diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-03-10 05:16:17 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-03-10 05:17:48 -0400 |
commit | 8293dd6f86e759068ce918aa10ca9c5d6d711cd0 (patch) | |
tree | de366d69078bf2b98c6765fa4ec1cc652f3d3173 /arch/x86/mm | |
parent | 631595fbf4aeac260e664a8a002897e4db6a50dd (diff) | |
parent | 467c88fee51e2ae862e9485245687da0730e29aa (diff) |
Merge branch 'x86/core' into tracing/ftrace
Semantic merge:
kernel/trace/trace_functions_graph.c
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/mm')
-rw-r--r-- | arch/x86/mm/init.c | 2 | ||||
-rw-r--r-- | arch/x86/mm/init_32.c | 23 | ||||
-rw-r--r-- | arch/x86/mm/init_64.c | 8 | ||||
-rw-r--r-- | arch/x86/mm/ioremap.c | 21 | ||||
-rw-r--r-- | arch/x86/mm/kmmio.c | 15 | ||||
-rw-r--r-- | arch/x86/mm/memtest.c | 3 |
6 files changed, 43 insertions, 29 deletions
diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c index 6d63e3d1253d..15219e0d1243 100644 --- a/arch/x86/mm/init.c +++ b/arch/x86/mm/init.c | |||
@@ -134,8 +134,8 @@ unsigned long __init_refok init_memory_mapping(unsigned long start, | |||
134 | { | 134 | { |
135 | unsigned long page_size_mask = 0; | 135 | unsigned long page_size_mask = 0; |
136 | unsigned long start_pfn, end_pfn; | 136 | unsigned long start_pfn, end_pfn; |
137 | unsigned long ret = 0; | ||
137 | unsigned long pos; | 138 | unsigned long pos; |
138 | unsigned long ret; | ||
139 | 139 | ||
140 | struct map_range mr[NR_RANGE_MR]; | 140 | struct map_range mr[NR_RANGE_MR]; |
141 | int nr_range, i; | 141 | int nr_range, i; |
diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c index d7f5060ab21c..749559ed80f5 100644 --- a/arch/x86/mm/init_32.c +++ b/arch/x86/mm/init_32.c | |||
@@ -806,11 +806,6 @@ static unsigned long __init setup_node_bootmem(int nodeid, | |||
806 | { | 806 | { |
807 | unsigned long bootmap_size; | 807 | unsigned long bootmap_size; |
808 | 808 | ||
809 | if (start_pfn > max_low_pfn) | ||
810 | return bootmap; | ||
811 | if (end_pfn > max_low_pfn) | ||
812 | end_pfn = max_low_pfn; | ||
813 | |||
814 | /* don't touch min_low_pfn */ | 809 | /* don't touch min_low_pfn */ |
815 | bootmap_size = init_bootmem_node(NODE_DATA(nodeid), | 810 | bootmap_size = init_bootmem_node(NODE_DATA(nodeid), |
816 | bootmap >> PAGE_SHIFT, | 811 | bootmap >> PAGE_SHIFT, |
@@ -843,13 +838,23 @@ void __init setup_bootmem_allocator(void) | |||
843 | max_pfn_mapped<<PAGE_SHIFT); | 838 | max_pfn_mapped<<PAGE_SHIFT); |
844 | printk(KERN_INFO " low ram: 0 - %08lx\n", max_low_pfn<<PAGE_SHIFT); | 839 | printk(KERN_INFO " low ram: 0 - %08lx\n", max_low_pfn<<PAGE_SHIFT); |
845 | 840 | ||
841 | for_each_online_node(nodeid) { | ||
842 | unsigned long start_pfn, end_pfn; | ||
843 | |||
846 | #ifdef CONFIG_NEED_MULTIPLE_NODES | 844 | #ifdef CONFIG_NEED_MULTIPLE_NODES |
847 | for_each_online_node(nodeid) | 845 | start_pfn = node_start_pfn[nodeid]; |
848 | bootmap = setup_node_bootmem(nodeid, node_start_pfn[nodeid], | 846 | end_pfn = node_end_pfn[nodeid]; |
849 | node_end_pfn[nodeid], bootmap); | 847 | if (start_pfn > max_low_pfn) |
848 | continue; | ||
849 | if (end_pfn > max_low_pfn) | ||
850 | end_pfn = max_low_pfn; | ||
850 | #else | 851 | #else |
851 | bootmap = setup_node_bootmem(0, 0, max_low_pfn, bootmap); | 852 | start_pfn = 0; |
853 | end_pfn = max_low_pfn; | ||
852 | #endif | 854 | #endif |
855 | bootmap = setup_node_bootmem(nodeid, start_pfn, end_pfn, | ||
856 | bootmap); | ||
857 | } | ||
853 | 858 | ||
854 | after_bootmem = 1; | 859 | after_bootmem = 1; |
855 | } | 860 | } |
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c index 66d6be85df82..1753e8020df6 100644 --- a/arch/x86/mm/init_64.c +++ b/arch/x86/mm/init_64.c | |||
@@ -85,7 +85,7 @@ early_param("gbpages", parse_direct_gbpages_on); | |||
85 | pteval_t __supported_pte_mask __read_mostly = ~_PAGE_IOMAP; | 85 | pteval_t __supported_pte_mask __read_mostly = ~_PAGE_IOMAP; |
86 | EXPORT_SYMBOL_GPL(__supported_pte_mask); | 86 | EXPORT_SYMBOL_GPL(__supported_pte_mask); |
87 | 87 | ||
88 | static int do_not_nx __cpuinitdata; | 88 | static int disable_nx __cpuinitdata; |
89 | 89 | ||
90 | /* | 90 | /* |
91 | * noexec=on|off | 91 | * noexec=on|off |
@@ -100,9 +100,9 @@ static int __init nonx_setup(char *str) | |||
100 | return -EINVAL; | 100 | return -EINVAL; |
101 | if (!strncmp(str, "on", 2)) { | 101 | if (!strncmp(str, "on", 2)) { |
102 | __supported_pte_mask |= _PAGE_NX; | 102 | __supported_pte_mask |= _PAGE_NX; |
103 | do_not_nx = 0; | 103 | disable_nx = 0; |
104 | } else if (!strncmp(str, "off", 3)) { | 104 | } else if (!strncmp(str, "off", 3)) { |
105 | do_not_nx = 1; | 105 | disable_nx = 1; |
106 | __supported_pte_mask &= ~_PAGE_NX; | 106 | __supported_pte_mask &= ~_PAGE_NX; |
107 | } | 107 | } |
108 | return 0; | 108 | return 0; |
@@ -114,7 +114,7 @@ void __cpuinit check_efer(void) | |||
114 | unsigned long efer; | 114 | unsigned long efer; |
115 | 115 | ||
116 | rdmsrl(MSR_EFER, efer); | 116 | rdmsrl(MSR_EFER, efer); |
117 | if (!(efer & EFER_NX) || do_not_nx) | 117 | if (!(efer & EFER_NX) || disable_nx) |
118 | __supported_pte_mask &= ~_PAGE_NX; | 118 | __supported_pte_mask &= ~_PAGE_NX; |
119 | } | 119 | } |
120 | 120 | ||
diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c index 62773abdf088..aca924a30ee6 100644 --- a/arch/x86/mm/ioremap.c +++ b/arch/x86/mm/ioremap.c | |||
@@ -87,6 +87,8 @@ bool __virt_addr_valid(unsigned long x) | |||
87 | return false; | 87 | return false; |
88 | if (__vmalloc_start_set && is_vmalloc_addr((void *) x)) | 88 | if (__vmalloc_start_set && is_vmalloc_addr((void *) x)) |
89 | return false; | 89 | return false; |
90 | if (x >= FIXADDR_START) | ||
91 | return false; | ||
90 | return pfn_valid((x - PAGE_OFFSET) >> PAGE_SHIFT); | 92 | return pfn_valid((x - PAGE_OFFSET) >> PAGE_SHIFT); |
91 | } | 93 | } |
92 | EXPORT_SYMBOL(__virt_addr_valid); | 94 | EXPORT_SYMBOL(__virt_addr_valid); |
@@ -504,13 +506,19 @@ static inline pte_t * __init early_ioremap_pte(unsigned long addr) | |||
504 | return &bm_pte[pte_index(addr)]; | 506 | return &bm_pte[pte_index(addr)]; |
505 | } | 507 | } |
506 | 508 | ||
509 | static unsigned long slot_virt[FIX_BTMAPS_SLOTS] __initdata; | ||
510 | |||
507 | void __init early_ioremap_init(void) | 511 | void __init early_ioremap_init(void) |
508 | { | 512 | { |
509 | pmd_t *pmd; | 513 | pmd_t *pmd; |
514 | int i; | ||
510 | 515 | ||
511 | if (early_ioremap_debug) | 516 | if (early_ioremap_debug) |
512 | printk(KERN_INFO "early_ioremap_init()\n"); | 517 | printk(KERN_INFO "early_ioremap_init()\n"); |
513 | 518 | ||
519 | for (i = 0; i < FIX_BTMAPS_SLOTS; i++) | ||
520 | slot_virt[i] = fix_to_virt(FIX_BTMAP_BEGIN - NR_FIX_BTMAPS*i); | ||
521 | |||
514 | pmd = early_ioremap_pmd(fix_to_virt(FIX_BTMAP_BEGIN)); | 522 | pmd = early_ioremap_pmd(fix_to_virt(FIX_BTMAP_BEGIN)); |
515 | memset(bm_pte, 0, sizeof(bm_pte)); | 523 | memset(bm_pte, 0, sizeof(bm_pte)); |
516 | pmd_populate_kernel(&init_mm, pmd, bm_pte); | 524 | pmd_populate_kernel(&init_mm, pmd, bm_pte); |
@@ -577,6 +585,7 @@ static inline void __init early_clear_fixmap(enum fixed_addresses idx) | |||
577 | 585 | ||
578 | static void __iomem *prev_map[FIX_BTMAPS_SLOTS] __initdata; | 586 | static void __iomem *prev_map[FIX_BTMAPS_SLOTS] __initdata; |
579 | static unsigned long prev_size[FIX_BTMAPS_SLOTS] __initdata; | 587 | static unsigned long prev_size[FIX_BTMAPS_SLOTS] __initdata; |
588 | |||
580 | static int __init check_early_ioremap_leak(void) | 589 | static int __init check_early_ioremap_leak(void) |
581 | { | 590 | { |
582 | int count = 0; | 591 | int count = 0; |
@@ -598,7 +607,8 @@ static int __init check_early_ioremap_leak(void) | |||
598 | } | 607 | } |
599 | late_initcall(check_early_ioremap_leak); | 608 | late_initcall(check_early_ioremap_leak); |
600 | 609 | ||
601 | static void __init __iomem *__early_ioremap(unsigned long phys_addr, unsigned long size, pgprot_t prot) | 610 | static void __init __iomem * |
611 | __early_ioremap(unsigned long phys_addr, unsigned long size, pgprot_t prot) | ||
602 | { | 612 | { |
603 | unsigned long offset, last_addr; | 613 | unsigned long offset, last_addr; |
604 | unsigned int nrpages; | 614 | unsigned int nrpages; |
@@ -664,9 +674,9 @@ static void __init __iomem *__early_ioremap(unsigned long phys_addr, unsigned lo | |||
664 | --nrpages; | 674 | --nrpages; |
665 | } | 675 | } |
666 | if (early_ioremap_debug) | 676 | if (early_ioremap_debug) |
667 | printk(KERN_CONT "%08lx + %08lx\n", offset, fix_to_virt(idx0)); | 677 | printk(KERN_CONT "%08lx + %08lx\n", offset, slot_virt[slot]); |
668 | 678 | ||
669 | prev_map[slot] = (void __iomem *)(offset + fix_to_virt(idx0)); | 679 | prev_map[slot] = (void __iomem *)(offset + slot_virt[slot]); |
670 | return prev_map[slot]; | 680 | return prev_map[slot]; |
671 | } | 681 | } |
672 | 682 | ||
@@ -734,8 +744,3 @@ void __init early_iounmap(void __iomem *addr, unsigned long size) | |||
734 | } | 744 | } |
735 | prev_map[slot] = NULL; | 745 | prev_map[slot] = NULL; |
736 | } | 746 | } |
737 | |||
738 | void __this_fixmap_does_not_exist(void) | ||
739 | { | ||
740 | WARN_ON(1); | ||
741 | } | ||
diff --git a/arch/x86/mm/kmmio.c b/arch/x86/mm/kmmio.c index 9f205030d9aa..6a518dd08a36 100644 --- a/arch/x86/mm/kmmio.c +++ b/arch/x86/mm/kmmio.c | |||
@@ -451,23 +451,24 @@ static void rcu_free_kmmio_fault_pages(struct rcu_head *head) | |||
451 | 451 | ||
452 | static void remove_kmmio_fault_pages(struct rcu_head *head) | 452 | static void remove_kmmio_fault_pages(struct rcu_head *head) |
453 | { | 453 | { |
454 | struct kmmio_delayed_release *dr = container_of( | 454 | struct kmmio_delayed_release *dr = |
455 | head, | 455 | container_of(head, struct kmmio_delayed_release, rcu); |
456 | struct kmmio_delayed_release, | ||
457 | rcu); | ||
458 | struct kmmio_fault_page *p = dr->release_list; | 456 | struct kmmio_fault_page *p = dr->release_list; |
459 | struct kmmio_fault_page **prevp = &dr->release_list; | 457 | struct kmmio_fault_page **prevp = &dr->release_list; |
460 | unsigned long flags; | 458 | unsigned long flags; |
459 | |||
461 | spin_lock_irqsave(&kmmio_lock, flags); | 460 | spin_lock_irqsave(&kmmio_lock, flags); |
462 | while (p) { | 461 | while (p) { |
463 | if (!p->count) | 462 | if (!p->count) { |
464 | list_del_rcu(&p->list); | 463 | list_del_rcu(&p->list); |
465 | else | 464 | prevp = &p->release_next; |
465 | } else { | ||
466 | *prevp = p->release_next; | 466 | *prevp = p->release_next; |
467 | prevp = &p->release_next; | 467 | } |
468 | p = p->release_next; | 468 | p = p->release_next; |
469 | } | 469 | } |
470 | spin_unlock_irqrestore(&kmmio_lock, flags); | 470 | spin_unlock_irqrestore(&kmmio_lock, flags); |
471 | |||
471 | /* This is the real RCU destroy call. */ | 472 | /* This is the real RCU destroy call. */ |
472 | call_rcu(&dr->rcu, rcu_free_kmmio_fault_pages); | 473 | call_rcu(&dr->rcu, rcu_free_kmmio_fault_pages); |
473 | } | 474 | } |
diff --git a/arch/x86/mm/memtest.c b/arch/x86/mm/memtest.c index 0bcd7883d036..605c8be06217 100644 --- a/arch/x86/mm/memtest.c +++ b/arch/x86/mm/memtest.c | |||
@@ -100,6 +100,9 @@ static int __init parse_memtest(char *arg) | |||
100 | { | 100 | { |
101 | if (arg) | 101 | if (arg) |
102 | memtest_pattern = simple_strtoul(arg, NULL, 0); | 102 | memtest_pattern = simple_strtoul(arg, NULL, 0); |
103 | else | ||
104 | memtest_pattern = ARRAY_SIZE(patterns); | ||
105 | |||
103 | return 0; | 106 | return 0; |
104 | } | 107 | } |
105 | 108 | ||