From: Andy P. <at...@us...> - 2001-08-31 14:04:51
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/vax/mm In directory usw-pr-cvs1:/tmp/cvs-serv1856 Modified Files: fault.c pgalloc.c Log Message: Fix double pte invalidate bug Index: fault.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/mm/fault.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- fault.c 2001/08/21 20:09:34 1.10 +++ fault.c 2001/08/31 11:50:57 1.11 @@ -59,7 +59,7 @@ unsigned fixup; #ifdef VAX_MM_DEBUG - printk("mmfault: fault at %8x, pc %8x, psl %8x, reason %8x\n",info->addr, info->pc, info->psl, info->reason); + printk("mmfault: pid %d fault at %8x, pc %8x, psl %8x, reason %8x\n",current->pid,info->addr, info->pc, info->psl, info->reason); printk("mmfault:p0br %8lx, p0lr %8lx, p1br %8lx, p1lr %8lx\n",Xmfpr(PR_P0BR),Xmfpr(PR_P0LR),Xmfpr(PR_P1BR),Xmfpr(PR_P1LR)); #endif /* This check, and the mm != NULL checks later, will be removed @@ -105,6 +105,7 @@ } survive: { + int fault; fault = handle_mm_fault(mm, vma, address, reason & REASON_WRITE); if (!fault) @@ -112,6 +113,7 @@ if (fault < 0) goto out_of_memory; } + up(&mm->mmap_sem); return; @@ -120,6 +122,7 @@ * Fix it, but check if it's kernel or user first.. */ bad_area: + up(&mm->mmap_sem); if (user_mode(regs)) { @@ -127,16 +130,17 @@ "pid %d, virtual address %08lx, reason mask %08x, " "PC %08x, PSL %08x\n", current->pid, address, reason, info->pc, info->psl); - printk("do_page_fault: sending SIGSEGV\n"); + show_regs(regs); + show_cpu_regs(); + + printk("do_page_fault: sending SIGSEGV\n"); force_sig(SIGSEGV, current); - /* signals arent implemented yet */ - /* They are now atp aug 17 2001 */ -// machine_halt(); return; } no_context: + /* Are we prepared to handle this fault as an exception? */ if ((fixup = search_exception_table(regs->pc)) != 0) { regs->pc = fixup; @@ -147,6 +151,7 @@ * Oops. The kernel tried to access some bad page. We'll have to * terminate things with extreme prejudice. */ + printk(KERN_ALERT "Unable to handle kernel paging request at " "virtual address %08lx, reason mask %08x, " "PC %08x, PSL %08x\n", Index: pgalloc.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/mm/pgalloc.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- pgalloc.c 2001/08/23 09:27:01 1.5 +++ pgalloc.c 2001/08/31 11:50:57 1.6 @@ -225,7 +225,6 @@ s0pte = GET_SPTE_VIRT(ptep); addr = (unsigned long)(((pte_val(*s0pte)&PAGELET_PFN_MASK)<<PAGELET_SHIFT)|PAGE_OFFSET); -// printk("get_pageaddr: ptep %p, spte %8lx, *spte %8lx, addr %8lx\n",ptep,s0pte,pte_val(*s0pte),addr); return addr; } @@ -249,7 +248,7 @@ * This is like remap_pte_range in memory.c but VAX specific * * s0addr is the address in S0 space that we need to remap the page - * pointed to pte_page to. We also clear the page pointed at by pte_page + * pointed at by pte_page to. We also clear the page pointed at by pte_page */ void remap_and_clear_pte_page(pmd_t *s0addr, pte_t *pte_page) { @@ -301,7 +300,6 @@ s0pte = GET_SPTE_VIRT(s0addr); set_pte(s0pte, pte_mkinvalid(*s0pte)); -// print_pte(s0pte); /* FIXME: these flush_tlb_alls need replacing with flush_tlb_8 */ flush_tlb_all(); // __flush_tlb_one(s0addr); @@ -444,8 +442,6 @@ is_p1=pgdp->segment; -// printk(KERN_DEBUG "ptealloc:pgd %8p, pgd->segment %ld, pgd->br %8lx, pgd->lr %lx, pgd->slot %8lx\n",pgdp,pgdp->segment,pgdp->br,pgdp->lr,pgdp->slot); - /* make an adjusted address + calculate linear page table entry */ adjusted_address = (((pmd-pmd_basep))<<(PAGE_SHIFT+7))+ (address&~PMD_MASK); @@ -566,12 +562,11 @@ remap_pte_invalidate(pte); } -/* we don't allocate any space for pte, just clear the one passed to us */ +/* This is only ever called from do_pgt_cache, all the unmapping have been done + * before the page has been placed on the pgt cache */ void free_pte_slow(pte_t *pte) { - free_page((unsigned long) get_pageaddr_from_pte(pte)); - /* invalidate the S0 pte that maps this */ - remap_pte_invalidate(pte); + free_page(pte); } void pte_free_kernel(pte_t *pte) |