summaryrefslogtreecommitdiffstats
path: root/arch/arm64/mm/kasan_init.c
diff options
context:
space:
mode:
authorSteve Capper <steve.capper@arm.com>2019-08-07 17:55:17 +0200
committerWill Deacon <will@kernel.org>2019-08-09 12:17:16 +0200
commit90ec95cda91a021d82351c976896a63aa364ebf1 (patch)
tree6f5295463a65f0cda5e79bd47998ab10df11c0f6 /arch/arm64/mm/kasan_init.c
parentarm64: dump: De-constify VA_START and KASAN_SHADOW_START (diff)
downloadlinux-90ec95cda91a021d82351c976896a63aa364ebf1.tar.xz
linux-90ec95cda91a021d82351c976896a63aa364ebf1.zip
arm64: mm: Introduce VA_BITS_MIN
In order to support 52-bit kernel addresses detectable at boot time, the kernel needs to know the most conservative VA_BITS possible should it need to fall back to this quantity due to lack of hardware support. A new compile time constant VA_BITS_MIN is introduced in this patch and it is employed in the KASAN end address, KASLR, and EFI stub. For Arm, if 52-bit VA support is unavailable the fallback is to 48-bits. In other words: VA_BITS_MIN = min (48, VA_BITS) Reviewed-by: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: Steve Capper <steve.capper@arm.com> Signed-off-by: Will Deacon <will@kernel.org>
Diffstat (limited to 'arch/arm64/mm/kasan_init.c')
-rw-r--r--arch/arm64/mm/kasan_init.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/arm64/mm/kasan_init.c b/arch/arm64/mm/kasan_init.c
index 05edfe9b02e4..725222271474 100644
--- a/arch/arm64/mm/kasan_init.c
+++ b/arch/arm64/mm/kasan_init.c
@@ -156,7 +156,8 @@ asmlinkage void __init kasan_early_init(void)
{
BUILD_BUG_ON(KASAN_SHADOW_OFFSET !=
KASAN_SHADOW_END - (1UL << (64 - KASAN_SHADOW_SCALE_SHIFT)));
- BUILD_BUG_ON(!IS_ALIGNED(KASAN_SHADOW_START, PGDIR_SIZE));
+ BUILD_BUG_ON(!IS_ALIGNED(_KASAN_SHADOW_START(VA_BITS), PGDIR_SIZE));
+ BUILD_BUG_ON(!IS_ALIGNED(_KASAN_SHADOW_START(VA_BITS_MIN), PGDIR_SIZE));
BUILD_BUG_ON(!IS_ALIGNED(KASAN_SHADOW_END, PGDIR_SIZE));
kasan_pgd_populate(KASAN_SHADOW_START, KASAN_SHADOW_END, NUMA_NO_NODE,
true);