From: Sean Christopherson <seanjc@google.com>
To: Oliver Upton <oliver.upton@linux.dev>
Cc: Mingwei Zhang <mizhang@google.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Vitaly Kuznetsov <vkuznets@redhat.com>,
Wanpeng Li <wanpengli@tencent.com>,
Jim Mattson <jmattson@google.com>, Joerg Roedel <joro@8bytes.org>,
kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/5] selftests: KVM/x86: Fix vcpu_{save,load}_state() by adding APIC state into kvm_x86_state
Date: Wed, 3 Aug 2022 19:21:43 +0000 [thread overview]
Message-ID: <YurKx+gFAWPvj35L@google.com> (raw)
In-Reply-To: <YurCI5PQu44UJ0a7@google.com>
KVM: selftests: for the shortlog.
On Wed, Aug 03, 2022, Oliver Upton wrote:
> Hi Mingwei,
>
> On Tue, Aug 02, 2022 at 11:07:15PM +0000, Mingwei Zhang wrote:
> > Fix vcpu_{save,load}_state() by adding APIC state into kvm_x86_state and
> > properly save/restore it in vcpu_{save,load}_state(). When vcpu resets,
> > APIC state become software disabled in kernel and thus the corresponding
> > vCPU is not able to receive posted interrupts [1]. So, add APIC
> > save/restore in userspace in selftest library code.
>
> Of course, there are no hard rules around it but IMO a changelog is
> easier to grok if it first describes the what/why of the problem, then
> afterwards how it is fixed by the commit.
I strongly disagree. :-) To some extent, it's a personal preference, e.g. I
find it easier to understand the details (why something is a problem) if I have
the extra context of how a problem is fixed (or: what code was broken).
But beyond personal preference, there are less subjective reasons for stating
what a patch does before diving into details. First and foremost, what code is
actually being changed is the most important information, and so that information
should be easy to find. Changelogs that bury the "what's actually changing" in a
one-liner after 3+ paragraphs of background make it very hard to find that information.
Maybe for initial review one could argue that "what's the bug" is more important,
but for skimming logs and git archeology, the gory details matter less and less.
E.g. when doing a series of "git blame", the details of each change along the way
are useless, the details only matter for the culprit; I just want to quickly
determine whether or not a commit might be of interest.
Another argument for stating "what's changing" first is that it's almost always
possible to state "what's changing" in a single sentence. Conversely, all but the
most simple bugs require multiple sentences or paragraphs to fully describe the
problem. If both the "what's changing" and "what's the bug" are super short then
the order doesn't matter. But if one is shorter (almost always the "what's changing),
then covering the shorter one first is advantageous because it's less of an
inconvenience for readers/reviewers that have a strict ordering preference. E.g.
having to skip one sentence to get to the stuff you care about is less painful than
me having to skip three paragraphs to get to the stuff that I care about.
I think the underlying problem with this changelog (and the shortlog) is that it's
too literal about what is being fixed. Shortlogs and changelogs shouldn't be
play-by-play descriptions of the code changes, they should be abstractions of the
problem and the fix. E.g.
KVM: selftests: Save/restore vAPIC state in "migration" tests
Save/restore vAPIC state as part of vCPU save/load so that it's preserved
across VM "migration". This will allow testing that posted interrupts
are properly handled across VM migration.
With that, the first sentence covers both the "what's changing" and provides a
high-level description of the "bug" it's fixing. And the second sentence covers
(a) "why do we want this patch", (b) "why wasn't this a problem before", and (c)
"what's the urgency of this patch".
next prev parent reply other threads:[~2022-08-03 19:21 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-02 23:07 [PATCH 0/5] Fix a race between posted interrupt delivery and migration in a nested VM Mingwei Zhang
2022-08-02 23:07 ` [PATCH 1/5] KVM: x86: Get vmcs12 pages before checking pending interrupts Mingwei Zhang
2022-08-03 10:08 ` Maxim Levitsky
2022-08-03 16:45 ` Mingwei Zhang
2022-08-03 17:00 ` Mingwei Zhang
2022-08-03 18:36 ` Oliver Upton
2022-08-03 17:18 ` Paolo Bonzini
2022-08-03 17:51 ` Mingwei Zhang
2022-08-03 19:34 ` Maxim Levitsky
2022-08-25 0:11 ` Sean Christopherson
2022-08-25 2:51 ` Jim Mattson
2022-08-25 14:40 ` Sean Christopherson
2022-08-25 17:16 ` Mingwei Zhang
2022-08-25 17:53 ` Sean Christopherson
2022-08-25 20:35 ` Mingwei Zhang
2022-08-25 20:37 ` Mingwei Zhang
2022-08-25 23:21 ` Jim Mattson
2022-08-02 23:07 ` [PATCH 2/5] selftests: KVM/x86: Fix vcpu_{save,load}_state() by adding APIC state into kvm_x86_state Mingwei Zhang
2022-08-03 18:44 ` Oliver Upton
2022-08-03 19:21 ` Sean Christopherson [this message]
2022-08-03 23:55 ` Oliver Upton
2022-08-02 23:07 ` [PATCH 3/5] selftests: KVM: Introduce vcpu_run_interruptable() Mingwei Zhang
2022-08-25 0:15 ` Sean Christopherson
2022-08-28 19:21 ` Mingwei Zhang
2022-08-02 23:07 ` [PATCH 4/5] selftests: KVM: Add support for posted interrupt handling in L2 Mingwei Zhang
2022-08-25 0:16 ` Sean Christopherson
2022-08-28 19:29 ` Mingwei Zhang
2022-08-02 23:07 ` [PATCH 5/5] selftests: KVM: Test if posted interrupt delivery race with migration Mingwei Zhang
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=YurKx+gFAWPvj35L@google.com \
--to=seanjc@google.com \
--cc=jmattson@google.com \
--cc=joro@8bytes.org \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mizhang@google.com \
--cc=oliver.upton@linux.dev \
--cc=pbonzini@redhat.com \
--cc=vkuznets@redhat.com \
--cc=wanpengli@tencent.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