From 92652cf986441b18282db6e5bd82afc74e8ed5e9 Mon Sep 17 00:00:00 2001 From: Kees Cook Date: Sat, 19 Feb 2022 17:26:00 -0800 Subject: xtensa: Implement "current_stack_pointer" To follow the existing per-arch conventions replace open-coded uses of asm "sp" as "current_stack_pointer". This will let it be used in non-arch places (like HARDENED_USERCOPY). Cc: Chris Zankel Cc: Marc Zyngier Cc: linux-xtensa@linux-xtensa.org Signed-off-by: Kees Cook Acked-by: Max Filippov Link: https://lore.kernel.org/lkml/CAMo8BfJFJE-n3=AF+pb9_6oF3gzxX7a+7aBrASHjjNX5byqDqw@mail.gmail.com --- arch/xtensa/kernel/irq.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'arch/xtensa/kernel/irq.c') diff --git a/arch/xtensa/kernel/irq.c b/arch/xtensa/kernel/irq.c index 15051a8a1539..529fe9245821 100644 --- a/arch/xtensa/kernel/irq.c +++ b/arch/xtensa/kernel/irq.c @@ -36,9 +36,8 @@ asmlinkage void do_IRQ(int hwirq, struct pt_regs *regs) #ifdef CONFIG_DEBUG_STACKOVERFLOW /* Debugging check for stack overflow: is there less than 1KB free? */ { - unsigned long sp; + unsigned long sp = current_stack_pointer; - __asm__ __volatile__ ("mov %0, a1\n" : "=a" (sp)); sp &= THREAD_SIZE - 1; if (unlikely(sp < (sizeof(thread_info) + 1024))) -- cgit v1.2.3