Re: [PATCH v2 3/8] KVM: VMX: Disallowing using to_vmx() in common VT code
From: Huang, Kai
Date: Wed Aug 26 2026 - 22:32:56 EST
On Wed, 2026-08-26 at 10:12 -0700, Sean Christopherson wrote:
> Poison to_vmx() in main.c and posted_intr.c so that attempting to interpret
> the vCPU as a VMX vCPU will fail at compile time, as opposed to failing at
> runtime, or worse corrupting state without outright failing.
>
> Note, to_tdx() is buried in tdx.c, i.e. isn't broadly reachable, and so
> doesn't need the same treatment as to_vmx().
>
> Signed-off-by: Sean Christopherson <seanjc@xxxxxxxxxx>
>
Nit: as Binbin mentioned in v1:
"Disallowing" -> "Disallow" in short-log.