aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/kernel/alternative.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c
index 2763cb37b553..7ead11f3732d 100644
--- a/arch/x86/kernel/alternative.c
+++ b/arch/x86/kernel/alternative.c
@@ -241,25 +241,25 @@ static void alternatives_smp_lock(u8 **start, u8 **end, u8 *text, u8 *text_end)
241 continue; 241 continue;
242 if (*ptr > text_end) 242 if (*ptr > text_end)
243 continue; 243 continue;
244 text_poke(*ptr, ((unsigned char []){0xf0}), 1); /* add lock prefix */ 244 /* turn DS segment override prefix into lock prefix */
245 text_poke(*ptr, ((unsigned char []){0xf0}), 1);
245 }; 246 };
246} 247}
247 248
248static void alternatives_smp_unlock(u8 **start, u8 **end, u8 *text, u8 *text_end) 249static void alternatives_smp_unlock(u8 **start, u8 **end, u8 *text, u8 *text_end)
249{ 250{
250 u8 **ptr; 251 u8 **ptr;
251 char insn[1];
252 252
253 if (noreplace_smp) 253 if (noreplace_smp)
254 return; 254 return;
255 255
256 add_nops(insn, 1);
257 for (ptr = start; ptr < end; ptr++) { 256 for (ptr = start; ptr < end; ptr++) {
258 if (*ptr < text) 257 if (*ptr < text)
259 continue; 258 continue;
260 if (*ptr > text_end) 259 if (*ptr > text_end)
261 continue; 260 continue;
262 text_poke(*ptr, insn, 1); 261 /* turn lock prefix into DS segment override prefix */
262 text_poke(*ptr, ((unsigned char []){0x3E}), 1);
263 }; 263 };
264} 264}
265 265