CONFIG_RANDOMIZE_IDENTITY_BASE only enables support for randomizing the
identity mapping base. The randomization (identity base != 0) itself
should happen only when KASLR is enabled at runtime.
Guard the __identity_base update with kaslr_enabled() so nokaslr (and
other KASLR-disabled cases) keep the non-randomized identity mapping at 0.
Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
max_mappable = max(ident_map_size, MAX_DCSS_ADDR);
max_mappable = min(max_mappable, vmemmap_start);
#ifdef CONFIG_RANDOMIZE_IDENTITY_BASE
- __identity_base = round_down(vmemmap_start - max_mappable, rte_size);
+ if (kaslr_enabled())
+ __identity_base = round_down(vmemmap_start - max_mappable, rte_size);
#endif
boot_debug("identity map: 0x%016lx-0x%016lx\n", __identity_base,
__identity_base + ident_map_size);