Commit 8119cefd authored by Hari Bathini's avatar Hari Bathini Committed by Michael Ellerman
Browse files

powerpc/kexec: blacklist functions called in real mode for kprobe



As kprobe does not handle events happening in real mode, blacklist the
functions that only get called in real mode or in kexec sequence with
MMU turned off.

Signed-off-by: default avatarHari Bathini <hbathini@linux.ibm.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/162626687834.155313.4692863392927831843.stgit@hbathini-workstation.ibm.com
parent e1ab9a73
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -712,6 +712,8 @@ _GLOBAL(copy_and_flush)
	isync
	blr

_ASM_NOKPROBE_SYMBOL(copy_and_flush); /* Called in real mode */

.align 8
copy_to_here:

+4 −2
Original line number Diff line number Diff line
@@ -72,7 +72,8 @@ int default_machine_kexec_prepare(struct kimage *image)
	return 0;
}

static void copy_segments(unsigned long ind)
/* Called during kexec sequence with MMU off */
static notrace void copy_segments(unsigned long ind)
{
	unsigned long entry;
	unsigned long *ptr;
@@ -105,7 +106,8 @@ static void copy_segments(unsigned long ind)
	}
}

void kexec_copy_flush(struct kimage *image)
/* Called during kexec sequence with MMU off */
notrace void kexec_copy_flush(struct kimage *image)
{
	long i, nr_segments = image->nr_segments;
	struct  kexec_segment ranges[KEXEC_SEGMENT_MAX];
+1 −1
Original line number Diff line number Diff line
@@ -787,7 +787,7 @@ static void hpte_decode(struct hash_pte *hpte, unsigned long slot,
 * TODO: add batching support when enabled.  remember, no dynamic memory here,
 * although there is the control page available...
 */
static void native_hpte_clear(void)
static notrace void native_hpte_clear(void)
{
	unsigned long vpn = 0;
	unsigned long slot, slots;
+2 −2
Original line number Diff line number Diff line
@@ -172,8 +172,8 @@ pmd_t pmd_modify(pmd_t pmd, pgprot_t newprot)
}
#endif /* CONFIG_TRANSPARENT_HUGEPAGE */

/* For use by kexec */
void mmu_cleanup_all(void)
/* For use by kexec, called with MMU off */
notrace void mmu_cleanup_all(void)
{
	if (radix_enabled())
		radix__mmu_cleanup_all();
+2 −1
Original line number Diff line number Diff line
@@ -679,7 +679,8 @@ void radix__early_init_mmu_secondary(void)
	mtspr(SPRN_UAMOR, 0);
}

void radix__mmu_cleanup_all(void)
/* Called during kexec sequence with MMU off */
notrace void radix__mmu_cleanup_all(void)
{
	unsigned long lpcr;

Loading