VMX: correct error handling in vmx_create_vmcs()
authorJan Beulich <jbeulich@suse.com>
Wed, 12 Oct 2022 15:57:56 +0000 (17:57 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 12 Oct 2022 15:57:56 +0000 (17:57 +0200)
commit448d28309f1a966bdc850aff1a637e0b79a03e43
tree0095d95b0e99c45e02efef0cb7b85064864b3dc8
parent87a20c98d9f0f422727fe9b4b9e22c2c43a5cd9c
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@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Release-acked-by: Henry Wang <Henry.Wang@arm.com>
xen/arch/x86/hvm/vmx/vmcs.c