aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYinghai Lu <yhlu.kernel@gmail.com>2008-06-25 01:14:09 -0400
committerIngo Molnar <mingo@elte.hu>2008-07-08 07:10:38 -0400
commitc987d12f8455b19b3b057d63bac3de161bd809fc (patch)
treeeb42d14516ea0d24d023d00ed0100cbee42df28c
parentf47f9d538ecc938bed589e9d39ad7b454f3b506c (diff)
x86: remove end_pfn in 64bit
and use max_pfn directly. Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r--arch/x86/kernel/aperture_64.c6
-rw-r--r--arch/x86/kernel/e820.c2
-rw-r--r--arch/x86/kernel/early-quirks.c2
-rw-r--r--arch/x86/kernel/machine_kexec_64.c2
-rw-r--r--arch/x86/kernel/pci-calgary_64.c4
-rw-r--r--arch/x86/kernel/pci-dma.c4
-rw-r--r--arch/x86/kernel/pci-gart_64.c4
-rw-r--r--arch/x86/kernel/pci-swiotlb_64.c2
-rw-r--r--arch/x86/mm/init_64.c17
-rw-r--r--arch/x86/mm/k8topology_64.c4
-rw-r--r--arch/x86/mm/numa_64.c4
-rw-r--r--arch/x86/mm/srat_64.c2
-rw-r--r--arch/x86/power/hibernate_64.c2
-rw-r--r--include/asm-x86/page_64.h5
14 files changed, 29 insertions, 31 deletions
diff --git a/arch/x86/kernel/aperture_64.c b/arch/x86/kernel/aperture_64.c
index 600470d464fa..9f907806c1a5 100644
--- a/arch/x86/kernel/aperture_64.c
+++ b/arch/x86/kernel/aperture_64.c
@@ -407,7 +407,9 @@ void __init gart_iommu_hole_init(void)
407 agp_aper_base == aper_base && 407 agp_aper_base == aper_base &&
408 agp_aper_order == aper_order) { 408 agp_aper_order == aper_order) {
409 /* the same between two setting from NB and agp */ 409 /* the same between two setting from NB and agp */
410 if (!no_iommu && end_pfn > MAX_DMA32_PFN && !printed_gart_size_msg) { 410 if (!no_iommu &&
411 max_pfn > MAX_DMA32_PFN &&
412 !printed_gart_size_msg) {
411 printk(KERN_ERR "you are using iommu with agp, but GART size is less than 64M\n"); 413 printk(KERN_ERR "you are using iommu with agp, but GART size is less than 64M\n");
412 printk(KERN_ERR "please increase GART size in your BIOS setup\n"); 414 printk(KERN_ERR "please increase GART size in your BIOS setup\n");
413 printk(KERN_ERR "if BIOS doesn't have that option, contact your HW vendor!\n"); 415 printk(KERN_ERR "if BIOS doesn't have that option, contact your HW vendor!\n");
@@ -448,7 +450,7 @@ out:
448 /* Got the aperture from the AGP bridge */ 450 /* Got the aperture from the AGP bridge */
449 } else if (swiotlb && !valid_agp) { 451 } else if (swiotlb && !valid_agp) {
450 /* Do nothing */ 452 /* Do nothing */
451 } else if ((!no_iommu && end_pfn > MAX_DMA32_PFN) || 453 } else if ((!no_iommu && max_pfn > MAX_DMA32_PFN) ||
452 force_iommu || 454 force_iommu ||
453 valid_agp || 455 valid_agp ||
454 fallback_aper_force) { 456 fallback_aper_force) {
diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c
index 1b76b25b4d9a..3900ff51bc68 100644
--- a/arch/x86/kernel/e820.c
+++ b/arch/x86/kernel/e820.c
@@ -527,7 +527,7 @@ __init void e820_setup_gap(void)
527 527
528#ifdef CONFIG_X86_64 528#ifdef CONFIG_X86_64
529 if (!found) { 529 if (!found) {
530 gapstart = (end_pfn << PAGE_SHIFT) + 1024*1024; 530 gapstart = (max_pfn << PAGE_SHIFT) + 1024*1024;
531 printk(KERN_ERR "PCI: Warning: Cannot find a gap in the 32bit " 531 printk(KERN_ERR "PCI: Warning: Cannot find a gap in the 32bit "
532 "address range\n" 532 "address range\n"
533 KERN_ERR "PCI: Unassigned devices with 32bit resource " 533 KERN_ERR "PCI: Unassigned devices with 32bit resource "
diff --git a/arch/x86/kernel/early-quirks.c b/arch/x86/kernel/early-quirks.c
index 84fd9f2a28ff..a4665f37cfc5 100644
--- a/arch/x86/kernel/early-quirks.c
+++ b/arch/x86/kernel/early-quirks.c
@@ -50,7 +50,7 @@ static void __init fix_hypertransport_config(int num, int slot, int func)
50static void __init via_bugs(int num, int slot, int func) 50static void __init via_bugs(int num, int slot, int func)
51{ 51{
52#ifdef CONFIG_GART_IOMMU 52#ifdef CONFIG_GART_IOMMU
53 if ((end_pfn > MAX_DMA32_PFN || force_iommu) && 53 if ((max_pfn > MAX_DMA32_PFN || force_iommu) &&
54 !gart_iommu_aperture_allowed) { 54 !gart_iommu_aperture_allowed) {
55 printk(KERN_INFO 55 printk(KERN_INFO
56 "Looks like a VIA chipset. Disabling IOMMU." 56 "Looks like a VIA chipset. Disabling IOMMU."
diff --git a/arch/x86/kernel/machine_kexec_64.c b/arch/x86/kernel/machine_kexec_64.c
index 576a03db4511..7830dc4a8380 100644
--- a/arch/x86/kernel/machine_kexec_64.c
+++ b/arch/x86/kernel/machine_kexec_64.c
@@ -110,7 +110,7 @@ static int init_pgtable(struct kimage *image, unsigned long start_pgtable)
110{ 110{
111 pgd_t *level4p; 111 pgd_t *level4p;
112 level4p = (pgd_t *)__va(start_pgtable); 112 level4p = (pgd_t *)__va(start_pgtable);
113 return init_level4_page(image, level4p, 0, end_pfn << PAGE_SHIFT); 113 return init_level4_page(image, level4p, 0, max_pfn << PAGE_SHIFT);
114} 114}
115 115
116static void set_idt(void *newidt, u16 limit) 116static void set_idt(void *newidt, u16 limit)
diff --git a/arch/x86/kernel/pci-calgary_64.c b/arch/x86/kernel/pci-calgary_64.c
index e28ec497e142..6959b5c45df4 100644
--- a/arch/x86/kernel/pci-calgary_64.c
+++ b/arch/x86/kernel/pci-calgary_64.c
@@ -1394,7 +1394,7 @@ void __init detect_calgary(void)
1394 return; 1394 return;
1395 } 1395 }
1396 1396
1397 specified_table_size = determine_tce_table_size(end_pfn * PAGE_SIZE); 1397 specified_table_size = determine_tce_table_size(max_pfn * PAGE_SIZE);
1398 1398
1399 for (bus = 0; bus < MAX_PHB_BUS_NUM; bus++) { 1399 for (bus = 0; bus < MAX_PHB_BUS_NUM; bus++) {
1400 struct calgary_bus_info *info = &bus_info[bus]; 1400 struct calgary_bus_info *info = &bus_info[bus];
@@ -1459,7 +1459,7 @@ int __init calgary_iommu_init(void)
1459 if (ret) { 1459 if (ret) {
1460 printk(KERN_ERR "PCI-DMA: Calgary init failed %d, " 1460 printk(KERN_ERR "PCI-DMA: Calgary init failed %d, "
1461 "falling back to no_iommu\n", ret); 1461 "falling back to no_iommu\n", ret);
1462 if (end_pfn > MAX_DMA32_PFN) 1462 if (max_pfn > MAX_DMA32_PFN)
1463 printk(KERN_ERR "WARNING more than 4GB of memory, " 1463 printk(KERN_ERR "WARNING more than 4GB of memory, "
1464 "32bit PCI may malfunction.\n"); 1464 "32bit PCI may malfunction.\n");
1465 return ret; 1465 return ret;
diff --git a/arch/x86/kernel/pci-dma.c b/arch/x86/kernel/pci-dma.c
index cb0bdf440715..8467ec2320f1 100644
--- a/arch/x86/kernel/pci-dma.c
+++ b/arch/x86/kernel/pci-dma.c
@@ -75,7 +75,7 @@ early_param("dma32_size", parse_dma32_size_opt);
75void __init dma32_reserve_bootmem(void) 75void __init dma32_reserve_bootmem(void)
76{ 76{
77 unsigned long size, align; 77 unsigned long size, align;
78 if (end_pfn <= MAX_DMA32_PFN) 78 if (max_pfn <= MAX_DMA32_PFN)
79 return; 79 return;
80 80
81 /* 81 /*
@@ -94,7 +94,7 @@ void __init dma32_reserve_bootmem(void)
94static void __init dma32_free_bootmem(void) 94static void __init dma32_free_bootmem(void)
95{ 95{
96 96
97 if (end_pfn <= MAX_DMA32_PFN) 97 if (max_pfn <= MAX_DMA32_PFN)
98 return; 98 return;
99 99
100 if (!dma32_bootmem_ptr) 100 if (!dma32_bootmem_ptr)
diff --git a/arch/x86/kernel/pci-gart_64.c b/arch/x86/kernel/pci-gart_64.c
index 021f3c684a62..d0d18db5d2a4 100644
--- a/arch/x86/kernel/pci-gart_64.c
+++ b/arch/x86/kernel/pci-gart_64.c
@@ -751,10 +751,10 @@ void __init gart_iommu_init(void)
751 return; 751 return;
752 752
753 if (no_iommu || 753 if (no_iommu ||
754 (!force_iommu && end_pfn <= MAX_DMA32_PFN) || 754 (!force_iommu && max_pfn <= MAX_DMA32_PFN) ||
755 !gart_iommu_aperture || 755 !gart_iommu_aperture ||
756 (no_agp && init_k8_gatt(&info) < 0)) { 756 (no_agp && init_k8_gatt(&info) < 0)) {
757 if (end_pfn > MAX_DMA32_PFN) { 757 if (max_pfn > MAX_DMA32_PFN) {
758 printk(KERN_WARNING "More than 4GB of memory " 758 printk(KERN_WARNING "More than 4GB of memory "
759 "but GART IOMMU not available.\n" 759 "but GART IOMMU not available.\n"
760 KERN_WARNING "falling back to iommu=soft.\n"); 760 KERN_WARNING "falling back to iommu=soft.\n");
diff --git a/arch/x86/kernel/pci-swiotlb_64.c b/arch/x86/kernel/pci-swiotlb_64.c
index 490da7f4b8d0..82299cd1d04d 100644
--- a/arch/x86/kernel/pci-swiotlb_64.c
+++ b/arch/x86/kernel/pci-swiotlb_64.c
@@ -38,7 +38,7 @@ const struct dma_mapping_ops swiotlb_dma_ops = {
38void __init pci_swiotlb_init(void) 38void __init pci_swiotlb_init(void)
39{ 39{
40 /* don't initialize swiotlb if iommu=off (no_iommu=1) */ 40 /* don't initialize swiotlb if iommu=off (no_iommu=1) */
41 if (!iommu_detected && !no_iommu && end_pfn > MAX_DMA32_PFN) 41 if (!iommu_detected && !no_iommu && max_pfn > MAX_DMA32_PFN)
42 swiotlb = 1; 42 swiotlb = 1;
43 if (swiotlb_force) 43 if (swiotlb_force)
44 swiotlb = 1; 44 swiotlb = 1;
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index 6eced2f10734..d5d4b04d48a4 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -49,11 +49,6 @@
49#include <asm/cacheflush.h> 49#include <asm/cacheflush.h>
50 50
51/* 51/*
52 * PFN of last memory page.
53 */
54unsigned long end_pfn;
55
56/*
57 * end_pfn only includes RAM, while max_pfn_mapped includes all e820 entries. 52 * end_pfn only includes RAM, while max_pfn_mapped includes all e820 entries.
58 * The direct mapping extends to max_pfn_mapped, so that we can directly access 53 * The direct mapping extends to max_pfn_mapped, so that we can directly access
59 * apertures, ACPI and other tables without having to play with fixmaps. 54 * apertures, ACPI and other tables without having to play with fixmaps.
@@ -586,9 +581,9 @@ void __init paging_init(void)
586 memset(max_zone_pfns, 0, sizeof(max_zone_pfns)); 581 memset(max_zone_pfns, 0, sizeof(max_zone_pfns));
587 max_zone_pfns[ZONE_DMA] = MAX_DMA_PFN; 582 max_zone_pfns[ZONE_DMA] = MAX_DMA_PFN;
588 max_zone_pfns[ZONE_DMA32] = MAX_DMA32_PFN; 583 max_zone_pfns[ZONE_DMA32] = MAX_DMA32_PFN;
589 max_zone_pfns[ZONE_NORMAL] = end_pfn; 584 max_zone_pfns[ZONE_NORMAL] = max_pfn;
590 585
591 memory_present(0, 0, end_pfn); 586 memory_present(0, 0, max_pfn);
592 sparse_init(); 587 sparse_init();
593 free_area_init_nodes(max_zone_pfns); 588 free_area_init_nodes(max_zone_pfns);
594} 589}
@@ -670,8 +665,8 @@ void __init mem_init(void)
670#else 665#else
671 totalram_pages = free_all_bootmem(); 666 totalram_pages = free_all_bootmem();
672#endif 667#endif
673 reservedpages = end_pfn - totalram_pages - 668 reservedpages = max_pfn - totalram_pages -
674 absent_pages_in_range(0, end_pfn); 669 absent_pages_in_range(0, max_pfn);
675 after_bootmem = 1; 670 after_bootmem = 1;
676 671
677 codesize = (unsigned long) &_etext - (unsigned long) &_text; 672 codesize = (unsigned long) &_etext - (unsigned long) &_text;
@@ -690,7 +685,7 @@ void __init mem_init(void)
690 printk(KERN_INFO "Memory: %luk/%luk available (%ldk kernel code, " 685 printk(KERN_INFO "Memory: %luk/%luk available (%ldk kernel code, "
691 "%ldk reserved, %ldk data, %ldk init)\n", 686 "%ldk reserved, %ldk data, %ldk init)\n",
692 (unsigned long) nr_free_pages() << (PAGE_SHIFT-10), 687 (unsigned long) nr_free_pages() << (PAGE_SHIFT-10),
693 end_pfn << (PAGE_SHIFT-10), 688 max_pfn << (PAGE_SHIFT-10),
694 codesize >> 10, 689 codesize >> 10,
695 reservedpages << (PAGE_SHIFT-10), 690 reservedpages << (PAGE_SHIFT-10),
696 datasize >> 10, 691 datasize >> 10,
@@ -784,7 +779,7 @@ int __init reserve_bootmem_generic(unsigned long phys, unsigned long len,
784#endif 779#endif
785 unsigned long pfn = phys >> PAGE_SHIFT; 780 unsigned long pfn = phys >> PAGE_SHIFT;
786 781
787 if (pfn >= end_pfn) { 782 if (pfn >= max_pfn) {
788 /* 783 /*
789 * This can happen with kdump kernels when accessing 784 * This can happen with kdump kernels when accessing
790 * firmware tables: 785 * firmware tables:
diff --git a/arch/x86/mm/k8topology_64.c b/arch/x86/mm/k8topology_64.c
index 317573ec9256..41f1b5c00a1d 100644
--- a/arch/x86/mm/k8topology_64.c
+++ b/arch/x86/mm/k8topology_64.c
@@ -143,8 +143,8 @@ int __init k8_scan_nodes(unsigned long start, unsigned long end)
143 limit |= (1<<24)-1; 143 limit |= (1<<24)-1;
144 limit++; 144 limit++;
145 145
146 if (limit > end_pfn << PAGE_SHIFT) 146 if (limit > max_pfn << PAGE_SHIFT)
147 limit = end_pfn << PAGE_SHIFT; 147 limit = max_pfn << PAGE_SHIFT;
148 if (limit <= base) 148 if (limit <= base)
149 continue; 149 continue;
150 150
diff --git a/arch/x86/mm/numa_64.c b/arch/x86/mm/numa_64.c
index 316e5f961ef0..b432d5781773 100644
--- a/arch/x86/mm/numa_64.c
+++ b/arch/x86/mm/numa_64.c
@@ -86,7 +86,7 @@ static int __init allocate_cachealigned_memnodemap(void)
86 86
87 addr = 0x8000; 87 addr = 0x8000;
88 nodemap_size = round_up(sizeof(s16) * memnodemapsize, L1_CACHE_BYTES); 88 nodemap_size = round_up(sizeof(s16) * memnodemapsize, L1_CACHE_BYTES);
89 nodemap_addr = find_e820_area(addr, end_pfn<<PAGE_SHIFT, 89 nodemap_addr = find_e820_area(addr, max_pfn<<PAGE_SHIFT,
90 nodemap_size, L1_CACHE_BYTES); 90 nodemap_size, L1_CACHE_BYTES);
91 if (nodemap_addr == -1UL) { 91 if (nodemap_addr == -1UL) {
92 printk(KERN_ERR 92 printk(KERN_ERR
@@ -579,7 +579,7 @@ void __init paging_init(void)
579 memset(max_zone_pfns, 0, sizeof(max_zone_pfns)); 579 memset(max_zone_pfns, 0, sizeof(max_zone_pfns));
580 max_zone_pfns[ZONE_DMA] = MAX_DMA_PFN; 580 max_zone_pfns[ZONE_DMA] = MAX_DMA_PFN;
581 max_zone_pfns[ZONE_DMA32] = MAX_DMA32_PFN; 581 max_zone_pfns[ZONE_DMA32] = MAX_DMA32_PFN;
582 max_zone_pfns[ZONE_NORMAL] = end_pfn; 582 max_zone_pfns[ZONE_NORMAL] = max_pfn;
583 583
584 sparse_memory_present_with_active_regions(MAX_NUMNODES); 584 sparse_memory_present_with_active_regions(MAX_NUMNODES);
585 sparse_init(); 585 sparse_init();
diff --git a/arch/x86/mm/srat_64.c b/arch/x86/mm/srat_64.c
index b67f5a16755f..0fd67b81a8b6 100644
--- a/arch/x86/mm/srat_64.c
+++ b/arch/x86/mm/srat_64.c
@@ -299,7 +299,7 @@ static int __init nodes_cover_memory(const struct bootnode *nodes)
299 pxmram = 0; 299 pxmram = 0;
300 } 300 }
301 301
302 e820ram = end_pfn - absent_pages_in_range(0, end_pfn); 302 e820ram = max_pfn - absent_pages_in_range(0, max_pfn);
303 /* We seem to lose 3 pages somewhere. Allow a bit of slack. */ 303 /* We seem to lose 3 pages somewhere. Allow a bit of slack. */
304 if ((long)(e820ram - pxmram) >= 1*1024*1024) { 304 if ((long)(e820ram - pxmram) >= 1*1024*1024) {
305 printk(KERN_ERR 305 printk(KERN_ERR
diff --git a/arch/x86/power/hibernate_64.c b/arch/x86/power/hibernate_64.c
index b542355e0e34..6dd000dd7933 100644
--- a/arch/x86/power/hibernate_64.c
+++ b/arch/x86/power/hibernate_64.c
@@ -83,7 +83,7 @@ static int set_up_temporary_mappings(void)
83 83
84 /* Set up the direct mapping from scratch */ 84 /* Set up the direct mapping from scratch */
85 start = (unsigned long)pfn_to_kaddr(0); 85 start = (unsigned long)pfn_to_kaddr(0);
86 end = (unsigned long)pfn_to_kaddr(end_pfn); 86 end = (unsigned long)pfn_to_kaddr(max_pfn);
87 87
88 for (; start < end; start = next) { 88 for (; start < end; start = next) {
89 pud_t *pud = (pud_t *)get_safe_page(GFP_ATOMIC); 89 pud_t *pud = (pud_t *)get_safe_page(GFP_ATOMIC);
diff --git a/include/asm-x86/page_64.h b/include/asm-x86/page_64.h
index ac37643078e7..cac5b9e78265 100644
--- a/include/asm-x86/page_64.h
+++ b/include/asm-x86/page_64.h
@@ -58,7 +58,8 @@
58void clear_page(void *page); 58void clear_page(void *page);
59void copy_page(void *to, void *from); 59void copy_page(void *to, void *from);
60 60
61extern unsigned long end_pfn; 61/* duplicated to the one in bootmem.h */
62extern unsigned long max_pfn;
62extern unsigned long phys_base; 63extern unsigned long phys_base;
63 64
64extern unsigned long __phys_addr(unsigned long); 65extern unsigned long __phys_addr(unsigned long);
@@ -87,7 +88,7 @@ extern void initmem_init(unsigned long start_pfn, unsigned long end_pfn);
87#endif /* !__ASSEMBLY__ */ 88#endif /* !__ASSEMBLY__ */
88 89
89#ifdef CONFIG_FLATMEM 90#ifdef CONFIG_FLATMEM
90#define pfn_valid(pfn) ((pfn) < end_pfn) 91#define pfn_valid(pfn) ((pfn) < max_pfn)
91#endif 92#endif
92 93
93 94