# git rev-parse -q --verify f8eb5bd9a818cc5f2a1e50b22b0091830b28cc36^{commit} f8eb5bd9a818cc5f2a1e50b22b0091830b28cc36 already have revision, skipping fetch # git checkout -q -f -B kisskb f8eb5bd9a818cc5f2a1e50b22b0091830b28cc36 # git clean -qxdf # < git log -1 # commit f8eb5bd9a818cc5f2a1e50b22b0091830b28cc36 # Author: Linus Torvalds # Date: Mon Sep 23 08:58:31 2024 -0700 # # mm: fix build on 32-bit targets without MAX_PHYSMEM_BITS # # The merge resolution to deal with the conflict between commits # ea72ce5da228 ("x86/kaslr: Expose and use the end of the physical memory # address space") and 99185c10d5d9 ("resource, kunit: add test case for # region_intersects()") ended up being broken in configurations didn't # define a MAX_PHYSMEM_BITS and that had a 32-bit 'phys_addr_t'. # # The fallback to using all bits set (ie "(-1ULL)") ended up causing a # build error: # # kernel/resource.c: In function ‘gfr_start’: # include/linux/minmax.h:93:30: error: conversion from ‘long long unsigned int’ to ‘resource_size_t’ {aka ‘unsigned int’} changes value from ‘18446744073709551615’ to ‘4294967295’ [-Werror=overflow] # # this was reported by Geert for m68k, but he points out that it happens # on other 32-bit architectures too, eg mips, xtensa, parisc, and powerpc. # # Limiting 'PHYSMEM_END' to a 'phys_addr_t' (which is the same as # 'resource_size_t') fixes the build, but Geert points out that it will # then cause a silent overflow in mm/sparse.c: # # unsigned long max_sparsemem_pfn = (PHYSMEM_END + 1) >> PAGE_SHIFT; # # so we actually do want PHYSMEM_END to be defined a 64-bit type - just # not all ones, and not larger than 'phys_addr_t'. # # The proper fix is probably to not have some kind of default fallback at # all, but just make sure every architecture has a valid MAX_PHYSMEM_BITS. # But in the meantime, this just applies the rule that PHYSMEM_END is the # largest value that fits in a 'phys_addr_t', but does not have the high # bit set in 64 bits. # # Ugly, ugly. # # Reported-by: Geert Uytterhoeven # Cc: Andrew Morton # Cc: Huang Ying # Cc: Thomas Gleixner # Signed-off-by: Linus Torvalds # < /opt/cross/kisskb/korg/gcc-13.1.0-nolibc/sh4-linux/bin/sh4-linux-gcc --version # < /opt/cross/kisskb/korg/gcc-13.1.0-nolibc/sh4-linux/bin/sh4-linux-ld --version # < git log --format=%s --max-count=1 f8eb5bd9a818cc5f2a1e50b22b0091830b28cc36 # make -s -j 32 ARCH=sh O=/kisskb/build/linus_allmodconfig_sh4-gcc13 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-13.1.0-nolibc/sh4-linux/bin/sh4-linux- allmodconfig # Added to kconfig CONFIG_BUILD_DOCSRC=n # Added to kconfig CONFIG_MODULE_SIG=n # Added to kconfig CONFIG_SAMPLES=n # < make -s -j 32 ARCH=sh O=/kisskb/build/linus_allmodconfig_sh4-gcc13 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-13.1.0-nolibc/sh4-linux/bin/sh4-linux- help # make -s -j 32 ARCH=sh O=/kisskb/build/linus_allmodconfig_sh4-gcc13 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-13.1.0-nolibc/sh4-linux/bin/sh4-linux- olddefconfig # make -s -j 32 ARCH=sh O=/kisskb/build/linus_allmodconfig_sh4-gcc13 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-13.1.0-nolibc/sh4-linux/bin/sh4-linux- Generating include/generated/machtypes.h :1519:2: warning: #warning syscall clone3 not implemented [-Wcpp] /kisskb/src/arch/sh/kernel/cpu/sh2/../../entry-common.S: Assembler messages: /kisskb/src/arch/sh/kernel/cpu/sh2/../../entry-common.S:85: Warning: overflow in branch to __restore_all; converted into longer instruction sequence /kisskb/src/arch/sh/kernel/cpu/sh2/../../entry-common.S:357: Warning: overflow in branch to syscall_exit_work; converted into longer instruction sequence /kisskb/src/arch/sh/kernel/cpu/sh2/../../entry-common.S:360: Warning: overflow in branch to syscall_exit_work; converted into longer instruction sequence /kisskb/src/kernel/fork.c: In function '__do_sys_clone3': /kisskb/src/kernel/fork.c:3078:2: error: #warning clone3() entry point is missing, please fix [-Werror=cpp] 3078 | #warning clone3() entry point is missing, please fix | ^~~~~~~ cc1: all warnings being treated as errors make[4]: *** [/kisskb/src/scripts/Makefile.build:244: kernel/fork.o] Error 1 make[4]: *** Waiting for unfinished jobs.... make[3]: *** [/kisskb/src/scripts/Makefile.build:485: kernel] Error 2 make[3]: *** Waiting for unfinished jobs.... {standard input}: Assembler messages: {standard input}: Error: open CFI at the end of file; missing .cfi_endproc directive {standard input}:1397: Error: pcrel too far sh4-linux-gcc: internal compiler error: Segmentation fault signal terminated program cc1 Please submit a full bug report, with preprocessed source (by using -freport-bug). See for instructions. make[6]: *** [/kisskb/src/scripts/Makefile.build:244: drivers/net/pcs/pcs-xpcs.o] Error 4 make[5]: *** [/kisskb/src/scripts/Makefile.build:485: drivers/net/pcs] Error 2 make[5]: *** Waiting for unfinished jobs.... make[4]: *** [/kisskb/src/scripts/Makefile.build:485: drivers/net] Error 2 make[4]: *** Waiting for unfinished jobs.... make[3]: *** [/kisskb/src/scripts/Makefile.build:485: drivers] Error 2 make[2]: *** [/kisskb/src/Makefile:1926: .] Error 2 make[1]: *** [/kisskb/src/Makefile:224: __sub-make] Error 2 make: *** [Makefile:224: __sub-make] Error 2 Command 'make -s -j 32 ARCH=sh O=/kisskb/build/linus_allmodconfig_sh4-gcc13 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-13.1.0-nolibc/sh4-linux/bin/sh4-linux- ' returned non-zero exit status 2. # rm -rf /kisskb/build/linus_allmodconfig_sh4-gcc13 # Build took: 0:07:50.345587