lkml.org 
[lkml]   [2024]   [Feb]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v4 5/5] iommu/dma: Force swiotlb_max_mapping_size on an untrusted device
From
On 27/02/2024 3:40 pm, Christoph Hellwig wrote:
> On Wed, Feb 21, 2024 at 11:35:04AM +0000, Will Deacon wrote:
>> +static size_t iommu_dma_max_mapping_size(struct device *dev)
>> +{
>> + if (is_swiotlb_active(dev) && dev_is_untrusted(dev))
>> + return swiotlb_max_mapping_size(dev);
>
> Curious: do we really need both checks here? If swiotlb is active
> for a device (for whatever reason), aren't we then always bound
> by the max size? If not please add a comment explaining it.
>

Oh, good point - if we have an untrusted device but SWIOTLB isn't
initialised for whatever reason, then it doesn't matter what
max_mapping_size returns because iommu_dma_map_page() is going to bail
out regardless.

Thanks,
Robin.

\
 
 \ /
  Last update: 2024-05-27 15:25    [W:0.118 / U:0.996 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site