aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/mm
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/mm')
-rw-r--r--arch/mips/mm/c-octeon.c2
-rw-r--r--arch/mips/mm/fault.c12
-rw-r--r--arch/mips/mm/init.c12
-rw-r--r--arch/mips/mm/pgtable-64.c3
-rw-r--r--arch/mips/mm/tlb-r4k.c2
-rw-r--r--arch/mips/mm/tlbex.c53
6 files changed, 19 insertions, 65 deletions
diff --git a/arch/mips/mm/c-octeon.c b/arch/mips/mm/c-octeon.c
index 10ab69f7183f..94e05e5733c1 100644
--- a/arch/mips/mm/c-octeon.c
+++ b/arch/mips/mm/c-octeon.c
@@ -79,7 +79,7 @@ static void octeon_flush_icache_all_cores(struct vm_area_struct *vma)
79 * cores it has been used on 79 * cores it has been used on
80 */ 80 */
81 if (vma) 81 if (vma)
82 mask = vma->vm_mm->cpu_vm_mask; 82 mask = *mm_cpumask(vma->vm_mm);
83 else 83 else
84 mask = cpu_online_map; 84 mask = cpu_online_map;
85 cpu_clear(cpu, mask); 85 cpu_clear(cpu, mask);
diff --git a/arch/mips/mm/fault.c b/arch/mips/mm/fault.c
index f956ecbb8136..e97a7a2fb2c0 100644
--- a/arch/mips/mm/fault.c
+++ b/arch/mips/mm/fault.c
@@ -58,11 +58,17 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long write,
58 * only copy the information from the master page table, 58 * only copy the information from the master page table,
59 * nothing more. 59 * nothing more.
60 */ 60 */
61#ifdef CONFIG_64BIT
62# define VMALLOC_FAULT_TARGET no_context
63#else
64# define VMALLOC_FAULT_TARGET vmalloc_fault
65#endif
66
61 if (unlikely(address >= VMALLOC_START && address <= VMALLOC_END)) 67 if (unlikely(address >= VMALLOC_START && address <= VMALLOC_END))
62 goto vmalloc_fault; 68 goto VMALLOC_FAULT_TARGET;
63#ifdef MODULE_START 69#ifdef MODULE_START
64 if (unlikely(address >= MODULE_START && address < MODULE_END)) 70 if (unlikely(address >= MODULE_START && address < MODULE_END))
65 goto vmalloc_fault; 71 goto VMALLOC_FAULT_TARGET;
66#endif 72#endif
67 73
68 /* 74 /*
@@ -203,6 +209,7 @@ do_sigbus:
203 force_sig_info(SIGBUS, &info, tsk); 209 force_sig_info(SIGBUS, &info, tsk);
204 210
205 return; 211 return;
212#ifndef CONFIG_64BIT
206vmalloc_fault: 213vmalloc_fault:
207 { 214 {
208 /* 215 /*
@@ -241,4 +248,5 @@ vmalloc_fault:
241 goto no_context; 248 goto no_context;
242 return; 249 return;
243 } 250 }
251#endif
244} 252}
diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c
index 0e820508ff23..15aa1902a788 100644
--- a/arch/mips/mm/init.c
+++ b/arch/mips/mm/init.c
@@ -352,7 +352,6 @@ void __init paging_init(void)
352 free_area_init_nodes(max_zone_pfns); 352 free_area_init_nodes(max_zone_pfns);
353} 353}
354 354
355static struct kcore_list kcore_mem, kcore_vmalloc;
356#ifdef CONFIG_64BIT 355#ifdef CONFIG_64BIT
357static struct kcore_list kcore_kseg0; 356static struct kcore_list kcore_kseg0;
358#endif 357#endif
@@ -409,15 +408,13 @@ void __init mem_init(void)
409 if ((unsigned long) &_text > (unsigned long) CKSEG0) 408 if ((unsigned long) &_text > (unsigned long) CKSEG0)
410 /* The -4 is a hack so that user tools don't have to handle 409 /* The -4 is a hack so that user tools don't have to handle
411 the overflow. */ 410 the overflow. */
412 kclist_add(&kcore_kseg0, (void *) CKSEG0, 0x80000000 - 4); 411 kclist_add(&kcore_kseg0, (void *) CKSEG0,
412 0x80000000 - 4, KCORE_TEXT);
413#endif 413#endif
414 kclist_add(&kcore_mem, __va(0), max_low_pfn << PAGE_SHIFT);
415 kclist_add(&kcore_vmalloc, (void *)VMALLOC_START,
416 VMALLOC_END-VMALLOC_START);
417 414
418 printk(KERN_INFO "Memory: %luk/%luk available (%ldk kernel code, " 415 printk(KERN_INFO "Memory: %luk/%luk available (%ldk kernel code, "
419 "%ldk reserved, %ldk data, %ldk init, %ldk highmem)\n", 416 "%ldk reserved, %ldk data, %ldk init, %ldk highmem)\n",
420 (unsigned long) nr_free_pages() << (PAGE_SHIFT-10), 417 nr_free_pages() << (PAGE_SHIFT-10),
421 ram << (PAGE_SHIFT-10), 418 ram << (PAGE_SHIFT-10),
422 codesize >> 10, 419 codesize >> 10,
423 reservedpages << (PAGE_SHIFT-10), 420 reservedpages << (PAGE_SHIFT-10),
@@ -475,9 +472,6 @@ unsigned long pgd_current[NR_CPUS];
475 */ 472 */
476pgd_t swapper_pg_dir[_PTRS_PER_PGD] __page_aligned(_PGD_ORDER); 473pgd_t swapper_pg_dir[_PTRS_PER_PGD] __page_aligned(_PGD_ORDER);
477#ifdef CONFIG_64BIT 474#ifdef CONFIG_64BIT
478#ifdef MODULE_START
479pgd_t module_pg_dir[PTRS_PER_PGD] __page_aligned(PGD_ORDER);
480#endif
481pmd_t invalid_pmd_table[PTRS_PER_PMD] __page_aligned(PMD_ORDER); 475pmd_t invalid_pmd_table[PTRS_PER_PMD] __page_aligned(PMD_ORDER);
482#endif 476#endif
483pte_t invalid_pte_table[PTRS_PER_PTE] __page_aligned(PTE_ORDER); 477pte_t invalid_pte_table[PTRS_PER_PTE] __page_aligned(PTE_ORDER);
diff --git a/arch/mips/mm/pgtable-64.c b/arch/mips/mm/pgtable-64.c
index e4b565aeb008..1121019fa456 100644
--- a/arch/mips/mm/pgtable-64.c
+++ b/arch/mips/mm/pgtable-64.c
@@ -59,9 +59,6 @@ void __init pagetable_init(void)
59 59
60 /* Initialize the entire pgd. */ 60 /* Initialize the entire pgd. */
61 pgd_init((unsigned long)swapper_pg_dir); 61 pgd_init((unsigned long)swapper_pg_dir);
62#ifdef MODULE_START
63 pgd_init((unsigned long)module_pg_dir);
64#endif
65 pmd_init((unsigned long)invalid_pmd_table, (unsigned long)invalid_pte_table); 62 pmd_init((unsigned long)invalid_pmd_table, (unsigned long)invalid_pte_table);
66 63
67 pgd_base = swapper_pg_dir; 64 pgd_base = swapper_pg_dir;
diff --git a/arch/mips/mm/tlb-r4k.c b/arch/mips/mm/tlb-r4k.c
index cee502caf398..d73428b18b0a 100644
--- a/arch/mips/mm/tlb-r4k.c
+++ b/arch/mips/mm/tlb-r4k.c
@@ -475,7 +475,7 @@ static void __cpuinit probe_tlb(unsigned long config)
475 c->tlbsize = ((reg >> 25) & 0x3f) + 1; 475 c->tlbsize = ((reg >> 25) & 0x3f) + 1;
476} 476}
477 477
478static int __cpuinitdata ntlb = 0; 478static int __cpuinitdata ntlb;
479static int __init set_ntlb(char *str) 479static int __init set_ntlb(char *str)
480{ 480{
481 get_option(&str, &ntlb); 481 get_option(&str, &ntlb);
diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c
index 9a17bf8395df..bb1719a55d22 100644
--- a/arch/mips/mm/tlbex.c
+++ b/arch/mips/mm/tlbex.c
@@ -321,6 +321,10 @@ static void __cpuinit build_tlb_write_entry(u32 **p, struct uasm_label **l,
321 case CPU_BCM3302: 321 case CPU_BCM3302:
322 case CPU_BCM4710: 322 case CPU_BCM4710:
323 case CPU_LOONGSON2: 323 case CPU_LOONGSON2:
324 case CPU_BCM6338:
325 case CPU_BCM6345:
326 case CPU_BCM6348:
327 case CPU_BCM6358:
324 case CPU_R5500: 328 case CPU_R5500:
325 if (m4kc_tlbp_war()) 329 if (m4kc_tlbp_war())
326 uasm_i_nop(p); 330 uasm_i_nop(p);
@@ -499,11 +503,7 @@ build_get_pmde64(u32 **p, struct uasm_label **l, struct uasm_reloc **r,
499 * The vmalloc handling is not in the hotpath. 503 * The vmalloc handling is not in the hotpath.
500 */ 504 */
501 uasm_i_dmfc0(p, tmp, C0_BADVADDR); 505 uasm_i_dmfc0(p, tmp, C0_BADVADDR);
502#ifdef MODULE_START
503 uasm_il_bltz(p, r, tmp, label_module_alloc);
504#else
505 uasm_il_bltz(p, r, tmp, label_vmalloc); 506 uasm_il_bltz(p, r, tmp, label_vmalloc);
506#endif
507 /* No uasm_i_nop needed here, since the next insn doesn't touch TMP. */ 507 /* No uasm_i_nop needed here, since the next insn doesn't touch TMP. */
508 508
509#ifdef CONFIG_SMP 509#ifdef CONFIG_SMP
@@ -556,52 +556,7 @@ build_get_pgd_vmalloc64(u32 **p, struct uasm_label **l, struct uasm_reloc **r,
556{ 556{
557 long swpd = (long)swapper_pg_dir; 557 long swpd = (long)swapper_pg_dir;
558 558
559#ifdef MODULE_START
560 long modd = (long)module_pg_dir;
561
562 uasm_l_module_alloc(l, *p);
563 /*
564 * Assumption:
565 * VMALLOC_START >= 0xc000000000000000UL
566 * MODULE_START >= 0xe000000000000000UL
567 */
568 UASM_i_SLL(p, ptr, bvaddr, 2);
569 uasm_il_bgez(p, r, ptr, label_vmalloc);
570
571 if (uasm_in_compat_space_p(MODULE_START) &&
572 !uasm_rel_lo(MODULE_START)) {
573 uasm_i_lui(p, ptr, uasm_rel_hi(MODULE_START)); /* delay slot */
574 } else {
575 /* unlikely configuration */
576 uasm_i_nop(p); /* delay slot */
577 UASM_i_LA(p, ptr, MODULE_START);
578 }
579 uasm_i_dsubu(p, bvaddr, bvaddr, ptr);
580
581 if (uasm_in_compat_space_p(modd) && !uasm_rel_lo(modd)) {
582 uasm_il_b(p, r, label_vmalloc_done);
583 uasm_i_lui(p, ptr, uasm_rel_hi(modd));
584 } else {
585 UASM_i_LA_mostly(p, ptr, modd);
586 uasm_il_b(p, r, label_vmalloc_done);
587 if (uasm_in_compat_space_p(modd))
588 uasm_i_addiu(p, ptr, ptr, uasm_rel_lo(modd));
589 else
590 uasm_i_daddiu(p, ptr, ptr, uasm_rel_lo(modd));
591 }
592
593 uasm_l_vmalloc(l, *p); 559 uasm_l_vmalloc(l, *p);
594 if (uasm_in_compat_space_p(MODULE_START) &&
595 !uasm_rel_lo(MODULE_START) &&
596 MODULE_START << 32 == VMALLOC_START)
597 uasm_i_dsll32(p, ptr, ptr, 0); /* typical case */
598 else
599 UASM_i_LA(p, ptr, VMALLOC_START);
600#else
601 uasm_l_vmalloc(l, *p);
602 UASM_i_LA(p, ptr, VMALLOC_START);
603#endif
604 uasm_i_dsubu(p, bvaddr, bvaddr, ptr);
605 560
606 if (uasm_in_compat_space_p(swpd) && !uasm_rel_lo(swpd)) { 561 if (uasm_in_compat_space_p(swpd) && !uasm_rel_lo(swpd)) {
607 uasm_il_b(p, r, label_vmalloc_done); 562 uasm_il_b(p, r, label_vmalloc_done);