xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@novell.com>
To: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Cc: Yinghai Lu <yinghai@kernel.org>
Subject: [PATCH 4/5] x86: adjust x2apic section placement
Date: Wed, 15 Dec 2010 11:20:05 +0000	[thread overview]
Message-ID: <4D08B2750200007800028191@vpn.id2.novell.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 2227 bytes --]

Signed-off-by: Jan Beulich <jbeulich@novell.com>

--- a/xen/arch/x86/apic.c
+++ b/xen/arch/x86/apic.c
@@ -953,18 +953,17 @@ no_apic:
     return -1;
 }
 
-void x2apic_setup(void)
+void x2apic_ap_setup(void)
+{
+    if ( x2apic_enabled )
+        __enable_x2apic();
+}
+
+void __init x2apic_bsp_setup(void)
 {
     struct IO_APIC_route_entry **ioapic_entries = NULL;
     uint64_t msr_content;
 
-    if ( smp_processor_id() != 0 )
-    {
-        if ( x2apic_enabled )
-            __enable_x2apic();
-        return;
-    }
-
     if ( !cpu_has_x2apic )
         return;
 
--- a/xen/arch/x86/genapic/x2apic.c
+++ b/xen/arch/x86/genapic/x2apic.c
@@ -27,7 +27,7 @@
 #include <xen/smp.h>
 #include <asm/mach-default/mach_mpparse.h>
 
-static int x2apic_phys; /* By default we use logical cluster mode. */
+static int __initdata x2apic_phys; /* By default we use logical cluster mode. */
 boolean_param("x2apic_phys", x2apic_phys);
 
 static void init_apic_ldr_x2apic_phys(void)
@@ -134,7 +134,7 @@ static const struct genapic apic_x2apic_
     .send_IPI_self = send_IPI_self_x2apic
 };
 
-const struct genapic *apic_x2apic_probe(void)
+const struct genapic *__init apic_x2apic_probe(void)
 {
     return x2apic_phys ? &apic_x2apic_phys : &apic_x2apic_cluster;
 }
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -1190,7 +1190,7 @@ void __init __start_xen(unsigned long mb
 
     init_cpu_to_node();
 
-    x2apic_setup();
+    x2apic_bsp_setup();
 
     init_IRQ();
 
--- a/xen/arch/x86/smpboot.c
+++ b/xen/arch/x86/smpboot.c
@@ -195,7 +195,7 @@ void smp_callin(void)
      * update until we finish. We are free to set up this CPU: first the APIC.
      */
     Dprintk("CALLIN, before setup_local_APIC().\n");
-    x2apic_setup();
+    x2apic_ap_setup();
     setup_local_APIC();
     map_cpu_to_logical_apicid();
 
--- a/xen/include/asm-x86/apic.h
+++ b/xen/include/asm-x86/apic.h
@@ -25,7 +25,8 @@ extern int apic_verbosity;
 extern int x2apic_enabled;
 extern int directed_eoi_enabled;
 
-void x2apic_setup(void);
+void x2apic_bsp_setup(void);
+void x2apic_ap_setup(void);
 const struct genapic *apic_x2apic_probe(void);
 
 /*




[-- Attachment #2: x86-x2apic-sections.patch --]
[-- Type: text/plain, Size: 2221 bytes --]

Signed-off-by: Jan Beulich <jbeulich@novell.com>

--- a/xen/arch/x86/apic.c
+++ b/xen/arch/x86/apic.c
@@ -953,18 +953,17 @@ no_apic:
     return -1;
 }
 
-void x2apic_setup(void)
+void x2apic_ap_setup(void)
+{
+    if ( x2apic_enabled )
+        __enable_x2apic();
+}
+
+void __init x2apic_bsp_setup(void)
 {
     struct IO_APIC_route_entry **ioapic_entries = NULL;
     uint64_t msr_content;
 
-    if ( smp_processor_id() != 0 )
-    {
-        if ( x2apic_enabled )
-            __enable_x2apic();
-        return;
-    }
-
     if ( !cpu_has_x2apic )
         return;
 
--- a/xen/arch/x86/genapic/x2apic.c
+++ b/xen/arch/x86/genapic/x2apic.c
@@ -27,7 +27,7 @@
 #include <xen/smp.h>
 #include <asm/mach-default/mach_mpparse.h>
 
-static int x2apic_phys; /* By default we use logical cluster mode. */
+static int __initdata x2apic_phys; /* By default we use logical cluster mode. */
 boolean_param("x2apic_phys", x2apic_phys);
 
 static void init_apic_ldr_x2apic_phys(void)
@@ -134,7 +134,7 @@ static const struct genapic apic_x2apic_
     .send_IPI_self = send_IPI_self_x2apic
 };
 
-const struct genapic *apic_x2apic_probe(void)
+const struct genapic *__init apic_x2apic_probe(void)
 {
     return x2apic_phys ? &apic_x2apic_phys : &apic_x2apic_cluster;
 }
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -1190,7 +1190,7 @@ void __init __start_xen(unsigned long mb
 
     init_cpu_to_node();
 
-    x2apic_setup();
+    x2apic_bsp_setup();
 
     init_IRQ();
 
--- a/xen/arch/x86/smpboot.c
+++ b/xen/arch/x86/smpboot.c
@@ -195,7 +195,7 @@ void smp_callin(void)
      * update until we finish. We are free to set up this CPU: first the APIC.
      */
     Dprintk("CALLIN, before setup_local_APIC().\n");
-    x2apic_setup();
+    x2apic_ap_setup();
     setup_local_APIC();
     map_cpu_to_logical_apicid();
 
--- a/xen/include/asm-x86/apic.h
+++ b/xen/include/asm-x86/apic.h
@@ -25,7 +25,8 @@ extern int apic_verbosity;
 extern int x2apic_enabled;
 extern int directed_eoi_enabled;
 
-void x2apic_setup(void);
+void x2apic_bsp_setup(void);
+void x2apic_ap_setup(void);
 const struct genapic *apic_x2apic_probe(void);
 
 /*

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

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

                 reply	other threads:[~2010-12-15 11:20 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D08B2750200007800028191@vpn.id2.novell.com \
    --to=jbeulich@novell.com \
    --cc=xen-devel@lists.xensource.com \
    --cc=yinghai@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).