Re: [Xen-devel] [PATCH v2 3/4] hvm/svm: Enable MSR events
On 02/08/2018 10:25 AM, Alexandru Isaila wrote: This commit enables MSR events for svm. Signed-off-by: Alexandru IsailaReviewed-by: Boris Ostrovsky ___ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel
Re: [Xen-devel] [PATCH v2 3/4] hvm/svm: Enable MSR events
(Resending too. Something was wrong with my client) On 02/10/2018 11:33 AM, Boris Ostrovsky wrote: On 02/08/2018 10:25 AM, Alexandru Isaila wrote: This commit enables MSR events for svm. Signed-off-by: Alexandru IsailaReviewed-by: Boris Ostrovsky ___ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel
Re: [Xen-devel] [PATCH v2 3/4] hvm/svm: Enable MSR events
On Thu, Feb 8, 2018 at 3:25 PM, Alexandru Isailawrote: > This commit enables MSR events for svm. I'd probably say 'implement' here as well. Also, you don't need to repeat the title in the commit message. If there's nothing more to put into the commit message than is said in the title, you can just include your SoB. (Contrariwise, if you feel like you need something in the commit message, it should be more than just repeating the title of the patch.) -George ___ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel
Re: [Xen-devel] [PATCH v2 3/4] hvm/svm: Enable MSR events
On Thu, Feb 8, 2018 at 8:25 AM, Alexandru Isailawrote: > This commit enables MSR events for svm. > > Signed-off-by: Alexandru Isaila Acked-by: Tamas K Lengyel > --- > xen/arch/x86/hvm/svm/svm.c| 9 + > xen/include/asm-x86/monitor.h | 4 ++-- > 2 files changed, 11 insertions(+), 2 deletions(-) > > diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c > index a14caab..1eadab4 100644 > --- a/xen/arch/x86/hvm/svm/svm.c > +++ b/xen/arch/x86/hvm/svm/svm.c > @@ -163,6 +163,14 @@ void svm_intercept_msr(struct vcpu *v, uint32_t msr, int > flags) > __clear_bit(msr * 2 + 1, msr_bit); > } > > +static void svm_enable_msr_interception(struct domain *d, uint32_t msr) > +{ > +struct vcpu *v; > + > +for_each_vcpu ( d, v ) > +svm_intercept_msr(v, msr, MSR_INTERCEPT_WRITE); > +} > + > static void svm_save_dr(struct vcpu *v) > { > struct vmcb_struct *vmcb = v->arch.hvm_svm.vmcb; > @@ -2460,6 +2468,7 @@ static struct hvm_function_table __initdata > svm_function_table = { > .fpu_dirty_intercept = svm_fpu_dirty_intercept, > .msr_read_intercept = svm_msr_read_intercept, > .msr_write_intercept = svm_msr_write_intercept, > +.enable_msr_interception = svm_enable_msr_interception, > .set_rdtsc_exiting= svm_set_rdtsc_exiting, > .set_descriptor_access_exiting = svm_set_descriptor_access_exiting, > .get_insn_bytes = svm_get_insn_bytes, > diff --git a/xen/include/asm-x86/monitor.h b/xen/include/asm-x86/monitor.h > index 68e62bd..138c463 100644 > --- a/xen/include/asm-x86/monitor.h > +++ b/xen/include/asm-x86/monitor.h > @@ -80,7 +80,6 @@ static inline uint32_t arch_monitor_get_capabilities(struct > domain *d) > if( cpu_has_vmx ) > { > capabilities = (1U << XEN_DOMCTL_MONITOR_EVENT_WRITE_CTRLREG) | > - (1U << XEN_DOMCTL_MONITOR_EVENT_MOV_TO_MSR) | > (1U << XEN_DOMCTL_MONITOR_EVENT_DEBUG_EXCEPTION) | > (1U << XEN_DOMCTL_MONITOR_EVENT_CPUID) | > (1U << XEN_DOMCTL_MONITOR_EVENT_INTERRUPT) | > @@ -92,7 +91,8 @@ static inline uint32_t arch_monitor_get_capabilities(struct > domain *d) > } > > capabilities |= ((1U << XEN_DOMCTL_MONITOR_EVENT_GUEST_REQUEST) | > -(1U << XEN_DOMCTL_MONITOR_EVENT_SOFTWARE_BREAKPOINT)); > +(1U << XEN_DOMCTL_MONITOR_EVENT_SOFTWARE_BREAKPOINT) | > +(1U << XEN_DOMCTL_MONITOR_EVENT_MOV_TO_MSR)); > > if ( hvm_funcs.set_descriptor_access_exiting ) > capabilities |= (1U << XEN_DOMCTL_MONITOR_EVENT_DESC_ACCESS); > -- > 2.7.4 ___ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel
[Xen-devel] [PATCH v2 3/4] hvm/svm: Enable MSR events
This commit enables MSR events for svm. Signed-off-by: Alexandru Isaila--- xen/arch/x86/hvm/svm/svm.c| 9 + xen/include/asm-x86/monitor.h | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c index a14caab..1eadab4 100644 --- a/xen/arch/x86/hvm/svm/svm.c +++ b/xen/arch/x86/hvm/svm/svm.c @@ -163,6 +163,14 @@ void svm_intercept_msr(struct vcpu *v, uint32_t msr, int flags) __clear_bit(msr * 2 + 1, msr_bit); } +static void svm_enable_msr_interception(struct domain *d, uint32_t msr) +{ +struct vcpu *v; + +for_each_vcpu ( d, v ) +svm_intercept_msr(v, msr, MSR_INTERCEPT_WRITE); +} + static void svm_save_dr(struct vcpu *v) { struct vmcb_struct *vmcb = v->arch.hvm_svm.vmcb; @@ -2460,6 +2468,7 @@ static struct hvm_function_table __initdata svm_function_table = { .fpu_dirty_intercept = svm_fpu_dirty_intercept, .msr_read_intercept = svm_msr_read_intercept, .msr_write_intercept = svm_msr_write_intercept, +.enable_msr_interception = svm_enable_msr_interception, .set_rdtsc_exiting= svm_set_rdtsc_exiting, .set_descriptor_access_exiting = svm_set_descriptor_access_exiting, .get_insn_bytes = svm_get_insn_bytes, diff --git a/xen/include/asm-x86/monitor.h b/xen/include/asm-x86/monitor.h index 68e62bd..138c463 100644 --- a/xen/include/asm-x86/monitor.h +++ b/xen/include/asm-x86/monitor.h @@ -80,7 +80,6 @@ static inline uint32_t arch_monitor_get_capabilities(struct domain *d) if( cpu_has_vmx ) { capabilities = (1U << XEN_DOMCTL_MONITOR_EVENT_WRITE_CTRLREG) | - (1U << XEN_DOMCTL_MONITOR_EVENT_MOV_TO_MSR) | (1U << XEN_DOMCTL_MONITOR_EVENT_DEBUG_EXCEPTION) | (1U << XEN_DOMCTL_MONITOR_EVENT_CPUID) | (1U << XEN_DOMCTL_MONITOR_EVENT_INTERRUPT) | @@ -92,7 +91,8 @@ static inline uint32_t arch_monitor_get_capabilities(struct domain *d) } capabilities |= ((1U << XEN_DOMCTL_MONITOR_EVENT_GUEST_REQUEST) | -(1U << XEN_DOMCTL_MONITOR_EVENT_SOFTWARE_BREAKPOINT)); +(1U << XEN_DOMCTL_MONITOR_EVENT_SOFTWARE_BREAKPOINT) | +(1U << XEN_DOMCTL_MONITOR_EVENT_MOV_TO_MSR)); if ( hvm_funcs.set_descriptor_access_exiting ) capabilities |= (1U << XEN_DOMCTL_MONITOR_EVENT_DESC_ACCESS); -- 2.7.4 ___ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel