i386: introduce voyager smp_ops, fix voyager build
PATCH 1/1 i386: introduce voyager smp_ops, fix voyager build
This adds an smp_ops for voyager, and hooks things up appropriately. This is the first baby-step to making subarch runtime switchable.
--- arch/i386/kernel/Makefile | 1 arch/i386/kernel/smp.c | 65 ++------------------------- arch/i386/kernel/smpboot.c | 19 -------- arch/i386/kernel/smpcommon.c | 79 ++++++++++++++++++++++++++++++++++ arch/i386/mach-voyager/voyager_smp.c | 71 ++++++++++++++++++------------ include/asm-i386/processor.h | 1 6 files changed, 129 insertions(+), 107 deletions(-)
===================================================================
arch/i386/kernel/Makefile +1 -0
@@ -20,6 +20,7 @@ obj-$(CONFIG_MICROCODE) += microcode.o obj-$(CONFIG_MICROCODE) += microcode.o obj-$(CONFIG_APM) += apm.o obj-$(CONFIG_X86_SMP) += smp.o smpboot.o tsc_sync.o +obj-$(CONFIG_SMP) += smpcommon.o obj-$(CONFIG_X86_TRAMPOLINE) += trampoline.o obj-$(CONFIG_X86_MPPARSE) += mpparse.o obj-$(CONFIG_X86_LOCAL_APIC) += apic.o nmi.o
===================================================================
arch/i386/kernel/smp.c +6 -59
89 lines not on this page · raw message
===================================================================
arch/i386/kernel/smpboot.c +0 -19
@@ -99,9 +99,6 @@ EXPORT_SYMBOL(x86_cpu_to_apicid);u8 apicid_2_node[MAX_APICID ]; -DEFINE_PER_CPU(unsigned long, this_cpu_off); -EXPORT_PER_CPU_SYMBOL (this_cpu_off); -/* * Trampoline 80x86 program as an array. */
@@ -766,22 +763,6 @@ static inline struct task_struct * alloc#define alloc_idle_task (cpu) fork_idle(cpu)#endif -/* Initialize the CPU's GDT. This is either the boot CPU doing itself -(still using the master per-cpu area), or a CPU doing it for a -secondary which will soon come up. */ -static __cpuinit void init_gdt (int cpu) -{ -struct desc_struct *gdt =get_cpu_gdt_table (cpu); - -pack_descriptor ((u32 *)&gdt[GDT_ENTRY_PERCPU ].a, - (u32 *)&gdt[GDT_ENTRY_PERCPU ].b, - __per_cpu_offset[cpu],0xFFFFF , -0x80 |DESCTYPE_S |0x2 ,0x8 ); - -per_cpu (this_cpu_off, cpu) = __per_cpu_offset[cpu]; -per_cpu (cpu_number, cpu) = cpu; -} -/* Defined in head.S */ extern struct Xgt_desc_struct early_gdt_descr;
===================================================================
arch/i386/kernel/smpcommon.c new file +79 -0
79 lines not on this page · raw message
===================================================================
arch/i386/mach-voyager/voyager_smp.c +42 -29
177 lines not on this page · raw message
===================================================================
include/asm-i386/processor.h +1 -0
@@ -752,6 +752,7 @@ extern void cpu_set_gdt(int);extern void cpu_set_gdt (int );extern void switch_to_new_gdt (void );extern void cpu_init (void ); +extern void init_gdt (int cpu);extern int force_mwait;
Quoted 2 lines · On Saturday 28 April 2007 19:22:45 Jeremy Fitzhardinge wrote:
This adds an
smp_opsfor voyager, and hooks things up appropriately. This is the first baby-step to making subarch runtime switchable.
James, does it actually work?
-Andi
Quoted 5 lines · Andi Kleen
Quoted 2 lines · On Saturday 28 April 2007 19:22:45 Jeremy Fitzhardinge wrote:
This adds an
smp_opsfor voyager, and hooks things up appropriately. This is the first baby-step to making subarch runtime switchable.James, does it actually work?
It will take me a while to tell you ... would you believe I'm currently bisecting for a voyager regression in 2.6.21 ...? ;-)
James
Quoted 2 lines · Jeremy Fitzhardinge
This adds an
smp_opsfor voyager, and hooks things up appropriately. This is the first baby-step to making subarch runtime switchable.
Unless I have missed something early_gdt_descr still needs to be updated.
Eric
Quoted 2 lines · Eric W. Biederman
Unless I have missed something
early_gdt_descrstill needs to be updated.
The patch is on top of Andi's current queue, which includes quite a few boot-time gdt setup cleanups. early_gdt_descr has gone.
J
Quoted 8 lines · Jeremy Fitzhardinge
Quoted 3 lines · Eric W. Biederman
Unless I have missed something
early_gdt_descrstill needs to be updated.The patch is on top of Andi's current queue, which includes quite a few boot-time gdt setup cleanups.
early_gdt_descrhas gone.
Hm, I was thinking of something else. Checking...
J
Quoted 2 lines · Jeremy Fitzhardinge
This adds an
smp_opsfor voyager, and hooks things up appropriately. This is the first baby-step to making subarch runtime switchable.
This sort of works, but there's something strange going on with it and andi's entire series. It now dies loading the SCSI modules in the error handling thread ... I assume we have some API conflict ... I'll investigate.
The other problem is it conflicts with an existing voyager patch:
But I've got that fixed up.
James