From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933404AbdKAVLm (ORCPT ); Wed, 1 Nov 2017 17:11:42 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:51172 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933124AbdKAVLk (ORCPT ); Wed, 1 Nov 2017 17:11:40 -0400 Date: Wed, 1 Nov 2017 22:11:37 +0100 (CET) From: Thomas Gleixner To: Dave Hansen cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, moritz.lipp@iaik.tugraz.at, daniel.gruss@iaik.tugraz.at, michael.schwarz@iaik.tugraz.at, luto@kernel.org, torvalds@linux-foundation.org, keescook@google.com, hughd@google.com, x86@kernel.org Subject: Re: [PATCH 02/23] x86, kaiser: do not set _PAGE_USER for init_mm page tables In-Reply-To: <20171031223150.AB41C68F@viggo.jf.intel.com> Message-ID: References: <20171031223146.6B47C861@viggo.jf.intel.com> <20171031223150.AB41C68F@viggo.jf.intel.com> 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 On Tue, 31 Oct 2017, Dave Hansen wrote: > > init_mm is for kernel-exclusive use. If someone is allocating page > tables in it, do not set _PAGE_USER on them. This ensures that > we do *not* set NX on these page tables in the KAISER code. This changelog is confusing at best. Why is this a kaiser issue? Nothing should ever create _PAGE_USER entries in init_mm, right? So this is a general improvement and creating a _PAGE_USER entry in init_mm should be considered a bug in the first place. > +/* > + * _KERNPG_TABLE has _PAGE_USER clear which tells the KAISER code > + * that this mapping is for kernel use only. That makes sure that > + * we leave the mapping usable by the kernel and do not try to > + * sabotage it by doing stuff like setting _PAGE_NX on it. So this comment should not mention KAISER at all. As I explained above there are no user mappings in init_mm and this should be expressed here. The fact that KAISER can make use of this information is a different story. Other than that: Reviewed-by: Thomas Gleixner Thanks, tglx