Message ID | 20231023082911.23242-9-luxu.kernel@bytedance.com (mailing list archive) |
---|---|
State | RFC |
Headers | show |
Series | riscv: Introduce Pseudo NMI | expand |
diff --git a/arch/riscv/include/asm/irqflags.h b/arch/riscv/include/asm/irqflags.h index 9700a17a003a..42f7803582df 100644 --- a/arch/riscv/include/asm/irqflags.h +++ b/arch/riscv/include/asm/irqflags.h @@ -54,13 +54,13 @@ static inline void arch_local_irq_enable(void) /* unconditionally disable interrupts */ static inline void arch_local_irq_disable(void) { - csr_clear(CSR_IE, irqs_enabled_ie); + csr_clear(CSR_IE, ~ALLOWED_NMI_MASK); } /* get status and disable interrupts */ static inline unsigned long arch_local_irq_save(void) { - return csr_read_clear(CSR_IE, irqs_enabled_ie); + return csr_read_clear(CSR_IE, ~ALLOWED_NMI_MASK); } /* test flags */
This commit allows NMIs to happen even when irqs are disabled. When disabling irqs, we mask all normal irqs via clearing corresponding bits in CSR_IE while leaving NMI bits alone. Signed-off-by: Xu Lu <luxu.kernel@bytedance.com> --- arch/riscv/include/asm/irqflags.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)