Re: [PATCH v5] KVM: TDX: Add sub-ioctl KVM_TDX_TERMINATE_VM

From: Sean Christopherson
Date: Mon Jul 21 2025 - 19:36:48 EST


On Fri, 18 Jul 2025 11:15:41 -0700, Sean Christopherson wrote:
> Add sub-ioctl KVM_TDX_TERMINATE_VM to release the HKID prior to shutdown,
> which enables more efficient reclaim of private memory.
>
> Private memory is removed from MMU/TDP when guest_memfds are closed. If
> the HKID has not been released, the TDX VM is still in the RUNNABLE state,
> and so pages must be removed using "Dynamic Page Removal" procedure (refer
> to the TDX Module Base spec) which involves a number of steps:
> Block further address translation
> Exit each VCPU
> Clear Secure EPT entry
> Flush/write-back/invalidate relevant caches
>
> [...]

Applied to kvm-x86 vmx (again).

[1/1] KVM: TDX: Add sub-ioctl KVM_TDX_TERMINATE_VM
https://github.com/kvm-x86/linux/commit/dcab95e53364

--
https://github.com/kvm-x86/linux/tree/next