|
From: NIIBE Y. <gn...@ch...> - 2000-05-17 10:12:31
|
I've found swap doesn't work. Here is possible fix. I don't know I
will commit this soon, because I'll implement handling TLB miss at
assembler level (in entry.S). If you've encounter problem, please
try this patch.
2000-05-17 NIIBE Yutaka <gn...@m1...>
* arch/sh/mm/fault.c (update_mmu_cache): We don't need to call
__flush_tlb_page. See the implementation of establish_pte in
mm/memory.c.
(handle_vmalloc_fault): Instead, call __flush_tlb_page here.
(update_mmu_cache): Conditionalize the setting of PTEH.
(handle_vmalloc_fault): Change the first argument type.
Index: arch/sh/mm/fault.c
===================================================================
RCS file: /cvsroot/linuxsh/kernel/arch/sh/mm/fault.c,v
retrieving revision 1.10
diff -u -r1.10 fault.c
--- arch/sh/mm/fault.c 2000/05/09 01:42:22 1.10
+++ arch/sh/mm/fault.c 2000/05/17 10:03:17
@@ -82,7 +82,7 @@
return 0;
}
-static void handle_vmalloc_fault(struct task_struct *tsk, unsigned long address)
+static void handle_vmalloc_fault(struct mm_struct *mm, unsigned long address)
{
pgd_t *dir;
pmd_t *pmd;
@@ -107,6 +107,13 @@
return;
}
+#if defined(__SH4__)
+ /*
+ * ITLB is not affected by "ldtlb" instruction.
+ * So, we need to flush the entry by ourselves.
+ */
+ __flush_tlb_page(mm, address&PAGE_MASK);
+#endif
update_mmu_cache(NULL, address, entry);
}
@@ -128,7 +135,7 @@
mm = tsk->mm;
if (address >= VMALLOC_START && address < VMALLOC_END) {
- handle_vmalloc_fault(tsk, address);
+ handle_vmalloc_fault(mm, address);
return;
}
@@ -269,18 +276,13 @@
unsigned long pteaddr;
save_and_cli(flags);
-#if defined(__SH4__)
- /*
- * ITLB is not affected by "ldtlb" instruction.
- * So, we need to flush the entry by ourselves.
- */
- __flush_tlb_page(vma->vm_mm, address&PAGE_MASK);
-#endif
/* Set PTEH register */
- pteaddr = (address & MMU_VPN_MASK) |
- (vma->vm_mm->context & MMU_CONTEXT_ASID_MASK);
- ctrl_outl(pteaddr, MMU_PTEH);
+ if (vma) {
+ pteaddr = (address & MMU_VPN_MASK) |
+ (vma->vm_mm->context & MMU_CONTEXT_ASID_MASK);
+ ctrl_outl(pteaddr, MMU_PTEH);
+ }
/* Set PTEL register */
pteval = pte_val(pte);
|