Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 May 2018 14:18:19 +0000 (UTC)
From:      Andrew Turner <andrew@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r334382 - head/sys/arm64/arm64
Message-ID:  <201805301418.w4UEIJwq083404@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: andrew
Date: Wed May 30 14:18:19 2018
New Revision: 334382
URL: https://svnweb.freebsd.org/changeset/base/334382

Log:
  Push down the locking in pmap_fault to just be around the calls to
  arm64_address_translate_*. There is no need to lock around the switch
  statement as we only care about a few cases.
  
  Sponsored by:	DARPA, AFRL

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

Modified: head/sys/arm64/arm64/pmap.c
==============================================================================
--- head/sys/arm64/arm64/pmap.c	Wed May 30 13:51:00 2018	(r334381)
+++ head/sys/arm64/arm64/pmap.c	Wed May 30 14:18:19 2018	(r334382)
@@ -4964,12 +4964,12 @@ pmap_fault(pmap_t pmap, uint64_t esr, uint64_t far)
 	}
 
 	/* 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:
 	case ISS_DATA_DFSC_TF_L1:
 	case ISS_DATA_DFSC_TF_L2:
 	case ISS_DATA_DFSC_TF_L3:
+		PMAP_LOCK(pmap);
 		/* Ask the MMU to check the address */
 		intr = intr_disable();
 		if (pmap == kernel_pmap)
@@ -4977,21 +4977,19 @@ pmap_fault(pmap_t pmap, uint64_t esr, uint64_t far)
 		else
 			par = arm64_address_translate_s1e0r(far);
 		intr_restore(intr);
+		PMAP_UNLOCK(pmap);
 
 		/*
 		 * If the translation was successful the address was invalid
 		 * due to a break-before-make sequence. We can unlock and
 		 * return success to the trap handler.
 		 */
-		if (PAR_SUCCESS(par)) {
-			PMAP_UNLOCK(pmap);
+		if (PAR_SUCCESS(par))
 			return (KERN_SUCCESS);
-		}
 		break;
 	default:
 		break;
 	}
-	PMAP_UNLOCK(pmap);
 #endif
 
 	return (KERN_FAILURE);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201805301418.w4UEIJwq083404>