Date: Tue, 26 Jan 2016 13:50:45 +0000 (UTC) From: Svatopluk Kraus <skra@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294822 - head/sys/arm/arm Message-ID: <201601261350.u0QDojWM033418@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: skra Date: Tue Jan 26 13:50:44 2016 New Revision: 294822 URL: https://svnweb.freebsd.org/changeset/base/294822 Log: Make pmap_fault() return values vm subsystem compliant to simplify their handling in abort_handler(). While here, remove one extra initialization of pcb variable. Modified: head/sys/arm/arm/pmap-v6-new.c head/sys/arm/arm/trap-v6.c Modified: head/sys/arm/arm/pmap-v6-new.c ============================================================================== --- head/sys/arm/arm/pmap-v6-new.c Tue Jan 26 13:49:46 2016 (r294821) +++ head/sys/arm/arm/pmap-v6-new.c Tue Jan 26 13:50:44 2016 (r294822) @@ -6151,7 +6151,7 @@ pmap_fault(pmap_t pmap, vm_offset_t far, __func__, pmap, pmap->pm_pt1, far); panic("%s: pm_pt1 abort", __func__); } - return (EFAULT); + return (KERN_INVALID_ADDRESS); } if (__predict_false(IN_RANGE2(far, PT2MAP, PT2MAP_SIZE))) { /* @@ -6167,7 +6167,7 @@ pmap_fault(pmap_t pmap, vm_offset_t far, __func__, pmap, PT2MAP, far); panic("%s: PT2MAP abort", __func__); } - return (EFAULT); + return (KERN_INVALID_ADDRESS); } /* @@ -6187,7 +6187,7 @@ pte2_seta: if (!pte2_cmpset(pte2p, pte2, pte2 | PTE2_A)) { goto pte2_seta; } - return (0); + return (KERN_SUCCESS); } } if (idx == FAULT_ACCESS_L1) { @@ -6198,7 +6198,7 @@ pte1_seta: if (!pte1_cmpset(pte1p, pte1, pte1 | PTE1_A)) { goto pte1_seta; } - return (0); + return (KERN_SUCCESS); } } @@ -6222,7 +6222,7 @@ pte2_setrw: goto pte2_setrw; } tlb_flush(trunc_page(far)); - return (0); + return (KERN_SUCCESS); } } if ((fsr & FSR_WNR) && (idx == FAULT_PERM_L1)) { @@ -6235,7 +6235,7 @@ pte1_setrw: goto pte1_setrw; } tlb_flush(pte1_trunc(far)); - return (0); + return (KERN_SUCCESS); } } @@ -6274,7 +6274,7 @@ pte1_setrw: } } #endif - return (EAGAIN); + return (KERN_FAILURE); } /* !!!! REMOVE !!!! */ Modified: head/sys/arm/arm/trap-v6.c ============================================================================== --- head/sys/arm/arm/trap-v6.c Tue Jan 26 13:49:46 2016 (r294821) +++ head/sys/arm/arm/trap-v6.c Tue Jan 26 13:50:44 2016 (r294822) @@ -336,14 +336,10 @@ abort_handler(struct trapframe *tf, int #ifdef ARM_NEW_PMAP rv = pmap_fault(PCPU_GET(curpmap), far, fsr, idx, usermode); - if (rv == 0) { + if (rv == KERN_SUCCESS) return; - } else if (rv == EFAULT) { - - call_trapsignal(td, SIGSEGV, SEGV_MAPERR, far); - userret(td, tf); - return; - } + if (rv == KERN_INVALID_ADDRESS) + goto nogo; #endif /* * Now, when we handled imprecise and debug aborts, the rest of @@ -452,7 +448,6 @@ abort_handler(struct trapframe *tf, int */ /* fusubailout is used by [fs]uswintr to avoid page faulting. */ - pcb = td->td_pcb; if (__predict_false(pcb->pcb_onfault == fusubailout)) { tf->tf_r0 = EFAULT; tf->tf_pc = (register_t)pcb->pcb_onfault;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201601261350.u0QDojWM033418>