From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933682AbdKAVSZ (ORCPT ); Wed, 1 Nov 2017 17:18:25 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:51263 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933262AbdKAVSW (ORCPT ); Wed, 1 Nov 2017 17:18:22 -0400 Date: Wed, 1 Nov 2017 22:18:18 +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 03/23] x86, kaiser: disable global pages In-Reply-To: <20171031223152.B5D241B2@viggo.jf.intel.com> Message-ID: References: <20171031223146.6B47C861@viggo.jf.intel.com> <20171031223152.B5D241B2@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: > --- a/arch/x86/include/asm/pgtable_types.h~kaiser-prep-disable-global-pages 2017-10-31 15:03:49.314064402 -0700 > +++ b/arch/x86/include/asm/pgtable_types.h 2017-10-31 15:03:49.323064827 -0700 > @@ -47,7 +47,12 @@ > #define _PAGE_ACCESSED (_AT(pteval_t, 1) << _PAGE_BIT_ACCESSED) > #define _PAGE_DIRTY (_AT(pteval_t, 1) << _PAGE_BIT_DIRTY) > #define _PAGE_PSE (_AT(pteval_t, 1) << _PAGE_BIT_PSE) > +#ifdef CONFIG_X86_GLOBAL_PAGES > #define _PAGE_GLOBAL (_AT(pteval_t, 1) << _PAGE_BIT_GLOBAL) > +#else > +/* We must ensure that kernel TLBs are unusable while in userspace */ > +#define _PAGE_GLOBAL (_AT(pteval_t, 0)) > +#endif What you really want to do here is to clear PAGE_GLOBAL in the supported_pte_mask. probe_page_size_mask() is the proper place for that. This allows both .config and boottime configuration. Thanks, tglx