public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Bill Wendling <morbo@google.com>
Cc: Jim Mattson <jmattson@google.com>,
	kvm@vger.kernel.org, Paolo Bonzini <pbonzini@redhat.com>,
	Bill Wendling <isanbard@gmail.com>
Subject: Re: [PATCH] x86/pmu: Disable inlining of measure()
Date: Tue, 25 Oct 2022 23:12:36 +0000	[thread overview]
Message-ID: <Y1htZKmRt/+WXhIo@google.com> (raw)
In-Reply-To: <CAGG=3QX218AyDM6LS8oe2-PH=eq=hBf5JrGedzb48DavE-5PPA@mail.gmail.com>

On Tue, Oct 25, 2022, Bill Wendling wrote:
> On Wed, Jun 1, 2022 at 10:22 AM Jim Mattson <jmattson@google.com> wrote:
> >
> > On Wed, Jun 1, 2022 at 9:30 AM Bill Wendling <morbo@google.com> wrote:
> > >
> > > From: Bill Wendling <isanbard@gmail.com>
> > >
> > > Clang can be more aggressive at inlining than GCC and will fully inline
> > > calls to measure(). This can mess with the counter overflow check. To
> > > set up the PMC overflow, check_counter_overflow() first records the
> > > number of instructions retired in an invocation of measure() and checks
> > > to see that subsequent calls to measure() retire the same number of
> > > instructions. If inlining occurs, those numbers can be different and the
> > > overflow test fails.
> > >
> > >   FAIL: overflow: cntr-0
> > >   PASS: overflow: status-0
> > >   PASS: overflow: status clear-0
> > >   PASS: overflow: irq-0
> > >   FAIL: overflow: cntr-1
> > >   PASS: overflow: status-1
> > >   PASS: overflow: status clear-1
> > >   PASS: overflow: irq-1
> > >   FAIL: overflow: cntr-2
> > >   PASS: overflow: status-2
> > >   PASS: overflow: status clear-2
> > >   PASS: overflow: irq-2
> > >   FAIL: overflow: cntr-3
> > >   PASS: overflow: status-3
> > >   PASS: overflow: status clear-3
> > >   PASS: overflow: irq-3
> > >
> > > Disabling inlining of measure() keeps the assumption that all calls to
> > > measure() retire the same number of instructions.
> > >
> > > Cc: Jim Mattson <jmattson@google.com>
> > > Signed-off-by: Bill Wendling <morbo@google.com>
> > Reviewed-by: Jim Mattson <jmattson@google.com>
> 
> Bumping for visibility.

Heh, make sure kvm-unit-tests is in the subject, i.e. [kvm-unit-tests PATCH].
This slipped by on my end because I didn't realize at a quick glance that it was
touching KVM-unit-tests and not kernel code.

  reply	other threads:[~2022-10-25 23:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-01 16:30 [PATCH] x86/pmu: Disable inlining of measure() Bill Wendling
2022-06-01 17:22 ` Jim Mattson
2022-10-25 19:22   ` Bill Wendling
2022-10-25 23:12     ` Sean Christopherson [this message]
2022-10-26 18:02       ` [kvm-unit-tests PATCH] " Bill Wendling
2022-11-01 18:53         ` Sean Christopherson
2022-11-01 19:16           ` Bill Wendling
2022-11-02 17:36 ` [PATCH] " Paolo Bonzini

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=Y1htZKmRt/+WXhIo@google.com \
    --to=seanjc@google.com \
    --cc=isanbard@gmail.com \
    --cc=jmattson@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=morbo@google.com \
    --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