From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752506AbdLFVSO (ORCPT ); Wed, 6 Dec 2017 16:18:14 -0500 Received: from mx2.suse.de ([195.135.220.15]:53308 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751604AbdLFVSN (ORCPT ); Wed, 6 Dec 2017 16:18:13 -0500 Date: Wed, 6 Dec 2017 22:18:00 +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 Subject: Re: [patch 39/60] x86/mm/kpti: Share cpu_entry_area PMDs Message-ID: <20171206211759.ityt5x5llrk3xth3@pd.tnic> References: <20171204140706.296109558@linutronix.de> <20171204150608.041596550@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20171204150608.041596550@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:45PM +0100, Thomas Gleixner wrote: > From: Andy Lutomirski > > Share the FIX_USR_SHARED PMDs so the user space and kernel space page > tables have the same PMD page. > > [ tglx: Made it use the FIX_USR_SHARED range so later additions > are covered automatically ] > > Signed-off-by: Andy Lutomirski > Signed-off-by: Thomas Gleixner > --- > arch/x86/mm/kpti.c | 18 ++++++++++++++++++ > 1 file changed, 18 insertions(+) > > --- a/arch/x86/mm/kpti.c > +++ b/arch/x86/mm/kpti.c > @@ -167,6 +167,23 @@ kpti_clone_pmds(unsigned long start, uns > } > > /* > + * Clone the populated PMDs of the user shared fixmaps into the user space > + * visible page table. > + */ > +static void __init kpti_clone_user_shared(void) > +{ > + unsigned long bot, top; > + > + bot = __fix_to_virt(FIX_USR_SHARED_BOTTOM); > + top = __fix_to_virt(FIX_USR_SHARED_TOP) + PAGE_SIZE; > + > + /* Top of the user shared block must be PMD-aligned. */ > + WARN_ON(top & ~PMD_MASK); Or WARN_ON(top & (PMD_SIZE - 1)); Otherwise: Reviewed-by: Borislav Petkov -- Regards/Gruss, Boris. SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg) --