kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] kvm: x86: Fix PMU virtualization for some basic events
@ 2021-11-12 23:52 Jim Mattson
  2021-11-12 23:52 ` [PATCH 1/2] KVM: x86: Update vPMCs when retiring instructions Jim Mattson
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Jim Mattson @ 2021-11-12 23:52 UTC (permalink / raw)
  To: kvm, pbonzini; +Cc: Jim Mattson

Google Cloud has a customer that needs accurate virtualization of two
architected PMU events on Intel hardware: "instructions retired" and
"branch instructions retired." The existing PMU virtualization code
fails to account for instructions that are emulated by kvm.

Accurately virtualizing all PMU events for all microarchitectures is a
herculean task, but there are only 8 architected events, so maybe we
can at least try to get those right.

Eric Hankland wrote this code originally, but his plate is full, so
I've volunteered to shepherd the changes through upstream acceptance.

Jim Mattson (2):
  KVM: x86: Update vPMCs when retiring instructions
  KVM: x86: Update vPMCs when retiring branch instructions

 arch/x86/kvm/emulate.c     | 57 +++++++++++++++++++++-----------------
 arch/x86/kvm/kvm_emulate.h |  1 +
 arch/x86/kvm/pmu.c         | 31 +++++++++++++++++++++
 arch/x86/kvm/pmu.h         |  1 +
 arch/x86/kvm/vmx/nested.c  |  6 +++-
 arch/x86/kvm/x86.c         |  5 ++++
 6 files changed, 75 insertions(+), 26 deletions(-)

-- 
2.34.0.rc1.387.gb447b232ab-goog


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2021-11-18 11:28 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-12 23:52 [PATCH 0/2] kvm: x86: Fix PMU virtualization for some basic events Jim Mattson
2021-11-12 23:52 ` [PATCH 1/2] KVM: x86: Update vPMCs when retiring instructions Jim Mattson
2021-11-16 10:30   ` Paolo Bonzini
2021-11-16 12:43   ` Like Xu
2021-11-16 22:15     ` Jim Mattson
2021-11-17  3:21       ` Like Xu
2021-11-17 20:01         ` Jim Mattson
2021-11-18  3:37           ` Jim Mattson
2021-11-18 11:26             ` Like Xu
2021-11-18  9:13           ` Like Xu
2021-11-12 23:52 ` [PATCH 2/2] KVM: x86: Update vPMCs when retiring branch instructions Jim Mattson
2021-11-15  3:43 ` [PATCH 0/2] kvm: x86: Fix PMU virtualization for some basic events Like Xu
2021-11-15 17:51   ` Jim Mattson
2021-11-16  3:22     ` Like Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).