git: 3fd429a7ba29 - stable/13 - riscv: better CTR messages in pmap_enter_l2()

From: Mitchell Horne <mhorne_at_FreeBSD.org>
Date: Sun, 09 Oct 2022 17:03:11 UTC
The branch stable/13 has been updated by mhorne:

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

commit 3fd429a7ba29e0d143f5597c1e5b2eb3a3e611f6
Author:     Mitchell Horne <mhorne@FreeBSD.org>
AuthorDate: 2022-08-25 20:08:41 +0000
Commit:     Mitchell Horne <mhorne@FreeBSD.org>
CommitDate: 2022-10-09 17:02:31 +0000

    riscv: better CTR messages in pmap_enter_l2()
    
    Disambiguate the failure cases.
    
    Reviewed by:    jhb
    MFC after:      3 days
    Differential Revision:  https://reviews.freebsd.org/D36562
    
    (cherry picked from commit dd18b62cec6228c17aef428a575f44152ea55d53)
---
 sys/riscv/riscv/pmap.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/sys/riscv/riscv/pmap.c b/sys/riscv/riscv/pmap.c
index 686d4278902a..3581708acce9 100644
--- a/sys/riscv/riscv/pmap.c
+++ b/sys/riscv/riscv/pmap.c
@@ -3174,8 +3174,8 @@ pmap_enter_l2(pmap_t pmap, vm_offset_t va, pd_entry_t new_l2, u_int flags,
 
 	if ((l2pg = pmap_alloc_l2(pmap, va, (flags & PMAP_ENTER_NOSLEEP) != 0 ?
 	    NULL : lockp)) == NULL) {
-		CTR2(KTR_PMAP, "pmap_enter_l2: failure for va %#lx in pmap %p",
-		    va, pmap);
+		CTR2(KTR_PMAP, "pmap_enter_l2: failed to allocate PT page"
+		    " for va %#lx in pmap %p", va, pmap);
 		return (KERN_RESOURCE_SHORTAGE);
 	}
 
@@ -3187,8 +3187,8 @@ pmap_enter_l2(pmap_t pmap, vm_offset_t va, pd_entry_t new_l2, u_int flags,
 		if ((flags & PMAP_ENTER_NOREPLACE) != 0) {
 			l2pg->ref_count--;
 			CTR2(KTR_PMAP,
-			    "pmap_enter_l2: failure for va %#lx in pmap %p",
-			    va, pmap);
+			    "pmap_enter_l2: failed to replace existing mapping"
+			    " for va %#lx in pmap %p", va, pmap);
 			return (KERN_FAILURE);
 		}
 		SLIST_INIT(&free);
@@ -3234,8 +3234,8 @@ pmap_enter_l2(pmap_t pmap, vm_offset_t va, pd_entry_t new_l2, u_int flags,
 				vm_page_free_pages_toq(&free, true);
 			}
 			CTR2(KTR_PMAP,
-			    "pmap_enter_l2: failure for va %#lx in pmap %p",
-			    va, pmap);
+			    "pmap_enter_l2: failed to create PV entry"
+			    " for va %#lx in pmap %p", va, pmap);
 			return (KERN_RESOURCE_SHORTAGE);
 		}
 		if ((new_l2 & PTE_W) != 0)