x86/voyager: fix compile breakage caused by dc1e35c6e95e8923cf1d3510438b63c600fee1e2
authorJames Bottomley <James.Bottomley@HansenPartnership.com>
Thu, 30 Oct 2008 21:00:59 +0000 (16:00 -0500)
committerIngo Molnar <mingo@elte.hu>
Thu, 30 Oct 2008 23:19:33 +0000 (00:19 +0100)
Impact: build fix on x86/Voyager

Given commits like this:

| Author: Suresh Siddha <suresh.b.siddha@intel.com>
| Date:   Tue Jul 29 10:29:19 2008 -0700
|
|     x86, xsave: enable xsave/xrstor on cpus with xsave support

Which deliberately expose boot cpu dependence to pieces of the system,
I think it's time to explicitly have a variable for it to prevent this
continual misassumption that the boot CPU is zero.

Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/x86/Kconfig
arch/x86/include/asm/smp.h
arch/x86/kernel/cpu/common.c

index 350bee1d54dc2ae41851f503d9ef7705a0e93e31..2a40c4c6dd7d9bee4d41e71a7782c529fbb879d4 100644 (file)
@@ -231,6 +231,10 @@ config SMP
 
          If you don't know what to do here, say N.
 
+config X86_HAS_BOOT_CPU_ID
+       def_bool y
+       depends on X86_VOYAGER
+
 config X86_FIND_SMP_CONFIG
        def_bool y
        depends on X86_MPPARSE || X86_VOYAGER
index 2766021aef80fc75453492ab611f683397e6aa16..d12811ce51d92fc8d4be51c24981329ba2591aec 100644 (file)
@@ -225,5 +225,11 @@ static inline int hard_smp_processor_id(void)
 
 #endif /* CONFIG_X86_LOCAL_APIC */
 
+#ifdef CONFIG_X86_HAS_BOOT_CPU_ID
+extern unsigned char boot_cpu_id;
+#else
+#define boot_cpu_id    0
+#endif
+
 #endif /* __ASSEMBLY__ */
 #endif /* _ASM_X86_SMP_H */
index 25581dcb280ea8d3a9c8840cd70fcc726e10b76f..93e9393ea64a4cbe8703742ac8699e8e122a73d3 100644 (file)
@@ -1134,7 +1134,7 @@ void __cpuinit cpu_init(void)
        /*
         * Boot processor to setup the FP and extended state context info.
         */
-       if (!smp_processor_id())
+       if (smp_processor_id() == boot_cpu_id)
                init_thread_xstate();
 
        xsave_init();