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