Skip to content

Commit 5f32e83

Browse files
chleroympe
authored andcommitted
powerpc/32: Blacklist functions running with MMU disabled for kprobe
kprobe does not handle events happening in real mode, all functions running with MMU disabled have to be blacklisted. 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/3bf57066d05518644dee0840af69d36ab5086729.1585670437.git.christophe.leroy@c-s.fr
1 parent 32746df commit 5f32e83

File tree

10 files changed

+16
-0
lines changed

10 files changed

+16
-0
lines changed

arch/powerpc/kernel/cpu_setup_6xx.S

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,7 @@ _GLOBAL(__init_fpu_registers)
288288
mtmsr r10
289289
isync
290290
blr
291+
_ASM_NOKPROBE_SYMBOL(__init_fpu_registers)
291292

292293

293294
/* Definitions for the table use to save CPU states */
@@ -483,4 +484,5 @@ _GLOBAL(__restore_cpu_setup)
483484
1:
484485
mtcr r7
485486
blr
487+
_ASM_NOKPROBE_SYMBOL(__restore_cpu_setup)
486488

arch/powerpc/kernel/entry_32.S

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,7 @@ stack_ovf:
312312
mtspr SPRN_SRR1,r10
313313
SYNC
314314
RFI
315+
_ASM_NOKPROBE_SYMBOL(stack_ovf)
315316
#endif
316317

317318
#ifdef CONFIG_TRACE_IRQFLAGS
@@ -1326,6 +1327,7 @@ nonrecoverable:
13261327
bl unrecoverable_exception
13271328
/* shouldn't return */
13281329
b 4b
1330+
_ASM_NOKPROBE_SYMBOL(nonrecoverable)
13291331

13301332
.section .bss
13311333
.align 2
@@ -1380,4 +1382,5 @@ _GLOBAL(enter_rtas)
13801382
mtspr SPRN_SRR0,r8
13811383
mtspr SPRN_SRR1,r9
13821384
RFI /* return to caller */
1385+
_ASM_NOKPROBE_SYMBOL(enter_rtas)
13831386
#endif /* CONFIG_PPC_RTAS */

arch/powerpc/kernel/fpu.S

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_VSX)
119119
/* restore registers and return */
120120
/* we haven't used ctr or xer or lr */
121121
blr
122+
_ASM_NOKPROBE_SYMBOL(load_up_fpu)
122123

123124
/*
124125
* save_fpu(tsk)

arch/powerpc/kernel/idle_6xx.S

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ BEGIN_FTR_SECTION
187187
mtspr SPRN_HID1, r9
188188
END_FTR_SECTION_IFSET(CPU_FTR_DUAL_PLL_750FX)
189189
b transfer_to_handler_cont
190+
_ASM_NOKPROBE_SYMBOL(power_save_ppc32_restore)
190191

191192
.data
192193

arch/powerpc/kernel/idle_e500.S

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,3 +90,4 @@ _GLOBAL(power_save_ppc32_restore)
9090
#endif
9191

9292
b transfer_to_handler_cont
93+
_ASM_NOKPROBE_SYMBOL(power_save_ppc32_restore)

arch/powerpc/kernel/l2cr_6xx.S

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,5 +455,6 @@ _GLOBAL(__inval_enable_L1)
455455
sync
456456

457457
blr
458+
_ASM_NOKPROBE_SYMBOL(__inval_enable_L1)
458459

459460

arch/powerpc/kernel/misc.S

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ _GLOBAL(add_reloc_offset)
3636
add r3,r3,r5
3737
mtlr r0
3838
blr
39+
_ASM_NOKPROBE_SYMBOL(reloc_offset)
40+
_ASM_NOKPROBE_SYMBOL(add_reloc_offset)
3941

4042
.align 3
4143
2: PPC_LONG 1b

arch/powerpc/kernel/misc_32.S

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ _GLOBAL(real_readb)
246246
sync
247247
isync
248248
blr
249+
_ASM_NOKPROBE_SYMBOL(real_readb)
249250

250251
/*
251252
* Do an IO access in real mode
@@ -263,6 +264,7 @@ _GLOBAL(real_writeb)
263264
sync
264265
isync
265266
blr
267+
_ASM_NOKPROBE_SYMBOL(real_writeb)
266268

267269
#endif /* CONFIG_40x */
268270

arch/powerpc/kernel/swsusp_32.S

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,7 @@ END_MMU_FTR_SECTION_IFSET(MMU_FTR_USE_HIGH_BATS)
395395

396396
li r3,0
397397
blr
398+
_ASM_NOKPROBE_SYMBOL(swsusp_arch_resume)
398399

399400
/* FIXME:This construct is actually not useful since we don't shut
400401
* down the instruction MMU, we could just flip back MSR-DR on.
@@ -406,4 +407,5 @@ turn_on_mmu:
406407
sync
407408
isync
408409
rfi
410+
_ASM_NOKPROBE_SYMBOL(turn_on_mmu)
409411

arch/powerpc/kernel/vector.S

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ _GLOBAL(load_up_altivec)
8989
REST_32VRS(0,r4,r6)
9090
/* restore registers and return */
9191
blr
92+
_ASM_NOKPROBE_SYMBOL(load_up_altivec)
9293

9394
/*
9495
* save_altivec(tsk)

0 commit comments

Comments
 (0)