Re: [RFC PATCH v3 40/58] KVM: x86/pmu: Grab x86 core PMU for passthrough PMU VM

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

 



On 11/21/2024 2:46 AM, Sean Christopherson wrote:
> On Thu, Aug 01, 2024, Mingwei Zhang wrote:
>> From: Xiong Zhang <xiong.y.zhang@xxxxxxxxxxxxxxx>
>>
>> When passthrough PMU is enabled by kvm and perf, KVM call
>> perf_get_mediated_pmu() to exclusive own x86 core PMU at VM creation, KVM
>> call perf_put_mediated_pmu() to return x86 core PMU to host perf at VM
>> destroy.
>>
>> When perf_get_mediated_pmu() fail, the host has system wide perf events
>> without exclude_guest = 1 which must be disabled to enable VM with
>> passthrough PMU.
> I still much prefer my idea of making the mediated PMU opt-in.  I haven't seen
> any argument against that approach.
>
> https://lore.kernel.org/all/ZiFGRFb45oZrmqnJ@xxxxxxxxxx

Yeah, I agree this look a more flexible method and it gives the VMM right
to control if the mediated vPMU should be enabled instead of static enabling.

The original issue is that this requires VMM to be involved and not all VMM
call the ioctl KVM_CAP_PMU_CAPABILITY, like qemu.

But I see there is already a patch
(https://lore.kernel.org/qemu-devel/20241104094119.4131-3-dongli.zhang@xxxxxxxxxx/)
which tries to add KVM_CAP_PMU_CAPABILITY support in Qemu although it's not
complete (only disable, but no enable)

Yeah, we would follow this suggestion and make the mediated vPMU opt-in. If
need, we would add corresponding changes for Qemu as well.






[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