Skip to contentSkip to conversation

selftests/vm: Only run 128TBswitch with 5-level paging

PATCH Superseded Adam Sindelar 1 participant 1 message Jun 28, 2022

Subsystems (2)

v4 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

PATCH v4 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]
-------------------------------

---
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
index 44f25acfbeca..6a34209379a4 100644
@@ -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
index 41fce8bea929..27c01c35c7a9 100755
@@ -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