]> git.baikalelectronics.ru Git - kernel.git/commit
s390: fix handling of runtime instrumentation psw bit
authorHeiko Carstens <heiko.carstens@de.ibm.com>
Wed, 16 Oct 2013 07:58:01 +0000 (09:58 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Thu, 24 Oct 2013 15:17:11 +0000 (17:17 +0200)
commite61e43c843e289fdf6f4d26af218a05cc82d4fd7
tree3b4cd4dd3540cbd9c9852293801b84c9b25146f8
parentcd8adab6499559c0d6d1f38e80c7226b101ae491
s390: fix handling of runtime instrumentation psw bit

Fix the following bugs:
- When returning from a signal the signal handler copies the saved psw mask
  from user space and uses parts of it. Especially it restores the RI bit
  unconditionally. If however the machine doesn't support RI, or RI is
  disabled for the task, the last lpswe instruction which returns to user
  space will generate a specification exception.
  To fix this check if the RI bit is allowed to be set and kill the task
  if not.
- In the compat mode signal handler code the RI bit of the psw mask gets
  propagated to the mask of the return psw: if user space enables RI in the
  signal handler, RI will also be enabled after the signal handler is
  finished.
  This is a different behaviour than with 64 bit tasks. So change this to
  match the 64 bit semantics, which restores the original RI bit value.
- Fix similar oddities within the ptrace code as well.

Reviewed-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/include/asm/compat.h
arch/s390/include/asm/processor.h
arch/s390/include/uapi/asm/ptrace.h
arch/s390/kernel/compat_signal.c
arch/s390/kernel/ptrace.c
arch/s390/kernel/signal.c