Skip to content

Commit 7549b33

Browse files
mhiramatshuahkh
authored andcommitted
selftests: vm: Build/Run 64bit tests only on 64bit arch
Some virtual address range tests requires 64bit address space, and we can not build and run those tests on the 32bit machine. Filter the 64bit architectures in Makefile and run_vmtests, so that those tests are built/run only on 64bit archs. Signed-off-by: Masami Hiramatsu <[email protected]> Cc: Anshuman Khandual <[email protected]> Cc: Aneesh Kumar K.V <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
1 parent 2f3571e commit 7549b33

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

tools/testing/selftests/vm/Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# SPDX-License-Identifier: GPL-2.0
22
# Makefile for vm selftests
3+
uname_M := $(shell uname -m 2>/dev/null || echo not)
4+
ARCH ?= $(shell echo $(uname_M) | sed -e 's/aarch64.*/arm64/')
35

46
CFLAGS = -Wall -I ../../../../usr/include $(EXTRA_CFLAGS)
57
LDLIBS = -lrt
@@ -16,8 +18,11 @@ TEST_GEN_FILES += on-fault-limit
1618
TEST_GEN_FILES += thuge-gen
1719
TEST_GEN_FILES += transhuge-stress
1820
TEST_GEN_FILES += userfaultfd
21+
22+
ifneq (,$(filter $(ARCH),arm64 ia64 mips64 parisc64 ppc64 riscv64 s390x sh64 sparc64 x86_64))
1923
TEST_GEN_FILES += va_128TBswitch
2024
TEST_GEN_FILES += virtual_address_range
25+
endif
2126

2227
TEST_PROGS := run_vmtests
2328

tools/testing/selftests/vm/run_vmtests

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,14 @@ else
5858
exit 1
5959
fi
6060

61+
#filter 64bit architectures
62+
ARCH64STR="arm64 ia64 mips64 parisc64 ppc64 riscv64 s390x sh64 sparc64 x86_64"
63+
if [ -z $ARCH ]; then
64+
ARCH=`uname -m 2>/dev/null | sed -e 's/aarch64.*/arm64/'`
65+
fi
66+
VADDR64=0
67+
echo "$ARCH64STR" | grep $ARCH && VADDR64=1
68+
6169
mkdir $mnt
6270
mount -t hugetlbfs none $mnt
6371

@@ -189,6 +197,7 @@ else
189197
echo "[PASS]"
190198
fi
191199

200+
if [ $VADDR64 -ne 0 ]; then
192201
echo "-----------------------------"
193202
echo "running virtual_address_range"
194203
echo "-----------------------------"
@@ -210,6 +219,7 @@ if [ $? -ne 0 ]; then
210219
else
211220
echo "[PASS]"
212221
fi
222+
fi # VADDR64
213223

214224
echo "------------------------------------"
215225
echo "running vmalloc stability smoke test"

0 commit comments

Comments
 (0)