xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] to fix ACPI slit table access at runtime
@ 2010-02-25  0:06 Kamble, Nitin A
  2010-02-25 12:13 ` Keir Fraser
  0 siblings, 1 reply; 13+ messages in thread
From: Kamble, Nitin A @ 2010-02-25  0:06 UTC (permalink / raw)
  To: Keir Fraser; +Cc: xen-devel@lists.xensource.com


[-- Attachment #1.1: Type: text/plain, Size: 2696 bytes --]

Hi Keir,
  I was noticing that the current Xen code was not able to access the ACPI SLIT data (node to node distance) at runtime. And I found root cause of it being the acpi_slit pointer not being valid at runtime.
I have fixed the issue by saving the slit table data at boot time, and using the saved data for runtime access as follows.

Please accept or comment.
Thanks & Regards,
Nitin

Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>

diff -r b474725a242b xen/arch/x86/srat.c
--- a/xen/arch/x86/srat.c             Thu Feb 25 07:50:38 2010 -0800
+++ b/xen/arch/x86/srat.c          Thu Feb 25 08:02:36 2010 -0800
@@ -20,13 +20,15 @@
 #include <asm/e820.h>
 #include <asm/page.h>

-static struct acpi_table_slit *__read_mostly acpi_slit;
-
 static nodemask_t nodes_parsed __initdata;
 static nodemask_t nodes_found __initdata;
 static struct node nodes[MAX_NUMNODES] __initdata;
 static u8 __read_mostly pxm2node[256] = { [0 ... 255] = 0xff };

+static struct {
+             struct acpi_table_slit slit_table;
+             u8 entries[MAX_NUMNODES * MAX_NUMNODES];
+} acpi_slit;

 static int num_node_memblks;
 static struct node node_memblk_range[NR_NODE_MEMBLKS];
@@ -144,7 +146,8 @@
                                printk(KERN_INFO "ACPI: SLIT table looks invalid. Not used.\n");
                                return;
                }
-              acpi_slit = slit;
+
+             memcpy(&acpi_slit, slit, slit->header.length);
 }

 /* Callback for Proximity Domain -> LAPIC mapping */
@@ -424,10 +427,10 @@
 {
                int index;

-              if (!acpi_slit)
+             if (!acpi_slit.slit_table.header.length)
                                return a == b ? 10 : 20;
-              index = acpi_slit->locality_count * node_to_pxm(a);
-              return acpi_slit->entry[index + node_to_pxm(b)];
+             index = acpi_slit.slit_table.locality_count * node_to_pxm(a);
+             return  acpi_slit.slit_table.entry[index + node_to_pxm(b)];
 }

 EXPORT_SYMBOL(__node_distance);
diff -r b474725a242b xen/include/acpi/actbl1.h
--- a/xen/include/acpi/actbl1.h Thu Feb 25 07:50:38 2010 -0800
+++ b/xen/include/acpi/actbl1.h              Thu Feb 25 08:02:36 2010 -0800
@@ -573,7 +573,7 @@
 struct acpi_table_slit {
                struct acpi_table_header header;            /* Common ACPI table header */
                u64 locality_count;
-              u8 entry[1];                        /* Real size = localities^2 */
+             u8 entry[0];                        /* Real size = localities^2 */
 };

 /*******************************************************************************

[-- Attachment #1.2: Type: text/html, Size: 8798 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2010-02-26 18:37 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-25  0:06 [PATCH] to fix ACPI slit table access at runtime Kamble, Nitin A
2010-02-25 12:13 ` Keir Fraser
2010-02-25 13:03   ` Jan Beulich
2010-02-25 13:16     ` Keir Fraser
2010-02-25 13:35       ` [PATCH] " Jan Beulich
2010-02-25 17:50   ` Kamble, Nitin A
2010-02-25 18:01     ` Keir Fraser
2010-02-25 18:47       ` Kamble, Nitin A
2010-02-25 21:53         ` Warning in current pv_ops Kernel Carsten Schiers
2010-02-25 21:57           ` Pasi Kärkkäinen
2010-02-25 19:31       ` [PATCH] to fix ACPI slit table access at runtime Kamble, Nitin A
2010-02-26  8:36         ` Jan Beulich
2010-02-26 18:37           ` Kamble, Nitin A

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).