public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Aaron Lewis <aaronlewis@google.com>
Cc: kvm@vger.kernel.org, pbonzini@redhat.com, jmattson@google.com
Subject: Re: [PATCH] KVM: x86: Fix a stall when KVM_SET_MSRS is called on the pmu counters
Date: Fri, 28 Oct 2022 21:50:53 +0000	[thread overview]
Message-ID: <Y1xOvenzUxFIS0iz@google.com> (raw)
In-Reply-To: <CAAAPnDEda-FBz+3suqtA868Szwp-YCoLEmK1c=UynibTWCU1hw@mail.gmail.com>

On Fri, Oct 28, 2022, Aaron Lewis wrote:
> On Fri, Oct 28, 2022 at 4:26 PM Sean Christopherson <seanjc@google.com> wrote:
> >
> > On Fri, Oct 28, 2022, Aaron Lewis wrote:
> > @@ -3778,16 +3775,13 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
> >
> >     case MSR_K7_PERFCTR0 ... MSR_K7_PERFCTR3:
> >     case MSR_P6_PERFCTR0 ... MSR_P6_PERFCTR1:
> > -        pr = true;
> > -        fallthrough;
> >     case MSR_K7_EVNTSEL0 ... MSR_K7_EVNTSEL3:
> >     case MSR_P6_EVNTSEL0 ... MSR_P6_EVNTSEL1:
> >         if (kvm_pmu_is_valid_msr(vcpu, msr))
> >             return kvm_pmu_set_msr(vcpu, msr_info);
> >
> > -        if (pr || data != 0)
> > -            vcpu_unimpl(vcpu, "disabled perfctr wrmsr: "
> > -                  "0x%x data 0x%llx\n", msr, data);
> > +        if (data)
> > +            kvm_pr_unimpl_wrmsr(vcpu, msr, data);
> 
> Any reason to keep the check for 'data' around?  Now that it's
> checking for 'report_ignored_msrs' maybe we don't need that check as
> well.  I'm not sure what the harm is in removing it, and with this
> change we are additionally restricting pmu counter == 0 from printing.

Checking 'dat' doesn't restrict counter 0, it skips printing if the guest (or host)
is writing '0', e.g. it would also skip the case you encountered where the host is
blindly "restoring" unused MSRs.

Or did I misunderstand your comment?

  reply	other threads:[~2022-10-28 21:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-28 13:00 [PATCH] KVM: x86: Fix a stall when KVM_SET_MSRS is called on the pmu counters Aaron Lewis
2022-10-28 16:26 ` Sean Christopherson
2022-10-28 20:47   ` Aaron Lewis
2022-10-28 21:50     ` Sean Christopherson [this message]
2022-10-28 22:01       ` Jim Mattson
2022-10-28 22:43         ` Sean Christopherson
2022-11-02 17:55           ` Paolo Bonzini
2022-11-02 23:15             ` Aaron Lewis
2022-10-29  0:34       ` Aaron Lewis

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=Y1xOvenzUxFIS0iz@google.com \
    --to=seanjc@google.com \
    --cc=aaronlewis@google.com \
    --cc=jmattson@google.com \
    --cc=kvm@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