All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Potapenko <glider@google.com>
To: Dmitriy Vyukov <dvyukov@google.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Quentin Casasnovas <quentin.casasnovas@oracle.com>,
	Will Deacon <will.deacon@arm.com>,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>,
	marc.zyngier@arm.com,
	Christoffer Dall <christoffer.dall@linaro.org>
Cc: linux-arm-kernel@lists.infradead.org,
	LKML <linux-kernel@vger.kernel.org>,
	syzkaller <syzkaller@googlegroups.com>,
	Kostya Serebryany <kcc@google.com>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH v2] arm64: allow building with kcov coverage on ARM64
Date: Tue, 14 Jun 2016 19:16:44 +0200	[thread overview]
Message-ID: <CAG_fn=VrfSUs11qBZJqKYpZ9hSjn84C8Vew73-FK2rP=Y5PT0g@mail.gmail.com> (raw)
In-Reply-To: <1465923441-107596-1-git-send-email-glider@google.com>

Hi all,

On Tue, Jun 14, 2016 at 6:57 PM, Alexander Potapenko <glider@google.com> wrote:
> Add ARCH_HAS_KCOV to ARM64 config. To avoid crashes, disable
> instrumentation of the following files:
>
> arch/arm64/boot/*
> arch/arm64/kvm/hyp/*
>
> Signed-off-by: Alexander Potapenko <glider@google.com>
> ---
> v2: - disable instrumentation of arch/arm64/{boot,kvm/hyp}
>     - enable instrumentation of arch/arm64/lib/delay.c
> ---
>  arch/arm64/Kconfig          | 1 +
>  arch/arm64/boot/Makefile    | 4 ++++
>  arch/arm64/kvm/hyp/Makefile | 4 ++++
>  3 files changed, 9 insertions(+)
>
> diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
> index 5a0a691..eb0b0a0 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/boot/Makefile b/arch/arm64/boot/Makefile
> index 305c552..74cec89 100644
> --- a/arch/arm64/boot/Makefile
> +++ b/arch/arm64/boot/Makefile
> @@ -14,6 +14,10 @@
>  # Based on the ia64 boot/Makefile.
>  #
>
> +# Avoid potential boot-time problems with kcov instrumentation. We are mostly
> +# interested in syscall coverage, so boot code is not interesting anyway.
> +KCOV_INSTRUMENT                := n
> +
>  targets := Image Image.gz
>
>  $(obj)/Image: vmlinux FORCE
> diff --git a/arch/arm64/kvm/hyp/Makefile b/arch/arm64/kvm/hyp/Makefile
> index 778d0ef..0c85feb 100644
> --- a/arch/arm64/kvm/hyp/Makefile
> +++ b/arch/arm64/kvm/hyp/Makefile
> @@ -17,6 +17,10 @@ obj-$(CONFIG_KVM_ARM_HOST) += tlb.o
>  obj-$(CONFIG_KVM_ARM_HOST) += hyp-entry.o
>  obj-$(CONFIG_KVM_ARM_HOST) += s2-setup.o
>
> +# KVM code is run at a different exception code with a different map, so
> +# compiler instrumentation that inserts callbacks or checks into the code may
> +# cause crashes. Just disable it.
>  GCOV_PROFILE   := n
>  KASAN_SANITIZE := n
>  UBSAN_SANITIZE := n
> +KCOV_INSTRUMENT        := n
> --
> 2.8.0.rc3.226.g39d4020
>
Following the previous patch discussion, I have dropped the delay.c
exception, which isn't strictly required for kcov to function.
We can decide what to do with it later.
Instead I've added rules to avoid instrumentation of arch/arm64/boot
and arch/arm64/kvm


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

WARNING: multiple messages have this Message-ID (diff)
From: glider@google.com (Alexander Potapenko)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2] arm64: allow building with kcov coverage on ARM64
Date: Tue, 14 Jun 2016 19:16:44 +0200	[thread overview]
Message-ID: <CAG_fn=VrfSUs11qBZJqKYpZ9hSjn84C8Vew73-FK2rP=Y5PT0g@mail.gmail.com> (raw)
In-Reply-To: <1465923441-107596-1-git-send-email-glider@google.com>

Hi all,

On Tue, Jun 14, 2016 at 6:57 PM, Alexander Potapenko <glider@google.com> wrote:
> Add ARCH_HAS_KCOV to ARM64 config. To avoid crashes, disable
> instrumentation of the following files:
>
> arch/arm64/boot/*
> arch/arm64/kvm/hyp/*
>
> Signed-off-by: Alexander Potapenko <glider@google.com>
> ---
> v2: - disable instrumentation of arch/arm64/{boot,kvm/hyp}
>     - enable instrumentation of arch/arm64/lib/delay.c
> ---
>  arch/arm64/Kconfig          | 1 +
>  arch/arm64/boot/Makefile    | 4 ++++
>  arch/arm64/kvm/hyp/Makefile | 4 ++++
>  3 files changed, 9 insertions(+)
>
> diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
> index 5a0a691..eb0b0a0 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/boot/Makefile b/arch/arm64/boot/Makefile
> index 305c552..74cec89 100644
> --- a/arch/arm64/boot/Makefile
> +++ b/arch/arm64/boot/Makefile
> @@ -14,6 +14,10 @@
>  # Based on the ia64 boot/Makefile.
>  #
>
> +# Avoid potential boot-time problems with kcov instrumentation. We are mostly
> +# interested in syscall coverage, so boot code is not interesting anyway.
> +KCOV_INSTRUMENT                := n
> +
>  targets := Image Image.gz
>
>  $(obj)/Image: vmlinux FORCE
> diff --git a/arch/arm64/kvm/hyp/Makefile b/arch/arm64/kvm/hyp/Makefile
> index 778d0ef..0c85feb 100644
> --- a/arch/arm64/kvm/hyp/Makefile
> +++ b/arch/arm64/kvm/hyp/Makefile
> @@ -17,6 +17,10 @@ obj-$(CONFIG_KVM_ARM_HOST) += tlb.o
>  obj-$(CONFIG_KVM_ARM_HOST) += hyp-entry.o
>  obj-$(CONFIG_KVM_ARM_HOST) += s2-setup.o
>
> +# KVM code is run at a different exception code with a different map, so
> +# compiler instrumentation that inserts callbacks or checks into the code may
> +# cause crashes. Just disable it.
>  GCOV_PROFILE   := n
>  KASAN_SANITIZE := n
>  UBSAN_SANITIZE := n
> +KCOV_INSTRUMENT        := n
> --
> 2.8.0.rc3.226.g39d4020
>
Following the previous patch discussion, I have dropped the delay.c
exception, which isn't strictly required for kcov to function.
We can decide what to do with it later.
Instead I've added rules to avoid instrumentation of arch/arm64/boot
and arch/arm64/kvm


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

  reply	other threads:[~2016-06-14 17:16 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-14 16:57 [PATCH v2] arm64: allow building with kcov coverage on ARM64 Alexander Potapenko
2016-06-14 16:57 ` Alexander Potapenko
2016-06-14 17:16 ` Alexander Potapenko [this message]
2016-06-14 17:16   ` Alexander Potapenko
2016-06-14 17:55 ` Mark Rutland
2016-06-14 17:55   ` Mark Rutland
2016-06-14 18:16   ` Alexander Potapenko
2016-06-14 18:16     ` Alexander Potapenko
2016-06-15  9:25     ` Mark Rutland
2016-06-15  9:25       ` Mark Rutland
2016-06-15 11:44       ` Mark Rutland
2016-06-15 11:44         ` Mark Rutland
2016-06-15 11:53         ` Alexander Potapenko
2016-06-15 11:53           ` Alexander Potapenko
2016-06-15 14:25           ` Mark Rutland
2016-06-15 14:25             ` Mark Rutland
2016-06-15 14:36             ` Dmitry Vyukov
2016-06-15 14:36               ` Dmitry Vyukov
2016-06-15 15:05               ` Mark Rutland
2016-06-15 15:05                 ` Mark Rutland
2016-06-15 15:16                 ` Dmitry Vyukov
2016-06-15 15:16                   ` Dmitry Vyukov
2016-06-16 10:47             ` James Morse
2016-06-16 10:47               ` James Morse
2016-06-16 15:20               ` Alexander Potapenko
2016-06-16 15:20                 ` Alexander Potapenko
2016-06-16 15:44                 ` Mark Rutland
2016-06-16 15:44                   ` Mark Rutland
2016-06-16 16:25                   ` Catalin Marinas
2016-06-16 16:25                     ` Catalin Marinas
2016-06-16 16:32                     ` Mark Rutland
2016-06-16 16:32                       ` Mark Rutland
2016-06-16 16:36                       ` Alexander Potapenko
2016-06-16 16:36                         ` Alexander Potapenko
2016-06-16 16:36                         ` James Morse
2016-06-16 16:36                           ` James Morse
2016-06-16 16:39                       ` Catalin Marinas
2016-06-16 16:39                         ` Catalin Marinas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAG_fn=VrfSUs11qBZJqKYpZ9hSjn84C8Vew73-FK2rP=Y5PT0g@mail.gmail.com' \
    --to=glider@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=ard.biesheuvel@linaro.org \
    --cc=catalin.marinas@arm.com \
    --cc=christoffer.dall@linaro.org \
    --cc=dvyukov@google.com \
    --cc=kcc@google.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marc.zyngier@arm.com \
    --cc=quentin.casasnovas@oracle.com \
    --cc=syzkaller@googlegroups.com \
    --cc=will.deacon@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.