lkml.org 
[lkml]   [2021]   [Sep]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2 6/8] iommu: Move IOMMU pagesize check to attach_device
From
Date
On 2021-09-01 18:14, Sven Peter wrote:
>
>
> On Tue, Aug 31, 2021, at 23:39, Alyssa Rosenzweig wrote:
>>> + if ((1 << __ffs(domain->pgsize_bitmap)) > PAGE_SIZE) {
>>
>> Not a fan of this construction. Could you assign `(1 <<
>> __ffs(domain->pgsize_bitmap))` to an appropriately named temporary (e.g
>> min_io_pgsize) so it's clearer what's going on?
>
> Good point, will do that for the next version.

Or maybe just test "__ffs(domain->pgsize_bitmap) > PAGE_SHIFT", or
perhaps even avoid shifts altogether with something like
"domain->pgsize_bitmap & (PAGE_SIZE | PAGE_SIZE - 1)".

Robin.

>
>>
>>> + pr_warn("IOMMU page size cannot represent CPU pages.\n");
>>
>> "Represent" how?
>>
>
> Looks like I dropped an "exactly" there when taking this line from iova.c :)
>
>
>
> Thanks,
>
>
> Sven
>

\
 
 \ /
  Last update: 2021-09-01 20:57    [W:0.094 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site