From: Roman Kagan <rkagan@amazon.de>
To: Sean Christopherson <seanjc@google.com>
Cc: Jim Mattson <jmattson@google.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Eric Hankland <ehankland@google.com>, <kvm@vger.kernel.org>,
Dave Hansen <dave.hansen@linux.intel.com>,
Like Xu <likexu@tencent.com>, <x86@kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
<linux-kernel@vger.kernel.org>, "H. Peter Anvin" <hpa@zytor.com>,
"Borislav Petkov" <bp@alien8.de>, Ingo Molnar <mingo@redhat.com>,
Mingwei Zhang <mizhang@google.com>
Subject: Re: [PATCH] KVM: x86: vPMU: truncate counter value to allowed width
Date: Mon, 3 Jul 2023 15:33:29 +0200 [thread overview]
Message-ID: <ZKLOKc1RbfLyQz7H@u40bc5e070a0153.ant.amazon.com> (raw)
In-Reply-To: <ZJ74gELkj4DgAk4S@google.com>
On Fri, Jun 30, 2023 at 08:45:04AM -0700, Sean Christopherson wrote:
> On Fri, Jun 30, 2023, Roman Kagan wrote:
> > On Fri, Jun 30, 2023 at 07:28:29AM -0700, Sean Christopherson wrote:
> > > On Fri, Jun 30, 2023, Roman Kagan wrote:
> > > > On Thu, Jun 29, 2023 at 05:11:06PM -0700, Sean Christopherson wrote:
> > > > > @@ -74,6 +74,14 @@ static inline u64 pmc_read_counter(struct kvm_pmc *pmc)
> > > > > return counter & pmc_bitmask(pmc);
> > > > > }
> > > > >
> > > > > +static inline void pmc_write_counter(struct kvm_pmc *pmc, u64 val)
> > > > > +{
> > > > > + if (pmc->perf_event && !pmc->is_paused)
> > > > > + perf_event_set_count(pmc->perf_event, val);
> > > > > +
> > > > > + pmc->counter = val;
> > > >
> > > > Doesn't this still have the original problem of storing wider value than
> > > > allowed?
> > >
> > > Yes, this was just to fix the counter offset weirdness. My plan is to apply your
> > > patch on top. Sorry for not making that clear.
> >
> > Ah, got it, thanks!
> >
> > Also I'm now chasing a problem that we occasionally see
> >
> > [3939579.462832] Uhhuh. NMI received for unknown reason 30 on CPU 43.
> > [3939579.462836] Do you have a strange power saving mode enabled?
> > [3939579.462836] Dazed and confused, but trying to continue
> >
> > in the guests when perf is used. These messages disappear when
> > 9cd803d496e7 ("KVM: x86: Update vPMCs when retiring instructions") is
> > reverted. I haven't yet figured out where exactly the culprit is.
>
> Can you reverting de0f619564f4 ("KVM: x86/pmu: Defer counter emulated overflow
> via pmc->prev_counter")? I suspect the problem is the prev_counter mess.
We observe the problem on a branch that predates this commit
Thanks,
Roman.
Amazon Development Center Germany GmbH
Krausenstr. 38
10117 Berlin
Geschaeftsfuehrung: Christian Schlaeger, Jonathan Weiss
Eingetragen am Amtsgericht Charlottenburg unter HRB 149173 B
Sitz: Berlin
Ust-ID: DE 289 237 879
next prev parent reply other threads:[~2023-07-03 13:34 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-04 12:00 Roman Kagan
2023-05-23 12:40 ` Like Xu
2023-05-23 16:42 ` Roman Kagan
2023-06-06 0:26 ` Sean Christopherson
2023-06-06 0:51 ` Sean Christopherson
2023-06-29 21:16 ` Jim Mattson
2023-06-30 0:11 ` Sean Christopherson
2023-06-30 0:31 ` Jim Mattson
2023-06-30 11:14 ` Roman Kagan
2023-06-30 14:28 ` Sean Christopherson
2023-06-30 15:21 ` Roman Kagan
2023-06-30 15:45 ` Sean Christopherson
2023-06-30 17:07 ` Mingwei Zhang
2023-06-30 17:16 ` Jim Mattson
2023-06-30 17:32 ` Mingwei Zhang
2023-06-30 18:03 ` Mingwei Zhang
2023-06-30 21:26 ` Sean Christopherson
2023-07-01 19:51 ` Mingwei Zhang
2023-08-11 8:30 ` Dapeng Mi
2023-08-22 9:29 ` Like Xu
2023-08-23 18:28 ` Mingwei Zhang
2023-07-03 13:33 ` Roman Kagan [this message]
2023-06-30 16:40 ` Jim Mattson
2023-06-30 23:25 ` Jim Mattson
2023-09-28 16:41 ` 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=ZKLOKc1RbfLyQz7H@u40bc5e070a0153.ant.amazon.com \
--to=rkagan@amazon.de \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=ehankland@google.com \
--cc=hpa@zytor.com \
--cc=jmattson@google.com \
--cc=kvm@vger.kernel.org \
--cc=likexu@tencent.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=mizhang@google.com \
--cc=pbonzini@redhat.com \
--cc=seanjc@google.com \
--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 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®