[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <158932793646.44260.2629848287332937779.stgit@naples-babu.amd.com>
Date: Tue, 12 May 2020 18:58:56 -0500
From: Babu Moger <babu.moger@....com>
To: corbet@....net, tglx@...utronix.de, mingo@...hat.com, bp@...en8.de,
hpa@...or.com, pbonzini@...hat.com, sean.j.christopherson@...el.com
Cc: x86@...nel.org, vkuznets@...hat.com, wanpengli@...cent.com,
jmattson@...gle.com, joro@...tes.org, dave.hansen@...ux.intel.com,
luto@...nel.org, peterz@...radead.org, mchehab+samsung@...nel.org,
babu.moger@....com, changbin.du@...el.com, namit@...are.com,
bigeasy@...utronix.de, yang.shi@...ux.alibaba.com,
asteinhauser@...gle.com, anshuman.khandual@....com,
jan.kiszka@...mens.com, akpm@...ux-foundation.org,
steven.price@....com, rppt@...ux.vnet.ibm.com, peterx@...hat.com,
dan.j.williams@...el.com, arjunroy@...gle.com, logang@...tatee.com,
thellstrom@...are.com, aarcange@...hat.com, justin.he@....com,
robin.murphy@....com, ira.weiny@...el.com, keescook@...omium.org,
jgross@...e.com, andrew.cooper3@...rix.com,
pawan.kumar.gupta@...ux.intel.com, fenghua.yu@...el.com,
vineela.tummalapalli@...el.com, yamada.masahiro@...ionext.com,
sam@...nborg.org, acme@...hat.com, linux-doc@...r.kernel.org,
linux-kernel@...r.kernel.org, kvm@...r.kernel.org
Subject: [PATCH v4 1/3] arch/x86: Update config and kernel doc for MPK
feature on AMD
AMD's next generation of EPYC processors support the MPK (Memory
Protection Keys) feature.
Add a generic X86_MEMORY_PROTECTION_KEYS config shadowing
X86_INTEL_MEMORY_PROTECTION_KEYS and update the kernel
documentation.
No functional changes.
Signed-off-by: Babu Moger <babu.moger@....com>
---
Documentation/core-api/protection-keys.rst | 3 ++-
arch/x86/Kconfig | 14 ++++++++++++--
2 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/Documentation/core-api/protection-keys.rst b/Documentation/core-api/protection-keys.rst
index 49d9833af871..d25e89e53c59 100644
--- a/Documentation/core-api/protection-keys.rst
+++ b/Documentation/core-api/protection-keys.rst
@@ -6,7 +6,8 @@ Memory Protection Keys
Memory Protection Keys for Userspace (PKU aka PKEYs) is a feature
which is found on Intel's Skylake "Scalable Processor" Server CPUs.
-It will be avalable in future non-server parts.
+It will be available in future non-server parts. Also, AMD64
+Architecture Programmer’s Manual defines PKU feature in AMD processors.
For anyone wishing to test or use this feature, it is available in
Amazon's EC2 C5 instances and is known to work there using an Ubuntu
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 1197b5596d5a..15bda3a60c1d 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -1887,10 +1887,10 @@ config X86_UMIP
results are dummy.
config X86_INTEL_MEMORY_PROTECTION_KEYS
- prompt "Intel Memory Protection Keys"
+ prompt "Memory Protection Keys"
def_bool y
# Note: only available in 64-bit mode
- depends on CPU_SUP_INTEL && X86_64
+ depends on X86_64 && (CPU_SUP_INTEL || CPU_SUP_AMD)
select ARCH_USES_HIGH_VMA_FLAGS
select ARCH_HAS_PKEYS
---help---
@@ -1902,6 +1902,16 @@ config X86_INTEL_MEMORY_PROTECTION_KEYS
If unsure, say y.
+config X86_MEMORY_PROTECTION_KEYS
+ # Both Intel and AMD platforms support "Memory Protection Keys"
+ # feature. So add a generic option X86_MEMORY_PROTECTION_KEYS
+ # and set the option whenever X86_INTEL_MEMORY_PROTECTION_KEYS
+ # is set. This is to avoid the confusion about the feature
+ # availability on AMD platforms. Also renaming the old option
+ # would cause the user an extra prompt during the kernel
+ # configuration. So avoided changing the old config name.
+ def_bool X86_INTEL_MEMORY_PROTECTION_KEYS
+
choice
prompt "TSX enable mode"
depends on CPU_SUP_INTEL
Powered by blists - more mailing lists