]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
riscv: Fix fp alignment bug in perf_callchain_user()
authorJinjie Ruan <ruanjinjie@huawei.com>
Mon, 8 Jul 2024 03:28:46 +0000 (11:28 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 4 Oct 2024 14:33:12 +0000 (16:33 +0200)
commit09210bb3a0f4b6d599c494017a38774b563bac4d
tree1749485d8492637a7a2dd4dc36be7dd133d72f0a
parent09eee130151d6fae8ca39611ae608a83d1a17ae5
riscv: Fix fp alignment bug in perf_callchain_user()

[ Upstream commit 22ab08955ea13be04a8efd20cc30890e0afaa49c ]

The standard RISC-V calling convention said:
"The stack grows downward and the stack pointer is always
kept 16-byte aligned".

So perf_callchain_user() should check whether 16-byte aligned for fp.

Link: https://riscv.org/wp-content/uploads/2015/01/riscv-calling.pdf
Fixes: dbeb90b0c1eb ("riscv: Add perf callchain support")
Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
Cc: Björn Töpel <bjorn@kernel.org>
Link: https://lore.kernel.org/r/20240708032847.2998158-2-ruanjinjie@huawei.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/riscv/kernel/perf_callchain.c