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.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Kevin Tian <kevin.tian@intel.com>
(cherry picked from commit
f30e3cf34042846e391e3f8361fc6a76d181a7ee)
unsigned long sysenter_eip;
u32 vmexit_ctl = vmx_vmexit_control;
u32 vmentry_ctl = vmx_vmentry_control;
+ int rc = 0;
vmx_vmcs_enter(v);
if ( msr_bitmap == NULL )
{
- vmx_vmcs_exit(v);
- return -ENOMEM;
+ rc = -ENOMEM;
+ goto out;
}
memset(msr_bitmap, ~0, PAGE_SIZE);
if ( cpu_has_vmx_mpx )
__vmwrite(GUEST_BNDCFGS, 0);
- vmx_vmcs_exit(v);
-
/* PVH: paging mode is updated by arch_set_info_guest(). */
if ( is_hvm_domain(d) )
{
vmx_vlapic_msr_changed(v);
}
- return 0;
+ out:
+ vmx_vmcs_exit(v);
+
+ return rc;
}
int vmx_read_guest_msr(u32 msr, u64 *val)