From: Sean Christopherson <seanjc@google.com>
To: Ilias Stamatis <ilstam@amazon.co.uk>
Cc: "pbonzini@redhat.com" <pbonzini@redhat.com>,
"maz@kernel.org" <maz@kernel.org>,
"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
"anup@brainfault.org" <anup@brainfault.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"oliver.upton@linux.dev" <oliver.upton@linux.dev>,
"paul@xen.org" <paul@xen.org>
Subject: Re: [PATCH 1/2] KVM: selftests: Add a test for coalesced MMIO (and PIO on x86)
Date: Tue, 27 Aug 2024 07:58:36 -0700 [thread overview]
Message-ID: <Zs3pnCj6wUWD2K-8@google.com> (raw)
In-Reply-To: <31611f4136230893bbcffc98619bfb93c5a42ef1.camel@amazon.co.uk>
On Tue, Aug 27, 2024, Ilias Stamatis wrote:
> On Fri, 2024-08-23 at 12:13 -0700, Sean Christopherson wrote:
> > Add a test to verify that KVM correctly exits (or not) when a vCPU's
> > coalesced I/O ring is full (or isn't). Iterate over all legal starting
> > points in the ring (with an empty ring), and verify that KVM doesn't exit
> > until the ring is full.
> >
> > Opportunistically verify that KVM exits immediately on non-coalesced I/O,
> > either because the MMIO/PIO region was never registered, or because a
> > previous region was unregistered.
> >
> > This is a regression test for a KVM bug where KVM would prematurely exit
> > due to bad math resulting in a false positive if the first entry in the
> > ring was before the halfway mark. See commit 92f6d4130497 ("KVM: Fix
> > coalesced_mmio_has_room() to avoid premature userspace exit").
> >
> > Enable the test for x86, arm64, and risc-v, i.e. all architectures except
> > s390, which doesn't have MMIO.
> >
> > On x86, which has both MMIO and PIO, interleave MMIO and PIO into the same
> > ring, as KVM shouldn't exit until a non-coalesced I/O is encountered,
> > regardless of whether the ring is filled with MMIO, PIO, or both.
>
> I guess there is some overlap between this patch and the one I proposed
> here:
> https://lore.kernel.org/kvm/20240820133333.1724191-7-ilstam@amazon.com/
/facepalm
> Even though my test depends on the new ioctls that the series
> introduces. However, both the existing v1 API and the new proposed v2
> API take the same code path internally when trying to push to the ring
> buffer.
Sorry, I completely spaced on the fact that you had already written a selftest.
I'll take a closer look at your selftest and see how best to smush the two
together.
next prev parent reply other threads:[~2024-08-27 14:58 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-23 19:13 [PATCH 0/2] KVM: Coalesced IO cleanup and test Sean Christopherson
2024-08-23 19:13 ` [PATCH 1/2] KVM: selftests: Add a test for coalesced MMIO (and PIO on x86) Sean Christopherson
2024-08-27 11:15 ` Stamatis, Ilias
2024-08-27 14:58 ` Sean Christopherson [this message]
2024-08-23 19:13 ` [PATCH 2/2] KVM: Clean up coalesced MMIO ring full check Sean Christopherson
2024-08-27 9:56 ` Stamatis, Ilias
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=Zs3pnCj6wUWD2K-8@google.com \
--to=seanjc@google.com \
--cc=anup@brainfault.org \
--cc=ilstam@amazon.co.uk \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maz@kernel.org \
--cc=oliver.upton@linux.dev \
--cc=paul@xen.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.