Skip to content

Commit 44eeb9b

Browse files
committed
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>
1 parent c64c782 commit 44eeb9b

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

arch/parisc/mm/init.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -555,6 +555,12 @@ void __init mem_init(void)
555555
BUILD_BUG_ON(PT_INITIAL > PTRS_PER_PGD);
556556
#endif
557557

558+
#ifdef CONFIG_64BIT
559+
/* avoid ldil_%L() asm statements to sign-extend into upper 32-bits */
560+
BUILD_BUG_ON(__PAGE_OFFSET >= 0x80000000);
561+
BUILD_BUG_ON(TMPALIAS_MAP_START >= 0x80000000);
562+
#endif
563+
558564
high_memory = __va((max_pfn << PAGE_SHIFT));
559565
set_max_mapnr(max_low_pfn);
560566
memblock_free_all();

0 commit comments

Comments
 (0)