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

[Xen-devel] [PATCH v4 3/3] x86/monitor: don't use hvm_funcs directly



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@xxxxxxxxxxx>
---
 xen/arch/x86/monitor.c        |  7 ++-----
 xen/include/asm-x86/hvm/hvm.h | 11 +++++++++++
 2 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/monitor.c b/xen/arch/x86/monitor.c
index 590a45d..44efcd0 100644
--- a/xen/arch/x86/monitor.c
+++ b/xen/arch/x86/monitor.c
@@ -130,7 +130,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;
     }
@@ -146,11 +146,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) == 0 )
                 ad->monitor.mov_to_msr_extended = 1;
-                hvm_funcs.enable_msr_exit_interception(d);
-            }
             else
                 return -EOPNOTSUPP;
         } else
diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h
index aa8ab8d..9128dff 100644
--- a/xen/include/asm-x86/hvm/hvm.h
+++ b/xen/include/asm-x86/hvm/hvm.h
@@ -514,6 +514,17 @@ static inline enum hvm_intblk 
nhvm_interrupt_blocked(struct vcpu *v)
     return hvm_funcs.nhvm_intr_blocked(v);
 }
 
+static inline int hvm_enable_msr_exit_interception(struct domain *d)
+{
+    if ( hvm_funcs.enable_msr_exit_interception )
+    {
+        hvm_funcs.enable_msr_exit_interception(d);
+        return 0;
+    }
+
+    return -ENOSYS;
+}
+
 static inline bool_t hvm_is_singlestep_supported(void)
 {
     return (hvm_funcs.is_singlestep_supported &&
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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