Skip to content

Commit b3a0c01

Browse files
mrutland-armwilldeacon
authored andcommitted
arm64: allow kprobes on EL0 handlers
Currently do_sysinstr() and do_cp15instr() are marked with NOKPROBE_SYMBOL(). However, these are only called for exceptions taken from EL0, and there is no risk of recursion in kprobes, so this is not necessary. Remove the NOKPROBE_SYMBOL() annotation, and rename the two functions to more clearly indicate that these are solely for exceptions taken from EL0, better matching the names used by the lower level entry points in entry-common.c. Signed-off-by: Mark Rutland <[email protected]> Cc: Catalin Marinas <[email protected]> Cc: James Morse <[email protected]> Cc: Joey Gouly <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Will Deacon <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
1 parent f0c4d9f commit b3a0c01

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

arch/arm64/include/asm/exception.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ void do_fpsimd_acc(unsigned long esr, struct pt_regs *regs);
6767
void do_sve_acc(unsigned long esr, struct pt_regs *regs);
6868
void do_sme_acc(unsigned long esr, struct pt_regs *regs);
6969
void do_fpsimd_exc(unsigned long esr, struct pt_regs *regs);
70-
void do_sysinstr(unsigned long esr, struct pt_regs *regs);
70+
void do_el0_sys(unsigned long esr, struct pt_regs *regs);
7171
void do_sp_pc_abort(unsigned long addr, unsigned long esr, struct pt_regs *regs);
7272
void bad_el0_sync(struct pt_regs *regs, int reason, unsigned long esr);
73-
void do_cp15instr(unsigned long esr, struct pt_regs *regs);
73+
void do_el0_cp15(unsigned long esr, struct pt_regs *regs);
7474
int do_compat_alignment_fixup(unsigned long addr, struct pt_regs *regs);
7575
void do_el0_svc(struct pt_regs *regs);
7676
void do_el0_svc_compat(struct pt_regs *regs);

arch/arm64/kernel/entry-common.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ static void noinstr el0_sys(struct pt_regs *regs, unsigned long esr)
570570
{
571571
enter_from_user_mode(regs);
572572
local_daif_restore(DAIF_PROCCTX);
573-
do_sysinstr(esr, regs);
573+
do_el0_sys(esr, regs);
574574
exit_to_user_mode(regs);
575575
}
576576

@@ -762,7 +762,7 @@ static void noinstr el0_cp15(struct pt_regs *regs, unsigned long esr)
762762
{
763763
enter_from_user_mode(regs);
764764
local_daif_restore(DAIF_PROCCTX);
765-
do_cp15instr(esr, regs);
765+
do_el0_cp15(esr, regs);
766766
exit_to_user_mode(regs);
767767
}
768768

arch/arm64/kernel/traps.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -748,7 +748,7 @@ static const struct sys64_hook cp15_64_hooks[] = {
748748
{},
749749
};
750750

751-
void do_cp15instr(unsigned long esr, struct pt_regs *regs)
751+
void do_el0_cp15(unsigned long esr, struct pt_regs *regs)
752752
{
753753
const struct sys64_hook *hook, *hook_base;
754754

@@ -786,10 +786,9 @@ void do_cp15instr(unsigned long esr, struct pt_regs *regs)
786786
*/
787787
do_undefinstr(regs, esr);
788788
}
789-
NOKPROBE_SYMBOL(do_cp15instr);
790789
#endif
791790

792-
void do_sysinstr(unsigned long esr, struct pt_regs *regs)
791+
void do_el0_sys(unsigned long esr, struct pt_regs *regs)
793792
{
794793
const struct sys64_hook *hook;
795794

@@ -806,7 +805,6 @@ void do_sysinstr(unsigned long esr, struct pt_regs *regs)
806805
*/
807806
do_undefinstr(regs, esr);
808807
}
809-
NOKPROBE_SYMBOL(do_sysinstr);
810808

811809
static const char *esr_class_str[] = {
812810
[0 ... ESR_ELx_EC_MAX] = "UNRECOGNIZED EC",

0 commit comments

Comments
 (0)