| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | /*
 | 
					
						
							|  |  |  |  * Written by: Patricia Gaughen <gone@us.ibm.com>, IBM Corporation | 
					
						
							|  |  |  |  * August 2002: added remote node KVA remap - Martin J. Bligh  | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * Copyright (C) 2002, IBM Corp. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * All rights reserved.           | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * This program is free software; you can redistribute it and/or modify | 
					
						
							|  |  |  |  * it under the terms of the GNU General Public License as published by | 
					
						
							|  |  |  |  * the Free Software Foundation; either version 2 of the License, or | 
					
						
							|  |  |  |  * (at your option) any later version. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * This program is distributed in the hope that it will be useful, but | 
					
						
							|  |  |  |  * WITHOUT ANY WARRANTY; without even the implied warranty of | 
					
						
							|  |  |  |  * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or | 
					
						
							|  |  |  |  * NON INFRINGEMENT.  See the GNU General Public License for more | 
					
						
							|  |  |  |  * details. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * You should have received a copy of the GNU General Public License | 
					
						
							|  |  |  |  * along with this program; if not, write to the Free Software | 
					
						
							|  |  |  |  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <linux/bootmem.h>
 | 
					
						
							| 
									
										
										
										
											2010-08-25 13:39:17 -07:00
										 |  |  | #include <linux/memblock.h>
 | 
					
						
							| 
									
										
										
										
											2005-06-23 00:08:33 -07:00
										 |  |  | #include <linux/module.h>
 | 
					
						
							| 
									
										
										
										
											2005-06-23 00:07:57 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-05-02 17:24:48 +02:00
										 |  |  | #include "numa_internal.h"
 | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-06-23 00:07:57 -07:00
										 |  |  | #ifdef CONFIG_DISCONTIGMEM
 | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | /*
 | 
					
						
							| 
									
										
										
										
											2005-06-23 00:07:57 -07:00
										 |  |  |  * 4) physnode_map     - the mapping between a pfn and owning node | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  |  * physnode_map keeps track of the physical memory layout of a generic | 
					
						
							| 
									
										
										
										
											2008-05-31 22:51:51 -07:00
										 |  |  |  * numa node on a 64Mb break (each element of the array will | 
					
						
							|  |  |  |  * represent 64Mb of memory and will be marked by the node id.  so, | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  |  * if the first gig is on node 0, and the second gig is on node 1 | 
					
						
							|  |  |  |  * physnode_map will contain: | 
					
						
							|  |  |  |  * | 
					
						
							| 
									
										
										
										
											2008-05-31 22:51:51 -07:00
										 |  |  |  *     physnode_map[0-15] = 0; | 
					
						
							|  |  |  |  *     physnode_map[16-31] = 1; | 
					
						
							|  |  |  |  *     physnode_map[32- ] = -1; | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  |  */ | 
					
						
							| 
									
										
										
										
											2011-07-12 09:44:22 +02:00
										 |  |  | s8 physnode_map[MAX_SECTIONS] __read_mostly = { [0 ... (MAX_SECTIONS - 1)] = -1}; | 
					
						
							| 
									
										
										
										
											2005-06-23 00:08:33 -07:00
										 |  |  | EXPORT_SYMBOL(physnode_map); | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | void memory_present(int nid, unsigned long start, unsigned long end) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	unsigned long pfn; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-06-23 16:41:30 -07:00
										 |  |  | 	printk(KERN_INFO "Node: %d, start_pfn: %lx, end_pfn: %lx\n", | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 			nid, start, end); | 
					
						
							|  |  |  | 	printk(KERN_DEBUG "  Setting physnode_map array to node %d for pfns:\n", nid); | 
					
						
							|  |  |  | 	printk(KERN_DEBUG "  "); | 
					
						
							| 
									
										
										
										
											2011-07-12 09:44:22 +02:00
										 |  |  | 	for (pfn = start; pfn < end; pfn += PAGES_PER_SECTION) { | 
					
						
							|  |  |  | 		physnode_map[pfn / PAGES_PER_SECTION] = nid; | 
					
						
							| 
									
										
										
										
											2008-06-23 16:41:30 -07:00
										 |  |  | 		printk(KERN_CONT "%lx ", pfn); | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	} | 
					
						
							| 
									
										
										
										
											2008-05-31 22:51:51 -07:00
										 |  |  | 	printk(KERN_CONT "\n"); | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | unsigned long node_memmap_size_bytes(int nid, unsigned long start_pfn, | 
					
						
							|  |  |  | 					      unsigned long end_pfn) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	unsigned long nr_pages = end_pfn - start_pfn; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	if (!nr_pages) | 
					
						
							|  |  |  | 		return 0; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	return (nr_pages + 1) * sizeof(struct page); | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2005-06-23 00:07:57 -07:00
										 |  |  | #endif
 | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | extern unsigned long highend_pfn, highstart_pfn; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #define LARGE_PAGE_BYTES (PTRS_PER_PTE * PAGE_SIZE)
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-10-17 18:04:36 +02:00
										 |  |  | static void *node_remap_start_vaddr[MAX_NUMNODES]; | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | void set_pmd_pfn(unsigned long vaddr, unsigned long pfn, pgprot_t flags); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-01-30 13:33:25 +01:00
										 |  |  | /*
 | 
					
						
							| 
									
										
										
										
											2011-04-05 00:24:00 +02:00
										 |  |  |  * Remap memory allocator | 
					
						
							| 
									
										
										
										
											2008-01-30 13:33:25 +01:00
										 |  |  |  */ | 
					
						
							|  |  |  | static unsigned long node_remap_start_pfn[MAX_NUMNODES]; | 
					
						
							|  |  |  | static void *node_remap_end_vaddr[MAX_NUMNODES]; | 
					
						
							|  |  |  | static void *node_remap_alloc_vaddr[MAX_NUMNODES]; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-04-05 00:24:00 +02:00
										 |  |  | /**
 | 
					
						
							|  |  |  |  * alloc_remap - Allocate remapped memory | 
					
						
							|  |  |  |  * @nid: NUMA node to allocate memory from | 
					
						
							|  |  |  |  * @size: The size of allocation | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * Allocate @size bytes from the remap area of NUMA node @nid.  The | 
					
						
							|  |  |  |  * size of the remap area is predetermined by init_alloc_remap() and | 
					
						
							|  |  |  |  * only the callers considered there should call this function.  For | 
					
						
							|  |  |  |  * more info, please read the comment on top of init_alloc_remap(). | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * The caller must be ready to handle allocation failure from this | 
					
						
							|  |  |  |  * function and fall back to regular memory allocator in such cases. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * CONTEXT: | 
					
						
							|  |  |  |  * Single CPU early boot context. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * RETURNS: | 
					
						
							|  |  |  |  * Pointer to the allocated memory on success, %NULL on failure. | 
					
						
							|  |  |  |  */ | 
					
						
							| 
									
										
										
										
											2005-06-23 00:07:39 -07:00
										 |  |  | void *alloc_remap(int nid, unsigned long size) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	void *allocation = node_remap_alloc_vaddr[nid]; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	size = ALIGN(size, L1_CACHE_BYTES); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-04-05 00:23:47 +02:00
										 |  |  | 	if (!allocation || (allocation + size) > node_remap_end_vaddr[nid]) | 
					
						
							| 
									
										
										
										
											2009-02-22 01:01:13 +01:00
										 |  |  | 		return NULL; | 
					
						
							| 
									
										
										
										
											2005-06-23 00:07:39 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	node_remap_alloc_vaddr[nid] += size; | 
					
						
							|  |  |  | 	memset(allocation, 0, size); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	return allocation; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-11-12 23:22:35 +01:00
										 |  |  | #ifdef CONFIG_HIBERNATION
 | 
					
						
							|  |  |  | /**
 | 
					
						
							|  |  |  |  * resume_map_numa_kva - add KVA mapping to the temporary page tables created | 
					
						
							|  |  |  |  *                       during resume from hibernation | 
					
						
							|  |  |  |  * @pgd_base - temporary resume page directory | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | void resume_map_numa_kva(pgd_t *pgd_base) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	int node; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	for_each_online_node(node) { | 
					
						
							| 
									
										
										
										
											2011-04-05 00:23:59 +02:00
										 |  |  | 		unsigned long start_va, start_pfn, nr_pages, pfn; | 
					
						
							| 
									
										
										
										
											2008-11-12 23:22:35 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | 		start_va = (unsigned long)node_remap_start_vaddr[node]; | 
					
						
							|  |  |  | 		start_pfn = node_remap_start_pfn[node]; | 
					
						
							| 
									
										
										
										
											2011-04-05 00:23:59 +02:00
										 |  |  | 		nr_pages = (node_remap_end_vaddr[node] - | 
					
						
							|  |  |  | 			    node_remap_start_vaddr[node]) >> PAGE_SHIFT; | 
					
						
							| 
									
										
										
										
											2008-11-12 23:22:35 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-01-07 14:42:41 -08:00
										 |  |  | 		printk(KERN_DEBUG "%s: node %d\n", __func__, node); | 
					
						
							| 
									
										
										
										
											2008-11-12 23:22:35 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-04-05 00:23:59 +02:00
										 |  |  | 		for (pfn = 0; pfn < nr_pages; pfn += PTRS_PER_PTE) { | 
					
						
							| 
									
										
										
										
											2008-11-12 23:22:35 +01:00
										 |  |  | 			unsigned long vaddr = start_va + (pfn << PAGE_SHIFT); | 
					
						
							|  |  |  | 			pgd_t *pgd = pgd_base + pgd_index(vaddr); | 
					
						
							|  |  |  | 			pud_t *pud = pud_offset(pgd, vaddr); | 
					
						
							|  |  |  | 			pmd_t *pmd = pmd_offset(pud, vaddr); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 			set_pmd(pmd, pfn_pmd(start_pfn + pfn, | 
					
						
							|  |  |  | 						PAGE_KERNEL_LARGE_EXEC)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 			printk(KERN_DEBUG "%s: %08lx -> pfn %08lx\n", | 
					
						
							| 
									
										
										
										
											2009-01-07 14:42:41 -08:00
										 |  |  | 				__func__, vaddr, start_pfn + pfn); | 
					
						
							| 
									
										
										
										
											2008-11-12 23:22:35 +01:00
										 |  |  | 		} | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-04-05 00:24:00 +02:00
										 |  |  | /**
 | 
					
						
							|  |  |  |  * init_alloc_remap - Initialize remap allocator for a NUMA node | 
					
						
							|  |  |  |  * @nid: NUMA node to initizlie remap allocator for | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * NUMA nodes may end up without any lowmem.  As allocating pgdat and | 
					
						
							|  |  |  |  * memmap on a different node with lowmem is inefficient, a special | 
					
						
							|  |  |  |  * remap allocator is implemented which can be used by alloc_remap(). | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * For each node, the amount of memory which will be necessary for | 
					
						
							|  |  |  |  * pgdat and memmap is calculated and two memory areas of the size are | 
					
						
							|  |  |  |  * allocated - one in the node and the other in lowmem; then, the area | 
					
						
							|  |  |  |  * in the node is remapped to the lowmem area. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * As pgdat and memmap must be allocated in lowmem anyway, this | 
					
						
							|  |  |  |  * doesn't waste lowmem address space; however, the actual lowmem | 
					
						
							|  |  |  |  * which gets remapped over is wasted.  The amount shouldn't be | 
					
						
							|  |  |  |  * problematic on machines this feature will be used. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * Initialization failure isn't fatal.  alloc_remap() is used | 
					
						
							|  |  |  |  * opportunistically and the callers will fall back to other memory | 
					
						
							|  |  |  |  * allocation mechanisms on failure. | 
					
						
							|  |  |  |  */ | 
					
						
							| 
									
										
										
										
											2011-05-02 14:18:54 +02:00
										 |  |  | void __init init_alloc_remap(int nid, u64 start, u64 end) | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2011-05-02 14:18:54 +02:00
										 |  |  | 	unsigned long start_pfn = start >> PAGE_SHIFT; | 
					
						
							|  |  |  | 	unsigned long end_pfn = end >> PAGE_SHIFT; | 
					
						
							| 
									
										
										
										
											2011-04-05 00:23:56 +02:00
										 |  |  | 	unsigned long size, pfn; | 
					
						
							| 
									
										
										
										
											2011-04-05 00:23:55 +02:00
										 |  |  | 	u64 node_pa, remap_pa; | 
					
						
							|  |  |  | 	void *remap_va; | 
					
						
							| 
									
										
										
										
											2011-04-05 00:23:50 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	/*
 | 
					
						
							|  |  |  | 	 * The acpi/srat node info can show hot-add memroy zones where | 
					
						
							|  |  |  | 	 * memory could be added but not currently present. | 
					
						
							|  |  |  | 	 */ | 
					
						
							|  |  |  | 	printk(KERN_DEBUG "node %d pfn: [%lx - %lx]\n", | 
					
						
							| 
									
										
										
										
											2011-05-02 14:18:54 +02:00
										 |  |  | 	       nid, start_pfn, end_pfn); | 
					
						
							| 
									
										
										
										
											2011-04-05 00:23:50 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-04-05 00:23:53 +02:00
										 |  |  | 	/* calculate the necessary space aligned to large page size */ | 
					
						
							| 
									
										
										
										
											2011-05-02 14:18:54 +02:00
										 |  |  | 	size = node_memmap_size_bytes(nid, start_pfn, end_pfn); | 
					
						
							| 
									
										
										
										
											2011-04-05 00:23:50 +02:00
										 |  |  | 	size += ALIGN(sizeof(pg_data_t), PAGE_SIZE); | 
					
						
							| 
									
										
										
										
											2011-04-05 00:23:52 +02:00
										 |  |  | 	size = ALIGN(size, LARGE_PAGE_BYTES); | 
					
						
							| 
									
										
										
										
											2011-04-05 00:23:50 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-04-05 00:23:55 +02:00
										 |  |  | 	/* allocate node memory and the lowmem remap area */ | 
					
						
							| 
									
										
										
										
											2011-05-02 14:18:54 +02:00
										 |  |  | 	node_pa = memblock_find_in_range(start, end, size, LARGE_PAGE_BYTES); | 
					
						
							| 
									
										
										
										
											2011-07-12 09:58:09 +02:00
										 |  |  | 	if (!node_pa) { | 
					
						
							| 
									
										
										
										
											2011-04-05 00:23:54 +02:00
										 |  |  | 		pr_warning("remap_alloc: failed to allocate %lu bytes for node %d\n", | 
					
						
							|  |  |  | 			   size, nid); | 
					
						
							| 
									
										
										
										
											2011-04-05 00:23:58 +02:00
										 |  |  | 		return; | 
					
						
							| 
									
										
										
										
											2011-04-05 00:23:54 +02:00
										 |  |  | 	} | 
					
						
							| 
									
										
										
										
											2011-07-12 11:16:06 +02:00
										 |  |  | 	memblock_reserve(node_pa, size); | 
					
						
							| 
									
										
										
										
											2011-04-05 00:23:55 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	remap_pa = memblock_find_in_range(min_low_pfn << PAGE_SHIFT, | 
					
						
							|  |  |  | 					  max_low_pfn << PAGE_SHIFT, | 
					
						
							|  |  |  | 					  size, LARGE_PAGE_BYTES); | 
					
						
							| 
									
										
										
										
											2011-07-12 09:58:09 +02:00
										 |  |  | 	if (!remap_pa) { | 
					
						
							| 
									
										
										
										
											2011-04-05 00:23:55 +02:00
										 |  |  | 		pr_warning("remap_alloc: failed to allocate %lu bytes remap area for node %d\n", | 
					
						
							|  |  |  | 			   size, nid); | 
					
						
							| 
									
										
										
										
											2011-07-12 11:16:06 +02:00
										 |  |  | 		memblock_free(node_pa, size); | 
					
						
							| 
									
										
										
										
											2011-04-05 00:23:58 +02:00
										 |  |  | 		return; | 
					
						
							| 
									
										
										
										
											2011-04-05 00:23:55 +02:00
										 |  |  | 	} | 
					
						
							| 
									
										
										
										
											2011-07-12 11:16:06 +02:00
										 |  |  | 	memblock_reserve(remap_pa, size); | 
					
						
							| 
									
										
										
										
											2011-04-05 00:23:55 +02:00
										 |  |  | 	remap_va = phys_to_virt(remap_pa); | 
					
						
							| 
									
										
										
										
											2011-04-05 00:23:50 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-04-05 00:23:56 +02:00
										 |  |  | 	/* perform actual remap */ | 
					
						
							|  |  |  | 	for (pfn = 0; pfn < size >> PAGE_SHIFT; pfn += PTRS_PER_PTE) | 
					
						
							|  |  |  | 		set_pmd_pfn((unsigned long)remap_va + (pfn << PAGE_SHIFT), | 
					
						
							|  |  |  | 			    (node_pa >> PAGE_SHIFT) + pfn, | 
					
						
							|  |  |  | 			    PAGE_KERNEL_LARGE); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-04-05 00:23:55 +02:00
										 |  |  | 	/* initialize remap allocator parameters */ | 
					
						
							|  |  |  | 	node_remap_start_pfn[nid] = node_pa >> PAGE_SHIFT; | 
					
						
							|  |  |  | 	node_remap_start_vaddr[nid] = remap_va; | 
					
						
							|  |  |  | 	node_remap_end_vaddr[nid] = remap_va + size; | 
					
						
							| 
									
										
										
										
											2011-04-05 00:23:57 +02:00
										 |  |  | 	node_remap_alloc_vaddr[nid] = remap_va; | 
					
						
							| 
									
										
										
										
											2011-04-05 00:23:50 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-04-05 00:23:55 +02:00
										 |  |  | 	printk(KERN_DEBUG "remap_alloc: node %d [%08llx-%08llx) -> [%p-%p)\n", | 
					
						
							|  |  |  | 	       nid, node_pa, node_pa + size, remap_va, remap_va + size); | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-02-16 12:13:06 +01:00
										 |  |  | void __init initmem_init(void) | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2011-05-02 17:24:48 +02:00
										 |  |  | 	x86_numa_init(); | 
					
						
							| 
									
										
										
										
											2011-04-05 00:23:55 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | #ifdef CONFIG_HIGHMEM
 | 
					
						
							|  |  |  | 	highstart_pfn = highend_pfn = max_pfn; | 
					
						
							| 
									
										
										
										
											2008-06-23 03:05:30 -07:00
										 |  |  | 	if (max_pfn > max_low_pfn) | 
					
						
							|  |  |  | 		highstart_pfn = max_low_pfn; | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	printk(KERN_NOTICE "%ldMB HIGHMEM available.\n", | 
					
						
							|  |  |  | 	       pages_to_mb(highend_pfn - highstart_pfn)); | 
					
						
							| 
									
										
										
										
											2006-09-26 10:52:31 +02:00
										 |  |  | 	num_physpages = highend_pfn; | 
					
						
							|  |  |  | 	high_memory = (void *) __va(highstart_pfn * PAGE_SIZE - 1) + 1; | 
					
						
							|  |  |  | #else
 | 
					
						
							| 
									
										
										
										
											2008-06-23 03:05:30 -07:00
										 |  |  | 	num_physpages = max_low_pfn; | 
					
						
							|  |  |  | 	high_memory = (void *) __va(max_low_pfn * PAGE_SIZE - 1) + 1; | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | #endif
 | 
					
						
							|  |  |  | 	printk(KERN_NOTICE "%ldMB LOWMEM available.\n", | 
					
						
							| 
									
										
										
										
											2008-06-23 03:05:30 -07:00
										 |  |  | 			pages_to_mb(max_low_pfn)); | 
					
						
							| 
									
										
										
										
											2008-06-23 16:41:30 -07:00
										 |  |  | 	printk(KERN_DEBUG "max_low_pfn = %lx, highstart_pfn = %lx\n", | 
					
						
							|  |  |  | 			max_low_pfn, highstart_pfn); | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-06-23 16:41:30 -07:00
										 |  |  | 	printk(KERN_DEBUG "Low memory ends at vaddr %08lx\n", | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 			(ulong) pfn_to_kaddr(max_low_pfn)); | 
					
						
							| 
									
										
										
										
											2008-06-24 12:19:41 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-06-23 16:41:30 -07:00
										 |  |  | 	printk(KERN_DEBUG "High memory starts at vaddr %08lx\n", | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 			(ulong) pfn_to_kaddr(highstart_pfn)); | 
					
						
							| 
									
										
										
										
											2008-06-24 12:19:41 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	setup_bootmem_allocator(); | 
					
						
							|  |  |  | } |