From: Like Xu <like.xu.linux@gmail.com>
To: Anselm Busse <abusse@amazon.com>
Cc: dwmw@amazon.co.uk, hborghor@amazon.de, sironi@amazon.de,
Sean Christopherson <seanjc@google.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/2] KVM support for Intel PMU v5 fixed function PMC bitmap
Date: Tue, 16 May 2023 21:29:07 +0800 [thread overview]
Message-ID: <2d7f7f80-278d-9fcf-cfc4-c433e95d9842@gmail.com> (raw)
In-Reply-To: <20230427095333.35038-1-abusse@amazon.com>
On 27/4/2023 5:53 pm, Anselm Busse wrote:
> Starting with v5, the Intel PMU allows to indicate the available fixed
> function PMCs not only through CPUID.0AH.EDX[4:0] but also through a
> bit mask in CPUID.0AH.ECX. According to the SDM the OS can consider a
> fix function PMC i supported for:
>
> CPUID.0AH.ECX[i] || (CPUID.0AH.EDX[4:0] > i)
Yes, this feature is attractive for virtualization scenarios, and it gives
flexibility
to control which fixed counters are available or not in the virtual machine.
However, currently KVM/x86 also supports Intel PMU V2, so I would expect
that we will review the enablement code for v3 and v4 first.
Ref:
https://lore.kernel.org/kvm/CALMp9eQVnk8gkOpX5AHhaCr8-5Fe=qNuX8PUP1Gv2H5FSYmHSw@mail.gmail.com/
>
> This behavior is already supported by the Intel PMU driver. However, KVM
> support is missing. This patch series add the support by first
> refactoring the tracking of available fixed function PMCs in KVM from a
> number to a bitmap in the frist patch. The second patch populates the
> bitmap accoring to the rule given by the SDM mentioned above.
>
> Regards,
> Anselm
>
> Anselm Busse (2):
> KVM: vmx/pmu: Indicate available fixed function PMCs through a bitmap
> KVM: vmx/pmu: Add support for selected fixed vPMU enablement for PMU v5
>
> arch/x86/include/asm/kvm_host.h | 2 +-
> arch/x86/kvm/pmu.h | 6 ++---
> arch/x86/kvm/svm/pmu.c | 2 +-
> arch/x86/kvm/vmx/pmu_intel.c | 40 ++++++++++++++++++++-------------
> 4 files changed, 30 insertions(+), 20 deletions(-)
>
>
> base-commit: 0cfd8703e7da687924371e9bc77a025bdeba9637
next prev parent reply other threads:[~2023-05-16 13:29 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-27 9:53 [PATCH 0/2] KVM support for Intel PMU v5 fixed function PMC bitmap Anselm Busse
2023-04-27 9:53 ` [PATCH 1/2] KVM: vmx/pmu: Indicate available fixed function PMCs through a bitmap Anselm Busse
2023-05-25 22:35 ` Sean Christopherson
2023-04-27 9:53 ` [PATCH 2/2] KVM: vmx/pmu: Add support for selected fixed vPMU enablement for PMU v5 Anselm Busse
2023-05-16 13:29 ` Like Xu [this message]
2023-05-25 22:30 ` [PATCH 0/2] KVM support for Intel PMU v5 fixed function PMC bitmap Sean Christopherson
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=2d7f7f80-278d-9fcf-cfc4-c433e95d9842@gmail.com \
--to=like.xu.linux@gmail.com \
--cc=abusse@amazon.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=dwmw@amazon.co.uk \
--cc=hborghor@amazon.de \
--cc=hpa@zytor.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=pbonzini@redhat.com \
--cc=seanjc@google.com \
--cc=sironi@amazon.de \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.