From: Sean Christopherson <seanjc@google.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Zhenzhong Duan <zhenzhong.duan@intel.com>,
qemu-devel@nongnu.org, mtosatti@redhat.com, likexu@tencent.com,
xiangfeix.ma@intel.com
Subject: Re: [PATCH] i386: Disable BTS and PEBS
Date: Mon, 18 Jul 2022 20:12:58 +0000 [thread overview]
Message-ID: <YtW+ymE654W662X4@google.com> (raw)
In-Reply-To: <a7bccbc5-fcb7-eaa8-ce95-fa7f380b8af9@redhat.com>
On Mon, Jul 18, 2022, Paolo Bonzini wrote:
> This needs to be fixed in the kernel because old QEMU/new KVM is supported.
I can't object to adding a quirk for this since KVM is breaking userspace, but on
the KVM side we really need to stop "sanitizing" userspace inputs unless it puts
the host at risk, because inevitably it leads to needing a quirk.
> But apart from that, where does Linux check MSR_IA32_MISC_ENABLE_BTS_UNAVAIL
> and MSR_IA32_MISC_ENABLE_PEBS_UNAVAIL?
The kernel uses synthetic feature flags that are set by:
static void init_intel(struct cpuinfo_x86 *c)
if (boot_cpu_has(X86_FEATURE_DS)) {
unsigned int l1, l2;
rdmsr(MSR_IA32_MISC_ENABLE, l1, l2);
if (!(l1 & (1<<11)))
set_cpu_cap(c, X86_FEATURE_BTS);
if (!(l1 & (1<<12)))
set_cpu_cap(c, X86_FEATURE_PEBS);
}
and consumed by:
void __init intel_ds_init(void)
/*
* No support for 32bit formats
*/
if (!boot_cpu_has(X86_FEATURE_DTES64))
return;
x86_pmu.bts = boot_cpu_has(X86_FEATURE_BTS);
x86_pmu.pebs = boot_cpu_has(X86_FEATURE_PEBS);
x86_pmu.pebs_buffer_size = PEBS_BUFFER_SIZE;
next prev parent reply other threads:[~2022-07-18 20:15 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-18 3:22 [PATCH] i386: Disable BTS and PEBS Zhenzhong Duan
2022-07-18 3:57 ` Like Xu
2022-07-18 7:44 ` Duan, Zhenzhong
2022-07-18 16:08 ` Paolo Bonzini
2022-07-18 20:12 ` Sean Christopherson [this message]
2022-07-19 18:18 ` Paolo Bonzini
2022-07-19 18:53 ` Sean Christopherson
2022-07-20 2:35 ` Duan, Zhenzhong
2022-07-20 15:48 ` Sean Christopherson
2022-07-21 2:42 ` Like Xu
2022-08-19 1:38 ` Duan, Zhenzhong
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=YtW+ymE654W662X4@google.com \
--to=seanjc@google.com \
--cc=likexu@tencent.com \
--cc=mtosatti@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=xiangfeix.ma@intel.com \
--cc=zhenzhong.duan@intel.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;
as well as URLs for NNTP newsgroup(s).