[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Thu, 11 Nov 2021 12:35:00 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Marco Elver <elver@...gle.com>
Cc: "Paul E . McKenney" <paulmck@...nel.org>,
Alexander Potapenko <glider@...gle.com>,
Boqun Feng <boqun.feng@...il.com>,
Borislav Petkov <bp@...en8.de>,
Dmitry Vyukov <dvyukov@...gle.com>,
Ingo Molnar <mingo@...nel.org>,
Josh Poimboeuf <jpoimboe@...hat.com>,
Mark Rutland <mark.rutland@....com>,
Thomas Gleixner <tglx@...utronix.de>,
Waiman Long <longman@...hat.com>,
Will Deacon <will@...nel.org>, kasan-dev@...glegroups.com,
linux-arch@...r.kernel.org, linux-doc@...r.kernel.org,
linux-kbuild@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-mm@...ck.org, x86@...nel.org
Subject: Re: [PATCH -rcu/kcsan 23/23] objtool, kcsan: Remove memory barrier
instrumentation from noinstr
On Thu, Nov 11, 2021 at 11:11:00AM +0100, Marco Elver wrote:
> On Tue, 5 Oct 2021 at 17:13, Marco Elver <elver@...gle.com> wrote:
> > So this is where I'd like to hear if the approach of:
> >
> > | #if !defined(CONFIG_ARCH_WANTS_NO_INSTR) || defined(CONFIG_STACK_VALIDATION)
> > | ...
> > | #else
> > | #define kcsan_noinstr noinstr
> > | static __always_inline bool within_noinstr(unsigned long ip)
> > | {
> > | return (unsigned long)__noinstr_text_start <= ip &&
> > | ip < (unsigned long)__noinstr_text_end;
Provided these turn into compile time constants this stands a fair
chance of working I suppose. Once this needs data loads things get a
*lot* more tricky.
> > | }
> > | #endif
> >
> > and then (using the !STACK_VALIDATION definitions)
> >
> > | kcsan_noinstr void instrumentation_may_appear_in_noinstr(void)
> > | {
> > | if (within_noinstr(_RET_IP_))
> > | return;
> >
> > works for the non-x86 arches that select ARCH_WANTS_NO_INSTR.
> >
> > If it doesn't I can easily just remove kcsan_noinstr/within_noinstr, and
> > add a "depends on !ARCH_WANTS_NO_INSTR || STACK_VALIDATION" to the
> > KCSAN_WEAK_MEMORY option.
> >
> > Looking at a previous discussion [1], however, I was under the
> > impression that this would work.
> >
> > [1] https://lkml.kernel.org/r/CANpmjNMAZiW-Er=2QDgGP+_3hg1LOvPYcbfGSPMv=aR6MVTB-g@mail.gmail.com
>
> I'll send v2 of this series after 5.16-rc1. So far I think we haven't
> been able to say the above doesn't work, which means I'll assume it
> works on non-x86 architectures with ARCH_WANTS_NO_INSTR until we get
> evidence of the opposite.
Fair enough.
Powered by blists - more mailing lists