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

[Xen-changelog] [xen-unstable] Clean up convoluted hvm_inject_exception() logic.



# HG changeset patch
# User Keir Fraser <keir@xxxxxxx>
# Date 1334910815 -3600
# Node ID aae8c2372a56262267c37e9ba538091c1f8f753f
# Parent  d1b0a8a84ccf3a7eed25996adf2e67916b8081da
Clean up convoluted hvm_inject_exception() logic.

Signed-off-by: Keir Fraser <keir@xxxxxxx>
---


diff -r d1b0a8a84ccf -r aae8c2372a56 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c    Thu Apr 19 15:30:44 2012 +0100
+++ b/xen/arch/x86/hvm/hvm.c    Fri Apr 20 09:33:35 2012 +0100
@@ -1203,30 +1203,19 @@ void hvm_triple_fault(void)
 
 void hvm_inject_exception(unsigned int trapnr, int errcode, unsigned long cr2)
 {
-    struct vcpu *v = current;
-
-    if ( !nestedhvm_enabled(v->domain) ) {
-        hvm_funcs.inject_exception(trapnr, errcode, cr2);
-        return;
-    }
-
-    if ( nestedhvm_vmswitch_in_progress(v) ) {
-        hvm_funcs.inject_exception(trapnr, errcode, cr2);
-        return;
-    }
-
-    if ( !nestedhvm_vcpu_in_guestmode(v) ) {
-        hvm_funcs.inject_exception(trapnr, errcode, cr2);
-        return;
-    }
-
-    if ( nhvm_vmcx_guest_intercepts_trap(v, trapnr, errcode) )
+    struct vcpu *curr = current;
+
+    if ( nestedhvm_enabled(curr->domain) &&
+         !nestedhvm_vmswitch_in_progress(curr) &&
+         nestedhvm_vcpu_in_guestmode(curr) &&
+         nhvm_vmcx_guest_intercepts_trap(curr, trapnr, errcode) )
     {
         enum nestedhvm_vmexits nsret;
 
-        nsret = nhvm_vcpu_vmexit_trap(v, trapnr, errcode, cr2);
-
-        switch (nsret) {
+        nsret = nhvm_vcpu_vmexit_trap(curr, trapnr, errcode, cr2);
+
+        switch ( nsret )
+        {
         case NESTEDHVM_VMEXIT_DONE:
         case NESTEDHVM_VMEXIT_ERROR: /* L1 guest will crash L2 guest */
             return;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
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®.