[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220826095112.289-3-thunder.leizhen@huawei.com>
Date: Fri, 26 Aug 2022 17:51:12 +0800
From: Zhen Lei <thunder.leizhen@...wei.com>
To: Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Russell King <linux@...linux.org.uk>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-kernel@...r.kernel.org>, <patches@...linux.org.uk>
CC: Zhen Lei <thunder.leizhen@...wei.com>
Subject: [PATCH v2 2/2] ARM: replace this_cpu_* with raw_cpu_* in panic_bad_stack()
The hardware automatically disable the IRQ interrupt before jumping to the
interrupt or exception vector. Therefore, the preempt_disable() operation
in this_cpu_read() after macro expansion is unnecessary for exception
handler. Use raw_cpu_* instead of this_cpu_* can reduce a few lines of
assembly code. To be honest, the fewer unnecessary operations in exception
handler, the better.
Signed-off-by: Zhen Lei <thunder.leizhen@...wei.com>
---
KernelVersion: v6.0-rc2
arch/arm/kernel/traps.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
index 1518a1f443ff866..d5903d790cf3b7e 100644
--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
@@ -927,9 +927,9 @@ asmlinkage void handle_bad_stack(struct pt_regs *regs)
{
unsigned long tsk_stk = (unsigned long)current->stack;
#ifdef CONFIG_IRQSTACKS
- unsigned long irq_stk = (unsigned long)this_cpu_read(irq_stack_ptr);
+ unsigned long irq_stk = (unsigned long)raw_cpu_read(irq_stack_ptr);
#endif
- unsigned long ovf_stk = (unsigned long)this_cpu_read(overflow_stack_ptr);
+ unsigned long ovf_stk = (unsigned long)raw_cpu_read(overflow_stack_ptr);
console_verbose();
pr_emerg("Insufficient stack space to handle exception!");
--
2.25.1
Powered by blists - more mailing lists