lkml.org 
[lkml]   [2021]   [Dec]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH mm v3 29/38] kasan, vmalloc: add vmalloc tagging for HW_TAGS
On Tue, Dec 14, 2021 at 8:56 PM Marco Elver <elver@google.com> wrote:
>
> On Mon, Dec 13, 2021 at 10:54PM +0100, andrey.konovalov@linux.dev wrote:
> [...]
> >
> > + /*
> > + * Skip page_alloc poisoning and zeroing for pages backing VM_ALLOC
> > + * mappings. Only effective in HW_TAGS mode.
> > + */
> > + gfp &= __GFP_SKIP_KASAN_UNPOISON & __GFP_SKIP_ZERO;
>
> This will turn gfp == 0 always. Should it have been
>
> gfp |= __GFP_SKIP_KASAN_UNPOISON | __GFP_SKIP_ZERO

Oh, this is bad. Thanks for noticing! Will fix in v4.

> Also, not sure it matters, but on non-KASAN builds, this will now always
> generate an extra instruction. You could conditionally define GFP_SKIP*
> only in the KASAN modes that need them, otherwise they become 0, so the
> compiler optimizes this out. (Although I think it does does complicate
> GFP_SHIFT a little?)

I can implement this, but I don't think a single extra instruction per
vmalloc() matters.

\
 
 \ /
  Last update: 2021-12-14 23:09    [W:0.092 / U:4.848 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site