git: abf3835be640 - stable/13 - Fix a set but not used warning in the arm64 pmap

From: Andrew Turner <andrew_at_FreeBSD.org>
Date: Wed, 29 Dec 2021 10:39:53 UTC
The branch stable/13 has been updated by andrew:

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

commit abf3835be640e8cc105c978bc96a1fd0686ee23c
Author:     Andrew Turner <andrew@FreeBSD.org>
AuthorDate: 2021-12-07 14:32:11 +0000
Commit:     Andrew Turner <andrew@FreeBSD.org>
CommitDate: 2021-12-29 10:05:59 +0000

    Fix a set but not used warning in the arm64 pmap
    
    In pmap_ts_referenced we read the virtual address from pv->pv_va,
    but then continue to use the pv struct to get the same value later
    in the function.
    
    Use the virtual address value we initially read rather than loading
    from the pv struct each time.
    
    (cherry picked from commit 1c643b721bed48ba795b42cdc5e8b5818f30ed14)
---
 sys/arm64/arm64/pmap.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c
index d4cebf6a8956..c105e7cae16b 100644
--- a/sys/arm64/arm64/pmap.c
+++ b/sys/arm64/arm64/pmap.c
@@ -5569,14 +5569,14 @@ retry:
 			}
 		}
 		va = pv->pv_va;
-		pde = pmap_pde(pmap, pv->pv_va, &lvl);
+		pde = pmap_pde(pmap, va, &lvl);
 		KASSERT(pde != NULL, ("pmap_ts_referenced: no l1 table found"));
 		KASSERT(lvl == 1,
 		    ("pmap_ts_referenced: invalid pde level %d", lvl));
 		tpde = pmap_load(pde);
 		KASSERT((tpde & ATTR_DESCR_MASK) == L1_TABLE,
 		    ("pmap_ts_referenced: found an invalid l1 table"));
-		pte = pmap_l1_to_l2(pde, pv->pv_va);
+		pte = pmap_l1_to_l2(pde, va);
 		tpte = pmap_load(pte);
 		if (pmap_pte_dirty(pmap, tpte)) {
 			/*
@@ -5606,11 +5606,11 @@ retry:
 			 * since the superpage is wired, the current state of
 			 * its reference bit won't affect page replacement.
 			 */
-			if ((((pa >> PAGE_SHIFT) ^ (pv->pv_va >> L2_SHIFT) ^
+			if ((((pa >> PAGE_SHIFT) ^ (va >> L2_SHIFT) ^
 			    (uintptr_t)pmap) & (Ln_ENTRIES - 1)) == 0 &&
 			    (tpte & ATTR_SW_WIRED) == 0) {
 				pmap_clear_bits(pte, ATTR_AF);
-				pmap_invalidate_page(pmap, pv->pv_va);
+				pmap_invalidate_page(pmap, va);
 				cleared++;
 			} else
 				not_cleared++;