rpms/kernel/F-11 kernel.spec, 1.1602, 1.1603 linux-2.6-iommu-fixes.patch, 1.2, 1.3

Kyle McMartin kyle at fedoraproject.org
Tue May 12 17:43:58 UTC 2009


Author: kyle

Update of /cvs/pkgs/rpms/kernel/F-11
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv10254

Modified Files:
	kernel.spec linux-2.6-iommu-fixes.patch 
Log Message:
* Tue May 12 2009 Kyle McMartin <kyle at redhat.com> 2.6.29.3-141
- linux-2.6-iommu-fixes.patch: intel-iommu: PAE memory corruption fix
  fd18de50b9e7965f93d231e7390436fb8900c0e6 upstream. Also, re-cherry-pick
  patchset and fix up merge conflicts against 2.6.29.3.



Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-11/kernel.spec,v
retrieving revision 1.1602
retrieving revision 1.1603
diff -u -p -r1.1602 -r1.1603
--- kernel.spec	12 May 2009 14:20:48 -0000	1.1602
+++ kernel.spec	12 May 2009 17:43:27 -0000	1.1603
@@ -1970,6 +1970,11 @@ fi
 # and build.
 
 %changelog
+* Tue May 12 2009 Kyle McMartin <kyle at redhat.com> 2.6.29.3-141
+- linux-2.6-iommu-fixes.patch: intel-iommu: PAE memory corruption fix
+  fd18de50b9e7965f93d231e7390436fb8900c0e6 upstream. Also, re-cherry-pick
+  patchset and fix up merge conflicts against 2.6.29.3.
+
 * Tue May 12 2009 Kyle McMartin <kyle at redhat.com> 2.6.29.3-140
 - git-bluetooth-fixes.patch: fix build error in backport from previous
   commit.

linux-2.6-iommu-fixes.patch:

Index: linux-2.6-iommu-fixes.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-11/linux-2.6-iommu-fixes.patch,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -p -r1.2 -r1.3
--- linux-2.6-iommu-fixes.patch	9 May 2009 02:08:24 -0000	1.2
+++ linux-2.6-iommu-fixes.patch	12 May 2009 17:43:27 -0000	1.3
@@ -1,21 +1,31 @@
-commit c065567f392e05f0fda406369e1c8969c4411c68
-Author: David Woodhouse <David.Woodhouse at intel.com>
-Date:   Fri Apr 10 22:27:48 2009 -0700
+commit bbad20263a1aa62f406847a98706f4509d66062e
+Author: David Woodhouse <dwmw2 at infradead.org>
+Date:   Sun May 10 23:57:41 2009 +0100
 
-    intel-iommu: Avoid panic() for DRHD at address zero.
+    intel-iommu: PAE memory corruption fix
+    
+    PAGE_MASK is 0xFFFFF000 on i386 -- even with PAE.
+    
+    So it's not sufficient to ensure that you use phys_addr_t or uint64_t
+    everywhere you handle physical addresses -- you also have to avoid using
+    the construct 'addr & PAGE_MASK', because that will strip the high 32
+    bits of the address.
     
-    If the BIOS does something obviously stupid, like claiming that the
-    registers for the IOMMU are at physical address zero, then print a nasty
-    message and abort, rather than trying to set up the IOMMU and then later
-    panicking.
+    This patch avoids that problem by using PHYSICAL_PAGE_MASK instead of
+    PAGE_MASK where appropriate. It leaves '& PAGE_MASK' in a few instances
+    that don't matter -- where it's being used on the virtual bus addresses
+    we're dishing out, which are 32-bit anyway.
     
-    It's becoming more and more obvious that trusting this stuff to the BIOS
-    was a mistake.
+    Since PHYSICAL_PAGE_MASK is not present on other architectures, we have
+    to define it (to PAGE_MASK) if it's not already defined.
+    
+    Maybe it would be better just to fix PAGE_MASK for i386/PAE?
     
     Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
-    (cherry picked from commit e523b38e2f568af58baa13120a994cbf24e6dee0)
+    Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>
+    (cherry picked from commit fd18de50b9e7965f93d231e7390436fb8900c0e6)
 
-commit 1d748e6cec8936af4c7044bdb51593a3f3904239
+commit c405c91435e937ed05e7858913262295ac68047c
 Author: David Woodhouse <David.Woodhouse at intel.com>
 Date:   Mon Apr 6 13:30:01 2009 -0700
 
@@ -28,7 +38,7 @@ Date:   Mon Apr 6 13:30:01 2009 -0700
     Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
     (cherry picked from commit 4958c5dc7bcb2e42d985cd26aeafd8a7eca9ab1e)
 
-commit 3bf17fdaaadea04d4d82be5930dff93ec737aeed
+commit 0210ca0870810580f8d26b0b4b56497814fc4898
 Author: David Woodhouse <David.Woodhouse at intel.com>
 Date:   Sat Apr 4 00:39:25 2009 +0100
 
@@ -47,7 +57,7 @@ Date:   Sat Apr 4 00:39:25 2009 +0100
     Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
     (cherry picked from commit 924b6231edfaf1e764ffb4f97ea382bf4facff58)
 
-commit 948852c81654aa8572a2bac1d2dfb1abfcc76ab2
+commit f4e871ae555664b64f97ccf301bf189487530528
 Author: Linus Torvalds <torvalds at linux-foundation.org>
 Date:   Tue Apr 7 07:59:41 2009 -0700
 
@@ -78,7 +88,7 @@ Date:   Tue Apr 7 07:59:41 2009 -0700
     Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>
     (cherry picked from commit aeeae86859f4319de0a4946b44771d9926eeed54)
 
-commit 484abc37905056cc7b90a51311e6589bacd9ed65
+commit 698149762a0af0c54259f543b660168b903d4ae4
 Author: Fenghua Yu <fenghua.yu at intel.com>
 Date:   Fri Mar 27 14:22:42 2009 -0700
 
@@ -93,10 +103,11 @@ Date:   Fri Mar 27 14:22:42 2009 -0700
     Signed-off-by: Fenghua Yu <fenghua.yu at intel.com>
     Acked-by: Ingo Molnar <mingo at elte.hu>
     Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
+    (cherry picked from commit f59c7b69bcba31cd355ababe067202b9895d6102)
 
-commit 85e4b00c9d0378d7c19510d7bac8d5834b58edea
-Author: David Woodhouse <David.Woodhouse at intel.com>
-Date:   Fri Apr 10 15:15:05 2009 -0700
+commit adfd653bdf2cb37b90ab44fb571b746e08755c1e
+Author: Fenghua Yu <fenghua.yu at intel.com>
+Date:   Fri Mar 27 14:22:43 2009 -0700
 
     Intel IOMMU Suspend/Resume Support - Queued Invalidation
     
@@ -107,7 +118,7 @@ Date:   Fri Apr 10 15:15:05 2009 -0700
     Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
     (cherry picked from commit eb4a52bc660ea835482c582eaaf4893742cbd160)
 
-commit 28dde4ade0c005b78f0cd0bda03ed20fcdfc11ae
+commit 19eadfec5de05cdaec5f5dbc2002c19aa5217e91
 Author: David Woodhouse <David.Woodhouse at intel.com>
 Date:   Fri Apr 3 15:19:32 2009 +0100
 
@@ -117,7 +128,7 @@ Date:   Fri Apr 3 15:19:32 2009 +0100
     Acked-by: Ingo Molnar <mingo at elte.hu>
     (cherry picked from commit 8f912ba4d7cdaf7d31cf39fe5a9b7732308a256d)
 
-commit b35948e3225618ab7c1c7700eae0c9f4565f9199
+commit 7fe06af0d58ea3e0494a5a77758593ea8cb8d996
 Author: Suresh Siddha <suresh.b.siddha at intel.com>
 Date:   Mon Mar 16 17:04:57 2009 -0700
 
@@ -133,7 +144,7 @@ Date:   Mon Mar 16 17:04:57 2009 -0700
     Signed-off-by: H. Peter Anvin <hpa at linux.intel.com>
     (cherry picked from commit 1531a6a6b81a4e6f9eec9a5608758a6ea14b96e0)
 
-commit 26c3c4ad26414ea9f66c56a27e394fc7ae937231
+commit 2724d3b3375d93f5d87f98ac5f308649f9919945
 Author: Suresh Siddha <suresh.b.siddha at intel.com>
 Date:   Mon Mar 16 17:04:56 2009 -0700
 
@@ -147,7 +158,7 @@ Date:   Mon Mar 16 17:04:56 2009 -0700
     Signed-off-by: H. Peter Anvin <hpa at linux.intel.com>
     (cherry picked from commit eba67e5da6e971993b2899d2cdf459ce77d3dbc5)
 
-commit 1c2f1031da6024fee999d2b115e31b40ff449405
+commit f31131852631f599d670a842071c48299b691b29
 Author: Suresh Siddha <suresh.b.siddha at intel.com>
 Date:   Mon Mar 16 17:04:54 2009 -0700
 
@@ -162,8 +173,16 @@ Date:   Mon Mar 16 17:04:54 2009 -0700
     Signed-off-by: H. Peter Anvin <hpa at linux.intel.com>
     (cherry picked from commit 0ac2491f57af5644f88383d28809760902d6f4d7)
 
+ drivers/pci/dmar.c           |  311 ++++++++++++++++++++++++++++++++++-
+ drivers/pci/intel-iommu.c    |  376 +++++++++++++++++++++----------------------
+ drivers/pci/intr_remapping.c |   44 +++++
+ include/linux/compiler.h     |    4 
+ include/linux/dmar.h         |   10 +
+ include/linux/intel-iommu.h  |   12 +
+ 6 files changed, 552 insertions(+), 205 deletions(-)
+
 diff --git a/drivers/pci/dmar.c b/drivers/pci/dmar.c
-index 8a01120..e095037 100644
+index 8a01120..8734b14 100644
 --- a/drivers/pci/dmar.c
 +++ b/drivers/pci/dmar.c
 @@ -31,6 +31,8 @@
@@ -255,7 +274,7 @@ index 8a01120..e095037 100644
  	struct q_inval *qi;
  
  	if (!ecap_qis(iommu->ecap))
-@@ -802,19 +867,218 @@ int dmar_enable_qi(struct intel_iommu *iommu)
+@@ -802,19 +867,241 @@ int dmar_enable_qi(struct intel_iommu *iommu)
  
  	spin_lock_init(&qi->q_lock);
  
@@ -460,6 +479,29 @@ index 8a01120..e095037 100644
 +	return ret;
 +}
 +
++int __init enable_drhd_fault_handling(void)
++{
++	struct dmar_drhd_unit *drhd;
++
++	/*
++	 * Enable fault control interrupt.
++	 */
++	for_each_drhd_unit(drhd) {
++		int ret;
++		struct intel_iommu *iommu = drhd->iommu;
++		ret = dmar_set_interrupt(iommu);
++
++		if (ret) {
++			printk(KERN_ERR "DRHD %Lx: failed to enable fault, "
++			       " interrupt, ret %d\n",
++			       (unsigned long long)drhd->reg_base_addr, ret);
++			return -1;
++		}
++	}
++
++	return 0;
++}
++
 +/*
 + * Re-enable Queued Invalidation interface.
 + */
@@ -485,7 +527,7 @@ index 8a01120..e095037 100644
  	return 0;
  }
 diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c
-index 7e4f9e6..8e4ac13 100644
+index 7e4f9e6..5b681b7 100644
 --- a/drivers/pci/intel-iommu.c
 +++ b/drivers/pci/intel-iommu.c
 @@ -36,6 +36,7 @@
@@ -496,7 +538,18 @@ index 7e4f9e6..8e4ac13 100644
  #include <asm/cacheflush.h>
  #include <asm/iommu.h>
  #include "pci.h"
-@@ -1010,194 +1011,6 @@ static int iommu_disable_translation(struct intel_iommu *iommu)
+@@ -58,6 +59,10 @@
+ #define DMA_32BIT_PFN		IOVA_PFN(DMA_32BIT_MASK)
+ #define DMA_64BIT_PFN		IOVA_PFN(DMA_64BIT_MASK)
+ 
++#ifndef PHYSICAL_PAGE_MASK
++#define PHYSICAL_PAGE_MASK PAGE_MASK
++#endif
++
+ /* global iommu list, set NULL for ignored DMAR units */
+ static struct intel_iommu **g_iommus;
+ 
+@@ -1010,194 +1015,6 @@ static int iommu_disable_translation(struct intel_iommu *iommu)
  	return 0;
  }
  
@@ -691,7 +744,16 @@ index 7e4f9e6..8e4ac13 100644
  
  static int iommu_init_domains(struct intel_iommu *iommu)
  {
-@@ -2049,11 +1862,40 @@ static int __init init_dmars(void)
+@@ -1369,7 +1186,7 @@ static void dmar_init_reserved_ranges(void)
+ 			if (!r->flags || !(r->flags & IORESOURCE_MEM))
+ 				continue;
+ 			addr = r->start;
+-			addr &= PAGE_MASK;
++			addr &= PHYSICAL_PAGE_MASK;
+ 			size = r->end - addr;
+ 			size = PAGE_ALIGN(size);
+ 			iova = reserve_iova(&reserved_iova_list, IOVA_PFN(addr),
+@@ -2049,11 +1866,40 @@ static int __init init_dmars(void)
  		}
  	}
  
@@ -732,7 +794,28 @@ index 7e4f9e6..8e4ac13 100644
  		if (dmar_enable_qi(iommu)) {
  			/*
  			 * Queued Invalidate not enabled, use Register Based
-@@ -2713,6 +2555,150 @@ static void __init init_no_remapping_devices(void)
+@@ -2270,7 +2116,8 @@ static dma_addr_t __intel_map_single(struct device *hwdev, phys_addr_t paddr,
+ 	 * is not a big problem
+ 	 */
+ 	ret = domain_page_mapping(domain, start_paddr,
+-		((u64)paddr) & PAGE_MASK, size, prot);
++				  ((u64)paddr) & PHYSICAL_PAGE_MASK,
++				  size, prot);
+ 	if (ret)
+ 		goto error;
+ 
+@@ -2554,8 +2401,8 @@ int intel_map_sg(struct device *hwdev, struct scatterlist *sglist, int nelems,
+ 		addr = (void *)virt_to_phys(addr);
+ 		size = aligned_size((u64)addr, sg->length);
+ 		ret = domain_page_mapping(domain, start_addr + offset,
+-			((u64)addr) & PAGE_MASK,
+-			size, prot);
++					  ((u64)addr) & PHYSICAL_PAGE_MASK,
++					  size, prot);
+ 		if (ret) {
+ 			/*  clear the page */
+ 			dma_pte_clear_range(domain, start_addr,
+@@ -2713,6 +2560,150 @@ static void __init init_no_remapping_devices(void)
  	}
  }
  
@@ -883,7 +966,7 @@ index 7e4f9e6..8e4ac13 100644
  int __init intel_iommu_init(void)
  {
  	int ret = 0;
-@@ -2748,6 +2734,7 @@ int __init intel_iommu_init(void)
+@@ -2748,6 +2739,7 @@ int __init intel_iommu_init(void)
  	init_timer(&unmap_timer);
  	force_iommu = 1;
  	dma_ops = &intel_dma_ops;




More information about the scm-commits mailing list