Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powerpc/irq: Use current_stack_pointer in do_IRQ()

Until commit 7306e83ccf5c ("powerpc: Don't use CURRENT_THREAD_INFO to
find the stack"), the current stack base address was obtained by
calling current_thread_info(). That inline function was simply masking
out the value of r1.

In that commit, it was changed to using current_stack_pointer() (since
renamed current_stack_frame()), which is a heavier function as it is
an outline assembly function which cannot be inlined and which reads
the content of the stack at 0(r1).

Convert to using current_stack_pointer for geting r1 and masking out
its value to obtain the base address of the stack pointer as before.

Fixes: 7306e83ccf5c ("powerpc: Don't use CURRENT_THREAD_INFO to find the stack")
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20200220115141.2707-5-mpe@ellerman.id.au

authored by

Christophe Leroy and committed by
Michael Ellerman
532d43a7 0dec6e1c

+1 -1
+1 -1
arch/powerpc/kernel/irq.c
··· 648 648 void *cursp, *irqsp, *sirqsp; 649 649 650 650 /* Switch to the irq stack to handle this */ 651 - cursp = (void *)(current_stack_frame() & ~(THREAD_SIZE - 1)); 651 + cursp = (void *)(current_stack_pointer & ~(THREAD_SIZE - 1)); 652 652 irqsp = hardirq_ctx[raw_smp_processor_id()]; 653 653 sirqsp = softirq_ctx[raw_smp_processor_id()]; 654 654