summaryrefslogtreecommitdiffstats
path: root/arch/um
diff options
context:
space:
mode:
authorVegard Nossum <vegard.nossum@oracle.com>2016-05-21 11:46:10 -0400
committerRichard Weinberger <richard@nod.at>2016-08-03 18:18:06 -0400
commit915eed20e40f4dcb142cb29a3de6f6ba67f4bb5a (patch)
treedc606eee62b4f6ed16b456450c4cc3523aab719f /arch/um
parent8e99bc70468dcc42a756ca4b100e2fb2c30c4c89 (diff)
um: Support kcov
This adds support for kcov to UML. There is a small problem where UML will randomly segfault during boot; this is because current_thread_info() occasionally returns an invalid (non-NULL) pointer and we try to dereference it in __sanitizer_cov_trace_pc(). I consider this a bug in UML itself and this patch merely exposes it. [v2: disable instrumentation in UML-specific code] Cc: Quentin Casasnovas <quentin.casasnovas@oracle.com> Cc: Richard Weinberger <richard@nod.at> Cc: Thomas Meyer <thomas@m3y3r.de> Cc: user-mode-linux-devel <user-mode-linux-devel@lists.sourceforge.net> Cc: Dmitry Vyukov <dvyukov@google.com> Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com> Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'arch/um')
-rw-r--r--arch/um/Kconfig.common1
-rw-r--r--arch/um/kernel/Makefile5
-rw-r--r--arch/um/os-Linux/Makefile3
3 files changed, 9 insertions, 0 deletions
diff --git a/arch/um/Kconfig.common b/arch/um/Kconfig.common
index 08d931c98621..f8530d866c9f 100644
--- a/arch/um/Kconfig.common
+++ b/arch/um/Kconfig.common
@@ -1,6 +1,7 @@
1config UML 1config UML
2 bool 2 bool
3 default y 3 default y
4 select ARCH_HAS_KCOV
4 select HAVE_ARCH_AUDITSYSCALL 5 select HAVE_ARCH_AUDITSYSCALL
5 select HAVE_ARCH_SECCOMP_FILTER 6 select HAVE_ARCH_SECCOMP_FILTER
6 select HAVE_UID16 7 select HAVE_UID16
diff --git a/arch/um/kernel/Makefile b/arch/um/kernel/Makefile
index a6a5e42caaef..2f36d515762e 100644
--- a/arch/um/kernel/Makefile
+++ b/arch/um/kernel/Makefile
@@ -3,6 +3,11 @@
3# Licensed under the GPL 3# Licensed under the GPL
4# 4#
5 5
6# Don't instrument UML-specific code; without this, we may crash when
7# accessing the instrumentation buffer for the first time from the
8# kernel.
9KCOV_INSTRUMENT := n
10
6CPPFLAGS_vmlinux.lds := -DSTART=$(LDS_START) \ 11CPPFLAGS_vmlinux.lds := -DSTART=$(LDS_START) \
7 -DELF_ARCH=$(LDS_ELF_ARCH) \ 12 -DELF_ARCH=$(LDS_ELF_ARCH) \
8 -DELF_FORMAT=$(LDS_ELF_FORMAT) \ 13 -DELF_FORMAT=$(LDS_ELF_FORMAT) \
diff --git a/arch/um/os-Linux/Makefile b/arch/um/os-Linux/Makefile
index 08ff5094fcdd..ada473bf6f46 100644
--- a/arch/um/os-Linux/Makefile
+++ b/arch/um/os-Linux/Makefile
@@ -3,6 +3,9 @@
3# Licensed under the GPL 3# Licensed under the GPL
4# 4#
5 5
6# Don't instrument UML-specific code
7KCOV_INSTRUMENT := n
8
6obj-y = aio.o execvp.o file.o helper.o irq.o main.o mem.o process.o \ 9obj-y = aio.o execvp.o file.o helper.o irq.o main.o mem.o process.o \
7 registers.o sigio.o signal.o start_up.o time.o tty.o \ 10 registers.o sigio.o signal.o start_up.o time.o tty.o \
8 umid.o user_syms.o util.o drivers/ skas/ 11 umid.o user_syms.o util.o drivers/ skas/