public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Nicolas Saenz Julienne <nsaenz@amazon.com>
To: Sean Christopherson <seanjc@google.com>
Cc: Vitaly Kuznetsov <vkuznets@redhat.com>, <kvm@vger.kernel.org>,
	<pbonzini@redhat.com>, <tglx@linutronix.de>, <mingo@redhat.com>,
	<bp@alien8.de>, <dave.hansen@linux.intel.com>, <x86@kernel.org>,
	<hpa@zytor.com>, <graf@amazon.de>, <rkagan@amazon.de>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] KVM: x86: hyper-v: Don't auto-enable stimer during deserialization
Date: Mon, 16 Oct 2023 17:04:15 +0000	[thread overview]
Message-ID: <CWA0YYN7MFBQ.3VOJQRP2X7BY8@amazon.com> (raw)
In-Reply-To: <ZS1kcXuGqO3O7yAq@google.com>

Hi Sean,
On Mon Oct 16, 2023 at 4:27 PM UTC, Sean Christopherson wrote:
> I'd prefer the shortlog be more explicit about the write coming from userspace, e.g.
>
>   KVM: x86: hyper-v: Don't auto-enable stimer on write from userspace
>
> A non-zero number of KVM's "deserialization" ioctls are used to stuff state
> without a paired "serialization".  I doubt anyone is doing that with the Hyper-V
> ioctls, but keeping things consistent is helpful for readers.
>
> On Mon, Oct 16, 2023, Nicolas Saenz Julienne wrote:
> > Hi Vitaly,
> >
> > On Mon Oct 16, 2023 at 12:14 PM UTC, Vitaly Kuznetsov wrote:
> > > Nicolas Saenz Julienne <nsaenz@amazon.com> writes:
> > >
> > > > By not honoring the 'stimer->config.enable' state during stimer
> > > > deserialization we might introduce spurious timer interrupts. For
>
> Avoid pronouns please.
>
> > > > example through the following events:
> > > >  - The stimer is configured in auto-enable mode.
> > > >  - The stimer's count is set and the timer enabled.
> > > >  - The stimer expires, an interrupt is injected.
> > > >  - We live migrate the VM.
>
> Same here.  "We" is already ambiguous, because the first usage is largely about
> KVM, and the second usage here is much more about userspace and/or the actual
> user.
>
> > > >  - The stimer config and count are deserialized, auto-enable is ON, the
> > > >    stimer is re-enabled.
> > > >  - The stimer expires right away, and injects an unwarranted interrupt.
> > > >
> > > > So let's not change the stimer's enable state if the MSR write comes
> > > > from user-space.
>
> Don't hedge, firmly state what the patch does and why the change is necessary
> and correct.  If it turns out the change is wrong, then the follow-up patch can
> explain the situation.  But in the happy case where the change is correct, using
> language that isn't assertive can result in
>
> > > > Fixes: 1f4b34f825e8 ("kvm/x86: Hyper-V SynIC timers")
>
> Does this need a?
>
>   Cc: stable@vger.kernel


Your reply raced with my v2. I'll rework the commit message, and send a
third revision.

Nicolas

      reply	other threads:[~2023-10-16 17:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-16  9:52 [PATCH] KVM: x86: hyper-v: Don't auto-enable stimer during deserialization Nicolas Saenz Julienne
2023-10-16 12:14 ` Vitaly Kuznetsov
2023-10-16 12:42   ` Nicolas Saenz Julienne
2023-10-16 16:27     ` Sean Christopherson
2023-10-16 17:04       ` Nicolas Saenz Julienne [this message]

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=CWA0YYN7MFBQ.3VOJQRP2X7BY8@amazon.com \
    --to=nsaenz@amazon.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=graf@amazon.de \
    --cc=hpa@zytor.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=rkagan@amazon.de \
    --cc=seanjc@google.com \
    --cc=tglx@linutronix.de \
    --cc=vkuznets@redhat.com \
    --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