提交 77759137 编写于 作者: P Peter Oberparleiter 提交者: Martin Schwidefsky

s390/chsc: Add exception handler for CHSC instruction

Prevent kernel crashes due to unhandled exceptions raised by the CHSC
instruction which may for example be triggered by invalid ioctl data.

Fixes: 64150adf ("s390/cio: Introduce generic synchronous CHSC IOCTL")
Cc: <stable@vger.kernel.org> # v3.11+
Signed-off-by: NPeter Oberparleiter <oberpar@linux.vnet.ibm.com>
Reviewed-by: NSebastian Ott <sebott@linux.vnet.ibm.com>
Reviewed-by: NCornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
上级 f50c0e63
......@@ -165,13 +165,15 @@ int tpi(struct tpi_info *addr)
int chsc(void *chsc_area)
{
typedef struct { char _[4096]; } addr_type;
int cc;
int cc = -EIO;
asm volatile(
" .insn rre,0xb25f0000,%2,0\n"
" ipm %0\n"
"0: ipm %0\n"
" srl %0,28\n"
: "=d" (cc), "=m" (*(addr_type *) chsc_area)
"1:\n"
EX_TABLE(0b, 1b)
: "+d" (cc), "=m" (*(addr_type *) chsc_area)
: "d" (chsc_area), "m" (*(addr_type *) chsc_area)
: "cc");
trace_s390_cio_chsc(chsc_area, cc);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册