Messages in this thread | | | From | Linus Torvalds <> | Date | Mon, 23 Sep 2019 11:12:27 -0700 | Subject | Re: [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
| |