diff options
author | Christophe Leroy <christophe.leroy@csgroup.eu> | 2020-06-29 14:15:21 +0300 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2020-07-26 17:01:30 +0300 |
commit | 7fbc22ce29931630da200cfc90fe5a454f54a794 (patch) | |
tree | 3949593c0bffa5ec555c467fe0d73068610e37bc /arch/powerpc/mm/kasan/kasan_init_32.c | |
parent | ccc8fcf72a6953fbfd6998999d622295f522b952 (diff) | |
download | linux-7fbc22ce29931630da200cfc90fe5a454f54a794.tar.xz |
powerpc: Use MODULES_VADDR if defined
In order to allow allocation of modules outside of vmalloc space,
use MODULES_VADDR and MODULES_END when MODULES_VADDR is defined.
Redefine module_alloc() when MODULES_VADDR defined.
Unmap corresponding KASAN shadow memory.
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/7ecf5fff1eef67d450e73fc412b6ec3818483d75.1593428200.git.christophe.leroy@csgroup.eu
Diffstat (limited to 'arch/powerpc/mm/kasan/kasan_init_32.c')
-rw-r--r-- | arch/powerpc/mm/kasan/kasan_init_32.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/powerpc/mm/kasan/kasan_init_32.c b/arch/powerpc/mm/kasan/kasan_init_32.c index 019b0c0bbbf3..fb294046e00e 100644 --- a/arch/powerpc/mm/kasan/kasan_init_32.c +++ b/arch/powerpc/mm/kasan/kasan_init_32.c @@ -115,6 +115,12 @@ static void __init kasan_unmap_early_shadow_vmalloc(void) unsigned long k_end = (unsigned long)kasan_mem_to_shadow((void *)VMALLOC_END); kasan_update_early_region(k_start, k_end, __pte(0)); + +#ifdef MODULES_VADDR + k_start = (unsigned long)kasan_mem_to_shadow((void *)MODULES_VADDR); + k_end = (unsigned long)kasan_mem_to_shadow((void *)MODULES_END); + kasan_update_early_region(k_start, k_end, __pte(0)); +#endif } void __init kasan_mmu_init(void) |