From nobody Sat Nov 23 16:35:11 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 4XwcyR541Cz5dWFK; Sat, 23 Nov 2024 16:35:11 +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 4XwcyR4Nvfz4Ps6; Sat, 23 Nov 2024 16:35:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732379711; 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=SuVJTV0VKXCg6paA0QhfLndDsIMoGbjT5XAqMaiCfvY=; b=EVptiZcA3QRGAC5abqGGEC82SWZsByB3ty5Vjb/tTYWQWkryCebO+GGYjY023FM9O6Hpoz 4MOTYMpJbqn7xuiQcLpONsGFEeMPF60tzIefiQ1KbdPjI6v2EJ6zvfMkM+s9Jc+VG9Gktm dHW56w1YGRNg/N1LxG8G8hBjQUsWB2CNzai6+rulj0++qcvJEZZ4wDgouo9NRNrBk1vfin IkC+ghegWSMr5sNgFdIxwYs6FpewEesdoJn8avgVD0JxSfh7Ggf5aMPRDUXgE+SNpYhkA3 eqmcgoi03fHD6/9dK+s7Ay76L8YgIVDAj0BWQoJGFYZivcwZON3BRbRUUqrpgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732379711; 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=SuVJTV0VKXCg6paA0QhfLndDsIMoGbjT5XAqMaiCfvY=; b=lIHonGVhN2ZQfx62oZwLkOAiAjc/Tewq/jCcoThO/WM+qKZPikZU9ONWXMiJethCAdWuD3 nUd+8pSkBO5no4fj3W1WQLzDgK/uYYqdwzAz6rDCNuGsTfIXkCP3uwtN3qgYP3iM67oIWP 2M/8fs/VgvBnZ6RjRVbH2MeE5NNsWysAfXtptrc+ma6StFn9OkmHyYzvf07AfBn9l1sNmh IOX4j8mUXwWW66gPqfo3ftQK4810vJzc5xKX0XZv3Ld3QvGhdwf4NFfolau9o7qHtM6OPw KC694M4t+Tqc/GYVpQSdVJnFgvhQ+4Tkk9HCtYXz4PYO3UalZIE7MMgTNN9FZw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1732379711; a=rsa-sha256; cv=none; b=ZibTbyfPh0jWJmev3gT1m1h/w98tn6lWLm13gncORQngivi8tfemJkm8YkXlS+Gm2NdCVZ UUPdigAfC8Y6yWzSGObWM/buX8y/umpxRh+Nnu3jdbyD7kfXV6ri4tos6axgRmtj7UuzlK 6FtjQ3XWXZHG246/NpgahyzFbxcZntgYGzyKuOvgJklkgo+RYuEK3RgLHwPKLqe9sOmKBZ 6zOeLOmpeP+GG6++SFOEsVriaNxCxfEmhuDTtPxy89eVi1vZnbPZH+KsxJkPFQ3EnTWI2C /h6uIpT/5QGwPGLYwhvqvFJ0cv8t1sqY7q6IIUckGxcGzKOpLXjmh0IsD45PhQ== 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 4XwcyR3wLVzHM3; Sat, 23 Nov 2024 16:35:11 +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 4ANGZBHd034825; Sat, 23 Nov 2024 16:35:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4ANGZBO0034822; Sat, 23 Nov 2024 16:35:11 GMT (envelope-from git) Date: Sat, 23 Nov 2024 16:35:11 GMT Message-Id: <202411231635.4ANGZBO0034822@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ka Ho Ng Subject: git: 9ad8116b5461 - main - 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/main X-Git-Reftype: branch X-Git-Commit: 9ad8116b54616a5e8cbcdd2e1432893dce0c608c Auto-Submitted: auto-generated The branch main has been updated by khng: URL: https://cgit.FreeBSD.org/src/commit/?id=9ad8116b54616a5e8cbcdd2e1432893dce0c608c commit 9ad8116b54616a5e8cbcdd2e1432893dce0c608c Author: Ka Ho Ng AuthorDate: 2024-11-23 16:35:07 +0000 Commit: Ka Ho Ng CommitDate: 2024-11-23 16:35:07 +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 --- 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 40355c14ba0f..67c5844013be 100644 --- a/sys/kern/kern_dump.c +++ b/sys/kern/kern_dump.c @@ -465,7 +465,6 @@ minidumpsys(struct dumperinfo *di, bool livedump) struct minidumpstate state; struct msgbuf mb_copy; char *msg_ptr; - size_t sz; int error; if (livedump) { @@ -510,9 +509,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()")); @@ -524,7 +524,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);