Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751047AbeAPVGw (ORCPT + 1 other); Tue, 16 Jan 2018 16:06:52 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:44307 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750811AbeAPVGv (ORCPT ); Tue, 16 Jan 2018 16:06:51 -0500 Date: Tue, 16 Jan 2018 22:06:48 +0100 (CET) From: Thomas Gleixner To: Joerg Roedel cc: Ingo Molnar , "H . Peter Anvin" , x86@kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Linus Torvalds , Andy Lutomirski , Dave Hansen , Josh Poimboeuf , Juergen Gross , Peter Zijlstra , Borislav Petkov , Jiri Kosina , Boris Ostrovsky , Brian Gerst , David Laight , Denys Vlasenko , Eduardo Valentin , Greg KH , Will Deacon , aliguori@amazon.com, daniel.gruss@iaik.tugraz.at, hughd@google.com, keescook@google.com, Andrea Arcangeli , Waiman Long , jroedel@suse.de Subject: Re: [PATCH 10/16] x86/mm/pti: Populate valid user pud entries In-Reply-To: <1516120619-1159-11-git-send-email-joro@8bytes.org> Message-ID: References: <1516120619-1159-1-git-send-email-joro@8bytes.org> <1516120619-1159-11-git-send-email-joro@8bytes.org> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Tue, 16 Jan 2018, Joerg Roedel wrote: > From: Joerg Roedel > > With PAE paging we don't have PGD and P4D levels in the > page-table, instead the PUD level is the highest one. > > In PAE page-tables at the top-level most bits we usually set > with _KERNPG_TABLE are reserved, resulting in a #GP when > they are loaded by the processor. > > Work around this by populating PUD entries in the user > page-table only with _PAGE_PRESENT set. > > I am pretty sure there is a cleaner way to do this, but > until I find it use this #ifdef solution. Stick somehting like #define _KERNELPG_TABLE_PUD_ENTRY into the 32 and 64 bit variants of some relevant header file Thanks, tglx