From nobody Mon Jul 07 00:06:21 2025 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 4bb4KB1VwLz60hrf; Mon, 07 Jul 2025 00:06:22 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bb4KB0jG5z43yd; Mon, 07 Jul 2025 00:06:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751846782; 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=YzpUpKjXngahm3dHptPK4XUnmKz6cYX1QB2v8+VEWGI=; b=F3werYCWYuAYAFkyNCr5AYAE9aYtOrW9mEdSYK3dty2F/K+b5TOL9/1Clsh9kWHZFQD6qy Dm7GSZ1rL2T3j4eCEvkA5oPb+MysJ3lIdm2BN2xOyOiIKW6EECTu3Ki2079aIWASj9Htkx GtpvZd/HHNIeGgRiHCZLXeeDRfFkglZVw6H4yAMkNmjuZ8xWkQK9Qcz+5swdZbOS2ipzel 6qvfjUxA3rdyUI8FMr8h981ShW0tq1mXm6QGdryRejkUHYdmvgfvJygxLqxJk7yiDEz9qI lzQGI5QwPKgtgV8yqPu8WI/i8UF8EUqnLpaeRzgL/VJI9WFsEHvPAIvfZdai5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751846782; 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=YzpUpKjXngahm3dHptPK4XUnmKz6cYX1QB2v8+VEWGI=; b=DpdaEF28nFQIjYm48fkNIP4KBQHtLMBTfWhW/r8s2ysxoEFh0ljdmSZMokK2zjF4z5pe8I 8XHfJ6Iqq4IzOJLDvyqxRPtD7rwDKc79+XHMPc0PwZ5J+brV+eBBRZPGHGbsJmi0BgADsR 98yuklqyMHyAV7ATnlAMAaQs5t4/Hv+nfvsGh40kuzq+trl+g3IgfzykQIP2j3C+pkOTxU brFgVHJ+EERbqZFDRpIvBmj8C2cqZU9j3g9L1v9EfplynJdUDjE0Q0i895WtQhmmrK7Cvz mBRhcEtANAwvoVgrPXHD27P2RwqRpnY+PGHZecaEFzFDlk4LRmHI0rENAdOe9Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751846782; a=rsa-sha256; cv=none; b=snqD1fC6XMy9sbF52ZMkPBP3d1MJzhH2fNIJV1TP+EgRPbnk0dxNq1NMQ7mWJgB8tzZZpW medQsjVsFMNZv9AATKGmArJkDqkBmThCda0cemCfN+UAwVfnE9ONNKkzEkwLm+e9rJSfyp ux9F98RH0nM7k99SqpAqOiL1HwYc4kcbJe3MqtMz+v8G3+6TODv/Y2eAz7SmYCYszugEsv hozhjkk3TlrCba6Tt/tJNE/ToiZ0lyqdJawDLT5ox9IG5BHhflOgTVPh7DelAc0ibCs4w0 bKy8UDgIrfdZ3/SCfwwqfrW9kdXi7RGcpD0aBhgjVuMnqGRtM+EJMwbjdqlNYw== 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 4bb4KB0FTszBXg; Mon, 07 Jul 2025 00:06:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56706LIi024195; Mon, 7 Jul 2025 00:06:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56706Ln5024192; Mon, 7 Jul 2025 00:06:21 GMT (envelope-from git) Date: Mon, 7 Jul 2025 00:06:21 GMT Message-Id: <202507070006.56706Ln5024192@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Cox Subject: git: 6a7761b4d27c - main - amd64 pmap: convert panics to KASSERTs 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: alc X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6a7761b4d27c99b3b548f2d948b88bf1430ee636 Auto-Submitted: auto-generated The branch main has been updated by alc: URL: https://cgit.FreeBSD.org/src/commit/?id=6a7761b4d27c99b3b548f2d948b88bf1430ee636 commit 6a7761b4d27c99b3b548f2d948b88bf1430ee636 Author: Alan Cox AuthorDate: 2025-07-06 17:42:08 +0000 Commit: Alan Cox CommitDate: 2025-07-07 00:03:28 +0000 amd64 pmap: convert panics to KASSERTs With the recent changes to pmap_demote_DMAP(), the calls to pmap_demote_pdpe() and pmap_demote_pde_mpte() should never fail, so we change the associated panics to KASSERTs. Reviewed by: kib, markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D51180 --- sys/amd64/amd64/pmap.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index cae5436a1ff2..9c985df13ddf 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -9991,7 +9991,7 @@ pmap_demote_DMAP(vm_paddr_t base, vm_size_t len, bool invalidate) pd_entry_t *pde; vm_offset_t va; vm_page_t m, mpte; - bool changed; + bool changed, rv __diagused; if (len == 0) return; @@ -10021,8 +10021,8 @@ pmap_demote_DMAP(vm_paddr_t base, vm_size_t len, bool invalidate) if ((*pdpe & X86_PG_V) == 0) panic("pmap_demote_DMAP: invalid PDPE"); if ((*pdpe & PG_PS) != 0) { - if (!pmap_demote_pdpe(kernel_pmap, pdpe, va, m)) - panic("pmap_demote_DMAP: PDPE failed"); + rv = pmap_demote_pdpe(kernel_pmap, pdpe, va, m); + KASSERT(rv, ("pmap_demote_DMAP: PDPE failed")); changed = true; m = NULL; } @@ -10033,9 +10033,9 @@ pmap_demote_DMAP(vm_paddr_t base, vm_size_t len, bool invalidate) if ((*pde & PG_PS) != 0) { mpte->pindex = pmap_pde_pindex(va); pmap_pt_page_count_adj(kernel_pmap, 1); - if (!pmap_demote_pde_mpte(kernel_pmap, pde, va, - NULL, mpte)) - panic("pmap_demote_DMAP: PDE failed"); + rv = pmap_demote_pde_mpte(kernel_pmap, pde, va, + NULL, mpte); + KASSERT(rv, ("pmap_demote_DMAP: PDE failed")); changed = true; mpte = NULL; }