ia64/xen-unstable

changeset 15914:b3f681d71265

x86: fix NUMA code for 32bit

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 <jbeulich@novell.com>
author kfraser@localhost.localdomain
date Fri Sep 14 16:10:08 2007 +0100 (2007-09-14)
parents 0349e4eedd25
children acfa9290746f
files xen/arch/x86/numa.c
line diff
     1.1 --- a/xen/arch/x86/numa.c	Fri Sep 14 16:08:39 2007 +0100
     1.2 +++ b/xen/arch/x86/numa.c	Fri Sep 14 16:10:08 2007 +0100
     1.3 @@ -139,15 +139,15 @@ void __init numa_init_array(void)
     1.4  static int numa_fake __initdata = 0;
     1.5  
     1.6  /* Numa emulation */
     1.7 -static int numa_emulation(unsigned long start_pfn, unsigned long end_pfn)
     1.8 +static int numa_emulation(u64 start_pfn, u64 end_pfn)
     1.9  {
    1.10   	int i;
    1.11   	struct node nodes[MAX_NUMNODES];
    1.12 - 	unsigned long sz = ((end_pfn - start_pfn)<<PAGE_SHIFT) / numa_fake;
    1.13 + 	u64 sz = ((end_pfn - start_pfn)<<PAGE_SHIFT) / numa_fake;
    1.14  
    1.15   	/* Kludge needed for the hash function */
    1.16   	if (hweight64(sz) > 1) {
    1.17 - 		unsigned long x = 1;
    1.18 + 		u64 x = 1;
    1.19   		while ((x << 1) < sz)
    1.20   			x <<= 1;
    1.21   		if (x < sz/2)
    1.22 @@ -190,17 +190,17 @@ void __init numa_initmem_init(unsigned l
    1.23  #endif
    1.24  
    1.25  #ifdef CONFIG_ACPI_NUMA
    1.26 -	if (!numa_off && !acpi_scan_nodes(start_pfn << PAGE_SHIFT,
    1.27 -					  end_pfn << PAGE_SHIFT))
    1.28 +	if (!numa_off && !acpi_scan_nodes((u64)start_pfn << PAGE_SHIFT,
    1.29 +					  (u64)end_pfn << PAGE_SHIFT))
    1.30  		return;
    1.31  #endif
    1.32  
    1.33  	printk(KERN_INFO "%s\n",
    1.34  	       numa_off ? "NUMA turned off" : "No NUMA configuration found");
    1.35  
    1.36 -	printk(KERN_INFO "Faking a node at %016lx-%016lx\n", 
    1.37 -	       start_pfn << PAGE_SHIFT,
    1.38 -	       end_pfn << PAGE_SHIFT); 
    1.39 +	printk(KERN_INFO "Faking a node at %016"PRIx64"-%016"PRIx64"\n",
    1.40 +	       (u64)start_pfn << PAGE_SHIFT,
    1.41 +	       (u64)end_pfn << PAGE_SHIFT);
    1.42  	/* setup dummy node covering all memory */ 
    1.43  	memnode_shift = 63; 
    1.44  	memnodemap[0] = 0;
    1.45 @@ -209,7 +209,7 @@ void __init numa_initmem_init(unsigned l
    1.46  	for (i = 0; i < NR_CPUS; i++)
    1.47  		numa_set_node(i, 0);
    1.48  	node_to_cpumask[0] = cpumask_of_cpu(0);
    1.49 -	setup_node_bootmem(0, start_pfn << PAGE_SHIFT, end_pfn << PAGE_SHIFT);
    1.50 +	setup_node_bootmem(0, (u64)start_pfn << PAGE_SHIFT, (u64)end_pfn << PAGE_SHIFT);
    1.51  }
    1.52  
    1.53  __cpuinit void numa_add_cpu(int cpu)