diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2010-07-05 08:31:29 +0100 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2010-07-05 08:31:29 +0100 |
commit | 52ff658b7e69e45f00679b7f1a29d25ab7ed7f8e (patch) | |
tree | 879b8c70575e6963c2778e10b23583664dcc1cc1 /xen/arch/x86/genapic | |
parent | 19fbbfffdc2e8ad2c20f577e2a3e9b46a8a9e1da (diff) | |
download | xen-52ff658b7e69e45f00679b7f1a29d25ab7ed7f8e.tar.gz xen-52ff658b7e69e45f00679b7f1a29d25ab7ed7f8e.tar.bz2 xen-52ff658b7e69e45f00679b7f1a29d25ab7ed7f8e.zip |
x2APIC: improve enabling logic
This patch masks PIC and IOAPIC RTE's before x2APIC enabling, unmask
and restore them after x2APIC enabling. It also really enables
interrupt remapping before x2APIC enabling instead of just checking
interrupt remapping setting. This patch also handles all x2APIC
configuration including BIOS settings and command line
settings. Especially, it handles that BIOS hands over in x2APIC mode
(when there is apic id > 255). It checks if x2APIC is already enabled
by BIOS. If already enabled, it will disable interrupt remapping and
queued invalidation first, then enable them again.
Signed-off-by: Weidong Han <weidong.han@intel.com>
Diffstat (limited to 'xen/arch/x86/genapic')
-rw-r--r-- | xen/arch/x86/genapic/x2apic.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/xen/arch/x86/genapic/x2apic.c b/xen/arch/x86/genapic/x2apic.c index 8c8d52ab01..ae61567f59 100644 --- a/xen/arch/x86/genapic/x2apic.c +++ b/xen/arch/x86/genapic/x2apic.c @@ -33,6 +33,11 @@ boolean_param("x2apic", x2apic); static int x2apic_phys; /* By default we use logical cluster mode. */ boolean_param("x2apic_phys", x2apic_phys); +int x2apic_cmdline_disable(void) +{ + return (x2apic == 0); +} + static int probe_x2apic_phys(void) { return x2apic && x2apic_phys && x2apic_is_available() && @@ -55,6 +60,20 @@ const struct genapic apic_x2apic_cluster = { GENAPIC_X2APIC_CLUSTER }; +const struct genapic *apic_x2apic_probe(void) +{ + if ( !x2apic || !x2apic_is_available() ) + return NULL; + + if ( !iommu_supports_eim() ) + return NULL; + + if ( x2apic_phys ) + return &apic_x2apic_phys; + else + return &apic_x2apic_cluster; +} + void init_apic_ldr_x2apic_phys(void) { return; |