diff options
| author | Manfred Spraul <manfred@colorfullife.com> | 2002-12-22 02:59:07 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.transmeta.com> | 2002-12-22 02:59:07 -0800 |
| commit | dd0f2bdff18ce10b7d4d634be46f57c875e5accd (patch) | |
| tree | ea372d94f231b324a64d41d7ee1f0b52158629d9 | |
| parent | 576d92d62e719887a9108f75378700ffaddd34ea (diff) | |
[PATCH] Avoid overwriting boot_cpu_data from trampoline code
boot_cpu_data should contain the common capabilities of all cpus in the
system. identify_cpu [arch/i386/kernel/cpu/common.c] tries to enforce
that. But right now, the SMP trampoline code [arch/i386/kernel/head.S]
overwrites boot_cpu_data when the secondary cpus are started, i.e.
boot_cpu_data contains the capabilities from the last cpu that booted :-(
The attached patch adds a new, __initdata variable for the asm code.
| -rw-r--r-- | arch/i386/kernel/head.S | 4 | ||||
| -rw-r--r-- | arch/i386/kernel/setup.c | 4 | ||||
| -rw-r--r-- | include/asm-i386/processor.h | 1 |
3 files changed, 7 insertions, 2 deletions
diff --git a/arch/i386/kernel/head.S b/arch/i386/kernel/head.S index 46bf230f16d9..31986482b0de 100644 --- a/arch/i386/kernel/head.S +++ b/arch/i386/kernel/head.S @@ -23,10 +23,10 @@ #define NEW_CL_POINTER 0x228 /* Relative to real mode data */ /* - * References to members of the boot_cpu_data structure. + * References to members of the new_cpu_data structure. */ -#define CPU_PARAMS boot_cpu_data +#define CPU_PARAMS new_cpu_data #define X86 CPU_PARAMS+0 #define X86_VENDOR CPU_PARAMS+1 #define X86_MODEL CPU_PARAMS+2 diff --git a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c index 3d2fc4e69c7b..73d4dbcfc60e 100644 --- a/arch/i386/kernel/setup.c +++ b/arch/i386/kernel/setup.c @@ -50,6 +50,9 @@ static inline char * __init machine_specific_memory_setup(void); */ char ignore_irq13; /* set if exception 16 works */ +/* cpu data as detected by the assembly code in head.S */ +struct cpuinfo_x86 new_cpu_data __initdata = { 0, 0, 0, 0, -1, 1, 0, 0, -1 }; +/* common cpu data for all cpus */ struct cpuinfo_x86 boot_cpu_data = { 0, 0, 0, 0, -1, 1, 0, 0, -1 }; unsigned long mmu_cr4_features; @@ -840,6 +843,7 @@ void __init setup_arch(char **cmdline_p) { unsigned long max_low_pfn; + memcpy(&boot_cpu_data, &new_cpu_data, sizeof(new_cpu_data)); pre_setup_arch_hook(); early_cpu_init(); diff --git a/include/asm-i386/processor.h b/include/asm-i386/processor.h index ac467d123706..bf944abdf821 100644 --- a/include/asm-i386/processor.h +++ b/include/asm-i386/processor.h @@ -78,6 +78,7 @@ struct cpuinfo_x86 { */ extern struct cpuinfo_x86 boot_cpu_data; +extern struct cpuinfo_x86 new_cpu_data; extern struct tss_struct init_tss[NR_CPUS]; #ifdef CONFIG_SMP |
