Re: [PATCH 8/9] selftests: move vDSO tests from Documentation/vDSO

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/vDSO/Makefile: No such file or 
>> directory
>> make[3]: *** No rule to make target 'Documentation/vDSO/Makefile'.
   make[3]: Failed to remake makefile 'Documentation/vDSO/Makefile'.

vim +44 scripts/Makefile.build

f77bf0142 Sam Ravnborg 2007-10-15  28  ldflags-y  :=
d72e5edbf Sam Ravnborg 2007-05-28  29  
720097d89 Sam Ravnborg 2009-04-19  30  subdir-asflags-y :=
720097d89 Sam Ravnborg 2009-04-19  31  subdir-ccflags-y :=
720097d89 Sam Ravnborg 2009-04-19  32  
3156fd052 Robert P. J. Day 2008-02-18  33  # Read auto.conf if it exists, 
otherwise ignore
c955ccafc Roman Zippel 2006-06-08  34  -include include/config/auto.conf
^1da177e4 Linus Torvalds   2005-04-16  35  
20a468b51 Sam Ravnborg 2006-01-22  36  include scripts/Kbuild.include
20a468b51 Sam Ravnborg 2006-01-22  37  
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),)
0c53c8e6e Sam Ravnborg 2007-10-14  48  ifneq 
("$(save-cflags)","$(CFLAGS)")
49c57d254 Arnaud Lacombe   2011-08-15  49  $(error CFLAGS was 
changed in "$(kbuild-file)". Fix it to use ccflags-y)
0c53c8e6e Sam Ravnborg 2007-10-14  50  endif
0c53c8e6e Sam Ravnborg 2007-10-14  51  endif
4a5838ad9 Borislav Petkov  2011-03-01  52  

:: 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


[PATCH 8/9] selftests: move vDSO tests from Documentation/vDSO

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

Signed-off-by: Shuah Khan 
---
 Documentation/vDSO/.gitignore  |   2 -
 Documentation/vDSO/Makefile|  17 --
 Documentation/vDSO/parse_vdso.c| 269 -
 Documentation/vDSO/vdso_standalone_test_x86.c  | 128 --
 Documentation/vDSO/vdso_test.c |  52 
 tools/testing/selftests/vDSO/.gitignore|   2 +
 tools/testing/selftests/vDSO/Makefile  |  17 ++
 tools/testing/selftests/vDSO/parse_vdso.c  | 269 +
 .../selftests/vDSO/vdso_standalone_test_x86.c  | 128 ++
 tools/testing/selftests/vDSO/vdso_test.c   |  52 
 10 files changed, 468 insertions(+), 468 deletions(-)
 delete mode 100644 Documentation/vDSO/.gitignore
 delete mode 100644 Documentation/vDSO/Makefile
 delete mode 100644 Documentation/vDSO/parse_vdso.c
 delete mode 100644 Documentation/vDSO/vdso_standalone_test_x86.c
 delete mode 100644 Documentation/vDSO/vdso_test.c
 create mode 100644 tools/testing/selftests/vDSO/.gitignore
 create mode 100644 tools/testing/selftests/vDSO/Makefile
 create mode 100644 tools/testing/selftests/vDSO/parse_vdso.c
 create mode 100644 tools/testing/selftests/vDSO/vdso_standalone_test_x86.c
 create mode 100644 tools/testing/selftests/vDSO/vdso_test.c

diff --git a/Documentation/vDSO/.gitignore b/Documentation/vDSO/.gitignore
deleted file mode 100644
index 133bf9e..000
--- a/Documentation/vDSO/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-vdso_test
-vdso_standalone_test_x86
diff --git a/Documentation/vDSO/Makefile b/Documentation/vDSO/Makefile
deleted file mode 100644
index b12e987..000
--- a/Documentation/vDSO/Makefile
+++ /dev/null
@@ -1,17 +0,0 @@
-ifndef CROSS_COMPILE
-# vdso_test won't build for glibc < 2.16, so disable it
-# hostprogs-y := vdso_test
-hostprogs-$(CONFIG_X86) := vdso_standalone_test_x86
-vdso_standalone_test_x86-objs := vdso_standalone_test_x86.o parse_vdso.o
-vdso_test-objs := parse_vdso.o vdso_test.o
-
-# Tell kbuild to always build the programs
-always := $(hostprogs-y)
-
-HOSTCFLAGS := -I$(objtree)/usr/include -std=gnu99
-HOSTCFLAGS_vdso_standalone_test_x86.o := -fno-asynchronous-unwind-tables 
-fno-stack-protector
-HOSTLOADLIBES_vdso_standalone_test_x86 := -nostdlib
-ifeq ($(CONFIG_X86_32),y)
-HOSTLOADLIBES_vdso_standalone_test_x86 += -lgcc_s
-endif
-endif
diff --git a/Documentation/vDSO/parse_vdso.c b/Documentation/vDSO/parse_vdso.c
deleted file mode 100644
index 1dbb4b8..000
--- a/Documentation/vDSO/parse_vdso.c
+++ /dev/null
@@ -1,269 +0,0 @@
-/*
- * parse_vdso.c: Linux reference vDSO parser
- * Written by Andrew Lutomirski, 2011-2014.
- *
- * This code is meant to be linked in to various programs that run on Linux.
- * As such, it is available with as few restrictions as possible.  This file
- * is licensed under the Creative Commons Zero License, version 1.0,
- * available at http://creativecommons.org/publicdomain/zero/1.0/legalcode
- *
- * The vDSO is a regular ELF DSO that the kernel maps into user space when
- * it starts a program.  It works equally well in statically and dynamically
- * linked binaries.
- *
- * This code is tested on x86.  In principle it should work on any
- * architecture that has a vDSO.
- */
-
-#include 
-#include 
-#include 
-#include 
-#include 
-
-/*
- * To use this vDSO parser, first call one of the vdso_init_* functions.
- * If you've already parsed auxv, then pass the value of AT_SYSINFO_EHDR
- * to vdso_init_from_sysinfo_ehdr.  Otherwise pass auxv to vdso_init_from_auxv.
- * Then call vdso_sym for each symbol you want.  For example, to look up
- * gettimeofday on x86_64, use:
- *
- *  = vdso_sym("LINUX_2.6", "gettimeofday");
- * or
- *  = vdso_sym("LINUX_2.6", "__vdso_gettimeofday");
- *
- * vdso_sym will return 0 if the symbol doesn't exist or if the init function
- * failed or was not called.  vdso_sym is a little slow, so its return value
- * should be cached.
- *
- * vdso_sym is threadsafe; the init functions are not.
- *
- * These are the prototypes:
- */
-extern void vdso_init_from_auxv(void *auxv);
-extern void vdso_init_from_sysinfo_ehdr(uintptr_t base);
-extern void *vdso_sym(const char *version, const char *name);
-
-
-/* And here's the code. */
-#ifndef ELF_BITS
-# if ULONG_MAX > 0xUL
-#  define ELF_BITS 64
-# else
-#  define ELF_BITS 32
-# endif
-#endif
-
-#define ELF_BITS_XFORM2(bits, x) Elf##bits##_##x
-#define ELF_BITS_XFORM(bits, x) ELF_BITS_XFORM2(bits, x)
-#define ELF(x) ELF_BITS_XFORM(ELF_BITS, x)
-
-static struct vdso_info
-{
-   bool valid;
-
-   /* Load information */
-   uintptr_t load_addr;
-   uintptr_t load_offset;  /* load_addr - recorded vaddr */
-
-   /* Symbol table */
-   ELF(Sym) *symtab;
-   const char *symstrings;
-   ELF(Word) *bucket, *chain;
-   ELF(Word) nbucket, nchain;
-
-   /* Version table