VMX: allow vmx_update_debug_state to be called when v!=current
authorGeorge Dunlap <george.dunlap@eu.citrix.com>
Wed, 13 Nov 2013 08:25:36 +0000 (09:25 +0100)
committerJan Beulich <jbeulich@suse.com>
Wed, 13 Nov 2013 08:25:36 +0000 (09:25 +0100)
Removing the assert allows the PVH code to call this during vmcs
construction in a later patch, making the code more robust by removing
duplicate code.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
Acked-by: Eddie Dong <eddie.dong@intel.com>
xen/arch/x86/hvm/vmx/vmx.c

index 8e418c5f1eee7a0f8a3e9e663afb03b508314074..8d451d449aa67baa4a8e7d7b262d272673136641 100644 (file)
@@ -1125,8 +1125,6 @@ void vmx_update_debug_state(struct vcpu *v)
 {
     unsigned long mask;
 
-    ASSERT(v == current);
-
     mask = 1u << TRAP_int3;
     if ( !cpu_has_monitor_trap_flag )
         mask |= 1u << TRAP_debug;
@@ -1135,7 +1133,10 @@ void vmx_update_debug_state(struct vcpu *v)
         v->arch.hvm_vmx.exception_bitmap |= mask;
     else
         v->arch.hvm_vmx.exception_bitmap &= ~mask;
+
+    vmx_vmcs_enter(v);
     vmx_update_exception_bitmap(v);
+    vmx_vmcs_exit(v);
 }
 
 static void vmx_update_guest_cr(struct vcpu *v, unsigned int cr)