From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752677AbdLESdk (ORCPT ); Tue, 5 Dec 2017 13:33:40 -0500 Received: from mx2.suse.de ([195.135.220.15]:57837 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752126AbdLESdh (ORCPT ); Tue, 5 Dec 2017 13:33:37 -0500 Date: Tue, 5 Dec 2017 19:33:21 +0100 From: Borislav Petkov To: Thomas Gleixner Cc: LKML , x86@kernel.org, Linus Torvalds , Andy Lutomirsky , Peter Zijlstra , Dave Hansen , Greg KH , keescook@google.com, hughd@google.com, Brian Gerst , Josh Poimboeuf , Denys Vlasenko , Rik van Riel , Boris Ostrovsky , Juergen Gross , David Laight , Eduardo Valentin , aliguori@amazon.com, Will Deacon , daniel.gruss@iaik.tugraz.at, Dave Hansen Subject: Re: [patch 33/60] x86/mm/kpti: Allocate a separate user PGD Message-ID: <20171205183321.paaz6exxpaagr7vk@pd.tnic> References: <20171204140706.296109558@linutronix.de> <20171204150607.554562018@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20171204150607.554562018@linutronix.de> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 04, 2017 at 03:07:39PM +0100, Thomas Gleixner wrote: > From: Dave Hansen > > Kernel page table isolation requires to have two PGDs. One for the kernel, > which contains the full kernel mapping plus the user space mapping and one > for user space which contains the user space mappings and the minimal set > of kernel mappings which are required by the architecture to be able to > transition from and to user space. > > Add the necessary preliminaries. > > [ tglx: Split out from the big kaiser dump ] > > Signed-off-by: Dave Hansen > Signed-off-by: Thomas Gleixner > > --- > arch/x86/kernel/head_64.S | 30 +++++++++++++++++++++++++++--- > arch/x86/mm/pgtable.c | 16 ++++++++++++++-- > 2 files changed, 41 insertions(+), 5 deletions(-) ... > --- a/arch/x86/mm/pgtable.c > +++ b/arch/x86/mm/pgtable.c > @@ -355,14 +355,26 @@ static inline void _pgd_free(pgd_t *pgd) > kmem_cache_free(pgd_cache, pgd); > } > #else > + > +#ifdef CONFIG_KERNEL_PAGE_TABLE_ISOLATION > +/* > + * Instead of one pgd, we aquire two pgds. Being order-1, it is "acquire" Otherwise: Reviewed-by: Borislav Petkov -- Regards/Gruss, Boris. SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg) --