From nobody Sun Jun 16 16:20:06 2024 X-Original-To: dev-commits-src-main@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 4W2JBv16k4z5P43Z; Sun, 16 Jun 2024 16:20:07 +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 4W2JBv0P8yz4P7R; Sun, 16 Jun 2024 16:20:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1718554807; 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=Gt/HBUY3N6vgFsXlAPMaVBlXYsXfbO5IeyQLRalf6Yo=; b=pBJc1zxDTldmHsVgVuI4lsSp2OW+iZxjU2Oxw9Uhr0vu87XRDvXpMGV10hqI9q/TrHraY5 RIsndaSmV26ZjyKSzccbehuh3BVU546nqPEqYrtN4R+7p8SbHMKNKntTTsTRrzvN+/EKw2 1bLHAnZQVaS5uJqAQqQ9KiN5PLQ79U8iqSyS8X33gfvu483Q7jLDuC+CAUJq0ZZlxz5goY fgOSmIRvI+VWWqegGKotxgOhOBr8ZsqeYZZiIa40ah7+PQcVc1QlvzhHkUMSYuHadMl2Qf gy1hT280Ywpid1/9y2Du+kf1amoPUYoLxgP0O5eN3079mBt5c1MvdSB5p7VhbA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1718554807; a=rsa-sha256; cv=none; b=QCfjy8hLtxfufAgHIfJa0JGLQfH2iwsTrQbX7X0bJL5QycMi+SlOpnHLafoy5/6zQk6Iv2 6eyu3q6PH9No2KEU2OsxKdfHed6U8d2akVG7+rYVj23GFguES8d0Orm7swh/a6/MRx+sSs VgRRzTIkH7+HxzUM6csnFrR4WPuCPg3DQvTSkwV1rjKtpR6oIp+xjrgHq8iL4jprs/ekpV ZYibO4lFBICyc1YQp5KMoH+wCFafKRmzbYaNRdcIynsnQ39XkrP+YDz030j35hO/zf1QHS TSRP7xOrms+lqs/WpYc94bVRaL9YWJ/m2crP5En45Q63ZVkiItlYS16D8pZMYQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1718554807; 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=Gt/HBUY3N6vgFsXlAPMaVBlXYsXfbO5IeyQLRalf6Yo=; b=EzjhxBBzL0n0/khcMtfCI/jdJzZYAIcD1ai9HH5VKHMgpq5uM4r1ESSwX+qKJ4Fg8ZR20r w1U+L9lIn8/oZDeOCtpsPP5YaYicQN6uUhDg099DPuXXvy4gmIDdbg1n57eHOQNCjU1tNV tt1MZM/MZJpg/NVH2fwx5OkUO4HznHTJDgPaGmo5J4wiAVN17KM8DD2ssYgY0/nw8YiEoa 5FBV3HnnjY4kuyjWH+RG042QPUkWnASFn3v3cmuoRfWz+ObJ+z0b2B5x6XMhmqH2G1EYWf pJ1DS+ClbcKB0ilSgfz+WZwW+rtbPvP2kEOxR7HUTEu3ErAWOJo8Rhfp93OfZg== 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 4W2JBt72Ptzvcn; Sun, 16 Jun 2024 16:20:06 +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 45GGK6TI041682; Sun, 16 Jun 2024 16:20:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 45GGK6no041677; Sun, 16 Jun 2024 16:20:06 GMT (envelope-from git) Date: Sun, 16 Jun 2024 16:20:06 GMT Message-Id: <202406161620.45GGK6no041677@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bojan =?utf-8?Q?Novkovi=C4=87?= Subject: git: 200de4dc0716 - main - powerpc_mmu_radix: Introduce 'pmap_abort_ptp' List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bnovkov X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 200de4dc0716ae2cc2b0995ccb6eee555d14c751 Auto-Submitted: auto-generated The branch main has been updated by bnovkov: URL: https://cgit.FreeBSD.org/src/commit/?id=200de4dc0716ae2cc2b0995ccb6eee555d14c751 commit 200de4dc0716ae2cc2b0995ccb6eee555d14c751 Author: Bojan Novković AuthorDate: 2024-06-13 16:03:31 +0000 Commit: Bojan Novković CommitDate: 2024-06-16 16:19:26 +0000 powerpc_mmu_radix: Introduce 'pmap_abort_ptp' This commit moves code for releasing pagetable page references into a separate function. No functional change intended. Approved by: markj (mentor) Differential Revision: https://reviews.freebsd.org/D45581 --- sys/powerpc/aim/mmu_radix.c | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/sys/powerpc/aim/mmu_radix.c b/sys/powerpc/aim/mmu_radix.c index 0a534e3f9d3f..746b1ef49a99 100644 --- a/sys/powerpc/aim/mmu_radix.c +++ b/sys/powerpc/aim/mmu_radix.c @@ -3137,6 +3137,28 @@ out: return (rv); } +/* + * Release a page table page reference after a failed attempt to create a + * mapping. + */ +static void +pmap_abort_ptp(pmap_t pmap, vm_offset_t va, vm_page_t pdpg) +{ + struct spglist free; + + SLIST_INIT(&free); + if (pmap_unwire_ptp(pmap, va, pdpg, &free)) { + /* + * Although "va" is not mapped, paging- + * structure caches could nonetheless have + * entries that refer to the freed page table + * pages. Invalidate those entries. + */ + pmap_invalidate_page(pmap, va); + vm_page_free_pages_toq(&free, true); + } +} + /* * Tries to create a read- and/or execute-only 2MB page mapping. Returns true * if successful. Returns false if (1) a page table page cannot be allocated @@ -3264,17 +3286,7 @@ pmap_enter_l3e(pmap_t pmap, vm_offset_t va, pml3_entry_t newpde, u_int flags, * Abort this mapping if its PV entry could not be created. */ if (!pmap_pv_insert_l3e(pmap, va, newpde, flags, lockp)) { - SLIST_INIT(&free); - if (pmap_unwire_ptp(pmap, va, pdpg, &free)) { - /* - * Although "va" is not mapped, paging- - * structure caches could nonetheless have - * entries that refer to the freed page table - * pages. Invalidate those entries. - */ - pmap_invalidate_page(pmap, va); - vm_page_free_pages_toq(&free, true); - } + pmap_abort_ptp(pmap, va, pdpg); if (uwptpg != NULL) { mt = pmap_remove_pt_page(pmap, va); KASSERT(mt == uwptpg,