From: Marco Elver <elver@google.com>
To: "Mark Rutland" <mark.rutland@arm.com>, "Martin Liška" <mliska@suse.cz>
Cc: Peter Zijlstra <peterz@infradead.org>,
Nick Desaulniers <ndesaulniers@google.com>,
Josh Poimboeuf <jpoimboe@redhat.com>,
Will Deacon <will@kernel.org>,
"Jose E. Marchesi" <jemarch@gnu.org>,
"Paul E. McKenney" <paulmck@kernel.org>,
Ard Biesheuvel <ardb@kernel.org>,
Catalin Marinas <catalin.marinas@arm.com>,
linux-toolchains@vger.kernel.org
Subject: Re: Linux Plumbers Conf 2021
Date: Wed, 19 May 2021 16:04:15 +0200 [thread overview]
Message-ID: <CANpmjNNo7SP1cKWMXFAOECif_YOxoiLH3k8h8QHoHRntSirRgQ@mail.gmail.com> (raw)
In-Reply-To: <20210519115654.GC2797@C02TD0UTHF1T.local>
+Cc Martin, who helped us last time with no_sanitize issues in GCC.
Martin, as far as we're aware there's no
__attribute__((no_sanitize_coverage)) for GCC -- is it possible to
implement this? Some context below. Thank you.
On Wed, 19 May 2021 at 13:57, Mark Rutland <mark.rutland@arm.com> wrote:
> On Wed, May 19, 2021 at 12:19:38PM +0200, Marco Elver wrote:
> > On Wed, 19 May 2021 at 11:32, Mark Rutland <mark.rutland@arm.com> wrote:
> > > On Tue, May 18, 2021 at 10:03:06PM +0200, Peter Zijlstra wrote:
> > > > On Tue, May 18, 2021 at 09:57:26AM -0700, Nick Desaulniers wrote:
> > > > > On Tue, May 18, 2021 at 6:23 AM Peter Zijlstra <peterz@infradead.org> wrote:
> > > >
> > > > > > - validates noinstr annotation; *HOWEVER* we rely on objtool to NOP
> > > > > > all __sanitizer_cov_* calls in .noinstr/.entry text sections because
> > > > > > __no_sanitize_cov is 'broken' in all known compilers.
> > > > >
> > > > > ^ Do you have more information on this?
> > > >
> > > > Random link in the middle of a relevant thread:
> > > >
> > > > https://lkml.kernel.org/r/CANpmjNPNa2f=kAF6c199oYVJ0iSyirQRGxeOBLxa9PmakSXRbA@mail.gmail.com
> > > >
> > > > Notable quote:
> > > >
> > > > "It's everywhere. We cannot mark noinstr functions to not be
> > > > instrumented by KCOV/-fsanitize-coverage, because no compiler provides
> > > > an attribute to do so. GCC doesn't have
> > > > __attribute__((no_sanitize_coverage)) and Clang doesn't have
> > > > __attribute__((no_sanitize("coverage")), and therefore we can't have
> > > > __no_sanitize_coverage."
[...]
> > > That *really* needs an attribute, and going forward we shouldn't accept
> > > new compiler instrumentation that we can't opt-out of like this.
> >
> > Strangely enough, in Clang, there's -fsanitize-coverage-blocklist, but
> > that's pretty useless for the kernel. Maintaining a list of functions
> > doesn't scale, and we just need an attribute. I'll ping a few of the
> > people who know Clang's fsanitize-coverage a bit better.
>
> Great, thanks!
I did the simplest possible thing, so let's see if we can land this:
https://reviews.llvm.org/D102772
> I think that kernel-side we should have a policy going forward that for
> new instrumentation it must be possible to opt-out like this (and when
> support is added, `noinstr` gets upsated to opt-out). Correspondingly on
> the compiler-side, it'd be good if that was seen as a general
> requirement for new instrumentation.
No argument with that!
Thanks,
-- Marco
next prev parent reply other threads:[~2021-05-19 14:04 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CAKwvOdm-Vb2BGRCmtYCh5JcGkM+XedzSMdNr8kQLbY4y_85EvA@mail.gmail.com>
[not found] ` <20210518121447.GB7914@willie-the-truck>
[not found] ` <20210518124311.r4fwv6lfz3erkqnb@treble>
2021-05-18 12:48 ` Linux Plumbers Conf 2021 Josh Poimboeuf
2021-05-18 13:21 ` Peter Zijlstra
2021-05-18 16:57 ` Nick Desaulniers
2021-05-18 20:03 ` Peter Zijlstra
2021-05-18 20:15 ` Nick Desaulniers
2021-05-19 9:32 ` Mark Rutland
2021-05-19 10:19 ` Marco Elver
2021-05-19 11:56 ` Mark Rutland
2021-05-19 14:04 ` Marco Elver [this message]
2021-05-19 15:02 ` Martin Liška
2021-05-19 15:05 ` Marco Elver
2021-05-20 8:34 ` Martin Liška
2021-06-16 23:01 ` Nick Desaulniers
2021-06-24 20:35 ` Nick Desaulniers
2021-06-24 20:37 ` Nick Desaulniers
2021-06-28 17:59 ` Will Deacon
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=CANpmjNNo7SP1cKWMXFAOECif_YOxoiLH3k8h8QHoHRntSirRgQ@mail.gmail.com \
--to=elver@google.com \
--cc=ardb@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=jemarch@gnu.org \
--cc=jpoimboe@redhat.com \
--cc=linux-toolchains@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mliska@suse.cz \
--cc=ndesaulniers@google.com \
--cc=paulmck@kernel.org \
--cc=peterz@infradead.org \
--cc=will@kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).