[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACT4Y+aRq9j=3GODWBcnDnW=Pgp4e=N2++FTYEuq-00OmfXpbw@mail.gmail.com>
Date: Wed, 12 Feb 2020 07:23:16 +0100
From: Dmitry Vyukov <dvyukov@...gle.com>
To: Patricia Alfonso <trishalfonso@...gle.com>
Cc: Jeff Dike <jdike@...toit.com>, Richard Weinberger <richard@....at>,
anton.ivanov@...bridgegreys.com,
Andrey Ryabinin <aryabinin@...tuozzo.com>,
David Gow <davidgow@...gle.com>,
Brendan Higgins <brendanhiggins@...gle.com>,
linux-um@...ts.infradead.org,
kasan-dev <kasan-dev@...glegroups.com>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [RFC PATCH] UML: add support for KASAN under x86_64
On Wed, Feb 12, 2020 at 12:48 AM Patricia Alfonso
<trishalfonso@...gle.com> wrote:
>
> On Thu, Jan 16, 2020 at 12:44 AM Dmitry Vyukov <dvyukov@...gle.com> wrote:
> >
> > On Wed, Jan 15, 2020 at 7:28 PM Patricia Alfonso
> > <trishalfonso@...gle.com> wrote:
> > > +config KASAN_SHADOW_OFFSET
> > > + hex
> > > + depends on KASAN
> > > + default 0x100000000000
> > > + help
> > > + This is the offset at which the ~2.25TB of shadow memory is
> > > + initialized and used by KASAN for memory debugging. The default
> > > + is 0x100000000000.
> >
> > What are restrictions on this value?
> The only restriction is that there is enough space there to map all of
> the KASAN shadow memory without conflicting with anything else.
>
> > In user-space we use 0x7fff8000 as a base (just below 2GB) and it's
> > extremely profitable wrt codegen since it fits into immediate of most
> > instructions.
> > We can load and add the base with a short instruction:
> > 2d8c: 48 81 c2 00 80 ff 7f add $0x7fff8000,%rdx
> > Or even add base, load shadow and check it with a single 7-byte instruction:
> > 1e4: 80 b8 00 80 ff 7f 00 cmpb $0x0,0x7fff8000(%rax)
> >
> I just tested with 0x7fff8000 as the KASAN_SHADOW_OFFSET and it worked
> so I can make that the default if it will be more efficient.
I think it's the right thing to do if it works.
Powered by blists - more mailing lists