[PATCH 1/2] fake the NUMA SLIT

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <[email protected]>
--
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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux