diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2009-09-07 08:46:46 +0100 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2009-09-07 08:46:46 +0100 |
commit | b8fae2f7774ee716e2aa6eda67624fc61ab31bce (patch) | |
tree | 6ff77dff87e2cd10b3cae847b1c58725cb25bb38 /xen/arch/x86/apic.c | |
parent | 5c53154b6190af523ec097dbb76c41685052dddd (diff) | |
download | xen-b8fae2f7774ee716e2aa6eda67624fc61ab31bce.tar.gz xen-b8fae2f7774ee716e2aa6eda67624fc61ab31bce.tar.bz2 xen-b8fae2f7774ee716e2aa6eda67624fc61ab31bce.zip |
Add the support of x2apic logical cluster mode.
Add a xen boolean parameter 'x2apic'.
Add a xen boolean parameter 'x2apic_phys'(by default, we use logical
cluster mode).
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
Diffstat (limited to 'xen/arch/x86/apic.c')
-rw-r--r-- | xen/arch/x86/apic.c | 35 |
1 files changed, 25 insertions, 10 deletions
diff --git a/xen/arch/x86/apic.c b/xen/arch/x86/apic.c index 47d614269e..ba6b0dbb3d 100644 --- a/xen/arch/x86/apic.c +++ b/xen/arch/x86/apic.c @@ -848,8 +848,31 @@ void enable_x2apic(void) { u32 lo, hi; - if ( !iommu_supports_eim() ) - return; + if ( smp_processor_id() == 0 ) + { + if ( !iommu_supports_eim() ) + { + printk("x2APIC would not be enabled without EIM.\n"); + return; + } + + if ( apic_x2apic_phys.probe() ) + genapic = &apic_x2apic_phys; + else if ( apic_x2apic_cluster.probe() ) + genapic = &apic_x2apic_cluster; + else + { + printk("x2APIC would not be enabled due to x2apic=off.\n"); + return; + } + + x2apic_enabled = 1; + printk("Switched to APIC driver %s.\n", genapic->name); + } + else + { + BUG_ON(!x2apic_enabled); /* APs only enable x2apic when BSP did so. */ + } rdmsr(MSR_IA32_APICBASE, lo, hi); if ( !(lo & MSR_IA32_APICBASE_EXTD) ) @@ -860,14 +883,6 @@ void enable_x2apic(void) } else printk("x2APIC mode enabled by BIOS.\n"); - - if ( !x2apic_enabled ) - { - x2apic_enabled = 1; - genapic = &apic_x2apic; - printk(KERN_INFO "Switched to APIC driver %s.\n", - genapic->name); - } } void __init init_apic_mappings(void) |