From nobody Sat Nov 30 06:54:07 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 4Y0gkm1Zfwz5fClW; Sat, 30 Nov 2024 06:54:08 +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 4Y0gkm0vYvz4s1V; Sat, 30 Nov 2024 06:54:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732949648; 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=TQ1AGMRHUOfsTnGlxzlnRQRTd6N++yMA+SCq5sCivpI=; b=IpXswLqNn/d5oHmh0GB1oRIkHzQfP3qySx7KTC+KagpTLkcOdSKfp8U8wu+8if/0gvTkIM f5B6PSRN3uDS8YIhM7Xu0GDSF/GVYNXOjCYEmcmxTpAh0InNlnRCxMens9S2QT3kZa3hGr ttJBfA/byef5N+DXHsflmFid0DeIClbe6ANQf4+h3aWgUfQlMK2iNz2QAeCdR5wpgx3ktH UaM/WFqayQ05ae0iAgPlBqM63sjAHgFDWmuNQQfRPk+iZ4Zl3ZqajJ4PF+aqZBcxl2LWFC uoMsaotEqOlHgHKYJdMcKLI9fMF86Wl6NajoqNmSc7KNBplYC7wn8zMDcmLleQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732949648; 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=TQ1AGMRHUOfsTnGlxzlnRQRTd6N++yMA+SCq5sCivpI=; b=T42E9FFftR9wd1OTH3wcbOwdJKRblosP/Ymb7S982h2QgEFSUbxTaTmH99/WGIU7qoI5gk ivQSo4AiU2zk9nlqNdi6gGuOR9SF1U65IbAwtVOR6wt62+qoX4IE0eZ9r58fT1RJh3S/Bq Cb1q0fbLO7I4nO21pMSvytc09ORH1p5VMrn0S8M8Kw4HFsawHoyg9K4dD6T2Z7FfCKJykp 1w4ae+nFYK//bdOmTY/k8Fp5tYmDjG3UqafM3hTT373NSPV4fTO2wPt/nPP2Mex2EZD7ti fk3c3xbvFReBJVRgsTGfIPEHjLjePsxtmskt1G501fBB3yiiSxb1rTJbkwKyKw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1732949648; a=rsa-sha256; cv=none; b=XewGtzMjWYI1v3XzLmDvkLyAS6xrbgBCw75Uj2us+oE9uWvrl4Lv38YbRzS6Zyq+dVEG8y onA9360f9YTgEh2iStgB1GeIMDP14LtWjBcZQaELXfJ1pbiil4R3XaNGV8NGcbqC6o+fcL Jp6C6+U0lNVOeJPN5vnRMbk/FDVF1ayH/h9SKrnICdTXq1UqNfvYvseoCqOrDNAC8rJSVi kQZSnKn38Yw+TOtMsmKRQK+9G9mQSdq7lEHsKz+8Kf7D+e36KCn2T/aVb4eBNxhyWFIEs7 nYf34AqMpjDLAeVihLza3DNPxEYtG4ZT+HHkwANkdCWYNuESwCAcBPLBpZ9AcA== 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 4Y0gkm0Jj9zxtJ; Sat, 30 Nov 2024 06:54:08 +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 4AU6s7GA034341; Sat, 30 Nov 2024 06:54:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4AU6s7dO034338; Sat, 30 Nov 2024 06:54:07 GMT (envelope-from git) Date: Sat, 30 Nov 2024 06:54:07 GMT Message-Id: <202411300654.4AU6s7dO034338@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ka Ho Ng Subject: git: 57a7f61b13c3 - stable/14 - kerneldump: fix incorrect SETSIZE to BIT_COPY_STORE_REL when livedump 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: khng X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 57a7f61b13c3c9c171fa791466dce4df704629c0 Auto-Submitted: auto-generated The branch stable/14 has been updated by khng: URL: https://cgit.FreeBSD.org/src/commit/?id=57a7f61b13c3c9c171fa791466dce4df704629c0 commit 57a7f61b13c3c9c171fa791466dce4df704629c0 Author: Ka Ho Ng AuthorDate: 2024-11-23 16:35:07 +0000 Commit: Ka Ho Ng CommitDate: 2024-11-30 06:53:49 +0000 kerneldump: fix incorrect SETSIZE to BIT_COPY_STORE_REL when livedump Also replace malloc/free with BITSET_ALLOC/BITSET_FREE macros. Sponsored by: Juniper Networks, Inc. MFC after: 1 week Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D47708 (cherry picked from commit 9ad8116b54616a5e8cbcdd2e1432893dce0c608c) --- sys/kern/kern_dump.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/kern/kern_dump.c b/sys/kern/kern_dump.c index 3afaee9acb7e..a3ca716b2861 100644 --- a/sys/kern/kern_dump.c +++ b/sys/kern/kern_dump.c @@ -466,7 +466,6 @@ minidumpsys(struct dumperinfo *di, bool livedump) struct minidumpstate state; struct msgbuf mb_copy; char *msg_ptr; - size_t sz; int error; if (livedump) { @@ -511,9 +510,10 @@ minidumpsys(struct dumperinfo *di, bool livedump) msgbuf_duplicate(msgbufp, &mb_copy, msg_ptr); state.msgbufp = &mb_copy; - sz = BITSET_SIZE(vm_page_dump_pages); - state.dump_bitset = malloc(sz, M_TEMP, M_WAITOK); - BIT_COPY_STORE_REL(sz, vm_page_dump, state.dump_bitset); + state.dump_bitset = BITSET_ALLOC(vm_page_dump_pages, M_TEMP, + M_WAITOK); + BIT_COPY_STORE_REL(vm_page_dump_pages, vm_page_dump, + state.dump_bitset); } else { KASSERT(dumping, ("minidump invoked outside of doadump()")); @@ -525,7 +525,7 @@ minidumpsys(struct dumperinfo *di, bool livedump) error = cpu_minidumpsys(di, &state); if (livedump) { free(msg_ptr, M_TEMP); - free(state.dump_bitset, M_TEMP); + BITSET_FREE(state.dump_bitset, M_TEMP); } return (error);