public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Mark Langsdorf" <mark.langsdorf@amd.com>
To: "Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>
Subject: [PATCH] allocate GART/IOMMU aperture from any node
Date: Tue, 03 Apr 2007 12:14:44 -0500	[thread overview]
Message-ID: <46128B84.3070303@amd.com> (raw)

Linux always tries to allocate the GART/IOMMU aperture from the
boot node memory.  However, it is legal to boot with no memory
attached to the boot node, in which case the system crashes with
invalid memory assignments.  Generalize the memory allocation to
support any node in the system with memory.

Signed-off-by: Mark Langsdorf <mark.langsdorf@amd.com>

--- linux-2.6.20/arch/x86_64/kernel/aperture.c.old	2007-04-02 
17:11:18.000000000 -0500
+++ linux-2.6.20/arch/x86_64/kernel/aperture.c	2007-04-02 
19:03:43.000000000 -0500
@@ -51,7 +51,6 @@ static void __init insert_aperture_resou

  static u32 __init allocate_aperture(void)
  {
-	pg_data_t *nd0 = NODE_DATA(0);
  	u32 aper_size;
  	void *p;

@@ -65,12 +64,12 @@ static u32 __init allocate_aperture(void
  	 * Unfortunately we cannot move it up because that would make the
  	 * IOMMU useless.
  	 */
-	p = __alloc_bootmem_node(nd0, aper_size, aper_size, 0);
+	p = __alloc_bootmem(aper_size, aper_size, 0);
  	if (!p || __pa(p)+aper_size > 0xffffffff) {
  		printk("Cannot allocate aperture memory hole (%p,%uK)\n",
  		       p, aper_size>>10);
  		if (p)
-			free_bootmem_node(nd0, __pa(p), aper_size);
+			free_bootmem(__pa(p), aper_size);
  		return 0;
  	}
  	printk("Mapping aperture over %d KB of RAM @ %lx\n",



                 reply	other threads:[~2007-04-03 17:15 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=46128B84.3070303@amd.com \
    --to=mark.langsdorf@amd.com \
    --cc=linux-kernel@vger.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