Re: [PATCH v3 03/12] KVM: x86: Encapsulate VMware backdoor checks
From: Jim Mattson
Date: Wed Nov 11 2026 - 19:20:25 EST
On Tue, Nov 10, 2026 at 10:08 PM Zack Rusin <zack.rusin@xxxxxxxxxxxx> wrote:
>
> Add kvm_is_vmware_backdoor_enabled(), kvm_is_vmware_io_port(),
> kvm_is_vmware_backdoor_pmc() and kvm_is_vmware_backdoor_opcode(), and
> use them instead of checking enable_vmware_backdoor and the VMware port
> and pseudo-PMC numbers directly. Make the module parameter and the
> pseudo-PMC numbers private to vmware.c, and take the backdoor port
> numbers from <asm/vmware.h> instead of keeping a second copy.
>
> The next patches make the backdoor a per-VM setting. With every caller
> asking whether a vCPU accepts a VMware interface, instead of reading a
> global, that change stays inside vmware.c.
>
> Check the enabled state inside the port and pseudo-PMC predicates, so
> that no caller can treat a port or PMC index as VMware's for a VM that
> hasn't enabled the backdoor.
>
> No functional change intended.
>
> Suggested-by: Sean Christopherson <seanjc@xxxxxxxxxx>
> Link: https://lore.kernel.org/r/aIEgVpjXDR0BXgHq@xxxxxxxxxx
> Signed-off-by: Zack Rusin <zack.rusin@xxxxxxxxxxxx>
Reviewed-by: Jim Mattson <jmattson@xxxxxxxxxx>