Skip to content

Commit 600e960

Browse files
committed
x86/irq: Ensure initial PIR loads are performed exactly once
Ensure the PIR is read exactly once at the start of handle_pending_pir(), to guarantee that checking for an outstanding posted interrupt in a given chuck doesn't reload the chunk from the "real" PIR. Functionally, a reload is benign, but it would defeat the purpose of pre-loading into a copy. Fixes: 1b03d82 ("x86/irq: Install posted MSI notification handler") Reviewed-by: Thomas Gleixner <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sean Christopherson <[email protected]>
1 parent 45eb291 commit 600e960

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/x86/kernel/irq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ static __always_inline bool handle_pending_pir(u64 *pir, struct pt_regs *regs)
419419
bool handled = false;
420420

421421
for (i = 0; i < 4; i++)
422-
pir_copy[i] = pir[i];
422+
pir_copy[i] = READ_ONCE(pir[i]);
423423

424424
for (i = 0; i < 4; i++) {
425425
if (!pir_copy[i])

0 commit comments

Comments
 (0)