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: Dave Hansen <dave@sr71.net>,
	dave.hansen@linux.intel.com, x86@kernel.org, bp@suse.de,
	luto@kernel.org, kirill.shutemov@linux.intel.com
Subject: [PATCH] x86, pkeys: fix mismerge of protection keys CPUID bits
Date: Thu, 10 Mar 2016 14:12:13 -0800	[thread overview]
Message-ID: <20160310221213.06F9DB53@viggo.jf.intel.com> (raw)


From: Dave Hansen <dave.hansen@linux.intel.com>

Kirill Shutemov pointed this out to me.

The tip tree currently has commit:

	dfb4a70f2 [x86/cpufeature, x86/mm/pkeys: Add protection keys related CPUID definitions]

whioch added support for two new CPUID bits: X86_FEATURE_PKU and
X86_FEATURE_OSPKE.  But, those bits were mis-merged and put in
cpufeature.h instead of cpufeatures.h.

This didn't cause any breakage *except* it keeps the "ospke" and
"pku" bits from showing up in cpuinfo.

Now cpuinfo has the two new flags:

	flags	: ...  pku ospke

BTW, is it really wise to have cpufeature.h and cpufeatures.h?
It seems like they can only cause confusion and mahem with tab
completion.

Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Cc: x86@kernel.org
Cc: Borislav Petkov <bp@suse.de>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: kirill.shutemov@linux.intel.com
---

 b/arch/x86/include/asm/cpufeature.h  |    4 ----
 b/arch/x86/include/asm/cpufeatures.h |    4 ++++
 2 files changed, 4 insertions(+), 4 deletions(-)

diff -puN arch/x86/include/asm/cpufeature.h~fix-next-mismerge arch/x86/include/asm/cpufeature.h
--- a/arch/x86/include/asm/cpufeature.h~fix-next-mismerge	2016-03-10 13:54:07.697446555 -0800
+++ b/arch/x86/include/asm/cpufeature.h	2016-03-10 13:54:15.944822125 -0800
@@ -94,10 +94,6 @@ extern const char * const x86_bug_flags[
 	(__builtin_constant_p(bit) && REQUIRED_MASK_BIT_SET(bit) ? 1 : 	\
 	 x86_this_cpu_test_bit(bit, (unsigned long *)&cpu_info.x86_capability))
 
-/* Intel-defined CPU features, CPUID level 0x00000007:0 (ecx), word 16 */
-#define X86_FEATURE_PKU		(16*32+ 3) /* Protection Keys for Userspace */
-#define X86_FEATURE_OSPKE	(16*32+ 4) /* OS Protection Keys Enable */
-
 /*
  * This macro is for detection of features which need kernel
  * infrastructure to be used.  It may *not* directly test the CPU
diff -puN arch/x86/include/asm/cpufeatures.h~fix-next-mismerge arch/x86/include/asm/cpufeatures.h
--- a/arch/x86/include/asm/cpufeatures.h~fix-next-mismerge	2016-03-10 13:54:07.698446601 -0800
+++ b/arch/x86/include/asm/cpufeatures.h	2016-03-10 13:54:23.506166451 -0800
@@ -271,6 +271,10 @@
 #define X86_FEATURE_PFTHRESHOLD (15*32+12) /* pause filter threshold */
 #define X86_FEATURE_AVIC	(15*32+13) /* Virtual Interrupt Controller */
 
+/* Intel-defined CPU features, CPUID level 0x00000007:0 (ecx), word 16 */
+#define X86_FEATURE_PKU		(16*32+ 3) /* Protection Keys for Userspace */
+#define X86_FEATURE_OSPKE	(16*32+ 4) /* OS Protection Keys Enable */
+
 /*
  * BUG word(s)
  */
_

             reply	other threads:[~2016-03-10 22:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-10 22:12 Dave Hansen [this message]
2016-03-12 15:15 ` [tip:mm/pkeys] x86/mm/pkeys: Fix " tip-bot for 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=20160310221213.06F9DB53@viggo.jf.intel.com \
    --to=dave@sr71.net \
    --cc=bp@suse.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@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

all inboxes | Powered by JetHome®