* [PATCH v2] selftests/vm: Fix building protection keys test
@ 2020-12-15 10:04 Harish
2020-12-15 10:12 ` Sandipan Das
2020-12-16 7:48 ` suxingxing
0 siblings, 2 replies; 3+ messages in thread
From: Harish @ 2020-12-15 10:04 UTC (permalink / raw)
To: shuah, akpm, sandipan, jhubbard, dave.hansen, kirill.shutemov,
bgeffon, almasrymina, suxingxing
Cc: Harish, linux-kselftest, stable
The patch d8cbe8bfa7d tries to include a ARCH check for powerpc,
however ARCH is not defined in the Makefile before including
lib.mk. This makes test building to skip on both x86 and powerpc.
Fix the arch check by replacing it using machine type as it is
already defined and used in the test.
Fixes: d8cbe8bfa7d ("tools/testing/selftests/vm: fix build error")
Signed-off-by: Harish <harish@linux.ibm.com>
---
Changes from v1:
- Add cause for test skip
- Handle x86_64 architecture
- Minor fixes to handle ppc64/ppc64le
- Add Fixes tag
---
tools/testing/selftests/vm/Makefile | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/tools/testing/selftests/vm/Makefile b/tools/testing/selftests/vm/Makefile
index 691893afc15d..e63f31632708 100644
--- a/tools/testing/selftests/vm/Makefile
+++ b/tools/testing/selftests/vm/Makefile
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: GPL-2.0
# Makefile for vm selftests
uname_M := $(shell uname -m 2>/dev/null || echo not)
-MACHINE ?= $(shell echo $(uname_M) | sed -e 's/aarch64.*/arm64/')
+MACHINE ?= $(shell echo $(uname_M) | sed -e 's/aarch64.*/arm64/' -e 's/ppc64.*/ppc64/')
# Without this, failed build products remain, with up-to-date timestamps,
# thus tricking Make (and you!) into believing that All Is Well, in subsequent
@@ -39,7 +39,7 @@ TEST_GEN_FILES += transhuge-stress
TEST_GEN_FILES += userfaultfd
TEST_GEN_FILES += khugepaged
-ifeq ($(ARCH),x86_64)
+ifeq ($(MACHINE),x86_64)
CAN_BUILD_I386 := $(shell ./../x86/check_cc.sh $(CC) ../x86/trivial_32bit_program.c -m32)
CAN_BUILD_X86_64 := $(shell ./../x86/check_cc.sh $(CC) ../x86/trivial_64bit_program.c)
CAN_BUILD_WITH_NOPIE := $(shell ./../x86/check_cc.sh $(CC) ../x86/trivial_program.c -no-pie)
@@ -61,13 +61,13 @@ TEST_GEN_FILES += $(BINARIES_64)
endif
else
-ifneq (,$(findstring $(ARCH),powerpc))
+ifneq (,$(findstring $(MACHINE),ppc64))
TEST_GEN_FILES += protection_keys
endif
endif
-ifneq (,$(filter $(MACHINE),arm64 ia64 mips64 parisc64 ppc64 ppc64le riscv64 s390x sh64 sparc64 x86_64))
+ifneq (,$(filter $(MACHINE),arm64 ia64 mips64 parisc64 ppc64 riscv64 s390x sh64 sparc64 x86_64))
TEST_GEN_FILES += va_128TBswitch
TEST_GEN_FILES += virtual_address_range
TEST_GEN_FILES += write_to_hugetlbfs
@@ -82,7 +82,7 @@ include ../lib.mk
$(OUTPUT)/hmm-tests: LDLIBS += -lhugetlbfs -lpthread
-ifeq ($(ARCH),x86_64)
+ifeq ($(MACHINE),x86_64)
BINARIES_32 := $(patsubst %,$(OUTPUT)/%,$(BINARIES_32))
BINARIES_64 := $(patsubst %,$(OUTPUT)/%,$(BINARIES_64))
--
2.26.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] selftests/vm: Fix building protection keys test
2020-12-15 10:04 [PATCH v2] selftests/vm: Fix building protection keys test Harish
@ 2020-12-15 10:12 ` Sandipan Das
2020-12-16 7:48 ` suxingxing
1 sibling, 0 replies; 3+ messages in thread
From: Sandipan Das @ 2020-12-15 10:12 UTC (permalink / raw)
To: Harish
Cc: linux-kselftest, stable, shuah, akpm, jhubbard, dave.hansen,
kirill.shutemov, bgeffon, almasrymina, suxingxing
On 15/12/20 3:34 pm, Harish wrote:
> The patch d8cbe8bfa7d tries to include a ARCH check for powerpc,
> however ARCH is not defined in the Makefile before including
> lib.mk. This makes test building to skip on both x86 and powerpc.
> Fix the arch check by replacing it using machine type as it is
> already defined and used in the test.
>
> Fixes: d8cbe8bfa7d ("tools/testing/selftests/vm: fix build error")
> Signed-off-by: Harish <harish@linux.ibm.com>
Reviewed-by: Sandipan Das <sandipan@linux.ibm.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] selftests/vm: Fix building protection keys test
2020-12-15 10:04 [PATCH v2] selftests/vm: Fix building protection keys test Harish
2020-12-15 10:12 ` Sandipan Das
@ 2020-12-16 7:48 ` suxingxing
1 sibling, 0 replies; 3+ messages in thread
From: suxingxing @ 2020-12-16 7:48 UTC (permalink / raw)
To: Harish, shuah, akpm, sandipan, jhubbard, dave.hansen,
kirill.shutemov, bgeffon, almasrymina
Cc: linux-kselftest, stable
On 12/15/2020 06:04 PM, Harish wrote:
> The patch d8cbe8bfa7d tries to include a ARCH check for powerpc,
> however ARCH is not defined in the Makefile before including
> lib.mk. This makes test building to skip on both x86 and powerpc.
> Fix the arch check by replacing it using machine type as it is
> already defined and used in the test.
>
> Fixes: d8cbe8bfa7d ("tools/testing/selftests/vm: fix build error")
> Signed-off-by: Harish <harish@linux.ibm.com>
> ---
>
>
> -ifneq (,$(findstring $(ARCH),powerpc))
> +ifneq (,$(findstring $(MACHINE),ppc64))
> TEST_GEN_FILES += protection_keys
> endif
Reviewed-by: Xingxing Su <suxingxing@loongson.cn>
The findstring isn't really canonical, it's my fault,
you can replace findstring with filter like V1.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-12-16 7:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-15 10:04 [PATCH v2] selftests/vm: Fix building protection keys test Harish
2020-12-15 10:12 ` Sandipan Das
2020-12-16 7:48 ` suxingxing
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).