IOMMU Archive on lore.kernel.org
 help / color / Atom feed
From: Tom Murphy <murphyt7@tcd.ie>
To: iommu@lists.linux-foundation.org
Cc: David Woodhouse <dwmw2@infradead.org>,
	linux-kernel@vger.kernel.org, Tom Murphy <murphyt7@tcd.ie>
Subject: [PATCH V2 0/5] Convert the intel iommu driver to the dma-iommu api
Date: Thu,  3 Sep 2020 21:18:32 +0100
Message-ID: <20200903201839.7327-1-murphyt7@tcd.ie> (raw)

This patchset converts the intel iommu driver to the dma-iommu api.

While converting the driver I exposed a bug in the intel i915 driver which causes a huge amount of artifacts on the screen of my laptop. You can see a picture of it here:
https://github.com/pippy360/kernelPatches/blob/master/IMG_20191219_225922.jpg

This issue is in the i915 driver and is caused by the driver not respecting the return value of the dma_map_ops::map_sg function.

We talked about this in this microconference:
https://linuxplumbersconf.org/event/7/contributions/846/
and came to the conclusion that we should add an attribute to disable combining sg segments in the dma-iommu api (in the __finalise_sg function). This will work as a temporary fix and allow us to convert the intel iommu driver to the dma-iommu path while we wait for the i915 driver to be rewritten to respect the return value of map_sg. I haven't done this work yet and won't have time to do it. If someone else could take this on that would be great.

To allow my patch set to be tested I have added a patch (the "DO NOT MERGE..." patch) in this series to disable combining sg segments in the dma-iommu api which fixes the bug but it doesn't fix the actual problem.

As part of this patch series I copied the intel bounce buffer code to the dma-iommu path. The addition of the bounce buffer code took me by surprise. I did most of my development on this patch series before the bounce buffer code was added and my reimplementation in the dma-iommu path is very rushed and not properly tested but I’m running out of time to work on this patch set.

On top of that I also didn’t port over the intel tracing code from this commit:
https://github.com/torvalds/linux/commit/3b53034c268d550d9e8522e613a14ab53b8840d8#diff-6b3e7c4993f05e76331e463ab1fc87e1
So all the work in that commit is now wasted. The code will need to be removed and reimplemented in the dma-iommu path. I would like to take the time to do this but I really don’t have the time at the moment and I want to get these changes out before the iommu code changes any more.

Unfortunately I no longer have enough spare time to continue to work on/rebase this patch series. So this will most likely be the last patch series from me for the intel dma-iommu conversion.

Change-log:
v2:
-Rebase on top of the latest staging branch
-move the freelist parameter to iommu_iotlb_gather

Signed-off-by: Tom Murphy <murphyt7@tcd.ie>

Tom Murphy (5):
  iommu: Handle freelists when using deferred flushing in iommu drivers
  iommu: Add iommu_dma_free_cpu_cached_iovas function
  iommu: allow the dma-iommu api to use bounce buffers
  iommu/vt-d: Convert intel iommu driver to the iommu ops
  DO NOT MERGE: iommu: disable list appending in dma-iommu

 drivers/iommu/Kconfig       |   1 +
 drivers/iommu/dma-iommu.c   | 169 +++++---
 drivers/iommu/intel/iommu.c | 805 ++++--------------------------------
 drivers/iommu/iommu.c       |  10 +
 include/linux/dma-iommu.h   |   3 +
 include/linux/iommu.h       |   8 +
 6 files changed, 222 insertions(+), 774 deletions(-)

-- 
2.20.1

_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

             reply index

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-03 20:18 Tom Murphy [this message]
2020-09-03 20:18 ` [PATCH V2 1/5] iommu: Handle freelists when using deferred flushing in iommu drivers Tom Murphy
2020-09-03 20:18 ` [PATCH V2 2/5] iommu: Add iommu_dma_free_cpu_cached_iovas function Tom Murphy
2020-09-09  0:45   ` Lu Baolu
2020-09-09  7:05     ` Christoph Hellwig
2020-09-12  2:55       ` Lu Baolu
2020-09-03 20:18 ` [PATCH V2 3/5] iommu: allow the dma-iommu api to use bounce buffers Tom Murphy
2020-09-09  1:34   ` Lu Baolu
2020-09-03 20:18 ` [PATCH V2 4/5] iommu/vt-d: Convert intel iommu driver to the iommu ops Tom Murphy
2020-09-09  1:59   ` Lu Baolu
2020-09-03 20:18 ` [PATCH V2 5/5] DO NOT MERGE: iommu: disable list appending in dma-iommu Tom Murphy
2020-09-07  7:00   ` Christoph Hellwig
2020-09-07 20:18     ` Tom Murphy
2020-09-08  5:36       ` Christoph Hellwig
2020-09-08  5:55         ` Christoph Hellwig
2020-09-08  6:04           ` Lu Baolu
2020-09-08  6:23             ` Christoph Hellwig
2020-09-08  9:07               ` Lu Baolu
2020-09-09  1:43               ` Lu Baolu
2020-09-09  7:06                 ` Christoph Hellwig
2020-09-12  3:13                   ` Lu Baolu
2020-09-04 10:03 ` [PATCH V2 0/5] Convert the intel iommu driver to the dma-iommu api Joerg Roedel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200903201839.7327-1-murphyt7@tcd.ie \
    --to=murphyt7@tcd.ie \
    --cc=dwmw2@infradead.org \
    --cc=iommu@lists.linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

IOMMU Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-iommu/0 linux-iommu/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-iommu linux-iommu/ https://lore.kernel.org/linux-iommu \
		iommu@lists.linux-foundation.org
	public-inbox-index linux-iommu

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.linux-foundation.lists.iommu


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git