On 02/05/2019 00:52, Tamas K Lengyel wrote: > diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c > index 283eb7b34d..5154ecc2a8 100644 > --- a/xen/arch/x86/hvm/vmx/vmx.c > +++ b/xen/arch/x86/hvm/vmx/vmx.c > @@ -779,12 +779,17 @@ static void vmx_load_cpu_state(struct vcpu *v, struct > hvm_hw_cpu *data) > > static void vmx_save_vmcs_ctxt(struct vcpu *v, struct hvm_hw_cpu *ctxt) > { > + if ( v == current ) > + vmx_save_guest_msrs(v); > + > vmx_save_cpu_state(v, ctxt); > vmx_vmcs_save(v, ctxt); > } > > static int vmx_load_vmcs_ctxt(struct vcpu *v, struct hvm_hw_cpu *ctxt) > { > + ASSERT(v != current);
I'd leave a comment along the lines of /* Not currently safe to use in current context. */ Can be fixed up on commit. This version is much cleaner, architecturally speaking, so Reviewed-by: Andrew Cooper <andrew.coop...@citrix.com> I'll drop the previous version out of x86-next. ~Andrew _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel