linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Gow <davidgow@google.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: Vincent Whitchurch <vincent.whitchurch@axis.com>,
	Patricia Alfonso <trishalfonso@google.com>,
	Jeff Dike <jdike@addtoit.com>,
	Richard Weinberger <richard@nod.at>,
	Anton Ivanov <anton.ivanov@cambridgegreys.com>,
	Dmitry Vyukov <dvyukov@google.com>,
	Brendan Higgins <brendanhiggins@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Andrey Konovalov <andreyknvl@gmail.com>,
	Andrey Ryabinin <ryabinin.a.a@gmail.com>,
	kasan-dev <kasan-dev@googlegroups.com>,
	linux-um <linux-um@lists.infradead.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Daniel Latypov <dlatypov@google.com>,
	Linux Memory Management List <linux-mm@kvack.org>
Subject: Re: [PATCH v2 2/2] UML: add support for KASAN under x86_64
Date: Thu, 30 Jun 2022 15:53:22 +0800	[thread overview]
Message-ID: <CABVgOSmcwGa4tw8EvuxbeOvrTLh8d7V3mFxGyj2spnqqWkFp9Q@mail.gmail.com> (raw)
In-Reply-To: <1a4e51a4d2ed51e7ae1ff55bd4da6a47fad7c0bf.camel@sipsolutions.net>

[-- Attachment #1: Type: text/plain, Size: 1411 bytes --]

On Mon, May 30, 2022 at 1:04 AM Johannes Berg <johannes@sipsolutions.net> wrote:
>
> On Fri, 2022-05-27 at 11:56 -0700, David Gow wrote:
> >
> > The UML-specific KASAN initializer uses mmap to map the roughly 2.25TB
>
> You say 2.25TB here, and
>
> > +config KASAN_SHADOW_OFFSET
> > +     hex
> > +     depends on KASAN
> > +     default 0x100000000000
> > +     help
> > +       This is the offset at which the ~2.25TB of shadow memory is
>
> here too, of course.
>
> But I notice that I get ~16TB address space use when running,
>
> > +/* used in kasan_mem_to_shadow to divide by 8 */
> > +#define KASAN_SHADOW_SCALE_SHIFT 3
> > +
> > +#ifdef CONFIG_X86_64
> > +#define KASAN_HOST_USER_SPACE_END_ADDR 0x00007fffffffffffUL
> > +/* KASAN_SHADOW_SIZE is the size of total address space divided by 8 */
> > +#define KASAN_SHADOW_SIZE ((KASAN_HOST_USER_SPACE_END_ADDR + 1) >> \
> > +                     KASAN_SHADOW_SCALE_SHIFT)
>
> because this ends up being 0x100000000000, i.e. 16 TiB.
>
> Is that intentional? Was something missed? Maybe
> KASAN_HOST_USER_SPACE_END_ADDR was too big?
>
> It doesn't really matter, but I guess then the documentation should be
> updated.

Whoops, the amount of shadow memory allocated was changed for v1 of
this patch (it was ~2.25 TB in the original RFC). I've updated these
comments in v3:
https://lore.kernel.org/lkml/20220630074757.2739000-2-davidgow@google.com/

-- David

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4003 bytes --]

  reply	other threads:[~2022-06-30  7:53 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-27 18:55 [PATCH v2 1/2] mm: Add PAGE_ALIGN_DOWN macro David Gow
2022-05-27 18:56 ` [PATCH v2 2/2] UML: add support for KASAN under x86_64 David Gow
2022-05-27 20:14   ` Johannes Berg
2022-05-29 17:55     ` Johannes Berg
2022-06-30  7:53     ` David Gow
2022-05-29 17:04   ` Johannes Berg
2022-06-30  7:53     ` David Gow [this message]
2022-05-30 18:03   ` Andrey Konovalov
2022-06-30  7:54     ` David Gow
2022-05-30  0:06 ` [PATCH v2 1/2] mm: Add PAGE_ALIGN_DOWN macro Andrew Morton

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=CABVgOSmcwGa4tw8EvuxbeOvrTLh8d7V3mFxGyj2spnqqWkFp9Q@mail.gmail.com \
    --to=davidgow@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=andreyknvl@gmail.com \
    --cc=anton.ivanov@cambridgegreys.com \
    --cc=brendanhiggins@google.com \
    --cc=dlatypov@google.com \
    --cc=dvyukov@google.com \
    --cc=jdike@addtoit.com \
    --cc=johannes@sipsolutions.net \
    --cc=kasan-dev@googlegroups.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-um@lists.infradead.org \
    --cc=richard@nod.at \
    --cc=ryabinin.a.a@gmail.com \
    --cc=trishalfonso@google.com \
    --cc=vincent.whitchurch@axis.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 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).