From: "Jan Beulich" Subject: [PATCH] x86: make pxm_to_node() return sane values when disabling NUMA internally Date: Mon, 26 Apr 2010 08:35:34 +0100 Message-ID: <4BD55E66020000780003C13C@vpn.id2.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__PartE2C87156.0__=" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__PartE2C87156.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Otherwise, pass-through code may call memory allocation functions with invalid node IDs, causing the allocations to fail. Signed-off-by: Jan Beulich --- 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] =3D { [0 ... 255] =3D 0xff }; +static u8 __read_mostly pxm2node[256] =3D { [0 ... 255] =3D NUMA_NO_NODE = }; =20 =20 static int num_node_memblks; @@ -112,6 +112,8 @@ static __init void bad_srat(void) acpi_numa =3D -1; for (i =3D 0; i < MAX_LOCAL_APIC; i++) apicid_to_node[i] =3D NUMA_NO_NODE; + for (i =3D 0; i < ARRAY_SIZE(pxm2node); i++) + pxm2node[i] =3D NUMA_NO_NODE; } =20 #ifdef CONFIG_X86_64 --=__PartE2C87156.0__= Content-Type: text/plain; name="x86-bad-srat-clear-pxm2node.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="x86-bad-srat-clear-pxm2node.patch" Otherwise, pass-through code may call memory allocation functions = with=0Ainvalid node IDs, causing the allocations to fail.=0A=0ASigned-off-b= y: Jan Beulich =0A=0A--- 2010-04-13.orig/xen/arch/x86/= srat.c 2010-03-08 22:36:09.000000000 +0100=0A+++ 2010-04-13/xen/arch/x86/s= rat.c 2010-04-14 14:28:17.000000000 +0200=0A@@ -25,7 +25,7 @@ static = struct acpi_table_slit *__read_mo=0A static nodemask_t nodes_parsed = __initdata;=0A static nodemask_t nodes_found __initdata;=0A static struct = node nodes[MAX_NUMNODES] __initdata;=0A-static u8 __read_mostly pxm2node[25= 6] =3D { [0 ... 255] =3D 0xff };=0A+static u8 __read_mostly pxm2node[256] = =3D { [0 ... 255] =3D NUMA_NO_NODE };=0A =0A =0A static int num_node_memblk= s;=0A@@ -112,6 +112,8 @@ static __init void bad_srat(void)=0A acpi_numa = =3D -1;=0A for (i =3D 0; i < MAX_LOCAL_APIC; i++)=0A = apicid_to_node[i] =3D NUMA_NO_NODE;=0A+ for (i =3D 0; i < ARRAY_SIZE(pxm2no= de); i++)=0A+ pxm2node[i] =3D NUMA_NO_NODE;=0A }=0A =0A #ifdef = CONFIG_X86_64=0A --=__PartE2C87156.0__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --=__PartE2C87156.0__=--