mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dave Hansen <dave@sr71.net>
To: linux-kernel@vger.kernel.org
Cc: bp@alien8.de, x86@kernel.org, hpa@zytor.com, Dave Hansen <dave@sr71.net>
Subject: [RFC][PATCH 2/3] x86: add more disabled features
Date: Fri, 20 Jun 2014 09:17:38 -0700	[thread overview]
Message-ID: <20140620161738.3ADE37A7@viggo.jf.intel.com> (raw)
In-Reply-To: <20140620161736.D6AC16FD@viggo.jf.intel.com>


There are a few other features than MPX that we can make
assumptions about at compile-time based on compile options.
Add them to disabled-features.h

---

 b/arch/x86/include/asm/cpufeature.h        |   18 ------------------
 b/arch/x86/include/asm/disabled-features.h |   16 ++++++++++++++--
 2 files changed, 14 insertions(+), 20 deletions(-)

diff -puN arch/x86/include/asm/cpufeature.h~x86-disabled_features-addmore arch/x86/include/asm/cpufeature.h
--- a/arch/x86/include/asm/cpufeature.h~x86-disabled_features-addmore	2014-06-20 09:16:08.420317511 -0700
+++ b/arch/x86/include/asm/cpufeature.h	2014-06-20 09:16:08.425317736 -0700
@@ -357,32 +357,14 @@ extern const char * const x86_power_flag
 #define cpu_has_eager_fpu	boot_cpu_has(X86_FEATURE_EAGER_FPU)
 #define cpu_has_topoext		boot_cpu_has(X86_FEATURE_TOPOEXT)
 
-#ifdef CONFIG_X86_INTEL_MPX
-#define cpu_has_mpx boot_cpu_has(X86_FEATURE_MPX)
-#else
-#define cpu_has_mpx 0
-#endif /* CONFIG_X86_INTEL_MPX */
-
 #ifdef CONFIG_X86_64
 
-#undef  cpu_has_vme
-#define cpu_has_vme		0
-
 #undef  cpu_has_pae
 #define cpu_has_pae		___BUG___
 
 #undef  cpu_has_mp
 #define cpu_has_mp		1
 
-#undef  cpu_has_k6_mtrr
-#define cpu_has_k6_mtrr		0
-
-#undef  cpu_has_cyrix_arr
-#define cpu_has_cyrix_arr	0
-
-#undef  cpu_has_centaur_mcr
-#define cpu_has_centaur_mcr	0
-
 #endif /* CONFIG_X86_64 */
 
 #if __GNUC__ >= 4
diff -puN arch/x86/include/asm/disabled-features.h~x86-disabled_features-addmore arch/x86/include/asm/disabled-features.h
--- a/arch/x86/include/asm/disabled-features.h~x86-disabled_features-addmore	2014-06-20 09:16:08.422317600 -0700
+++ b/arch/x86/include/asm/disabled-features.h	2014-06-20 09:16:08.426317782 -0700
@@ -16,13 +16,25 @@
 # define HAVE_MPX	0
 #endif
 
+#ifdef CONFIG_X86_64
+# define HAVE_VME		(1<<(X86_FEATURE_VME & 31))
+# define HAVE_K6_MTRR		(1<<(X86_FEATURE_K6_MTRR & 31))
+# define HAVE_CYRIX_ARR		(1<<(X86_FEATURE_CYRIX_ARR & 31))
+# define HAVE_CENTAUR_MCR	(1<<(X86_FEATURE_CENTAUR_MCR & 31))
+#else
+# define HAVE_VME		0
+# define HAVE_K6_MTRR		0
+# define HAVE_CYRIX_ARR		0
+# define HAVE_CENTAUR_MCR	0
+#endif /* CONFIG_X86_64 */
+
 /*
  * Make sure to add features to the correct mask
  */
-#define DISABLED_MASK0	0
+#define DISABLED_MASK0	(HAVE_VME|HAVE_K6_MTRR)
 #define DISABLED_MASK1	0
 #define DISABLED_MASK2	0
-#define DISABLED_MASK3	0
+#define DISABLED_MASK3	(HAVE_CYRIX_ARR|HAVE_CENTAUR_MCR)
 #define DISABLED_MASK4	0
 #define DISABLED_MASK5	0
 #define DISABLED_MASK6	0
_

  reply	other threads:[~2014-06-20 16:17 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-20 16:17 [RFC][PATCH 1/3] x86: introduce disabled-features Dave Hansen
2014-06-20 16:17 ` Dave Hansen [this message]
2014-06-20 16:17 ` [RFC][PATCH 3/3] x86: make MP a required-feature on 64-bit Dave Hansen
2014-06-20 16:23   ` H. Peter Anvin
2014-06-20 16:30     ` Dave Hansen
2014-06-20 16:37       ` H. Peter Anvin
2014-06-20 17:43         ` Borislav Petkov
2014-06-20 17:47           ` H. Peter Anvin
2014-06-20 18:05             ` Borislav Petkov
2014-06-20 18:16               ` Dave Jones
2014-06-20 18:48                 ` Borislav Petkov
2014-06-20 18:54               ` H. Peter Anvin
2014-06-20 20:00                 ` Borislav Petkov
2014-06-20 20:22                   ` H. Peter Anvin
2014-06-20 20:35                     ` Borislav Petkov
2014-06-20 17:50           ` H. Peter Anvin
2014-06-20 18:15             ` Borislav Petkov
2014-06-20 18:57               ` H. Peter Anvin
2014-06-20 20:37                 ` Borislav Petkov
2014-06-23  6:11         ` Andi Kleen
2014-06-20 16:20 ` [RFC][PATCH 1/3] x86: introduce disabled-features H. Peter Anvin
2014-06-20 17:20   ` Dave Hansen
2014-06-20 20:40 ` Dave Hansen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140620161738.3ADE37A7@viggo.jf.intel.com \
    --to=dave@sr71.net \
    --cc=bp@alien8.de \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome