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: Hari Bathini <hbathini@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/162626687834.155313.4692863392927831843.stgit@hbathini-workstation.ibm.com
This commit is contained in:
Hari Bathini 2021-07-14 18:17:58 +05:30 committed by Michael Ellerman
parent e1ab9a730b
commit 8119cefd9a
8 changed files with 25 additions and 12 deletions

View File

@ -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:

View File

@ -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];

View File

@ -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;

View File

@ -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();

View File

@ -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;

View File

@ -169,7 +169,8 @@ static void ps3_hpte_invalidate(unsigned long slot, unsigned long vpn,
spin_unlock_irqrestore(&ps3_htab_lock, flags);
}
static void ps3_hpte_clear(void)
/* Called during kexec sequence with MMU off */
static notrace void ps3_hpte_clear(void)
{
unsigned long hpte_count = (1UL << ppc64_pft_size) >> 4;
u64 i;

View File

@ -195,9 +195,11 @@ fail:
/**
* ps3_mm_vas_destroy -
*
* called during kexec sequence with MMU off.
*/
void ps3_mm_vas_destroy(void)
notrace void ps3_mm_vas_destroy(void)
{
int result;
@ -1243,9 +1245,11 @@ void __init ps3_mm_init(void)
/**
* ps3_mm_shutdown - final cleanup of address space
*
* called during kexec sequence with MMU off.
*/
void ps3_mm_shutdown(void)
notrace void ps3_mm_shutdown(void)
{
ps3_mm_region_destroy(&map.r1);
}

View File

@ -801,7 +801,8 @@ static long pSeries_lpar_hpte_remove(unsigned long hpte_group)
return -1;
}
static void manual_hpte_clear_all(void)
/* Called during kexec sequence with MMU off */
static notrace void manual_hpte_clear_all(void)
{
unsigned long size_bytes = 1UL << ppc64_pft_size;
unsigned long hpte_count = size_bytes >> 4;
@ -834,7 +835,8 @@ static void manual_hpte_clear_all(void)
}
}
static int hcall_hpte_clear_all(void)
/* Called during kexec sequence with MMU off */
static notrace int hcall_hpte_clear_all(void)
{
int rc;
@ -845,7 +847,8 @@ static int hcall_hpte_clear_all(void)
return rc;
}
static void pseries_hpte_clear_all(void)
/* Called during kexec sequence with MMU off */
static notrace void pseries_hpte_clear_all(void)
{
int rc;