move some tools/lkl/Makefile.autoconf logic to kconfig#603
move some tools/lkl/Makefile.autoconf logic to kconfig#603tavip merged 10 commits intolkl:masterfrom
Conversation
|
the clang build is throwing I need to revisit the logic at: |
|
...
I wonder whether we could use something like this instead: i.e. with |
72f3d60 to
683a1f0
Compare
|
v2:
|
It'd be nice to get Windows builds tested for this PR. Does anyone know how to upgrade the workflow to target a more recent (e.g. Server 2025) version? |
df87005 to
6804d3a
Compare
|
Windows 2022 build / tests are passing 🎉 . I'll keep the draft tag for now while I look at what other kernel .config autoconf options can be easily moved into |
6804d3a to
3bc246b
Compare
|
update:
|
Use tabs instead of spaces. Signed-off-by: David Disseldorp <ddiss@suse.de>
CONFIG_STACK_HASH_ORDER was removed via mainline kernel commit f998792 ("lib/stackdepot: replace CONFIG_STACK_HASH_ORDER with automatic sizing") at around the same time as this was added via downstream LKL commit facd006 ("lkl: add KASAN support"). The automatic sizing uses a minimum of 12, which matches the obsolete setting. Signed-off-by: David Disseldorp <ddiss@suse.de>
Kconfig makes it relatively easy to set kernel config parameters based on compiler settings, etc. So move some of the logic from tools/lkl/Makefile.autoconf into arch/lkl/Kconfig . Moving non-tools specific parameters out of Makefile.autoconf should make it easier to build LKL as a standalone library. Signed-off-by: David Disseldorp <ddiss@suse.de>
The existing scripts work for GCC but restrict LLVM builds to elf64-x86-64 only. The new cc-objdump-file-format.sh helper script works with both gcc/clang and objdump/llvm-objdump for CC and OBJDUMP respectively. Signed-off-by: David Disseldorp <ddiss@suse.de>
Makefile.autoconf::do_autoconf_fuzzing sets KCONFIG=fuzzing_defconfig so appending CONFIG_LKL_FUZZING=y to .config via tools/lkl/kernel.config shouldn't be necessary. Signed-off-by: David Disseldorp <ddiss@suse.de>
The LKL_HOST_MEMCPY, LKL_HOST_MEMSET and LKL_HOST_MEMMOVE kernel config parameters are currently set via tools/lkl/Makefile.autoconf based on whether OUTPUT_FORMAT starts with "elf64" or "elf32". Use the same logic in arch/lkl/Kconfig to set the parameter defaults and remove the corresponding Makefile.autoconf set_kernel_config calls. Signed-off-by: David Disseldorp <ddiss@suse.de>
OUTPUT_FORMAT is known within Kconfig, so we can use the same "elf64-x86-64" specific logic when setting the defaults for CONFIG_KASAN_SHADOW_OFFSET and CONFIG_KASAN_SHADOW_SIZE. The LKL_HOST_CONFIG_KASAN_SHADOW_OFFSET/_SIZE autoconf variables appear to be unused, so drop them for now. If necessary we could put them back in arch/lkl/include/generated/uapi/asm/config.h . Signed-off-by: David Disseldorp <ddiss@suse.de>
The LKL_MEMORY_START=0x50000000 and LKL_TASK_UNMAPPED_BASE=0x100000 kernel config values set in Makefile.autoconf match the arch/lkl/Kconfig defaults, so avoid explicitly setting them. The corresponding LKL_HOST_CONFIG_LKL_MEMORY_START/_TASK_UNMAPPED_BASE lkl_autoconf.h consts appear to be unused, so also drop them for now. Signed-off-by: David Disseldorp <ddiss@suse.de>
ebda356 to
62514fe
Compare
|
update:
|
In order to minimize code size (CONFIG_CC_OPTIMIZE_FOR_SIZE=y),
compiler might choose to make a regular function call (out-of-line) for
shmem_is_huge() instead of inlining it. When transparent hugepages are
disabled (CONFIG_TRANSPARENT_HUGEPAGE=n), it can cause compilation
error.
mm/shmem.c: In function `shmem_getattr':
./include/linux/huge_mm.h:383:27: note: in expansion of macro `BUILD_BUG'
383 | #define HPAGE_PMD_SIZE ({ BUILD_BUG(); 0; })
| ^~~~~~~~~
mm/shmem.c:1148:33: note: in expansion of macro `HPAGE_PMD_SIZE'
1148 | stat->blksize = HPAGE_PMD_SIZE;
To prevent the possible error, always inline shmem_is_huge() when
transparent hugepages are disabled.
Link: https://lkml.kernel.org/r/20240409155407.2322714-1-sumanthk@linux.ibm.com
Signed-off-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
Acked-by: David Hildenbrand <david@redhat.com>
Cc: Alexander Gordeev <agordeev@linux.ibm.com>
Cc: Heiko Carstens <hca@linux.ibm.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Ilya Leoshkevich <iii@linux.ibm.com>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
(cherry picked from commit 1f73784)
The previous mainline commit 1f73784 ("mm/shmem: inline shmem_is_huge() for disabled transparent hugepages") fixes the described build failure, so leave the CONFIG_SHMEM setting up to the user (it's enabled by default with MMU=y). Signed-off-by: David Disseldorp <ddiss@suse.de>
|
update:
The changes so here far are all minor and incremental. I'll drop the WIP flag for now. |
|
Windows CI failure appears unrelated to the changes here: |
|
Thank you for looping me in and doing this great clean up, folks! LGTM! |
This is (currently) one extra change atop the #602 s390 fixes.
I think it makes sense to move the Makefile.autoconf logic closer to where it's used, so arch specific kernel default settings can be moved into arch/lkl/Kconfig . Kconfig can call external shell scripts, which should allow us to share some logic between arch and tools while avoiding the
cat kernel.config >> ../../.configgymnastics.