All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Travis <travis@sgi.com>
To: David Woodhouse <dwmw2@infradead.org>,
	Chris Wright <chrisw@sous-sol.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Ingo Molnar <mingo@elte.hu>
Cc: Mike Habeck <habeck@sgi.com>, Dimitri Sivanich <sivanich@sgi.com>,
	Derek Fults <dfults@sgi.com>,
	Jesse Barnes <jbarnes@virtuousgeek.org>,
	stable@kernel.org, iommu@lists.linux-foundation.org,
	linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 7/7] Intel pci: Provide option to enable 64-bit IOMMU pass through mode
Date: Sat, 28 May 2011 13:15:08 -0500	[thread overview]
Message-ID: <20110528181502.896824782@gulag1.americas.sgi.com> (raw)
In-Reply-To: 20110528181501.896092225@gulag1.americas.sgi.com

[-- Attachment #1: indicate-iommu-fixed.patch --]
[-- Type: text/plain, Size: 3018 bytes --]

v2: Use kernel option to implement pass through mode based on this
feedback from David Woodhouse <dwmw2@infradead.org>:

	Alternatively, let your version check just be '>=2.6.40', and
	your backports to the archaeological trees can include a *new*
	kernel command line parameter like 'iommu=pt64' which unfixed
	kernels won't understand and will ignore. So your SCU will provide
	'iommu=pt' for 2.6.40 or newer, and 'iommu=pt64' for older
	kernels. Then at least your hack doesn't affect the *current*
	kernels, and will eventually be lost in the mists of time.

    Prior to these IOMMU patches, the pass through option could not
    be used because it would cause the kernel to panic in certain
    circumstances (primarily having devices with more than 32 bits of
    DMA addressing, but not enough to handle the system's address range).
    In addition, the "force double address cycle" was required to work
    around similar issues which causes a significant reduction in DMA
    performance.

    This patch provides an option to enable the 64bit pass through mode if
    the kernel has the capability of enabling that mode without panicing.
    It also disables "forcedac" unless that option follows the "pt64" option.

Signed-off-by: Mike Travis <travis@sgi.com>
Acked-by: Dimitri Sivanich <sivanich@sgi.com>
Cc: stable@kernel.org
---
 Documentation/kernel-parameters.txt |    8 +++++++-
 drivers/pci/intel-iommu.c           |    5 +++++
 2 files changed, 12 insertions(+), 1 deletion(-)

--- linux.orig/Documentation/kernel-parameters.txt
+++ linux/Documentation/kernel-parameters.txt
@@ -988,13 +988,19 @@ bytes respectively. Such letter suffixes
 			bypassed by not enabling DMAR with this option. In
 			this case, gfx device will use physical address for
 			DMA.
+		pt64 [Default Off]
+			Enable 64 bit pass through mode if the kernel has the
+			capability.  Also disables forcedac, unless that option
+			follows this option.
 		forcedac [x86_64]
 			With this option iommu will not optimize to look
 			for io virtual address below 32 bit forcing dual
 			address cycle on pci bus for cards supporting greater
 			than 32 bit addressing. The default is to look
 			for translation below 32 bit and if not available
-			then look in the higher range.
+			then look in the higher range.  Note that pt64 disables
+			this option, so this must follow that option to be
+			effective.
 		strict [Default Off]
 			With this option on every unmap_single operation will
 			result in a hardware IOTLB flush operation as opposed
--- linux.orig/drivers/pci/intel-iommu.c
+++ linux/drivers/pci/intel-iommu.c
@@ -419,6 +419,11 @@ static int __init intel_iommu_setup(char
 			printk(KERN_INFO
 				"Intel-IOMMU: disable batched IOTLB flush\n");
 			intel_iommu_strict = 1;
+		} else if (!strncmp(str, "pt64", 6)) {
+			pr_info("Intel-IOMMU: enable 64bit passthrough mode, "
+				"disable Forcing DAC for PCI devices\n");
+			iommu_pass_through = 1;
+			dmar_forcedac = 0;
 		}
 
 		str += strcspn(str, ",");

-- 

  parent reply	other threads:[~2011-05-28 18:16 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-28 18:15 [PATCH 0/7] Intel pci: Fix various problems with Intel IOMMU code Mike Travis
2011-05-28 18:15 ` [PATCH 1/7] Intel pci: Check for identity mapping candidate using system dma mask Mike Travis
2011-05-28 18:15 ` [PATCH 2/7] Intel pci: Speed up processing of the identity_mapping function Mike Travis
2011-05-28 18:15 ` [PATCH 3/7] Intel pci: Dont cache iova above 32bit Mike Travis
2011-05-28 18:15 ` [PATCH 4/7] Intel pci: Use coherent DMA mask when requested Mike Travis
2011-05-28 18:15 ` [PATCH 5/7] Intel pci: Remove Host Bridge devices from identity mapping Mike Travis
2011-05-28 18:15 ` [PATCH 6/7] Intel pci: Add domain check in domain_remove_one_dev_info Mike Travis
2011-05-28 18:15 ` Mike Travis [this message]
2011-05-29  0:12 ` [PATCH 0/7] Intel pci: Fix various problems with Intel IOMMU code David Woodhouse
2011-05-30 20:57   ` Mike Travis
2011-06-03 14:03   ` David Woodhouse

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=20110528181502.896824782@gulag1.americas.sgi.com \
    --to=travis@sgi.com \
    --cc=akpm@linux-foundation.org \
    --cc=chrisw@sous-sol.org \
    --cc=dfults@sgi.com \
    --cc=dwmw2@infradead.org \
    --cc=habeck@sgi.com \
    --cc=iommu@lists.linux-foundation.org \
    --cc=jbarnes@virtuousgeek.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=sivanich@sgi.com \
    --cc=stable@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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.