[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAHk-=wiRARoL=c0zSJbA9v8n7jqBnxaUyxOPGppoz9M4G+mahw@mail.gmail.com>
Date: Mon, 23 Sep 2019 11:12:27 -0700
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Song Liu <songliubraving@...com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
kernel-team@...com, "the arch/x86 maintainers" <x86@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...nel.org>
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@...radead.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
Powered by blists - more mailing lists