summaryrefslogtreecommitdiffstats
path: root/arch/arm64/kernel/kaslr.c
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2018-01-17 16:11:27 +0000
committerWill Deacon <will.deacon@arm.com>2018-03-05 12:06:43 +0000
commit6141ac1c274741ea8a47dfda759071f1c2eb5573 (patch)
tree88cb0e8bb004791bdfc2917de92d61e2a625b1a8 /arch/arm64/kernel/kaslr.c
parent532826f3712b607256eb30f92f23d1c604d3fa34 (diff)
downloadlinux-stable-6141ac1c274741ea8a47dfda759071f1c2eb5573.tar.gz
linux-stable-6141ac1c274741ea8a47dfda759071f1c2eb5573.tar.bz2
linux-stable-6141ac1c274741ea8a47dfda759071f1c2eb5573.zip
arm64/kernel: kaslr: drop special Image placement logic
Now that the early kernel mapping logic can tolerate placements of Image that cross swapper table boundaries, we can remove the logic that adjusts the offset if the dice roll produced an offset that puts the kernel right on top of one. Reviewed-by: Steve Capper <steve.capper@arm.com> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'arch/arm64/kernel/kaslr.c')
-rw-r--r--arch/arm64/kernel/kaslr.c15
1 files changed, 0 insertions, 15 deletions
diff --git a/arch/arm64/kernel/kaslr.c b/arch/arm64/kernel/kaslr.c
index 47080c49cc7e..e3d5cbe2167b 100644
--- a/arch/arm64/kernel/kaslr.c
+++ b/arch/arm64/kernel/kaslr.c
@@ -128,21 +128,6 @@ u64 __init kaslr_early_init(u64 dt_phys)
/* use the top 16 bits to randomize the linear region */
memstart_offset_seed = seed >> 48;
- /*
- * The kernel Image should not extend across a 1GB/32MB/512MB alignment
- * boundary (for 4KB/16KB/64KB granule kernels, respectively). If this
- * happens, round down the KASLR offset by (1 << SWAPPER_TABLE_SHIFT).
- *
- * NOTE: The references to _text and _end below will already take the
- * modulo offset (the physical displacement modulo 2 MB) into
- * account, given that the physical placement is controlled by
- * the loader, and will not change as a result of the virtual
- * mapping we choose.
- */
- if ((((u64)_text + offset) >> SWAPPER_TABLE_SHIFT) !=
- (((u64)_end + offset) >> SWAPPER_TABLE_SHIFT))
- offset = round_down(offset, 1 << SWAPPER_TABLE_SHIFT);
-
if (IS_ENABLED(CONFIG_KASAN))
/*
* KASAN does not expect the module region to intersect the