lkml.org 
[lkml]   [2018]   [Jan]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v3] vfio/type1: Adopt fast IOTLB flush interface when unmap IOVAs
From
Date
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

\
 
 \ /
  Last update: 2018-01-24 05:39    [W:2.529 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site