From nobody Tue Oct 04 17:06:17 2022 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 4Mhkcn3z0Lz4fGrB; Tue, 4 Oct 2022 17:06:17 +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 4Mhkcn3M8Lz4Cm7; Tue, 4 Oct 2022 17:06:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1664903177; 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=XsvGrYAMJOqlwfY6LEXtgPMNzHaMFVisAFbqsn+KW4M=; b=s+gzgYV/vzINriQpQAt/Ivt3okvZ0XbYlXqVkVjFNzAYWQuc0ds1pQURCNN5W5GT0xumTa UWxjYRH7jCHo4CfmJpAjEYjhjk2tGludEFehXDvqtRlB+bDQ8GvKX4WcNvi8Nc0/5fR0Ds R5Yr9jZMlWANHOS3HvxgFsiPjXAP9N9n9SJaQ7TBDHvR7FnIqDuuL2bBZ6Z61wY+pv8VcG P/KsiSGNpWCWVJXocdSh9VQSRgAjY89zuEDHrvgBjA983hZzoV3+fWSTBZqkEarCXh/lli 6WLEi/ZJg/SqOoacsFzBrkFScjDpLFtLjlTnigCCxaXpyOpcNzgpmAtjNM3SlQ== 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 4Mhkcn2FBKzdBm; Tue, 4 Oct 2022 17:06:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 294H6HvQ099354; Tue, 4 Oct 2022 17:06:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 294H6HG7099353; Tue, 4 Oct 2022 17:06:17 GMT (envelope-from git) Date: Tue, 4 Oct 2022 17:06:17 GMT Message-Id: <202210041706.294H6HG7099353@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: d5dc278eeca3 - main - riscv: Apply 8d7ee2047c5e to the riscv pmap 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: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d5dc278eeca341cf1b5199c7c6ba70553bbb44a0 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1664903177; 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=XsvGrYAMJOqlwfY6LEXtgPMNzHaMFVisAFbqsn+KW4M=; b=JXywo3FgvOtevCnFPrGoSra0/zngvREhXMavhSpR71j8vQsBDE1sxQk87J3GlQfsL2MVNp ESnb7OTAm3OaaKn6XhwM66Zk+kStwF/GnjG5K+V1XuqD/jodaJomdGtfGAQogd8YDHE4GH Asxh9e+wD1ymUZtx2vu3vRvPKOSqjaeIoBQEManu+ox5Kttq553GiMdMBfgnAfHqW1uMjH IGk2FBXdoZdn4UEx8TUTOIkPnnRHrXc202DToFy+NNsgBxDIYRXqazSmpcP64vdKlKY0Bj onB5Jai3llI9TYwAJLv6plzn2Coz/9jeaO5hKqH9u2C7gBAY8F32PEwy9g84lg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1664903177; a=rsa-sha256; cv=none; b=uy7Pqofn+GX8PwLsecPWDqdDnpORNh+e1VnoCsB85Xyr4TEsXmcWddbnBPVi7zRgHDXOga bp3As9A0bavkaC4KNUA31yb2mAw4i4i9UbbhSZNhAtZfAGi4Nc5wvpUThlYT1ip5M4v722 NMYKEeRENp/9bTqiINL/5aREPzAE01P599K/kZr0Hap1WMjFDdOxzQkfdo8ZoJUmGrVzSi GKANl6Q5fsVOoD5R+rt0us8e0Ags5fS0kywOihWRiAMOmhurq2xHZYYog0QTHKbxTSnk7W ow/fTlToV6XIsiZfN4vKz2agQnigDUUki9rhBRnxKK5ND8cB4PohaGesnNZY6g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=d5dc278eeca341cf1b5199c7c6ba70553bbb44a0 commit d5dc278eeca341cf1b5199c7c6ba70553bbb44a0 Author: Mark Johnston AuthorDate: 2022-10-04 16:49:36 +0000 Commit: Mark Johnston CommitDate: 2022-10-04 17:05:54 +0000 riscv: Apply 8d7ee2047c5e to the riscv pmap Reviewed by: alc MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D36840 --- sys/riscv/riscv/pmap.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sys/riscv/riscv/pmap.c b/sys/riscv/riscv/pmap.c index ddbeb9039c51..1171b7fe9b17 100644 --- a/sys/riscv/riscv/pmap.c +++ b/sys/riscv/riscv/pmap.c @@ -2105,12 +2105,13 @@ pmap_pv_promote_l2(pmap_t pmap, vm_offset_t va, vm_paddr_t pa, vm_offset_t va_last; rw_assert(&pvh_global_lock, RA_LOCKED); - KASSERT((va & L2_OFFSET) == 0, - ("pmap_pv_promote_l2: misaligned va %#lx", va)); + KASSERT((pa & L2_OFFSET) == 0, + ("pmap_pv_promote_l2: misaligned pa %#lx", pa)); CHANGE_PV_LIST_LOCK_TO_PHYS(lockp, pa); m = PHYS_TO_VM_PAGE(pa); + va = va & ~L2_OFFSET; pv = pmap_pvh_remove(&m->md, pmap, va); KASSERT(pv != NULL, ("pmap_pv_promote_l2: pv for %#lx not found", va)); pvh = pa_to_pvh(pa); @@ -2755,16 +2756,14 @@ pmap_demote_l2_locked(pmap_t pmap, pd_entry_t *l2, vm_offset_t va, #if VM_NRESERVLEVEL > 0 static void -pmap_promote_l2(pmap_t pmap, pd_entry_t *l2, vm_offset_t va, +pmap_promote_l2(pmap_t pmap, pd_entry_t *l2, vm_offset_t va, vm_page_t ml3, struct rwlock **lockp) { pt_entry_t *firstl3, firstl3e, *l3, l3e; vm_paddr_t pa; - vm_page_t ml3; PMAP_LOCK_ASSERT(pmap, MA_OWNED); - va &= ~L2_OFFSET; KASSERT((pmap_load(l2) & PTE_RWX) == 0, ("pmap_promote_l2: invalid l2 entry %p", l2)); @@ -2821,7 +2820,8 @@ pmap_promote_l2(pmap_t pmap, pd_entry_t *l2, vm_offset_t va, pa += PAGE_SIZE; } - ml3 = PHYS_TO_VM_PAGE(PTE_TO_PHYS(pmap_load(l2))); + if (ml3 == NULL) + ml3 = PHYS_TO_VM_PAGE(PTE_TO_PHYS(pmap_load(l2))); KASSERT(ml3->pindex == pmap_l2_pindex(va), ("pmap_promote_l2: page table page's pindex is wrong")); if (pmap_insert_pt_page(pmap, ml3, true)) { @@ -3107,7 +3107,7 @@ validate: pmap_ps_enabled(pmap) && (m->flags & PG_FICTITIOUS) == 0 && vm_reserv_level_iffullpop(m) == 0) - pmap_promote_l2(pmap, l2, va, &lock); + pmap_promote_l2(pmap, l2, va, mpte, &lock); #endif rv = KERN_SUCCESS;