[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <200707181130.58945.joachim.deguara@amd.com>
Date: Wed, 18 Jul 2007 11:30:58 +0200
From: "Joachim Deguara" <joachim.deguara@....com>
To: "lkml List" <linux-kernel@...r.kernel.org>
cc: gregkh@...e.de, "Andreas Kleen" <ak@...e.de>, lenb@...nel.org,
"Christoph Lameter" <clameter@....com>
Subject: [PATCH 1/2] fake the NUMA SLIT
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@....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:
-
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