Files
linux-bredos/arch/x86/include/asm
Peter Zijlstra 08beb0d436 x86: Fix CPUIDLE_FLAG_IRQ_ENABLE leaking timer reprogram
[ Upstream commit edc8fc01f6 ]

intel_idle_irq() re-enables IRQs very early. As a result, an interrupt
may fire before mwait() is eventually called. If such an interrupt queues
a timer, it may go unnoticed until mwait returns and the idle loop
handles the tick re-evaluation. And monitoring TIF_NEED_RESCHED doesn't
help because a local timer enqueue doesn't set that flag.

The issue is mitigated by the fact that this idle handler is only invoked
for shallow C-states when, presumably, the next tick is supposed to be
close enough. There may still be rare cases though when the next tick
is far away and the selected C-state is shallow, resulting in a timer
getting ignored for a while.

Fix this with using sti_mwait() whose IRQ-reenablement only triggers
upon calling mwait(), dealing with the race while keeping the interrupt
latency within acceptable bounds.

Fixes: c227233ad6 (intel_idle: enable interrupts before C1 on Xeons)
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Rafael J. Wysocki <rafael@kernel.org>
Link: https://lkml.kernel.org/r/20231115151325.6262-3-frederic@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-01-25 15:35:12 -08:00
..
2023-08-09 12:00:55 -07:00
2022-09-26 10:13:16 -07:00
2023-06-05 09:36:39 +02:00
2023-06-05 09:36:39 +02:00
2023-05-09 12:53:16 +02:00
2023-05-15 20:03:08 +02:00
2022-10-17 16:41:15 +02:00
2022-10-03 14:03:26 -07:00
2023-09-18 19:30:08 +02:00
2022-11-10 13:12:45 +01:00
2023-06-01 15:04:33 +02:00
2023-06-05 09:36:39 +02:00
2023-09-29 17:20:46 -07:00
2023-08-02 15:01:51 -07:00
2023-07-10 09:52:25 +02:00
2023-06-06 18:25:57 +02:00
2023-08-17 17:07:09 +02:00