diff options
author | Nicholas Piggin <npiggin@gmail.com> | 2022-10-22 15:22:07 +1000 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2022-10-27 00:38:35 +1100 |
commit | 65722736c3baf29e02e964a09e85c9ef71c48e8d (patch) | |
tree | e558adef19bc3f753ee8f38e75280db0b4c29606 /lib/test_hexdump.c | |
parent | dc398a084d459f065658855454e09f2778f8c5cc (diff) | |
download | linux-stable-65722736c3baf29e02e964a09e85c9ef71c48e8d.tar.gz linux-stable-65722736c3baf29e02e964a09e85c9ef71c48e8d.tar.bz2 linux-stable-65722736c3baf29e02e964a09e85c9ef71c48e8d.zip |
powerpc/64s/interrupt: Fix clear of PACA_IRQS_HARD_DIS when returning to soft-masked context
Commit a4cb3651a1743 ("powerpc/64s/interrupt: Fix lost interrupts when
returning to soft-masked context") fixed the problem of pending irqs
being cleared when clearing the HARD_DIS bit, but then it didn't clear
the bit at all. This change clears HARD_DIS without affecting other bits
in the mask.
When an interrupt hits in a soft-masked section that has MSR[EE]=1, it
can hard disable and set PACA_IRQS_HARD_DIS, which must be cleared when
returning to the EE=1 caller (unless it was set due to a MUST_HARD_MASK
interrupt becoming pending). Failure to clear this leaves the
returned-to context running with MSR[EE]=1 and PACA_IRQS_HARD_DIS, which
confuses irq assertions and could be dangerous for code that might test
the flag.
This was observed in a hash MMU kernel where a kernel hash fault hits in
a local_irqs_disabled region that has EE=1. The hash fault also runs
with EE=1, then as it returns, a decrementer hits in the restart section
and the irq restart code hard-masks which sets the PACA_IRQ_HARD_DIS
flag, which is not clear when the original context is returned to.
Reported-by: Sachin Sant <sachinp@linux.ibm.com>
Fixes: a4cb3651a1743 ("powerpc/64s/interrupt: Fix lost interrupts when returning to soft-masked context")
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Tested-by: Sachin Sant <sachinp@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20221022052207.471328-1-npiggin@gmail.com
Diffstat (limited to 'lib/test_hexdump.c')
0 files changed, 0 insertions, 0 deletions