On Mon, Dec 04, 2017 at 03:07:45PM +0100, Thomas Gleixner wrote:
> From: Andy Lutomirski <[email protected]>
> 
> 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 <[email protected]>
> Signed-off-by: Thomas Gleixner <[email protected]>
> ---
>  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 <[email protected]>

-- 
Regards/Gruss,
    Boris.

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

Reply via email to