lkml.org 
[lkml]   [2017]   [Dec]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch V163 24/51] x86/mm/pti: Add mapping helper functions
On Mon, Dec 18, 2017 at 12:42:39PM +0100, Thomas Gleixner wrote:
> static inline void native_set_p4d(p4d_t *p4dp, p4d_t p4d)
> {
> +#if defined(CONFIG_PAGE_TABLE_ISOLATION) && !defined(CONFIG_X86_5LEVEL)
> + p4dp->pgd = pti_set_user_pgd(&p4dp->pgd, p4d.pgd);
> +#else
> *p4dp = p4d;
> +#endif
> }
>
> static inline void native_p4d_clear(p4d_t *p4d)
> @@ -147,7 +235,11 @@ static inline void native_p4d_clear(p4d_
>
> static inline void native_set_pgd(pgd_t *pgdp, pgd_t pgd)
> {
> +#ifdef CONFIG_PAGE_TABLE_ISOLATION
> + *pgdp = pti_set_user_pgd(pgdp, pgd);
> +#else
> *pgdp = pgd;
> +#endif
> }

We should probably start using WRITE_ONCE() to set page-table entries.
But that's a whole separate patch series..

\
 
 \ /
  Last update: 2017-12-18 14:51    [W:0.267 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site