Commit f7cea6fe authored by Jinjie Ruan's avatar Jinjie Ruan
Browse files

irqchip/gic-v3: Fix a system stall when using pseudo NMI with CONFIG_ARM64_NMI closed

hulk inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I9CHAE



--------------------------------

A system stall occurrs when using pseudo NMI with CONFIG_ARM64_NMI closed.
If the hardware supports FEAT_NMI, the ALLINT bit in pstate may set or
clear on exception trap whether the software enables it or not, so it is
not safe to use it to check interrupts_enabled() or
fast_interrupts_enabled() when FEAT_NMI not enabled in kernel, so
recover it.

After applying this patch, the system stall not happen again on hardware
with FEAT_NMI feature.

Fixes: eefea615 ("irqchip/gic-v3: Fix hard LOCKUP caused by NMI being masked")
Signed-off-by: default avatarJinjie Ruan <ruanjinjie@huawei.com>
parent c8e916a3
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -244,11 +244,10 @@ static inline void forget_syscall(struct pt_regs *regs)
		true)

#define interrupts_enabled(regs)			\
	(!((regs)->pstate & PSR_ALLINT_BIT) && !((regs)->pstate & PSR_I_BIT) && \
	 irqs_priority_unmasked(regs))
	(!((regs)->pstate & PSR_I_BIT) && irqs_priority_unmasked(regs))

#define fast_interrupts_enabled(regs) \
	(!((regs)->pstate & PSR_ALLINT_BIT) && !(regs)->pstate & PSR_F_BIT)
	(!(regs)->pstate & PSR_F_BIT)

static inline unsigned long user_stack_pointer(struct pt_regs *regs)
{
+0 −1
Original line number Diff line number Diff line
@@ -48,7 +48,6 @@
#define PSR_D_BIT	0x00000200
#define PSR_BTYPE_MASK	0x00000c00
#define PSR_SSBS_BIT	0x00001000
#define PSR_ALLINT_BIT	0x00002000
#define PSR_PAN_BIT	0x00400000
#define PSR_UAO_BIT	0x00800000
#define PSR_DIT_BIT	0x01000000