mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: "Liang, Kan" <kan.liang@linux.intel.com>
Cc: acme@redhat.com, linux-kernel@vger.kernel.org,
	alexander.shishkin@linux.intel.com, ak@linux.intel.com,
	Jianfeng Gao <jianfeng.gao@intel.com>,
	Andrew Cooper <Andrew.Cooper3@citrix.com>
Subject: Re: [RESEND PATCH] perf/x86/intel: Fix unchecked MSR access error for Alder Lake N
Date: Mon, 22 Aug 2022 17:21:11 +0200	[thread overview]
Message-ID: <YwOe54h8SO11JAKw@worktop.programming.kicks-ass.net> (raw)
In-Reply-To: <afb376c7-7f91-2b1c-9bef-ff4d49f066ed@linux.intel.com>

On Mon, Aug 22, 2022 at 10:59:13AM -0400, Liang, Kan wrote:

> > +	if (boot_cpu_has(X86_FEATURE_HYPERVISOR)) {
> > +		pr_warn_once("hybrid PMU and virt are incompatible\n");
> > +		return false;
> > +	}
> 
> I would expect that KVM exposes the enhanced CPUID to the guest. The
> guest vCPU should knows its specific CPU type. The KVM should bind the
> vCPU to the same type of CPUs.
> 
> Before KVM provides such support, I guess it may be OK to have the
> warning. Maybe more specifically, only architecture events work.

Well, as is I randomly get #GPs when I boot a guest kernel.

The QEMU thing is passing in Core CPUID to all vCPUs (because per luck
it starts on a biggie), but if the vCPU lands on a small then the
PERF_GLOBAL_CTRL write will #GP because biggie has more bits set than
small knows how to deal with:

0001000f000000ff vs 000000070000003f, or something like that.

So I'm thinking we should entirely kill the thing by default and allow
KVM to set some magical bit when it knows the CPUID and affinity crud is
just right to have it maybe work. But that's for some virt person to
sort out...

  reply	other threads:[~2022-08-22 15:25 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-18 18:15 kan.liang
2022-08-19  8:05 ` Peter Zijlstra
2022-08-19  8:33   ` Peter Zijlstra
2022-08-22 13:24     ` Liang, Kan
2022-08-22 13:55       ` Peter Zijlstra
2022-08-22 15:20         ` Liang, Kan
2022-08-19 14:38 ` Peter Zijlstra
2022-08-22 13:28   ` Liang, Kan
2022-08-22 13:48     ` Peter Zijlstra
2022-08-22 14:31       ` Andi Kleen
2022-08-22 14:39     ` Peter Zijlstra
2022-08-22 14:51       ` Andrew Cooper
2022-08-22 14:59       ` Liang, Kan
2022-08-22 15:21         ` Peter Zijlstra [this message]
2022-08-22 15:08       ` Andi Kleen
2022-08-22 15:47         ` Peter Zijlstra
2022-08-22 18:21           ` Sean Christopherson
2022-08-22 19:21             ` Andi Kleen

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=YwOe54h8SO11JAKw@worktop.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=Andrew.Cooper3@citrix.com \
    --cc=acme@redhat.com \
    --cc=ak@linux.intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=jianfeng.gao@intel.com \
    --cc=kan.liang@linux.intel.com \
    --cc=linux-kernel@vger.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 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®