All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/boot: Remove stack segment parameter from smpboot.
@ 2013-08-15 18:00 Andrew Cooper
  2013-08-16  9:30 ` Jan Beulich
  2013-08-16  9:45 ` Jan Beulich
  0 siblings, 2 replies; 3+ messages in thread
From: Andrew Cooper @ 2013-08-15 18:00 UTC (permalink / raw)
  To: Xen-devel; +Cc: Andrew Cooper, Keir Fraser, Jan Beulich

The stack segment is legacy remnant of a 32bit hypervisor, and not used in
64bit.  Furthermore, the unsigned short in the structure actually aliases
whatever the linker decides to put next in the data section.

Drop the extern struct definition and change it to a simple void pointer,
which matches its definition in arch/x86/boot/x86_64.S

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
CC: Keir Fraser <keir@xen.org>
CC: Jan Beulich <JBeulich@suse.com>
---
 xen/arch/x86/smpboot.c |    9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c
index 3df4e88..9f81c7b 100644
--- a/xen/arch/x86/smpboot.c
+++ b/xen/arch/x86/smpboot.c
@@ -393,10 +393,7 @@ void start_secondary(void *unused)
     startup_cpu_idle_loop();
 }
 
-extern struct {
-    void * esp;
-    unsigned short ss;
-} stack_start;
+extern void *stack_start;
 
 static int wakeup_secondary_cpu(int phys_apicid, unsigned long start_eip)
 {
@@ -555,7 +552,7 @@ static int do_boot_cpu(int apicid, int cpu)
         printk("Booting processor %d/%d eip %lx\n",
                cpu, apicid, start_eip);
 
-    stack_start.esp = stack_base[cpu];
+    stack_start = stack_base[cpu];
 
     /* This grunge runs the startup process for the targeted processor. */
 
@@ -734,7 +731,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
     boot_cpu_physical_apicid = get_apic_id();
     x86_cpu_to_apicid[0] = boot_cpu_physical_apicid;
 
-    stack_base[0] = stack_start.esp;
+    stack_base[0] = stack_start;
 
     if ( !zalloc_cpumask_var(&per_cpu(cpu_sibling_mask, 0)) ||
          !zalloc_cpumask_var(&per_cpu(cpu_core_mask, 0)) )
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] x86/boot: Remove stack segment parameter from smpboot.
  2013-08-15 18:00 [PATCH] x86/boot: Remove stack segment parameter from smpboot Andrew Cooper
@ 2013-08-16  9:30 ` Jan Beulich
  2013-08-16  9:45 ` Jan Beulich
  1 sibling, 0 replies; 3+ messages in thread
From: Jan Beulich @ 2013-08-16  9:30 UTC (permalink / raw)
  To: Andrew Cooper; +Cc: xen-devel, Keir Fraser

>>> On 15.08.13 at 20:00, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
> The stack segment is legacy remnant of a 32bit hypervisor, and not used in
> 64bit.  Furthermore, the unsigned short in the structure actually aliases
> whatever the linker decides to put next in the data section.

And, fwiw, the 32-bit code didn't use the ss field either.

Jan

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] x86/boot: Remove stack segment parameter from smpboot.
  2013-08-15 18:00 [PATCH] x86/boot: Remove stack segment parameter from smpboot Andrew Cooper
  2013-08-16  9:30 ` Jan Beulich
@ 2013-08-16  9:45 ` Jan Beulich
  1 sibling, 0 replies; 3+ messages in thread
From: Jan Beulich @ 2013-08-16  9:45 UTC (permalink / raw)
  To: Andrew Cooper; +Cc: xen-devel, Keir Fraser

>>> On 15.08.13 at 20:00, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
> The stack segment is legacy remnant of a 32bit hypervisor, and not used in
> 64bit.  Furthermore, the unsigned short in the structure actually aliases
> whatever the linker decides to put next in the data section.
> 
> Drop the extern struct definition and change it to a simple void pointer,
> which matches its definition in arch/x86/boot/x86_64.S

I'll commit this, but I think we could go further and eliminate
stack_start altogether - the boot code can load %rsp from
stack_base[] quite fine I would think.

Jan

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-08-16  9:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-15 18:00 [PATCH] x86/boot: Remove stack segment parameter from smpboot Andrew Cooper
2013-08-16  9:30 ` Jan Beulich
2013-08-16  9:45 ` Jan Beulich

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.