[PATCH v1] iommu/vt-d: Switch to bitmap_zalloc()

2019-03-04 Thread Andy Shevchenko
Switch to bitmap_zalloc() to show clearly what we are allocating. Besides that it returns pointer of bitmap type instead of opaque void *. Signed-off-by: Andy Shevchenko --- drivers/iommu/intel_irq_remapping.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git

Re: [PATCH 0/2][RFC] kernel/dma: Support platform-specific default CMA sizes

2019-03-04 Thread Robin Murphy
Hi Thomas, On 04/03/2019 11:52, Thomas Zimmermann wrote: This is an RFC patch set that adds support for configuring a default CMA size, depending on the platform. At SUSE, our ARM installer image runs on a variety of platforms. One of these, the Raspberry Pi 3, requires CMA to be allocated on

Re: [RFC PATCH v1 05/15] iommu/arm-smmu: Add auxiliary domain support for arm-smmuv2

2019-03-04 Thread Jean-Philippe Brucker
Hi Jordan, On 01/03/2019 19:38, Jordan Crouse wrote: > Support the new auxiliary domain API for arm-smmuv2 to initialize and > support multiple pagetables for a SMMU device. Since the smmu-v2 hardware > doesn't have any built in support for switching the pagetable base it is > left as an exercise

Re: [PATCH v2] iommu: io-pgtable: Add ARM Mali midgard MMU page table format

2019-03-04 Thread Robin Murphy
On 04/03/2019 15:32, Rob Herring wrote: On Fri, Mar 1, 2019 at 10:28 AM Robin Murphy wrote: On 27/02/2019 23:22, Rob Herring wrote: ARM Mali midgard GPU page tables are similar to standard 64-bit stage 1 page tables, but have a few differences. Add a new format type to represent the format.

[PATCH 3/4] iommu/vt-d: Allow IOMMU_DOMAIN_DMA and IOMMU_DOMAIN_IDENTITY to be allocated

2019-03-04 Thread James Sewart via iommu
Allowing IOMMU_DOMAIN_DMA type IOMMU domain to be allocated allows the default_domain of an iommu_group to be set. This delegates device-domain relationships to the generic IOMMU code. Signed-off-by: James Sewart --- drivers/iommu/intel-iommu.c | 113 +++- 1 file

[PATCH 4/4] iommu/vt-d: Remove lazy allocation of domains

2019-03-04 Thread James Sewart via iommu
The generic IOMMU code will allocate and attach a dma ops domain to each device that comes online, replacing any lazy allocated domain. Removes RMRR application at iommu init time as we won't have a domain attached to any device. iommu.c will do this after attaching a device using

Re: [PATCH RFC 1/1] iommu: set the default iommu-dma mode as non-strict

2019-03-04 Thread Robin Murphy
On 02/03/2019 06:12, Leizhen (ThunderTown) wrote: On 2019/3/1 19:07, Jean-Philippe Brucker wrote: Hi Leizhen, On 01/03/2019 04:44, Leizhen (ThunderTown) wrote: On 2019/2/26 20:36, Hanjun Guo wrote: Hi Jean, On 2019/1/31 22:55, Jean-Philippe Brucker wrote: Hi, On 31/01/2019 13:52, Zhen

[PATCH 0/4] iommu/vt-d: Fix-up device-domain relationship by refactoring to use iommu group default domain.

2019-03-04 Thread James Sewart via iommu
Hey, This patchset moves IOMMU_DOMAIN_DMA iommu domain management to iommu.c. This avoids the use of find_or_alloc_domain whose domain assignment is inconsistent with the iommu grouping as determined by pci_device_group. Patch 3 permits domain type IOMMU_DOMAIN_DMA to be allocated via the

Re: [PATCH v2] iommu: io-pgtable: Add ARM Mali midgard MMU page table format

2019-03-04 Thread Rob Herring
On Fri, Mar 1, 2019 at 10:28 AM Robin Murphy wrote: > > On 27/02/2019 23:22, Rob Herring wrote: > > ARM Mali midgard GPU page tables are similar to standard 64-bit stage 1 > > page tables, but have a few differences. Add a new format type to > > represent the format. The input address size is

[PATCH 1/4] iommu: Move iommu_group_create_direct_mappings to after device_attach

2019-03-04 Thread James Sewart via iommu
If an IOMMU driver requires to know which IOMMU a domain is associated to initialise a domain then it will do so in device_attach, before which it is not safe to call iommu_ops. Signed-off-by: James Sewart --- drivers/iommu/iommu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff

[PATCH 2/4] iommu/vt-d: Implement apply_resv_region for reserving IOVA ranges

2019-03-04 Thread James Sewart via iommu
Used by iommu.c before creating identity mappings for reserved ranges to ensure dma-map-ops won't ever remap these addresses. Signed-off-by: James Sewart --- drivers/iommu/intel-iommu.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/drivers/iommu/intel-iommu.c

Re: [PATCH 3/4] iommu/vt-d: Allow IOMMU_DOMAIN_DMA and IOMMU_DOMAIN_IDENTITY to be allocated

2019-03-04 Thread Lu Baolu
Hi, On 3/4/19 11:46 PM, James Sewart wrote: Allowing IOMMU_DOMAIN_DMA type IOMMU domain to be allocated allows the default_domain of an iommu_group to be set. This delegates device-domain relationships to the generic IOMMU code. Signed-off-by: James Sewart --- drivers/iommu/intel-iommu.c |

Re: [PATCH] Revert "swiotlb: remove SWIOTLB_MAP_ERROR"

2019-03-04 Thread Robin Murphy
Hi Arnd, On 2019-03-04 7:59 pm, Arnd Bergmann wrote: This reverts commit b907e20508d0 ("swiotlb: remove SWIOTLB_MAP_ERROR"), which introduced an overflow warning in configurations that have a larger dma_addr_t than phys_addr_t: In file included from include/linux/dma-direct.h:5,

Re: [PATCH 4/4] iommu/vt-d: Remove lazy allocation of domains

2019-03-04 Thread Lu Baolu
Hi, It's hard for me to understand why do we remove the rmrr related code in this patch. And, now we have two places to hold a domain for a device: group and dev->info. We can consider to optimize the use of per device iommu arch data. This should be later work anyway. More comments inline.

Re: [PATCH 0/4] iommu/vt-d: Fix-up device-domain relationship by refactoring to use iommu group default domain.

2019-03-04 Thread Lu Baolu
Hi James, Very glad to see this. Thank you! On 3/4/19 11:41 PM, James Sewart wrote: Hey, This patchset moves IOMMU_DOMAIN_DMA iommu domain management to iommu.c. This avoids the use of find_or_alloc_domain whose domain assignment is inconsistent with the iommu grouping as determined by

Re: [PATCH v2] iommu: io-pgtable: Add ARM Mali midgard MMU page table format

2019-03-04 Thread Rob Herring
On Mon, Mar 4, 2019 at 11:31 AM Robin Murphy wrote: > > On 04/03/2019 15:32, Rob Herring wrote: > > On Fri, Mar 1, 2019 at 10:28 AM Robin Murphy wrote: > >> > >> On 27/02/2019 23:22, Rob Herring wrote: > >>> ARM Mali midgard GPU page tables are similar to standard 64-bit stage 1 > >>> page

[PATCH] Revert "swiotlb: remove SWIOTLB_MAP_ERROR"

2019-03-04 Thread Arnd Bergmann
This reverts commit b907e20508d0 ("swiotlb: remove SWIOTLB_MAP_ERROR"), which introduced an overflow warning in configurations that have a larger dma_addr_t than phys_addr_t: In file included from include/linux/dma-direct.h:5, from kernel/dma/swiotlb.c:23: kernel/dma/swiotlb.c:

Re: [PATCH] Revert "swiotlb: remove SWIOTLB_MAP_ERROR"

2019-03-04 Thread Konrad Rzeszutek Wilk
On Mon, Mar 04, 2019 at 08:59:03PM +0100, Arnd Bergmann wrote: > This reverts commit b907e20508d0 ("swiotlb: remove SWIOTLB_MAP_ERROR"), which > introduced an overflow warning in configurations that have a larger > dma_addr_t than phys_addr_t: > > In file included from