Re: [PATCH] iommu: fix min_not_zero() type mismatch warning

2019-12-10 Thread Christoph Hellwig
I think we agree that the parameter should be a u64 instead, and either Nicolas or Robin (sorry, fading memory) promised to send me a patch for that. ___ iommu mailing list iommu@lists.linux-foundation.org

Re: [RESEND PATCH v9 2/4] uacce: add uacce driver

2019-12-10 Thread zhangfei
On 2019/12/11 上午8:09, kbuild test robot wrote: Hi Zhangfei, Thank you for the patch! Yet something to improve: [auto build test ERROR on cryptodev/master] [also build test ERROR on crypto/master char-misc/char-misc-testing v5.5-rc1 next-20191210] [if your patch is applied to the wrong git

[PATCH v2] arm64: dts: Add m4u and smi-larbs nodes for mt8183

2019-12-10 Thread Yong Wu
Add nodes for M4U, smi-common, and smi-larbs. Signed-off-by: Yong Wu --- change notes: v2: Rebase on v5.5-rc1 and power_domain nodes[1]. [1] https://lore.kernel.org/patchwork/patch/1164746/ v1: https://lore.kernel.org/patchwork/patch/1054099/ --- arch/arm64/boot/dts/mediatek/mt8183.dtsi |

[PATCH v3 0/6] Use 1st-level for IOVA translation

2019-12-10 Thread Lu Baolu
Intel VT-d in scalable mode supports two types of page tables for DMA translation: the first level page table and the second level page table. The first level page table uses the same format as the CPU page table, while the second level page table keeps compatible with previous formats. The

[PATCH v3 5/6] iommu/vt-d: Flush PASID-based iotlb for iova over first level

2019-12-10 Thread Lu Baolu
When software has changed first-level tables, it should invalidate the affected IOTLB and the paging-structure-caches using the PASID- based-IOTLB Invalidate Descriptor defined in spec 6.5.2.4. Signed-off-by: Lu Baolu --- drivers/iommu/dmar.c| 41 ++

[PATCH v3 2/6] iommu/vt-d: Add set domain DOMAIN_ATTR_NESTING attr

2019-12-10 Thread Lu Baolu
This adds the Intel VT-d specific callback of setting DOMAIN_ATTR_NESTING domain attribution. It is necessary to let the VT-d driver know that the domain represents a virtual machine which requires the IOMMU hardware to support nested translation mode. Return success if the IOMMU hardware suports

[PATCH v3 6/6] iommu/vt-d: Use iova over first level

2019-12-10 Thread Lu Baolu
After we make all map/unmap paths support first level page table. Let's turn it on if hardware supports scalable mode. Signed-off-by: Lu Baolu --- drivers/iommu/intel-iommu.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/iommu/intel-iommu.c

[PATCH v3 4/6] iommu/vt-d: Setup pasid entries for iova over first level

2019-12-10 Thread Lu Baolu
Intel VT-d in scalable mode supports two types of page tables for IOVA translation: first level and second level. The IOMMU driver can choose one from both for IOVA translation according to the use case. This sets up the pasid entry if a domain is selected to use the first-level page table for

[PATCH v3 3/6] iommu/vt-d: Add PASID_FLAG_FL5LP for first-level pasid setup

2019-12-10 Thread Lu Baolu
Current intel_pasid_setup_first_level() use 5-level paging for first level translation if CPUs use 5-level paging mode too. This makes sense for SVA usages since the page table is shared between CPUs and IOMMUs. But it makes no sense if we only want to use first level for IOVA translation. Add

[PATCH v3 1/6] iommu/vt-d: Identify domains using first level page table

2019-12-10 Thread Lu Baolu
This checks whether a domain should use the first level page table for map/unmap and marks it in the domain structure. Signed-off-by: Lu Baolu --- drivers/iommu/intel-iommu.c | 39 + 1 file changed, 39 insertions(+) diff --git a/drivers/iommu/intel-iommu.c

Re: [PATCH v2 5/8] iommu/vt-d: Add first level page table interfaces

2019-12-10 Thread Lu Baolu
Hi Jacob, On 12/3/19 7:27 AM, Jacob Pan wrote: On Thu, 28 Nov 2019 10:25:47 +0800 Lu Baolu wrote: This adds functions to manipulate first level page tables which could be used by a scalale mode capable IOMMU unit. FL and SL page tables are very similar, and I presume we are not using all

[PATCH 1/1] iommu/vt-d: trace: Extend map_sg trace event

2019-12-10 Thread Lu Baolu
Current map_sg stores trace message in a coarse manner. This extends it so that more detailed messages could be traced. The map_sg trace message looks like: map_sg: dev=:00:17.0 [1/9] dev_addr=0xf8f9 phys_addr=0x158051000 size=4096 map_sg: dev=:00:17.0 [2/9] dev_addr=0xf8f91000

[PATCH 1/1] iommu/vt-d: Fix dmar pte read access not set error

2019-12-10 Thread Lu Baolu
If the default DMA domain of a group doesn't fit a device, it will still sit in the group but use a private identity domain. When map/unmap/iova_to_phys come through iommu API, the driver should still serve them, otherwise, other devices in the same group will be impacted. Since identity domain

Re: [PATCH] iommu: set group default domain before creating direct mappings

2019-12-10 Thread Lu Baolu
Hi, On 12/11/19 2:56 AM, Jerry Snitselaar wrote: iommu_group_create_direct_mappings uses group->default_domain, but right after it is called, request_default_domain_for_dev calls iommu_domain_free for the default domain, and sets the group default domain to a different domain. Move the

Re: [RESEND PATCH v9 2/4] uacce: add uacce driver

2019-12-10 Thread kbuild test robot
Hi Zhangfei, Thank you for the patch! Yet something to improve: [auto build test ERROR on cryptodev/master] [also build test ERROR on crypto/master char-misc/char-misc-testing v5.5-rc1 next-20191210] [if your patch is applied to the wrong git tree, please drop us a note to help improve

Re: [PATCH v6 2/3] PCI: Add parameter nr_devfns to pci_add_dma_alias

2019-12-10 Thread Bjorn Helgaas
[+cc Joerg] On Tue, Dec 03, 2019 at 03:43:53PM +, James Sewart wrote: > pci_add_dma_alias can now be used to create a dma alias for a range of > devfns. > > Reviewed-by: Logan Gunthorpe > Signed-off-by: James Sewart > --- > drivers/pci/pci.c| 22 +- >

Re: [PATCH v6 1/3] PCI: Fix off by one in dma_alias_mask allocation size

2019-12-10 Thread Bjorn Helgaas
[+cc Joerg] On Tue, Dec 03, 2019 at 03:43:22PM +, James Sewart wrote: > The number of possible devfns is 256, add def and correct uses. > > Reviewed-by: Logan Gunthorpe > Signed-off-by: James Sewart I applied these three patches to pci/virtualization for v5.6, thanks! I moved the

Re: dmar pte read access not set error messages on hp dl388 gen8 systems

2019-12-10 Thread Jerry Snitselaar
On Tue Dec 10 19, Lu Baolu wrote: Hi, On 12/10/19 1:18 PM, Jerry Snitselaar wrote: On Mon Dec 09 19, Jerry Snitselaar wrote: [snip] A call to iommu_map is failing. [   36.686881] pci :01:00.2: iommu_group_add_device: calling iommu_group_create_direct_mappings [   36.689843] pci

Re: [PATCH v3 12/13] PCI/ATS: Add PASID stubs

2019-12-10 Thread Bjorn Helgaas
On Mon, Dec 09, 2019 at 07:05:13PM +0100, Jean-Philippe Brucker wrote: > The SMMUv3 driver, which may be built without CONFIG_PCI, will soon gain > PASID support. Partially revert commit c6e9aefbf9db ("PCI/ATS: Remove > unused PRI and PASID stubs") to re-introduce the PASID stubs, and avoid >

Re: [PATCH v5 0/8] VT-d Native Shared virtual memory cleanup and fixes

2019-12-10 Thread Jacob Pan
On Tue, 10 Dec 2019 09:14:07 +0800 Lu Baolu wrote: > Hi Jacob, > > This has been queued for internal test. I will forward it to Joerg if > everything goes well (probably around rc4). > Thanks for the confirmation. I will send out further patches based on this series. > Best regards, > -baolu

[PATCH] iommu: fix min_not_zero() type mismatch warning

2019-12-10 Thread Arnd Bergmann
min()/max() require the arguments to be of the same type. When dma_addr_t is not compatible with __u64, this causes a warning: In file included from include/linux/list.h:9, from include/linux/kobject.h:19, from include/linux/of.h:17, from

[PATCH] iommu: set group default domain before creating direct mappings

2019-12-10 Thread Jerry Snitselaar
iommu_group_create_direct_mappings uses group->default_domain, but right after it is called, request_default_domain_for_dev calls iommu_domain_free for the default domain, and sets the group default domain to a different domain. Move the iommu_group_create_direct_mappings call to after the group

Re: [Patch v3 0/3] iommu: reduce spinlock contention on fast path

2019-12-10 Thread John Garry
On 06/12/2019 21:38, Cong Wang wrote: This patchset contains three small optimizations for the global spinlock contention in IOVA cache. Our memcache perf test shows this reduced its p999 latency down by 45% on AMD when IOMMU is enabled. Cong Wang (3): iommu: avoid unnecessary magazine

Re: [RESEND PATCH v9 2/4] uacce: add uacce driver

2019-12-10 Thread kbuild test robot
the system. BTW, we also suggest to use '--base' option to specify the base tree in git format-patch, please see https://stackoverflow.com/a/37406982] url: https://github.com/0day-ci/linux/commits/Zhangfei-Gao/Add-uacce-module-for-Accelerator/20191210-160210 base: https://git.kernel.org/pub/scm

Re: [PATCH] iommu/dma: Use a better type for dma_limit

2019-12-10 Thread Robin Murphy
On 10/12/2019 9:28 am, Stephan Gerhold wrote: On Mon, Dec 09, 2019 at 01:08:32PM +, Robin Murphy wrote: It makes little sense for dma_limit to be a dma_addr_t when we only use it to pass u64 arguments, and combine it with another u64 along the way. Just make it u64, and head off any

Re: [PATCH] iommu/dma: Use a better type for dma_limit

2019-12-10 Thread Stephan Gerhold
On Mon, Dec 09, 2019 at 01:08:32PM +, Robin Murphy wrote: > It makes little sense for dma_limit to be a dma_addr_t when we only use > it to pass u64 arguments, and combine it with another u64 along the way. > Just make it u64, and head off any possible size mismatches. > > Signed-off-by: