[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-id: <200706221219.16243.yinghai.lu@sun.com>
Date: Fri, 22 Jun 2007 12:19:15 -0700
From: Yinghai Lu <Yinghai.Lu@....COM>
To: Andi Kleen <ak@...e.de>, Andrew Morton <akpm@...ux-foundation.org>,
"Eric W. Biederman" <ebiederm@...ssion.com>,
Vivek Goyal <vgoyal@...ibm.com>
Cc: Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: [PATCH] x86-64: disable the GART before allocate aperture
[PATCH] x86-64: disable the GART before allocate aperture
For K8 system: 4G RAM with memory hole remapping enabled, or more than 4G RAM
installed. when mem is allocated for GART, it will do the memset for clear.
and for kexec case, the first kernel already enable that, the memset in second
kernel will cause the system restart. So disable that at first before we try to
allocate mem for it.
Signed-off-by: Yinghai Lu <yinghai.lu@....com>
diff --git a/arch/x86_64/kernel/aperture.c b/arch/x86_64/kernel/aperture.c
index a3d450d..7a1b072 100644
--- a/arch/x86_64/kernel/aperture.c
+++ b/arch/x86_64/kernel/aperture.c
@@ -270,6 +270,19 @@ void __init iommu_hole_init(void)
printk("This costs you %d MB of RAM\n",
32 << fallback_aper_order);
+ /*
+ * disable it in case it is enabled before, esp for kexec/kdump,
+ * previous kernel already enable that. otherwise memset called
+ * by allocate_aperture/__alloc_bootmem_nopanic cause restart.
+ */
+ for (num = 24; num < 32; num++) {
+ if (!early_is_k8_nb(read_pci_config(0, num, 3, 0x00)))
+ continue;
+
+ write_pci_config(0, num, 3, 0x90, 0);
+ write_pci_config(0, num, 3, 0x94, 0);
+ }
+
aper_order = fallback_aper_order;
aper_alloc = allocate_aperture();
if (!aper_alloc) {
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists