[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAAeHK+z5pqSYJifvpLoHNe83UaJSsuR8WdBS8-JOwgCeHTi8ow@mail.gmail.com>
Date: Fri, 18 Sep 2020 17:45:54 +0200
From: Andrey Konovalov <andreyknvl@...gle.com>
To: Marco Elver <elver@...gle.com>
Cc: Dmitry Vyukov <dvyukov@...gle.com>,
Vincenzo Frascino <vincenzo.frascino@....com>,
Catalin Marinas <catalin.marinas@....com>,
kasan-dev <kasan-dev@...glegroups.com>,
Andrey Ryabinin <aryabinin@...tuozzo.com>,
Alexander Potapenko <glider@...gle.com>,
Evgenii Stepanov <eugenis@...gle.com>,
Elena Petrova <lenaptr@...gle.com>,
Branislav Rankov <Branislav.Rankov@....com>,
Kevin Brodsky <kevin.brodsky@....com>,
Will Deacon <will.deacon@....com>,
Andrew Morton <akpm@...ux-foundation.org>,
Linux ARM <linux-arm-kernel@...ts.infradead.org>,
Linux Memory Management List <linux-mm@...ck.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 21/37] kasan: introduce CONFIG_KASAN_HW_TAGS
On Fri, Sep 18, 2020 at 5:36 PM Marco Elver <elver@...gle.com> wrote:
>
> > > How about something like the below change (introduce KASAN_INSTRUMENTED
> > > Kconfig var) to avoid the repeated "KASAN_GENERIC || KASAN_SW_TAGS".
> > > This could then also be used in the various .c/.h files (and make some
> > > of the code more readable hopefully).
> >
> > I tried doing that initially, but it didn't really look good. The
> > reason is that we actually have two properties that are currently
> > common for the software modes, but aren't actually tied to each other:
> > instrumentation and shadow memory. Therefore we will end up with two
> > new configs: KASAN_INSTRUMENTED and KASAN_USES_SHADOW (or something),
> > and things get quite confusing. I think it's better to keep
> > KASAN_GENERIC || KASAN_SW_TAGS everywhere.
>
> Ah, I see. So in some cases the reason the #ifdef exists is because of
> instrumentation, in other cases because there is some shadow memory
> (right?).
Correct.
> The only other option I see is to call it what it is ("KASAN_SW" or
> "KASAN_SOFTWARE"), but other than that, I don't mind if it stays
> as-is.
Let's leave it as is then. I don't think the code will get much better
in terms of readability if we add KASAN_SOFTWARE, but we'll get
another "indirect" config option, which makes things a bit more
confusing.
Powered by blists - more mailing lists