git: 4f77144279f2 - main - arm64 pmap: eliminate a redundant variable

From: Alan Cox <alc_at_FreeBSD.org>
Date: Sun, 19 May 2024 19:43:53 UTC
The branch main has been updated by alc:

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

commit 4f77144279f210ce65d77c13470c6363c3ce3c57
Author:     Alan Cox <alc@FreeBSD.org>
AuthorDate: 2024-05-19 19:22:53 +0000
Commit:     Alan Cox <alc@FreeBSD.org>
CommitDate: 2024-05-19 19:33:19 +0000

    arm64 pmap: eliminate a redundant variable
    
    Moreover, if we attempt an L2 promotion on the kernel pmap from
    pmap_enter_quick_locked(), this change eliminates the recomputation of
    the L2 entry's address.
    
    MFC after:      1 week
---
 sys/arm64/arm64/pmap.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c
index a6056a5edfc2..269513589d78 100644
--- a/sys/arm64/arm64/pmap.c
+++ b/sys/arm64/arm64/pmap.c
@@ -5848,7 +5848,6 @@ static vm_page_t
 pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, vm_page_t m,
     vm_prot_t prot, vm_page_t mpte, struct rwlock **lockp)
 {
-	pd_entry_t *pde;
 	pt_entry_t *l1, *l2, *l3, l3_val;
 	vm_paddr_t pa;
 	int lvl;
@@ -5913,13 +5912,13 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, vm_page_t m,
 		l3 = &l3[pmap_l3_index(va)];
 	} else {
 		mpte = NULL;
-		pde = pmap_pde(kernel_pmap, va, &lvl);
-		KASSERT(pde != NULL,
+		l2 = pmap_pde(kernel_pmap, va, &lvl);
+		KASSERT(l2 != NULL,
 		    ("pmap_enter_quick_locked: Invalid page entry, va: 0x%lx",
 		     va));
 		KASSERT(lvl == 2,
 		    ("pmap_enter_quick_locked: Invalid level %d", lvl));
-		l3 = pmap_l2_to_l3(pde, va);
+		l3 = pmap_l2_to_l3(l2, va);
 	}
 
 	/*