Skip to content

Commit 4175eff

Browse files
Chunyan Zhangakpm00
authored andcommitted
selftests/mm: skip virtual_address_range tests on riscv
RISC-V doesn't currently have the behavior of restricting the virtual address space which virtual_address_range tests check, this will cause the tests fail. So lets disable the whole test suite for riscv64 for now, not build it and run_vmtests.sh will skip it if it is not present. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Chunyan Zhang <[email protected]> Reviewed-by: Charlie Jenkins <[email protected]> Acked-by: Palmer Dabbelt <[email protected]> Cc: Alexandre Ghiti <[email protected]> Cc: Paul Walmsley <[email protected]> Cc: Shuah Khan <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent e847f8c commit 4175eff

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

tools/testing/selftests/mm/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,9 @@ endif
116116

117117
ifneq (,$(filter $(ARCH),arm64 mips64 parisc64 powerpc riscv64 s390x sparc64 x86_64 s390))
118118
TEST_GEN_FILES += va_high_addr_switch
119+
ifneq ($(ARCH),riscv64)
119120
TEST_GEN_FILES += virtual_address_range
121+
endif
120122
TEST_GEN_FILES += write_to_hugetlbfs
121123
endif
122124

tools/testing/selftests/mm/run_vmtests.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -347,10 +347,12 @@ if [ $VADDR64 -ne 0 ]; then
347347
# allows high virtual address allocation requests independent
348348
# of platform's physical memory.
349349

350-
prev_policy=$(cat /proc/sys/vm/overcommit_memory)
351-
echo 1 > /proc/sys/vm/overcommit_memory
352-
CATEGORY="hugevm" run_test ./virtual_address_range
353-
echo $prev_policy > /proc/sys/vm/overcommit_memory
350+
if [ -x ./virtual_address_range ]; then
351+
prev_policy=$(cat /proc/sys/vm/overcommit_memory)
352+
echo 1 > /proc/sys/vm/overcommit_memory
353+
CATEGORY="hugevm" run_test ./virtual_address_range
354+
echo $prev_policy > /proc/sys/vm/overcommit_memory
355+
fi
354356

355357
# va high address boundary switch test
356358
ARCH_ARM64="arm64"

0 commit comments

Comments
 (0)