linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-next: manual merge of the dwmw2-iommu tree with the x86 tree
@ 2009-04-30  3:12 Stephen Rothwell
  2009-04-30 22:54 ` [PATCH] Fix for "undefined iommu_pass_through" compiling error Fenghua Yu
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Rothwell @ 2009-04-30  3:12 UTC (permalink / raw)
  To: David Woodhouse
  Cc: linux-next, Fenghua Yu, Weidong Han, Thomas Gleixner,
	Ingo Molnar, H. Peter Anvin

Hi David,

Today's linux-next merge of the dwmw2-iommu tree got a conflict in
drivers/pci/intel-iommu.c between commit
937582382c71b75b29fbb92615629494e1a05ac0 ("x86, intr-remap: enable
interrupt remapping early") from the x86 tree and commit
4ed0d3e6c64cfd9ba4ceb2099b10d1cf8ece4320 ("Intel IOMMU Pass Through
Support") from the dwmw2-iommu tree.

Just context changes.  I fixed it up (see below) and can carry the fix as
necessary.
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --cc drivers/pci/intel-iommu.c
index 9ce8f07,1312182..0000000
--- a/drivers/pci/intel-iommu.c
+++ b/drivers/pci/intel-iommu.c
@@@ -1968,30 -2025,23 +2025,15 @@@ static int __init init_dmars(void
  		}
  	}
  
 -#ifdef CONFIG_INTR_REMAP
 -	if (!intr_remapping_enabled) {
 -		ret = enable_intr_remapping(0);
 -		if (ret)
 -			printk(KERN_ERR
 -			       "IOMMU: enable interrupt remapping failed\n");
 -	}
 -#endif
  	/*
- 	 * For each rmrr
- 	 *   for each dev attached to rmrr
- 	 *   do
- 	 *     locate drhd for dev, alloc domain for dev
- 	 *     allocate free domain
- 	 *     allocate page table entries for rmrr
- 	 *     if context not allocated for bus
- 	 *           allocate and init context
- 	 *           set present in root table for this bus
- 	 *     init context with domain, translation etc
- 	 *    endfor
- 	 * endfor
+ 	 * If pass through is set and enabled, context entries of all pci
+ 	 * devices are intialized by pass through translation type.
  	 */
- 	for_each_rmrr_units(rmrr) {
- 		for (i = 0; i < rmrr->devices_cnt; i++) {
- 			pdev = rmrr->devices[i];
- 			/* some BIOS lists non-exist devices in DMAR table */
- 			if (!pdev)
- 				continue;
- 			ret = iommu_prepare_rmrr_dev(rmrr, pdev);
- 			if (ret)
- 				printk(KERN_ERR
- 				 "IOMMU: mapping reserved region failed\n");
+ 	if (iommu_pass_through) {
+ 		ret = init_context_pass_through();
+ 		if (ret) {
+ 			printk(KERN_ERR "IOMMU: Pass through init failed.\n");
+ 			iommu_pass_through = 0;
  		}
  	}
  

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] Fix for "undefined iommu_pass_through" compiling error
  2009-04-30  3:12 linux-next: manual merge of the dwmw2-iommu tree with the x86 tree Stephen Rothwell
@ 2009-04-30 22:54 ` Fenghua Yu
  0 siblings, 0 replies; 3+ messages in thread
From: Fenghua Yu @ 2009-04-30 22:54 UTC (permalink / raw)
  To: David Woodhouse, Stephen Rothwell, Ingo Molnar, H. Peter Anvin,
	Tony Luck
  Cc: linux-next, iommu

When CONFIG_DMAR is off, linux-next or iomm-2.6.git kernel build complains
"undefined iommu_pass_through" error.

This patch moves iommu_pass_through beyond CONFIG_DMAR and fixes this issue.

Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>
Acked-by: Tony Luck <tony.luck@intel.com>

---

 arch/ia64/kernel/dma-mapping.c |    2 ++
 arch/x86/kernel/pci-dma.c      |    2 ++
 drivers/pci/intel-iommu.c      |    1 -
 3 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/ia64/kernel/dma-mapping.c b/arch/ia64/kernel/dma-mapping.c
index 086a2ae..336ccdc 100644
--- a/arch/ia64/kernel/dma-mapping.c
+++ b/arch/ia64/kernel/dma-mapping.c
@@ -3,6 +3,8 @@
 /* Set this to 1 if there is a HW IOMMU in the system */
 int iommu_detected __read_mostly;
 
+int iommu_pass_through;
+
 struct dma_map_ops *dma_ops;
 EXPORT_SYMBOL(dma_ops);
 
diff --git a/arch/x86/kernel/pci-dma.c b/arch/x86/kernel/pci-dma.c
index 8cad0d8..14fddef 100644
--- a/arch/x86/kernel/pci-dma.c
+++ b/arch/x86/kernel/pci-dma.c
@@ -32,6 +32,8 @@ int no_iommu __read_mostly;
 /* Set this to 1 if there is a HW IOMMU in the system */
 int iommu_detected __read_mostly = 0;
 
+int iommu_pass_through;
+
 dma_addr_t bad_dma_address __read_mostly = 0;
 EXPORT_SYMBOL(bad_dma_address);
 
diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c
index 1312182..d3edd6a 100644
--- a/drivers/pci/intel-iommu.c
+++ b/drivers/pci/intel-iommu.c
@@ -288,7 +288,6 @@ int dmar_disabled = 1;
 static int __initdata dmar_map_gfx = 1;
 static int dmar_forcedac;
 static int intel_iommu_strict;
-int iommu_pass_through;
 
 #define DUMMY_DEVICE_DOMAIN_INFO ((struct device_domain_info *)(-1))
 static DEFINE_SPINLOCK(device_domain_lock);

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* linux-next: manual merge of the dwmw2-iommu tree with the x86 tree
@ 2009-05-11  4:46 Stephen Rothwell
  0 siblings, 0 replies; 3+ messages in thread
From: Stephen Rothwell @ 2009-05-11  4:46 UTC (permalink / raw)
  To: David Woodhouse
  Cc: linux-next, Weidong Han, Thomas Gleixner, Ingo Molnar, H. Peter Anvin

[-- Attachment #1: Type: text/plain, Size: 620 bytes --]

Hi David,

Today's linux-next merge of the dwmw2-iommu tree got a conflict in
drivers/pci/intr_remapping.c between commit
937582382c71b75b29fbb92615629494e1a05ac0 ("x86, intr-remap: enable
interrupt remapping early") from the x86 tree and commit
c416daa98a584596df21ee2c26fac6579ee58f57 ("intel-iommu: Tidy up
iommu->gcmd handling") from the dwmw2-iommu tree.

The former removes the code that the latter is modifying, so I just
removed the code ("if (mode == 0) { ... }" in iommu_set_intr_remapping).
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-05-11  4:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-30  3:12 linux-next: manual merge of the dwmw2-iommu tree with the x86 tree Stephen Rothwell
2009-04-30 22:54 ` [PATCH] Fix for "undefined iommu_pass_through" compiling error Fenghua Yu
2009-05-11  4:46 linux-next: manual merge of the dwmw2-iommu tree with the x86 tree Stephen Rothwell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).