From: Sean Christopherson <seanjc@google.com>
To: Like Xu <like.xu.linux@gmail.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Subject: Re: [PATCH v3 1/3] KVM: x86/pmu: Disable guest PEBS on hybird cpu due to heterogeneity
Date: Fri, 20 Jan 2023 00:47:27 +0000 [thread overview]
Message-ID: <Y8nknyxfKl4p/0GY@google.com> (raw)
In-Reply-To: <20221109082802.27543-2-likexu@tencent.com>
On Wed, Nov 09, 2022, Like Xu wrote:
> From: Like Xu <likexu@tencent.com>
>
> From vPMU enabling perspective, KVM does not have proper support for
> hybird x86 core. The reported perf_capabilities value (e.g. the format
> of pebs record) depends on the type of cpu the kvm-intel module is init.
> When a vcpu of one pebs format migrates to a vcpu of another pebs format,
> the incorrect parsing of pebs records by guest can make profiling data
> analysis extremely problematic.
>
> The safe way to fix this is to disable this part of the support until the
> guest recognizes that it is running on the hybird cpu, which is appropriate
> at the moment given that x86 hybrid architectures are not heavily touted
> in the data center market.
>
> Signed-off-by: Like Xu <likexu@tencent.com>
> ---
> arch/x86/kvm/vmx/capabilities.h | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/arch/x86/kvm/vmx/capabilities.h b/arch/x86/kvm/vmx/capabilities.h
> index cd2ac9536c99..ea0498684048 100644
> --- a/arch/x86/kvm/vmx/capabilities.h
> +++ b/arch/x86/kvm/vmx/capabilities.h
> @@ -392,7 +392,9 @@ static inline bool vmx_pt_mode_is_host_guest(void)
>
> static inline bool vmx_pebs_supported(void)
> {
> - return boot_cpu_has(X86_FEATURE_PEBS) && kvm_pmu_cap.pebs_ept;
> + return boot_cpu_has(X86_FEATURE_PEBS) &&
> + !boot_cpu_has(X86_FEATURE_HYBRID_CPU) &&
> + kvm_pmu_cap.pebs_ept;
I assume the patch I just posted[*] to disable the vPMU entirely is sufficient, or
do we need this as well in order to hide X86_FEATURE_DS and X86_FEATURE_DTES64?
[*] https://lore.kernel.org/all/20230120004051.2043777-1-seanjc@google.com
next prev parent reply other threads:[~2023-01-20 0:47 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-09 8:27 [PATCH v3 0/3] KVM: x86/pmu: Enable guest PEBS for SPR and later models Like Xu
2022-11-09 8:28 ` [PATCH v3 1/3] KVM: x86/pmu: Disable guest PEBS on hybird cpu due to heterogeneity Like Xu
2022-11-25 10:18 ` Kunkun Jiang
2022-11-25 10:59 ` Like Xu
2023-01-20 0:47 ` Sean Christopherson [this message]
2023-01-30 11:30 ` Like Xu
2023-01-30 17:40 ` Sean Christopherson
2023-01-31 8:53 ` Like Xu
2022-11-09 8:28 ` [PATCH v3 2/3] KVM: x86/pmu: Add PRIR++ and PDist support for SPR and later models Like Xu
2022-11-09 8:28 ` [PATCH v3 3/3] perf/x86/intel: Expose EPT-friendly PEBS for SPR and future models Like Xu
2022-11-14 12:46 ` Peter Zijlstra
2022-11-15 7:16 ` Like Xu
2023-02-02 1:32 ` [PATCH v3 0/3] KVM: x86/pmu: Enable guest PEBS for SPR and later models 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=Y8nknyxfKl4p/0GY@google.com \
--to=seanjc@google.com \
--cc=kvm@vger.kernel.org \
--cc=like.xu.linux@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
/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
Powered by JetHome