x86 SMP alternatives: update X86_FEATURE_UP on cpu0
PATCH 1/1 x86 SMP alternatives: update X86_FEATURE_UP on cpu0
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]>
arch/i386/kernel/alternative.c +4 -1
@@ -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_instructioextern 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(voiif (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,
Signature · 1 line
Chuck