]> xenbits.xensource.com Git - xen.git/commitdiff
x86/monitor: don't use hvm_funcs directly
authorTamas K Lengyel <tlengyel@novetta.com>
Fri, 10 Jul 2015 10:39:02 +0000 (12:39 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 10 Jul 2015 10:39:02 +0000 (12:39 +0200)
A couple spots in x86/monitor used hvm_funcs directly. This patch adds an extra
wrapper for enable_msr_exit_interception and changes monitor.c to use only the
wrappers.

Signed-off-by: Tamas K Lengyel <tlengyel@novetta.com>
Acked-by: Razvan Cojocaru <rcojocaru@bitdefender.com>
xen/arch/x86/monitor.c
xen/include/asm-x86/hvm/hvm.h

index 79c490aae6c21cad70b7aeb99c9ba37cf34633d5..d8fe98a74a63677c2cdea86c5eb89cec41162be7 100644 (file)
@@ -128,7 +128,7 @@ int monitor_domctl(struct domain *d, struct xen_domctl_monitor_op *mop)
         if ( mop->u.mov_to_cr.index == VM_EVENT_X86_CR3 )
             /* Latches new CR3 mask through CR0 code */
             for_each_vcpu ( d, v )
-                hvm_funcs.update_guest_cr(v, 0);
+                hvm_update_guest_cr(v, 0);
 
         break;
     }
@@ -144,11 +144,8 @@ int monitor_domctl(struct domain *d, struct xen_domctl_monitor_op *mop)
         if ( mop->op == XEN_DOMCTL_MONITOR_OP_ENABLE &&
              mop->u.mov_to_msr.extended_capture )
         {
-            if ( hvm_funcs.enable_msr_exit_interception )
-            {
+            if ( hvm_enable_msr_exit_interception(d) )
                 ad->monitor.mov_to_msr_extended = 1;
-                hvm_funcs.enable_msr_exit_interception(d);
-            }
             else
                 return -EOPNOTSUPP;
         } else
index 5181f73d1c7313224f1f0d8b3f08dac6ee3f3480..bff47b40bba68e11525e6f1fa796c7505ec6e346 100644 (file)
@@ -510,6 +510,17 @@ static inline enum hvm_intblk nhvm_interrupt_blocked(struct vcpu *v)
     return hvm_funcs.nhvm_intr_blocked(v);
 }
 
+static inline bool_t hvm_enable_msr_exit_interception(struct domain *d)
+{
+    if ( hvm_funcs.enable_msr_exit_interception )
+    {
+        hvm_funcs.enable_msr_exit_interception(d);
+        return 1;
+    }
+
+    return 0;
+}
+
 static inline bool_t hvm_is_singlestep_supported(void)
 {
     return (hvm_funcs.is_singlestep_supported &&