On Mon, May 28, 2018 at 03:27:57PM +0100, Andrew Cooper wrote: > paging_update_paging_modes() and vmx_vlapic_msr_changed() both operate on the > VMCS being constructed. Avoid dropping and re-acquiring the reference > multiple times. > > Signed-off-by: Andrew Cooper <andrew.coop...@citrix.com> > --- > CC: Jan Beulich <jbeul...@suse.com> > CC: Jun Nakajima <jun.nakaj...@intel.com> > CC: Kevin Tian <kevin.t...@intel.com> > CC: Wei Liu <wei.l...@citrix.com> > CC: Roger Pau Monné <roger....@citrix.com> > --- > xen/arch/x86/hvm/vmx/vmcs.c | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) > > diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c > index be02be1..ce78f19 100644 > --- a/xen/arch/x86/hvm/vmx/vmcs.c > +++ b/xen/arch/x86/hvm/vmx/vmcs.c > @@ -996,6 +996,7 @@ static int construct_vmcs(struct vcpu *v) > struct domain *d = v->domain; > u32 vmexit_ctl = vmx_vmexit_control; > u32 vmentry_ctl = vmx_vmentry_control; > + int rc; > > vmx_vmcs_enter(v); > > @@ -1083,8 +1084,8 @@ static int construct_vmcs(struct vcpu *v) > > if ( msr_bitmap == NULL ) > { > - vmx_vmcs_exit(v); > - return -ENOMEM; > + rc = -ENOMEM; > + goto out; > } > > memset(msr_bitmap, ~0, PAGE_SIZE); > @@ -1258,13 +1259,14 @@ static int construct_vmcs(struct vcpu *v) > if ( cpu_has_vmx_tsc_scaling ) > __vmwrite(TSC_MULTIPLIER, d->arch.hvm_domain.tsc_scaling_ratio); > > - vmx_vmcs_exit(v); > - > /* will update HOST & GUEST_CR3 as reqd */ > paging_update_paging_modes(v); > > vmx_vlapic_msr_changed(v); > > + out: > + vmx_vmcs_exit(v); > + > return 0;
Shouldn't you return rc here? Or else you lose the error value. Roger. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel