powerpc/32: Blacklist functions running with MMU disabled for kprobe
authorChristophe Leroy <christophe.leroy@c-s.fr>
Tue, 31 Mar 2020 16:03:44 +0000 (16:03 +0000)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 2 Jun 2020 10:59:11 +0000 (20:59 +1000)
kprobe does not handle events happening in real mode, all
functions running with MMU disabled have to be blacklisted.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Acked-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/3bf57066d05518644dee0840af69d36ab5086729.1585670437.git.christophe.leroy@c-s.fr
arch/powerpc/kernel/cpu_setup_6xx.S
arch/powerpc/kernel/entry_32.S
arch/powerpc/kernel/fpu.S
arch/powerpc/kernel/idle_6xx.S
arch/powerpc/kernel/idle_e500.S
arch/powerpc/kernel/l2cr_6xx.S
arch/powerpc/kernel/misc.S
arch/powerpc/kernel/misc_32.S
arch/powerpc/kernel/swsusp_32.S
arch/powerpc/kernel/vector.S

index f6517f6..f8b5ff6 100644 (file)
@@ -288,6 +288,7 @@ _GLOBAL(__init_fpu_registers)
        mtmsr   r10
        isync
        blr
+_ASM_NOKPROBE_SYMBOL(__init_fpu_registers)
 
 
 /* Definitions for the table use to save CPU states */
@@ -483,4 +484,5 @@ _GLOBAL(__restore_cpu_setup)
 1:
        mtcr    r7
        blr
+_ASM_NOKPROBE_SYMBOL(__restore_cpu_setup)
 
index 126ede4..d54f406 100644 (file)
@@ -312,6 +312,7 @@ stack_ovf:
        mtspr   SPRN_SRR1,r10
        SYNC
        RFI
+_ASM_NOKPROBE_SYMBOL(stack_ovf)
 #endif
 
 #ifdef CONFIG_TRACE_IRQFLAGS
@@ -1326,6 +1327,7 @@ nonrecoverable:
        bl      unrecoverable_exception
        /* shouldn't return */
        b       4b
+_ASM_NOKPROBE_SYMBOL(nonrecoverable)
 
        .section .bss
        .align  2
@@ -1380,4 +1382,5 @@ _GLOBAL(enter_rtas)
        mtspr   SPRN_SRR0,r8
        mtspr   SPRN_SRR1,r9
        RFI                     /* return to caller */
+_ASM_NOKPROBE_SYMBOL(enter_rtas)
 #endif /* CONFIG_PPC_RTAS */
index 3235a8d..1dfccf5 100644 (file)
@@ -119,6 +119,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_VSX)
        /* restore registers and return */
        /* we haven't used ctr or xer or lr */
        blr
+_ASM_NOKPROBE_SYMBOL(load_up_fpu)
 
 /*
  * save_fpu(tsk)
index 433d97b..69df840 100644 (file)
@@ -187,6 +187,7 @@ BEGIN_FTR_SECTION
        mtspr   SPRN_HID1, r9
 END_FTR_SECTION_IFSET(CPU_FTR_DUAL_PLL_750FX)
        b       transfer_to_handler_cont
+_ASM_NOKPROBE_SYMBOL(power_save_ppc32_restore)
 
        .data
 
index 308f499..72c85b6 100644 (file)
@@ -90,3 +90,4 @@ _GLOBAL(power_save_ppc32_restore)
 #endif
 
        b       transfer_to_handler_cont
+_ASM_NOKPROBE_SYMBOL(power_save_ppc32_restore)
index 2020d25..5f07aa5 100644 (file)
@@ -455,5 +455,6 @@ _GLOBAL(__inval_enable_L1)
        sync
 
        blr
+_ASM_NOKPROBE_SYMBOL(__inval_enable_L1)
 
 
index 65f9f73..5be96fe 100644 (file)
@@ -36,6 +36,8 @@ _GLOBAL(add_reloc_offset)
        add     r3,r3,r5
        mtlr    r0
        blr
+_ASM_NOKPROBE_SYMBOL(reloc_offset)
+_ASM_NOKPROBE_SYMBOL(add_reloc_offset)
 
        .align  3
 2:     PPC_LONG 1b
index 70bb885..b24f866 100644 (file)
@@ -246,6 +246,7 @@ _GLOBAL(real_readb)
        sync
        isync
        blr
+_ASM_NOKPROBE_SYMBOL(real_readb)
 
        /*
  * Do an IO access in real mode
@@ -263,6 +264,7 @@ _GLOBAL(real_writeb)
        sync
        isync
        blr
+_ASM_NOKPROBE_SYMBOL(real_writeb)
 
 #endif /* CONFIG_40x */
 
index cbdf862..f73f4d7 100644 (file)
@@ -395,6 +395,7 @@ END_MMU_FTR_SECTION_IFSET(MMU_FTR_USE_HIGH_BATS)
 
        li      r3,0
        blr
+_ASM_NOKPROBE_SYMBOL(swsusp_arch_resume)
 
 /* FIXME:This construct is actually not useful since we don't shut
  * down the instruction MMU, we could just flip back MSR-DR on.
@@ -406,4 +407,5 @@ turn_on_mmu:
        sync
        isync
        rfi
+_ASM_NOKPROBE_SYMBOL(turn_on_mmu)
 
index d20c5e7..efc5b52 100644 (file)
@@ -89,6 +89,7 @@ _GLOBAL(load_up_altivec)
        REST_32VRS(0,r4,r6)
        /* restore registers and return */
        blr
+_ASM_NOKPROBE_SYMBOL(load_up_altivec)
 
 /*
  * save_altivec(tsk)