aboutsummaryrefslogtreecommitdiff
path: root/arch/s390/kernel/kprobes.c
diff options
context:
space:
mode:
authorGravatar Heiko Carstens <hca@linux.ibm.com> 2023-09-11 21:40:02 +0200
committerGravatar Vasily Gorbik <gor@linux.ibm.com> 2023-09-19 13:26:56 +0200
commit4b440e01da51da0cc651c06a036b8914b7b61ccf (patch)
tree1561e8c910fc4e383a1b10242e6f1c8c03ee5736 /arch/s390/kernel/kprobes.c
parents390/ctlreg: change parameters of __local_ctl_load() and __local_ctl_store() (diff)
downloadlinux-4b440e01da51da0cc651c06a036b8914b7b61ccf.tar.gz
linux-4b440e01da51da0cc651c06a036b8914b7b61ccf.tar.bz2
linux-4b440e01da51da0cc651c06a036b8914b7b61ccf.zip
s390/kprobes,ptrace: open code struct per_reg
Open code struct per_regs within kprobes and ptrace code, since at both locations a struct per_regs is passed to __local_ctl_load() and __local_ctl_store() which prevents to implement type checking for both functions. 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/kprobes.c')
-rw-r--r--arch/s390/kernel/kprobes.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/arch/s390/kernel/kprobes.c b/arch/s390/kernel/kprobes.c
index ef556b93596d..d4c2ece4f839 100644
--- a/arch/s390/kernel/kprobes.c
+++ b/arch/s390/kernel/kprobes.c
@@ -224,7 +224,14 @@ static void enable_singlestep(struct kprobe_ctlblk *kcb,
struct pt_regs *regs,
unsigned long ip)
{
- struct per_regs per_kprobe;
+ union {
+ unsigned long regs[3];
+ struct {
+ unsigned long control;
+ unsigned long start;
+ unsigned long end;
+ };
+ } per_kprobe;
/* Set up the PER control registers %cr9-%cr11 */
per_kprobe.control = PER_EVENT_IFETCH;
@@ -237,7 +244,7 @@ static void enable_singlestep(struct kprobe_ctlblk *kcb,
(PSW_MASK_PER | PSW_MASK_IO | PSW_MASK_EXT);
/* Set PER control regs, turns on single step for the given address */
- __local_ctl_load(9, 11, per_kprobe);
+ __local_ctl_load(9, 11, per_kprobe.regs);
regs->psw.mask |= PSW_MASK_PER;
regs->psw.mask &= ~(PSW_MASK_IO | PSW_MASK_EXT);
regs->psw.addr = ip;