When cpu hotplug is enabled, the x86 feature "up" is always shown
for CPU 0 in /proc/cpuinfo. Update CPU 0 when updating
boot_cpu_data so they stay in sync. Also, get some definitions
from header files.
Signed-off-by: Chuck Ebbert <[email protected]>
--- 2.6.16-rc1-mm4-386.orig/arch/i386/kernel/alternative.c
+++ 2.6.16-rc1-mm4-386/arch/i386/kernel/alternative.c
@@ -2,6 +2,7 @@
#include <linux/spinlock.h>
#include <linux/list.h>
#include <asm/alternative.h>
+#include <asm/sections.h>
#define DEBUG 0
#if DEBUG
@@ -71,7 +72,6 @@ extern struct alt_instr __alt_instructio
extern struct alt_instr __smp_alt_instructions[], __smp_alt_instructions_end[];
extern u8 *__smp_locks[], *__smp_locks_end[];
-extern u8 _text[], _etext[];
extern u8 __smp_alt_begin[], __smp_alt_end[];
@@ -264,6 +264,7 @@ void alternatives_smp_switch(int smp)
if (smp) {
printk(KERN_INFO "SMP alternatives: switching to SMP code\n");
clear_bit(X86_FEATURE_UP, boot_cpu_data.x86_capability);
+ clear_bit(X86_FEATURE_UP, cpu_data[0].x86_capability);
alternatives_smp_apply(__smp_alt_instructions,
__smp_alt_instructions_end);
list_for_each_entry(mod, &smp_alt_modules, next)
@@ -272,6 +273,7 @@ void alternatives_smp_switch(int smp)
} else {
printk(KERN_INFO "SMP alternatives: switching to UP code\n");
set_bit(X86_FEATURE_UP, boot_cpu_data.x86_capability);
+ set_bit(X86_FEATURE_UP, cpu_data[0].x86_capability);
apply_alternatives(__smp_alt_instructions,
__smp_alt_instructions_end);
list_for_each_entry(mod, &smp_alt_modules, next)
@@ -301,6 +303,7 @@ void __init alternative_instructions(voi
if (1 == num_possible_cpus()) {
printk(KERN_INFO "SMP alternatives: switching to UP code\n");
set_bit(X86_FEATURE_UP, boot_cpu_data.x86_capability);
+ set_bit(X86_FEATURE_UP, cpu_data[0].x86_capability);
apply_alternatives(__smp_alt_instructions,
__smp_alt_instructions_end);
alternatives_smp_unlock(__smp_locks, __smp_locks_end,
--
Chuck
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]