summaryrefslogtreecommitdiff
path: root/arch/s390/mm/extable.c
diff options
context:
space:
mode:
authorHeiko Carstens <hca@linux.ibm.com>2022-11-02 17:18:45 +0300
committerHeiko Carstens <hca@linux.ibm.com>2022-11-21 15:36:15 +0300
commitf39a8c4a22ea104c368361b9ae0f550da161db2d (patch)
tree371973e6f3980432d3a12488aa3e09bc7b543a21 /arch/s390/mm/extable.c
parente388d66f032166c8e8c4efd9e6c6f43610378903 (diff)
downloadlinux-f39a8c4a22ea104c368361b9ae0f550da161db2d.tar.xz
s390/extable: add EX_TABLE_UA_LOAD_REGPAIR() macro
Add new exception table type which is able to handle register pairs. If an exception is recognized on such an instruction the specified register pair will be zeroed, and the specified error register will be modified so it contains -EFAULT, similar to the existing EX_TABLE_UA_LOAD_REG() macro. Link: https://lore.kernel.org/r/Y2J8RSW2khWLgpPo@osiris Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Diffstat (limited to 'arch/s390/mm/extable.c')
-rw-r--r--arch/s390/mm/extable.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/arch/s390/mm/extable.c b/arch/s390/mm/extable.c
index 1e4d2187541a..fe87291df95d 100644
--- a/arch/s390/mm/extable.c
+++ b/arch/s390/mm/extable.c
@@ -47,13 +47,16 @@ static bool ex_handler_ua_load_mem(const struct exception_table_entry *ex, struc
return true;
}
-static bool ex_handler_ua_load_reg(const struct exception_table_entry *ex, struct pt_regs *regs)
+static bool ex_handler_ua_load_reg(const struct exception_table_entry *ex,
+ bool pair, struct pt_regs *regs)
{
unsigned int reg_zero = FIELD_GET(EX_DATA_REG_ADDR, ex->data);
unsigned int reg_err = FIELD_GET(EX_DATA_REG_ERR, ex->data);
regs->gprs[reg_err] = -EFAULT;
regs->gprs[reg_zero] = 0;
+ if (pair)
+ regs->gprs[reg_zero + 1] = 0;
regs->psw.addr = extable_fixup(ex);
return true;
}
@@ -75,7 +78,9 @@ bool fixup_exception(struct pt_regs *regs)
case EX_TYPE_UA_LOAD_MEM:
return ex_handler_ua_load_mem(ex, regs);
case EX_TYPE_UA_LOAD_REG:
- return ex_handler_ua_load_reg(ex, regs);
+ return ex_handler_ua_load_reg(ex, false, regs);
+ case EX_TYPE_UA_LOAD_REGPAIR:
+ return ex_handler_ua_load_reg(ex, true, regs);
}
panic("invalid exception table entry");
}