From: Babu Moger <babu.moger@amd.com>
To: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de,
hpa@zytor.com, x86@kernel.org
Cc: fenghua.yu@intel.com, jpoimboe@redhat.com, aaronlewis@google.com,
robert.hu@linux.intel.com, ak@linux.intel.com,
thellstrom@vmware.com, linux-kernel@vger.kernel.org
Subject: [PATCH] x86/cpufeatures: Add feature bit RDPRU on AMD
Date: Mon, 07 Oct 2019 15:48:39 -0500 [thread overview]
Message-ID: <20191007204839.5727.10803.stgit@localhost.localdomain> (raw)
AMD Zen 2 introduces new RDPRU instruction which is used to give access
to some processor registers that are typically only accessible when the
privilege level is zero.
ECX is used as the implicit register to specify which register to read.
RDPRU places the specified register’s value into EDX:EAX
For example, RDPRU instruction can be used to reading MPERF and APERF at
user level.
Adding this to cpu feature definition, so it is visible in /proc/cpuinfo.
Details are available in AMD64 Architecture Programmer’s Manual.
https://www.amd.com/system/files/TechDocs/24594.pdf
Signed-off-by: Babu Moger <babu.moger@amd.com>
---
arch/x86/include/asm/cpufeatures.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/x86/include/asm/cpufeatures.h b/arch/x86/include/asm/cpufeatures.h
index 0652d3e..5d2f1a7 100644
--- a/arch/x86/include/asm/cpufeatures.h
+++ b/arch/x86/include/asm/cpufeatures.h
@@ -292,6 +292,7 @@
#define X86_FEATURE_CLZERO (13*32+ 0) /* CLZERO instruction */
#define X86_FEATURE_IRPERF (13*32+ 1) /* Instructions Retired Count */
#define X86_FEATURE_XSAVEERPTR (13*32+ 2) /* Always save/restore FP error pointers */
+#define X86_FEATURE_RDPRU (13*32+ 4) /* read processor register at user level */
#define X86_FEATURE_WBNOINVD (13*32+ 9) /* WBNOINVD instruction */
#define X86_FEATURE_AMD_IBPB (13*32+12) /* "" Indirect Branch Prediction Barrier */
#define X86_FEATURE_AMD_IBRS (13*32+14) /* "" Indirect Branch Restricted Speculation */
next reply other threads:[~2019-10-07 20:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-07 20:48 Babu Moger [this message]
2019-10-08 7:35 ` [tip: x86/cpu] x86/cpufeatures: Add feature bit RDPRU on AMD tip-bot2 for Babu Moger
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=20191007204839.5727.10803.stgit@localhost.localdomain \
--to=babu.moger@amd.com \
--cc=aaronlewis@google.com \
--cc=ak@linux.intel.com \
--cc=bp@alien8.de \
--cc=fenghua.yu@intel.com \
--cc=hpa@zytor.com \
--cc=jpoimboe@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=robert.hu@linux.intel.com \
--cc=tglx@linutronix.de \
--cc=thellstrom@vmware.com \
--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