[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20171218125242.5ny3lgqfdlhm7rhw@hirez.programming.kicks-ass.net>
Date: Mon, 18 Dec 2017 13:52:42 +0100
From: Peter Zijlstra <peterz@...radead.org>
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>,
Dave Hansen <dave.hansen@...el.com>,
Borislav Petkov <bpetkov@...e.de>,
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,
Dave Hansen <dave.hansen@...ux.intel.com>,
Ingo Molnar <mingo@...nel.org>, Borislav Petkov <bp@...en8.de>,
"H. Peter Anvin" <hpa@...or.com>
Subject: Re: [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..
Powered by blists - more mailing lists