Re: [PATCH 0/3] SMMUv3 CMD_SYNC optimisation

2017-08-24 Thread Nate Watterson
Hi Robin, On 8/18/2017 1:33 PM, Robin Murphy wrote: Hi all, Waiting for the command queue to drain for CMD_SYNC completion is likely a contention hotspot on high-core-count systems. If the SMMU is coherent and supports MSIs, though, we can use this cool feature (as suggested by the

Re: [PATCH 13/13] remoteproc: Use sychronized interface of the IOMMU-API

2017-08-24 Thread Bjorn Andersson
On Thu 17 Aug 05:56 PDT 2017, Joerg Roedel wrote: > From: Joerg Roedel > > The map and unmap functions of the IOMMU-API changed their > semantics: They do no longer guarantee that the hardware > TLBs are synchronized with the page-table updates they made. > > To make

Re: [PATCH v2 4/4] iommu: Prevent VMD child devices from being remapping targets

2017-08-24 Thread Bjorn Helgaas
On Fri, Aug 18, 2017 at 11:04:33AM -0500, Bjorn Helgaas wrote: > [+cc Robin] > > This series looks fine to me as far as PCI is concerned, and I'd be > happy to take it via my tree given an ack from David for this IOMMU > piece. Alternatively, you can add my > > Acked-by: Bjorn Helgaas

Re: [PATCH v6 3/3] iommu/arm-smmu-v3:Enable ACPI based HiSilicon erratum 161010801

2017-08-24 Thread John Garry
On 24/08/2017 15:35, Will Deacon wrote: > >>OK, seems reasonable. > >> > >>We would consider blacklisting the device, where/how to do is the question. > >> > >>So the errata is in the GICv3 ITS/PCI host controller, and we just use the > >>in-between SMMU (driver) to provide the workaround. So my

Re: [PATCH v6 3/3] iommu/arm-smmu-v3:Enable ACPI based HiSilicon erratum 161010801

2017-08-24 Thread Will Deacon
On Wed, Aug 23, 2017 at 05:55:52PM +0100, John Garry wrote: > On 23/08/2017 17:43, Will Deacon wrote: > >On Wed, Aug 23, 2017 at 03:29:46PM +0100, John Garry wrote: > >>On 23/08/2017 14:24, Will Deacon wrote: > >>>On Wed, Aug 23, 2017 at 02:17:24PM +0100, John Garry wrote: > >>>Signed-off-by:

[PATCH v2] iommu/amd: Check if domain is NULL in get_domain() and return -EBUSY

2017-08-24 Thread Baoquan He
In get_domain(), 'domain' could be NULL before it's passed to dma_ops_domain() to dereference. And the current code calling get_domain() can't deal with the returned 'domain' well if its value is NULL. So before dma_ops_domain() calling, check if 'domain' is NULL, If yes just return

Re: [PATCH 4/4] iommu/pamu: Add support for generic iommu-device

2017-08-24 Thread Joerg Roedel
Hi Michael, On Thu, Aug 24, 2017 at 12:04:13PM +1000, Michael Ellerman wrote: > Joerg Roedel writes: > > Can you please try the attached patch? > > Thanks, that works. Great, thanks for testing it. I'll queue it on-top of the original patch-set. > > It boots happily, much

Re: [PATCH] iommu/amd: Check if domain is NULL before dereference it

2017-08-24 Thread Baoquan He
On 08/24/17 at 03:53pm, Dan Carpenter wrote: > On Thu, Aug 24, 2017 at 08:47:33PM +0800, Baoquan He wrote: > > On 08/24/17 at 03:32pm, Dan Carpenter wrote: > > > Take a look at this code for example. But all the places which call > > > get_domain() are the same: > > > > > >

Re: [PATCH] iommu/amd: Check if domain is NULL before dereference it

2017-08-24 Thread Dan Carpenter
On Thu, Aug 24, 2017 at 08:47:33PM +0800, Baoquan He wrote: > On 08/24/17 at 03:32pm, Dan Carpenter wrote: > > Take a look at this code for example. But all the places which call > > get_domain() are the same: > > > > drivers/iommu/amd_iommu.c > > 2648 page = virt_to_page(virt_addr);

Re: [PATCH] iommu/amd: Check if domain is NULL before dereference it

2017-08-24 Thread Baoquan He
On 08/24/17 at 03:32pm, Dan Carpenter wrote: > Take a look at this code for example. But all the places which call > get_domain() are the same: > > drivers/iommu/amd_iommu.c > 2648 page = virt_to_page(virt_addr); > 2649 size = PAGE_ALIGN(size); > 2650 > 2651

Re: [PATCH] iommu/amd: Check if domain is NULL before dereference it

2017-08-24 Thread Dan Carpenter
Take a look at this code for example. But all the places which call get_domain() are the same: drivers/iommu/amd_iommu.c 2648 page = virt_to_page(virt_addr); 2649 size = PAGE_ALIGN(size); 2650 2651 domain = get_domain(dev);

Re: [PATCH] iommu/amd: Check if domain is NULL before dereference it

2017-08-24 Thread Baoquan He
On 08/24/17 at 03:11pm, Dan Carpenter wrote: > On Thu, Aug 24, 2017 at 07:56:47PM +0800, Baoquan He wrote: > > In get_domain(), 'domain' could still be NULL before it's passed to > > dma_ops_domain() to dereference. For safety, check if 'domain' is > > NULL before passing to dma_ops_domain(). > >

Re: [PATCH] iommu/amd: Check if domain is NULL before dereference it

2017-08-24 Thread Dan Carpenter
On Thu, Aug 24, 2017 at 07:56:47PM +0800, Baoquan He wrote: > In get_domain(), 'domain' could still be NULL before it's passed to > dma_ops_domain() to dereference. For safety, check if 'domain' is > NULL before passing to dma_ops_domain(). > > Reported-by: Dan Carpenter

[PATCH] iommu/amd: Check if domain is NULL before dereference it

2017-08-24 Thread Baoquan He
In get_domain(), 'domain' could still be NULL before it's passed to dma_ops_domain() to dereference. For safety, check if 'domain' is NULL before passing to dma_ops_domain(). Reported-by: Dan Carpenter Signed-off-by: Baoquan He ---

Re: [bug report] iommu/amd: Use is_attach_deferred call-back

2017-08-24 Thread Baoquan He
Hi Dan, On 08/24/17 at 02:04pm, Dan Carpenter wrote: > Hello Baoquan He, > > This is a semi-automatic email about new static checker warnings. > > The patch df3f7a6e8e85: "iommu/amd: Use is_attach_deferred call-back" > from Aug 9, 2017, leads to the following Smatch complaint: > >

[bug report] iommu/amd: Use is_attach_deferred call-back

2017-08-24 Thread Dan Carpenter
Hello Baoquan He, This is a semi-automatic email about new static checker warnings. The patch df3f7a6e8e85: "iommu/amd: Use is_attach_deferred call-back" from Aug 9, 2017, leads to the following Smatch complaint: drivers/iommu/amd_iommu.c:2265 get_domain() error: we previously assumed

[PATCH v2 1/2] iommu/mediatek: Fix a build fail of m4u_type

2017-08-24 Thread Yong Wu
The commit ("iommu/mediatek: Enlarge the validate PA range for 4GB mode") introduce the following build error: drivers/iommu/mtk_iommu.c: In function 'mtk_iommu_hw_init': >> drivers/iommu/mtk_iommu.c:536:30: error: 'const struct mtk_iommu_data' has no member named 'm4u_type'; did you mean

[PATCH v2 2/2] iommu/mediatek: Fix a build warning of BIT(32) in ARM

2017-08-24 Thread Yong Wu
The commit ("iommu/mediatek: Enlarge the validate PA range for 4GB mode") introduce the following build warning while ARCH=arm: drivers/iommu/mtk_iommu.c: In function 'mtk_iommu_iova_to_phys': include/linux/bitops.h:6:24: warning: left shift count >= width of type [-Wshift-count-overflow]

Re: [RFC v2 2/4] iommu/arm-smmu-v3: Add tlbi_on_map option

2017-08-24 Thread Auger Eric
Hi Will, On 23/08/2017 18:42, Will Deacon wrote: > Hi Eric, > > On Wed, Aug 23, 2017 at 02:36:53PM +0200, Auger Eric wrote: >> On 23/08/2017 12:25, Will Deacon wrote: >>> On Tue, Aug 22, 2017 at 10:09:15PM +0300, Michael S. Tsirkin wrote: On Fri, Aug 18, 2017 at 05:49:42AM +0300, Michael S.

Re: [PATCH v2 7/8] iommu/mediatek: Enlarge the validate PA range for 4GB mode

2017-08-24 Thread kbuild test robot
-SUPPORT/20170824-074750 base: https://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git next config: arm-allmodconfig (attached as .config) compiler: arm-linux-gnueabi-gcc (Debian 6.1.1-9) 6.1.1 20160705 reproduce: wget https://raw.githubusercontent.com/01org/lkp-tests/master/sbin