From: Joerg Roedel <joerg.roedel@amd.com>
To: Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
Thomas Gleixner <tglx@linutronix.de>
Cc: <x86@kernel.org>, <linux-kernel@vger.kernel.org>,
Joerg Roedel <joerg.roedel@amd.com>,
Yinghai Lu <yinghai@kernel.org>
Subject: [PATCH 1/4] x86, gart: Don't enforce GART aperture lower-bound by alignment
Date: Mon, 18 Apr 2011 15:45:43 +0200 [thread overview]
Message-ID: <1303134346-5805-2-git-send-email-joerg.roedel@amd.com> (raw)
In-Reply-To: <1303134346-5805-1-git-send-email-joerg.roedel@amd.com>
This patch changes the allocation of the GART aperture to
enforce only natural alignment instead of aligning it on
512MB. This big alignment was used to force the GART
aperture to be over 512MB. This is enforced by using 512MB
as the lower-bound address in the allocation range.
Cc: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
---
arch/x86/kernel/aperture_64.c | 34 +++++++++++++++++++---------------
1 files changed, 19 insertions(+), 15 deletions(-)
diff --git a/arch/x86/kernel/aperture_64.c b/arch/x86/kernel/aperture_64.c
index 86d1ad4..5c66a2f 100644
--- a/arch/x86/kernel/aperture_64.c
+++ b/arch/x86/kernel/aperture_64.c
@@ -30,6 +30,22 @@
#include <asm/amd_nb.h>
#include <asm/x86_init.h>
+/*
+ * Using 512M as goal, in case kexec will load kernel_big
+ * that will do the on-position decompress, and could overlap with
+ * with the gart aperture that is used.
+ * Sequence:
+ * kernel_small
+ * ==> kexec (with kdump trigger path or gart still enabled)
+ * ==> kernel_small (gart area become e820_reserved)
+ * ==> kexec (with kdump trigger path or gart still enabled)
+ * ==> kerne_big (uncompressed size will be big than 64M or 128M)
+ * So don't use 512M below as gart iommu, leave the space for kernel
+ * code for safe.
+ */
+#define GART_MIN_ADDR (512ULL << 20)
+#define GART_MAX_ADDR (1ULL << 32)
+
int gart_iommu_aperture;
int gart_iommu_aperture_disabled __initdata;
int gart_iommu_aperture_allowed __initdata;
@@ -70,21 +86,9 @@ static u32 __init allocate_aperture(void)
* memory. Unfortunately we cannot move it up because that would
* make the IOMMU useless.
*/
- /*
- * using 512M as goal, in case kexec will load kernel_big
- * that will do the on position decompress, and could overlap with
- * that position with gart that is used.
- * sequende:
- * kernel_small
- * ==> kexec (with kdump trigger path or previous doesn't shutdown gart)
- * ==> kernel_small(gart area become e820_reserved)
- * ==> kexec (with kdump trigger path or previous doesn't shutdown gart)
- * ==> kerne_big (uncompressed size will be big than 64M or 128M)
- * so don't use 512M below as gart iommu, leave the space for kernel
- * code for safe
- */
- addr = memblock_find_in_range(0, 1ULL<<32, aper_size, 512ULL<<20);
- if (addr == MEMBLOCK_ERROR || addr + aper_size > 0xffffffff) {
+ addr = memblock_find_in_range(GART_MIN_ADDR, GART_MAX_ADDR,
+ aper_size, aper_size);
+ if (addr == MEMBLOCK_ERROR || addr + aper_size > GART_MAX_ADDR) {
printk(KERN_ERR
"Cannot allocate aperture memory hole (%lx,%uK)\n",
addr, aper_size>>10);
--
1.7.1
next prev parent reply other threads:[~2011-04-18 13:46 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-18 13:45 [PATCH 0/4] gart cleanups and fixes Joerg Roedel
2011-04-18 13:45 ` Joerg Roedel [this message]
2011-04-18 14:45 ` [PATCH 1/4] x86, gart: Don't enforce GART aperture lower-bound by alignment H. Peter Anvin
2011-04-18 14:56 ` Roedel, Joerg
2011-04-18 15:51 ` H. Peter Anvin
2011-04-18 17:36 ` Joerg Roedel
2011-04-18 17:39 ` H. Peter Anvin
2011-04-18 17:50 ` Joerg Roedel
2011-04-18 19:06 ` Joerg Roedel
2011-04-18 19:40 ` H. Peter Anvin
2011-04-18 18:29 ` Yinghai Lu
2011-04-18 18:39 ` [tip:x86/gart] " tip-bot for Joerg Roedel
2011-04-18 13:45 ` [PATCH 2/4] x86, gart: Convert spaces to tabs in enable_gart_translation Joerg Roedel
2011-04-18 16:39 ` [tip:x86/urgent] " tip-bot for Joerg Roedel
2011-04-18 13:45 ` [PATCH 3/4] x86, gart: Set DISTLBWALKPRB bit always Joerg Roedel
2011-04-18 16:40 ` [tip:x86/urgent] " tip-bot for Joerg Roedel
2011-04-18 13:45 ` [PATCH 4/4] x86, gart: Make sure GART does not map physmem above 1TB Joerg Roedel
2011-04-18 14:46 ` H. Peter Anvin
2011-04-18 14:52 ` Roedel, Joerg
2011-04-18 15:53 ` H. Peter Anvin
2011-04-18 14:54 ` H. Peter Anvin
2011-04-18 14:59 ` Roedel, Joerg
2011-04-18 15:50 ` Ingo Molnar
2011-04-19 6:12 ` Roedel, Joerg
2011-04-19 7:25 ` Ingo Molnar
2011-04-19 9:15 ` [PATCH] x86, gart: Rename pci-gart_64.c to amd64_gart.c Roedel, Joerg
2011-04-19 13:43 ` [PATCH 4/4] x86, gart: Make sure GART does not map physmem above 1TB H. Peter Anvin
2011-04-19 14:29 ` Roedel, Joerg
2011-04-20 17:38 ` H. Peter Anvin
2011-05-10 15:32 ` [PATCH] x86, gart: Rename pci-gart_64.c to amd_gart_64.c 1TB Roedel, Joerg
2011-04-18 16:40 ` [tip:x86/urgent] x86, gart: Make sure GART does not map physmem above 1TB tip-bot for Joerg Roedel
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=1303134346-5805-2-git-send-email-joerg.roedel@amd.com \
--to=joerg.roedel@amd.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
--cc=yinghai@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome