From 6f86eac7ab0a52a4d887ecfd1e4291f375ce7732 Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Wed, 16 Nov 2022 13:37:03 -0500 Subject: [PATCH 09/52] mips: Fix an apparent typo in pmap_demote_pde_locked() When allocating a page table page as part of a demotion, the code is trying as hard as possible to ensure that the allocation succeeds when operating on the kernel pmap, but it was using incorrect bounds for the check. This is harmless since we don't have superpage promotion enabled for the kernel map, but let's avoid referencing VM_MAX_ADDRESS. --- sys/mips/mips/pmap_mips64.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/mips/mips/pmap_mips64.c b/sys/mips/mips/pmap_mips64.c index cd6a2c21e42e..b07d6a56b3e0 100644 --- a/sys/mips/mips/pmap_mips64.c +++ b/sys/mips/mips/pmap_mips64.c @@ -2223,8 +2223,9 @@ pmap_demote_pde_locked(pmap_t pmap, pd_entry_t *pde, vm_offset_t va, */ if (!pte_is_ref(&oldpte) || (mpte = vm_page_alloc(NULL, pmap_pde_pindex(va), (va >= VM_MIN_KERNEL_ADDRESS && va < - VM_MAX_ADDRESS ? VM_ALLOC_INTERRUPT : VM_ALLOC_NORMAL) | - VM_ALLOC_NOOBJ | VM_ALLOC_WIRED)) == NULL) { + VM_MAX_KERNEL_ADDRESS ? VM_ALLOC_INTERRUPT : + VM_ALLOC_NORMAL) | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED)) == + NULL) { SLIST_INIT(&free); pmap_remove_pde(pmap, pde, trunc_2mpage(va), &free, lockp); -- 2.41.0