git: 2eb64df7f53d - main - riscv: remove a redundant check on PGA_WRITEABLE

From: Mitchell Horne <mhorne_at_FreeBSD.org>
Date: Fri, 28 Jun 2024 14:13:28 UTC
The branch main has been updated by mhorne:

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

commit 2eb64df7f53d699f0be5d9ad3828bafee175a606
Author:     wy-chung <wy-chung@outlook.com>
AuthorDate: 2024-06-26 07:46:32 +0000
Commit:     Mitchell Horne <mhorne@FreeBSD.org>
CommitDate: 2024-06-28 14:10:57 +0000

    riscv: remove a redundant check on PGA_WRITEABLE
    
    This is achieved by the preceding call to pmap_page_is_write_mapped().
    It appears the second check and comment were left mistakenly when the
    intent was to remove them.
    
    Reviewed by:    mhorne
    MFC after:      1 week
    Fixes:  638f867814a6 ("(6/6) Convert pmap to expect busy in write... ")
    Pull Request:   https://github.com/freebsd/freebsd-src/pull/1304
---
 sys/riscv/riscv/pmap.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/sys/riscv/riscv/pmap.c b/sys/riscv/riscv/pmap.c
index 377d038a9a8a..781f6b250a18 100644
--- a/sys/riscv/riscv/pmap.c
+++ b/sys/riscv/riscv/pmap.c
@@ -4611,19 +4611,12 @@ pmap_clear_modify(vm_page_t m)
 	int md_gen, pvh_gen;
 
 	KASSERT((m->oflags & VPO_UNMANAGED) == 0,
-	    ("pmap_clear_modify: page %p is not managed", m));
+	    ("%s: page %p is not managed", __func__, m));
 	vm_page_assert_busied(m);
 
 	if (!pmap_page_is_write_mapped(m))
 	        return;
 
-	/*
-	 * If the page is not PGA_WRITEABLE, then no PTEs can have PG_M set.
-	 * If the object containing the page is locked and the page is not
-	 * exclusive busied, then PGA_WRITEABLE cannot be concurrently set.
-	 */
-	if ((m->a.flags & PGA_WRITEABLE) == 0)
-		return;
 	pvh = (m->flags & PG_FICTITIOUS) != 0 ? &pv_dummy :
 	    pa_to_pvh(VM_PAGE_TO_PHYS(m));
 	lock = VM_PAGE_TO_PV_LIST_LOCK(m);