mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Joachim Deguara" <joachim.deguara@amd.com>
To: "lkml List" <linux-kernel@vger.kernel.org>
Cc: gregkh@suse.de, "Andreas Kleen" <ak@suse.de>,
	lenb@kernel.org, "Christoph Lameter" <clameter@sgi.com>
Subject: [PATCH 1/2] fake the NUMA SLIT
Date: Wed, 18 Jul 2007 11:30:58 +0200	[thread overview]
Message-ID: <200707181130.58945.joachim.deguara@amd.com> (raw)
In-Reply-To: <200707181130.01861.joachim.deguara@amd.com>

Most x86 NUMA systems do not have a SLIT provided by them from the BIOS.  We 
want to fake this by either creating one or copying the original.  The reason 
to do this is so to later be able to alter it. 

Signed-off-by: Joachim Deguara <joachim.deguara@amd.com>
--
Index: kernel/drivers/acpi/numa.c
===================================================================
--- kernel.orig/drivers/acpi/numa.c
+++ kernel/drivers/acpi/numa.c
@@ -228,6 +228,28 @@ int __init acpi_numa_init(void)
 	return 0;
 }
 
+int __init acpi_numa_slit_fixup(void)
+{
+	/* either no SLIT table from ACPI so we create one or we just copy*/
+	struct acpi_table_slit *fake_slit;
+	u32 localities = num_online_nodes();
+	int i, j, slitsize;
+
+	slitsize = sizeof(struct acpi_table_slit) + localities * localities - 1;
+	fake_slit = kmalloc(slitsize, GFP_KERNEL);
+	if (!fake_slit)
+		return -ENOMEM;
+
+	fake_slit->locality_count = localities;
+	for (i = 0; i < localities; i++)
+		for (j = 0; j < localities; j++)
+			fake_slit->entry[i*localities + j] = node_distance(i,j);
+
+	acpi_numa_slit_init(fake_slit);
+
+	return 0;
+}
+
 int acpi_get_pxm(acpi_handle h)
 {
 	unsigned long pxm;
Index: kernel/drivers/acpi/bus.c
===================================================================
--- kernel.orig/drivers/acpi/bus.c
+++ kernel/drivers/acpi/bus.c
@@ -650,6 +650,10 @@ void __init acpi_early_init(void)
 		goto error0;
 	}
 
+#ifdef CONFIG_ACPI_NUMA
+	acpi_numa_slit_fixup();
+#endif
+
 	return;
 
       error0:




  reply	other threads:[~2007-07-18  9:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-18  9:30 [PATCH 0/2] faking and fixing " Joachim Deguara
2007-07-18  9:30 ` Joachim Deguara [this message]
2007-07-18  9:31 ` [PATCH 2/2] make node distance writeable Joachim Deguara
2007-07-18  9:42 ` [PATCH 0/2] faking and fixing the NUMA SLIT Andi Kleen
2007-07-18  9:57   ` Joachim Deguara
2007-07-23 20:25   ` Christoph Lameter
2007-07-23 22:10     ` Len Brown

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=200707181130.58945.joachim.deguara@amd.com \
    --to=joachim.deguara@amd.com \
    --cc=ak@suse.de \
    --cc=clameter@sgi.com \
    --cc=gregkh@suse.de \
    --cc=lenb@kernel.org \
    --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

Powered by JetHome