summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorHeiko Carstens <hca@linux.ibm.com>2024-10-10 17:52:39 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-11-08 16:21:58 +0100
commit5c345c47e88497ed5887bd921bb2a74f38cbae59 (patch)
tree99c38eaefaf9fee8cbd489e309d035d0f254b574 /arch
parent6af43ec3bf40f8b428d9134ffa7a291aecd60da8 (diff)
downloadlinux-5c345c47e88497ed5887bd921bb2a74f38cbae59.tar.gz
linux-5c345c47e88497ed5887bd921bb2a74f38cbae59.tar.bz2
linux-5c345c47e88497ed5887bd921bb2a74f38cbae59.zip
s390: Initialize psw mask in perf_arch_fetch_caller_regs()
[ Upstream commit 223e7fb979fa06934f1595b6ad0ae1d4ead1147f ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/s390/include/asm/perf_event.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/s390/include/asm/perf_event.h b/arch/s390/include/asm/perf_event.h
index b9da71632827..ea340b901839 100644
--- a/arch/s390/include/asm/perf_event.h
+++ b/arch/s390/include/asm/perf_event.h
@@ -75,6 +75,7 @@ struct perf_sf_sde_regs {
#define SAMPLE_FREQ_MODE(hwc) (SAMPL_FLAGS(hwc) & PERF_CPUM_SF_FREQ_MODE)
#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); \