diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-17 16:13:16 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-17 16:13:16 -0400 |
commit | d20ead9e86881bc7ae84e385f47b5196b7d93aac (patch) | |
tree | ed27dd5db5f8447e4b3f541f0ec38219085d2f32 /arch/x86/mm | |
parent | c56ec7639288f3e5d6371b0c48d37da93642fc93 (diff) | |
parent | 88e4d250234fc9e64d6ce51df95efdcf8334fd95 (diff) |
Merge ssh://master.kernel.org/pub/scm/linux/kernel/git/tglx/linux-2.6-x86
* ssh://master.kernel.org/pub/scm/linux/kernel/git/tglx/linux-2.6-x86: (114 commits)
x86: delete vsyscall files during make clean
kbuild: fix typo SRCARCH in find_sources
x86: fix kernel rebuild due to vsyscall fallout
.gitignore update for x86 arch
x86: unify include/asm/debugreg_32/64.h
x86: unify include/asm/unwind_32/64.h
x86: unify include/asm/types_32/64.h
x86: unify include/asm/tlb_32/64.h
x86: unify include/asm/siginfo_32/64.h
x86: unify include/asm/bug_32/64.h
x86: unify include/asm/mman_32/64.h
x86: unify include/asm/agp_32/64.h
x86: unify include/asm/kdebug_32/64.h
x86: unify include/asm/ioctls_32/64.h
x86: unify include/asm/floppy_32/64.h
x86: apply missing DMA/OOM prevention to floppy_32.h
x86: unify include/asm/cache_32/64.h
x86: unify include/asm/cache_32/64.h
x86: unify include/asm/dmi_32/64.h
x86: unify include/asm/delay_32/64.h
...
Diffstat (limited to 'arch/x86/mm')
-rw-r--r-- | arch/x86/mm/discontig_32.c | 10 | ||||
-rw-r--r-- | arch/x86/mm/fault_32.c | 17 | ||||
-rw-r--r-- | arch/x86/mm/init_32.c | 11 | ||||
-rw-r--r-- | arch/x86/mm/numa_64.c | 6 | ||||
-rw-r--r-- | arch/x86/mm/pageattr_32.c | 4 | ||||
-rw-r--r-- | arch/x86/mm/pageattr_64.c | 3 | ||||
-rw-r--r-- | arch/x86/mm/pgtable_32.c | 6 | ||||
-rw-r--r-- | arch/x86/mm/srat_64.c | 4 |
8 files changed, 36 insertions, 25 deletions
diff --git a/arch/x86/mm/discontig_32.c b/arch/x86/mm/discontig_32.c index b1e45457d4ef..13893772cc48 100644 --- a/arch/x86/mm/discontig_32.c +++ b/arch/x86/mm/discontig_32.c | |||
@@ -103,14 +103,14 @@ extern unsigned long highend_pfn, highstart_pfn; | |||
103 | 103 | ||
104 | #define LARGE_PAGE_BYTES (PTRS_PER_PTE * PAGE_SIZE) | 104 | #define LARGE_PAGE_BYTES (PTRS_PER_PTE * PAGE_SIZE) |
105 | 105 | ||
106 | unsigned long node_remap_start_pfn[MAX_NUMNODES]; | 106 | static unsigned long node_remap_start_pfn[MAX_NUMNODES]; |
107 | unsigned long node_remap_size[MAX_NUMNODES]; | 107 | unsigned long node_remap_size[MAX_NUMNODES]; |
108 | unsigned long node_remap_offset[MAX_NUMNODES]; | 108 | static unsigned long node_remap_offset[MAX_NUMNODES]; |
109 | void *node_remap_start_vaddr[MAX_NUMNODES]; | 109 | static void *node_remap_start_vaddr[MAX_NUMNODES]; |
110 | void set_pmd_pfn(unsigned long vaddr, unsigned long pfn, pgprot_t flags); | 110 | void set_pmd_pfn(unsigned long vaddr, unsigned long pfn, pgprot_t flags); |
111 | 111 | ||
112 | void *node_remap_end_vaddr[MAX_NUMNODES]; | 112 | static void *node_remap_end_vaddr[MAX_NUMNODES]; |
113 | void *node_remap_alloc_vaddr[MAX_NUMNODES]; | 113 | static void *node_remap_alloc_vaddr[MAX_NUMNODES]; |
114 | static unsigned long kva_start_pfn; | 114 | static unsigned long kva_start_pfn; |
115 | static unsigned long kva_pages; | 115 | static unsigned long kva_pages; |
116 | /* | 116 | /* |
diff --git a/arch/x86/mm/fault_32.c b/arch/x86/mm/fault_32.c index c686ae20fd6b..6555c3d14371 100644 --- a/arch/x86/mm/fault_32.c +++ b/arch/x86/mm/fault_32.c | |||
@@ -105,7 +105,7 @@ static inline unsigned long get_segment_eip(struct pt_regs *regs, | |||
105 | LDT and other horrors are only used in user space. */ | 105 | LDT and other horrors are only used in user space. */ |
106 | if (seg & (1<<2)) { | 106 | if (seg & (1<<2)) { |
107 | /* Must lock the LDT while reading it. */ | 107 | /* Must lock the LDT while reading it. */ |
108 | down(¤t->mm->context.sem); | 108 | mutex_lock(¤t->mm->context.lock); |
109 | desc = current->mm->context.ldt; | 109 | desc = current->mm->context.ldt; |
110 | desc = (void *)desc + (seg & ~7); | 110 | desc = (void *)desc + (seg & ~7); |
111 | } else { | 111 | } else { |
@@ -118,7 +118,7 @@ static inline unsigned long get_segment_eip(struct pt_regs *regs, | |||
118 | base = get_desc_base((unsigned long *)desc); | 118 | base = get_desc_base((unsigned long *)desc); |
119 | 119 | ||
120 | if (seg & (1<<2)) { | 120 | if (seg & (1<<2)) { |
121 | up(¤t->mm->context.sem); | 121 | mutex_unlock(¤t->mm->context.lock); |
122 | } else | 122 | } else |
123 | put_cpu(); | 123 | put_cpu(); |
124 | 124 | ||
@@ -539,23 +539,22 @@ no_context: | |||
539 | printk(KERN_ALERT "BUG: unable to handle kernel paging" | 539 | printk(KERN_ALERT "BUG: unable to handle kernel paging" |
540 | " request"); | 540 | " request"); |
541 | printk(" at virtual address %08lx\n",address); | 541 | printk(" at virtual address %08lx\n",address); |
542 | printk(KERN_ALERT " printing eip:\n"); | 542 | printk(KERN_ALERT "printing eip: %08lx ", regs->eip); |
543 | printk("%08lx\n", regs->eip); | ||
544 | 543 | ||
545 | page = read_cr3(); | 544 | page = read_cr3(); |
546 | page = ((__typeof__(page) *) __va(page))[address >> PGDIR_SHIFT]; | 545 | page = ((__typeof__(page) *) __va(page))[address >> PGDIR_SHIFT]; |
547 | #ifdef CONFIG_X86_PAE | 546 | #ifdef CONFIG_X86_PAE |
548 | printk(KERN_ALERT "*pdpt = %016Lx\n", page); | 547 | printk("*pdpt = %016Lx ", page); |
549 | if ((page >> PAGE_SHIFT) < max_low_pfn | 548 | if ((page >> PAGE_SHIFT) < max_low_pfn |
550 | && page & _PAGE_PRESENT) { | 549 | && page & _PAGE_PRESENT) { |
551 | page &= PAGE_MASK; | 550 | page &= PAGE_MASK; |
552 | page = ((__typeof__(page) *) __va(page))[(address >> PMD_SHIFT) | 551 | page = ((__typeof__(page) *) __va(page))[(address >> PMD_SHIFT) |
553 | & (PTRS_PER_PMD - 1)]; | 552 | & (PTRS_PER_PMD - 1)]; |
554 | printk(KERN_ALERT "*pde = %016Lx\n", page); | 553 | printk(KERN_ALERT "*pde = %016Lx ", page); |
555 | page &= ~_PAGE_NX; | 554 | page &= ~_PAGE_NX; |
556 | } | 555 | } |
557 | #else | 556 | #else |
558 | printk(KERN_ALERT "*pde = %08lx\n", page); | 557 | printk("*pde = %08lx ", page); |
559 | #endif | 558 | #endif |
560 | 559 | ||
561 | /* | 560 | /* |
@@ -569,8 +568,10 @@ no_context: | |||
569 | page &= PAGE_MASK; | 568 | page &= PAGE_MASK; |
570 | page = ((__typeof__(page) *) __va(page))[(address >> PAGE_SHIFT) | 569 | page = ((__typeof__(page) *) __va(page))[(address >> PAGE_SHIFT) |
571 | & (PTRS_PER_PTE - 1)]; | 570 | & (PTRS_PER_PTE - 1)]; |
572 | printk(KERN_ALERT "*pte = %0*Lx\n", sizeof(page)*2, (u64)page); | 571 | printk("*pte = %0*Lx ", sizeof(page)*2, (u64)page); |
573 | } | 572 | } |
573 | |||
574 | printk("\n"); | ||
574 | } | 575 | } |
575 | 576 | ||
576 | tsk->thread.cr2 = address; | 577 | tsk->thread.cr2 = address; |
diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c index 33d367a3432e..c7d19471261d 100644 --- a/arch/x86/mm/init_32.c +++ b/arch/x86/mm/init_32.c | |||
@@ -85,13 +85,20 @@ static pmd_t * __init one_md_table_init(pgd_t *pgd) | |||
85 | static pte_t * __init one_page_table_init(pmd_t *pmd) | 85 | static pte_t * __init one_page_table_init(pmd_t *pmd) |
86 | { | 86 | { |
87 | if (!(pmd_val(*pmd) & _PAGE_PRESENT)) { | 87 | if (!(pmd_val(*pmd) & _PAGE_PRESENT)) { |
88 | pte_t *page_table = (pte_t *) alloc_bootmem_low_pages(PAGE_SIZE); | 88 | pte_t *page_table = NULL; |
89 | |||
90 | #ifdef CONFIG_DEBUG_PAGEALLOC | ||
91 | page_table = (pte_t *) alloc_bootmem_pages(PAGE_SIZE); | ||
92 | #endif | ||
93 | if (!page_table) | ||
94 | page_table = | ||
95 | (pte_t *)alloc_bootmem_low_pages(PAGE_SIZE); | ||
89 | 96 | ||
90 | paravirt_alloc_pt(&init_mm, __pa(page_table) >> PAGE_SHIFT); | 97 | paravirt_alloc_pt(&init_mm, __pa(page_table) >> PAGE_SHIFT); |
91 | set_pmd(pmd, __pmd(__pa(page_table) | _PAGE_TABLE)); | 98 | set_pmd(pmd, __pmd(__pa(page_table) | _PAGE_TABLE)); |
92 | BUG_ON(page_table != pte_offset_kernel(pmd, 0)); | 99 | BUG_ON(page_table != pte_offset_kernel(pmd, 0)); |
93 | } | 100 | } |
94 | 101 | ||
95 | return pte_offset_kernel(pmd, 0); | 102 | return pte_offset_kernel(pmd, 0); |
96 | } | 103 | } |
97 | 104 | ||
diff --git a/arch/x86/mm/numa_64.c b/arch/x86/mm/numa_64.c index 6da235522269..5eec5e56d07f 100644 --- a/arch/x86/mm/numa_64.c +++ b/arch/x86/mm/numa_64.c | |||
@@ -166,7 +166,7 @@ early_node_mem(int nodeid, unsigned long start, unsigned long end, | |||
166 | return __va(mem); | 166 | return __va(mem); |
167 | ptr = __alloc_bootmem_nopanic(size, | 167 | ptr = __alloc_bootmem_nopanic(size, |
168 | SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS)); | 168 | SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS)); |
169 | if (ptr == 0) { | 169 | if (ptr == NULL) { |
170 | printk(KERN_ERR "Cannot find %lu bytes in node %d\n", | 170 | printk(KERN_ERR "Cannot find %lu bytes in node %d\n", |
171 | size, nodeid); | 171 | size, nodeid); |
172 | return NULL; | 172 | return NULL; |
@@ -261,7 +261,7 @@ void __init numa_init_array(void) | |||
261 | We round robin the existing nodes. */ | 261 | We round robin the existing nodes. */ |
262 | rr = first_node(node_online_map); | 262 | rr = first_node(node_online_map); |
263 | for (i = 0; i < NR_CPUS; i++) { | 263 | for (i = 0; i < NR_CPUS; i++) { |
264 | if (cpu_to_node[i] != NUMA_NO_NODE) | 264 | if (cpu_to_node(i) != NUMA_NO_NODE) |
265 | continue; | 265 | continue; |
266 | numa_set_node(i, rr); | 266 | numa_set_node(i, rr); |
267 | rr = next_node(rr, node_online_map); | 267 | rr = next_node(rr, node_online_map); |
@@ -543,7 +543,7 @@ __cpuinit void numa_add_cpu(int cpu) | |||
543 | void __cpuinit numa_set_node(int cpu, int node) | 543 | void __cpuinit numa_set_node(int cpu, int node) |
544 | { | 544 | { |
545 | cpu_pda(cpu)->nodenumber = node; | 545 | cpu_pda(cpu)->nodenumber = node; |
546 | cpu_to_node[cpu] = node; | 546 | cpu_to_node(cpu) = node; |
547 | } | 547 | } |
548 | 548 | ||
549 | unsigned long __init numa_free_all_bootmem(void) | 549 | unsigned long __init numa_free_all_bootmem(void) |
diff --git a/arch/x86/mm/pageattr_32.c b/arch/x86/mm/pageattr_32.c index 4241a74d16c8..260073c07600 100644 --- a/arch/x86/mm/pageattr_32.c +++ b/arch/x86/mm/pageattr_32.c | |||
@@ -70,10 +70,10 @@ static struct page *split_large_page(unsigned long address, pgprot_t prot, | |||
70 | 70 | ||
71 | static void cache_flush_page(struct page *p) | 71 | static void cache_flush_page(struct page *p) |
72 | { | 72 | { |
73 | unsigned long adr = (unsigned long)page_address(p); | 73 | void *adr = page_address(p); |
74 | int i; | 74 | int i; |
75 | for (i = 0; i < PAGE_SIZE; i += boot_cpu_data.x86_clflush_size) | 75 | for (i = 0; i < PAGE_SIZE; i += boot_cpu_data.x86_clflush_size) |
76 | asm volatile("clflush (%0)" :: "r" (adr + i)); | 76 | clflush(adr+i); |
77 | } | 77 | } |
78 | 78 | ||
79 | static void flush_kernel_map(void *arg) | 79 | static void flush_kernel_map(void *arg) |
diff --git a/arch/x86/mm/pageattr_64.c b/arch/x86/mm/pageattr_64.c index 10b9809ce821..8a4f65bf956e 100644 --- a/arch/x86/mm/pageattr_64.c +++ b/arch/x86/mm/pageattr_64.c | |||
@@ -65,7 +65,7 @@ static void cache_flush_page(void *adr) | |||
65 | { | 65 | { |
66 | int i; | 66 | int i; |
67 | for (i = 0; i < PAGE_SIZE; i += boot_cpu_data.x86_clflush_size) | 67 | for (i = 0; i < PAGE_SIZE; i += boot_cpu_data.x86_clflush_size) |
68 | asm volatile("clflush (%0)" :: "r" (adr + i)); | 68 | clflush(adr+i); |
69 | } | 69 | } |
70 | 70 | ||
71 | static void flush_kernel_map(void *arg) | 71 | static void flush_kernel_map(void *arg) |
@@ -148,6 +148,7 @@ __change_page_attr(unsigned long address, unsigned long pfn, pgprot_t prot, | |||
148 | split = split_large_page(address, prot, ref_prot2); | 148 | split = split_large_page(address, prot, ref_prot2); |
149 | if (!split) | 149 | if (!split) |
150 | return -ENOMEM; | 150 | return -ENOMEM; |
151 | pgprot_val(ref_prot2) &= ~_PAGE_NX; | ||
151 | set_pte(kpte, mk_pte(split, ref_prot2)); | 152 | set_pte(kpte, mk_pte(split, ref_prot2)); |
152 | kpte_page = split; | 153 | kpte_page = split; |
153 | } | 154 | } |
diff --git a/arch/x86/mm/pgtable_32.c b/arch/x86/mm/pgtable_32.c index ef1f6cd3ea66..be61a1d845a4 100644 --- a/arch/x86/mm/pgtable_32.c +++ b/arch/x86/mm/pgtable_32.c | |||
@@ -6,6 +6,7 @@ | |||
6 | #include <linux/kernel.h> | 6 | #include <linux/kernel.h> |
7 | #include <linux/errno.h> | 7 | #include <linux/errno.h> |
8 | #include <linux/mm.h> | 8 | #include <linux/mm.h> |
9 | #include <linux/nmi.h> | ||
9 | #include <linux/swap.h> | 10 | #include <linux/swap.h> |
10 | #include <linux/smp.h> | 11 | #include <linux/smp.h> |
11 | #include <linux/highmem.h> | 12 | #include <linux/highmem.h> |
@@ -39,6 +40,8 @@ void show_mem(void) | |||
39 | for_each_online_pgdat(pgdat) { | 40 | for_each_online_pgdat(pgdat) { |
40 | pgdat_resize_lock(pgdat, &flags); | 41 | pgdat_resize_lock(pgdat, &flags); |
41 | for (i = 0; i < pgdat->node_spanned_pages; ++i) { | 42 | for (i = 0; i < pgdat->node_spanned_pages; ++i) { |
43 | if (unlikely(i % MAX_ORDER_NR_PAGES == 0)) | ||
44 | touch_nmi_watchdog(); | ||
42 | page = pgdat_page_nr(pgdat, i); | 45 | page = pgdat_page_nr(pgdat, i); |
43 | total++; | 46 | total++; |
44 | if (PageHighMem(page)) | 47 | if (PageHighMem(page)) |
@@ -97,8 +100,7 @@ static void set_pte_pfn(unsigned long vaddr, unsigned long pfn, pgprot_t flags) | |||
97 | } | 100 | } |
98 | pte = pte_offset_kernel(pmd, vaddr); | 101 | pte = pte_offset_kernel(pmd, vaddr); |
99 | if (pgprot_val(flags)) | 102 | if (pgprot_val(flags)) |
100 | /* <pfn,flags> stored as-is, to permit clearing entries */ | 103 | set_pte_present(&init_mm, vaddr, pte, pfn_pte(pfn, flags)); |
101 | set_pte(pte, pfn_pte(pfn, flags)); | ||
102 | else | 104 | else |
103 | pte_clear(&init_mm, vaddr, pte); | 105 | pte_clear(&init_mm, vaddr, pte); |
104 | 106 | ||
diff --git a/arch/x86/mm/srat_64.c b/arch/x86/mm/srat_64.c index acdf03e19146..56089ccc3949 100644 --- a/arch/x86/mm/srat_64.c +++ b/arch/x86/mm/srat_64.c | |||
@@ -431,9 +431,9 @@ int __init acpi_scan_nodes(unsigned long start, unsigned long end) | |||
431 | setup_node_bootmem(i, nodes[i].start, nodes[i].end); | 431 | setup_node_bootmem(i, nodes[i].start, nodes[i].end); |
432 | 432 | ||
433 | for (i = 0; i < NR_CPUS; i++) { | 433 | for (i = 0; i < NR_CPUS; i++) { |
434 | if (cpu_to_node[i] == NUMA_NO_NODE) | 434 | if (cpu_to_node(i) == NUMA_NO_NODE) |
435 | continue; | 435 | continue; |
436 | if (!node_isset(cpu_to_node[i], node_possible_map)) | 436 | if (!node_isset(cpu_to_node(i), node_possible_map)) |
437 | numa_set_node(i, NUMA_NO_NODE); | 437 | numa_set_node(i, NUMA_NO_NODE); |
438 | } | 438 | } |
439 | numa_init_array(); | 439 | numa_init_array(); |