[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20231023082911.23242-9-luxu.kernel@bytedance.com>
Date: Mon, 23 Oct 2023 16:29:07 +0800
From: Xu Lu <luxu.kernel@...edance.com>
To: paul.walmsley@...ive.com, palmer@...belt.com,
aou@...s.berkeley.edu, tglx@...utronix.de, maz@...nel.org,
anup@...infault.org, atishp@...shpatra.org
Cc: dengliang.1214@...edance.com, liyu.yukiteru@...edance.com,
sunjiadong.lff@...edance.com, xieyongji@...edance.com,
lihangjing@...edance.com, chaiwen.cc@...edance.com,
linux-kernel@...r.kernel.org, linux-riscv@...ts.infradead.org,
Xu Lu <luxu.kernel@...edance.com>
Subject: [RFC 08/12] riscv: Enable NMIs during irqs disabled context
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@...edance.com>
---
arch/riscv/include/asm/irqflags.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
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 */
--
2.20.1
Powered by blists - more mailing lists