xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86: make pxm_to_node() return sane values when disabling NUMA internally
@ 2010-04-26  7:35 Jan Beulich
  0 siblings, 0 replies; only message in thread
From: Jan Beulich @ 2010-04-26  7:35 UTC (permalink / raw)
  To: xen-devel

[-- Attachment #1: Type: text/plain, Size: 972 bytes --]

Otherwise, pass-through code may call memory allocation functions with
invalid node IDs, causing the allocations to fail.

Signed-off-by: Jan Beulich <jbeulich@novell.com>

--- 2010-04-13.orig/xen/arch/x86/srat.c	2010-03-08 22:36:09.000000000 +0100
+++ 2010-04-13/xen/arch/x86/srat.c	2010-04-14 14:28:17.000000000 +0200
@@ -25,7 +25,7 @@ static struct acpi_table_slit *__read_mo
 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 u8 __read_mostly pxm2node[256] = { [0 ... 255] = NUMA_NO_NODE };
 
 
 static int num_node_memblks;
@@ -112,6 +112,8 @@ static __init void bad_srat(void)
 	acpi_numa = -1;
 	for (i = 0; i < MAX_LOCAL_APIC; i++)
 		apicid_to_node[i] = NUMA_NO_NODE;
+	for (i = 0; i < ARRAY_SIZE(pxm2node); i++)
+		pxm2node[i] = NUMA_NO_NODE;
 }
 
 #ifdef CONFIG_X86_64




[-- Attachment #2: x86-bad-srat-clear-pxm2node.patch --]
[-- Type: text/plain, Size: 966 bytes --]

Otherwise, pass-through code may call memory allocation functions with
invalid node IDs, causing the allocations to fail.

Signed-off-by: Jan Beulich <jbeulich@novell.com>

--- 2010-04-13.orig/xen/arch/x86/srat.c	2010-03-08 22:36:09.000000000 +0100
+++ 2010-04-13/xen/arch/x86/srat.c	2010-04-14 14:28:17.000000000 +0200
@@ -25,7 +25,7 @@ static struct acpi_table_slit *__read_mo
 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 u8 __read_mostly pxm2node[256] = { [0 ... 255] = NUMA_NO_NODE };
 
 
 static int num_node_memblks;
@@ -112,6 +112,8 @@ static __init void bad_srat(void)
 	acpi_numa = -1;
 	for (i = 0; i < MAX_LOCAL_APIC; i++)
 		apicid_to_node[i] = NUMA_NO_NODE;
+	for (i = 0; i < ARRAY_SIZE(pxm2node); i++)
+		pxm2node[i] = NUMA_NO_NODE;
 }
 
 #ifdef CONFIG_X86_64

[-- Attachment #3: 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] only message in thread

only message in thread, other threads:[~2010-04-26  7:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-26  7:35 [PATCH] x86: make pxm_to_node() return sane values when disabling NUMA internally Jan Beulich

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).