Re: [Linux-4.19] ThinkPad T470 not booting with "intel_iommu=on"

2018-10-18 Thread Lu Baolu
Hi, On 10/18/18 2:52 PM, Sedat Dilek wrote: On Tue, Oct 16, 2018 at 8:37 AM Lu Baolu wrote: Hi Sedat, Sorry for late reply. Do you still have this issue with newer rc's (like 4.19-rc8)? I checked the dmesg log you attached there, it seems that the vt-d was not on actually. Here my kerne

Re: [PATCH v5 1/2] iommu/arm-smmu-v3: Poll for CMD_SYNC outside cmdq lock

2018-10-18 Thread Andrew Murray
On Wed, Oct 17, 2018 at 02:56:06PM +0100, Robin Murphy wrote: > Even without the MSI trick, we can still do a lot better than hogging > the entire queue while it drains. All we actually need to do for the > necessary guarantee of completion is wait for our particular command to > have been consumed

Re: [PATCH v5 2/2] iommu/arm-smmu-v3: Reunify arm_smmu_cmdq_issue_sync()

2018-10-18 Thread Andrew Murray
On Wed, Oct 17, 2018 at 02:56:07PM +0100, Robin Murphy wrote: > Now that both sync methods are more or less the same shape, we can save > some code and levels of indirection by rolling them up together again, > with just a couple of simple conditionals to discriminate the MSI and > queue-polling sp

Re: [Linux-4.19] ThinkPad T470 not booting with "intel_iommu=on"

2018-10-18 Thread Sedat Dilek
On Thu, Oct 18, 2018 at 9:06 AM Lu Baolu wrote: > > Hi, > > On 10/18/18 2:52 PM, Sedat Dilek wrote: > > On Tue, Oct 16, 2018 at 8:37 AM Lu Baolu wrote: > >> > >> Hi Sedat, > >> > >> Sorry for late reply. > >> > >> Do you still have this issue with newer rc's (like 4.19-rc8)? > >> > >> I checked t

Re: [PATCH v3 3/7] PCI: OF: Allow endpoints to bypass the iommu

2018-10-18 Thread Robin Murphy
On 17/10/18 16:14, Michael S. Tsirkin wrote: On Mon, Oct 15, 2018 at 08:46:41PM +0100, Jean-philippe Brucker wrote: [Replying with my personal address because we're having SMTP issues] On 15/10/2018 11:52, Michael S. Tsirkin wrote: On Fri, Oct 12, 2018 at 02:41:59PM -0500, Bjorn Helgaas wrote:

Re: [PATCH v5 1/2] iommu/arm-smmu-v3: Poll for CMD_SYNC outside cmdq lock

2018-10-18 Thread John Garry
On 17/10/2018 14:56, Robin Murphy wrote: Even without the MSI trick, we can still do a lot better than hogging the entire queue while it drains. All we actually need to do for the necessary guarantee of completion is wait for our particular command to have been consumed - as long as we keep track

[PATCH v2] iommu/mediatek: Constify iommu_ops

2018-10-18 Thread Yong Wu
From: Arvind Yadav iommu_ops are not supposed to change at runtime. Functions 'iommu_device_set_ops' and 'bus_set_iommu' working with const iommu_ops provided by . So mark the non-const structs as const. Signed-off-by: Arvind Yadav Signed-off-by: Yong Wu (Change the title to iommu/mediatek: xx

Re: [PATCH v5 2/2] iommu/arm-smmu-v3: Reunify arm_smmu_cmdq_issue_sync()

2018-10-18 Thread Robin Murphy
Hi John, On 17/10/18 15:38, John Garry wrote: On 17/10/2018 14:56, Robin Murphy wrote: Now that both sync methods are more or less the same shape, we can save some code and levels of indirection by rolling them up together again, with just a couple of simple conditionals to discriminate the MSI

Re: [PATCH v5 1/2] iommu/arm-smmu-v3: Poll for CMD_SYNC outside cmdq lock

2018-10-18 Thread Robin Murphy
On 18/10/18 11:55, John Garry wrote: [...] @@ -976,18 +1019,19 @@ static int __arm_smmu_cmdq_issue_sync(struct arm_smmu_device *smmu)  { u64 cmd[CMDQ_ENT_DWORDS]; unsigned long flags; -    bool wfe = !!(smmu->features & ARM_SMMU_FEAT_SEV); struct arm_smmu_cmdq_ent ent = { .opcode

Re: [PATCH v5 2/2] iommu/arm-smmu-v3: Reunify arm_smmu_cmdq_issue_sync()

2018-10-18 Thread John Garry
On 18/10/2018 12:18, Robin Murphy wrote: Hi John, On 17/10/18 15:38, John Garry wrote: On 17/10/2018 14:56, Robin Murphy wrote: Now that both sync methods are more or less the same shape, we can save some code and levels of indirection by rolling them up together again, with just a couple of s

Re: [PATCH v5 1/2] iommu/arm-smmu-v3: Poll for CMD_SYNC outside cmdq lock

2018-10-18 Thread John Garry
On 18/10/2018 12:19, Robin Murphy wrote: On 18/10/18 11:55, John Garry wrote: [...] @@ -976,18 +1019,19 @@ static int __arm_smmu_cmdq_issue_sync(struct arm_smmu_device *smmu) { u64 cmd[CMDQ_ENT_DWORDS]; unsigned long flags; -bool wfe = !!(smmu->features & ARM_SMMU_FEAT_SEV);

Re: [PATCH] x86: enable swiotlb for > 4GiG ram on 32-bit kernels

2018-10-18 Thread Christoph Hellwig
On Wed, Oct 17, 2018 at 01:41:49PM -0400, tedheadster wrote: > > What is the comparism? Is this on a non-aic7xxx kernel with and without > > the fix? > > Christoph, > I will try and do some strict before-and-after benchmarking of your > patch. It will take a few days because I am on travel. Thi

Re: [PATCH 2/4] iommu/arm-smmu: Workaround for Marvell Armada-AP806 SoC erratum #582743

2018-10-18 Thread Robin Murphy
On 16/10/18 09:25, Hanna Hawa wrote: Hi Robin, On 10/15/2018 04:00 PM, Robin Murphy wrote: Hi Hanna, On 15/10/18 13:00, han...@marvell.com wrote: From: Hanna Hawa Due to erratum #582743, the Marvell Armada-AP806 can't access 64bit to ARM SMMUv2 registers. This patch split the writeq/readq

Re: [PATCH 05/10] swiotlb: merge swiotlb_unmap_page and unmap_single

2018-10-18 Thread Robin Murphy
On 08/10/18 09:02, Christoph Hellwig wrote: Signed-off-by: Christoph Hellwig --- kernel/dma/swiotlb.c | 15 --- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c index 11dbcd80b4a6..15335f3a1bf3 100644 --- a/kernel/dma/swiot

Re: [PATCH 06/10] swiotlb: use swiotlb_map_page in swiotlb_map_sg_attrs

2018-10-18 Thread Robin Murphy
On 08/10/18 09:02, Christoph Hellwig wrote: No need to duplicate the code - map_sg is equivalent to map_page for each page in the scatterlist. Even better, this will also make map_sg actually fire the tracepoint (which I've certainly found handy in the past for debugging a mask cockup that le

Re: [PATCH 07/10] swiotlb: refactor swiotlb_map_page

2018-10-18 Thread Robin Murphy
On 08/10/18 09:02, Christoph Hellwig wrote: Remove the somewhat useless map_single function, and replace it with a swiotlb_bounce_page handler that handles everything related to actually bouncing a page. Signed-off-by: Christoph Hellwig --- kernel/dma/swiotlb.c | 77 +-

Re: [PATCH 3/4] dt-bindings: iommu/arm, smmu: add compatible string for Marvell

2018-10-18 Thread Rob Herring
On Mon, Oct 15, 2018 at 02:11:52PM +0100, Robin Murphy wrote: > On 15/10/18 13:00, han...@marvell.com wrote: > > From: Hanna Hawa > > > > Add specific compatible string for Marvell usage due errata of > > accessing 64bit registers of ARM SMMU, in AP806. > > > > AP806 SOC use the generic ARM-MMU5

Re: [PATCH 01/10] swiotlb: remove a pointless comment

2018-10-18 Thread Konrad Rzeszutek Wilk
On Mon, Oct 08, 2018 at 10:02:37AM +0200, Christoph Hellwig wrote: > This comments describes an aspect of the map_sg interface that isn't > even exploited by swiotlb. > > Signed-off-by: Christoph Hellwig Reviewed-by: Konrad Rzeszutek Wilk Thank you! > --- > kernel/dma/swiotlb.c | 6 -- > 1

Re: [PATCH 02/10] swiotlb: mark is_swiotlb_buffer static

2018-10-18 Thread Konrad Rzeszutek Wilk
On Mon, Oct 08, 2018 at 10:02:38AM +0200, Christoph Hellwig wrote: > Signed-off-by: Christoph Hellwig Reviewed-by: Konrad Rzeszutek Wilk Thank you! > --- > include/linux/swiotlb.h | 1 - > kernel/dma/swiotlb.c| 2 +- > 2 files changed, 1 insertion(+), 2 deletions(-) > > diff --git a/includ

Re: [PATCH 03/10] swiotlb: do not panic on mapping failures

2018-10-18 Thread Konrad Rzeszutek Wilk
On Mon, Oct 08, 2018 at 10:02:39AM +0200, Christoph Hellwig wrote: > All properly written drivers now have error handling in the > dma_map_single / dma_map_page callers. As swiotlb_tbl_map_single already > prints a useful warning when running out of swiotlb pool swace we can s/swace/space/ > als

Re: [PATCH 03/10] swiotlb: do not panic on mapping failures

2018-10-18 Thread Konrad Rzeszutek Wilk
On Thu, Oct 11, 2018 at 07:06:31PM +0100, Robin Murphy wrote: > On 08/10/18 09:02, Christoph Hellwig wrote: > > All properly written drivers now have error handling in the > > dma_map_single / dma_map_page callers. As swiotlb_tbl_map_single already > > prints a useful warning when running out of s

Re: [PATCH 04/10] swiotlb: remove the overflow buffer

2018-10-18 Thread Konrad Rzeszutek Wilk
On Mon, Oct 08, 2018 at 10:02:40AM +0200, Christoph Hellwig wrote: > Like all other dma mapping drivers just return an error code instead > of an actual memory buffer. The reason for the overflow buffer was > that at the time swiotlb was invented there was no way to check for > dma mapping errors,

Re: [PATCH 05/10] swiotlb: merge swiotlb_unmap_page and unmap_single

2018-10-18 Thread Konrad Rzeszutek Wilk
On Mon, Oct 08, 2018 at 10:02:41AM +0200, Christoph Hellwig wrote: > Signed-off-by: Christoph Hellwig Reviewed-by: Konrad Rzeszutek Wilk Thank you! > --- > kernel/dma/swiotlb.c | 15 --- > 1 file changed, 4 insertions(+), 11 deletions(-) > > diff --git a/kernel/dma/swiotlb.c b/kern

Re: [PATCH 06/10] swiotlb: use swiotlb_map_page in swiotlb_map_sg_attrs

2018-10-18 Thread Konrad Rzeszutek Wilk
On Mon, Oct 08, 2018 at 10:02:42AM +0200, Christoph Hellwig wrote: > No need to duplicate the code - map_sg is equivalent to map_page > for each page in the scatterlist. > > Signed-off-by: Christoph Hellwig Reviewed-by: Konrad Rzeszutek Wilk Thank you! > --- > kernel/dma/swiotlb.c | 34 +++

Re: [PATCH 07/10] swiotlb: refactor swiotlb_map_page

2018-10-18 Thread Konrad Rzeszutek Wilk
> > + if (!dma_capable(dev, dma_addr, size) || > > + swiotlb_force == SWIOTLB_FORCE) { > > + trace_swiotlb_bounced(dev, dma_addr, size, swiotlb_force); > > + dma_addr = swiotlb_bounce_page(dev, &phys, size, dir, attrs); > > + } > > FWIW I prefer the inverse condition

Re: [PATCH 08/10] swiotlb: don't dip into swiotlb pool for coherent allocations

2018-10-18 Thread Konrad Rzeszutek Wilk
On Mon, Oct 08, 2018 at 10:02:44AM +0200, Christoph Hellwig wrote: > All architectures that support swiotlb also have a zone that backs up > these less than full addressing allocations (usually ZONE_DMA32). > > Because of that it is rather pointless to fall back to the global swiotlb > buffer if t

Re: [PATCH 09/10] swiotlb: add support for non-coherent DMA

2018-10-18 Thread Konrad Rzeszutek Wilk
On Mon, Oct 08, 2018 at 10:02:45AM +0200, Christoph Hellwig wrote: > Handle architectures that are not cache coherent directly in the main > swiotlb code by calling arch_sync_dma_for_{device,cpu} in all the right > places from the various dma_map/unmap/sync methods when the device is > non-coherent

Re: [PATCH] x86: enable swiotlb for > 4GiG ram on 32-bit kernels

2018-10-18 Thread tedheadster
> But you said without the fix it doesn't work at all? Or is this > the same box, just with the aic7xxx controller disabled? > > In general the patch should only have two effects: > > - set a small amount of memory aside for bounce buffering > - switch the default dma_ops from dma_direct_ops to

Re: [PATCH] x86: enable swiotlb for > 4GiG ram on 32-bit kernels

2018-10-18 Thread Ingo Molnar
* tedheadster wrote: > > But you said without the fix it doesn't work at all? Or is this > > the same box, just with the aic7xxx controller disabled? > > > > In general the patch should only have two effects: > > > > - set a small amount of memory aside for bounce buffering > > - switch the

Re: [PATCH 03/10] swiotlb: do not panic on mapping failures

2018-10-18 Thread Christoph Hellwig
On Thu, Oct 18, 2018 at 08:17:14PM -0400, Konrad Rzeszutek Wilk wrote: > On Mon, Oct 08, 2018 at 10:02:39AM +0200, Christoph Hellwig wrote: > > All properly written drivers now have error handling in the > > dma_map_single / dma_map_page callers. As swiotlb_tbl_map_single already > > prints a usef

Re: [PATCH 07/10] swiotlb: refactor swiotlb_map_page

2018-10-18 Thread Christoph Hellwig
On Thu, Oct 18, 2018 at 08:37:15PM -0400, Konrad Rzeszutek Wilk wrote: > > > + if (!dma_capable(dev, dma_addr, size) || > > > + swiotlb_force == SWIOTLB_FORCE) { > > > + trace_swiotlb_bounced(dev, dma_addr, size, swiotlb_force); > > > + dma_addr = swiotlb_bounce_page(dev, &phys,