From nobody Fri Feb 02 22:59:13 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TRWRj5SCjz58T7C; Fri, 2 Feb 2024 22:59:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TRWRj4h6cz45Bm; Fri, 2 Feb 2024 22:59:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706914753; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ay0qwFkZvH3ups14ba7E8p7Az304AjVYO7wvd1LeIuk=; b=l65/zmaMEM1bEd6Nvuwt4iHc02cb8zcBWTf8UM35QIjgvLLnUKi5qx/CDEvl0ohgpKIIdx v8EP1gvmWztzG/cSfP68Q9gYgG+PtYMCezB/jdTr+VzRSD2z9SA/J2EhkNhx16UPD4MxFP 1dY+A6Q7IAgYxTDWQh1CkjAEfy4HLEqkZzvtMoKhcLu358yvoWB9pWuzbAekfM06DvVHYd mXVqoAYMOO67OUrzWNfQI+tbJWf+dUAmEzJhYlhFaLNi0Sw8Qm/XmdZxRx3XljRdS0JW10 TiIT9WJNQIzwyhL3eae0RKNdnJoLyFG59tVDM3kj8A4LGKl/q0DiTwnaJougVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706914753; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ay0qwFkZvH3ups14ba7E8p7Az304AjVYO7wvd1LeIuk=; b=W+Ay+nak4OK401XoYhCOFFHs/Rf4YqFrxm6UKRs2gyjOJShlNdUkZ77SJqie2rO71jrtpP DP4JA3dNFJx7Z7Iq16j00ovC+U1TbIxnEVDyFPAD0f5elXyVjHhSsYYy2uDR4833w9l4W4 PksQPVq4tUo+Fvfh2C4kr5mSaYu7o1nnriU/vuACPwNf2kc4urNj4bg5ZaQqY220mb2XlD W3cdw650703e9Z1KBmTTlUIPqldDjAdWWGEZ7E/AnXYd/nl5xDqqXcUUpqO1QEm1mVnx8N EMWXmMR5EkwuVQBcfkcrbPHTVo2t1sdDXb5slKVrEAw6RaTu9qoZA3sEUToVWQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706914753; a=rsa-sha256; cv=none; b=jjmGCYmCOtKDf7KlIm1PLXGhlwCj5VQWsp+VRBc55nwiKnoGr05KkY/Atg651XJuYPsXxv ZLLWt5u4txEtNdDjT53/YA0kSbUsOKzRvgpNHGtpLrISg/1mjKfRzJNAz7PHg7kOiEFVJ+ 6EOfe69+OuGXZEszO7ivjdi+zVWJ4MZ9u1qcBBzizXDFctrJGZUGCfl17Ll6coMDJ2c7Yf wN7qmqzc54OiW03u+HnvG4wjAaXljT3h4etHpK4VIuJCyXWni4Yd8Ip7JY1KKh8MvhS4bG tTI+z8Gf30MnO/pj7J+n+3PyFAicXb5vPtddCkfJ32PSTYCQJn6SY3aI/H4DNQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TRWRj3kR0zq5b; Fri, 2 Feb 2024 22:59:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 412MxDnh042401; Fri, 2 Feb 2024 22:59:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 412MxDbQ042398; Fri, 2 Feb 2024 22:59:13 GMT (envelope-from git) Date: Fri, 2 Feb 2024 22:59:13 GMT Message-Id: <202402022259.412MxDbQ042398@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: fd1aa5b3a2a9 - main - x86: Consistently pass true/false to is_pde parameter of pmap_cache_bits List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fd1aa5b3a2a9356bb3716cdea93710969d6c4817 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=fd1aa5b3a2a9356bb3716cdea93710969d6c4817 commit fd1aa5b3a2a9356bb3716cdea93710969d6c4817 Author: John Baldwin AuthorDate: 2024-02-02 22:58:30 +0000 Commit: John Baldwin CommitDate: 2024-02-02 22:58:30 +0000 x86: Consistently pass true/false to is_pde parameter of pmap_cache_bits Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D43692 --- sys/amd64/amd64/efirt_machdep.c | 2 +- sys/i386/i386/pmap.c | 35 ++++++++++++++++++----------------- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/sys/amd64/amd64/efirt_machdep.c b/sys/amd64/amd64/efirt_machdep.c index 0ee8b7b3bb96..5d0106e2aa88 100644 --- a/sys/amd64/amd64/efirt_machdep.c +++ b/sys/amd64/amd64/efirt_machdep.c @@ -235,7 +235,7 @@ efi_create_1t1_map(struct efi_md *map, int ndesc, int descsz) "attributes unsupported\n", i); mode = VM_MEMATTR_UNCACHEABLE; } - bits = pmap_cache_bits(kernel_pmap, mode, FALSE) | X86_PG_RW | + bits = pmap_cache_bits(kernel_pmap, mode, false) | X86_PG_RW | X86_PG_V; VM_OBJECT_WLOCK(obj_1t1_pt); for (va = p->md_phys, idx = 0; idx < p->md_pages; idx++, diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c index fe9b7a0c43df..6552fbbca4d5 100644 --- a/sys/i386/i386/pmap.c +++ b/sys/i386/i386/pmap.c @@ -1766,7 +1766,7 @@ pmap_kenter_attr(vm_offset_t va, vm_paddr_t pa, int mode) pte = vtopte(va); pte_store(pte, pa | PG_RW | PG_V | pmap_cache_bits(kernel_pmap, - mode, 0)); + mode, false)); } /* @@ -1862,7 +1862,7 @@ __CONCAT(PMTYPE, qenter)(vm_offset_t sva, vm_page_t *ma, int count) while (pte < endpte) { m = *ma++; pa = VM_PAGE_TO_PHYS(m) | pmap_cache_bits(kernel_pmap, - m->md.pat_mode, 0); + m->md.pat_mode, false); if ((*pte & (PG_FRAME | PG_PTE_CACHE)) != pa) { oldpte |= *pte; pte_store(pte, pa | pg_nx | PG_RW | PG_V); @@ -3918,8 +3918,8 @@ pmap_enter_4mpage(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot) pd_entry_t newpde; PMAP_LOCK_ASSERT(pmap, MA_OWNED); - newpde = VM_PAGE_TO_PHYS(m) | pmap_cache_bits(pmap, m->md.pat_mode, 1) | - PG_PS | PG_V; + newpde = VM_PAGE_TO_PHYS(m) | + pmap_cache_bits(pmap, m->md.pat_mode, true) | PG_PS | PG_V; if ((m->oflags & VPO_UNMANAGED) == 0) newpde |= PG_MANAGED; #ifdef PMAP_PAE_COMP @@ -4233,7 +4233,7 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, vm_page_t m, pmap->pm_stats.resident_count++; newpte = VM_PAGE_TO_PHYS(m) | PG_V | - pmap_cache_bits(pmap, m->md.pat_mode, 0); + pmap_cache_bits(pmap, m->md.pat_mode, false); if ((m->oflags & VPO_UNMANAGED) == 0) newpte |= PG_MANAGED; #ifdef PMAP_PAE_COMP @@ -4339,7 +4339,7 @@ __CONCAT(PMTYPE, object_init_pt)(pmap_t pmap, vm_offset_t addr, * "pa" will not affect the termination of this loop. */ PMAP_LOCK(pmap); - for (pa = ptepa | pmap_cache_bits(pmap, pat_mode, 1); + for (pa = ptepa | pmap_cache_bits(pmap, pat_mode, true); pa < ptepa + size; pa += NBPDR) { pde = pmap_pde(pmap, addr); if (*pde == 0) { @@ -4596,7 +4596,7 @@ __CONCAT(PMTYPE, zero_page)(vm_page_t m) if (*cmap_pte2) panic("pmap_zero_page: CMAP2 busy"); *cmap_pte2 = PG_V | PG_RW | VM_PAGE_TO_PHYS(m) | PG_A | PG_M | - pmap_cache_bits(kernel_pmap, m->md.pat_mode, 0); + pmap_cache_bits(kernel_pmap, m->md.pat_mode, false); invlcaddr(pc->pc_cmap_addr2); pagezero(pc->pc_cmap_addr2); *cmap_pte2 = 0; @@ -4627,7 +4627,7 @@ __CONCAT(PMTYPE, zero_page_area)(vm_page_t m, int off, int size) if (*cmap_pte2) panic("pmap_zero_page_area: CMAP2 busy"); *cmap_pte2 = PG_V | PG_RW | VM_PAGE_TO_PHYS(m) | PG_A | PG_M | - pmap_cache_bits(kernel_pmap, m->md.pat_mode, 0); + pmap_cache_bits(kernel_pmap, m->md.pat_mode, false); invlcaddr(pc->pc_cmap_addr2); if (off == 0 && size == PAGE_SIZE) pagezero(pc->pc_cmap_addr2); @@ -4657,10 +4657,10 @@ __CONCAT(PMTYPE, copy_page)(vm_page_t src, vm_page_t dst) if (*cmap_pte2) panic("pmap_copy_page: CMAP2 busy"); *cmap_pte1 = PG_V | VM_PAGE_TO_PHYS(src) | PG_A | - pmap_cache_bits(kernel_pmap, src->md.pat_mode, 0); + pmap_cache_bits(kernel_pmap, src->md.pat_mode, false); invlcaddr(pc->pc_cmap_addr1); *cmap_pte2 = PG_V | PG_RW | VM_PAGE_TO_PHYS(dst) | PG_A | PG_M | - pmap_cache_bits(kernel_pmap, dst->md.pat_mode, 0); + pmap_cache_bits(kernel_pmap, dst->md.pat_mode, false); invlcaddr(pc->pc_cmap_addr2); bcopy(pc->pc_cmap_addr1, pc->pc_cmap_addr2, PAGE_SIZE); *cmap_pte1 = 0; @@ -4697,10 +4697,11 @@ __CONCAT(PMTYPE, copy_pages)(vm_page_t ma[], vm_offset_t a_offset, b_pg_offset = b_offset & PAGE_MASK; cnt = min(cnt, PAGE_SIZE - b_pg_offset); *cmap_pte1 = PG_V | VM_PAGE_TO_PHYS(a_pg) | PG_A | - pmap_cache_bits(kernel_pmap, a_pg->md.pat_mode, 0); + pmap_cache_bits(kernel_pmap, a_pg->md.pat_mode, false); invlcaddr(pc->pc_cmap_addr1); *cmap_pte2 = PG_V | PG_RW | VM_PAGE_TO_PHYS(b_pg) | PG_A | - PG_M | pmap_cache_bits(kernel_pmap, b_pg->md.pat_mode, 0); + PG_M | pmap_cache_bits(kernel_pmap, b_pg->md.pat_mode, + false); invlcaddr(pc->pc_cmap_addr2); a_cp = pc->pc_cmap_addr1 + a_pg_offset; b_cp = pc->pc_cmap_addr2 + b_pg_offset; @@ -5663,7 +5664,7 @@ __CONCAT(PMTYPE, flush_page)(vm_page_t m) panic("pmap_flush_page: CMAP2 busy"); *cmap_pte2 = PG_V | PG_RW | VM_PAGE_TO_PHYS(m) | PG_A | PG_M | pmap_cache_bits(kernel_pmap, m->md.pat_mode, - 0); + false); invlcaddr(pc->pc_cmap_addr2); sva = (vm_offset_t)pc->pc_cmap_addr2; eva = sva + PAGE_SIZE; @@ -5724,8 +5725,8 @@ __CONCAT(PMTYPE, change_attr)(vm_offset_t va, vm_size_t size, int mode) if (base < VM_MIN_KERNEL_ADDRESS) return (EINVAL); - cache_bits_pde = pmap_cache_bits(kernel_pmap, mode, 1); - cache_bits_pte = pmap_cache_bits(kernel_pmap, mode, 0); + cache_bits_pde = pmap_cache_bits(kernel_pmap, mode, true); + cache_bits_pte = pmap_cache_bits(kernel_pmap, mode, false); changed = false; /* @@ -5939,7 +5940,7 @@ __CONCAT(PMTYPE, quick_enter_page)(vm_page_t m) KASSERT(*pte == 0, ("pmap_quick_enter_page: PTE busy %#jx", (uintmax_t)*pte)); *pte = PG_V | PG_RW | VM_PAGE_TO_PHYS(m) | PG_A | PG_M | - pmap_cache_bits(kernel_pmap, pmap_page_get_memattr(m), 0); + pmap_cache_bits(kernel_pmap, pmap_page_get_memattr(m), false); invlpg(qaddr); return (qaddr); @@ -6085,7 +6086,7 @@ __CONCAT(PMTYPE, sf_buf_map)(struct sf_buf *sf) ptep = vtopte(sf->kva); opte = *ptep; *ptep = VM_PAGE_TO_PHYS(sf->m) | PG_RW | PG_V | - pmap_cache_bits(kernel_pmap, sf->m->md.pat_mode, 0); + pmap_cache_bits(kernel_pmap, sf->m->md.pat_mode, false); /* * Avoid unnecessary TLB invalidations: If the sf_buf's old