summaryrefslogtreecommitdiffstats
path: root/arch/s390/kernel/early.c
diff options
context:
space:
mode:
authorHeiko Carstens <hca@linux.ibm.com>2022-02-28 13:31:33 +0100
committerVasily Gorbik <gor@linux.ibm.com>2022-03-08 00:33:00 +0100
commitcfa45c5e0d36b87f99e76f1060526eac032dd624 (patch)
treeccbe4f026e3163c949a3db5bdabfa57cd68fc1e7 /arch/s390/kernel/early.c
parent0741ec112ca67ea95dc8158a7bc7547ae36cbecc (diff)
downloadlinux-cfa45c5e0d36b87f99e76f1060526eac032dd624.tar.gz
linux-cfa45c5e0d36b87f99e76f1060526eac032dd624.tar.bz2
linux-cfa45c5e0d36b87f99e76f1060526eac032dd624.zip
s390/base: pass pt_regs to early program check handler
Pass pt_regs to early program check handler like it is done for every other interrupt and exception handler. Also the passed pt_regs can be changed by the called function and the changes register contents and psw contents will be taken into account when returning. In addition the return psw will not be copied to the program check old psw in lowcore, but to the usual return psw location, like it is also done by the regular program check handler. This allows also to get rid of the code that disabled lowcore protection when changing the return address. Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Diffstat (limited to 'arch/s390/kernel/early.c')
-rw-r--r--arch/s390/kernel/early.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/arch/s390/kernel/early.c b/arch/s390/kernel/early.c
index 9d151808d03e..5715d1aab173 100644
--- a/arch/s390/kernel/early.c
+++ b/arch/s390/kernel/early.c
@@ -149,22 +149,14 @@ static __init void setup_topology(void)
topology_max_mnest = max_mnest;
}
-static void early_pgm_check_handler(void)
+static void early_pgm_check_handler(struct pt_regs *regs)
{
const struct exception_table_entry *fixup;
- unsigned long cr0, cr0_new;
- unsigned long addr;
- addr = S390_lowcore.program_old_psw.addr;
- fixup = s390_search_extables(addr);
+ fixup = s390_search_extables(regs->psw.addr);
if (!fixup)
disabled_wait();
- /* Disable low address protection before storing into lowcore. */
- __ctl_store(cr0, 0, 0);
- cr0_new = cr0 & ~(1UL << 28);
- __ctl_load(cr0_new, 0, 0);
- S390_lowcore.program_old_psw.addr = extable_fixup(fixup);
- __ctl_load(cr0, 0, 0);
+ regs->psw.addr = extable_fixup(fixup);
}
static noinline __init void setup_lowcore_early(void)