All of lore.kernel.org
 help / color / mirror / Atom feed
* [Patch] Disallow SMEP for PV guest
@ 2011-06-01 14:31 Yang, Wei Y
  2011-06-01 14:55 ` Konrad Rzeszutek Wilk
  2011-06-01 15:17 ` Jan Beulich
  0 siblings, 2 replies; 9+ messages in thread
From: Yang, Wei Y @ 2011-06-01 14:31 UTC (permalink / raw)
  To: xen-devel@lists.xensource.com

This patch disallows SMEP for PV guest.

 Signed-off-by: Yang, Wei <wei.y.yang@intel.com>
 Signed-off-by: Shan, Haitao <haitao.shan@intel.com>
 Signed-off-by: Li, Xin <xin.li@intel.com>

---
 xc_cpufeature.h |    3 +++
 xc_cpuid_x86.c  |    5 +++++
 2 files changed, 8 insertions(+)

diff -r 6f72160d2d55 tools/libxc/xc_cpufeature.h
--- a/tools/libxc/xc_cpufeature.h	Wed Jun 01 19:57:32 2011 +0800
+++ b/tools/libxc/xc_cpufeature.h	Wed Jun 01 22:21:33 2011 +0800
@@ -141,4 +141,7 @@
 #define X86_FEATURE_TBM         (6*32+21) /* trailing bit manipulations */
 #define X86_FEATURE_TOPOEXT     (6*32+22) /* topology extensions CPUID leafs */
 
+/* Intel-defined CPU features, CPUID level 0x00000007:0 (ebx), word 7 */
+#define X86_FEATURE_SMEP       (7*32+ 7) /* Supervisor Mode Execution Protection */
+
 #endif /* __LIBXC_CPUFEATURE_H */
diff -r 6f72160d2d55 tools/libxc/xc_cpuid_x86.c
--- a/tools/libxc/xc_cpuid_x86.c	Wed Jun 01 19:57:32 2011 +0800
+++ b/tools/libxc/xc_cpuid_x86.c	Wed Jun 01 22:21:33 2011 +0800
@@ -470,6 +470,11 @@
         xc_cpuid_config_xsave(xch, domid, xfeature_mask, input, regs);
         break;
 
+    case 7:
+        if ( input[1] == 0 )
+            clear_bit(X86_FEATURE_SMEP, regs[1]);
+        break;
+
     case 0x80000001:
         if ( !guest_64bit )
         {

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2011-06-01 20:41 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-01 14:31 [Patch] Disallow SMEP for PV guest Yang, Wei Y
2011-06-01 14:55 ` Konrad Rzeszutek Wilk
2011-06-01 15:17   ` Li, Xin
2011-06-01 15:36     ` Keir Fraser
2011-06-01 16:01       ` Li, Xin
2011-06-01 17:27         ` Konrad Rzeszutek Wilk
2011-06-01 20:41           ` Keir Fraser
2011-06-01 15:28   ` Keir Fraser
2011-06-01 15:17 ` Jan Beulich

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.