powerpc/64s/exception: Avoid touching the stack in hdecrementer
authorNicholas Piggin <npiggin@gmail.com>
Tue, 25 Feb 2020 17:35:25 +0000 (03:35 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 1 Apr 2020 02:42:12 +0000 (13:42 +1100)
commit2babd6ea43edacfc1577432baa187a7d212f3f4f
tree3c1e7f7df92915c79139b66761f6385883074d22
parent9d598f934470dc455dac01f0dcbebecf1604606f
powerpc/64s/exception: Avoid touching the stack in hdecrementer

The hdec interrupt handler is reported to sometimes fire in Linux if
KVM leaves it pending after a guest exists. This is harmless, so there
is a no-op handler for it.

The interrupt handler currently uses the regular kernel stack. Change
this to avoid touching the stack entirely.

This should be the last place where the regular Linux stack can be
accessed with asynchronous interrupts (including PMI) soft-masked.
It might be possible to take advantage of this invariant, e.g., to
context switch the kernel stack SLB entry without clearing MSR[EE].

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20200225173541.1549955-17-npiggin@gmail.com
arch/powerpc/include/asm/time.h
arch/powerpc/kernel/exceptions-64s.S
arch/powerpc/kernel/time.c