From: Sean Christopherson <seanjc@google.com>
To: Sean Christopherson <seanjc@google.com>,
Paolo Bonzini <pbonzini@redhat.com>
Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
Mingwei Zhang <mizhang@google.com>,
Roman Kagan <rkagan@amazon.de>, Jim Mattson <jmattson@google.com>,
Dapeng Mi <dapeng1.mi@linux.intel.com>,
Like Xu <like.xu.linux@gmail.com>
Subject: [PATCH 0/6] KVM: x86/pmu: Clean up emulated PMC event handling
Date: Mon, 23 Oct 2023 16:39:54 -0700 [thread overview]
Message-ID: <20231023234000.2499267-1-seanjc@google.com> (raw)
The ultimate goal of this series is to track emulated counter events using
a dedicated variable instead of trying to track the previous counter value.
Tracking the previous counter value is flawed as it takes a snapshot at
every emulated event, but only checks for overflow prior to VM-Enter, i.e.
KVM could miss an overflow if KVM ever supports emulating event types that
can occur multiple times in a single VM-Exit.
Patches 1-5 are (some loosely, some tightly) related fixes and cleanups to
simplify the emulated counter approach implementation. The fixes are
tagged for stable as usersepace could cause some weirdness around perf
events, but I doubt any real world VMM is actually affected.
Sean Christopherson (6):
KVM: x86/pmu: Move PMU reset logic to common x86 code
KVM: x86/pmu: Reset the PMU, i.e. stop counters, before refreshing
KVM: x86/pmu: Stop calling kvm_pmu_reset() at RESET (it's redundant)
KVM: x86/pmu: Remove manual clearing of fields in kvm_pmu_init()
KVM: x86/pmu: Update sample period in pmc_write_counter()
KVM: x86/pmu: Track emulated counter events instead of previous
counter
arch/x86/include/asm/kvm-x86-pmu-ops.h | 2 +-
arch/x86/include/asm/kvm_host.h | 17 +++-
arch/x86/kvm/pmu.c | 128 +++++++++++++++++++++----
arch/x86/kvm/pmu.h | 47 +--------
arch/x86/kvm/svm/pmu.c | 17 ----
arch/x86/kvm/vmx/pmu_intel.c | 22 -----
arch/x86/kvm/x86.c | 1 -
7 files changed, 127 insertions(+), 107 deletions(-)
base-commit: ec2f1daad460c6201338dae606466220ccaa96d5
--
2.42.0.758.gaed0368e0e-goog
next reply other threads:[~2023-10-23 23:40 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-23 23:39 Sean Christopherson [this message]
2023-10-23 23:39 ` [PATCH 1/6] KVM: x86/pmu: Move PMU reset logic to common x86 code Sean Christopherson
2023-10-23 23:39 ` [PATCH 2/6] KVM: x86/pmu: Reset the PMU, i.e. stop counters, before refreshing Sean Christopherson
2023-10-23 23:39 ` [PATCH 3/6] KVM: x86/pmu: Stop calling kvm_pmu_reset() at RESET (it's redundant) Sean Christopherson
2023-10-23 23:39 ` [PATCH 4/6] KVM: x86/pmu: Remove manual clearing of fields in kvm_pmu_init() Sean Christopherson
2023-10-23 23:39 ` [PATCH 5/6] KVM: x86/pmu: Update sample period in pmc_write_counter() Sean Christopherson
2023-10-23 23:40 ` [PATCH 6/6] KVM: x86/pmu: Track emulated counter events instead of previous counter Sean Christopherson
2023-10-27 20:55 ` Sean Christopherson
2023-11-01 9:37 ` [PATCH 0/6] KVM: x86/pmu: Clean up emulated PMC event handling Mi, Dapeng
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231023234000.2499267-1-seanjc@google.com \
--to=seanjc@google.com \
--cc=dapeng1.mi@linux.intel.com \
--cc=jmattson@google.com \
--cc=kvm@vger.kernel.org \
--cc=like.xu.linux@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mizhang@google.com \
--cc=pbonzini@redhat.com \
--cc=rkagan@amazon.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®