[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d566cce2-2c78-4547-a2c0-75087e06f790@redhat.com>
Date: Tue, 10 Sep 2024 19:23:10 +0200
From: Paolo Bonzini <pbonzini@...hat.com>
To: Rick Edgecombe <rick.p.edgecombe@...el.com>, seanjc@...gle.com,
kvm@...r.kernel.org
Cc: kai.huang@...el.com, isaku.yamahata@...il.com,
tony.lindgren@...ux.intel.com, xiaoyao.li@...el.com,
linux-kernel@...r.kernel.org, Isaku Yamahata <isaku.yamahata@...el.com>
Subject: Re: [PATCH 15/25] KVM: TDX: Make pmu_intel.c ignore guest TD case
On 8/13/24 00:48, Rick Edgecombe wrote:
> From: Isaku Yamahata<isaku.yamahata@...el.com>
>
> Because TDX KVM doesn't support PMU yet (it's future work of TDX KVM
> support as another patch series) and pmu_intel.c touches vmx specific
> structure in vcpu initialization, as workaround add dummy structure to
> struct vcpu_tdx and pmu_intel.c can ignore TDX case.
>
> Signed-off-by: Isaku Yamahata<isaku.yamahata@...el.com>
> Signed-off-by: Rick Edgecombe<rick.p.edgecombe@...el.com>
Would be nicer not to have this dummy member at all if possible.
Could vcpu_to_lbr_desc() return NULL, and then lbr_desc can be checked
in intel_pmu_init() and intel_pmu_refresh()? Then the checks for
is_td_vcpu(vcpu), both inside WARN_ON_ONCE() and outside, can also be
changed to check NULL-ness of vcpu_to_lbr_desc().
Also please add a WARN_ON_ONCE(is_td_vcpu(vcpu)), or
WARN_ON_ONCE(!lbr_desc) given the above suggestion, to return early from
vmx_passthrough_lbr_msrs().
Thanks,
Paolo
Powered by blists - more mailing lists