WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] x86: restore x2apic pre-enabled check log

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] x86: restore x2apic pre-enabled check logic
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 17 Jan 2011 07:59:35 -0800
Delivery-date: Mon, 17 Jan 2011 08:20:28 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir@xxxxxxx>
# Date 1294746050 0
# Node ID 2ff199e2842b7e4f08ea99558afc32536a77280c
# Parent  ca10302ac2859b43a41afe425d79ae0df29f2a9c
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@xxxxxxxxxx>
---
 xen/arch/x86/apic.c           |    9 ---------
 xen/arch/x86/genapic/probe.c  |    6 ++++--
 xen/arch/x86/genapic/x2apic.c |   19 +++++++++++++++++++
 xen/include/asm-x86/apic.h    |    1 +
 4 files changed, 24 insertions(+), 11 deletions(-)

diff -r ca10302ac285 -r 2ff199e2842b xen/arch/x86/apic.c
--- a/xen/arch/x86/apic.c       Tue Jan 11 11:27:37 2011 +0000
+++ b/xen/arch/x86/apic.c       Tue Jan 11 11:40:50 2011 +0000
@@ -957,18 +957,9 @@ void __init x2apic_bsp_setup(void)
 void __init x2apic_bsp_setup(void)
 {
     struct IO_APIC_route_entry **ioapic_entries = NULL;
-    uint64_t msr_content;
 
     if ( !cpu_has_x2apic )
         return;
-
-    /* Check whether x2apic mode was already enabled by the BIOS. */
-    rdmsrl(MSR_IA32_APICBASE, msr_content);
-    if ( msr_content & MSR_IA32_APICBASE_EXTD )
-    {
-        printk("x2APIC mode is already enabled by BIOS.\n");
-        x2apic_enabled = 1;
-    }
 
     if ( !opt_x2apic )
     {
diff -r ca10302ac285 -r 2ff199e2842b xen/arch/x86/genapic/probe.c
--- a/xen/arch/x86/genapic/probe.c      Tue Jan 11 11:27:37 2011 +0000
+++ b/xen/arch/x86/genapic/probe.c      Tue Jan 11 11:40:50 2011 +0000
@@ -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 -r ca10302ac285 -r 2ff199e2842b xen/arch/x86/genapic/x2apic.c
--- a/xen/arch/x86/genapic/x2apic.c     Tue Jan 11 11:27:37 2011 +0000
+++ b/xen/arch/x86/genapic/x2apic.c     Tue Jan 11 11:40:50 2011 +0000
@@ -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
 {
     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();
+    }
+}
diff -r ca10302ac285 -r 2ff199e2842b xen/include/asm-x86/apic.h
--- a/xen/include/asm-x86/apic.h        Tue Jan 11 11:27:37 2011 +0000
+++ b/xen/include/asm-x86/apic.h        Tue Jan 11 11:40:50 2011 +0000
@@ -25,6 +25,7 @@ extern bool_t x2apic_enabled;
 extern bool_t x2apic_enabled;
 extern bool_t directed_eoi_enabled;
 
+void check_x2apic_preenabled(void);
 void x2apic_bsp_setup(void);
 void x2apic_ap_setup(void);
 const struct genapic *apic_x2apic_probe(void);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] x86: restore x2apic pre-enabled check logic, Xen patchbot-unstable <=