Re: [PATCH 4/9] selftests: move prctl tests from Documentation/prctl

2016-09-09 Thread kbuild test robot
Hi Shuah,

[auto build test ERROR on linus/master]
[also build test ERROR on v4.8-rc5 next-20160909]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]
[Suggest to use git(>=2.9.0) format-patch --base= (or --base=auto for 
convenience) to record what (public, well-known) commit your patch series was 
built on]
[Check https://git-scm.com/docs/git-format-patch for more information]

url:
https://github.com/0day-ci/linux/commits/Shuah-Khan/Move-runnable-code-tests-from-Documentation-to-selftests/20160910-063538
config: i386-tinyconfig (attached as .config)
compiler: gcc-6 (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
# save the attached .config to linux build tree
make ARCH=i386 

All errors (new ones prefixed by >>):

>> scripts/Makefile.build:44: Documentation/prctl/Makefile: No such file or 
>> directory
   make[3]: *** No rule to make target 'Documentation/prctl/Makefile'.
   make[3]: Failed to remake makefile 'Documentation/prctl/Makefile'.

vim +44 scripts/Makefile.build

3156fd052 Robert P. J. Day 2008-02-18  38  # For backward compatibility check 
that these variables do not change
0c53c8e6e Sam Ravnborg 2007-10-14  39  save-cflags := $(CFLAGS)
0c53c8e6e Sam Ravnborg 2007-10-14  40  
2a6914703 Sam Ravnborg 2005-07-25  41  # The filename Kbuild has precedence 
over Makefile
db8c1a7b2 Sam Ravnborg 2005-07-27  42  kbuild-dir := $(if $(filter 
/%,$(src)),$(src),$(srctree)/$(src))
0c53c8e6e Sam Ravnborg 2007-10-14  43  kbuild-file := $(if $(wildcard 
$(kbuild-dir)/Kbuild),$(kbuild-dir)/Kbuild,$(kbuild-dir)/Makefile)
0c53c8e6e Sam Ravnborg 2007-10-14 @44  include $(kbuild-file)
^1da177e4 Linus Torvalds   2005-04-16  45  
0c53c8e6e Sam Ravnborg 2007-10-14  46  # If the save-* variables changed 
error out
0c53c8e6e Sam Ravnborg 2007-10-14  47  ifeq ($(KBUILD_NOPEDANTIC),)

:: The code at line 44 was first introduced by commit
:: 0c53c8e6eb456cde30f2305421c605713856abc8 kbuild: check for wrong use of 
CFLAGS

:: TO: Sam Ravnborg 
:: CC: Sam Ravnborg 

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: Binary data


Re: [PATCH 4/9] selftests: move prctl tests from Documentation/prctl

2016-09-09 Thread kbuild test robot
Hi Shuah,

[auto build test ERROR on linus/master]
[also build test ERROR on v4.8-rc5 next-20160909]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]
[Suggest to use git(>=2.9.0) format-patch --base= (or --base=auto for 
convenience) to record what (public, well-known) commit your patch series was 
built on]
[Check https://git-scm.com/docs/git-format-patch for more information]

url:
https://github.com/0day-ci/linux/commits/Shuah-Khan/Move-runnable-code-tests-from-Documentation-to-selftests/20160910-063538
config: i386-tinyconfig (attached as .config)
compiler: gcc-6 (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
# save the attached .config to linux build tree
make ARCH=i386 

All errors (new ones prefixed by >>):

   scripts/Makefile.clean:14: Documentation/prctl/Makefile: No such file or 
directory
>> make[3]: *** No rule to make target 'Documentation/prctl/Makefile'.
   make[3]: Failed to remake makefile 'Documentation/prctl/Makefile'.
   make[2]: *** [Documentation/prctl] Error 2
   scripts/Makefile.clean:14: Documentation/filesystems/Makefile: No such file 
or directory
   make[3]: *** No rule to make target 'Documentation/filesystems/Makefile'.
   make[3]: Failed to remake makefile 'Documentation/filesystems/Makefile'.
   make[2]: *** [Documentation/filesystems] Error 2
   make[2]: Target '__clean' not remade because of errors.
   make[1]: *** [_clean_Documentation] Error 2
   make[1]: Target 'distclean' not remade because of errors.
   make: *** [sub-make] Error 2

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: Binary data


[PATCH 4/9] selftests: move prctl tests from Documentation/prctl

2016-09-09 Thread Shuah Khan
Move prctl tests from Documentation/prctl to selftests/prctl.

Signed-off-by: Shuah Khan 
---
 Documentation/prctl/.gitignore |  3 -
 Documentation/prctl/Makefile   | 10 ---
 .../prctl/disable-tsc-ctxt-sw-stress-test.c| 97 --
 .../prctl/disable-tsc-on-off-stress-test.c | 96 -
 Documentation/prctl/disable-tsc-test.c | 95 -
 tools/testing/selftests/prctl/.gitignore   |  3 +
 tools/testing/selftests/prctl/Makefile | 10 +++
 .../prctl/disable-tsc-ctxt-sw-stress-test.c| 97 ++
 .../prctl/disable-tsc-on-off-stress-test.c | 96 +
 tools/testing/selftests/prctl/disable-tsc-test.c   | 95 +
 10 files changed, 301 insertions(+), 301 deletions(-)
 delete mode 100644 Documentation/prctl/.gitignore
 delete mode 100644 Documentation/prctl/Makefile
 delete mode 100644 Documentation/prctl/disable-tsc-ctxt-sw-stress-test.c
 delete mode 100644 Documentation/prctl/disable-tsc-on-off-stress-test.c
 delete mode 100644 Documentation/prctl/disable-tsc-test.c
 create mode 100644 tools/testing/selftests/prctl/.gitignore
 create mode 100644 tools/testing/selftests/prctl/Makefile
 create mode 100644 
tools/testing/selftests/prctl/disable-tsc-ctxt-sw-stress-test.c
 create mode 100644 
tools/testing/selftests/prctl/disable-tsc-on-off-stress-test.c
 create mode 100644 tools/testing/selftests/prctl/disable-tsc-test.c

diff --git a/Documentation/prctl/.gitignore b/Documentation/prctl/.gitignore
deleted file mode 100644
index 0b5c274..000
--- a/Documentation/prctl/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-disable-tsc-ctxt-sw-stress-test
-disable-tsc-on-off-stress-test
-disable-tsc-test
diff --git a/Documentation/prctl/Makefile b/Documentation/prctl/Makefile
deleted file mode 100644
index 44de308..000
--- a/Documentation/prctl/Makefile
+++ /dev/null
@@ -1,10 +0,0 @@
-ifndef CROSS_COMPILE
-# List of programs to build
-hostprogs-$(CONFIG_X86) := disable-tsc-ctxt-sw-stress-test 
disable-tsc-on-off-stress-test disable-tsc-test
-# Tell kbuild to always build the programs
-always := $(hostprogs-y)
-
-HOSTCFLAGS_disable-tsc-ctxt-sw-stress-test.o += -I$(objtree)/usr/include
-HOSTCFLAGS_disable-tsc-on-off-stress-test.o += -I$(objtree)/usr/include
-HOSTCFLAGS_disable-tsc-test.o += -I$(objtree)/usr/include
-endif
diff --git a/Documentation/prctl/disable-tsc-ctxt-sw-stress-test.c 
b/Documentation/prctl/disable-tsc-ctxt-sw-stress-test.c
deleted file mode 100644
index f7499d1..000
--- a/Documentation/prctl/disable-tsc-ctxt-sw-stress-test.c
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Tests for prctl(PR_GET_TSC, ...) / prctl(PR_SET_TSC, ...)
- *
- * Tests if the control register is updated correctly
- * at context switches
- *
- * Warning: this test will cause a very high load for a few seconds
- *
- */
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-
-#include 
-#include 
-
-/* Get/set the process' ability to use the timestamp counter instruction */
-#ifndef PR_GET_TSC
-#define PR_GET_TSC 25
-#define PR_SET_TSC 26
-# define PR_TSC_ENABLE 1   /* allow the use of the timestamp counter */
-# define PR_TSC_SIGSEGV2   /* throw a SIGSEGV instead of 
reading the TSC */
-#endif
-
-static uint64_t rdtsc(void)
-{
-uint32_t lo, hi;
-/* We cannot use "=A", since this would use %rax on x86_64 */
-__asm__ __volatile__ ("rdtsc" : "=a" (lo), "=d" (hi));
-return (uint64_t)hi << 32 | lo;
-}
-
-static void sigsegv_expect(int sig)
-{
-   /* */
-}
-
-static void segvtask(void)
-{
-   if (prctl(PR_SET_TSC, PR_TSC_SIGSEGV) < 0)
-   {
-   perror("prctl");
-   exit(0);
-   }
-   signal(SIGSEGV, sigsegv_expect);
-   alarm(10);
-   rdtsc();
-   fprintf(stderr, "FATAL ERROR, rdtsc() succeeded while disabled\n");
-   exit(0);
-}
-
-
-static void sigsegv_fail(int sig)
-{
-   fprintf(stderr, "FATAL ERROR, rdtsc() failed while enabled\n");
-   exit(0);
-}
-
-static void rdtsctask(void)
-{
-   if (prctl(PR_SET_TSC, PR_TSC_ENABLE) < 0)
-   {
-   perror("prctl");
-   exit(0);
-   }
-   signal(SIGSEGV, sigsegv_fail);
-   alarm(10);
-   for(;;) rdtsc();
-}
-
-
-int main(void)
-{
-   int n_tasks = 100, i;
-
-   fprintf(stderr, "[No further output means we're allright]\n");
-
-   for (i=0; i