Re: [PATCH v3 05/12] KVM: x86: Add a unified VMware capability

From: Jim Mattson

Date: Wed Nov 11 2026 - 19:21:38 EST


On Tue, Nov 10, 2026 at 10:05 PM Zack Rusin <zack.rusin@xxxxxxxxxxxx> wrote:
>
> Add KVM_CAP_X86_VMWARE, a VM capability that takes a mask of VMware
> interfaces to enable, with KVM_VMWARE_ENABLE_BACKDOOR enabling the
> I/O-port and pseudo-PMC backdoor. KVM_CHECK_EXTENSION returns the
> supported flags. Track the flags per VM, and keep
> enable_vmware_backdoor as the initial value of the backdoor flag.
>
> The module parameter enables the backdoor for every VM on the host,
> whichever VMM created it. A per-VM flag lets VMMs enable it only where
> it is wanted, and the module parameter keeps existing VMMs working.
>
> Use one capability, so that the hypercall and nested-backdoor flags
> added next share its validation and rules. Accept flags only before
> the first vCPU is created, because vCPU setup configures #GP and RDPMC
> interception from them, and don't allow clearing them. Limit the flags
> to bits 0-30, as KVM_CHECK_EXTENSION returns an int.
>
> Enabling the backdoor for an SEV guest still doesn't bypass the guest's
> I/O permissions: KVM doesn't intercept #GP for SEV guests.
>
> Suggested-by: Paolo Bonzini <pbonzini@xxxxxxxxxx>
> Suggested-by: Sean Christopherson <seanjc@xxxxxxxxxx>
> Link: https://lore.kernel.org/r/c60b32a3-e699-4a8c-8d52-09b34c4d5269@xxxxxxxxxx
> Link: https://lore.kernel.org/r/aAjrOgsooR4RYIJr@xxxxxxxxxx
> Link: https://lore.kernel.org/r/aAkgV3ja9NbDsrju@xxxxxxxxxx
> Link: https://lore.kernel.org/r/aIEkrc7Mdf2ia1Mm@xxxxxxxxxx
> Signed-off-by: Zack Rusin <zack.rusin@xxxxxxxxxxxx>
Reviewed-by: Jim Mattson <jmattson@xxxxxxxxxx>