diff options
Diffstat (limited to 'arch/x86/kernel/alternative.c')
| -rw-r--r-- | arch/x86/kernel/alternative.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c index 65a0c1b48696..fb04e49776ba 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 | ||
