lkml.org 
[lkml]   [2007]   [Jul]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/2] fake the NUMA SLIT
Date
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:


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-07-18 11:37    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site