riscv: Add kcov support
PATCH RESEND 1/1 riscv: Add kcov support
Add ARCH_HAS_KCOV and HAVE_GCC_PLUGINS to the riscv Kconfig. Also disable instrumentation of some early boot code and vdso.
Tested on QEMU's riscv64 virt machine with syzkaller.
Acked-by Dmitry Vyukov <[email protected]>
Signed-off-by Tobias Klauser <[email protected]>
---
Resent due to infradead.org mailing list issues.
arch/riscv/Kconfig | 2 ++ arch/riscv/boot/Makefile | 2 ++ arch/riscv/kernel/vdso/Makefile | 1 + arch/riscv/mm/Makefile | 2 ++ 4 files changed, 7 insertions(+)
arch/riscv/Kconfig +2 -0
@@ -19,6 +19,7 @@ config RISCV select ARCH_HAS_DEBUG_WX select ARCH_HAS_GCOV_PROFILE_ALL select ARCH_HAS_GIGANTIC_PAGE + select ARCH_HAS_KCOV select ARCH_HAS_MMIOWB select ARCH_HAS_PTE_SPECIAL select ARCH_HAS_SET_DIRECT_MAP
@@ -57,6 +58,7 @@ config RISCV select HAVE_DMA_CONTIGUOUS if MMU select HAVE_EBPF_JIT if MMU select HAVE_FUTEX_CMPXCHG if FUTEX + select HAVE_GCC_PLUGINS select HAVE_GENERIC_VDSO if MMU && 64BIT select HAVE_PCI select HAVE_PERF_EVENTS
arch/riscv/boot/Makefile +2 -0
@@ -14,6 +14,8 @@ # Based on the ia64 and arm64 boot/Makefile. # +KCOV_INSTRUMENT := n + OBJCOPYFLAGS_Image :=-O binary -R .note -R .note.gnu.build-id -R .comment -S targets := Image loader
arch/riscv/kernel/vdso/Makefile +1 -0
@@ -32,6 +32,7 @@ CFLAGS_REMOVE_vgettimeofday.o = $(CC_FLAGS_FTRACE) -Os # Disable gcov profiling for VDSO code GCOV_PROFILE := n +KCOV_INSTRUMENT := n # Force dependency $(obj)/vdso.o: $(obj)/vdso.so
arch/riscv/mm/Makefile +2 -0
@@ -5,6 +5,8 @@ ifdef CONFIG_FTRACE CFLAGS_REMOVE_init.o = -pg endif +KCOV_INSTRUMENT_init.o := n + obj-y += init.o obj-y += extable.o obj-$(CONFIG_MMU) += fault.o pageattr.o
Signature · 7 lines
2.27.0 _______________________________________________ linux-riscv mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-riscv