Author: mmel
Date: Sat Jan 27 09:49:47 2018
New Revision: 328466
URL: https://svnweb.freebsd.org/changeset/base/328466

Log:
  Fix pmap_fault().
  
  - special fault handling for break-before-make mechanism should be also
    applied for instruction translation faults, not only for data translation
    faults.
  
  - since arm64_address_translate_...() functions are not atomic,
    use these with disabled interrupts.

Modified:
  head/sys/arm64/arm64/pmap.c

Modified: head/sys/arm64/arm64/pmap.c
==============================================================================
--- head/sys/arm64/arm64/pmap.c Sat Jan 27 07:41:31 2018        (r328465)
+++ head/sys/arm64/arm64/pmap.c Sat Jan 27 09:49:47 2018        (r328466)
@@ -4745,10 +4745,12 @@ int
 pmap_fault(pmap_t pmap, uint64_t esr, uint64_t far)
 {
 #ifdef SMP
+       register_t intr;
        uint64_t par;
-#endif
 
        switch (ESR_ELx_EXCEPTION(esr)) {
+       case EXCP_INSN_ABORT_L:
+       case EXCP_INSN_ABORT:
        case EXCP_DATA_ABORT_L:
        case EXCP_DATA_ABORT:
                break;
@@ -4756,7 +4758,7 @@ pmap_fault(pmap_t pmap, uint64_t esr, uint64_t far)
                return (KERN_FAILURE);
        }
 
-#ifdef SMP
+       /* Data and insn aborts use same encoding for FCS field. */
        PMAP_LOCK(pmap);
        switch (esr & ISS_DATA_DFSC_MASK) {
        case ISS_DATA_DFSC_TF_L0:
@@ -4764,10 +4766,12 @@ pmap_fault(pmap_t pmap, uint64_t esr, uint64_t far)
        case ISS_DATA_DFSC_TF_L2:
        case ISS_DATA_DFSC_TF_L3:
                /* Ask the MMU to check the address */
+               intr = intr_disable();
                if (pmap == kernel_pmap)
                        par = arm64_address_translate_s1e1r(far);
                else
                        par = arm64_address_translate_s1e0r(far);
+               intr_restore(intr);
 
                /*
                 * If the translation was successful the address was invalid
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to