Re: [PATCH 10/16] x86/mm/pti: Populate valid user pud entries

From: Thomas Gleixner
Date: Tue Jan 16 2018 - 16:06:57 EST


On Tue, 16 Jan 2018, Joerg Roedel wrote:

> From: Joerg Roedel <jroedel@xxxxxxx>
>
> With PAE paging we don't have PGD and P4D levels in the
> page-table, instead the PUD level is the highest one.
>
> In PAE page-tables at the top-level most bits we usually set
> with _KERNPG_TABLE are reserved, resulting in a #GP when
> they are loaded by the processor.
>
> Work around this by populating PUD entries in the user
> page-table only with _PAGE_PRESENT set.
>
> I am pretty sure there is a cleaner way to do this, but
> until I find it use this #ifdef solution.

Stick somehting like

#define _KERNELPG_TABLE_PUD_ENTRY

into the 32 and 64 bit variants of some relevant header file

Thanks,

tglx