lkml.org 
[lkml]   [2019]   [Sep]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] x86/mm/pti: Handle unaligned addr to PMD-mapped page in pti_clone_pgtable
On Mon, Sep 23, 2019 at 4:28 AM Peter Zijlstra <peterz@infradead.org> wrote:
>
> I'm conflicted on this one... the only use of addr here is
> pti_user_pagetable_walk_pmd() and that already masks things, so the
> fixup is 'pointless'.

No it's not.

The *other* use of 'addr' is

addr += PMD_SIZE;

and then repeat the loop.

And that repeat might then use it for the page-level case the next iteration.

> Also the location is weird; we'd want to do alignment enforcement before
> we commence the for-loop, methinks.

No. See again. The alignment is different for the different cases
inside the loop. Some do per-page stuff, some do per-pmd stuff, and
some do per-pud stuff.

And you don't know which you'll hit a-priori (because it's not limited
to the 'level' testing).

Linus

\
 
 \ /
  Last update: 2019-09-23 20:13    [W:0.044 / U:0.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site