From: John Levon <john.levon@nutanix.com>
To: "Cédric Le Goater" <clg@redhat.com>
Cc: qemu-devel@nongnu.org, "Peter Xu" <peterx@redhat.com>,
qemu-s390x@nongnu.org, "Jason Herne" <jjherne@linux.ibm.com>,
"Tomita Moeko" <tomitamoeko@gmail.com>,
"Markus Armbruster" <armbru@redhat.com>,
"Matthew Rosato" <mjrosato@linux.ibm.com>,
"Eric Farman" <farman@linux.ibm.com>,
"David Hildenbrand" <david@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Michael S. Tsirkin" <mst@redhat.com>,
"Tony Krowiak" <akrowiak@linux.ibm.com>,
"Alex Williamson" <alex.williamson@redhat.com>,
"Stefano Garzarella" <sgarzare@redhat.com>,
"Thomas Huth" <thuth@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Halil Pasic" <pasic@linux.ibm.com>
Subject: Re: [PATCH v2 09/15] vfio: implement unmap all for DMA unmap callbacks
Date: Wed, 7 May 2025 12:47:27 +0100 [thread overview]
Message-ID: <aBtIT-G3ftu7xr0a@lent> (raw)
In-Reply-To: <3d5e7ab7-bd1b-4dca-aba7-3b82a8ee8763@redhat.com>
On Mon, May 05, 2025 at 01:28:02PM +0200, Cédric Le Goater wrote:
> > +static int vfio_legacy_dma_unmap(const VFIOContainerBase *bcontainer,
> > + hwaddr iova, ram_addr_t size,
> > + IOMMUTLBEntry *iotlb, bool unmap_all)
> > +{
> > + int ret;
> > +
> > + if (unmap_all) {
> > + /* The unmap ioctl doesn't accept a full 64-bit span. */
> > + Int128 llsize = int128_rshift(int128_2_64(), 1);
> > +
> > + ret = vfio_legacy_dma_unmap_one(bcontainer, 0, int128_get64(llsize),
> > + iotlb);
> > +
> > + if (ret == 0) {
> > + ret = vfio_legacy_dma_unmap_one(bcontainer, int128_get64(llsize),
> > + int128_get64(llsize), iotlb);
> > + }
> > +
> > + } else {
> > + ret = vfio_legacy_dma_unmap_one(bcontainer, iova, size, iotlb);
> > + }
> > +
> > + if (ret != 0) {
> > + return -errno;
> > + }
>
> the ret value should already be an errno. Shouldn't it ?
Yes, this can just be "return ret", thanks.
regards
john
next prev parent reply other threads:[~2025-05-07 11:48 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-30 19:39 [PATCH v2 00/15] vfio: preparation for vfio-user John Levon
2025-04-30 19:39 ` [PATCH v2 01/15] vfio: add vfio_prepare_device() John Levon
2025-05-05 8:35 ` Cédric Le Goater
2025-04-30 19:39 ` [PATCH v2 02/15] vfio: add vfio_unprepare_device() John Levon
2025-05-05 9:18 ` Cédric Le Goater
2025-04-30 19:39 ` [PATCH v2 03/15] vfio: add vfio_attach_device_by_iommu_type() John Levon
2025-04-30 19:39 ` [PATCH v2 04/15] vfio: add vfio_device_get_irq_info() helper John Levon
2025-05-01 11:53 ` Anthony Krowiak
2025-05-05 9:19 ` Cédric Le Goater
2025-05-06 11:38 ` John Levon
2025-05-06 12:27 ` Cédric Le Goater
2025-05-06 12:35 ` John Levon
2025-04-30 19:39 ` [PATCH v2 05/15] vfio: consistently handle return value for helpers John Levon
2025-05-05 9:32 ` Cédric Le Goater
2025-04-30 19:39 ` [PATCH v2 06/15] include/qemu: add strread/writeerror() John Levon
2025-05-05 9:37 ` Cédric Le Goater
2025-04-30 19:39 ` [PATCH v2 07/15] vfio: add vfio_pci_config_space_read/write() John Levon
2025-05-05 9:45 ` Cédric Le Goater
2025-04-30 19:39 ` [PATCH v2 08/15] vfio: add unmap_all flag to DMA unmap callback John Levon
2025-05-05 12:06 ` Cédric Le Goater
2025-05-05 13:26 ` John Levon
2025-05-05 21:05 ` Cédric Le Goater
2025-04-30 19:39 ` [PATCH v2 09/15] vfio: implement unmap all for DMA unmap callbacks John Levon
2025-05-05 11:28 ` Cédric Le Goater
2025-05-07 11:47 ` John Levon [this message]
2025-04-30 19:39 ` [PATCH v2 10/15] vfio: add device IO ops vector John Levon
2025-05-05 12:21 ` Cédric Le Goater
2025-05-06 10:01 ` Cédric Le Goater
2025-04-30 19:39 ` [PATCH v2 11/15] vfio: add region info cache John Levon
2025-05-05 12:26 ` Cédric Le Goater
2025-04-30 19:40 ` [PATCH v2 12/15] vfio: add read/write to device IO ops vector John Levon
2025-05-05 12:39 ` Cédric Le Goater
2025-04-30 19:40 ` [PATCH v2 13/15] vfio: add vfio-pci-base class John Levon
2025-05-05 12:42 ` Cédric Le Goater
2025-04-30 19:40 ` [PATCH v2 14/15] vfio/container: pass listener_begin/commit callbacks John Levon
2025-05-05 12:43 ` Cédric Le Goater
2025-04-30 19:40 ` [PATCH v2 15/15] vfio/container: pass MemoryRegion to DMA operations John Levon
2025-05-05 12:46 ` Cédric Le Goater
2025-05-07 13:58 ` John Levon
2025-05-09 10:28 ` Cédric Le Goater
2025-05-05 12:51 ` [PATCH v2 00/15] vfio: preparation for vfio-user Cédric Le Goater
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=aBtIT-G3ftu7xr0a@lent \
--to=john.levon@nutanix.com \
--cc=akrowiak@linux.ibm.com \
--cc=alex.williamson@redhat.com \
--cc=armbru@redhat.com \
--cc=clg@redhat.com \
--cc=david@redhat.com \
--cc=farman@linux.ibm.com \
--cc=jjherne@linux.ibm.com \
--cc=mjrosato@linux.ibm.com \
--cc=mst@redhat.com \
--cc=pasic@linux.ibm.com \
--cc=pbonzini@redhat.com \
--cc=peterx@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=sgarzare@redhat.com \
--cc=thuth@redhat.com \
--cc=tomitamoeko@gmail.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;
as well as URLs for NNTP newsgroup(s).