summaryrefslogtreecommitdiffstats
path: root/arch/arm64/kernel/vmlinux.lds.S
diff options
context:
space:
mode:
authorJoey Gouly <joey.gouly@arm.com>2021-02-02 12:36:57 +0000
committerWill Deacon <will@kernel.org>2021-02-03 20:43:45 +0000
commit00ef543419366e8b742435992d08e0d5a87fd561 (patch)
treee41fabcdd9176181f10a0732d290f081f62dcd6d /arch/arm64/kernel/vmlinux.lds.S
parentb9ba680969d1016888fed4e03d8ecb4b97726f34 (diff)
downloadlinux-00ef543419366e8b742435992d08e0d5a87fd561.tar.gz
linux-00ef543419366e8b742435992d08e0d5a87fd561.tar.bz2
linux-00ef543419366e8b742435992d08e0d5a87fd561.zip
arm64: vmlinux.ld.S: add assertion for reserved_pg_dir offset
Add RESERVED_SWAPPER_OFFSET and use that instead of hardcoding the offset between swapper_pg_dir and reserved_pg_dir. Then use RESERVED_SWAPPER_OFFSET to assert that the offset is correct at link time. Signed-off-by: Joey Gouly <joey.gouly@arm.com> Reviewed-by: Mark Rutland <mark.rutland@arm.com> Tested-by: Mark Rutland <mark.rutland@arm.com> Link: https://lore.kernel.org/r/20210202123658.22308-2-joey.gouly@arm.com Signed-off-by: Will Deacon <will@kernel.org>
Diffstat (limited to 'arch/arm64/kernel/vmlinux.lds.S')
-rw-r--r--arch/arm64/kernel/vmlinux.lds.S3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/arm64/kernel/vmlinux.lds.S b/arch/arm64/kernel/vmlinux.lds.S
index 4c0b0c89ad59..a03a5300bce9 100644
--- a/arch/arm64/kernel/vmlinux.lds.S
+++ b/arch/arm64/kernel/vmlinux.lds.S
@@ -316,3 +316,6 @@ ASSERT((__entry_tramp_text_end - __entry_tramp_text_start) == PAGE_SIZE,
* If padding is applied before .head.text, virt<->phys conversions will fail.
*/
ASSERT(_text == KIMAGE_VADDR, "HEAD is misaligned")
+
+ASSERT(swapper_pg_dir - reserved_pg_dir == RESERVED_SWAPPER_OFFSET,
+ "RESERVED_SWAPPER_OFFSET is wrong!")