s390: Initialize psw mask in perf_arch_fetch_caller_regs()
authorHeiko Carstens <hca@linux.ibm.com>
Thu, 10 Oct 2024 15:52:39 +0000 (17:52 +0200)
committerHeiko Carstens <hca@linux.ibm.com>
Wed, 16 Oct 2024 09:32:32 +0000 (11:32 +0200)
Also initialize regs->psw.mask in perf_arch_fetch_caller_regs().
This way user_mode(regs) will return false, like it should.

It looks like all current users initialize regs to zero, so that this
doesn't fix a bug currently. However it is better to not rely on callers
to do this.

Fixes: 914d52e46490 ("s390: implement perf_arch_fetch_caller_regs")
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
arch/s390/include/asm/perf_event.h

index 66200d4..29ee289 100644 (file)
@@ -49,6 +49,7 @@ struct perf_sf_sde_regs {
 };
 
 #define perf_arch_fetch_caller_regs(regs, __ip) do {                   \
+       (regs)->psw.mask = 0;                                           \
        (regs)->psw.addr = (__ip);                                      \
        (regs)->gprs[15] = (unsigned long)__builtin_frame_address(0) -  \
                offsetof(struct stack_frame, back_chain);               \