Re: [PATCH 2/2] KVM: TDX: Disable pmu virtualization for TDX VMs

From: Huang, Kai

Date: Wed May 06 2026 - 19:56:39 EST


On Wed, 2026-05-06 at 16:03 -0700, Sean Christopherson wrote:
> The question then becomes, do we keep patch 1 and also clear enable_pmu in tdx.c,
> or do we keep the ordering and have kvm_arch_init_vm() consume has_protected_pmu?
> Neither one is particularly awesome :-/

Maybe keeping patch 1 is slightly better? This allows the vm_init() to toggle
all the values and flags that the default ones don't fit. If we go with latter,
when there's similar cases where we need more flags, then kvm_arch_init_vm()
needs to consume more flags.

This is also consistent with how KVM sets the existing kvm-
>arch.shadow_mmio_value: KVM sets the default in kvm_arch_init_vm() ->
kvm_mmu_init_vm(), and then TDX changes it to other values in tdx_vm_init().