[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20171206211759.ityt5x5llrk3xth3@pd.tnic>
Date: Wed, 6 Dec 2017 22:18:00 +0100
From: Borislav Petkov <bp@...e.de>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: LKML <linux-kernel@...r.kernel.org>, x86@...nel.org,
Linus Torvalds <torvalds@...ux-foundation.org>,
Andy Lutomirsky <luto@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Dave Hansen <dave.hansen@...el.com>,
Greg KH <gregkh@...uxfoundation.org>, keescook@...gle.com,
hughd@...gle.com, Brian Gerst <brgerst@...il.com>,
Josh Poimboeuf <jpoimboe@...hat.com>,
Denys Vlasenko <dvlasenk@...hat.com>,
Rik van Riel <riel@...hat.com>,
Boris Ostrovsky <boris.ostrovsky@...cle.com>,
Juergen Gross <jgross@...e.com>,
David Laight <David.Laight@...lab.com>,
Eduardo Valentin <eduval@...zon.com>, aliguori@...zon.com,
Will Deacon <will.deacon@....com>, daniel.gruss@...k.tugraz.at
Subject: Re: [patch 39/60] x86/mm/kpti: Share cpu_entry_area PMDs
On Mon, Dec 04, 2017 at 03:07:45PM +0100, Thomas Gleixner wrote:
> From: Andy Lutomirski <luto@...nel.org>
>
> Share the FIX_USR_SHARED PMDs so the user space and kernel space page
> tables have the same PMD page.
>
> [ tglx: Made it use the FIX_USR_SHARED range so later additions
> are covered automatically ]
>
> Signed-off-by: Andy Lutomirski <luto@...nel.org>
> Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
> ---
> arch/x86/mm/kpti.c | 18 ++++++++++++++++++
> 1 file changed, 18 insertions(+)
>
> --- a/arch/x86/mm/kpti.c
> +++ b/arch/x86/mm/kpti.c
> @@ -167,6 +167,23 @@ kpti_clone_pmds(unsigned long start, uns
> }
>
> /*
> + * Clone the populated PMDs of the user shared fixmaps into the user space
> + * visible page table.
> + */
> +static void __init kpti_clone_user_shared(void)
> +{
> + unsigned long bot, top;
> +
> + bot = __fix_to_virt(FIX_USR_SHARED_BOTTOM);
> + top = __fix_to_virt(FIX_USR_SHARED_TOP) + PAGE_SIZE;
> +
> + /* Top of the user shared block must be PMD-aligned. */
> + WARN_ON(top & ~PMD_MASK);
Or
WARN_ON(top & (PMD_SIZE - 1));
Otherwise:
Reviewed-by: Borislav Petkov <bp@...e.de>
--
Regards/Gruss,
Boris.
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)
--
Powered by blists - more mailing lists