Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756861AbcCaOCu (ORCPT ); Thu, 31 Mar 2016 10:02:50 -0400 Received: from mail-wm0-f42.google.com ([74.125.82.42]:33554 "EHLO mail-wm0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750751AbcCaOCt convert rfc822-to-8bit (ORCPT ); Thu, 31 Mar 2016 10:02:49 -0400 MIME-Version: 1.0 In-Reply-To: <57cb1b66d85b85eadea28ef3304a62b1327ded45.1459432254.git.glider@google.com> References: <57cb1b66d85b85eadea28ef3304a62b1327ded45.1459432254.git.glider@google.com> Date: Thu, 31 Mar 2016 16:02:47 +0200 Message-ID: Subject: Re: [PATCH v1] arm64: allow building with kcov coverage on ARM64 From: Alexander Potapenko To: Dmitriy Vyukov , catalin.marinas@arm.com, quentin.casasnovas@oracle.com, will.deacon@arm.com Cc: LKML , syzkaller@googlegroups.com, linux-arm-kernel@lists.infradead.org, Kostya Serebryany , Andrew Morton Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2060 Lines: 61 On Thu, Mar 31, 2016 at 3:54 PM, Alexander Potapenko wrote: > Add ARCH_HAS_KCOV to ARM64 config. Disable instrumentation of > arch/arm64/lib/delay.c > > Signed-off-by: Alexander Potapenko > --- > arch/arm64/Kconfig | 1 + > arch/arm64/lib/Makefile | 3 +++ > 2 files changed, 4 insertions(+) > > diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig > index 4f43622..c52aa61 100644 > --- a/arch/arm64/Kconfig > +++ b/arch/arm64/Kconfig > @@ -7,6 +7,7 @@ config ARM64 > select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE > select ARCH_HAS_ELF_RANDOMIZE > select ARCH_HAS_GCOV_PROFILE_ALL > + select ARCH_HAS_KCOV > select ARCH_HAS_SG_CHAIN > select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST > select ARCH_USE_CMPXCHG_LOCKREF > diff --git a/arch/arm64/lib/Makefile b/arch/arm64/lib/Makefile > index c86b790..b407bc1 100644 > --- a/arch/arm64/lib/Makefile > +++ b/arch/arm64/lib/Makefile > @@ -1,3 +1,6 @@ > +# Produces uninteresting flaky coverage. > +KCOV_INSTRUMENT_delay.o := n > + > lib-y := bitops.o clear_user.o delay.o copy_from_user.o \ > copy_to_user.o copy_in_user.o copy_page.o \ > clear_page.o memchr.o memcpy.o memmove.o memset.o \ > -- > 2.8.0.rc3.226.g39d4020 > Hi all, I've ported the above patch from kernel 3.18, which I was able to successfully run with kcov support on an arm64 device. The original 3.18 patch is at https://chromium-review.googlesource.com/#/c/334560/1, it also touches arch/arm64/kernel/Makefile, which is unnecessary in upstream code, because efi-stub.c has been moved to libstub. Therefore I suspect the above patch should be correct, but I don't have an opportunity to actually test it. Alex -- Alexander Potapenko Software Engineer Google Germany GmbH Erika-Mann-Straße, 33 80636 München Geschäftsführer: Matthew Scott Sucherman, Paul Terence Manicle Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg