hc
2024-11-01 2f529f9b558ca1c1bd74be7437a84e4711743404
kernel/arch/x86/kernel/alternative.c
....@@ -8,6 +8,7 @@
88 #include <linux/list.h>
99 #include <linux/stringify.h>
1010 #include <linux/highmem.h>
11
+#include <linux/irq_pipeline.h>
1112 #include <linux/mm.h>
1213 #include <linux/vmalloc.h>
1314 #include <linux/memory.h>
....@@ -366,9 +367,9 @@
366367 if (nnops <= 1)
367368 return nnops;
368369
369
- local_irq_save(flags);
370
+ flags = hard_local_irq_save();
370371 add_nops(instr + off, nnops);
371
- local_irq_restore(flags);
372
+ hard_local_irq_restore(flags);
372373
373374 DUMP_BYTES(instr, instrlen, "%px: [%d:%d) optimized NOPs: ", instr, off, i);
374375
....@@ -1065,9 +1066,9 @@
10651066 */
10661067 memcpy(addr, opcode, len);
10671068 } else {
1068
- local_irq_save(flags);
1069
+ flags = hard_local_irq_save();
10691070 memcpy(addr, opcode, len);
1070
- local_irq_restore(flags);
1071
+ hard_local_irq_restore(flags);
10711072 sync_core();
10721073
10731074 /*
....@@ -1099,6 +1100,7 @@
10991100 temp_mm_state_t temp_state;
11001101
11011102 lockdep_assert_irqs_disabled();
1103
+ WARN_ON_ONCE(irq_pipeline_debug() && !hard_irqs_disabled());
11021104
11031105 /*
11041106 * Make sure not to be in TLB lazy mode, as otherwise we'll end up
....@@ -1192,7 +1194,7 @@
11921194 */
11931195 VM_BUG_ON(!ptep);
11941196
1195
- local_irq_save(flags);
1197
+ local_irq_save_full(flags);
11961198
11971199 pte = mk_pte(pages[0], pgprot);
11981200 set_pte_at(poking_mm, poking_addr, ptep, pte);
....@@ -1243,7 +1245,7 @@
12431245 */
12441246 BUG_ON(memcmp(addr, opcode, len));
12451247
1246
- local_irq_restore(flags);
1248
+ local_irq_restore_full(flags);
12471249 pte_unmap_unlock(ptep, ptl);
12481250 return addr;
12491251 }