[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen master] VMX: correct error handling in vmx_create_vmcs()



commit 448d28309f1a966bdc850aff1a637e0b79a03e43
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Wed Oct 12 17:57:56 2022 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Wed Oct 12 17:57:56 2022 +0200

    VMX: correct error handling in vmx_create_vmcs()
    
    With the addition of vmx_add_msr() calls to construct_vmcs() there are
    now cases where simply freeing the VMCS isn't enough: The MSR bitmap
    page as well as one of the MSR area ones (if it's the 2nd vmx_add_msr()
    which fails) may also need freeing. Switch to using vmx_destroy_vmcs()
    instead.
    
    Fixes: 3bd36952dab6 ("x86/spec-ctrl: Introduce an option to control 
L1D_FLUSH for HVM HAP guests")
    Fixes: 53a570b28569 ("x86/spec-ctrl: Support IBPB-on-entry")
    Reported-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Reviewed-by: Kevin Tian <kevin.tian@xxxxxxxxx>
    Release-acked-by: Henry Wang <Henry.Wang@xxxxxxx>
---
 xen/arch/x86/hvm/vmx/vmcs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index 4f12fa06ac..a1aca1ec04 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -1821,7 +1821,7 @@ int vmx_create_vmcs(struct vcpu *v)
 
     if ( (rc = construct_vmcs(v)) != 0 )
     {
-        vmx_free_vmcs(vmx->vmcs_pa);
+        vmx_destroy_vmcs(v);
         return rc;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.