linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/7] Improvement kselftest support for arm and arm64
@ 2015-08-14 13:43 Bamvor Jian Zhang
  2015-08-14 13:43 ` [PATCH 1/7] selftests: rename jump label to static_keys Bamvor Jian Zhang
                   ` (6 more replies)
  0 siblings, 7 replies; 29+ messages in thread
From: Bamvor Jian Zhang @ 2015-08-14 13:43 UTC (permalink / raw)
  To: linux-kernel; +Cc: broonie, khilman, tyler.baker, bamvor.zhangjian, shuahkh

This is my first attempt for improving the kselftest for arm/arm64
architecture. Eventually, we hope we could build(in an cross compile
environment) and run all the kselftest cases automatically(successful
of courses).

I realize that there are lots of improvement for kselftest after the
lastest pull request for kselftest. So, All my work is based on the
lastest linux-next tree ("30b42f4 Add linux-next specific files for
20150813").

In this series, I try to make all the testcases compiling and
installation successful.

Patch 1 rename jumplabel target to static_keys in the Makefile.

Patch 2 add CFLAGS_EXTRA to fix the cross comiling failure.

Patch 3 fix the running the installation issue for exec testcase.

Patch 4 check if there are files need to be installed. This is
useful when such testcase is not built for specific architecture.
E.g. x86 testcases for arm/arm64.

Patch 5, 6 and 7 check the architecture before build and install.

Bamvor Jian Zhang (7):
  selftests: rename jump label to static_keys
  selftests: add CFLAGS_EXTRA
  selftests: exec: fix for running and installing
  selftests: check before install
  selftests: disable seccomp for arm64
  selftests: only compile userfaultfd for x86 and powperpc
  selftests: breakpoints: fix installing error on the architecture
    except x86

 tools/testing/selftests/Makefile             |  3 +--
 tools/testing/selftests/breakpoints/Makefile | 16 +++-------------
 tools/testing/selftests/exec/Makefile        | 14 +++++++++++---
 tools/testing/selftests/lib.mk               | 15 ++++++++++-----
 tools/testing/selftests/seccomp/Makefile     |  6 ++++++
 tools/testing/selftests/vm/Makefile          | 12 ++++++++++++
 6 files changed, 43 insertions(+), 23 deletions(-)

-- 
2.1.4


^ permalink raw reply	[flat|nested] 29+ messages in thread

* [PATCH 1/7] selftests: rename jump label to static_keys
  2015-08-14 13:43 [PATCH 0/7] Improvement kselftest support for arm and arm64 Bamvor Jian Zhang
@ 2015-08-14 13:43 ` Bamvor Jian Zhang
  2015-08-27 22:17   ` Shuah Khan
  2015-08-14 13:43 ` [PATCH 2/7] selftests: add CFLAGS_EXTRA Bamvor Jian Zhang
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 29+ messages in thread
From: Bamvor Jian Zhang @ 2015-08-14 13:43 UTC (permalink / raw)
  To: linux-kernel; +Cc: broonie, khilman, tyler.baker, bamvor.zhangjian, shuahkh

commit "2bf9e0a locking/static_keys: Provide a selftest" rename
jump_label directory to static_keys.

Signed-off-by: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org>
---
 tools/testing/selftests/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile
index 2cb20b7..5f1d643 100644
--- a/tools/testing/selftests/Makefile
+++ b/tools/testing/selftests/Makefile
@@ -16,12 +16,12 @@ TARGETS += powerpc
 TARGETS += ptrace
 TARGETS += seccomp
 TARGETS += size
+TARGETS += static_keys
 TARGETS += sysctl
 ifneq (1, $(quicktest))
 TARGETS += timers
 endif
 TARGETS += user
-TARGETS += jumplabel
 TARGETS += vm
 TARGETS += x86
 #Please keep the TARGETS list alphabetically sorted
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 2/7] selftests: add CFLAGS_EXTRA
  2015-08-14 13:43 [PATCH 0/7] Improvement kselftest support for arm and arm64 Bamvor Jian Zhang
  2015-08-14 13:43 ` [PATCH 1/7] selftests: rename jump label to static_keys Bamvor Jian Zhang
@ 2015-08-14 13:43 ` Bamvor Jian Zhang
  2015-08-24  3:48   ` Michael Ellerman
  2015-08-14 13:43 ` [PATCH 3/7] selftests: exec: fix for running and installing Bamvor Jian Zhang
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 29+ messages in thread
From: Bamvor Jian Zhang @ 2015-08-14 13:43 UTC (permalink / raw)
  To: linux-kernel; +Cc: broonie, khilman, tyler.baker, bamvor.zhangjian, shuahkh

One may pass the "-I /path/to/headers -L /path/to/lib" through
CFLAGS_EXTRA for cross compiling. mqueue could compile pass
in this way when we provide the popt.h and libpopt.so. And kdbus
could compile pass with sys/capability and libcap.so

Sed-off-by: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org>

--
Originally, I want to add something like --sysroot to the compile
which mean the user need to provide the full filesystem including
headers and library for compiler. With CFLAGS_EXTRA, the user only
need to provide the minimal headers and/or librarys for building.
---
 tools/testing/selftests/lib.mk | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk
index ee412ba..1acfd02 100644
--- a/tools/testing/selftests/lib.mk
+++ b/tools/testing/selftests/lib.mk
@@ -2,6 +2,8 @@
 # Makefile can operate with or without the kbuild infrastructure.
 CC := $(CROSS_COMPILE)gcc
 
+CFLAGS += $(CFLAGS_EXTRA)
+
 define RUN_TESTS
 	@for TEST in $(TEST_PROGS); do \
 		(./$$TEST && echo "selftests: $$TEST [PASS]") || echo "selftests: $$TEST [FAIL]"; \
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 3/7] selftests: exec: fix for running and installing
  2015-08-14 13:43 [PATCH 0/7] Improvement kselftest support for arm and arm64 Bamvor Jian Zhang
  2015-08-14 13:43 ` [PATCH 1/7] selftests: rename jump label to static_keys Bamvor Jian Zhang
  2015-08-14 13:43 ` [PATCH 2/7] selftests: add CFLAGS_EXTRA Bamvor Jian Zhang
@ 2015-08-14 13:43 ` Bamvor Jian Zhang
  2015-08-27 10:55   ` Michael Ellerman
  2015-08-14 13:43 ` [PATCH 4/7] selftests: check before install Bamvor Jian Zhang
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 29+ messages in thread
From: Bamvor Jian Zhang @ 2015-08-14 13:43 UTC (permalink / raw)
  To: linux-kernel; +Cc: broonie, khilman, tyler.baker, bamvor.zhangjian, shuahkh

Fix three issues in exec testcase:

Add RUN_TESTS rules in order to running the testcases in the build
directory through "make TARGETS=exec kselftest"

Copy symbol link and non-executable file instead of install it,
otherwise this test will fail after installation.

Exec testcases need a "Makefile" in line 346, otherwise it will
be ENOENT instead of EACCES.

Signed-off-by: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org>
---
 tools/testing/selftests/exec/Makefile | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/tools/testing/selftests/exec/Makefile b/tools/testing/selftests/exec/Makefile
index 6b76bfd..34966a0 100644
--- a/tools/testing/selftests/exec/Makefile
+++ b/tools/testing/selftests/exec/Makefile
@@ -1,4 +1,4 @@
-CFLAGS = -Wall
+CFLAGS = -Wall -g
 BINARIES = execveat
 DEPS = execveat.symlink execveat.denatured script
 all: $(BINARIES) $(DEPS)
@@ -18,11 +18,19 @@ execveat.denatured: execveat
 	$(CC) $(CFLAGS) -o $@ $^
 
 TEST_PROGS := execveat
-TEST_FILES := $(DEPS)
+TEST_FILES := script
 
 include ../lib.mk
 
-override EMIT_TESTS := echo "mkdir -p subdir; (./execveat && echo \"selftests: execveat [PASS]\") || echo \"selftests: execveat [FAIL]\""
+override RUN_TESTS := mkdir -p subdir; (./execveat && echo "selftests: execveat [PASS]") || echo "selftests: execveat [FAIL]"
+
+override EMIT_TESTS := echo "mkdir -p subdir; touch Makefile; (./execveat && echo \"selftests: execveat [PASS]\") || echo \"selftests: execveat [FAIL]\""
+
+override define INSTALL_RULE
+       mkdir -p $(INSTALL_PATH)
+       install -t $(INSTALL_PATH) $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES)
+       cp -a execveat.symlink execveat.denatured $(INSTALL_PATH)
+endef
 
 clean:
 	rm -rf $(BINARIES) $(DEPS) subdir.moved execveat.moved xxxxx*
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 4/7] selftests: check before install
  2015-08-14 13:43 [PATCH 0/7] Improvement kselftest support for arm and arm64 Bamvor Jian Zhang
                   ` (2 preceding siblings ...)
  2015-08-14 13:43 ` [PATCH 3/7] selftests: exec: fix for running and installing Bamvor Jian Zhang
@ 2015-08-14 13:43 ` Bamvor Jian Zhang
  2015-08-27 20:10   ` Shuah Khan
  2015-08-14 13:43 ` [PATCH 5/7] selftests: disable seccomp for arm64 Bamvor Jian Zhang
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 29+ messages in thread
From: Bamvor Jian Zhang @ 2015-08-14 13:43 UTC (permalink / raw)
  To: linux-kernel; +Cc: broonie, khilman, tyler.baker, bamvor.zhangjian, shuahkh

When the test cases is not supported by the current architecture
the install files(TEST_PROGS, TEST_PROGS_EXTENDED and TEST_FILES)
will be empty. Check it before installation to dismiss a failure
reported by install program.

Signed-off-by: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org>
---
 tools/testing/selftests/Makefile |  1 -
 tools/testing/selftests/lib.mk   | 13 ++++++++-----
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile
index 5f1d643..1d4a29a 100644
--- a/tools/testing/selftests/Makefile
+++ b/tools/testing/selftests/Makefile
@@ -73,7 +73,6 @@ ifdef INSTALL_PATH
 	@# Ask all targets to install their files
 	mkdir -p $(INSTALL_PATH)
 	for TARGET in $(TARGETS); do \
-		mkdir -p $(INSTALL_PATH)/$$TARGET ; \
 		make -C $$TARGET INSTALL_PATH=$(INSTALL_PATH)/$$TARGET install; \
 	done;
 
diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk
index 1acfd02..4e14665 100644
--- a/tools/testing/selftests/lib.mk
+++ b/tools/testing/selftests/lib.mk
@@ -14,11 +14,14 @@ run_tests: all
 	$(RUN_TESTS)
 
 define INSTALL_RULE
-	mkdir -p $(INSTALL_PATH)
-	@for TEST_DIR in $(TEST_DIRS); do\
-		cp -r $$TEST_DIR $(INSTALL_PATH); \
-	done;
-	install -t $(INSTALL_PATH) $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES)
+	@if [ "X$(TEST_PROGS)$(TEST_PROGS_EXTENDED)$(TEST_FILES)" != "X" ]; then			\
+		mkdir -p $(INSTALL_PATH);								\
+		for TEST_DIR in $(TEST_DIRS); do							\
+			cp -r $$TEST_DIR $(INSTALL_PATH);						\
+		done;											\
+		echo "install -t $(INSTALL_PATH) $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES)";	\
+		install -t $(INSTALL_PATH) $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES);		\
+	fi
 endef
 
 install: all
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 5/7] selftests: disable seccomp for arm64
  2015-08-14 13:43 [PATCH 0/7] Improvement kselftest support for arm and arm64 Bamvor Jian Zhang
                   ` (3 preceding siblings ...)
  2015-08-14 13:43 ` [PATCH 4/7] selftests: check before install Bamvor Jian Zhang
@ 2015-08-14 13:43 ` Bamvor Jian Zhang
  2015-08-24  3:48   ` Michael Ellerman
  2015-08-14 13:43 ` [PATCH 6/7] selftests: only compile userfaultfd for x86 and powperpc Bamvor Jian Zhang
  2015-08-14 13:43 ` [PATCH 7/7] selftests: breakpoints: fix installing error on the architecture except x86 Bamvor Jian Zhang
  6 siblings, 1 reply; 29+ messages in thread
From: Bamvor Jian Zhang @ 2015-08-14 13:43 UTC (permalink / raw)
  To: linux-kernel; +Cc: broonie, khilman, tyler.baker, bamvor.zhangjian, shuahkh

Currently, seccomp need the __NR_poll which is not supported
by arm64(There is only __NR_ppoll). I am not sure we should
skip this test testcase or update the seccomp without __NR_poll.

Signed-off-by: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org>
---
 tools/testing/selftests/seccomp/Makefile | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tools/testing/selftests/seccomp/Makefile b/tools/testing/selftests/seccomp/Makefile
index 8401e87..ea2793a 100644
--- a/tools/testing/selftests/seccomp/Makefile
+++ b/tools/testing/selftests/seccomp/Makefile
@@ -1,4 +1,10 @@
+
+uname_M := $(shell uname -m 2>/dev/null || echo not)
+ARCH ?= $(shell echo $(uname_M) | sed -e s/aarch64.*/arm64/)
+
+ifneq ($(ARCH),arm64)
 TEST_PROGS := seccomp_bpf
+endif
 CFLAGS += -Wl,-no-as-needed -Wall
 LDFLAGS += -lpthread
 
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 6/7] selftests: only compile userfaultfd for x86 and powperpc
  2015-08-14 13:43 [PATCH 0/7] Improvement kselftest support for arm and arm64 Bamvor Jian Zhang
                   ` (4 preceding siblings ...)
  2015-08-14 13:43 ` [PATCH 5/7] selftests: disable seccomp for arm64 Bamvor Jian Zhang
@ 2015-08-14 13:43 ` Bamvor Jian Zhang
  2015-08-27 22:20   ` Shuah Khan
  2015-08-31  3:26   ` Michael Ellerman
  2015-08-14 13:43 ` [PATCH 7/7] selftests: breakpoints: fix installing error on the architecture except x86 Bamvor Jian Zhang
  6 siblings, 2 replies; 29+ messages in thread
From: Bamvor Jian Zhang @ 2015-08-14 13:43 UTC (permalink / raw)
  To: linux-kernel; +Cc: broonie, khilman, tyler.baker, bamvor.zhangjian, shuahkh

Signed-off-by: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org>
---
 tools/testing/selftests/vm/Makefile | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/tools/testing/selftests/vm/Makefile b/tools/testing/selftests/vm/Makefile
index bb888c6..4dd6e4f 100644
--- a/tools/testing/selftests/vm/Makefile
+++ b/tools/testing/selftests/vm/Makefile
@@ -1,5 +1,15 @@
 # Makefile for vm selftests
 
+uname_M := $(shell uname -m 2>/dev/null || echo not)
+ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/i386/ -e s/ppc.*/powerpc/)
+
+ifeq ($(ARCH),powerpc)
+support_userfaultfd = yes
+endif
+ifeq ($(ARCH),x86)
+support_userfaultfd = yes
+endif
+
 CFLAGS = -Wall
 BINARIES = compaction_test
 BINARIES += hugepage-mmap
@@ -9,7 +19,9 @@ BINARIES += mlock2-tests
 BINARIES += on-fault-limit
 BINARIES += thuge-gen
 BINARIES += transhuge-stress
+ifdef support_userfaultfd
 BINARIES += userfaultfd
+endif
 
 all: $(BINARIES)
 %: %.c
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 7/7] selftests: breakpoints: fix installing error on the architecture except x86
  2015-08-14 13:43 [PATCH 0/7] Improvement kselftest support for arm and arm64 Bamvor Jian Zhang
                   ` (5 preceding siblings ...)
  2015-08-14 13:43 ` [PATCH 6/7] selftests: only compile userfaultfd for x86 and powperpc Bamvor Jian Zhang
@ 2015-08-14 13:43 ` Bamvor Jian Zhang
  2015-08-27 14:16   ` Shuah Khan
  6 siblings, 1 reply; 29+ messages in thread
From: Bamvor Jian Zhang @ 2015-08-14 13:43 UTC (permalink / raw)
  To: linux-kernel; +Cc: broonie, khilman, tyler.baker, bamvor.zhangjian, shuahkh

Signed-off-by: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org>
---
 tools/testing/selftests/breakpoints/Makefile | 16 +++-------------
 1 file changed, 3 insertions(+), 13 deletions(-)

diff --git a/tools/testing/selftests/breakpoints/Makefile b/tools/testing/selftests/breakpoints/Makefile
index 1822356..d27108b 100644
--- a/tools/testing/selftests/breakpoints/Makefile
+++ b/tools/testing/selftests/breakpoints/Makefile
@@ -1,22 +1,12 @@
 # Taken from perf makefile
 uname_M := $(shell uname -m 2>/dev/null || echo not)
-ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/i386/)
-ifeq ($(ARCH),i386)
-        ARCH := x86
-endif
-ifeq ($(ARCH),x86_64)
-	ARCH := x86
-endif
+ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/x86/ -e s/x86_64/x86/)
 
-
-all:
 ifeq ($(ARCH),x86)
-	gcc breakpoint_test.c -o breakpoint_test
-else
-	echo "Not an x86 target, can't build breakpoints selftests"
+TEST_PROGS := breakpoint_test
 endif
 
-TEST_PROGS := breakpoint_test
+all:
 
 include ../lib.mk
 
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* Re: [PATCH 2/7] selftests: add CFLAGS_EXTRA
  2015-08-14 13:43 ` [PATCH 2/7] selftests: add CFLAGS_EXTRA Bamvor Jian Zhang
@ 2015-08-24  3:48   ` Michael Ellerman
  2015-08-25 12:49     ` Bamvor Zhang Jian
  0 siblings, 1 reply; 29+ messages in thread
From: Michael Ellerman @ 2015-08-24  3:48 UTC (permalink / raw)
  To: Bamvor Jian Zhang; +Cc: linux-kernel, broonie, khilman, tyler.baker, shuahkh

On Fri, 2015-08-14 at 21:43 +0800, Bamvor Jian Zhang wrote:
> One may pass the "-I /path/to/headers -L /path/to/lib" through
> CFLAGS_EXTRA for cross compiling. mqueue could compile pass
> in this way when we provide the popt.h and libpopt.so. And kdbus
> could compile pass with sys/capability and libcap.so

There should be no need to define a new variable.

You should just update the relevant Makefiles to use CFLAGS += rather than
CFLAGS =. And then you can just specifiy CFLAGS on the command line.

cheers



^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH 5/7] selftests: disable seccomp for arm64
  2015-08-14 13:43 ` [PATCH 5/7] selftests: disable seccomp for arm64 Bamvor Jian Zhang
@ 2015-08-24  3:48   ` Michael Ellerman
  2015-08-25 12:51     ` Bamvor Zhang Jian
  0 siblings, 1 reply; 29+ messages in thread
From: Michael Ellerman @ 2015-08-24  3:48 UTC (permalink / raw)
  To: Bamvor Jian Zhang; +Cc: linux-kernel, broonie, khilman, tyler.baker, shuahkh

On Fri, 2015-08-14 at 21:43 +0800, Bamvor Jian Zhang wrote:
> Currently, seccomp need the __NR_poll which is not supported
> by arm64(There is only __NR_ppoll). I am not sure we should
> skip this test testcase or update the seccomp without __NR_poll.

You should fix or skip the test that needs __NR_poll, not skip the entire test
suite.

You should also CC the author of the tests, they might be able to help you.

cheers




^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH 2/7] selftests: add CFLAGS_EXTRA
  2015-08-24  3:48   ` Michael Ellerman
@ 2015-08-25 12:49     ` Bamvor Zhang Jian
  2015-08-27 10:23       ` Michael Ellerman
  0 siblings, 1 reply; 29+ messages in thread
From: Bamvor Zhang Jian @ 2015-08-25 12:49 UTC (permalink / raw)
  To: Michael Ellerman; +Cc: linux-kernel, Mark Brown, khilman, tyler.baker, shuahkh



On 08/24/2015 11:48 AM, Michael Ellerman wrote:
> On Fri, 2015-08-14 at 21:43 +0800, Bamvor Jian Zhang wrote:
>> One may pass the "-I /path/to/headers -L /path/to/lib" through
>> CFLAGS_EXTRA for cross compiling. mqueue could compile pass
>> in this way when we provide the popt.h and libpopt.so. And kdbus
>> could compile pass with sys/capability and libcap.so
> 
> There should be no need to define a new variable.
> 
> You should just update the relevant Makefiles to use CFLAGS += rather than
> CFLAGS =. And then you can just specifiy CFLAGS on the command line.
yeap, it works for me. There is only one line need to be changed:
diff --git a/tools/testing/selftests/mqueue/Makefile b/tools/testing/selftests/mqueue/Makefile
index 0e3b41e..ca8327f 100644
--- a/tools/testing/selftests/mqueue/Makefile
+++ b/tools/testing/selftests/mqueue/Makefile
@@ -1,4 +1,4 @@
-CFLAGS = -O2
+CFLAGS += -O2
 
 all:
 	$(CC) $(CFLAGS) mq_open_tests.c -o mq_open_tests -lrt

regards

bamvor
> 
> cheers
> 
> 

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* Re: [PATCH 5/7] selftests: disable seccomp for arm64
  2015-08-24  3:48   ` Michael Ellerman
@ 2015-08-25 12:51     ` Bamvor Zhang Jian
  0 siblings, 0 replies; 29+ messages in thread
From: Bamvor Zhang Jian @ 2015-08-25 12:51 UTC (permalink / raw)
  To: Michael Ellerman; +Cc: linux-kernel, Mark Brown, khilman, tyler.baker, shuahkh

Hi, Michael

On 08/24/2015 11:48 AM, Michael Ellerman wrote:
> On Fri, 2015-08-14 at 21:43 +0800, Bamvor Jian Zhang wrote:
>> Currently, seccomp need the __NR_poll which is not supported
>> by arm64(There is only __NR_ppoll). I am not sure we should
>> skip this test testcase or update the seccomp without __NR_poll.
> 
> You should fix or skip the test that needs __NR_poll, not skip the entire test
> suite.
> 
> You should also CC the author of the tests, they might be able to help you.
Thanks you suggestion. I am trying to do this.

regards

bamvor
> 
> cheers
> 
> 
> 

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH 2/7] selftests: add CFLAGS_EXTRA
  2015-08-25 12:49     ` Bamvor Zhang Jian
@ 2015-08-27 10:23       ` Michael Ellerman
  0 siblings, 0 replies; 29+ messages in thread
From: Michael Ellerman @ 2015-08-27 10:23 UTC (permalink / raw)
  To: Bamvor Zhang Jian; +Cc: linux-kernel, Mark Brown, khilman, tyler.baker, shuahkh

On Tue, 2015-08-25 at 20:49 +0800, Bamvor Zhang Jian wrote:
> 
> On 08/24/2015 11:48 AM, Michael Ellerman wrote:
> > On Fri, 2015-08-14 at 21:43 +0800, Bamvor Jian Zhang wrote:
> >> One may pass the "-I /path/to/headers -L /path/to/lib" through
> >> CFLAGS_EXTRA for cross compiling. mqueue could compile pass
> >> in this way when we provide the popt.h and libpopt.so. And kdbus
> >> could compile pass with sys/capability and libcap.so
> > 
> > There should be no need to define a new variable.
> > 
> > You should just update the relevant Makefiles to use CFLAGS += rather than
> > CFLAGS =. And then you can just specifiy CFLAGS on the command line.

> yeap, it works for me. There is only one line need to be changed:

OK, so please send a patch to update that Makefile.

> diff --git a/tools/testing/selftests/mqueue/Makefile b/tools/testing/selftests/mqueue/Makefile
> index 0e3b41e..ca8327f 100644
> --- a/tools/testing/selftests/mqueue/Makefile
> +++ b/tools/testing/selftests/mqueue/Makefile
> @@ -1,4 +1,4 @@
> -CFLAGS = -O2
> +CFLAGS += -O2
>  
>  all:
>  	$(CC) $(CFLAGS) mq_open_tests.c -o mq_open_tests -lrt

And this can be simplified to:

LDLIBS = -lrt

all: mq_open_tests

cheers



^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH 3/7] selftests: exec: fix for running and installing
  2015-08-14 13:43 ` [PATCH 3/7] selftests: exec: fix for running and installing Bamvor Jian Zhang
@ 2015-08-27 10:55   ` Michael Ellerman
  0 siblings, 0 replies; 29+ messages in thread
From: Michael Ellerman @ 2015-08-27 10:55 UTC (permalink / raw)
  To: Bamvor Jian Zhang; +Cc: linux-kernel, broonie, khilman, tyler.baker, shuahkh

On Fri, 2015-08-14 at 21:43 +0800, Bamvor Jian Zhang wrote:
> Fix three issues in exec testcase:

In future please describe the issues you're trying to fix. Below you describe
only the *fixes*, which means I have to work backward to work out what the
issues were.

> Add RUN_TESTS rules in order to running the testcases in the build
> directory through "make TARGETS=exec kselftest"

OK so the problem here is that subdir isn't created when we're *not*
installing. It looks like we actually broke that in commit 84cbd9e4c457
("selftests/exec: do not install subdir as it is already created").

If so I think the fix is just to add subdir as a dependency of all isn't it?

> Copy symbol link and non-executable file instead of install it,
> otherwise this test will fail after installation.

And the problem here is that install wrecks the permissions, right?

> Exec testcases need a "Makefile" in line 346, otherwise it will
> be ENOENT instead of EACCES.

OK. It seems it would be cleaner to have the test create a specific test file,
rather than relying on the presence of the Makefile.


I've been wondering if we should just be using rsync to install the files,
rather than the current method. That way if the Makefile creates the correct
files, they should then appear exactly the same in the installed directory.

I had a quick look at it a while back, but didn't have time to test it 100%.
Does the patch below fix it for you?

cheers


diff --git a/tools/testing/selftests/ftrace/Makefile b/tools/testing/selftests/ftrace/Makefile
index 0acbeca47225..4e6ed13e7f66 100644
--- a/tools/testing/selftests/ftrace/Makefile
+++ b/tools/testing/selftests/ftrace/Makefile
@@ -1,7 +1,7 @@
 all:
 
 TEST_PROGS := ftracetest
-TEST_DIRS := test.d/
+TEST_DIRS := test.d
 
 include ../lib.mk
 
diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk
index ee412bab7ed4..7082b7e8a2ee 100644
--- a/tools/testing/selftests/lib.mk
+++ b/tools/testing/selftests/lib.mk
@@ -13,10 +13,7 @@ run_tests: all
 
 define INSTALL_RULE
        mkdir -p $(INSTALL_PATH)
-       @for TEST_DIR in $(TEST_DIRS); do\
-               cp -r $$TEST_DIR $(INSTALL_PATH); \
-       done;
-       install -t $(INSTALL_PATH) $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES)
+       rsync -a $(TEST_DIRS) $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES) $(INSTALL_PATH)/
 endef
 
 install: all






^ permalink raw reply related	[flat|nested] 29+ messages in thread

* Re: [PATCH 7/7] selftests: breakpoints: fix installing error on the architecture except x86
  2015-08-14 13:43 ` [PATCH 7/7] selftests: breakpoints: fix installing error on the architecture except x86 Bamvor Jian Zhang
@ 2015-08-27 14:16   ` Shuah Khan
  2015-08-27 22:14     ` Shuah Khan
  0 siblings, 1 reply; 29+ messages in thread
From: Shuah Khan @ 2015-08-27 14:16 UTC (permalink / raw)
  To: Bamvor Jian Zhang, linux-kernel; +Cc: broonie, khilman, tyler.baker, Shuah Khan

On 08/14/2015 07:43 AM, Bamvor Jian Zhang wrote:
> Signed-off-by: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org>

Hi Bamvor,

Could you please add commit log with more details on the error you
are seeing. I would like to get this patch into kselftest next for
4.3 soon

thanks,
-- Shuah
> ---
>  tools/testing/selftests/breakpoints/Makefile | 16 +++-------------
>  1 file changed, 3 insertions(+), 13 deletions(-)
> 
> diff --git a/tools/testing/selftests/breakpoints/Makefile b/tools/testing/selftests/breakpoints/Makefile
> index 1822356..d27108b 100644
> --- a/tools/testing/selftests/breakpoints/Makefile
> +++ b/tools/testing/selftests/breakpoints/Makefile
> @@ -1,22 +1,12 @@
>  # Taken from perf makefile
>  uname_M := $(shell uname -m 2>/dev/null || echo not)
> -ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/i386/)
> -ifeq ($(ARCH),i386)
> -        ARCH := x86
> -endif
> -ifeq ($(ARCH),x86_64)
> -	ARCH := x86
> -endif
> +ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/x86/ -e s/x86_64/x86/)
>  
> -
> -all:
>  ifeq ($(ARCH),x86)
> -	gcc breakpoint_test.c -o breakpoint_test
> -else
> -	echo "Not an x86 target, can't build breakpoints selftests"
> +TEST_PROGS := breakpoint_test
>  endif
>  
> -TEST_PROGS := breakpoint_test
> +all:
>  
>  include ../lib.mk
>  
> 


-- 
Shuah Khan
Sr. Linux Kernel Developer
Open Source Innovation Group
Samsung Research America (Silicon Valley)
shuahkh@osg.samsung.com | (970) 217-8978

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH 4/7] selftests: check before install
  2015-08-14 13:43 ` [PATCH 4/7] selftests: check before install Bamvor Jian Zhang
@ 2015-08-27 20:10   ` Shuah Khan
  2015-08-27 22:13     ` Shuah Khan
  0 siblings, 1 reply; 29+ messages in thread
From: Shuah Khan @ 2015-08-27 20:10 UTC (permalink / raw)
  To: Bamvor Jian Zhang, linux-kernel; +Cc: broonie, khilman, tyler.baker, Shuah Khan

On 08/14/2015 07:43 AM, Bamvor Jian Zhang wrote:
> When the test cases is not supported by the current architecture
> the install files(TEST_PROGS, TEST_PROGS_EXTENDED and TEST_FILES)
> will be empty. Check it before installation to dismiss a failure
> reported by install program.
> 
> Signed-off-by: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org>
> ---
>  tools/testing/selftests/Makefile |  1 -
>  tools/testing/selftests/lib.mk   | 13 ++++++++-----
>  2 files changed, 8 insertions(+), 6 deletions(-)
> 
> diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile
> index 5f1d643..1d4a29a 100644
> --- a/tools/testing/selftests/Makefile
> +++ b/tools/testing/selftests/Makefile
> @@ -73,7 +73,6 @@ ifdef INSTALL_PATH
>  	@# Ask all targets to install their files
>  	mkdir -p $(INSTALL_PATH)
>  	for TARGET in $(TARGETS); do \
> -		mkdir -p $(INSTALL_PATH)/$$TARGET ; \
>  		make -C $$TARGET INSTALL_PATH=$(INSTALL_PATH)/$$TARGET install; \
>  	done;
>  
> diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk
> index 1acfd02..4e14665 100644
> --- a/tools/testing/selftests/lib.mk
> +++ b/tools/testing/selftests/lib.mk
> @@ -14,11 +14,14 @@ run_tests: all
>  	$(RUN_TESTS)
>  
>  define INSTALL_RULE
> -	mkdir -p $(INSTALL_PATH)
> -	@for TEST_DIR in $(TEST_DIRS); do\
> -		cp -r $$TEST_DIR $(INSTALL_PATH); \
> -	done;
> -	install -t $(INSTALL_PATH) $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES)
> +	@if [ "X$(TEST_PROGS)$(TEST_PROGS_EXTENDED)$(TEST_FILES)" != "X" ]; then			\
> +		mkdir -p $(INSTALL_PATH);								\
> +		for TEST_DIR in $(TEST_DIRS); do							\
> +			cp -r $$TEST_DIR $(INSTALL_PATH);						\
> +		done;											\
> +		echo "install -t $(INSTALL_PATH) $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES)";	\
> +		install -t $(INSTALL_PATH) $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES);		\
> +	fi
>  endef
>  
>  install: all
> 

Hi Bamvor,

This patch works as intended for tests that use the default
INSTALL_RULE. In the cases where INSTALL_RULE is overridden
as in the case of powerpc, powerpc directory still gets created
during install.

It would be nice if we can fix it for the override cases as well.
I will get this into 4.3 for now. Would you like to send a patch
to fix the override cases as well??

thanks,
-- Shuah

-- 
Shuah Khan
Sr. Linux Kernel Developer
Open Source Innovation Group
Samsung Research America (Silicon Valley)
shuahkh@osg.samsung.com | (970) 217-8978

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH 4/7] selftests: check before install
  2015-08-27 20:10   ` Shuah Khan
@ 2015-08-27 22:13     ` Shuah Khan
  0 siblings, 0 replies; 29+ messages in thread
From: Shuah Khan @ 2015-08-27 22:13 UTC (permalink / raw)
  To: Bamvor Jian Zhang, linux-kernel; +Cc: broonie, khilman, tyler.baker, Shuah Khan

On 08/27/2015 02:10 PM, Shuah Khan wrote:
> On 08/14/2015 07:43 AM, Bamvor Jian Zhang wrote:
>> When the test cases is not supported by the current architecture
>> the install files(TEST_PROGS, TEST_PROGS_EXTENDED and TEST_FILES)
>> will be empty. Check it before installation to dismiss a failure
>> reported by install program.
>>
>> Signed-off-by: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org>
>> ---
>>  tools/testing/selftests/Makefile |  1 -
>>  tools/testing/selftests/lib.mk   | 13 ++++++++-----
>>  2 files changed, 8 insertions(+), 6 deletions(-)
>>
>> diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile
>> index 5f1d643..1d4a29a 100644
>> --- a/tools/testing/selftests/Makefile
>> +++ b/tools/testing/selftests/Makefile
>> @@ -73,7 +73,6 @@ ifdef INSTALL_PATH
>>  	@# Ask all targets to install their files
>>  	mkdir -p $(INSTALL_PATH)
>>  	for TARGET in $(TARGETS); do \
>> -		mkdir -p $(INSTALL_PATH)/$$TARGET ; \
>>  		make -C $$TARGET INSTALL_PATH=$(INSTALL_PATH)/$$TARGET install; \
>>  	done;
>>  
>> diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk
>> index 1acfd02..4e14665 100644
>> --- a/tools/testing/selftests/lib.mk
>> +++ b/tools/testing/selftests/lib.mk
>> @@ -14,11 +14,14 @@ run_tests: all
>>  	$(RUN_TESTS)
>>  
>>  define INSTALL_RULE
>> -	mkdir -p $(INSTALL_PATH)
>> -	@for TEST_DIR in $(TEST_DIRS); do\
>> -		cp -r $$TEST_DIR $(INSTALL_PATH); \
>> -	done;
>> -	install -t $(INSTALL_PATH) $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES)
>> +	@if [ "X$(TEST_PROGS)$(TEST_PROGS_EXTENDED)$(TEST_FILES)" != "X" ]; then			\
>> +		mkdir -p $(INSTALL_PATH);								\
>> +		for TEST_DIR in $(TEST_DIRS); do							\
>> +			cp -r $$TEST_DIR $(INSTALL_PATH);						\
>> +		done;											\
>> +		echo "install -t $(INSTALL_PATH) $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES)";	\
>> +		install -t $(INSTALL_PATH) $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES);		\
>> +	fi
>>  endef
>>  
>>  install: all
>>
> 
> Hi Bamvor,
> 
> This patch works as intended for tests that use the default
> INSTALL_RULE. In the cases where INSTALL_RULE is overridden
> as in the case of powerpc, powerpc directory still gets created
> during install.
> 
> It would be nice if we can fix it for the override cases as well.
> I will get this into 4.3 for now. Would you like to send a patch
> to fix the override cases as well??
> 

Applied to linux-kselftest next for 4.3-rc1.

thanks,
-- Shuah


-- 
Shuah Khan
Sr. Linux Kernel Developer
Open Source Innovation Group
Samsung Research America (Silicon Valley)
shuahkh@osg.samsung.com | (970) 217-8978

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH 7/7] selftests: breakpoints: fix installing error on the architecture except x86
  2015-08-27 14:16   ` Shuah Khan
@ 2015-08-27 22:14     ` Shuah Khan
  0 siblings, 0 replies; 29+ messages in thread
From: Shuah Khan @ 2015-08-27 22:14 UTC (permalink / raw)
  To: Bamvor Jian Zhang, linux-kernel; +Cc: broonie, khilman, tyler.baker, Shuah Khan

On 08/27/2015 08:16 AM, Shuah Khan wrote:
> On 08/14/2015 07:43 AM, Bamvor Jian Zhang wrote:
>> Signed-off-by: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org>
> 
> Hi Bamvor,
> 
> Could you please add commit log with more details on the error you
> are seeing. I would like to get this patch into kselftest next for
> 4.3 soon
> 
> thanks,
> -- Shuah

Never mind. I applied the patch to linux-kselftest next for 4.3-rc1

thanks,
-- Shuah


-- 
Shuah Khan
Sr. Linux Kernel Developer
Open Source Innovation Group
Samsung Research America (Silicon Valley)
shuahkh@osg.samsung.com | (970) 217-8978

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH 1/7] selftests: rename jump label to static_keys
  2015-08-14 13:43 ` [PATCH 1/7] selftests: rename jump label to static_keys Bamvor Jian Zhang
@ 2015-08-27 22:17   ` Shuah Khan
  2015-09-07 10:33     ` Michael Ellerman
  0 siblings, 1 reply; 29+ messages in thread
From: Shuah Khan @ 2015-08-27 22:17 UTC (permalink / raw)
  To: Bamvor Jian Zhang, linux-kernel; +Cc: broonie, khilman, tyler.baker, Shuah Khan

On 08/14/2015 07:43 AM, Bamvor Jian Zhang wrote:
> commit "2bf9e0a locking/static_keys: Provide a selftest" rename
> jump_label directory to static_keys.
> 
> Signed-off-by: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org>
> ---
>  tools/testing/selftests/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 

I will get this into 4.3-rc2, once the jump_label patch gets
into 4.3-rc1

thanks for the fix.
-- Shuah

-- 
Shuah Khan
Sr. Linux Kernel Developer
Open Source Innovation Group
Samsung Research America (Silicon Valley)
shuahkh@osg.samsung.com | (970) 217-8978

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH 6/7] selftests: only compile userfaultfd for x86 and powperpc
  2015-08-14 13:43 ` [PATCH 6/7] selftests: only compile userfaultfd for x86 and powperpc Bamvor Jian Zhang
@ 2015-08-27 22:20   ` Shuah Khan
  2015-08-31  3:26   ` Michael Ellerman
  1 sibling, 0 replies; 29+ messages in thread
From: Shuah Khan @ 2015-08-27 22:20 UTC (permalink / raw)
  To: Bamvor Jian Zhang, linux-kernel
  Cc: broonie, khilman, tyler.baker, Shuah Khan, Andrew Morton

On 08/14/2015 07:43 AM, Bamvor Jian Zhang wrote:
> Signed-off-by: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org>
> ---
>  tools/testing/selftests/vm/Makefile | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/tools/testing/selftests/vm/Makefile b/tools/testing/selftests/vm/Makefile
> index bb888c6..4dd6e4f 100644
> --- a/tools/testing/selftests/vm/Makefile
> +++ b/tools/testing/selftests/vm/Makefile
> @@ -1,5 +1,15 @@
>  # Makefile for vm selftests
>  
> +uname_M := $(shell uname -m 2>/dev/null || echo not)
> +ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/i386/ -e s/ppc.*/powerpc/)
> +
> +ifeq ($(ARCH),powerpc)
> +support_userfaultfd = yes
> +endif
> +ifeq ($(ARCH),x86)
> +support_userfaultfd = yes
> +endif
> +
>  CFLAGS = -Wall
>  BINARIES = compaction_test
>  BINARIES += hugepage-mmap
> @@ -9,7 +19,9 @@ BINARIES += mlock2-tests
>  BINARIES += on-fault-limit
>  BINARIES += thuge-gen
>  BINARIES += transhuge-stress
> +ifdef support_userfaultfd
>  BINARIES += userfaultfd
> +endif
>  
>  all: $(BINARIES)
>  %: %.c
> 

I will get this into 4.3-rc2 once the userfaultfd gets into
4.3-rc1. Thanks for the fix.

thanks,
-- Shuah

-- 
Shuah Khan
Sr. Linux Kernel Developer
Open Source Innovation Group
Samsung Research America (Silicon Valley)
shuahkh@osg.samsung.com | (970) 217-8978

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH 6/7] selftests: only compile userfaultfd for x86 and powperpc
  2015-08-14 13:43 ` [PATCH 6/7] selftests: only compile userfaultfd for x86 and powperpc Bamvor Jian Zhang
  2015-08-27 22:20   ` Shuah Khan
@ 2015-08-31  3:26   ` Michael Ellerman
  2015-09-08  9:15     ` Bamvor Zhang Jian
  1 sibling, 1 reply; 29+ messages in thread
From: Michael Ellerman @ 2015-08-31  3:26 UTC (permalink / raw)
  To: Bamvor Jian Zhang; +Cc: linux-kernel, broonie, khilman, tyler.baker, shuahkh

On Fri, 2015-08-14 at 21:43 +0800, Bamvor Jian Zhang wrote:
> Signed-off-by: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org>
> ---
>  tools/testing/selftests/vm/Makefile | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/tools/testing/selftests/vm/Makefile b/tools/testing/selftests/vm/Makefile
> index bb888c6..4dd6e4f 100644
> --- a/tools/testing/selftests/vm/Makefile
> +++ b/tools/testing/selftests/vm/Makefile
> @@ -1,5 +1,15 @@
>  # Makefile for vm selftests
>  
> +uname_M := $(shell uname -m 2>/dev/null || echo not)
> +ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/i386/ -e s/ppc.*/powerpc/)
> +
> +ifeq ($(ARCH),powerpc)
> +support_userfaultfd = yes
> +endif
> +ifeq ($(ARCH),x86)
> +support_userfaultfd = yes
> +endif
> +
>  CFLAGS = -Wall
>  BINARIES = compaction_test
>  BINARIES += hugepage-mmap
> @@ -9,7 +19,9 @@ BINARIES += mlock2-tests
>  BINARIES += on-fault-limit
>  BINARIES += thuge-gen
>  BINARIES += transhuge-stress
> +ifdef support_userfaultfd
>  BINARIES += userfaultfd
> +endif
>  
>  all: $(BINARIES)
>  %: %.c


This is nasty. It means when userfaultfd gets implemented for other arches
someone has to remember to update the logic here, which they won't.

Instead the C program should just do nothing when __NR_userfaultfd is not defined, eg:

#ifdef __NR_userfaultfd

int main(int argc, char **argv)
{
	...
}

#else

int main(void)
{
	printf("skip: Skipping userfaultfd test\n");
	return 0;
}
#endif


This way when the syscall is implemented for other arches the test will just
start working.

cheers



^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH 1/7] selftests: rename jump label to static_keys
  2015-08-27 22:17   ` Shuah Khan
@ 2015-09-07 10:33     ` Michael Ellerman
  2015-09-08 13:03       ` Shuah Khan
  0 siblings, 1 reply; 29+ messages in thread
From: Michael Ellerman @ 2015-09-07 10:33 UTC (permalink / raw)
  To: Shuah Khan; +Cc: Bamvor Jian Zhang, linux-kernel, broonie, khilman, tyler.baker

On Thu, 2015-08-27 at 16:17 -0600, Shuah Khan wrote:
> On 08/14/2015 07:43 AM, Bamvor Jian Zhang wrote:
> > commit "2bf9e0a locking/static_keys: Provide a selftest" rename
> > jump_label directory to static_keys.
> > 
> > Signed-off-by: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org>
> > ---
> >  tools/testing/selftests/Makefile | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> 
> I will get this into 4.3-rc2, once the jump_label patch gets
> into 4.3-rc1
> 
> thanks for the fix.

Hi Shuah,

Currently the selftests don't build in Linus' tree due to this breakage.

Can you please pull this fix and send it to Linus?

thanks



^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH 6/7] selftests: only compile userfaultfd for x86 and powperpc
  2015-08-31  3:26   ` Michael Ellerman
@ 2015-09-08  9:15     ` Bamvor Zhang Jian
  2015-09-08  9:54       ` Michael Ellerman
  0 siblings, 1 reply; 29+ messages in thread
From: Bamvor Zhang Jian @ 2015-09-08  9:15 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: linux-kernel, Mark Brown, khilman, tyler.baker, shuahkh,
	Andrea Arcangeli

Hi, Michael

I thought I reply to you, but ...

On 08/31/2015 11:26 AM, Michael Ellerman wrote:
> On Fri, 2015-08-14 at 21:43 +0800, Bamvor Jian Zhang wrote:
>> Signed-off-by: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org>
>> ---
>>  tools/testing/selftests/vm/Makefile | 12 ++++++++++++
>>  1 file changed, 12 insertions(+)
>>
>> diff --git a/tools/testing/selftests/vm/Makefile b/tools/testing/selftests/vm/Makefile
>> index bb888c6..4dd6e4f 100644
>> --- a/tools/testing/selftests/vm/Makefile
>> +++ b/tools/testing/selftests/vm/Makefile
>> @@ -1,5 +1,15 @@
>>  # Makefile for vm selftests
>>  
>> +uname_M := $(shell uname -m 2>/dev/null || echo not)
>> +ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/i386/ -e s/ppc.*/powerpc/)
>> +
>> +ifeq ($(ARCH),powerpc)
>> +support_userfaultfd = yes
>> +endif
>> +ifeq ($(ARCH),x86)
>> +support_userfaultfd = yes
>> +endif
>> +
>>  CFLAGS = -Wall
>>  BINARIES = compaction_test
>>  BINARIES += hugepage-mmap
>> @@ -9,7 +19,9 @@ BINARIES += mlock2-tests
>>  BINARIES += on-fault-limit
>>  BINARIES += thuge-gen
>>  BINARIES += transhuge-stress
>> +ifdef support_userfaultfd
>>  BINARIES += userfaultfd
>> +endif
>>  
>>  all: $(BINARIES)
>>  %: %.c
> 
> 
> This is nasty. It means when userfaultfd gets implemented for other arches
> someone has to remember to update the logic here, which they won't.
> 
> Instead the C program should just do nothing when __NR_userfaultfd is not defined, eg:
> 
> #ifdef __NR_userfaultfd
> 
> int main(int argc, char **argv)
> {
> 	...
> }
> 
> #else
> 
> int main(void)
> {
> 	printf("skip: Skipping userfaultfd test\n");
> 	return 0;
> }
> #endif
> 
> 
> This way when the syscall is implemented for other arches the test will just
> start working.
> 
> cheers
> 
>
When read the following code, It seems that sometimes __NR_userfaultfd is not
defined but the syscall is exist. I am not sure why these piece is needed.
cc'd c

#ifndef __NR_userfaultfd
#ifdef __x86_64__
#define __NR_userfaultfd 323
#elif defined(__i386__)
#define __NR_userfaultfd 374
#elif defined(__powewrpc__)
#define __NR_userfaultfd 364
#else
#error "missing __NR_userfaultfd definition"
#endif
#endif

Do you mean that we should remove the above code?

regards

bamvor

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH 6/7] selftests: only compile userfaultfd for x86 and powperpc
  2015-09-08  9:15     ` Bamvor Zhang Jian
@ 2015-09-08  9:54       ` Michael Ellerman
  2015-09-08 12:25         ` Bamvor Zhang Jian
  0 siblings, 1 reply; 29+ messages in thread
From: Michael Ellerman @ 2015-09-08  9:54 UTC (permalink / raw)
  To: Bamvor Zhang Jian
  Cc: linux-kernel, Mark Brown, khilman, tyler.baker, shuahkh,
	Andrea Arcangeli

On Tue, 2015-09-08 at 17:15 +0800, Bamvor Zhang Jian wrote:
> Hi, Michael
> 
> I thought I reply to you, but ...
> 
> On 08/31/2015 11:26 AM, Michael Ellerman wrote:
> > On Fri, 2015-08-14 at 21:43 +0800, Bamvor Jian Zhang wrote:
> >> Signed-off-by: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org>
> >> ---
> >>  tools/testing/selftests/vm/Makefile | 12 ++++++++++++
> >>  1 file changed, 12 insertions(+)
> >>
> >> diff --git a/tools/testing/selftests/vm/Makefile b/tools/testing/selftests/vm/Makefile
> >> index bb888c6..4dd6e4f 100644
> >> --- a/tools/testing/selftests/vm/Makefile
> >> +++ b/tools/testing/selftests/vm/Makefile
> >> @@ -1,5 +1,15 @@
> >>  # Makefile for vm selftests
> >>  
> >> +uname_M := $(shell uname -m 2>/dev/null || echo not)
> >> +ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/i386/ -e s/ppc.*/powerpc/)
> >> +
> >> +ifeq ($(ARCH),powerpc)
> >> +support_userfaultfd = yes
> >> +endif
> >> +ifeq ($(ARCH),x86)
> >> +support_userfaultfd = yes
> >> +endif
> >> +
> >>  CFLAGS = -Wall
> >>  BINARIES = compaction_test
> >>  BINARIES += hugepage-mmap
> >> @@ -9,7 +19,9 @@ BINARIES += mlock2-tests
> >>  BINARIES += on-fault-limit
> >>  BINARIES += thuge-gen
> >>  BINARIES += transhuge-stress
> >> +ifdef support_userfaultfd
> >>  BINARIES += userfaultfd
> >> +endif
> >>  
> >>  all: $(BINARIES)
> >>  %: %.c
> > 
> > 
> > This is nasty. It means when userfaultfd gets implemented for other arches
> > someone has to remember to update the logic here, which they won't.
> > 
> > Instead the C program should just do nothing when __NR_userfaultfd is not defined, eg:
> > 
> > #ifdef __NR_userfaultfd
> > 
> > int main(int argc, char **argv)
> > {
> > 	...
> > }
> > 
> > #else
> > 
> > int main(void)
> > {
> > 	printf("skip: Skipping userfaultfd test\n");
> > 	return 0;
> > }
> > #endif
> > 
> > 
> > This way when the syscall is implemented for other arches the test will just
> > start working.
> > 
> > cheers
> > 
> >
> When read the following code, It seems that sometimes __NR_userfaultfd is not
> defined but the syscall is exist. I am not sure why these piece is needed.
> cc'd c
> 
> #ifndef __NR_userfaultfd
> #ifdef __x86_64__
> #define __NR_userfaultfd 323
> #elif defined(__i386__)
> #define __NR_userfaultfd 374
> #elif defined(__powewrpc__)
> #define __NR_userfaultfd 364
> #else
> #error "missing __NR_userfaultfd definition"
> #endif
> #endif
> 
> Do you mean that we should remove the above code?

Well yes, it would need to be removed to make the logic I suggested work.

I'm not sure those #defines actually help in practice, because if the syscall
number is not defined then linux/userfaultfd.h will not exist and the whole
test will not compile anyway.

I was suggesting something like this, which has the properties of:
 - not breaking the build on arches that don't have the syscall
 - still printing a notice on arches that don't have the syscall, both at build
   time and runtime.
 - building correctly on an arch as soon as that arch implements the syscall,
   with no extra changes required.

cheers


diff --git a/tools/testing/selftests/vm/userfaultfd.c b/tools/testing/selftests/vm/userfaultfd.c
index 2bf1fc3f562b..652c9d805006 100644
--- a/tools/testing/selftests/vm/userfaultfd.c
+++ b/tools/testing/selftests/vm/userfaultfd.c
@@ -64,19 +64,10 @@
 #include <sys/syscall.h>
 #include <sys/ioctl.h>
 #include <pthread.h>
-#include <linux/userfaultfd.h>
 
-#ifndef __NR_userfaultfd
-#ifdef __x86_64__
-#define __NR_userfaultfd 323
-#elif defined(__i386__)
-#define __NR_userfaultfd 374
-#elif defined(__powewrpc__)
-#define __NR_userfaultfd 364
-#else
-#error "missing __NR_userfaultfd definition"
-#endif
-#endif
+#ifdef __NR_userfaultfd
+
+#include <linux/userfaultfd.h>
 
 static unsigned long nr_cpus, nr_pages, nr_pages_per_cpu, page_size;
 
@@ -636,3 +627,15 @@ int main(int argc, char **argv)
 	       nr_pages, nr_pages_per_cpu);
 	return userfaultfd_stress();
 }
+
+#else /* ! __NR_userfaultfd */
+
+#warning "missing __NR_userfaultfd definition"
+
+int main(void)
+{
+	printf("skip: Skipping userfaultfd test (missing __NR_userfaultfd)\n");
+	return 0;
+}
+
+#endif



^ permalink raw reply related	[flat|nested] 29+ messages in thread

* Re: [PATCH 6/7] selftests: only compile userfaultfd for x86 and powperpc
  2015-09-08  9:54       ` Michael Ellerman
@ 2015-09-08 12:25         ` Bamvor Zhang Jian
  2015-09-08 14:34           ` Andrea Arcangeli
  0 siblings, 1 reply; 29+ messages in thread
From: Bamvor Zhang Jian @ 2015-09-08 12:25 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: linux-kernel, Mark Brown, khilman, tyler.baker, shuahkh,
	Andrea Arcangeli

Hi, Michael

On 09/08/2015 05:54 PM, Michael Ellerman wrote:
> On Tue, 2015-09-08 at 17:15 +0800, Bamvor Zhang Jian wrote:
>> Hi, Michael
>>
>> I thought I reply to you, but ...
>>
>> On 08/31/2015 11:26 AM, Michael Ellerman wrote:
>>> On Fri, 2015-08-14 at 21:43 +0800, Bamvor Jian Zhang wrote:
>>>> Signed-off-by: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org>
>>>> ---
>>>>  tools/testing/selftests/vm/Makefile | 12 ++++++++++++
>>>>  1 file changed, 12 insertions(+)
>>>>
>>>> diff --git a/tools/testing/selftests/vm/Makefile b/tools/testing/selftests/vm/Makefile
>>>> index bb888c6..4dd6e4f 100644
>>>> --- a/tools/testing/selftests/vm/Makefile
>>>> +++ b/tools/testing/selftests/vm/Makefile
>>>> @@ -1,5 +1,15 @@
>>>>  # Makefile for vm selftests
>>>>  
>>>> +uname_M := $(shell uname -m 2>/dev/null || echo not)
>>>> +ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/i386/ -e s/ppc.*/powerpc/)
>>>> +
>>>> +ifeq ($(ARCH),powerpc)
>>>> +support_userfaultfd = yes
>>>> +endif
>>>> +ifeq ($(ARCH),x86)
>>>> +support_userfaultfd = yes
>>>> +endif
>>>> +
>>>>  CFLAGS = -Wall
>>>>  BINARIES = compaction_test
>>>>  BINARIES += hugepage-mmap
>>>> @@ -9,7 +19,9 @@ BINARIES += mlock2-tests
>>>>  BINARIES += on-fault-limit
>>>>  BINARIES += thuge-gen
>>>>  BINARIES += transhuge-stress
>>>> +ifdef support_userfaultfd
>>>>  BINARIES += userfaultfd
>>>> +endif
>>>>  
>>>>  all: $(BINARIES)
>>>>  %: %.c
>>>
>>>
>>> This is nasty. It means when userfaultfd gets implemented for other arches
>>> someone has to remember to update the logic here, which they won't.
>>>
>>> Instead the C program should just do nothing when __NR_userfaultfd is not defined, eg:
>>>
>>> #ifdef __NR_userfaultfd
>>>
>>> int main(int argc, char **argv)
>>> {
>>> 	...
>>> }
>>>
>>> #else
>>>
>>> int main(void)
>>> {
>>> 	printf("skip: Skipping userfaultfd test\n");
>>> 	return 0;
>>> }
>>> #endif
>>>
>>>
>>> This way when the syscall is implemented for other arches the test will just
>>> start working.
>>>
>>> cheers
>>>
>>>
>> When read the following code, It seems that sometimes __NR_userfaultfd is not
>> defined but the syscall is exist. I am not sure why these piece is needed.
>> cc'd c
>>
>> #ifndef __NR_userfaultfd
>> #ifdef __x86_64__
>> #define __NR_userfaultfd 323
>> #elif defined(__i386__)
>> #define __NR_userfaultfd 374
>> #elif defined(__powewrpc__)
>> #define __NR_userfaultfd 364
>> #else
>> #error "missing __NR_userfaultfd definition"
>> #endif
>> #endif
>>
>> Do you mean that we should remove the above code?
> 
> Well yes, it would need to be removed to make the logic I suggested work.
> 
> I'm not sure those #defines actually help in practice, because if the syscall
> number is not defined then linux/userfaultfd.h will not exist and the whole
> test will not compile anyway.
> 
> I was suggesting something like this, which has the properties of:
>  - not breaking the build on arches that don't have the syscall
>  - still printing a notice on arches that don't have the syscall, both at build
>    time and runtime.
>  - building correctly on an arch as soon as that arch implements the syscall,
>    with no extra changes required.
Ok, I agree with you. I will send the updated patch later.
> cheers
> 
> 
> diff --git a/tools/testing/selftests/vm/userfaultfd.c b/tools/testing/selftests/vm/userfaultfd.c
> index 2bf1fc3f562b..652c9d805006 100644
> --- a/tools/testing/selftests/vm/userfaultfd.c
> +++ b/tools/testing/selftests/vm/userfaultfd.c
> @@ -64,19 +64,10 @@
>  #include <sys/syscall.h>
>  #include <sys/ioctl.h>
>  #include <pthread.h>
> -#include <linux/userfaultfd.h>
>  
> -#ifndef __NR_userfaultfd
> -#ifdef __x86_64__
> -#define __NR_userfaultfd 323
> -#elif defined(__i386__)
> -#define __NR_userfaultfd 374
> -#elif defined(__powewrpc__)
> -#define __NR_userfaultfd 364
> -#else
> -#error "missing __NR_userfaultfd definition"
> -#endif
> -#endif
> +#ifdef __NR_userfaultfd
> +
> +#include <linux/userfaultfd.h>
>  
>  static unsigned long nr_cpus, nr_pages, nr_pages_per_cpu, page_size;
>  
> @@ -636,3 +627,15 @@ int main(int argc, char **argv)
>  	       nr_pages, nr_pages_per_cpu);
>  	return userfaultfd_stress();
>  }
> +
> +#else /* ! __NR_userfaultfd */
> +
> +#warning "missing __NR_userfaultfd definition"
> +
> +int main(void)
> +{
> +	printf("skip: Skipping userfaultfd test (missing __NR_userfaultfd)\n");
> +	return 0;
> +}
> +
> +#endif
> 
> 

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH 1/7] selftests: rename jump label to static_keys
  2015-09-07 10:33     ` Michael Ellerman
@ 2015-09-08 13:03       ` Shuah Khan
  0 siblings, 0 replies; 29+ messages in thread
From: Shuah Khan @ 2015-09-08 13:03 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: Bamvor Jian Zhang, linux-kernel, broonie, khilman, tyler.baker,
	Shuah Khan

On 09/07/2015 04:33 AM, Michael Ellerman wrote:
> On Thu, 2015-08-27 at 16:17 -0600, Shuah Khan wrote:
>> On 08/14/2015 07:43 AM, Bamvor Jian Zhang wrote:
>>> commit "2bf9e0a locking/static_keys: Provide a selftest" rename
>>> jump_label directory to static_keys.
>>>
>>> Signed-off-by: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org>
>>> ---
>>>  tools/testing/selftests/Makefile | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>
>> I will get this into 4.3-rc2, once the jump_label patch gets
>> into 4.3-rc1
>>
>> thanks for the fix.
> 
> Hi Shuah,
> 
> Currently the selftests don't build in Linus' tree due to this breakage.
> 
> Can you please pull this fix and send it to Linus?
> 

Thanks for letting me know. I will include this in my pull-request.

-- Shuah


-- 
Shuah Khan
Sr. Linux Kernel Developer
Open Source Innovation Group
Samsung Research America (Silicon Valley)
shuahkh@osg.samsung.com | (970) 217-8978

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH 6/7] selftests: only compile userfaultfd for x86 and powperpc
  2015-09-08 12:25         ` Bamvor Zhang Jian
@ 2015-09-08 14:34           ` Andrea Arcangeli
  2015-09-09  8:43             ` Michael Ellerman
  0 siblings, 1 reply; 29+ messages in thread
From: Andrea Arcangeli @ 2015-09-08 14:34 UTC (permalink / raw)
  To: Bamvor Zhang Jian
  Cc: Michael Ellerman, linux-kernel, Mark Brown, khilman, tyler.baker,
	shuahkh

On Tue, Sep 08, 2015 at 08:25:45PM +0800, Bamvor Zhang Jian wrote:
> Hi, Michael
> 
> On 09/08/2015 05:54 PM, Michael Ellerman wrote:
> > On Tue, 2015-09-08 at 17:15 +0800, Bamvor Zhang Jian wrote:
> >> Hi, Michael
> >>
> >> I thought I reply to you, but ...
> >>
> >> On 08/31/2015 11:26 AM, Michael Ellerman wrote:
> >>> On Fri, 2015-08-14 at 21:43 +0800, Bamvor Jian Zhang wrote:
> >>>> Signed-off-by: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org>
> >>>> ---
> >>>>  tools/testing/selftests/vm/Makefile | 12 ++++++++++++
> >>>>  1 file changed, 12 insertions(+)
> >>>>
> >>>> diff --git a/tools/testing/selftests/vm/Makefile b/tools/testing/selftests/vm/Makefile
> >>>> index bb888c6..4dd6e4f 100644
> >>>> --- a/tools/testing/selftests/vm/Makefile
> >>>> +++ b/tools/testing/selftests/vm/Makefile
> >>>> @@ -1,5 +1,15 @@
> >>>>  # Makefile for vm selftests
> >>>>  
> >>>> +uname_M := $(shell uname -m 2>/dev/null || echo not)
> >>>> +ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/i386/ -e s/ppc.*/powerpc/)
> >>>> +
> >>>> +ifeq ($(ARCH),powerpc)
> >>>> +support_userfaultfd = yes
> >>>> +endif
> >>>> +ifeq ($(ARCH),x86)
> >>>> +support_userfaultfd = yes
> >>>> +endif
> >>>> +
> >>>>  CFLAGS = -Wall
> >>>>  BINARIES = compaction_test
> >>>>  BINARIES += hugepage-mmap
> >>>> @@ -9,7 +19,9 @@ BINARIES += mlock2-tests
> >>>>  BINARIES += on-fault-limit
> >>>>  BINARIES += thuge-gen
> >>>>  BINARIES += transhuge-stress
> >>>> +ifdef support_userfaultfd
> >>>>  BINARIES += userfaultfd
> >>>> +endif
> >>>>  
> >>>>  all: $(BINARIES)
> >>>>  %: %.c
> >>>
> >>>
> >>> This is nasty. It means when userfaultfd gets implemented for other arches
> >>> someone has to remember to update the logic here, which they won't.
> >>>
> >>> Instead the C program should just do nothing when __NR_userfaultfd is not defined, eg:
> >>>
> >>> #ifdef __NR_userfaultfd
> >>>
> >>> int main(int argc, char **argv)
> >>> {
> >>> 	...
> >>> }
> >>>
> >>> #else
> >>>
> >>> int main(void)
> >>> {
> >>> 	printf("skip: Skipping userfaultfd test\n");
> >>> 	return 0;
> >>> }
> >>> #endif
> >>>
> >>>
> >>> This way when the syscall is implemented for other arches the test will just
> >>> start working.
> >>>
> >>> cheers
> >>>
> >>>
> >> When read the following code, It seems that sometimes __NR_userfaultfd is not
> >> defined but the syscall is exist. I am not sure why these piece is needed.
> >> cc'd c
> >>
> >> #ifndef __NR_userfaultfd
> >> #ifdef __x86_64__
> >> #define __NR_userfaultfd 323
> >> #elif defined(__i386__)
> >> #define __NR_userfaultfd 374
> >> #elif defined(__powewrpc__)
> >> #define __NR_userfaultfd 364
> >> #else
> >> #error "missing __NR_userfaultfd definition"
> >> #endif
> >> #endif
> >>
> >> Do you mean that we should remove the above code?
> > 
> > Well yes, it would need to be removed to make the logic I suggested work.
> > 
> > I'm not sure those #defines actually help in practice, because if the syscall
> > number is not defined then linux/userfaultfd.h will not exist and the whole
> > test will not compile anyway.
> > 
> > I was suggesting something like this, which has the properties of:
> >  - not breaking the build on arches that don't have the syscall
> >  - still printing a notice on arches that don't have the syscall, both at build
> >    time and runtime.
> >  - building correctly on an arch as soon as that arch implements the syscall,
> >    with no extra changes required.
> Ok, I agree with you. I will send the updated patch later.

I already had a few minor changes queued to be submitted for arm and
ppc and a few updates to the selftest.

I didn't like that you had to remember running make headers_install
for changes like the below one to build, so I added the dependency so
that "make" still works without having to run other commands before
it. These aren't reviewed yet.

https://git.kernel.org/cgit/linux/kernel/git/andrea/aa.git/commit/?id=5ce2efeb91b501aa1bc7370f43732681fa9123e2

I was planning to send these non-x86 updates to Andrew for review and
merging...

Isn't this necessary as well?

https://git.kernel.org/cgit/linux/kernel/git/andrea/aa.git/commit/?id=0eb943b76537a93fc4dd85cc0cbf937ce8266228

I can include the below one too, but we need to coordinate to submit
them or eventually some will reject.


> > cheers
> > 
> > 
> > diff --git a/tools/testing/selftests/vm/userfaultfd.c b/tools/testing/selftests/vm/userfaultfd.c
> > index 2bf1fc3f562b..652c9d805006 100644
> > --- a/tools/testing/selftests/vm/userfaultfd.c
> > +++ b/tools/testing/selftests/vm/userfaultfd.c
> > @@ -64,19 +64,10 @@
> >  #include <sys/syscall.h>
> >  #include <sys/ioctl.h>
> >  #include <pthread.h>
> > -#include <linux/userfaultfd.h>
> >  
> > -#ifndef __NR_userfaultfd
> > -#ifdef __x86_64__
> > -#define __NR_userfaultfd 323
> > -#elif defined(__i386__)
> > -#define __NR_userfaultfd 374
> > -#elif defined(__powewrpc__)
> > -#define __NR_userfaultfd 364
> > -#else
> > -#error "missing __NR_userfaultfd definition"
> > -#endif
> > -#endif
> > +#ifdef __NR_userfaultfd
> > +
> > +#include <linux/userfaultfd.h>
> >  
> >  static unsigned long nr_cpus, nr_pages, nr_pages_per_cpu, page_size;
> >  
> > @@ -636,3 +627,15 @@ int main(int argc, char **argv)
> >  	       nr_pages, nr_pages_per_cpu);
> >  	return userfaultfd_stress();
> >  }
> > +
> > +#else /* ! __NR_userfaultfd */
> > +
> > +#warning "missing __NR_userfaultfd definition"
> > +
> > +int main(void)
> > +{
> > +	printf("skip: Skipping userfaultfd test (missing __NR_userfaultfd)\n");
> > +	return 0;
> > +}
> > +
> > +#endif
> > 
> > 
> 

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH 6/7] selftests: only compile userfaultfd for x86 and powperpc
  2015-09-08 14:34           ` Andrea Arcangeli
@ 2015-09-09  8:43             ` Michael Ellerman
  2015-09-09 17:20               ` Andrea Arcangeli
  0 siblings, 1 reply; 29+ messages in thread
From: Michael Ellerman @ 2015-09-09  8:43 UTC (permalink / raw)
  To: Andrea Arcangeli
  Cc: Bamvor Zhang Jian, linux-kernel, Mark Brown, khilman,
	tyler.baker, shuahkh

On Tue, 2015-09-08 at 16:34 +0200, Andrea Arcangeli wrote:
> 
> I already had a few minor changes queued to be submitted for arm and
> ppc and a few updates to the selftest.
> 
> I didn't like that you had to remember running make headers_install
> for changes like the below one to build, so I added the dependency so
> that "make" still works without having to run other commands before
> it. These aren't reviewed yet.
> 
> https://git.kernel.org/cgit/linux/kernel/git/andrea/aa.git/commit/?id=5ce2efeb91b501aa1bc7370f43732681fa9123e2

That's, how should I put it, fairly gross :)

I'd really rather you didn't do that. It's really not that hard to run make
headers_install once manually is it?

> I was planning to send these non-x86 updates to Andrew for review and
> merging...

Fine by me, that's probably the best way to get them in.

> Isn't this necessary as well?
> 
> https://git.kernel.org/cgit/linux/kernel/git/andrea/aa.git/commit/?id=0eb943b76537a93fc4dd85cc0cbf937ce8266228

Yes, I think I acked that earlier today.

> I can include the below one too, but we need to coordinate to submit
> them or eventually some will reject.

I think given you already have a series you should pick this up as part of
that series. It will need to be reworked slightly anyway to go on top of your
series I think.

cheers



^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH 6/7] selftests: only compile userfaultfd for x86 and powperpc
  2015-09-09  8:43             ` Michael Ellerman
@ 2015-09-09 17:20               ` Andrea Arcangeli
  0 siblings, 0 replies; 29+ messages in thread
From: Andrea Arcangeli @ 2015-09-09 17:20 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: Bamvor Zhang Jian, linux-kernel, Mark Brown, khilman,
	tyler.baker, shuahkh

On Wed, Sep 09, 2015 at 06:43:11PM +1000, Michael Ellerman wrote:
> On Tue, 2015-09-08 at 16:34 +0200, Andrea Arcangeli wrote:
> > 
> > I already had a few minor changes queued to be submitted for arm and
> > ppc and a few updates to the selftest.
> > 
> > I didn't like that you had to remember running make headers_install
> > for changes like the below one to build, so I added the dependency so
> > that "make" still works without having to run other commands before
> > it. These aren't reviewed yet.
> > 
> > https://git.kernel.org/cgit/linux/kernel/git/andrea/aa.git/commit/?id=5ce2efeb91b501aa1bc7370f43732681fa9123e2
> 
> That's, how should I put it, fairly gross :)
> 
> I'd really rather you didn't do that. It's really not that hard to run make
> headers_install once manually is it?

I agree it's fairly gross, but I don't like when "make" fails and you
need to know something non-standard from documentation to make it work
(ehm documentation? I don't think there is any about how to build the
selftest).

This is self documenting change (that works better than actual
documentation) and you're free to run "make headers_install" by hand
if you prefer after a git clean -d -x -f and you won't know the
difference.

If there's a cleaner solution that's fine, but I don't like to
fallback in having to run "make headers_install" by hand :).

> I think given you already have a series you should pick this up as part of
> that series. It will need to be reworked slightly anyway to go on top of your
> series I think.

Yep I reworked and integrated it.

Thanks!
Andrea

^ permalink raw reply	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2015-09-09 17:20 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-14 13:43 [PATCH 0/7] Improvement kselftest support for arm and arm64 Bamvor Jian Zhang
2015-08-14 13:43 ` [PATCH 1/7] selftests: rename jump label to static_keys Bamvor Jian Zhang
2015-08-27 22:17   ` Shuah Khan
2015-09-07 10:33     ` Michael Ellerman
2015-09-08 13:03       ` Shuah Khan
2015-08-14 13:43 ` [PATCH 2/7] selftests: add CFLAGS_EXTRA Bamvor Jian Zhang
2015-08-24  3:48   ` Michael Ellerman
2015-08-25 12:49     ` Bamvor Zhang Jian
2015-08-27 10:23       ` Michael Ellerman
2015-08-14 13:43 ` [PATCH 3/7] selftests: exec: fix for running and installing Bamvor Jian Zhang
2015-08-27 10:55   ` Michael Ellerman
2015-08-14 13:43 ` [PATCH 4/7] selftests: check before install Bamvor Jian Zhang
2015-08-27 20:10   ` Shuah Khan
2015-08-27 22:13     ` Shuah Khan
2015-08-14 13:43 ` [PATCH 5/7] selftests: disable seccomp for arm64 Bamvor Jian Zhang
2015-08-24  3:48   ` Michael Ellerman
2015-08-25 12:51     ` Bamvor Zhang Jian
2015-08-14 13:43 ` [PATCH 6/7] selftests: only compile userfaultfd for x86 and powperpc Bamvor Jian Zhang
2015-08-27 22:20   ` Shuah Khan
2015-08-31  3:26   ` Michael Ellerman
2015-09-08  9:15     ` Bamvor Zhang Jian
2015-09-08  9:54       ` Michael Ellerman
2015-09-08 12:25         ` Bamvor Zhang Jian
2015-09-08 14:34           ` Andrea Arcangeli
2015-09-09  8:43             ` Michael Ellerman
2015-09-09 17:20               ` Andrea Arcangeli
2015-08-14 13:43 ` [PATCH 7/7] selftests: breakpoints: fix installing error on the architecture except x86 Bamvor Jian Zhang
2015-08-27 14:16   ` Shuah Khan
2015-08-27 22:14     ` Shuah Khan

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).