[PATCH v2 2/2] powerpc: Enable kcov
Andrew Donnellan
andrew.donnellan at au1.ibm.com
Wed Feb 20 15:47:27 AEDT 2019
On 20/2/19 3:26 pm, Daniel Axtens wrote:
> I needed the following diff to get this booting on a T4240RDB:
>
> diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile
> index 961f44eabb65..fbe9894d6305 100644
> --- a/arch/powerpc/kernel/Makefile
> +++ b/arch/powerpc/kernel/Makefile
> @@ -3,6 +3,10 @@
> # Makefile for the linux kernel.
> #
>
> +KCOV_INSTRUMENT_cputable.o := n
> +KCOV_INSTRUMENT_setup_64.o := n
> +KCOV_INSTRUMENT_paca.o := n
> +
> CFLAGS_ptrace.o += -DUTS_MACHINE='"$(UTS_MACHINE)"'
>
> # Disable clang warning for using setjmp without setjmp.h header
> diff --git a/arch/powerpc/mm/Makefile b/arch/powerpc/mm/Makefile
> index f965fc33a8b7..0140e7e12c29 100644
> --- a/arch/powerpc/mm/Makefile
> +++ b/arch/powerpc/mm/Makefile
> @@ -5,6 +5,9 @@
>
> ccflags-$(CONFIG_PPC64) := $(NO_MINIMAL_TOC)
>
> +KCOV_INSTRUMENT_tlb_nohash.o := n
> +KCOV_INSTRUMENT_fsl_booke_mmu.o := n
> +
> CFLAGS_REMOVE_slb.o = $(CC_FLAGS_FTRACE)
>
> obj-y := fault.o mem.o pgtable.o mmap.o \
>
>
> The change to kernel/ is required to get the kernel to even begin to
> boot, and the change to mm/ is required to successfully set up SMP. I'm
> not sure preciesly why they cause issues.
Thanks for testing this - I'll roll this into v3.
>
> I was then able to run kcovtrace and the results seem to make sense. >
> Perhaps in the future some further stuff should be trimmed down to make
> the coverage results less noisy (restore_math is probably not telling us
> anything interesting, for example), but certainly this is a great start.
I think syzkaller (as the main kcov consumer) can probably cope...
>
> With those changes,
> Tested-by: Daniel Axtens <dja at axtens.net> # e6500
--
Andrew Donnellan OzLabs, ADL Canberra
andrew.donnellan at au1.ibm.com IBM Australia Limited
More information about the Linuxppc-dev
mailing list