lkml.org 
[lkml]   [2017]   [Dec]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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@kernel.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@kernel.org>
> Signed-off-by: Thomas Gleixner <tglx@linutronix.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@suse.de>

--
Regards/Gruss,
Boris.

SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)
--

\
 
 \ /
  Last update: 2017-12-06 22:19    [W:0.504 / U:0.808 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site