From owner-svn-src-head@freebsd.org Wed May 30 14:18:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A1CFF6FC51; Wed, 30 May 2018 14:18:20 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EDE8D856A8; Wed, 30 May 2018 14:18:19 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CEE654161; Wed, 30 May 2018 14:18:19 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4UEIJXW083405; Wed, 30 May 2018 14:18:19 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4UEIJwq083404; Wed, 30 May 2018 14:18:19 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201805301418.w4UEIJwq083404@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 30 May 2018 14:18:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334382 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 334382 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 May 2018 14:18:20 -0000 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);