aboutsummaryrefslogtreecommitdiffstats
path: root/xen/arch/x86/genapic
diff options
context:
space:
mode:
authorKeir Fraser <keir@xen.org>2011-01-11 11:40:50 +0000
committerKeir Fraser <keir@xen.org>2011-01-11 11:40:50 +0000
commitdb0fe41a146e1e8170fdbe1360a99fe5758f40e2 (patch)
tree0939f1312e478362d8f8eb319aecece06e1ed746 /xen/arch/x86/genapic
parent0c138347400b9be2b811f025109c17a9c9397376 (diff)
downloadxen-db0fe41a146e1e8170fdbe1360a99fe5758f40e2.tar.gz
xen-db0fe41a146e1e8170fdbe1360a99fe5758f40e2.tar.bz2
xen-db0fe41a146e1e8170fdbe1360a99fe5758f40e2.zip
x86: restore x2apic pre-enabled check logic
c/s 22475 removed the early checking without replacement, neglecting the fact that x2apic_enabled must be set early for APIC register accesses done during second stage ACPI table parsing (rooted at acpi_boot_init()) to work correctly. Without this, particularly determination of the boot CPU won't work, resulting in an attempt to bring up that CPU again as a secondary one (which fails). Restore the functionality, now calling it from generic_apic_probe(). Signed-off-by: Jan Beulich <jbeulich@novell.com>
Diffstat (limited to 'xen/arch/x86/genapic')
-rw-r--r--xen/arch/x86/genapic/probe.c6
-rw-r--r--xen/arch/x86/genapic/x2apic.c19
2 files changed, 23 insertions, 2 deletions
diff --git a/xen/arch/x86/genapic/probe.c b/xen/arch/x86/genapic/probe.c
index 7768d36d71..20e72922db 100644
--- a/xen/arch/x86/genapic/probe.c
+++ b/xen/arch/x86/genapic/probe.c
@@ -59,8 +59,10 @@ custom_param("apic", genapic_apic_force);
void __init generic_apic_probe(void)
{
- int i;
- int changed = cmdline_apic = (genapic != NULL);
+ int i, changed;
+
+ check_x2apic_preenabled();
+ cmdline_apic = changed = (genapic != NULL);
for (i = 0; !changed && apic_probe[i]; i++) {
if (apic_probe[i]->probe()) {
diff --git a/xen/arch/x86/genapic/x2apic.c b/xen/arch/x86/genapic/x2apic.c
index 98afc66b1b..7cf8989947 100644
--- a/xen/arch/x86/genapic/x2apic.c
+++ b/xen/arch/x86/genapic/x2apic.c
@@ -24,6 +24,8 @@
#include <asm/genapic.h>
#include <asm/apic.h>
#include <asm/io_apic.h>
+#include <asm/msr.h>
+#include <asm/processor.h>
#include <xen/smp.h>
#include <asm/mach-default/mach_mpparse.h>
@@ -123,3 +125,20 @@ const struct genapic *__init apic_x2apic_probe(void)
{
return x2apic_phys ? &apic_x2apic_phys : &apic_x2apic_cluster;
}
+
+void __init check_x2apic_preenabled(void)
+{
+ u32 lo, hi;
+
+ if ( !cpu_has_x2apic )
+ return;
+
+ /* Check whether x2apic mode was already enabled by the BIOS. */
+ rdmsr(MSR_IA32_APICBASE, lo, hi);
+ if ( lo & MSR_IA32_APICBASE_EXTD )
+ {
+ printk("x2APIC mode is already enabled by BIOS.\n");
+ x2apic_enabled = 1;
+ genapic = apic_x2apic_probe();
+ }
+}