From: Tamas K Lengyel Date: Fri, 10 Jul 2015 10:39:02 +0000 (+0200) Subject: x86/monitor: don't use hvm_funcs directly X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~2841 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=2062f31bb32fedcbbb80175927c3f929e60aa095;p=xen.git 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 Acked-by: Razvan Cojocaru --- diff --git a/xen/arch/x86/monitor.c b/xen/arch/x86/monitor.c index 79c490aae6..d8fe98a74a 100644 --- a/xen/arch/x86/monitor.c +++ b/xen/arch/x86/monitor.c @@ -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 diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h index 5181f73d1c..bff47b40bb 100644 --- a/xen/include/asm-x86/hvm/hvm.h +++ b/xen/include/asm-x86/hvm/hvm.h @@ -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 &&