Modules fixes for v6.13-rc1

This consists of 3 fixes, the main one build that we build the kallsyms
 test modules all over again if we just run make twice.
 -----BEGIN PGP SIGNATURE-----
 
 iQJGBAABCgAwFiEENnNq2KuOejlQLZofziMdCjCSiKcFAmdIwzgSHG1jZ3JvZkBr
 ZXJuZWwub3JnAAoJEM4jHQowkoin4w0P/iHEmQk7CBfAg1rzVTwQKF/aOWEbXszT
 dRQZj4/mtjMxAiRW2fj3MowzdjBqG1BCSwjoKZD+fJPIkq6fLP7UmXxHkBUPBRvP
 e1pXNBcR6FPsGO93OKNhkNsZR42v0dYoIbnq0h43LRR17TQjRu+a2Dnjr9h8NyCP
 TwAnBo5BqJy4/RO0hjalrrUlN1fCl4ZsLKmWFffqCRrk42wmsOI18auIlTCrxuAd
 4N9jySe+KwdBZ1nIA5wJikaQRxoYIiAGJxWGlhqd8eqmXSA6QF0wguHzDLzbkBIt
 UXmZnDZ/1H69CNoHOU/WlVMYYv/xCyqPJfGBLydIwLhDA5caOQEW4VVB7A1vOg8u
 78CYxHLTsfKvyOof8XuQKTuy3b0ELynvkPwJ8oj6z8Zt2UfWx4XMddaYmd394IUS
 R80CO0N7ep3EVYNo0avfJbV/GU+3yeDotnlimm/E5UMKhD5HrwTyOrikwpyk80xq
 /PdiNo4g0KpjTi9V3QZwOnXoiJVgMte8W/C+BPSCY4TL+zfAS88XAEPxsW6/ZhBb
 eNfo/tZ0oMm7bP05icMwViSVDnImUN+l/YTC5lziNOty9L/Z+dOdZPGv4Y5biIj/
 qqhQL87hs8CuM1PilYsxHo6QjcsDcmQPd9AR4GvgHfxnN+jhGarGYqPeQK5MOXNB
 a2CRkMzweHpR
 =3s2l
 -----END PGP SIGNATURE-----

Merge tag 'modules-6.13-rc1-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/modules/linux

Pull modules fixes from Luis Chamberlain:
 "Three fixes, the main one build that we build the kallsyms test
  modules all over again if we just run make twice"

* tag 'modules-6.13-rc1-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/modules/linux:
  selftests: find_symbol: Actually use load_mod() parameter
  selftests: kallsyms: fix and clarify current test boundaries
  selftests: kallsyms: fix double build stupidity
This commit is contained in:
Linus Torvalds 2024-11-29 11:15:07 -08:00
commit 93e064ce85
4 changed files with 48 additions and 14 deletions

View File

@ -3003,9 +3003,39 @@ config TEST_KALLSYMS_D
tristate
depends on m
choice
prompt "Kallsym test range"
default TEST_KALLSYMS_LARGE
help
Selecting something other than "Fast" will enable tests which slow
down the build and may crash your build.
config TEST_KALLSYMS_FAST
bool "Fast builds"
help
You won't really be testing kallsysms, so this just helps fast builds
when allmodconfig is used..
config TEST_KALLSYMS_LARGE
bool "Enable testing kallsyms with large exports"
help
This will enable larger number of symbols. This will slow down
your build considerably.
config TEST_KALLSYMS_MAX
bool "Known kallsysms limits"
help
This will enable exports to the point we know we'll start crashing
builds.
endchoice
config TEST_KALLSYMS_NUMSYMS
int "test kallsyms number of symbols"
default 100
range 2 10000
default 2 if TEST_KALLSYMS_FAST
default 100 if TEST_KALLSYMS_LARGE
default 10000 if TEST_KALLSYMS_MAX
help
The number of symbols to create on TEST_KALLSYMS_A, only one of which
module TEST_KALLSYMS_B will use. This also will be used

View File

@ -3,13 +3,12 @@ obj-$(CONFIG_TEST_KALLSYMS_B) += test_kallsyms_b.o
obj-$(CONFIG_TEST_KALLSYMS_C) += test_kallsyms_c.o
obj-$(CONFIG_TEST_KALLSYMS_D) += test_kallsyms_d.o
$(obj)/%.c: FORCE
@$(kecho) " GEN $@"
$(Q)$(srctree)/lib/tests/module/gen_test_kallsyms.sh $@\
$(CONFIG_TEST_KALLSYMS_NUMSYMS) \
$(CONFIG_TEST_KALLSYMS_SCALE_FACTOR)
quiet_cmd_gen_test_kallsyms = GEN $@
cmd_gen_test_kallsyms = $< $@ \
$(CONFIG_TEST_KALLSYMS_NUMSYMS) \
$(CONFIG_TEST_KALLSYMS_SCALE_FACTOR)
clean-files += test_kallsyms_a.c
clean-files += test_kallsyms_b.c
clean-files += test_kallsyms_c.c
clean-files += test_kallsyms_d.c
$(obj)/%.c: $(src)/gen_test_kallsyms.sh FORCE
$(call if_changed,gen_test_kallsyms)
targets += $(foreach x, a b c d, test_kallsyms_$(x).c)

View File

@ -7,6 +7,11 @@ NUM_SYMS=$2
SCALE_FACTOR=$3
TEST_TYPE=$(echo $TARGET | sed -e 's|lib/tests/module/test_kallsyms_||g')
TEST_TYPE=$(echo $TEST_TYPE | sed -e 's|.c||g')
FIRST_B_LOOKUP=1
if [[ $NUM_SYMS -gt 2 ]]; then
FIRST_B_LOOKUP=$((NUM_SYMS/2))
fi
gen_template_module_header()
{
@ -52,10 +57,10 @@ ____END_MODULE
gen_template_module_data_b()
{
printf "\nextern int auto_test_a_%010d;\n\n" 28
printf "\nextern int auto_test_a_%010d;\n\n" $FIRST_B_LOOKUP
echo "static int auto_runtime_test(void)"
echo "{"
printf "\nreturn auto_test_a_%010d;\n" 28
printf "\nreturn auto_test_a_%010d;\n" $FIRST_B_LOOKUP
echo "}"
}

View File

@ -44,10 +44,10 @@ load_mod()
local ARCH="$(uname -m)"
case "${ARCH}" in
x86_64)
perf stat $STATS $MODPROBE test_kallsyms_b
perf stat $STATS $MODPROBE $MOD
;;
*)
time $MODPROBE test_kallsyms_b
time $MODPROBE $MOD
exit 1
;;
esac