Re: [PATCH] KVM: TDX: Charge misc cgroup before allocating HKID

From: Sean Christopherson

Date: Fri Nov 13 2026 - 09:25:12 EST


On Fri, 21 Aug 2026 17:39:57 +0800, Binbin Wu wrote:
> Add a tdx_hkid_alloc() helper that charges the misc cgroup before
> allocating an HKID, and unwind the charge if HKID allocation fails.
>
> __tdx_td_init() currently allocates an HKID before charging the misc
> cgroup. If the charge fails, the error path calls tdx_hkid_free(), which
> uncharges a resource that was never successfully charged. This can make
> the misc-cgroup usage negative.
>
> [...]

Applied to kvm-x86 vmx, thanks!

[1/1] KVM: TDX: Charge misc cgroup before allocating HKID
https://github.com/kvm-x86/linux/commit/93f1e8445a2f

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