selftests/vm: Only run 128TBswitch with 5-level paging
Subsystems (2)
PATCH v6 1/1 selftests/vm: Only run 128TBswitch with 5-level paging
The test va_128TBswitch.c expects to be able to pass mmap an address hint and length that cross the address 1<<47. On x86_64, this is not possible without 5-level page tables, so the test fails.
The test is already only run on 64-bit powerpc and x86_64 archs, but this patch adds an additional check on x86_64 that skips the test if PG_TABLE_LEVELS < 5. There is precedent for checking /proc/config.gz in selftests, e.g. in selftests/firmware.
Running the tests produces the desired output:
sudo make -C tools/testing/selftests TARGETS=vm run_tests
---------------------------
running ./va_128TBswitch.sh
---------------------------
./va_128TBswitch.sh: PG_TABLE_LEVELS=4, must be >= 5 to run this test [SKIP]
-------------------------------
---
V5 -> V6: Fixed formatting issues
V4 -> V5: Renamed "die" to "fail" (missed the review comment, sorry!) V3 -> V4: Restrict the check to x86_64
V2 -> V3: Clean up the commit message
V1 -> V2: Variables local, fixed Makefile typo, comment on gzip usage
tools/testing/selftests/vm/Makefile | 1 + tools/testing/selftests/vm/run_vmtests.sh | 2 +- tools/testing/selftests/vm/va_128TBswitch.sh | 54 ++++++++++++++++++++ 3 files changed, 56 insertions(+), 1 deletion(-) create mode 100755 tools/testing/selftests/vm/va_128TBswitch.sh
tools/testing/selftests/vm/Makefile +1 -0
@@ -93,6 +93,7 @@ TEST_PROGS := run_vmtests.sh TEST_FILES := test_vmalloc.sh TEST_FILES += test_hmm.sh +TEST_FILES += va_128TBswitch.sh KSFT_KHDR_INSTALL := 1 include ../lib.mk
tools/testing/selftests/vm/run_vmtests.sh +1 -1
@@ -151,7 +151,7 @@ if [ $VADDR64 -ne 0 ]; then run_test ./virtual_address_range # virtual address 128TB switch test - run_test ./va_128TBswitch + run_test ./va_128TBswitch.sh fi # VADDR64 # vmalloc stability smoke test
tools/testing/selftests/vm/va_128TBswitch.sh new file +54 -0
54 lines not on this page · raw message
Signature · 1 line
2.35.1
Quoted 19 lines · Adam Sindelar
The test
va_128TBswitch.cexpects to be able to pass mmap an address hint and length that cross the address 1<<47. Onx86_64, this is not possible without 5-level page tables, so the test fails.The test is already only run on 64-bit powerpc and
x86_64archs, but this patch adds an additional check onx86_64that skips the test ifPG_TABLE_LEVELS< 5. There is precedent for checking/proc/config.gzin selftests, e.g. in selftests/firmware.Running the tests produces the desired output:
sudo make -C
tools/testing/selftestsTARGETS=vmrun_tests
---------------------------
running ./va_128TBswitch.sh
---------------------------
./va_128TBswitch.sh: PG_TABLE_LEVELS=4, must be >= 5 to run this test [SKIP]
-------------------------------
Quoted 1 line
Signed-off-by Adam Sindelar <[email protected]>
[...]
Thanks, Adam. Looks good to me.