Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934693AbcCOQS4 (ORCPT ); Tue, 15 Mar 2016 12:18:56 -0400 Received: from g9t5008.houston.hp.com ([15.240.92.66]:53207 "EHLO g9t5008.houston.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752359AbcCOQSy (ORCPT ); Tue, 15 Mar 2016 12:18:54 -0400 Message-ID: <1458061883.6393.359.camel@hpe.com> Subject: Re: [PATCH 1/2] x86/mm/pat: Change pat_disable() to emulate PAT table From: Toshi Kani To: Borislav Petkov Cc: "Luis R. Rodriguez" , "mingo@kernel.org" , "hpa@zytor.com" , "tglx@linutronix.de" , "jgross@suse.com" , "paul.gortmaker@windriver.com" , "x86@kernel.org" , "linux-kernel@vger.kernel.org" , "xen-devel@lists.xenproject.org" , "boris.ostrovsky@oracle.com" Date: Tue, 15 Mar 2016 11:11:23 -0600 In-Reply-To: <20160315154731.GD4559@pd.tnic> References: <1457671546-13486-2-git-send-email-toshi.kani@hpe.com> <20160311091229.GA4347@pd.tnic> <1457713660.6393.55.camel@hpe.com> <20160311155439.GF4312@pd.tnic> <1457724504.6393.151.camel@hpe.com> <20160312115544.GA23410@pd.tnic> <20160315002921.GG25147@wotan.suse.de> <1458011476.6393.327.camel@hpe.com> <20160315110148.GC4559@pd.tnic> <1458056595.6393.332.camel@hpe.com> <20160315154731.GD4559@pd.tnic> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.18.4 (3.18.4-1.fc23) Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1153 Lines: 29 On Tue, 2016-03-15 at 16:47 +0100, Borislav Petkov wrote: > On Tue, Mar 15, 2016 at 09:43:15AM -0600, Toshi Kani wrote: > > > Please use on init paths boot_cpu_has(X86_FEATURE_PAT) and on fast > > > paths static_cpu_has(X86_FEATURE_PAT). No more of that cpu_has_XXX > > > ugliness. > > > > 'cpu_has_pat' is defined as 'boot_cpu_has(X86_FEATURE_PAT)'.  Do you > > mean it should explicitly use 'boot_cpu_has(X86_FEATURE_PAT)'? > > No, read what I said. > > We use boot_cpu_has() on slow paths (i.e., init, bootup, > etc), where speed is not that important. static_cpu_has() > is an optimized version which should be used in hot paths. Yes, I understand that part.  Let me rephrase my question. This PAT code is on init paths and speed is not that important.  So, it needs to use 'boot_cpu_has()' here.  'cpu_has_pat' is defined as boot_cpu_has(X86_FEATURE_PAT), and hence it uses boot_cpu_has() already.   While cpu_has_pat is the same as boot_cpu_has(X86_FEATURE_PAT), cpu_has_XXX should not be used.  So, this code needs to be changed to use boot_cpu_has(X86_FEATURE_PAT) directly. Is this right? Thanks, -Toshi