Re: [PATCH kvm-unit-tests] pmu: fix conditions for emulation test

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

 



On 17/11/2021 4:00 am, Jim Mattson wrote:
On Tue, Nov 16, 2021 at 10:03 AM Paolo Bonzini <pbonzini@xxxxxxxxxx> wrote:

On 11/16/21 18:49, Jim Mattson wrote:
Thanks for fixing this. By the way, one of the reasons that we don't
expose a virtual PMU to more customers is the conflict with the NMI
watchdog. We aren't willing to give up the NMI watchdog on the host,
and we don't really want to report a reduced number of general purpose

The NMI watchdog is definitely a good feature to me as well.

counters to the guest. (On AMD, we *can't* report a reduced number of
counters to the guest; the architectural specification doesn't allow
it.)

Yes, AMD has more architectural design troubles with the guest PMU,
which I am trying to resolve part of them (such as disabling vpmu or guest IBS stuff).


FWIW we also generally use the PMU emulation only for debugging of guest
performance issues.

More and more customers are interfacing with me since application developers
nowadays cannot access to the host environment for their performance issues.


We do have quite a few customers who want it, but I'm not sure that
they really know what it is they will be getting. :-)

My cloud-based customers ask me for almost everything about the host PMU capabilities.
For example, the Intel Guest PEBS has been a stable out-of-tree feature for a year.


We can't be the only ones running with the NMI watchdog enabled. How
do others deal with this? Is there any hope of suspending the NMI
watchdog while in VMX non-root mode (or guest mode on AMD)?

Like, what do you think?

Suspending the host NMI watchdog for guest code would be easy to implement,
but difficult to get upstream buy-in, especially for security researchers.

For Intel, the enabled NMI watchdog unconditionally seizes a counter
from vCPU usage, causing inaccuracy for guest pmu emulation.

For AMD, we have the dedicated "CPU Watchdog Timer Register",
which may help the issue, but I'm just getting into the AMD world.

I guess Google has a perf scheduler code diff for static allocation counters
and in that case the NMI watchdog occupies a specific counter all the time.

The current upstream status is that we allow guest pmu emulation to fail
temporarily since we expect the vPMU users will run profiling agent repeatedly.


Paolo

This also hid a typo for the force_emulation_prefix module parameter,
which is part of the kvm module rather than the kvm_intel module,
so fix that.

Reported-by: Like Xu <like.xu.linux@xxxxxxxxx>
Signed-off-by: Paolo Bonzini <pbonzini@xxxxxxxxxx>
Reviewed-by: Jim Mattson <jmattson@xxxxxxxxxx>





[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