From: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
To: Alex Williamson <alex.williamson@redhat.com>
Cc: kvm@vger.kernel.org, iommu@lists.linux-foundation.org,
linux-kernel@vger.kernel.org, joro@8bytes.org, jroedel@suse.de
Subject: Re: [PATCH v3] vfio/type1: Adopt fast IOTLB flush interface when unmap IOVAs
Date: Wed, 24 Jan 2018 11:38:04 +0700 [thread overview]
Message-ID: <1fb32e87-80f9-27e0-affe-afed3add7306@amd.com> (raw)
In-Reply-To: <20180123150452.03a42c53@w520.home>
Alex/Joerg,
On 1/24/18 5:04 AM, Alex Williamson wrote:
>> +static size_t try_unmap_unpin_fast(struct vfio_domain *domain, dma_addr_t iova,
>> + size_t len, phys_addr_t phys,
>> + struct list_head *unmapped_regions)
>> +{
>> + struct vfio_regions *entry;
>> + size_t unmapped;
>> +
>> + entry = kzalloc(sizeof(*entry), GFP_KERNEL);
>> + if (!entry)
>> + return -ENOMEM;
> size_t is unsigned, so pushing -ENOMEM out though this unsigned
> function and the callee interpreting it as unsigned, means we're going
> to see this as a very large unmap, not an error condition. Looks like
> the IOMMU API has problems in this space too, ex. iommu_unmap(), Joerg?
>
I can clean up the APIs to use ssize_t, where it can return errors.
Suravee
next prev parent reply other threads:[~2018-01-24 4:38 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-22 4:29 [PATCH v3] vfio/type1: Adopt fast IOTLB flush interface when unmap IOVAs Suravee Suthikulpanit
2018-01-23 22:04 ` Alex Williamson
2018-01-24 4:38 ` Suravee Suthikulpanit [this message]
[not found] ` <20180123150452.03a42c53-DGNDKt5SQtizQB+pC5nmwQ@public.gmane.org>
2018-01-24 10:00 ` Suravee Suthikulpanit
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=1fb32e87-80f9-27e0-affe-afed3add7306@amd.com \
--to=suravee.suthikulpanit@amd.com \
--cc=alex.williamson@redhat.com \
--cc=iommu@lists.linux-foundation.org \
--cc=joro@8bytes.org \
--cc=jroedel@suse.de \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.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