Date: Thu, 4 Feb 2016 13:35:40 +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: r295255 - head/sys/arm/arm Message-ID: <201602041335.u14DZeeM086032@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: skra Date: Thu Feb 4 13:35:40 2016 New Revision: 295255 URL: https://svnweb.freebsd.org/changeset/base/295255 Log: Small rearrangement of abort_handler(). (1) Move cnt.v_trap increment to the beginning. There is cnt.v_vm_faults counter in vm_fault(), so a number of hardware emulation aborts may be get roughly as difference. (2) Move kdb_reenter() up to not be ignored if pmap_fault() has failed. (3) Update comments. Modified: head/sys/arm/arm/trap-v6.c Modified: head/sys/arm/arm/trap-v6.c ============================================================================== --- head/sys/arm/arm/trap-v6.c Thu Feb 4 13:32:29 2016 (r295254) +++ head/sys/arm/arm/trap-v6.c Thu Feb 4 13:35:40 2016 (r295255) @@ -293,7 +293,10 @@ abort_handler(struct trapframe *tf, int #ifdef INVARIANTS void *onfault; #endif + + PCPU_INC(cnt.v_trap); td = curthread; + fsr = (prefetch) ? cp15_ifsr_get(): cp15_dfsr_get(); #if __ARM_ARCH >= 7 far = (prefetch) ? cp15_ifar_get() : cp15_dfar_get(); @@ -334,24 +337,23 @@ abort_handler(struct trapframe *tf, int * they are not from KVA space. Thus, no action is needed here. */ + /* + * (1) Handle access and R/W hardware emulation aborts. + * (2) Check that abort is not on pmap essential address ranges. + * There is no way how to fix it, so we don't even try. + */ rv = pmap_fault(PCPU_GET(curpmap), far, fsr, idx, usermode); if (rv == KERN_SUCCESS) return; - if (rv == KERN_INVALID_ADDRESS) - goto nogo; - /* - * Now, when we handled imprecise and debug aborts, the rest of - * aborts should be really related to mapping. - */ - - PCPU_INC(cnt.v_trap); - #ifdef KDB if (kdb_active) { kdb_reenter(); goto out; } #endif + if (rv == KERN_INVALID_ADDRESS) + goto nogo; + if (__predict_false((td->td_pflags & TDP_NOFAULTING) != 0)) { /* * Due to both processor errata and lazy TLB invalidation when @@ -418,6 +420,14 @@ abort_handler(struct trapframe *tf, int } /* + * At this point, we're dealing with one of the following aborts: + * + * FAULT_ICACHE - I-cache maintenance + * FAULT_TRAN_xx - Translation + * FAULT_PERM_xx - Permission + */ + + /* * Don't pass faulting cache operation to vm_fault(). We don't want * to handle all vm stuff at this moment. */ @@ -435,16 +445,6 @@ abort_handler(struct trapframe *tf, int goto out; } - /* - * At this point, we're dealing with one of the following aborts: - * - * FAULT_TRAN_xx - Translation - * FAULT_PERM_xx - Permission - * - * These are the main virtual memory-related faults signalled by - * the MMU. - */ - /* fusubailout is used by [fs]uswintr to avoid page faulting. */ if (__predict_false(pcb->pcb_onfault == fusubailout)) { tf->tf_r0 = EFAULT;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201602041335.u14DZeeM086032>