From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752888AbdK0SPg (ORCPT ); Mon, 27 Nov 2017 13:15:36 -0500 Received: from mga06.intel.com ([134.134.136.31]:34576 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751528AbdK0SPf (ORCPT ); Mon, 27 Nov 2017 13:15:35 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,465,1505804400"; d="scan'208";a="10197616" Subject: Re: [patch V2 2/5] x86/kaiser: Simplify disabling of global pages To: Thomas Gleixner , LKML References: <20171126231403.657575796@linutronix.de> <20171126232414.393912629@linutronix.de> Cc: Andy Lutomirski , Ingo Molnar , Borislav Petkov , Brian Gerst , Denys Vlasenko , "H. Peter Anvin" , Josh Poimboeuf , Linus Torvalds , Peter Zijlstra , Rik van Riel , daniel.gruss@iaik.tugraz.at, hughd@google.com, keescook@google.com, linux-mm@kvack.org, michael.schwarz@iaik.tugraz.at, moritz.lipp@iaik.tugraz.at, richard.fellner@student.tugraz.at From: Dave Hansen Message-ID: <0b5a64f1-9979-ae56-99f8-72c3802a9c60@linux.intel.com> Date: Mon, 27 Nov 2017 10:15:33 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171126232414.393912629@linutronix.de> Content-Type: text/plain; charset=iso-8859-15 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/26/2017 03:14 PM, Thomas Gleixner wrote: > +static void enable_global_pages(void) > +{ > +#ifndef CONFIG_KAISER > + __supported_pte_mask |= _PAGE_GLOBAL; > +#endif > +} > + > static void __init probe_page_size_mask(void) > { > /* > @@ -179,11 +186,11 @@ static void __init probe_page_size_mask( > cr4_set_bits_and_update_boot(X86_CR4_PSE); > > /* Enable PGE if available */ > + __supported_pte_mask |= _PAGE_GLOBAL; > if (boot_cpu_has(X86_FEATURE_PGE)) { > cr4_set_bits_and_update_boot(X86_CR4_PGE); > - __supported_pte_mask |= _PAGE_GLOBAL; > - } else > - __supported_pte_mask &= ~_PAGE_GLOBAL; > + enable_global_pages(); > + } This looks a little funky. Doesn't this or _PAGE_GLOBAL into __supported_pte_mask twice? Once before the if(), and then a second time via enable_global_pages() inside the if? Did you intend for it to be masked *out* in the first one and then or'd back in via enable_global_pages()?