summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/gecko.py
diff options
context:
space:
mode:
authorNam Cao <namcaov@gmail.com>2023-08-29 11:36:15 +0300
committerPalmer Dabbelt <palmer@rivosinc.com>2023-11-06 01:12:28 +0300
commitb701f9e726f0a30a94ea6af596b74c1f07b95b6b (patch)
tree731d9ce1dc2aff4a2da59761e46d950cc7d62caf /tools/perf/scripts/python/gecko.py
parent3ce99bd6357d4789c138898d9a07916d0f3b7f29 (diff)
downloadlinux-b701f9e726f0a30a94ea6af596b74c1f07b95b6b.tar.xz
riscv: provide riscv-specific is_trap_insn()
uprobes expects is_trap_insn() to return true for any trap instructions, not just the one used for installing uprobe. The current default implementation only returns true for 16-bit c.ebreak if C extension is enabled. This can confuse uprobes if a 32-bit ebreak generates a trap exception from userspace: uprobes asks is_trap_insn() who says there is no trap, so uprobes assume a probe was there before but has been removed, and return to the trap instruction. This causes an infinite loop of entering and exiting trap handler. Instead of using the default implementation, implement this function speficially for riscv with checks for both ebreak and c.ebreak. Fixes: 74784081aac8 ("riscv: Add uprobes supported") Signed-off-by: Nam Cao <namcaov@gmail.com> Tested-by: Björn Töpel <bjorn@rivosinc.com> Reviewed-by: Guo Ren <guoren@kernel.org> Link: https://lore.kernel.org/r/20230829083614.117748-1-namcaov@gmail.com Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Diffstat (limited to 'tools/perf/scripts/python/gecko.py')
0 files changed, 0 insertions, 0 deletions