KVM: TDX: Don't offline the last cpu of one package when there's TDX guest
Destroying TDX guest requires there's at least one cpu online for each package, because reclaiming the TDX KeyID of the guest (as part of the teardown process) requires to call some SEAMCALL (on any cpu) on all packages. Do not offline the last cpu of one package when there's any TDX guest running, otherwise KVM may not be able to teardown TDX guest resulting in leaking of TDX KeyID and other resources like TDX guest control structure pages. Implement the TDX version 'offline_cpu()' to prevent the cpu from going offline if it is the last cpu on the package. Co-developed-by:Kai Huang <kai.huang@intel.com> Signed-off-by:
Kai Huang <kai.huang@intel.com> Suggested-by:
Sean Christopherson <seanjc@google.com> Signed-off-by:
Isaku Yamahata <isaku.yamahata@intel.com> Signed-off-by:
Rick Edgecombe <rick.p.edgecombe@intel.com> Reviewed-by:
Binbin Wu <binbin.wu@linux.intel.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
Loading
Please sign in to comment