Re: [PATCH v3 4/6] iommu: Move IOMMU pagesize check to attach_device

2021-10-23 Thread Sven Peter via iommu
On Fri, Oct 22, 2021, at 15:39, Robin Murphy wrote: > On 2021-10-22 09:06, Marc Zyngier wrote: >> On Fri, 22 Oct 2021 03:52:38 +0100, >> Lu Baolu wrote: >>> >>> On 10/21/21 4:10 PM, Marc Zyngier wrote: On Thu, 21 Oct 2021 03:22:30 +0100, Lu Baolu wrote: > > On 10/20/21 10:22

Re: [PATCH v3 4/6] iommu: Move IOMMU pagesize check to attach_device

2021-10-22 Thread Robin Murphy
On 2021-10-22 09:06, Marc Zyngier wrote: On Fri, 22 Oct 2021 03:52:38 +0100, Lu Baolu wrote: On 10/21/21 4:10 PM, Marc Zyngier wrote: On Thu, 21 Oct 2021 03:22:30 +0100, Lu Baolu wrote: On 10/20/21 10:22 PM, Marc Zyngier wrote: On Wed, 20 Oct 2021 06:21:44 +0100, Lu Baolu wrote: On

Re: [PATCH v3 4/6] iommu: Move IOMMU pagesize check to attach_device

2021-10-22 Thread Marc Zyngier
On Fri, 22 Oct 2021 03:52:38 +0100, Lu Baolu wrote: > > On 10/21/21 4:10 PM, Marc Zyngier wrote: > > On Thu, 21 Oct 2021 03:22:30 +0100, > > Lu Baolu wrote: > >> > >> On 10/20/21 10:22 PM, Marc Zyngier wrote: > >>> On Wed, 20 Oct 2021 06:21:44 +0100, > >>> Lu Baolu wrote: > > On

Re: [PATCH v3 4/6] iommu: Move IOMMU pagesize check to attach_device

2021-10-21 Thread Lu Baolu
On 10/21/21 4:10 PM, Marc Zyngier wrote: On Thu, 21 Oct 2021 03:22:30 +0100, Lu Baolu wrote: On 10/20/21 10:22 PM, Marc Zyngier wrote: On Wed, 20 Oct 2021 06:21:44 +0100, Lu Baolu wrote: On 2021/10/20 0:37, Sven Peter via iommu wrote: + /* +* Check that CPU pages can be

Re: [PATCH v3 4/6] iommu: Move IOMMU pagesize check to attach_device

2021-10-21 Thread Sven Peter via iommu
On Wed, Oct 20, 2021, at 07:21, Lu Baolu wrote: > On 2021/10/20 0:37, Sven Peter via iommu wrote: >> The iova allocator is capable of handling any granularity which is a power >> of two. Remove the much stronger condition that the granularity must be >> smaller or equal to the CPU page size

Re: [PATCH v3 4/6] iommu: Move IOMMU pagesize check to attach_device

2021-10-21 Thread Marc Zyngier
On Thu, 21 Oct 2021 03:22:30 +0100, Lu Baolu wrote: > > On 10/20/21 10:22 PM, Marc Zyngier wrote: > > On Wed, 20 Oct 2021 06:21:44 +0100, > > Lu Baolu wrote: > >> > >> On 2021/10/20 0:37, Sven Peter via iommu wrote: > >>> + /* > >>> + * Check that CPU pages can be represented by the IOVA

Re: [PATCH v3 4/6] iommu: Move IOMMU pagesize check to attach_device

2021-10-20 Thread Lu Baolu
On 10/20/21 10:22 PM, Marc Zyngier wrote: On Wed, 20 Oct 2021 06:21:44 +0100, Lu Baolu wrote: On 2021/10/20 0:37, Sven Peter via iommu wrote: The iova allocator is capable of handling any granularity which is a power of two. Remove the much stronger condition that the granularity must be

Re: [PATCH v3 4/6] iommu: Move IOMMU pagesize check to attach_device

2021-10-20 Thread Marc Zyngier
On Wed, 20 Oct 2021 06:21:44 +0100, Lu Baolu wrote: > > On 2021/10/20 0:37, Sven Peter via iommu wrote: > > The iova allocator is capable of handling any granularity which is a power > > of two. Remove the much stronger condition that the granularity must be > > smaller or equal to the CPU page

Re: [PATCH v3 4/6] iommu: Move IOMMU pagesize check to attach_device

2021-10-19 Thread Lu Baolu
On 2021/10/20 0:37, Sven Peter via iommu wrote: The iova allocator is capable of handling any granularity which is a power of two. Remove the much stronger condition that the granularity must be smaller or equal to the CPU page size from a BUG_ON there. Instead, check this condition during

[PATCH v3 4/6] iommu: Move IOMMU pagesize check to attach_device

2021-10-19 Thread Sven Peter via iommu
The iova allocator is capable of handling any granularity which is a power of two. Remove the much stronger condition that the granularity must be smaller or equal to the CPU page size from a BUG_ON there. Instead, check this condition during __iommu_attach_device and fail gracefully.