Skip to content

Commit e51c3e1

Browse files
chleroympe
authored andcommitted
powerpc/entry32: Blacklist exception exit points for kprobe.
kprobe does not handle events happening in real mode. The very last part of exception exits cannot support a trap. Blacklist them from kprobe. While we are at it, remove exc_exit_start symbol which is not used to avoid having to blacklist it. Signed-off-by: Christophe Leroy <[email protected]> Acked-by: Naveen N. Rao <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/098b0fd3f6299aa1bd692bd576bd7012c84608de.1585670437.git.christophe.leroy@c-s.fr
1 parent 7cdf440 commit e51c3e1

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

arch/powerpc/kernel/entry_32.S

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -806,6 +806,7 @@ fast_exception_return:
806806
lwz r11,GPR11(r11)
807807
SYNC
808808
RFI
809+
_ASM_NOKPROBE_SYMBOL(fast_exception_return)
809810

810811
#if !(defined(CONFIG_4xx) || defined(CONFIG_BOOKE))
811812
/* check if the exception happened in a restartable section */
@@ -1041,6 +1042,8 @@ exc_exit_restart:
10411042
exc_exit_restart_end:
10421043
SYNC
10431044
RFI
1045+
_ASM_NOKPROBE_SYMBOL(exc_exit_restart)
1046+
_ASM_NOKPROBE_SYMBOL(exc_exit_restart_end)
10441047

10451048
#else /* !(CONFIG_4xx || CONFIG_BOOKE) */
10461049
/*
@@ -1062,7 +1065,6 @@ exc_exit_restart_end:
10621065
exc_exit_restart:
10631066
lwz r11,_NIP(r1)
10641067
lwz r12,_MSR(r1)
1065-
exc_exit_start:
10661068
mtspr SPRN_SRR0,r11
10671069
mtspr SPRN_SRR1,r12
10681070
REST_2GPRS(11, r1)
@@ -1071,6 +1073,7 @@ exc_exit_start:
10711073
exc_exit_restart_end:
10721074
rfi
10731075
b . /* prevent prefetch past rfi */
1076+
_ASM_NOKPROBE_SYMBOL(exc_exit_restart)
10741077

10751078
/*
10761079
* Returning from a critical interrupt in user mode doesn't need
@@ -1182,6 +1185,7 @@ ret_from_crit_exc:
11821185
mtspr SPRN_SRR0,r9;
11831186
mtspr SPRN_SRR1,r10;
11841187
RET_FROM_EXC_LEVEL(SPRN_CSRR0, SPRN_CSRR1, PPC_RFCI)
1188+
_ASM_NOKPROBE_SYMBOL(ret_from_crit_exc)
11851189
#endif /* CONFIG_40x */
11861190

11871191
#ifdef CONFIG_BOOKE
@@ -1193,6 +1197,7 @@ ret_from_crit_exc:
11931197
RESTORE_xSRR(SRR0,SRR1);
11941198
RESTORE_MMU_REGS;
11951199
RET_FROM_EXC_LEVEL(SPRN_CSRR0, SPRN_CSRR1, PPC_RFCI)
1200+
_ASM_NOKPROBE_SYMBOL(ret_from_crit_exc)
11961201

11971202
.globl ret_from_debug_exc
11981203
ret_from_debug_exc:
@@ -1203,6 +1208,7 @@ ret_from_debug_exc:
12031208
RESTORE_xSRR(CSRR0,CSRR1);
12041209
RESTORE_MMU_REGS;
12051210
RET_FROM_EXC_LEVEL(SPRN_DSRR0, SPRN_DSRR1, PPC_RFDI)
1211+
_ASM_NOKPROBE_SYMBOL(ret_from_debug_exc)
12061212

12071213
.globl ret_from_mcheck_exc
12081214
ret_from_mcheck_exc:
@@ -1214,6 +1220,7 @@ ret_from_mcheck_exc:
12141220
RESTORE_xSRR(DSRR0,DSRR1);
12151221
RESTORE_MMU_REGS;
12161222
RET_FROM_EXC_LEVEL(SPRN_MCSRR0, SPRN_MCSRR1, PPC_RFMCI)
1223+
_ASM_NOKPROBE_SYMBOL(ret_from_mcheck_exc)
12171224
#endif /* CONFIG_BOOKE */
12181225

12191226
/*

0 commit comments

Comments
 (0)