hc
2024-11-01 2f529f9b558ca1c1bd74be7437a84e4711743404
kernel/arch/x86/kernel/process.c
....@@ -598,9 +598,9 @@
598598 unsigned long flags;
599599
600600 /* Forced update. Make sure all relevant TIF flags are different */
601
- local_irq_save(flags);
601
+ flags = hard_local_irq_save();
602602 __speculation_ctrl_update(~tif, tif);
603
- local_irq_restore(flags);
603
+ hard_local_irq_restore(flags);
604604 }
605605
606606 /* Called from seccomp/prctl update */
....@@ -700,6 +700,9 @@
700700
701701 /*
702702 * We use this if we don't have any better idle routine..
703
+ *
704
+ * IRQ pipeline: safe_halt() returns with hard irqs on, caller does
705
+ * not need to force enable.
703706 */
704707 void __cpuidle default_idle(void)
705708 {
....@@ -722,7 +725,7 @@
722725
723726 void stop_this_cpu(void *dummy)
724727 {
725
- local_irq_disable();
728
+ hard_local_irq_disable();
726729 /*
727730 * Remove this CPU:
728731 */
....@@ -822,11 +825,14 @@
822825 }
823826
824827 __monitor((void *)&current_thread_info()->flags, 0, 0);
825
- if (!need_resched())
828
+ if (!need_resched()) {
826829 __sti_mwait(0, 0);
827
- else
830
+ } else {
831
+ hard_cond_local_irq_enable();
828832 raw_local_irq_enable();
833
+ }
829834 } else {
835
+ hard_cond_local_irq_enable();
830836 raw_local_irq_enable();
831837 }
832838 __current_clr_polling();