summaryrefslogtreecommitdiffstats
path: root/arch/arm64/include/asm/memory.h
diff options
context:
space:
mode:
authorJoey Gouly <joey.gouly@arm.com>2021-02-02 12:36:58 +0000
committerWill Deacon <will@kernel.org>2021-02-03 20:43:45 +0000
commit0188a894c390e51475274ece76b4d601782d709e (patch)
tree79cf592206f63eed00a6b74f88f573ce836cd627 /arch/arm64/include/asm/memory.h
parent00ef543419366e8b742435992d08e0d5a87fd561 (diff)
downloadlinux-0188a894c390e51475274ece76b4d601782d709e.tar.bz2
arm64: vmlinux.ld.S: add assertion for tramp_pg_dir offset
Add TRAMP_SWAPPER_OFFSET and use that instead of hardcoding the offset between swapper_pg_dir and tramp_pg_dir. Then use TRAMP_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-3-joey.gouly@arm.com Signed-off-by: Will Deacon <will@kernel.org>
Diffstat (limited to 'arch/arm64/include/asm/memory.h')
-rw-r--r--arch/arm64/include/asm/memory.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/arm64/include/asm/memory.h b/arch/arm64/include/asm/memory.h
index f6bf8a972a16..6c2674937665 100644
--- a/arch/arm64/include/asm/memory.h
+++ b/arch/arm64/include/asm/memory.h
@@ -165,6 +165,12 @@
*/
#define RESERVED_SWAPPER_OFFSET (PAGE_SIZE)
+/*
+ * Open-coded (swapper_pg_dir - tramp_pg_dir) as this cannot be calculated
+ * until link time.
+ */
+#define TRAMP_SWAPPER_OFFSET (2 * PAGE_SIZE)
+
#ifndef __ASSEMBLY__
#include <linux/bitops.h>