From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752119AbdLFU4K (ORCPT ); Wed, 6 Dec 2017 15:56:10 -0500 Received: from mail-wr0-f193.google.com ([209.85.128.193]:41276 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751598AbdLFU4J (ORCPT ); Wed, 6 Dec 2017 15:56:09 -0500 X-Google-Smtp-Source: AGs4zMalAg5bmQ9Yb0fEEQFh66JdYqjl63TNhYZRMReskNP0QrMnOjX+rWf084xxO05xNfjm4LdYpg== Date: Wed, 6 Dec 2017 21:56:05 +0100 From: Ingo Molnar To: Borislav Petkov Cc: Thomas Gleixner , 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: <20171206205605.e2tnt67w5tmtk323@gmail.com> References: <20171204140706.296109558@linutronix.de> <20171204150607.554562018@linutronix.de> <20171205183321.paaz6exxpaagr7vk@pd.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171205183321.paaz6exxpaagr7vk@pd.tnic> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Borislav Petkov wrote: > 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" Fixed. I also did a s/pgd/PGD > Otherwise: > > Reviewed-by: Borislav Petkov Thanks! Ingo