git: b9868ea45aa2 - stable/13 - arm64: Simplify fcmpset failure in pmap_promote_l2()

Mark Johnston markj at FreeBSD.org
Tue Aug 31 19:09:52 UTC 2021


The branch stable/13 has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=b9868ea45aa2506e354764309dad119164e2b796

commit b9868ea45aa2506e354764309dad119164e2b796
Author:     Alan Cox <alc at FreeBSD.org>
AuthorDate: 2021-07-07 18:16:03 +0000
Commit:     Mark Johnston <markj at FreeBSD.org>
CommitDate: 2021-08-31 19:09:24 +0000

    arm64: Simplify fcmpset failure in pmap_promote_l2()
    
    When the initial fcmpset in pmap_promote_l2() fails, there is no need
    to repeat the check for the physical address being 2MB aligned or for
    the accessed bit being set.  While the pmap is locked the hardware can
    only transition the accessed bit from 0 to 1, and we have already
    determined that it is 1 when the fcmpset fails.
    
    (cherry picked from commit 0add3c9945c85c7f766f9225866e99e2a805819b)
---
 sys/arm64/arm64/pmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c
index 35cbfc4c308c..fe26f1fea1c3 100644
--- a/sys/arm64/arm64/pmap.c
+++ b/sys/arm64/arm64/pmap.c
@@ -3523,7 +3523,6 @@ pmap_promote_l2(pmap_t pmap, pd_entry_t *l2, vm_offset_t va,
 	firstl3 = pmap_l2_to_l3(l2, sva);
 	newl2 = pmap_load(firstl3);
 
-setl2:
 	if (((newl2 & (~ATTR_MASK | ATTR_AF)) & L2_OFFSET) != ATTR_AF) {
 		atomic_add_long(&pmap_l2_p_failures, 1);
 		CTR2(KTR_PMAP, "pmap_promote_l2: failure for va %#lx"
@@ -3531,6 +3530,7 @@ setl2:
 		return;
 	}
 
+setl2:
 	if ((newl2 & (ATTR_S1_AP_RW_BIT | ATTR_SW_DBM)) ==
 	    (ATTR_S1_AP(ATTR_S1_AP_RO) | ATTR_SW_DBM)) {
 		/*


More information about the dev-commits-src-all mailing list