Re: [PATCH v4 0/6] PCI: Support multiple DMA aliases

2016-04-11 Thread Bjorn Helgaas
On Wed, Feb 24, 2016 at 01:43:32PM -0600, Bjorn Helgaas wrote: > This is a revision of Jacek's v3 posting: > http://lkml.kernel.org/r/1454152012-46337-1-git-send-email-jacek.lawrynow...@intel.com > > The changes from v3 are: > > - Split into smaller patches for reviewability > - Move printk w

Re: [PATCH 7/7] iommu: introduce per-cpu caching to iova allocation

2016-04-11 Thread Benjamin Serebrin via iommu
On Mon, Dec 28, 2015 at 8:17 AM, Adam Morrison wrote: > From: Omer Peleg > > This patch introduces global and per-CPU caches of IOVAs, so that > CPUs can usually allocate IOVAs without taking the rbtree spinlock > to do so. The caching is based on magazines, as described in "Magazines > and Vmem

Re: [PATCH 6/7] iommu: change intel-iommu to use IOVA frame numbers

2016-04-11 Thread Benjamin Serebrin via iommu
Reviewed-by: Ben Serebrin Looks good. On Mon, Dec 28, 2015 at 8:17 AM, Adam Morrison wrote: > From: Omer Peleg > > Make intel-iommu map/unmap/invalidate work with IOVA pfns instead of > pointers to "struct iova". This avoids using the iova struct from the IOVA > red-black tree and the resultin

Re: [PATCH 5/7] iommu: avoid dev iotlb logic in intel-iommu for domains with no dev iotlbs

2016-04-11 Thread Benjamin Serebrin via iommu
Reviewed-by: Ben Serebrin Looks good! On Mon, Dec 28, 2015 at 8:17 AM, Adam Morrison wrote: > From: Omer Peleg > > This patch avoids taking the device_domain_lock in iommu_flush_dev_iotlb() > for domains with no dev iotlb devices. > > Signed-off-by: Omer Peleg > [m...@cs.technion.ac.il: rebas

Re: [PATCH 4/7] iommu: only unmap mapped entries

2016-04-11 Thread Benjamin Serebrin via iommu
(From Adam's slightly newer patchset sent via email) @@ -3542,6 +3543,7 @@ static void flush_unmaps(struct deferred_flush_data *flush_data) struct deferred_flush_entry *entry = &flush_table->entries[j]; struct iova *iova = entry->iova; + unsigned long nrpages = entry->nrpages; Is this alway

Re: [PATCH 3/7] iommu: correct flush_unmaps pfn usage

2016-04-11 Thread Benjamin Serebrin via iommu
Reviewed-by: Ben Serebrin Looks good. On Mon, Dec 28, 2015 at 8:16 AM, Adam Morrison wrote: > From: Omer Peleg > > Change flush_unmaps() to correctly pass iommu_flush_iotlb_psi() > dma addresses. (Intel mm and dma have the same size for pages > at the moment, but this usage improves consisten

Re: [PATCH 2/7] iommu: per-cpu deferred invalidation queues

2016-04-11 Thread Benjamin Serebrin via iommu
Reviewed-by: Ben Serebrin Commit message nit: s/defererred/deferred/ intel-iommu.c Line 3615: I'd suggest making the 10ms into a #defined constant. On Mon, Dec 28, 2015 at 8:16 AM, Adam Morrison wrote: > From: Omer Peleg > > The IOMMU's IOTLB invalidation is a costly process. When iommu mode

Re: [PATCH 1/7] iommu: refactoring of deferred flush entries

2016-04-11 Thread Benjamin Serebrin via iommu
Reviewed-by: sereb...@google.com Looks good! On Mon, Dec 28, 2015 at 8:15 AM, Adam Morrison wrote: > From: Omer Peleg > > Currently, deferred flushes' info is striped between several lists in > the flush tables. Instead, move all information about a specific flush > to a single entry in this ta

Re: Can't boot new 4.4 kernel with IOMMU enabled

2016-04-11 Thread Joerg Roedel
On Mon, Apr 11, 2016 at 10:59:48AM -0400, Mark Hounschell wrote: > Yes this patch fixes my problem. Awesome, thanks for testing. I'll send it upstream soon and then it should hit the various stable-kernels. Joerg ___ iommu mailing list iommu@l

Re: Can't boot new 4.4 kernel with IOMMU enabled

2016-04-11 Thread Mark Hounschell
On 04/11/2016 09:54 AM, Joerg Roedel wrote: Hi Mark, On Fri, Mar 18, 2016 at 01:24:27PM -0400, Mark Hounschell wrote: Should I submit a kernel bug report on this? I just fixed a regression in v4.4. Can you please try the attached patch and report if it fixes your problem too? The patch is aga

Re: [patch] iommu/amd: Signedness bug in acpihid_device_group()

2016-04-11 Thread Joerg Roedel
On Mon, Apr 11, 2016 at 10:14:46AM +0300, Dan Carpenter wrote: > "devid" needs to be signed for the error handling to work. > > Fixes:b097d11a0fa3f ('iommu/amd: Manage iommu_group for ACPI HID devices') > Signed-off-by: Dan Carpenter Applied, thanks.

Re: AMD-Vi regression with PCIe/PCI bridges in 4.4

2016-04-11 Thread Joerg Roedel
On Fri, Apr 08, 2016 at 10:17:03PM +0200, Tomasz Golinski wrote: > >> > Can you > >> > guys please test if the attached patch fixes the issues for you as it > >> > did for me? > > Tested, works as expected. Thanks. Attaching dmesg from patched kernel > in case you need it. Thanks for verifying th

Re: Can't boot new 4.4 kernel with IOMMU enabled

2016-04-11 Thread Joerg Roedel
Hi Mark, On Fri, Mar 18, 2016 at 01:24:27PM -0400, Mark Hounschell wrote: > Should I submit a kernel bug report on this? I just fixed a regression in v4.4. Can you please try the attached patch and report if it fixes your problem too? The patch is against v4.6-rc2. Thanks, Joerg >From

Re: [RFT v2] iommu/amd: use subsys_initcall() on amdv2 iommu

2016-04-11 Thread Christian König
Am 11.04.2016 um 15:39 schrieb Oded Gabbay: On Mon, Apr 11, 2016 at 4:28 PM, Christian König wrote: Am 09.04.2016 um 02:25 schrieb Luis R. Rodriguez: On Tue, Mar 29, 2016 at 10:41 AM, Luis R. Rodriguez wrote: We need to ensure amd iommu v2 initializes before driver uses such as drivers/gpu/d

Re: [PATCH V2 1/5] iommu/msm: Add DT adaptation

2016-04-11 Thread Rob Herring
On Wed, Apr 06, 2016 at 07:59:31PM +0530, Sricharan R wrote: > The driver currently works based on platform data. Remove this > and add support for DT. A single master can have multiple ports > connected to more than one iommu. > > master > | >

Re: [RFT v2] iommu/amd: use subsys_initcall() on amdv2 iommu

2016-04-11 Thread Oded Gabbay
On Mon, Apr 11, 2016 at 4:28 PM, Christian König wrote: > > Am 09.04.2016 um 02:25 schrieb Luis R. Rodriguez: >> >> On Tue, Mar 29, 2016 at 10:41 AM, Luis R. Rodriguez >> wrote: >>> >>> We need to ensure amd iommu v2 initializes before >>> driver uses such as drivers/gpu/drm/amd/amdkfd/kfd_modul

Re: [RFT v2] iommu/amd: use subsys_initcall() on amdv2 iommu

2016-04-11 Thread Christian König
Am 09.04.2016 um 02:25 schrieb Luis R. Rodriguez: On Tue, Mar 29, 2016 at 10:41 AM, Luis R. Rodriguez wrote: We need to ensure amd iommu v2 initializes before driver uses such as drivers/gpu/drm/amd/amdkfd/kfd_module.c, to do this make its init routine a subsys_initcall() which ensures its load

[PATCH RESEND] iommu/dma: Implement scatterlist segment merging

2016-04-11 Thread Robin Murphy
Stop wasting IOVA space by over-aligning scatterlist segments for a theoretical worst-case segment boundary mask, and instead take the real limits into account to merge consecutive segments wherever appropriate, so our callers can benefit from getting back nicely simplified lists. This also repres

Re: [PATCH v2 1/2] dma/iommu: Add pgsize_bitmap confirmation in __iommu_dma_alloc_pages

2016-04-11 Thread Yong Wu
On Fri, 2016-04-08 at 10:34 -0700, Doug Anderson wrote: > Hi, > > On Fri, Apr 8, 2016 at 10:30 AM, Will Deacon wrote: > >> > Am I barking up the wrong tree? > >> > >> I don't think min_order can be negative. Certainly we could enter the > >> loop with order == 0 and min_order == 0, though. > > >

RE: [patch] iommu/amd: Signedness bug in acpihid_device_group()

2016-04-11 Thread Wan, Vincent
> From: Dan Carpenter [mailto:dan.carpen...@oracle.com] > Sent: Monday, April 11, 2016 3:15 PM > To: Joerg Roedel; Wan, Vincent > Cc: iommu@lists.linux-foundation.org; linux-ker...@vger.kernel.org; kernel- > janit...@vger.kernel.org > Subject: [patch] iommu/amd: Signedness bug in acpihid_device_gro

[patch] iommu/amd: Signedness bug in acpihid_device_group()

2016-04-11 Thread Dan Carpenter
"devid" needs to be signed for the error handling to work. Fixes:b097d11a0fa3f ('iommu/amd: Manage iommu_group for ACPI HID devices') Signed-off-by: Dan Carpenter diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c index c430c10..12f7779 100644 --- a/drivers/iommu/amd_iommu.c +++