[PATCH 0/3] KVM: VMX: Harden against interpreting TDX vCPU as vcpu_vmx
Sean Christopherson <[email protected]>
| Newsgroups | dev.linux.lists.linux-coco,org.kernel.vger.kvm,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
Move vmx_handle_exit_irqoff() and all its helpers to main.c, and then poison to_vmx() for the common .c files to harden KVM against misinterpreting a TDX vCPU as a VMX vCPU, i.e. consuming to_vmx() on a TDX vCPU. Spotted when working through the bus lock series. TDX changes are compile-tested only (one of these days I'll track down a host that's fully TDX-capable). Sean Christopherson (3): KVM: VMX: Move the shared "IRQs off" exit handler(s) to common code KVM: VMX: Disallowing using to_vmx() in common VT code KVM: VMX: Rename posted interrupt prefixes from "vmx" to "vt" arch/x86/kvm/vmx/common.h | 6 +++ arch/x86/kvm/vmx/main.c | 75 +++++++++++++++++++++++++++++++- arch/x86/kvm/vmx/posted_intr.c | 18 ++++---- arch/x86/kvm/vmx/posted_intr.h | 8 ++-- arch/x86/kvm/vmx/tdx.c | 4 +- arch/x86/kvm/vmx/vmx.c | 78 +--------------------------------- arch/x86/kvm/vmx/x86_ops.h | 1 - 7 files changed, 97 insertions(+), 93 deletions(-) base-commit: 1b731e5ded480bd1e5546aed35584238661ce72e -- 2.55.0.691.gc56d675ccc-goog