aboutsummaryrefslogtreecommitdiffstats
path: root/arch/riscv/mm/fault.c
diff options
context:
space:
mode:
authorGuo Ren <guoren@linux.alibaba.com>2020-12-17 16:01:41 +0000
committerPalmer Dabbelt <palmerdabbelt@google.com>2021-01-14 15:09:05 -0800
commitafc76b8b80112189b6f11e67e19cf58301944814 (patch)
tree034c48f5730615893aa5d89f8c8e2327e2cb8585 /arch/riscv/mm/fault.c
parentriscv: Fixup patch_text panic in ftrace (diff)
downloadlinux-dev-afc76b8b80112189b6f11e67e19cf58301944814.tar.xz
linux-dev-afc76b8b80112189b6f11e67e19cf58301944814.zip
riscv: Using PATCHABLE_FUNCTION_ENTRY instead of MCOUNT
This patch changes the current detour mechanism of dynamic ftrace which has been discussed during LPC 2020 RISCV-MC [1]. Before the patch, we used mcount for detour: <funca>: addi sp,sp,-16 sd ra,8(sp) sd s0,0(sp) addi s0,sp,16 mv a5,ra mv a0,a5 auipc ra,0x0 -> nop jalr -296(ra) <_mcount@plt> ->nop ... After the patch, we use nop call site area for detour: <funca>: nop -> REG_S ra, -SZREG(sp) nop -> auipc ra, 0x? nop -> jalr ?(ra) nop -> REG_L ra, -SZREG(sp) ... The mcount mechanism is mixed with gcc function prologue which is not very clear. The patchable function entry just put 16 bytes nop before the front of the function prologue which could be filled with a separated detour mechanism. [1] https://www.linuxplumbersconf.org/event/7/contributions/807/ Signed-off-by: Guo Ren <guoren@linux.alibaba.com> Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
Diffstat (limited to 'arch/riscv/mm/fault.c')
0 files changed, 0 insertions, 0 deletions