From mboxrd@z Thu Jan 1 00:00:00 1970 Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 14 Nov 2014 16:21:40 +0100 (CET) Received: from mga01.intel.com ([192.55.52.88]:35213 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by eddie.linux-mips.org with ESMTP id S27013725AbaKNPTjutjMR (ORCPT ); Fri, 14 Nov 2014 16:19:39 +0100 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 14 Nov 2014 07:18:54 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.07,386,1413270000"; d="scan'208";a="632005803" Received: from viggo.jf.intel.com (HELO localhost.localdomain) ([10.23.232.122]) by fmsmga002.fm.intel.com with ESMTP; 14 Nov 2014 07:18:23 -0800 Subject: [PATCH 05/11] x86, mpx: add MPX to disaabled features To: hpa@zytor.com Cc: tglx@linutronix.de, mingo@redhat.com, x86@kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-ia64@vger.kernel.org, linux-mips@linux-mips.org, qiaowei.ren@intel.com, Dave Hansen , dave.hansen@linux.intel.com From: Dave Hansen Date: Fri, 14 Nov 2014 07:18:23 -0800 References: <20141114151816.F56A3072@viggo.jf.intel.com> In-Reply-To: <20141114151816.F56A3072@viggo.jf.intel.com> Message-Id: <20141114151823.B358EAD2@viggo.jf.intel.com> Return-Path: X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0) X-Orcpt: rfc822;linux-mips@linux-mips.org Original-Recipient: rfc822;linux-mips@linux-mips.org X-archive-position: 44172 X-ecartis-version: Ecartis v1.0.0 Sender: linux-mips-bounce@linux-mips.org Errors-to: linux-mips-bounce@linux-mips.org X-original-sender: dave@sr71.net Precedence: bulk List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: linux-mips X-List-ID: linux-mips List-subscribe: List-owner: List-post: List-archive: X-list: linux-mips From: Dave Hansen This allows us to use cpu_feature_enabled(X86_FEATURE_MPX) as both a runtime and compile-time check. When CONFIG_X86_INTEL_MPX is disabled, cpu_feature_enabled(X86_FEATURE_MPX) will evaluate at compile-time to 0. If CONFIG_X86_INTEL_MPX=y, then the cpuid flag will be checked at runtime. Signed-off-by: Dave Hansen Signed-off-by: Qiaowei Ren --- b/arch/x86/include/asm/disabled-features.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff -puN arch/x86/include/asm/disabled-features.h~mpx-v11-add-MPX-to-disaabled-features arch/x86/include/asm/disabled-features.h --- a/arch/x86/include/asm/disabled-features.h~mpx-v11-add-MPX-to-disaabled-features 2014-11-14 07:06:22.297610243 -0800 +++ b/arch/x86/include/asm/disabled-features.h 2014-11-14 07:06:22.300610378 -0800 @@ -10,6 +10,12 @@ * cpu_feature_enabled(). */ +#ifdef CONFIG_X86_INTEL_MPX +# define DISABLE_MPX 0 +#else +# define DISABLE_MPX (1<<(X86_FEATURE_MPX & 31)) +#endif + #ifdef CONFIG_X86_64 # define DISABLE_VME (1<<(X86_FEATURE_VME & 31)) # define DISABLE_K6_MTRR (1<<(X86_FEATURE_K6_MTRR & 31)) @@ -34,6 +40,6 @@ #define DISABLED_MASK6 0 #define DISABLED_MASK7 0 #define DISABLED_MASK8 0 -#define DISABLED_MASK9 0 +#define DISABLED_MASK9 (DISABLE_MPX) #endif /* _ASM_X86_DISABLED_FEATURES_H */ _