]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
.33 patch
authorGreg Kroah-Hartman <gregkh@suse.de>
Thu, 22 Apr 2010 16:29:32 +0000 (09:29 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 22 Apr 2010 16:29:32 +0000 (09:29 -0700)
queue-2.6.33/series
queue-2.6.33/x86-gart-disable-gart-explicitly-before-initialization.patch [new file with mode: 0644]

index 718b8cc2c2a3e62fe60c6b570e467191acd9955f..a9ff1bf8059d9ef22163ac2d0792ff198b0bf0a2 100644 (file)
@@ -135,3 +135,4 @@ sched-use-proper-type-in-sched_getaffinity.patch
 0007-KVM-fix-the-handling-of-dirty-bitmaps-to-avoid-overf.patch
 0008-KVM-Increase-NR_IOBUS_DEVS-limit-to-200.patch
 0009-KVM-x86-Fix-TSS-size-check-for-16-bit-tasks.patch
+x86-gart-disable-gart-explicitly-before-initialization.patch
diff --git a/queue-2.6.33/x86-gart-disable-gart-explicitly-before-initialization.patch b/queue-2.6.33/x86-gart-disable-gart-explicitly-before-initialization.patch
new file mode 100644 (file)
index 0000000..5775d29
--- /dev/null
@@ -0,0 +1,66 @@
+From 4b83873d3da0704987cb116833818ed96214ee29 Mon Sep 17 00:00:00 2001
+From: Joerg Roedel <joerg.roedel@amd.com>
+Date: Wed, 7 Apr 2010 12:57:35 +0200
+Subject: x86/gart: Disable GART explicitly before initialization
+
+From: Joerg Roedel <joerg.roedel@amd.com>
+
+commit 4b83873d3da0704987cb116833818ed96214ee29 upstream.
+
+If we boot into a crash-kernel the gart might still be
+enabled and its caches might be dirty. This can result in
+undefined behavior later. Fix it by explicitly disabling the
+gart hardware before initialization and flushing the caches
+after enablement.
+
+Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ arch/x86/kernel/aperture_64.c |   15 ++++++++++++++-
+ arch/x86/kernel/pci-gart_64.c |    3 +++
+ 2 files changed, 17 insertions(+), 1 deletion(-)
+
+--- a/arch/x86/kernel/aperture_64.c
++++ b/arch/x86/kernel/aperture_64.c
+@@ -394,6 +394,7 @@ void __init gart_iommu_hole_init(void)
+       for (i = 0; i < ARRAY_SIZE(bus_dev_ranges); i++) {
+               int bus;
+               int dev_base, dev_limit;
++              u32 ctl;
+               bus = bus_dev_ranges[i].bus;
+               dev_base = bus_dev_ranges[i].dev_base;
+@@ -407,7 +408,19 @@ void __init gart_iommu_hole_init(void)
+                       gart_iommu_aperture = 1;
+                       x86_init.iommu.iommu_init = gart_iommu_init;
+-                      aper_order = (read_pci_config(bus, slot, 3, AMD64_GARTAPERTURECTL) >> 1) & 7;
++                      ctl = read_pci_config(bus, slot, 3,
++                                            AMD64_GARTAPERTURECTL);
++
++                      /*
++                       * Before we do anything else disable the GART. It may
++                       * still be enabled if we boot into a crash-kernel here.
++                       * Reconfiguring the GART while it is enabled could have
++                       * unknown side-effects.
++                       */
++                      ctl &= ~GARTEN;
++                      write_pci_config(bus, slot, 3, AMD64_GARTAPERTURECTL, ctl);
++
++                      aper_order = (ctl >> 1) & 7;
+                       aper_size = (32 * 1024 * 1024) << aper_order;
+                       aper_base = read_pci_config(bus, slot, 3, AMD64_GARTAPERTUREBASE) & 0x7fff;
+                       aper_base <<= 25;
+--- a/arch/x86/kernel/pci-gart_64.c
++++ b/arch/x86/kernel/pci-gart_64.c
+@@ -564,6 +564,9 @@ static void enable_gart_translations(voi
+               enable_gart_translation(dev, __pa(agp_gatt_table));
+       }
++
++      /* Flush the GART-TLB to remove stale entries */
++      k8_flush_garts();
+ }
+ /*