[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] x86 vmx: Add handlers for missing exit_reasons documented by Intel SDM 3B



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1284393945 -3600
# Node ID e300bfa3c0323ac08e7b8cd9fb40f9f1ab548543
# Parent  9c5f084135b8dfafc661b586b3230a7b0e94a538
x86 vmx: Add handlers for missing exit_reasons documented by Intel SDM 3B

Signed-off-by: Liu Yuan <yuan.b.liu@xxxxxxxxx>
Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 xen/arch/x86/hvm/vmx/vmx.c        |   20 ++++++++++++++++++++
 xen/include/asm-x86/hvm/vmx/vmx.h |    6 ++++++
 2 files changed, 26 insertions(+)

diff -r 9c5f084135b8 -r e300bfa3c032 xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c        Mon Sep 13 17:00:10 2010 +0100
+++ b/xen/arch/x86/hvm/vmx/vmx.c        Mon Sep 13 17:05:45 2010 +0100
@@ -2331,7 +2331,14 @@ asmlinkage void vmx_vmexit_handler(struc
         case EXIT_REASON_PENDING_VIRT_INTR:
         case EXIT_REASON_PENDING_VIRT_NMI:
         case EXIT_REASON_MCE_DURING_VMENTRY:
+        case EXIT_REASON_GETSEC:
+        case EXIT_REASON_ACCESS_GDTR_OR_IDTR:
+        case EXIT_REASON_ACCESS_LDTR_OR_TR:
+        case EXIT_REASON_VMX_PREEMPTION_TIMER_EXPIRED:
+        case EXIT_REASON_INVEPT:
+        case EXIT_REASON_INVVPID:
             break;
+
         default:
             v->arch.hvm_vmx.vmx_emulate = 1;
             perfc_incr(realmode_exits);
@@ -2582,6 +2589,15 @@ asmlinkage void vmx_vmexit_handler(struc
     case EXIT_REASON_VMWRITE:
     case EXIT_REASON_VMXOFF:
     case EXIT_REASON_VMXON:
+    case EXIT_REASON_GETSEC:
+    case EXIT_REASON_INVEPT:
+    case EXIT_REASON_INVVPID:
+        /*
+         * We should never exit on GETSEC because CR4.SMXE is always 0 when
+         * running in guest context, and the CPU checks that before getting
+         * as far as vmexit.
+         */
+        WARN_ON(exit_reason == EXIT_REASON_GETSEC);
         vmx_inject_hw_exception(TRAP_invalid_op, HVM_DELIVER_NO_ERROR_CODE);
         break;
 
@@ -2647,6 +2663,10 @@ asmlinkage void vmx_vmexit_handler(struc
         break;
     }
 
+    case EXIT_REASON_ACCESS_GDTR_OR_IDTR:
+    case EXIT_REASON_ACCESS_LDTR_OR_TR:
+    case EXIT_REASON_VMX_PREEMPTION_TIMER_EXPIRED:
+    /* fall through */
     default:
     exit_and_crash:
         gdprintk(XENLOG_ERR, "Bad vmexit (reason %x)\n", exit_reason);
diff -r 9c5f084135b8 -r e300bfa3c032 xen/include/asm-x86/hvm/vmx/vmx.h
--- a/xen/include/asm-x86/hvm/vmx/vmx.h Mon Sep 13 17:00:10 2010 +0100
+++ b/xen/include/asm-x86/hvm/vmx/vmx.h Mon Sep 13 17:05:45 2010 +0100
@@ -77,6 +77,7 @@ void vmx_update_debug_state(struct vcpu 
 #define EXIT_REASON_PENDING_VIRT_NMI    8
 #define EXIT_REASON_TASK_SWITCH         9
 #define EXIT_REASON_CPUID               10
+#define EXIT_REASON_GETSEC              11
 #define EXIT_REASON_HLT                 12
 #define EXIT_REASON_INVD                13
 #define EXIT_REASON_INVLPG              14
@@ -107,9 +108,14 @@ void vmx_update_debug_state(struct vcpu 
 #define EXIT_REASON_MCE_DURING_VMENTRY  41
 #define EXIT_REASON_TPR_BELOW_THRESHOLD 43
 #define EXIT_REASON_APIC_ACCESS         44
+#define EXIT_REASON_ACCESS_GDTR_OR_IDTR 46
+#define EXIT_REASON_ACCESS_LDTR_OR_TR   47
 #define EXIT_REASON_EPT_VIOLATION       48
 #define EXIT_REASON_EPT_MISCONFIG       49
+#define EXIT_REASON_INVEPT              50
 #define EXIT_REASON_RDTSCP              51
+#define EXIT_REASON_VMX_PREEMPTION_TIMER_EXPIRED 52
+#define EXIT_REASON_INVVPID             53
 #define EXIT_REASON_WBINVD              54
 #define EXIT_REASON_XSETBV              55
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.