mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
To: Robin Murphy <robin.murphy@arm.com>,
	iommu@lists.linux-foundation.org, kvm@vger.kernel.org,
	linux-kernel@vger.kernel.org
Cc: jroedel@suse.de
Subject: Re: [PATCH 1/2] iommu: Fix iommu_unmap and iommu_unmap_fast return type
Date: Thu, 1 Feb 2018 12:03:46 +0700	[thread overview]
Message-ID: <de21de51-1589-edb1-3dd1-b7065eb8fb3c@amd.com> (raw)
In-Reply-To: <eaa33cb6-3df0-6f95-59ea-e563076d7f76@arm.com>

Hi Robin,

On 2/1/18 1:02 AM, Robin Murphy wrote:
> Hi Suravee,
> 
> On 31/01/18 01:48, Suravee Suthikulpanit wrote:
>> Currently, iommu_unmap and iommu_unmap_fast return unmapped
>> pages with size_t.  However, the actual value returned could
>> be error codes (< 0), which can be misinterpreted as large
>> number of unmapped pages. Therefore, change the return type to ssize_t.
>>
>> Cc: Joerg Roedel <joro@8bytes.org>
>> Cc: Alex Williamson <alex.williamson@redhat.com>
>> Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
>> ---
>>   drivers/iommu/amd_iommu.c   |  6 +++---
>>   drivers/iommu/intel-iommu.c |  4 ++--
> 
> Er, there are a few more drivers than that implementing iommu_ops ;)

Ahh right.
> 
> It seems like it might be more sensible to fix the single instance of a driver returning -EINVAL (which appears to be a "should never happen if used correctly" kinda thing anyway) and leave the API-internal callback prototype as-is. I do agree the inconsistency of iommu_unmap() itself wants sorting, though (particularly the !IOMMU_API stubs which are wrong either way).
> 
> Robin.

Make sense. I'll leave the API alone, and change the code to not returning error then.
There are a few places to fix.

Thanks,
Suravee

  reply	other threads:[~2018-02-01  5:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-31  1:48 [PATCH 0/2] iommu / vfio: Clean up iommu_map[_fast] interface Suravee Suthikulpanit
2018-01-31  1:48 ` [PATCH 1/2] iommu: Fix iommu_unmap and iommu_unmap_fast return type Suravee Suthikulpanit
2018-01-31 18:02   ` Robin Murphy
2018-02-01  5:03     ` Suravee Suthikulpanit [this message]
2018-02-01 12:17       ` Robin Murphy
2018-02-02 19:13   ` kbuild test robot
2018-02-02 19:41   ` kbuild test robot
2018-02-02 23:57   ` kbuild test robot
2018-01-31  1:48 ` [PATCH 2/2] vfio/type1: Add iommu_unmap error check when vfio_unmap_unpin 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=de21de51-1589-edb1-3dd1-b7065eb8fb3c@amd.com \
    --to=suravee.suthikulpanit@amd.com \
    --cc=iommu@lists.linux-foundation.org \
    --cc=jroedel@suse.de \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robin.murphy@arm.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

all inboxes | Powered by JetHome®