#define node_to_cpumask(node) (node_to_cpumask[node])
struct node {
- u64 start,end;
+ paddr_t start, end;
};
extern int compute_hash_shift(struct node *nodes, int numnodes,
extern nodeid_t setup_node(unsigned int pxm);
extern void srat_detect_node(int cpu);
-extern void setup_node_bootmem(nodeid_t nodeid, u64 start, u64 end);
+extern void setup_node_bootmem(nodeid_t nodeid, paddr_t start, paddr_t end);
extern nodeid_t apicid_to_node[];
extern void init_cpu_to_node(void);
NODE_DATA(nid)->node_spanned_pages)
#define arch_want_default_dmazone() (num_online_nodes() > 1)
-extern int valid_numa_range(u64 start, u64 end, nodeid_t node);
+extern int valid_numa_range(paddr_t start, paddr_t end, nodeid_t node);
-void srat_parse_regions(u64 addr);
+void srat_parse_regions(paddr_t addr);
extern u8 __node_distance(nodeid_t a, nodeid_t b);
unsigned int arch_get_dma_bitsize(void);
return shift;
}
/* initialize NODE_DATA given nodeid and start/end */
-void __init setup_node_bootmem(nodeid_t nodeid, u64 start, u64 end)
-{
- unsigned long start_pfn, end_pfn;
-
- start_pfn = start >> PAGE_SHIFT;
- end_pfn = end >> PAGE_SHIFT;
+void __init setup_node_bootmem(nodeid_t nodeid, paddr_t start, paddr_t end)
+{
+ unsigned long start_pfn = paddr_to_pfn(start);
+ unsigned long end_pfn = paddr_to_pfn(end);
NODE_DATA(nodeid)->node_start_pfn = start_pfn;
NODE_DATA(nodeid)->node_spanned_pages = end_pfn - start_pfn;
static int numa_fake __initdata = 0;
/* Numa emulation */
-static int __init numa_emulation(u64 start_pfn, u64 end_pfn)
+static int __init numa_emulation(unsigned long start_pfn,
+ unsigned long end_pfn)
{
int i;
struct node nodes[MAX_NUMNODES];
- u64 sz = ((end_pfn - start_pfn)<<PAGE_SHIFT) / numa_fake;
+ uint64_t sz = pfn_to_paddr(end_pfn - start_pfn) / numa_fake;
/* Kludge needed for the hash function */
if ( hweight64(sz) > 1 )
memset(&nodes,0,sizeof(nodes));
for ( i = 0; i < numa_fake; i++ )
{
- nodes[i].start = (start_pfn<<PAGE_SHIFT) + i*sz;
+ nodes[i].start = pfn_to_paddr(start_pfn) + i * sz;
if ( i == numa_fake - 1 )
- sz = (end_pfn<<PAGE_SHIFT) - nodes[i].start;
+ sz = pfn_to_paddr(end_pfn) - nodes[i].start;
nodes[i].end = nodes[i].start + sz;
printk(KERN_INFO "Faking node %d at %"PRIx64"-%"PRIx64" (%"PRIu64"MB)\n",
i,
void __init numa_initmem_init(unsigned long start_pfn, unsigned long end_pfn)
{
int i;
+ paddr_t start = pfn_to_paddr(start_pfn);
+ paddr_t end = pfn_to_paddr(end_pfn);
#ifdef CONFIG_NUMA_EMU
if ( numa_fake && !numa_emulation(start_pfn, end_pfn) )
#endif
#ifdef CONFIG_ACPI_NUMA
- if ( !numa_off && !acpi_scan_nodes((u64)start_pfn << PAGE_SHIFT,
- (u64)end_pfn << PAGE_SHIFT) )
+ if ( !numa_off && !acpi_scan_nodes(start, end) )
return;
#endif
printk(KERN_INFO "%s\n",
numa_off ? "NUMA turned off" : "No NUMA configuration found");
- printk(KERN_INFO "Faking a node at %016"PRIx64"-%016"PRIx64"\n",
- (u64)start_pfn << PAGE_SHIFT,
- (u64)end_pfn << PAGE_SHIFT);
+ printk(KERN_INFO "Faking a node at %"PRIpaddr"-%"PRIpaddr"\n",
+ start, end);
/* setup dummy node covering all memory */
memnode_shift = BITS_PER_LONG - 1;
memnodemap = _memnodemap;
for ( i = 0; i < nr_cpu_ids; i++ )
numa_set_node(i, 0);
cpumask_copy(&node_to_cpumask[0], cpumask_of(0));
- setup_node_bootmem(0, (u64)start_pfn << PAGE_SHIFT,
- (u64)end_pfn << PAGE_SHIFT);
+ setup_node_bootmem(0, start, end);
}
void numa_add_cpu(int cpu)
return node;
}
-int valid_numa_range(u64 start, u64 end, nodeid_t node)
+int valid_numa_range(paddr_t start, paddr_t end, nodeid_t node)
{
int i;
return 0;
}
-static __init int conflicting_memblks(u64 start, u64 end)
+static __init int conflicting_memblks(paddr_t start, paddr_t end)
{
int i;
return -1;
}
-static __init void cutoff_node(int i, u64 start, u64 end)
+static __init void cutoff_node(int i, paddr_t start, paddr_t end)
{
struct node *nd = &nodes[i];
if (nd->start < start) {
void __init
acpi_numa_memory_affinity_init(const struct acpi_srat_mem_affinity *ma)
{
- u64 start, end;
+ paddr_t start, end;
unsigned pxm;
nodeid_t node;
int i;
bool mismatch = !(ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE) !=
!test_bit(i, memblk_hotplug);
- printk("%sSRAT: PXM %u (%"PRIx64"-%"PRIx64") overlaps with itself (%"PRIx64"-%"PRIx64")\n",
+ printk("%sSRAT: PXM %u (%"PRIpaddr"-%"PRIpaddr") overlaps with itself (%"PRIpaddr"-%"PRIpaddr")\n",
mismatch ? KERN_ERR : KERN_WARNING, pxm, start, end,
node_memblk_range[i].start, node_memblk_range[i].end);
if (mismatch) {
}
} else {
printk(KERN_ERR
- "SRAT: PXM %u (%"PRIx64"-%"PRIx64") overlaps with PXM %u (%"PRIx64"-%"PRIx64")\n",
+ "SRAT: PXM %u (%"PRIpaddr"-%"PRIpaddr") overlaps with PXM %u (%"PRIpaddr"-%"PRIpaddr")\n",
pxm, start, end, node_to_pxm(memblk_nodeid[i]),
node_memblk_range[i].start, node_memblk_range[i].end);
bad_srat();
nd->end = end;
}
}
- printk(KERN_INFO "SRAT: Node %u PXM %u %"PRIx64"-%"PRIx64"%s\n",
+ printk(KERN_INFO "SRAT: Node %u PXM %u %"PRIpaddr"-%"PRIpaddr"%s\n",
node, pxm, start, end,
ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE ? " (hotplug)" : "");
for (i = 0; i < e820.nr_map; i++) {
int j, found;
- unsigned long long start, end;
+ paddr_t start, end;
if (e820.map[i].type != E820_RAM) {
continue;
if (start < end) {
printk(KERN_ERR "SRAT: No PXM for e820 range: "
- "%016Lx - %016Lx\n", start, end);
+ "%"PRIpaddr" - %"PRIpaddr"\n", start, end);
return 0;
}
}
return 0;
}
-void __init srat_parse_regions(u64 addr)
+void __init srat_parse_regions(paddr_t addr)
{
u64 mask;
unsigned int i;
}
/* Use the information discovered above to actually set up the nodes. */
-int __init acpi_scan_nodes(u64 start, u64 end)
+int __init acpi_scan_nodes(paddr_t start, paddr_t end)
{
int i;
nodemask_t all_nodes_parsed;
/* Finally register nodes */
for_each_node_mask(i, all_nodes_parsed)
{
- u64 size = nodes[i].end - nodes[i].start;
+ uint64_t size = nodes[i].end - nodes[i].start;
+
if ( size == 0 )
printk(KERN_WARNING "SRAT: Node %u has no memory. "
"BIOS Bug or mis-configured hardware?\n", i);