From: tip-bot for Ross Zwisler <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@kernel.org,
ross.zwisler@linux.intel.com, tglx@linutronix.de,
hpa@linux.intel.com
Subject: [tip:x86/cpufeature] x86: Add support for the clflushopt instruction
Date: Thu, 27 Feb 2014 08:27:26 -0800 [thread overview]
Message-ID: <tip-171699f7630c92d0a928f83e5fb3aeabe35398c0@git.kernel.org> (raw)
In-Reply-To: <1393441612-19729-2-git-send-email-ross.zwisler@linux.intel.com>
Commit-ID: 171699f7630c92d0a928f83e5fb3aeabe35398c0
Gitweb: http://git.kernel.org/tip/171699f7630c92d0a928f83e5fb3aeabe35398c0
Author: Ross Zwisler <ross.zwisler@linux.intel.com>
AuthorDate: Wed, 26 Feb 2014 12:06:49 -0700
Committer: H. Peter Anvin <hpa@linux.intel.com>
CommitDate: Thu, 27 Feb 2014 08:23:28 -0800
x86: Add support for the clflushopt instruction
Add support for the new clflushopt instruction. This instruction was
announced in the document "Intel Architecture Instruction Set Extensions
Programming Reference" with Ref # 319433-018.
http://download-software.intel.com/sites/default/files/managed/50/1a/319433-018.pdf
[ hpa: changed the feature flag to simply X86_FEATURE_CLFLUSHOPT - if
that is what we want to report in /proc/cpuinfo anyway... ]
Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Link: http://lkml.kernel.org/r/1393441612-19729-2-git-send-email-ross.zwisler@linux.intel.com
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
---
arch/x86/include/asm/cpufeature.h | 1 +
arch/x86/include/asm/special_insns.h | 8 ++++++++
2 files changed, 9 insertions(+)
diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h
index 5f12968..bc507d7 100644
--- a/arch/x86/include/asm/cpufeature.h
+++ b/arch/x86/include/asm/cpufeature.h
@@ -221,6 +221,7 @@
#define X86_FEATURE_RDSEED (9*32+18) /* The RDSEED instruction */
#define X86_FEATURE_ADX (9*32+19) /* The ADCX and ADOX instructions */
#define X86_FEATURE_SMAP (9*32+20) /* Supervisor Mode Access Prevention */
+#define X86_FEATURE_CLFLUSHOPT (9*32+23) /* CLFLUSHOPT instruction */
#define X86_FEATURE_AVX512PF (9*32+26) /* AVX-512 Prefetch */
#define X86_FEATURE_AVX512ER (9*32+27) /* AVX-512 Exponential and Reciprocal */
#define X86_FEATURE_AVX512CD (9*32+28) /* AVX-512 Conflict Detection */
diff --git a/arch/x86/include/asm/special_insns.h b/arch/x86/include/asm/special_insns.h
index 645cad2..e820c08 100644
--- a/arch/x86/include/asm/special_insns.h
+++ b/arch/x86/include/asm/special_insns.h
@@ -191,6 +191,14 @@ static inline void clflush(volatile void *__p)
asm volatile("clflush %0" : "+m" (*(volatile char __force *)__p));
}
+static inline void clflushopt(volatile void *__p)
+{
+ alternative_io(".byte " __stringify(NOP_DS_PREFIX) "; clflush %P0",
+ ".byte 0x66; clflush %P0",
+ X86_FEATURE_CLFLUSHOPT,
+ "+m" (*(volatile char __force *)__p));
+}
+
#define nop() asm volatile ("nop")
next prev parent reply other threads:[~2014-02-27 16:27 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-26 19:06 [PATCH 0/4] x86: Add and use support for clflushopt Ross Zwisler
2014-02-26 19:06 ` [PATCH 1/4] x86: Add " Ross Zwisler
2014-02-27 16:27 ` tip-bot for Ross Zwisler [this message]
2014-02-26 19:06 ` [PATCH 2/4] x86: Use clflushopt in clflush_cache_range Ross Zwisler
2014-02-27 16:30 ` [tip:x86/cpu] " tip-bot for Ross Zwisler
2014-02-26 19:06 ` [PATCH 3/4] x86: Use clflushopt in drm_clflush_page Ross Zwisler
2014-02-27 16:30 ` [tip:x86/cpu] " tip-bot for Ross Zwisler
2014-02-26 19:06 ` [PATCH 4/4] x86: Use clflushopt in drm_clflush_virt_range Ross Zwisler
2014-02-27 16:30 ` [tip:x86/cpu] " tip-bot for Ross Zwisler
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=tip-171699f7630c92d0a928f83e5fb3aeabe35398c0@git.kernel.org \
--to=tipbot@zytor.com \
--cc=hpa@linux.intel.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=ross.zwisler@linux.intel.com \
--cc=tglx@linutronix.de \
/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