Re: [PATCH v19 040/130] KVM: TDX: Make pmu_intel.c ignore guest TD case

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Mar 20, 2024 at 03:01:48PM +0800,
Chao Gao <chao.gao@xxxxxxxxx> wrote:

> On Mon, Feb 26, 2024 at 12:25:42AM -0800, isaku.yamahata@xxxxxxxxx wrote:
> >From: Isaku Yamahata <isaku.yamahata@xxxxxxxxx>
> >
> >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.
> 
> Can we instead factor pmu_intel.c to avoid corrupting memory? how hard would it
> be?

Do you mean sprinkling "if (tdx) return"? It's easy. Just add it to all hooks
in kvm_pmu_ops.

I chose this approach because we'll soon support vPMU support. For simplicity,
will switch to sprinkle "if (tdx) return".

> >+bool intel_pmu_lbr_is_enabled(struct kvm_vcpu *vcpu)
> >+{
> >+	struct x86_pmu_lbr *lbr = vcpu_to_lbr_records(vcpu);
> >+
> >+	if (is_td_vcpu(vcpu))
> >+		return false;
> >+
> >+	return lbr->nr && (vcpu_get_perf_capabilities(vcpu) & PMU_CAP_LBR_FMT);
> 
> The check about vcpu's perf capabilities is new. is it necessary?

No. Will delete it. It crept in during rebase.
-- 
Isaku Yamahata <isaku.yamahata@xxxxxxxxx>




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux