aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Cox <alc@FreeBSD.org>2021-07-07 18:16:03 +0000
committerMark Johnston <markj@FreeBSD.org>2021-08-31 19:09:24 +0000
commitb9868ea45aa2506e354764309dad119164e2b796 (patch)
tree86cf86b82c8e04b7158d782727ea169e4e8a11d1
parent380c653c7d4b1b54cc0ea5f7f80a8ec8c71671f1 (diff)
downloadsrc-b9868ea45aa2506e354764309dad119164e2b796.tar.gz
src-b9868ea45aa2506e354764309dad119164e2b796.zip
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)
-rw-r--r--sys/arm64/arm64/pmap.c2
1 files changed, 1 insertions, 1 deletions
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)) {
/*