Skip to contentSkip to conversation

x86/tools: Expose SMAP to HVM guests

PATCH In review Feng Wu 2 participants 3 messages Apr 15, 2014 – Apr 16, 2014

lore
Share & tools
lore

Feng Wu

author
#0 lore raw

PATCH 6/6 x86/tools: Expose SMAP to HVM guests

This patch exposes SMAP festure to HVM guests

---
 tools/libxc/xc_cpufeature.h | 1 +
 tools/libxc/xc_cpuid_x86.c  | 1 +
 2 files changed, 2 insertions(+)
tools/libxc/xc_cpufeature.h +1 -0
index c464e3a..37c69f7 100644
@@ -137,5 +137,6 @@
 #define X86_FEATURE_ERMS         9 /* Enhanced REP MOVSB/STOSB */
 #define X86_FEATURE_INVPCID     10 /* Invalidate Process Context ID */
 #define X86_FEATURE_RTM         11 /* Restricted Transactional Memory */
+#define X86_FEATURE_SMAP        20 /* Supervisor Mode Access Protection */
 
 #endif /* __LIBXC_CPUFEATURE_H */
tools/libxc/xc_cpuid_x86.c +1 -0
index bbbf9b8..953945f 100644
@@ -367,6 +367,7 @@ static void xc_cpuid_hvm_policy(
                         bitmaskof(X86_FEATURE_HLE)  |
                         bitmaskof(X86_FEATURE_AVX2) |
                         bitmaskof(X86_FEATURE_SMEP) |
+                        bitmaskof(X86_FEATURE_SMAP) |
                         bitmaskof(X86_FEATURE_BMI2) |
                         bitmaskof(X86_FEATURE_ERMS) |
                         bitmaskof(X86_FEATURE_INVPCID) |
Signature · 1 line
1.8.3.1
Acked-by on v1 6/6
#1 lore raw

Please could you arrange for your series posting to be threaded, i.e. emails {1..6}/6 should be replies to 0/6. This is very helpful to reviewers etc since it keeps everything together. I thought this was the default mode of git send-email...

Quoted 3 lines · Feng Wu

This patch exposes SMAP festure to HVM guests

Assuming that the hypervisor guys agree that this makes sense the implementation here is trivially correct:

Quoted 28 lines
---
 tools/libxc/xc_cpufeature.h | 1 +
 tools/libxc/xc_cpuid_x86.c  | 1 +
 2 files changed, 2 insertions(+)
tools/libxc/xc_cpufeature.h +1 -0
index c464e3a..37c69f7 100644
@@ -137,5 +137,6 @@
 #define X86_FEATURE_ERMS         9 /* Enhanced REP MOVSB/STOSB */
 #define X86_FEATURE_INVPCID     10 /* Invalidate Process Context ID */
 #define X86_FEATURE_RTM         11 /* Restricted Transactional Memory */
+#define X86_FEATURE_SMAP        20 /* Supervisor Mode Access Protection */
 
 #endif /* __LIBXC_CPUFEATURE_H */
tools/libxc/xc_cpuid_x86.c +1 -0
index bbbf9b8..953945f 100644
@@ -367,6 +367,7 @@ static void xc_cpuid_hvm_policy(
                         bitmaskof(X86_FEATURE_HLE)  |
                         bitmaskof(X86_FEATURE_AVX2) |
                         bitmaskof(X86_FEATURE_SMEP) |
+                        bitmaskof(X86_FEATURE_SMAP) |
                         bitmaskof(X86_FEATURE_BMI2) |
                         bitmaskof(X86_FEATURE_ERMS) |
                         bitmaskof(X86_FEATURE_INVPCID) |
author
#2 lore raw
Quoted 9 lines

-----Original Message-----
From: Ian Campbell [mailto:[email protected]]
Sent: Tuesday, April 15, 2014 5:20 PM
To: Wu, Feng
Cc: [email protected]; [email protected]; Nakajima, Jun; Dong, Eddie
Subject: Re: [PATCH v1 6/6] x86/tools: Expose SMAP to HVM guests

Quoted 5 lines

Please could you arrange for your series posting to be threaded, i.e. emails {1..6}/6 should be replies to 0/6. This is very helpful to reviewers etc since it keeps everything together. I thought this was the default mode of git send-email...

Sorry for that, the series were threaded, but I made a mistake in series [0/6] and [3/6], so I sent these two again.

Quoted 28 lines · Feng Wu
Quoted 3 lines

This patch exposes SMAP festure to HVM guests

Assuming that the hypervisor guys agree that this makes sense the implementation here is trivially correct:

tools/libxc/xc_cpufeature.h line 137

Quoted 11 lines
---
 tools/libxc/xc_cpufeature.h | 1 +
 tools/libxc/xc_cpuid_x86.c  | 1 +
 2 files changed, 2 insertions(+)
tools/libxc/xc_cpufeature.h +0 -0
index c464e3a..37c69f7 100644
@@ -137,5 +137,6 @@
 #define X86_FEATURE_ERMS         9 /* Enhanced REP MOVSB/STOSB

*/

tools/libxc/xc_cpufeature.h line 138

Quoted 1 line
tools/libxc/xc_cpufeature.h +0 -0
 #define X86_FEATURE_INVPCID     10 /* Invalidate Process Context ID

*/

tools/libxc/xc_cpufeature.h line 139

Quoted 1 line
tools/libxc/xc_cpufeature.h +0 -0
 #define X86_FEATURE_RTM         11 /* Restricted Transactional

Memory */

tools/libxc/xc_cpufeature.h line 140

Quoted 1 line
tools/libxc/xc_cpufeature.h +1 -0
+#define X86_FEATURE_SMAP        20 /* Supervisor Mode Access

Protection */

Quoted 1 line
Quoted 14 lines

tools/libxc/xc_cpuid_x86.c static void xc_cpuid_hvm_policy( · line 373

Quoted 13 lines

#endif /* __LIBXC_CPUFEATURE_H */

tools/libxc/xc_cpuid_x86.c +1 -0
index bbbf9b8..953945f 100644
@@ -367,6 +367,7 @@ static void xc_cpuid_hvm_policy(
                         bitmaskof(X86_FEATURE_HLE)  |
                         bitmaskof(X86_FEATURE_AVX2) |
                         bitmaskof(X86_FEATURE_SMEP) |
+                        bitmaskof(X86_FEATURE_SMAP) |
                         bitmaskof(X86_FEATURE_BMI2) |
                         bitmaskof(X86_FEATURE_ERMS) |
                         bitmaskof(X86_FEATURE_INVPCID) |

Thanks,
Feng