Commit 6a205420 authored by Kristina Martsenko's avatar Kristina Martsenko Committed by Catalin Marinas

arm64: fix ID map extension to 52 bits

Commit fa2a8445 added support for extending the ID map to 52 bits,
but accidentally dropped a required change to __cpu_uses_extended_idmap.
As a result, the kernel fails to boot when VA_BITS = 48 and the ID map
text is in 52-bit physical memory, because we reduce TCR.T0SZ to cover
the ID map, but then never set it back to VA_BITS.

Add back the change, and also clean up some double parentheses.

Fixes: fa2a8445 ("arm64: allow ID map to be extended to 52 bits")
Reviewed-by: default avatarSuzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: default avatarKristina Martsenko <kristina.martsenko@arm.com>
Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
parent 071929db
...@@ -72,8 +72,7 @@ extern u64 idmap_ptrs_per_pgd; ...@@ -72,8 +72,7 @@ extern u64 idmap_ptrs_per_pgd;
static inline bool __cpu_uses_extended_idmap(void) static inline bool __cpu_uses_extended_idmap(void)
{ {
return (!IS_ENABLED(CONFIG_ARM64_VA_BITS_48) && return unlikely(idmap_t0sz != TCR_T0SZ(VA_BITS));
unlikely(idmap_t0sz != TCR_T0SZ(VA_BITS)));
} }
/* /*
...@@ -82,7 +81,7 @@ static inline bool __cpu_uses_extended_idmap(void) ...@@ -82,7 +81,7 @@ static inline bool __cpu_uses_extended_idmap(void)
*/ */
static inline bool __cpu_uses_extended_idmap_level(void) static inline bool __cpu_uses_extended_idmap_level(void)
{ {
return ARM64_HW_PGTABLE_LEVELS((64 - idmap_t0sz)) > CONFIG_PGTABLE_LEVELS; return ARM64_HW_PGTABLE_LEVELS(64 - idmap_t0sz) > CONFIG_PGTABLE_LEVELS;
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment