diff options
Diffstat (limited to 'arch/x86/kernel/alternative.c')
| -rw-r--r-- | arch/x86/kernel/alternative.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c index 65a0c1b48696..a84ac7b570e6 100644 --- a/arch/x86/kernel/alternative.c +++ b/arch/x86/kernel/alternative.c | |||
| @@ -231,25 +231,25 @@ static void alternatives_smp_lock(u8 **start, u8 **end, u8 *text, u8 *text_end) | |||
| 231 | continue; | 231 | continue; |
| 232 | if (*ptr > text_end) | 232 | if (*ptr > text_end) |
| 233 | continue; | 233 | continue; |
| 234 | text_poke(*ptr, ((unsigned char []){0xf0}), 1); /* add lock prefix */ | 234 | /* turn DS segment override prefix into lock prefix */ |
| 235 | text_poke(*ptr, ((unsigned char []){0xf0}), 1); | ||
| 235 | }; | 236 | }; |
| 236 | } | 237 | } |
| 237 | 238 | ||
| 238 | static void alternatives_smp_unlock(u8 **start, u8 **end, u8 *text, u8 *text_end) | 239 | static void alternatives_smp_unlock(u8 **start, u8 **end, u8 *text, u8 *text_end) |
| 239 | { | 240 | { |
| 240 | u8 **ptr; | 241 | u8 **ptr; |
| 241 | char insn[1]; | ||
| 242 | 242 | ||
| 243 | if (noreplace_smp) | 243 | if (noreplace_smp) |
| 244 | return; | 244 | return; |
| 245 | 245 | ||
| 246 | add_nops(insn, 1); | ||
| 247 | for (ptr = start; ptr < end; ptr++) { | 246 | for (ptr = start; ptr < end; ptr++) { |
| 248 | if (*ptr < text) | 247 | if (*ptr < text) |
| 249 | continue; | 248 | continue; |
| 250 | if (*ptr > text_end) | 249 | if (*ptr > text_end) |
| 251 | continue; | 250 | continue; |
| 252 | text_poke(*ptr, insn, 1); | 251 | /* turn lock prefix into DS segment override prefix */ |
| 252 | text_poke(*ptr, ((unsigned char []){0x3E}), 1); | ||
| 253 | }; | 253 | }; |
| 254 | } | 254 | } |
| 255 | 255 | ||
| @@ -444,7 +444,7 @@ void __init alternative_instructions(void) | |||
| 444 | _text, _etext); | 444 | _text, _etext); |
| 445 | 445 | ||
| 446 | /* Only switch to UP mode if we don't immediately boot others */ | 446 | /* Only switch to UP mode if we don't immediately boot others */ |
| 447 | if (num_possible_cpus() == 1 || setup_max_cpus <= 1) | 447 | if (num_present_cpus() == 1 || setup_max_cpus <= 1) |
| 448 | alternatives_smp_switch(0); | 448 | alternatives_smp_switch(0); |
| 449 | } | 449 | } |
| 450 | #endif | 450 | #endif |
