From: "Michael S. Tsirkin" <mst@redhat.com>
To: Eugenio Perez Martin <eperezma@redhat.com>
Cc: Alexander Graf <graf@amazon.com>,
Jason Wang <jasowangio@gmail.com>,
nh-open-source@amazon.com, Xuan Zhuo <xuanzhuo@linux.alibaba.com>,
Halil Pasic <pasic@linux.ibm.com>,
virtualization@lists.linux.dev, linux-kernel@vger.kernel.org,
Stefan Hajnoczi <stefanha@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [PATCH v2 04/12] virtio_ring: return -ENOMEM when a packed ring mapping fails
Date: Mon, 31 Aug 2026 02:21:26 -0400 [thread overview]
Message-ID: <20260831022012-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <CAJaqyWe1fKBwBXXxHqDV676Uw03Pvr0uLizPmHKqm+sqmY_LgA@mail.gmail.com>
On Mon, Aug 31, 2026 at 08:00:00AM +0200, Eugenio Perez Martin wrote:
> On Wed, Aug 26, 2026 at 2:47 PM Eugenio Perez Martin
> <eperezma@redhat.com> wrote:
> >
> > On Tue, Aug 18, 2026 at 11:15 PM Alexander Graf <graf@amazon.com> wrote:
> > >
> > > Commit f7728002c1c7 ("virtio_ring: fix return code on DMA mapping
> > > fails") moved virtqueue_add_split() and virtqueue_add_indirect_packed()
> > > to -ENOMEM, because virtio_queue_rq() maps -EIO to BLK_STS_IOERR and
> > > the request fails. We still return -EIO from virtqueue_add_packed(),
> > > and virtqueue_add_packed_in_order() copied that when it was added later.
> > >
> > > Guests that bounce their I/O through swiotlb (SEV-SNP, TDX, s390 secure
> > > execution) run the pool out with enough I/O in flight. On a split ring
> > > virtio_queue_rq() reports BLK_STS_RESOURCE and the block layer requeues
> > > the request. On a packed ring virtio_queue_rq() reports BLK_STS_IOERR
> > > instead and the error reaches the filesystem.
> > >
> > > Return -ENOMEM from the packed unmap_release paths too. Both are reached
> > > from a single goto on a failed mapping, which is where
> > > vring_map_one_sg() already produces -ENOMEM.
> > >
> > > That way every ring layout reports the same errno, and the block layer
> > > requeues the request instead of failing it.
> > >
> > > Fixes: f7728002c1c7 ("virtio_ring: fix return code on DMA mapping fails")
> > > Fixes: f6a15d854986 ("virtio_ring: add in order support")
> >
> > Acked-by: Eugenio Pérez <eperezma@redhat.com>
> >
>
> Even if I'd like to see this merged, I'm having second thoughts
> because it introduces userland visible changes in some drivers. Are
> them acceptable?
I mean, fixing the kernel for the userspace is kinda what we do, right?
--
MST
next prev parent reply other threads:[~2026-08-31 6:21 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-18 21:14 [PATCH v2 00/12] virtio: support devices that own their virtqueue memory Alexander Graf
2026-08-18 21:14 ` [PATCH v2 01/12] virtio_ring: remove the unused map sync API Alexander Graf
2026-08-26 8:31 ` Eugenio Perez Martin
2026-08-18 21:14 ` [PATCH v2 02/12] virtio: drop the sync operations from virtio_map_ops Alexander Graf
2026-08-26 9:05 ` Eugenio Perez Martin
2026-08-18 21:14 ` [PATCH v2 03/12] vdpa: drop the VIRTIO_DEVICE_F_MASK example value Alexander Graf
2026-08-26 9:11 ` Eugenio Perez Martin
2026-08-18 21:14 ` [PATCH v2 04/12] virtio_ring: return -ENOMEM when a packed ring mapping fails Alexander Graf
2026-08-26 12:47 ` Eugenio Perez Martin
2026-08-31 6:00 ` Eugenio Perez Martin
2026-08-31 6:21 ` Michael S. Tsirkin [this message]
2026-08-31 8:17 ` Eugenio Perez Martin
2026-08-31 8:22 ` Michael S. Tsirkin
2026-08-31 10:04 ` Eugenio Perez Martin
2026-08-31 10:33 ` Michael S. Tsirkin
2026-08-31 10:39 ` Eugenio Perez Martin
2026-08-18 21:14 ` [PATCH v2 05/12] virtio: add the VIRTIO_F_DMB feature bit Alexander Graf
2026-08-18 21:14 ` [PATCH v2 06/12] virtio_pci: read the device memory buffer registers Alexander Graf
2026-08-18 21:14 ` [PATCH v2 07/12] virtio_pci: create virtqueues with the device's mapping token Alexander Graf
2026-08-18 21:14 ` [PATCH v2 08/12] virtio: add a device memory buffer region allocator Alexander Graf
2026-08-18 21:14 ` [PATCH v2 09/12] virtio: locate the device memory buffer after feature negotiation Alexander Graf
2026-08-18 21:14 ` [PATCH v2 10/12] virtio: treat VIRTIO_F_DMB as implying VIRTIO_F_ACCESS_PLATFORM Alexander Graf
2026-08-18 21:14 ` [PATCH v2 11/12] virtio_pci: support VIRTIO_F_DMB Alexander Graf
2026-08-18 21:40 ` sashiko-bot
2026-08-18 21:14 ` [PATCH v2 12/12] virtio: expose device memory buffer occupancy over debugfs Alexander Graf
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=20260831022012-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=eperezma@redhat.com \
--cc=graf@amazon.com \
--cc=jasowangio@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=nh-open-source@amazon.com \
--cc=pasic@linux.ibm.com \
--cc=pbonzini@redhat.com \
--cc=stefanha@redhat.com \
--cc=virtualization@lists.linux.dev \
--cc=xuanzhuo@linux.alibaba.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.