[PATCH] kernel/dma: export dma_alloc_from_contiguous to modules

2019-07-10 Thread miles.chen
From: Miles Chen This change exports dma_alloc_from_contiguous and dma_release_from_contiguous to modules. Currently, we can add a reserve a memory node in dts files, make it a CMA memory by setting compatible = "shared-dma-pool", and setup the dev->cma_area by using

[RFC PATCH] iommu: io-pgtable: Drop WARN for empty PTEs on unmap

2019-07-10 Thread Rob Herring
If a region has been mapped sparsely (such as on page faults), the user has to keep track of what was mapped or not in order to avoid warnings when unmapping the entire region. Remove the WARN on empty PTEs to allow unmapping sparsely mapped regions. Cc: Will Deacon Cc: Robin Murphy Cc: Joerg

[PATCH] iommu/amd: fix a crash in iova_magazine_free_pfns

2019-07-10 Thread Qian Cai
When a system is under heavy memory pressure, the allocation in alloc_iova_fast() could still fail even flush_rcache=true, and then causes dma_ops_alloc_iova() return 0. pqi_scsi_queue_command pqi_raid_submit_scsi_cmd_with_io_request scsi_dma_map map_sg dma_ops_alloc_iova

[PATCH] dma-direct: Force unencrypted DMA under SME for certain DMA masks

2019-07-10 Thread Lendacky, Thomas
From: Tom Lendacky If a device doesn't support DMA to a physical address that includes the encryption bit (currently bit 47, so 48-bit DMA), then the DMA must occur to unencrypted memory. SWIOTLB is used to satisfy that requirement if an IOMMU is not active (enabled or configured in passthrough

[PATCH v2] iommu: add support for drivers that manage iommu explicitly

2019-07-10 Thread Rob Clark
From: Rob Clark Avoid attaching any non-driver managed domain if the driver indicates that it manages the iommu directly. This avoids a problem on devices where the bootloader takes the SMMU out of bypass and enables scanout, such as is the case on snapdragon aarch64 laptops and newer

Re: [RESEND PATCH v2 2/3] iommu/io-pgtable-arm: Add support for AARCH64 split pagetables

2019-07-10 Thread Jordan Crouse
On Wed, Jul 10, 2019 at 05:45:37PM +0100, Robin Murphy wrote: > Hi Jordan, > > On 08/07/2019 20:00, Jordan Crouse wrote: > >Add a new sub-format ARM_64_LPAE_SPLIT_S1 to create and set up split > >pagetables (TTBR0 and TTBR1). The initialization function sets up the > >correct va_size and sign

Re: [RESEND PATCH v2 2/3] iommu/io-pgtable-arm: Add support for AARCH64 split pagetables

2019-07-10 Thread Robin Murphy
Hi Jordan, On 08/07/2019 20:00, Jordan Crouse wrote: Add a new sub-format ARM_64_LPAE_SPLIT_S1 to create and set up split pagetables (TTBR0 and TTBR1). The initialization function sets up the correct va_size and sign extension bits and programs the TCR registers. Split pagetable formats use

Re: [RESEND PATCH v2 3/3] iommu/arm-smmu: Add support for DOMAIN_ATTR_SPLIT_TABLES

2019-07-10 Thread Robin Murphy
On 08/07/2019 20:00, Jordan Crouse wrote: When DOMAIN_ATTR_SPLIT_TABLES is specified for pass ARM_64_LPAE_SPLIT_S1 to io_pgtable_ops to allocate and initialize TTBR0 and TTBR1 pagetables. v3: Moved all the pagetable specific work into io-pgtable-arm in a previous patch. Signed-off-by: Jordan

Re: [PATCH v8 07/21] iommu/io-pgtable-arm-v7s: Extend MediaTek 4GB Mode

2019-07-10 Thread Will Deacon
On Sat, Jun 29, 2019 at 10:09:13AM +0800, Yong Wu wrote: > MediaTek extend the arm v7s descriptor to support the dram over 4GB. > > In the mt2712 and mt8173, it's called "4GB mode", the physical address > is from 0x4000_ to 0x1_3fff_, but from EMI point of view, it > is remapped to high

VFIO/IOMMU/PCI Linux Plumbers 2019 MC - Call for Topics

2019-07-10 Thread Lorenzo Pieralisi
Hi, following the official LPC19 VFIO/IOMMU/PCI microconference acceptance notification: https://www.linuxplumbersconf.org/blog/2019/vfio-iommu-pci-microconference-accepted-into-2019-linux-plumbers-conference/ I am sending out a call for sessions proposals open to all developers