OSDN Git Service

s390/entry: avoid setting up backchain in ext|io handlers
authorVasily Gorbik <gor@linux.ibm.com>
Thu, 8 Apr 2021 22:13:18 +0000 (00:13 +0200)
committerHeiko Carstens <hca@linux.ibm.com>
Mon, 12 Apr 2021 10:44:30 +0000 (12:44 +0200)
commitb74e409ea1b18128b877a50883d92a12eba83c33
treeee47a55df598dc0d64c4455dc811a0083a09ce59
parentad31a8c05196a3dc5283b193e9c74a72022d3c65
s390/entry: avoid setting up backchain in ext|io handlers

Currently when interrupt arrives to cpu while in kernel context
INT_HANDLER macro (used for ext_int_handler and io_int_handler)
allocates new stack frame and pt_regs on the kernel stack and
sets up the backchain to jump over the pt_regs to the frame which has
been interrupted. This is not ideal to two reasons:

1. This hides the fact that kernel stack contains interrupt frame in it
   and hence breaks arch_stack_walk_reliable(), which needs to know that to
   guarantee "reliability" and checks that there are no pt_regs on the way.

2. It breaks the backchain unwinder logic, which assumes that the next
   stack frame after an interrupt frame is reliable, while it is not.
   In some cases (when r14 contains garbage) this leads to early unwinding
   termination with an error, instead of marking frame as unreliable
   and continuing.

To address that, only set backchain to 0.

Fixes: 56e62a737028 ("s390: convert to generic entry")
Reviewed-by: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
arch/s390/kernel/entry.S