summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHelge Deller <deller@gmx.de>2022-05-17 16:57:06 +0200
committerHelge Deller <deller@gmx.de>2022-05-23 13:44:24 +0200
commit44eeb9b56774c6f87155132a92252410e4610384 (patch)
treeb2ab546afabb7035902560023a09409b57ffbcb1
parentc64c782e58ac5bb3601aa77b860ca4e93a489b7a (diff)
parisc: Prevent ldil() to sign-extend into upper 32 bits
Add some build time checks to prevent that the various usages of "ldil L%(TMPALIAS_MAP_START), %reg" sign-extends into the upper 32 bits when building a 64-bit kernel. Signed-off-by: Helge Deller <deller@gmx.de>
-rw-r--r--arch/parisc/mm/init.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c
index 1dc2e88e7b04..0a81499dd35e 100644
--- a/arch/parisc/mm/init.c
+++ b/arch/parisc/mm/init.c
@@ -555,6 +555,12 @@ void __init mem_init(void)
BUILD_BUG_ON(PT_INITIAL > PTRS_PER_PGD);
#endif
+#ifdef CONFIG_64BIT
+ /* avoid ldil_%L() asm statements to sign-extend into upper 32-bits */
+ BUILD_BUG_ON(__PAGE_OFFSET >= 0x80000000);
+ BUILD_BUG_ON(TMPALIAS_MAP_START >= 0x80000000);
+#endif
+
high_memory = __va((max_pfn << PAGE_SHIFT));
set_max_mapnr(max_low_pfn);
memblock_free_all();