diff options
author | Heiko Carstens <hca@linux.ibm.com> | 2022-02-22 15:27:52 +0100 |
---|---|---|
committer | Vasily Gorbik <gor@linux.ibm.com> | 2022-03-01 21:05:10 +0100 |
commit | 1a5e3f262e0310365cf7b5c8b8fc3a6e94a19cb7 (patch) | |
tree | 7023b51614451c946ece67c1c64d4276a1403ce7 /arch/s390/kernel | |
parent | s390/ptrace: remove opencoded offsetof (diff) | |
download | linux-1a5e3f262e0310365cf7b5c8b8fc3a6e94a19cb7.tar.xz linux-1a5e3f262e0310365cf7b5c8b8fc3a6e94a19cb7.zip |
s390/ftrace: make use of epsw to get psw mask
Finally use epsw to create a complete psw mask within pt_regs. Without
this only some bits are correct, while other bits are (incorrectly)
always zero.
The epsw instruction is quite heavy weight, however given that this
only effects ftrace_regs_caller this seems to be the right thing, so
we finally get a complete psw mask for ftrace kprobed functions.
Reviewed-by: Sven Schnelle <svens@linux.ibm.com>
Acked-by: Ilya Leoshkevich <iii@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')
-rw-r--r-- | arch/s390/kernel/mcount.S | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/arch/s390/kernel/mcount.S b/arch/s390/kernel/mcount.S index b88205224f3c..6ace43d7e8d2 100644 --- a/arch/s390/kernel/mcount.S +++ b/arch/s390/kernel/mcount.S @@ -33,9 +33,16 @@ ENDPROC(ftrace_stub) stg %r14,(__SF_GPRS+8*8)(%r15) # save traced function caller .if \allregs == 1 - lghi %r14,0 # save condition code - ipm %r14 # don't put any instructions - sllg %r14,%r14,16 # clobbering CC before this point + # save psw mask + # don't put any instructions clobbering CC before this point +#ifdef CONFIG_HAVE_MARCH_Z10_FEATURES + epsw %r1,%r14 + risbg %r14,%r1,0,31,32 +#else + epsw %r14,%r1 + sllg %r14,%r14,32 + lr %r14,%r1 +#endif .endif lgr %r1,%r15 @@ -51,7 +58,6 @@ ENDPROC(ftrace_stub) .if \allregs == 1 stg %r14,(STACK_PTREGS_PSW)(%r15) - stosm (STACK_PTREGS_PSW)(%r15),0 #ifdef CONFIG_HAVE_MARCH_Z10_FEATURES mvghi STACK_PTREGS_FLAGS(%r15),_PIF_FTRACE_FULL_REGS #else |