From: "Jan Beulich" Subject: [PATCH] x86: fix NUMA code for 32bit Date: Fri, 14 Sep 2007 10:06:57 +0100 Message-ID: <46EA6B51.76E4.0078.0@novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline 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 I don't know how significant this is (most of the NUMA node data seems unused at this point), but anyway: enable proper operation of NUMA emulation and the fake NUMA node in case there's no SRAT table on x86-32. This will at least make the "Faking node ..." message not print confusing information anymore. Signed-off-by: Jan Beulich Index: 2007-08-08/xen/arch/x86/numa.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- 2007-08-08.orig/xen/arch/x86/numa.c 2006-12-15 08:53:48.000000000 = +0100 +++ 2007-08-08/xen/arch/x86/numa.c 2007-09-14 11:01:01.000000000 = +0200 @@ -139,15 +139,15 @@ void __init numa_init_array(void) static int numa_fake __initdata =3D 0; =20 /* Numa emulation */ -static int numa_emulation(unsigned long start_pfn, unsigned long end_pfn) +static int numa_emulation(u64 start_pfn, u64 end_pfn) { int i; struct node nodes[MAX_NUMNODES]; - unsigned long sz =3D ((end_pfn - start_pfn)< 1) { - unsigned long x =3D 1; + u64 x =3D 1; while ((x << 1) < sz) x <<=3D 1; if (x < sz/2) @@ -190,17 +190,17 @@ void __init numa_initmem_init(unsigned l #endif =20 #ifdef CONFIG_ACPI_NUMA - if (!numa_off && !acpi_scan_nodes(start_pfn << PAGE_SHIFT, - end_pfn << PAGE_SHIFT)) + if (!numa_off && !acpi_scan_nodes((u64)start_pfn << PAGE_SHIFT, + (u64)end_pfn << PAGE_SHIFT)) return; #endif =20 printk(KERN_INFO "%s\n", numa_off ? "NUMA turned off" : "No NUMA configuration = found"); =20 - printk(KERN_INFO "Faking a node at %016lx-%016lx\n",=20 - start_pfn << PAGE_SHIFT, - end_pfn << PAGE_SHIFT);=20 + printk(KERN_INFO "Faking a node at %016"PRIx64"-%016"PRIx64"\n", + (u64)start_pfn << PAGE_SHIFT, + (u64)end_pfn << PAGE_SHIFT); /* setup dummy node covering all memory */=20 memnode_shift =3D 63;=20 memnodemap[0] =3D 0; @@ -209,7 +209,7 @@ void __init numa_initmem_init(unsigned l for (i =3D 0; i < NR_CPUS; i++) numa_set_node(i, 0); node_to_cpumask[0] =3D cpumask_of_cpu(0); - setup_node_bootmem(0, start_pfn << PAGE_SHIFT, end_pfn << = PAGE_SHIFT); + setup_node_bootmem(0, (u64)start_pfn << PAGE_SHIFT, (u64)end_pfn = << PAGE_SHIFT); } =20 __cpuinit void numa_add_cpu(int cpu)