Re: [RFC PATCH 2/3] iommu/dma-iommu: Support iovad->granule > PAGE_SIZE

2021-08-12 Thread Robin Murphy
On 2021-08-11 21:18, Sven Peter wrote: On Tue, Aug 10, 2021, at 11:51, Robin Murphy wrote: On 2021-08-09 21:45, Sven Peter wrote: On Mon, Aug 9, 2021, at 19:41, Robin Murphy wrote: On 2021-08-07 12:47, Sven Peter via iommu wrote: On Fri, Aug 6, 2021, at 20:04, Robin Murphy wrote: On

Re: [RFC PATCH 2/3] iommu/dma-iommu: Support iovad->granule > PAGE_SIZE

2021-08-11 Thread Sven Peter via iommu
On Tue, Aug 10, 2021, at 11:51, Robin Murphy wrote: > On 2021-08-09 21:45, Sven Peter wrote: > > > > > > On Mon, Aug 9, 2021, at 19:41, Robin Murphy wrote: > >> On 2021-08-07 12:47, Sven Peter via iommu wrote: > >>> > >>> > >>> On Fri, Aug 6, 2021, at 20:04, Robin Murphy wrote: > On

Re: [RFC PATCH 2/3] iommu/dma-iommu: Support iovad->granule > PAGE_SIZE

2021-08-10 Thread Robin Murphy
On 2021-08-09 21:45, Sven Peter wrote: On Mon, Aug 9, 2021, at 19:41, Robin Murphy wrote: On 2021-08-07 12:47, Sven Peter via iommu wrote: On Fri, Aug 6, 2021, at 20:04, Robin Murphy wrote: On 2021-08-06 16:55, Sven Peter via iommu wrote: @@ -1006,6 +1019,31 @@ static int

Re: [RFC PATCH 2/3] iommu/dma-iommu: Support iovad->granule > PAGE_SIZE

2021-08-09 Thread Sven Peter via iommu
On Mon, Aug 9, 2021, at 19:41, Robin Murphy wrote: > On 2021-08-07 12:47, Sven Peter via iommu wrote: > > > > > > On Fri, Aug 6, 2021, at 20:04, Robin Murphy wrote: > >> On 2021-08-06 16:55, Sven Peter via iommu wrote: > >>> @@ -1006,6 +1019,31 @@ static int iommu_dma_map_sg(struct device

Re: [RFC PATCH 2/3] iommu/dma-iommu: Support iovad->granule > PAGE_SIZE

2021-08-09 Thread Sven Peter via iommu
Hi, On Mon, Aug 9, 2021, at 20:37, Robin Murphy wrote: > On 2021-08-07 09:41, Sven Peter wrote: > > Hi, > > > > Thanks a lot for quick reply! > > > > On Fri, Aug 6, 2021, at 20:04, Robin Murphy wrote: > >> On 2021-08-06 16:55, Sven Peter via iommu wrote: > >>> DMA IOMMU domains can support

Re: [RFC PATCH 2/3] iommu/dma-iommu: Support iovad->granule > PAGE_SIZE

2021-08-09 Thread Robin Murphy
On 2021-08-07 09:41, Sven Peter wrote: Hi, Thanks a lot for quick reply! On Fri, Aug 6, 2021, at 20:04, Robin Murphy wrote: On 2021-08-06 16:55, Sven Peter via iommu wrote: DMA IOMMU domains can support hardware where the IOMMU page size is larger than the CPU page size. Alignments need to

Re: [RFC PATCH 2/3] iommu/dma-iommu: Support iovad->granule > PAGE_SIZE

2021-08-09 Thread Robin Murphy
On 2021-08-07 12:47, Sven Peter via iommu wrote: On Fri, Aug 6, 2021, at 20:04, Robin Murphy wrote: On 2021-08-06 16:55, Sven Peter via iommu wrote: @@ -1006,6 +1019,31 @@ static int iommu_dma_map_sg(struct device *dev, struct scatterlist *sg, if (dev_is_untrusted(dev))

Re: [RFC PATCH 2/3] iommu/dma-iommu: Support iovad->granule > PAGE_SIZE

2021-08-07 Thread Sven Peter via iommu
On Fri, Aug 6, 2021, at 20:04, Robin Murphy wrote: > On 2021-08-06 16:55, Sven Peter via iommu wrote: > > @@ -1006,6 +1019,31 @@ static int iommu_dma_map_sg(struct device *dev, > > struct scatterlist *sg, > > if (dev_is_untrusted(dev)) > > return iommu_dma_map_sg_swiotlb(dev,

Re: [RFC PATCH 2/3] iommu/dma-iommu: Support iovad->granule > PAGE_SIZE

2021-08-07 Thread Sven Peter via iommu
Hi, Thanks a lot for quick reply! On Fri, Aug 6, 2021, at 20:04, Robin Murphy wrote: > On 2021-08-06 16:55, Sven Peter via iommu wrote: > > DMA IOMMU domains can support hardware where the IOMMU page size is > > larger than the CPU page size. > > Alignments need to be done with respect to both

Re: [RFC PATCH 2/3] iommu/dma-iommu: Support iovad->granule > PAGE_SIZE

2021-08-06 Thread Robin Murphy
On 2021-08-06 16:55, Sven Peter via iommu wrote: DMA IOMMU domains can support hardware where the IOMMU page size is larger than the CPU page size. Alignments need to be done with respect to both PAGE_SIZE and iovad->granule. Additionally, the sg list optimization to use a single IOVA allocation

[RFC PATCH 2/3] iommu/dma-iommu: Support iovad->granule > PAGE_SIZE

2021-08-06 Thread Sven Peter via iommu
DMA IOMMU domains can support hardware where the IOMMU page size is larger than the CPU page size. Alignments need to be done with respect to both PAGE_SIZE and iovad->granule. Additionally, the sg list optimization to use a single IOVA allocation cannot be used in those cases since the physical