]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
KVM: TDX: Account all non-transient page allocations for per-TD structures
authorSean Christopherson <seanjc@google.com>
Thu, 29 Jan 2026 01:14:35 +0000 (17:14 -0800)
committerSean Christopherson <seanjc@google.com>
Wed, 13 May 2026 18:16:40 +0000 (11:16 -0700)
commita8b2924676ec42d76597f849baba31acc3ba1bfc
tree8dea44d2750f1ada6979f8a508974f4b5f9252de
parent02eaaffdd8656084f130e000a7c1a4ef27ac87a8
KVM: TDX: Account all non-transient page allocations for per-TD structures

Account all non-transient allocations associated with a single TD (or its
vCPUs), as KVM's ABI is that allocations that are active for the lifetime
of a VM are accounted.  Leave temporary allocations, i.e. allocations that
are freed within a single function/ioctl, unaccounted, to again align with
KVM's existing behavior, e.g. see commit dd103407ca31 ("KVM: X86: Remove
unnecessary GFP_KERNEL_ACCOUNT for temporary variables").

Fixes: 8d032b683c29 ("KVM: TDX: create/destroy VM structure")
Fixes: a50f673f25e0 ("KVM: TDX: Do TDX specific vcpu initialization")
Cc: stable@vger.kernel.org
Reviewed-by: Kai Huang <kai.huang@intel.com>
Reviewed-by: Rick Edgecombe <rick.p.edgecombe@intel.com>
Link: https://patch.msgid.link/20260129011517.3545883-4-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/vmx/tdx.c