From nobody Sun Jun 4 17:18:38 2023 X-Original-To: dev-commits-src-branches@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 4QZ3Nt2pFhz4ZN2M; Sun, 4 Jun 2023 17:18:38 +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 4QZ3Nt2Fzpz411V; Sun, 4 Jun 2023 17:18:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685899118; 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=2P7akGGa7W3lSHY47S7RacqZtvIg2tv3f2cmgq0+jg0=; b=MaDO7JTbT4789+/eG3SS+RnIEf42aN0hFlN8MBfKtB85doQg1f3MyYD4im1HSAt91Dv9mZ x8CxaGe5g3dRxHvs5uUivukBLhCQgIN5D32kT8J2T2C7OL5NtskQlUs+ayiV7ZxuG2ukwh p5jyLE5muuLXJ/edsKY89L/StiEexvHHy77lw3wIjuY4GHnjcl9TDUgmAZOORix2dAsQ0K QuXApEaVFIOaqGLDEwfutkWdqxJagzwvrKcVfAQmt4cLEQRxosU6ZLs9SwvWy3Tc2B4aQA aRp8Um+HlaU9AzmlUid1pp4JLlt6l5oCYP0bLYp7oGzlZNFRluwP+kVUg7DKKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685899118; 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=2P7akGGa7W3lSHY47S7RacqZtvIg2tv3f2cmgq0+jg0=; b=NHxc72mi1eGtl1cdzUQ1EXVX1qUqM6Jeg1N2kCOIEhSKGTtOeDH3dMN1xZmt5sub9YbGm5 hXPtcb8tb+iLy/5UtZvv5ektbCBWYJUMpBAOvirs0PEspMNDlalYX5UNzaRaRZbBxAVWuC ZsQCVCKTdf67k7tgFVTAPzp1FUR73LrcpIagSc563s1Fen6rqP3NWUIgtCgim5bf++3zkL NwU+SUlo444MVXXLVGBUkEg3pJ7TTLtxpifRf0zxcf+Zvrth6FHhrXvtyZJ3yB3B6QUCqb J/uPxvyf6LIpHdny1o2xac2yhyAC9ymR3gXfKGJunqTi4cXmf/qOPHJkzNvARw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685899118; a=rsa-sha256; cv=none; b=iav4Fk6LFt1S72S9qmaaDpgBLkB18HLg8aBP6Gld66RfWRtrRD4Xq/VcBegZUeLLPUxXpp 8bHcQ3FdShY07hqpqClGEXU3nTJM0yzecXYGV20pq/AIruL7fKJcwzvasXOSdVXp5246Ud virVphZRd44G3YeLDyWkj4slcXxemzBwjFfaf+gsumxvTwcCHyad9s9kEI6ANRULWTqVR+ UA7EctUS/leypWc/8aM36CW/SQC8UjBioXU07SAgEEzk4BywF+Lv/WQTYA+v9go91gmja4 RmeiDkNJc4EMkl0MVt5IcNayrUVBl9WgBRHzfe0X7DQzEOhRys5QN2XMCPu95Q== 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 4QZ3Nt1MsmzF1Y; Sun, 4 Jun 2023 17:18:38 +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 354HIcls010197; Sun, 4 Jun 2023 17:18:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 354HIcR4010196; Sun, 4 Jun 2023 17:18:38 GMT (envelope-from git) Date: Sun, 4 Jun 2023 17:18:38 GMT Message-Id: <202306041718.354HIcR4010196@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Chuck Silvers Subject: git: 89bd147dbf8e - stable/13 - ffs: restore backward compatibility of newfs and makefs with older binaries List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: chs X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 89bd147dbf8e30acf76838a4170025261c2f3b38 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by chs: URL: https://cgit.FreeBSD.org/src/commit/?id=89bd147dbf8e30acf76838a4170025261c2f3b38 commit 89bd147dbf8e30acf76838a4170025261c2f3b38 Author: Chuck Silvers AuthorDate: 2023-05-30 02:26:28 +0000 Commit: Chuck Silvers CommitDate: 2023-06-04 11:00:22 +0000 ffs: restore backward compatibility of newfs and makefs with older binaries The previous change to CGSIZE had the unintended side-effect of allowing newfs and makefs to create file systems that would fail validation when examined by older commands and kernels, by allowing newfs/makefs to pack slightly more blocks into a CG than those older binaries think is valid. Fix this by having newfs/makefs artificially restrict the number of blocks in a CG to the slightly smaller value that those older binaries will accept. The validation code will continue to accept the slightly larger value that the current newfs/makefs (before this change) could create. Fixes: 0a6e34e950cd5889122a199c34519b67569be9cc Reviewed by: mckusick MFC after: 3 days Sponsored by: Netflix (cherry picked from commit d464a7698de8fe18530ea65fac90dce56b860a59) --- sbin/newfs/mkfs.c | 26 +++++++++++++++++++++++--- usr.sbin/makefs/ffs/mkfs.c | 26 +++++++++++++++++++++++--- 2 files changed, 46 insertions(+), 6 deletions(-) diff --git a/sbin/newfs/mkfs.c b/sbin/newfs/mkfs.c index 42866f9b1426..7b55c5c1f229 100644 --- a/sbin/newfs/mkfs.c +++ b/sbin/newfs/mkfs.c @@ -76,6 +76,23 @@ __FBSDID("$FreeBSD$"); #define UMASK 0755 #define POWEROF2(num) (((num) & ((num) - 1)) == 0) +/* + * The definition of "struct cg" used to contain an extra field at the end + * to represent the variable-length data that followed the fixed structure. + * This had the effect of artificially limiting the number of blocks that + * newfs would put in a CG, since newfs thought that the fixed-size header + * was bigger than it really was. When we started validating that the CG + * header data actually fit into one fs block, the placeholder field caused + * a problem because it caused struct cg to be a different size depending on + * platform. The placeholder field was later removed, but this caused a + * backward compatibility problem with older binaries that still thought + * struct cg was larger, and a new file system could fail validation if + * viewed by the older binaries. To avoid this compatibility problem, we + * now artificially reduce the amount of space that the variable-length data + * can use such that new file systems will pass validation by older binaries. + */ +#define CGSIZEFUDGE 8 + static struct csum *fscs; #define sblock disk.d_fs #define acg disk.d_cg @@ -369,7 +386,8 @@ retry: sblock.fs_fpg = minfpg; sblock.fs_ipg = roundup(howmany(sblock.fs_fpg, fragsperinode), INOPB(&sblock)); - if (CGSIZE(&sblock) < (unsigned long)sblock.fs_bsize) + if (CGSIZE(&sblock) < (unsigned long)sblock.fs_bsize - + CGSIZEFUDGE) break; density -= sblock.fs_fsize; } @@ -388,9 +406,11 @@ retry: if (Oflag > 1 || (Oflag == 1 && sblock.fs_ipg <= 0x7fff)) { if (sblock.fs_size / sblock.fs_fpg < MINCYLGRPS) break; - if (CGSIZE(&sblock) < (unsigned long)sblock.fs_bsize) + if (CGSIZE(&sblock) < (unsigned long)sblock.fs_bsize - + CGSIZEFUDGE) continue; - if (CGSIZE(&sblock) == (unsigned long)sblock.fs_bsize) + if (CGSIZE(&sblock) == (unsigned long)sblock.fs_bsize - + CGSIZEFUDGE) break; } sblock.fs_fpg -= sblock.fs_frag; diff --git a/usr.sbin/makefs/ffs/mkfs.c b/usr.sbin/makefs/ffs/mkfs.c index d48dc65aac68..4e88dae7aae8 100644 --- a/usr.sbin/makefs/ffs/mkfs.c +++ b/usr.sbin/makefs/ffs/mkfs.c @@ -80,6 +80,23 @@ static int count_digits(int); #define UMASK 0755 #define POWEROF2(num) (((num) & ((num) - 1)) == 0) +/* + * The definition of "struct cg" used to contain an extra field at the end + * to represent the variable-length data that followed the fixed structure. + * This had the effect of artificially limiting the number of blocks that + * newfs would put in a CG, since newfs thought that the fixed-size header + * was bigger than it really was. When we started validating that the CG + * header data actually fit into one fs block, the placeholder field caused + * a problem because it caused struct cg to be a different size depending on + * platform. The placeholder field was later removed, but this caused a + * backward compatibility problem with older binaries that still thought + * struct cg was larger, and a new file system could fail validation if + * viewed by the older binaries. To avoid this compatibility problem, we + * now artificially reduce the amount of space that the variable-length data + * can use such that new file systems will pass validation by older binaries. + */ +#define CGSIZEFUDGE 8 + static union { struct fs fs; char pad[SBLOCKSIZE]; @@ -347,7 +364,8 @@ ffs_mkfs(const char *fsys, const fsinfo_t *fsopts, time_t tstamp) sblock.fs_fpg = minfpg; sblock.fs_ipg = roundup(howmany(sblock.fs_fpg, fragsperinode), INOPB(&sblock)); - if (CGSIZE(&sblock) < (unsigned long)sblock.fs_bsize) + if (CGSIZE(&sblock) < (unsigned long)sblock.fs_bsize - + CGSIZEFUDGE) break; density -= sblock.fs_fsize; } @@ -366,9 +384,11 @@ ffs_mkfs(const char *fsys, const fsinfo_t *fsopts, time_t tstamp) INOPB(&sblock)); if (sblock.fs_size / sblock.fs_fpg < 1) break; - if (CGSIZE(&sblock) < (unsigned long)sblock.fs_bsize) + if (CGSIZE(&sblock) < (unsigned long)sblock.fs_bsize - + CGSIZEFUDGE) continue; - if (CGSIZE(&sblock) == (unsigned long)sblock.fs_bsize) + if (CGSIZE(&sblock) == (unsigned long)sblock.fs_bsize - + CGSIZEFUDGE) break; sblock.fs_fpg -= sblock.fs_frag; sblock.fs_ipg = roundup(howmany(sblock.fs_fpg, fragsperinode), From nobody Mon Jun 5 03:41:35 2023 X-Original-To: dev-commits-src-branches@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 4QZKCh3ntjz4Z8nh; Mon, 5 Jun 2023 03:41:36 +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 4QZKCh3ZwLz4MqW; Mon, 5 Jun 2023 03:41:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685936496; 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=x/FkAatrO+ZyQjU/oFHWzSyX/snVEcrVVL5w8mLvlsA=; b=auL3a72UH9xJo5gZuAAyGsCUX/U4bu6ksZ6uPgYxa4VHOrI+qX4foc3nPKLlvpFHiZuTHj 8/vUPbvaYUZTt3QjW82GFfSoEiU/t7m53mj2/n4cV09KXMlzPAhGwYlpwkIOSBG+CjRLLz YMbcnuiQ2s4ktWcwqYsGIrHEl0XUBujn9bRtHT7L4EOy8+rmUt9fy5X1tAs8KhB6YNlJo0 UqNBME3VexIjp0VHPrnXJ+CGIpUfKWZ4S+anH9BSl4D2xeUlMKnZcpgCyezY8Wn2uU03U/ /B34/sjXmN8IIGPI+m//IXVbk+JaoNExdVwlDE2DPy2HSSlF+SpQQIUi8g7N7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685936496; 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=x/FkAatrO+ZyQjU/oFHWzSyX/snVEcrVVL5w8mLvlsA=; b=YTUUhv6T/rPvW+kyqu+V2Ssv2uevlpNO0P+sLE4F66QElUq8sLuZNDCiRYCYrF7PjARdwP U6XEz6ArRvx3eKh9niIlWxiA7k+jrHWDvvdVFIkV+K/J3LzqgJvSo21/O1FPE+DOHSUIrn l16GmzL1ihcUXNTNjFtz/v5oe8k9Zo+lVnNH17fKlTcEvPk0q3FpXWMLKvSD8QtOwU1/ow JPFg0Acjlpk/Xf4TrScg2zd2OYk7S4rMTDqT8PkQFs8pED3iJlBGPThF9u61F+8SYkzD7A xn4fxta8tk8AQx0EDy80u2ApmqVjlWHzb7xrG6NN7jSW+tMcYO3zDmLDHA/Vaw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685936496; a=rsa-sha256; cv=none; b=kp9kINk7SW/60rn6hjU9LWqTNPfW/hbmEFc27KevmHTQxBQxiR59b6WCY6+t1zdgW7+R3D /i8B8du3gsjUG97WIrozKGCy3zCqE+DTFkqXf/sxwGDC1XoI6cY2KLh7tfd2X1YRnV7w/K JnuSQ1JQcxM0u/wFBm0Tldmc4L/P4KTAY5pB2nzORn5VkT6sYJuhBPVE3w7xm3i8NJD253 MllDkgYT6ieR7bI1AE7I9sCPf7vw3NikYbFYy2EQ+Q/CYWkA4f8CRMKnCBZNNt/gGUsPy1 PeAkrz4b9tU/wi1GexIBmOp6iX1RmJlUjrSD6zIuTPuRORsoIdPloKIYkfY6oA== 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 4QZKCh2gqGzY2R; Mon, 5 Jun 2023 03:41:36 +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 3553faSL042548; Mon, 5 Jun 2023 03:41:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3553fZlS042544; Mon, 5 Jun 2023 03:41:35 GMT (envelope-from git) Date: Mon, 5 Jun 2023 03:41:35 GMT Message-Id: <202306050341.3553fZlS042544@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: ea656f7cdcc1 - stable/13 - sqlite3: Vendor import of sqlite3 3.42.0 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ea656f7cdcc1fedd5cd62bc9b983c748f814fca2 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=ea656f7cdcc1fedd5cd62bc9b983c748f814fca2 commit ea656f7cdcc1fedd5cd62bc9b983c748f814fca2 Author: Cy Schubert AuthorDate: 2023-05-28 14:31:36 +0000 Commit: Cy Schubert CommitDate: 2023-06-05 01:38:55 +0000 sqlite3: Vendor import of sqlite3 3.42.0 Release notes at https://www.sqlite.org/releaselog/3_42_0.html. Obtained from: https://www.sqlite.org/2023/sqlite-autoconf-3420000.tar.gz Merge commit '92b2b066353ddd32e1d59f8c52c430d552d9a9a5' into sqlite3/main (cherry picked from commit 402cee1f19b613bae844a176156a41cdfa507585) --- contrib/sqlite3/configure | 20 +- contrib/sqlite3/configure.ac | 2 +- contrib/sqlite3/shell.c | 1016 ++++-- contrib/sqlite3/sqlite3.c | 6955 +++++++++++++++++++++++++------------- contrib/sqlite3/sqlite3.h | 202 +- contrib/sqlite3/sqlite3rc.h | 2 +- contrib/sqlite3/tea/configure | 18 +- contrib/sqlite3/tea/configure.ac | 2 +- 8 files changed, 5524 insertions(+), 2693 deletions(-) diff --git a/contrib/sqlite3/configure b/contrib/sqlite3/configure index dea9860d00ee..1016e350c37f 100755 --- a/contrib/sqlite3/configure +++ b/contrib/sqlite3/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for sqlite 3.41.2. +# Generated by GNU Autoconf 2.71 for sqlite 3.42.0. # # Report bugs to . # @@ -621,8 +621,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='sqlite' PACKAGE_TARNAME='sqlite' -PACKAGE_VERSION='3.41.2' -PACKAGE_STRING='sqlite 3.41.2' +PACKAGE_VERSION='3.42.0' +PACKAGE_STRING='sqlite 3.42.0' PACKAGE_BUGREPORT='http://www.sqlite.org' PACKAGE_URL='' @@ -1367,7 +1367,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures sqlite 3.41.2 to adapt to many kinds of systems. +\`configure' configures sqlite 3.42.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1438,7 +1438,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of sqlite 3.41.2:";; + short | recursive ) echo "Configuration of sqlite 3.42.0:";; esac cat <<\_ACEOF @@ -1563,7 +1563,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -sqlite configure 3.41.2 +sqlite configure 3.42.0 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. @@ -1833,7 +1833,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by sqlite $as_me 3.41.2, which was +It was created by sqlite $as_me 3.42.0, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw @@ -3106,7 +3106,7 @@ fi # Define the identity of the package. PACKAGE='sqlite' - VERSION='3.41.2' + VERSION='3.42.0' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h @@ -15314,7 +15314,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by sqlite $as_me 3.41.2, which was +This file was extended by sqlite $as_me 3.42.0, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -15373,7 +15373,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -sqlite config.status 3.41.2 +sqlite config.status 3.42.0 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" diff --git a/contrib/sqlite3/configure.ac b/contrib/sqlite3/configure.ac index 290f160afc56..a706a4753049 100644 --- a/contrib/sqlite3/configure.ac +++ b/contrib/sqlite3/configure.ac @@ -10,7 +10,7 @@ # AC_PREREQ(2.61) -AC_INIT(sqlite, 3.41.2, http://www.sqlite.org) +AC_INIT(sqlite, 3.42.0, http://www.sqlite.org) AC_CONFIG_SRCDIR([sqlite3.c]) AC_CONFIG_AUX_DIR([.]) diff --git a/contrib/sqlite3/shell.c b/contrib/sqlite3/shell.c index e6495d75128e..647a214226cc 100644 --- a/contrib/sqlite3/shell.c +++ b/contrib/sqlite3/shell.c @@ -117,6 +117,7 @@ typedef unsigned short int u16; #include #include #include +#include #include "sqlite3.h" typedef sqlite3_int64 i64; typedef sqlite3_uint64 u64; @@ -245,6 +246,7 @@ typedef unsigned char u8; #if SQLITE_OS_WINRT #include #endif +#define WIN32_LEAN_AND_MEAN #include /* string conversion routines only needed on Win32 */ @@ -459,11 +461,25 @@ static void endTimer(void){ static int bail_on_error = 0; /* -** Threat stdin as an interactive input if the following variable +** Treat stdin as an interactive input if the following variable ** is true. Otherwise, assume stdin is connected to a file or pipe. */ static int stdin_is_interactive = 1; +#if (defined(_WIN32) || defined(WIN32)) && SHELL_USE_LOCAL_GETLINE \ + && !defined(SHELL_OMIT_WIN_UTF8) +# define SHELL_WIN_UTF8_OPT 1 +#else +# define SHELL_WIN_UTF8_OPT 0 +#endif + +#if SHELL_WIN_UTF8_OPT +/* +** Setup console for UTF-8 input/output when following variable true. +*/ +static int console_utf8 = 0; +#endif + /* ** On Windows systems we have to know if standard output is a console ** in order to translate UTF-8 into MBCS. The following variable is @@ -596,16 +612,150 @@ static char *dynamicContinuePrompt(void){ } #endif /* !defined(SQLITE_OMIT_DYNAPROMPT) */ +#if SHELL_WIN_UTF8_OPT +/* Following struct is used for -utf8 operation. */ +static struct ConsoleState { + int stdinEof; /* EOF has been seen on console input */ + int infsMode; /* Input file stream mode upon shell start */ + UINT inCodePage; /* Input code page upon shell start */ + UINT outCodePage; /* Output code page upon shell start */ + HANDLE hConsoleIn; /* Console input handle */ + DWORD consoleMode; /* Console mode upon shell start */ +} conState = { 0, 0, 0, 0, INVALID_HANDLE_VALUE, 0 }; + +#ifndef _O_U16TEXT /* For build environments lacking this constant: */ +# define _O_U16TEXT 0x20000 +#endif + +/* +** Prepare console, (if known to be a WIN32 console), for UTF-8 +** input (from either typing or suitable paste operations) and for +** UTF-8 rendering. This may "fail" with a message to stderr, where +** the preparation is not done and common "code page" issues occur. +*/ +static void console_prepare(void){ + HANDLE hCI = GetStdHandle(STD_INPUT_HANDLE); + DWORD consoleMode = 0; + if( isatty(0) && GetFileType(hCI)==FILE_TYPE_CHAR + && GetConsoleMode( hCI, &consoleMode) ){ + if( !IsValidCodePage(CP_UTF8) ){ + fprintf(stderr, "Cannot use UTF-8 code page.\n"); + console_utf8 = 0; + return; + } + conState.hConsoleIn = hCI; + conState.consoleMode = consoleMode; + conState.inCodePage = GetConsoleCP(); + conState.outCodePage = GetConsoleOutputCP(); + SetConsoleCP(CP_UTF8); + SetConsoleOutputCP(CP_UTF8); + consoleMode |= ENABLE_LINE_INPUT | ENABLE_PROCESSED_INPUT; + SetConsoleMode(conState.hConsoleIn, consoleMode); + conState.infsMode = _setmode(_fileno(stdin), _O_U16TEXT); + console_utf8 = 1; + }else{ + console_utf8 = 0; + } +} + +/* +** Undo the effects of console_prepare(), if any. +*/ +static void SQLITE_CDECL console_restore(void){ + if( console_utf8 && conState.inCodePage!=0 + && conState.hConsoleIn!=INVALID_HANDLE_VALUE ){ + _setmode(_fileno(stdin), conState.infsMode); + SetConsoleCP(conState.inCodePage); + SetConsoleOutputCP(conState.outCodePage); + SetConsoleMode(conState.hConsoleIn, conState.consoleMode); + /* Avoid multiple calls. */ + conState.hConsoleIn = INVALID_HANDLE_VALUE; + conState.consoleMode = 0; + console_utf8 = 0; + } +} + +/* +** Collect input like fgets(...) with special provisions for input +** from the Windows console to get around its strange coding issues. +** Defers to plain fgets() when input is not interactive or when the +** startup option, -utf8, has not been provided or taken effect. +*/ +static char* utf8_fgets(char *buf, int ncmax, FILE *fin){ + if( fin==0 ) fin = stdin; + if( fin==stdin && stdin_is_interactive && console_utf8 ){ +# define SQLITE_IALIM 150 + wchar_t wbuf[SQLITE_IALIM]; + int lend = 0; + int noc = 0; + if( ncmax==0 || conState.stdinEof ) return 0; + buf[0] = 0; + while( noc SQLITE_IALIM*4+1 + noc) + ? SQLITE_IALIM : (ncmax-1 - noc)/4; +# undef SQLITE_IALIM + DWORD nbr = 0; + BOOL bRC = ReadConsoleW(conState.hConsoleIn, wbuf, na, &nbr, 0); + if( !bRC || (noc==0 && nbr==0) ) return 0; + if( nbr > 0 ){ + int nmb = WideCharToMultiByte(CP_UTF8,WC_COMPOSITECHECK|WC_DEFAULTCHAR, + wbuf,nbr,0,0,0,0); + if( nmb !=0 && noc+nmb <= ncmax ){ + int iseg = noc; + nmb = WideCharToMultiByte(CP_UTF8,WC_COMPOSITECHECK|WC_DEFAULTCHAR, + wbuf,nbr,buf+noc,nmb,0,0); + noc += nmb; + /* Fixup line-ends as coded by Windows for CR (or "Enter".)*/ + if( noc > 0 ){ + if( buf[noc-1]=='\n' ){ + lend = 1; + if( noc > 1 && buf[noc-2]=='\r' ){ + buf[noc-2] = '\n'; + --noc; + } + } + } + /* Check for ^Z (anywhere in line) too. */ + while( iseg < noc ){ + if( buf[iseg]==0x1a ){ + conState.stdinEof = 1; + noc = iseg; /* Chop ^Z and anything following. */ + break; + } + ++iseg; + } + }else break; /* Drop apparent garbage in. (Could assert.) */ + }else break; + } + /* If got nothing, (after ^Z chop), must be at end-of-file. */ + if( noc == 0 ) return 0; + buf[noc] = 0; + return buf; + }else{ + return fgets(buf, ncmax, fin); + } +} + +# define fgets(b,n,f) utf8_fgets(b,n,f) +#endif /* SHELL_WIN_UTF8_OPT */ + /* ** Render output like fprintf(). Except, if the output is going to the -** console and if this is running on a Windows machine, translate the -** output from UTF-8 into MBCS. +** console and if this is running on a Windows machine, and if the -utf8 +** option is unavailable or (available and inactive), translate the +** output from UTF-8 into MBCS for output through 8-bit stdout stream. +** (With -utf8 active, no translation is needed and must not be done.) */ #if defined(_WIN32) || defined(WIN32) void utf8_printf(FILE *out, const char *zFormat, ...){ va_list ap; va_start(ap, zFormat); - if( stdout_is_console && (out==stdout || out==stderr) ){ + if( stdout_is_console && (out==stdout || out==stderr) +# if SHELL_WIN_UTF8_OPT + && !console_utf8 +# endif + ){ char *z1 = sqlite3_vmprintf(zFormat, ap); char *z2 = sqlite3_win32_utf8_to_mbcs_v2(z1, 0); sqlite3_free(z1); @@ -637,7 +787,7 @@ static void shell_out_of_memory(void){ /* Check a pointer to see if it is NULL. If it is NULL, exit with an ** out-of-memory error. */ -static void shell_check_oom(void *p){ +static void shell_check_oom(const void *p){ if( p==0 ) shell_out_of_memory(); } @@ -816,9 +966,14 @@ static char *local_getline(char *zLine, FILE *in){ } } #if defined(_WIN32) || defined(WIN32) - /* For interactive input on Windows systems, translate the - ** multi-byte characterset characters into UTF-8. */ - if( stdin_is_interactive && in==stdin ){ + /* For interactive input on Windows systems, without -utf8, + ** translate the multi-byte characterset characters into UTF-8. + ** This is the translation that predates the -utf8 option. */ + if( stdin_is_interactive && in==stdin +# if SHELL_WIN_UTF8_OPT + && !console_utf8 +# endif /* SHELL_WIN_UTF8_OPT */ + ){ char *zTrans = sqlite3_win32_mbcs_to_utf8_v2(zLine, 0); if( zTrans ){ i64 nTrans = strlen(zTrans)+1; @@ -859,10 +1014,21 @@ static char *one_input_line(FILE *in, char *zPrior, int isContinuation){ #if SHELL_USE_LOCAL_GETLINE printf("%s", zPrompt); fflush(stdout); - zResult = local_getline(zPrior, stdin); + do{ + zResult = local_getline(zPrior, stdin); + zPrior = 0; + /* ^C trap creates a false EOF, so let "interrupt" thread catch up. */ + if( zResult==0 ) sqlite3_sleep(50); + }while( zResult==0 && seenInterrupt>0 ); #else free(zPrior); zResult = shell_readline(zPrompt); + while( zResult==0 ){ + /* ^C trap creates a false EOF, so let "interrupt" thread catch up. */ + sqlite3_sleep(50); + if( seenInterrupt==0 ) break; + zResult = shell_readline(""); + } if( zResult && *zResult ) shell_add_history(zResult); #endif } @@ -1002,6 +1168,7 @@ static void appendText(ShellText *p, const char *zAppend, char quote){ */ static char quoteChar(const char *zName){ int i; + if( zName==0 ) return '"'; if( !isalpha((unsigned char)zName[0]) && zName[0]!='_' ) return '"'; for(i=0; zName[i]; i++){ if( !isalnum((unsigned char)zName[i]) && zName[i]!='_' ) return '"'; @@ -1645,7 +1812,8 @@ int sqlite3MemTraceDeactivate(void){ ** ****************************************************************************** ** -** This SQLite extension implements functions that compute SHA3 hashes. +** This SQLite extension implements functions that compute SHA3 hashes +** in the way described by the (U.S.) NIST FIPS 202 SHA-3 Standard. ** Two SQL functions are implemented: ** ** sha3(X,SIZE) @@ -3173,6 +3341,7 @@ SQLITE_EXTENSION_INIT1; #define U8_TYPEDEF #endif +/* Decoding table, ASCII (7-bit) value to base 64 digit value or other */ static const u8 b64DigitValues[128] = { /* HT LF VT FF CR */ ND,ND,ND,ND, ND,ND,ND,ND, ND,WS,WS,WS, WS,WS,ND,ND, @@ -3244,9 +3413,9 @@ static char* toBase64( u8 *pIn, int nbIn, char *pOut ){ } /* Skip over text which is not base64 numeral(s). */ -static char * skipNonB64( char *s ){ +static char * skipNonB64( char *s, int nc ){ char c; - while( (c = *s) && !IS_BX_DIGIT(BX_DV_PROTO(c)) ) ++s; + while( nc-- > 0 && (c = *s) && !IS_BX_DIGIT(BX_DV_PROTO(c)) ) ++s; return s; } @@ -3255,7 +3424,7 @@ static u8* fromBase64( char *pIn, int ncIn, u8 *pOut ){ if( ncIn>0 && pIn[ncIn-1]=='\n' ) --ncIn; while( ncIn>0 && *pIn!=PAD_CHAR ){ static signed char nboi[] = { 0, 0, 1, 2, 3 }; - char *pUse = skipNonB64(pIn); + char *pUse = skipNonB64(pIn, ncIn); unsigned long qv = 0L; int nti, nbo, nac; ncIn -= (pUse - pIn); @@ -3315,9 +3484,16 @@ static void base64(sqlite3_context *context, int na, sqlite3_value *av[]){ sqlite3_result_error(context, "blob expanded to base64 too big", -1); return; } + bBuf = (u8*)sqlite3_value_blob(av[0]); + if( !bBuf ){ + if( SQLITE_NOMEM==sqlite3_errcode(sqlite3_context_db_handle(context)) ){ + goto memFail; + } + sqlite3_result_text(context,"",-1,SQLITE_STATIC); + break; + } cBuf = sqlite3_malloc(nc); if( !cBuf ) goto memFail; - bBuf = (u8*)sqlite3_value_blob(av[0]); nc = (int)(toBase64(bBuf, nb, cBuf) - cBuf); sqlite3_result_text(context, cBuf, nc, sqlite3_free); break; @@ -3330,9 +3506,16 @@ static void base64(sqlite3_context *context, int na, sqlite3_value *av[]){ }else if( nb<1 ){ nb = 1; } + cBuf = (char *)sqlite3_value_text(av[0]); + if( !cBuf ){ + if( SQLITE_NOMEM==sqlite3_errcode(sqlite3_context_db_handle(context)) ){ + goto memFail; + } + sqlite3_result_zeroblob(context, 0); + break; + } bBuf = sqlite3_malloc(nb); if( !bBuf ) goto memFail; - cBuf = (char *)sqlite3_value_text(av[0]); nb = (int)(fromBase64(cBuf, nc, bBuf) - bBuf); sqlite3_result_blob(context, bBuf, nb, sqlite3_free); break; @@ -3520,9 +3703,9 @@ static u8 base85DigitValue( char c ){ #define B85_DARK_MAX 80 -static char * skipNonB85( char *s ){ +static char * skipNonB85( char *s, int nc ){ char c; - while( (c = *s) && !IS_B85(c) ) ++s; + while( nc-- > 0 && (c = *s) && !IS_B85(c) ) ++s; return s; } @@ -3592,7 +3775,7 @@ static u8* fromBase85( char *pIn, int ncIn, u8 *pOut ){ if( ncIn>0 && pIn[ncIn-1]=='\n' ) --ncIn; while( ncIn>0 ){ static signed char nboi[] = { 0, 0, 1, 2, 3, 4 }; - char *pUse = skipNonB85(pIn); + char *pUse = skipNonB85(pIn, ncIn); unsigned long qv = 0L; int nti, nbo; ncIn -= (pUse - pIn); @@ -3677,9 +3860,16 @@ static void base85(sqlite3_context *context, int na, sqlite3_value *av[]){ sqlite3_result_error(context, "blob expanded to base85 too big", -1); return; } + bBuf = (u8*)sqlite3_value_blob(av[0]); + if( !bBuf ){ + if( SQLITE_NOMEM==sqlite3_errcode(sqlite3_context_db_handle(context)) ){ + goto memFail; + } + sqlite3_result_text(context,"",-1,SQLITE_STATIC); + break; + } cBuf = sqlite3_malloc(nc); if( !cBuf ) goto memFail; - bBuf = (u8*)sqlite3_value_blob(av[0]); nc = (int)(toBase85(bBuf, nb, cBuf, "\n") - cBuf); sqlite3_result_text(context, cBuf, nc, sqlite3_free); break; @@ -3692,9 +3882,16 @@ static void base85(sqlite3_context *context, int na, sqlite3_value *av[]){ }else if( nb<1 ){ nb = 1; } + cBuf = (char *)sqlite3_value_text(av[0]); + if( !cBuf ){ + if( SQLITE_NOMEM==sqlite3_errcode(sqlite3_context_db_handle(context)) ){ + goto memFail; + } + sqlite3_result_zeroblob(context, 0); + break; + } bBuf = sqlite3_malloc(nb); if( !bBuf ) goto memFail; - cBuf = (char *)sqlite3_value_text(av[0]); nb = (int)(fromBase85(cBuf, nc, bBuf) - bBuf); sqlite3_result_blob(context, bBuf, nb, sqlite3_free); break; @@ -4114,7 +4311,7 @@ int sqlite3_ieee_init( /************************* End ../ext/misc/ieee754.c ********************/ /************************* Begin ../ext/misc/series.c ******************/ /* -** 2015-08-18 +** 2015-08-18, 2023-04-28 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: @@ -4127,7 +4324,19 @@ int sqlite3_ieee_init( ** ** This file demonstrates how to create a table-valued-function using ** a virtual table. This demo implements the generate_series() function -** which gives similar results to the eponymous function in PostgreSQL. +** which gives the same results as the eponymous function in PostgreSQL, +** within the limitation that its arguments are signed 64-bit integers. +** +** Considering its equivalents to generate_series(start,stop,step): A +** value V[n] sequence is produced for integer n ascending from 0 where +** ( V[n] == start + n * step && sgn(V[n] - stop) * sgn(step) >= 0 ) +** for each produced value (independent of production time ordering.) +** +** All parameters must be either integer or convertable to integer. +** The start parameter is required. +** The stop parameter defaults to (1<<32)-1 (aka 4294967295 or 0xffffffff) +** The step parameter defaults to 1 and 0 is treated as 1. +** ** Examples: ** ** SELECT * FROM generate_series(0,100,5); @@ -4143,6 +4352,14 @@ int sqlite3_ieee_init( ** ** Integers 20 through 29. ** +** SELECT * FROM generate_series(0,-100,-5); +** +** Integers 0 -5 -10 ... -100. +** +** SELECT * FROM generate_series(0,-1); +** +** Empty sequence. +** ** HOW IT WORKS ** ** The generate_series "function" is really a virtual table with the @@ -4155,6 +4372,9 @@ int sqlite3_ieee_init( ** step HIDDEN ** ); ** +** The virtual table also has a rowid, logically equivalent to n+1 where +** "n" is the ascending integer in the aforesaid production definition. +** ** Function arguments in queries against this virtual table are translated ** into equality constraints against successive hidden columns. In other ** words, the following pairs of queries are equivalent to each other: @@ -4187,9 +4407,126 @@ int sqlite3_ieee_init( SQLITE_EXTENSION_INIT1 #include #include +#include #ifndef SQLITE_OMIT_VIRTUALTABLE +/* +** Return that member of a generate_series(...) sequence whose 0-based +** index is ix. The 0th member is given by smBase. The sequence members +** progress per ix increment by smStep. +*/ +static sqlite3_int64 genSeqMember(sqlite3_int64 smBase, + sqlite3_int64 smStep, + sqlite3_uint64 ix){ + if( ix>=(sqlite3_uint64)LLONG_MAX ){ + /* Get ix into signed i64 range. */ + ix -= (sqlite3_uint64)LLONG_MAX; + /* With 2's complement ALU, this next can be 1 step, but is split into + * 2 for UBSAN's satisfaction (and hypothetical 1's complement ALUs.) */ + smBase += (LLONG_MAX/2) * smStep; + smBase += (LLONG_MAX - LLONG_MAX/2) * smStep; + } + /* Under UBSAN (or on 1's complement machines), must do this last term + * in steps to avoid the dreaded (and harmless) signed multiply overlow. */ + if( ix>=2 ){ + sqlite3_int64 ix2 = (sqlite3_int64)ix/2; + smBase += ix2*smStep; + ix -= ix2; + } + return smBase + ((sqlite3_int64)ix)*smStep; +} + +/* typedef unsigned char u8; */ + +typedef struct SequenceSpec { + sqlite3_int64 iBase; /* Starting value ("start") */ + sqlite3_int64 iTerm; /* Given terminal value ("stop") */ + sqlite3_int64 iStep; /* Increment ("step") */ + sqlite3_uint64 uSeqIndexMax; /* maximum sequence index (aka "n") */ + sqlite3_uint64 uSeqIndexNow; /* Current index during generation */ + sqlite3_int64 iValueNow; /* Current value during generation */ + u8 isNotEOF; /* Sequence generation not exhausted */ + u8 isReversing; /* Sequence is being reverse generated */ +} SequenceSpec; + +/* +** Prepare a SequenceSpec for use in generating an integer series +** given initialized iBase, iTerm and iStep values. Sequence is +** initialized per given isReversing. Other members are computed. +*/ +static void setupSequence( SequenceSpec *pss ){ + int bSameSigns; + pss->uSeqIndexMax = 0; + pss->isNotEOF = 0; + bSameSigns = (pss->iBase < 0)==(pss->iTerm < 0); + if( pss->iTerm < pss->iBase ){ + sqlite3_uint64 nuspan = 0; + if( bSameSigns ){ + nuspan = (sqlite3_uint64)(pss->iBase - pss->iTerm); + }else{ + /* Under UBSAN (or on 1's complement machines), must do this in steps. + * In this clause, iBase>=0 and iTerm<0 . */ + nuspan = 1; + nuspan += pss->iBase; + nuspan += -(pss->iTerm+1); + } + if( pss->iStep<0 ){ + pss->isNotEOF = 1; + if( nuspan==ULONG_MAX ){ + pss->uSeqIndexMax = ( pss->iStep>LLONG_MIN )? nuspan/-pss->iStep : 1; + }else if( pss->iStep>LLONG_MIN ){ + pss->uSeqIndexMax = nuspan/-pss->iStep; + } + } + }else if( pss->iTerm > pss->iBase ){ + sqlite3_uint64 puspan = 0; + if( bSameSigns ){ + puspan = (sqlite3_uint64)(pss->iTerm - pss->iBase); + }else{ + /* Under UBSAN (or on 1's complement machines), must do this in steps. + * In this clause, iTerm>=0 and iBase<0 . */ + puspan = 1; + puspan += pss->iTerm; + puspan += -(pss->iBase+1); + } + if( pss->iStep>0 ){ + pss->isNotEOF = 1; + pss->uSeqIndexMax = puspan/pss->iStep; + } + }else if( pss->iTerm == pss->iBase ){ + pss->isNotEOF = 1; + pss->uSeqIndexMax = 0; + } + pss->uSeqIndexNow = (pss->isReversing)? pss->uSeqIndexMax : 0; + pss->iValueNow = (pss->isReversing) + ? genSeqMember(pss->iBase, pss->iStep, pss->uSeqIndexMax) + : pss->iBase; +} +/* +** Progress sequence generator to yield next value, if any. +** Leave its state to either yield next value or be at EOF. +** Return whether there is a next value, or 0 at EOF. +*/ +static int progressSequence( SequenceSpec *pss ){ + if( !pss->isNotEOF ) return 0; + if( pss->isReversing ){ + if( pss->uSeqIndexNow > 0 ){ + pss->uSeqIndexNow--; + pss->iValueNow -= pss->iStep; + }else{ + pss->isNotEOF = 0; + } + }else{ + if( pss->uSeqIndexNow < pss->uSeqIndexMax ){ + pss->uSeqIndexNow++; + pss->iValueNow += pss->iStep; + }else{ + pss->isNotEOF = 0; + } + } + return pss->isNotEOF; +} /* series_cursor is a subclass of sqlite3_vtab_cursor which will ** serve as the underlying representation of a cursor that scans @@ -4198,12 +4535,7 @@ SQLITE_EXTENSION_INIT1 typedef struct series_cursor series_cursor; struct series_cursor { sqlite3_vtab_cursor base; /* Base class - must be first */ - int isDesc; /* True to count down rather than up */ - sqlite3_int64 iRowid; /* The rowid */ - sqlite3_int64 iValue; /* Current value ("value") */ - sqlite3_int64 mnValue; /* Mimimum value ("start") */ - sqlite3_int64 mxValue; /* Maximum value ("stop") */ - sqlite3_int64 iStep; /* Increment ("step") */ + SequenceSpec ss; /* (this) Derived class data */ }; /* @@ -4285,12 +4617,7 @@ static int seriesClose(sqlite3_vtab_cursor *cur){ */ static int seriesNext(sqlite3_vtab_cursor *cur){ series_cursor *pCur = (series_cursor*)cur; - if( pCur->isDesc ){ - pCur->iValue -= pCur->iStep; - }else{ - pCur->iValue += pCur->iStep; - } - pCur->iRowid++; + progressSequence( & pCur->ss ); return SQLITE_OK; } @@ -4306,23 +4633,23 @@ static int seriesColumn( series_cursor *pCur = (series_cursor*)cur; sqlite3_int64 x = 0; switch( i ){ - case SERIES_COLUMN_START: x = pCur->mnValue; break; - case SERIES_COLUMN_STOP: x = pCur->mxValue; break; - case SERIES_COLUMN_STEP: x = pCur->iStep; break; - default: x = pCur->iValue; break; + case SERIES_COLUMN_START: x = pCur->ss.iBase; break; + case SERIES_COLUMN_STOP: x = pCur->ss.iTerm; break; + case SERIES_COLUMN_STEP: x = pCur->ss.iStep; break; + default: x = pCur->ss.iValueNow; break; } sqlite3_result_int64(ctx, x); return SQLITE_OK; } /* -** Return the rowid for the current row. In this implementation, the -** first row returned is assigned rowid value 1, and each subsequent -** row a value 1 more than that of the previous. +** Return the rowid for the current row, logically equivalent to n+1 where +** "n" is the ascending integer in the aforesaid production definition. */ static int seriesRowid(sqlite3_vtab_cursor *cur, sqlite_int64 *pRowid){ series_cursor *pCur = (series_cursor*)cur; - *pRowid = pCur->iRowid; + sqlite3_uint64 n = pCur->ss.uSeqIndexNow; + *pRowid = (sqlite3_int64)((n<0xffffffffffffffff)? n+1 : 0); return SQLITE_OK; } @@ -4332,14 +4659,10 @@ static int seriesRowid(sqlite3_vtab_cursor *cur, sqlite_int64 *pRowid){ */ static int seriesEof(sqlite3_vtab_cursor *cur){ series_cursor *pCur = (series_cursor*)cur; - if( pCur->isDesc ){ - return pCur->iValue < pCur->mnValue; - }else{ - return pCur->iValue > pCur->mxValue; - } + return !pCur->ss.isNotEOF; } -/* True to cause run-time checking of the start=, stop=, and/or step= +/* True to cause run-time checking of the start=, stop=, and/or step= ** parameters. The only reason to do this is for testing the ** constraint checking logic for virtual tables in the SQLite core. */ @@ -4350,7 +4673,7 @@ static int seriesEof(sqlite3_vtab_cursor *cur){ /* ** This method is called to "rewind" the series_cursor object back ** to the first row of output. This method is always called at least -** once prior to any call to seriesColumn() or seriesRowid() or +** once prior to any call to seriesColumn() or seriesRowid() or ** seriesEof(). ** ** The query plan selected by seriesBestIndex is passed in the idxNum @@ -4370,7 +4693,7 @@ static int seriesEof(sqlite3_vtab_cursor *cur){ ** (so that seriesEof() will return true) if the table is empty. */ static int seriesFilter( - sqlite3_vtab_cursor *pVtabCursor, + sqlite3_vtab_cursor *pVtabCursor, int idxNum, const char *idxStrUnused, int argc, sqlite3_value **argv ){ @@ -4378,46 +4701,41 @@ static int seriesFilter( int i = 0; (void)idxStrUnused; if( idxNum & 1 ){ - pCur->mnValue = sqlite3_value_int64(argv[i++]); + pCur->ss.iBase = sqlite3_value_int64(argv[i++]); }else{ - pCur->mnValue = 0; + pCur->ss.iBase = 0; } if( idxNum & 2 ){ - pCur->mxValue = sqlite3_value_int64(argv[i++]); + pCur->ss.iTerm = sqlite3_value_int64(argv[i++]); }else{ - pCur->mxValue = 0xffffffff; + pCur->ss.iTerm = 0xffffffff; } if( idxNum & 4 ){ - pCur->iStep = sqlite3_value_int64(argv[i++]); - if( pCur->iStep==0 ){ - pCur->iStep = 1; - }else if( pCur->iStep<0 ){ - pCur->iStep = -pCur->iStep; + pCur->ss.iStep = sqlite3_value_int64(argv[i++]); + if( pCur->ss.iStep==0 ){ + pCur->ss.iStep = 1; + }else if( pCur->ss.iStep<0 ){ if( (idxNum & 16)==0 ) idxNum |= 8; } }else{ - pCur->iStep = 1; + pCur->ss.iStep = 1; } for(i=0; imnValue = 1; - pCur->mxValue = 0; + pCur->ss.iBase = 1; + pCur->ss.iTerm = 0; + pCur->ss.iStep = 1; break; } } if( idxNum & 8 ){ - pCur->isDesc = 1; - pCur->iValue = pCur->mxValue; - if( pCur->iStep>0 ){ - pCur->iValue -= (pCur->mxValue - pCur->mnValue)%pCur->iStep; - } + pCur->ss.isReversing = pCur->ss.iStep > 0; }else{ - pCur->isDesc = 0; - pCur->iValue = pCur->mnValue; + pCur->ss.isReversing = pCur->ss.iStep < 0; } - pCur->iRowid = 1; + setupSequence( &pCur->ss ); return SQLITE_OK; } @@ -5172,7 +5490,7 @@ static const char *re_subcompile_string(ReCompiled *p){ break; } case '[': { - int iFirst = p->nState; + unsigned int iFirst = p->nState; if( rePeek(p)=='^' ){ re_append(p, RE_OP_CC_EXC, 0); p->sIn.i++; @@ -5196,7 +5514,7 @@ static const char *re_subcompile_string(ReCompiled *p){ if( rePeek(p)==']' ){ p->sIn.i++; break; } } if( c==0 ) return "unclosed '['"; - p->aArg[iFirst] = p->nState - iFirst; + if( p->nState>iFirst ) p->aArg[iFirst] = p->nState - iFirst; break; } case '\\': { @@ -8773,7 +9091,10 @@ static int zipfileColumn( ** it to be a directory either if the mode suggests so, or if ** the final character in the name is '/'. */ u32 mode = pCDS->iExternalAttr >> 16; - if( !(mode & S_IFDIR) && pCDS->zFile[pCDS->nFile-1]!='/' ){ + if( !(mode & S_IFDIR) + && pCDS->nFile>=1 + && pCDS->zFile[pCDS->nFile-1]!='/' + ){ sqlite3_result_blob(ctx, "", 0, SQLITE_STATIC); } } @@ -9210,9 +9531,19 @@ static u32 zipfileGetTime(sqlite3_value *pVal){ */ static void zipfileRemoveEntryFromList(ZipfileTab *pTab, ZipfileEntry *pOld){ if( pOld ){ - ZipfileEntry **pp; - for(pp=&pTab->pFirstEntry; (*pp)!=pOld; pp=&((*pp)->pNext)); - *pp = (*pp)->pNext; + if( pTab->pFirstEntry==pOld ){ + pTab->pFirstEntry = pOld->pNext; + if( pTab->pLastEntry==pOld ) pTab->pLastEntry = 0; + }else{ + ZipfileEntry *p; + for(p=pTab->pFirstEntry; p; p=p->pNext){ + if( p->pNext==pOld ){ + p->pNext = pOld->pNext; + if( pTab->pLastEntry==pOld ) pTab->pLastEntry = p; + break; + } + } + } zipfileEntryFree(pOld); } } @@ -12678,6 +13009,7 @@ static int dbdataConnect( (void)argc; (void)argv; (void)pzErr; + sqlite3_vtab_config(db, SQLITE_VTAB_USES_ALL_SCHEMAS); if( rc==SQLITE_OK ){ pTab = (DbdataTable*)sqlite3_malloc64(sizeof(DbdataTable)); if( pTab==0 ){ @@ -13323,8 +13655,6 @@ static int dbdataFilter( } if( rc==SQLITE_OK ){ rc = sqlite3_bind_text(pCsr->pStmt, 1, zSchema, -1, SQLITE_TRANSIENT); - }else{ - pTab->base.zErrMsg = sqlite3_mprintf("%s", sqlite3_errmsg(pTab->db)); } /* Try to determine the encoding of the db by inspecting the header @@ -13333,6 +13663,10 @@ static int dbdataFilter( rc = dbdataGetEncoding(pCsr); } + if( rc!=SQLITE_OK ){ + pTab->base.zErrMsg = sqlite3_mprintf("%s", sqlite3_errmsg(pTab->db)); + } + if( rc==SQLITE_OK ){ rc = dbdataNext(pCursor); } @@ -14571,7 +14905,7 @@ static void recoverAddTable( int iField = sqlite3_column_int(pStmt, 0); int iCol = sqlite3_column_int(pStmt, 1); - assert( iFieldnCol && iColnCol ); + assert( iColnCol ); pNew->aCol[iCol].iField = iField; pNew->bIntkey = 0; @@ -16335,7 +16669,7 @@ int sqlite3_recover_finish(sqlite3_recover *p){ #endif /* ifndef SQLITE_OMIT_VIRTUALTABLE */ /************************* End ../ext/recover/sqlite3recover.c ********************/ -# endif +# endif /* SQLITE_HAVE_SQLITE3R */ #endif #ifdef SQLITE_SHELL_EXTSRC # include SHELL_STRINGIFY(SQLITE_SHELL_EXTSRC) @@ -16517,6 +16851,7 @@ static ShellState shellState; #define SHFLG_HeaderSet 0x00000080 /* showHeader has been specified */ #define SHFLG_DumpDataOnly 0x00000100 /* .dump show data only */ #define SHFLG_DumpNoSys 0x00000200 /* .dump omits system tables */ +#define SHFLG_TestingMode 0x00000400 /* allow unsafe testing features */ /* ** Macros for testing and setting shellFlgs @@ -16760,6 +17095,7 @@ static void editFunc( }else{ /* If the file did not originally contain \r\n then convert any new ** \r\n back into \n */ + p[sz] = 0; for(i=j=0; i To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 60ab53f3a67b - stable/12 - sqlite3: Vendor import of sqlite3 3.42.0 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 60ab53f3a67be68174f5a8ef4a64b03f52b60201 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=60ab53f3a67be68174f5a8ef4a64b03f52b60201 commit 60ab53f3a67be68174f5a8ef4a64b03f52b60201 Author: Cy Schubert AuthorDate: 2023-05-28 14:31:36 +0000 Commit: Cy Schubert CommitDate: 2023-06-05 03:42:08 +0000 sqlite3: Vendor import of sqlite3 3.42.0 Release notes at https://www.sqlite.org/releaselog/3_42_0.html. Obtained from: https://www.sqlite.org/2023/sqlite-autoconf-3420000.tar.gz Merge commit '92b2b066353ddd32e1d59f8c52c430d552d9a9a5' into sqlite3/main (cherry picked from commit 402cee1f19b613bae844a176156a41cdfa507585) --- contrib/sqlite3/configure | 20 +- contrib/sqlite3/configure.ac | 2 +- contrib/sqlite3/shell.c | 1016 ++++-- contrib/sqlite3/sqlite3.c | 6955 +++++++++++++++++++++++++------------- contrib/sqlite3/sqlite3.h | 202 +- contrib/sqlite3/sqlite3rc.h | 2 +- contrib/sqlite3/tea/configure | 18 +- contrib/sqlite3/tea/configure.ac | 2 +- 8 files changed, 5524 insertions(+), 2693 deletions(-) diff --git a/contrib/sqlite3/configure b/contrib/sqlite3/configure index dea9860d00ee..1016e350c37f 100755 --- a/contrib/sqlite3/configure +++ b/contrib/sqlite3/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for sqlite 3.41.2. +# Generated by GNU Autoconf 2.71 for sqlite 3.42.0. # # Report bugs to . # @@ -621,8 +621,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='sqlite' PACKAGE_TARNAME='sqlite' -PACKAGE_VERSION='3.41.2' -PACKAGE_STRING='sqlite 3.41.2' +PACKAGE_VERSION='3.42.0' +PACKAGE_STRING='sqlite 3.42.0' PACKAGE_BUGREPORT='http://www.sqlite.org' PACKAGE_URL='' @@ -1367,7 +1367,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures sqlite 3.41.2 to adapt to many kinds of systems. +\`configure' configures sqlite 3.42.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1438,7 +1438,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of sqlite 3.41.2:";; + short | recursive ) echo "Configuration of sqlite 3.42.0:";; esac cat <<\_ACEOF @@ -1563,7 +1563,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -sqlite configure 3.41.2 +sqlite configure 3.42.0 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. @@ -1833,7 +1833,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by sqlite $as_me 3.41.2, which was +It was created by sqlite $as_me 3.42.0, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw @@ -3106,7 +3106,7 @@ fi # Define the identity of the package. PACKAGE='sqlite' - VERSION='3.41.2' + VERSION='3.42.0' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h @@ -15314,7 +15314,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by sqlite $as_me 3.41.2, which was +This file was extended by sqlite $as_me 3.42.0, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -15373,7 +15373,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -sqlite config.status 3.41.2 +sqlite config.status 3.42.0 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" diff --git a/contrib/sqlite3/configure.ac b/contrib/sqlite3/configure.ac index 290f160afc56..a706a4753049 100644 --- a/contrib/sqlite3/configure.ac +++ b/contrib/sqlite3/configure.ac @@ -10,7 +10,7 @@ # AC_PREREQ(2.61) -AC_INIT(sqlite, 3.41.2, http://www.sqlite.org) +AC_INIT(sqlite, 3.42.0, http://www.sqlite.org) AC_CONFIG_SRCDIR([sqlite3.c]) AC_CONFIG_AUX_DIR([.]) diff --git a/contrib/sqlite3/shell.c b/contrib/sqlite3/shell.c index e6495d75128e..647a214226cc 100644 --- a/contrib/sqlite3/shell.c +++ b/contrib/sqlite3/shell.c @@ -117,6 +117,7 @@ typedef unsigned short int u16; #include #include #include +#include #include "sqlite3.h" typedef sqlite3_int64 i64; typedef sqlite3_uint64 u64; @@ -245,6 +246,7 @@ typedef unsigned char u8; #if SQLITE_OS_WINRT #include #endif +#define WIN32_LEAN_AND_MEAN #include /* string conversion routines only needed on Win32 */ @@ -459,11 +461,25 @@ static void endTimer(void){ static int bail_on_error = 0; /* -** Threat stdin as an interactive input if the following variable +** Treat stdin as an interactive input if the following variable ** is true. Otherwise, assume stdin is connected to a file or pipe. */ static int stdin_is_interactive = 1; +#if (defined(_WIN32) || defined(WIN32)) && SHELL_USE_LOCAL_GETLINE \ + && !defined(SHELL_OMIT_WIN_UTF8) +# define SHELL_WIN_UTF8_OPT 1 +#else +# define SHELL_WIN_UTF8_OPT 0 +#endif + +#if SHELL_WIN_UTF8_OPT +/* +** Setup console for UTF-8 input/output when following variable true. +*/ +static int console_utf8 = 0; +#endif + /* ** On Windows systems we have to know if standard output is a console ** in order to translate UTF-8 into MBCS. The following variable is @@ -596,16 +612,150 @@ static char *dynamicContinuePrompt(void){ } #endif /* !defined(SQLITE_OMIT_DYNAPROMPT) */ +#if SHELL_WIN_UTF8_OPT +/* Following struct is used for -utf8 operation. */ +static struct ConsoleState { + int stdinEof; /* EOF has been seen on console input */ + int infsMode; /* Input file stream mode upon shell start */ + UINT inCodePage; /* Input code page upon shell start */ + UINT outCodePage; /* Output code page upon shell start */ + HANDLE hConsoleIn; /* Console input handle */ + DWORD consoleMode; /* Console mode upon shell start */ +} conState = { 0, 0, 0, 0, INVALID_HANDLE_VALUE, 0 }; + +#ifndef _O_U16TEXT /* For build environments lacking this constant: */ +# define _O_U16TEXT 0x20000 +#endif + +/* +** Prepare console, (if known to be a WIN32 console), for UTF-8 +** input (from either typing or suitable paste operations) and for +** UTF-8 rendering. This may "fail" with a message to stderr, where +** the preparation is not done and common "code page" issues occur. +*/ +static void console_prepare(void){ + HANDLE hCI = GetStdHandle(STD_INPUT_HANDLE); + DWORD consoleMode = 0; + if( isatty(0) && GetFileType(hCI)==FILE_TYPE_CHAR + && GetConsoleMode( hCI, &consoleMode) ){ + if( !IsValidCodePage(CP_UTF8) ){ + fprintf(stderr, "Cannot use UTF-8 code page.\n"); + console_utf8 = 0; + return; + } + conState.hConsoleIn = hCI; + conState.consoleMode = consoleMode; + conState.inCodePage = GetConsoleCP(); + conState.outCodePage = GetConsoleOutputCP(); + SetConsoleCP(CP_UTF8); + SetConsoleOutputCP(CP_UTF8); + consoleMode |= ENABLE_LINE_INPUT | ENABLE_PROCESSED_INPUT; + SetConsoleMode(conState.hConsoleIn, consoleMode); + conState.infsMode = _setmode(_fileno(stdin), _O_U16TEXT); + console_utf8 = 1; + }else{ + console_utf8 = 0; + } +} + +/* +** Undo the effects of console_prepare(), if any. +*/ +static void SQLITE_CDECL console_restore(void){ + if( console_utf8 && conState.inCodePage!=0 + && conState.hConsoleIn!=INVALID_HANDLE_VALUE ){ + _setmode(_fileno(stdin), conState.infsMode); + SetConsoleCP(conState.inCodePage); + SetConsoleOutputCP(conState.outCodePage); + SetConsoleMode(conState.hConsoleIn, conState.consoleMode); + /* Avoid multiple calls. */ + conState.hConsoleIn = INVALID_HANDLE_VALUE; + conState.consoleMode = 0; + console_utf8 = 0; + } +} + +/* +** Collect input like fgets(...) with special provisions for input +** from the Windows console to get around its strange coding issues. +** Defers to plain fgets() when input is not interactive or when the +** startup option, -utf8, has not been provided or taken effect. +*/ +static char* utf8_fgets(char *buf, int ncmax, FILE *fin){ + if( fin==0 ) fin = stdin; + if( fin==stdin && stdin_is_interactive && console_utf8 ){ +# define SQLITE_IALIM 150 + wchar_t wbuf[SQLITE_IALIM]; + int lend = 0; + int noc = 0; + if( ncmax==0 || conState.stdinEof ) return 0; + buf[0] = 0; + while( noc SQLITE_IALIM*4+1 + noc) + ? SQLITE_IALIM : (ncmax-1 - noc)/4; +# undef SQLITE_IALIM + DWORD nbr = 0; + BOOL bRC = ReadConsoleW(conState.hConsoleIn, wbuf, na, &nbr, 0); + if( !bRC || (noc==0 && nbr==0) ) return 0; + if( nbr > 0 ){ + int nmb = WideCharToMultiByte(CP_UTF8,WC_COMPOSITECHECK|WC_DEFAULTCHAR, + wbuf,nbr,0,0,0,0); + if( nmb !=0 && noc+nmb <= ncmax ){ + int iseg = noc; + nmb = WideCharToMultiByte(CP_UTF8,WC_COMPOSITECHECK|WC_DEFAULTCHAR, + wbuf,nbr,buf+noc,nmb,0,0); + noc += nmb; + /* Fixup line-ends as coded by Windows for CR (or "Enter".)*/ + if( noc > 0 ){ + if( buf[noc-1]=='\n' ){ + lend = 1; + if( noc > 1 && buf[noc-2]=='\r' ){ + buf[noc-2] = '\n'; + --noc; + } + } + } + /* Check for ^Z (anywhere in line) too. */ + while( iseg < noc ){ + if( buf[iseg]==0x1a ){ + conState.stdinEof = 1; + noc = iseg; /* Chop ^Z and anything following. */ + break; + } + ++iseg; + } + }else break; /* Drop apparent garbage in. (Could assert.) */ + }else break; + } + /* If got nothing, (after ^Z chop), must be at end-of-file. */ + if( noc == 0 ) return 0; + buf[noc] = 0; + return buf; + }else{ + return fgets(buf, ncmax, fin); + } +} + +# define fgets(b,n,f) utf8_fgets(b,n,f) +#endif /* SHELL_WIN_UTF8_OPT */ + /* ** Render output like fprintf(). Except, if the output is going to the -** console and if this is running on a Windows machine, translate the -** output from UTF-8 into MBCS. +** console and if this is running on a Windows machine, and if the -utf8 +** option is unavailable or (available and inactive), translate the +** output from UTF-8 into MBCS for output through 8-bit stdout stream. +** (With -utf8 active, no translation is needed and must not be done.) */ #if defined(_WIN32) || defined(WIN32) void utf8_printf(FILE *out, const char *zFormat, ...){ va_list ap; va_start(ap, zFormat); - if( stdout_is_console && (out==stdout || out==stderr) ){ + if( stdout_is_console && (out==stdout || out==stderr) +# if SHELL_WIN_UTF8_OPT + && !console_utf8 +# endif + ){ char *z1 = sqlite3_vmprintf(zFormat, ap); char *z2 = sqlite3_win32_utf8_to_mbcs_v2(z1, 0); sqlite3_free(z1); @@ -637,7 +787,7 @@ static void shell_out_of_memory(void){ /* Check a pointer to see if it is NULL. If it is NULL, exit with an ** out-of-memory error. */ -static void shell_check_oom(void *p){ +static void shell_check_oom(const void *p){ if( p==0 ) shell_out_of_memory(); } @@ -816,9 +966,14 @@ static char *local_getline(char *zLine, FILE *in){ } } #if defined(_WIN32) || defined(WIN32) - /* For interactive input on Windows systems, translate the - ** multi-byte characterset characters into UTF-8. */ - if( stdin_is_interactive && in==stdin ){ + /* For interactive input on Windows systems, without -utf8, + ** translate the multi-byte characterset characters into UTF-8. + ** This is the translation that predates the -utf8 option. */ + if( stdin_is_interactive && in==stdin +# if SHELL_WIN_UTF8_OPT + && !console_utf8 +# endif /* SHELL_WIN_UTF8_OPT */ + ){ char *zTrans = sqlite3_win32_mbcs_to_utf8_v2(zLine, 0); if( zTrans ){ i64 nTrans = strlen(zTrans)+1; @@ -859,10 +1014,21 @@ static char *one_input_line(FILE *in, char *zPrior, int isContinuation){ #if SHELL_USE_LOCAL_GETLINE printf("%s", zPrompt); fflush(stdout); - zResult = local_getline(zPrior, stdin); + do{ + zResult = local_getline(zPrior, stdin); + zPrior = 0; + /* ^C trap creates a false EOF, so let "interrupt" thread catch up. */ + if( zResult==0 ) sqlite3_sleep(50); + }while( zResult==0 && seenInterrupt>0 ); #else free(zPrior); zResult = shell_readline(zPrompt); + while( zResult==0 ){ + /* ^C trap creates a false EOF, so let "interrupt" thread catch up. */ + sqlite3_sleep(50); + if( seenInterrupt==0 ) break; + zResult = shell_readline(""); + } if( zResult && *zResult ) shell_add_history(zResult); #endif } @@ -1002,6 +1168,7 @@ static void appendText(ShellText *p, const char *zAppend, char quote){ */ static char quoteChar(const char *zName){ int i; + if( zName==0 ) return '"'; if( !isalpha((unsigned char)zName[0]) && zName[0]!='_' ) return '"'; for(i=0; zName[i]; i++){ if( !isalnum((unsigned char)zName[i]) && zName[i]!='_' ) return '"'; @@ -1645,7 +1812,8 @@ int sqlite3MemTraceDeactivate(void){ ** ****************************************************************************** ** -** This SQLite extension implements functions that compute SHA3 hashes. +** This SQLite extension implements functions that compute SHA3 hashes +** in the way described by the (U.S.) NIST FIPS 202 SHA-3 Standard. ** Two SQL functions are implemented: ** ** sha3(X,SIZE) @@ -3173,6 +3341,7 @@ SQLITE_EXTENSION_INIT1; #define U8_TYPEDEF #endif +/* Decoding table, ASCII (7-bit) value to base 64 digit value or other */ static const u8 b64DigitValues[128] = { /* HT LF VT FF CR */ ND,ND,ND,ND, ND,ND,ND,ND, ND,WS,WS,WS, WS,WS,ND,ND, @@ -3244,9 +3413,9 @@ static char* toBase64( u8 *pIn, int nbIn, char *pOut ){ } /* Skip over text which is not base64 numeral(s). */ -static char * skipNonB64( char *s ){ +static char * skipNonB64( char *s, int nc ){ char c; - while( (c = *s) && !IS_BX_DIGIT(BX_DV_PROTO(c)) ) ++s; + while( nc-- > 0 && (c = *s) && !IS_BX_DIGIT(BX_DV_PROTO(c)) ) ++s; return s; } @@ -3255,7 +3424,7 @@ static u8* fromBase64( char *pIn, int ncIn, u8 *pOut ){ if( ncIn>0 && pIn[ncIn-1]=='\n' ) --ncIn; while( ncIn>0 && *pIn!=PAD_CHAR ){ static signed char nboi[] = { 0, 0, 1, 2, 3 }; - char *pUse = skipNonB64(pIn); + char *pUse = skipNonB64(pIn, ncIn); unsigned long qv = 0L; int nti, nbo, nac; ncIn -= (pUse - pIn); @@ -3315,9 +3484,16 @@ static void base64(sqlite3_context *context, int na, sqlite3_value *av[]){ sqlite3_result_error(context, "blob expanded to base64 too big", -1); return; } + bBuf = (u8*)sqlite3_value_blob(av[0]); + if( !bBuf ){ + if( SQLITE_NOMEM==sqlite3_errcode(sqlite3_context_db_handle(context)) ){ + goto memFail; + } + sqlite3_result_text(context,"",-1,SQLITE_STATIC); + break; + } cBuf = sqlite3_malloc(nc); if( !cBuf ) goto memFail; - bBuf = (u8*)sqlite3_value_blob(av[0]); nc = (int)(toBase64(bBuf, nb, cBuf) - cBuf); sqlite3_result_text(context, cBuf, nc, sqlite3_free); break; @@ -3330,9 +3506,16 @@ static void base64(sqlite3_context *context, int na, sqlite3_value *av[]){ }else if( nb<1 ){ nb = 1; } + cBuf = (char *)sqlite3_value_text(av[0]); + if( !cBuf ){ + if( SQLITE_NOMEM==sqlite3_errcode(sqlite3_context_db_handle(context)) ){ + goto memFail; + } + sqlite3_result_zeroblob(context, 0); + break; + } bBuf = sqlite3_malloc(nb); if( !bBuf ) goto memFail; - cBuf = (char *)sqlite3_value_text(av[0]); nb = (int)(fromBase64(cBuf, nc, bBuf) - bBuf); sqlite3_result_blob(context, bBuf, nb, sqlite3_free); break; @@ -3520,9 +3703,9 @@ static u8 base85DigitValue( char c ){ #define B85_DARK_MAX 80 -static char * skipNonB85( char *s ){ +static char * skipNonB85( char *s, int nc ){ char c; - while( (c = *s) && !IS_B85(c) ) ++s; + while( nc-- > 0 && (c = *s) && !IS_B85(c) ) ++s; return s; } @@ -3592,7 +3775,7 @@ static u8* fromBase85( char *pIn, int ncIn, u8 *pOut ){ if( ncIn>0 && pIn[ncIn-1]=='\n' ) --ncIn; while( ncIn>0 ){ static signed char nboi[] = { 0, 0, 1, 2, 3, 4 }; - char *pUse = skipNonB85(pIn); + char *pUse = skipNonB85(pIn, ncIn); unsigned long qv = 0L; int nti, nbo; ncIn -= (pUse - pIn); @@ -3677,9 +3860,16 @@ static void base85(sqlite3_context *context, int na, sqlite3_value *av[]){ sqlite3_result_error(context, "blob expanded to base85 too big", -1); return; } + bBuf = (u8*)sqlite3_value_blob(av[0]); + if( !bBuf ){ + if( SQLITE_NOMEM==sqlite3_errcode(sqlite3_context_db_handle(context)) ){ + goto memFail; + } + sqlite3_result_text(context,"",-1,SQLITE_STATIC); + break; + } cBuf = sqlite3_malloc(nc); if( !cBuf ) goto memFail; - bBuf = (u8*)sqlite3_value_blob(av[0]); nc = (int)(toBase85(bBuf, nb, cBuf, "\n") - cBuf); sqlite3_result_text(context, cBuf, nc, sqlite3_free); break; @@ -3692,9 +3882,16 @@ static void base85(sqlite3_context *context, int na, sqlite3_value *av[]){ }else if( nb<1 ){ nb = 1; } + cBuf = (char *)sqlite3_value_text(av[0]); + if( !cBuf ){ + if( SQLITE_NOMEM==sqlite3_errcode(sqlite3_context_db_handle(context)) ){ + goto memFail; + } + sqlite3_result_zeroblob(context, 0); + break; + } bBuf = sqlite3_malloc(nb); if( !bBuf ) goto memFail; - cBuf = (char *)sqlite3_value_text(av[0]); nb = (int)(fromBase85(cBuf, nc, bBuf) - bBuf); sqlite3_result_blob(context, bBuf, nb, sqlite3_free); break; @@ -4114,7 +4311,7 @@ int sqlite3_ieee_init( /************************* End ../ext/misc/ieee754.c ********************/ /************************* Begin ../ext/misc/series.c ******************/ /* -** 2015-08-18 +** 2015-08-18, 2023-04-28 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: @@ -4127,7 +4324,19 @@ int sqlite3_ieee_init( ** ** This file demonstrates how to create a table-valued-function using ** a virtual table. This demo implements the generate_series() function -** which gives similar results to the eponymous function in PostgreSQL. +** which gives the same results as the eponymous function in PostgreSQL, +** within the limitation that its arguments are signed 64-bit integers. +** +** Considering its equivalents to generate_series(start,stop,step): A +** value V[n] sequence is produced for integer n ascending from 0 where +** ( V[n] == start + n * step && sgn(V[n] - stop) * sgn(step) >= 0 ) +** for each produced value (independent of production time ordering.) +** +** All parameters must be either integer or convertable to integer. +** The start parameter is required. +** The stop parameter defaults to (1<<32)-1 (aka 4294967295 or 0xffffffff) +** The step parameter defaults to 1 and 0 is treated as 1. +** ** Examples: ** ** SELECT * FROM generate_series(0,100,5); @@ -4143,6 +4352,14 @@ int sqlite3_ieee_init( ** ** Integers 20 through 29. ** +** SELECT * FROM generate_series(0,-100,-5); +** +** Integers 0 -5 -10 ... -100. +** +** SELECT * FROM generate_series(0,-1); +** +** Empty sequence. +** ** HOW IT WORKS ** ** The generate_series "function" is really a virtual table with the @@ -4155,6 +4372,9 @@ int sqlite3_ieee_init( ** step HIDDEN ** ); ** +** The virtual table also has a rowid, logically equivalent to n+1 where +** "n" is the ascending integer in the aforesaid production definition. +** ** Function arguments in queries against this virtual table are translated ** into equality constraints against successive hidden columns. In other ** words, the following pairs of queries are equivalent to each other: @@ -4187,9 +4407,126 @@ int sqlite3_ieee_init( SQLITE_EXTENSION_INIT1 #include #include +#include #ifndef SQLITE_OMIT_VIRTUALTABLE +/* +** Return that member of a generate_series(...) sequence whose 0-based +** index is ix. The 0th member is given by smBase. The sequence members +** progress per ix increment by smStep. +*/ +static sqlite3_int64 genSeqMember(sqlite3_int64 smBase, + sqlite3_int64 smStep, + sqlite3_uint64 ix){ + if( ix>=(sqlite3_uint64)LLONG_MAX ){ + /* Get ix into signed i64 range. */ + ix -= (sqlite3_uint64)LLONG_MAX; + /* With 2's complement ALU, this next can be 1 step, but is split into + * 2 for UBSAN's satisfaction (and hypothetical 1's complement ALUs.) */ + smBase += (LLONG_MAX/2) * smStep; + smBase += (LLONG_MAX - LLONG_MAX/2) * smStep; + } + /* Under UBSAN (or on 1's complement machines), must do this last term + * in steps to avoid the dreaded (and harmless) signed multiply overlow. */ + if( ix>=2 ){ + sqlite3_int64 ix2 = (sqlite3_int64)ix/2; + smBase += ix2*smStep; + ix -= ix2; + } + return smBase + ((sqlite3_int64)ix)*smStep; +} + +/* typedef unsigned char u8; */ + +typedef struct SequenceSpec { + sqlite3_int64 iBase; /* Starting value ("start") */ + sqlite3_int64 iTerm; /* Given terminal value ("stop") */ + sqlite3_int64 iStep; /* Increment ("step") */ + sqlite3_uint64 uSeqIndexMax; /* maximum sequence index (aka "n") */ + sqlite3_uint64 uSeqIndexNow; /* Current index during generation */ + sqlite3_int64 iValueNow; /* Current value during generation */ + u8 isNotEOF; /* Sequence generation not exhausted */ + u8 isReversing; /* Sequence is being reverse generated */ +} SequenceSpec; + +/* +** Prepare a SequenceSpec for use in generating an integer series +** given initialized iBase, iTerm and iStep values. Sequence is +** initialized per given isReversing. Other members are computed. +*/ +static void setupSequence( SequenceSpec *pss ){ + int bSameSigns; + pss->uSeqIndexMax = 0; + pss->isNotEOF = 0; + bSameSigns = (pss->iBase < 0)==(pss->iTerm < 0); + if( pss->iTerm < pss->iBase ){ + sqlite3_uint64 nuspan = 0; + if( bSameSigns ){ + nuspan = (sqlite3_uint64)(pss->iBase - pss->iTerm); + }else{ + /* Under UBSAN (or on 1's complement machines), must do this in steps. + * In this clause, iBase>=0 and iTerm<0 . */ + nuspan = 1; + nuspan += pss->iBase; + nuspan += -(pss->iTerm+1); + } + if( pss->iStep<0 ){ + pss->isNotEOF = 1; + if( nuspan==ULONG_MAX ){ + pss->uSeqIndexMax = ( pss->iStep>LLONG_MIN )? nuspan/-pss->iStep : 1; + }else if( pss->iStep>LLONG_MIN ){ + pss->uSeqIndexMax = nuspan/-pss->iStep; + } + } + }else if( pss->iTerm > pss->iBase ){ + sqlite3_uint64 puspan = 0; + if( bSameSigns ){ + puspan = (sqlite3_uint64)(pss->iTerm - pss->iBase); + }else{ + /* Under UBSAN (or on 1's complement machines), must do this in steps. + * In this clause, iTerm>=0 and iBase<0 . */ + puspan = 1; + puspan += pss->iTerm; + puspan += -(pss->iBase+1); + } + if( pss->iStep>0 ){ + pss->isNotEOF = 1; + pss->uSeqIndexMax = puspan/pss->iStep; + } + }else if( pss->iTerm == pss->iBase ){ + pss->isNotEOF = 1; + pss->uSeqIndexMax = 0; + } + pss->uSeqIndexNow = (pss->isReversing)? pss->uSeqIndexMax : 0; + pss->iValueNow = (pss->isReversing) + ? genSeqMember(pss->iBase, pss->iStep, pss->uSeqIndexMax) + : pss->iBase; +} +/* +** Progress sequence generator to yield next value, if any. +** Leave its state to either yield next value or be at EOF. +** Return whether there is a next value, or 0 at EOF. +*/ +static int progressSequence( SequenceSpec *pss ){ + if( !pss->isNotEOF ) return 0; + if( pss->isReversing ){ + if( pss->uSeqIndexNow > 0 ){ + pss->uSeqIndexNow--; + pss->iValueNow -= pss->iStep; + }else{ + pss->isNotEOF = 0; + } + }else{ + if( pss->uSeqIndexNow < pss->uSeqIndexMax ){ + pss->uSeqIndexNow++; + pss->iValueNow += pss->iStep; + }else{ + pss->isNotEOF = 0; + } + } + return pss->isNotEOF; +} /* series_cursor is a subclass of sqlite3_vtab_cursor which will ** serve as the underlying representation of a cursor that scans @@ -4198,12 +4535,7 @@ SQLITE_EXTENSION_INIT1 typedef struct series_cursor series_cursor; struct series_cursor { sqlite3_vtab_cursor base; /* Base class - must be first */ - int isDesc; /* True to count down rather than up */ - sqlite3_int64 iRowid; /* The rowid */ - sqlite3_int64 iValue; /* Current value ("value") */ - sqlite3_int64 mnValue; /* Mimimum value ("start") */ - sqlite3_int64 mxValue; /* Maximum value ("stop") */ - sqlite3_int64 iStep; /* Increment ("step") */ + SequenceSpec ss; /* (this) Derived class data */ }; /* @@ -4285,12 +4617,7 @@ static int seriesClose(sqlite3_vtab_cursor *cur){ */ static int seriesNext(sqlite3_vtab_cursor *cur){ series_cursor *pCur = (series_cursor*)cur; - if( pCur->isDesc ){ - pCur->iValue -= pCur->iStep; - }else{ - pCur->iValue += pCur->iStep; - } - pCur->iRowid++; + progressSequence( & pCur->ss ); return SQLITE_OK; } @@ -4306,23 +4633,23 @@ static int seriesColumn( series_cursor *pCur = (series_cursor*)cur; sqlite3_int64 x = 0; switch( i ){ - case SERIES_COLUMN_START: x = pCur->mnValue; break; - case SERIES_COLUMN_STOP: x = pCur->mxValue; break; - case SERIES_COLUMN_STEP: x = pCur->iStep; break; - default: x = pCur->iValue; break; + case SERIES_COLUMN_START: x = pCur->ss.iBase; break; + case SERIES_COLUMN_STOP: x = pCur->ss.iTerm; break; + case SERIES_COLUMN_STEP: x = pCur->ss.iStep; break; + default: x = pCur->ss.iValueNow; break; } sqlite3_result_int64(ctx, x); return SQLITE_OK; } /* -** Return the rowid for the current row. In this implementation, the -** first row returned is assigned rowid value 1, and each subsequent -** row a value 1 more than that of the previous. +** Return the rowid for the current row, logically equivalent to n+1 where +** "n" is the ascending integer in the aforesaid production definition. */ static int seriesRowid(sqlite3_vtab_cursor *cur, sqlite_int64 *pRowid){ series_cursor *pCur = (series_cursor*)cur; - *pRowid = pCur->iRowid; + sqlite3_uint64 n = pCur->ss.uSeqIndexNow; + *pRowid = (sqlite3_int64)((n<0xffffffffffffffff)? n+1 : 0); return SQLITE_OK; } @@ -4332,14 +4659,10 @@ static int seriesRowid(sqlite3_vtab_cursor *cur, sqlite_int64 *pRowid){ */ static int seriesEof(sqlite3_vtab_cursor *cur){ series_cursor *pCur = (series_cursor*)cur; - if( pCur->isDesc ){ - return pCur->iValue < pCur->mnValue; - }else{ - return pCur->iValue > pCur->mxValue; - } + return !pCur->ss.isNotEOF; } -/* True to cause run-time checking of the start=, stop=, and/or step= +/* True to cause run-time checking of the start=, stop=, and/or step= ** parameters. The only reason to do this is for testing the ** constraint checking logic for virtual tables in the SQLite core. */ @@ -4350,7 +4673,7 @@ static int seriesEof(sqlite3_vtab_cursor *cur){ /* ** This method is called to "rewind" the series_cursor object back ** to the first row of output. This method is always called at least -** once prior to any call to seriesColumn() or seriesRowid() or +** once prior to any call to seriesColumn() or seriesRowid() or ** seriesEof(). ** ** The query plan selected by seriesBestIndex is passed in the idxNum @@ -4370,7 +4693,7 @@ static int seriesEof(sqlite3_vtab_cursor *cur){ ** (so that seriesEof() will return true) if the table is empty. */ static int seriesFilter( - sqlite3_vtab_cursor *pVtabCursor, + sqlite3_vtab_cursor *pVtabCursor, int idxNum, const char *idxStrUnused, int argc, sqlite3_value **argv ){ @@ -4378,46 +4701,41 @@ static int seriesFilter( int i = 0; (void)idxStrUnused; if( idxNum & 1 ){ - pCur->mnValue = sqlite3_value_int64(argv[i++]); + pCur->ss.iBase = sqlite3_value_int64(argv[i++]); }else{ - pCur->mnValue = 0; + pCur->ss.iBase = 0; } if( idxNum & 2 ){ - pCur->mxValue = sqlite3_value_int64(argv[i++]); + pCur->ss.iTerm = sqlite3_value_int64(argv[i++]); }else{ - pCur->mxValue = 0xffffffff; + pCur->ss.iTerm = 0xffffffff; } if( idxNum & 4 ){ - pCur->iStep = sqlite3_value_int64(argv[i++]); - if( pCur->iStep==0 ){ - pCur->iStep = 1; - }else if( pCur->iStep<0 ){ - pCur->iStep = -pCur->iStep; + pCur->ss.iStep = sqlite3_value_int64(argv[i++]); + if( pCur->ss.iStep==0 ){ + pCur->ss.iStep = 1; + }else if( pCur->ss.iStep<0 ){ if( (idxNum & 16)==0 ) idxNum |= 8; } }else{ - pCur->iStep = 1; + pCur->ss.iStep = 1; } for(i=0; imnValue = 1; - pCur->mxValue = 0; + pCur->ss.iBase = 1; + pCur->ss.iTerm = 0; + pCur->ss.iStep = 1; break; } } if( idxNum & 8 ){ - pCur->isDesc = 1; - pCur->iValue = pCur->mxValue; - if( pCur->iStep>0 ){ - pCur->iValue -= (pCur->mxValue - pCur->mnValue)%pCur->iStep; - } + pCur->ss.isReversing = pCur->ss.iStep > 0; }else{ - pCur->isDesc = 0; - pCur->iValue = pCur->mnValue; + pCur->ss.isReversing = pCur->ss.iStep < 0; } - pCur->iRowid = 1; + setupSequence( &pCur->ss ); return SQLITE_OK; } @@ -5172,7 +5490,7 @@ static const char *re_subcompile_string(ReCompiled *p){ break; } case '[': { - int iFirst = p->nState; + unsigned int iFirst = p->nState; if( rePeek(p)=='^' ){ re_append(p, RE_OP_CC_EXC, 0); p->sIn.i++; @@ -5196,7 +5514,7 @@ static const char *re_subcompile_string(ReCompiled *p){ if( rePeek(p)==']' ){ p->sIn.i++; break; } } if( c==0 ) return "unclosed '['"; - p->aArg[iFirst] = p->nState - iFirst; + if( p->nState>iFirst ) p->aArg[iFirst] = p->nState - iFirst; break; } case '\\': { @@ -8773,7 +9091,10 @@ static int zipfileColumn( ** it to be a directory either if the mode suggests so, or if ** the final character in the name is '/'. */ u32 mode = pCDS->iExternalAttr >> 16; - if( !(mode & S_IFDIR) && pCDS->zFile[pCDS->nFile-1]!='/' ){ + if( !(mode & S_IFDIR) + && pCDS->nFile>=1 + && pCDS->zFile[pCDS->nFile-1]!='/' + ){ sqlite3_result_blob(ctx, "", 0, SQLITE_STATIC); } } @@ -9210,9 +9531,19 @@ static u32 zipfileGetTime(sqlite3_value *pVal){ */ static void zipfileRemoveEntryFromList(ZipfileTab *pTab, ZipfileEntry *pOld){ if( pOld ){ - ZipfileEntry **pp; - for(pp=&pTab->pFirstEntry; (*pp)!=pOld; pp=&((*pp)->pNext)); - *pp = (*pp)->pNext; + if( pTab->pFirstEntry==pOld ){ + pTab->pFirstEntry = pOld->pNext; + if( pTab->pLastEntry==pOld ) pTab->pLastEntry = 0; + }else{ + ZipfileEntry *p; + for(p=pTab->pFirstEntry; p; p=p->pNext){ + if( p->pNext==pOld ){ + p->pNext = pOld->pNext; + if( pTab->pLastEntry==pOld ) pTab->pLastEntry = p; + break; + } + } + } zipfileEntryFree(pOld); } } @@ -12678,6 +13009,7 @@ static int dbdataConnect( (void)argc; (void)argv; (void)pzErr; + sqlite3_vtab_config(db, SQLITE_VTAB_USES_ALL_SCHEMAS); if( rc==SQLITE_OK ){ pTab = (DbdataTable*)sqlite3_malloc64(sizeof(DbdataTable)); if( pTab==0 ){ @@ -13323,8 +13655,6 @@ static int dbdataFilter( } if( rc==SQLITE_OK ){ rc = sqlite3_bind_text(pCsr->pStmt, 1, zSchema, -1, SQLITE_TRANSIENT); - }else{ - pTab->base.zErrMsg = sqlite3_mprintf("%s", sqlite3_errmsg(pTab->db)); } /* Try to determine the encoding of the db by inspecting the header @@ -13333,6 +13663,10 @@ static int dbdataFilter( rc = dbdataGetEncoding(pCsr); } + if( rc!=SQLITE_OK ){ + pTab->base.zErrMsg = sqlite3_mprintf("%s", sqlite3_errmsg(pTab->db)); + } + if( rc==SQLITE_OK ){ rc = dbdataNext(pCursor); } @@ -14571,7 +14905,7 @@ static void recoverAddTable( int iField = sqlite3_column_int(pStmt, 0); int iCol = sqlite3_column_int(pStmt, 1); - assert( iFieldnCol && iColnCol ); + assert( iColnCol ); pNew->aCol[iCol].iField = iField; pNew->bIntkey = 0; @@ -16335,7 +16669,7 @@ int sqlite3_recover_finish(sqlite3_recover *p){ #endif /* ifndef SQLITE_OMIT_VIRTUALTABLE */ /************************* End ../ext/recover/sqlite3recover.c ********************/ -# endif +# endif /* SQLITE_HAVE_SQLITE3R */ #endif #ifdef SQLITE_SHELL_EXTSRC # include SHELL_STRINGIFY(SQLITE_SHELL_EXTSRC) @@ -16517,6 +16851,7 @@ static ShellState shellState; #define SHFLG_HeaderSet 0x00000080 /* showHeader has been specified */ #define SHFLG_DumpDataOnly 0x00000100 /* .dump show data only */ #define SHFLG_DumpNoSys 0x00000200 /* .dump omits system tables */ +#define SHFLG_TestingMode 0x00000400 /* allow unsafe testing features */ /* ** Macros for testing and setting shellFlgs @@ -16760,6 +17095,7 @@ static void editFunc( }else{ /* If the file did not originally contain \r\n then convert any new ** \r\n back into \n */ + p[sz] = 0; for(i=j=0; i To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 64d0e990f766 - stable/13 - setkey(8): remove redundand returns List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 64d0e990f766a169751ed7771f4cf6303fe01d49 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=64d0e990f766a169751ed7771f4cf6303fe01d49 commit 64d0e990f766a169751ed7771f4cf6303fe01d49 Author: Konstantin Belousov AuthorDate: 2023-04-03 01:59:07 +0000 Commit: Konstantin Belousov CommitDate: 2023-06-05 08:35:00 +0000 setkey(8): remove redundand returns (cherry picked from commit 462c3d3cf45eca034683d9793b9ce09381346744) --- sbin/setkey/parse.y | 4 ---- 1 file changed, 4 deletions(-) diff --git a/sbin/setkey/parse.y b/sbin/setkey/parse.y index ae0859c22d2c..0d8605c3409a 100644 --- a/sbin/setkey/parse.y +++ b/sbin/setkey/parse.y @@ -1306,14 +1306,10 @@ parse_init() p_aiflags = 0; p_aifamily = PF_UNSPEC; - - return; } void free_buffer() { /* we got tons of memory leaks in the parser anyways, leave them */ - - return; } From nobody Mon Jun 5 08:35:57 2023 X-Original-To: dev-commits-src-branches@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 4QZRlK5l88z4bLyM; Mon, 5 Jun 2023 08:35:57 +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 4QZRlK3SLhz3wlK; Mon, 5 Jun 2023 08:35:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685954157; 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=voGp3eFqDNHdjMF6REm/acFfNQGHkgwI85PJsKZn01U=; b=GC7jk3gSECclLk8rfFgN4QDaYY63/irnvnMBLoWDzkWWGC1dnSE/wP15kO/UWTGyNuJkQn mAUgzEOaqzXMDn9Mfy1T5Dq3eCzP01v3GbAzEIpoTtKvdERpS3gwEel8E/C9MiMFvze3mc TQJq9AqD3xKXPonJTZJ4nRaRbR7EplDPI+QAbdYw7Wl+U1bVvfx94CgKQ88AopQ2hB1/IX Q9iDzmdo5fHKisJS/Jv54EKoVPUpoMsvWRZpjnzBo1UFiPfbtTRclIYwlM0bU9gGAaG/7m Oa1D253SYmE6BTzWZayaHHQwIp8uXlU1/K8fp7FWhPGgZ4GrvUFypEbyWdwGtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685954157; 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=voGp3eFqDNHdjMF6REm/acFfNQGHkgwI85PJsKZn01U=; b=S237YuaC8a8eVzsoxwWTwQsqyyxa1/18uVHCjeodhlhrLciECaebGJgWuwE0fh7YXk388z wkZiIJ+5kaHERquCYMS0O/HAWMGc0X407mSb/a4fcrunhiaSvH0oFclsNDYf77Nns2t5Qa YqCjYwGmBgA1VapYsb2/taariPhir8a2MNXbKw8n4KmH2d3DjptgqVqRm2Vw2tPKajjNMU ypbjGtCnk8Sk3KsPPtsHkOB/UjrYTgKtMLrJKQhU2N4Ycf3O6uOD5RFP9bp5s4xlQ1baNj Ne6GyykDm/OpOsFFrf3hSuH6RHgGVGJ/eCuSVyIQTAN3ZddL7aW5O+inksz2Og== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685954157; a=rsa-sha256; cv=none; b=K44iORFGh17XFPisG6N1FOi3W5XZqdrYS79PHm0zvqbOj3/nYGbQ5PRBFg2TAW3zDkRWWi w3G3SQk7CU/WKtiFWjAIYiiVbQwKVG047olKsHoBvixa7mSAhbOHLurCbKf75t1MQkj/P/ kl9X6/ZC8bhYPuAiVH/UP+XzT2szndZT1wEM5eho9dTlUr+X44KQn0b77CCNL0rCro445T 5wTlofd1lvEJC+Tim0n+f+QdAuaNKmAtSNoheFbyOj1965J9OvHMO3o+sXrSDlPJ5jEUT/ gKuzMqJ9jRCQIDh/MDNM/GQ3R2lI3Xqp8FwIT7jPC+nXlBJyMYDX1nA9zs5B3w== 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 4QZRlK26FyzgVD; Mon, 5 Jun 2023 08:35:57 +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 3558Zv6P024268; Mon, 5 Jun 2023 08:35:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3558ZvnQ024267; Mon, 5 Jun 2023 08:35:57 GMT (envelope-from git) Date: Mon, 5 Jun 2023 08:35:57 GMT Message-Id: <202306050835.3558ZvnQ024267@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 0957619bf5f0 - stable/13 - setkey(8): ansify parser List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0957619bf5f0933b572a726200dad96ac9ecb96e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=0957619bf5f0933b572a726200dad96ac9ecb96e commit 0957619bf5f0933b572a726200dad96ac9ecb96e Author: Konstantin Belousov AuthorDate: 2023-04-03 02:00:25 +0000 Commit: Konstantin Belousov CommitDate: 2023-06-05 08:35:00 +0000 setkey(8): ansify parser (cherry picked from commit bef81bc0aef9dd4cd772b292d81bcc0ff7151d9f) --- sbin/setkey/parse.y | 51 +++++++++++++-------------------------------------- sbin/setkey/token.l | 9 +++------ 2 files changed, 16 insertions(+), 44 deletions(-) diff --git a/sbin/setkey/parse.y b/sbin/setkey/parse.y index 0d8605c3409a..3d3ed123d4f0 100644 --- a/sbin/setkey/parse.y +++ b/sbin/setkey/parse.y @@ -773,11 +773,7 @@ policy_requests %% int -setkeymsg0(msg, type, satype, l) - struct sadb_msg *msg; - unsigned int type; - unsigned int satype; - size_t l; +setkeymsg0(struct sadb_msg *msg, unsigned type, unsigned satype, size_t l) { msg->sadb_msg_version = PF_KEY_V2; @@ -793,14 +789,8 @@ setkeymsg0(msg, type, satype, l) /* XXX NO BUFFER OVERRUN CHECK! BAD BAD! */ static int -setkeymsg_spdaddr(type, upper, policy, srcs, splen, dsts, dplen) - unsigned int type; - unsigned int upper; - vchar_t *policy; - struct addrinfo *srcs; - int splen; - struct addrinfo *dsts; - int dplen; +setkeymsg_spdaddr(unsigned type, unsigned upper, vchar_t *policy, + struct addrinfo *srcs, int splen, struct addrinfo *dsts, int dplen) { struct sadb_msg *msg; char buf[BUFSIZ]; @@ -892,12 +882,8 @@ setkeymsg_spdaddr(type, upper, policy, srcs, splen, dsts, dplen) /* XXX NO BUFFER OVERRUN CHECK! BAD BAD! */ static int -setkeymsg_addr(type, satype, srcs, dsts, no_spi) - unsigned int type; - unsigned int satype; - struct addrinfo *srcs; - struct addrinfo *dsts; - int no_spi; +setkeymsg_addr(unsigned type, unsigned satype, struct addrinfo *srcs, + struct addrinfo *dsts, int no_spi) { struct sadb_msg *msg; char buf[BUFSIZ]; @@ -1023,11 +1009,8 @@ setkeymsg_addr(type, satype, srcs, dsts, no_spi) /* XXX NO BUFFER OVERRUN CHECK! BAD BAD! */ static int -setkeymsg_add(type, satype, srcs, dsts) - unsigned int type; - unsigned int satype; - struct addrinfo *srcs; - struct addrinfo *dsts; +setkeymsg_add(unsigned type, unsigned satype, struct addrinfo *srcs, + struct addrinfo *dsts) { struct sadb_msg *msg; char buf[BUFSIZ]; @@ -1211,9 +1194,7 @@ setkeymsg_add(type, satype, srcs, dsts) } static struct addrinfo * -parse_addr(host, port) - char *host; - char *port; +parse_addr(char *host, char *port) { struct addrinfo hints, *res = NULL; int error; @@ -1232,8 +1213,7 @@ parse_addr(host, port) } static int -fix_portstr(spec, sport, dport) - vchar_t *spec, *sport, *dport; +fix_portstr(vchar_t *spec, vchar_t *sport, vchar_t *dport) { char *p, *p2; u_int l; @@ -1273,13 +1253,8 @@ fix_portstr(spec, sport, dport) } static int -setvarbuf(buf, off, ebuf, elen, vbuf, vlen) - char *buf; - int *off; - struct sadb_ext *ebuf; - int elen; - caddr_t vbuf; - int vlen; +setvarbuf(char *buf, int *off, struct sadb_ext *ebuf, int elen, caddr_t vbuf, + int vlen) { memset(buf + *off, 0, PFKEY_UNUNIT64(ebuf->sadb_ext_len)); memcpy(buf + *off, (caddr_t)ebuf, elen); @@ -1290,7 +1265,7 @@ setvarbuf(buf, off, ebuf, elen, vbuf, vlen) } void -parse_init() +parse_init(void) { p_spi = 0; @@ -1309,7 +1284,7 @@ parse_init() } void -free_buffer() +free_buffer(void) { /* we got tons of memory leaks in the parser anyways, leave them */ } diff --git a/sbin/setkey/token.l b/sbin/setkey/token.l index 9a0cc9ea1915..180493d76b05 100644 --- a/sbin/setkey/token.l +++ b/sbin/setkey/token.l @@ -251,23 +251,20 @@ any { return(ANY); } %% void -yyfatal(s) - const char *s; +yyfatal(const char *s) { yyerror(s); exit(1); } void -yyerror(s) - const char *s; +yyerror(const char *s) { printf("line %d: %s at [%s]\n", lineno, s, yytext); } int -parse(fp) - FILE **fp; +parse(FILE **fp) { yyin = *fp; From nobody Mon Jun 5 08:35:58 2023 X-Original-To: dev-commits-src-branches@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 4QZRlL4rMMz4bM7r; Mon, 5 Jun 2023 08:35:58 +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 4QZRlL4L6Mz3wVY; Mon, 5 Jun 2023 08:35:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685954158; 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=pOIM6U+bFDvrTLQCUk5v/m4GtvpS6NLcJOhIJMOKtlU=; b=r0PBBAIO7cIZOPCUT1tdyEc7dJejjr/x2TMbOYQNHFXWPFM2dEYUE5Sj7KhzBCAVOGDfTb quTi7leC5y3tyaZM3xztuEXIvq5FOnSA7m2HJ0u5OgyAG2Bos7umsouNyEDK4eJD0pLTu/ OC0ywndaPK+caHXY1B99KxgMyAaLlys5mu6NHm0AS5hIi6npWwQcnr8A71bz4+qER+HDtE cFWbs+qaQ2g/DEgfaAVjYME3TLC7zsj1qhMhRTrA5oTXan+r7+1ZLVvJOxQFSMh4FsOgb8 8QlEGRVfXewrLdVjfXAsQy+rQu20cbcTVLDGxccEaW5zHhJ/UMV5xZuFkoSysg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685954158; 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=pOIM6U+bFDvrTLQCUk5v/m4GtvpS6NLcJOhIJMOKtlU=; b=HVTdvNA05qG1sT325vmzcxJ/bxcFLeGfx+RHFrOUK3L4aSVsP6O14Ja/J5+A0F10XgUdLj fwWyEIUjoiDZabw5+w6VS0b+JCQRim25rq0Xna0a6oAyuSovlcQqraZWOSAyM9r/Ubg8bl bkUxfwFLukpqe+zoPCZqEYBTXYevMywsqQHO5VmyIPxBQCrCOjO+AH8zVv/z3xWHMmN/71 XMrxXXo7qiqNwnDJ0JfUKFtWM0wxdkpV6I9OoG+Qhmra9z8EYHNOYxbsZbq96v4fGRvUyl bHrg9YyKIIhWiwtunNLXbqZYQk378WAyXjynq8k9brki6Mfx35w8cu5R7+kE3A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685954158; a=rsa-sha256; cv=none; b=Y8x9g3yvBQCtG6SMiaqYTR2/ERZE2c7CczkvNACi08cEVPd1wezX4DMam3wq/hVOKnaX0c RRJsP9bY/Vx82yZiU5i3XqUI607cswJCZLwne3eNsAzPScul/0/YTzGJ4Cx8XdQqOMx0sQ 3MXoaZ0csx3PUPjeHuzRyMoVelG9iiO785yi7bL0NUb3yzoGpnZi78WfI3XhO4vdMgUFYs mTsH+tNQwwvPZiszNjbQ+IZzQ4JWyDzOXmxiE5BOivbFaB+Cck17eHvTxf1qGpHnKm/i6g 0zJZQHjkvrh2gTpiBsNIo/U70xZaHCCPBx+FaZEb5iLWWOPxydw+gsC6pskjvw== 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 4QZRlL3GWLzh0v; Mon, 5 Jun 2023 08:35:58 +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 3558ZwnR024287; Mon, 5 Jun 2023 08:35:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3558Zw1m024286; Mon, 5 Jun 2023 08:35:58 GMT (envelope-from git) Date: Mon, 5 Jun 2023 08:35:58 GMT Message-Id: <202306050835.3558Zw1m024286@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 256d03bc580e - stable/13 - setkey(8): extract prefixlen calculation info helper List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 256d03bc580e9ad5f34b1c17ce356b65799473c0 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=256d03bc580e9ad5f34b1c17ce356b65799473c0 commit 256d03bc580e9ad5f34b1c17ce356b65799473c0 Author: Konstantin Belousov AuthorDate: 2023-05-25 12:20:00 +0000 Commit: Konstantin Belousov CommitDate: 2023-06-05 08:35:00 +0000 setkey(8): extract prefixlen calculation info helper (cherry picked from commit 2c1296a3c5473651aa87eefea25e7b7475e9e16c) --- sbin/setkey/parse.y | 56 ++++++++++++++++++++++------------------------------- 1 file changed, 23 insertions(+), 33 deletions(-) diff --git a/sbin/setkey/parse.y b/sbin/setkey/parse.y index 3d3ed123d4f0..d279546fada6 100644 --- a/sbin/setkey/parse.y +++ b/sbin/setkey/parse.y @@ -787,6 +787,23 @@ setkeymsg0(struct sadb_msg *msg, unsigned type, unsigned satype, size_t l) return 0; } +static int +setkeymsg_plen(struct addrinfo *s) +{ + switch (s->ai_addr->sa_family) { +#ifdef INET + case AF_INET: + return (sizeof(struct in_addr) << 3); +#endif +#ifdef INET6 + case AF_INET6: + return (sizeof(struct in6_addr) << 3); +#endif + default: + return (-1); + } +} + /* XXX NO BUFFER OVERRUN CHECK! BAD BAD! */ static int setkeymsg_spdaddr(unsigned type, unsigned upper, vchar_t *policy, @@ -825,18 +842,9 @@ setkeymsg_spdaddr(unsigned type, unsigned upper, vchar_t *policy, if (s->ai_addr->sa_family != d->ai_addr->sa_family) continue; - switch (s->ai_addr->sa_family) { - case AF_INET: - plen = sizeof(struct in_addr) << 3; - break; -#ifdef INET6 - case AF_INET6: - plen = sizeof(struct in6_addr) << 3; - break; -#endif - default: + plen = setkeymsg_plen(s); + if (plen == -1) continue; - } /* set src */ sa = s->ai_addr; @@ -954,18 +962,9 @@ setkeymsg_addr(unsigned type, unsigned satype, struct addrinfo *srcs, if (s->ai_addr->sa_family != d->ai_addr->sa_family) continue; - switch (s->ai_addr->sa_family) { - case AF_INET: - plen = sizeof(struct in_addr) << 3; - break; -#ifdef INET6 - case AF_INET6: - plen = sizeof(struct in6_addr) << 3; - break; -#endif - default: + plen = setkeymsg_plen(s); + if (plen == -1) continue; - } /* set src */ sa = s->ai_addr; @@ -1140,18 +1139,9 @@ setkeymsg_add(unsigned type, unsigned satype, struct addrinfo *srcs, if (s->ai_addr->sa_family != d->ai_addr->sa_family) continue; - switch (s->ai_addr->sa_family) { - case AF_INET: - plen = sizeof(struct in_addr) << 3; - break; -#ifdef INET6 - case AF_INET6: - plen = sizeof(struct in6_addr) << 3; - break; -#endif - default: + plen = setkeymsg_plen(s); + if (plen == -1) continue; - } /* set src */ sa = s->ai_addr; From nobody Mon Jun 5 08:35:59 2023 X-Original-To: dev-commits-src-branches@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 4QZRlM6TVdz4bLyP; Mon, 5 Jun 2023 08:35:59 +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 4QZRlM5l4Yz3wrV; Mon, 5 Jun 2023 08:35:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685954159; 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=6Xw0DZ+kh/xlgMplJ8R4kER0gwMD/JjeuqHXuVvWDqo=; b=vxNdGKBBvt0ECGw7eyNLcxFWath2bLQpFErvYXWKiaegTjAcx2g4jswHDl305YsJWUknjf yWXIbUCg3e1Z/edbYtLs4fI2ZFHOa2W74N7MYAYT2jR4YGCQAL5C2+tbnEktS28hbUpeN0 jsKyiaoY0XdeWuEDfnjZK0SM/dTu6UpPkU7xo6l9kf2rfXNl4FF4NtY/pO+qoDC92Htzcn CWqwGS91B2WzArZa++YTxkvCFQLf50PjD0kMRNnhTwKxniBaXAHHdopZLVU8PxSzlkcEKa QaOF4wYQH2koSOTFnXLHTsAjkZIoFHR+B6AaZOxa9D8xkC5YMWHiOj8/bfIXsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685954159; 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=6Xw0DZ+kh/xlgMplJ8R4kER0gwMD/JjeuqHXuVvWDqo=; b=vCKWfuxTP7/P8hcKX8AuJ8//s0tI6pYoTOnTsssY5JIGDGd5JcD+ciuw35yuK7W7pj5FJm JFgMtOm6CzDLg1DQCghKJogIIZlcoGqXJvadhT2UWuTD4nAz94JUFtw7Unoy0DvAkVryBj fJSLyv8DbuIy+NiIidhFco5fm7VeRExuWClwH1ND01sCLOFmfAG2K1sc//ACzt2lhTaWST Wa7dIziPKoGHG8LBVt4i20tS0AbBkhesBVFDrJ8HTJNJ1MMyFXw6gzvXQI3AosqCOOV0az 4JGRHWuDhsF7YF93JHeyCsdCxkskz/clE3tE4e7eZHxr0KRaMydXZmQ2PLbpyw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685954159; a=rsa-sha256; cv=none; b=KvorQ20l2of9NkYIS1jbGKhR54fqoY7NzH6hmzwMxk8GVI2cTmggcHD80q6dBSczROSkr5 yrSoxQkdDb6NQQYzU2Kc4p84ZtHPI6mWO+pM+n4tNSUpskgPQQM1RL1zyxnVbZgmZc0DNp wnrp6SSvISUNQ5k7kYPg6Bb1PA8G5Qilmhjk+sT7jBRYQujWhkvibJXUjVRRcNsU+R/s8C 9MzhcOaHpyGYKlIOVzQRu4crb3KzqClrD8jZFjt48jBMeNhYV0ALnlqMi5JlMatmrD2nOb s6Yrof4BXx4J/Bo/piP2vi6x4PIBQGZG+Vk7/4EJIFzgIYxKhI77MurpcTqyWg== 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 4QZRlM4BCGzgMN; Mon, 5 Jun 2023 08:35:59 +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 3558Zx6d024306; Mon, 5 Jun 2023 08:35:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3558Zxls024305; Mon, 5 Jun 2023 08:35:59 GMT (envelope-from git) Date: Mon, 5 Jun 2023 08:35:59 GMT Message-Id: <202306050835.3558Zxls024305@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 447af6361cec - stable/13 - setkey(8): NAT-T manual configuration support List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 447af6361cec48b2d6e5955e7b2284620cb50ece Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=447af6361cec48b2d6e5955e7b2284620cb50ece commit 447af6361cec48b2d6e5955e7b2284620cb50ece Author: Konstantin Belousov AuthorDate: 2023-05-25 10:41:15 +0000 Commit: Konstantin Belousov CommitDate: 2023-06-05 08:35:00 +0000 setkey(8): NAT-T manual configuration support (cherry picked from commit 2fa1b8617fdf68d0043efb7ae7c524702afba27c) --- sbin/setkey/parse.y | 87 ++++++++++++++++++++++++++++++++++++++++++++++++++++- sbin/setkey/token.l | 2 ++ 2 files changed, 88 insertions(+), 1 deletion(-) diff --git a/sbin/setkey/parse.y b/sbin/setkey/parse.y index d279546fada6..8e4866e7e848 100644 --- a/sbin/setkey/parse.y +++ b/sbin/setkey/parse.y @@ -43,6 +43,7 @@ #include #include #include +#include #include #include @@ -64,6 +65,10 @@ u_int32_t p_reqid; u_int p_key_enc_len, p_key_auth_len; caddr_t p_key_enc, p_key_auth; time_t p_lt_hard, p_lt_soft; +u_int p_natt_type; +struct addrinfo *p_natt_oai, *p_natt_oar; +int p_natt_sport, p_natt_dport; +int p_natt_fraglen; static int p_aiflags = 0, p_aifamily = PF_UNSPEC; @@ -110,7 +115,7 @@ extern void yyerror(const char *); /* SPD management */ %token SPDADD SPDDELETE SPDDUMP SPDFLUSH %token F_POLICY PL_REQUESTS -%token F_AIFLAGS +%token F_AIFLAGS F_NATT F_NATT_MTU %token TAGGED %type prefix protocol_spec upper_spec @@ -521,6 +526,20 @@ extension } | F_LIFETIME_HARD DECSTRING { p_lt_hard = $2; } | F_LIFETIME_SOFT DECSTRING { p_lt_soft = $2; } + | F_NATT ipaddr BLCL DECSTRING ELCL ipaddr BLCL DECSTRING ELCL + { + p_natt_type = UDP_ENCAP_ESPINUDP; + p_natt_oai = $2; + p_natt_oar = $6; + if (p_natt_oai == NULL || p_natt_oar == NULL) + return (-1); + p_natt_sport = $4; + p_natt_dport = $8; + } + | F_NATT_MTU DECSTRING + { + p_natt_fraglen = $2; + } ; /* definition about command for SPD management */ @@ -1019,6 +1038,9 @@ setkeymsg_add(unsigned type, unsigned satype, struct addrinfo *srcs, struct sadb_address m_addr; struct sadb_x_sa_replay m_replay; struct addrinfo *s, *d; + struct sadb_x_nat_t_type m_natt_type; + struct sadb_x_nat_t_port m_natt_port; + struct sadb_x_nat_t_frag m_natt_frag; int n; int plen; struct sockaddr *sa; @@ -1128,6 +1150,64 @@ setkeymsg_add(unsigned type, unsigned satype, struct addrinfo *srcs, memcpy(buf + l, &m_replay, len); l += len; } + + if (p_natt_type != 0) { + len = sizeof(m_natt_type); + memset(&m_natt_type, 0, sizeof(m_natt_type)); + m_natt_type.sadb_x_nat_t_type_len = PFKEY_UNIT64(len); + m_natt_type.sadb_x_nat_t_type_exttype = SADB_X_EXT_NAT_T_TYPE; + m_natt_type.sadb_x_nat_t_type_type = p_natt_type; + memcpy(buf + l, &m_natt_type, len); + l += len; + + memset(&m_addr, 0, sizeof(m_addr)); + m_addr.sadb_address_exttype = SADB_X_EXT_NAT_T_OAI; + sa = p_natt_oai->ai_addr; + salen = p_natt_oai->ai_addr->sa_len; + m_addr.sadb_address_len = PFKEY_UNIT64(sizeof(m_addr) + + PFKEY_ALIGN8(salen)); + m_addr.sadb_address_prefixlen = setkeymsg_plen(p_natt_oai); + setvarbuf(buf, &l, (struct sadb_ext *)&m_addr, + sizeof(m_addr), (caddr_t)sa, salen); + + len = sizeof(m_natt_port); + memset(&m_natt_port, 0, sizeof(m_natt_port)); + m_natt_port.sadb_x_nat_t_port_len = PFKEY_UNIT64(len); + m_natt_port.sadb_x_nat_t_port_exttype = SADB_X_EXT_NAT_T_SPORT; + m_natt_port.sadb_x_nat_t_port_port = htons(p_natt_sport); + memcpy(buf + l, &m_natt_port, len); + l += len; + + memset(&m_addr, 0, sizeof(m_addr)); + m_addr.sadb_address_exttype = SADB_X_EXT_NAT_T_OAR; + sa = p_natt_oar->ai_addr; + salen = p_natt_oar->ai_addr->sa_len; + m_addr.sadb_address_len = PFKEY_UNIT64(sizeof(m_addr) + + PFKEY_ALIGN8(salen)); + m_addr.sadb_address_prefixlen = setkeymsg_plen(p_natt_oar); + setvarbuf(buf, &l, (struct sadb_ext *)&m_addr, + sizeof(m_addr), (caddr_t)sa, salen); + + len = sizeof(m_natt_port); + memset(&m_natt_port, 0, sizeof(m_natt_port)); + m_natt_port.sadb_x_nat_t_port_len = PFKEY_UNIT64(len); + m_natt_port.sadb_x_nat_t_port_exttype = SADB_X_EXT_NAT_T_DPORT; + m_natt_port.sadb_x_nat_t_port_port = htons(p_natt_dport); + memcpy(buf + l, &m_natt_port, len); + l += len; + + if (p_natt_fraglen != -1) { + len = sizeof(m_natt_frag); + memset(&m_natt_port, 0, sizeof(m_natt_frag)); + m_natt_frag.sadb_x_nat_t_frag_len = PFKEY_UNIT64(len); + m_natt_frag.sadb_x_nat_t_frag_exttype = + SADB_X_EXT_NAT_T_FRAG; + m_natt_frag.sadb_x_nat_t_frag_fraglen = p_natt_fraglen; + memcpy(buf + l, &m_natt_frag, len); + l += len; + } + } + l0 = l; n = 0; @@ -1271,6 +1351,11 @@ parse_init(void) p_aiflags = 0; p_aifamily = PF_UNSPEC; + + p_natt_type = 0; + p_natt_oai = p_natt_oar = NULL; + p_natt_sport = p_natt_dport = 0; + p_natt_fraglen = -1; } void diff --git a/sbin/setkey/token.l b/sbin/setkey/token.l index 180493d76b05..f5ccb4297d33 100644 --- a/sbin/setkey/token.l +++ b/sbin/setkey/token.l @@ -184,6 +184,8 @@ nocyclic-seq { return(NOCYCLICSEQ); } {hyphen}r { return(F_REPLAY); } {hyphen}lh { return(F_LIFETIME_HARD); } {hyphen}ls { return(F_LIFETIME_SOFT); } +{hyphen}natt { return(F_NATT); } +{hyphen}natt_mtu { return(F_NATT_MTU); } /* ... */ any { return(ANY); } From nobody Mon Jun 5 08:36:00 2023 X-Original-To: dev-commits-src-branches@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 4QZRlN65Rbz4bM81; Mon, 5 Jun 2023 08:36:00 +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 4QZRlN5XTXz3wh2; Mon, 5 Jun 2023 08:36:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685954160; 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=llqr0RNcRGvi3BE/6x3LXYXFteHGAlCELH3GqrQgQjQ=; b=HsOyBpn6ucbAKzjMLojXyrUDoiNGu6wOwSSUBceKXCC1dO8s6b12p6LarGTWtmCfz9eLNv NgeON+8n54+hj2GWgZ0Fy7AbL5vbPnN5pRKmNhPT/DjPe4CqS7Swc2UtYrFuQBcW9qE87m ifTQbibw9wwuqEcfPqy1Ps8WeW1gyd5a7pliPCXFMrd2hIYVU3jGY5n4bbLh2tB86X4dZl RX4ixHM8NShgU/G8JsDSrPpMLzkWlFlpJ1BOHW7qK53VsOXbo/lr3BcCG3pzR7GCcjkyfk rcYhIxQqTQl/f8ikHBOFLa2pyDWoiVjUx8Ntao/MiTQuqxKJ83skimA5Yg/cCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685954160; 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=llqr0RNcRGvi3BE/6x3LXYXFteHGAlCELH3GqrQgQjQ=; b=fAg5COfn7RIPvcTrnKmLZR48MvVLfmsh04DQ7XK0tVInIsrkyxK/7oX8KgSOCUFXwDZ7K/ 22alrsOnwOm9cl8HPiMjJ5Y9nQcAUMDhLf+AHAvDWNCsqWWx4a06rivW/Ez6DOmLXEp9Xo zrdjZLTdnxZlwcS5/tEVYiSMQW3Urfhpk5drGjc/zOet59DOoBmOCmn5xjT3EeaK6HLmKA 160SUMR7/JFWNXEPUw6Z0zWGJ3b0ko38pKKtlz5L4qaMWsTQDhAuFx8cNpUElyz6lJVCII g7R5OUnOt8gvaswiNZ1n2h3l3AQ/BpHQJ/mfJT4RAhdjDZy8M/n0p9Fze4FiAg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685954160; a=rsa-sha256; cv=none; b=SRsGIIfjut2tLo1VUEmgdMCo3UzVkCSUtMhXU6/N1u6uNvRakPjfuTu34cxwUq5dfGPWA9 Yof0oYkz/cKWgt4Bn3k1W+uwKh+d0VIHxdUeeNeCCTklrdv3JRFFW8Yq/8GUTxpwZ5qXrl MwfLLdM9SCBW1YmKObyv1rm3dVjA1Zy7SGy5DO7bi3i6NSffqhdG8JfqWOJlNAyuskGgZX G3huKhJgXv8hunvLbDPnbKUo/6LZF1A6iMKqYgzqxyU/f+3nvtzlVGknf427HDB2AyrIZu MMarDMop/V+PXj49RABTns+QrVNxxP7sCobawITY4a3Ii5DUbK0gilartuQjgw== 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 4QZRlN4fDCzh1D; Mon, 5 Jun 2023 08:36:00 +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 3558a09d024335; Mon, 5 Jun 2023 08:36:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3558a0Ph024334; Mon, 5 Jun 2023 08:36:00 GMT (envelope-from git) Date: Mon, 5 Jun 2023 08:36:00 GMT Message-Id: <202306050836.3558a0Ph024334@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: dcaa24cf3057 - stable/13 - setkey(8): document NAT-T and NAT-T MTU extensions syntax List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: dcaa24cf30571be8b80be3f5202e4ec77aa595f2 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=dcaa24cf30571be8b80be3f5202e4ec77aa595f2 commit dcaa24cf30571be8b80be3f5202e4ec77aa595f2 Author: Konstantin Belousov AuthorDate: 2023-05-27 06:00:24 +0000 Commit: Konstantin Belousov CommitDate: 2023-06-05 08:35:00 +0000 setkey(8): document NAT-T and NAT-T MTU extensions syntax (cherry picked from commit cf85818e05a9349dfba040fb32e752d3c691ed1f) --- sbin/setkey/setkey.8 | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/sbin/setkey/setkey.8 b/sbin/setkey/setkey.8 index 20754c1b368f..73c89fdf9ec2 100644 --- a/sbin/setkey/setkey.8 +++ b/sbin/setkey/setkey.8 @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 3, 2023 +.Dd May 27, 2023 .Dt SETKEY 8 .Os .\" @@ -283,7 +283,7 @@ and they cannot be used. .Pp .It Ar extensions take some of the following: -.Bl -tag -width Fl -compact +.Bl -tag -width Fl natt_mtu -compact .\" .It Fl m Ar mode Specify a security protocol mode for use. @@ -328,6 +328,21 @@ Do not allow cyclic sequence number. .It Fl lh Ar time .It Fl ls Ar time Specify hard/soft life time duration of the SA. +.It Fl natt Ar oai \([ Ar sport \(] Ar oar \([ Ar dport \(] +Manually configure NAT-T for the SA, by specifying initiator +.Ar oai +and +requestor +.Ar oar +ip addresses and ports. +Note that the +.Sq \([ +and +.Sq \(] +symbols are part of the syntax for the ports specification, +not indication of the optional components. +.It Fl natt_mtu Ar fragsize +Configure NAT-T fragment size. .El .\" .Pp From nobody Mon Jun 5 08:36:01 2023 X-Original-To: dev-commits-src-branches@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 4QZRlQ1mPsz4bLrx; Mon, 5 Jun 2023 08:36:02 +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 4QZRlP6Gxxz3wxR; Mon, 5 Jun 2023 08:36:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685954161; 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=h6xEUy2zyQvahoSxL0oqnYzW9qysarexVnSd+SQ4K4g=; b=OQqJUOOQYss1EAdlWaokHH8kD+FKnX3SG5VINkhtuOoe7G2AcDc1AgGTTsgJB2R6ZcgBUJ xw9UCodp3VDDFF2VG6WqObfUStVzUH9zAfZGBpHeL9f8Y4JdOI+zqaQjNjCKPdf8UwJ+Vq 3k3nSpkK750iL15LVe5qmHtItNmjG3X2UkqqF1ENgpc2hFgZyygKRYlT/XsVqVUql8PBt7 eEizaQ0W8jttC6x7Z0tUCwTtruLXnT/NoeNTFg6u8FHwabk/rtjpD76porCRlv3zPpEZbl pcXpUgfu5E1J3jfvpzRRt/LKHgKfU6uOjViO0Cr3G4lDxmrOxDeOwzppEMUlHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685954161; 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=h6xEUy2zyQvahoSxL0oqnYzW9qysarexVnSd+SQ4K4g=; b=TT+CZAFbpx09JISYqF7Jo4AJPr+FTMLIzo4Uv/UnkZboLnrVZ+p2JVRFPDYxAmsVKgygjy KfLgj+lObl2jENfixCr1+eTDbpBcyAcWhbXVGlBqDmJZe3usTGWECSDhahBwq7dn8Dvyeu CXpTeaZskJAnzbMfviCDX3mVESjASIJFyErT+DZCUi6fqMG2GiHDAqsM48HZmaatfXayDL NVfVQcmRLY0IoOaDVKi3w309Hneh35R/eFwMgOUMgDrn5C+/2x5e1j580kMjnKPZf4gbqD n2ohEnk1R/2UVKCwDnWTGCFJRMcUNjPVJYvrwY0pPirDupUp12ZM6KUbG/bV6g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685954161; a=rsa-sha256; cv=none; b=Sx/FkuacUuQbK8hBMPgg4MudHgoqAwevDVkHNKSknC79zIyGIDqU1/FaqqaLGS3EXz9/5l t/B52oIQx0tKQmAxcPIJJ1d2m86djQAfQh7MMA06XN+9l3OxkgVYLWBLK045AygBpiTRBa Bvzir+sLn1YykJLuL58mbgTHZaYn9K8ehOh1YA5ivf7Q4YC1aeK5TpzjvJjkYsj6otM3o+ 8gPrK6XEUShnwQI6LhiwZO7kkQ3LRY3cmA2Id+QMVCPuw76Yq5Cp+HtDygkHRC1Kveaa0S UP3Fau9ktzkn4ztM1YQx1vyQMXpmPP0vNp24tUOstJvQQ0vyV07O1LmRvtkwzw== 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 4QZRlP4zXVzgVF; Mon, 5 Jun 2023 08:36:01 +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 3558a1TO024354; Mon, 5 Jun 2023 08:36:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3558a1cK024353; Mon, 5 Jun 2023 08:36:01 GMT (envelope-from git) Date: Mon, 5 Jun 2023 08:36:01 GMT Message-Id: <202306050836.3558a1cK024353@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: be455be5099d - stable/13 - kern/subr_unit.c: some style List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: be455be5099db29e6dae645fc221d331367ae38f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=be455be5099db29e6dae645fc221d331367ae38f commit be455be5099db29e6dae645fc221d331367ae38f Author: Konstantin Belousov AuthorDate: 2023-05-12 22:37:35 +0000 Commit: Konstantin Belousov CommitDate: 2023-06-05 08:35:00 +0000 kern/subr_unit.c: some style (cherry picked from commit 042ec55f9df769697feb6cee472959d001a0f033) --- sys/kern/subr_unit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/kern/subr_unit.c b/sys/kern/subr_unit.c index 8e5eb94711c3..fd9425e95dd5 100644 --- a/sys/kern/subr_unit.c +++ b/sys/kern/subr_unit.c @@ -205,7 +205,7 @@ struct unrb { CTASSERT((sizeof(struct unr) % sizeof(bitstr_t)) == 0); /* Number of bits we can store in the bitmap */ -#define NBITS (8 * sizeof(((struct unrb*)NULL)->map)) +#define NBITS (NBBY * sizeof(((struct unrb *)NULL)->map)) /* Is the unrb empty in at least the first len bits? */ static inline bool @@ -1024,7 +1024,7 @@ test_alloc_unr_specific(struct unrhdr *uh, u_int i, char a[]) } static void -usage(char** argv) +usage(char **argv) { printf("%s [-h] [-r REPETITIONS] [-v]\n", argv[0]); } From nobody Mon Jun 5 08:36:02 2023 X-Original-To: dev-commits-src-branches@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 4QZRlR1fHWz4bLs1; Mon, 5 Jun 2023 08:36:03 +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 4QZRlQ6t4Mz3wqG; Mon, 5 Jun 2023 08:36:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685954163; 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=B6MP1IziZYdmJXzPIWDn6y1T8kuiBk6a86rL3gMNGVk=; b=MUt9x7O0k205K9KxoQgBz5aRzeJCl6tbFk+5dFRG2AyVx0yDMCl6gDDwzWcQTpGbvoSEtF zncNbDx1xej9pPZ+cZZpyHmMbTIov9d8A7rl6y9NtvOW7HLUXtq6kfolADLMa1jBeZ4RdA Wr1PY0VugFAc9S8b4mlI3aBT2y9S1Q+EkBiuHFNXJcUSOgb/gjuFp2+AiF3aBi0bVNYpSM b421uNQRUaUN8PV79YN92dTLhkbug8kN8Up5EPDow+8D5tkG/LhCeTG2/db/4WzSZMWcE5 oOeq3cW4OF+HVHC0k4oD7daA10Z9YaWt9Uxk3c+VVtda5flllR1JkKYr6tE0kw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685954163; 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=B6MP1IziZYdmJXzPIWDn6y1T8kuiBk6a86rL3gMNGVk=; b=LNGGrhtdy1p3W6Moq9UKUqsS5lAb54K4jzq4Qj3b7TDg2izvChAIU57EV6mQZ3fZyUHIDL 1DF+3KU4E6GYfa33OD7HkX8gVVWf1NsOvGvr+sHaeGHYBMgMLW+rpRxYlLkip0z8ibshJO AOr4Jovam2FIvQCKeL0mEjv3DRvQDvSzKmzblGsjKqr+2nLhRoC2i91TdzeDaV0wwufwXi jwqlBid/iOUklgAiXgNzk8wcnsI7/Oicsw1vY7Ptx8sVOCL5M/T+77Lthew5nwJ020r4F/ NF0oCv/+gh6R8XYfdfwwwPuK/ArCk2vqLj5Q5K0YIHm9e20i8h3Ubv31nHGibQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685954163; a=rsa-sha256; cv=none; b=EFGzvCV+EKmwZbrfXL1NGFsurqYwTM4nc+GIzFytfUCLGVIJ+7Rg0MfMgpAQ0P0o+iMWMH 5U4XvAOKSiSQDll+gfMb05RYYmpQw2N2ylJ7vlkIEoBZVsQ8Duun0AAjs0sFd5nQyqmc42 FWGFkJitV7yQYXMdBkRnC9t22eM/NTTZWitH0TUDBDaDdBDs4Vf/EyvtLbH2aWaX7wMEjN tEH8chDYXMd2E672RRlel43J8JpZhO0k05eBo5CdV/pfOhwk+9mYeFw/JJSrkr8GrORQc4 hB859O7kpWAIWPeb+ecP4l8WaLOWlqzJ4jTTFLVGlaSf2hczB+0NLYUMOoN1Fw== 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 4QZRlQ5kHkzgPr; Mon, 5 Jun 2023 08:36:02 +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 3558a2oQ024373; Mon, 5 Jun 2023 08:36:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3558a2JG024372; Mon, 5 Jun 2023 08:36:02 GMT (envelope-from git) Date: Mon, 5 Jun 2023 08:36:02 GMT Message-Id: <202306050836.3558a2JG024372@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 23af3ca2d418 - stable/13 - kern/subr_unit.c: more uses for is_bitmap() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 23af3ca2d4183c298435297b2e0aca226e2277dd Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=23af3ca2d4183c298435297b2e0aca226e2277dd commit 23af3ca2d4183c298435297b2e0aca226e2277dd Author: Konstantin Belousov AuthorDate: 2023-05-12 22:39:35 +0000 Commit: Konstantin Belousov CommitDate: 2023-06-05 08:35:00 +0000 kern/subr_unit.c: more uses for is_bitmap() (cherry picked from commit 36b1f8a81ef96b42ce446efb79cffd577f1819f7) --- sys/kern/subr_unit.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sys/kern/subr_unit.c b/sys/kern/subr_unit.c index fd9425e95dd5..6c1368c64e00 100644 --- a/sys/kern/subr_unit.c +++ b/sys/kern/subr_unit.c @@ -207,6 +207,12 @@ CTASSERT((sizeof(struct unr) % sizeof(bitstr_t)) == 0); /* Number of bits we can store in the bitmap */ #define NBITS (NBBY * sizeof(((struct unrb *)NULL)->map)) +static inline bool +is_bitmap(struct unrhdr *uh, struct unr *up) +{ + return (up->ptr != uh && up->ptr != NULL); +} + /* Is the unrb empty in at least the first len bits? */ static inline bool ub_empty(struct unrb *ub, int len) { @@ -246,7 +252,7 @@ check_unrhdr(struct unrhdr *uh, int line) z = 0; TAILQ_FOREACH(up, &uh->head, list) { z++; - if (up->ptr != uh && up->ptr != NULL) { + if (is_bitmap(uh, up)) { ub = up->ptr; KASSERT (up->len <= NBITS, ("UNR inconsistency: len %u max %zd (line %d)\n", @@ -409,12 +415,6 @@ clear_unrhdr(struct unrhdr *uh) check_unrhdr(uh, __LINE__); } -static __inline int -is_bitmap(struct unrhdr *uh, struct unr *up) -{ - return (up->ptr != uh && up->ptr != NULL); -} - /* * Look for sequence of items which can be combined into a bitmap, if * multiple are present, take the one which saves most memory. From nobody Mon Jun 5 08:36:03 2023 X-Original-To: dev-commits-src-branches@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 4QZRlS1MFCz4bLyg; Mon, 5 Jun 2023 08:36:04 +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 4QZRlS0TdHz3x1X; Mon, 5 Jun 2023 08:36:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685954164; 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=7o6GkU4q2nHWn+CdSSgrzxpB1VRcIt8cXDNgZxaq9e4=; b=rTafMRymr2z4P1g1ShXg1aT/qFRkO7eFyBhKLsHdMHigNq/unrj7q5ZXcTWLtndPCpxOPj 8be0MOwJxY8Jgp7ILmVGIfyJMJ3oqRk+JM3D15/UMmdMEFQp4pDVVNnA+VQJ8L6nOKsEJA TjZhYMZZUnnqmONFG6KDbbTdmdIFvvSE2t8GW5396pa3SnRaw1S09navBhBsamQHqaJKdS u0Syw0ia6VZL5tNozTub3Fa8SplorJzHEhpMu963AgBF9AgHoby3qsJ6E2JGXhlzgpla/+ zDrsy3OtGkaXd1QmaXrH2UFAggAOQAfCFSP6bu71C5UgBKL8BjlKbyLwY94F0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685954164; 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=7o6GkU4q2nHWn+CdSSgrzxpB1VRcIt8cXDNgZxaq9e4=; b=KaRqiA3wtQZC59nuZwQ2lFDHAjuMEFiATLcKSr7oQLPgYb4n9+6SCW6Gnx6MM1I0LWvCTp YsPqhn7ipsb6l6oxpsewlbfa5OyQGbFxkcKNQuKcKVQagZ7EsW9+Sck2YJuRG+lCHQlRaa ZMWnwzZU3BMbn5p3iVrPkMaxvKZ4qud47VuQWoWdEEdxT9ZcNELAY4M5v4JNjxJbxEUY7z hh7+Vcui1PObEKhs+SIAqGGURO1YyEywSyiGn2bY5GCNJ4gCJWX7jvxVDh+FVDEjW5/Ne0 5iOOLMM+Z1QbvkDU/Md86aVGVJ5+NBJ/HHB0/sycwAF4utremegKjkDhpzI2rA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685954164; a=rsa-sha256; cv=none; b=nLEpKbyqXT4aQUavzp+OyIr57bTsHsf/ImrS+ZSvU8FaUYjd1sr4mbhUs0JzYiGejB6Trq 5efxBltEqYiqSkpU3ea0wtCIoQb35HGFcMosCQjBhAmkGE+FB2QaJHjXP8D1lBC2twsnhl cGmj8Y1Ml+bMkFbDJqq6+HHWipgvM/ysyq1edOz/LjHI4H3mzXKwmMpE6fX0fXIAYHvUhB fat/utFo9tSEmgezEUoUI+SojrnCPEyMocvdHXXl8s1VqskPNJOkePqv92/pfAoORMO5fD 0Yg3sPXEIONwcksQJ2qBLEeUwdVv8jLn5hNvxbRrf373B+4DPBhTw8dw7WOMhQ== 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 4QZRlR6Y1Czh0w; Mon, 5 Jun 2023 08:36:03 +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 3558a3sb024392; Mon, 5 Jun 2023 08:36:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3558a3Uk024391; Mon, 5 Jun 2023 08:36:03 GMT (envelope-from git) Date: Mon, 5 Jun 2023 08:36:03 GMT Message-Id: <202306050836.3558a3Uk024391@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: c26549327f42 - stable/13 - subr_unit.c: explain first/last special ranges List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c26549327f425bc1b0272037d524af18392c0c88 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=c26549327f425bc1b0272037d524af18392c0c88 commit c26549327f425bc1b0272037d524af18392c0c88 Author: Konstantin Belousov AuthorDate: 2023-05-14 23:11:17 +0000 Commit: Konstantin Belousov CommitDate: 2023-06-05 08:35:01 +0000 subr_unit.c: explain first/last special ranges (cherry picked from commit d44f477038d3ede5fe62fa19c9301b43455cd8f1) --- sys/kern/subr_unit.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/kern/subr_unit.c b/sys/kern/subr_unit.c index 6c1368c64e00..a78b6ddf4840 100644 --- a/sys/kern/subr_unit.c +++ b/sys/kern/subr_unit.c @@ -191,6 +191,12 @@ mtx_assert(struct mtx *mp, int flag) * For bitmaps the len field represents the number of allocated items. * * The bitmap is the same size as struct unr to optimize memory management. + * + * Two special ranges are not covered by unrs: + * - at the start of the allocator space, all elements in [low, low + first) + * are allocated; + * - at the end of the allocator space, all elements in [high - last, high] + * are free. */ struct unr { TAILQ_ENTRY(unr) list; From nobody Mon Jun 5 08:36:04 2023 X-Original-To: dev-commits-src-branches@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 4QZRlT23L1z4bLsL; Mon, 5 Jun 2023 08:36:05 +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 4QZRlT1LbSz3xFH; Mon, 5 Jun 2023 08:36:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685954165; 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=mi/6Ie06cI10EG9aIgeLK5I4TZNsLVgPgfZG245Ptow=; b=QlJD6z52uYE8REM5ZAd3uFYkbUc0n64rnMD2badjK4C0ckgwGp/FjTomHrnnAUrMUYpOxd lpGE0B2Rj1GJNtE64ZVY4Som/YxkON9DMn/ctguCgYjiGVCW5Sohi8aDz8f2nevN/DDtFD spRACOa1D8+ZWfzTU1bWTzWtMslR0pT17ZynQme7FnCLx5/3p7firaRqA2r61uVfKGKp4/ 4jhw/tUsDRPzVSfD0mSNo+MPrUba1iX47ll6G5rtMMdimJgAbodLLqEmVqwsRSA46A2KWw C7xUEF0YfqsokPkZC79akb6VsOo4E6iwjSTszXa4rR9mDlrGTY1QwRcnSoGkIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685954165; 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=mi/6Ie06cI10EG9aIgeLK5I4TZNsLVgPgfZG245Ptow=; b=K8zFWyvc6GTaZOUcDz6ugxmx2z25eUjikZGLX2cQ9Lic0VI5zDjOBf83cq1WUwRnaTRydx B6XBKTq5FoLGejusu991NP3zhXCW/z/c6YoaUQFdm89d63MdGLdRiZXa20rlp5ZQdxJmM/ htiGupTAMgPKHRztx4bZMVH06g1NhZfUB0K29Hff4KR26uRBJD5yNfDbwhHoHnwVhf8v3d c5M4qA/FPs6ES7R8x6LinFYhGlxghsN0Lf4EbWAK/pvNsaa5jVdS121HYqFiDzK0wt0rTw TxErM1Qq61PmbHeJ5erBbZDxwL5wS9KjUdcrRc9sQdWbKtrHOnxYuLG1bvqGqQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685954165; a=rsa-sha256; cv=none; b=bTdO9Tt3EoQICwuBJge68Uhfqur6GE+2dg8olDVxaKl3GLx9foaXnnX2+txFWWihDBMTwo lpWxF8EAIjhoEywxJPYhlGl9Fanhc54i17scVQnuuG2VNBmIt5JfEeDjiWh3XRV5Omj2hg cz7MpSjnEKPmoqTzKnoEQuvGq5fK6LpHBD3JGQlh32+Kaz1JSF6J63oQGy4zRamOkcBc3q h6XgngENn4lRVhbudDYDkOK0LwJ6F6QqJz+mp9pFw5X02Ynht2ggmBliloCcyZg70QjqAp aCDVavmXRTjxPS+09g9FBXDKESJv9EhsZEcB/HU8rpFzP1kYlgT+BsnP4Z4+Ww== 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 4QZRlT0NRvzgPs; Mon, 5 Jun 2023 08:36:05 +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 3558a4Sa024411; Mon, 5 Jun 2023 08:36:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3558a48v024410; Mon, 5 Jun 2023 08:36:04 GMT (envelope-from git) Date: Mon, 5 Jun 2023 08:36:04 GMT Message-Id: <202306050836.3558a48v024410@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 4ae4e074ebe8 - stable/13 - unr(9): document clean_unrhdr() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4ae4e074ebe8d1ffa749ae7444b1704acc2b25d2 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=4ae4e074ebe8d1ffa749ae7444b1704acc2b25d2 commit 4ae4e074ebe8d1ffa749ae7444b1704acc2b25d2 Author: Konstantin Belousov AuthorDate: 2023-05-14 00:43:54 +0000 Commit: Konstantin Belousov CommitDate: 2023-06-05 08:35:01 +0000 unr(9): document clean_unrhdr() (cherry picked from commit f8c37080853c13ada935e7fe3d53286c1d9220f1) --- share/man/man9/unr.9 | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/share/man/man9/unr.9 b/share/man/man9/unr.9 index c2e9b3943829..c0cf44b9033e 100644 --- a/share/man/man9/unr.9 +++ b/share/man/man9/unr.9 @@ -29,6 +29,7 @@ .Os .Sh NAME .Nm new_unrhdr , +.Nm clean_unrhdr , .Nm clear_unrhdr , .Nm delete_unrhdr , .Nm alloc_unr , @@ -40,6 +41,10 @@ .Ft "struct unrhdr *" .Fn new_unrhdr "int low" "int high" "struct mtx *mutex" .Ft void +.Fn clean_unrhdr "struct unrhdr *uh" +.Ft void +.Fn clean_unrhdrl "struct unrhdr *uh" +.Ft void .Fn clear_unrhdr "struct unrhdr *uh" .Ft void .Fn delete_unrhdr "struct unrhdr *uh" @@ -86,6 +91,26 @@ This function frees the memory associated with the entity, it does not free any units. To free all units use .Fn clear_unrhdr . +.It Fn clean_unrhdr uh +Freeing unit numbers might result in some internal memory becoming unused. +There are +.Nm unit +allocator consumers that cannot tolerate taking +.Xr malloc 9 +locks to free the memory, while having their unit mutex locked. +For this reason, free of the unused memory after delete is postponed +until the consumer can afford calling into the +.Xr malloc 9 +subsystem. +Call +.Fn clean_unrhdr uh +to do the cleanup. +In particular, this needs to be done before freeing a unr, if +a deletion of units could have been performed. +.It Fn clean_unrhdrl +Same as +.Fn clean_unrhdr , +but assumes that the unr mutex is already owned, if any. .It Fn alloc_unr uh Return a new unit number. The lowest free number is always allocated. From nobody Mon Jun 5 08:36:06 2023 X-Original-To: dev-commits-src-branches@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 4QZRlV2wrNz4bLqD; Mon, 5 Jun 2023 08:36:06 +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 4QZRlV2VFRz3wxC; Mon, 5 Jun 2023 08:36:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685954166; 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=NR198L/rMjSiRPbNaPNJF1d6cE+DVWBVBGlrI2Q9IJA=; b=gdCfBq/8l6rERqCubMnAF363nRhHkVUZa+w9ZKld2AeR9/yUqWPVA/AavxDlhHwYImUqN4 yOjqEPfAKSisn45yKjNm2tWRf9VZ1X2gTIm0ukksQLf0WHK8jcJaQVNdHd3wL5BJVIWSjN UkDybyZFyDYJfM28q6SeTzByIvfhmMl/+XTgWfHiY8Yy2y5xu7bnrwKWFBql99fc0/klZM THFIvf0dS/aRurkBr8ee5xE+EqX/Zuniev9Hj3wQilZ7vdJNLVFQkjGg9dVnq+Vo7o7Kdg qEOawAa/rsfDN1mw/pAZz8AVH0fSZL21SjRVlVbaCdreahZvbllOOVlcvGDF/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685954166; 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=NR198L/rMjSiRPbNaPNJF1d6cE+DVWBVBGlrI2Q9IJA=; b=qHmt9f7WPgdnrMz/5yzabr9HMzIW7ZE7og/kEtVrPm1mSKgWzwUF787XOPYGgQitQBGX/3 +tKibuQJbuZ9TgszCp5TnOP7Q1595p8ePPfbktKdGZ2WWkooOVGb5WplanSF2KKeVB5Eq/ 91MXbntKhPCsyIhzdZ1RR7GRABc5TvXTgSmrhaekur/ktaH7TfHkAdVULZqcXmWA9jRJSx PlT6ZJlsspl+96LQVRVMApFJKE3dp4GTriywiUUGKnYHGf9GKka2Iy3pcGckpMOIRaoGiH sTL+/IbC6jn0GyYg1BheQXLJqU7zAZTmtMaPkrqYYj5vndRvjftBhSDXvsiMuw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685954166; a=rsa-sha256; cv=none; b=MaRYGeguunlf8tZdPE4Pi22yV+7Rtbfu1eftaeAAU0PAZYGIu2J9Bm4bKJHuZbxSKZ6W3d X3GU9wlGLba9Zvi554tOV7VkWljR64qnCXFN/+wBU2IlXsYZ6fvfNoxRABPkRwQ+YAC+Gt gte0BxA8mnOsxui/QvbYUGECyJwHFpFWTofZkcuDL+HVj7IpPJYt5e+YIRirdNSRAxJwBR 8ptdKK1yY9bci2gCpKNOZ/ia6/f9DQKGjC8sQJkcFct18gSckzXwiTrN5RDS9WTPjFuzye upyY9MIzL4nsRKSfoLONk/lCnlnmOfVT+8a92vf8frko1joClK41KsnORkaKuw== 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 4QZRlV1Mcszh0x; Mon, 5 Jun 2023 08:36:06 +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 3558a6AL024430; Mon, 5 Jun 2023 08:36:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3558a64s024429; Mon, 5 Jun 2023 08:36:06 GMT (envelope-from git) Date: Mon, 5 Jun 2023 08:36:06 GMT Message-Id: <202306050836.3558a64s024429@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 694714adcd19 - stable/13 - unr(9): add 'show unrhdr' ddb command List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 694714adcd19b7463b2fe697f2d8301a13a25729 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=694714adcd19b7463b2fe697f2d8301a13a25729 commit 694714adcd19b7463b2fe697f2d8301a13a25729 Author: Konstantin Belousov AuthorDate: 2023-05-25 11:14:19 +0000 Commit: Konstantin Belousov CommitDate: 2023-06-05 08:35:01 +0000 unr(9): add 'show unrhdr' ddb command (cherry picked from commit f386b27736fe6dee535a530d5c7610d8a9827758) --- sys/kern/subr_unit.c | 59 ++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 43 insertions(+), 16 deletions(-) diff --git a/sys/kern/subr_unit.c b/sys/kern/subr_unit.c index a78b6ddf4840..0f4d25257553 100644 --- a/sys/kern/subr_unit.c +++ b/sys/kern/subr_unit.c @@ -939,15 +939,18 @@ free_unr(struct unrhdr *uh, u_int item) Free(p2); } -#ifndef _KERNEL /* USERLAND test driver */ +#ifdef _KERNEL +#include "opt_ddb.h" +#ifdef DDB +#include +#endif +#endif -/* - * Simple stochastic test driver for the above functions. The code resides - * here so that it can access static functions and structures. - */ +#if (defined(_KERNEL) && defined(DDB)) || !defined(_KERNEL) -static bool verbose; -#define VPRINTF(...) {if (verbose) printf(__VA_ARGS__);} +#if !defined(_KERNEL) +#define db_printf printf +#endif static void print_unr(struct unrhdr *uh, struct unr *up) @@ -955,21 +958,21 @@ print_unr(struct unrhdr *uh, struct unr *up) u_int x; struct unrb *ub; - printf(" %p len = %5u ", up, up->len); + db_printf(" %p len = %5u ", up, up->len); if (up->ptr == NULL) - printf("free\n"); + db_printf("free\n"); else if (up->ptr == uh) - printf("alloc\n"); + db_printf("alloc\n"); else { ub = up->ptr; - printf("bitmap ["); + db_printf("bitmap ["); for (x = 0; x < up->len; x++) { if (bit_test(ub->map, x)) - printf("#"); + db_printf("#"); else - printf(" "); + db_printf(" "); } - printf("]\n"); + db_printf("]\n"); } } @@ -979,12 +982,12 @@ print_unrhdr(struct unrhdr *uh) struct unr *up; u_int x; - printf( + db_printf( "%p low = %u high = %u first = %u last = %u busy %u chunks = %u\n", uh, uh->low, uh->high, uh->first, uh->last, uh->busy, uh->alloc); x = uh->low + uh->first; TAILQ_FOREACH(up, &uh->head, list) { - printf(" from = %5u", x); + db_printf(" from = %5u", x); print_unr(uh, up); if (up->ptr == NULL || up->ptr == uh) x += up->len; @@ -993,6 +996,30 @@ print_unrhdr(struct unrhdr *uh) } } +#endif + +#if defined(_KERNEL) && defined(DDB) +DB_SHOW_COMMAND(unrhdr, unrhdr_print_unrhdr) +{ + if (!have_addr) { + db_printf("show unrhdr addr\n"); + return; + } + + print_unrhdr((struct unrhdr *)addr); +} +#endif + +#ifndef _KERNEL /* USERLAND test driver */ + +/* + * Simple stochastic test driver for the above functions. The code resides + * here so that it can access static functions and structures. + */ + +static bool verbose; +#define VPRINTF(...) {if (verbose) printf(__VA_ARGS__);} + static void test_alloc_unr(struct unrhdr *uh, u_int i, char a[]) { From nobody Mon Jun 5 08:36:07 2023 X-Original-To: dev-commits-src-branches@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 4QZRlW5YHnz4bM1s; Mon, 5 Jun 2023 08:36: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 4QZRlW3F2Gz3xCj; Mon, 5 Jun 2023 08:36:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685954167; 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=n7PPf5hn96BriOW9E6XJZxbIsJoaAJQ4m1GqMlNnnOM=; b=GOwbe8WqPYutkLP41HOsqVJv3rbjYwgZPMeM0M99IncgtTukZmDlA5eGcMNSMkPuc2nQl5 /eh8Ks6Up2lQNw1rdJWsQx7fsRD+6U33Y7VFR/xaSCziou7rIzGrRn6X8s+Dy58Mw/q3C6 ubKtK9h4ltUWu5aSkDc5Yhem1Pb3rWwqPC4NaifUlgSNhT/1EiOykt0RTMoX2VUD8/yD9G ZMpkYXb0uW3U1oeF1hItQtk/qZUh9Ayr6OPNhz9JcSAaRR4/z7PTR8F/9T+QsvYakiofwf IQcE1WNXctMJ/j8ajMgqoo2e0KxA7db2Q1Efg2rIwBR+qYeNTt9WbcMA/4Hxgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685954167; 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=n7PPf5hn96BriOW9E6XJZxbIsJoaAJQ4m1GqMlNnnOM=; b=yzdMh40JwacOki3hIfQQ9dHnq9KFgk/J/zV/RuaQOOT0gYAkWdnbGrlBJbc13DJWcQrEaX al/9l1hucLI7dR2pxQos7sE5bNUfOT3eWf/Od1+OAPoGDNJmx77clAdnBhX6Xd02yk6eLO owtRoMlfziBgl6wnjIFfA+6j1B5kTygMIrlw/0eh7A1rD3gd8NVc0Rnf54PFns9aEgXL4/ 29PTzCa5QtBaDNf8+PCHXWkHUvcb9tE4SBZ+ApmDB9QP608QPt/HTR/j9ezUA26dk4OewK GVtrfjCVi1aLLzEvZMhGGnbkbcXiy7H5lOFl6l2TfhCmg7922YGnjvIzv1dD4Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685954167; a=rsa-sha256; cv=none; b=ZRX0rTxj1FhbmWDTkloMzNiiT74fjPmzHG5d4v+awJl3I4mcLeOnN9C21CUMcDHlXkpE1b pQwnMhS8SCY8DA3t/4l9dyFcL/G87DHKP84tmY4uF66jn8P6Aw9rORNT5Iq0vOCU8AxRXG IvpZZ/6c9xeykpVC5urOc7uRSK8xQqxXi2SzG2DHfVwrp5noqCO0AHciV54xcpcGjzHY7+ 03VCk5kwBcOEnAu/0PUmetx/pZoEfYNweQfw6luzCno4FshZdWaFNhyivb/LFyTUWAvVpY Bh5H0lWF033LCmxRKsGiCVti10CF6WIVGuXH2Bg8g6DyhHvCeH3R1kIq6msWlw== 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 4QZRlW2Ltgzgs5; Mon, 5 Jun 2023 08:36:07 +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 3558a72q024455; Mon, 5 Jun 2023 08:36:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3558a7o7024454; Mon, 5 Jun 2023 08:36:07 GMT (envelope-from git) Date: Mon, 5 Jun 2023 08:36:07 GMT Message-Id: <202306050836.3558a7o7024454@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: c0360504add5 - stable/13 - unr(9): add iterator interface List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c0360504add56d422bb8f77ec7f7a32689a2e8b1 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=c0360504add56d422bb8f77ec7f7a32689a2e8b1 commit c0360504add56d422bb8f77ec7f7a32689a2e8b1 Author: Konstantin Belousov AuthorDate: 2023-05-12 22:49:29 +0000 Commit: Konstantin Belousov CommitDate: 2023-06-05 08:35:01 +0000 unr(9): add iterator interface (cherry picked from commit a014e0a3987a277a0e56c7fa5b9d895f735a8d1e) --- sys/kern/subr_unit.c | 121 +++++++++++++++++++++++++++++++++++++++++++++++++++ sys/sys/systm.h | 3 ++ 2 files changed, 124 insertions(+) diff --git a/sys/kern/subr_unit.c b/sys/kern/subr_unit.c index 0f4d25257553..ee67e5db01d6 100644 --- a/sys/kern/subr_unit.c +++ b/sys/kern/subr_unit.c @@ -238,6 +238,122 @@ ub_full(struct unrb *ub, int len) return (first_clear == -1); } +/* + * start: ipos = -1, upos = NULL; + * end: ipos = -1, upos = uh + */ +struct unrhdr_iter { + struct unrhdr *uh; + int ipos; + int upos_first_item; + void *upos; +}; + +void * +create_iter_unr(struct unrhdr *uh) +{ + struct unrhdr_iter *iter; + + iter = Malloc(sizeof(*iter)); + iter->ipos = -1; + iter->uh = uh; + iter->upos = NULL; + iter->upos_first_item = -1; + return (iter); +} + +static void +next_iter_unrl(struct unrhdr *uh, struct unrhdr_iter *iter) +{ + struct unr *up; + struct unrb *ub; + u_int y; + int c; + + if (iter->ipos == -1) { + if (iter->upos == uh) + return; + y = uh->low - 1; + if (uh->first == 0) { + up = TAILQ_FIRST(&uh->head); + if (up == NULL) { + iter->upos = uh; + return; + } + iter->upos = up; + if (up->ptr == NULL) + iter->upos = NULL; + else + iter->upos_first_item = uh->low; + } + } else { + y = iter->ipos; + } + + up = iter->upos; + + /* Special case for the compacted [low, first) run. */ + if (up == NULL) { + if (y + 1 < uh->low + uh->first) { + iter->ipos = y + 1; + return; + } + up = iter->upos = TAILQ_FIRST(&uh->head); + iter->upos_first_item = uh->low + uh->first; + } + + for (;;) { + if (y + 1 < iter->upos_first_item + up->len) { + if (up->ptr == uh) { + iter->ipos = y + 1; + return; + } else if (is_bitmap(uh, up)) { + ub = up->ptr; + bit_ffs_at(&ub->map[0], + y + 1 - iter->upos_first_item, + up->len, &c); + if (c != -1) { + iter->ipos = iter->upos_first_item + c; + return; + } + } + } + iter->upos_first_item += up->len; + y = iter->upos_first_item - 1; + up = iter->upos = TAILQ_NEXT((struct unr *)iter->upos, list); + if (iter->upos == NULL) { + iter->ipos = -1; + iter->upos = uh; + return; + } + } +} + +/* + * returns -1 on end, otherwise the next element + */ +int +next_iter_unr(void *handle) +{ + struct unrhdr *uh; + struct unrhdr_iter *iter; + + iter = handle; + uh = iter->uh; + if (uh->mtx != NULL) + mtx_lock(uh->mtx); + next_iter_unrl(uh, iter); + if (uh->mtx != NULL) + mtx_unlock(uh->mtx); + return (iter->ipos); +} + +void +free_iter_unr(void *handle) +{ + Free(handle); +} + #if defined(DIAGNOSTIC) || !defined(_KERNEL) /* * Consistency check function. @@ -1056,6 +1172,11 @@ test_alloc_unr_specific(struct unrhdr *uh, u_int i, char a[]) } } +static void +test_iter(void) +{ +} + static void usage(char **argv) { diff --git a/sys/sys/systm.h b/sys/sys/systm.h index 828297e5b948..4b479e95aa2f 100644 --- a/sys/sys/systm.h +++ b/sys/sys/systm.h @@ -483,6 +483,9 @@ int alloc_unr(struct unrhdr *uh); int alloc_unr_specific(struct unrhdr *uh, u_int item); int alloc_unrl(struct unrhdr *uh); void free_unr(struct unrhdr *uh, u_int item); +void *create_iter_unr(struct unrhdr *uh); +int next_iter_unr(void *handle); +void free_iter_unr(void *handle); #ifndef __LP64__ #define UNR64_LOCKED From nobody Mon Jun 5 08:36:08 2023 X-Original-To: dev-commits-src-branches@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 4QZRlX4dhZz4bMDY; Mon, 5 Jun 2023 08:36: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QZRlX48nWz3xD3; Mon, 5 Jun 2023 08:36:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685954168; 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=jki3ZElsbV5Lqt4oN9GCPnWfaBov38EoaiMXCMdgRdo=; b=iicdsGtn0scbEiH2A49tWi4QOEj9wtj13JRKzfjlKApmIR6ag8CvoYPqyg5jWcn2ljgRcN to9mRN7tC6C7/drxENmisaMZhT7B+dj8GdHt+pMxy5zIPCpEyM0ENg0mwlpJAAzEWXN/ep OOK1s9/nTUD/HrbBiZcAlakc/I9tuMFMoIyu4zhBq3DqoqN0ei2KHbrlCaw5uIPBSRa+W4 g1hke3VIvlR8AVIAzRnzMCaFsBF53yHU/VJCKpqTWz/mkaR1ADXaQ5MkZ4G0p+ZOIGlMdU ssfr0n++uWlPz1okWUPjriyOBQkN/Y/33Q8E6Z5n7Y51P2cQ9U5M34DqVwBhmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685954168; 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=jki3ZElsbV5Lqt4oN9GCPnWfaBov38EoaiMXCMdgRdo=; b=qd5mJHRABPyCmuHWdVdWH9dV2Rhlj+NlS3YwuxW7cnEH/vk3vVRoyycvT+jqrSUp1TUDzw 5dK67NNCYvTVZmuo7DU9SnnhKffpVQllP3LTM1QxK4qEc7cw/vunti7G2i8eq8tzCirv1M ZvLEedeMDhRSAeO9uo7IYSA+feM36hYUmCd11piwJzrLbR8iDXS62soI/inPHbykweNj2p mFH9IE9znSy6ICjFZAWOCYZw28b+sY8RY/IgLhXy7WXiAK5ViSY6saHa0g/RFRbunnVWoh LNa+/ci6a+qDhK03rDOe1A/OY/AaA6VVaz+24cORVGRGbIReFI0I2An8e2cnXQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685954168; a=rsa-sha256; cv=none; b=DxEd85OyJy89pE3SzIwFCLihK/o3AHusSz8Z4ioTz1rN4Zw1gOrG7sBk6324J11ml30d8D tGvghUdDOtJZ/3t5c9QBbJzP+tU+j44ak91pYPRfXSe83+vfCiMjytP2f50Ma692EpbULF jMJy6lPoPjaDU4Ya8XZRfC3oOPofYau9j9ZpodtA5NZgkZmFb7vo112B1MEPJEIe470Jg2 kHUWLdXoVUem+wnj7rtIB6Gys966D8qHRbj6wblV1ISffoI0cZ/PjMcxEAMA9koXcNTTgi PCowW4eZ9ESC89pFNN/bKyueN//YKgufk1J6zLqLT/WXpBcyrzuttd7kW0Ey8Q== 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 4QZRlX3GKLzgds; Mon, 5 Jun 2023 08:36:08 +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 3558a89O024474; Mon, 5 Jun 2023 08:36:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3558a89i024473; Mon, 5 Jun 2023 08:36:08 GMT (envelope-from git) Date: Mon, 5 Jun 2023 08:36:08 GMT Message-Id: <202306050836.3558a89i024473@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: e7c3889a1736 - stable/13 - unr(9): add 'show unrhdr_iter' command List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e7c3889a17368ba396734019a480c0c2dfb3fd63 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e7c3889a17368ba396734019a480c0c2dfb3fd63 commit e7c3889a17368ba396734019a480c0c2dfb3fd63 Author: Konstantin Belousov AuthorDate: 2023-05-25 18:09:27 +0000 Commit: Konstantin Belousov CommitDate: 2023-06-05 08:35:01 +0000 unr(9): add 'show unrhdr_iter' command (cherry picked from commit c4cc0cab1ea619e07b52ce4c3825e7941996cb49) --- sys/kern/subr_unit.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/sys/kern/subr_unit.c b/sys/kern/subr_unit.c index ee67e5db01d6..236ca9915740 100644 --- a/sys/kern/subr_unit.c +++ b/sys/kern/subr_unit.c @@ -1124,6 +1124,23 @@ DB_SHOW_COMMAND(unrhdr, unrhdr_print_unrhdr) print_unrhdr((struct unrhdr *)addr); } + +static void +print_unrhdr_iter(struct unrhdr_iter *iter) +{ + db_printf("iter %p unrhdr %p ipos %d upos %p ufi %d\n", + iter, iter->uh, iter->ipos, iter->upos, iter->upos_first_item); +} + +DB_SHOW_COMMAND(unrhdr_iter, unrhdr_print_iter) +{ + if (!have_addr) { + db_printf("show unrhdr_iter addr\n"); + return; + } + + print_unrhdr_iter((struct unrhdr_iter *)addr); +} #endif #ifndef _KERNEL /* USERLAND test driver */ From nobody Mon Jun 5 08:36:09 2023 X-Original-To: dev-commits-src-branches@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 4QZRlY5tF2z4bLsh; Mon, 5 Jun 2023 08:36:09 +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 4QZRlY52J2z3xK5; Mon, 5 Jun 2023 08:36:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685954169; 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=f1aJyFYmHfzSC6qvD9J3pNPpVYAB7r7A0wg2Mt54eyE=; b=h7apJzIXsGtptJSpoHGON7J+vuYvH43dUmOdhse2XitZPjxP6NlNl08NA9OzyFX8u3FPUI b9XqbebLkgLGSKzjtlr1bIRFsq4NGqnZryAHMdHfyIgY+jsB37R7rfpobvxQEwzI3xrfmZ 2tN8iWZhWvXBXAL1J589DBbon5UNSP0/u8mYpIOesPxHbUBVB1wGMMcYIaj0omQTJJc+nn fznYs0MaWCrn2SN6ZlZ2sG6KjZfcckrHQjx62vHQRtNo8KGFYS9br9fGgFkgpFuJZ3A7H6 Sx/0XwLb3ylX+pjXPOFF1znzw8zJRsAwZTcNyhL2VyKWb9hgqXWI4CmGJIzoFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685954169; 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=f1aJyFYmHfzSC6qvD9J3pNPpVYAB7r7A0wg2Mt54eyE=; b=cuEtRjJZjFhgD77ZMsUBcx/QPpmxOcdmpDQsfcpzWFQ4i/JT2QX4C+VHD24q83wuiY2rrD cCB6mgm7WPwQTg8492Hgu6OZAbSbRCrzjHWz9vFJiC+oTNh9WbgcQxpY763odFKig4r8kf AlcNV5F3O0inK2aWC413236D4Q1bz/U1meTCk92lHdeCUoNGm/JBZNyV6U587Qf0x28bxv ExTfpXYjZWRA5uUdRAkR7xJd2HWcAmVkdqesFZ1z5dNvzyEf76lGtKrBmZTOhbrfckGSy2 CP0CME2eOjFqgNcGelHjU+rdB7RJyEkHVmcQaGYuoIAkrGeW3TznP7s5u6j40A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685954169; a=rsa-sha256; cv=none; b=NWnbvV+dDqeW/UQw3pb4XnhJgcNdKkUe3crv11q3iTJ0yV84htm1hY7eDs2WpXBtag7Spi vTsliWDNgtELRagi3BKQn2B7/BYebc1s3x5VkNWjD+pVx6/FmNMk10T6zaLhrKPYr03ytN oLidK7VBrDA8Zaekr/0sKoVNsl/h9yxWY95EvBANmMcWOPbURfUHJuvh+9xGUVO4kPYUuh Ebp3eDDH6LnvjyJC62VvasC8QULuUzsD59f26iQ3y8ba5QCL9+5X93jMj+iCKb/xfi/OuO iFdJ7qbRRLUV7BaRUS5rwwyzJfYA1vRLmcxeMc4E8A3ReD1bMFovj43YFRQn0g== 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 4QZRlY45V9zgPt; Mon, 5 Jun 2023 08:36:09 +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 3558a9GC024494; Mon, 5 Jun 2023 08:36:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3558a99i024493; Mon, 5 Jun 2023 08:36:09 GMT (envelope-from git) Date: Mon, 5 Jun 2023 08:36:09 GMT Message-Id: <202306050836.3558a99i024493@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: d4fb56c08fb9 - stable/13 - unr(9) iterator: add naive test List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d4fb56c08fb971916d87483f74ae3f1b4adf2e91 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=d4fb56c08fb971916d87483f74ae3f1b4adf2e91 commit d4fb56c08fb971916d87483f74ae3f1b4adf2e91 Author: Konstantin Belousov AuthorDate: 2023-05-13 01:32:25 +0000 Commit: Konstantin Belousov CommitDate: 2023-06-05 08:35:01 +0000 unr(9) iterator: add naive test (cherry picked from commit 12db3c914fe0a985de1e393ee964c9cda5b3e0ca) --- sys/kern/subr_unit.c | 91 ++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 89 insertions(+), 2 deletions(-) diff --git a/sys/kern/subr_unit.c b/sys/kern/subr_unit.c index 236ca9915740..2be7a27064ad 100644 --- a/sys/kern/subr_unit.c +++ b/sys/kern/subr_unit.c @@ -1189,15 +1189,93 @@ test_alloc_unr_specific(struct unrhdr *uh, u_int i, char a[]) } } +#define TBASE 7 +#define XSIZE 10 +#define ISIZE 1000 + +static int +test_iter_compar(const void *a, const void *b) +{ + return (*(const int *)a - *(const int *)b); +} + +static void +test_iter_fill(int *vals, struct unrhdr *uh, int i, int v, int *res) +{ + int x; + + vals[i] = v; + x = alloc_unr_specific(uh, v); + if (x != v) { + VPRINTF("alloc_unr_specific failed %d %d\n", x, v); + *res = 1; + } +} + static void test_iter(void) { + struct unrhdr *uh; + void *ihandle; + int vals[ISIZE]; + int i, j, v, x, res; + + res = 0; + uh = new_unrhdr(TBASE, INT_MAX, NULL); + for (i = 0; i < XSIZE; i++) { + vals[i] = i + TBASE; + x = alloc_unr_specific(uh, i + TBASE); + if (x != i + TBASE) { + VPRINTF("alloc_unr_specific failed %d %d\n", x, + i + TBASE); + res = 1; + } + } + for (; i < ISIZE; i++) { + for (;;) { +again: + v = arc4random_uniform(INT_MAX); + if (v < TBASE) + goto again; + for (j = 0; j < i; j++) { + if (v == vals[j] || v + 1 == vals[j]) + goto again; + } + break; + } + test_iter_fill(vals, uh, i, v, &res); + i++, v++; + if (i < ISIZE) + test_iter_fill(vals, uh, i, v, &res); + } + qsort(vals, ISIZE, sizeof(vals[0]), test_iter_compar); + + ihandle = create_iter_unr(uh); + i = 0; + while ((v = next_iter_unr(ihandle)) != -1) { + if (vals[i] != v) { + VPRINTF("iter %d: iter %d != val %d\n", i, v, vals[i]); + if (res == 0) { + if (verbose) + print_unrhdr(uh); + res = 1; + } + } else { + VPRINTF("iter %d: val %d\n", i, v); + } + i++; + } + free_iter_unr(ihandle); + clean_unrhdr(uh); + clear_unrhdr(uh); + delete_unrhdr(uh); + exit(res); } static void usage(char **argv) { - printf("%s [-h] [-r REPETITIONS] [-v]\n", argv[0]); + printf("%s [-h] [-i] [-r REPETITIONS] [-v]\n", argv[0]); } int @@ -1209,11 +1287,16 @@ main(int argc, char **argv) long reps = 1, m; int ch; u_int i; + bool testing_iter; verbose = false; + testing_iter = false; - while ((ch = getopt(argc, argv, "hr:v")) != -1) { + while ((ch = getopt(argc, argv, "hir:v")) != -1) { switch (ch) { + case 'i': + testing_iter = true; + break; case 'r': errno = 0; reps = strtol(optarg, NULL, 0); @@ -1234,6 +1317,10 @@ main(int argc, char **argv) } setbuf(stdout, NULL); + + if (testing_iter) + test_iter(); + uh = new_unrhdr(0, count - 1, NULL); print_unrhdr(uh); From nobody Mon Jun 5 08:36:10 2023 X-Original-To: dev-commits-src-branches@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 4QZRlb1MCmz4bLsl; Mon, 5 Jun 2023 08:36: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QZRlb0xC8z3xFG; Mon, 5 Jun 2023 08:36:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685954171; 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=9iscgdeh92DYY0oav6JxWF5q2JnJ9BpKGtUuwBASOT4=; b=NvWIj3d/a3TERE7eu/1Nv+xFILOSYRsC1k1cv8oZDy7SDuc+rE9Y14xaoiLzDWGVhHSBOP U8DBmJlNdUV81GKKMXEajqPNFhGzr1BABD/Fcbkq3m0CqqoNmBTVptfOKKKOgO6bC7Gvuv 33h1LgTSVGPWZaT5TlvuA786wYR0ilitLDe1bdcaraAuD9PhunVbqPZASIDewS3U0rUoke 6ci+9/EWoykAKJ2rKa8q3QbYnfnnPCkFiqratJQriyjzPxMJCfk/yZRfb7HwPf4MGD0pWN b3yy2/3EaIrk8YlTBVFdt+F75NPwxGxTz4AQn9TLXECKCQooD7DfQ8aBkwpocw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685954171; 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=9iscgdeh92DYY0oav6JxWF5q2JnJ9BpKGtUuwBASOT4=; b=ozcctHn1a3Tgz4lk9TBF4I2yiPMZzh83jOI7P5RHYzVjZEiL30j1koHaHH2yOWsmNob2dx UtyPqQL2M/zMRMLJASYMveBnWesHGv0usiHeXBN6ijfmH8lPIC/DOCvqEU9SkDsGTPQzu+ 5Y8BM5unS+3830oC7FgRaAcRq3ZTDXwN/tfFe75e1GMZMFUHFxUffRiT9qEFJid+GiVcN3 kl02btG1AGuMst9IB94MmB+ClwIWOrK6yTDPthRAtiw/nuussp8kPPeuolCqF9z/DAtzA2 JpSV8HOiV2q9//5aQrLEX2nLbXmJ5s4U0SPVb7msjTCCjKBf0iCTRJQ8dUlWLQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685954171; a=rsa-sha256; cv=none; b=i3IXxps3N6hvVOr3s6zk5i+IDHyCv6rNqPg0hhp4MuDTD9gjTA8igfYjGDGR1rEZd8oSdr 7Gki3FVVEyNajKO1RkFPw+rdV3Qt/JNqaaFA0bmqYM26hgVzmxR7Ni7Y+2Oa/PjjgkeVf+ vFzOpVAtdwNaEWHQkaLdT1dP3T7ZCljAIyiFLzptiuxcjlbCPXEh2Hi0y55WOOavtoIYyh clPCU3HPP1XXNBT3wqZgnl7bJXgieLswsjFPlhb67k0uknF/2BECqxKqrU8mFeCB2g3wuM sc4LpGVMFbIZ2QaadhX2NyAD9ssGHBfmZEjoxm/CFJQ7vrCGTv/J0AJ1FVi4lg== 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 4QZRlZ75m0zgMP; Mon, 5 Jun 2023 08:36:10 +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 3558aAbi024520; Mon, 5 Jun 2023 08:36:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3558aAW5024519; Mon, 5 Jun 2023 08:36:10 GMT (envelope-from git) Date: Mon, 5 Jun 2023 08:36:10 GMT Message-Id: <202306050836.3558aAW5024519@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 135bc1d49de5 - stable/13 - unr(9): document iterators List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 135bc1d49de598a8c1c0b679e70265e01d08beea Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=135bc1d49de598a8c1c0b679e70265e01d08beea commit 135bc1d49de598a8c1c0b679e70265e01d08beea Author: Konstantin Belousov AuthorDate: 2023-05-14 01:40:08 +0000 Commit: Konstantin Belousov CommitDate: 2023-06-05 08:35:01 +0000 unr(9): document iterators (cherry picked from commit ea95173dbb3b67019a83155e55f798d4618f18c7) --- share/man/man9/unr.9 | 46 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/share/man/man9/unr.9 b/share/man/man9/unr.9 index c0cf44b9033e..201717ccdfd2 100644 --- a/share/man/man9/unr.9 +++ b/share/man/man9/unr.9 @@ -34,7 +34,10 @@ .Nm delete_unrhdr , .Nm alloc_unr , .Nm alloc_unr_specific , -.Nm free_unr +.Nm free_unr , +.Nm create_iter_unr , +.Nm next_iter_unr , +.Nm free_iter_unr .Nd "kernel unit number allocator" .Sh SYNOPSIS .In sys/systm.h @@ -56,6 +59,12 @@ .Fn alloc_unr_specific "struct unrhdr *uh" "u_int item" .Ft void .Fn free_unr "struct unrhdr *uh" "u_int item" +.Ft void * +.Fn create_iter_unr "struct unrhdr *uh" +.Ft int +.Fn next_iter_unr "void *handle" +.Ft void +.Fn free_iter_unr "void *handle" .Sh DESCRIPTION The kernel unit number allocator is a generic facility, which allows to allocate unit numbers within a specified range. @@ -135,6 +144,41 @@ Free a previously allocated unit number. This function may require allocating memory, and thus it can sleep. There is no pre-locked variant. .El +.Sh ITERATOR INTERFACE +The +.Nm unr +facility provides an interface to iterate over all allocated units +for the given +.Dv unrhdr . +Iterators are identified by an opaque handle. +More than one iterators can operate simultaneously; the iterator position +data is recorded only in the iterator handle. +.Pp +Consumers must ensure that the unit allocator is not modified between +calls to the iterator functions. +In particular, the internal allocator mutex cannot provide consistency, +because it is acquired and dropped inside the +.Fn next_iter_unr +function. +If the allocator was modified, it is safe to free the iterator with +.Fn free_iter_unr +method nevertheless. +.Bl -tag -width indent +.It Fn create_iter_unr uh +Create an iterator. +Return the handle that should be passed to other iterator functions. +.It Fn next_iter_unr handle +Return the value of the next unit. +Units are returned in ascending order. +A return value of +.Li \-1 +indicates the end of iteration, in which +case +.Li \-1 +is returned for all future calls. +.It Fn free_iter_unr handle +Free the iterator, handle is no longer valid. +.El .Sh CODE REFERENCES The above functions are implemented in .Pa sys/kern/subr_unit.c . From nobody Mon Jun 5 08:36:11 2023 X-Original-To: dev-commits-src-branches@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 4QZRlc1ntPz4bMBN; Mon, 5 Jun 2023 08:36:12 +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 4QZRlb72t0z3xXj; Mon, 5 Jun 2023 08:36:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685954172; 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=nNvJQBGlmRU2rKeF6UugbxPPURnV+GyVgzwO3arF9h0=; b=wDCm3ohSbKOEfxQH3c+1db1VK2enPFdBorVg/Gzh2zQ9b9rNlRS4xVleofTs9WuMUlxjAr NzCuXkZmTNjMOWiLT5VA3eXgO5EVw6JK18ylMlzyFsECDkrE0H8OcNrF+PO1N6F2DUZxEF Hlr6C46kS5mF92NnxtLa7DlpJg40eZp8sYZoRyAt3EAjXg80jL/40dpJwifSU0SgNdGXe6 mkzYICf9An1ekLUKpiTlvk/3k0Z1thIQ04Dw+NTTTrT4hQhys7EJI+Bj6TkD5h6jH2AQZ2 n7ZDHGE9GRD2tM5fmrfE88kYlQ/gYaqfQ5Pq/O8cTYEx6Cv6/g4CU4wihdUkwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685954172; 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=nNvJQBGlmRU2rKeF6UugbxPPURnV+GyVgzwO3arF9h0=; b=rr0rRU2JuRhsaY3EMBmZUziVunQ3BWAbcm7xddfCGPuRi8L0dFMlhMlzVgRsROEkcdHZaE KvmiHLCM5kVgYSV2m7mxmtY0yr4SQbYDUJRDKT/nhYqajiiGr7Z9hPeepuWpMiuu9ib+eh fhLK73svEuRaFkuRbZMNMYCrktI0igYoMJIpmNG58uuaQ4pbjOtqprDKlr14y4Au3zrw2m mlMC1GQWkJzCLa3p9im7ccuJHhsa/axy8ya1gIhO1FvUGLGMW8vcHj5JGX2CChOiZP2naN bRPQaoKVd5T9p2spIlqENOPaPnfN1b5dgLDc2KCJWOZ+1hkd7qpl0kY5us31Kg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685954172; a=rsa-sha256; cv=none; b=cM7aHZ2ivXI0eCbc1WbikbVakGe37koD7f33nv/ArgWO+OOSgfmJp9qeEW0anp70Wzuvw7 +eGqQqMXUQynOLjhp3bFClqNzsmAXqez3hOZtlBEgV73lw7Ym7wqg12xwP3mZvrQ41v80U EPdeo8NbDSHT5QcTGGOGFdGjPYmpKPcNuzQuRi94pve457PTJX4i/tioOWpdkQ5TPpXsD7 oJ31UwA8j7XOiB8fiGFjPcTSNfeA8Jav2K/aT+pIk+VL5f/bopzfip6ysEDZts8tuq2h+w Cky9K9R6n+Nwy96Nd8/hgkWoSA3HG7VxUF43xsmjWohSyqyHXx0z/vwMBUfl0g== 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 4QZRlb68zLzgMQ; Mon, 5 Jun 2023 08:36:11 +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 3558aBTk024542; Mon, 5 Jun 2023 08:36:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3558aB6n024541; Mon, 5 Jun 2023 08:36:11 GMT (envelope-from git) Date: Mon, 5 Jun 2023 08:36:11 GMT Message-Id: <202306050836.3558aB6n024541@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: bb75966eaa31 - stable/13 - reapkill: handle possible pid reuse after the pid was recorded as signalled List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: bb75966eaa3125aa22884663768068a173cda408 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=bb75966eaa3125aa22884663768068a173cda408 commit bb75966eaa3125aa22884663768068a173cda408 Author: Konstantin Belousov AuthorDate: 2023-05-12 22:36:52 +0000 Commit: Konstantin Belousov CommitDate: 2023-06-05 08:35:01 +0000 reapkill: handle possible pid reuse after the pid was recorded as signalled (cherry picked from commit 8164032a495b53b9176814f7b08e093961fabdca) --- sys/kern/kern_procctl.c | 36 +++++++++++++++++++++++++++++++++++- sys/sys/proc.h | 1 + 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/sys/kern/kern_procctl.c b/sys/kern/kern_procctl.c index a4f675c2938e..16bd9ac702e8 100644 --- a/sys/kern/kern_procctl.c +++ b/sys/kern/kern_procctl.c @@ -416,8 +416,22 @@ reap_kill_subtree_once(struct thread *td, struct proc *p, struct proc *reaper, continue; if ((p2->p_treeflag & P_TREE_REAPER) != 0) reap_kill_sched(&tracker, p2); - if (alloc_unr_specific(pids, p2->p_pid) != p2->p_pid) + + /* + * Handle possible pid reuse. If we recorded + * p2 as killed but its p_flag2 does not + * confirm it, that means that the process + * terminated and its id was reused by other + * process in the reaper subtree. + * + * Unlocked read of p2->p_flag2 is fine, it is + * our thread that set the tested flag. + */ + if (alloc_unr_specific(pids, p2->p_pid) != p2->p_pid && + (atomic_load_int(&p2->p_flag2) & + (P2_REAPKILLED | P2_WEXIT)) != 0) continue; + if (p2 == td->td_proc) { if ((p2->p_flag & P_HADTHREADS) != 0 && (p2->p_flag2 & P2_WEXIT) == 0) { @@ -428,6 +442,11 @@ reap_kill_subtree_once(struct thread *td, struct proc *p, struct proc *reaper, st = false; } PROC_LOCK(p2); + /* + * sapblk ensures that only one thread + * in the system sets this flag. + */ + p2->p_flag2 |= P2_REAPKILLED; if (st) r = thread_single(p2, SINGLE_NO_EXIT); (void)pksignal(p2, w->rk->rk_sig, w->ksi); @@ -445,6 +464,7 @@ reap_kill_subtree_once(struct thread *td, struct proc *p, struct proc *reaper, PROC_LOCK(p2); if ((p2->p_flag2 & P2_WEXIT) == 0) { _PHOLD_LITE(p2); + p2->p_flag2 |= P2_REAPKILLED; PROC_UNLOCK(p2); w->target = p2; taskqueue_enqueue(taskqueue_thread, @@ -471,6 +491,9 @@ reap_kill_subtree(struct thread *td, struct proc *p, struct proc *reaper, struct reap_kill_proc_work *w) { struct unrhdr pids; + void *ihandle; + struct proc *p2; + int pid; /* * pids records processes which were already signalled, to @@ -486,6 +509,17 @@ reap_kill_subtree(struct thread *td, struct proc *p, struct proc *reaper, PROC_UNLOCK(td->td_proc); while (reap_kill_subtree_once(td, p, reaper, &pids, w)) ; + + ihandle = create_iter_unr(&pids); + while ((pid = next_iter_unr(ihandle)) != -1) { + p2 = pfind(pid); + if (p2 != NULL) { + p2->p_flag2 &= ~P2_REAPKILLED; + PROC_UNLOCK(p2); + } + } + free_iter_unr(ihandle); + out: clean_unrhdr(&pids); clear_unrhdr(&pids); diff --git a/sys/sys/proc.h b/sys/sys/proc.h index 0f04921fffe6..997ff110bcdc 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -836,6 +836,7 @@ struct proc { #define P2_WEXIT 0x00040000 /* exit just started, no external thread_single() is permitted */ +#define P2_REAPKILLED 0x00080000 /* Flags protected by proctree_lock, kept in p_treeflags. */ #define P_TREE_ORPHANED 0x00000001 /* Reparented, on orphan list */ From nobody Mon Jun 5 08:36:12 2023 X-Original-To: dev-commits-src-branches@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 4QZRld1TRQz4bM2B; Mon, 5 Jun 2023 08:36:13 +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 4QZRld0rnRz3xXv; Mon, 5 Jun 2023 08:36:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685954173; 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=I0HmjvV7L2VOlJHsliSbAkxIDqjHw9g1oo9n6sIUZEE=; b=FBJ8sGy4x50789a/wdeZ/UfrnwlQ5S4QeCiR6vp3KfXRP/PCuHOWyoga4bKAIEvyZdVkmz fLK16R4Tg4k5oqbPf8hQ9AsGUlv5uN2XmCAIBTiVhti/w+byPta/g/UWbreMNHo7P/7HCP pgmFhcgYklH4Egu1MUNhfc3bBChi7a2Xu0wsD8zLM8aERCczCrVr1U4tYcaE84Jjyk3x+9 6KhQksDPJ/HI6AryjEZPEqe++RF+js1E48TdxMLnug9sU2DGqtMEChwLbjTlIzJP2J6Xta 1H6EgVeEJVfpdMRIEivg9c0qMayNyIYmPkglY0Hv4npVurLPoBliSR5WyT4vEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685954173; 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=I0HmjvV7L2VOlJHsliSbAkxIDqjHw9g1oo9n6sIUZEE=; b=TSpyL6GLuqqnSi9JywCG540ZnmMxF3s1zjU09nJmlF88yGWolHnsG7ahG9vIgTZfKZjtXS 9+N9dAjCZMU/8YpcrPnkouijVa2OtB+mu5H+88V9Tk3qQ4Rof0BeyJZjAKaLbUfN7S/LPT ZfYoV4nA9josq/WURtmBvrvX+ySVR4VZvifIGjf+G37tFRXXFv0ZkqeIQHju8fPsuEqb4y 0LRHqQ/uo/BmEIACFD/RE3iC+TF7EiOjhrZKk5S9GLm1JIf4v2+1lNPm96WDSjxJa6Z7KW KMjKRUxYqFi6tmZHFm+JT9pJRjKeen1Aw+goYVoKA3iUMSs44PLvW6Y/zYD90g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685954173; a=rsa-sha256; cv=none; b=vUbKxTO5SZQclBiHNI3ZgXK0cB/HlPaMfnpXtWAgbJa20iGNKN++XYwFg2x47uKLVhokej X3EAlwTqftCM0sCHx6AlhNh+SoRl3dtgSS9NEk5g1W4vXV1srXBBvqMFRSPqpXl1xjChsW D73ptwutNdqeIWCRiYY0eBg0CvBuPKQSOyY2s3/zC/G5lJFxiMDIqM3/9lfJ3h4zQN4dJJ xlAv1ocMLZ/r6l1abh92Y6tRtbpvTyNKejmcTIki5ZhFJEPeR6GLTyNlzZjIXE/wNPSDVP 2jBXFAjHl/ZuFuGvqTcfsVDmUUjj2Cedr6ApTG5mY/6SfvLl11pitCGol9l4jg== 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 4QZRlc74GnzgPv; Mon, 5 Jun 2023 08:36:12 +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 3558aCvk024569; Mon, 5 Jun 2023 08:36:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3558aCFg024568; Mon, 5 Jun 2023 08:36:12 GMT (envelope-from git) Date: Mon, 5 Jun 2023 08:36:12 GMT Message-Id: <202306050836.3558aCFg024568@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 1e26f443cd2b - stable/13 - __acl_get_fd(2), __acl_aclcheck_fd(2): enable for O_PATH filedescriptors List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1e26f443cd2b8775ba50207aa9645ec12ead9e8a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=1e26f443cd2b8775ba50207aa9645ec12ead9e8a commit 1e26f443cd2b8775ba50207aa9645ec12ead9e8a Author: Konstantin Belousov AuthorDate: 2023-05-29 15:07:18 +0000 Commit: Konstantin Belousov CommitDate: 2023-06-05 08:35:01 +0000 __acl_get_fd(2), __acl_aclcheck_fd(2): enable for O_PATH filedescriptors PR: 271704 (cherry picked from commit 7a292504bad8467915f072f0576b2a07c76de1f5) --- lib/libc/sys/open.2 | 3 ++- sys/kern/vfs_acl.c | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/libc/sys/open.2 b/lib/libc/sys/open.2 index 876a4ce1e57d..db3e8f373ad7 100644 --- a/lib/libc/sys/open.2 +++ b/lib/libc/sys/open.2 @@ -28,7 +28,7 @@ .\" @(#)open.2 8.2 (Berkeley) 11/16/93 .\" $FreeBSD$ .\" -.Dd April 22, 2022 +.Dd May 29, 2023 .Dt OPEN 2 .Os .Sh NAME @@ -344,6 +344,7 @@ message using for .Dv EVFILT_VNODE .It Xr readlinkat 2 +.It Xr __acl_get_fd 2 , Xr __alc_aclcheck_fd 2 .El But operations like .Xr read 2 , diff --git a/sys/kern/vfs_acl.c b/sys/kern/vfs_acl.c index 596a26f8acea..dff1d9368f40 100644 --- a/sys/kern/vfs_acl.c +++ b/sys/kern/vfs_acl.c @@ -434,7 +434,7 @@ sys___acl_get_fd(struct thread *td, struct __acl_get_fd_args *uap) int error; AUDIT_ARG_FD(uap->filedes); - error = getvnode(td, uap->filedes, + error = getvnode_path(td, uap->filedes, cap_rights_init_one(&rights, CAP_ACL_GET), &fp); if (error == 0) { error = vacl_get_acl(td, fp->f_vnode, uap->type, uap->aclp); @@ -567,7 +567,7 @@ sys___acl_aclcheck_fd(struct thread *td, struct __acl_aclcheck_fd_args *uap) int error; AUDIT_ARG_FD(uap->filedes); - error = getvnode(td, uap->filedes, + error = getvnode_path(td, uap->filedes, cap_rights_init_one(&rights, CAP_ACL_CHECK), &fp); if (error == 0) { error = vacl_aclcheck(td, fp->f_vnode, uap->type, uap->aclp); From nobody Mon Jun 5 08:36:13 2023 X-Original-To: dev-commits-src-branches@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 4QZRlf2VR5z4bM6j; Mon, 5 Jun 2023 08:36:14 +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 4QZRlf1Qhvz3xX3; Mon, 5 Jun 2023 08:36:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685954174; 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=CKVxEFbBgbG5P+yFgGME+02JVkQLzQgUeO29qVDsrqQ=; b=vpp42IWhdA5XHzl1HWwWwpmZJKBoM7B48kKPIdqEMSRb99PJZBE3KiPKI+2PHPX/H75mWB SYQqhTDt4iXToSQoAkoxRUob3b84A/DsHTKxhlfTIPRWQslY3QvY/hLm8sfKKr/EVrtKRS 1vXq/Nn4SRqXdf2JdjniZAtFN/NottL4214Yw8s/GPPBDByYcpvA4tJvZtjNNH6rbNuWEg x6B02nlj9ZrpofKF5TtaWDV0Vms7clXfBzOQCaXTAyxRelurX25mCjQr2zzZiDLIY36Xg/ 65U5/PgvEHCm6fjhVhe0rL+mMCuhCVYaAnqwRg0u9vac4XzgPfJEcqb2k+opBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685954174; 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=CKVxEFbBgbG5P+yFgGME+02JVkQLzQgUeO29qVDsrqQ=; b=Tp68ll9pRN/xfzgBDYIICw0YADU6r8ELq3JjMIsInUXTUUjvE8rkLOe1UIlyFURyISQNC1 wQsA0rTXhnWhu9u8KHQLlpb3uORd8nEP1OG07vpUucrdGX7kYlOUk2hmbaEx4556rbl4Pr FNPOHnRQ/mH4YGUnxfO+tA4kSi7yzwue91Y0I/RRnJqijdJ5qDErHjA2TB0y8k/4mqRp9S MR/+/53ZmERdMpO7t9ogPiJ8Shw6sWaVUOsKTy4XHiBoxDnKzVDH1l62NY4t+u5N341bYR QYb9r6Pgrn1navsyOdM70iAQnkR6wSA9dpXb5yzjTRRFuBBQxexSzuoR04eEvA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685954174; a=rsa-sha256; cv=none; b=iPWAZKWITMQqtWHjUv9u368T9ptHD1h+DoiA9qsdV4q7lMmgVz6fQhv+bf409j5O0iM3N4 Rb4FXHuU6Ka68EaY0ZwEdF5w6dUT4c6WPSeMIPE9dPuKDCnuXQ37SWb1B146jTrUTbHFbb KvHPpUym6ra5Ln4Hy81vHRVVgGKGCPerFtOdR95K1rR4NLduw6nOGwbczu0GKaOB6EL1oO Tui5RS5Spt/wNw7/UHJas9OiaQXiYYUgByriAmWYVAml5zXS0GzCEWa0t2XnqPC5nwHGGV dX/L71GibpyyzcZFCwIM6zbNf1tz6Dy6DK9ux4u+4QnE4LQhKWm/jOJdElrE8w== 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 4QZRlf0VGSzgdt; Mon, 5 Jun 2023 08:36:14 +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 3558aD9w024591; Mon, 5 Jun 2023 08:36:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3558aDX2024590; Mon, 5 Jun 2023 08:36:13 GMT (envelope-from git) Date: Mon, 5 Jun 2023 08:36:13 GMT Message-Id: <202306050836.3558aDX2024590@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: e99631746701 - stable/13 - open(2): fix typo List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e99631746701ffb81b6d090a4217349d3bf86faa Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e99631746701ffb81b6d090a4217349d3bf86faa commit e99631746701ffb81b6d090a4217349d3bf86faa Author: Konstantin Belousov AuthorDate: 2023-05-30 09:17:26 +0000 Commit: Konstantin Belousov CommitDate: 2023-06-05 08:35:02 +0000 open(2): fix typo (cherry picked from commit 1fc174cba6e0b949f7499d195dc36bf8df15df4f) --- lib/libc/sys/open.2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libc/sys/open.2 b/lib/libc/sys/open.2 index db3e8f373ad7..ae66797c558e 100644 --- a/lib/libc/sys/open.2 +++ b/lib/libc/sys/open.2 @@ -344,7 +344,7 @@ message using for .Dv EVFILT_VNODE .It Xr readlinkat 2 -.It Xr __acl_get_fd 2 , Xr __alc_aclcheck_fd 2 +.It Xr __acl_get_fd 2 , Xr __acl_aclcheck_fd 2 .El But operations like .Xr read 2 , From nobody Mon Jun 5 10:57:59 2023 X-Original-To: dev-commits-src-branches@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 4QZVvC5rHGz4ZbR4; Mon, 5 Jun 2023 10:57:59 +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 4QZVvC5M9Nz4YPs; Mon, 5 Jun 2023 10:57:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685962679; 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=X9QfWoTybqDf7bl0bC6aNtF5JFolTZIIk4gZFFeGuCk=; b=nZXJaxp+VHahhTvbURRa3WVGik9/DICK4krS7cYGgHsnpMVWvDSXNX+/ZwOG1yS900jMwx JmAbnmY3hwKyCysHXaCZLbWiattpkwzGiYzGvdKwcA6VVjV8PLNHSHs7rrYsNJPE0ALo2J WaaWlrsrjowZE47g5ffPgcp1QFBOEtCy8XEsbK4dZbnL5QhcdFXu9BgTSKecPArLRrTQQF pEVVIKytOWJdG71W4hCeAyyp525XtrPydXOPl6KBJdiGGN/LE6eqtU18mA/0UTkUw6RY1N xin4vQkFxEb2GLUtdNn0lq+vF8SJgibuJ+9QrMzgGIE0Ztie0VMIqtaHBHAsUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685962679; 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=X9QfWoTybqDf7bl0bC6aNtF5JFolTZIIk4gZFFeGuCk=; b=rB0cooSK+BGT0cvu5iNVIcO2Zmp6K7eLa8ILNbv0p4eZvsN3xhQevJelmHjtDFYWMNn8ty g5g4KjOBsljItYnQ/VaRM9agRV2v5ocad+uD3Vu4SmbN3eCZ3soFo2YDZUkj6GXL9gCoFX pdfrZeL1u7pW049zOt3kHXLhvkQU7eishuuQsWFJrLLzELfxjYih87WQrUaW5Mm3xJSrBJ zkAVay8Sw1mmuRGeEDx13P70EL/er6Cl51hAGr518/wy838/NY21SFoYRGCGjPkXykuA6d 9UmiqcnQtf7ci3tYOG21tomuY0yqQwIuR7Ost+zUZCkRDUxDRY/mgyTOXjXdFA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685962679; a=rsa-sha256; cv=none; b=SkFlBGjzDfLyAJK22+qoZZrKwH/IYIb2PTpd970GhY3RBIQKmsZD1t3JY1fWSPVJNEoCf6 W/Xmj3l+XAsEGhvbc62ejauy/3JwzStMnceZ0hzY26IYalUajdyEQ/JZsUlzzfORvusTeL +wyl2QepSfOgTOf+ax8thzGud4esQ1ccD692jlAzDCgt9GAwlLWZba8+OwacPHtJU15ViY om/mV8bguzHVauPyU8zJXXgqtANbBJQwb8wX7eYGIUb842bA+UEzydYQEc2bEAVqzOQQy0 mPhzHbOcpu8DkfRaAQVWwuWrbW0IxVJvb0TujV8/RKNY2MbVyNP/1MGeiO9oFA== 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 4QZVvC4JXmzl6G; Mon, 5 Jun 2023 10:57:59 +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 355AvxqZ055519; Mon, 5 Jun 2023 10:57:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 355AvxXc055518; Mon, 5 Jun 2023 10:57:59 GMT (envelope-from git) Date: Mon, 5 Jun 2023 10:57:59 GMT Message-Id: <202306051057.355AvxXc055518@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 6180303a79bc - stable/13 - cd9660.5: Fix the history section List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6180303a79bca73597db695ba6a3980049618406 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=6180303a79bca73597db695ba6a3980049618406 commit 6180303a79bca73597db695ba6a3980049618406 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2023-04-25 17:36:34 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2023-06-05 10:57:13 +0000 cd9660.5: Fix the history section MFC after: 7 days Sponsored by: Klara Inc. (cherry picked from commit 5212225753e965c87ae4a7fe5f8a7d9a8b6d04af) --- share/man/man5/cd9660.5 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/man/man5/cd9660.5 b/share/man/man5/cd9660.5 index 54f26738bc4f..48b14e4cbc42 100644 --- a/share/man/man5/cd9660.5 +++ b/share/man/man5/cd9660.5 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 8, 2022 +.Dd April 25, 2023 .Dt CD9660 5 .Os .Sh NAME @@ -69,7 +69,7 @@ volume located on The .Nm driver first appeared in -.Fx 4.4 Lite +.Bx 4.4 Lite . .Sh AUTHORS .An -nosplit The From nobody Mon Jun 5 10:58:00 2023 X-Original-To: dev-commits-src-branches@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 4QZVvD5wrNz4ZbNy; Mon, 5 Jun 2023 10:58:00 +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 4QZVvD5TR2z4YL1; Mon, 5 Jun 2023 10:58:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685962680; 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=oqeeSDbGWF9ZTbrJQCJRamyhB7UuzmSNGz6460yj19k=; b=cQrsdeEJOtOzB08sr6YZCXYjEZG67Jw4pg0O5O4Izwh+yGK1exgrIQMgn7OCWM4WgOhVeZ orXbEOG4sYJOkVaTbc5zIPAt6olit/RFSd/+sKm8qRU+NDBVsWhVldTC+u/NqrwucX8s9w IW3dXN9EEF89YaPPzaiIObAnCMLmQH/rZNtXSUNNP4v0HIMwx9inw/9ZTahenqaLPfwfYg 3g+9ACLpjkveNf34QcYOVyfXyVgs5UMcxsr8GaHdO0E2FgxbcnZLdXqKlGhv6zlDPej43U ESu3sS0irxgngEfdfCKQyLYFfEg2O7syE6IU6NIwL2vAJBGIG2ZsPQaKgPdJMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685962680; 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=oqeeSDbGWF9ZTbrJQCJRamyhB7UuzmSNGz6460yj19k=; b=uYCFXOM166D/jFyKYlbXKcNl1GPVVxkKrPN/4fXPIsK77fzoOPqOmYo/3t8FLUkY+ys60V EqlxIa7ETuLR0bfYmlOYA0HQae32cbBd88tvmfEboDemKpo0WrP/SCSxnF70kOG+aS9IEs Kob3f92V8qULeF4ivMcBqfiQNJCPUIrl5T3SQ207/1niYIqAbkDzg8OYcM8ilbjZjcwYHQ pX2OzN2PuKPPUOu2OA8M9h1fg2kPpE30Ty0tQ+CrRp5X30Fv7EozrEgmEUQgNTV8G1P32X OreC0/iALDO/e2/KSr24JrSzdJk4iV+RVjVqVIrDTilJTGCbS2gpmhvPLdI4gA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685962680; a=rsa-sha256; cv=none; b=dUAeEuargbR4hUP/P55QjIS2k5TGwwnGwrIK8ibd5PzcW1K3RM+x3AxGXFhyUpao2ss3au sByFlNIlklodkLs+TqyNGnswIWFCGkcPgIyZuGizuCJlwZLjCb048UAIQYNIAxFE2Bf9w8 mVnFpmIJZlflSmlsRLfwtqujfPx47H+1B4koHTLAubXTaOdmsa4doD2BgUePL8JyObpKHK jFZ33O2SZgwsHYtfFNIaX0Fiq7xixA2gMLwiIwcnpDIoZFGFwr2Ym88ayPXiZdzJeYS9Fo vpTF4ibTswR7tHeuEppuQ1FKN9WNCH5Snit6wTgfo6EbCT2QpFHCeL39xKqKqA== 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 4QZVvD4ZW7zlQ9; Mon, 5 Jun 2023 10:58:00 +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 355Aw0DF055540; Mon, 5 Jun 2023 10:58:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 355Aw0vh055539; Mon, 5 Jun 2023 10:58:00 GMT (envelope-from git) Date: Mon, 5 Jun 2023 10:58:00 GMT Message-Id: <202306051058.355Aw0vh055539@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 19677c0da80f - stable/13 - ps: Fix synopsis List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 19677c0da80fe687e438489f7074ca1670c83952 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=19677c0da80fe687e438489f7074ca1670c83952 commit 19677c0da80fe687e438489f7074ca1670c83952 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2023-04-25 11:38:10 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2023-06-05 10:57:13 +0000 ps: Fix synopsis In the -L mode, the -L flag is not optional. MFC after: 3 days Sponsored by: Klara Inc. (cherry picked from commit 3f46bf40a1b26c49b53df4ec504757c5d8c9f921) --- bin/ps/ps.1 | 4 ++-- bin/ps/ps.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/ps/ps.1 b/bin/ps/ps.1 index 25373adb7d73..bc760c174c11 100644 --- a/bin/ps/ps.1 +++ b/bin/ps/ps.1 @@ -29,7 +29,7 @@ .\" @(#)ps.1 8.3 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd June 27, 2020 +.Dd April 25, 2023 .Dt PS 1 .Os .Sh NAME @@ -49,7 +49,7 @@ .Op Fl U Ar user Ns Op , Ns Ar user Ns Ar ... .Nm .Op Fl -libxo -.Op Fl L +.Fl L .Sh DESCRIPTION The .Nm diff --git a/bin/ps/ps.c b/bin/ps/ps.c index 0c656d8a1544..141b57cfd683 100644 --- a/bin/ps/ps.c +++ b/bin/ps/ps.c @@ -1463,6 +1463,6 @@ usage(void) "usage: ps " SINGLE_OPTS " [-O fmt | -o fmt] [-G gid[,gid...]]", " [-J jid[,jid...]] [-M core] [-N system]", " [-p pid[,pid...]] [-t tty[,tty...]] [-U user[,user...]]", - " ps [-L]"); + " ps -L"); exit(1); } From nobody Mon Jun 5 10:58:01 2023 X-Original-To: dev-commits-src-branches@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 4QZVvG1lj6z4ZbR9; Mon, 5 Jun 2023 10:58:02 +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 4QZVvF6NBtz4YVv; Mon, 5 Jun 2023 10:58:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685962681; 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=22QlV7XaVH/PjU1Vkpg6DdKj6MosBJd71Qp44rrGmTU=; b=gXht+J6d+OIbRKFjeciyr+Je4kG4mRKyqadzIlTXV10R0H67Ng1amJbHZo7W6lX/08dzJ/ MgeC7T79WGtMW2Y4fpqu8A4JM0JxzPCX2TOh7dYxn75BAvgrIbZS46nkyxqcvQxFi5jV/p Pkw7MQksaHnGsxAXyYeYzC9WiKrkaXOIcPxzCkkBIjEyhM66uZEK6/JqhvqT3kF1kukJ0D T2ScrE9kl8NA67IquFAfEQZcZYkuFnN9264DegKyLZpT4HNRvCT6DThiludpJCGFURLjCy 9Z874d7G+uIXEgrWfxsgiY13hrV1BCCsQZdGYKkhrcNn8wz4VMmhQBUkR58gfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685962681; 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=22QlV7XaVH/PjU1Vkpg6DdKj6MosBJd71Qp44rrGmTU=; b=f5ToNwLoC2rxoUaF5Jvf5Vdy7tqTijNndB3S274bX4gnOcgA6XhIObBHT8h9G72H8DCbgk E0Ir1mtc++EqY16xE1xOTWLPFuGhevqTwtOaqMpxZNBWN3Mn22eIcFFDlBw2lk1EpiNRV8 rqjdYZoVvscc7YYuy1+RloJ913ywvlOkss4d4/9cixtd6aHszmQo0OBBMymFQoyLc+Mu1f wAZS5ht3b8NPRVWkCU4g1sqVg62n6PzSEc9wiFsMEHm7vEn9ynP+zC5TGXWglcobbC/Xv4 1AR4+0XPa7/YG4vzOGUCtEDiE9ttlbIxv68Zt3gXP0TyjdM9kW3OiWmkdT9sYw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685962681; a=rsa-sha256; cv=none; b=iSwKfky+cZWrZk8ejLDVokfAreDa1rSW4LZRSQtUdv1okWD3wkI5VutkxbB3bq3UXDbxNS RC6lGhxfHL3cxuWQGBilUPPA++d5T80GOVlz0+wgwq6kqlKUDHHIoSMXFrrf72FpmUmE9e GIZj6PSN4O5Cc71gulsF2JW2VUeVcbufOZ1QJn48VVDJdzv7OzVTfoMnV1z3L2tFgYjoVF MZq/rKQSpsQ5CbicTE5nHbpgFCU/H1G36eXqlZ3GfMRyjlepczl+Ao4h0CI7AM8J/daV0X kWhkmlCyNegQXbzLLxi+6CoPLvExQQz6/fyfamAIDRzSKFWrErEB+j23mfgmHw== 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 4QZVvF5V42zkc2; Mon, 5 Jun 2023 10:58:01 +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 355Aw1Uk055559; Mon, 5 Jun 2023 10:58:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 355Aw1sf055558; Mon, 5 Jun 2023 10:58:01 GMT (envelope-from git) Date: Mon, 5 Jun 2023 10:58:01 GMT Message-Id: <202306051058.355Aw1sf055558@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: e06bc4821edd - stable/13 - ps: Add libxo to usage message List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e06bc4821edd7d4d69bd27b7d40ef30aa7c2f234 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=e06bc4821edd7d4d69bd27b7d40ef30aa7c2f234 commit e06bc4821edd7d4d69bd27b7d40ef30aa7c2f234 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2023-04-25 11:55:17 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2023-06-05 10:57:13 +0000 ps: Add libxo to usage message MFC after: 1 week Sponsored by: Klara Inc. (cherry picked from commit 820ac126795b8b1c55009676fad3dfe5c7834b0b) --- bin/ps/ps.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/ps/ps.c b/bin/ps/ps.c index 141b57cfd683..b4b1c5c01730 100644 --- a/bin/ps/ps.c +++ b/bin/ps/ps.c @@ -1460,9 +1460,9 @@ usage(void) #define SINGLE_OPTS "[-aCcde" OPT_LAZY_f "HhjlmrSTuvwXxZ]" (void)xo_error("%s\n%s\n%s\n%s\n", - "usage: ps " SINGLE_OPTS " [-O fmt | -o fmt] [-G gid[,gid...]]", - " [-J jid[,jid...]] [-M core] [-N system]", + "usage: ps [--libxo] " SINGLE_OPTS " [-O fmt | -o fmt]", + " [-G gid[,gid...]] [-J jid[,jid...]] [-M core] [-N system]", " [-p pid[,pid...]] [-t tty[,tty...]] [-U user[,user...]]", - " ps -L"); + " ps [--libxo] -L"); exit(1); } From nobody Mon Jun 5 10:58:02 2023 X-Original-To: dev-commits-src-branches@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 4QZVvH0b8Gz4ZbSn; Mon, 5 Jun 2023 10:58:03 +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 4QZVvH08Mzz4YTV; Mon, 5 Jun 2023 10:58:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685962683; 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=VFEBospWcZtCsLhd4CmYV96JRgQzr4zdUFQgU1iBSuU=; b=lzgoO0hbvvjFXiLTcfsq0aY/8wuTWSx7LCyGyfIzLxHi5PPsv4vzWD+527CW/3MIJ83jc/ anGnPntZUCEjEJcgj01Y+Gq0hibZ3fE4LTTAv/raotDG10UmRptHiMH4qk2BpUGc3OVxiT jLTh95unK7CGG8nj7QSWplHAjZwNBH5q6BIiAulO/E4IvN1BLEwCCmDfIcqLhzxv7guXoj iV1bKp9UqGnFfTDTgqnI3ttXe6vaH5QQ4PoAFTOgkc8NUxY1T57lwlnPV9bKGjBk6FK1nR hOGJE1MnMOTA7p5jhPsP+HW1cgzmFqbmdaC1Za92OmsGHj5qxYb/0XVUkcfncQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685962683; 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=VFEBospWcZtCsLhd4CmYV96JRgQzr4zdUFQgU1iBSuU=; b=EHyiSLsNYpFYG2CtAjTpkh2WyZS7hvnMMXqcfJsrU9w/DhWOWZRUOs7YmjiQYpuw1oWPdt vrfhtzL/nTnNNX9GqVY9ftDLEcgXWZl4iio2kgx5GBeh6jHjev3/aFZUILQ6mO1CIz6YDG iuIZOCuFOfXAzrypqYafd7woqfTWJnUeAQe5OQtV4Bw2XlIEzZ8kQe9qMMPXCctPv6B+xJ V1/QkWTgbA9jj1YWbi+VCLqEatO9xY0axSJ5tXRhwuWGkH9KGGAWZpVaJm9DQkduKBBOvY q2XA8H8YLdFznIP/5oOvEStqbypK1hDR9O/AWLhA+Dizhfyw/emKopJuGjA4Pw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685962683; a=rsa-sha256; cv=none; b=nt1Lq2qLRxXc0aEG6ntB4krOdbofw8t9XZHcim3fZik2sNqZjd1C99DsX1E6oxUjXvASRO T/RAnugN/nu8v2Yvkmdl704bTWgMeVxIfp3K3Ue+VCK8t40oV9xTBTdZ5Zfm34oc8tMS+J 0kzGdEp7I+/RqVRwV4Qj02JlMbkd8WhHgAAk2jz0XtwGU1zH5UCsKVg3bbznKzHyCmJGsL DWxl7gowNmGwmIwMsBNxtaX6M5axm/HK5IU9hNsIH2APCE54hoZI0hTudmmskqnTk+KdFm m4NYxj68RlIXsOrBIyyHpBttWGBe6yv+b4kw37t/vNMUYcRL/j5dhHgsGoeW/g== 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 4QZVvG6MvwzknZ; Mon, 5 Jun 2023 10:58:02 +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 355Aw2qR055578; Mon, 5 Jun 2023 10:58:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 355Aw2rR055577; Mon, 5 Jun 2023 10:58:02 GMT (envelope-from git) Date: Mon, 5 Jun 2023 10:58:02 GMT Message-Id: <202306051058.355Aw2rR055577@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 412394a79096 - stable/13 - nproc.1: Fix "first appeared in" details List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 412394a79096b989d0f6bdfb3213e3f8e5105f7a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=412394a79096b989d0f6bdfb3213e3f8e5105f7a commit 412394a79096b989d0f6bdfb3213e3f8e5105f7a Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2023-06-02 16:49:36 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2023-06-05 10:57:17 +0000 nproc.1: Fix "first appeared in" details nproc(1) has been MFC'ed into 13-STABLE and made it into 13.2-RELEASE. MFC after: 3 days (cherry picked from commit 1e078fb6021ebb5ccfb092fe9e5befcf4054ac0b) --- bin/nproc/nproc.1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/nproc/nproc.1 b/bin/nproc/nproc.1 index d4d97ccbb5be..b693ded79a39 100644 --- a/bin/nproc/nproc.1 +++ b/bin/nproc/nproc.1 @@ -3,7 +3,7 @@ .\" .\" * SPDX-License-Identifier: BSD-2-Clause .\" -.Dd February 15, 2023 +.Dd June 2, 2023 .Dt NPROC 1 .Os .Sh NAME @@ -50,7 +50,7 @@ On FreeBSD only active threads will be reported. The .Nm utility first appeared in -.Fx 14.0 . +.Fx 13.2 . .Sh AUTHORS .An -nosplit .An Mateusz Guzik Aq Mt mjg@FreeBSD.org From nobody Mon Jun 5 14:30:05 2023 X-Original-To: dev-commits-src-branches@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 4QZbbx57pxz4bHgr; Mon, 5 Jun 2023 14:30:05 +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 4QZbbx4ggVz42K4; Mon, 5 Jun 2023 14:30:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685975405; 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=1+gsv8Pt9jXsQP4dG7F+KWJ0zX+oQxE8/sVRTCnV0XA=; b=d/XUAXSu5BCw2JuSraU7QVr4eHAyua8pu/cPbNJYOFSq8fSwzfHjXDuBMwjZR5SzK5zo5G FtVWYB1dROdiXdHAhaP/jEwjTVgU5WenFoEN/AT0sMHAMsJv2iyVbQa9U3AnnBS34ezZGl ftKnOfsgXzNZKsGhvnfcTlS4l4ppet5ZSTkEJ8WvnyL6WWpTJiaz+3uA0fNiCZ/SE4Mgy4 XRac6vE+wm6r8wrlpaYVBdOIYfDEoyBfqrJwjGn3EeKjDi3lKmw2oDtBBDkr0Q5LuKDmhc 2YaJPsEn/MnLkjdJHnI3yuhF+0wB2V1p+VffaW9EwlS6H6Vg/9EkfUIvu22lSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685975405; 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=1+gsv8Pt9jXsQP4dG7F+KWJ0zX+oQxE8/sVRTCnV0XA=; b=KFyAQBM4pVIgYpDZYkg2rz0qrgbeMATtbBM+lNBHW2n9UR1CGxuHfAObZsbb4TckHM0Xl+ SvLYvWoWYWjMakau1xc/j5RqGXE51gdjI2bcYZUX5YQoxoGX6EDTUVrNZDhUR6eD7xtpwR +S4ksWka2dq368RUz77+zsyedQqrwzUkNRF6vDazMUtK/AKnVDqoXBNEPG37DP+YFN6Ix7 WzPfDbwGxoNTXuPYfcqzhYYf+/+ALtGfaliST6SK/8hPz0jdYMpwPrhUjRiNnQfb9athYP U0kMEg9AHWyDg9lFhFd3FK6LbQ0MWD/3UJKb5frZKmhnRNWbAntLICvLaLaXFQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685975405; a=rsa-sha256; cv=none; b=Uowh/zUnSxF1B7H/ecfuKBVMnHB7oC5yA4ykXFpLV7yrv6zfOK3O5Z9reH8nUbDVRn2ZYz SsEkODbljqEQ/8Bk+AsplPxQPPc5YmjJlb7SH9HQYAKGliDVUiYIjTVyfVirbrkJlGoyz5 ZYvUnMpT9MK0hqxJ1RquE5EktapiGhLM1nM8fm3dKf4Lfwp/+lLL3spm8IZ5ZQRxuskh0E Sq/ZAMBHH/TN4uB9uZUL8t1jLyDZIN5CvvU5LXlbxVtMXARNDxr/NWwTeEXYVZSR0jFYZU 1XtEewEasD3+l5BZgvKs7EM5sNSbkIj24w7EfIJpDWQ+VhCCx+/yuGjfopyp9g== 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 4QZbbx3kVMzrWW; Mon, 5 Jun 2023 14:30:05 +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 355EU51S004735; Mon, 5 Jun 2023 14:30:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 355EU5qf004731; Mon, 5 Jun 2023 14:30:05 GMT (envelope-from git) Date: Mon, 5 Jun 2023 14:30:05 GMT Message-Id: <202306051430.355EU5qf004731@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: c2144c3766ba - stable/13 - Cirrus-CI: add gcc12 automatic task on primary GitHub mirror List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c2144c3766baa70f49ba0ba76ac54b9ef0fcdad7 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=c2144c3766baa70f49ba0ba76ac54b9ef0fcdad7 commit c2144c3766baa70f49ba0ba76ac54b9ef0fcdad7 Author: Ed Maste AuthorDate: 2023-05-09 18:26:47 +0000 Commit: Ed Maste CommitDate: 2023-06-05 14:29:42 +0000 Cirrus-CI: add gcc12 automatic task on primary GitHub mirror We want to get GCC coverage via Cirrus-CI, but don't want to trigger excessive runs across all forks and branches. Create a duplicate gcc12 task to run automatically for freebsd/freebsd-src. Reviewed by: jhb Sponsored by: The FreeBSD Foundation (cherry picked from commit f5f1b9a9828a4fdf5b0ba51b291e0e1e7ac7b55f) --- .cirrus.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.cirrus.yml b/.cirrus.yml index 57ff4a3b271f..3270040aba40 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -27,12 +27,18 @@ task: TARGET: arm64 TARGET_ARCH: aarch64 TOOLCHAIN_PKG: llvm15 - - name: World and kernel gcc12 amd64 build and boot smoke test + - name: World and kernel gcc12 amd64 build and boot smoke test (manual) trigger_type: manual env: TARGET: amd64 TARGET_ARCH: amd64 TOOLCHAIN_PKG: amd64-gcc12 + - name: World and kernel gcc12 amd64 build and boot smoke test (FreeBSD repo) + only_if: $CIRRUS_REPO_FULL_NAME == 'freebsd/freebsd-src' + env: + TARGET: amd64 + TARGET_ARCH: amd64 + TOOLCHAIN_PKG: amd64-gcc12 timeout_in: 120m install_script: - sh .cirrus-ci/pkg-install.sh qemu-nox11 ${TOOLCHAIN_PKG} From nobody Mon Jun 5 16:01:42 2023 X-Original-To: dev-commits-src-branches@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 4QZddf4PS5z4Z6fs; Mon, 5 Jun 2023 16:01:42 +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 4QZddf3xqqz4KCY; Mon, 5 Jun 2023 16:01:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685980902; 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=hGEjVmhDjVZCCVXR0QnEhuRNnt4Ro/P6/gXWwoo9h0g=; b=B5//xeAO6Zs4bMwOTlVQ2G1Xuq1qb0uQ03uptjE944edx5jq6ruVwXXTGVM0H3kVLzsW6o +sKFI3ZZ/eYMtUtyP+YZLEeKYXj28zqrAAyilk2Eg4VqnzVYWYjeIu8kFVtRTsEyQLSb0A jGb+ZHeP1aFNXtNhoDg87fqNHD/vOLhkrWEy7Fwji11J8axesSNBrEN3Fsv94b7iNWWl0B aUwh9Fer/e4EsAwGUZxOGTfq+TvyZv0JGfzHvdyfVWridQMOXJ52CvDDAOlGCcicKx4osW ohfaWBOEkW0JXaMpIOIoRk6pPrOG8os+X48V+8bAjYCzXibsF61BcWw9HqVucw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685980902; 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=hGEjVmhDjVZCCVXR0QnEhuRNnt4Ro/P6/gXWwoo9h0g=; b=xyhqNqxd+hoflAOojrIkkhfZ2YRBQMk7OSyG7/zTtodWtzGWNU71OYj9RrLJZb+Zrh8Ax4 h6tgsRzXCrMmNlF8AOUbJR+CWso0rzjUoUIwOIa54nX8wPhwrwFzFBVOlpcwWfpebPmDj6 LerNsJTFnPvV0d5AyYC/tJml0Qqq7L89r1zXF1jspwNXBw0rfCEJkLHp6K+1kAP8RKkMd8 zxKAlQ+jbfWt6+Afb+tSHO6qc+Yl7XJJm/6lIdw1BA7/24V07o2k7YT3GmxF9sHVvwdZuj CRZIwE1UZP6DjvPZk9bl1U+ZThSqc+O+ToYxYmwgW+zcJHLB/6TG3jOyQ4QAdg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685980902; a=rsa-sha256; cv=none; b=HRbt9TPhHB/uKftSPliv5ArqnKgF422UV2UnGk6Uxdwp3L4iFElw9MQLzVhkoEydkyJLHH MABBNXMYie3eFv6B+3kmCEg4m2OLjogFhYcDJ0XOJ5QUAAxxjaky8WZqF0gVTqrLzmg/RF Je9lpwV2w5FUrluc32vJyXfzP3Nv7tdMsv9xTlG4c35vFQ8jt6giwbuFrcWKClMX3gSo4B kBkdbt5HJ2PhqmDq/PMlRhSo7hPJaP4rG5hZlDDJgQi15/IL/rOGzpl1Fyjw9o6xFQlBGm nfTU7djDzVfM89DGi1A02yN3sZqTBMXs4qP5gSVN/7HenHVKZy5qv1vMSgXeNQ== 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 4QZddf30DtztkR; Mon, 5 Jun 2023 16:01:42 +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 355G1gLF065648; Mon, 5 Jun 2023 16:01:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 355G1g4A065647; Mon, 5 Jun 2023 16:01:42 GMT (envelope-from git) Date: Mon, 5 Jun 2023 16:01:42 GMT Message-Id: <202306051601.355G1g4A065647@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 089d1ed94c07 - stable/13 - Cirrus-CI: move QEMU pkg installation to test script List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 089d1ed94c0708c4ef9ba13c121294904750d5f1 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=089d1ed94c0708c4ef9ba13c121294904750d5f1 commit 089d1ed94c0708c4ef9ba13c121294904750d5f1 Author: Ed Maste AuthorDate: 2022-09-07 14:12:37 +0000 Commit: Ed Maste CommitDate: 2023-06-05 14:35:06 +0000 Cirrus-CI: move QEMU pkg installation to test script Occasionally the QEMU package fails to build and isn't available on -CURRENT using the Latest package set. Move the package installation to the test script, so that if the package isn't available we at least still perform a build test. Sponsored by: The FreeBSD Foundation (cherry picked from commit 612f254c82468d037fccb6c26dc0a7e37a73a53e) --- .cirrus.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.cirrus.yml b/.cirrus.yml index 3270040aba40..eeb4bf83fb07 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -41,7 +41,7 @@ task: TOOLCHAIN_PKG: amd64-gcc12 timeout_in: 120m install_script: - - sh .cirrus-ci/pkg-install.sh qemu-nox11 ${TOOLCHAIN_PKG} + - sh .cirrus-ci/pkg-install.sh ${TOOLCHAIN_PKG} setup_script: - uname -a - gpart show @@ -57,6 +57,7 @@ task: package_check_script: - su user -c "/usr/libexec/flua tools/pkgbase/metalog_reader.lua -c /usr/obj/$(pwd -P)/${TARGET}.${TARGET_ARCH}/worldstage/METALOG" test_script: + - sh .cirrus-ci/pkg-install.sh qemu-nox11 - sh tools/boot/ci-qemu-test.sh post_script: - df -m From nobody Mon Jun 5 16:01:43 2023 X-Original-To: dev-commits-src-branches@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 4QZddg5WVcz4Z6wx; Mon, 5 Jun 2023 16:01:43 +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 4QZddg53s9z4K54; Mon, 5 Jun 2023 16:01:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685980903; 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=WR+lIE9JQPfr0bVbmLBlh9ieEcU0awRiUxmz6qID6aQ=; b=iMeN7dc4fgk5wEv0R3/tWVobxoR0Lmu6b6Y4Td/6Bd6fV447YWs1yfEiYeGvIKxuwKjDhj J3D+Uk7pG4qQSRSmNqNpuHnQKQvgoOJiOUyD6GHc+LjM4XyqJanzbTNKP6KxZmWsj/KDAk D7y+HfbPTN4xysO5M0oMT6MNlCBdtyShi3zS1adTcM18VRk+7cUCvr976AH8nty9TxPklt iFMF0CbNLwGzx1d7OnTQMgJR455pLe2Pfc0CYgAU8GXxQFTGLqx5Bd0pbbJtBgQxFOt8PS 0g2ruacD85p8vHUzFOZ1POUbd+KwJceqtQ8Hntjw3zGet19gB07yJHm3R4YUhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685980903; 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=WR+lIE9JQPfr0bVbmLBlh9ieEcU0awRiUxmz6qID6aQ=; b=wjjT9XZxfKCvpgg6CcC27pgaCG9sZJA/tbNnUZOPp9aW0e9IFM6kxEB4Ws92L9ztVWQUF2 cxNeVuMTQfAgCuKpEXmyFdBgoQbrb7GiT+nJ/hL7ZEqU0ayXeE/f1VKNJUhwprHGGx446q 0wr3EEg3+K3it50211ZynJ0Kbrvwgd+kQ8FCVunL9MsPzicsMVpEFdG52DB3mGgfPE7pes qQcVPJoV11/2GXE+BBmiyQ+g7yLIQUZDN3EU8053TWvoPR2o8k5JdiBlj/pO08bJWHvTSM 6siCkZ4CA8JQrf/5o8MGtDbMSqNDVHG0HlX2YxBINbeqRbNlpMMZxR91Dq/h9w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685980903; a=rsa-sha256; cv=none; b=amL7FDUzmaobciIf79rJT3DiHShxyJugBAfprVOmzVYYXbtgk5NJ7Zn9poz1QqEV9xLFP9 NWMwbO6lf55rIo9PIkAS+34vPzk0CGaY4cQkVKyMCwkgrw6vD9V8hV0Ay8epe7EBRNUNG/ TEbuliEolddaonNGpBYOMeagv0AY4NED139yYWf4WWVc4XeJtcubtbzp/wok6B1Carh6NO zJJ+YV+LTXXQzrc/0FhZfxzxgS++RHlVFCh67BZ1lLhzoFObqRDOZjCFCvfZfRu2kExODV WkR1N+MalQ47DVMf9sL/AXEaJSOAa8xDqyYX6fkM/Lx97YYiT3wx2pdAM0I2FA== 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 4QZddg490Fzt7r; Mon, 5 Jun 2023 16:01:43 +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 355G1hr8065667; Mon, 5 Jun 2023 16:01:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 355G1hVe065666; Mon, 5 Jun 2023 16:01:43 GMT (envelope-from git) Date: Mon, 5 Jun 2023 16:01:43 GMT Message-Id: <202306051601.355G1hVe065666@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 7d947ad81079 - stable/13 - Cirrus-CI: hide manual tasks from official runs List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7d947ad810791fa4fa11ce9b63308e8205cd5ccc Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=7d947ad810791fa4fa11ce9b63308e8205cd5ccc commit 7d947ad810791fa4fa11ce9b63308e8205cd5ccc Author: Ed Maste AuthorDate: 2023-05-11 15:16:51 +0000 Commit: Ed Maste CommitDate: 2023-06-05 14:35:15 +0000 Cirrus-CI: hide manual tasks from official runs Sponsored by: The FreeBSD Foundation (cherry picked from commit 9244506a1b314d9ad5bcb1bd5cc0b75939464174) --- .cirrus.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.cirrus.yml b/.cirrus.yml index eeb4bf83fb07..1c6bb1d8e5a4 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -22,12 +22,14 @@ task: TARGET_ARCH: amd64 TOOLCHAIN_PKG: llvm15 - name: World and kernel arm64 build and boot smoke test + only_if: $CIRRUS_REPO_FULL_NAME != 'freebsd/freebsd-src' trigger_type: manual env: TARGET: arm64 TARGET_ARCH: aarch64 TOOLCHAIN_PKG: llvm15 - name: World and kernel gcc12 amd64 build and boot smoke test (manual) + only_if: $CIRRUS_REPO_FULL_NAME != 'freebsd/freebsd-src' trigger_type: manual env: TARGET: amd64 From nobody Mon Jun 5 16:01:44 2023 X-Original-To: dev-commits-src-branches@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 4QZddh6t02z4Z6g5; Mon, 5 Jun 2023 16:01:44 +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 4QZddh5zBtz4KLZ; Mon, 5 Jun 2023 16:01:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685980904; 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=a7yqYAuskHNdbHrKEeAIT5t0G0cnFlMA6NR980CLJNQ=; b=KOpAv4IdIIJSIHA6/1PPFrGc65wWRYSVeqPf4a7PXGnJbWMe/68tZVu9q3ZQe0GYaVrajZ cNgydjICiNyqOertauSwmyPrRsZY3IR4qMVMskcLYnzT3jo7gz9Ml8FwUSUZuIuNWJXQCZ tF8OgDsFpRkHmm0KCuu/FAgJHzDTbKZjGXTj3vGL5XYmB/k5IUUxx1+OQ0xaF0zlWfe4v8 tFZD6oUNvICAbcN2G7DEZwmIFwyEzMhX/bnyDRwkm810P/mQwlOIrXxYyDxL8lm+Munclv JvdqMoVLAN928UKuAUcRzZc0T2pjKW+OhVdJHGCVfIFx4rfZYYKWuMSnliln3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685980904; 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=a7yqYAuskHNdbHrKEeAIT5t0G0cnFlMA6NR980CLJNQ=; b=azEDJ7jdgAvZ/FF2TczVOf4CH5ZE5kWysWNJQxYmNg/VDQWyv2bd3GBEkJU7VYtJyt3LWc Xy95TBB9yDBHjQWUFiAVuHl6XNEHBu9iSew4QDTyUyuxzS2ZnsvQT/WyGJ5nPedAj2GB22 bLDk1xWHeKXAgqS669rfr9T24Vh3mfRbUA2gfO58cdyDpWdbhhBacQvBDao8oBEisChDgM LSioA8feauee2XV4yaFkSByNDwwm+2vlGmo08HBh4x+kPhswcxIiJvk8zHv+Hg7jFqwbkb ket5ZN1kensuUnRp1zhHtCaWYC4EFc8Ff2pxmMJz85dqjGI1c97bdqKLQ58z0Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685980904; a=rsa-sha256; cv=none; b=rBFgtyTIUTn9tuJdHvERmxIEUntUqibzrLSnUQ/xU03Z+JagOvmcfjPFr5TNCJFWo4RPvc jlp/OvIpSGde08+K70bFWOXrB/NIY1gIda3Rx1q7y8mp18ErX52UhKNRH7GmDOgV574W5T VPJZ52UxO1/qBK7EH6FhrrmnMwwqWS4PH6df5xJD1/VnGGGy4k+GuzDpfKe1ctrHxNORHA sssMq0MJ24iFHDtrvXfL4ZVc7sKPpgHtzJfeJ7Csy+Ad6M3JeDl98Q3V7pzo/9NBeFfch8 bpfASSdJwor8ZSH6tpPYI8r2OY/rcjqr0hOpxaRTvV9DkpCiZ6NgkTcEQaLxAw== 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 4QZddh55Lpzt7s; Mon, 5 Jun 2023 16:01:44 +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 355G1ivG065687; Mon, 5 Jun 2023 16:01:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 355G1iaE065686; Mon, 5 Jun 2023 16:01:44 GMT (envelope-from git) Date: Mon, 5 Jun 2023 16:01:44 GMT Message-Id: <202306051601.355G1iaE065686@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 99b983ffe737 - stable/13 - Cirrus-CI: switch to -lite LLVM package for native run List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 99b983ffe737fa2cb7bd5b2f1cc0f6b6b8d5fe9e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=99b983ffe737fa2cb7bd5b2f1cc0f6b6b8d5fe9e commit 99b983ffe737fa2cb7bd5b2f1cc0f6b6b8d5fe9e Author: Ed Maste AuthorDate: 2023-05-17 18:16:06 +0000 Commit: Ed Maste CommitDate: 2023-06-05 14:35:28 +0000 Cirrus-CI: switch to -lite LLVM package for native run This reduces CI cycle time (a small amount). Suggested by: brooks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D40136 (cherry picked from commit f326a83c857066754cbc92c59e1904a68af37deb) --- .cirrus.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 1c6bb1d8e5a4..0e3fea9e3776 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -20,27 +20,31 @@ task: env: TARGET: amd64 TARGET_ARCH: amd64 - TOOLCHAIN_PKG: llvm15 + TOOLCHAIN: llvm15 + TOOLCHAIN_PKG: ${TOOLCHAIN}-lite - name: World and kernel arm64 build and boot smoke test only_if: $CIRRUS_REPO_FULL_NAME != 'freebsd/freebsd-src' trigger_type: manual env: TARGET: arm64 TARGET_ARCH: aarch64 - TOOLCHAIN_PKG: llvm15 + TOOLCHAIN: llvm15 + TOOLCHAIN_PKG: ${TOOLCHAIN} - name: World and kernel gcc12 amd64 build and boot smoke test (manual) only_if: $CIRRUS_REPO_FULL_NAME != 'freebsd/freebsd-src' trigger_type: manual env: TARGET: amd64 TARGET_ARCH: amd64 - TOOLCHAIN_PKG: amd64-gcc12 + TOOLCHAIN: amd64-gcc12 + TOOLCHAIN_PKG: ${TOOLCHAIN} - name: World and kernel gcc12 amd64 build and boot smoke test (FreeBSD repo) only_if: $CIRRUS_REPO_FULL_NAME == 'freebsd/freebsd-src' env: TARGET: amd64 TARGET_ARCH: amd64 - TOOLCHAIN_PKG: amd64-gcc12 + TOOLCHAIN: amd64-gcc12 + TOOLCHAIN_PKG: ${TOOLCHAIN} timeout_in: 120m install_script: - sh .cirrus-ci/pkg-install.sh ${TOOLCHAIN_PKG} @@ -53,9 +57,9 @@ task: - mkdir -p /usr/obj/$(pwd -P) - chown user:user /usr/obj/$(pwd -P) script: - - su user -c "make -j$(sysctl -n hw.ncpu) CROSS_TOOLCHAIN=${TOOLCHAIN_PKG} WITHOUT_TOOLCHAIN=yes buildworld buildkernel" + - su user -c "make -j$(sysctl -n hw.ncpu) CROSS_TOOLCHAIN=${TOOLCHAIN} WITHOUT_TOOLCHAIN=yes buildworld buildkernel" package_script: - - su user -c "make CROSS_TOOLCHAIN=${TOOLCHAIN_PKG} WITHOUT_TOOLCHAIN=yes packages" + - su user -c "make CROSS_TOOLCHAIN=${TOOLCHAIN} WITHOUT_TOOLCHAIN=yes packages" package_check_script: - su user -c "/usr/libexec/flua tools/pkgbase/metalog_reader.lua -c /usr/obj/$(pwd -P)/${TARGET}.${TARGET_ARCH}/worldstage/METALOG" test_script: From nobody Mon Jun 5 16:01:45 2023 X-Original-To: dev-commits-src-branches@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 4QZddk0n8zz4Z6d9; Mon, 5 Jun 2023 16:01:46 +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 4QZddj6tyvz4KGf; Mon, 5 Jun 2023 16:01:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685980906; 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=Qem6yMEgiuX2zO5B/Xo1tONayt9Uh3zZMYTGeA6QmkE=; b=WquUJijE5S1N2vFXz65LIuAAnJ8A+7OuddAZb8c6ayM90aLJU7nY7JtmO0DoRdr7otkF76 nrd8htUrFk61HYyCyl3P8CLCgo+NFPdssv7hD9SrhzVSRPP7fqwmuDO9fBaKl9MIVFqphV zxYBdJp8S6eqPZEdJMqZqoNLIkw6UN1W7QZg2VVYwhAibzmLwpKxJ4CpwCR0622WWs19xK mKZZ9gaPZwBcndqagRKeIf1wup8LV0orjZ/Qf3QvEk2IL8ODYJ7KJFV8ep118N12uHezzj Ruom1cFvCWO+uFwv1d5AUprKrVmwdxLZ8SG4KYj+5O58TuIPnvAj2CM4q6TvUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685980906; 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=Qem6yMEgiuX2zO5B/Xo1tONayt9Uh3zZMYTGeA6QmkE=; b=PoBZE02w3EhYgE/JDjKQrLj1HxjagAFkBrkDbo0EoHDv3ISPk8kVtiIm7tD6EvG/EzbgjT U8KumavanIQIaciBTky4NCAbS8/n1RfmqBIe7SYTp840tem2gmhuldhol33+8hS9KC/Ziv owjWJVM72CQ6uiYRB5CrzLZr6XPEEfU5n0Ob4cvXA+0QSK+mu/D5hjlA2Dnj7ktTMeE2mB PyNdsh8Se61o38WTIPRcbrh4CiurVb5DPq8Jt2Vj6PXCMRZ5pn0NeYrRZ/3AvxHHFkW312 zEpyHrI2xz2X1pH/O+wuQRJBUJa6bvn7KE07nOZqC2rfsz5qdXQKY3u+6FtIUQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685980906; a=rsa-sha256; cv=none; b=Dl3XWiy+CbMWNueYUtMxKoZ6422wfFzZ6JwFt6CiS8NOVpML5VMN6OrHrLplSl0qKRHcZi G5DbE+0uZPBz+RagwqGgYsQx4fdSHTRIiJtj/VD4CQP3pICNyqy3vKxxzEEZdmw6rYbIdI EKkY9WRaTyx4DX6rTaJD3+nt4Br4eOhqQox7GMbzMDH8qLBzkaU7MDisirwkrYSHJQD9hf Dk1LHHFXrlulVmZ5hyuwuEIEPg4nYI3UfwlP7Pn+tZ13KmiYH/o9tV+zH+B1uOyWqv+gVX euE5BpL9K6RogwMcur28qumIqz58/q5jVvFqQSO8zRLoITgyBMMeaOpO5Nh1vA== 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 4QZddj60j9ztHN; Mon, 5 Jun 2023 16:01:45 +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 355G1j7F065712; Mon, 5 Jun 2023 16:01:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 355G1jsH065711; Mon, 5 Jun 2023 16:01:45 GMT (envelope-from git) Date: Mon, 5 Jun 2023 16:01:45 GMT Message-Id: <202306051601.355G1jsH065711@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 80622a0a440d - stable/13 - Cirrus-CI: move arch and toolchain to beginning of task names List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 80622a0a440da63fc9e816500901788283b70e77 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=80622a0a440da63fc9e816500901788283b70e77 commit 80622a0a440da63fc9e816500901788283b70e77 Author: Ed Maste AuthorDate: 2023-05-26 17:58:04 +0000 Commit: Ed Maste CommitDate: 2023-06-05 14:39:25 +0000 Cirrus-CI: move arch and toolchain to beginning of task names This is the key difference between the tasks, so make it the most prominent. Sponsored by: The FreeBSD Foundation (cherry picked from commit 98c5211847afbfef54cf7446a4a94a6aad6a31bd) --- .cirrus.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 0e3fea9e3776..6b588d05e551 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -16,13 +16,13 @@ env: task: matrix: - - name: World and kernel amd64 build and boot smoke test + - name: amd64-llvm15 World and kernel build and boot smoke test env: TARGET: amd64 TARGET_ARCH: amd64 TOOLCHAIN: llvm15 TOOLCHAIN_PKG: ${TOOLCHAIN}-lite - - name: World and kernel arm64 build and boot smoke test + - name: arm64-llvm15 World and kernel build and boot smoke test only_if: $CIRRUS_REPO_FULL_NAME != 'freebsd/freebsd-src' trigger_type: manual env: @@ -30,7 +30,7 @@ task: TARGET_ARCH: aarch64 TOOLCHAIN: llvm15 TOOLCHAIN_PKG: ${TOOLCHAIN} - - name: World and kernel gcc12 amd64 build and boot smoke test (manual) + - name: amd64-gcc12 World and kernel build and boot smoke test (manual) only_if: $CIRRUS_REPO_FULL_NAME != 'freebsd/freebsd-src' trigger_type: manual env: @@ -38,7 +38,7 @@ task: TARGET_ARCH: amd64 TOOLCHAIN: amd64-gcc12 TOOLCHAIN_PKG: ${TOOLCHAIN} - - name: World and kernel gcc12 amd64 build and boot smoke test (FreeBSD repo) + - name: amd64-gcc12 World and kernel build and boot smoke test (FreeBSD repo) only_if: $CIRRUS_REPO_FULL_NAME == 'freebsd/freebsd-src' env: TARGET: amd64 From nobody Mon Jun 5 16:03:31 2023 X-Original-To: dev-commits-src-branches@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 4QZdgl4vtqz4Z6yn; Mon, 5 Jun 2023 16:03:31 +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 4QZdgl4RjPz4LDC; Mon, 5 Jun 2023 16:03:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685981011; 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=+LW3CqbVshYpLDzP7HOjo41gkEVaoUwUiYuoVOxGOHs=; b=hfpRfJbMzc3pQNc1FVCe5zrDsnGa+PW5XUHHDH6sKVUr22Kx7AfO+7xGvrvrSwxiE+jjZR Qk4rJDrAxh893HVyuoiygfBhwixKxvq2Jl0paaka8BiCP+fPTx0zlTLrN+VK7OyrFaLors Z7kUT5m2bdLcYURWBTQEs/+ovbpUkmGDedlInwsz8rOREzCJIUZh83Qm/r21DHZkVxsZqX n85DzeW+JGvC+AjWJE4WiqRljc0AKq/fv8svLTLdc55mhs+QWMYMaIp0ye3X0CGk0tA13K f4fZuW7dYCYhIJc1bwVJKkmR9T2J2UkG+/HBwaKpvHcI4TQi7TRbl/0xPgQP7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685981011; 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=+LW3CqbVshYpLDzP7HOjo41gkEVaoUwUiYuoVOxGOHs=; b=dvDnEzDrLECyTU1T2aHv8WZ1ZXzDgV/JJydh2HRAkajM+Z5iz2qepz9DQcX9wMofaJrXcq Xb+3tmkfSGA3QmMyZmtFJy53zrftzKmZsML7CnR30jVs3a0X81hTM7VPW83istxtxfKHxJ aTmJ9+eRLO4wuN9FKhORjUPyS/hOChRIsV03BK/d3OgkfbSl/x7rwOvpSrirrp0a1AU2zD /XbV+PfMr6hSEUlYJR7ykQdZtbw+mPtxcJ2XU1ZC0Yggow8zQGhw63sHqqqvHUJ8jxM+cl zY0vVSqVdc9jneWTHV5Pvlu+WR1xr/e3DjrR0ZYo6zxEbnpzM4gOc2sn5m3Wng== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685981011; a=rsa-sha256; cv=none; b=hRN0fErgaBg1EoU0dQsCX22/TrWIfaKkaT1HratCPmcsSMi5l7oUvLwy3Qz8sC8ZjPYw3J lg+tB/5q9lFyEJ+sdK7p7aG3ao+T7ZOCmedGAYczP0KvzRjk6Kv3977RCQq/x8yGcPg94z oc6/KhPpMxV+vrmk1fl+BB+9Su+nEs5SF8vEjMNCyLRa+CI53k3ub0Lth7XFnHPfZtYfPc NAT+SFsEzmUAwJSkq4b0dBm6sHW8CfbvjRlfv66s5axKtxkRiyfCj2KRT6bnVit+Uq0QJi P5wrNuN7vozJedaW/dXm9yPpUSCkXYzc7YLQ9UY06cHoTBMu5p2xxzsHKhADIw== 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 4QZdgl3W4HztSZ; Mon, 5 Jun 2023 16:03:31 +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 355G3Vsk067057; Mon, 5 Jun 2023 16:03:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 355G3VIQ067056; Mon, 5 Jun 2023 16:03:31 GMT (envelope-from git) Date: Mon, 5 Jun 2023 16:03:31 GMT Message-Id: <202306051603.355G3VIQ067056@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 2b4fb1350cee - stable/12 - openssh: include destination constraints for smartcard keys List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 2b4fb1350ceea0f2a0f04b1b8f5bfd3c32329ae4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=2b4fb1350ceea0f2a0f04b1b8f5bfd3c32329ae4 commit 2b4fb1350ceea0f2a0f04b1b8f5bfd3c32329ae4 Author: Ed Maste AuthorDate: 2023-06-05 14:49:53 +0000 Commit: Ed Maste CommitDate: 2023-06-05 14:56:23 +0000 openssh: include destination constraints for smartcard keys From openssh-portable 54ac4ab2b53ce9fcb66b8250dee91c070e4167ed, OpenBSD-Commit-ID: add879fac6903a1cb1d1e42c4309e5359c3d870f PR: 271839 Sponsored by: The FreeBSD Foundation --- crypto/openssh/authfd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/openssh/authfd.c b/crypto/openssh/authfd.c index b633e35eaf8b..b9ae505ad7b2 100644 --- a/crypto/openssh/authfd.c +++ b/crypto/openssh/authfd.c @@ -666,7 +666,7 @@ ssh_update_card(int sock, int add, const char *reader_id, const char *pin, struct dest_constraint **dest_constraints, size_t ndest_constraints) { struct sshbuf *msg; - int r, constrained = (life || confirm); + int r, constrained = (life || confirm || dest_constraints); u_char type; if (add) { From nobody Mon Jun 5 18:11:20 2023 X-Original-To: dev-commits-src-branches@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 4QZhWD3s1jz4ZmZR; Mon, 5 Jun 2023 18:11:20 +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 4QZhWD3Kmsz3lN9; Mon, 5 Jun 2023 18:11:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685988680; 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=PdlMYyyWYOQxk33oMmYu9a7mxBrgHVw7CAhKettJlTo=; b=S/DsaNXSZt/Pfue9Del47Iir2WJqNFpU+4iREISKr6dzVrTqST5B2fwg33u4g1qnF9iUN7 ljiCi2MXrKOCF2eR/LNHHWihXBtj8VhWQ3EqibfALxtSgoogWar8JKlUecOI0GybYxieou oJs7DuYIfhPp7U/k5In34DqsGasmhHgAXCEsJx6wXLvlqohkDq3CtvhsO95BOnXs2h+o25 5qdipF9OuJOWIYBhNxRCaHOJOcdglrUKc/ATM+WvQh0ikqc4pQQFnjhaxb6hJs40JZUjYI tRVrc8ffQZ6qgmSlXIJCNgYYeB1+lOJuPrif926s9VTbAKQ2iRcHoneH9HrOXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685988680; 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=PdlMYyyWYOQxk33oMmYu9a7mxBrgHVw7CAhKettJlTo=; b=rioms5+K37pgWglyiGxgQ94Llyn2sB3OjuVOl93Q3qVOmXSYl4PixSGYxEA9x8dQWSeaJ5 OUcXMWHDWqlYwXwllNyBvdJ2DobIGJKvFEXL3CDLe1pc7xfvE9yhQSToOpgkMhPXBoT6vx Lav6vYrsRWeH5YlLd5AQpmq1fkQHGkkc5jIuwBtB31XSxhWuSvRIuRVkruF3Eme61faXh4 I6OHaBwYFGzMxq+NQBLKJDdM/XwXA5gB9yHguEI4Ut94mxKAwkb2Y4gu2RdLvwqBsd5VIY B17Lcabanr/7inObhuhGKwUm7IehoK8G4OTq+Vu9GhltSUFg7kNCDSNkl/CiBA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685988680; a=rsa-sha256; cv=none; b=sJD9phZa1qFr1V9LaoDNwbi4tC8KW6GG29691jS9U2Iw9OujFwIBqrO+HFe6kCzQLT7YsC hd5660J6QNEfYkdpiTQhKsGtRU19gxOxJZWfxauLaizLSnsklLGS3cYFochcKEXBdFqyBK I2Yn76KsHZRMKQ8BcEZcEX24XcZbgb3BYHWZR7vuHkVXYAzYceKScEl3U+sEM863RoUW4M 1ZIbTuO8rwIVNuE0AW2sXPRWXUXTYXMBqduWPxxebQ0SEsmYYiX8/TZg6EJM+z1NGOfGxf rpoXjd4TVDRTkRjg4MXCd9R/j6YArcZemJCmm9LbTDWbxSMsVN/ZvcTS2VLd+w== 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 4QZhWD2Ql2zxwW; Mon, 5 Jun 2023 18:11:20 +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 355IBKHf081540; Mon, 5 Jun 2023 18:11:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 355IBK7U081539; Mon, 5 Jun 2023 18:11:20 GMT (envelope-from git) Date: Mon, 5 Jun 2023 18:11:20 GMT Message-Id: <202306051811.355IBK7U081539@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 792d3f16868e - stable/13 - ssh: fix leak and apply style(9) to hostname canonicalization List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 792d3f16868e5f79ab8b11803340251371515f0a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=792d3f16868e5f79ab8b11803340251371515f0a commit 792d3f16868e5f79ab8b11803340251371515f0a Author: Ed Maste AuthorDate: 2023-02-08 13:16:53 +0000 Commit: Ed Maste CommitDate: 2023-06-05 16:03:51 +0000 ssh: fix leak and apply style(9) to hostname canonicalization Fixes: bf2e2524a2ce ("ssh: canonicize the host name before...") Fixes: 3e74849a1ee2 ("ssh: canonicize the host name before...") Reviewed by: rew Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D38441 (cherry picked from commit 19aba210e1a1b5999bff10cccab5a277060c4d46) --- crypto/openssh/ssh.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/crypto/openssh/ssh.c b/crypto/openssh/ssh.c index 268781518b8c..883406f7b8f9 100644 --- a/crypto/openssh/ssh.c +++ b/crypto/openssh/ssh.c @@ -1396,18 +1396,21 @@ main(int ac, char **av) cinfo->locuser = xstrdup(pw->pw_name); /* Find canonic host name. */ - if (strchr(host, '.') == 0) { + if (strchr(host, '.') == NULL) { struct addrinfo hints; struct addrinfo *ai = NULL; int errgai; + memset(&hints, 0, sizeof(hints)); hints.ai_family = options.address_family; hints.ai_flags = AI_CANONNAME; hints.ai_socktype = SOCK_STREAM; errgai = getaddrinfo(host, NULL, &hints, &ai); if (errgai == 0) { - if (ai->ai_canonname != NULL) + if (ai->ai_canonname != NULL) { + free(host); host = xstrdup(ai->ai_canonname); + } freeaddrinfo(ai); } } From nobody Mon Jun 5 19:06:52 2023 X-Original-To: dev-commits-src-branches@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 4QZjlK0Xvzz4b106; Mon, 5 Jun 2023 19:06:53 +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 4QZjlJ6Vg3z3qY2; Mon, 5 Jun 2023 19:06:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685992012; 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=Izb86PIa/EYuOyUb8yZj4MFuBJdpi40rP+zPm8FtGe8=; b=blMFS1tP6pAPxENTy0/fe/Wso4cMcac55MGIHeoA4AbJxGTRtXodLOa4JlbwfL/D+Uakvx kfxJytL0Nsc2qLFu3C6Cr9ZC7377CkF74K8e4czr1xcDokepbNvs8+sZ9yz+QuVE0HhDuv lrL2KH/E58gAVZSOoUgvYKoL42VHzSCK7l4tIsWxzN39pgfJkJBZPcwxRADB0GPYis4hM8 yPYG6ALSpGi+B+Ueo62TXIPkdED34t3I5niRvSSBet9TAtUEKNtb3VeqCEFE8xde/izinS hiRuHCKPjOd2mHtl9bIHFeRqg1vSSkmXS3n8138qj3bPgKdl/En4sIewTxdEbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685992012; 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=Izb86PIa/EYuOyUb8yZj4MFuBJdpi40rP+zPm8FtGe8=; b=k00nThZoatfAfpMec8WH/sWi6zETN6rUaE0mPAJ8RwrZUg4yxFBgPuVc8EQ6SGIH6W+xxE ZYDucLDrPuwlFM1H+JHU7kTjmkE5t48yxY6ErxgzUnT2gp2KLrXX+hyQ/Iqwvwr5jauDGw 0r0SDbpsnjQY7oGyshXoaB9YsuYnkRANGqpoNKCTN39I//3tU5ZXek0+LinPLZDLDcJAnm GQuWQ6l/Ca8IBA0OtlidOqeSRRxj63QyPLQka5yOIU2sztrRn23gec+CBfcsnSPuaJdVkP jgoUyM4b3E8dKhwa/rqXQSc4ABTKSbGU9V2GF6xrLc/+ScYA0S3WPctx1AeymQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685992012; a=rsa-sha256; cv=none; b=tDc5PUxjbasc2equ4xFIiV8JlO5DKZtMDbokqfs5P7ki+hHrX6USz37amtwolhpXRKdz+e l7WcLS3irVzoZPW04BbQAkrv+HBWBchJYsv3uS54NxrSlEil9uQyg5flTkTnVCU457+p4M ZLl3Lbf+eZjyWIq/DX8onPxFJfhH5qHG9TRqL3sQYEOmBsVcPncjcQOGPG3ZLE7iL/iWGt RZYqVEV7qHSq0rxbhEqqMxdl4a7b2YGxQqQVjsgQGyG1dpfmXtzMKgGNJ6UeoPrRvwP/xB TSs+22jG7eS7FOPYbmJ09RTfR52R0uPx7avD91RS0cocL0tis4KTpPKLEjHNCA== 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 4QZjlJ5VDzz10Hl; Mon, 5 Jun 2023 19:06:52 +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 355J6qXe085713; Mon, 5 Jun 2023 19:06:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 355J6q8D085712; Mon, 5 Jun 2023 19:06:52 GMT (envelope-from git) Date: Mon, 5 Jun 2023 19:06:52 GMT Message-Id: <202306051906.355J6q8D085712@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 77d002b9cbf4 - stable/12 - ssh: fix leak and apply style(9) to hostname canonicalization List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 77d002b9cbf49168ba6261b5dc84b8e694c24b20 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=77d002b9cbf49168ba6261b5dc84b8e694c24b20 commit 77d002b9cbf49168ba6261b5dc84b8e694c24b20 Author: Ed Maste AuthorDate: 2023-02-08 13:16:53 +0000 Commit: Ed Maste CommitDate: 2023-06-05 19:05:32 +0000 ssh: fix leak and apply style(9) to hostname canonicalization Fixes: bf2e2524a2ce ("ssh: canonicize the host name before...") Fixes: 3e74849a1ee2 ("ssh: canonicize the host name before...") Reviewed by: rew Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D38441 (cherry picked from commit 19aba210e1a1b5999bff10cccab5a277060c4d46) (cherry picked from commit 792d3f16868e5f79ab8b11803340251371515f0a) --- crypto/openssh/ssh.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/crypto/openssh/ssh.c b/crypto/openssh/ssh.c index c5a4326bd1c6..b058e8349c63 100644 --- a/crypto/openssh/ssh.c +++ b/crypto/openssh/ssh.c @@ -1397,18 +1397,21 @@ main(int ac, char **av) cinfo->locuser = xstrdup(pw->pw_name); /* Find canonic host name. */ - if (strchr(host, '.') == 0) { + if (strchr(host, '.') == NULL) { struct addrinfo hints; struct addrinfo *ai = NULL; int errgai; + memset(&hints, 0, sizeof(hints)); hints.ai_family = options.address_family; hints.ai_flags = AI_CANONNAME; hints.ai_socktype = SOCK_STREAM; errgai = getaddrinfo(host, NULL, &hints, &ai); if (errgai == 0) { - if (ai->ai_canonname != NULL) + if (ai->ai_canonname != NULL) { + free(host); host = xstrdup(ai->ai_canonname); + } freeaddrinfo(ai); } } From nobody Tue Jun 6 12:45:33 2023 X-Original-To: dev-commits-src-branches@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 4Qb9Dt0vtTz4bSpl; Tue, 6 Jun 2023 12:45:34 +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 4Qb9Dt0MBwz3LCD; Tue, 6 Jun 2023 12:45:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686055534; 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=4jn3SJWJCo9ND2vkyE8bep7hsm6Ua6HCJQWuAlcVovA=; b=sHTZl3K8BD7iU/G1HQmSz2lSodLdJk0f+TWoW7uFyZS5aqHrt2CKaruDZ2jqEbLr4rnA9k FbXnzWakoAIpoWwLIHElQz361Lua37j4/S8derUL+5F/IrlCfalRZBM2SGVyglB91z24dh 5CRwA6OPtVAkXjk4sMsF5MuMkaEwVgtaQ3D6SwsEC7X6SxgnaEBtjeUDCT9Ij8s1kWkPbm n04NwwaDvSubb/KgwC8FmkTV5QnUNuLJkZKEBT4UPSF3fLrJRuXZZgZAKBCNqwCafkTwUB i3eLC5HE0ALId1Fyd64x0UkEsUQ6/5yHC95mPGY0svtqkJMr31e4QzC43mseLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686055534; 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=4jn3SJWJCo9ND2vkyE8bep7hsm6Ua6HCJQWuAlcVovA=; b=Hdox4RT6BEqYtjp3A1LXaeK1klXJ01lPPqkXIz+V3M6iTfQ98bvTW+yKXqXDXh2adWuyZY 5idj7+lmOW1G/rQy5zNydyF+8jcV6uk7XIBZ8BQPfW0CJg2/zwlj5j3y5h4nBUfpks230t XlNSm67Vfc4vdt36PCZo4S8MHqQuXa87UqHOg2uKKAFhKyT25AcczcFiEGU4vngILdfb98 TdVP7bRcv58OM2SwWYoAqTi7u+LjyIl5oFjQsXpC1VvVHH9uwKRszyPKg7I+oKrafNXIu8 8Ys0A5DTrYKrR+ceJMUCBwdFm7rtNXg7qQdtjDI8Jpyf1JHImoJX6+RQLDqVBA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686055534; a=rsa-sha256; cv=none; b=OpOd6wWHy8GC55G1RFJ99fqG2wJUllXH8wbxQXXrqcAnfwblUWcZj9EcBhKeFK2wpdidco HD+A7rQZCDG/JkmjFC6M8Z8jf3ehYasSpwZ5vRKwi/MNPnUEhyz5cL/Yd4ef/Q3sQa+SeX K08qTp5yhXyopp84UL6mTdh8HLdNo8+0Lw904XdUHhO50Ip5NB6suM3fY0vwctDoSI/QTA XAjHmX4WY2pyl8msjAwHL+POoSdwUl0jp1wewvgonDMnuBgtIsNf6RNDFcj6jr1zMDicyb tYIMHgi9ZcUlrfb3o2NPKdZbdjyFiOI0Jd+8djcUBqOIWt/rau+nyg8Hsfkwyw== 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 4Qb9Ds6R7gzVdZ; Tue, 6 Jun 2023 12:45:33 +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 356CjXG1034794; Tue, 6 Jun 2023 12:45:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 356CjXmc034793; Tue, 6 Jun 2023 12:45:33 GMT (envelope-from git) Date: Tue, 6 Jun 2023 12:45:33 GMT Message-Id: <202306061245.356CjXmc034793@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 52503c4477cc - stable/12 - sftp: avoid leaking path arg in calls to make_absolute_pwd_glob List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 52503c4477ccba162baca69fb2801f26ff5a5572 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=52503c4477ccba162baca69fb2801f26ff5a5572 commit 52503c4477ccba162baca69fb2801f26ff5a5572 Author: Ed Maste AuthorDate: 2022-11-03 17:17:40 +0000 Commit: Ed Maste CommitDate: 2023-06-05 19:07:56 +0000 sftp: avoid leaking path arg in calls to make_absolute_pwd_glob As Coverity reports: Overwriting tmp in tmp = make_absolute_pwd_glob(tmp, remote_path) leaks the storage that tmp points to. Consume the first arg in make_absolute_pwd_glob, and add xstrdup() to the one case which did not assign to the same variable that was passed in. With this change make_absolute() and make_absolute_pwd_glob() have the same semantics with respect to freeing the input string. This change was reported to OpenSSH in https://lists.mindrot.org/pipermail/openssh-unix-dev/2022-November/040497.html [and was later adopted upstream]. Reported by: Coverity Scan CID: 1500409 Reviewed by: markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D37253 (cherry picked from commit 69c72a57af843267b220f8367c4cc7162a12d696) (cherry picked from commit 533a942a213c9e852265f94d27f1e9768294eaa6) --- crypto/openssh/sftp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crypto/openssh/sftp.c b/crypto/openssh/sftp.c index c3c347e087e4..630e7773af75 100644 --- a/crypto/openssh/sftp.c +++ b/crypto/openssh/sftp.c @@ -621,14 +621,14 @@ escape_glob(const char *s) } static char * -make_absolute_pwd_glob(const char *p, const char *pwd) +make_absolute_pwd_glob(char *p, const char *pwd) { char *ret, *escpwd; escpwd = escape_glob(pwd); if (p == NULL) return escpwd; - ret = make_absolute(xstrdup(p), escpwd); + ret = make_absolute(p, escpwd); free(escpwd); return ret; } @@ -641,7 +641,7 @@ process_get(struct sftp_conn *conn, const char *src, const char *dst, glob_t g; int i, r, err = 0; - abs_src = make_absolute_pwd_glob(src, pwd); + abs_src = make_absolute_pwd_glob(xstrdup(src), pwd); memset(&g, 0, sizeof(g)); debug3("Looking up %s", abs_src); From nobody Wed Jun 7 22:35:10 2023 X-Original-To: dev-commits-src-branches@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 4Qc2Gk6yM4z4bZhN; Wed, 7 Jun 2023 22:35:10 +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 4Qc2Gk6M22z4MY1; Wed, 7 Jun 2023 22:35:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686177310; 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=VbyyFD1jHmSYJSaPxzLtOcbQh/h6jojz71idngLWrN8=; b=CvqX+bsxFY1saWJ2GBWKUwEznD04BVQAGv8cqjlceGob9TPfsTw5+y2ZdkZMTzr0ZHOMjX Dim+t2QRr3DikMpYEIakd3D0PkIaJVuLFvjmd3YgFaxi6yPFs9b9OhjK/RaGbOnfn7DnwI ZGwzOiR2BIgghs+MUdUmAPBeyoy2q68T/9euLWu68GQ3S1dxoDSXoFSv9R3XCn2PqiZ+U6 APkthNhzInn2mmLaemIiKyFco5CuPuncuG+FnRw6rpvkLsdWOXKLyLZ/TAeF0ey1SoKOPJ ZFXXOTBskyH8hizdq7cZ3Jj2vFKEfu/13CS6Bydhls6lzd1SQ912BdAbSRl1QQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686177310; 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=VbyyFD1jHmSYJSaPxzLtOcbQh/h6jojz71idngLWrN8=; b=AoJIWKVwGQfVyG75Ly6C0SnSwEURCESLlb+gL9kaL98eHnruxdxfXyFPuqFGk17i8oJODO SposaC8D3tkbKu9Z6o83I0Jnvfpj5zQupvny1Hh1OI/xnprjXT8Ve7XfCYd7Ty4IZi2ANO 7AWMUEXH9HWofYdwm7Nyog3jWDUG9+qsb3CK30kGUKyC5jrw0xAFfVbf5ZqifUkJGWHFbN bgv03rC2yCL1fOgGJafuI3pXbqHQAGM0BLk060hJnByo+qsz5BZbxdKmcEffBqZq3z1iPl 9gfKP9K+Q7/ZCubhe2lDNDJiu59xgCXWlU9jTzSE9DNbFTWfnFYFZWUiV66U1g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686177310; a=rsa-sha256; cv=none; b=t/u8GpMHVZN9MiGV1gUhWEVbRqGbXuw0SA4l4ZHNifFTsWfcCTaoKVjtGlSOSweSypHsxG 1QI4kJiFXZxYTmWu6MQ34k+8SnmvVgZtznD4ddO4Exrgpd2VgEEWZtAU9hgsMJwdNwE1Sm 7ycd4eNuRMkyKFxLRa170WW3muly0ZUnFYJKtLKGGr7cckseOJSfYLPBlqd31dl7u6gW7F REae2UjldeyHTtr3/6XvhV4XG6Q1JUHcDbsOfSMQ++DywVJQ//xT50X1XJ9UTmGRKeM3As ++j85m7uHCYDEmdpX4c/2bKagdEtWsr10Y0fe0krSq9ZLG3ywOML+dsZ/Nhuhg== 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 4Qc2Gk56hWzVDQ; Wed, 7 Jun 2023 22:35:10 +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 357MZAKS081839; Wed, 7 Jun 2023 22:35:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 357MZALh081838; Wed, 7 Jun 2023 22:35:10 GMT (envelope-from git) Date: Wed, 7 Jun 2023 22:35:10 GMT Message-Id: <202306072235.357MZALh081838@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kirk McKusick Subject: git: 007322a94cee - stable/13 - Add the ability to adjust directory depths to background fsck_ffs(8). List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 007322a94ceeca654c3bb3bf1fdf6e2bea30d683 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=007322a94ceeca654c3bb3bf1fdf6e2bea30d683 commit 007322a94ceeca654c3bb3bf1fdf6e2bea30d683 Author: Kirk McKusick AuthorDate: 2023-05-26 02:27:04 +0000 Commit: Kirk McKusick CommitDate: 2023-06-07 22:34:39 +0000 Add the ability to adjust directory depths to background fsck_ffs(8). Sponsored by: The FreeBSD Foundation (cherry picked from commit e4a905d1e0d94ddb8e15de50d37e67f13e058047) --- sbin/fsck_ffs/dir.c | 26 +++++++++++++++++++++----- sbin/fsck_ffs/fsck.h | 1 + sbin/fsck_ffs/globs.c | 2 ++ sys/ufs/ffs/ffs_alloc.c | 28 ++++++++++++++++++++++++++++ sys/ufs/ffs/fs.h | 3 ++- 5 files changed, 54 insertions(+), 6 deletions(-) diff --git a/sbin/fsck_ffs/dir.c b/sbin/fsck_ffs/dir.c index cc5305c390a4..e5f0e1e7e7f4 100644 --- a/sbin/fsck_ffs/dir.c +++ b/sbin/fsck_ffs/dir.c @@ -105,6 +105,7 @@ check_dirdepth(struct inoinfo *inp) struct inode ip; union dinode *dp; int saveresolved; + size_t size; static int updateasked, dirdepthupdate; if ((parentinp = getinoinfo(inp->i_parent)) == NULL) { @@ -141,9 +142,11 @@ check_dirdepth(struct inoinfo *inp) } } /* - * If we are not converting, nothing more to do. + * If we are not converting or we are running in no-write mode + * there is nothing more to do. */ - if (inp->i_depth == 0 && dirdepthupdate == 0) + if ((inp->i_depth == 0 && dirdepthupdate == 0) || + (fswritefd < 0 && bkgrdflag == 0)) return; /* * Individual directory at wrong depth. Report it and correct if @@ -174,8 +177,20 @@ check_dirdepth(struct inoinfo *inp) printf(" (ADJUSTED)\n"); } inp->i_depth = parentinp->i_depth + 1; - DIP_SET(dp, di_dirdepth, inp->i_depth); - inodirty(&ip); + if (bkgrdflag == 0) { + DIP_SET(dp, di_dirdepth, inp->i_depth); + inodirty(&ip); + } else { + cmd.value = inp->i_number; + cmd.size = (int64_t)inp->i_depth - DIP(dp, di_dirdepth); + if (debug) + printf("adjdepth ino %ld amt %jd\n", (long)cmd.value, + (intmax_t)cmd.size); + size = MIBSIZE; + if (sysctlnametomib("vfs.ffs.adjdepth", adjdepth, &size) < 0 || + sysctl(adjdepth, MIBSIZE, 0, 0, &cmd, sizeof cmd) == -1) + rwerror("ADJUST INODE DEPTH", cmd.value); + } irelse(&ip); } @@ -506,7 +521,8 @@ adjust(struct inodesc *idesc, int lcnt) (long long)cmd.size); if (sysctl(adjrefcnt, MIBSIZE, 0, 0, &cmd, sizeof cmd) == -1) - rwerror("ADJUST INODE", cmd.value); + rwerror("ADJUST INODE LINK COUNT", + cmd.value); } } } diff --git a/sbin/fsck_ffs/fsck.h b/sbin/fsck_ffs/fsck.h index 4e5878b0b12f..9f9b1e0a8857 100644 --- a/sbin/fsck_ffs/fsck.h +++ b/sbin/fsck_ffs/fsck.h @@ -333,6 +333,7 @@ extern int adjnbfree[MIBSIZE]; /* MIB cmd to adjust number of free blocks */ extern int adjnifree[MIBSIZE]; /* MIB cmd to adjust number of free inodes */ extern int adjnffree[MIBSIZE]; /* MIB cmd to adjust number of free frags */ extern int adjnumclusters[MIBSIZE]; /* MIB cmd adjust number of free clusters */ +extern int adjdepth[MIBSIZE]; /* MIB cmd to adjust directory depth count */ extern int freefiles[MIBSIZE]; /* MIB cmd to free a set of files */ extern int freedirs[MIBSIZE]; /* MIB cmd to free a set of directories */ extern int freeblks[MIBSIZE]; /* MIB cmd to free a set of data blocks */ diff --git a/sbin/fsck_ffs/globs.c b/sbin/fsck_ffs/globs.c index 92e77b61f9d4..2340636fe3a9 100644 --- a/sbin/fsck_ffs/globs.c +++ b/sbin/fsck_ffs/globs.c @@ -68,6 +68,7 @@ int adjnbfree[MIBSIZE]; /* MIB command to adjust number of free blocks */ int adjnifree[MIBSIZE]; /* MIB command to adjust number of free inodes */ int adjnffree[MIBSIZE]; /* MIB command to adjust number of free frags */ int adjnumclusters[MIBSIZE]; /* MIB command to adjust number of free clusters */ +int adjdepth[MIBSIZE]; /* MIB cmd to adjust directory depth count */ int freefiles[MIBSIZE]; /* MIB command to free a set of files */ int freedirs[MIBSIZE]; /* MIB command to free a set of directories */ int freeblks[MIBSIZE]; /* MIB command to free a set of data blocks */ @@ -141,6 +142,7 @@ fsckinit(void) bzero(adjnifree, sizeof(int) * MIBSIZE); bzero(adjnffree, sizeof(int) * MIBSIZE); bzero(adjnumclusters, sizeof(int) * MIBSIZE); + bzero(adjdepth, sizeof(int) * MIBSIZE); bzero(freefiles, sizeof(int) * MIBSIZE); bzero(freedirs, sizeof(int) * MIBSIZE); bzero(freeblks, sizeof(int) * MIBSIZE); diff --git a/sys/ufs/ffs/ffs_alloc.c b/sys/ufs/ffs/ffs_alloc.c index 6d37afcfadf6..195ba9f8a299 100644 --- a/sys/ufs/ffs/ffs_alloc.c +++ b/sys/ufs/ffs/ffs_alloc.c @@ -3108,6 +3108,8 @@ ffs_fserr(struct fs *fs, * the count to zero will cause the inode to be freed. * adjblkcnt(inode, amt) - adjust the number of blocks used by the * inode by the specified amount. + * adjdepth(inode, amt) - adjust the depth of the specified directory + * inode by the specified amount. * setsize(inode, size) - set the size of the inode to the * specified size. * adjndir, adjbfree, adjifree, adjffree, adjnumclusters(amt) - @@ -3142,6 +3144,10 @@ static SYSCTL_NODE(_vfs_ffs, FFS_ADJ_BLKCNT, adjblkcnt, CTLFLAG_WR | CTLFLAG_NEEDGIANT, sysctl_ffs_fsck, "Adjust Inode Used Blocks Count"); +static SYSCTL_NODE(_vfs_ffs, FFS_ADJ_DEPTH, adjdepth, + CTLFLAG_WR | CTLFLAG_NEEDGIANT, sysctl_ffs_fsck, + "Adjust Directory Inode Depth"); + static SYSCTL_NODE(_vfs_ffs, FFS_SET_SIZE, setsize, CTLFLAG_WR | CTLFLAG_NEEDGIANT, sysctl_ffs_fsck, "Set the inode size"); @@ -3299,6 +3305,28 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) vput(vp); break; + case FFS_ADJ_DEPTH: +#ifdef DIAGNOSTIC + if (fsckcmds) { + printf("%s: adjust directory inode %jd depth by %jd\n", + mp->mnt_stat.f_mntonname, (intmax_t)cmd.value, + (intmax_t)cmd.size); + } +#endif /* DIAGNOSTIC */ + if ((error = ffs_vget(mp, (ino_t)cmd.value, LK_EXCLUSIVE, &vp))) + break; + if (vp->v_type != VDIR) { + vput(vp); + error = ENOTDIR; + break; + } + ip = VTOI(vp); + DIP_SET(ip, i_dirdepth, DIP(ip, i_dirdepth) + cmd.size); + UFS_INODE_SET_FLAG(ip, IN_CHANGE | IN_MODIFIED); + error = ffs_update(vp, 1); + vput(vp); + break; + case FFS_SET_SIZE: #ifdef DIAGNOSTIC if (fsckcmds) { diff --git a/sys/ufs/ffs/fs.h b/sys/ufs/ffs/fs.h index b2ed2051471c..70e24242b01b 100644 --- a/sys/ufs/ffs/fs.h +++ b/sys/ufs/ffs/fs.h @@ -224,7 +224,8 @@ /* Was FFS_SET_INODE 15 */ /* Was FFS_SET_BUFOUTPUT 16 */ #define FFS_SET_SIZE 17 /* set inode size */ -#define FFS_MAXID 17 /* number of valid ffs ids */ +#define FFS_ADJ_DEPTH 18 /* adjust directory inode depth */ +#define FFS_MAXID 18 /* number of valid ffs ids */ /* * Command structure passed in to the filesystem to adjust filesystem values. From nobody Wed Jun 7 22:37:25 2023 X-Original-To: dev-commits-src-branches@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 4Qc2KL26mDz4bZmD; Wed, 7 Jun 2023 22:37:26 +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 4Qc2KL19Rsz4N29; Wed, 7 Jun 2023 22:37:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686177446; 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=mBuxoxQ4xJfraKV8PlVFA0eq+k6/ZpQ5CI3Y5TxMebY=; b=dZG8RcGSea+q2tilzHygt/t+y6rIjuUm7u8yxdvAfwyPOmuoXA72sIbnCZFJfafel580PZ CkkUaHFS6no1Z4m9arpEKETti5ZlDuw/KJ4h9sSu1+RsTCda5E/bhQ/DYEiQ+bJimHE31h KbV9CknF0JTqu95nA+w8AIqYn1IwxgOxX04P0VGsRbqBc5buJ5icad+388AUbmGTFBrGUi p9WLvu0//Mi8Gx45Yg3SvVkx1/T8KZ7RSD6rCG7cuA1oI9ZTqWaSl1h7OaW/7MI2bQVMSx +FWGTSabHOlpfgF2f0WD/RckzHgLSDnDOWkx4Qx+hWmAyJC1uajPJMvKiaI4iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686177446; 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=mBuxoxQ4xJfraKV8PlVFA0eq+k6/ZpQ5CI3Y5TxMebY=; b=oLnM3lK/9fee7oyq1iQIdoTNDjeEg4hAS1ZFcaT18vS52FmixKsT6VSPjaqQnSK/ROWZww AkrkPzRXga1aiEBuFEJIoyaJvZ4BuSaHq5WwDOK4eaPPHutTkGGFW482nuu6077qMu4QBo QU7KfR3dSSDhmV8SFtBrD2fm1z4a/TA4EbHpVOZgyZKrTFnD2caPalzodiNGMc/3FQgcn1 OvnfDLwGhZLmQOFYq5PnuSamyt0uq8bToE7b7eqEaFn928cUh8nL3HDGi7bp2SNQTUHwVn Y71OtPifAiMJk2IhYeSOJaq/ZPLl+FykAUxhOuvmL8haX15Df4UQOT6kkmNliA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686177446; a=rsa-sha256; cv=none; b=cLUqQeXcOcVRw58/V/fb5NogIMEFJAWiCQm7dEZhBeWWnte7m/tA0rlBZJafCLO+2HXFNy lCGApwMwf5jLU5pSbKlWXwaIUA0KSr1rlsTWwWolNaQ74L6E2blzdsOOCQmq0JMlPUNvRI gv3t9pFhDejZ1dBpGVVfcGE7dHPWF2n+QkfwuOJio7jp+OJYAGT2sTBNBGhRu3ZRQN1zfR DpWGSUT8Q1kfC4hIXB95ySlQ8FVf61ilywGH5hDMvFs4vlpsWaE9XGncrv2spPt5Lw1jfh YXBChUXAA9hghZYvekiN+mQgdy6OxdUgQ5Zr979LlZ+mQNaoCahSujCqO3/4AA== 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 4Qc2KL0Cj3zV9y; Wed, 7 Jun 2023 22:37:26 +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 357MbP3b082205; Wed, 7 Jun 2023 22:37:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 357MbPTO082204; Wed, 7 Jun 2023 22:37:25 GMT (envelope-from git) Date: Wed, 7 Jun 2023 22:37:25 GMT Message-Id: <202306072237.357MbPTO082204@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kirk McKusick Subject: git: 77cbed11b2ea - stable/13 - Do not try to adjust a directory depth when its reconnection is declined. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 77cbed11b2eabaa811963c60e83e83fd6677fca3 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=77cbed11b2eabaa811963c60e83e83fd6677fca3 commit 77cbed11b2eabaa811963c60e83e83fd6677fca3 Author: Kirk McKusick AuthorDate: 2023-05-27 05:55:11 +0000 Commit: Kirk McKusick CommitDate: 2023-06-07 22:36:39 +0000 Do not try to adjust a directory depth when its reconnection is declined. Sponsored by: The FreeBSD Foundation (cherry picked from commit 49943856eb2710c6a6debdfa40d89d31d3fdb8ea) --- sbin/fsck_ffs/pass3.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sbin/fsck_ffs/pass3.c b/sbin/fsck_ffs/pass3.c index b9d24f18371b..49cb43620392 100644 --- a/sbin/fsck_ffs/pass3.c +++ b/sbin/fsck_ffs/pass3.c @@ -100,10 +100,10 @@ pass3(void) if (linkup(orphan, inp->i_dotdot, NULL)) { inp->i_parent = inp->i_dotdot = lfdir; inoinfo(lfdir)->ino_linkcnt--; + inoinfo(orphan)->ino_state = DFOUND; + check_dirdepth(inp); + propagate(); } - inoinfo(orphan)->ino_state = DFOUND; - check_dirdepth(inp); - propagate(); continue; } pfatal("ORPHANED DIRECTORY LOOP DETECTED I=%lu", From nobody Wed Jun 7 23:15:34 2023 X-Original-To: dev-commits-src-branches@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 4Qc39L6lvvz4bhRm; Wed, 7 Jun 2023 23:15:34 +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 4Qc39L6HhWz3Cw6; Wed, 7 Jun 2023 23:15:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686179734; 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=T3Q/JLCxW5eWncLJTFrQxpOlxVeBdWp7NpdCKPZAyA0=; b=rmuUSw1OmW5McZNIwIvz2QKSlHN0h91zG0rU84JClpmsJdcCLxahtkVOtNXgN7sDFe5ieM IHyKp3J8BOKAVQt10hys/e0ZU9/1y+xaCNBA/awHsMhY1rww1W854LMNqMMsIccOLoao1Y EeLjdSUeVyG4Ij5DOYAxayn94CXBLODsatRBUrtA9y/tLWQch+L0hPO3OaT90rjxufibFb 2RwKP2hk3baf9y9E5OdE4XAx0LnKu/YAqmgJg+StusLHCN+xYxtXlZ9tIaj8s3JYgeHH4q 6gKsooYpxtuBg3XyaMFCdEUdSEu38FnyRJ9zYw+cfZFp2mfWxd24vZyhyEgogQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686179734; 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=T3Q/JLCxW5eWncLJTFrQxpOlxVeBdWp7NpdCKPZAyA0=; b=W0Q8/QyY6VAlz7RepPw5qUTzOTvObsQLZhyRgCaqRKozhKl8AkQT19QyHHoIF/EEtUYuhB eFaglm2gUCe1AGhxdb+wwkYK7kOXgJxnqv1v2GFa/YXpgu9zIBid7z9mjxInNF4lBKCxCL zeYN8R+JkJfur/ecoqQjh6PLXZNq248RO+KMC0HTcXBQmwN3DzZJJ2jBWbzZGHQ8qGoozI b4fnKcrgYOTNFpYt/rN/ccJG2W2w7COp0O0gI+16ifgQCWbDQSW2rSi+5zAlR1leFxvkak fQSf249FDBqHjUwpoJ+i/t91bc8e04ljA56FZLg++pdAba59mHcdZTw37HWyzg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686179734; a=rsa-sha256; cv=none; b=KgaeJcWrSQnT7iUGrR44Sn9ue310BrPPULE6dZFuWbLZtzPXHttARjRwzS4HcoMpXlnHcM jYk1kGTVLOMsmhDdw168p8SPCR2kuZPUeTXIb3SERm8whRL25RQggBRSTaA7j98SUzKwnu fx74EftnBdSSI7QNver3zOtYsrSX88hGMYa2kL9NxZVQ3lQ6MPiISx4AD0jov/EwSdSaFh fgmh+hSyQ8LYcjcGKTgwhc2ilOFbHlVRjI8WdT3atUMQBP2+9fdrOb+82ZKrMq9aYVFjD+ B9t90mx9qK2Feboba7mlmj8VcSvBGHJ+/jMqpFQoTXOBGTvSXU4Sqawl0jr5bw== 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 4Qc39L5MNBzWGG; Wed, 7 Jun 2023 23:15:34 +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 357NFYpC048376; Wed, 7 Jun 2023 23:15:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 357NFYo6048375; Wed, 7 Jun 2023 23:15:34 GMT (envelope-from git) Date: Wed, 7 Jun 2023 23:15:34 GMT Message-Id: <202306072315.357NFYo6048375@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kirk McKusick Subject: git: 52f50301aaab - stable/13 - Correct two bugs in fsck_ffs(8) triggered by corrupted filesystems. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 52f50301aaabddc6e3c1bc8c354101cfd7ea0463 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=52f50301aaabddc6e3c1bc8c354101cfd7ea0463 commit 52f50301aaabddc6e3c1bc8c354101cfd7ea0463 Author: Kirk McKusick AuthorDate: 2023-05-27 05:41:57 +0000 Commit: Kirk McKusick CommitDate: 2023-06-07 22:40:35 +0000 Correct two bugs in fsck_ffs(8) triggered by corrupted filesystems. Reported-by: Robert Morris PR: 271310 PR: 271354 Sponsored-by: The FreeBSD Foundation (cherry picked from commit 03a8680202ef7d7e68adc70625633c490b4ed637) --- sbin/fsck_ffs/pass1.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sbin/fsck_ffs/pass1.c b/sbin/fsck_ffs/pass1.c index e784fd29dc1c..863bf34ff0fc 100644 --- a/sbin/fsck_ffs/pass1.c +++ b/sbin/fsck_ffs/pass1.c @@ -400,13 +400,13 @@ checkinode(ino_t inumber, struct inodesc *idesc, int rebuiltcg) if (mode == IFDIR) { if (DIP(dp, di_size) == 0) { inoinfo(inumber)->ino_state = DCLEAR; - } else if (DIP(dp, di_nlink) <= 0) { + } else if (DIP(dp, di_nlink) == 0) { inoinfo(inumber)->ino_state = DZLINK; } else { inoinfo(inumber)->ino_state = DSTATE; - cacheino(dp, inumber); - countdirs++; } + cacheino(dp, inumber); + countdirs++; } else if (DIP(dp, di_nlink) <= 0) inoinfo(inumber)->ino_state = FZLINK; else From nobody Wed Jun 7 23:15:35 2023 X-Original-To: dev-commits-src-branches@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 4Qc39N1hFGz4bhlX; Wed, 7 Jun 2023 23:15:36 +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 4Qc39N0hGdz3CwR; Wed, 7 Jun 2023 23:15:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686179736; 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=1Wkjd8LdrLkLgun+BB9ZfMp9qPA08w9lGRwWlPl4GZ8=; b=Ci2SRY/gWPaMhZ9VCeB5apKvNvdJq8Tkim96IMNPvH+Q5FVj8J70ugYtLEojwQRcWdvzm2 Lv8AAEUQq8FcBlXpOMS9dg5Ot7ZhIA9P5VYROXO31PawBjFhp+zIH0AdSMAnDIDBeTB1xg oYo4N4WfzCEcxSuVqFrbY1kYSc+Ce/aObItm3szKvUhvV6S+WBGru3koimlv6Q53XURdZ7 shtLPDs+byJt8M8S8vgytA/ni1SaQ5WzmzXpmTNXj2wHBJfQy9k0hJXNs7KYaKeLbwVPby M/pju8HQ2mEMvJtcnPyLzIJp9sBjtN+7n598iOcd/xDBvrHDxsX1rmtiRnCKuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686179736; 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=1Wkjd8LdrLkLgun+BB9ZfMp9qPA08w9lGRwWlPl4GZ8=; b=BYnCaH83wyZRmFoqjMARFwFXsNPGSZo1YYrJ7VpBbS7bgZ56Dyx5G+cjVtr1k5HMXQu0W4 xdzkYPUISbq4JRACfH0qQeP0pYhMNMLuCOt9gDoB2j1oqPZZAP/NDMXLTR0PWBs0/Dq228 uJ6M+GFX2wJIo4gnKsabwesWzgJFMUzDGv8mwR6/zCHPIDDhj2B80pGxTyAOcqfvObdO8H szpVV9VjlGd3S+iSNg3e4ajfu2BU/n3OFwkFDrd9qxZ/TsH5UOHYKRCJWL2DDkFZzL3Ima 1rzTNJtuM7emZzPoQmyS8b9w3QDNNbDrUFzq3XriMotUDrOhhi6Qy8JkFRM0VQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686179736; a=rsa-sha256; cv=none; b=kYFw2sxZ08SzHIdaHdxeFTJoiRCyfL8LRvihsxSuPt5LVY8YC1mh5f3gPev0N7B4Kwm587 BZ9E7L1UnnRPl7IYPyKWj5FK+YAdnm6z0lmD1RENggozs/IPdMCtgv7ie7aWDcfyZX/fGa FkDVtp6njL0jyuU/8HEz6N7JAL0UolssW73rmEpEz0VPmJMLuTYsoxw8MYUcgPNFh4U5oh bFJcswc6JSVvA7A3ZWM4IOzgUCTMnk9BoR7SGVDZy4Qk+czzIdu3kKadiYh0tt6GUViowt hs+Tl7HAV0mAE8xNlt2xfzGpmqimwolFOTGmLQQp0n9Ge+y5Pwejfc3/CsfiOg== 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 4Qc39M6HQVzWGH; Wed, 7 Jun 2023 23:15:35 +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 357NFZG1048398; Wed, 7 Jun 2023 23:15:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 357NFZrR048397; Wed, 7 Jun 2023 23:15:35 GMT (envelope-from git) Date: Wed, 7 Jun 2023 23:15:35 GMT Message-Id: <202306072315.357NFZrR048397@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kirk McKusick Subject: git: fbfbd0638a5a - stable/13 - Fix a bug in fsck_ffs(8) triggered by corrupted filesystems. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: fbfbd0638a5a3dd4f76eaf17f81450cc09d48e5b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=fbfbd0638a5a3dd4f76eaf17f81450cc09d48e5b commit fbfbd0638a5a3dd4f76eaf17f81450cc09d48e5b Author: Kirk McKusick AuthorDate: 2023-05-27 23:07:09 +0000 Commit: Kirk McKusick CommitDate: 2023-06-07 22:44:12 +0000 Fix a bug in fsck_ffs(8) triggered by corrupted filesystems. The last valid inode in the filesystem is maxino - 1, not maxino. Thus validity checks should ino < maxino, not ino <= maxino. Reported-by: Robert Morris PR: 271312 Sponsored-by: The FreeBSD Foundation (cherry picked from commit 11ce203e0535c1c8f520c9bda81ab9326cf5db80) --- sbin/fsck_ffs/dir.c | 4 ++-- sbin/fsck_ffs/fsutil.c | 2 +- sbin/fsck_ffs/inode.c | 14 ++++++++------ sbin/fsck_ffs/pass2.c | 4 ++-- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/sbin/fsck_ffs/dir.c b/sbin/fsck_ffs/dir.c index e5f0e1e7e7f4..7ea471bcb30a 100644 --- a/sbin/fsck_ffs/dir.c +++ b/sbin/fsck_ffs/dir.c @@ -126,7 +126,7 @@ check_dirdepth(struct inoinfo *inp) if (inp->i_depth == 0 && updateasked == 0) { updateasked = 1; if (preen) { - pwarn("UPDATING FILESYSTEM TO TRACK DIRECTORY DEPTH"); + pwarn("UPDATING FILESYSTEM TO TRACK DIRECTORY DEPTH\n"); dirdepthupdate = 1; } else { /* @@ -437,7 +437,7 @@ fileerror(ino_t cwd, ino_t ino, const char *errmesg) char pathbuf[MAXPATHLEN + 1]; pwarn("%s ", errmesg); - if (ino < UFS_ROOTINO || ino > maxino) { + if (ino < UFS_ROOTINO || ino >= maxino) { pfatal("out-of-range inode number %ju", (uintmax_t)ino); return; } diff --git a/sbin/fsck_ffs/fsutil.c b/sbin/fsck_ffs/fsutil.c index bed87299a3cf..419d0e91a1df 100644 --- a/sbin/fsck_ffs/fsutil.c +++ b/sbin/fsck_ffs/fsutil.c @@ -169,7 +169,7 @@ inoinfo(ino_t inum) struct inostatlist *ilp; int iloff; - if (inum > maxino) + if (inum >= maxino) errx(EEXIT, "inoinfo: inumber %ju out of range", (uintmax_t)inum); ilp = &inostathead[inum / sblock.fs_ipg]; diff --git a/sbin/fsck_ffs/inode.c b/sbin/fsck_ffs/inode.c index 00a60157138c..7dca95129ed1 100644 --- a/sbin/fsck_ffs/inode.c +++ b/sbin/fsck_ffs/inode.c @@ -433,8 +433,9 @@ void ginode(ino_t inumber, struct inode *ip) { ufs2_daddr_t iblk; + struct ufs2_dinode *dp; - if (inumber < UFS_ROOTINO || inumber > maxino) + if (inumber < UFS_ROOTINO || inumber >= maxino) errx(EEXIT, "bad inode number %ju to ginode", (uintmax_t)inumber); ip->i_number = inumber; @@ -473,14 +474,15 @@ ginode(ino_t inumber, struct inode *ip) } ip->i_dp = (union dinode *) &ip->i_bp->b_un.b_dinode2[inumber - ip->i_bp->b_index]; - if (ffs_verify_dinode_ckhash(&sblock, (struct ufs2_dinode *)ip->i_dp)) { + dp = (struct ufs2_dinode *)ip->i_dp; + /* Do not check hash of inodes being created */ + if (dp->di_mode != 0 && ffs_verify_dinode_ckhash(&sblock, dp)) { pwarn("INODE CHECK-HASH FAILED"); prtinode(ip); if (preen || reply("FIX") != 0) { if (preen) printf(" (FIXED)\n"); - ffs_update_dinode_ckhash(&sblock, - (struct ufs2_dinode *)ip->i_dp); + ffs_update_dinode_ckhash(&sblock, dp); inodirty(ip); } } @@ -1292,7 +1294,7 @@ findino(struct inodesc *idesc) if (dirp->d_ino == 0) return (KEEPON); if (strcmp(dirp->d_name, idesc->id_name) == 0 && - dirp->d_ino >= UFS_ROOTINO && dirp->d_ino <= maxino) { + dirp->d_ino >= UFS_ROOTINO && dirp->d_ino < maxino) { idesc->id_parent = dirp->d_ino; return (STOP|FOUND); } @@ -1322,7 +1324,7 @@ prtinode(struct inode *ip) dp = ip->i_dp; printf(" I=%lu ", (u_long)ip->i_number); - if (ip->i_number < UFS_ROOTINO || ip->i_number > maxino) + if (ip->i_number < UFS_ROOTINO || ip->i_number >= maxino) return; printf(" OWNER="); if ((pw = getpwuid((int)DIP(dp, di_uid))) != NULL) diff --git a/sbin/fsck_ffs/pass2.c b/sbin/fsck_ffs/pass2.c index 8200209cc03e..48bf27a8b142 100644 --- a/sbin/fsck_ffs/pass2.c +++ b/sbin/fsck_ffs/pass2.c @@ -371,7 +371,7 @@ chk1: dirp->d_reclen = proto.d_reclen; } if (dirp->d_ino != 0 && strcmp(dirp->d_name, "..") == 0) { - if (dirp->d_ino > maxino) { + if (dirp->d_ino >= maxino) { direrror(idesc->id_number, "BAD INODE NUMBER FOR '..'"); /* * If we know parent set it now, otherwise let it @@ -471,7 +471,7 @@ chk2: } idesc->id_entryno++; n = 0; - if (dirp->d_ino > maxino) { + if (dirp->d_ino >= maxino) { fileerror(idesc->id_number, dirp->d_ino, "I OUT OF RANGE"); n = reply("REMOVE"); } else if (((dirp->d_ino == UFS_WINO && dirp->d_type != DT_WHT) || From nobody Wed Jun 7 23:15:36 2023 X-Original-To: dev-commits-src-branches@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 4Qc39P1KsNz4bhV9; Wed, 7 Jun 2023 23:15:37 +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 4Qc39P0t8Vz3CqJ; Wed, 7 Jun 2023 23:15:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686179737; 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=xpPaRajNb1mK3yTkuQolV1hswqguQ+k48eWAJcINGeY=; b=ob7qNmZbNTaoZuV8I+rQ0pGojOPXmhvKbG1UvuSRUGNRy04NvfXaQhwj/Yg2i4fRyeSPTp 6Z2cjIaas5OB7R+6JYZ8i5nXISgHXQU991oyKIxGDU476dGfUcX+HZkhyJBpEmgta1Jxo8 YQZk4qO7N0v+KLHbcCrnyaGQn/Y8wQ5JuHplMr9CxhIp+kbbMbt/7o2RwpFAldA1F+mBTC 2xYYOjL3d93CAqZm//BY8jb64iP+yP1sxq5aefqu2svUDB1iet0ZZzTMguqt/08C8y+lAE 1hDpIeDFDznKxlpTHhJ+l+o3F+cN7/n65UihlPyFZz18oi/jAxEdNbrWSweG1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686179737; 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=xpPaRajNb1mK3yTkuQolV1hswqguQ+k48eWAJcINGeY=; b=xktGH4p7Du/SvgV41e31H8LkLvRlrJmTLspHvU6yCAvmLJhoO2kGVQuMxQPmPtsCz9B+6q WfPQzaWkI3B4saPVgSOlwoCuWMuXY+4i4LTekZ/YUn+kEn8vlU+To5piqW37ff+cVgvDd1 cEvLuiUiqi2gCpsdCb1lPcndGVPAAOV9Fgn48XQO+XJku2PiVoc/nhPC+6+vEA+SDcdLV2 gnb23bpKZaBjNBA2S9WGuMjcc+cyNrHNBqFPWMk70HpR1rqNtO4IbXgkB6SoBRpVcMIS6b kpzB7X1ZlJM+1K/nyVDFupBOhElzfXNOJTWjPELzEVi7M8LYWh+G/kADnKTP1g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686179737; a=rsa-sha256; cv=none; b=Vgq6oNHgWd6wTgleEag5Kic5ntcAHgUsbFLY3VS8T9AP4NWeFhiS21dNfbdPtJnc6v9Yfl +5uc2BUMOANp2RCEMbi7eyYKrcDh9JxDs9L9pTKfPSDz4Bns+bKAQzf/V9KJhQTbdY0lyN jQw/dVxS3pwp2Vwdzi7yrXjL4HT8Av42NQzFt1Y5koZM8y0mRBX3CIarT/gpzdwxYfsQHw RW2UpWykvruofyF1UfRoVhaObuVq9SfEW8fIWoOzmgDrEPK2F5XR6MLDBluXmTaxQmo183 PSzZbYaG/Q1OHI7QN7thl4NozqjzMvZEqh1GXMVgBelNFhp7cxtTz2ARmqc1VQ== 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 4Qc39N721BzWGJ; Wed, 7 Jun 2023 23:15:36 +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 357NFaHK048422; Wed, 7 Jun 2023 23:15:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 357NFaHD048421; Wed, 7 Jun 2023 23:15:36 GMT (envelope-from git) Date: Wed, 7 Jun 2023 23:15:36 GMT Message-Id: <202306072315.357NFaHD048421@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kirk McKusick Subject: git: 3035f98d56eb - stable/13 - Fix a bug in fsck_ffs(8) triggered by corrupted filesystems. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3035f98d56eb72240c6260d667427ab4ade08b45 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=3035f98d56eb72240c6260d667427ab4ade08b45 commit 3035f98d56eb72240c6260d667427ab4ade08b45 Author: Kirk McKusick AuthorDate: 2023-05-28 00:09:02 +0000 Commit: Kirk McKusick CommitDate: 2023-06-07 22:46:53 +0000 Fix a bug in fsck_ffs(8) triggered by corrupted filesystems. Reported-by: Robert Morris PR: 271378 Sponsored-by: The FreeBSD Foundation (cherry picked from commit 101a9ac07128a17d8797cc3e93978d2cfa457e99) --- sbin/fsck_ffs/fsck.h | 1 + sbin/fsck_ffs/fsutil.c | 25 +++++++++++++++++++++++++ sbin/fsck_ffs/pass1.c | 12 +----------- sbin/fsck_ffs/suj.c | 3 +++ 4 files changed, 30 insertions(+), 11 deletions(-) diff --git a/sbin/fsck_ffs/fsck.h b/sbin/fsck_ffs/fsck.h index 9f9b1e0a8857..4f77fc39f3f7 100644 --- a/sbin/fsck_ffs/fsck.h +++ b/sbin/fsck_ffs/fsck.h @@ -471,6 +471,7 @@ void check_blkcnt(struct inode *ip); int check_cgmagic(int cg, struct bufarea *cgbp); void rebuild_cg(int cg, struct bufarea *cgbp); void check_dirdepth(struct inoinfo *inp); +int chkfilesize(mode_t mode, u_int64_t filesize); int chkrange(ufs2_daddr_t blk, int cnt); void ckfini(int markclean); int ckinode(union dinode *dp, struct inodesc *); diff --git a/sbin/fsck_ffs/fsutil.c b/sbin/fsck_ffs/fsutil.c index 419d0e91a1df..ab55bdfbb37a 100644 --- a/sbin/fsck_ffs/fsutil.c +++ b/sbin/fsck_ffs/fsutil.c @@ -1206,6 +1206,31 @@ std_checkblkavail(ufs2_daddr_t blkno, long frags) return (0); } +/* + * Check whether a file size is within the limits for the filesystem. + * Return 1 when valid and 0 when too big. + * + * This should match the file size limit in ffs_mountfs(). + */ +int +chkfilesize(mode_t mode, u_int64_t filesize) +{ + u_int64_t kernmaxfilesize; + + if (sblock.fs_magic == FS_UFS1_MAGIC) + kernmaxfilesize = (off_t)0x40000000 * sblock.fs_bsize - 1; + else + kernmaxfilesize = sblock.fs_maxfilesize; + if (filesize > kernmaxfilesize || + filesize > sblock.fs_maxfilesize || + (mode == IFDIR && filesize > MAXDIRSIZE)) { + if (debug) + printf("bad file size %ju:", (uintmax_t)filesize); + return (0); + } + return (1); +} + /* * Slow down IO so as to leave some disk bandwidth for other processes */ diff --git a/sbin/fsck_ffs/pass1.c b/sbin/fsck_ffs/pass1.c index 863bf34ff0fc..d328234220ad 100644 --- a/sbin/fsck_ffs/pass1.c +++ b/sbin/fsck_ffs/pass1.c @@ -256,7 +256,6 @@ checkinode(ino_t inumber, struct inodesc *idesc, int rebuiltcg) { struct inode ip; union dinode *dp; - off_t kernmaxfilesize; ufs2_daddr_t ndb; mode_t mode; intmax_t size, fixsize; @@ -293,16 +292,7 @@ checkinode(ino_t inumber, struct inodesc *idesc, int rebuiltcg) return (1); } lastino = inumber; - /* This should match the file size limit in ffs_mountfs(). */ - if (sblock.fs_magic == FS_UFS1_MAGIC) - kernmaxfilesize = (off_t)0x40000000 * sblock.fs_bsize - 1; - else - kernmaxfilesize = sblock.fs_maxfilesize; - if (DIP(dp, di_size) > kernmaxfilesize || - DIP(dp, di_size) > sblock.fs_maxfilesize || - (mode == IFDIR && DIP(dp, di_size) > MAXDIRSIZE)) { - if (debug) - printf("bad size %ju:", (uintmax_t)DIP(dp, di_size)); + if (chkfilesize(mode, DIP(dp, di_size)) == 0) { pfatal("BAD FILE SIZE"); goto unknown; } diff --git a/sbin/fsck_ffs/suj.c b/sbin/fsck_ffs/suj.c index 8bcee7c54c85..cbb6e597dfee 100644 --- a/sbin/fsck_ffs/suj.c +++ b/sbin/fsck_ffs/suj.c @@ -1963,6 +1963,9 @@ ino_build_trunc(struct jtrncrec *rec) printf("ino_build_trunc: op %d ino %ju, size %jd\n", rec->jt_op, (uintmax_t)rec->jt_ino, (uintmax_t)rec->jt_size); + if (chkfilesize(IFREG, rec->jt_size) == 0) + err_suj("ino_build: truncation size too large %ju\n", + (intmax_t)rec->jt_size); sino = ino_lookup(rec->jt_ino, 1); if (rec->jt_op == JOP_SYNC) { sino->si_trunc = NULL; From nobody Wed Jun 7 23:15:38 2023 X-Original-To: dev-commits-src-branches@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 4Qc39Q2BsTz4bhjr; Wed, 7 Jun 2023 23:15:38 +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 4Qc39Q1kSQz3D89; Wed, 7 Jun 2023 23:15:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686179738; 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=5JC9sIryRifeboHj4oaY8NMk+i7nJMk7GbnjWKKYOPc=; b=xpWqiYAS1QF+jvdkUCBR1nWS7otS7JQnQ8FlqsyzqEVHHScgYZITMcFZy6Pd3pbD5OC38Y BHrauVAxm7FM/MTVAkU22Ocuyk3vm9GvLFjLfk1B0VkzYtwSQeI0cR+vrirAATC2RJ+mCj ACgnanSuKf6cRadm1GkGYXvzWPwbVa4ndOuWaM0nqTjT4ExcID81EW0mqnUw1ZxK3ylbQ4 al2SmcZQVM9uWhoXxzYFwqb22PDxQ19/iSOySojRmmRKycuYN9WpSxhAgfgrLrYRdzpUfh WugmN4C71WR3LPZDhBAj1xpEBAUgTBK9p9VXYpCRzSHsoQUx2ifDJZ5G+2zvhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686179738; 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=5JC9sIryRifeboHj4oaY8NMk+i7nJMk7GbnjWKKYOPc=; b=eavbM3iEUYF5JjEoHMjmTp2P1G6J+mCLsNXaAAKjjEWDpMXVmNaMbOL817KV2Z5UyTZNEq 1NG4I7zQGhSZKD4QXBc5x7E4UTdha7nDS/qDRfAAXqbKDPfZ4dUgmFnBvciw1BPC/0XPqb SEdOzJtRobeMc7xOQxcb3p5d05HQIYHMeWcV3rotTFTtiPVEEPR5Q4s2Eb9j5S1HDUrX2K OnpWZD8lUu5Wg8CcmXndd9Np9wTiwxiIdWbQxF2OhUHuDS+yDNP71d6apDJrw5J3tWhWfd TfK0uRnxLI+Fgy1iuqXAoDglPgZcePBXRM0+Y0T904q15ctLHGoVmRQz91ixVw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686179738; a=rsa-sha256; cv=none; b=ObgEG7uALBVfNh7iz96EsmPe83KLA6GqNWjGL66H7PvbqNzDFzLHYtU/1167EMUWWvo0uG PC8WzyulLzXEshb/3z8kXJGvaxb99lKlLsf9zRAzhnwsP9z4sVJnZ7d87+ACSZUcyxd0Wn gUBaTakhuyIAD+bJbip2e6F4zTIhNxg6Jb0kvhZQmeiwl/sufda6pFFTqxbNkJkNM9JZgr C3qrDRTyZfBAEJyClWkmiHo84GPGllvrwnHco81bExGppnzoBjeYACE5l9zmvKcCmRabYY QNcPYmris/reKRbQKgZyJCFJBKonXK6S0rN/i7lhOvNrv3EDGoHOzpMCLI+7yQ== 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 4Qc39Q0r4szWGK; Wed, 7 Jun 2023 23:15:38 +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 357NFcO2048441; Wed, 7 Jun 2023 23:15:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 357NFcgR048440; Wed, 7 Jun 2023 23:15:38 GMT (envelope-from git) Date: Wed, 7 Jun 2023 23:15:38 GMT Message-Id: <202306072315.357NFcgR048440@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kirk McKusick Subject: git: da8749afdca8 - stable/13 - Fix a bug in fsck_ffs(8) triggered by corrupted filesystems. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: da8749afdca81a435b76f8f54e7642e5ee232958 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=da8749afdca81a435b76f8f54e7642e5ee232958 commit da8749afdca81a435b76f8f54e7642e5ee232958 Author: Kirk McKusick AuthorDate: 2023-05-28 22:23:16 +0000 Commit: Kirk McKusick CommitDate: 2023-06-07 22:48:47 +0000 Fix a bug in fsck_ffs(8) triggered by corrupted filesystems. Reported-by: Robert Morris PR: 271383 Sponsored-by: The FreeBSD Foundation (cherry picked from commit b796bfce48698449470b751de6b0d96ae7047202) --- sbin/fsck_ffs/suj.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sbin/fsck_ffs/suj.c b/sbin/fsck_ffs/suj.c index cbb6e597dfee..5a09943406c8 100644 --- a/sbin/fsck_ffs/suj.c +++ b/sbin/fsck_ffs/suj.c @@ -734,7 +734,7 @@ indir_visit(ino_t ino, ufs_lbn_t lbn, ufs2_daddr_t blk, uint64_t *frags, lbnadd *= NINDIR(fs); bp = getdatablk(blk, fs->fs_bsize, BT_LEVEL1 + level); if (bp->b_errs != 0) - err_suj("indir_visit: UNRECOVERABLE I/O ERROR"); + err_suj("indir_visit: UNRECOVERABLE I/O ERROR\n"); for (i = 0; i < NINDIR(fs); i++) { if ((nblk = IBLK(bp, i)) == 0) continue; @@ -1916,6 +1916,9 @@ blk_build(struct jblkrec *blkrec) blk = blknum(fs, blkrec->jb_blkno); frag = fragnum(fs, blkrec->jb_blkno); + if (blkrec->jb_blkno < 0 || blk + fs->fs_frag - frag > fs->fs_size) + err_suj("Out-of-bounds journal block number %jd\n", + blkrec->jb_blkno); sblk = blk_lookup(blk, 1); /* * Rewrite the record using oldfrags to indicate the offset into From nobody Wed Jun 7 23:15:39 2023 X-Original-To: dev-commits-src-branches@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 4Qc39R3Cgwz4bhXs; Wed, 7 Jun 2023 23:15:39 +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 4Qc39R2ghBz3D8m; Wed, 7 Jun 2023 23:15:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686179739; 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=/RFXUQR2OAv8w0oRRCeYG+hlZpKN4HD5IuTVDLWY3rw=; b=VpXD2ur0ZH2TUnLNYxZbFsoe6z1c8cXwVl1zP00MGQAXU838sDSgOfzkuotlUyyEWpWqdf 2zl45q7sv3O7P/ZEQoPD7ANAORe1hP10Tl7HcyjaK4kOPJ5d0j6Ufx07PPY/3hLPVs2RZN HAbKlsDMQ0sV0u2FsMJWTw+jfNXhZApSOlpk5Vk/lXRUvSKLoomGXfWCMK4BKDPQDkSWBL yjXTKQGn+94hRbeLRIja8zfBHNifJYjH4b3sqHe74HnOqBUldQfwfSwpzLxS/Elxtn01WJ HgX2jwPaQqkV4iEFnQAua0e9dvvvAhof3bjzPg3oNWpdrQAbH66nKmLbPKY26A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686179739; 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=/RFXUQR2OAv8w0oRRCeYG+hlZpKN4HD5IuTVDLWY3rw=; b=mKlthAoL+zBsjHS9GsizwwgcgSYYNWXH1hA0AfpJ7ra182jIZNDAg9WPdSQaX/HCIT+RdS gkNvT2TewsVE/OOZvRFPAUGhrPBzszM44jp3j0ITTSXqgWZoUOFZ/VuguiV0pcvQAGQ4Z7 kLT/bBzxcFp6sbHP8BnVSkq+Pc+0mRFVBDM0SGfCKQUjkkb1U++/vPrhmBIppviY4Eih+k s2NcPKo6r1uTuLtcZ538UN4Bm+6VzEswetxOWAj/Ime3WA/Kf+YbRajeMXk3JwW8kPqGVq KArHaQyee5/Ru+vVIMZO2VbEbN4KwaRU/AmGR4QlHMzas/p6Zh8vyqlVvrGZqw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686179739; a=rsa-sha256; cv=none; b=Da0PWOGrSzqtCRUtpgvCEg4rm3/GOEltvWgvlpDpgAaTPXEbKXrewxgOv/wfwG108j3iov Ph8diwQT9IAcM+zI4qh5fEWDvNyRYL77Ghmqgvys5nncqWV1VTEM2UldcjY52BdBJZiJFt SivNcbNuBiy2kNez55Um11p0rt+PZGe5EyTWr4G9ui+BbT/XsgKrG/Eoq2OLOT9tIowFwM Lgy9/QzKUMz7qgZBwzd5XFKsn8Ofl1SczahpaiByT6R3rKM+5/3lZGJekmFEwycBqLPdEM d/RsE3bwhGBn0wFAzykgeQQcpG1SncqXDrc0ftqybP+/Sg4jR5seWbd2BIXLww== 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 4Qc39R1dF5zWQt; Wed, 7 Jun 2023 23:15:39 +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 357NFdBl048460; Wed, 7 Jun 2023 23:15:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 357NFdUV048459; Wed, 7 Jun 2023 23:15:39 GMT (envelope-from git) Date: Wed, 7 Jun 2023 23:15:39 GMT Message-Id: <202306072315.357NFdUV048459@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kirk McKusick Subject: git: 90532db778dc - stable/13 - Cleanups to fsck_ffs(8). List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 90532db778dc2bca557d5be43c5b9813ba44d80a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=90532db778dc2bca557d5be43c5b9813ba44d80a commit 90532db778dc2bca557d5be43c5b9813ba44d80a Author: Kirk McKusick AuthorDate: 2023-05-29 21:54:52 +0000 Commit: Kirk McKusick CommitDate: 2023-06-07 22:54:13 +0000 Cleanups to fsck_ffs(8). Sponsored-by: The FreeBSD Foundation (cherry picked from commit 5267120645fa52eac771c9bd8e28d68620a3bb89) --- sbin/fsck_ffs/dir.c | 3 +++ sbin/fsck_ffs/inode.c | 17 +++++++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/sbin/fsck_ffs/dir.c b/sbin/fsck_ffs/dir.c index 7ea471bcb30a..3ff6c467ee08 100644 --- a/sbin/fsck_ffs/dir.c +++ b/sbin/fsck_ffs/dir.c @@ -725,6 +725,7 @@ changeino(ino_t dir, const char *name, ino_t newnum, int depth) ginode(dir, &ip); if (((error = ckinode(ip.i_dp, &idesc)) & ALTERED) && newnum != 0) { DIP_SET(ip.i_dp, di_dirdepth, depth); + inodirty(&ip); getinoinfo(dir)->i_depth = depth; } free(idesc.id_name); @@ -879,6 +880,7 @@ expanddir(struct inode *ip, char *name) DIP_SET(dp, di_ib[0], indirblk); DIP_SET(dp, di_blocks, DIP(dp, di_blocks) + btodb(sblock.fs_bsize)); + inodirty(ip); } IBLK_SET(nbp, lastlbn - UFS_NDADDR, newblk); dirty(nbp); @@ -969,6 +971,7 @@ allocdir(ino_t parent, ino_t request, int mode) } else { inp->i_depth = parentinp->i_depth + 1; DIP_SET(dp, di_dirdepth, inp->i_depth); + inodirty(&ip); } inoinfo(ino)->ino_type = DT_DIR; inoinfo(ino)->ino_state = inoinfo(parent)->ino_state; diff --git a/sbin/fsck_ffs/inode.c b/sbin/fsck_ffs/inode.c index 7dca95129ed1..c56d938cce41 100644 --- a/sbin/fsck_ffs/inode.c +++ b/sbin/fsck_ffs/inode.c @@ -90,6 +90,10 @@ ckinode(union dinode *dp, struct inodesc *idesc) dino.dp1 = dp->dp1; else dino.dp2 = dp->dp2; + if (DIP(&dino, di_size) < 0) { + pfatal("NEGATIVE INODE SIZE %jd\n", DIP(&dino, di_size)); + return (STOP); + } ndb = howmany(DIP(&dino, di_size), sblock.fs_bsize); for (i = 0; i < UFS_NDADDR; i++) { idesc->id_lbn++; @@ -116,6 +120,7 @@ ckinode(union dinode *dp, struct inodesc *idesc) inodirty(&ip); irelse(&ip); } + return (STOP); } continue; } @@ -498,6 +503,11 @@ irelse(struct inode *ip) /* Check for failed inode read */ if (ip->i_bp == NULL) return; + if (debug && sblock.fs_magic == FS_UFS2_MAGIC && + ffs_verify_dinode_ckhash(&sblock, (struct ufs2_dinode *)ip->i_dp)) { + pwarn("irelse: releasing inode with bad check-hash"); + prtinode(ip); + } if (ip->i_bp->b_refcnt <= 0) pfatal("irelse: releasing unreferenced ino %ju\n", (uintmax_t) ip->i_number); @@ -1419,21 +1429,20 @@ retry: cgdirty(cgbp); ginode(ino, &ip); dp = ip.i_dp; + memset(dp, 0, ((sblock.fs_magic == FS_UFS1_MAGIC) ? + sizeof(struct ufs1_dinode) : sizeof(struct ufs2_dinode))); DIP_SET(dp, di_db[0], allocblk(ino_to_cg(&sblock, ino), (long)1, std_checkblkavail)); if (DIP(dp, di_db[0]) == 0) { inoinfo(ino)->ino_state = USTATE; + inodirty(&ip); irelse(&ip); return (0); } DIP_SET(dp, di_mode, type); - DIP_SET(dp, di_flags, 0); DIP_SET(dp, di_atime, time(NULL)); DIP_SET(dp, di_ctime, DIP(dp, di_atime)); DIP_SET(dp, di_mtime, DIP(dp, di_ctime)); - DIP_SET(dp, di_mtimensec, 0); - DIP_SET(dp, di_ctimensec, 0); - DIP_SET(dp, di_atimensec, 0); DIP_SET(dp, di_size, sblock.fs_fsize); DIP_SET(dp, di_blocks, btodb(sblock.fs_fsize)); n_files++; From nobody Wed Jun 7 23:15:40 2023 X-Original-To: dev-commits-src-branches@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 4Qc39S50Kpz4bhlk; Wed, 7 Jun 2023 23:15:40 +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 4Qc39S31ncz3DHZ; Wed, 7 Jun 2023 23:15:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686179740; 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=m/H9HTceWSS15lPHRie91DBOC58jmt/Mon+xjvMrdLQ=; b=RwALpXiy+1SZ43uag8ruh5Iy25WaryEmSstzShUj91G6meMcFgYdw/3ArNelVkrRQgbGPh p3v0PbjkKXnIxOWTigM6R+EJoquOJ3ltssCLRzLv1MhUaeLJwl/dGfesZYp8R63Chtf2zN NcE2XD1oVqKQ8Z72dt0mK1DfNkAMsW7x0PwFXhLZ9TJyyxrSz6xiEKW7A0Y0+CKGiI2uwY izP+gv1XEo4L6fg11zs+LIk3Vvy4zMAVVQx+ADBFaf9z1G1pJFO8T8Zda+rftb/DrDyU9E fAP6Tzl2272c6uNAVVSINr1CP/mWWDHVDszZrMsC5LzOuSWtU0PFp4yOtRlK1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686179740; 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=m/H9HTceWSS15lPHRie91DBOC58jmt/Mon+xjvMrdLQ=; b=l1DCB0JBzXl7UyQ0CdzkEgQ2178k6OId8j4CReFd5fGsTP21GPzbmQLQLAMHsXPwp5DRyT /XK3u7ivoVepTb9RCMo2ZmG00sLeyxHTk4KsIj9zKqw1bZBPoouJqJYGYwPDLgHp/x7Fmt JZtSsD82Vlp2iNdD96UY21dE52c2FXFf8laM0W2dhpQoZ4X3x6hDnmImOLFHzWBe2O0PLb Um0WUGlEwFN7NUrrI463XFBPS7vq7+4kwUNWYBEVeKB4iD4jflWhuAZMGhq1GnZ5J/dH76 EmdKw8NSMGPKWu89bBxJJCPzSSbSiIevoteDy8Jf2QN1EpKvov0B0Ew1jpwdpQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686179740; a=rsa-sha256; cv=none; b=QQ/R8L2C2r82nbZICsQBq72xP6Wz53GLO8h74o2hWEGkkefIMTqO+Rb/fDdnx7UP1mAliq qTWzzWajo+YjrMyjgTBv3Z4OEOiJdOFMfSgHBoL9d+XB98VJQetFjNRJlr/mD40CP00tcw IuTpnWfMIal2gU4yITn0TvBBLuBwdaLRgVaEOqq+PDWfq1NZNnPEFb+I1F+vCj/EKzVyEr X9JhzZNf1XRBsE31Xukkqc1rm8FMYfhC7LBKusuLpKOchAFl6ccv3s4iACib/XTfHKDDO8 Jm8YTJzmhgqfp7NKFnHm6t7MrKVxms1kGqunmKLHTITQ107xPd/lzuvu8Fndiw== 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 4Qc39S26P6zVx0; Wed, 7 Jun 2023 23:15:40 +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 357NFeha048486; Wed, 7 Jun 2023 23:15:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 357NFert048485; Wed, 7 Jun 2023 23:15:40 GMT (envelope-from git) Date: Wed, 7 Jun 2023 23:15:40 GMT Message-Id: <202306072315.357NFert048485@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kirk McKusick Subject: git: a4bea5c479d8 - stable/13 - Fix a bug in fsck_ffs(8) triggered by corrupted filesystems. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a4bea5c479d84d5fb10c6d78abce504253fe8e1d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=a4bea5c479d84d5fb10c6d78abce504253fe8e1d commit a4bea5c479d84d5fb10c6d78abce504253fe8e1d Author: Kirk McKusick AuthorDate: 2023-05-29 21:58:20 +0000 Commit: Kirk McKusick CommitDate: 2023-06-07 22:56:12 +0000 Fix a bug in fsck_ffs(8) triggered by corrupted filesystems. Reported-by: Robert Morris PR: 271414 Sponsored-by: The FreeBSD Foundation (cherry picked from commit 6a71277c3037df2c3a70464c2e2bf20dec2c128a) --- sbin/fsck_ffs/suj.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/sbin/fsck_ffs/suj.c b/sbin/fsck_ffs/suj.c index 5a09943406c8..d1b6d8530ce6 100644 --- a/sbin/fsck_ffs/suj.c +++ b/sbin/fsck_ffs/suj.c @@ -2375,7 +2375,7 @@ suj_check(const char *filesys) { struct inodesc idesc; struct csum *cgsum; - union dinode *jip; + union dinode *dp, *jip; struct inode ip; uint64_t blocks; int i, retval; @@ -2417,7 +2417,17 @@ suj_check(const char *filesys) idesc.id_func = findino; idesc.id_name = SUJ_FILE; ginode(UFS_ROOTINO, &ip); - if ((ckinode(ip.i_dp, &idesc) & FOUND) == FOUND) { + dp = ip.i_dp; + if ((DIP(dp, di_mode) & IFMT) != IFDIR) { + irelse(&ip); + err_suj("root inode is not a directory\n"); + } + if (DIP(dp, di_size) < 0 || DIP(dp, di_size) > MAXDIRSIZE) { + irelse(&ip); + err_suj("negative or oversized root directory %jd\n", + (uintmax_t)DIP(dp, di_size)); + } + if ((ckinode(dp, &idesc) & FOUND) == FOUND) { sujino = idesc.id_parent; irelse(&ip); } else { From nobody Wed Jun 7 23:15:41 2023 X-Original-To: dev-commits-src-branches@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 4Qc39V0HBWz4bhd8; Wed, 7 Jun 2023 23:15:42 +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 4Qc39T3nMVz3DFW; Wed, 7 Jun 2023 23:15:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686179741; 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=lZqlqeDQB5ao7y/pXatcDzeSyxnaEWf2AgN40cq0Sx0=; b=YbDyU09RjixcllURSnTj9AOtTJkthR3zdik2TCe8GJ63NmsZdpidHBPpkP2Fwc/8S3hExy 5TYbHCBPogjyvVClKr8uYLouTlYsidvKf0dG2lAIUPrU+4i4dl7oKOQfUZw+cUwuZQl75o CcGkQO7prZgvds2DfpW8igyeWaN8NAOXNEgZR+URfuxI152ktnQXddH7M/QsRQcjxMs4Gc eVuTDqIwbEyi6EEagS1s/bSn2SMKuOZnjhBkbNPJmRi7NQk0VPhfLxzzAnyhaXNIiJYULK 6nG8vFYzZ1HeJFpIfbLs5WMjsMYhTjOSFmh/lwb96Ap5Lo5K69rLnTdk5oGmaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686179741; 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=lZqlqeDQB5ao7y/pXatcDzeSyxnaEWf2AgN40cq0Sx0=; b=CcdYbTHIX+AzCWKpE6Id3NBfJ2mSb1wEDCJb8N6FUADMrfmye41ECjCUxj2h8E2Fx4RdSM ZhuQffxIqNHbrubG9tA/GfOmhdVr24nPgzY0zZ4hC7bSAk7O5DtKKFUqVxIEtFWmrJazLc xESQUu49P0VWGPtr0dVI9OpwXpMFsWEkGKgirj8Tb4GCNIRzEvj1u2WFBdJZz1KkDAuOK/ xf19mZaPkFKczZ+Yf/AOAKb/H+Qa6nW2fAtQ9rsDqd7RB1iCUqayjQ1SRLckpRM3vYpQz8 eroFhQ++hfsmX/G8ldZBIdgkvptM6Yw12uLVhxCrx+OIYDejEauocIoTgxE+Zg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686179741; a=rsa-sha256; cv=none; b=rrJxSjAdIxg6NmCIUlebtTBUqGkwAymTbveB7meWeXoxZa8vxZHa8vAPtVJPgSQmZBAvbU nh+eXcrWED4JhSwYgjW0IAjU/jcCJgAnuPfIRXTD3E1UggIHUcO3L/2qvDDre+z/okacH1 vGXwtBqxAhuFHq7WXOpGlQ4o5tp084kdVxoxbqWlJZRrarrIawzKmmsHe5R5H+4nV2fx9u tluFVWexmc++e1dDTeVNM/aiTOqbWonPGVx+2l7jQdDubAW8+PCSsgvqGorr1PKGuOoxmw k1GxuNGfbfepu8EL+GT2ydY1Xz1XuWgOAGD1PTIZeNls6kVIGe8Yvj1hFK/Smw== 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 4Qc39T2tPTzWQv; Wed, 7 Jun 2023 23:15:41 +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 357NFfZX048505; Wed, 7 Jun 2023 23:15:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 357NFfup048504; Wed, 7 Jun 2023 23:15:41 GMT (envelope-from git) Date: Wed, 7 Jun 2023 23:15:41 GMT Message-Id: <202306072315.357NFfup048504@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kirk McKusick Subject: git: 95fc911fe9f2 - stable/13 - Updates to UFS/FFS superblock integrity checks when reading a superblock. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 95fc911fe9f258ab9baa6b9fa1b1643f86b103b6 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=95fc911fe9f258ab9baa6b9fa1b1643f86b103b6 commit 95fc911fe9f258ab9baa6b9fa1b1643f86b103b6 Author: Kirk McKusick AuthorDate: 2023-06-07 23:12:12 +0000 Commit: Kirk McKusick CommitDate: 2023-06-07 23:12:12 +0000 Updates to UFS/FFS superblock integrity checks when reading a superblock. Reported-by: Robert Morris PR: 271351 Sponsored-by: The FreeBSD Foundation (cherry picked from commit c79a1416955a260424a5dd2013b114ff864bc926) --- sys/ufs/ffs/ffs_subr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/ufs/ffs/ffs_subr.c b/sys/ufs/ffs/ffs_subr.c index 4ba452b05ec9..813736c9d070 100644 --- a/sys/ufs/ffs/ffs_subr.c +++ b/sys/ufs/ffs/ffs_subr.c @@ -505,7 +505,8 @@ validate_sblock(struct fs *fs, int isaltsblk) CHK(fs->fs_csaddr, <, 0, %jd); CHK(fs->fs_cssize, !=, fragroundup(fs, fs->fs_ncg * sizeof(struct csum)), %jd); - CHK(dtog(fs, fs->fs_csaddr), >, fs->fs_ncg, %jd); + CHK(fs->fs_csaddr + howmany(fs->fs_cssize, fs->fs_fsize), >, + fs->fs_size, %jd); CHK(fs->fs_csaddr, <, cgdmin(fs, dtog(fs, fs->fs_csaddr)), %jd); CHK(dtog(fs, fs->fs_csaddr + howmany(fs->fs_cssize, fs->fs_fsize)), >, dtog(fs, fs->fs_csaddr), %jd); From nobody Thu Jun 8 08:02:28 2023 X-Original-To: dev-commits-src-branches@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 4QcGsJ6cGCz4c0nf; Thu, 8 Jun 2023 08:02:28 +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 4QcGsJ63t9z3MQD; Thu, 8 Jun 2023 08:02:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686211348; 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=O1NymtV17DJFb6565YrpKQEqA0GiMFV3W+rfIz0yG4g=; b=H490SDZ8ucU8gu9S2Ot9LG6pSzuxTP5hS+fxuQoCT44tRUepE9EaV1jFwUrGP5ke3N0Jvq RFa1fdTfrL4ze/VijoUQS5jQdh56onJZkfH4NRLsU4Pv//hF0kxIMX2gKzzCt6P+UE6nSI MbZ76SEVH5zu1NTxPU0Vhdk2yZSwPfNl1bYRyluV2WneBu3sMeU23zz+Xj5/k8CJ2y/W/O LZsGOxpNQhWDpCOIaMtFb0EzJZbA5kYqIzNwcQ2hux4iPkUgr4M1cyqKQYveDJc1m87vF4 Zi0G3tP1UKK7vB0Yrz1cRdh92cYf7SolGy9YQxvoZoTzmxEhF0hrtmjI9VeIGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686211348; 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=O1NymtV17DJFb6565YrpKQEqA0GiMFV3W+rfIz0yG4g=; b=qOdgmmptFxVFmXVxLv56rTi3vOKqOJw+Rp3pXF0Xd98y72JK8JD9rQfQgk3xqvziyhQCnu GD3mfJR8n0NFPmXQy7Nd+ybm9XrBna1aJ7MYErODU4pYIdQlKMEIZDK8Tl6UnMYgflpP2v NhUkxSeYIkXQ2n7iL6evlXMDW80hOJFUluUnKluZmKAf51djHaxRUD9PFrOAhxrmvTmSPL /qBpkTzrWlHJTyIp5juwi8MuRK0awmp6SKreMFy4Ve3ROT8ObKRD4uRPwdPgUb8cw2uMyS C6kLay/+k7d5OfcO3ecq+cikhGMGyjqNqix9dmBgnC6mCNh+jFe8HWrfJmSXLQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686211348; a=rsa-sha256; cv=none; b=WV/XjUfzsmi8dPw7kFiZ1NeHLKyxdDigovDqonRTyITS258uzP1V7s1UUQCm45LsxXNCqQ 7arwOnjfgetVdgk9oibuaZoodlAjZzrFENByYb7LAULKppdpl91XxkJDolFh29HGYL1pFG rhhdqMu791dhn9muiSA86/RPOvBo78+acczKxO1ssJdlCe3KXa0Cr/QxVnT1tXx+vmETLD rNlnPZcwn3KLy/uNJIyb71TkNNtXyIx3w+6opyKCQ2ep/4ZFo6PVnGCdxD9NskX538W8Ck WX8/imU3MooGLC7t7fjbxNtpsp/83sG1q2RiFUU8TGpOsRXrVk/aLPTTaCb+Qg== 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 4QcGsJ596tzm5G; Thu, 8 Jun 2023 08:02:28 +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 35882SIm024335; Thu, 8 Jun 2023 08:02:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 35882SQZ024334; Thu, 8 Jun 2023 08:02:28 GMT (envelope-from git) Date: Thu, 8 Jun 2023 08:02:28 GMT Message-Id: <202306080802.35882SQZ024334@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: d2565dc8022d - stable/13 - nfsstat.1: Add a missing argument to -w List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d2565dc8022d85b1d1be1221bae275ae60644c1a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=d2565dc8022d85b1d1be1221bae275ae60644c1a commit d2565dc8022d85b1d1be1221bae275ae60644c1a Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2023-06-05 12:32:46 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2023-06-08 08:02:24 +0000 nfsstat.1: Add a missing argument to -w MFC after: 3 days Sponsored by: Klara Inc. (cherry picked from commit 979754a15ae4c507cd739163331cbaef7b100e23) --- usr.bin/nfsstat/nfsstat.1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.bin/nfsstat/nfsstat.1 b/usr.bin/nfsstat/nfsstat.1 index 4a37fdc7529a..892e675390b3 100644 --- a/usr.bin/nfsstat/nfsstat.1 +++ b/usr.bin/nfsstat/nfsstat.1 @@ -28,7 +28,7 @@ .\" From: @(#)nfsstat.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd December 31, 2019 +.Dd June 5, 2023 .Dt NFSSTAT 1 .Os .Sh NAME @@ -53,7 +53,7 @@ If you wish to compare RPC counts between NFSv3 and NFSv4, you must use statistics in the client(s). .Pp The options are as follows: -.Bl -tag -width indent +.Bl -tag -width "-w wait" .It Fl c Only display client side statistics. .It Fl d @@ -111,7 +111,7 @@ useful when combined with or .Fl s and a time delay. -.It Fl w +.It Fl w Ar wait Display a shorter summary of .Tn NFS activity for both the client and server at From nobody Thu Jun 8 10:57:15 2023 X-Original-To: dev-commits-src-branches@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 4QcLkz58N9z4bM21; Thu, 8 Jun 2023 10:57:15 +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 4QcLkz4ql8z3y03; Thu, 8 Jun 2023 10:57:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686221835; 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=TetPygu6m1Z9iAJnNijkdQ5HG65scIVutHCHdIDCDh0=; b=ZzhHlHuzAvvdtgHuo+78PYbWGQB0Ox9RZNgdxsgvo4qN7kUJPzkmbPTH6VYkVG3FTFnFmd FP99pvg63QgoB5J2mGS049aYvpKK+8WvQz5+0D8Eu7vvWpGZaKUaa7owt+ygUuwaUMUQYQ ZZQzkjxfaO8GCmyfdlHOUx/KyVSN5ysvc94eVGRNWj2mbdJ3eKCteYgHaxaPinbsEyFL2y Z/F8ZIC9tZRc/2qEtJ+rLP3T9nwe5oOL7Qkrekl9q0YLqj+TpFKAGHE94lTZ2AmPeS5mNt yVHlSoir1DiD8o4mqCnVEMeWxXr0hf2ASHe/iBTCAhg7ZE4yoGDx1c1qXl1j4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686221835; 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=TetPygu6m1Z9iAJnNijkdQ5HG65scIVutHCHdIDCDh0=; b=oBEO39YVQWnvlVwEdMs0H7UXZnidpd1eU9SEHglf+8tro6SYnKSURFimVTBtccWI+k23p2 KpVtyC0TCq9xL7dVMEdQpcNnrm25D1nmACO3AK9WiyeD+pbjQLuYUETZ9ifUGZZImuC5PS JIkoDhyHyOSFceJOaNU+whaAfuv8wHKiJtmhyitjkqyB2MCzn0sbp7kI9NbdAowSQqyI8S dKjJ6lj4zYG8rSf+LujGWDIM+SpjS8uCQvSrLILr/TFwgHnzBs5TaApZJMC3ylBpQ2rKOP 4UFNgoyp8aRP3X3dDiEUsXB0CmoqDVYplLqvz3mTzlb26O2XtFJKMMCjQDGfXg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686221835; a=rsa-sha256; cv=none; b=KPWcRqoZxBFci3AmLPrITLHoTnb2mruHwhHDWwaAeRCJ3ixNqKaauzMDIc3sJ57lg1jJcC 2i4Y/J9I35AB7zKTcP1mC6NGrCEP+uBZYpr6XAlgfWq109/j/JcemSQ4oYjJhvdX/7NOsm KvwUPLrg2/Za1m35DFSvMx+QoXvX+hMBCbvR0pVxj89dVRMAfQ+VFT8Zb/qQePFajrfqJ0 apjr34IKW15sPq/zF+68YaUuavzrFeSkOc2KDDWJr1Uw1RUuQ/kckLxIYc2FfouY454QOs esKgzYXnTjpyv8w/m6ATK5WJn4fzp29E5nD0MdaJ0sxCS6KD8uaczw+sgum4Kw== 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 4QcLkz3wYQzrK0; Thu, 8 Jun 2023 10:57:15 +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 358AvF93004672; Thu, 8 Jun 2023 10:57:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 358AvFd0004671; Thu, 8 Jun 2023 10:57:15 GMT (envelope-from git) Date: Thu, 8 Jun 2023 10:57:15 GMT Message-Id: <202306081057.358AvFd0004671@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: =?utf-8?Q?Stefan=20E=C3=9Fer?= Subject: git: 46494d4edf98 - stable/13 - vendor/bc: import version 6.3.1 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: se X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 46494d4edf9873fb31dc26d088f41482b341510d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=46494d4edf9873fb31dc26d088f41482b341510d commit 46494d4edf9873fb31dc26d088f41482b341510d Author: Stefan Eßer AuthorDate: 2023-02-24 22:14:58 +0000 Commit: Stefan Eßer CommitDate: 2023-06-08 10:56:44 +0000 vendor/bc: import version 6.3.1 This version adds a command to dc to query whether extended registers are enabled or not. (cherry picked from commit 103d7cdfb7435591049413e1bc39482cb316efb7) contrib/bc: import version 6.5.0 This release that fixes an infinite loop bug in the (non-standard) extended math library functions root() and cbrt(), fixes a bug with BC_LINE_LENGTH=0, and adds the fib() function to the extended math library to calculate Fibonacci numbers. (cherry picked from commit 8c48f4c5377ddc3dc55388f181f23111145f7099) contrib/bc: upgrade to version 6.6.0 This update removes printing of a leading zero in scientific or engineering output modes (which are an extended feature of this implementation). (cherry picked from commit 76238846ad3e9e271a3d1f792f72beab727fd153) --- contrib/bc/LICENSE.md | 2 +- contrib/bc/MEMORY_BUGS.md | 5 + contrib/bc/Makefile.in | 12 +- contrib/bc/NEWS.md | 62 +++ contrib/bc/README.md | 18 +- contrib/bc/configure.sh | 34 +- contrib/bc/gen/lib2.bc | 28 +- contrib/bc/gen/strgen.c | 6 +- contrib/bc/gen/strgen.sh | 4 +- contrib/bc/include/bcl.h | 57 +++ contrib/bc/include/lang.h | 7 +- contrib/bc/include/lex.h | 17 +- contrib/bc/include/library.h | 210 ++++++-- contrib/bc/include/num.h | 8 + contrib/bc/include/parse.h | 14 +- contrib/bc/include/program.h | 218 +++----- contrib/bc/include/rand.h | 6 +- contrib/bc/include/status.h | 31 +- contrib/bc/include/vector.h | 4 +- contrib/bc/include/version.h | 2 +- contrib/bc/include/vm.h | 10 +- contrib/bc/manuals/bc/A.1 | 6 +- contrib/bc/manuals/bc/A.1.md | 2 +- contrib/bc/manuals/bc/E.1 | 6 +- contrib/bc/manuals/bc/E.1.md | 2 +- contrib/bc/manuals/bc/EH.1 | 6 +- contrib/bc/manuals/bc/EH.1.md | 2 +- contrib/bc/manuals/bc/EHN.1 | 6 +- contrib/bc/manuals/bc/EHN.1.md | 2 +- contrib/bc/manuals/bc/EN.1 | 6 +- contrib/bc/manuals/bc/EN.1.md | 2 +- contrib/bc/manuals/bc/H.1 | 6 +- contrib/bc/manuals/bc/H.1.md | 2 +- contrib/bc/manuals/bc/HN.1 | 6 +- contrib/bc/manuals/bc/HN.1.md | 2 +- contrib/bc/manuals/bc/N.1 | 6 +- contrib/bc/manuals/bc/N.1.md | 2 +- contrib/bc/manuals/bcl.3 | 424 +++++++++++++++- contrib/bc/manuals/bcl.3.md | 320 +++++++++++- contrib/bc/manuals/dc/A.1 | 12 +- contrib/bc/manuals/dc/A.1.md | 10 +- contrib/bc/manuals/dc/E.1 | 12 +- contrib/bc/manuals/dc/E.1.md | 10 +- contrib/bc/manuals/dc/EH.1 | 12 +- contrib/bc/manuals/dc/EH.1.md | 10 +- contrib/bc/manuals/dc/EHN.1 | 12 +- contrib/bc/manuals/dc/EHN.1.md | 10 +- contrib/bc/manuals/dc/EN.1 | 12 +- contrib/bc/manuals/dc/EN.1.md | 10 +- contrib/bc/manuals/dc/H.1 | 12 +- contrib/bc/manuals/dc/H.1.md | 10 +- contrib/bc/manuals/dc/HN.1 | 12 +- contrib/bc/manuals/dc/HN.1.md | 10 +- contrib/bc/manuals/dc/N.1 | 12 +- contrib/bc/manuals/dc/N.1.md | 10 +- contrib/bc/scripts/exec-install.sh | 6 + contrib/bc/scripts/format.sh | 2 + contrib/bc/scripts/link.sh | 5 + contrib/bc/scripts/lint.sh | 5 +- contrib/bc/scripts/locale_install.sh | 3 +- contrib/bc/scripts/safe-install.sh | 12 +- contrib/bc/src/args.c | 4 +- contrib/bc/src/bc_parse.c | 6 +- contrib/bc/src/data.c | 77 +-- contrib/bc/src/dc_lex.c | 1 + contrib/bc/src/dc_parse.c | 1 + contrib/bc/src/file.c | 4 +- contrib/bc/src/history.c | 4 +- contrib/bc/src/lang.c | 8 +- contrib/bc/src/library.c | 743 +++++++++++++++++++--------- contrib/bc/src/num.c | 95 +++- contrib/bc/src/parse.c | 4 +- contrib/bc/src/program.c | 75 ++- contrib/bc/src/rand.c | 5 +- contrib/bc/src/read.c | 4 +- contrib/bc/src/vm.c | 44 +- contrib/bc/tests/all.sh | 3 +- contrib/bc/tests/bc/all.txt | 2 + contrib/bc/tests/bc/fib.txt | 31 ++ contrib/bc/tests/bc/fib_results.txt | 31 ++ contrib/bc/tests/bc/rand_limits.txt | 284 +++++++++++ contrib/bc/tests/bc/rand_limits_results.txt | 222 +++++++++ contrib/bc/tests/bc/scripts/all.txt | 1 + contrib/bc/tests/bc/scripts/cbrt.txt | 100 ++++ contrib/bc/tests/bc/scripts/root.bc | 19 + contrib/bc/tests/bc/scripts/root.txt | 255 ++++++++++ contrib/bc/tests/bcl.c | 52 +- contrib/bc/tests/error.sh | 8 +- contrib/bc/tests/errors.sh | 8 +- contrib/bc/tests/extra_required.txt | 2 + contrib/bc/tests/other.sh | 120 +++-- contrib/bc/tests/read.sh | 13 + contrib/bc/tests/script.sh | 20 +- contrib/bc/tests/scripts.sh | 5 +- contrib/bc/tests/test.sh | 6 +- contrib/bc/vs/bc.vcxproj | 2 +- usr.bin/gh-bc/Makefile | 43 +- usr.bin/gh-bc/tests/Makefile | 4 +- 98 files changed, 3293 insertions(+), 785 deletions(-) diff --git a/contrib/bc/LICENSE.md b/contrib/bc/LICENSE.md index b65095edc26c..74441065df35 100644 --- a/contrib/bc/LICENSE.md +++ b/contrib/bc/LICENSE.md @@ -59,7 +59,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. The files `src/rand.c` and `include/rand.h` are under the following copyrights and license: -Copyright (c) 2014-2017 Melissa O'Neill and PCG Project contributors +Copyright (c) 2014-2017 Melissa O'Neill and PCG Project contributors
Copyright (c) 2018-2023 Gavin D. Howard Permission is hereby granted, free of charge, to any person obtaining a copy of diff --git a/contrib/bc/MEMORY_BUGS.md b/contrib/bc/MEMORY_BUGS.md index d675b28b342a..12e0b854e9d8 100644 --- a/contrib/bc/MEMORY_BUGS.md +++ b/contrib/bc/MEMORY_BUGS.md @@ -51,3 +51,8 @@ existed in. had properly hooked Valgrind into my `bcl` tests, but I had not. The first version without this bug is `6.0.1`. + +* In version `6.0.0` until `6.2.4` (inclusive) of `bcl`, there is a possible + use-after-free if `bcl_init()` fails. + + The first version without this bug is `6.2.5`. diff --git a/contrib/bc/Makefile.in b/contrib/bc/Makefile.in index 83417a333826..55e2e4a6270a 100644 --- a/contrib/bc/Makefile.in +++ b/contrib/bc/Makefile.in @@ -205,7 +205,7 @@ DC_DEFS = $(DC_DEFS1) $(DC_DEFS2) $(DC_DEFS3) $(DC_DEFS4) $(DC_DEFS5) CPPFLAGS1 = -D$(BC_ENABLED_NAME)=$(BC_ENABLED) -D$(DC_ENABLED_NAME)=$(DC_ENABLED) CPPFLAGS2 = $(CPPFLAGS1) -I$(INCDIR)/ -DBUILD_TYPE=$(BC_BUILD_TYPE) %%LONG_BIT_DEFINE%% CPPFLAGS3 = $(CPPFLAGS2) -DEXECPREFIX=$(EXEC_PREFIX) -DMAINEXEC=$(MAIN_EXEC) -CPPFLAGS4 = $(CPPFLAGS3) %%BSD%% +CPPFLAGS4 = $(CPPFLAGS3) %%BSD%% %%APPLE%% CPPFLAGS5 = $(CPPFLAGS4) -DBC_NUM_KARATSUBA_LEN=$(BC_NUM_KARATSUBA_LEN) CPPFLAGS6 = $(CPPFLAGS5) -DBC_ENABLE_NLS=$(BC_ENABLE_NLS) CPPFLAGS7 = $(CPPFLAGS6) -D$(BC_ENABLE_EXTRA_MATH_NAME)=$(BC_ENABLE_EXTRA_MATH) @@ -239,25 +239,25 @@ $(GEN_EXEC): $(GEN_DIR) %%GEN_EXEC_TARGET%% $(BC_LIB_C): $(GEN_EXEC) $(BC_LIB) - $(GEN_EMU) $(GEN_EXEC) $(BC_LIB) $(BC_LIB_C) $(BC_EXCLUDE_EXTRA_MATH) $(BC_LIB_C_ARGS) + $(GEN_EMU) $(GEN_EXEC) $(BC_LIB) $(BC_LIB_C) $(BC_EXCLUDE_EXTRA_MATH) $(BC_LIB_C_ARGS) "" "" 1 $(BC_LIB_O): $(BC_LIB_C) $(CC) $(CFLAGS) -o $@ -c $< $(BC_LIB2_C): $(GEN_EXEC) $(BC_LIB2) - $(GEN_EMU) $(GEN_EXEC) $(BC_LIB2) $(BC_LIB2_C) $(BC_EXCLUDE_EXTRA_MATH) $(BC_LIB2_C_ARGS) + $(GEN_EMU) $(GEN_EXEC) $(BC_LIB2) $(BC_LIB2_C) $(BC_EXCLUDE_EXTRA_MATH) $(BC_LIB2_C_ARGS) "" "" 1 $(BC_LIB2_O): $(BC_LIB2_C) $(CC) $(CFLAGS) -o $@ -c $< $(BC_HELP_C): $(GEN_EXEC) $(BC_HELP) - $(GEN_EMU) $(GEN_EXEC) $(BC_HELP) $(BC_HELP_C) $(BC_EXCLUDE_EXTRA_MATH) bc_help "" $(BC_ENABLED_NAME) + $(GEN_EMU) $(GEN_EXEC) $(BC_HELP) $(BC_HELP_C) $(BC_EXCLUDE_EXTRA_MATH) bc_help "" $(BC_ENABLED_NAME) 0 $(BC_HELP_O): $(BC_HELP_C) $(CC) $(CFLAGS) -o $@ -c $< $(DC_HELP_C): $(GEN_EXEC) $(DC_HELP) - $(GEN_EMU) $(GEN_EXEC) $(DC_HELP) $(DC_HELP_C) $(BC_EXCLUDE_EXTRA_MATH) dc_help "" $(DC_ENABLED_NAME) + $(GEN_EMU) $(GEN_EXEC) $(DC_HELP) $(DC_HELP_C) $(BC_EXCLUDE_EXTRA_MATH) dc_help "" $(DC_ENABLED_NAME) 0 $(DC_HELP_O): $(DC_HELP_C) $(CC) $(CFLAGS) -o $@ -c $< @@ -548,6 +548,8 @@ clean_config: clean clean_benchmarks @$(RM) -f Makefile @$(RM) -f $(BC_MD) $(BC_MANPAGE) @$(RM) -f $(DC_MD) $(DC_MANPAGE) + @$(RM) -f compile_commands.json + @$(RM) -f $(BCL_PC) clean_coverage: @printf 'Cleaning coverage files...\n' diff --git a/contrib/bc/NEWS.md b/contrib/bc/NEWS.md index 4601db456f86..de3b35026fea 100644 --- a/contrib/bc/NEWS.md +++ b/contrib/bc/NEWS.md @@ -1,5 +1,67 @@ # News +## 6.6.0 + +This is a production release with two bug fixes and one change. + +The first bug fix is to fix the build on Mac OSX. + +The second bug was to remove printing a leading zero in scientific or +engineering output modes. + +The change was that the implementation of `irand()` was improved to call the +PRNG less. + +## 6.5.0 + +This is a production release that fixes an infinite loop bug in `root()` and +`cbrt()`, fixes a bug with `BC_LINE_LENGTH=0`, and adds the `fib()` function to +the extended math library to calculate Fibonacci numbers. + +## 6.4.0 + +This is a production release that fixes a `read()`/`?` bug and adds features to +`bcl`. + +The bug was that multiple read calls could repeat old data. + +The new features in `bcl` are functions to preserve `BclNumber` arguments and +not free them. + +***WARNING for `bcl` Users***: The `bcl_rand_seedWithNum()` function used to not +consume its arguments. Now it does. This change could have made this version +`7.0.0`, but I'm 99.9% confident that there are no `bcl` users, or if there are, +they probably don't use the PRNG. So I took a risk and didn't update the major +version. + +`bcl` now includes more capacity to check for invalid numbers when built to run +under Valgrind. + +## 6.3.1 + +This is a production release that fixes a `bc` dependency loop for minimal +environments and Linux from Scratch. + +## 6.3.0 + +This is a production release with a couple of fixes for manuals and a new +feature for `dc`: there is now a command to query whether extended registers are +enabled or not. + +Users who don't care do not need to upgrade. + +## 6.2.6 + +This is a production release that fixes an install bug that affected locale +installation of all locales when using `mksh`. Users do ***NOT*** need to +upgrade if they don't use `mksh` and/or don't need to install all locales. + +## 6.2.5 + +This is a production release that fixes a test bug that affected Android and +`mksh`. Users do ***NOT*** need to upgrade unless they use `mksh` or another +affected shell and need to run the test suite. + ## 6.2.4 This is a production release that fixes a test failure that happens when diff --git a/contrib/bc/README.md b/contrib/bc/README.md index 9d395f747185..943ca89eee2c 100644 --- a/contrib/bc/README.md +++ b/contrib/bc/README.md @@ -422,13 +422,23 @@ Other projects based on this bc are: * [busybox `bc`][8]. The busybox maintainers have made their own changes, so any bugs in the busybox `bc` should be reported to them. - * [toybox `bc`][9]. The maintainer has also made his own changes, so bugs in the toybox `bc` should be reported there. - * [FreeBSD `bc`][23]. While the `bc` in FreeBSD is kept up-to-date, it is better to [report bugs there][24], as well as [submit patches][25], and the maintainers of the package will contact me if necessary. +* [Mac OSX `bc`][35]. Any bugs in that `bc` should be reported to me, but do + expect bugs because the version is old. +* [Android Open Source `bc`][32]. Any bugs in that `bc` can be reported here. + +This is a non-comprehensive list of Linux distros that use this `bc` as the +system `bc`: + +* [Gentoo][33]; it is a first-class alternative to GNU `bc`, but not exclusive. +* [Linux from Scratch][34]. + +Other Linux distros package it as a second-class alternative, usually as `bc-gh` +or `howard-bc`. ## Language @@ -500,3 +510,7 @@ Folders: [29]: https://github.com/gavinhoward/bc [30]: ./manuals/bc/A.1.md#extended-library [31]: ./manuals/build.md#settings +[32]: https://android.googlesource.com/platform/external/bc/ +[33]: https://github.com/gentoo/gentoo/blob/master/app-alternatives/bc/bc-0.ebuild#L8 +[34]: https://www.linuxfromscratch.org/lfs/view/stable/chapter08/bc.html +[35]: https://github.com/apple-oss-distributions/bc/tree/main/bc diff --git a/contrib/bc/configure.sh b/contrib/bc/configure.sh index 3ada5298e9ed..4ba957131d52 100755 --- a/contrib/bc/configure.sh +++ b/contrib/bc/configure.sh @@ -772,7 +772,7 @@ predefined_build() { dc_default_digit_clamp=0;; GDH) - CFLAGS="-flto -Weverything -Wno-padded -Werror -pedantic -std=c11" + CFLAGS="-flto -Weverything -Wno-padded -Wno-unsafe-buffer-usage -Werror -pedantic -std=c11" bc_only=0 dc_only=0 coverage=0 @@ -806,7 +806,7 @@ predefined_build() { dc_default_digit_clamp=1;; DBG) - CFLAGS="-Weverything -Wno-padded -Werror -pedantic -std=c11" + CFLAGS="-Weverything -Wno-padded -Wno-unsafe-buffer-usage -Werror -pedantic -std=c11" bc_only=0 dc_only=0 coverage=0 @@ -1653,12 +1653,12 @@ else # We are also setting the CFLAGS and LDFLAGS here. if [ "$editline" -ne 0 ]; then LDFLAGS="$LDFLAGS -ledit" - CFLAGS="$CFLAGS -DBC_ENABLE_EDITLINE=1 -DBC_ENABLE_READLINE=0" + CPPFLAGS="$CPPFLAGS -DBC_ENABLE_EDITLINE=1 -DBC_ENABLE_READLINE=0" elif [ "$readline" -ne 0 ]; then LDFLAGS="$LDFLAGS -lreadline" - CFLAGS="$CFLAGS -DBC_ENABLE_EDITLINE=0 -DBC_ENABLE_READLINE=1" + CPPFLAGS="$CPPFLAGS -DBC_ENABLE_EDITLINE=0 -DBC_ENABLE_READLINE=1" else - CFLAGS="$CFLAGS -DBC_ENABLE_EDITLINE=0 -DBC_ENABLE_READLINE=0" + CPPFLAGS="$CPPFLAGS -DBC_ENABLE_EDITLINE=0 -DBC_ENABLE_READLINE=0" fi fi @@ -1682,6 +1682,24 @@ else CPPFLAGS="$CPPFLAGS -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700" fi +# Test Mac OSX. This is not in an if statement because regardless of whatever +# the user says, we need to know if we are on Mac OSX. If we are, we have to set +# _DARWIN_C_SOURCE. +printf 'Testing for Mac OSX...\n' + +flags="-DBC_TEST_APPLE -DBC_ENABLE_AFL=0" +"$CC" $CPPFLAGS $CFLAGS $flags "-I$scriptdir/include" -E "$scriptdir/src/vm.c" > /dev/null 2>&1 + +err="$?" + +if [ "$err" -ne 0 ]; then + printf 'On Mac OSX. Using _DARWIN_C_SOURCE.\n\n' + apple="-D_DARWIN_C_SOURCE" +else + printf 'Not on Mac OSX.\n\n' + apple="" +fi + # Test OpenBSD. This is not in an if statement because regardless of whatever # the user says, we need to know if we are on OpenBSD to activate _BSD_SOURCE. # No, I cannot `#define _BSD_SOURCE` in a header because OpenBSD's patched GCC @@ -1690,7 +1708,6 @@ fi # we have to set it because we also set _POSIX_C_SOURCE, which OpenBSD headers # detect, and when they detect it, they turn off _BSD_SOURCE unless it is # specifically requested. -set +e printf 'Testing for OpenBSD...\n' flags="-DBC_TEST_OPENBSD -DBC_ENABLE_AFL=0" @@ -1713,6 +1730,8 @@ else bsd="" fi +set -e + if [ "$library" -eq 1 ]; then bc_lib="" fi @@ -1801,7 +1820,7 @@ if [ "$library" -ne 0 ]; then contents=$(replace "$contents" "LIBDIR" "$LIBDIR") contents=$(replace "$contents" "VERSION" "$version") - printf '%s\n' "$contents" > "./bcl.pc" + printf '%s\n' "$contents" > "$scriptdir/bcl.pc" pkg_config_install="\$(SAFE_INSTALL) \$(PC_INSTALL_ARGS) \"\$(BCL_PC)\" \"\$(DESTDIR)\$(PC_PATH)/\$(BCL_PC)\"" pkg_config_uninstall="\$(RM) -f \"\$(DESTDIR)\$(PC_PATH)/\$(BCL_PC)\"" @@ -2072,6 +2091,7 @@ contents=$(replace "$contents" "CLEAN_PREREQS" "$CLEAN_PREREQS") contents=$(replace "$contents" "GEN_EMU" "$GEN_EMU") contents=$(replace "$contents" "BSD" "$bsd") +contents=$(replace "$contents" "APPLE" "$apple") contents=$(replace "$contents" "BC_DEFAULT_BANNER" "$bc_default_banner") contents=$(replace "$contents" "BC_DEFAULT_SIGINT_RESET" "$bc_default_sigint_reset") diff --git a/contrib/bc/gen/lib2.bc b/contrib/bc/gen/lib2.bc index 826f8a430cea..ba3f76b1803a 100644 --- a/contrib/bc/gen/lib2.bc +++ b/contrib/bc/gen/lib2.bc @@ -36,7 +36,7 @@ define p(x,y){ auto a a=y$ - if(y==a)return (x^a)@scale + if(y==a)return(x^a)@scale return e(y*l(x)) } define r(x,p){ @@ -93,6 +93,18 @@ define comb(n,r){ scale=s return f } +define fib(n){ + auto i,t,p,r + if(!n)return 0 + n=abs(n)$ + t=1 + for (i=1;i 6 && strcmp("", argv[6]) != 0); define = has_define ? argv[6] : ""; - remove_tabs = (argc > 7); + remove_tabs = (argc > 7 && atoi(argv[7]) != 0); in = bc_read_file(argv[1]); if (in == NULL) return INVALID_INPUT_FILE; diff --git a/contrib/bc/gen/strgen.sh b/contrib/bc/gen/strgen.sh index a65e221ad0b4..2b8927b5528e 100755 --- a/contrib/bc/gen/strgen.sh +++ b/contrib/bc/gen/strgen.sh @@ -62,7 +62,9 @@ name="$4" label="$5" define="$6" remove_tabs="$7" -check_bool_arg "$remove_tabs" +if [ "$remove_tabs" != "" ]; then + check_bool_arg "$remove_tabs" +fi tmpinput=$(mktemp -t "${input##*/}_XXXXXX") diff --git a/contrib/bc/include/bcl.h b/contrib/bc/include/bcl.h index 234fe475f00e..0908e215182c 100644 --- a/contrib/bc/include/bcl.h +++ b/contrib/bc/include/bcl.h @@ -36,11 +36,20 @@ #ifndef BC_BCL_H #define BC_BCL_H +// TODO: Add a generation index when building with Valgrind to check for +// use-after-free's or double frees. + #include #include #include #include +#ifndef NDEBUG +#define BC_DEBUG (1) +#else // NDEBUG +#define BC_DEBUG (0) +#endif // NDEBUG + #ifdef _WIN32 #include #include @@ -232,42 +241,78 @@ bcl_dup(BclNumber s); BclError bcl_bigdig(BclNumber n, BclBigDig* result); +BclError +bcl_bigdig_keep(BclNumber n, BclBigDig* result); + BclNumber bcl_bigdig2num(BclBigDig val); BclNumber bcl_add(BclNumber a, BclNumber b); +BclNumber +bcl_add_keep(BclNumber a, BclNumber b); + BclNumber bcl_sub(BclNumber a, BclNumber b); +BclNumber +bcl_sub_keep(BclNumber a, BclNumber b); + BclNumber bcl_mul(BclNumber a, BclNumber b); +BclNumber +bcl_mul_keep(BclNumber a, BclNumber b); + BclNumber bcl_div(BclNumber a, BclNumber b); +BclNumber +bcl_div_keep(BclNumber a, BclNumber b); + BclNumber bcl_mod(BclNumber a, BclNumber b); +BclNumber +bcl_mod_keep(BclNumber a, BclNumber b); + BclNumber bcl_pow(BclNumber a, BclNumber b); +BclNumber +bcl_pow_keep(BclNumber a, BclNumber b); + BclNumber bcl_lshift(BclNumber a, BclNumber b); +BclNumber +bcl_lshift_keep(BclNumber a, BclNumber b); + BclNumber bcl_rshift(BclNumber a, BclNumber b); +BclNumber +bcl_rshift_keep(BclNumber a, BclNumber b); + BclNumber bcl_sqrt(BclNumber a); +BclNumber +bcl_sqrt_keep(BclNumber a); + BclError bcl_divmod(BclNumber a, BclNumber b, BclNumber* c, BclNumber* d); +BclError +bcl_divmod_keep(BclNumber a, BclNumber b, BclNumber* c, BclNumber* d); + BclNumber bcl_modexp(BclNumber a, BclNumber b, BclNumber c); +BclNumber +bcl_modexp_keep(BclNumber a, BclNumber b, BclNumber c); + ssize_t bcl_cmp(BclNumber a, BclNumber b); @@ -283,18 +328,30 @@ bcl_parse(const char* restrict val); char* bcl_string(BclNumber n); +char* +bcl_string_keep(BclNumber n); + BclNumber bcl_irand(BclNumber a); +BclNumber +bcl_irand_keep(BclNumber a); + BclNumber bcl_frand(size_t places); BclNumber bcl_ifrand(BclNumber a, size_t places); +BclNumber +bcl_ifrand_keep(BclNumber a, size_t places); + BclError bcl_rand_seedWithNum(BclNumber n); +BclError +bcl_rand_seedWithNum_keep(BclNumber n); + BclError bcl_rand_seed(unsigned char seed[BCL_SEED_SIZE]); diff --git a/contrib/bc/include/lang.h b/contrib/bc/include/lang.h index 2d9776532249..97aeeaa98da8 100644 --- a/contrib/bc/include/lang.h +++ b/contrib/bc/include/lang.h @@ -277,6 +277,9 @@ typedef enum BcInst #if DC_ENABLED + /// dc extended registers command. + BC_INST_EXTENDED_REGISTERS, + /// dc's return; it pops an executing string off of the stack. BC_INST_POP_EXEC, @@ -575,7 +578,7 @@ bc_func_insert(BcFunc* f, struct BcProgram* p, char* name, BcType type, void bc_func_reset(BcFunc* f); -#ifndef NDEBUG +#if BC_DEBUG /** * Frees a function. This is a destructor. This is only used in debug builds * because all functions are freed at exit. We free them in debug builds to @@ -584,7 +587,7 @@ bc_func_reset(BcFunc* f); */ void bc_func_free(void* func); -#endif // NDEBUG +#endif // BC_DEBUG /** * Initializes an array, which is the array type in bc and dc source code. Since diff --git a/contrib/bc/include/lex.h b/contrib/bc/include/lex.h index 54d704f8b447..ac9b7b6ea69c 100644 --- a/contrib/bc/include/lex.h +++ b/contrib/bc/include/lex.h @@ -49,11 +49,11 @@ * @param l The lexer. * @param e The error. */ -#ifndef NDEBUG +#if BC_DEBUG #define bc_lex_err(l, e) (bc_vm_handleError((e), __FILE__, __LINE__, (l)->line)) -#else // NDEBUG +#else // BC_DEBUG #define bc_lex_err(l, e) (bc_vm_handleError((e), (l)->line)) -#endif // NDEBUG +#endif // BC_DEBUG /** * A convenience macro for throwing errors in lex code. This takes care of @@ -61,12 +61,12 @@ * @param l The lexer. * @param e The error. */ -#ifndef NDEBUG +#if BC_DEBUG #define bc_lex_verr(l, e, ...) \ (bc_vm_handleError((e), __FILE__, __LINE__, (l)->line, __VA_ARGS__)) -#else // NDEBUG +#else // BC_DEBUG #define bc_lex_verr(l, e, ...) (bc_vm_handleError((e), (l)->line, __VA_ARGS__)) -#endif // NDEBUG +#endif // BC_DEBUG // BC_LEX_NEG_CHAR returns the char that corresponds to negative for the // current calculator. @@ -409,6 +409,9 @@ typedef enum BcLexType #if DC_ENABLED + /// dc extended registers keyword. + BC_LEX_EXTENDED_REGISTERS, + /// A special token for dc to calculate equal without a register. BC_LEX_EQ_NO_REG, @@ -533,7 +536,7 @@ void bc_lex_init(BcLex* l); /** - * Frees a lexer. This is not guarded by #ifndef NDEBUG because a separate + * Frees a lexer. This is not guarded by #if BC_DEBUG because a separate * parser is created at runtime to parse read() expressions and dc strings, and * that parser needs a lexer. * @param l The lexer to free. diff --git a/contrib/bc/include/library.h b/contrib/bc/include/library.h index 76df91392da1..1edd3757444c 100644 --- a/contrib/bc/include/library.h +++ b/contrib/bc/include/library.h @@ -47,6 +47,145 @@ #include #include +#if BC_ENABLE_MEMCHECK + +/** + * A typedef for Valgrind builds. This is to add a generation index for error + * checking. + */ +typedef struct BclNum +{ + /// The number. + BcNum n; + + /// The generation index. + size_t gen_idx; + +} BclNum; + +/** + * Clears the generation byte in a BclNumber and returns the value. + * @param n The BclNumber. + * @return The value of the index. + */ +#define BCL_NO_GEN(n) \ + ((n).i & ~(((size_t) UCHAR_MAX) << ((sizeof(size_t) - 1) * CHAR_BIT))) + +/** + * Gets the generation index in a BclNumber. + * @param n The BclNumber. + * @return The generation index. + */ +#define BCL_GET_GEN(n) ((n).i >> ((sizeof(size_t) - 1) * CHAR_BIT)) + +/** + * Turns a BclNumber into a BcNum. + * @param c The context. + * @param n The BclNumber. + */ +#define BCL_NUM(c, n) ((BclNum*) bc_vec_item(&(c)->nums, BCL_NO_GEN(n))) + +/** + * Clears the generation index top byte in the BclNumber. + * @param n The BclNumber. + */ +#define BCL_CLEAR_GEN(n) \ + do \ + { \ + (n).i &= ~(((size_t) UCHAR_MAX) << ((sizeof(size_t) - 1) * CHAR_BIT)); \ + } \ + while (0) + +#define BCL_CHECK_NUM_GEN(c, bn) \ + do \ + { \ + size_t gen_ = BCL_GET_GEN(bn); \ + BclNum* ptr_ = BCL_NUM(c, bn); \ + if (BCL_NUM_ARRAY(ptr_) == NULL) \ + { \ + bcl_nonexistentNum(); \ + } \ + if (gen_ != ptr_->gen_idx) \ + { \ + bcl_invalidGeneration(); \ + } \ + } \ + while (0) + +#define BCL_CHECK_NUM_VALID(c, bn) \ + do \ + { \ + size_t idx_ = BCL_NO_GEN(bn); \ + if ((c)->nums.len <= idx_) \ + { \ + bcl_numIdxOutOfRange(); \ + } \ + BCL_CHECK_NUM_GEN(c, bn); \ + } \ + while (0) + +/** + * Returns the limb array of the number. + * @param bn The number. + * @return The limb array. + */ +#define BCL_NUM_ARRAY(bn) ((bn)->n.num) + +/** + * Returns the limb array of the number for a non-pointer. + * @param bn The number. + * @return The limb array. + */ +#define BCL_NUM_ARRAY_NP(bn) ((bn).n.num) + +/** + * Returns the BcNum pointer. + * @param bn The number. + * @return The BcNum pointer. + */ +#define BCL_NUM_NUM(bn) (&(bn)->n) + +/** + * Returns the BcNum pointer for a non-pointer. + * @param bn The number. + * @return The BcNum pointer. + */ +#define BCL_NUM_NUM_NP(bn) (&(bn).n) + +// These functions only abort. They exist to give developers some idea of what +// went wrong when bugs are found, if they look at the Valgrind stack trace. + +BC_NORETURN void +bcl_invalidGeneration(void); + +BC_NORETURN void +bcl_nonexistentNum(void); + +BC_NORETURN void +bcl_numIdxOutOfRange(void); + +#else // BC_ENABLE_MEMCHECK + +/** + * A typedef for non-Valgrind builds. + */ +typedef BcNum BclNum; + +#define BCL_NO_GEN(n) ((n).i) +#define BCL_NUM(c, n) ((BclNum*) bc_vec_item(&(c)->nums, (n).i)) +#define BCL_CLEAR_GEN(n) ((void) (n)) + +#define BCL_CHECK_NUM_GEN(c, bn) +#define BCL_CHECK_NUM_VALID(c, n) + +#define BCL_NUM_ARRAY(bn) ((bn)->num) +#define BCL_NUM_ARRAY_NP(bn) ((bn).num) + +#define BCL_NUM_NUM(bn) (bn) +#define BCL_NUM_NUM_NP(bn) (&(bn)) + +#endif // BC_ENABLE_MEMCHECK + /** * A header that sets a jump. * @param vm The thread data. @@ -88,19 +227,19 @@ * idx. * @param c The context. * @param e The error. - * @param n The number. + * @param bn The number. * @param idx The idx to set as the return value. */ -#define BC_MAYBE_SETUP(c, e, n, idx) \ - do \ - { \ - if (BC_ERR((e) != BCL_ERROR_NONE)) \ - { \ - if ((n).num != NULL) bc_num_free(&(n)); \ - idx.i = 0 - (size_t) (e); \ - } \ - else idx = bcl_num_insert(c, &(n)); \ - } \ +#define BC_MAYBE_SETUP(c, e, bn, idx) \ + do \ + { \ + if (BC_ERR((e) != BCL_ERROR_NONE)) \ + { \ + if (BCL_NUM_ARRAY_NP(bn) != NULL) bc_num_free(BCL_NUM_NUM_NP(bn)); \ + idx.i = 0 - (size_t) (e); \ + } \ + else idx = bcl_num_insert(c, &(bn)); \ + } \ while (0) /** @@ -108,17 +247,17 @@ * is bad. * @param c The context. */ -#define BC_CHECK_CTXT(vm, c) \ - do \ - { \ - c = bcl_contextHelper(vm); \ - if (BC_ERR(c == NULL)) \ - { \ - BclNumber n_num; \ - n_num.i = 0 - (size_t) BCL_ERROR_INVALID_CONTEXT; \ - return n_num; \ - } \ - } \ +#define BC_CHECK_CTXT(vm, c) \ + do \ + { \ + c = bcl_contextHelper(vm); \ + if (BC_ERR(c == NULL)) \ + { \ + BclNumber n_num_; \ + n_num_.i = 0 - (size_t) BCL_ERROR_INVALID_CONTEXT; \ + return n_num_; \ + } \ + } \ while (0) /** @@ -157,16 +296,18 @@ #define BC_CHECK_NUM(c, n) \ do \ { \ - if (BC_ERR((n).i >= (c)->nums.len)) \ + size_t no_gen_ = BCL_NO_GEN(n); \ + if (BC_ERR(no_gen_ >= (c)->nums.len)) \ { \ if ((n).i > 0 - (size_t) BCL_ERROR_NELEMS) return (n); \ else \ { \ - BclNumber n_num; \ - n_num.i = 0 - (size_t) BCL_ERROR_INVALID_NUM; \ - return n_num; \ + BclNumber n_num_; \ + n_num_.i = 0 - (size_t) BCL_ERROR_INVALID_NUM; \ + return n_num_; \ } \ } \ + BCL_CHECK_NUM_GEN(c, n); \ } \ while (0) @@ -181,7 +322,8 @@ *** 6729 LINES SKIPPED *** From nobody Thu Jun 8 13:16:47 2023 X-Original-To: dev-commits-src-branches@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 4QcPqz3LT8z4bckp; Thu, 8 Jun 2023 13:16:47 +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 4QcPqz2tD7z4FjB; Thu, 8 Jun 2023 13:16:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686230207; 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=VkUhBkfndWUCHk1JMsxTBtfWrWktry8wAzirga73CDU=; b=vrXfqB/XNQG/jJtasUx/D/xXnEEPDGeQalp5fH3pwo3iXXQnsCqcQja+JjYivVL6mDcdfI uaIILCkxOgwyh5kiszYzBDayX6EE/OcqRNZUiXtGWj3Vd8/Oc8jCu/TCQLuydHhjP3HJjh dtXIRnc9S7aPMvmOEUHPEY3RTPIiL6Iv/0afFFEsLklap4ncYDl+2ngzYmUBBPun48ZrYq Eiv/9Zehf0VLcEk4dHNMpy9aqINq7Twry175+y2eg83LYPznPq1VFycDoF0P6DVHXM4WG4 rnlqKy5A5Lb54TuPwvQLp2CXpzN8PhcP17lJ8EUU/Zi6O+2RW2kzGKy70kizXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686230207; 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=VkUhBkfndWUCHk1JMsxTBtfWrWktry8wAzirga73CDU=; b=gwtWfWkoH/9H0/yTbsipxowHVHXQJmypCNa/Ka36v7fb5L9m9HpkNzVvmjDi8YJ/fzYkhS DSXuDBYXcAbGdLCwk4tW6XYw3nYa18F+Ajkbjh0i+MT7o+RoBAoAl/5uCf5rDVi/9jxAh3 CKFnbjFtWiczw3L18Gnd/yre9Mw0aDYdbl5WfGl4bk2dvXWCKANqiezIKL2Ki9wq6tFz2I 9WF24sJA6JHPUgtVzOCqkHBOG5C5gBkrS/pap5gWW2jf+AIYovD9QXblXabLMbblnDTwWU t9Iguph37oJfY4/VDjqOrzlOUQpyjW/raB4lVVREcY/m8WfV7panK4Fxf8LZOA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686230207; a=rsa-sha256; cv=none; b=ov7TvIZK9AJmN0bSydDzC+GSQDQAa127WST8ANw9NGzIDI9KWric6xgmdcKqPfBhJKCeCW OuShAmz7Iz1+zFU5Kd7a6T13l40KnTBr5YKYXJ2W/u9KtrCUfjtUUe8EkmozvjwwVszQmu ukkKYyjnxYYFgj/N83nXvscdk4WvhF5AK6giYb2G8KFWFgOdbmf4C8cisdFCvRbJAjBwEv iQYE7bvsDuXkjtXfkBMXXFuck2aST2aowBJLu0xw+5PHEKM1MViRAt7Py2PVO80QO7jurH hycbRv9GL24QIrd6xvZm8L0P5bOvECaaFq3TtHXnagwrbMUrecGxFydZSP7mFg== 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 4QcPqz1xGCzvk5; Thu, 8 Jun 2023 13:16:47 +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 358DGlHt036132; Thu, 8 Jun 2023 13:16:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 358DGlWf036131; Thu, 8 Jun 2023 13:16:47 GMT (envelope-from git) Date: Thu, 8 Jun 2023 13:16:47 GMT Message-Id: <202306081316.358DGlWf036131@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: e30c54cd4447 - stable/13 - ktrace: Make the data lengths table const List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: e30c54cd444760c6a1bdda07aa5e34b98a859dbb Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=e30c54cd444760c6a1bdda07aa5e34b98a859dbb commit e30c54cd444760c6a1bdda07aa5e34b98a859dbb Author: Mark Johnston AuthorDate: 2023-06-01 21:12:42 +0000 Commit: Mark Johnston CommitDate: 2023-06-08 13:16:26 +0000 ktrace: Make the data lengths table const No functional change intended. MFC after: 1 week (cherry picked from commit 3080f82b8b644809d8731c4f5c72f1530c400eb3) --- sys/kern/kern_ktrace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/kern_ktrace.c b/sys/kern/kern_ktrace.c index 9221a9ceb765..d2fe2a999dc3 100644 --- a/sys/kern/kern_ktrace.c +++ b/sys/kern/kern_ktrace.c @@ -112,7 +112,7 @@ struct ktr_request { STAILQ_ENTRY(ktr_request) ktr_list; }; -static int data_lengths[] = { +static const int data_lengths[] = { [KTR_SYSCALL] = offsetof(struct ktr_syscall, ktr_args), [KTR_SYSRET] = sizeof(struct ktr_sysret), [KTR_NAMEI] = 0, From nobody Thu Jun 8 13:16:48 2023 X-Original-To: dev-commits-src-branches@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 4QcPr05Pd0z4bd1r; Thu, 8 Jun 2023 13:16:48 +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 4QcPr04729z4FrB; Thu, 8 Jun 2023 13:16:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686230208; 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=AFpjGI5Ze76kJdXkywk96k33tfmlvZbEZg6apA/xfMk=; b=h4taJKFOqkRzcesRpsDRPjtXNt1I3SKRRPpyUokeT9eSMCnBp9g7ixp6HQDiuSJcQpf/RR 1TCAzHzwTT5hLo2DpevPsdfgCDJQYyE+nTwG8RxEI1nQrqUSL1HnzKD3umugJs3V1e3f1K donClijZIeW1yILX/DMOaQHutSklscKWx5KJs9FoNlf7a7vcKavJiFlgG4Pb1+jqYUfixv P2yfAgkA8mHHwPepftp40cSkqjOoRE2R4PVFqoPAHQpiCxB13xHTo2BUEz+E0Pw3rxzTRd mRh5UZfrKogF9UL6Q17WTuOChSeQ4qhTV+AAdTYmCey/eoq3EjTKuXuwN8+51A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686230208; 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=AFpjGI5Ze76kJdXkywk96k33tfmlvZbEZg6apA/xfMk=; b=wg7Zytg9TmBoqq+JyLDYIHNIKmcTx4XoYvz5ws0INaVKMUMjg/eBLPPe8sdRuTHX/C2VNy T9/qXpZe8APG9CMmhVlGFye780shIJAEkIAsB0avAg6eowL+GFYvPyCaqME3Jvify7fmoq vP7creiO2hmtYyvkkKu++ycySg1RgWYAsVc7CmvroiqjDdFj3nWoNIrSf1yxBNgN+lesuM tAuEglvPrAVmFdtDqLut3+6G4w5tKLCZcu3P/UYXkBs353JPbQ39LBgJ5qFgchLT7/Ksl0 wTfcMb9tjDiZe3USC1qIOrnv9wV9D6KkyDtp9c17GlB5xchPbChb1FQns73ezg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686230208; a=rsa-sha256; cv=none; b=rCXrPTB93jlREcTOW0jOE3ZVLCsWxkTNRpfwygCruJdYD6Vd3cifna58pxatInlA/t9Saa OdiKO3t0OrbDV601hylYGuI/hsUyKqOup4SwWouwbUh/EJUik5ViYqxM3dyEUQn1mEQROj binkwRt+uTr79dfONdNEgkfvHxg5jJ3y0KLO9kD707dPnWaC08vud3McfdaMJCcnYyKrbZ 1VZTadUgLb4yh7PEked1oJLjcz2oZhp/fu4hikZw+5x52LbELTcUk+jnIEQqS1cx7T8pqp Iw4qxohe+n5/VR0fbB36adCb/9GPyMwwB+piN5rpcxhfd272H4SLYMla3UDQWA== 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 4QcPr03BQ8zvyY; Thu, 8 Jun 2023 13:16:48 +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 358DGmZ1036151; Thu, 8 Jun 2023 13:16:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 358DGm7Z036150; Thu, 8 Jun 2023 13:16:48 GMT (envelope-from git) Date: Thu, 8 Jun 2023 13:16:48 GMT Message-Id: <202306081316.358DGm7Z036150@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: cf5731ee5a6f - stable/13 - signal: Make the signal disposition table const List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: cf5731ee5a6fd8545eaf9eea02eab3c5dc1e9c61 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=cf5731ee5a6fd8545eaf9eea02eab3c5dc1e9c61 commit cf5731ee5a6fd8545eaf9eea02eab3c5dc1e9c61 Author: Mark Johnston AuthorDate: 2023-06-01 21:11:55 +0000 Commit: Mark Johnston CommitDate: 2023-06-08 13:16:34 +0000 signal: Make the signal disposition table const No functional change intended. MFC after: 1 week (cherry picked from commit 0d3f1b4f25150c3c5afaa669715421821323ead1) --- sys/kern/kern_sig.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index 63d73cf7a909..539c020c183e 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -219,7 +219,7 @@ SYSCTL_INT(_kern, OID_AUTO, coredump_devctl, CTLFLAG_RW, &coredump_devctl, #define SIGPROP_IGNORE 0x10 /* ignore by default */ #define SIGPROP_CONT 0x20 /* continue if suspended */ -static int sigproptbl[NSIG] = { +static const int sigproptbl[NSIG] = { [SIGHUP] = SIGPROP_KILL, [SIGINT] = SIGPROP_KILL, [SIGQUIT] = SIGPROP_KILL | SIGPROP_CORE, From nobody Thu Jun 8 14:50:12 2023 X-Original-To: dev-commits-src-branches@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 4QcRvn1Rh8z4bpsk; Thu, 8 Jun 2023 14:50:13 +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 4QcRvn0th3z4RyZ; Thu, 8 Jun 2023 14:50:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686235813; 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=tJYxZW6GvOwL7ITG6uLevsrJgryZhWa8MuBbWz0gs74=; b=STrH/AK96PsGmhNvHrhMcSZNBD7IelcyZgqmGZoaSThybxjA1o5i/UPrsz2NjIgBCV6A1E Wtp8rAiKm5vI0kdH879A17EreFifsmrErlX7vvP04Z1dblZizWMefNWJRv/xjfntqBTM0o Yxl0NULel29Nn9/H51YamwRtPUSzVpXQMHCPUKYMWf1KghO2yVTb1d1v3MhBWJlaA+xQfq Biw9YHLY+hIU66WFgSkGEvy9tQtl0LiYRaDFLlpyMKNfOGTGkK751npqEtnwNUdxIq/65n Nzwb+OaKoPZhitm4z8uION11g2vPWIyJbo8Sx4h8PZCFUGObpNIJdD+VpttI7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686235813; 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=tJYxZW6GvOwL7ITG6uLevsrJgryZhWa8MuBbWz0gs74=; b=puGdz+H4LBRPMG9ZjNmoy5h1iInNjpv2p6eehbgyLD9Q2g0tcKy+pwU6THeP3bfhn6a/it 8VpOhTjxyQ0llvkizOw67O6SPZmPw6LV4Tiz/dBPPvgLijyng2nDGzrAUooFfPgPRdXLqd CTUc6XXyo/jgVrIib7SO0VeUXw1GA4fT3sS1Z0UHOFpyWpSekF9Lb47KOEXinNxo5Skcu0 gTardrXodFpicSjiAuhs+BTN399ef4nW/IzN/GCNuMBIcfNwCklpfvHYKwPM2JMj875K0I Moej0zD0KYKf1pFWlISBgtsPno02U7zGNbSHJKPER/jDAXO1MVUSNbJGpkUZrw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686235813; a=rsa-sha256; cv=none; b=Jw7hhmGcdxwYd1T+psL0xhLnt62Oq2EjraNVCfCUvGcrtSGiGyA4uqhnbCf/QbGEFkiBq7 wiG+TJtMeWTfqFZM5qGeteO7+/b8q8p043vdnr9J+gve0ylosDhYwCgW+PgLxn3HESVr+9 fCKsneqNPacj9L2N5V7nVNRjPOorvvAMjSLsaIHYu/ugZEy5IFjts274o0+fVKjpS2jPsz Z1doB1wFSwgqZvRg9m3ITjQZLaiAqaFoeG3oi+VStSXur4yH5gcTk+iJ/1LFtP1RGFkQ0q GZyEa3JIL9/m8vikkRAvA/7U7YgCM0KFxz8tYznvxHy/MnAw3ZIQa3MgKHLf8g== 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 4QcRvm7407zxry; Thu, 8 Jun 2023 14:50:12 +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 358EoCAR090131; Thu, 8 Jun 2023 14:50:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 358EoCiW090124; Thu, 8 Jun 2023 14:50:12 GMT (envelope-from git) Date: Thu, 8 Jun 2023 14:50:12 GMT Message-Id: <202306081450.358EoCiW090124@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: =?utf-8?Q?Stefan=20E=C3=9Fer?= Subject: git: 8eba66320128 - stable/13 - usr.bin/bc: fix build issue of version 6.6.0 on MIPS List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: se X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8eba66320128e4258b2e0b676d1e6b7a96f81532 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=8eba66320128e4258b2e0b676d1e6b7a96f81532 commit 8eba66320128e4258b2e0b676d1e6b7a96f81532 Author: Stefan Eßer AuthorDate: 2023-06-08 14:45:11 +0000 Commit: Stefan Eßer CommitDate: 2023-06-08 14:49:49 +0000 usr.bin/bc: fix build issue of version 6.6.0 on MIPS The update removed MIPS and POWERPC64 from the list of architectures that cannot use LTO to build this software. Restore the previous exception list and do not use LTO on MIPS, MIPS64, POWERPC64, and RISCV64. This is necessary due to differences in compiler support for LTO in -CURRENT vs. 13-STABLE. --- usr.bin/gh-bc/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usr.bin/gh-bc/Makefile b/usr.bin/gh-bc/Makefile index 6554d626af89..154155085479 100644 --- a/usr.bin/gh-bc/Makefile +++ b/usr.bin/gh-bc/Makefile @@ -71,7 +71,8 @@ MAN_SRC_BC= bc/A.1 MAN_SRC_DC= dc/A.1 # prevent floating point incompatibilities caused by -flto on some architectures -.if ${MACHINE_ARCH} != riscv64 +.if ${MACHINE_ARCH:Mmips*} == "" && ${MACHINE_ARCH} != powerpc64 && \ + ${MACHINE_ARCH} != riscv64 CFLAGS+= -flto .endif From nobody Fri Jun 9 13:37:49 2023 X-Original-To: dev-commits-src-branches@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 4Qd2Fp2nW6z4c4Bx; Fri, 9 Jun 2023 13:37:50 +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 4Qd2Fp2Fsqz4Ws8; Fri, 9 Jun 2023 13:37:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686317870; 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=HMkbjP4cqvfZtQgki4l0CeibqhHObuLq0ky1s6yact8=; b=tKfDYjTlBPovVusPRg6sqn1P/tkbCSoebRg9gqvIVJV3XPEwPEUWi9cmNEqag2MAmlFBE1 ADFlkIpn/nsmn+hpU+uilwVUf+nXv8+imUduEioDY243pQKRy6VcOQsvxJ5ApgtzrGqkpk ESUBcxFb3MbdflRY3r0ajTKk4fKp9YJVth/F24LzDsiLPOLrPKFrNkGjzgfFcD9ArAIJl6 ObHotMOLWT4q/QmrAcR4HLL72rxg4NVNpKFqS5trQ7kPlj+J6+kZAAdvZGWqrkwwLf/Omw JqtDxqEbog6Z6L372VeSB3p+0tnGaBCnWDQnNrsvYofTt6WVe6crCsf40ydEgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686317870; 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=HMkbjP4cqvfZtQgki4l0CeibqhHObuLq0ky1s6yact8=; b=Q4HS6GVjZYUPeZHT3GTlWZLby/wv+w5Esk2T6eAGMVIX0LBqaCKTiqyvnUdWejK8w+/24G FI8eHqW9djCd0E+Kmbsw2HsNyMuHA61FlWQyp+eb5TuZY0zPgUcfuOlH6DDlEpRjfDgVdz V+RVwpdVuVfi40W+dYg9CCa3133O6FQ0LqnxrZNGqXsunXNBjK4Nfj0zV3nsx3RE4RPVvT w+QQ/wM4OdiJEcV5PA0dhnFrlowaBX4wDijZU+UX521HmOpiP2zU9xzBkRXNH7a/uCTZp7 ixynSMdZuorxsJoj/80YD0U24SEMt1EUUFkPtEErL14gM6HbZRI1f5bw9SlqFw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686317870; a=rsa-sha256; cv=none; b=BMBxWh1flU3TUGSBMxgTdPfANhCK6Y5iScLGhHYQfVF75SsewA4eQsJNr08OrsWwmM7ofu zxwjale1NVg6H8zD1ywkrHyjIlUfAtV0pZ0scZZ8a1Vn6U//CqcwAsKl79ujdNIKKLYuNI WB2PZMp4I85mfK37Cx3qqseOFhLQ79IhIlrmMEgV/tKUMmW85V/sUlVLyYH+bpgEWAVhT7 ZMbtPUhrbcrXvkSGma8vr7oOsOHkEz40WQMRNgkdlt8NYmgV/I00A9JItwVc5QJZ+HsJVx rIwFqaWH1ri9llpY8isUbUJW66IaYSJ42dmQ6O2AYuWOiOeu1k64fu+GW++/ow== 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 4Qd2Fp1J2tzd2K; Fri, 9 Jun 2023 13:37:50 +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 359DboX7044768; Fri, 9 Jun 2023 13:37:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 359DbnXw044764; Fri, 9 Jun 2023 13:37:49 GMT (envelope-from git) Date: Fri, 9 Jun 2023 13:37:49 GMT Message-Id: <202306091337.359DbnXw044764@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 5d3fa3d71c31 - stable/13 - ntp: import ntp-4.2.8p17 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5d3fa3d71c3166f573b045a870e45e464399e2ef Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=5d3fa3d71c3166f573b045a870e45e464399e2ef commit 5d3fa3d71c3166f573b045a870e45e464399e2ef Author: Cy Schubert AuthorDate: 2023-06-06 12:43:04 +0000 Commit: Cy Schubert CommitDate: 2023-06-09 13:35:55 +0000 ntp: import ntp-4.2.8p17 Fixes two small bugs including one regression. Merge commit 'ab1f1aa8333369a83ff284848fc3fc2e52d5f29f' (cherry picked from commit e6bfd18d21b225af6a0ed67ceeaf1293b7b9eba5) ntp: Fix build Two files used to obtain time from reference clocks did not include ntp_types.h resulting in an undefined NONEMPTY_TRANSLATION_UNIT. Fixes: e6bfd18d21b2 (cherry picked from commit 82aa1470c94c55db31c0168d65f8a08fa1d41378) --- contrib/ntp/ChangeLog | 14 + contrib/ntp/CommitLog | 464 +++++++++++++++++++++ contrib/ntp/NEWS | 25 ++ contrib/ntp/configure | 20 +- contrib/ntp/include/ntp.h | 2 +- contrib/ntp/include/ntp_md5.h | 4 + contrib/ntp/include/ntp_stdlib.h | 39 +- contrib/ntp/libntp/a_md5encrypt.c | 23 +- contrib/ntp/libntp/authkeys.c | 27 +- contrib/ntp/libntp/authreadkeys.c | 12 +- contrib/ntp/libntp/msyslog.c | 5 +- contrib/ntp/libparse/clk_hopf6021.c | 7 +- contrib/ntp/libparse/clk_wharton.c | 7 +- contrib/ntp/ntpd/invoke-ntp.conf.texi | 2 +- contrib/ntp/ntpd/invoke-ntp.keys.texi | 2 +- contrib/ntp/ntpd/invoke-ntpd.texi | 4 +- contrib/ntp/ntpd/ntp.conf.5man | 4 +- contrib/ntp/ntpd/ntp.conf.5mdoc | 4 +- contrib/ntp/ntpd/ntp.conf.html | 2 +- contrib/ntp/ntpd/ntp.conf.man.in | 4 +- contrib/ntp/ntpd/ntp.conf.mdoc.in | 4 +- contrib/ntp/ntpd/ntp.keys.5man | 4 +- contrib/ntp/ntpd/ntp.keys.5mdoc | 4 +- contrib/ntp/ntpd/ntp.keys.html | 2 +- contrib/ntp/ntpd/ntp.keys.man.in | 4 +- contrib/ntp/ntpd/ntp.keys.mdoc.in | 4 +- contrib/ntp/ntpd/ntp_config.c | 18 + contrib/ntp/ntpd/ntp_control.c | 1 - contrib/ntp/ntpd/ntp_loopfilter.c | 3 - contrib/ntp/ntpd/ntp_proto.c | 5 +- contrib/ntp/ntpd/ntpd-opts.c | 14 +- contrib/ntp/ntpd/ntpd-opts.h | 6 +- contrib/ntp/ntpd/ntpd.1ntpdman | 4 +- contrib/ntp/ntpd/ntpd.1ntpdmdoc | 4 +- contrib/ntp/ntpd/ntpd.c | 6 +- contrib/ntp/ntpd/ntpd.html | 4 +- contrib/ntp/ntpd/ntpd.man.in | 4 +- contrib/ntp/ntpd/ntpd.mdoc.in | 4 +- contrib/ntp/ntpdc/invoke-ntpdc.texi | 4 +- contrib/ntp/ntpdc/ntpdc-opts.c | 14 +- contrib/ntp/ntpdc/ntpdc-opts.h | 6 +- contrib/ntp/ntpdc/ntpdc.1ntpdcman | 4 +- contrib/ntp/ntpdc/ntpdc.1ntpdcmdoc | 4 +- contrib/ntp/ntpdc/ntpdc.html | 4 +- contrib/ntp/ntpdc/ntpdc.man.in | 4 +- contrib/ntp/ntpdc/ntpdc.mdoc.in | 4 +- contrib/ntp/ntpq/invoke-ntpq.texi | 4 +- contrib/ntp/ntpq/ntpq-opts.c | 14 +- contrib/ntp/ntpq/ntpq-opts.h | 6 +- contrib/ntp/ntpq/ntpq.1ntpqman | 4 +- contrib/ntp/ntpq/ntpq.1ntpqmdoc | 4 +- contrib/ntp/ntpq/ntpq.html | 4 +- contrib/ntp/ntpq/ntpq.man.in | 4 +- contrib/ntp/ntpq/ntpq.mdoc.in | 4 +- contrib/ntp/ntpsnmpd/invoke-ntpsnmpd.texi | 2 +- contrib/ntp/ntpsnmpd/ntpsnmpd-opts.c | 14 +- contrib/ntp/ntpsnmpd/ntpsnmpd-opts.h | 6 +- contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdman | 4 +- contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc | 4 +- contrib/ntp/ntpsnmpd/ntpsnmpd.html | 2 +- contrib/ntp/ntpsnmpd/ntpsnmpd.man.in | 4 +- contrib/ntp/ntpsnmpd/ntpsnmpd.mdoc.in | 4 +- contrib/ntp/packageinfo.sh | 2 +- .../calc_tickadj/calc_tickadj.1calc_tickadjman | 4 +- .../calc_tickadj/calc_tickadj.1calc_tickadjmdoc | 4 +- contrib/ntp/scripts/calc_tickadj/calc_tickadj.html | 2 +- .../ntp/scripts/calc_tickadj/calc_tickadj.man.in | 4 +- .../ntp/scripts/calc_tickadj/calc_tickadj.mdoc.in | 4 +- .../scripts/calc_tickadj/invoke-calc_tickadj.texi | 2 +- contrib/ntp/scripts/invoke-plot_summary.texi | 4 +- contrib/ntp/scripts/invoke-summary.texi | 4 +- contrib/ntp/scripts/ntp-wait/invoke-ntp-wait.texi | 4 +- contrib/ntp/scripts/ntp-wait/ntp-wait-opts | 4 +- contrib/ntp/scripts/ntp-wait/ntp-wait.1ntp-waitman | 4 +- .../ntp/scripts/ntp-wait/ntp-wait.1ntp-waitmdoc | 4 +- contrib/ntp/scripts/ntp-wait/ntp-wait.html | 4 +- contrib/ntp/scripts/ntp-wait/ntp-wait.man.in | 4 +- contrib/ntp/scripts/ntp-wait/ntp-wait.mdoc.in | 4 +- contrib/ntp/scripts/ntpsweep/invoke-ntpsweep.texi | 4 +- contrib/ntp/scripts/ntpsweep/ntpsweep-opts | 4 +- contrib/ntp/scripts/ntpsweep/ntpsweep.1ntpsweepman | 4 +- .../ntp/scripts/ntpsweep/ntpsweep.1ntpsweepmdoc | 4 +- contrib/ntp/scripts/ntpsweep/ntpsweep.html | 4 +- contrib/ntp/scripts/ntpsweep/ntpsweep.man.in | 4 +- contrib/ntp/scripts/ntpsweep/ntpsweep.mdoc.in | 4 +- contrib/ntp/scripts/ntptrace/invoke-ntptrace.texi | 4 +- contrib/ntp/scripts/ntptrace/ntptrace-opts | 4 +- contrib/ntp/scripts/ntptrace/ntptrace.1ntptraceman | 4 +- .../ntp/scripts/ntptrace/ntptrace.1ntptracemdoc | 4 +- contrib/ntp/scripts/ntptrace/ntptrace.html | 4 +- contrib/ntp/scripts/ntptrace/ntptrace.man.in | 4 +- contrib/ntp/scripts/ntptrace/ntptrace.mdoc.in | 4 +- contrib/ntp/scripts/plot_summary-opts | 4 +- contrib/ntp/scripts/plot_summary.1plot_summaryman | 4 +- contrib/ntp/scripts/plot_summary.1plot_summarymdoc | 4 +- contrib/ntp/scripts/plot_summary.html | 4 +- contrib/ntp/scripts/plot_summary.man.in | 4 +- contrib/ntp/scripts/plot_summary.mdoc.in | 4 +- contrib/ntp/scripts/summary-opts | 4 +- contrib/ntp/scripts/summary.1summaryman | 4 +- contrib/ntp/scripts/summary.1summarymdoc | 4 +- contrib/ntp/scripts/summary.html | 4 +- contrib/ntp/scripts/summary.man.in | 4 +- contrib/ntp/scripts/summary.mdoc.in | 4 +- .../scripts/update-leap/invoke-update-leap.texi | 2 +- contrib/ntp/scripts/update-leap/update-leap-opts | 4 +- .../update-leap/update-leap.1update-leapman | 4 +- .../update-leap/update-leap.1update-leapmdoc | 4 +- contrib/ntp/scripts/update-leap/update-leap.html | 2 +- contrib/ntp/scripts/update-leap/update-leap.man.in | 4 +- .../ntp/scripts/update-leap/update-leap.mdoc.in | 4 +- contrib/ntp/sntp/configure | 20 +- contrib/ntp/sntp/crypto.c | 5 - contrib/ntp/sntp/crypto.h | 1 - contrib/ntp/sntp/include/version.def | 2 +- contrib/ntp/sntp/include/version.texi | 6 +- contrib/ntp/sntp/invoke-sntp.texi | 4 +- contrib/ntp/sntp/m4/version.m4 | 2 +- contrib/ntp/sntp/scm-rev | 2 +- contrib/ntp/sntp/sntp-opts.c | 14 +- contrib/ntp/sntp/sntp-opts.h | 6 +- contrib/ntp/sntp/sntp.1sntpman | 4 +- contrib/ntp/sntp/sntp.1sntpmdoc | 4 +- contrib/ntp/sntp/sntp.html | 4 +- contrib/ntp/sntp/sntp.man.in | 4 +- contrib/ntp/sntp/sntp.mdoc.in | 4 +- contrib/ntp/tests/libntp/data/mills,david-03.jpg | Bin 0 -> 40964 bytes contrib/ntp/tests/libntp/data/ntp.keys | 34 ++ contrib/ntp/tests/libntp/digests.c | 415 ++++++++++++++++++ contrib/ntp/tests/libntp/run-digests.c | 80 ++++ contrib/ntp/util/invoke-ntp-keygen.texi | 4 +- contrib/ntp/util/ntp-keygen-opts.c | 14 +- contrib/ntp/util/ntp-keygen-opts.h | 6 +- contrib/ntp/util/ntp-keygen.1ntp-keygenman | 4 +- contrib/ntp/util/ntp-keygen.1ntp-keygenmdoc | 4 +- contrib/ntp/util/ntp-keygen.html | 4 +- contrib/ntp/util/ntp-keygen.man.in | 4 +- contrib/ntp/util/ntp-keygen.mdoc.in | 4 +- usr.sbin/ntp/config.h | 6 +- 139 files changed, 1404 insertions(+), 337 deletions(-) diff --git a/contrib/ntp/ChangeLog b/contrib/ntp/ChangeLog index 8e34d2a96696..93cdab8b94eb 100644 --- a/contrib/ntp/ChangeLog +++ b/contrib/ntp/ChangeLog @@ -1,3 +1,17 @@ +--- +(4.2.8p17) 2023/06/06 Released by Harlan Stenn + +* [Bug 3824] Spurious "ntpd: daemon failed to notify parent!" logged at + event_sync. Reported by Edward McGuire. +* [Bug 3822] ntpd significantly delays first poll of servers specified by name. + Miroslav Lichvar identified regression in 4.2.8p16. +* [Bug 3821] 4.2.8p16 misreads hex authentication keys, won't interop with + 4.2.8p15 or earlier. Reported by Matt Nordhoff, thanks to + Miroslav Lichvar and Matt for rapid testing and identifying the + problem. +* Add tests/libntp/digests.c to catch regressions reading keys file or with + symmetric authentication digest output. + --- (4.2.8p16) 2023/05/31 Released by Harlan Stenn diff --git a/contrib/ntp/CommitLog b/contrib/ntp/CommitLog index 54bf0f9a45fc..adeda2c60402 100644 --- a/contrib/ntp/CommitLog +++ b/contrib/ntp/CommitLog @@ -1,3 +1,467 @@ +ChangeSet@1.4004, 2023-06-06 04:40:27-07:00, ntpreleng@ntp-build.tal1.ntfo.org + NTP_4_2_8P17 + TAG: NTP_4_2_8P17 + + ChangeLog@1.2053 +1 -0 + NTP_4_2_8P17 + + ntpd/invoke-ntp.conf.texi@1.225 +1 -1 + NTP_4_2_8P17 + + ntpd/invoke-ntp.keys.texi@1.210 +1 -1 + NTP_4_2_8P17 + + ntpd/invoke-ntpd.texi@1.524 +2 -2 + NTP_4_2_8P17 + + ntpd/ntp.conf.5man@1.259 +2 -2 + NTP_4_2_8P17 + + ntpd/ntp.conf.5mdoc@1.259 +2 -2 + NTP_4_2_8P17 + + ntpd/ntp.conf.html@1.207 +1 -1 + NTP_4_2_8P17 + + ntpd/ntp.conf.man.in@1.259 +2 -2 + NTP_4_2_8P17 + + ntpd/ntp.conf.mdoc.in@1.259 +2 -2 + NTP_4_2_8P17 + + ntpd/ntp.keys.5man@1.244 +2 -2 + NTP_4_2_8P17 + + ntpd/ntp.keys.5mdoc@1.244 +2 -2 + NTP_4_2_8P17 + + ntpd/ntp.keys.html@1.204 +1 -1 + NTP_4_2_8P17 + + ntpd/ntp.keys.man.in@1.244 +2 -2 + NTP_4_2_8P17 + + ntpd/ntp.keys.mdoc.in@1.244 +2 -2 + NTP_4_2_8P17 + + ntpd/ntpd-opts.c@1.549 +7 -7 + NTP_4_2_8P17 + + ntpd/ntpd-opts.h@1.548 +3 -3 + NTP_4_2_8P17 + + ntpd/ntpd.1ntpdman@1.353 +2 -2 + NTP_4_2_8P17 + + ntpd/ntpd.1ntpdmdoc@1.353 +2 -2 + NTP_4_2_8P17 + + ntpd/ntpd.html@1.198 +2 -2 + NTP_4_2_8P17 + + ntpd/ntpd.man.in@1.353 +2 -2 + NTP_4_2_8P17 + + ntpd/ntpd.mdoc.in@1.353 +2 -2 + NTP_4_2_8P17 + + ntpdc/invoke-ntpdc.texi@1.523 +2 -2 + NTP_4_2_8P17 + + ntpdc/ntpdc-opts.c@1.544 +7 -7 + NTP_4_2_8P17 + + ntpdc/ntpdc-opts.h@1.543 +3 -3 + NTP_4_2_8P17 + + ntpdc/ntpdc.1ntpdcman@1.354 +2 -2 + NTP_4_2_8P17 + + ntpdc/ntpdc.1ntpdcmdoc@1.354 +2 -2 + NTP_4_2_8P17 + + ntpdc/ntpdc.html@1.368 +2 -2 + NTP_4_2_8P17 + + ntpdc/ntpdc.man.in@1.354 +2 -2 + NTP_4_2_8P17 + + ntpdc/ntpdc.mdoc.in@1.354 +2 -2 + NTP_4_2_8P17 + + ntpq/invoke-ntpq.texi@1.533 +2 -2 + NTP_4_2_8P17 + + ntpq/ntpq-opts.c@1.553 +7 -7 + NTP_4_2_8P17 + + ntpq/ntpq-opts.h@1.551 +3 -3 + NTP_4_2_8P17 + + ntpq/ntpq.1ntpqman@1.361 +2 -2 + NTP_4_2_8P17 + + ntpq/ntpq.1ntpqmdoc@1.361 +2 -2 + NTP_4_2_8P17 + + ntpq/ntpq.html@1.198 +2 -2 + NTP_4_2_8P17 + + ntpq/ntpq.man.in@1.361 +2 -2 + NTP_4_2_8P17 + + ntpq/ntpq.mdoc.in@1.361 +2 -2 + NTP_4_2_8P17 + + ntpsnmpd/invoke-ntpsnmpd.texi@1.523 +1 -1 + NTP_4_2_8P17 + + ntpsnmpd/ntpsnmpd-opts.c@1.544 +7 -7 + NTP_4_2_8P17 + + ntpsnmpd/ntpsnmpd-opts.h@1.543 +3 -3 + NTP_4_2_8P17 + + ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.352 +2 -2 + NTP_4_2_8P17 + + ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.352 +2 -2 + NTP_4_2_8P17 + + ntpsnmpd/ntpsnmpd.html@1.190 +1 -1 + NTP_4_2_8P17 + + ntpsnmpd/ntpsnmpd.man.in@1.352 +2 -2 + NTP_4_2_8P17 + + ntpsnmpd/ntpsnmpd.mdoc.in@1.352 +2 -2 + NTP_4_2_8P17 + + packageinfo.sh@1.550 +2 -2 + NTP_4_2_8P17 + + scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.113 +2 -2 + NTP_4_2_8P17 + + scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.115 +2 -2 + NTP_4_2_8P17 + + scripts/calc_tickadj/calc_tickadj.html@1.114 +1 -1 + NTP_4_2_8P17 + + scripts/calc_tickadj/calc_tickadj.man.in@1.112 +2 -2 + NTP_4_2_8P17 + + scripts/calc_tickadj/calc_tickadj.mdoc.in@1.115 +2 -2 + NTP_4_2_8P17 + + scripts/calc_tickadj/invoke-calc_tickadj.texi@1.117 +1 -1 + NTP_4_2_8P17 + + scripts/invoke-plot_summary.texi@1.135 +2 -2 + NTP_4_2_8P17 + + scripts/invoke-summary.texi@1.134 +2 -2 + NTP_4_2_8P17 + + scripts/ntp-wait/invoke-ntp-wait.texi@1.346 +2 -2 + NTP_4_2_8P17 + + scripts/ntp-wait/ntp-wait-opts@1.82 +2 -2 + NTP_4_2_8P17 + + scripts/ntp-wait/ntp-wait.1ntp-waitman@1.341 +2 -2 + NTP_4_2_8P17 + + scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.343 +2 -2 + NTP_4_2_8P17 + + scripts/ntp-wait/ntp-wait.html@1.362 +2 -2 + NTP_4_2_8P17 + + scripts/ntp-wait/ntp-wait.man.in@1.341 +2 -2 + NTP_4_2_8P17 + + scripts/ntp-wait/ntp-wait.mdoc.in@1.343 +2 -2 + NTP_4_2_8P17 + + scripts/ntpsweep/invoke-ntpsweep.texi@1.132 +2 -2 + NTP_4_2_8P17 + + scripts/ntpsweep/ntpsweep-opts@1.85 +2 -2 + NTP_4_2_8P17 + + scripts/ntpsweep/ntpsweep.1ntpsweepman@1.120 +2 -2 + NTP_4_2_8P17 + + scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.120 +2 -2 + NTP_4_2_8P17 + + scripts/ntpsweep/ntpsweep.html@1.134 +2 -2 + NTP_4_2_8P17 + + scripts/ntpsweep/ntpsweep.man.in@1.120 +2 -2 + NTP_4_2_8P17 + + scripts/ntpsweep/ntpsweep.mdoc.in@1.121 +2 -2 + NTP_4_2_8P17 + + scripts/ntptrace/invoke-ntptrace.texi@1.135 +2 -2 + NTP_4_2_8P17 + + scripts/ntptrace/ntptrace-opts@1.85 +2 -2 + NTP_4_2_8P17 + + scripts/ntptrace/ntptrace.1ntptraceman@1.120 +2 -2 + NTP_4_2_8P17 + + scripts/ntptrace/ntptrace.1ntptracemdoc@1.122 +2 -2 + NTP_4_2_8P17 + + scripts/ntptrace/ntptrace.html@1.135 +2 -2 + NTP_4_2_8P17 + + scripts/ntptrace/ntptrace.man.in@1.120 +2 -2 + NTP_4_2_8P17 + + scripts/ntptrace/ntptrace.mdoc.in@1.123 +2 -2 + NTP_4_2_8P17 + + scripts/plot_summary-opts@1.86 +2 -2 + NTP_4_2_8P17 + + scripts/plot_summary.1plot_summaryman@1.133 +2 -2 + NTP_4_2_8P17 + + scripts/plot_summary.1plot_summarymdoc@1.133 +2 -2 + NTP_4_2_8P17 + + scripts/plot_summary.html@1.137 +2 -2 + NTP_4_2_8P17 + + scripts/plot_summary.man.in@1.133 +2 -2 + NTP_4_2_8P17 + + scripts/plot_summary.mdoc.in@1.133 +2 -2 + NTP_4_2_8P17 + + scripts/summary-opts@1.85 +2 -2 + NTP_4_2_8P17 + + scripts/summary.1summaryman@1.132 +2 -2 + NTP_4_2_8P17 + + scripts/summary.1summarymdoc@1.132 +2 -2 + NTP_4_2_8P17 + + scripts/summary.html@1.136 +2 -2 + NTP_4_2_8P17 + + scripts/summary.man.in@1.132 +2 -2 + NTP_4_2_8P17 + + scripts/summary.mdoc.in@1.132 +2 -2 + NTP_4_2_8P17 + + scripts/update-leap/invoke-update-leap.texi@1.33 +1 -1 + NTP_4_2_8P17 + + scripts/update-leap/update-leap-opts@1.35 +2 -2 + NTP_4_2_8P17 + + scripts/update-leap/update-leap.1update-leapman@1.33 +2 -2 + NTP_4_2_8P17 + + scripts/update-leap/update-leap.1update-leapmdoc@1.34 +2 -2 + NTP_4_2_8P17 + + scripts/update-leap/update-leap.html@1.33 +1 -1 + NTP_4_2_8P17 + + scripts/update-leap/update-leap.man.in@1.33 +2 -2 + NTP_4_2_8P17 + + scripts/update-leap/update-leap.mdoc.in@1.34 +2 -2 + NTP_4_2_8P17 + + sntp/invoke-sntp.texi@1.523 +2 -2 + NTP_4_2_8P17 + + sntp/sntp-opts.c@1.545 +7 -7 + NTP_4_2_8P17 + + sntp/sntp-opts.h@1.543 +3 -3 + NTP_4_2_8P17 + + sntp/sntp.1sntpman@1.358 +2 -2 + NTP_4_2_8P17 + + sntp/sntp.1sntpmdoc@1.358 +2 -2 + NTP_4_2_8P17 + + sntp/sntp.html@1.539 +2 -2 + NTP_4_2_8P17 + + sntp/sntp.man.in@1.358 +2 -2 + NTP_4_2_8P17 + + sntp/sntp.mdoc.in@1.358 +2 -2 + NTP_4_2_8P17 + + util/invoke-ntp-keygen.texi@1.526 +2 -2 + NTP_4_2_8P17 + + util/ntp-keygen-opts.c@1.547 +7 -7 + NTP_4_2_8P17 + + util/ntp-keygen-opts.h@1.545 +3 -3 + NTP_4_2_8P17 + + util/ntp-keygen.1ntp-keygenman@1.354 +2 -2 + NTP_4_2_8P17 + + util/ntp-keygen.1ntp-keygenmdoc@1.354 +2 -2 + NTP_4_2_8P17 + + util/ntp-keygen.html@1.199 +2 -2 + NTP_4_2_8P17 + + util/ntp-keygen.man.in@1.354 +2 -2 + NTP_4_2_8P17 + + util/ntp-keygen.mdoc.in@1.354 +2 -2 + NTP_4_2_8P17 + +ChangeSet@1.4003, 2023-06-06 04:28:11-07:00, ntpreleng@ntp-build.tal1.ntfo.org + p17 + + tests/libntp/run-digests.c@1.2 +7 -7 + p17 + +ChangeSet@1.4002, 2023-06-06 04:09:35-07:00, ntpreleng@ntp-build.tal1.ntfo.org + p17 + + packageinfo.sh@1.549 +1 -1 + p17 + +ChangeSet@1.4001, 2023-06-06 09:43:55+00:00, hart@ntp-devbuild.chi1.ntfo.org + Makefile.am: + Fix make distcheck failure with generated srcdir.c + + tests/libntp/Makefile.am@1.104 +2 -2 + Fix make distcheck failure with generated srcdir.c + +ChangeSet@1.4000, 2023-06-06 03:43:29-05:00, stenn@stenn.chi1.ntfo.org + prep for p17 + + ChangeLog@1.2052 +8 -6 + prep for p17 + + NEWS@1.219 +25 -0 + prep for p17 + +ChangeSet@1.3998, 2023-06-05 00:21:10+00:00, davehart@tl.davehart.net + Add tests for loading and using all supported symmetric auth digests. + + ChangeLog@1.2050 +2 -0 + Add tests/libntp/digests.c to catch regressions reading keys file or with + symmetric authentication digest output. + + include/ntp.h@1.235 +1 -1 + move KEY_TYPE_MD5 to ntp_md5.h + + include/ntp_md5.h@1.15 +4 -0 + move a few items here where they better fit. + + include/ntp_stdlib.h@1.91 +21 -18 + Move items to ntp_md5.h, add some arg names to prototypes. + + libntp/a_md5encrypt.c@1.55 +13 -10 + %zu isn't supported by all compilers we support + + libntp/authkeys.c@1.46 +11 -12 + Get rid of magic number 4 for sizeof(u_int32), use zero_mem() + + libntp/authreadkeys.c@1.36 +10 -2 + Warn if AES128CMAC key is less than 128 bits. + + libntp/msyslog.c@1.57 +3 -2 + Comment grammar + + libparse/clk_hopf6021.c@1.14 +3 -2 + include ascii.h after ntp_stdlib.h to avoid clash with EM define + + libparse/clk_wharton.c@1.13 +3 -2 + include ascii.h after ntp_stdlib.h to avoid clash with EM define + + ntpd/ntp_control.c@1.241 +0 -1 + ntp_md5.h in ntp_stdlib.h now + + ntpd/ntp_loopfilter.c@1.197 +0 -3 + Move PATH_MAX definition to header file. + + sntp/crypto.c@1.42 +0 -5 + Remove redundancies + + sntp/crypto.h@1.15 +0 -1 + separate include of ntp_md5.h no longer needed + + tests/libntp/Makefile.am@1.103 +33 -6 + add digests.c + + tests/libntp/data/ntp.keys@1.2 +1 -1 + typo + + tests/libntp/digests.c@1.1 +415 -0 + Unit test for loading and using all supported symmetric auth methods. + + tests/libntp/digests.c@1.0 +0 -0 + + tests/libntp/run-digests.c@1.1 +80 -0 + Unity generated runner for digests.c + + tests/libntp/run-digests.c@1.0 +0 -0 + +ChangeSet@1.3996.2.1, 2023-06-03 22:48:12+00:00, davehart@tl.davehart.net + [Bug 3822] ntpd significantly delays first poll of servers specified by name. + + ChangeLog@1.2048.2.1 +4 -0 + [Bug 3822] ntpd significantly delays first poll of servers specified by name. + + ntpd/ntp_config.c@1.383 +18 -0 + Treat associations from ntp.conf with hostnames the same as those with IP addresses. + +ChangeSet@1.3996.1.1, 2023-06-02 23:42:10+00:00, davehart@tl.davehart.net + [Bug 3824] Spurious "ntpd: daemon failed to notify parent!" logged at event_sync. + + ChangeLog@1.2048.1.1 +4 -0 + [Bug 3824] Spurious "ntpd: daemon failed to notify parent!" logged at event_sync. + + ntpd/ntp_proto.c@1.446 +3 -2 + CLarify error message + + ntpd/ntpd.c@1.189 +4 -2 + Fix logic error, clarify message + +ChangeSet@1.3997, 2023-06-02 19:29:12+00:00, davehart@tl.davehart.net + [Bug 3821] 4.2.8p16 misreads hex auth keys, won't interop with 4.2.8p15. + + ChangeLog@1.2049 +5 -0 + [Bug 3821] 4.2.8p16 misreads hex auth keys, won't interop with 4.2.8p15. + + libntp/authkeys.c@1.45 +2 -2 + > typo for >> + + tests/libntp/data/mills,david-03.jpg@1.1 +912 -0 + The internet's Father Time + + tests/libntp/data/mills,david-03.jpg@1.0 +0 -0 + + tests/libntp/data/ntp.keys@1.1 +34 -0 + Test keys for libntp/tests/digest.c + + tests/libntp/data/ntp.keys@1.0 +0 -0 + ChangeSet@1.3996, 2023-05-31 20:05:32-07:00, ntpreleng@ntp-build.tal1.ntfo.org NTP_4_2_8P16 TAG: NTP_4_2_8P16 diff --git a/contrib/ntp/NEWS b/contrib/ntp/NEWS index d9d8a0987ab6..432c3d324575 100644 --- a/contrib/ntp/NEWS +++ b/contrib/ntp/NEWS @@ -1,3 +1,28 @@ +--- +NTP 4.2.8p17 (Harlan Stenn , 2023 Jun 06) + +Focus: Bug fixes + +Severity: HIGH (for people running 4.2.8p16) + +This release: + +- fixes 3 bugs, including a regression +- adds new unit tests + +Details below: + +* [Bug 3824] Spurious "ntpd: daemon failed to notify parent!" logged at + event_sync. Reported by Edward McGuire. +* [Bug 3822] ntpd significantly delays first poll of servers specified by name. + Miroslav Lichvar identified regression in 4.2.8p16. +* [Bug 3821] 4.2.8p16 misreads hex authentication keys, won't interop with + 4.2.8p15 or earlier. Reported by Matt Nordhoff, thanks to + Miroslav Lichvar and Matt for rapid testing and identifying the + problem. +* Add tests/libntp/digests.c to catch regressions reading keys file or with + symmetric authentication digest output. + --- NTP 4.2.8p16 (Harlan Stenn , 2023 May 30) diff --git a/contrib/ntp/configure b/contrib/ntp/configure index a8c2ba593aa3..5d09904bea03 100755 --- a/contrib/ntp/configure +++ b/contrib/ntp/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for ntp 4.2.8p16. +# Generated by GNU Autoconf 2.71 for ntp 4.2.8p17. # # Report bugs to . # @@ -621,8 +621,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='ntp' PACKAGE_TARNAME='ntp' -PACKAGE_VERSION='4.2.8p16' -PACKAGE_STRING='ntp 4.2.8p16' +PACKAGE_VERSION='4.2.8p17' +PACKAGE_STRING='ntp 4.2.8p17' PACKAGE_BUGREPORT='https://bugs.ntp.org/' PACKAGE_URL='https://www.ntp.org/' @@ -1651,7 +1651,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures ntp 4.2.8p16 to adapt to many kinds of systems. +\`configure' configures ntp 4.2.8p17 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1722,7 +1722,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of ntp 4.2.8p16:";; + short | recursive ) echo "Configuration of ntp 4.2.8p17:";; esac cat <<\_ACEOF @@ -1967,7 +1967,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -ntp configure 4.2.8p16 +ntp configure 4.2.8p17 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. @@ -2624,7 +2624,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by ntp $as_me 4.2.8p16, which was +It was created by ntp $as_me 4.2.8p17, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw @@ -4039,7 +4039,7 @@ fi # Define the identity of the package. PACKAGE='ntp' - VERSION='4.2.8p16' + VERSION='4.2.8p17' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h @@ -35365,7 +35365,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by ntp $as_me 4.2.8p16, which was +This file was extended by ntp $as_me 4.2.8p17, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -35434,7 +35434,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -ntp config.status 4.2.8p16 +ntp config.status 4.2.8p17 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" diff --git a/contrib/ntp/include/ntp.h b/contrib/ntp/include/ntp.h index c037f5986016..258ddd6138f7 100644 --- a/contrib/ntp/include/ntp.h +++ b/contrib/ntp/include/ntp.h @@ -134,7 +134,7 @@ typedef char s_char; * Miscellaneous stuff */ #define NTP_MAXKEY 65535 /* max authentication key number */ -#define KEY_TYPE_MD5 NID_md5 /* MD5 digest NID */ + /* * Limits of things */ diff --git a/contrib/ntp/include/ntp_md5.h b/contrib/ntp/include/ntp_md5.h index 06c90b2d2faf..8b5a7d0cbb49 100644 --- a/contrib/ntp/include/ntp_md5.h +++ b/contrib/ntp/include/ntp_md5.h @@ -6,6 +6,8 @@ #ifndef NTP_MD5_H #define NTP_MD5_H +# define KEY_TYPE_MD5 NID_md5 + #ifdef OPENSSL # include # include "libssl_compat.h" @@ -30,6 +32,8 @@ typedef MD5_CTX EVP_MD_CTX; +# define NID_md5 4 /* from openssl/objects.h */ +# define EVP_MAX_MD_SIZE 64 /* from openssl/evp.h */ # define EVP_MD_CTX_free(c) free(c) # define EVP_MD_CTX_new() calloc(1, sizeof(MD5_CTX)) # define EVP_get_digestbynid(t) NULL diff --git a/contrib/ntp/include/ntp_stdlib.h b/contrib/ntp/include/ntp_stdlib.h index 2d7c640565d5..446837e3adcb 100644 --- a/contrib/ntp/include/ntp_stdlib.h +++ b/contrib/ntp/include/ntp_stdlib.h @@ -11,6 +11,7 @@ #include "declcond.h" /* ntpd uses ntpd/declcond.h, others include/ */ #include "l_stdlib.h" +#include "ntp_md5.h" #include "ntp_net.h" #include "ntp_debug.h" #include "ntp_malloc.h" @@ -18,6 +19,10 @@ #include "ntp_syslog.h" #include "ntp_keyacc.h" +#ifndef PATH_MAX +# define PATH_MAX MAX_PATH +#endif + #ifdef __GNUC__ #define NTP_PRINTF(fmt, args) __attribute__((__format__(__printf__, fmt, args))) #else @@ -36,24 +41,16 @@ extern void mvsyslog(int, const char *, va_list) NTP_PRINTF(2, 0); extern void init_logging (const char *, u_int32, int); extern int change_logfile (const char *, int); extern void setup_logfile (const char *); -#ifndef errno_to_str +#ifndef errno_to_str /* Windows port defines this */ extern void errno_to_str(int, char *, size_t); #endif -extern char * ntp_realpath(const char * fsname); +extern char * ntp_realpath(const char *fsname); -extern int xvsbprintf(char**, char* const, char const*, va_list) NTP_PRINTF(3, 0); -extern int xsbprintf(char**, char* const, char const*, ...) NTP_PRINTF(3, 4); - -/* - * When building without OpenSSL, use a few macros of theirs to - * minimize source differences in NTP. - */ -#ifndef OPENSSL -#define NID_md5 4 /* from openssl/objects.h */ -/* from openssl/evp.h */ -#define EVP_MAX_MD_SIZE 64 /* longest known is SHA512 */ -#endif +extern int xvsbprintf(char **, char * const, char const *, va_list) + NTP_PRINTF(3, 0); +extern int xsbprintf(char **, char * const, char const *, ...) + NTP_PRINTF(3, 4); #define SAVE_ERRNO(stmt) \ { \ @@ -111,10 +108,16 @@ extern void auth_prealloc_symkeys(int); extern int ymd2yd (int, int, int); /* a_md5encrypt.c */ -extern int MD5authdecrypt (int, const u_char *, size_t, u_int32 *, size_t, size_t, keyid_t); -extern size_t MD5authencrypt (int, const u_char *, size_t, u_int32 *, size_t); -extern void MD5auth_setkey (keyid_t, int, const u_char *, size_t, KeyAccT *c); -extern u_int32 addr2refid (sockaddr_u *); +extern size_t MD5authencrypt (int type, const u_char *key, size_t klen, + u_int32 *pkt, size_t length); +extern int MD5authdecrypt (int type, const u_char *key, size_t klen, + u_int32 *pkt, size_t length, size_t size, + keyid_t keyno); +extern u_int32 addr2refid(sockaddr_u *); + +/* authkeys.c */ +extern void MD5auth_setkey (keyid_t, int, const u_char *, size_t, + KeyAccT *c); /* emalloc.c */ #ifndef EREALLOC_CALLSITE /* ntp_malloc.h defines */ diff --git a/contrib/ntp/libntp/a_md5encrypt.c b/contrib/ntp/libntp/a_md5encrypt.c index 6011af52af6d..7a372969123f 100644 --- a/contrib/ntp/libntp/a_md5encrypt.c +++ b/contrib/ntp/libntp/a_md5encrypt.c @@ -9,7 +9,6 @@ #include "ntp_string.h" #include "ntp_stdlib.h" #include "ntp.h" -#include "ntp_md5.h" /* provides OpenSSL digest API */ #include "isc/string.h" typedef struct { @@ -22,10 +21,12 @@ typedef struct { size_t len; } rwbuffT; + #if defined(OPENSSL) && defined(ENABLE_CMAC) static size_t cmac_ctx_size( - CMAC_CTX * ctx) + CMAC_CTX * ctx + ) { size_t mlen = 0; @@ -36,14 +37,16 @@ cmac_ctx_size( } return mlen; } -#endif /*OPENSSL && ENABLE_CMAC*/ +#endif /* OPENSSL && ENABLE_CMAC */ + static size_t make_mac( const rwbuffT * digest, int ktype, const robuffT * key, - const robuffT * msg) + const robuffT * msg + ) { /* * Compute digest of key concatenated with packet. Note: the @@ -66,8 +69,8 @@ make_mac( /* adjust key size (zero padded buffer) if necessary */ if (AES_128_KEY_SIZE > key->len) { memcpy(keybuf, keyptr, key->len); - memset((keybuf + key->len), 0, - (AES_128_KEY_SIZE - key->len)); + zero_mem((keybuf + key->len), + (AES_128_KEY_SIZE - key->len)); keyptr = keybuf; } @@ -107,10 +110,10 @@ make_mac( goto mac_fail; } - #ifdef EVP_MD_CTX_FLAG_NON_FIPS_ALLOW + #ifdef EVP_MD_CTX_FLAG_NON_FIPS_ALLOW /* make sure MD5 is allowd */ EVP_MD_CTX_set_flags(ctx, EVP_MD_CTX_FLAG_NON_FIPS_ALLOW); - #endif + #endif /* [Bug 3457] DON'T use plain EVP_DigestInit! It would * kill the flags! */ if (!EVP_DigestInit_ex(ctx, EVP_get_digestbynid(ktype), NULL)) { @@ -239,8 +242,8 @@ MD5authdecrypt( dlen = MAX_MDG_LEN; if (size != (size_t)dlen + KEY_MAC_LEN) { msyslog(LOG_ERR, - "MAC decrypt: MAC length error: len=%zu key=%d", - size, keyno); + "MAC decrypt: MAC length error: len=%u key=%d", + (u_int)size, keyno); return (0); } return !isc_tsmemcmp(digest, diff --git a/contrib/ntp/libntp/authkeys.c b/contrib/ntp/libntp/authkeys.c index 4448dadd2b6a..d28b4b932b84 100644 --- a/contrib/ntp/libntp/authkeys.c +++ b/contrib/ntp/libntp/authkeys.c @@ -284,8 +284,7 @@ init_auth(void) */ newalloc = authhashbuckets * sizeof(key_hash[0]); - key_hash = erealloc(key_hash, newalloc); - memset(key_hash, '\0', newalloc); + key_hash = emalloc_zero(newalloc); INIT_DLIST(key_listhead, llink); @@ -458,7 +457,7 @@ auth_resize_hashtable(void) newalloc = authhashbuckets * sizeof(key_hash[0]); *** 3320 LINES SKIPPED *** From nobody Fri Jun 9 13:39:24 2023 X-Original-To: dev-commits-src-branches@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 4Qd2Hd1jxLz4c4rK; Fri, 9 Jun 2023 13:39:25 +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 4Qd2Hd1LHnz4XR8; Fri, 9 Jun 2023 13:39:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686317965; 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=z4nYpAmO4qocSZdbz5oWhuWjWqj9ODQlQYJyNAZBYEQ=; b=oA6IX/mDh0cKfulAPD0KW3Ap5h/JPR5fG2LUIrA4fmC16S7FEadkpE7wuc8Tsa9qG9vqmY 9Kh40gKVPRSJDEz6SE8LEbzeGk18vbwrqxopJEwtAiwr0u66RkG1S1JMhASiaDUcSe4Vkp XFeXwpOyV1llv9tbMp961AXgxZc8DnaxLfAniMfazc1SU/KAKntK+DMSCru5heg3Xdjxl9 Xg9Ed0SG0A7Ykq7F/7Y0nEa9V8cT17t6QCvsP1ZeUixAylnmPSkla9X+0V7DvUpJQEcRf0 1LHtrFWW5nt9ooqhAWS0vgEbPCFKb/ofvy3EJm+RkEgUZTSje/NWYdKbwI5yxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686317965; 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=z4nYpAmO4qocSZdbz5oWhuWjWqj9ODQlQYJyNAZBYEQ=; b=xsUlDxT4p+wyNv6ui9+f6brwCmtV7K3nNQ7gL/aGPVzySFgOax0nzGYf//glrLNbQayoNF GyBLIYh+CSMp6gICekWhWvMIOmUPUThmBxT5UK1gIInLctj7d0u0jSsT4DSpvCDuSFN9bF Af+r31pq8yvP/bAK92EQwPgCJCMaOTn2iu0qg6wnj8mxK6wzeU7PsdUmEBwKk7wyS4oKro EehB3SseF5Y+8A1UkFKlFp9kKJtuD4IHprYcgxIKvtff6JnmQlER1ELdf8SGQdAgZolVcc xux7Kyr7GNgB9xYYPj6PIZxHIRznZIn1k30t9CUxUIe7SUUJNWNc4IW2s/qgLg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686317965; a=rsa-sha256; cv=none; b=oWgcYonOJr/15cNqwK5AafNjH6MA9/5OOg2mfuOlmY7yxBrO8JDPxpJv8SUq3mBWZgGzpx 6tvyYMfKAQFKW5MxXz9ZvTxs9K967BR9xyByFkFzbGm0MNLcEuXsYT96GXFDg590py13Et 1cx3ZZhJFo9JxY+XYpKCgNZAqWVLFKzUoyqcJmeKvGgZ6St2PIJG31aTcbdM0lBTNAYzGy XSsvULKDfj4nAjqh2QPLfeSHXPhZ5CTNiYPAB+mGAHYye/X6XIfrhm8qvflGtStkxcC2k9 Addxf/YsLSQYGPf3z5valf9Vwh4n1EJaT4mLIG5iHDpjyLAqZet8Gb9HydUkiQ== 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 4Qd2Hd0QfvzdC9; Fri, 9 Jun 2023 13:39:25 +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 359DdPoo045083; Fri, 9 Jun 2023 13:39:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 359DdO82045082; Fri, 9 Jun 2023 13:39:24 GMT (envelope-from git) Date: Fri, 9 Jun 2023 13:39:24 GMT Message-Id: <202306091339.359DdO82045082@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 2a5324685d3a - stable/12 - ntp: import ntp-4.2.8p17 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 2a5324685d3abd857ff638d97e4be21a75db723e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=2a5324685d3abd857ff638d97e4be21a75db723e commit 2a5324685d3abd857ff638d97e4be21a75db723e Author: Cy Schubert AuthorDate: 2023-06-06 12:43:04 +0000 Commit: Cy Schubert CommitDate: 2023-06-09 13:39:05 +0000 ntp: import ntp-4.2.8p17 Fixes two small bugs including one regression. Merge commit 'ab1f1aa8333369a83ff284848fc3fc2e52d5f29f' (cherry picked from commit e6bfd18d21b225af6a0ed67ceeaf1293b7b9eba5) ntp: Fix build Two files used to obtain time from reference clocks did not include ntp_types.h resulting in an undefined NONEMPTY_TRANSLATION_UNIT. Fixes: e6bfd18d21b2 (cherry picked from commit 82aa1470c94c55db31c0168d65f8a08fa1d41378) --- contrib/ntp/ChangeLog | 14 + contrib/ntp/CommitLog | 464 +++++++++++++++++++++ contrib/ntp/NEWS | 25 ++ contrib/ntp/configure | 20 +- contrib/ntp/include/ntp.h | 2 +- contrib/ntp/include/ntp_md5.h | 4 + contrib/ntp/include/ntp_stdlib.h | 39 +- contrib/ntp/libntp/a_md5encrypt.c | 23 +- contrib/ntp/libntp/authkeys.c | 27 +- contrib/ntp/libntp/authreadkeys.c | 12 +- contrib/ntp/libntp/msyslog.c | 5 +- contrib/ntp/libparse/clk_hopf6021.c | 7 +- contrib/ntp/libparse/clk_wharton.c | 7 +- contrib/ntp/ntpd/invoke-ntp.conf.texi | 2 +- contrib/ntp/ntpd/invoke-ntp.keys.texi | 2 +- contrib/ntp/ntpd/invoke-ntpd.texi | 4 +- contrib/ntp/ntpd/ntp.conf.5man | 4 +- contrib/ntp/ntpd/ntp.conf.5mdoc | 4 +- contrib/ntp/ntpd/ntp.conf.html | 2 +- contrib/ntp/ntpd/ntp.conf.man.in | 4 +- contrib/ntp/ntpd/ntp.conf.mdoc.in | 4 +- contrib/ntp/ntpd/ntp.keys.5man | 4 +- contrib/ntp/ntpd/ntp.keys.5mdoc | 4 +- contrib/ntp/ntpd/ntp.keys.html | 2 +- contrib/ntp/ntpd/ntp.keys.man.in | 4 +- contrib/ntp/ntpd/ntp.keys.mdoc.in | 4 +- contrib/ntp/ntpd/ntp_config.c | 18 + contrib/ntp/ntpd/ntp_control.c | 1 - contrib/ntp/ntpd/ntp_loopfilter.c | 3 - contrib/ntp/ntpd/ntp_proto.c | 5 +- contrib/ntp/ntpd/ntpd-opts.c | 14 +- contrib/ntp/ntpd/ntpd-opts.h | 6 +- contrib/ntp/ntpd/ntpd.1ntpdman | 4 +- contrib/ntp/ntpd/ntpd.1ntpdmdoc | 4 +- contrib/ntp/ntpd/ntpd.c | 6 +- contrib/ntp/ntpd/ntpd.html | 4 +- contrib/ntp/ntpd/ntpd.man.in | 4 +- contrib/ntp/ntpd/ntpd.mdoc.in | 4 +- contrib/ntp/ntpdc/invoke-ntpdc.texi | 4 +- contrib/ntp/ntpdc/ntpdc-opts.c | 14 +- contrib/ntp/ntpdc/ntpdc-opts.h | 6 +- contrib/ntp/ntpdc/ntpdc.1ntpdcman | 4 +- contrib/ntp/ntpdc/ntpdc.1ntpdcmdoc | 4 +- contrib/ntp/ntpdc/ntpdc.html | 4 +- contrib/ntp/ntpdc/ntpdc.man.in | 4 +- contrib/ntp/ntpdc/ntpdc.mdoc.in | 4 +- contrib/ntp/ntpq/invoke-ntpq.texi | 4 +- contrib/ntp/ntpq/ntpq-opts.c | 14 +- contrib/ntp/ntpq/ntpq-opts.h | 6 +- contrib/ntp/ntpq/ntpq.1ntpqman | 4 +- contrib/ntp/ntpq/ntpq.1ntpqmdoc | 4 +- contrib/ntp/ntpq/ntpq.html | 4 +- contrib/ntp/ntpq/ntpq.man.in | 4 +- contrib/ntp/ntpq/ntpq.mdoc.in | 4 +- contrib/ntp/ntpsnmpd/invoke-ntpsnmpd.texi | 2 +- contrib/ntp/ntpsnmpd/ntpsnmpd-opts.c | 14 +- contrib/ntp/ntpsnmpd/ntpsnmpd-opts.h | 6 +- contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdman | 4 +- contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc | 4 +- contrib/ntp/ntpsnmpd/ntpsnmpd.html | 2 +- contrib/ntp/ntpsnmpd/ntpsnmpd.man.in | 4 +- contrib/ntp/ntpsnmpd/ntpsnmpd.mdoc.in | 4 +- contrib/ntp/packageinfo.sh | 2 +- .../calc_tickadj/calc_tickadj.1calc_tickadjman | 4 +- .../calc_tickadj/calc_tickadj.1calc_tickadjmdoc | 4 +- contrib/ntp/scripts/calc_tickadj/calc_tickadj.html | 2 +- .../ntp/scripts/calc_tickadj/calc_tickadj.man.in | 4 +- .../ntp/scripts/calc_tickadj/calc_tickadj.mdoc.in | 4 +- .../scripts/calc_tickadj/invoke-calc_tickadj.texi | 2 +- contrib/ntp/scripts/invoke-plot_summary.texi | 4 +- contrib/ntp/scripts/invoke-summary.texi | 4 +- contrib/ntp/scripts/ntp-wait/invoke-ntp-wait.texi | 4 +- contrib/ntp/scripts/ntp-wait/ntp-wait-opts | 4 +- contrib/ntp/scripts/ntp-wait/ntp-wait.1ntp-waitman | 4 +- .../ntp/scripts/ntp-wait/ntp-wait.1ntp-waitmdoc | 4 +- contrib/ntp/scripts/ntp-wait/ntp-wait.html | 4 +- contrib/ntp/scripts/ntp-wait/ntp-wait.man.in | 4 +- contrib/ntp/scripts/ntp-wait/ntp-wait.mdoc.in | 4 +- contrib/ntp/scripts/ntpsweep/invoke-ntpsweep.texi | 4 +- contrib/ntp/scripts/ntpsweep/ntpsweep-opts | 4 +- contrib/ntp/scripts/ntpsweep/ntpsweep.1ntpsweepman | 4 +- .../ntp/scripts/ntpsweep/ntpsweep.1ntpsweepmdoc | 4 +- contrib/ntp/scripts/ntpsweep/ntpsweep.html | 4 +- contrib/ntp/scripts/ntpsweep/ntpsweep.man.in | 4 +- contrib/ntp/scripts/ntpsweep/ntpsweep.mdoc.in | 4 +- contrib/ntp/scripts/ntptrace/invoke-ntptrace.texi | 4 +- contrib/ntp/scripts/ntptrace/ntptrace-opts | 4 +- contrib/ntp/scripts/ntptrace/ntptrace.1ntptraceman | 4 +- .../ntp/scripts/ntptrace/ntptrace.1ntptracemdoc | 4 +- contrib/ntp/scripts/ntptrace/ntptrace.html | 4 +- contrib/ntp/scripts/ntptrace/ntptrace.man.in | 4 +- contrib/ntp/scripts/ntptrace/ntptrace.mdoc.in | 4 +- contrib/ntp/scripts/plot_summary-opts | 4 +- contrib/ntp/scripts/plot_summary.1plot_summaryman | 4 +- contrib/ntp/scripts/plot_summary.1plot_summarymdoc | 4 +- contrib/ntp/scripts/plot_summary.html | 4 +- contrib/ntp/scripts/plot_summary.man.in | 4 +- contrib/ntp/scripts/plot_summary.mdoc.in | 4 +- contrib/ntp/scripts/summary-opts | 4 +- contrib/ntp/scripts/summary.1summaryman | 4 +- contrib/ntp/scripts/summary.1summarymdoc | 4 +- contrib/ntp/scripts/summary.html | 4 +- contrib/ntp/scripts/summary.man.in | 4 +- contrib/ntp/scripts/summary.mdoc.in | 4 +- .../scripts/update-leap/invoke-update-leap.texi | 2 +- contrib/ntp/scripts/update-leap/update-leap-opts | 4 +- .../update-leap/update-leap.1update-leapman | 4 +- .../update-leap/update-leap.1update-leapmdoc | 4 +- contrib/ntp/scripts/update-leap/update-leap.html | 2 +- contrib/ntp/scripts/update-leap/update-leap.man.in | 4 +- .../ntp/scripts/update-leap/update-leap.mdoc.in | 4 +- contrib/ntp/sntp/configure | 20 +- contrib/ntp/sntp/crypto.c | 5 - contrib/ntp/sntp/crypto.h | 1 - contrib/ntp/sntp/include/version.def | 2 +- contrib/ntp/sntp/include/version.texi | 6 +- contrib/ntp/sntp/invoke-sntp.texi | 4 +- contrib/ntp/sntp/m4/version.m4 | 2 +- contrib/ntp/sntp/scm-rev | 2 +- contrib/ntp/sntp/sntp-opts.c | 14 +- contrib/ntp/sntp/sntp-opts.h | 6 +- contrib/ntp/sntp/sntp.1sntpman | 4 +- contrib/ntp/sntp/sntp.1sntpmdoc | 4 +- contrib/ntp/sntp/sntp.html | 4 +- contrib/ntp/sntp/sntp.man.in | 4 +- contrib/ntp/sntp/sntp.mdoc.in | 4 +- contrib/ntp/tests/libntp/data/mills,david-03.jpg | Bin 0 -> 40964 bytes contrib/ntp/tests/libntp/data/ntp.keys | 34 ++ contrib/ntp/tests/libntp/digests.c | 415 ++++++++++++++++++ contrib/ntp/tests/libntp/run-digests.c | 80 ++++ contrib/ntp/util/invoke-ntp-keygen.texi | 4 +- contrib/ntp/util/ntp-keygen-opts.c | 14 +- contrib/ntp/util/ntp-keygen-opts.h | 6 +- contrib/ntp/util/ntp-keygen.1ntp-keygenman | 4 +- contrib/ntp/util/ntp-keygen.1ntp-keygenmdoc | 4 +- contrib/ntp/util/ntp-keygen.html | 4 +- contrib/ntp/util/ntp-keygen.man.in | 4 +- contrib/ntp/util/ntp-keygen.mdoc.in | 4 +- usr.sbin/ntp/config.h | 6 +- 139 files changed, 1404 insertions(+), 337 deletions(-) diff --git a/contrib/ntp/ChangeLog b/contrib/ntp/ChangeLog index 8e34d2a96696..93cdab8b94eb 100644 --- a/contrib/ntp/ChangeLog +++ b/contrib/ntp/ChangeLog @@ -1,3 +1,17 @@ +--- +(4.2.8p17) 2023/06/06 Released by Harlan Stenn + +* [Bug 3824] Spurious "ntpd: daemon failed to notify parent!" logged at + event_sync. Reported by Edward McGuire. +* [Bug 3822] ntpd significantly delays first poll of servers specified by name. + Miroslav Lichvar identified regression in 4.2.8p16. +* [Bug 3821] 4.2.8p16 misreads hex authentication keys, won't interop with + 4.2.8p15 or earlier. Reported by Matt Nordhoff, thanks to + Miroslav Lichvar and Matt for rapid testing and identifying the + problem. +* Add tests/libntp/digests.c to catch regressions reading keys file or with + symmetric authentication digest output. + --- (4.2.8p16) 2023/05/31 Released by Harlan Stenn diff --git a/contrib/ntp/CommitLog b/contrib/ntp/CommitLog index 54bf0f9a45fc..adeda2c60402 100644 --- a/contrib/ntp/CommitLog +++ b/contrib/ntp/CommitLog @@ -1,3 +1,467 @@ +ChangeSet@1.4004, 2023-06-06 04:40:27-07:00, ntpreleng@ntp-build.tal1.ntfo.org + NTP_4_2_8P17 + TAG: NTP_4_2_8P17 + + ChangeLog@1.2053 +1 -0 + NTP_4_2_8P17 + + ntpd/invoke-ntp.conf.texi@1.225 +1 -1 + NTP_4_2_8P17 + + ntpd/invoke-ntp.keys.texi@1.210 +1 -1 + NTP_4_2_8P17 + + ntpd/invoke-ntpd.texi@1.524 +2 -2 + NTP_4_2_8P17 + + ntpd/ntp.conf.5man@1.259 +2 -2 + NTP_4_2_8P17 + + ntpd/ntp.conf.5mdoc@1.259 +2 -2 + NTP_4_2_8P17 + + ntpd/ntp.conf.html@1.207 +1 -1 + NTP_4_2_8P17 + + ntpd/ntp.conf.man.in@1.259 +2 -2 + NTP_4_2_8P17 + + ntpd/ntp.conf.mdoc.in@1.259 +2 -2 + NTP_4_2_8P17 + + ntpd/ntp.keys.5man@1.244 +2 -2 + NTP_4_2_8P17 + + ntpd/ntp.keys.5mdoc@1.244 +2 -2 + NTP_4_2_8P17 + + ntpd/ntp.keys.html@1.204 +1 -1 + NTP_4_2_8P17 + + ntpd/ntp.keys.man.in@1.244 +2 -2 + NTP_4_2_8P17 + + ntpd/ntp.keys.mdoc.in@1.244 +2 -2 + NTP_4_2_8P17 + + ntpd/ntpd-opts.c@1.549 +7 -7 + NTP_4_2_8P17 + + ntpd/ntpd-opts.h@1.548 +3 -3 + NTP_4_2_8P17 + + ntpd/ntpd.1ntpdman@1.353 +2 -2 + NTP_4_2_8P17 + + ntpd/ntpd.1ntpdmdoc@1.353 +2 -2 + NTP_4_2_8P17 + + ntpd/ntpd.html@1.198 +2 -2 + NTP_4_2_8P17 + + ntpd/ntpd.man.in@1.353 +2 -2 + NTP_4_2_8P17 + + ntpd/ntpd.mdoc.in@1.353 +2 -2 + NTP_4_2_8P17 + + ntpdc/invoke-ntpdc.texi@1.523 +2 -2 + NTP_4_2_8P17 + + ntpdc/ntpdc-opts.c@1.544 +7 -7 + NTP_4_2_8P17 + + ntpdc/ntpdc-opts.h@1.543 +3 -3 + NTP_4_2_8P17 + + ntpdc/ntpdc.1ntpdcman@1.354 +2 -2 + NTP_4_2_8P17 + + ntpdc/ntpdc.1ntpdcmdoc@1.354 +2 -2 + NTP_4_2_8P17 + + ntpdc/ntpdc.html@1.368 +2 -2 + NTP_4_2_8P17 + + ntpdc/ntpdc.man.in@1.354 +2 -2 + NTP_4_2_8P17 + + ntpdc/ntpdc.mdoc.in@1.354 +2 -2 + NTP_4_2_8P17 + + ntpq/invoke-ntpq.texi@1.533 +2 -2 + NTP_4_2_8P17 + + ntpq/ntpq-opts.c@1.553 +7 -7 + NTP_4_2_8P17 + + ntpq/ntpq-opts.h@1.551 +3 -3 + NTP_4_2_8P17 + + ntpq/ntpq.1ntpqman@1.361 +2 -2 + NTP_4_2_8P17 + + ntpq/ntpq.1ntpqmdoc@1.361 +2 -2 + NTP_4_2_8P17 + + ntpq/ntpq.html@1.198 +2 -2 + NTP_4_2_8P17 + + ntpq/ntpq.man.in@1.361 +2 -2 + NTP_4_2_8P17 + + ntpq/ntpq.mdoc.in@1.361 +2 -2 + NTP_4_2_8P17 + + ntpsnmpd/invoke-ntpsnmpd.texi@1.523 +1 -1 + NTP_4_2_8P17 + + ntpsnmpd/ntpsnmpd-opts.c@1.544 +7 -7 + NTP_4_2_8P17 + + ntpsnmpd/ntpsnmpd-opts.h@1.543 +3 -3 + NTP_4_2_8P17 + + ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.352 +2 -2 + NTP_4_2_8P17 + + ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.352 +2 -2 + NTP_4_2_8P17 + + ntpsnmpd/ntpsnmpd.html@1.190 +1 -1 + NTP_4_2_8P17 + + ntpsnmpd/ntpsnmpd.man.in@1.352 +2 -2 + NTP_4_2_8P17 + + ntpsnmpd/ntpsnmpd.mdoc.in@1.352 +2 -2 + NTP_4_2_8P17 + + packageinfo.sh@1.550 +2 -2 + NTP_4_2_8P17 + + scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.113 +2 -2 + NTP_4_2_8P17 + + scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.115 +2 -2 + NTP_4_2_8P17 + + scripts/calc_tickadj/calc_tickadj.html@1.114 +1 -1 + NTP_4_2_8P17 + + scripts/calc_tickadj/calc_tickadj.man.in@1.112 +2 -2 + NTP_4_2_8P17 + + scripts/calc_tickadj/calc_tickadj.mdoc.in@1.115 +2 -2 + NTP_4_2_8P17 + + scripts/calc_tickadj/invoke-calc_tickadj.texi@1.117 +1 -1 + NTP_4_2_8P17 + + scripts/invoke-plot_summary.texi@1.135 +2 -2 + NTP_4_2_8P17 + + scripts/invoke-summary.texi@1.134 +2 -2 + NTP_4_2_8P17 + + scripts/ntp-wait/invoke-ntp-wait.texi@1.346 +2 -2 + NTP_4_2_8P17 + + scripts/ntp-wait/ntp-wait-opts@1.82 +2 -2 + NTP_4_2_8P17 + + scripts/ntp-wait/ntp-wait.1ntp-waitman@1.341 +2 -2 + NTP_4_2_8P17 + + scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.343 +2 -2 + NTP_4_2_8P17 + + scripts/ntp-wait/ntp-wait.html@1.362 +2 -2 + NTP_4_2_8P17 + + scripts/ntp-wait/ntp-wait.man.in@1.341 +2 -2 + NTP_4_2_8P17 + + scripts/ntp-wait/ntp-wait.mdoc.in@1.343 +2 -2 + NTP_4_2_8P17 + + scripts/ntpsweep/invoke-ntpsweep.texi@1.132 +2 -2 + NTP_4_2_8P17 + + scripts/ntpsweep/ntpsweep-opts@1.85 +2 -2 + NTP_4_2_8P17 + + scripts/ntpsweep/ntpsweep.1ntpsweepman@1.120 +2 -2 + NTP_4_2_8P17 + + scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.120 +2 -2 + NTP_4_2_8P17 + + scripts/ntpsweep/ntpsweep.html@1.134 +2 -2 + NTP_4_2_8P17 + + scripts/ntpsweep/ntpsweep.man.in@1.120 +2 -2 + NTP_4_2_8P17 + + scripts/ntpsweep/ntpsweep.mdoc.in@1.121 +2 -2 + NTP_4_2_8P17 + + scripts/ntptrace/invoke-ntptrace.texi@1.135 +2 -2 + NTP_4_2_8P17 + + scripts/ntptrace/ntptrace-opts@1.85 +2 -2 + NTP_4_2_8P17 + + scripts/ntptrace/ntptrace.1ntptraceman@1.120 +2 -2 + NTP_4_2_8P17 + + scripts/ntptrace/ntptrace.1ntptracemdoc@1.122 +2 -2 + NTP_4_2_8P17 + + scripts/ntptrace/ntptrace.html@1.135 +2 -2 + NTP_4_2_8P17 + + scripts/ntptrace/ntptrace.man.in@1.120 +2 -2 + NTP_4_2_8P17 + + scripts/ntptrace/ntptrace.mdoc.in@1.123 +2 -2 + NTP_4_2_8P17 + + scripts/plot_summary-opts@1.86 +2 -2 + NTP_4_2_8P17 + + scripts/plot_summary.1plot_summaryman@1.133 +2 -2 + NTP_4_2_8P17 + + scripts/plot_summary.1plot_summarymdoc@1.133 +2 -2 + NTP_4_2_8P17 + + scripts/plot_summary.html@1.137 +2 -2 + NTP_4_2_8P17 + + scripts/plot_summary.man.in@1.133 +2 -2 + NTP_4_2_8P17 + + scripts/plot_summary.mdoc.in@1.133 +2 -2 + NTP_4_2_8P17 + + scripts/summary-opts@1.85 +2 -2 + NTP_4_2_8P17 + + scripts/summary.1summaryman@1.132 +2 -2 + NTP_4_2_8P17 + + scripts/summary.1summarymdoc@1.132 +2 -2 + NTP_4_2_8P17 + + scripts/summary.html@1.136 +2 -2 + NTP_4_2_8P17 + + scripts/summary.man.in@1.132 +2 -2 + NTP_4_2_8P17 + + scripts/summary.mdoc.in@1.132 +2 -2 + NTP_4_2_8P17 + + scripts/update-leap/invoke-update-leap.texi@1.33 +1 -1 + NTP_4_2_8P17 + + scripts/update-leap/update-leap-opts@1.35 +2 -2 + NTP_4_2_8P17 + + scripts/update-leap/update-leap.1update-leapman@1.33 +2 -2 + NTP_4_2_8P17 + + scripts/update-leap/update-leap.1update-leapmdoc@1.34 +2 -2 + NTP_4_2_8P17 + + scripts/update-leap/update-leap.html@1.33 +1 -1 + NTP_4_2_8P17 + + scripts/update-leap/update-leap.man.in@1.33 +2 -2 + NTP_4_2_8P17 + + scripts/update-leap/update-leap.mdoc.in@1.34 +2 -2 + NTP_4_2_8P17 + + sntp/invoke-sntp.texi@1.523 +2 -2 + NTP_4_2_8P17 + + sntp/sntp-opts.c@1.545 +7 -7 + NTP_4_2_8P17 + + sntp/sntp-opts.h@1.543 +3 -3 + NTP_4_2_8P17 + + sntp/sntp.1sntpman@1.358 +2 -2 + NTP_4_2_8P17 + + sntp/sntp.1sntpmdoc@1.358 +2 -2 + NTP_4_2_8P17 + + sntp/sntp.html@1.539 +2 -2 + NTP_4_2_8P17 + + sntp/sntp.man.in@1.358 +2 -2 + NTP_4_2_8P17 + + sntp/sntp.mdoc.in@1.358 +2 -2 + NTP_4_2_8P17 + + util/invoke-ntp-keygen.texi@1.526 +2 -2 + NTP_4_2_8P17 + + util/ntp-keygen-opts.c@1.547 +7 -7 + NTP_4_2_8P17 + + util/ntp-keygen-opts.h@1.545 +3 -3 + NTP_4_2_8P17 + + util/ntp-keygen.1ntp-keygenman@1.354 +2 -2 + NTP_4_2_8P17 + + util/ntp-keygen.1ntp-keygenmdoc@1.354 +2 -2 + NTP_4_2_8P17 + + util/ntp-keygen.html@1.199 +2 -2 + NTP_4_2_8P17 + + util/ntp-keygen.man.in@1.354 +2 -2 + NTP_4_2_8P17 + + util/ntp-keygen.mdoc.in@1.354 +2 -2 + NTP_4_2_8P17 + +ChangeSet@1.4003, 2023-06-06 04:28:11-07:00, ntpreleng@ntp-build.tal1.ntfo.org + p17 + + tests/libntp/run-digests.c@1.2 +7 -7 + p17 + +ChangeSet@1.4002, 2023-06-06 04:09:35-07:00, ntpreleng@ntp-build.tal1.ntfo.org + p17 + + packageinfo.sh@1.549 +1 -1 + p17 + +ChangeSet@1.4001, 2023-06-06 09:43:55+00:00, hart@ntp-devbuild.chi1.ntfo.org + Makefile.am: + Fix make distcheck failure with generated srcdir.c + + tests/libntp/Makefile.am@1.104 +2 -2 + Fix make distcheck failure with generated srcdir.c + +ChangeSet@1.4000, 2023-06-06 03:43:29-05:00, stenn@stenn.chi1.ntfo.org + prep for p17 + + ChangeLog@1.2052 +8 -6 + prep for p17 + + NEWS@1.219 +25 -0 + prep for p17 + +ChangeSet@1.3998, 2023-06-05 00:21:10+00:00, davehart@tl.davehart.net + Add tests for loading and using all supported symmetric auth digests. + + ChangeLog@1.2050 +2 -0 + Add tests/libntp/digests.c to catch regressions reading keys file or with + symmetric authentication digest output. + + include/ntp.h@1.235 +1 -1 + move KEY_TYPE_MD5 to ntp_md5.h + + include/ntp_md5.h@1.15 +4 -0 + move a few items here where they better fit. + + include/ntp_stdlib.h@1.91 +21 -18 + Move items to ntp_md5.h, add some arg names to prototypes. + + libntp/a_md5encrypt.c@1.55 +13 -10 + %zu isn't supported by all compilers we support + + libntp/authkeys.c@1.46 +11 -12 + Get rid of magic number 4 for sizeof(u_int32), use zero_mem() + + libntp/authreadkeys.c@1.36 +10 -2 + Warn if AES128CMAC key is less than 128 bits. + + libntp/msyslog.c@1.57 +3 -2 + Comment grammar + + libparse/clk_hopf6021.c@1.14 +3 -2 + include ascii.h after ntp_stdlib.h to avoid clash with EM define + + libparse/clk_wharton.c@1.13 +3 -2 + include ascii.h after ntp_stdlib.h to avoid clash with EM define + + ntpd/ntp_control.c@1.241 +0 -1 + ntp_md5.h in ntp_stdlib.h now + + ntpd/ntp_loopfilter.c@1.197 +0 -3 + Move PATH_MAX definition to header file. + + sntp/crypto.c@1.42 +0 -5 + Remove redundancies + + sntp/crypto.h@1.15 +0 -1 + separate include of ntp_md5.h no longer needed + + tests/libntp/Makefile.am@1.103 +33 -6 + add digests.c + + tests/libntp/data/ntp.keys@1.2 +1 -1 + typo + + tests/libntp/digests.c@1.1 +415 -0 + Unit test for loading and using all supported symmetric auth methods. + + tests/libntp/digests.c@1.0 +0 -0 + + tests/libntp/run-digests.c@1.1 +80 -0 + Unity generated runner for digests.c + + tests/libntp/run-digests.c@1.0 +0 -0 + +ChangeSet@1.3996.2.1, 2023-06-03 22:48:12+00:00, davehart@tl.davehart.net + [Bug 3822] ntpd significantly delays first poll of servers specified by name. + + ChangeLog@1.2048.2.1 +4 -0 + [Bug 3822] ntpd significantly delays first poll of servers specified by name. + + ntpd/ntp_config.c@1.383 +18 -0 + Treat associations from ntp.conf with hostnames the same as those with IP addresses. + +ChangeSet@1.3996.1.1, 2023-06-02 23:42:10+00:00, davehart@tl.davehart.net + [Bug 3824] Spurious "ntpd: daemon failed to notify parent!" logged at event_sync. + + ChangeLog@1.2048.1.1 +4 -0 + [Bug 3824] Spurious "ntpd: daemon failed to notify parent!" logged at event_sync. + + ntpd/ntp_proto.c@1.446 +3 -2 + CLarify error message + + ntpd/ntpd.c@1.189 +4 -2 + Fix logic error, clarify message + +ChangeSet@1.3997, 2023-06-02 19:29:12+00:00, davehart@tl.davehart.net + [Bug 3821] 4.2.8p16 misreads hex auth keys, won't interop with 4.2.8p15. + + ChangeLog@1.2049 +5 -0 + [Bug 3821] 4.2.8p16 misreads hex auth keys, won't interop with 4.2.8p15. + + libntp/authkeys.c@1.45 +2 -2 + > typo for >> + + tests/libntp/data/mills,david-03.jpg@1.1 +912 -0 + The internet's Father Time + + tests/libntp/data/mills,david-03.jpg@1.0 +0 -0 + + tests/libntp/data/ntp.keys@1.1 +34 -0 + Test keys for libntp/tests/digest.c + + tests/libntp/data/ntp.keys@1.0 +0 -0 + ChangeSet@1.3996, 2023-05-31 20:05:32-07:00, ntpreleng@ntp-build.tal1.ntfo.org NTP_4_2_8P16 TAG: NTP_4_2_8P16 diff --git a/contrib/ntp/NEWS b/contrib/ntp/NEWS index d9d8a0987ab6..432c3d324575 100644 --- a/contrib/ntp/NEWS +++ b/contrib/ntp/NEWS @@ -1,3 +1,28 @@ +--- +NTP 4.2.8p17 (Harlan Stenn , 2023 Jun 06) + +Focus: Bug fixes + +Severity: HIGH (for people running 4.2.8p16) + +This release: + +- fixes 3 bugs, including a regression +- adds new unit tests + +Details below: + +* [Bug 3824] Spurious "ntpd: daemon failed to notify parent!" logged at + event_sync. Reported by Edward McGuire. +* [Bug 3822] ntpd significantly delays first poll of servers specified by name. + Miroslav Lichvar identified regression in 4.2.8p16. +* [Bug 3821] 4.2.8p16 misreads hex authentication keys, won't interop with + 4.2.8p15 or earlier. Reported by Matt Nordhoff, thanks to + Miroslav Lichvar and Matt for rapid testing and identifying the + problem. +* Add tests/libntp/digests.c to catch regressions reading keys file or with + symmetric authentication digest output. + --- NTP 4.2.8p16 (Harlan Stenn , 2023 May 30) diff --git a/contrib/ntp/configure b/contrib/ntp/configure index a8c2ba593aa3..5d09904bea03 100755 --- a/contrib/ntp/configure +++ b/contrib/ntp/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for ntp 4.2.8p16. +# Generated by GNU Autoconf 2.71 for ntp 4.2.8p17. # # Report bugs to . # @@ -621,8 +621,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='ntp' PACKAGE_TARNAME='ntp' -PACKAGE_VERSION='4.2.8p16' -PACKAGE_STRING='ntp 4.2.8p16' +PACKAGE_VERSION='4.2.8p17' +PACKAGE_STRING='ntp 4.2.8p17' PACKAGE_BUGREPORT='https://bugs.ntp.org/' PACKAGE_URL='https://www.ntp.org/' @@ -1651,7 +1651,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures ntp 4.2.8p16 to adapt to many kinds of systems. +\`configure' configures ntp 4.2.8p17 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1722,7 +1722,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of ntp 4.2.8p16:";; + short | recursive ) echo "Configuration of ntp 4.2.8p17:";; esac cat <<\_ACEOF @@ -1967,7 +1967,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -ntp configure 4.2.8p16 +ntp configure 4.2.8p17 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. @@ -2624,7 +2624,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by ntp $as_me 4.2.8p16, which was +It was created by ntp $as_me 4.2.8p17, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw @@ -4039,7 +4039,7 @@ fi # Define the identity of the package. PACKAGE='ntp' - VERSION='4.2.8p16' + VERSION='4.2.8p17' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h @@ -35365,7 +35365,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by ntp $as_me 4.2.8p16, which was +This file was extended by ntp $as_me 4.2.8p17, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -35434,7 +35434,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -ntp config.status 4.2.8p16 +ntp config.status 4.2.8p17 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" diff --git a/contrib/ntp/include/ntp.h b/contrib/ntp/include/ntp.h index c037f5986016..258ddd6138f7 100644 --- a/contrib/ntp/include/ntp.h +++ b/contrib/ntp/include/ntp.h @@ -134,7 +134,7 @@ typedef char s_char; * Miscellaneous stuff */ #define NTP_MAXKEY 65535 /* max authentication key number */ -#define KEY_TYPE_MD5 NID_md5 /* MD5 digest NID */ + /* * Limits of things */ diff --git a/contrib/ntp/include/ntp_md5.h b/contrib/ntp/include/ntp_md5.h index 06c90b2d2faf..8b5a7d0cbb49 100644 --- a/contrib/ntp/include/ntp_md5.h +++ b/contrib/ntp/include/ntp_md5.h @@ -6,6 +6,8 @@ #ifndef NTP_MD5_H #define NTP_MD5_H +# define KEY_TYPE_MD5 NID_md5 + #ifdef OPENSSL # include # include "libssl_compat.h" @@ -30,6 +32,8 @@ typedef MD5_CTX EVP_MD_CTX; +# define NID_md5 4 /* from openssl/objects.h */ +# define EVP_MAX_MD_SIZE 64 /* from openssl/evp.h */ # define EVP_MD_CTX_free(c) free(c) # define EVP_MD_CTX_new() calloc(1, sizeof(MD5_CTX)) # define EVP_get_digestbynid(t) NULL diff --git a/contrib/ntp/include/ntp_stdlib.h b/contrib/ntp/include/ntp_stdlib.h index 2d7c640565d5..446837e3adcb 100644 --- a/contrib/ntp/include/ntp_stdlib.h +++ b/contrib/ntp/include/ntp_stdlib.h @@ -11,6 +11,7 @@ #include "declcond.h" /* ntpd uses ntpd/declcond.h, others include/ */ #include "l_stdlib.h" +#include "ntp_md5.h" #include "ntp_net.h" #include "ntp_debug.h" #include "ntp_malloc.h" @@ -18,6 +19,10 @@ #include "ntp_syslog.h" #include "ntp_keyacc.h" +#ifndef PATH_MAX +# define PATH_MAX MAX_PATH +#endif + #ifdef __GNUC__ #define NTP_PRINTF(fmt, args) __attribute__((__format__(__printf__, fmt, args))) #else @@ -36,24 +41,16 @@ extern void mvsyslog(int, const char *, va_list) NTP_PRINTF(2, 0); extern void init_logging (const char *, u_int32, int); extern int change_logfile (const char *, int); extern void setup_logfile (const char *); -#ifndef errno_to_str +#ifndef errno_to_str /* Windows port defines this */ extern void errno_to_str(int, char *, size_t); #endif -extern char * ntp_realpath(const char * fsname); +extern char * ntp_realpath(const char *fsname); -extern int xvsbprintf(char**, char* const, char const*, va_list) NTP_PRINTF(3, 0); -extern int xsbprintf(char**, char* const, char const*, ...) NTP_PRINTF(3, 4); - -/* - * When building without OpenSSL, use a few macros of theirs to - * minimize source differences in NTP. - */ -#ifndef OPENSSL -#define NID_md5 4 /* from openssl/objects.h */ -/* from openssl/evp.h */ -#define EVP_MAX_MD_SIZE 64 /* longest known is SHA512 */ -#endif +extern int xvsbprintf(char **, char * const, char const *, va_list) + NTP_PRINTF(3, 0); +extern int xsbprintf(char **, char * const, char const *, ...) + NTP_PRINTF(3, 4); #define SAVE_ERRNO(stmt) \ { \ @@ -111,10 +108,16 @@ extern void auth_prealloc_symkeys(int); extern int ymd2yd (int, int, int); /* a_md5encrypt.c */ -extern int MD5authdecrypt (int, const u_char *, size_t, u_int32 *, size_t, size_t, keyid_t); -extern size_t MD5authencrypt (int, const u_char *, size_t, u_int32 *, size_t); -extern void MD5auth_setkey (keyid_t, int, const u_char *, size_t, KeyAccT *c); -extern u_int32 addr2refid (sockaddr_u *); +extern size_t MD5authencrypt (int type, const u_char *key, size_t klen, + u_int32 *pkt, size_t length); +extern int MD5authdecrypt (int type, const u_char *key, size_t klen, + u_int32 *pkt, size_t length, size_t size, + keyid_t keyno); +extern u_int32 addr2refid(sockaddr_u *); + +/* authkeys.c */ +extern void MD5auth_setkey (keyid_t, int, const u_char *, size_t, + KeyAccT *c); /* emalloc.c */ #ifndef EREALLOC_CALLSITE /* ntp_malloc.h defines */ diff --git a/contrib/ntp/libntp/a_md5encrypt.c b/contrib/ntp/libntp/a_md5encrypt.c index 6011af52af6d..7a372969123f 100644 --- a/contrib/ntp/libntp/a_md5encrypt.c +++ b/contrib/ntp/libntp/a_md5encrypt.c @@ -9,7 +9,6 @@ #include "ntp_string.h" #include "ntp_stdlib.h" #include "ntp.h" -#include "ntp_md5.h" /* provides OpenSSL digest API */ #include "isc/string.h" typedef struct { @@ -22,10 +21,12 @@ typedef struct { size_t len; } rwbuffT; + #if defined(OPENSSL) && defined(ENABLE_CMAC) static size_t cmac_ctx_size( - CMAC_CTX * ctx) + CMAC_CTX * ctx + ) { size_t mlen = 0; @@ -36,14 +37,16 @@ cmac_ctx_size( } return mlen; } -#endif /*OPENSSL && ENABLE_CMAC*/ +#endif /* OPENSSL && ENABLE_CMAC */ + static size_t make_mac( const rwbuffT * digest, int ktype, const robuffT * key, - const robuffT * msg) + const robuffT * msg + ) { /* * Compute digest of key concatenated with packet. Note: the @@ -66,8 +69,8 @@ make_mac( /* adjust key size (zero padded buffer) if necessary */ if (AES_128_KEY_SIZE > key->len) { memcpy(keybuf, keyptr, key->len); - memset((keybuf + key->len), 0, - (AES_128_KEY_SIZE - key->len)); + zero_mem((keybuf + key->len), + (AES_128_KEY_SIZE - key->len)); keyptr = keybuf; } @@ -107,10 +110,10 @@ make_mac( goto mac_fail; } - #ifdef EVP_MD_CTX_FLAG_NON_FIPS_ALLOW + #ifdef EVP_MD_CTX_FLAG_NON_FIPS_ALLOW /* make sure MD5 is allowd */ EVP_MD_CTX_set_flags(ctx, EVP_MD_CTX_FLAG_NON_FIPS_ALLOW); - #endif + #endif /* [Bug 3457] DON'T use plain EVP_DigestInit! It would * kill the flags! */ if (!EVP_DigestInit_ex(ctx, EVP_get_digestbynid(ktype), NULL)) { @@ -239,8 +242,8 @@ MD5authdecrypt( dlen = MAX_MDG_LEN; if (size != (size_t)dlen + KEY_MAC_LEN) { msyslog(LOG_ERR, - "MAC decrypt: MAC length error: len=%zu key=%d", - size, keyno); + "MAC decrypt: MAC length error: len=%u key=%d", + (u_int)size, keyno); return (0); } return !isc_tsmemcmp(digest, diff --git a/contrib/ntp/libntp/authkeys.c b/contrib/ntp/libntp/authkeys.c index 4448dadd2b6a..d28b4b932b84 100644 --- a/contrib/ntp/libntp/authkeys.c +++ b/contrib/ntp/libntp/authkeys.c @@ -284,8 +284,7 @@ init_auth(void) */ newalloc = authhashbuckets * sizeof(key_hash[0]); - key_hash = erealloc(key_hash, newalloc); - memset(key_hash, '\0', newalloc); + key_hash = emalloc_zero(newalloc); INIT_DLIST(key_listhead, llink); @@ -458,7 +457,7 @@ auth_resize_hashtable(void) newalloc = authhashbuckets * sizeof(key_hash[0]); *** 3320 LINES SKIPPED *** From nobody Fri Jun 9 17:21:25 2023 X-Original-To: dev-commits-src-branches@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 4Qd7Cp1SSbz4bb00; Fri, 9 Jun 2023 17:21:26 +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 4Qd7Cp0zL2z3rw8; Fri, 9 Jun 2023 17:21:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686331286; 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=QF0wioru5t9CU7068B+EVABovh+/9SECNs6wyyfErK0=; b=ryfhZ8D5+NXUAhxgGBOmRElXBNHJ7eIifdkLbqu0sqUReo2YAy8CebZZQVI9zBlPUhesmd 83zdafYHSFJEz3HGE5odxGzouroEy1HKHaCkbwj0LoKp1V3ktzBux0uqnjj0qFVfh/gIhI hCpMFX3cXgQ+jjk6bWBtdgYpsNX8AvAfpojyl0S+w97v29w2Be93fVlgIjWI+ynV/5Yf7t ytk82GEOREeMJUF6xgKpdVX4w6ukiNeXItrpu8gzDfl4RghIRCoiiHknCBAONqwO9nPSf/ LSVQOJ1GyIhjTXWMwiLGaogojphNt4QmoksTsf0AGxra+V0Ij24qTi1PtFyn7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686331286; 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=QF0wioru5t9CU7068B+EVABovh+/9SECNs6wyyfErK0=; b=u94Bey/TlBIFIgcpodDz8RSBABZXNwnjkPj28I68QlLB5aR2DHPtKQo3iyUBN9bU1tcUBF cx/327+oCxiNhum3aTbA+wHyoWLufjnvE5GWeKURqvYsetZcLs7X+vHbR+G6m8cOkGkDei kvKYtNIqChShPrc30nc1TW1PMDaS7Yoafj2UZ4KXfPtVAbGu+rKd6C+gVgNrDcjHTsEbY+ 6NyCFk+mQhxlJaRpP/c+t8RFgF9WkkzpvmZ46ZdWkzXyb0A7vRwmUt/yTF+6NQWC7KHmaP ksM5fiY3fMl/3gPdtvtZ44Wo2AsrR2ne0IfZkzjwngRKcmqDmTOuztDdLBYpSQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686331286; a=rsa-sha256; cv=none; b=h6h4TLbD1SyS39IpB4IOGfh5/6JMVgacY61ovb4p8A3A26mz2g3+jpRJ65T2ViNmUGTFvI vPbEXcyQsEjgpgjHN7MGTIPzvxEmil25AMk8sMph3L5MNHC7u481J/+pMISmUyItmwAqyy PDKM7HaI4SJCeWW5rf92YkdoKevYg221qsRNc9ChcbbluxusddkUFYCl89EZ8Fr5S1753s p+/3jjVLkxWecqAWzNYga6WnFM6m5rj7gXGTJvrRg43ptktlu+rPiFh4LFw1CmgxDaIS11 YBmmYKA836tQIen0UYBMQL5VW3D5UFXFAaaNdPaRDVGj1hZ7zyWWpNyxwFpeZw== 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 4Qd7Cp034GzjyS; Fri, 9 Jun 2023 17:21:26 +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 359HLPvG019671; Fri, 9 Jun 2023 17:21:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 359HLP8Q019670; Fri, 9 Jun 2023 17:21:25 GMT (envelope-from git) Date: Fri, 9 Jun 2023 17:21:25 GMT Message-Id: <202306091721.359HLP8Q019670@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 0837ad1598e0 - stable/13 - ipsec: Make algorithm tables read-only List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 0837ad1598e0cb5fe1e7f5b305feee05bc4e9858 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=0837ad1598e0cb5fe1e7f5b305feee05bc4e9858 commit 0837ad1598e0cb5fe1e7f5b305feee05bc4e9858 Author: Mark Johnston AuthorDate: 2023-06-02 17:22:56 +0000 Commit: Mark Johnston CommitDate: 2023-06-09 17:19:34 +0000 ipsec: Make algorithm tables read-only No functional change intended. MFC after: 1 week (cherry picked from commit 056305d3aa2bdb93e57c7a3d369e5742b1b404b8) --- sys/netipsec/key.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/netipsec/key.c b/sys/netipsec/key.c index efda68f09078..4e325f597c07 100644 --- a/sys/netipsec/key.c +++ b/sys/netipsec/key.c @@ -580,7 +580,7 @@ struct sadb_msghdr { int extlen[SADB_EXT_MAX + 1]; }; -static struct supported_ealgs { +static const struct supported_ealgs { int sadb_alg; const struct enc_xform *xform; } supported_ealgs[] = { @@ -591,7 +591,7 @@ static struct supported_ealgs { { SADB_X_EALG_AESGMAC, &enc_xform_aes_nist_gmac }, }; -static struct supported_aalgs { +static const struct supported_aalgs { int sadb_alg; const struct auth_hash *xform; } supported_aalgs[] = { @@ -605,7 +605,7 @@ static struct supported_aalgs { { SADB_X_AALG_AES256GMAC, &auth_hash_nist_gmac_aes_256 }, }; -static struct supported_calgs { +static const struct supported_calgs { int sadb_alg; const struct comp_algo *xform; } supported_calgs[] = { From nobody Fri Jun 9 17:21:27 2023 X-Original-To: dev-commits-src-branches@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 4Qd7Cq2xxfz4bb4c; Fri, 9 Jun 2023 17:21:27 +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 4Qd7Cq23TQz3s2D; Fri, 9 Jun 2023 17:21:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686331287; 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=xdGBSyDyOmvsquXvbU4l1WZTZT8Y9jTONhyqjNprjF0=; b=wK+im71Wxh0d/X4d/bd++t2cTxu1McZ+drJ0nhuoa6bWl3YALYESmBfckNusjdTURtYbaR r/pFECjZEniuk24MvlzU0wG60cTxc8fTDfXLOsrjr8NK7RP3BmwEJ+/X7pB8bAIvT8C/Q8 CUINrU2WzvTBdE99CEZ4BLE92OltG+4vsUUKVDLn8qSxxBbJ8enJ/kRZq8c/GW3BHnsD21 ov8n/yc4RLlhRgB/nTW9CU1O+P070xnD0Be388TdW5tznoWUCeATzNStHQnn8mG9B7P6C6 A+QsylX4DtWK7z7W53X40Y2JCRVG5uMsBp4M7qsVA754bdgLF/mUzNbCmDTg9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686331287; 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=xdGBSyDyOmvsquXvbU4l1WZTZT8Y9jTONhyqjNprjF0=; b=YAm5HzqlOC4v0nZN2o679q0LFDZy+gT/PgbVwbmbCfzmrXZyIxFkwf9+yzO10qcLNJdVVK rMsSPMmkJlxdrWezD5d/ZuFiW6zorCEgCVz8E/mSb6btGas67haCd4rca6DgIqCUvUsnai cmgdnpw8b0hS27y/jfjf/Hjzi6RUi/r2Vj4tJmchJmwMrzWIuav/DvkESKk3yCh9Ad+Yhk fPoEyOw4ZLjMqXfu2rrsCgxgvkcTfgT+Hs9biql8l8GYU8tmn1s0d1IquIwiI37h/MNoCC QvzFZGDExbv6uorr66AAgxDV6zQ9gXy3wn1XnusLGGme2JhcxnNKlMAx6uIV3Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686331287; a=rsa-sha256; cv=none; b=CMMzSmAkIVukM46bXFkLgZNN6VLLNTQBmjvlAQxe83l7fvMsSqPL6eSjC6YD20lqwws/sO QbM0nKKQMjPH1ypjzAouuet+5aoTlI4DK6TC/RmpBNqzAs/BHVh/AxczJP3cGC4hA8FNaA K5tgf8+S0aVaoX6b806tigeDGBaINHw+Lt3i+RmP+Dw2VdcWZp3a+q/C0IGndwt2imENrm BDz674LqTjZdgiPMVVwhxaBKfm8rsma/fd0ULOCE7yf2dDTJsrJacsxhQKCSDw5dJ9xbzq 835nlR4LVfClgzzKPnpxOehFipVwh/jLZbEjvKJqImuj6zMHo5O0hxhQdZqjBQ== 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 4Qd7Cq0wsHzkKc; Fri, 9 Jun 2023 17:21:27 +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 359HLRWw019691; Fri, 9 Jun 2023 17:21:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 359HLRl0019690; Fri, 9 Jun 2023 17:21:27 GMT (envelope-from git) Date: Fri, 9 Jun 2023 17:21:27 GMT Message-Id: <202306091721.359HLRl0019690@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: bdfc441d41f5 - stable/13 - x86: Mark the CPU idle function table as const List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: bdfc441d41f5ceacf389ea347a85cd42d25f6388 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=bdfc441d41f5ceacf389ea347a85cd42d25f6388 commit bdfc441d41f5ceacf389ea347a85cd42d25f6388 Author: Mark Johnston AuthorDate: 2023-06-02 17:22:32 +0000 Commit: Mark Johnston CommitDate: 2023-06-09 17:19:47 +0000 x86: Mark the CPU idle function table as const No functional change intended. MFC after: 1 week (cherry picked from commit 7266f5249848512b99d4dc78256af148f9df986e) --- sys/x86/x86/cpu_machdep.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/x86/x86/cpu_machdep.c b/sys/x86/x86/cpu_machdep.c index 37db1e85a374..1d5f7e548dc1 100644 --- a/sys/x86/x86/cpu_machdep.c +++ b/sys/x86/x86/cpu_machdep.c @@ -724,9 +724,9 @@ cpu_idle_wakeup(int cpu) /* * Ordered by speed/power consumption. */ -static struct { +static const struct { void *id_fn; - char *id_name; + const char *id_name; int id_cpuid2_flag; } idle_tbl[] = { { .id_fn = cpu_idle_spin, .id_name = "spin" }, @@ -790,7 +790,8 @@ cpu_idle_selector(const char *new_idle_name) static int cpu_idle_sysctl(SYSCTL_HANDLER_ARGS) { - char buf[16], *p; + char buf[16]; + const char *p; int error, i; p = "unknown"; From nobody Fri Jun 9 17:21:28 2023 X-Original-To: dev-commits-src-branches@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 4Qd7Cr6b8Vz4bb7R; Fri, 9 Jun 2023 17:21:28 +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 4Qd7Cr2WYhz3s0K; Fri, 9 Jun 2023 17:21:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686331288; 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=fFpCreY5SiXVjmw+7W/50uq8gzUp17U1Iv91vEEdhR0=; b=izw4uv1sBBRsu64TEOJdzdFhFHtk2cHAUx6hZDZDVz0Ld9IuMMxSRXclGkV6bCfoeELjKU 2SotYqBXD9rXuJ7FzUtrL81L/OG5gOTN6X6aCmyHT0tjJ67c0LtLCXlGUZ+I90WUFckbxy Iq2j9b8QqKAp5rK9dSIn9dd4XCf1Rlb4XwrDc4NaEQvr8u7izW51kjqYYfLuaCImkH5Onk OsQwsZM2WgzyS+Oz0/4/ddxwGq9ctzYqZ2ulO6klaXsChS7Qr4bzXFplZQU/TFviiSbqrf toAaGKV584n4OZAPbvn5YpJf/RepQjvxEq1EUSR4E2OFWXD3ixEG5sjOzclRVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686331288; 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=fFpCreY5SiXVjmw+7W/50uq8gzUp17U1Iv91vEEdhR0=; b=keC5hB78lAQ3VFO1DNeMAFsF1abQoxAusA+aeMvC6EmQQbWjvqBQ4MFNUwQN3qWgX9yoB7 XAP822fB5uLsCWLpGZjNoqEASPLB04WPhdq3m4TBgJleLYj7osMdU8QvF+bxXURW1b0hoH /bxD5hxDBLdF/xVISQG8R0c45C0k0DSN9ldkXk5actWYeeN+/8f0XRdyK4+mo9Ud3dkQGf sOMHryv12vfSRRfEx+HRPn7CsdcrsRwgCr137lnuCzJtim8VH6zRwylWnCzQUgLlJtZ3pn UXP27A2YEu+DZ8gFMSPEl+/BTAtscTyAHd9QWkY0EhuMleG5y1mv2EUvfdGv4w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686331288; a=rsa-sha256; cv=none; b=HH8OH5U9jla+sPIhhEv8rJ5K6JpyMVpKWT8MIVVCszQdSJsqS6vKNz5yICoLbgtDWgwT7F QCDGsoqw0nyjqqW2zCs9szwMiAyXU3u+h1zsir8kjpcTzO76huRT9/vBcb6hMNZGOxeWku Y/s+OqqNOt5mC2rtqmrmUTnCq4OsMj16kEyDgUTojRdXwH+NtInjNl34Vtz4KTmOghRmhT cDsxpIa9giKOpZdbYp47F9IkgdR6u50HZktq5f7TicVGsuxy0kL563sRBL0J1MmBVDl2Zb vRv8Hn3+c/ZvDBAEkMOfXPAahPt0u7qf8PgluoAgxFvxBFzcX+LIMlopTqCVpQ== 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 4Qd7Cr1ch5zk10; Fri, 9 Jun 2023 17:21:28 +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 359HLSnL019711; Fri, 9 Jun 2023 17:21:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 359HLSrn019710; Fri, 9 Jun 2023 17:21:28 GMT (envelope-from git) Date: Fri, 9 Jun 2023 17:21:28 GMT Message-Id: <202306091721.359HLSrn019710@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 86204d931f3a - stable/13 - sysarch: Add includes required for ktrcapfail() calls to be compiled List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 86204d931f3a6031b6203b7345038560c8d30829 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=86204d931f3a6031b6203b7345038560c8d30829 commit 86204d931f3a6031b6203b7345038560c8d30829 Author: Mark Johnston AuthorDate: 2023-06-01 21:13:09 +0000 Commit: Mark Johnston CommitDate: 2023-06-09 17:20:05 +0000 sysarch: Add includes required for ktrcapfail() calls to be compiled Reported by: jfree MFC after: 1 week (cherry picked from commit 18282c4772fb68a0e076d17f30de9749190542f4) --- sys/amd64/amd64/sys_machdep.c | 2 ++ sys/arm/arm/sys_machdep.c | 2 ++ sys/i386/i386/sys_machdep.c | 2 ++ 3 files changed, 6 insertions(+) diff --git a/sys/amd64/amd64/sys_machdep.c b/sys/amd64/amd64/sys_machdep.c index 9a577e3e0817..cbbadc0966cc 100644 --- a/sys/amd64/amd64/sys_machdep.c +++ b/sys/amd64/amd64/sys_machdep.c @@ -36,11 +36,13 @@ __FBSDID("$FreeBSD$"); #include "opt_capsicum.h" +#include "opt_ktrace.h" #include #include #include #include +#include #include #include #include diff --git a/sys/arm/arm/sys_machdep.c b/sys/arm/arm/sys_machdep.c index fc424d0fad39..718c5a06318e 100644 --- a/sys/arm/arm/sys_machdep.c +++ b/sys/arm/arm/sys_machdep.c @@ -35,10 +35,12 @@ __FBSDID("$FreeBSD$"); #include "opt_capsicum.h" +#include "opt_ktrace.h" #include #include #include +#include #include #include #include diff --git a/sys/i386/i386/sys_machdep.c b/sys/i386/i386/sys_machdep.c index eeff4b280696..04456b55da52 100644 --- a/sys/i386/i386/sys_machdep.c +++ b/sys/i386/i386/sys_machdep.c @@ -36,10 +36,12 @@ __FBSDID("$FreeBSD$"); #include "opt_capsicum.h" #include "opt_kstack_pages.h" +#include "opt_ktrace.h" #include #include #include +#include #include #include #include From nobody Fri Jun 9 17:21:29 2023 X-Original-To: dev-commits-src-branches@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 4Qd7Ct0tKkz4bbPr; Fri, 9 Jun 2023 17:21:30 +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 4Qd7Cs3T2Dz3sG1; Fri, 9 Jun 2023 17:21:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686331289; 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=F7WErJq20PcDtl7ZM35XsUKre3PKV9Her2mMMzI0GvQ=; b=I5PFVNhm+pIYbKSfi7aSF4sxerN+4MmVH6WfYMf1bVRRvOzCY51ZG/aNZedRQ5qG4smkqM y6AzMYh4VRncKKMTUiPnuqI8fA8+UpqU1iSI7trkKUbfJ9Wpqmndjw4Wh3WJjIGPraNETU iZu3sFDrktuFo0l9AoZQ8jEm0pO+9Y5NceUlquI4/YFXcp+4iH2UgE5CtM7sgvxkqkuAXz 16uegNjAJLfm5Xcire2nk4lj/ipfGpBpZh9SqdFiGc89M32pucevMLDEyUkRsaPRmCZDFO 9Ao0PAlzDlDbNqpYIm0Qqme/50HEiPB0PVBOINdHbTk6LADdNVxo6ZcKwjPjEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686331289; 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=F7WErJq20PcDtl7ZM35XsUKre3PKV9Her2mMMzI0GvQ=; b=x99gr4wLSj8C53Hr+jmexebRm+2gLNFC3vXCDeJ2lBpKY85umVRxlScHr/JpLUrnh9U7tp G7QUa3gYDvXRac1DWB5fPomC610t3nK9991wbtWYH+4edlnO1s4+wqXwbRzZlOUEnrJnFC MLxxRhF63rf+bBfWsb0i/qBP5KWsIVY3R3pN2GVFt7PLgrBp3PNyRSwTYeLFMBcAgX9Mo4 lqOZn7Q9eahjAoojzY3UQi0dT99cB1ELSrM9/1bae5bzJmsgyFoMcF9NtgJrqnzTM/9+jz LSQYnDbW8BQUill4x/ZNEBXfnatRNCb9XeeXxRaS5jQcj6n0LwYoHvLjrisYxQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686331289; a=rsa-sha256; cv=none; b=sLDYwwx+Hd9WWwW7mh/krqm4iTBvUBb3yA3wXdWWt4UzK7KLsPnCOaX/mTUizMuysQFo7B i3muI2zlENGvkh874lPqfFJVnLf79FrCWkJM+3M9eQTFdgzNFrgMJoy7zJpj7DFuASFxJ5 QzETRN0Blb/LTelYkC/uizIezgHpF33jV1uDhgud+JLm5VRIGeHlvaoAehss1v374SvCUc IfyAyJWeZkkOLxNOolnOAj8cL04Inll3SzY8FtCww30jD2IBpYGL5EYh64Xg0/M+kivAcq B20kdm2Xj2Vnj3cLFgHkDNsA4oC5pECQ4nGv6vPA26Y/LKoxVr/xgGhEarU/aQ== 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 4Qd7Cs2HPjzkSg; Fri, 9 Jun 2023 17:21:29 +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 359HLTs3019731; Fri, 9 Jun 2023 17:21:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 359HLTlc019730; Fri, 9 Jun 2023 17:21:29 GMT (envelope-from git) Date: Fri, 9 Jun 2023 17:21:29 GMT Message-Id: <202306091721.359HLTlc019730@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: f4c08b759ad1 - stable/13 - ktrace: Make sys/ktrace.h self-contained List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: f4c08b759ad1cc4f7a91f367a088b1757d633ae1 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=f4c08b759ad1cc4f7a91f367a088b1757d633ae1 commit f4c08b759ad1cc4f7a91f367a088b1757d633ae1 Author: Mark Johnston AuthorDate: 2023-06-01 21:10:44 +0000 Commit: Mark Johnston CommitDate: 2023-06-09 17:20:29 +0000 ktrace: Make sys/ktrace.h self-contained MFC after: 2 weeks (cherry picked from commit c8a383396888d897d057088d7f84fb57de40807e) --- sys/sys/ktrace.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/sys/ktrace.h b/sys/sys/ktrace.h index b9d80f7f94d0..4f0b3c8dd892 100644 --- a/sys/sys/ktrace.h +++ b/sys/sys/ktrace.h @@ -36,6 +36,8 @@ #define _SYS_KTRACE_H_ #include +#include +#include /* * operations to ktrace system call (KTROP(op)) From nobody Fri Jun 9 17:21:30 2023 X-Original-To: dev-commits-src-branches@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 4Qd7Ct5DRsz4bb7X; Fri, 9 Jun 2023 17:21:30 +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 4Qd7Ct4DwZz3s9g; Fri, 9 Jun 2023 17:21:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686331290; 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=GbkaDNPcOsJvwngW72l0j4IK+goTuRx6wjK+vIbaPTI=; b=dFK2XzZ/d/kOeXQz5VPmbsaAS37jp3nq5pdyW+Kww79Ea/8MYs+iF80KjkvzmSOMrzLU2l IzDdjM0wpvju3mHq2GcstgRwrubsXbfgW1P/bADbjHgPlnhyOTu6nvBJ3Egr+xTTWP3Eew e6ZSLF8P3GQajdQsowWBwgQRNgU5sRGc2CKt4s3TmUBSHcWG+uVT+4exjqjIEZUIpj6mYA XXlZbrhVucau/fwxSzQFRsiO/ekZhpsUZ3C3mCd9ZT/qcV7bHQ7pBfkheaEZeWxBM4pKk8 nBhVQZL3NVbVzD6RkKOVdozgCU6Ud+QB8X0PDH9EFr+hYTA4CSh7IobNi7OW6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686331290; 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=GbkaDNPcOsJvwngW72l0j4IK+goTuRx6wjK+vIbaPTI=; b=ukgc0pQv0V6hqkvk7bkLgxX2pweIDPfZ8UEBF7Sooy/BdBbINVK9chI9NFDxXv7w6LTknb h1PmT0YoZbU4OXffe96teCcioAVJ94w1+dkFZJPhfnOkI0LgahAldaDcHEVhs7XQJ9ViT3 shOdGyepQpMjacahbaClFMjGW2Zg3RoWE2Qrw651Rdsn+z+WaHzXtfd7rXkrfBQO5RzHUU OWdA4R2/dBD/xsN8M72amStjme0DTqjULl9fxtoGEpLlu5sCBFejZLXiPK9pD8OQC5x8Lu UPUxBLhsm+D5d2M4EePF4IbML3ANfHKu+vWYp4Q2gXtgWFWoau6IvW2WMns9iw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686331290; a=rsa-sha256; cv=none; b=C7H0OHCcFO9qGUXsEwfPH5zLvQFYBGIiOlDaZa8pQveP05uGoT8A540QFhD6P+AyUXxIoS XZlpsloxZSrUGTRwlTr4VPZvb4m/63ixEt/DyzuQOHR6UcJka+wPXcK5WKDTsveVe10egN ASurT3RNWiK1GT9XFqlcryOEZSIoTlvB54sbYffiI2SJPg66PJQt5bQuBfrsJ87rbx4oab rsB69q7To7jqzYsbHtGjuarHno4zh47+Z1keBEZ3uawBitly9V+meQLIKiB6gll1OaRhi9 zbcKRrRQ9eA8naOKPfd8oy6+fH/bJTlN1JfE7TRXP8JHdZWjXTKRJjkGzhb3aA== 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 4Qd7Ct3HqKzkSj; Fri, 9 Jun 2023 17:21:30 +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 359HLUB6019756; Fri, 9 Jun 2023 17:21:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 359HLU1c019755; Fri, 9 Jun 2023 17:21:30 GMT (envelope-from git) Date: Fri, 9 Jun 2023 17:21:30 GMT Message-Id: <202306091721.359HLU1c019755@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: e81a864ddaad - stable/13 - top: Use a cpuset_t to represent a CPU mask List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: e81a864ddaad0f0cdb4a3da0fd9d43c4448679c4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=e81a864ddaad0f0cdb4a3da0fd9d43c4448679c4 commit e81a864ddaad0f0cdb4a3da0fd9d43c4448679c4 Author: Mark Johnston AuthorDate: 2023-05-26 19:14:21 +0000 Commit: Mark Johnston CommitDate: 2023-06-09 17:20:40 +0000 top: Use a cpuset_t to represent a CPU mask The code attempts to detect holes in the CPU ID space, but previously this would only work for up to sizeof(long)*8 CPUs. MFC after: 2 weeks (cherry picked from commit e96ed177465ee59fcc43dd0696106e5342e28c27) --- usr.bin/top/machine.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/usr.bin/top/machine.c b/usr.bin/top/machine.c index be667ec0e461..2fbdb8551bb0 100644 --- a/usr.bin/top/machine.c +++ b/usr.bin/top/machine.c @@ -16,9 +16,10 @@ * $FreeBSD$ */ +#include +#include #include #include -#include #include #include #include @@ -204,7 +205,7 @@ static const char *ordernames[] = { static int maxcpu; static int maxid; static int ncpus; -static unsigned long cpumask; +static cpuset_t cpumask; static long *times; static long *pcpu_cp_time; static long *pcpu_cp_old; @@ -347,8 +348,6 @@ machine_init(struct statics *statics) statics->order_names = ordernames; /* Allocate state for per-CPU stats. */ - cpumask = 0; - ncpus = 0; GETSYSCTL("kern.smp.maxcpus", maxcpu); times = calloc(maxcpu * CPUSTATES, sizeof(long)); if (times == NULL) @@ -357,18 +356,18 @@ machine_init(struct statics *statics) if (sysctlbyname("kern.cp_times", times, &size, NULL, 0) == -1) err(1, "sysctlbyname kern.cp_times"); pcpu_cp_time = calloc(1, size); - maxid = (size / CPUSTATES / sizeof(long)) - 1; + maxid = MIN(size / CPUSTATES / sizeof(long) - 1, CPU_SETSIZE - 1); + CPU_ZERO(&cpumask); for (i = 0; i <= maxid; i++) { empty = 1; for (j = 0; empty && j < CPUSTATES; j++) { if (times[i * CPUSTATES + j] != 0) empty = 0; } - if (!empty) { - cpumask |= (1ul << i); - ncpus++; - } + if (!empty) + CPU_SET(i, &cpumask); } + ncpus = CPU_COUNT(&cpumask); assert(ncpus > 0); pcpu_cp_old = calloc(ncpus * CPUSTATES, sizeof(long)); pcpu_cp_diff = calloc(ncpus * CPUSTATES, sizeof(long)); @@ -466,7 +465,7 @@ get_system_info(struct system_info *si) /* convert cp_time counts to percentages */ for (i = j = 0; i <= maxid; i++) { - if ((cpumask & (1ul << i)) == 0) + if (!CPU_ISSET(i, &cpumask)) continue; percentages(CPUSTATES, &pcpu_cpu_states[j * CPUSTATES], &pcpu_cp_time[j * CPUSTATES], From nobody Fri Jun 9 19:57:54 2023 X-Original-To: dev-commits-src-branches@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 4QdBhL58gXz4cKXv; Fri, 9 Jun 2023 19:57:54 +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 4QdBhL4T2Yz4Hly; Fri, 9 Jun 2023 19:57:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686340674; 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=m1MCtNryZtyyk89xKNxySGUAaWkaa+T36rkB+ab8qbk=; b=YvWo372Oq4VsWfU2zfTj24vfZbonfP+2kTT3aLVIRPb619MdAzCre+ax2NXpwwLcJ+AuJp kaqP/2TV72heYkFXJlhVWpIKrtuytkQZFw3wcc6tGut8pqpD29oVkCK4RqGnMo9lN6O4b4 vDNDRyCUI+9hdyGb4mnHKs309Dx5jRkKv6htO+aLg6fgAdhk88YNatumQp2Kfgxrz0GKGp hsXLgNtdXNrOage/pBUynuCATF3RerVkYgPIHy9Aityj1ifWnTDh/tFptYxJ3odj0jYO1H UsYCTk7+GtVutJoE+J2aaPCAxtmw+p5wSPv10s2pkUkFSEFFeQvR1ghR6rVIVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686340674; 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=m1MCtNryZtyyk89xKNxySGUAaWkaa+T36rkB+ab8qbk=; b=USGGss07sG4OQlSRamNK2dkiXc9FoP9u19I94ReRtk4JmpiOh1nswZ7Pz842f3GGnSOUCt ULchJGGlvooJ84TSp2PTRNoFb56aFHZityTIrgCSWTB0h4rzD1e9pHumc1C999jWpnygLc TQtbhuybeksquhqJ3sTPSqoz3R/4u0FJ+s8Qy7VSwjY28LB//kDiKS6EP+z5FgYD2k6IIy /hkVZCpu+Rwvo1WmNGU/M5n35B27odV1NAyazBgqlnavHsTQjzdXV9K3FXru4PRZXKNHUN 2ufO3Afka/J2453lCvvZe9tGl8l2102mwKWzYynBDhWMdZynx8WGAVjZdfYM3g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686340674; a=rsa-sha256; cv=none; b=NYPEasUyLLHz2In1p0OQ6m/rKJGyKq/5RvgNsDkEZOhhX6WHxijkiuB7IQS3t+9vtsJYRW 21n0tHtG/4+wvjrxwymwQOALzmu/rBqCwekfA4DiYyiop1+ajjj2ZkxnjZy7+04e51cAoU abycd6f+Ns3OiH5qFzsqz57fpoG8ps35GVNnV8vIeQa9k7PFzHTzNSbx7FYiIwTTj2Z2OW TAvAfJXRl+TUZWG5E/Oo1qo7mXA4OmnYNjXt+RntRig7YArWXRQEmrciSyAiHSLhpT37GT W5naiRlV/JEbtfXzHPnBrZq1NtlfNeZvqf+xyxdntykVd+SP2MyZU4WOtw0YNg== 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 4QdBhL3PzWznW1; Fri, 9 Jun 2023 19:57:54 +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 359Jvs54071885; Fri, 9 Jun 2023 19:57:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 359JvsY5071884; Fri, 9 Jun 2023 19:57:54 GMT (envelope-from git) Date: Fri, 9 Jun 2023 19:57:54 GMT Message-Id: <202306091957.359JvsY5071884@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 8a226e8cabee - stable/13 - arm64/disassem.c: style and formatting List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8a226e8cabeeb8b022cc42245115ef7a1da3ce86 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=8a226e8cabeeb8b022cc42245115ef7a1da3ce86 commit 8a226e8cabeeb8b022cc42245115ef7a1da3ce86 Author: Mykola Hohsadze AuthorDate: 2023-04-18 15:50:33 +0000 Commit: Mitchell Horne CommitDate: 2023-06-09 18:14:57 +0000 arm64/disassem.c: style and formatting Reviewed by: mhorne MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D38899 (cherry picked from commit 5b61ad4b005d73b497537fcb41e3557314d18ddd) --- sys/arm64/arm64/disassem.c | 75 +++++++++++++++++++++++++++++----------------- 1 file changed, 48 insertions(+), 27 deletions(-) diff --git a/sys/arm64/arm64/disassem.c b/sys/arm64/arm64/disassem.c index ce0bf7660b02..681164011b40 100644 --- a/sys/arm64/arm64/disassem.c +++ b/sys/arm64/arm64/disassem.c @@ -28,11 +28,13 @@ #include __FBSDID("$FreeBSD$"); -#include +#include #include -#include + #include +#include + #include #define ARM64_MAX_TOKEN_LEN 8 @@ -82,12 +84,21 @@ struct arm64_insn_token { * Define generic types for instruction printing. */ enum arm64_format_type { - TYPE_01, /* OP , , {, #} SF32/64 - OP , , #{, } SF32/64 */ - TYPE_02, /* OP , [, #]{!}] SF32/64 - OP , [], #{!} SF32/64 - OP , , {, EXTEND AMOUNT } */ - TYPE_03, /* OP , #imm SF32/64 */ + /* + * OP , , {, #imm} SF32/64 + * OP , , #{, } SF32/64 + */ + TYPE_01, + + /* + * OP , [, #]{!} SF32/64 + * OP , [], #{!} SF32/64 + * OP , , {, EXTEND AMOUNT } + */ + TYPE_02, + + /* OP , #imm SF32/64 */ + TYPE_03, }; /* @@ -101,8 +112,8 @@ enum arm64_format_type { * tokens - array of tokens (operands) inside instruction */ struct arm64_insn { - char* name; - char* format; + char *name; + char *format; enum arm64_format_type type; uint64_t special_ops; uint32_t mask; @@ -202,7 +213,7 @@ arm64_disasm_generate_masks(struct arm64_insn *tab) */ a = (INSN_SIZE * NBBY) - 1; while (*format != '\0' && (a >= 0)) { - switch(*format) { + switch (*format) { case '0': /* Bit is 0, add to mask and pattern */ mask |= (1 << a); @@ -230,7 +241,8 @@ arm64_disasm_generate_masks(struct arm64_insn *tab) i++; format++; if (i >= ARM64_MAX_TOKEN_LEN) { - printf("ERROR: token too long in op %s\n", + printf("ERROR: " + "token too long in op %s\n", tab->name); error = 1; break; @@ -243,7 +255,8 @@ arm64_disasm_generate_masks(struct arm64_insn *tab) ret = sscanf(format, "(%d)", &len); if (ret == 1) { if (token >= ARM64_MAX_TOKEN_CNT) { - printf("ERROR: to many tokens in op %s\n", + printf("ERROR: " + "too many tokens in op %s\n", tab->name); error = 1; break; @@ -357,7 +370,7 @@ disasm(const struct disasm_interface *di, vm_offset_t loc, int altfmt) while (i_ptr->name) { /* If mask is 0 then the parser was not initialized yet */ if ((i_ptr->mask != 0) && - ((insn & i_ptr->mask) == i_ptr->pattern)) { + ((insn & i_ptr->mask) == i_ptr->pattern)) { matchp = 1; break; } @@ -388,14 +401,17 @@ disasm(const struct disasm_interface *di, vm_offset_t loc, int altfmt) /* Print opcode by type */ switch (i_ptr->type) { case TYPE_01: - /* OP , , {, #} SF32/64 - OP , , #{, } SF32/64 */ + /* + * OP , , {, #} SF32/64 + * OP , , #{, } SF32/64 + */ /* Mandatory tokens */ ret = arm64_disasm_read_token(i_ptr, insn, "RD", &rd); ret |= arm64_disasm_read_token(i_ptr, insn, "RN", &rn); if (ret != 0) { - printf("ERROR: Missing mandatory token for op %s type %d\n", + printf("ERROR: " + "Missing mandatory token for op %s type %d\n", i_ptr->name, i_ptr->type); goto undefined; } @@ -420,15 +436,18 @@ disasm(const struct disasm_interface *di, vm_offset_t loc, int altfmt) } break; case TYPE_02: - /* OP , [, #]{!}] SF32/64 - OP , [], #{!} SF32/64 - OP , , {, EXTEND AMOUNT } */ + /* + * OP , [, #]{!}] SF32/64 + * OP , [], #{!} SF32/64 + * OP , , {, EXTEND AMOUNT } + */ /* Mandatory tokens */ ret = arm64_disasm_read_token(i_ptr, insn, "RT", &rt); ret |= arm64_disasm_read_token(i_ptr, insn, "RN", &rn); if (ret != 0) { - printf("ERROR: Missing mandatory token for op %s type %d\n", + printf("ERROR: " + "Missing mandatory token for op %s type %d\n", i_ptr->name, i_ptr->type); goto undefined; } @@ -464,7 +483,8 @@ disasm(const struct disasm_interface *di, vm_offset_t loc, int altfmt) break; } - di->di_printf("%s\t%s, ", i_ptr->name, arm64_reg(sf, rt)); + di->di_printf("%s\t%s, ", i_ptr->name, + arm64_reg(sf, rt)); if (inside != 0) { di->di_printf("[%s", arm64_reg(1, rn)); if (imm != 0) @@ -516,7 +536,8 @@ disasm(const struct disasm_interface *di, vm_offset_t loc, int altfmt) /* Mandatory tokens */ ret = arm64_disasm_read_token(i_ptr, insn, "RT", &rt); if (ret != 0) { - printf("ERROR: Missing mandatory token for op %s type %d\n", + printf("ERROR: " + "Missing mandatory token for op %s type %d\n", i_ptr->name, i_ptr->type); goto undefined; } @@ -533,13 +554,13 @@ disasm(const struct disasm_interface *di, vm_offset_t loc, int altfmt) } di->di_printf("\n"); - return(loc + INSN_SIZE); + return (loc + INSN_SIZE); undefined: di->di_printf("undefined\t%08x\n", insn); - return(loc + INSN_SIZE); + return (loc + INSN_SIZE); } /* Parse format strings at the very beginning */ -SYSINIT(arm64_disasm_generate_masks, SI_SUB_DDB_SERVICES, - SI_ORDER_FIRST, arm64_disasm_generate_masks, arm64_i); +SYSINIT(arm64_disasm_generate_masks, SI_SUB_DDB_SERVICES, SI_ORDER_FIRST, + arm64_disasm_generate_masks, arm64_i); From nobody Fri Jun 9 19:57:55 2023 X-Original-To: dev-commits-src-branches@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 4QdBhM5xvWz4cK2g; Fri, 9 Jun 2023 19:57:55 +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 4QdBhM5DhJz4HmQ; Fri, 9 Jun 2023 19:57:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686340675; 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=QwLMzi52SaOBnDu2yA4F8AEbdBnMsOxk7ceX8VX5owY=; b=woi6fqfdaCsJ+YzJJ/nS+zRqQNgF9RrXkFP37tLcEDw1BZ3MtGEnM7iIXrTQV9kHhO0Ofx vZeYsPt55D9jAKMwl3hoI+on+RYGcjMLGrYxHNa2hytl55/2630adjLTceWgdT9jM4uDuK i4ANCOJDizC2jIBMZkICEHNkAIrjl7z+0H3I+P5P3kBL3CgmqvbiO3OMQf34WgFUXYBwIo P7kp6tbqelebMbOcqTdtsIQDH+OXSWkUMnjPKdtoi+Nc4sU4DEFAZ2lTn+hLW/5uKjleFu GSdkan/XheNT5mVr6BB4+3SCLUg4DudmLi0X4S4UUq77WDMuYiTFU9yT3310OQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686340675; 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=QwLMzi52SaOBnDu2yA4F8AEbdBnMsOxk7ceX8VX5owY=; b=JSxCKPHgLLTyidaPcwcaXM1BwEpA7msX+FLlSui5Vi0B95YgFSQQPQ6HHL/KpvCHRSAfqe Z34xxuM18I6R/CZIq8Z26CdJIdvOdmiMCWqqbCO4sYieUxu0RovO16YNQDBWs80iq9LZuK gGGVuQBhso2JQBGHAjoPtT45/LnmgFWnC78UqvmYfFXKm5U9MPo96rR8fEBORwQ8dsyhiX z/1Kd7pIB5FCejRF3NvGZ+JFebkZ8+B3Su82c+BJrNF3x9Z/cMPMstDZtD8bNPJDIQtTrM 2kgZWeS2+rtv4MqpyY+TOVd+l/FJK5Mvi/G3Ywi8Ha9OXrmijXojovvdFUqzSw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686340675; a=rsa-sha256; cv=none; b=KxjvZGdZE6xKARgI5vAj18D0/AC8ChHyRbiat9KdsJ6fGj9hHSQBoNyuMSK3B5gysCOQ9A rLaSDQXVzDUUT5g6htDO3sjXc8TEx5T3QUFFwC1A5XuMfCGKlUQPEYq7R3jYuzJauZz28i 3dLN9F2mXMhDP2eUbkhjLyUoFKyhyNTF1XscRWA7f5Dsv8AGPOhJZpc2HLaOu2xhor9h0f HLSk/jFHrrxBCoITU+f3kWqYNkY96bwslrxcr9hv6LG8xBMBtkUgIwdO4aQ0fkyVJ5QODA rNpvo/GcPBpVJeUDdPFbO8e/A9k/ARB6GxkfEFiO9JuwuP6+l0PhcMtg9m/Maw== 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 4QdBhM42z7zndv; Fri, 9 Jun 2023 19:57:55 +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 359Jvtgn071904; Fri, 9 Jun 2023 19:57:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 359Jvtoh071903; Fri, 9 Jun 2023 19:57:55 GMT (envelope-from git) Date: Fri, 9 Jun 2023 19:57:55 GMT Message-Id: <202306091957.359Jvtoh071903@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: bf64c283250a - stable/13 - arm64/disassem.c: Add support str/strb/strh instructions List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: bf64c283250a1ac7023e497a09ed2e36be3cae33 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=bf64c283250a1ac7023e497a09ed2e36be3cae33 commit bf64c283250a1ac7023e497a09ed2e36be3cae33 Author: Mykola Hohsadze AuthorDate: 2023-04-18 15:51:15 +0000 Commit: Mitchell Horne CommitDate: 2023-06-09 18:14:58 +0000 arm64/disassem.c: Add support str/strb/strh instructions Added disassembly support for each type of str/strb/strh instruction encoding. Reviewed by: mhorne MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D39336 (cherry picked from commit 7edb7adf8c8b0615c6d845ca789d4f527f8b18a3) --- sys/arm64/arm64/disassem.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/sys/arm64/arm64/disassem.c b/sys/arm64/arm64/disassem.c index 681164011b40..ea6193655a5f 100644 --- a/sys/arm64/arm64/disassem.c +++ b/sys/arm64/arm64/disassem.c @@ -187,6 +187,24 @@ static struct arm64_insn arm64_i[] = { TYPE_02, 0 }, /* ldrsw register */ { "ldrsw", "10011000|IMM(19)|RT(5)", TYPE_03, OP_SIGN_EXT | OP_LITERAL | OP_MULT_4 }, /* ldr literal */ + { "str", "1|SF(1)|111000000|IMM(9)|OPTION(2)|RN(5)|RT(5)", + TYPE_02, OP_SIGN_EXT }, /* str immediate post/pre index */ + { "str", "1|SF(1)|11100100|IMM(12)|RN(5)|RT(5)", + TYPE_02, 0 }, /* str immediate unsigned */ + { "str", "1|SF(1)|111000001|RM(5)|OPTION(3)|SCALE(1)|10|RN(5)|RT(5)", + TYPE_02, 0 }, /* str register */ + { "strb", "00111000000|IMM(9)|OPTION(2)|RN(5)|RT(5)", + TYPE_02, OP_SIGN_EXT | OP_SF32 }, /* strb immediate post/pre index */ + { "strb", "0011100100|IMM(12)|RN(5)|RT(5)", + TYPE_02, OP_SF32 }, /* strb immediate unsigned */ + { "strb", "00111000001|RM(5)|OPTION(3)|SCALE(1)|10|RN(5)|RT(5)", + TYPE_02, OP_SF32 }, /* strb register */ + { "strh", "01111000000|IMM(9)|OPTION(2)|RN(5)|RT(5)", + TYPE_02, OP_SF32 | OP_SIGN_EXT }, /* strh immediate post/pre index */ + { "strh", "0111100100|IMM(12)|RN(5)|RT(5)", + TYPE_02, OP_SF32 }, /* immediate unsigned */ + { "strh", "01111000001|RM(5)|OPTION(3)|SCALE(1)|10|RN(5)|RT(5)", + TYPE_02, OP_SF32 }, /* strh register */ { NULL, NULL } }; From nobody Fri Jun 9 19:57:56 2023 X-Original-To: dev-commits-src-branches@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 4QdBhN6fdtz4cKSJ; Fri, 9 Jun 2023 19:57:56 +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 4QdBhN5lDsz4Hq3; Fri, 9 Jun 2023 19:57:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686340676; 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=CmLOvs3Gg8KfbkmSw7C+oMnc0qz7Z/BxCsB1yoNzZPY=; b=uTbn1o/6dtH0TvedSIohvZidWfl+Y1gVWUVhAoBDI4NeGT/VUNZomA3wz+sqOq8XH/if9o wrrSGaoPGaoY0QDaejhbwecoOcg5Jymwx+2484GAglP9Bb3XV3XyZ5h2X6aGnycjv0UtxM NefRor6bngsAF3p2cPSKuxWj14t6SqcY65ZVYZ4F5JoprwarFtE6vHIeJuNPf2vj/PjD01 yh/1K30nt40Js5n99zxrn2s8uX2kV/WjmNmDB6x23g8tekIMLgTk2AX7Jk/cmv1TIcGEhc dDISocoiE4LRQ1XypzsbgqJ/OSLmsgAyjY8yxOOCWGxlxyHcFUmhswcYa4Iuvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686340676; 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=CmLOvs3Gg8KfbkmSw7C+oMnc0qz7Z/BxCsB1yoNzZPY=; b=BnVpOiBDCFDnxJncsilAG2EZjaqrojRfJCovE7PrkAcdviVxnUEnxt2Gg/hwGjxKVgzsP6 JhYktlWZZNE1ltYfsnrhjR7HGIH2flOSo+PcU4E7B4pw6R5xmtZCSQk3/ld/58BBpXldMY 7TvyLVYZXg54AFOGtkgCoO+3Hk3s0thLRNsYtsl9UVl7M7vAE9DItLzZLgr+ZlTzjfavyT nLTEQwqT2tiPsdkUKy9s9G+qACrgrtpzQdaA5uQOgpH4ZeGjvJt9/3w0u57B/Xb7EiULBs h31zT8qszh47j9VD8Uiq6fQtGqY4rE5g1cBlMf7zrta05uFSRNirDVeaYc0WJg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686340676; a=rsa-sha256; cv=none; b=VWZ7bbbPXWffSxVrUhGF04R2AsOivt2fPmhLXB2idNq6UjWRvWN/Ln4J+s0obPMMzkM1a9 DJYgnRzM73YtwndRcQzrMJ0CGF76jSY1jpL4wWPzjgAgeIDWiurXwYzZxjxCjHLmWtwWnN cd9E2aTfJH2Ty+Q1cZtFc45tC369g/i7yPlboWaX6KLECLHH8dKuL5FXv3UMRQk1KSGoEg BznEgrdvQW8TJV61twheduM7opwXGErokVP1KUBmcc0+rwl+72JjdrosUitlmLdEKWXNP/ ulYjG54KQoOyf9l1BXI+pBLGYgqdKKhSj7BjSXlFRXN0r8RCumJm5VSJ13jarQ== 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 4QdBhN4mYNznwt; Fri, 9 Jun 2023 19:57:56 +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 359JvukV071923; Fri, 9 Jun 2023 19:57:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 359JvuYO071922; Fri, 9 Jun 2023 19:57:56 GMT (envelope-from git) Date: Fri, 9 Jun 2023 19:57:56 GMT Message-Id: <202306091957.359JvuYO071922@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 6cc69b793bbd - stable/13 - arm64/disassem.c: Fix typo sxts to sxts and amount for TYPE_02 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6cc69b793bbd761ec04eee0b379392dd75f09351 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=6cc69b793bbd761ec04eee0b379392dd75f09351 commit 6cc69b793bbd761ec04eee0b379392dd75f09351 Author: Mykola Hohsadze AuthorDate: 2023-04-18 15:50:58 +0000 Commit: Mitchell Horne CommitDate: 2023-06-09 18:14:58 +0000 arm64/disassem.c: Fix typo sxts to sxts and amount for TYPE_02 The current implementation is wrong, since it unconditionally sets the amount equal to the field of the instruction. However, when the bit (scale) is not set, it must be zero. Also fix a typo, sxts to sxtx, according to the Arm64 documentation. Reviewed by: mhorne MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D39334 (cherry picked from commit cb923f03faa068f0c8ed5ffa7c3485ad7918be10) --- sys/arm64/arm64/disassem.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/sys/arm64/arm64/disassem.c b/sys/arm64/arm64/disassem.c index ea6193655a5f..0f7b040e7b06 100644 --- a/sys/arm64/arm64/disassem.c +++ b/sys/arm64/arm64/disassem.c @@ -521,9 +521,13 @@ disasm(const struct disasm_interface *di, vm_offset_t loc, int altfmt) arm64_reg(sf, rt), arm64_reg(1, rn), arm64_reg(option & 1, rm)); - /* Calculate amount, it's op(31:30) */ - amount = (insn >> ARM_INSN_SIZE_OFFSET) & - ARM_INSN_SIZE_MASK; + if (scale == 0) + amount = 0; + else { + /* Calculate amount, it's op(31:30) */ + amount = (insn >> ARM_INSN_SIZE_OFFSET) & + ARM_INSN_SIZE_MASK; + } switch (option) { case 0x2: @@ -537,7 +541,7 @@ disasm(const struct disasm_interface *di, vm_offset_t loc, int altfmt) di->di_printf(", sxtw #%d", amount); break; case 0x7: - di->di_printf(", sxts #%d", amount); + di->di_printf(", sxtx #%d", amount); break; default: di->di_printf(", RSVD"); From nobody Fri Jun 9 19:57:57 2023 X-Original-To: dev-commits-src-branches@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 4QdBhP71q2z4cKSM; Fri, 9 Jun 2023 19:57:57 +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 4QdBhP6T7Tz4Hkq; Fri, 9 Jun 2023 19:57:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686340677; 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=5lGZDiEfOhrljWSVN6IxnzfQDxPtduWeuvH5bbju1+4=; b=hUzwdFfVRwfmUUtEYdfaH8sjh9u/WilmS+jRfbmYxIvL9nc6sV4BksvJfPNKPnt6KA4/51 2LlEP6qY4v3c5muPcdzdkK5FbLfROz2fsbp82TroJzGeLx5yV+CanjLxREYWxcneTULBtb raly2AU2bTmWTO2vPf4cj9S5g6gWefUT2MYeB5VPYYRD46SbU9f6OVGj+ORq76pnlA3p6D 2KU1r2W2XL8ptESjyS65uIR2TEH4dyXPj7P423A5xwIC4r+NiilJnWkEcOpv/lepwujKYq DqUqukY4l1qXfaIM5DCKzLJTdyvHU+Zl3eJSwowL/RHawQLAceRcHc1Bz6nRdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686340677; 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=5lGZDiEfOhrljWSVN6IxnzfQDxPtduWeuvH5bbju1+4=; b=OqHclqlCdyK+7cC1uK0vHZ9Nml6kIov0KIjPY92SPLdlMbmKilGbvwROnDsUOrkml34EwU IJoaseONxp+L+r2P68MHnKDxHlZdFSw+6brP8tVeIUIr2dUGdqn8adPvyiQfy/Ka9LR9lh 99pbaoeQoC0bqdW3Knk3Fn5uWaIz0DHT0xv+GpBQDdpuS2nAkdbjgQEjM7DU3Ar3kHZf8z 6mKe5ONc0lEU3zZ5BOienCr49CLdPPmuX9HnFJhGxz/tGONKfpO1e1ftKQ+xcQ67+gW0LY sLmTrWGkdcQKe6uNybj7JnNxn23R7j6CIIwPPorvPQf6WQFGXaKl1jQEIA5XuA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686340677; a=rsa-sha256; cv=none; b=XEg9GgRGpj29EBHgItvqYU9cpxk6/KhO/Zuwe+Cy5ZESX43IiS6JLq8DxufR8YCz3KkFMy NX4WTW282Qi9Uz5F08Np7RDkOKa2t/vIG7JQQ+gmwwJJo03shpZABudl2BQbW/qVoH7suk oqGG67XRjdsn9lcHWtsflRZToiPqQdC5EqM2YF/6kTbAfQEA9dzdLbRalTMjlFwoV6Fb1W +H8rF6pwvCgkjDmicwgYPIeqZBiu/90XDPoqGml8Llq1U6ZDW9es6VuPSDZzVY5r2EpYZr 5mSSsubzZu3dXMqeuugK64GHHBzJSNK2hjrYB+mJQSVwjr7DDPtmm0UQPZRVyQ== 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 4QdBhP5RSGzndw; Fri, 9 Jun 2023 19:57:57 +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 359Jvvjq071952; Fri, 9 Jun 2023 19:57:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 359JvvWJ071951; Fri, 9 Jun 2023 19:57:57 GMT (envelope-from git) Date: Fri, 9 Jun 2023 19:57:57 GMT Message-Id: <202306091957.359JvvWJ071951@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: fd9ce8745f64 - stable/13 - printf(9): clarify the description of %b List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: fd9ce8745f643e718014ca301e63c07bad1595d9 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=fd9ce8745f643e718014ca301e63c07bad1595d9 commit fd9ce8745f643e718014ca301e63c07bad1595d9 Author: Mitchell Horne AuthorDate: 2023-04-25 20:26:36 +0000 Commit: Mitchell Horne CommitDate: 2023-06-09 18:14:58 +0000 printf(9): clarify the description of %b The bit values are numbers given in octal representation, not decimal, as one might assume from the description. Same goes for the base, although this has an example. Reviewed by: emaste MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D39815 (cherry picked from commit 82bc33d5ad2e00179ea7026c496a35b00550da15) --- share/man/man9/printf.9 | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/share/man/man9/printf.9 b/share/man/man9/printf.9 index 33347fb135ca..631701e455cf 100644 --- a/share/man/man9/printf.9 +++ b/share/man/man9/printf.9 @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 14, 2023 +.Dd April 25, 2023 .Dt PRINTF 9 .Os .Sh NAME @@ -94,11 +94,13 @@ and a These are used as a register value and a print mask for decoding bitmasks. The print mask is made up of two parts: the base and the arguments. -The base value is the output base expressed as an integer value; +The base value is the output base (radix) expressed as an octal value; for example, \e10 gives octal and \e20 gives hexadecimal. The arguments are made up of a sequence of bit identifiers. -Each bit identifier begins with an integer value which is the number of the -bit (starting from 1) this identifier describes. +Each bit identifier begins with an +.Em octal +value which is the number of the bit (starting from 1) this identifier +describes. The rest of the identifier is a string of characters containing the name of the bit. The string is terminated by either the bit number at the start of the next From nobody Fri Jun 9 19:57:58 2023 X-Original-To: dev-commits-src-branches@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 4QdBhR1xvRz4cKBY; Fri, 9 Jun 2023 19:57:59 +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 4QdBhR0DMLz4J3v; Fri, 9 Jun 2023 19:57:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686340679; 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=W3IOK5rY7oODbW+IFHORQdaVcUjYg8CedtYxZa6I3UQ=; b=T7NRXzU0dj9fvNlfIUqtdGJbqoc+hxFRwWUrGhFAMU6wq8VRQOIEr6hgIpisld2YenIzp2 O+mYJuF7vpzBJ1B1Mu6Pi8a+vgCjDsED/MLULPtSpBk4W0alBpe0WjcfLxc/r5nHXOED4P rMLFgVC4brEzWhWCfFl4uKGyW648NfDhFlG8b2W4FDAQ8QZqybpMU8C2RjtkTU5jaGRW9G JmkSzyjja4+cAoTgmKIqlVIuj4zEAKidSRuDyYe3+PaBMJnySM7lrmWvpgDN2fnMpVqsfO 7vKQEwH2Bt8iIQ8MbRtCT7KzH2xKOKetEg4MWsBEhS/u/ZBUooJHPEeTSfKa9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686340679; 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=W3IOK5rY7oODbW+IFHORQdaVcUjYg8CedtYxZa6I3UQ=; b=qk3xMU2Rpxz9ffZBiMCBvETkp+5YiRRWIjSCkylwg9di8C76fPCIP/QH2LYdAQiN7eLhO8 j8ZFD0dlI2A6LTRd5PYCbd86Mi/dN/plEmoHW6M/PRK0R38TkYlt+MyCUuP4T7v6elrjvb hqtkXbh+Pue016lVMfXWvYupCWUDanAL7FRTEXFOa4UAlKa2s5tDXut/E6cTQTg46hh3k3 QXZuZkXzRfdKt/be3sw5eObnLkY4DsEA7digrd3NamwZ4zzpVRZaGN2Rx43wcjq5zjwXvz DohspNJ2QxQ07j2pYVk0YcOvfgc0LroAnlX7TunbAWwnHmk4R+Vm5oD50XoYhg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686340679; a=rsa-sha256; cv=none; b=PAnxYrrRvjzzIo6w/Yh02fm/MK/u4Dx5khdz6dkFqheZ9USlYJkJQ0QlMDga3WZjqTO2pA 0Kra5mDdAslcMRbgkoAoOabsqiyUJr8h9a7I7+riOx5DE9URQLAnUC3PZwy4fCNGIDiaVa 8UIuF297vbBbhEbMvIAN7HihzPsdrKYRRoIHVCT4aC5DQbaY+Qwedam5RtDqiU8Y3Xp9mx Jy2oQVtlP8QSTlvWMoVfZS3r66u35lYkNxlc8vqW2y84xUCvPglwRcDxfo6kcGK5AjEQXS rMvd9Cvdc45Bh2DfagKSXiBidADNFI9X88++e6fgoUzR/tl28UCxBgNOuSkAYw== 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 4QdBhQ6Ddgzndx; Fri, 9 Jun 2023 19:57:58 +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 359JvwAK071979; Fri, 9 Jun 2023 19:57:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 359JvwKI071978; Fri, 9 Jun 2023 19:57:58 GMT (envelope-from git) Date: Fri, 9 Jun 2023 19:57:58 GMT Message-Id: <202306091957.359JvwKI071978@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 36d68e55b2f7 - stable/13 - hwpmc: drop vestigial IAP event definitions List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 36d68e55b2f79983ebdc38fdb8445fa43887cb1f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=36d68e55b2f79983ebdc38fdb8445fa43887cb1f commit 36d68e55b2f79983ebdc38fdb8445fa43887cb1f Author: Mitchell Horne AuthorDate: 2023-05-05 21:55:54 +0000 Commit: Mitchell Horne CommitDate: 2023-06-09 18:14:58 +0000 hwpmc: drop vestigial IAP event definitions These are maintained elsewhere. No functional change. Reviewed by: jkoshy MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D39900 (cherry picked from commit 1be8ef26794dcf93e2f4851474808dc3b34dbcbd) --- sys/dev/hwpmc/pmc_events.h | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/sys/dev/hwpmc/pmc_events.h b/sys/dev/hwpmc/pmc_events.h index 6a727c6e7f25..355c206ed610 100644 --- a/sys/dev/hwpmc/pmc_events.h +++ b/sys/dev/hwpmc/pmc_events.h @@ -204,22 +204,6 @@ __PMC_EV_ALIAS("instruction-retired", IAF_INSTR_RETIRED_ANY) \ __PMC_EV_ALIAS("unhalted-core-cycles", IAF_CPU_CLK_UNHALTED_CORE) \ __PMC_EV_ALIAS("unhalted-reference-cycles", IAF_CPU_CLK_UNHALTED_REF) - -#define PMC_EV_IAP_FIRST PMC_EV_IAP_ARCH_BR_INS_RET -#define PMC_EV_IAP_LAST PMC_EV_IAP_EVENT_FDH_40H - -/* - * Map "architectural" event names to event ids. - */ -#define __PMC_EV_ALIAS_INTEL_ARCHITECTURAL() \ -__PMC_EV_ALIAS("branch-instruction-retired", IAP_ARCH_BR_INS_RET) \ -__PMC_EV_ALIAS("branch-misses-retired", IAP_ARCH_BR_MIS_RET) \ -__PMC_EV_ALIAS("instruction-retired", IAP_ARCH_INS_RET) \ -__PMC_EV_ALIAS("llc-misses", IAP_ARCH_LLC_MIS) \ -__PMC_EV_ALIAS("llc-reference", IAP_ARCH_LLC_REF) \ -__PMC_EV_ALIAS("unhalted-reference-cycles", IAP_ARCH_UNH_REF_CYC) \ -__PMC_EV_ALIAS("unhalted-core-cycles", IAP_ARCH_UNH_COR_CYC) - #define __PMC_EV_UCP() \ __PMC_EV(UCP, EVENT_0CH_04H_E) \ __PMC_EV(UCP, EVENT_0CH_04H_F) \ From nobody Fri Jun 9 19:57:59 2023 X-Original-To: dev-commits-src-branches@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 4QdBhS262kz4cKYB; Fri, 9 Jun 2023 19:58:00 +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 4QdBhS0yT5z4Hld; Fri, 9 Jun 2023 19:58:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686340680; 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=z7buBk9RKzKqWogLmIW1alIgZxJ8rBG7hXlEZNtfyeQ=; b=W3iN6U+QCkrNV5Sl/XRT/YFJtt8SpL3RahD8ZEMFDb0eJK3WCNNO8U1QrRttLLZzy72WQh CtIO+byMQN5GIMIZYdmpSTKebIzEdX9rjb+rlh5kuJILiYuZrl8ayJBPXdv4S+bj4psTKV O20fWaTzs4zFW7+nOSbbCb+hnXl7wc4CaPvAZhx2UBdqyhI5oUrXPJOUoxHLvUbOYs2yV6 2WN1gQcFTJlfNwkM+3wQDd3NPCXv6jPGiCwRUNgHprpCCOh5TutV9lsm/WubE3337m3A/6 ABroPKSbbhpull3ApvVDJBCPTgjF0EVM1geG7S/MXnyj9icKLJ8TuMGpztgjVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686340680; 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=z7buBk9RKzKqWogLmIW1alIgZxJ8rBG7hXlEZNtfyeQ=; b=cUaLsWEioEPnaoctK11tAbkxhPtFuaskXeAETaB90l/KxinTeKgMIF+TcdR17sxVLEVqMm wYZiOBMhVQrrOIqxTE1s8x0SqZryUTnuFLCf2CbAcgfiODdKS/6JYn1qUUoxG1Xzwos8Tg naf0HCq90eeQuQKK0Cf9TSpQSqza3l9tGHoLBkuzb262hxJGE3fujdkdjyy+yR4uKxzx/N YHZq0xfj5lw+WsQ9VJ7s8EOJCqqms8LeOOwFl4dlEKN541Ovg6+ZMqudu+MjJ3KgBM/qhx gNui+OBsDDn2Mnf4F6BpAwUpuSxGxRPZniIl3w+MjSEQDrrFRIeLNMIdgjPPHw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686340680; a=rsa-sha256; cv=none; b=USGsiOYRukKAwzCQ6TECUNKiJiCgnV6RXokCKeSah9Ul61fiSPffjDd7/xn3TwNkRruEWI WHKJcUsdebP6se+jhW1olbQE8BP3iQEkPcVjLBQIWpFGDyf2t5Zk9ktUrGEspZaVb1AROX Kqbl0qwzKmS+JYIUJUqAae7JXIzGOMvFQbvrYzPwTZ9M+Tmfx4KrmLDQsI3noYW8xW+zNC Ub/QAzP7hS3A/nngv6JphmNx7E3VPcAgqHzJEfUswySxR4B18TPNDapPKy+qdWhxtE8nRd EAZoG/evQO1uUBx7FRof/GD133Bo9459EL3G2/Ux7Yq1oaCHOWhcBumoPxQozQ== 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 4QdBhS02Hnznmp; Fri, 9 Jun 2023 19:58:00 +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 359Jvx61071998; Fri, 9 Jun 2023 19:57:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 359Jvxf0071997; Fri, 9 Jun 2023 19:57:59 GMT (envelope-from git) Date: Fri, 9 Jun 2023 19:57:59 GMT Message-Id: <202306091957.359Jvxf0071997@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 0ebcec2b02e6 - stable/13 - hwpmc: remove remaining UCP event definitions List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0ebcec2b02e649e7f5a4eaba28eba6962e902272 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=0ebcec2b02e649e7f5a4eaba28eba6962e902272 commit 0ebcec2b02e649e7f5a4eaba28eba6962e902272 Author: Mitchell Horne AuthorDate: 2023-05-05 21:56:34 +0000 Commit: Mitchell Horne CommitDate: 2023-06-09 18:14:58 +0000 hwpmc: remove remaining UCP event definitions Although this block has remained in __PMC_EVENTS(), there is no handling of UCP in libpmc/libpmc.c, so it is not possible to select one of these events. It should therefore be impossible to trigger the code removed from ucp_start_pmc(). Note that the GQ_SNOOP_MSF MSR exists only for Nehalem and Westmere architectures, and the related events do not exist for later generations. The Uncore support in hwpmc has severely atrophied in general. We have uncore event definitions in pmu-events, but the kernel support was written against Intel Performance Measurement Architecture version 2, and is disabled for processor generations later than Westmere. Nehalem and Westmere lack uncore event definitions in pmu-events. I'd be surprised if Uncore support is usable on any machine in its current state. Reviewed by: jkoshy MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D39901 (cherry picked from commit d71a439020721a9abea5c353b9e03b5dc29d253e) --- sys/dev/hwpmc/hwpmc_uncore.c | 21 --------------------- sys/dev/hwpmc/pmc_events.h | 12 ------------ 2 files changed, 33 deletions(-) diff --git a/sys/dev/hwpmc/hwpmc_uncore.c b/sys/dev/hwpmc/hwpmc_uncore.c index 0d9085564c2a..c9ae128b55cf 100644 --- a/sys/dev/hwpmc/hwpmc_uncore.c +++ b/sys/dev/hwpmc/hwpmc_uncore.c @@ -671,27 +671,6 @@ ucp_start_pmc(int cpu, int ri) "ucp-start/2 cpu=%d ri=%d evselmsr=0x%x evsel=0x%x", cpu, ri, SELECTSEL(uncore_cputype) + ri, evsel); - /* Event specific configuration. */ - switch (pm->pm_event) { - case PMC_EV_UCP_EVENT_0CH_04H_E: - case PMC_EV_UCP_EVENT_0CH_08H_E: - wrmsr(MSR_GQ_SNOOP_MESF,0x2); - break; - case PMC_EV_UCP_EVENT_0CH_04H_F: - case PMC_EV_UCP_EVENT_0CH_08H_F: - wrmsr(MSR_GQ_SNOOP_MESF,0x8); - break; - case PMC_EV_UCP_EVENT_0CH_04H_M: - case PMC_EV_UCP_EVENT_0CH_08H_M: - wrmsr(MSR_GQ_SNOOP_MESF,0x1); - break; - case PMC_EV_UCP_EVENT_0CH_04H_S: - case PMC_EV_UCP_EVENT_0CH_08H_S: - wrmsr(MSR_GQ_SNOOP_MESF,0x4); - break; - default: - break; - } wrmsr(SELECTSEL(uncore_cputype) + ri, evsel); cc->pc_globalctrl |= (1ULL << ri); diff --git a/sys/dev/hwpmc/pmc_events.h b/sys/dev/hwpmc/pmc_events.h index 355c206ed610..3873ca5ac0ca 100644 --- a/sys/dev/hwpmc/pmc_events.h +++ b/sys/dev/hwpmc/pmc_events.h @@ -204,16 +204,6 @@ __PMC_EV_ALIAS("instruction-retired", IAF_INSTR_RETIRED_ANY) \ __PMC_EV_ALIAS("unhalted-core-cycles", IAF_CPU_CLK_UNHALTED_CORE) \ __PMC_EV_ALIAS("unhalted-reference-cycles", IAF_CPU_CLK_UNHALTED_REF) -#define __PMC_EV_UCP() \ - __PMC_EV(UCP, EVENT_0CH_04H_E) \ - __PMC_EV(UCP, EVENT_0CH_04H_F) \ - __PMC_EV(UCP, EVENT_0CH_04H_M) \ - __PMC_EV(UCP, EVENT_0CH_04H_S) \ - __PMC_EV(UCP, EVENT_0CH_08H_E) \ - __PMC_EV(UCP, EVENT_0CH_08H_F) \ - __PMC_EV(UCP, EVENT_0CH_08H_M) \ - __PMC_EV(UCP, EVENT_0CH_08H_S) \ - /* * ARMv7 Events */ @@ -1870,8 +1860,6 @@ __PMC_EV_ALIAS("unhalted-reference-cycles", IAF_CPU_CLK_UNHALTED_REF) __PMC_EV_MIPS74K() \ __PMC_EV_BLOCK(BERI, 0x11600) \ __PMC_EV_BERI() \ - __PMC_EV_BLOCK(UCP, 0x12080) \ - __PMC_EV_UCP() \ __PMC_EV_BLOCK(PPC7450, 0x13000) \ __PMC_EV_PPC7450() \ __PMC_EV_BLOCK(PPC970, 0x13100) \ From nobody Fri Jun 9 19:58:00 2023 X-Original-To: dev-commits-src-branches@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 4QdBhT2P6rz4cKSY; Fri, 9 Jun 2023 19:58:01 +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 4QdBhT1cKmz4J9K; Fri, 9 Jun 2023 19:58:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686340681; 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=PH9xrwhwHaPpB+QxCyzjHMQNSL5jZ8LGlPO7NOMT5hI=; b=btD1bqFsvVGfmhG9EGWM9j6nriyPnJ70aYmh1JhhbZvJJqHUv2h/k/nsvb9d3m2VrZxjm2 QN+nz5DFyNJzJ7+GDuMsTowtRhOU5uJqIFH3dpId9FacUeh9GgAu5g+rMqTEC8I1ylQBYn axjCcwffm/epxW799Zy2GnsjRGB8lh2ek5OFYDY+HqwbIM1pfDTyNeuWdTUte+ybsCizhC tzCL3gEwfyXSZjAy6pzoKNRpMXtWdOdUHqiW7hJvzRhFFxq4Dem+5hf0cGqxp5vDi2yp5Y xfm41cNFAouYEM7Hn7+yMKV6h5NXwK0iHApmR51rYWHDguAVpwt0fP9Kw1TXCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686340681; 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=PH9xrwhwHaPpB+QxCyzjHMQNSL5jZ8LGlPO7NOMT5hI=; b=eDMO/V+pNoPf7wOYZukw5iqqqznGOq7fe/zLbis7lJo2l9W/5TEFyDl5vHgBS/fPh09W3P IdS40IPjfPqJkXFP209hP5utCAlgB68Wc6LFpFDqedHNHagcntCHFqhOsO0sDHNSSLGSCm mLBU26Cu913Rr5YT8903FcxELeXoIklA/QeyhElhe7bLlebB5uhg8bl7JiM7ruV1tdII9q jxS7jp8bKBXnAmIWLRUS/HDb/lfCNAFQqry3UdmvcUwUnHAu2v9PQ+aFHKnA+hnY9bt8aM n/UrLQVCpFVtr9FwYa97GLhxpiAFl9TB3KSXyr9JwV8fdsj5fAQHYnMKkBWlZw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686340681; a=rsa-sha256; cv=none; b=URjHCUswGN//Ja7UsIqzSmVVvmarFHbt0/EsfptRbddmF8CSv5mP0SxIP92LtzYr+FgPzq Gi05ZjydTYv8/ygKBS0FZC6aI2286XGjLgcIlkzjqB2POG2+C1jxcT032TX0bx0cq8nkFD NO455JL3AeQZMNaETN0c2y+D15XGxtF80yD3WPZhYoH2rryf4VRY9jkvvcwDL25072J5Li R1shoc4wTnrofS8rDOEZk6DBXDoJ51lCZo08QmyWCZeY5OmkcJgug/sfdHfr+Pn++tjhJ2 i4/8kkXLmIHWKsLMJ1i2cWRXJzl2/LD9opt40rcTZ1jfIbLF/y6Av3QRqAZtIg== 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 4QdBhT0gl5zp00; Fri, 9 Jun 2023 19:58:01 +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 359Jw0ON072025; Fri, 9 Jun 2023 19:58:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 359Jw0Vp072024; Fri, 9 Jun 2023 19:58:00 GMT (envelope-from git) Date: Fri, 9 Jun 2023 19:58:00 GMT Message-Id: <202306091958.359Jw0Vp072024@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 009c4909bafe - stable/13 - pmc_events.h: update event list comment List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 009c4909bafea9f03a3692d5cc862e814e80e7b2 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=009c4909bafea9f03a3692d5cc862e814e80e7b2 commit 009c4909bafea9f03a3692d5cc862e814e80e7b2 Author: Mitchell Horne AuthorDate: 2023-05-05 21:56:55 +0000 Commit: Mitchell Horne CommitDate: 2023-06-09 18:14:58 +0000 pmc_events.h: update event list comment This comment is no longer in sync with the contents of __PMC_EVENTS(). Update to reflect the removal of various Intel event definitions from this list; these event definitions now come from Linux and live in lib/libpmc/pmu-events/. Reviewed by: jkoshy MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D39902 (cherry picked from commit 6bdf067890ed1d1515ad0dbd105848bb11711210) --- sys/dev/hwpmc/pmc_events.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/dev/hwpmc/pmc_events.h b/sys/dev/hwpmc/pmc_events.h index 3873ca5ac0ca..7a3ef832b47c 100644 --- a/sys/dev/hwpmc/pmc_events.h +++ b/sys/dev/hwpmc/pmc_events.h @@ -1826,10 +1826,10 @@ __PMC_EV_ALIAS("unhalted-reference-cycles", IAF_CPU_CLK_UNHALTED_REF) * 0x2000 0x0080 AMD K7 events * 0x2080 0x0100 AMD K8 events * 0x10000 0x0080 INTEL architectural fixed-function events - * 0x10080 0x0F80 INTEL architectural programmable events - * 0x11000 0x0080 INTEL Pentium 4 events - * 0x11080 0x0080 INTEL Pentium MMX events - * 0x11100 0x0100 INTEL Pentium Pro/P-II/P-III/Pentium-M events + * 0x10080 0x0F80 free (was INTEL architectural programmable events) + * 0x11000 0x0080 free (was INTEL Pentium 4 events) + * 0x11080 0x0080 free (was INTEL Pentium MMX events) + * 0x11100 0x0100 free (was INTEL Pentium Pro/P-II/P-III/Pentium-M events) * 0x11200 0x00FF free (was INTEL XScale events) * 0x11300 0x00FF MIPS 24K events * 0x11400 0x00FF Octeon events From nobody Fri Jun 9 19:58:02 2023 X-Original-To: dev-commits-src-branches@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 4QdBhV3j18z4cKdJ; Fri, 9 Jun 2023 19:58:02 +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 4QdBhV2rv7z4J55; Fri, 9 Jun 2023 19:58:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686340682; 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=OUzR3CHDA0tUIDpmpLkYaJggomBxxM5gQRU8MNN0tzQ=; b=rcaHWUl1ookScl3K7CUc2mw3T5BP2KQS9lgB1ciF9q0Z3fjeq2I8bb4EGGcT80QHqrDXZ+ 8jkoEHoLgFoniRd+/d28g7obILKw9ruNpgOfi2EHSO5m1WHEl35Q9ibdUxpIYOwS/WqIDk Nvry4gTQyVL8jesoUZbRViKWF7CzU/LRO6QEQr2nnivOLx88TwGj+szERS1zEIR+19/qLu pnLr7xRgFteq3+dEKJ/n/etKywZPX90ndKbTAz1U9j+JKIFPW2m8Atw0Q1qQdLB3m9UaC3 uWk3XZRk+sosch+30nRzkkKr1zspN5+uz9OBUvF1StFI6cr4/yiyqsrpHZh+Vg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686340682; 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=OUzR3CHDA0tUIDpmpLkYaJggomBxxM5gQRU8MNN0tzQ=; b=sbrn/D8a+wNF8IvVIwC4RY9eDdwbxoIeL6u64PDIvlCQ2D8UG49mZ2VAeDM0cRwnYQxlEC H0SSPvynSbf8+TRK/qZtjAzPQnNj9O46mmmZEXRdK3ES8mma+hWB+eESHTovEbmXZi6s5x ww/7DHqD7QwT4e8hwHaBx1cT+VaZ8A4GcBEYLfjWQ/Jq5mFlzYHxgMhoV9o+PO8h+gsole 2EK7dS4EgdP/mnho1ahQwv37HRMt4o8wOREU/QiiMrCkOjdI/Hj+EQWcSkfdVSeU4oh1Dr AKs7Nh793unhz1Cw0NexwmQVHBGIJvlJdbhFk8OWstZIGjuiiQfHkj2SCSM5ew== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686340682; a=rsa-sha256; cv=none; b=bQXT6E+5vUb2eLt3u80X19AoKWpiO9Hm/EZbZF1uzBxgKZx+dYCigcHsfJbNnumt6q+rvK pX5U6IdPbw3Te5JlXw5WM+v5uO4iFkyTW37ngIaIfqtL+Kh1D78bhPHfjkpKtOC/aI9zN4 zaEfEi0Zin+OJc9gm0UWjGsm+UACii6oHGcOP6HIaLkGLQN05DkiajARBkKqNXcjA+kAEX NxLnrNYLowsbYPwAZUIGOoUVn8c6AX7Hwzhn7uEAfkhXmRZFSWxOUOG30bt1IhGIVQzhCh OtxodMQOBlLbhwbx1t+cek8XXycq3VFUGArQ23EdHiJn7eVoegT8ixetIWJJRg== 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 4QdBhV1gGFzndy; Fri, 9 Jun 2023 19:58:02 +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 359Jw2WG072044; Fri, 9 Jun 2023 19:58:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 359Jw2uj072043; Fri, 9 Jun 2023 19:58:02 GMT (envelope-from git) Date: Fri, 9 Jun 2023 19:58:02 GMT Message-Id: <202306091958.359Jw2uj072043@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 2fc54435a6c4 - stable/13 - pmc_events.h: event list formatting List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2fc54435a6c4874aeacd027faf18f1ad64b5492d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=2fc54435a6c4874aeacd027faf18f1ad64b5492d commit 2fc54435a6c4874aeacd027faf18f1ad64b5492d Author: Mitchell Horne AuthorDate: 2023-05-05 21:57:14 +0000 Commit: Mitchell Horne CommitDate: 2023-06-09 18:14:58 +0000 pmc_events.h: event list formatting Improve the legibility of the list. Bump overall indentation, fix some whitespace, and sort the IAF block. Reviewed by: jkoshy MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D39903 (cherry picked from commit b6c9d2a3f892169d4a6acc92869f9d9db52876ea) --- sys/dev/hwpmc/pmc_events.h | 56 +++++++++++++++++++++++----------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/sys/dev/hwpmc/pmc_events.h b/sys/dev/hwpmc/pmc_events.h index 7a3ef832b47c..6df2ef4d82d7 100644 --- a/sys/dev/hwpmc/pmc_events.h +++ b/sys/dev/hwpmc/pmc_events.h @@ -1843,34 +1843,34 @@ __PMC_EV_ALIAS("unhalted-reference-cycles", IAF_CPU_CLK_UNHALTED_REF) * 0x14100 0x0100 ARMv8 events * 0x20000 0x1000 Software events */ -#define __PMC_EVENTS() \ - __PMC_EV_BLOCK(TSC, 0x01000) \ - __PMC_EV_TSC() \ - __PMC_EV_BLOCK(IAF, 0x10000) \ - __PMC_EV_IAF() \ - __PMC_EV_BLOCK(K7, 0x2000) \ - __PMC_EV_K7() \ - __PMC_EV_BLOCK(K8, 0x2080) \ - __PMC_EV_K8() \ - __PMC_EV_BLOCK(MIPS24K, 0x11300) \ - __PMC_EV_MIPS24K() \ - __PMC_EV_BLOCK(OCTEON, 0x11400) \ - __PMC_EV_OCTEON() \ - __PMC_EV_BLOCK(MIPS74K, 0x11500) \ - __PMC_EV_MIPS74K() \ - __PMC_EV_BLOCK(BERI, 0x11600) \ - __PMC_EV_BERI() \ - __PMC_EV_BLOCK(PPC7450, 0x13000) \ - __PMC_EV_PPC7450() \ - __PMC_EV_BLOCK(PPC970, 0x13100) \ - __PMC_EV_PPC970() \ - __PMC_EV_BLOCK(POWER8, 0x13200) \ - __PMC_EV_POWER8() \ - __PMC_EV_BLOCK(E500, 0x13300) \ - __PMC_EV_E500() \ - __PMC_EV_BLOCK(ARMV7, 0x14000) \ - __PMC_EV_ARMV7() \ - __PMC_EV_BLOCK(ARMV8, 0x14100) \ +#define __PMC_EVENTS() \ + __PMC_EV_BLOCK(TSC, 0x01000) \ + __PMC_EV_TSC() \ + __PMC_EV_BLOCK(K7, 0x02000) \ + __PMC_EV_K7() \ + __PMC_EV_BLOCK(K8, 0x02080) \ + __PMC_EV_K8() \ + __PMC_EV_BLOCK(IAF, 0x10000) \ + __PMC_EV_IAF() \ + __PMC_EV_BLOCK(MIPS24K, 0x11300) \ + __PMC_EV_MIPS24K() \ + __PMC_EV_BLOCK(OCTEON, 0x11400) \ + __PMC_EV_OCTEON() \ + __PMC_EV_BLOCK(MIPS74K, 0x11500) \ + __PMC_EV_MIPS74K() \ + __PMC_EV_BLOCK(BERI, 0x11600) \ + __PMC_EV_BERI() \ + __PMC_EV_BLOCK(PPC7450, 0x13000) \ + __PMC_EV_PPC7450() \ + __PMC_EV_BLOCK(PPC970, 0x13100) \ + __PMC_EV_PPC970() \ + __PMC_EV_BLOCK(POWER8, 0x13200) \ + __PMC_EV_POWER8() \ + __PMC_EV_BLOCK(E500, 0x13300) \ + __PMC_EV_E500() \ + __PMC_EV_BLOCK(ARMV7, 0x14000) \ + __PMC_EV_ARMV7() \ + __PMC_EV_BLOCK(ARMV8, 0x14100) \ __PMC_EV_ARMV8() #define PMC_EVENT_FIRST PMC_EV_TSC_TSC From nobody Fri Jun 9 19:58:03 2023 X-Original-To: dev-commits-src-branches@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 4QdBhW4J3Rz4cKdP; Fri, 9 Jun 2023 19:58:03 +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 4QdBhW3ZC4z4JJs; Fri, 9 Jun 2023 19:58:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686340683; 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=MGmqKaTGqxs+jUN8zQme+y8S+6NHjtGg0T7Xa25gwec=; b=T2uBtv0BwI12Ideb2EOd7x8RFq1tmFDQAMzuiqpVOt9XgaRF/rIPzXeFz2EyjSHwvjtP6M S0ZpixfnHWRdfIENIdWE3P6HiS0vAFoPgnO95/P+qMBrQLPnbhW8TtZvukOd7Ud6cUQrWa vaoZU5JjsBBF9PCBfXMolAp4kI9tgC8yXeIjnai48dMsWRtaqZPFEjgPQA4E9XGjpi/lJ9 SitiznTvhWlAoQ+f5gJwNUeS9GH/6HWV6TKI3I6qkBBh2SFPmjU42xZMkSbzfb7ktK4IQ0 6szSjLAMhUJTmbTjcOIYtTnkdYOxdvRsDDZ4qDrqu6MYEX5Ow+0UHe3x8pssqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686340683; 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=MGmqKaTGqxs+jUN8zQme+y8S+6NHjtGg0T7Xa25gwec=; b=DpAAJcJHLmS04WunYRtj0XcgdKAr5Njsf+Ls7FizHLt8IACO/1YCeGYAXRTvuv0rKJJkSE 05l0qJ6LT1/5vjFZtcO/44idq3kfVOq6damlrRqGOZTKZ2Z3/hpKeK/sRrGRSapXKOkos5 nj6toS5oHDyivC6ch181ER1WulxrV7ceiuNUcPChctlPzl+pRiwSX1cofJ6fFFh488oBiO 02uPZAjpn3Ctn84UxW1E0IOhC7UQ+sRTfPJlg/JoQKqrQJ109Ul/w4fvGo8TVjqCLsMiQK eswjuLtiwmeew4uwmyb7pYZ3PIxX2/rwrtTkGuijT5MXdJcKWmqvISgWlOU/NQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686340683; a=rsa-sha256; cv=none; b=IHFnpRJIEi0bRKJGdMLn+WsQuxTqHdQmPWxTMYrq6Np5T/J7K/1BInzCcwBiCLqaKoe+f4 2Em9ZXKRSYd5eBvXvOnaimbNfG+vFErzYNZxtz9HgVwdByMF5uQrzXdiIkIYtH1EXLi0FT WGpacc/amZUmnmhEeS0euWYWBq+AwNuFprsUbnKA661TaHCt7x0GewVQRyQ5z1+XZbIbDF ZzymGSAkL5wb+4d6geaRw17qwBZmvSRR96ANhFuSwufGorb4TRT9rDMH7AAjRdvqbjcRzW 4W+A700BWL8HJrEYhW8V24DgbOXtjzm9/H/tj+OKHOEjlbQsL1MF2Chxe+9NKw== 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 4QdBhW2hRlzp99; Fri, 9 Jun 2023 19:58:03 +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 359Jw3bv072066; Fri, 9 Jun 2023 19:58:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 359Jw32r072064; Fri, 9 Jun 2023 19:58:03 GMT (envelope-from git) Date: Fri, 9 Jun 2023 19:58:03 GMT Message-Id: <202306091958.359Jw32r072064@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: e456727fcc3f - stable/13 - pmccontrol: drop Pentium 4 special case List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e456727fcc3fe0e2ffa68ee225f93382707c1323 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=e456727fcc3fe0e2ffa68ee225f93382707c1323 commit e456727fcc3fe0e2ffa68ee225f93382707c1323 Author: Mitchell Horne AuthorDate: 2023-05-05 21:57:23 +0000 Commit: Mitchell Horne CommitDate: 2023-06-09 18:14:58 +0000 pmccontrol: drop Pentium 4 special case This is dead code; we no longer support Pentium hardware in libpmc or hwpmc. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation (cherry picked from commit 8bd4459560f39bdbccba76a21539136a7a44b9d7) --- usr.sbin/pmccontrol/pmccontrol.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/usr.sbin/pmccontrol/pmccontrol.c b/usr.sbin/pmccontrol/pmccontrol.c index 9d57a2923784..70f716826223 100644 --- a/usr.sbin/pmccontrol/pmccontrol.c +++ b/usr.sbin/pmccontrol/pmccontrol.c @@ -241,11 +241,6 @@ pmcc_do_list_state(void) ncpu = pc->pm_ncpu; for (c = cpu = 0; cpu < ncpu; cpu++) { -#if defined(__i386__) || defined(__amd64__) - if (pc->pm_cputype == PMC_CPU_INTEL_PIV && - CPU_ISSET(cpu, &logical_cpus_mask)) - continue; /* skip P4-style 'logical' cpus */ -#endif if (pmc_pmcinfo(cpu, &pi) < 0) { if (errno == ENXIO) continue; From nobody Fri Jun 9 19:58:04 2023 X-Original-To: dev-commits-src-branches@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 4QdBhX5xjZz4cKZv; Fri, 9 Jun 2023 19:58:04 +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 4QdBhX4bvxz4J8g; Fri, 9 Jun 2023 19:58:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686340684; 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=hYzqJZHUjKYFBXeaoMuF7hxlACWJf7UFfzRqWYHxRdk=; b=uXhvG07UtVh7RZ3C5MlbBNmUkvHFr+/tIe4gToX0DI8VWwBeJWZStz7NKiRBiah3zsPDjv pfb2qgEWyx7iKS3vGV12WyLSp2KnJknsF69U08h5ODZ5IdkpKNTumFSTGoZiJYGVfGjdce yQMbSU3L6KFxlt03O34zJP2wlRA2Z3mjaBWKgpmQG1G0g0hHLhSsmt2kGZr47btWNdtq3d Smmppu8WhM8P7+w064iWyao+GZNttk/Oyx1KnpO4AT4FG1wDed8Sk3h2MJkxr9Okv5rsng XQaBVvKQEd8K/Ne08xMrFIJVv2Xn9lX2bXnSEwyrWE56A9yMOJG5FWaEfxhpRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686340684; 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=hYzqJZHUjKYFBXeaoMuF7hxlACWJf7UFfzRqWYHxRdk=; b=inB7IDth0lPMr/pzPgD6qDGQPXTpCTFoH5o5YJtw9oPf7IE0NUCTCs2Ihy7TuMncrhCm/R dA5ydQAYp9zmjEv4IWrSGNwDvO0MOUCLZOeBOT1FE3Ot51v6KomjZ3QuG5nzYli14AunfU q+6Nt15BLUFpSZeBrtzEH+EXj6WlNiP903CcCU+1us0oPuFLHBljdblqNrcQAgiplFAGIE Ys6hzKRNwMMhrN4ZB8pt6XGtwtwePhxjFzPVtZptnU1GivvgIsEpY3kRMSD+loKaRncNsU sr15NZFmEt3xbV4EMhOHicpdL615s/f6sbFIpUADfalfTlYnxGm+WPA0CxWdjw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686340684; a=rsa-sha256; cv=none; b=R7WGIu6UvKtXIiGMTLHNSxJZogFcCouC6cOjQZ0MMrCri7AD5UYfPsQxI7OoZiYYORx2Pt FIVVOM2n4Qo9/gjWUxMO/3H7TojXeSoN7ccyNuQiXAvXf/dUplo9/ogm1QYSvg7jwu7Pqm H+cG03C+q3+kWQlIliDi8AiMGELgjp+r86A9/v42VE9ollKycUhr9SMuXilnpiFhlhcWsN n/17NhCvITSnhA5bm1TJ/WPsGZxftjX0B4WDTVUzaXuA6N1kqeKFdKB1CXtWJsskmJIFMp Qklsr8jnMQLFSK+HKq99JVaMkNlgdeTR1OHz7ZBfoK6dqRnsFfaURjIZ92dQvQ== 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 4QdBhX3hTqznmq; Fri, 9 Jun 2023 19:58:04 +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 359Jw4D0072097; Fri, 9 Jun 2023 19:58:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 359Jw4wK072096; Fri, 9 Jun 2023 19:58:04 GMT (envelope-from git) Date: Fri, 9 Jun 2023 19:58:04 GMT Message-Id: <202306091958.359Jw4wK072096@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 4f845152b19b - stable/13 - hwpmc: trim obsolete Intel CPU and class defs List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4f845152b19b154f4df65886c60f23c105d0c6fd Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=4f845152b19b154f4df65886c60f23c105d0c6fd commit 4f845152b19b154f4df65886c60f23c105d0c6fd Author: Mitchell Horne AuthorDate: 2023-05-05 21:57:38 +0000 Commit: Mitchell Horne CommitDate: 2023-06-09 18:14:58 +0000 hwpmc: trim obsolete Intel CPU and class defs No functional change. Reviewed by: jkoshy MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D39904 (cherry picked from commit ca43b2ae3ef2ed86b0df36296464d7830b61b944) --- sys/dev/hwpmc/hwpmc_intel.c | 2 +- sys/i386/include/pmc_mdep.h | 4 ---- sys/sys/pmc.h | 10 ---------- 3 files changed, 1 insertion(+), 15 deletions(-) diff --git a/sys/dev/hwpmc/hwpmc_intel.c b/sys/dev/hwpmc/hwpmc_intel.c index 894f9c07b622..c51e74f34516 100644 --- a/sys/dev/hwpmc/hwpmc_intel.c +++ b/sys/dev/hwpmc/hwpmc_intel.c @@ -99,7 +99,7 @@ pmc_intel_initialize(void) family, model, stepping); switch (cpu_id & 0xF00) { - case 0x600: /* Pentium Pro, Celeron, Pentium II & III */ + case 0x600: switch (model) { case 0xE: cputype = PMC_CPU_INTEL_CORE; diff --git a/sys/i386/include/pmc_mdep.h b/sys/i386/include/pmc_mdep.h index a868ce11c3ca..3d498e006a36 100644 --- a/sys/i386/include/pmc_mdep.h +++ b/sys/i386/include/pmc_mdep.h @@ -45,10 +45,6 @@ struct pmc_mdep; * TSC The timestamp counter * K7 AMD Athlon XP/MP and other 32 bit processors. * K8 AMD Athlon64 and Opteron PMCs in 32 bit mode. - * PIV Intel P4/HTT and P4/EMT64 - * PPRO Intel Pentium Pro, Pentium-II, Pentium-III, Celeron and - * Pentium-M processors - * PENTIUM Intel Pentium MMX. * IAP Intel Core/Core2/Atom programmable PMCs. * IAF Intel fixed-function PMCs. * UCP Intel Uncore programmable PMCs. diff --git a/sys/sys/pmc.h b/sys/sys/pmc.h index 91ce5d2bd71f..4b645c771484 100644 --- a/sys/sys/pmc.h +++ b/sys/sys/pmc.h @@ -84,13 +84,6 @@ extern char pmc_cpuid[PMC_CPUID_LEN]; #define __PMC_CPUS() \ __PMC_CPU(AMD_K7, 0x00, "AMD K7") \ __PMC_CPU(AMD_K8, 0x01, "AMD K8") \ - __PMC_CPU(INTEL_P5, 0x80, "Intel Pentium") \ - __PMC_CPU(INTEL_P6, 0x81, "Intel Pentium Pro") \ - __PMC_CPU(INTEL_CL, 0x82, "Intel Celeron") \ - __PMC_CPU(INTEL_PII, 0x83, "Intel Pentium II") \ - __PMC_CPU(INTEL_PIII, 0x84, "Intel Pentium III") \ - __PMC_CPU(INTEL_PM, 0x85, "Intel Pentium M") \ - __PMC_CPU(INTEL_PIV, 0x86, "Intel Pentium IV") \ __PMC_CPU(INTEL_CORE, 0x87, "Intel Core Solo/Duo") \ __PMC_CPU(INTEL_CORE2, 0x88, "Intel Core2") \ __PMC_CPU(INTEL_CORE2EXTREME, 0x89, "Intel Core2 Extreme") \ @@ -153,9 +146,6 @@ enum pmc_cputype { __PMC_CLASS(TSC, 0x00, "CPU Timestamp counter") \ __PMC_CLASS(K7, 0x01, "AMD K7 performance counters") \ __PMC_CLASS(K8, 0x02, "AMD K8 performance counters") \ - __PMC_CLASS(P5, 0x03, "Intel Pentium counters") \ - __PMC_CLASS(P6, 0x04, "Intel Pentium Pro counters") \ - __PMC_CLASS(P4, 0x05, "Intel Pentium-IV counters") \ __PMC_CLASS(IAF, 0x06, "Intel Core2/Atom, fixed function") \ __PMC_CLASS(IAP, 0x07, "Intel Core...Atom, programmable") \ __PMC_CLASS(UCF, 0x08, "Intel Uncore fixed function") \ From nobody Fri Jun 9 19:58:05 2023 X-Original-To: dev-commits-src-branches@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 4QdBhY62dVz4cKW2; Fri, 9 Jun 2023 19:58:05 +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 4QdBhY5cMCz4JPZ; Fri, 9 Jun 2023 19:58:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686340685; 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=X9zofmrSSvisZJnuTmPYEPyXAtkKyjBuIO10fFSgvtw=; b=nxTCwR8ZNkT4ORgc7ynHkeCj8DLXN2plJvSKMFvZ3BIVoQnj5g6C+HocYvnPRKEGsrSap8 /O997b8e/SoPMu/gLpowJfQEmHbBtPIAOs5I7IxWOFeEzSir8XTcfOsQZuB7Wi3gflC1Yj Al23dbuRU+A7iErAgILM8G2cJOyHawsST9367NAAckIKz/4j5aGgqNX9pUA4ndsjieGah+ jIW5rlGnZMuR1d1FlXav3cAfxrQqrTTJiZfe3Zd71LRutVWmN8gigyIkBFCLouUgKE1rhE ma026u9pqq+mviT4stszs9PyBKYLPKhVARYUG7KaFIG1YnXW+5+E1p+tVVisLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686340685; 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=X9zofmrSSvisZJnuTmPYEPyXAtkKyjBuIO10fFSgvtw=; b=i5hH5i6Aj6SoaKnvGXtHC50OMEVUSWZJgoi5bopS1don+KM85gi+YBeWvMrYQkc7fqr5Qc /ZuA83WhQ+V/dFt+HjD1OvNKRxiuZADbcTxXGNzbhtHmB2/8Cuq5/Jib/GLUr2BJzaElvt QZ9qnCSPf9U81hFeZiW4GUBZ+runPsS7NZe2qiDP5wUrC0Nj3gVpJWYY8zQVyRqSxQzGjp N3lAkTfhLqVUDqVFwdnaApDjsUKJ/bBKU2CxboD5XkAq/Xaiic3FR32vFRJb0KLvoMuaC8 tFgwK2cR/2RrdkBVjY9pHL/QnIICLlf+uT9b3l1q0Lo8DDfu8/Z+PpdlO23a4Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686340685; a=rsa-sha256; cv=none; b=U0fw36JVkU9gVQaCI/92A/y/1lmd5xPrmve9VeYh7xU9wdtGPNglt2JNOUAluy/00LCw4U hHfv4VBv6/S6blnlwl6+D8CnjaxcZxWUklUHAKwgXxw8/rzIByNp+hWVyBxwvCT/SeJZNh L8j0V+xDy2yW7My/GEGgAZZw3ZiKxKfJ8hb7lZuGcOqB7P+7RuyuR7kK9dgLty/vNeI5iV UZ3k9SDgqzJHsTDjXKCU3K4yqpYfXVvlwt8WqbPSZ2ClmhiE6Dapa/d2c1CL9zCaike3V4 nmjxoQUxMKnAX8SUQG5QsWGdPzXTdh2cVWkJsOc6frUmSj1Vwd3RokE44R5eQQ== 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 4QdBhY4Td1znmr; Fri, 9 Jun 2023 19:58:05 +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 359Jw54Y072116; Fri, 9 Jun 2023 19:58:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 359Jw5kg072115; Fri, 9 Jun 2023 19:58:05 GMT (envelope-from git) Date: Fri, 9 Jun 2023 19:58:05 GMT Message-Id: <202306091958.359Jw5kg072115@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: fd9f6074dc71 - stable/13 - hwpmc: formatting of CPU and class lists List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: fd9f6074dc71e2e18c7091909d67a257bfd2528c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=fd9f6074dc71e2e18c7091909d67a257bfd2528c commit fd9f6074dc71e2e18c7091909d67a257bfd2528c Author: Mitchell Horne AuthorDate: 2023-05-05 21:58:13 +0000 Commit: Mitchell Horne CommitDate: 2023-06-09 18:14:58 +0000 hwpmc: formatting of CPU and class lists The end result is much more legible in both cases. Reviewed by: jkoshy MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D39906 (cherry picked from commit 7253dc57a0b400ff745a43017928304ff8dcf33f) --- sys/sys/pmc.h | 136 +++++++++++++++++++++++++++++----------------------------- 1 file changed, 67 insertions(+), 69 deletions(-) diff --git a/sys/sys/pmc.h b/sys/sys/pmc.h index 4b645c771484..8f817658fe55 100644 --- a/sys/sys/pmc.h +++ b/sys/sys/pmc.h @@ -80,54 +80,53 @@ extern char pmc_cpuid[PMC_CPUID_LEN]; * and numbered sparsely in order to minimize changes to the ABI involved * when new CPUs are added. */ - -#define __PMC_CPUS() \ - __PMC_CPU(AMD_K7, 0x00, "AMD K7") \ - __PMC_CPU(AMD_K8, 0x01, "AMD K8") \ - __PMC_CPU(INTEL_CORE, 0x87, "Intel Core Solo/Duo") \ - __PMC_CPU(INTEL_CORE2, 0x88, "Intel Core2") \ - __PMC_CPU(INTEL_CORE2EXTREME, 0x89, "Intel Core2 Extreme") \ - __PMC_CPU(INTEL_ATOM, 0x8A, "Intel Atom") \ - __PMC_CPU(INTEL_COREI7, 0x8B, "Intel Core i7") \ - __PMC_CPU(INTEL_WESTMERE, 0x8C, "Intel Westmere") \ - __PMC_CPU(INTEL_SANDYBRIDGE, 0x8D, "Intel Sandy Bridge") \ - __PMC_CPU(INTEL_IVYBRIDGE, 0x8E, "Intel Ivy Bridge") \ - __PMC_CPU(INTEL_SANDYBRIDGE_XEON, 0x8F, "Intel Sandy Bridge Xeon") \ - __PMC_CPU(INTEL_IVYBRIDGE_XEON, 0x90, "Intel Ivy Bridge Xeon") \ - __PMC_CPU(INTEL_HASWELL, 0x91, "Intel Haswell") \ - __PMC_CPU(INTEL_ATOM_SILVERMONT, 0x92, "Intel Atom Silvermont") \ - __PMC_CPU(INTEL_NEHALEM_EX, 0x93, "Intel Nehalem Xeon 7500") \ - __PMC_CPU(INTEL_WESTMERE_EX, 0x94, "Intel Westmere Xeon E7") \ - __PMC_CPU(INTEL_HASWELL_XEON, 0x95, "Intel Haswell Xeon E5 v3") \ - __PMC_CPU(INTEL_BROADWELL, 0x96, "Intel Broadwell") \ - __PMC_CPU(INTEL_BROADWELL_XEON, 0x97, "Intel Broadwell Xeon") \ - __PMC_CPU(INTEL_SKYLAKE, 0x98, "Intel Skylake") \ - __PMC_CPU(INTEL_SKYLAKE_XEON, 0x99, "Intel Skylake Xeon") \ - __PMC_CPU(INTEL_ATOM_GOLDMONT, 0x9A, "Intel Atom Goldmont") \ - __PMC_CPU(INTEL_ICELAKE, 0x9B, "Intel Icelake") \ - __PMC_CPU(INTEL_ICELAKE_XEON, 0x9C, "Intel Icelake Xeon") \ - __PMC_CPU(INTEL_ALDERLAKE, 0x9D, "Intel Alderlake") \ - __PMC_CPU(INTEL_ATOM_GOLDMONT_P, 0x9E, "Intel Atom Goldmont Plus") \ - __PMC_CPU(INTEL_ATOM_TREMONT, 0x9F, "Intel Atom Tremont") \ - __PMC_CPU(INTEL_XSCALE, 0x100, "Intel XScale") \ - __PMC_CPU(MIPS_24K, 0x200, "MIPS 24K") \ - __PMC_CPU(MIPS_OCTEON, 0x201, "Cavium Octeon") \ - __PMC_CPU(MIPS_74K, 0x202, "MIPS 74K") \ - __PMC_CPU(MIPS_BERI, 0x203, "BERI") \ - __PMC_CPU(PPC_7450, 0x300, "PowerPC MPC7450") \ - __PMC_CPU(PPC_E500, 0x340, "PowerPC e500 Core") \ - __PMC_CPU(PPC_970, 0x380, "IBM PowerPC 970") \ - __PMC_CPU(PPC_POWER8, 0x390, "IBM POWER8") \ - __PMC_CPU(GENERIC, 0x400, "Generic") \ - __PMC_CPU(ARMV7_CORTEX_A5, 0x500, "ARMv7 Cortex A5") \ - __PMC_CPU(ARMV7_CORTEX_A7, 0x501, "ARMv7 Cortex A7") \ - __PMC_CPU(ARMV7_CORTEX_A8, 0x502, "ARMv7 Cortex A8") \ - __PMC_CPU(ARMV7_CORTEX_A9, 0x503, "ARMv7 Cortex A9") \ - __PMC_CPU(ARMV7_CORTEX_A15, 0x504, "ARMv7 Cortex A15") \ - __PMC_CPU(ARMV7_CORTEX_A17, 0x505, "ARMv7 Cortex A17") \ - __PMC_CPU(ARMV8_CORTEX_A53, 0x600, "ARMv8 Cortex A53") \ - __PMC_CPU(ARMV8_CORTEX_A57, 0x601, "ARMv8 Cortex A57") \ - __PMC_CPU(ARMV8_CORTEX_A76, 0x602, "ARMv8 Cortex A76") +#define __PMC_CPUS() \ + __PMC_CPU(AMD_K7, 0x00, "AMD K7") \ + __PMC_CPU(AMD_K8, 0x01, "AMD K8") \ + __PMC_CPU(INTEL_CORE, 0x87, "Intel Core Solo/Duo") \ + __PMC_CPU(INTEL_CORE2, 0x88, "Intel Core2") \ + __PMC_CPU(INTEL_CORE2EXTREME, 0x89, "Intel Core2 Extreme") \ + __PMC_CPU(INTEL_ATOM, 0x8A, "Intel Atom") \ + __PMC_CPU(INTEL_COREI7, 0x8B, "Intel Core i7") \ + __PMC_CPU(INTEL_WESTMERE, 0x8C, "Intel Westmere") \ + __PMC_CPU(INTEL_SANDYBRIDGE, 0x8D, "Intel Sandy Bridge") \ + __PMC_CPU(INTEL_IVYBRIDGE, 0x8E, "Intel Ivy Bridge") \ + __PMC_CPU(INTEL_SANDYBRIDGE_XEON, 0x8F, "Intel Sandy Bridge Xeon") \ + __PMC_CPU(INTEL_IVYBRIDGE_XEON, 0x90, "Intel Ivy Bridge Xeon") \ + __PMC_CPU(INTEL_HASWELL, 0x91, "Intel Haswell") \ + __PMC_CPU(INTEL_ATOM_SILVERMONT, 0x92, "Intel Atom Silvermont") \ + __PMC_CPU(INTEL_NEHALEM_EX, 0x93, "Intel Nehalem Xeon 7500") \ + __PMC_CPU(INTEL_WESTMERE_EX, 0x94, "Intel Westmere Xeon E7") \ + __PMC_CPU(INTEL_HASWELL_XEON, 0x95, "Intel Haswell Xeon E5 v3") \ + __PMC_CPU(INTEL_BROADWELL, 0x96, "Intel Broadwell") \ + __PMC_CPU(INTEL_BROADWELL_XEON, 0x97, "Intel Broadwell Xeon") \ + __PMC_CPU(INTEL_SKYLAKE, 0x98, "Intel Skylake") \ + __PMC_CPU(INTEL_SKYLAKE_XEON, 0x99, "Intel Skylake Xeon") \ + __PMC_CPU(INTEL_ATOM_GOLDMONT, 0x9A, "Intel Atom Goldmont") \ + __PMC_CPU(INTEL_ICELAKE, 0x9B, "Intel Icelake") \ + __PMC_CPU(INTEL_ICELAKE_XEON, 0x9C, "Intel Icelake Xeon") \ + __PMC_CPU(INTEL_ALDERLAKE, 0x9D, "Intel Alderlake") \ + __PMC_CPU(INTEL_ATOM_GOLDMONT_P, 0x9E, "Intel Atom Goldmont Plus") \ + __PMC_CPU(INTEL_ATOM_TREMONT, 0x9F, "Intel Atom Tremont") \ + __PMC_CPU(INTEL_XSCALE, 0x100, "Intel XScale") \ + __PMC_CPU(MIPS_24K, 0x200, "MIPS 24K") \ + __PMC_CPU(MIPS_OCTEON, 0x201, "Cavium Octeon") \ + __PMC_CPU(MIPS_74K, 0x202, "MIPS 74K") \ + __PMC_CPU(MIPS_BERI, 0x203, "BERI") \ + __PMC_CPU(PPC_7450, 0x300, "PowerPC MPC7450") \ + __PMC_CPU(PPC_E500, 0x340, "PowerPC e500 Core") \ + __PMC_CPU(PPC_970, 0x380, "IBM PowerPC 970") \ + __PMC_CPU(PPC_POWER8, 0x390, "IBM POWER8") \ + __PMC_CPU(GENERIC, 0x400, "Generic") \ + __PMC_CPU(ARMV7_CORTEX_A5, 0x500, "ARMv7 Cortex A5") \ + __PMC_CPU(ARMV7_CORTEX_A7, 0x501, "ARMv7 Cortex A7") \ + __PMC_CPU(ARMV7_CORTEX_A8, 0x502, "ARMv7 Cortex A8") \ + __PMC_CPU(ARMV7_CORTEX_A9, 0x503, "ARMv7 Cortex A9") \ + __PMC_CPU(ARMV7_CORTEX_A15, 0x504, "ARMv7 Cortex A15") \ + __PMC_CPU(ARMV7_CORTEX_A17, 0x505, "ARMv7 Cortex A17") \ + __PMC_CPU(ARMV8_CORTEX_A53, 0x600, "ARMv8 Cortex A53") \ + __PMC_CPU(ARMV8_CORTEX_A57, 0x601, "ARMv8 Cortex A57") \ + __PMC_CPU(ARMV8_CORTEX_A76, 0x602, "ARMv8 Cortex A76") enum pmc_cputype { #undef __PMC_CPU @@ -141,27 +140,26 @@ enum pmc_cputype { /* * Classes of PMCs */ - -#define __PMC_CLASSES() \ - __PMC_CLASS(TSC, 0x00, "CPU Timestamp counter") \ - __PMC_CLASS(K7, 0x01, "AMD K7 performance counters") \ - __PMC_CLASS(K8, 0x02, "AMD K8 performance counters") \ - __PMC_CLASS(IAF, 0x06, "Intel Core2/Atom, fixed function") \ - __PMC_CLASS(IAP, 0x07, "Intel Core...Atom, programmable") \ - __PMC_CLASS(UCF, 0x08, "Intel Uncore fixed function") \ - __PMC_CLASS(UCP, 0x09, "Intel Uncore programmable") \ - __PMC_CLASS(XSCALE, 0x0A, "Intel XScale counters") \ - __PMC_CLASS(MIPS24K, 0x0B, "MIPS 24K") \ - __PMC_CLASS(OCTEON, 0x0C, "Cavium Octeon") \ - __PMC_CLASS(PPC7450, 0x0D, "Motorola MPC7450 class") \ - __PMC_CLASS(PPC970, 0x0E, "IBM PowerPC 970 class") \ - __PMC_CLASS(SOFT, 0x0F, "Software events") \ - __PMC_CLASS(ARMV7, 0x10, "ARMv7") \ - __PMC_CLASS(ARMV8, 0x11, "ARMv8") \ - __PMC_CLASS(MIPS74K, 0x12, "MIPS 74K") \ - __PMC_CLASS(E500, 0x13, "Freescale e500 class") \ - __PMC_CLASS(BERI, 0x14, "MIPS BERI") \ - __PMC_CLASS(POWER8, 0x15, "IBM POWER8 class") +#define __PMC_CLASSES() \ + __PMC_CLASS(TSC, 0x00, "CPU Timestamp counter") \ + __PMC_CLASS(K7, 0x01, "AMD K7 performance counters") \ + __PMC_CLASS(K8, 0x02, "AMD K8 performance counters") \ + __PMC_CLASS(IAF, 0x06, "Intel Core2/Atom, fixed function") \ + __PMC_CLASS(IAP, 0x07, "Intel Core...Atom, programmable") \ + __PMC_CLASS(UCF, 0x08, "Intel Uncore fixed function") \ + __PMC_CLASS(UCP, 0x09, "Intel Uncore programmable") \ + __PMC_CLASS(XSCALE, 0x0A, "Intel XScale counters") \ + __PMC_CLASS(MIPS24K, 0x0B, "MIPS 24K") \ + __PMC_CLASS(OCTEON, 0x0C, "Cavium Octeon") \ + __PMC_CLASS(PPC7450, 0x0D, "Motorola MPC7450 class") \ + __PMC_CLASS(PPC970, 0x0E, "IBM PowerPC 970 class") \ + __PMC_CLASS(SOFT, 0x0F, "Software events") \ + __PMC_CLASS(ARMV7, 0x10, "ARMv7") \ + __PMC_CLASS(ARMV8, 0x11, "ARMv8") \ + __PMC_CLASS(MIPS74K, 0x12, "MIPS 74K") \ + __PMC_CLASS(E500, 0x13, "Freescale e500 class") \ + __PMC_CLASS(BERI, 0x14, "MIPS BERI") \ + __PMC_CLASS(POWER8, 0x15, "IBM POWER8 class") \ enum pmc_class { #undef __PMC_CLASS From nobody Fri Jun 9 19:58:06 2023 X-Original-To: dev-commits-src-branches@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 4QdBhZ6xrQz4cKSn; Fri, 9 Jun 2023 19:58:06 +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 4QdBhZ6HNbz4JMg; Fri, 9 Jun 2023 19:58:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686340686; 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=Fqa0RD/OcXmWf0uUC5HCBadDWV3wzHRJ4F/K244csVk=; b=C/6Z4OFeBUdrF1nTFs77Z191EijZyLeJno/ZWuMHgbMhwsGnmq6sYGjCgPnVSiE48cjfpB 30AR/PJHGNXm14oRDq8L4bhRkbG75DyFQRKZei7bNWBO02Sw09zXrxZKtszw50CWi6vgIE wZT7EERIt5roPaWwrm5CLUVDVy+xC22ujF4xZ08UEGHQUX2d6MSnmFN3aKfOZmhq8AhMpB M3HxImfb4jK7+A75/fe8jKOoOy6mkPipYq940DIbnanjFl+TCFIVGbEA4mohTNW6ToSB8A 6nsbQaotpG2jI86Of39h2vy9WpvEEDZRaDR4s/MPzW8VhK9ddECvO3C5/UIrQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686340686; 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=Fqa0RD/OcXmWf0uUC5HCBadDWV3wzHRJ4F/K244csVk=; b=dE9BJA6+z0JbfNYoiKYDnioBr6dawVJOG5lJ6hrZrzIzdzbz6yJQh3xDjz4+ftT4ZCTdd2 C7YMyOZc+4iWlhy5GmESc01LYh0Q40/XIZoEu061/eLMwHZdqhLg2vrNsTE3xnziU9CIHU HaG/vtEScrBAuAjfJOAUfzrWe24ZjJzlAc02NOwKKFVPlE+Y91HOS3VSBQmQX3hR1dDaTc 7ecDXaI2s7agYGH20b76QvVKHpxHE/cG5pIOBlvG4/ArqkxxQfsWoZpz/F28XNTnoqoxux GrFH51I/DsnG7PXryRXVci4//D01Jiv7yP9TTKXj2KEGoOm0ok8L7TiqDmOZlw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686340686; a=rsa-sha256; cv=none; b=OmpFG/31AKh5bBpKNPXXZvXXs7nTHlfXQZ6pbq+p5I1riRQGlrI03snWpGDqtsQp8RROSe kzUfzYzUdj4Nj8hk6vh7PFaaoRDAUlj9/Nl9UPbjOhF9Vpf2fEXt44zZZ21yl2iqNFpTTb 08tisGkr2CDQPoJYBhvT4eqysKNJ9L8TqUJzp8d2+zn3GiRO5gsAwCCA0Q6b5l62H/Tn3R CYpXpqvJsbLcCklTdVZDA1R8XjLDMin0kI4qBwyjp0HRUgOq9Hpg0pfumuGRZbCGOY9tJw CJhdlHVQzuT0w6qGqdJdu55FaZXLGSx48daeW8zQry+07moNrUUflDlOFGTAjw== 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 4QdBhZ5MY8znf0; Fri, 9 Jun 2023 19:58:06 +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 359Jw6TN072138; Fri, 9 Jun 2023 19:58:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 359Jw6P3072137; Fri, 9 Jun 2023 19:58:06 GMT (envelope-from git) Date: Fri, 9 Jun 2023 19:58:06 GMT Message-Id: <202306091958.359Jw6P3072137@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 67239b0a33b2 - stable/13 - hwpmc: don't use deprecated copystr(9) List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 67239b0a33b22f0e92b975378b060f82fef5593b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=67239b0a33b22f0e92b975378b060f82fef5593b commit 67239b0a33b22f0e92b975378b060f82fef5593b Author: Mitchell Horne AuthorDate: 2023-05-05 21:59:15 +0000 Commit: Mitchell Horne CommitDate: 2023-06-09 18:14:58 +0000 hwpmc: don't use deprecated copystr(9) It is just wrapper around strlcpy(), but results in more complicated code. Clean this up to use strlcpy() or snprintf() as appropriate. Reviewed by: jkoshy MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D39910 (cherry picked from commit 31610e34b7e39d573d927ea98346c88f23cabdab) --- sys/dev/hwpmc/hwpmc_amd.c | 7 +------ sys/dev/hwpmc/hwpmc_arm64.c | 9 +++------ sys/dev/hwpmc/hwpmc_armv7.c | 9 +++------ sys/dev/hwpmc/hwpmc_beri.c | 8 ++------ sys/dev/hwpmc/hwpmc_core.c | 16 ++-------------- sys/dev/hwpmc/hwpmc_mips.c | 8 ++------ sys/dev/hwpmc/hwpmc_powerpc.c | 9 +++------ sys/dev/hwpmc/hwpmc_soft.c | 7 +------ sys/dev/hwpmc/hwpmc_tsc.c | 7 +------ sys/dev/hwpmc/hwpmc_uncore.c | 16 ++-------------- 10 files changed, 20 insertions(+), 76 deletions(-) diff --git a/sys/dev/hwpmc/hwpmc_amd.c b/sys/dev/hwpmc/hwpmc_amd.c index 2b5356924ae6..05584ee1660d 100644 --- a/sys/dev/hwpmc/hwpmc_amd.c +++ b/sys/dev/hwpmc/hwpmc_amd.c @@ -905,8 +905,6 @@ amd_intr(struct trapframe *tf) static int amd_describe(int cpu, int ri, struct pmc_info *pi, struct pmc **ppmc) { - int error; - size_t copied; const struct amd_descr *pd; struct pmc_hw *phw; @@ -918,10 +916,7 @@ amd_describe(int cpu, int ri, struct pmc_info *pi, struct pmc **ppmc) phw = &amd_pcpu[cpu]->pc_amdpmcs[ri]; pd = &amd_pmcdesc[ri]; - if ((error = copystr(pd->pm_descr.pd_name, pi->pm_name, - PMC_NAME_MAX, &copied)) != 0) - return error; - + strlcpy(pi->pm_name, pd->pm_descr.pd_name, sizeof(pi->pm_name)); pi->pm_class = pd->pm_descr.pd_class; if (phw->phw_state & PMC_PHW_FLAG_IS_ENABLED) { diff --git a/sys/dev/hwpmc/hwpmc_arm64.c b/sys/dev/hwpmc/hwpmc_arm64.c index 80d97070b913..a89f26f90dd0 100644 --- a/sys/dev/hwpmc/hwpmc_arm64.c +++ b/sys/dev/hwpmc/hwpmc_arm64.c @@ -425,9 +425,7 @@ arm64_intr(struct trapframe *tf) static int arm64_describe(int cpu, int ri, struct pmc_info *pi, struct pmc **ppmc) { - char arm64_name[PMC_NAME_MAX]; struct pmc_hw *phw; - int error; KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), ("[arm64,%d], illegal CPU %d", __LINE__, cpu)); @@ -435,11 +433,10 @@ arm64_describe(int cpu, int ri, struct pmc_info *pi, struct pmc **ppmc) ("[arm64,%d] row-index %d out of range", __LINE__, ri)); phw = &arm64_pcpu[cpu]->pc_arm64pmcs[ri]; - snprintf(arm64_name, sizeof(arm64_name), "ARMV8-%d", ri); - if ((error = copystr(arm64_name, pi->pm_name, PMC_NAME_MAX, - NULL)) != 0) - return (error); + + snprintf(pi->pm_name, sizeof(pi->pm_name), "ARMV8-%d", ri); pi->pm_class = PMC_CLASS_ARMV8; + if (phw->phw_state & PMC_PHW_FLAG_IS_ENABLED) { pi->pm_enabled = TRUE; *ppmc = phw->phw_pmc; diff --git a/sys/dev/hwpmc/hwpmc_armv7.c b/sys/dev/hwpmc/hwpmc_armv7.c index cd4761df46be..2cfac1e857bd 100644 --- a/sys/dev/hwpmc/hwpmc_armv7.c +++ b/sys/dev/hwpmc/hwpmc_armv7.c @@ -389,9 +389,7 @@ armv7_intr(struct trapframe *tf) static int armv7_describe(int cpu, int ri, struct pmc_info *pi, struct pmc **ppmc) { - char armv7_name[PMC_NAME_MAX]; struct pmc_hw *phw; - int error; KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), ("[armv7,%d], illegal CPU %d", __LINE__, cpu)); @@ -399,11 +397,10 @@ armv7_describe(int cpu, int ri, struct pmc_info *pi, struct pmc **ppmc) ("[armv7,%d] row-index %d out of range", __LINE__, ri)); phw = &armv7_pcpu[cpu]->pc_armv7pmcs[ri]; - snprintf(armv7_name, sizeof(armv7_name), "ARMV7-%d", ri); - if ((error = copystr(armv7_name, pi->pm_name, PMC_NAME_MAX, - NULL)) != 0) - return error; + + snprintf(pi->pm_name, sizeof(pi->pm_name), "ARMV7-%d", ri); pi->pm_class = PMC_CLASS_ARMV7; + if (phw->phw_state & PMC_PHW_FLAG_IS_ENABLED) { pi->pm_enabled = TRUE; *ppmc = phw->phw_pmc; diff --git a/sys/dev/hwpmc/hwpmc_beri.c b/sys/dev/hwpmc/hwpmc_beri.c index 4fec1b950299..ce15bb57fda4 100644 --- a/sys/dev/hwpmc/hwpmc_beri.c +++ b/sys/dev/hwpmc/hwpmc_beri.c @@ -366,8 +366,6 @@ static int beri_describe(int cpu, int ri, struct pmc_info *pi, struct pmc **ppmc) { struct pmc_hw *phw; - char beri_name[PMC_NAME_MAX]; - int error; KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), ("[beri,%d], illegal CPU %d", __LINE__, cpu)); @@ -375,10 +373,8 @@ beri_describe(int cpu, int ri, struct pmc_info *pi, struct pmc **ppmc) ("[beri,%d] row-index %d out of range", __LINE__, ri)); phw = &beri_pcpu[cpu]->pc_beripmcs[ri]; - snprintf(beri_name, sizeof(beri_name), "MIPS-%d", ri); - if ((error = copystr(beri_name, pi->pm_name, PMC_NAME_MAX, - NULL)) != 0) - return error; + + snprintf(pi->pm_name, sizeof(pi->pm_name), "MIPS-%d", ri); pi->pm_class = beri_pmc_spec.ps_cpuclass; if (phw->phw_state & PMC_PHW_FLAG_IS_ENABLED) { pi->pm_enabled = TRUE; diff --git a/sys/dev/hwpmc/hwpmc_core.c b/sys/dev/hwpmc/hwpmc_core.c index 5d29931c90f0..ad9d323bdb9a 100644 --- a/sys/dev/hwpmc/hwpmc_core.c +++ b/sys/dev/hwpmc/hwpmc_core.c @@ -330,17 +330,11 @@ iaf_config_pmc(int cpu, int ri, struct pmc *pm) static int iaf_describe(int cpu, int ri, struct pmc_info *pi, struct pmc **ppmc) { - int error; struct pmc_hw *phw; - char iaf_name[PMC_NAME_MAX]; phw = &core_pcpu[cpu]->pc_corepmcs[ri + core_iaf_ri]; - (void) snprintf(iaf_name, sizeof(iaf_name), "IAF-%d", ri); - if ((error = copystr(iaf_name, pi->pm_name, PMC_NAME_MAX, - NULL)) != 0) - return (error); - + snprintf(pi->pm_name, sizeof(pi->pm_name), "IAF-%d", ri); pi->pm_class = PMC_CLASS_IAF; if (phw->phw_state & PMC_PHW_FLAG_IS_ENABLED) { @@ -814,17 +808,11 @@ iap_config_pmc(int cpu, int ri, struct pmc *pm) static int iap_describe(int cpu, int ri, struct pmc_info *pi, struct pmc **ppmc) { - int error; struct pmc_hw *phw; - char iap_name[PMC_NAME_MAX]; phw = &core_pcpu[cpu]->pc_corepmcs[ri]; - (void) snprintf(iap_name, sizeof(iap_name), "IAP-%d", ri); - if ((error = copystr(iap_name, pi->pm_name, PMC_NAME_MAX, - NULL)) != 0) - return (error); - + snprintf(pi->pm_name, sizeof(pi->pm_name), "IAP-%d", ri); pi->pm_class = PMC_CLASS_IAP; if (phw->phw_state & PMC_PHW_FLAG_IS_ENABLED) { diff --git a/sys/dev/hwpmc/hwpmc_mips.c b/sys/dev/hwpmc/hwpmc_mips.c index edf83154dc57..1ed3fdea8915 100644 --- a/sys/dev/hwpmc/hwpmc_mips.c +++ b/sys/dev/hwpmc/hwpmc_mips.c @@ -319,9 +319,7 @@ mips_pmc_intr(struct trapframe *tf) static int mips_describe(int cpu, int ri, struct pmc_info *pi, struct pmc **ppmc) { - int error; struct pmc_hw *phw; - char mips_name[PMC_NAME_MAX]; KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), ("[mips,%d], illegal CPU %d", __LINE__, cpu)); @@ -329,10 +327,8 @@ mips_describe(int cpu, int ri, struct pmc_info *pi, struct pmc **ppmc) ("[mips,%d] row-index %d out of range", __LINE__, ri)); phw = &mips_pcpu[cpu]->pc_mipspmcs[ri]; - snprintf(mips_name, sizeof(mips_name), "MIPS-%d", ri); - if ((error = copystr(mips_name, pi->pm_name, PMC_NAME_MAX, - NULL)) != 0) - return error; + + snprintf(pi->pm_name, sizeof(pi->pm_name), "MIPS-%d", ri); pi->pm_class = mips_pmc_spec.ps_cpuclass; if (phw->phw_state & PMC_PHW_FLAG_IS_ENABLED) { pi->pm_enabled = TRUE; diff --git a/sys/dev/hwpmc/hwpmc_powerpc.c b/sys/dev/hwpmc/hwpmc_powerpc.c index 7c6df5825399..4c2a9cf84ef4 100644 --- a/sys/dev/hwpmc/hwpmc_powerpc.c +++ b/sys/dev/hwpmc/hwpmc_powerpc.c @@ -122,19 +122,16 @@ powerpc_switch_out(struct pmc_cpu *pc, struct pmc_process *pp) int powerpc_describe(int cpu, int ri, struct pmc_info *pi, struct pmc **ppmc) { - int error; struct pmc_hw *phw; - char powerpc_name[PMC_NAME_MAX]; KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), ("[powerpc,%d], illegal CPU %d", __LINE__, cpu)); phw = &powerpc_pcpu[cpu]->pc_ppcpmcs[ri]; - snprintf(powerpc_name, sizeof(powerpc_name), "POWERPC-%d", ri); - if ((error = copystr(powerpc_name, pi->pm_name, PMC_NAME_MAX, - NULL)) != 0) - return error; + + snprintf(pi->pm_name, sizeof(pi->pm_name), "POWERPC-%d", ri); pi->pm_class = powerpc_pcpu[cpu]->pc_class; + if (phw->phw_state & PMC_PHW_FLAG_IS_ENABLED) { pi->pm_enabled = TRUE; *ppmc = phw->phw_pmc; diff --git a/sys/dev/hwpmc/hwpmc_soft.c b/sys/dev/hwpmc/hwpmc_soft.c index cf2401e9159e..f3a6ffc70677 100644 --- a/sys/dev/hwpmc/hwpmc_soft.c +++ b/sys/dev/hwpmc/hwpmc_soft.c @@ -159,8 +159,6 @@ soft_config_pmc(int cpu, int ri, struct pmc *pm) static int soft_describe(int cpu, int ri, struct pmc_info *pi, struct pmc **ppmc) { - int error; - size_t copied; const struct soft_descr *pd; struct pmc_hw *phw; @@ -172,10 +170,7 @@ soft_describe(int cpu, int ri, struct pmc_info *pi, struct pmc **ppmc) phw = &soft_pcpu[cpu]->soft_hw[ri]; pd = &soft_pmcdesc[ri]; - if ((error = copystr(pd->pm_descr.pd_name, pi->pm_name, - PMC_NAME_MAX, &copied)) != 0) - return (error); - + strlcpy(pi->pm_name, pd->pm_descr.pd_name, sizeof(pi->pm_name)); pi->pm_class = pd->pm_descr.pd_class; if (phw->phw_state & PMC_PHW_FLAG_IS_ENABLED) { diff --git a/sys/dev/hwpmc/hwpmc_tsc.c b/sys/dev/hwpmc/hwpmc_tsc.c index d59c8908f4ca..25b2e9f8fd57 100644 --- a/sys/dev/hwpmc/hwpmc_tsc.c +++ b/sys/dev/hwpmc/hwpmc_tsc.c @@ -115,8 +115,6 @@ tsc_config_pmc(int cpu, int ri, struct pmc *pm) static int tsc_describe(int cpu, int ri, struct pmc_info *pi, struct pmc **ppmc) { - int error; - size_t copied; const struct tsc_descr *pd; struct pmc_hw *phw; @@ -127,10 +125,7 @@ tsc_describe(int cpu, int ri, struct pmc_info *pi, struct pmc **ppmc) phw = &tsc_pcpu[cpu]->tc_hw; pd = &tsc_pmcdesc[ri]; - if ((error = copystr(pd->pm_descr.pd_name, pi->pm_name, - PMC_NAME_MAX, &copied)) != 0) - return (error); - + strlcpy(pi->pm_name, pd->pm_descr.pd_name, sizeof(pi->pm_name)); pi->pm_class = pd->pm_descr.pd_class; if (phw->phw_state & PMC_PHW_FLAG_IS_ENABLED) { diff --git a/sys/dev/hwpmc/hwpmc_uncore.c b/sys/dev/hwpmc/hwpmc_uncore.c index c9ae128b55cf..47d1e62e2698 100644 --- a/sys/dev/hwpmc/hwpmc_uncore.c +++ b/sys/dev/hwpmc/hwpmc_uncore.c @@ -237,17 +237,11 @@ ucf_config_pmc(int cpu, int ri, struct pmc *pm) static int ucf_describe(int cpu, int ri, struct pmc_info *pi, struct pmc **ppmc) { - int error; struct pmc_hw *phw; - char ucf_name[PMC_NAME_MAX]; phw = &uncore_pcpu[cpu]->pc_uncorepmcs[ri + uncore_ucf_ri]; - (void) snprintf(ucf_name, sizeof(ucf_name), "UCF-%d", ri); - if ((error = copystr(ucf_name, pi->pm_name, PMC_NAME_MAX, - NULL)) != 0) - return (error); - + snprintf(pi->pm_name, sizeof(pi->pm_name), "UCF-%d", ri); pi->pm_class = PMC_CLASS_UCF; if (phw->phw_state & PMC_PHW_FLAG_IS_ENABLED) { @@ -564,17 +558,11 @@ ucp_config_pmc(int cpu, int ri, struct pmc *pm) static int ucp_describe(int cpu, int ri, struct pmc_info *pi, struct pmc **ppmc) { - int error; struct pmc_hw *phw; - char ucp_name[PMC_NAME_MAX]; phw = &uncore_pcpu[cpu]->pc_uncorepmcs[ri]; - (void) snprintf(ucp_name, sizeof(ucp_name), "UCP-%d", ri); - if ((error = copystr(ucp_name, pi->pm_name, PMC_NAME_MAX, - NULL)) != 0) - return (error); - + snprintf(pi->pm_name, sizeof(pi->pm_name), "UCP-%d", ri); pi->pm_class = PMC_CLASS_UCP; if (phw->phw_state & PMC_PHW_FLAG_IS_ENABLED) { From nobody Fri Jun 9 19:58:07 2023 X-Original-To: dev-commits-src-branches@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 4QdBhc0WYFz4cKQK; Fri, 9 Jun 2023 19:58: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QdBhc025Qz4Jbb; Fri, 9 Jun 2023 19:58:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686340688; 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=ayGBlWuyQbwsT6/kIXRCgOithr1XrVmAm6YB8Idsvk8=; b=f6IXziWojE86hGoprOnXIrsFWhmSGxvTzlyTT3bexyOt1eTaDPl/7OXCzI6YHm2DzzerCO OrygN29iYmLKgFnFATed1392G6qcD5JIiac3hyCCLIZSZ2btSu6aPJKjzKtscpzDn4gfPn 4cmvVtmfaRnaqe1nezJGwBH4M+ZY8nKIlV+Z0G4yrIcdLNNHWBctl3EbYbSLd1ryN364c9 YVLEIM5Ubvjlx0jGBLc6T1eCZsuB6m//gFqx4jIvxVIriwJBgYobR+uTtAr0ioEbUkY+NP PF8hYuxocjmbOaI89515+auOteQJptNfmMH26rMLBcQmIKqxhYhvmJkYuAL58Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686340688; 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=ayGBlWuyQbwsT6/kIXRCgOithr1XrVmAm6YB8Idsvk8=; b=gUqQGoDR5KumqAO9++SX9NUNc+WAaCNmklC/Yc1wKQ/oBdeeuUPVE/tXWUnsWhJGYzwgUh VCkHOyNC4U41lBy2xM8tbMgXsqmng+eBBxYZL8a9PLjh63JnQlibM0ZA7eNLqQC/mcs4Qm ejI1p3Ao07oO5eNzP5gqM3TRoiMQldXfyibKMFB4omnQ2wC/GyzG1L0Gq1P0tyJCu85ipz L4vr+HZfXSJM/fR27Yg/JhXbLR1ShADymwP4/SWhcupfI5C41niNT7ijdiyKgpebefs6eU 9J2IZpneNSlBHPO+2GiXL+k/lEEvJbDGhr14yToHGEIfrhVUUHtZf5eidqXa4Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686340688; a=rsa-sha256; cv=none; b=MMoaVbJiZr1AE+2df5rJrT/JOO+B8Wna7ITZpx9ZG2fQ/Z4L+vIc974aNdPO2PxPVdf2+e PrzsCBsU0warz71ZLXRMr5r3alAb7JyNUfZLOC6+ogenEoZSSoEbB8YB4dlkuDof78x05V phfiPEccjmO1qgWTN+gIv7bDfjoUGqBJE9l4ooZ4r5xt7Aev9WL2d3DX/Xs7pAMmFuT7rc F/4v3ETZF5PrGPqCqgtBvl08dFNVZfbst6nRwT6CFGl8lJd3B1BdGyiPKBNVhJ4OXT2L2E Ol/gb8LydwYXHWr2NWYxJeYkqdW/Z4mOaPOKwA5s5jGmis2ZcE6q5CP+yFD72A== 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 4QdBhb6Df2znf1; Fri, 9 Jun 2023 19:58:07 +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 359Jw7An072157; Fri, 9 Jun 2023 19:58:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 359Jw7I3072156; Fri, 9 Jun 2023 19:58:07 GMT (envelope-from git) Date: Fri, 9 Jun 2023 19:58:07 GMT Message-Id: <202306091958.359Jw7I3072156@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: ca05e98df02a - stable/13 - hwpmc_logging: less macro magic for type names List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ca05e98df02a1f83fadb453408b5eb8c3d2ac868 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=ca05e98df02a1f83fadb453408b5eb8c3d2ac868 commit ca05e98df02a1f83fadb453408b5eb8c3d2ac868 Author: Mitchell Horne AuthorDate: 2023-05-05 21:59:27 +0000 Commit: Mitchell Horne CommitDate: 2023-06-09 18:14:59 +0000 hwpmc_logging: less macro magic for type names Provide the log type names in their entirely, rather than relying on the macro to prepend the prefix. This improves their searchability; for example, if I see PMCLOG_TYPE_PMCALLOCATE in libpmc I will now be able to find where that is emitted in the kernel with a simple grep. Reviewed by: jkoshy, emaste MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D39911 (cherry picked from commit 3a7c9fc01bdae13edbd5724745b748e6a61065eb) --- sys/dev/hwpmc/hwpmc_logging.c | 57 +++++++++++++++++++++++++------------------ 1 file changed, 33 insertions(+), 24 deletions(-) diff --git a/sys/dev/hwpmc/hwpmc_logging.c b/sys/dev/hwpmc/hwpmc_logging.c index 5b6744ab752c..b0dca3c15827 100644 --- a/sys/dev/hwpmc/hwpmc_logging.c +++ b/sys/dev/hwpmc/hwpmc_logging.c @@ -116,9 +116,7 @@ static struct mtx pmc_kthread_mtx; /* sleep lock */ * Log file record constructors. */ #define _PMCLOG_TO_HEADER(T,L) \ - ((PMCLOG_HEADER_MAGIC << 24) | \ - (PMCLOG_TYPE_ ## T << 16) | \ - ((L) & 0xFFFF)) + ((PMCLOG_HEADER_MAGIC << 24) | (T << 16) | ((L) & 0xFFFF)) /* reserve LEN bytes of space and initialize the entry header */ #define _PMCLOG_RESERVE_SAFE(PO,TYPE,LEN,ACTION, TSC) do { \ @@ -722,7 +720,7 @@ pmclog_configure_log(struct pmc_mdep *md, struct pmc_owner *po, int logfd) PROC_UNLOCK(p); nanotime(&ts); /* create a log initialization entry */ - PMCLOG_RESERVE_WITH_ERROR(po, INITIALIZE, + PMCLOG_RESERVE_WITH_ERROR(po, PMCLOG_TYPE_INITIALIZE, sizeof(struct pmclog_initialize)); PMCLOG_EMIT32(PMC_VERSION); PMCLOG_EMIT32(md->pmd_cputype); @@ -922,7 +920,7 @@ pmclog_process_callchain(struct pmc *pm, struct pmc_sample *ps) ps->ps_nsamples * sizeof(uintfptr_t); po = pm->pm_owner; flags = PMC_CALLCHAIN_TO_CPUFLAGS(ps->ps_cpu,ps->ps_flags); - PMCLOG_RESERVE_SAFE(po, CALLCHAIN, recordlen, ps->ps_tsc); + PMCLOG_RESERVE_SAFE(po, PMCLOG_TYPE_CALLCHAIN, recordlen, ps->ps_tsc); PMCLOG_EMIT32(ps->ps_pid); PMCLOG_EMIT32(ps->ps_tid); PMCLOG_EMIT32(pm->pm_id); @@ -935,14 +933,16 @@ pmclog_process_callchain(struct pmc *pm, struct pmc_sample *ps) void pmclog_process_closelog(struct pmc_owner *po) { - PMCLOG_RESERVE(po,CLOSELOG,sizeof(struct pmclog_closelog)); + PMCLOG_RESERVE(po, PMCLOG_TYPE_CLOSELOG, + sizeof(struct pmclog_closelog)); PMCLOG_DESPATCH_SYNC(po); } void pmclog_process_dropnotify(struct pmc_owner *po) { - PMCLOG_RESERVE(po,DROPNOTIFY,sizeof(struct pmclog_dropnotify)); + PMCLOG_RESERVE(po, PMCLOG_TYPE_DROPNOTIFY, + sizeof(struct pmclog_dropnotify)); PMCLOG_DESPATCH(po); } @@ -958,7 +958,7 @@ pmclog_process_map_in(struct pmc_owner *po, pid_t pid, uintfptr_t start, recordlen = offsetof(struct pmclog_map_in, pl_pathname) + pathlen; - PMCLOG_RESERVE(po, MAP_IN, recordlen); + PMCLOG_RESERVE(po, PMCLOG_TYPE_MAP_IN, recordlen); PMCLOG_EMIT32(pid); PMCLOG_EMIT32(0); PMCLOG_EMITADDR(start); @@ -972,7 +972,7 @@ pmclog_process_map_out(struct pmc_owner *po, pid_t pid, uintfptr_t start, { KASSERT(start <= end, ("[pmclog,%d] start > end", __LINE__)); - PMCLOG_RESERVE(po, MAP_OUT, sizeof(struct pmclog_map_out)); + PMCLOG_RESERVE(po, PMCLOG_TYPE_MAP_OUT, sizeof(struct pmclog_map_out)); PMCLOG_EMIT32(pid); PMCLOG_EMIT32(0); PMCLOG_EMITADDR(start); @@ -991,7 +991,7 @@ pmclog_process_pmcallocate(struct pmc *pm) PMCDBG1(LOG,ALL,1, "pm=%p", pm); if (PMC_TO_CLASS(pm) == PMC_CLASS_SOFT) { - PMCLOG_RESERVE(po, PMCALLOCATEDYN, + PMCLOG_RESERVE(po, PMCLOG_TYPE_PMCALLOCATEDYN, sizeof(struct pmclog_pmcallocatedyn)); PMCLOG_EMIT32(pm->pm_id); PMCLOG_EMIT32(pm->pm_event); @@ -1006,7 +1006,7 @@ pmclog_process_pmcallocate(struct pmc *pm) pmc_soft_ev_release(ps); PMCLOG_DESPATCH_SYNC(po); } else { - PMCLOG_RESERVE(po, PMCALLOCATE, + PMCLOG_RESERVE(po, PMCLOG_TYPE_PMCALLOCATE, sizeof(struct pmclog_pmcallocate)); PMCLOG_EMIT32(pm->pm_id); PMCLOG_EMIT32(pm->pm_event); @@ -1030,7 +1030,7 @@ pmclog_process_pmcattach(struct pmc *pm, pid_t pid, char *path) pathlen = strlen(path) + 1; /* #bytes for the string */ recordlen = offsetof(struct pmclog_pmcattach, pl_pathname) + pathlen; - PMCLOG_RESERVE(po, PMCATTACH, recordlen); + PMCLOG_RESERVE(po, PMCLOG_TYPE_PMCATTACH, recordlen); PMCLOG_EMIT32(pm->pm_id); PMCLOG_EMIT32(pid); PMCLOG_EMITSTRING(path, pathlen); @@ -1046,7 +1046,8 @@ pmclog_process_pmcdetach(struct pmc *pm, pid_t pid) po = pm->pm_owner; - PMCLOG_RESERVE(po, PMCDETACH, sizeof(struct pmclog_pmcdetach)); + PMCLOG_RESERVE(po, PMCLOG_TYPE_PMCDETACH, + sizeof(struct pmclog_pmcdetach)); PMCLOG_EMIT32(pm->pm_id); PMCLOG_EMIT32(pid); PMCLOG_DESPATCH_SYNC(po); @@ -1056,13 +1057,15 @@ void pmclog_process_proccreate(struct pmc_owner *po, struct proc *p, int sync) { if (sync) { - PMCLOG_RESERVE(po, PROC_CREATE, sizeof(struct pmclog_proccreate)); + PMCLOG_RESERVE(po, PMCLOG_TYPE_PROC_CREATE, + sizeof(struct pmclog_proccreate)); PMCLOG_EMIT32(p->p_pid); PMCLOG_EMIT32(p->p_flag); PMCLOG_EMITSTRING(p->p_comm, MAXCOMLEN+1); PMCLOG_DESPATCH_SYNC(po); } else { - PMCLOG_RESERVE(po, PROC_CREATE, sizeof(struct pmclog_proccreate)); + PMCLOG_RESERVE(po, PMCLOG_TYPE_PROC_CREATE, + sizeof(struct pmclog_proccreate)); PMCLOG_EMIT32(p->p_pid); PMCLOG_EMIT32(p->p_flag); PMCLOG_EMITSTRING(p->p_comm, MAXCOMLEN+1); @@ -1087,7 +1090,8 @@ pmclog_process_proccsw(struct pmc *pm, struct pmc_process *pp, pmc_value_t v, st po = pm->pm_owner; - PMCLOG_RESERVE_SAFE(po, PROCCSW, sizeof(struct pmclog_proccsw), pmc_rdtsc()); + PMCLOG_RESERVE_SAFE(po, PMCLOG_TYPE_PROCCSW, + sizeof(struct pmclog_proccsw), pmc_rdtsc()); PMCLOG_EMIT64(v); PMCLOG_EMIT32(pm->pm_id); PMCLOG_EMIT32(pp->pp_proc->p_pid); @@ -1106,7 +1110,7 @@ pmclog_process_procexec(struct pmc_owner *po, pmc_id_t pmid, pid_t pid, pathlen = strlen(path) + 1; /* #bytes for the path */ recordlen = offsetof(struct pmclog_procexec, pl_pathname) + pathlen; - PMCLOG_RESERVE(po, PROCEXEC, recordlen); + PMCLOG_RESERVE(po, PMCLOG_TYPE_PROCEXEC, recordlen); PMCLOG_EMIT32(pid); PMCLOG_EMIT32(pmid); PMCLOG_EMITADDR(startaddr); @@ -1130,7 +1134,8 @@ pmclog_process_procexit(struct pmc *pm, struct pmc_process *pp) po = pm->pm_owner; - PMCLOG_RESERVE(po, PROCEXIT, sizeof(struct pmclog_procexit)); + PMCLOG_RESERVE(po, PMCLOG_TYPE_PROCEXIT, + sizeof(struct pmclog_procexit)); PMCLOG_EMIT32(pm->pm_id); PMCLOG_EMIT32(pp->pp_proc->p_pid); PMCLOG_EMIT64(pp->pp_pmcs[ri].pp_pmcval); @@ -1144,7 +1149,8 @@ pmclog_process_procexit(struct pmc *pm, struct pmc_process *pp) void pmclog_process_procfork(struct pmc_owner *po, pid_t oldpid, pid_t newpid) { - PMCLOG_RESERVE(po, PROCFORK, sizeof(struct pmclog_procfork)); + PMCLOG_RESERVE(po, PMCLOG_TYPE_PROCFORK, + sizeof(struct pmclog_procfork)); PMCLOG_EMIT32(oldpid); PMCLOG_EMIT32(newpid); PMCLOG_DESPATCH(po); @@ -1157,7 +1163,7 @@ pmclog_process_procfork(struct pmc_owner *po, pid_t oldpid, pid_t newpid) void pmclog_process_sysexit(struct pmc_owner *po, pid_t pid) { - PMCLOG_RESERVE(po, SYSEXIT, sizeof(struct pmclog_sysexit)); + PMCLOG_RESERVE(po, PMCLOG_TYPE_SYSEXIT, sizeof(struct pmclog_sysexit)); PMCLOG_EMIT32(pid); PMCLOG_DESPATCH(po); } @@ -1169,7 +1175,8 @@ pmclog_process_threadcreate(struct pmc_owner *po, struct thread *td, int sync) p = td->td_proc; if (sync) { - PMCLOG_RESERVE(po, THR_CREATE, sizeof(struct pmclog_threadcreate)); + PMCLOG_RESERVE(po, PMCLOG_TYPE_THR_CREATE, + sizeof(struct pmclog_threadcreate)); PMCLOG_EMIT32(td->td_tid); PMCLOG_EMIT32(p->p_pid); PMCLOG_EMIT32(p->p_flag); @@ -1177,7 +1184,8 @@ pmclog_process_threadcreate(struct pmc_owner *po, struct thread *td, int sync) PMCLOG_EMITSTRING(td->td_name, MAXCOMLEN+1); PMCLOG_DESPATCH_SYNC(po); } else { - PMCLOG_RESERVE(po, THR_CREATE, sizeof(struct pmclog_threadcreate)); + PMCLOG_RESERVE(po, PMCLOG_TYPE_THR_CREATE, + sizeof(struct pmclog_threadcreate)); PMCLOG_EMIT32(td->td_tid); PMCLOG_EMIT32(p->p_pid); PMCLOG_EMIT32(p->p_flag); @@ -1191,7 +1199,8 @@ void pmclog_process_threadexit(struct pmc_owner *po, struct thread *td) { - PMCLOG_RESERVE(po, THR_EXIT, sizeof(struct pmclog_threadexit)); + PMCLOG_RESERVE(po, PMCLOG_TYPE_THR_EXIT, + sizeof(struct pmclog_threadexit)); PMCLOG_EMIT32(td->td_tid); PMCLOG_DESPATCH(po); } @@ -1209,7 +1218,7 @@ pmclog_process_userlog(struct pmc_owner *po, struct pmc_op_writelog *wl) error = 0; - PMCLOG_RESERVE_WITH_ERROR(po, USERDATA, + PMCLOG_RESERVE_WITH_ERROR(po, PMCLOG_TYPE_USERDATA, sizeof(struct pmclog_userdata)); PMCLOG_EMIT32(wl->pm_userdata); PMCLOG_DESPATCH(po); From nobody Fri Jun 9 19:58:08 2023 X-Original-To: dev-commits-src-branches@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 4QdBhd5z5pz4cKdg; Fri, 9 Jun 2023 19:58:09 +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 4QdBhd158zz4JWM; Fri, 9 Jun 2023 19:58:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686340689; 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=QCUmINrx5cHsRXP1UJ3G+56xaIZJBZvQOqqHZoPfvjU=; b=absEjJoa0uhYM3upo8FPdzV2CL6fIBnNRhiFASgHrikEJ0LdBneEI/kbnx0NFnTIW0xFeP TL0nQbiV9V/ii/EgKpQ9x4DdrEIFm9Pznhv2x1ZNwhuwqOHrI7H7Ot6FFDY1IF6yGqnJYZ Qxe4xmXlyjMZ+U90f6PDKiVYGPMTC09gfMB/FWfccsGTYfTqad6p/hQRoxIh0t5kUBArCK qMO714EOVN0suk9j1XELVN5ZTTBw7vAPy0H4VUtZKOrcU5JdO1YQqpCv9Vl457/G5L72mc 1p8D0wlEX4qLZ5O/mGemyeBPzxsMdPbEmf8EW0LQj6nXEV4KHj4yaEmlTzlSuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686340689; 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=QCUmINrx5cHsRXP1UJ3G+56xaIZJBZvQOqqHZoPfvjU=; b=pseV4Trg2Ia3z/oFedvY6N4+h5OUxThUElWe8jJs/i5z3mRKJuROeuP0iI6Yk2tW0bb1D4 bRHb7S0Vo+QrPZjl8PDTETr9JdAvfFtKNeCw3tAHX3YYfb/jhajc8rvTZaLLV8qvYdYAzc mBdrL82DPIoQ3gtSL53UqVltKVAwgTh1g7xBqr36Pjb6m3HSZdOtO8cVJsNBYKsjTer4Vb HfjbAUvdYSjX6jx4KZc4I9ihdntAXTZeIIRXEKpnJkRAZJM80J4RXil8ekORTcP9Ndq5eW tI0ECEro2OoxshzSa+xc3FehXQmqI7Mo+0BQnq6FDSyyaz1dbyQhApd1Y+JJrQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686340689; a=rsa-sha256; cv=none; b=DVjBRDcn1sey8YSLUtMR6+IV+3sLCKfPW4G7rQHGcKakJctlphbDgy2zn3GR7Nt+9YPLYI OYoB/bd3dR2jH4w1Kho74q5Nk8baeb1nswNVung0vO4IFB8Lz+vSMizmyBidNmfy1H1Zfb YpP94b2WiSYKWcdaF3TajDcdJhp8e0/nCaBf+nW86F7371Go1DbMUNNswCFi6/ZurbJy7J nyJ+FlpT44r8BX8xvrumPvWqwsv4wP+ufwJkMlVs9WZ/I8486bQbfnO67I6IqAiZllPIko ZvEQNKNrPZkwzj0Y6HyjCcJNfgSwFWsOaFpijKfCUxNKUUKgkpgsu+tBe/g0vQ== 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 4QdBhd0C9zzp9B; Fri, 9 Jun 2023 19:58:09 +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 359Jw8ij072176; Fri, 9 Jun 2023 19:58:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 359Jw8vl072175; Fri, 9 Jun 2023 19:58:08 GMT (envelope-from git) Date: Fri, 9 Jun 2023 19:58:08 GMT Message-Id: <202306091958.359Jw8vl072175@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 6b5db9d3af04 - stable/13 - hwpmc: simplify arm64 kernel stack unwinding List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6b5db9d3af0497e4538d6fd43df2596172867568 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=6b5db9d3af0497e4538d6fd43df2596172867568 commit 6b5db9d3af0497e4538d6fd43df2596172867568 Author: Mitchell Horne AuthorDate: 2023-05-05 21:58:40 +0000 Commit: Mitchell Horne CommitDate: 2023-06-09 18:14:59 +0000 hwpmc: simplify arm64 kernel stack unwinding Use the unwind_frame() function, which properly validates the frame pointer and uses ADDR_MAKE_CANONICAL() for the pc, required when PAC is enabled. Reviewed by: andrew, markj, jkoshy MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D39934 (cherry picked from commit 5387495773e9e92441b795c0eb8c2a3ecc25708a) --- sys/dev/hwpmc/hwpmc_arm64_md.c | 31 ++++++++++--------------------- 1 file changed, 10 insertions(+), 21 deletions(-) diff --git a/sys/dev/hwpmc/hwpmc_arm64_md.c b/sys/dev/hwpmc/hwpmc_arm64_md.c index 015bee227f89..996c91eea592 100644 --- a/sys/dev/hwpmc/hwpmc_arm64_md.c +++ b/sys/dev/hwpmc/hwpmc_arm64_md.c @@ -62,7 +62,8 @@ int pmc_save_kernel_callchain(uintptr_t *cc, int maxsamples, struct trapframe *tf) { - uintptr_t pc, r, stackstart, stackend, fp; + struct unwind_state frame; + uintptr_t stackstart, stackend; struct thread *td; int count; @@ -70,38 +71,26 @@ pmc_save_kernel_callchain(uintptr_t *cc, int maxsamples, __LINE__)); td = curthread; - pc = PMC_TRAPFRAME_TO_PC(tf); - *cc++ = pc; + frame.pc = PMC_TRAPFRAME_TO_PC(tf); + *cc++ = frame.pc; if (maxsamples <= 1) return (1); stackstart = (uintptr_t) td->td_kstack; stackend = (uintptr_t) td->td_kstack + td->td_kstack_pages * PAGE_SIZE; - fp = PMC_TRAPFRAME_TO_FP(tf); + frame.fp = PMC_TRAPFRAME_TO_FP(tf); - if (!PMC_IN_KERNEL(pc) || - !PMC_IN_KERNEL_STACK(fp, stackstart, stackend)) + if (!PMC_IN_KERNEL(frame.pc) || + !PMC_IN_KERNEL_STACK(frame.fp, stackstart, stackend)) return (1); for (count = 1; count < maxsamples; count++) { - /* Use saved lr as pc. */ - r = fp + sizeof(uintptr_t); - if (!PMC_IN_KERNEL_STACK(r, stackstart, stackend)) - break; - pc = *(uintptr_t *)r; - if (!PMC_IN_KERNEL(pc)) - break; - - *cc++ = pc; - - /* Switch to next frame up */ - r = fp; - if (!PMC_IN_KERNEL_STACK(r, stackstart, stackend)) + if (!unwind_frame(curthread, &frame)) break; - fp = *(uintptr_t *)r; - if (!PMC_IN_KERNEL_STACK(fp, stackstart, stackend)) + if (!PMC_IN_KERNEL(frame.pc)) break; + *cc++ = frame.pc; } return (count); From nobody Fri Jun 9 19:58:10 2023 X-Original-To: dev-commits-src-branches@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 4QdBhf4Fvyz4cKSw; Fri, 9 Jun 2023 19:58:10 +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 4QdBhf2CsYz4JWb; Fri, 9 Jun 2023 19:58:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686340690; 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=THOeQ5+rMmn9ZWsf37tPZTSsCn7g5vy1BMM60zLwmio=; b=xQY5RKfO4gK+xO4xNUwlDQQLXJoD3Li31A8OXVTRYXb+TcrjesCxcZrZ1AWc74fjzuXmsI 3ZoI/aTCL8+PYpoGyyXThc556kcUWo0i4d+dTL8+ttJtT6F4bjxkYCqeiHR5+VeRuDo0mr DFj3zk0T3Dx6Jy5CLKzUkf64dA8C3coUjxt6G2oZjPkK+3MbZNS5Ak05PDtXgAB/NeyIjo jsQbAJ6aOi/8cB4GI6Hv0lk4PJAK14CpMGld3TGuF/MS76wDYoZ74KAOokh6pKV5OuH92g NdGa8e31gTQB7XlhZDCmujs1FTYz1yU6rQbatcPAS1wq78iphlB4JSzALlOjJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686340690; 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=THOeQ5+rMmn9ZWsf37tPZTSsCn7g5vy1BMM60zLwmio=; b=vSbDlbZLgQQPF32Lep8ovP0oGO406aU7mL+M44uKuAwelPQ8wikpvEi0zI69+JWMCvYD16 Zkx9bKACDe/vXaX+KzBQdKXLGk5+/MT3bG9DNkBaUpaFA0KiYqgKIrJobFC62bAH+9jXXZ 8F+6rfzJgyqSc14OUNiKVkf/sr0tgwSoiklMp04LxS6FeQUb1d0zF0jkECM39EYpd4CFnO cX0j4clwYMTLy3nPhxkMvjx3TnoLzKAm+IsOkQ+4W/AOlDV2KMj7xloXzMis94MIVtzDYL XEI1YZ2jJMdR1RFxp9CeLSlObczrry8lmtFGsLUi+m2G35506NLs54h53qvpGg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686340690; a=rsa-sha256; cv=none; b=txi4XrF1pS690d+9X2XrLt+HeOGQccxCEeHp2lt07lEHYJTm18kfKMIcAvmvRaWm3Oagb0 Ounqczp31MwJZnWxRajMqmjWkN6JHtw2qdmrRUe69JjO87PfRQmuD+HsdoLStkD2Z/tK0m wxaxfUIM2ViTVl7RvGLBO21BjteFBCXNcddtCX8mLqchwqB8FhPS9nT07NZQH69cr6isUr Wvpj9mT0+rlCnrSXF9TA0Gwi8gq7/UCO6zHBO/dVP+MzjwED2UD3xWbHtdWrK2eByQ2MgN MYQnDkdZeSX3kty9xZ6sCbKxm+QHp2KkVf6Md/VTjfX1ehjkYDOtzvPbYExGCQ== 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 4QdBhf1Jpmzp7Q; Fri, 9 Jun 2023 19:58:10 +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 359JwAvN072201; Fri, 9 Jun 2023 19:58:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 359JwAwj072200; Fri, 9 Jun 2023 19:58:10 GMT (envelope-from git) Date: Fri, 9 Jun 2023 19:58:10 GMT Message-Id: <202306091958.359JwAwj072200@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 14df23cfeadc - stable/13 - hwpmc: purge EOL release compatibility List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 14df23cfeadc70b757c09277db6e1040713701a2 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=14df23cfeadc70b757c09277db6e1040713701a2 commit 14df23cfeadc70b757c09277db6e1040713701a2 Author: Elliott Mitchell AuthorDate: 2022-09-08 16:16:03 +0000 Commit: Mitchell Horne CommitDate: 2023-06-09 18:14:59 +0000 hwpmc: purge EOL release compatibility (cherry picked from commit cb6abe87cf1c178ea1b9cd8a385e53459aef96e8) --- sys/dev/hwpmc/hwpmc_logging.c | 6 ------ sys/dev/hwpmc/hwpmc_uncore.c | 4 ---- sys/dev/hwpmc/hwpmc_x86.c | 4 ---- 3 files changed, 14 deletions(-) diff --git a/sys/dev/hwpmc/hwpmc_logging.c b/sys/dev/hwpmc/hwpmc_logging.c index b0dca3c15827..e0ff87619137 100644 --- a/sys/dev/hwpmc/hwpmc_logging.c +++ b/sys/dev/hwpmc/hwpmc_logging.c @@ -79,9 +79,6 @@ SYSCTL_DECL(_kern_hwpmc); */ static int pmclog_buffer_size = PMC_LOG_BUFFER_SIZE; -#if (__FreeBSD_version < 1100000) -TUNABLE_INT(PMC_SYSCTL_NAME_PREFIX "logbuffersize", &pmclog_buffer_size); -#endif SYSCTL_INT(_kern_hwpmc, OID_AUTO, logbuffersize, CTLFLAG_RDTUN, &pmclog_buffer_size, 0, "size of log buffers in kilobytes"); @@ -90,9 +87,6 @@ SYSCTL_INT(_kern_hwpmc, OID_AUTO, logbuffersize, CTLFLAG_RDTUN, */ static int pmc_nlogbuffers_pcpu = PMC_NLOGBUFFERS_PCPU; -#if (__FreeBSD_version < 1100000) -TUNABLE_INT(PMC_SYSCTL_NAME_PREFIX "nbuffers", &pmc_nlogbuffers_pcpu); -#endif SYSCTL_INT(_kern_hwpmc, OID_AUTO, nbuffers_pcpu, CTLFLAG_RDTUN, &pmc_nlogbuffers_pcpu, 0, "number of log buffers per cpu"); diff --git a/sys/dev/hwpmc/hwpmc_uncore.c b/sys/dev/hwpmc/hwpmc_uncore.c index 47d1e62e2698..7f61deedfd79 100644 --- a/sys/dev/hwpmc/hwpmc_uncore.c +++ b/sys/dev/hwpmc/hwpmc_uncore.c @@ -40,11 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include -#if (__FreeBSD_version >= 1100000) #include -#else -#include -#endif #include #include #include diff --git a/sys/dev/hwpmc/hwpmc_x86.c b/sys/dev/hwpmc/hwpmc_x86.c index 935ffefcf980..c30089accbef 100644 --- a/sys/dev/hwpmc/hwpmc_x86.c +++ b/sys/dev/hwpmc/hwpmc_x86.c @@ -42,11 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#if (__FreeBSD_version >= 1100000) #include -#else -#include -#endif #include #include From nobody Fri Jun 9 19:58:11 2023 X-Original-To: dev-commits-src-branches@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 4QdBhg45Z1z4cKb4; Fri, 9 Jun 2023 19:58: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QdBhg35wlz4Jfq; Fri, 9 Jun 2023 19:58:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686340691; 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=thDS9/n3CQUR8ZqqWfJTxVSu5wmCx9k1FMclMV+aH5Y=; b=CzvJSKzDt4mg5RNQCwszkAewj0w+Qf328zZtiUqHC6bv0iTD5cA27r8g6t5OrP3h3exjXi 0NKObnyQLjAD0tmuFtVHJyYmhraXxO+36RTXAMA2f2HbL+JQBoESa5LqpL4EMPxxOexYYS UG2w/oD+igEtH3A3zEmPj3tbwlAnbWLlUY4aC3W6QtR4zPl0EEIVzER8bg/Dr0U0PXHI4L paotrvoJN15XRgMC4PzPHBOgM7D1X5adMdjQgYAEXuyoiveYW4YJNFAJDAqp7zB3ydYSXw soO1vxLjaKsMp52BLwFONn3CxqO6nq+hz1ZmV9ZBAEgDYbSvRlKyffbmcgNI3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686340691; 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=thDS9/n3CQUR8ZqqWfJTxVSu5wmCx9k1FMclMV+aH5Y=; b=MacaDOKwWc0g2kS4ejaf30/q1+jrqGyMSW4dfTabq8Cy+wq4WFur9XK4aqOy0vcWB/CHxf q0HoU9OXVp8du/WOFfPM1SOtU8PhxnenjGu60zxi0Utoagw7Jv9uDv6jfAEN6dgwpKFzMx CROXTgmPTOcrmjB2zVpII/r2CDDvJdK0mXLQLm998cLI2NsygTWrIG2/99+ENX6nPwJWsm uMMNLCe5mgCAabWX8VU0M/gde7OIjEHbKv9NpifnOLYv96XWaTfcW04LXeGx1uY4CBUtlY DA88i2Xs6+OIk/WLk8AxMyZca7jAeiGtQqu+nhb4z5vI+2BMMnzhpej1yXk6eA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686340691; a=rsa-sha256; cv=none; b=IBx1yUkINQ5yn9YkUZgv9JC05X60w7HUjSpgeK0Alzj5Fb4iKN6WBfTCundqdmkcNHgN/f cZuKu3Sw8R4UdnxOijIe/u2TDzQ92UDrDXWL91TzsYO+3pROVKqjYOGTLFmiADX7bgzh/p 6OK5IWOrVarluhIb66XZopx9Usz5VNtNnn/2TeBeVF5+OGM2uUDRtldX2Nxab/eSy/GDTO Ew/iHWXQVbCanBnn18IRpkJYMfKOrwtMk+ye3RlD0e8ii1tdoarto1x73waY/l+uAwd/hp 0RSrBE0aU+cyIkYahMaz3wFsKvqTnrSIKsKG2alHwACVzU4Vnb+FMMOk8ijFaQ== 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 4QdBhg2Cl6zp9C; Fri, 9 Jun 2023 19:58:11 +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 359JwBwc072220; Fri, 9 Jun 2023 19:58:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 359JwBmQ072219; Fri, 9 Jun 2023 19:58:11 GMT (envelope-from git) Date: Fri, 9 Jun 2023 19:58:11 GMT Message-Id: <202306091958.359JwBmQ072219@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 9520dca1cef4 - stable/13 - hwpmc: use kstack_contains() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 9520dca1cef41d8850833f89160da83b0d59bdae Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=9520dca1cef41d8850833f89160da83b0d59bdae commit 9520dca1cef41d8850833f89160da83b0d59bdae Author: Mitchell Horne AuthorDate: 2023-05-05 21:59:01 +0000 Commit: Mitchell Horne CommitDate: 2023-06-09 18:14:59 +0000 hwpmc: use kstack_contains() This existing helper function is preferable to the hand-rolled calculation of the kstack bounds. Make some small style improvements while here. Notably, rename every instance of "r", the return address, to "ra". Tidy the includes in the affected files. Reviewed by: jkoshy MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D39909 (cherry picked from commit aba91805aa92a47b2f3f01741a55ff9f07c42d04) --- sys/amd64/include/pmc_mdep.h | 8 +++--- sys/arm/include/pmc_mdep.h | 6 ++--- sys/arm64/include/pmc_mdep.h | 9 +++---- sys/dev/hwpmc/hwpmc_arm.c | 35 +++++++++++--------------- sys/dev/hwpmc/hwpmc_arm64_md.c | 23 ++++++----------- sys/dev/hwpmc/hwpmc_x86.c | 56 ++++++++++++++++++------------------------ sys/i386/include/pmc_mdep.h | 6 ++--- sys/riscv/include/pmc_mdep.h | 11 ++++----- 8 files changed, 61 insertions(+), 93 deletions(-) diff --git a/sys/amd64/include/pmc_mdep.h b/sys/amd64/include/pmc_mdep.h index 026a9ae2e669..5563f5b1bdbb 100644 --- a/sys/amd64/include/pmc_mdep.h +++ b/sys/amd64/include/pmc_mdep.h @@ -109,11 +109,9 @@ union pmc_md_pmc { ((PC) >= (uintptr_t) start_exceptions && \ (PC) < (uintptr_t) end_exceptions) -#define PMC_IN_KERNEL_STACK(S,START,END) \ - ((S) >= (START) && (S) < (END)) -#define PMC_IN_KERNEL(va) INKERNEL(va) - -#define PMC_IN_USERSPACE(va) ((va) <= VM_MAXUSER_ADDRESS) +#define PMC_IN_KERNEL_STACK(va) kstack_contains(curthread, (va), sizeof(va)) +#define PMC_IN_KERNEL(va) INKERNEL(va) +#define PMC_IN_USERSPACE(va) ((va) <= VM_MAXUSER_ADDRESS) /* Build a fake kernel trapframe from current instruction pointer. */ #define PMC_FAKE_TRAPFRAME(TF) \ diff --git a/sys/arm/include/pmc_mdep.h b/sys/arm/include/pmc_mdep.h index 69cb0c84deca..d7b80abb64b0 100644 --- a/sys/arm/include/pmc_mdep.h +++ b/sys/arm/include/pmc_mdep.h @@ -52,11 +52,9 @@ union pmc_md_pmc { struct pmc_md_armv7_pmc pm_armv7; }; -#define PMC_IN_KERNEL_STACK(S,START,END) \ - ((S) >= (START) && (S) < (END)) +#define PMC_IN_KERNEL_STACK(va) kstack_contains(curthread, (va), sizeof(va)) #define PMC_IN_KERNEL(va) INKERNEL((va)) - -#define PMC_IN_USERSPACE(va) ((va) <= VM_MAXUSER_ADDRESS) +#define PMC_IN_USERSPACE(va) ((va) <= VM_MAXUSER_ADDRESS) #define PMC_TRAPFRAME_TO_PC(TF) ((TF)->tf_pc) #define PMC_TRAPFRAME_TO_FP(TF) ((TF)->tf_r11) diff --git a/sys/arm64/include/pmc_mdep.h b/sys/arm64/include/pmc_mdep.h index dec90b386b13..c7145690bae8 100644 --- a/sys/arm64/include/pmc_mdep.h +++ b/sys/arm64/include/pmc_mdep.h @@ -55,12 +55,11 @@ union pmc_md_pmc { struct pmc_md_arm64_pmc pm_arm64; }; -#define PMC_IN_KERNEL_STACK(S,START,END) \ - ((S) >= (START) && (S) < (END)) +#define PMC_IN_KERNEL_STACK(va) kstack_contains(curthread, (va), sizeof(va)) #define PMC_IN_KERNEL(va) INKERNEL((va)) -#define PMC_IN_USERSPACE(va) ((va) <= VM_MAXUSER_ADDRESS) -#define PMC_TRAPFRAME_TO_PC(TF) ((TF)->tf_elr) -#define PMC_TRAPFRAME_TO_FP(TF) ((TF)->tf_x[29]) +#define PMC_IN_USERSPACE(va) ((va) <= VM_MAXUSER_ADDRESS) +#define PMC_TRAPFRAME_TO_PC(TF) ((TF)->tf_elr) +#define PMC_TRAPFRAME_TO_FP(TF) ((TF)->tf_x[29]) /* * Prototypes diff --git a/sys/dev/hwpmc/hwpmc_arm.c b/sys/dev/hwpmc/hwpmc_arm.c index c585a6cefd1e..a0e2e6823219 100644 --- a/sys/dev/hwpmc/hwpmc_arm.c +++ b/sys/dev/hwpmc/hwpmc_arm.c @@ -31,18 +31,17 @@ __FBSDID("$FreeBSD$"); #include -#include -#include #include +#include + +#include +#include #include #include #include #include - -#include -#include -#include +#include /* XXX: Userland code compiled with gcc will need an heuristic * to be correctly detected. @@ -78,45 +77,39 @@ int pmc_save_kernel_callchain(uintptr_t *cc, int maxsamples, struct trapframe *tf) { - uintptr_t pc, r, stackstart, stackend, fp; - struct thread *td; + uintptr_t pc, ra, fp; int count; KASSERT(TRAPF_USERMODE(tf) == 0,("[arm,%d] not a kernel backtrace", __LINE__)); - td = curthread; pc = PMC_TRAPFRAME_TO_PC(tf); *cc++ = pc; if (maxsamples <= 1) return (1); - stackstart = (uintptr_t) td->td_kstack; - stackend = (uintptr_t) td->td_kstack + td->td_kstack_pages * PAGE_SIZE; fp = PMC_TRAPFRAME_TO_FP(tf); - - if (!PMC_IN_KERNEL(pc) || - !PMC_IN_KERNEL_STACK(fp, stackstart, stackend)) + if (!PMC_IN_KERNEL(pc) || !PMC_IN_KERNEL_STACK(fp)) return (1); for (count = 1; count < maxsamples; count++) { /* Use saved lr as pc. */ - r = fp + PC_OFF * sizeof(uintptr_t); - if (!PMC_IN_KERNEL_STACK(r, stackstart, stackend)) + ra = fp + PC_OFF * sizeof(uintptr_t); + if (!PMC_IN_KERNEL_STACK(ra)) break; - pc = *(uintptr_t *)r; + pc = *(uintptr_t *)ra; if (!PMC_IN_KERNEL(pc)) break; *cc++ = pc; /* Switch to next frame up */ - r = fp + FP_OFF * sizeof(uintptr_t); - if (!PMC_IN_KERNEL_STACK(r, stackstart, stackend)) + ra = fp + FP_OFF * sizeof(uintptr_t); + if (!PMC_IN_KERNEL_STACK(ra)) break; - fp = *(uintptr_t *)r; - if (!PMC_IN_KERNEL_STACK(fp, stackstart, stackend)) + fp = *(uintptr_t *)ra; + if (!PMC_IN_KERNEL_STACK(fp)) break; } diff --git a/sys/dev/hwpmc/hwpmc_arm64_md.c b/sys/dev/hwpmc/hwpmc_arm64_md.c index 996c91eea592..8ea363520a3f 100644 --- a/sys/dev/hwpmc/hwpmc_arm64_md.c +++ b/sys/dev/hwpmc/hwpmc_arm64_md.c @@ -31,18 +31,17 @@ __FBSDID("$FreeBSD$"); #include -#include -#include #include +#include + +#include +#include #include #include #include #include - -#include -#include -#include +#include struct pmc_mdep * pmc_md_initialize(void) @@ -59,30 +58,22 @@ pmc_md_finalize(struct pmc_mdep *md) } int -pmc_save_kernel_callchain(uintptr_t *cc, int maxsamples, - struct trapframe *tf) +pmc_save_kernel_callchain(uintptr_t *cc, int maxsamples, struct trapframe *tf) { struct unwind_state frame; - uintptr_t stackstart, stackend; - struct thread *td; int count; KASSERT(TRAPF_USERMODE(tf) == 0,("[arm,%d] not a kernel backtrace", __LINE__)); - td = curthread; frame.pc = PMC_TRAPFRAME_TO_PC(tf); *cc++ = frame.pc; if (maxsamples <= 1) return (1); - stackstart = (uintptr_t) td->td_kstack; - stackend = (uintptr_t) td->td_kstack + td->td_kstack_pages * PAGE_SIZE; frame.fp = PMC_TRAPFRAME_TO_FP(tf); - - if (!PMC_IN_KERNEL(frame.pc) || - !PMC_IN_KERNEL_STACK(frame.fp, stackstart, stackend)) + if (!PMC_IN_KERNEL(frame.pc) || !PMC_IN_KERNEL_STACK(frame.fp)) return (1); for (count = 1; count < maxsamples; count++) { diff --git a/sys/dev/hwpmc/hwpmc_x86.c b/sys/dev/hwpmc/hwpmc_x86.c index c30089accbef..9bbe66b2dfaf 100644 --- a/sys/dev/hwpmc/hwpmc_x86.c +++ b/sys/dev/hwpmc/hwpmc_x86.c @@ -34,21 +34,22 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include -#include -#include + +#include +#include #include #include -#include -#include -#include +#include /* For x86/apicvar.h */ #include +#include +#include +#include -#include -#include -#include +#include #include "hwpmc_soft.h" @@ -155,36 +156,29 @@ pmc_save_user_callchain(uintptr_t *cc, int nframes, struct trapframe *tf) int __nosanitizeaddress pmc_save_kernel_callchain(uintptr_t *cc, int nframes, struct trapframe *tf) { - int n; + uintptr_t fp, pc, ra, sp; uint32_t instr; - uintptr_t fp, pc, r, sp, stackstart, stackend; - struct thread *td; + int n; KASSERT(TRAPF_USERMODE(tf) == 0,("[x86,%d] not a kernel backtrace", __LINE__)); - td = curthread; pc = PMC_TRAPFRAME_TO_PC(tf); fp = PMC_TRAPFRAME_TO_FP(tf); sp = PMC_TRAPFRAME_TO_KERNEL_SP(tf); *cc++ = pc; - r = fp + sizeof(uintptr_t); /* points to return address */ + ra = fp + sizeof(uintptr_t); /* points to return address */ if (nframes <= 1) return (1); - stackstart = (uintptr_t) td->td_kstack; - stackend = (uintptr_t) td->td_kstack + td->td_kstack_pages * PAGE_SIZE; - - if (PMC_IN_TRAP_HANDLER(pc) || - !PMC_IN_KERNEL(pc) || - !PMC_IN_KERNEL_STACK(r, stackstart, stackend) || - !PMC_IN_KERNEL_STACK(sp, stackstart, stackend) || - !PMC_IN_KERNEL_STACK(fp, stackstart, stackend)) + if (PMC_IN_TRAP_HANDLER(pc) || !PMC_IN_KERNEL(pc) || + !PMC_IN_KERNEL_STACK(ra) || !PMC_IN_KERNEL_STACK(sp) || + !PMC_IN_KERNEL_STACK(fp)) return (1); - instr = *(uint32_t *) pc; + instr = *(uint32_t *)pc; /* * Determine whether the interrupted function was in the @@ -205,15 +199,15 @@ pmc_save_kernel_callchain(uintptr_t *cc, int nframes, struct trapframe *tf) * and the caller's address is therefore at sp[1]. */ sp += sizeof(uintptr_t); - if (!PMC_IN_KERNEL_STACK(sp, stackstart, stackend)) + if (!PMC_IN_KERNEL_STACK(sp)) return (1); - pc = *(uintptr_t *) sp; + pc = *(uintptr_t *)sp; } else { /* * Not in the function prologue or epilogue. */ - pc = *(uintptr_t *) r; - fp = *(uintptr_t *) fp; + pc = *(uintptr_t *)ra; + fp = *(uintptr_t *)fp; } for (n = 1; n < nframes; n++) { @@ -222,12 +216,11 @@ pmc_save_kernel_callchain(uintptr_t *cc, int nframes, struct trapframe *tf) if (PMC_IN_TRAP_HANDLER(pc)) break; - r = fp + sizeof(uintptr_t); - if (!PMC_IN_KERNEL_STACK(fp, stackstart, stackend) || - !PMC_IN_KERNEL_STACK(r, stackstart, stackend)) + ra = fp + sizeof(uintptr_t); + if (!PMC_IN_KERNEL_STACK(fp) || !PMC_IN_KERNEL_STACK(ra)) break; - pc = *(uintptr_t *) r; - fp = *(uintptr_t *) fp; + pc = *(uintptr_t *)ra; + fp = *(uintptr_t *)fp; } return (n); @@ -236,7 +229,6 @@ pmc_save_kernel_callchain(uintptr_t *cc, int nframes, struct trapframe *tf) /* * Machine dependent initialization for x86 class platforms. */ - struct pmc_mdep * pmc_md_initialize(void) { diff --git a/sys/i386/include/pmc_mdep.h b/sys/i386/include/pmc_mdep.h index 3d498e006a36..15bdd7a65dc8 100644 --- a/sys/i386/include/pmc_mdep.h +++ b/sys/i386/include/pmc_mdep.h @@ -121,11 +121,9 @@ struct pmc_mdep; #define PMC_TRAPFRAME_TO_USER_SP(TF) ((TF)->tf_esp) #define PMC_TRAPFRAME_TO_KERNEL_SP(TF) ((uintptr_t) &((TF)->tf_esp)) -#define PMC_IN_KERNEL_STACK(S,START,END) \ - ((S) >= (START) && (S) < (END)) +#define PMC_IN_KERNEL_STACK(va) kstack_contains(curthread, (va), sizeof(va)) #define PMC_IN_KERNEL(va) INKERNEL(va) - -#define PMC_IN_USERSPACE(va) ((va) <= VM_MAXUSER_ADDRESS) +#define PMC_IN_USERSPACE(va) ((va) <= VM_MAXUSER_ADDRESS) #define PMC_IN_TRAP_HANDLER(PC) \ ((PC) >= (uintptr_t)start_exceptions + setidt_disp && \ diff --git a/sys/riscv/include/pmc_mdep.h b/sys/riscv/include/pmc_mdep.h index 10dc5c8b98ed..b192d75ec14b 100644 --- a/sys/riscv/include/pmc_mdep.h +++ b/sys/riscv/include/pmc_mdep.h @@ -48,12 +48,11 @@ union pmc_md_pmc { struct pmc_md_riscv_pmc pm_riscv; }; -#define PMC_IN_KERNEL_STACK(S,START,END) \ - ((S) >= (START) && (S) < (END)) -#define PMC_IN_KERNEL(va) INKERNEL((va)) -#define PMC_IN_USERSPACE(va) ((va) <= VM_MAXUSER_ADDRESS) -#define PMC_TRAPFRAME_TO_PC(TF) ((TF)->tf_ra) -#define PMC_TRAPFRAME_TO_FP(TF) (0) /* stub */ +#define PMC_IN_KERNEL_STACK(va) kstack_contains(curthread, (va), sizeof(va)) +#define PMC_IN_KERNEL(va) INKERNEL((va)) +#define PMC_IN_USERSPACE(va) ((va) <= VM_MAXUSER_ADDRESS) +#define PMC_TRAPFRAME_TO_PC(TF) ((TF)->tf_ra) +#define PMC_TRAPFRAME_TO_FP(TF) (0) /* stub */ /* * Prototypes From nobody Fri Jun 9 19:58:12 2023 X-Original-To: dev-commits-src-branches@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 4QdBhh69Nsz4cK30; Fri, 9 Jun 2023 19:58:12 +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 4QdBhh3vbKz4JdX; Fri, 9 Jun 2023 19:58:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686340692; 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=cFs8Cea6ru2B0Y41ukAPpW5HDflemDh4sHNM9imTBkk=; b=pRyVQY2jsYXS4ZSstTVjt9IQhftEsmQQ6AUVxKiVQCA6dLCDBI100QF67+oF2o3zVT3ttl B6Vcl+ifEmMjwvHeGhYjwGHBkxCoQeUsgazZkz5e8zB8H1wSYYpJCt+dIJtix8h5TDcV3B r3C5HMsk+KhXLjHSPFECHNr1kGtmW/1AZrVqu4XvZX1uCV4rlpnXsI/mNIwLJbpLYbWKi/ 6qBiqXbiWojIFPpgDb1qGW+wK8VfUckeyZL0hpnTq8sjHT0a5cVhPH8INzJha+QgoRzrDD UyjQdRiTjEUG0BLGPy1b8lnxRTxzW8gEyArfSSeQPl6vsVuwsWEnSQ79ZiorBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686340692; 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=cFs8Cea6ru2B0Y41ukAPpW5HDflemDh4sHNM9imTBkk=; b=jhw6QrElOFHni86Y9/6nwDNw5tRgDX5gs12ZVCWOyO+p2hXSC2vYXeD3QpmYcEOOX0r204 cGjqD2eOkpu2y+YJTMKzoX2lD9xaYRTKxRTBw4v3FccZ+sDmQd1Y05K69nFNswNb52+4nr dQQcRaqEO+XSXTkzw3c4aX/5eHJibUq5mbzDFiyUP2f747ai9xw2/C2E1ofa6KSSZxPBBu lEgOzDFZAlnAutXACHmuQMlthDBW9YGlyYB3pq8qh4GuTCdURNmbJM2rtRqWyK9dQm6W2S 1mwhLqrvK4VTBSEU5zuap511brosYyO5ixiu5lwgXjXV1LU2GtulF2K8u2Sk8w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686340692; a=rsa-sha256; cv=none; b=wHSfiz5Xcc5yiRTx+QMe2Ca2HmSCfUaM7xCEkqcrbHYXFzs0vltc9NDCKyzdJfye7tYxdf rCJ6yp0kBSnwKkS6jGtIKbwvY1LwVKBmjnw8BE0ul0d/aeRDysCn4Ay3lU4LLkmWXDtjGI 8xjp31zksjZxQNIrFHUKB/F7smLgei5SfJafH6QkbLeLIRyxWop+9PbJuNolPgiNqE7D8V a+Ck21by8+gWwY7MuVvjKrGjnkKVDtPmAxSLXFmSDW9ze0MQYO1mm8o2a52xQKlXPJYrYW /kbGMWTGwer2/29eWlRyGxC6BOXyNu/NWLp/75C4p7lMkp9bGuIo4UcLqMxing== 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 4QdBhh307Gzp01; Fri, 9 Jun 2023 19:58:12 +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 359JwCNo072239; Fri, 9 Jun 2023 19:58:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 359JwCkF072238; Fri, 9 Jun 2023 19:58:12 GMT (envelope-from git) Date: Fri, 9 Jun 2023 19:58:12 GMT Message-Id: <202306091958.359JwCkF072238@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: e6246bd85ae0 - stable/13 - pmcstat: augment an error message List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e6246bd85ae030091ad3cbafc3d9196820a537c8 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=e6246bd85ae030091ad3cbafc3d9196820a537c8 commit e6246bd85ae030091ad3cbafc3d9196820a537c8 Author: Mitchell Horne AuthorDate: 2023-05-05 21:58:23 +0000 Commit: Mitchell Horne CommitDate: 2023-06-09 18:14:59 +0000 pmcstat: augment an error message It also applies to the -t argument. Reviewed by: jkoshy MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D39907 (cherry picked from commit bf66159342e86b1dba02f1c463b47dd96fb09969) --- usr.sbin/pmcstat/pmcstat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/pmcstat/pmcstat.c b/usr.sbin/pmcstat/pmcstat.c index 3e2d101ab113..9e8d3b6994a8 100644 --- a/usr.sbin/pmcstat/pmcstat.c +++ b/usr.sbin/pmcstat/pmcstat.c @@ -923,7 +923,7 @@ main(int argc, char **argv) if ((args.pa_required & FLAG_HAS_PROCESS_PMCS) && (args.pa_flags & FLAG_HAS_PROCESS_PMCS) == 0) errx(EX_USAGE, -"ERROR: options -d, -E, and -W require a process mode PMC to be specified." +"ERROR: options -d, -E, -t, and -W require a process mode PMC to be specified." ); /* check for -c cpu with no system mode PMCs or logfile. */ From nobody Fri Jun 9 19:58:13 2023 X-Original-To: dev-commits-src-branches@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 4QdBhj6v4Hz4cK5M; Fri, 9 Jun 2023 19:58:13 +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 4QdBhj5ZPpz4JxC; Fri, 9 Jun 2023 19:58:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686340693; 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=adGPeJZJDTqJmAweItvDt1I0vzXeYcCcYEFBOXAmRSU=; b=tupf9qHYwBi+PWhHXDFPgKWEzJbUMz9VDiwi+Y33EsCo6Sxk5Xe5l6U/IfO2O9G/7dD77z rk+i30OpRqC7RnB4HPmxQWMKGcTn5HxFQTVpn4AW/86UFrlS0ADd+pwTC2knPTlIOhDza4 CnGHDML2Us/kJyruDKJIX+O3eVGxlvVWVKWCskP5gtTAfIIR0WjNxUT8z+ui1Va+Vm4qDO WZbjWmDQ7BxgzGNSnNvl01kiQxCLTeU1sh5WcRcnoUT738OkZDNYJRMNp8uRg0TZXCb4UZ 9qWQyc2nJpP1JwRmot6y8tElrTDj38WK0slkTsbHM1jdXZtmsjAUgzkcu9ge8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686340693; 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=adGPeJZJDTqJmAweItvDt1I0vzXeYcCcYEFBOXAmRSU=; b=tuYmTWZINf1YKkppoaVyam/ci2BtJpalMlren/gELkRIHTmh913CKaIVGaTHXopqCs6i8y fQAJh5WNuarzSu2GOU+39WnocfwIInFAazgddHVdgOaeL/nxk7L+ZEIEvUMSaw57yN/11m nLEQr/KD+gOYkF9hGMPs6AmludN0ZBejCKd7jlVD9w90Ut5gSgEmYp/sTI3cUSa7wRQMHr +mjT+OEzaOEJVn9sPqpmiSq+viUaM1M6ujKKClTNPT3aTEzeq4kDf7EraJpi8qBm77mtu9 7+kTKjelob0ZSIe/Rj3IoBnD0ONsRyoZOXmVUuw/rZmLdO/6guae5Ek4oXNmFw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686340693; a=rsa-sha256; cv=none; b=Yed4f+0XC21RJNEwWfjQhf77IwcdY/bhe+Ntf3npDzr60i89DQZodn7pt4Xu4eYmXnPGbC 2qQCzxznO04I0yZd6PL3k3ljGBQg3dVR4V6F8BWPXHbEnEdSQaoWY6SqJgGTn+ZvUbYMEl Zsz+WTF+JC/WCcqkpa91nzJNDu4S0VooPTnI3JegUWTrZfmcamoDc52p1qxgk/El1JuVfV 5Cz9Eh7taI8zKPnvLpKcfXVHOkU4dlndpcybeF+MbZq6nChvBTwaOid5dg+vKjT1utUQwj Uec5kik1h5pz/2swk3o2rCW5bT6Ci/mRN/gPqlWJGCEepCk8GPoPajmSGM885Q== 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 4QdBhj4047znW2; Fri, 9 Jun 2023 19:58:13 +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 359JwDXa072258; Fri, 9 Jun 2023 19:58:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 359JwDQR072257; Fri, 9 Jun 2023 19:58:13 GMT (envelope-from git) Date: Fri, 9 Jun 2023 19:58:13 GMT Message-Id: <202306091958.359JwDQR072257@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: e6b3aaa3e68d - stable/13 - hwpmc: unused/diagused annotations in tsc class List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e6b3aaa3e68db10ef4ef7ae25cefb04b3d61b5d2 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=e6b3aaa3e68db10ef4ef7ae25cefb04b3d61b5d2 commit e6b3aaa3e68db10ef4ef7ae25cefb04b3d61b5d2 Author: Mitchell Horne AuthorDate: 2023-05-05 21:59:53 +0000 Commit: Mitchell Horne CommitDate: 2023-06-09 18:14:59 +0000 hwpmc: unused/diagused annotations in tsc class These are preferred over casts to void. No functional change. Reviewed by: jkoshy MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D39914 (cherry picked from commit a35453b9c7644f11df83d0c7e73da488f521e56e) --- sys/dev/hwpmc/hwpmc_tsc.c | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/sys/dev/hwpmc/hwpmc_tsc.c b/sys/dev/hwpmc/hwpmc_tsc.c index 25b2e9f8fd57..3c95ceb080a5 100644 --- a/sys/dev/hwpmc/hwpmc_tsc.c +++ b/sys/dev/hwpmc/hwpmc_tsc.c @@ -70,10 +70,9 @@ struct tsc_cpu { static struct tsc_cpu **tsc_pcpu; static int -tsc_allocate_pmc(int cpu, int ri, struct pmc *pm, +tsc_allocate_pmc(int cpu __diagused, int ri __diagused, struct pmc *pm __unused, const struct pmc_op_pmcallocate *a) { - (void) cpu; KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), ("[tsc,%d] illegal CPU value %d", __LINE__, cpu)); @@ -140,9 +139,8 @@ tsc_describe(int cpu, int ri, struct pmc_info *pi, struct pmc **ppmc) } static int -tsc_get_config(int cpu, int ri, struct pmc **ppm) +tsc_get_config(int cpu, int ri __diagused, struct pmc **ppm) { - (void) ri; KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), ("[tsc,%d] illegal CPU %d", __LINE__, cpu)); @@ -154,9 +152,8 @@ tsc_get_config(int cpu, int ri, struct pmc **ppm) } static int -tsc_get_msr(int ri, uint32_t *msr) +tsc_get_msr(int ri __diagused, uint32_t *msr) { - (void) ri; KASSERT(ri >= 0 && ri < TSC_NPMCS, ("[tsc,%d] ri %d out of range", __LINE__, ri)); @@ -252,12 +249,10 @@ tsc_read_pmc(int cpu, int ri, pmc_value_t *v) } static int -tsc_release_pmc(int cpu, int ri, struct pmc *pmc) +tsc_release_pmc(int cpu, int ri __diagused, struct pmc *pmc __unused) { struct pmc_hw *phw __diagused; - (void) pmc; - KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), ("[tsc,%d] illegal CPU value %d", __LINE__, cpu)); KASSERT(ri == 0, @@ -275,9 +270,8 @@ tsc_release_pmc(int cpu, int ri, struct pmc *pmc) } static int -tsc_start_pmc(int cpu, int ri) +tsc_start_pmc(int cpu __diagused, int ri __diagused) { - (void) cpu; KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), ("[tsc,%d] illegal CPU value %d", __LINE__, cpu)); @@ -287,9 +281,8 @@ tsc_start_pmc(int cpu, int ri) } static int -tsc_stop_pmc(int cpu, int ri) +tsc_stop_pmc(int cpu __diagused, int ri __diagused) { - (void) cpu; (void) ri; KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), ("[tsc,%d] illegal CPU value %d", __LINE__, cpu)); @@ -299,9 +292,8 @@ tsc_stop_pmc(int cpu, int ri) } static int -tsc_write_pmc(int cpu, int ri, pmc_value_t v) +tsc_write_pmc(int cpu __diagused, int ri __diagused, pmc_value_t v __unused) { - (void) cpu; (void) ri; (void) v; KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), ("[tsc,%d] illegal CPU value %d", __LINE__, cpu)); @@ -354,7 +346,7 @@ pmc_tsc_initialize(struct pmc_mdep *md, int maxcpu) } void -pmc_tsc_finalize(struct pmc_mdep *md) +pmc_tsc_finalize(struct pmc_mdep *md __diagused) { #ifdef INVARIANTS int i, ncpus; @@ -366,9 +358,6 @@ pmc_tsc_finalize(struct pmc_mdep *md) KASSERT(md->pmd_classdep[PMC_MDEP_CLASS_INDEX_TSC].pcd_class == PMC_CLASS_TSC, ("[tsc,%d] class mismatch", __LINE__)); - -#else - (void) md; #endif free(tsc_pcpu, M_PMC); From nobody Fri Jun 9 19:58:14 2023 X-Original-To: dev-commits-src-branches@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 4QdBhk6b9Pz4cK5R; Fri, 9 Jun 2023 19:58:14 +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 4QdBhk5tprz4JhQ; Fri, 9 Jun 2023 19:58:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686340694; 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=NgxQA3cCAmzEU/XLhrKvb06ehee3QRzYqTZ/Q9IhnWc=; b=lI6KhZSidVlfv12/TLcTPrrIk/5JmPhCF+akrAyziUjEx1vUyD0KF7fEEzTDbLqEP+81Wu 9jlc5PdMYYW0mcFj6ofGTuvDH3oFHoEu6fuEJjPXIyxH1hwcdHNJZI4TDYMwT+vOXX/YZf cPrad7BXN6yUhmAJVi4jKlnKSkgZuSZQpvywF/FqIY/l49ISYhQLYg3gXDqH4HVPSaS78h JfGFcZPmOYBX7b+XJ4BXplvrrpJ5IZTHlfY3kVoQWvjJh7DZt/Io9q+zDKjZLSaj8bbL2p kjVTzMcPEK5NgYDh4XnUoCugkRRsBSECwuc+/guMT8paOH9lrf1fh9tm3Xc+zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686340694; 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=NgxQA3cCAmzEU/XLhrKvb06ehee3QRzYqTZ/Q9IhnWc=; b=fMJd3UyQvY0APU7/ZWEr8kpb8fpe6o9TCgD/Djm+ccVn6u5Kb/pwBoYfcYhVTY1nMJaevr +paqx1TkF7G+a6j3rEeJiJNCyBTXTBtuHG7YiaC0ROG530CuSZcrVM+m1f7AMzwHx0+eyc Giucw/LfpU7jLPkJ2C7J9w5tB5IDIGakFWHsxgjVssoZViRgBhrFZKbszj2uV3O9QVLnXN RRsm4naFUkjGD3Y2ro94tpeWrnc3ZjfgmWKDp8isHnZNcLGMuOxwA2LrsJ3CTRwtRdB1yV HaSR8vhpF+kBMC1e9MxGu4Hn5+60IM1B7ys5S9D37c4RUMKCS0QeXZqPEKndGQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686340694; a=rsa-sha256; cv=none; b=R9YAn9boOyF1Ed4D4z4rz+wzHRO3ZZxmykX7sSY7+He8NGcnMmwasZdUxkhSMpb9zJp4MW HUEZZSr84tTJiIDbjxnwwmnWpfejlu9qXFMB0GkDJL2qLD91zFXht3CTCL9obTpkQAeB/V Ij1pUee8k/1lJB/hNP4EoQAYrp8qNew+HfEuBshESbiex3/lmD6wuy8LFpFhZwusum/+3F XseJ3vIlx5kOa540FTfKTA85mX1Y6Ed5B9ydQHpZW0HMmnRGKz3YCin1LmdaoWI6/oD+kz we5Oo8iAjMJHNAgatasXL2Dt9BN6DtwSiBsVhPtealUOXtqsc1qa7iR4Gr9TYg== 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 4QdBhk4wdPznwv; Fri, 9 Jun 2023 19:58:14 +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 359JwEWi072277; Fri, 9 Jun 2023 19:58:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 359JwElt072276; Fri, 9 Jun 2023 19:58:14 GMT (envelope-from git) Date: Fri, 9 Jun 2023 19:58:14 GMT Message-Id: <202306091958.359JwElt072276@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 1b7d148ed773 - stable/13 - hwpmc: pass pmc pointer to more class methods List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1b7d148ed773259d1e247c326ff8d500f92f289a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=1b7d148ed773259d1e247c326ff8d500f92f289a commit 1b7d148ed773259d1e247c326ff8d500f92f289a Author: Mitchell Horne AuthorDate: 2023-05-05 22:00:02 +0000 Commit: Mitchell Horne CommitDate: 2023-06-09 19:47:33 +0000 hwpmc: pass pmc pointer to more class methods In many cases this avoids an extra lookup, since the callers always have pm at hand. We can also eliminate several assertions, mostly for pm != NULL. The class methods are an internal interface, and the callers already handle such a scenario. No functional change intended. Reviewed by: jkoshy MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D39915 (cherry picked from commit 39f92a76a99a2ceb747250da4f2d627b9c317f8c) --- sys/dev/hwpmc/hwpmc_amd.c | 39 ++++----------------------- sys/dev/hwpmc/hwpmc_arm64.c | 27 +++++-------------- sys/dev/hwpmc/hwpmc_armv7.c | 26 +++++------------- sys/dev/hwpmc/hwpmc_beri.c | 20 +++----------- sys/dev/hwpmc/hwpmc_core.c | 62 ++++++------------------------------------- sys/dev/hwpmc/hwpmc_e500.c | 2 +- sys/dev/hwpmc/hwpmc_mips.c | 26 +++++------------- sys/dev/hwpmc/hwpmc_mod.c | 34 +++++++++++++----------- sys/dev/hwpmc/hwpmc_powerpc.c | 25 +++++------------ sys/dev/hwpmc/hwpmc_powerpc.h | 8 +++--- sys/dev/hwpmc/hwpmc_soft.c | 41 ++++------------------------ sys/dev/hwpmc/hwpmc_tsc.c | 17 ++++-------- sys/dev/hwpmc/hwpmc_uncore.c | 62 ++++++------------------------------------- sys/sys/pmc.h | 12 +++++---- 14 files changed, 90 insertions(+), 311 deletions(-) diff --git a/sys/dev/hwpmc/hwpmc_amd.c b/sys/dev/hwpmc/hwpmc_amd.c index 05584ee1660d..36411da871ea 100644 --- a/sys/dev/hwpmc/hwpmc_amd.c +++ b/sys/dev/hwpmc/hwpmc_amd.c @@ -397,11 +397,10 @@ static struct amd_cpu **amd_pcpu; */ static int -amd_read_pmc(int cpu, int ri, pmc_value_t *v) +amd_read_pmc(int cpu, int ri, struct pmc *pm, pmc_value_t *v) { enum pmc_mode mode; const struct amd_descr *pd; - struct pmc *pm; pmc_value_t tmp; KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), @@ -411,13 +410,7 @@ amd_read_pmc(int cpu, int ri, pmc_value_t *v) KASSERT(amd_pcpu[cpu], ("[amd,%d] null per-cpu, cpu %d", __LINE__, cpu)); - pm = amd_pcpu[cpu]->pc_amdpmcs[ri].phw_pmc; pd = &amd_pmcdesc[ri]; - - KASSERT(pm != NULL, - ("[amd,%d] No owner for HWPMC [cpu%d,pmc%d]", __LINE__, - cpu, ri)); - mode = PMC_TO_MODE(pm); PMCDBG2(MDP,REA,1,"amd-read id=%d class=%d", ri, pd->pm_descr.pd_class); @@ -456,24 +449,17 @@ amd_read_pmc(int cpu, int ri, pmc_value_t *v) */ static int -amd_write_pmc(int cpu, int ri, pmc_value_t v) +amd_write_pmc(int cpu, int ri, struct pmc *pm, pmc_value_t v) { const struct amd_descr *pd; enum pmc_mode mode; - struct pmc *pm; KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), ("[amd,%d] illegal CPU value %d", __LINE__, cpu)); KASSERT(ri >= 0 && ri < AMD_NPMCS, ("[amd,%d] illegal row-index %d", __LINE__, ri)); - pm = amd_pcpu[cpu]->pc_amdpmcs[ri].phw_pmc; pd = &amd_pmcdesc[ri]; - - KASSERT(pm != NULL, - ("[amd,%d] PMC not owned (cpu%d,pmc%d)", __LINE__, - cpu, ri)); - mode = PMC_TO_MODE(pm); #ifdef HWPMC_DEBUG @@ -705,11 +691,9 @@ amd_release_pmc(int cpu, int ri, struct pmc *pmc) */ static int -amd_start_pmc(int cpu, int ri) +amd_start_pmc(int cpu, int ri, struct pmc *pm) { uint64_t config; - struct pmc *pm; - struct pmc_hw *phw; const struct amd_descr *pd; KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), @@ -717,14 +701,8 @@ amd_start_pmc(int cpu, int ri) KASSERT(ri >= 0 && ri < AMD_NPMCS, ("[amd,%d] illegal row-index %d", __LINE__, ri)); - phw = &amd_pcpu[cpu]->pc_amdpmcs[ri]; - pm = phw->phw_pmc; pd = &amd_pmcdesc[ri]; - KASSERT(pm != NULL, - ("[amd,%d] starting cpu%d,pmc%d with null pmc record", __LINE__, - cpu, ri)); - PMCDBG2(MDP,STA,1,"amd-start cpu=%d ri=%d", cpu, ri); KASSERT(AMD_PMC_IS_STOPPED(pd->pm_evsel), @@ -745,10 +723,8 @@ amd_start_pmc(int cpu, int ri) */ static int -amd_stop_pmc(int cpu, int ri) +amd_stop_pmc(int cpu, int ri, struct pmc *pm) { - struct pmc *pm; - struct pmc_hw *phw; const struct amd_descr *pd; uint64_t config; int i; @@ -758,13 +734,8 @@ amd_stop_pmc(int cpu, int ri) KASSERT(ri >= 0 && ri < AMD_NPMCS, ("[amd,%d] illegal row-index %d", __LINE__, ri)); - phw = &amd_pcpu[cpu]->pc_amdpmcs[ri]; - pm = phw->phw_pmc; - pd = &amd_pmcdesc[ri]; + pd = &amd_pmcdesc[ri]; - KASSERT(pm != NULL, - ("[amd,%d] cpu%d,pmc%d no PMC to stop", __LINE__, - cpu, ri)); KASSERT(!AMD_PMC_IS_STOPPED(pd->pm_evsel), ("[amd,%d] PMC%d, CPU%d \"%s\" already stopped", __LINE__, ri, cpu, pd->pm_descr.pd_name)); diff --git a/sys/dev/hwpmc/hwpmc_arm64.c b/sys/dev/hwpmc/hwpmc_arm64.c index a89f26f90dd0..36524072d50c 100644 --- a/sys/dev/hwpmc/hwpmc_arm64.c +++ b/sys/dev/hwpmc/hwpmc_arm64.c @@ -212,10 +212,9 @@ arm64_allocate_pmc(int cpu, int ri, struct pmc *pm, static int -arm64_read_pmc(int cpu, int ri, pmc_value_t *v) +arm64_read_pmc(int cpu, int ri, struct pmc *pm, pmc_value_t *v) { pmc_value_t tmp; - struct pmc *pm; register_t s; int reg; @@ -224,8 +223,6 @@ arm64_read_pmc(int cpu, int ri, pmc_value_t *v) KASSERT(ri >= 0 && ri < arm64_npmcs, ("[arm64,%d] illegal row index %d", __LINE__, ri)); - pm = arm64_pcpu[cpu]->pc_arm64pmcs[ri].phw_pmc; - /* * Ensure we don't get interrupted while updating the overflow count. */ @@ -261,17 +258,14 @@ arm64_read_pmc(int cpu, int ri, pmc_value_t *v) } static int -arm64_write_pmc(int cpu, int ri, pmc_value_t v) +arm64_write_pmc(int cpu, int ri, struct pmc *pm, pmc_value_t v) { - struct pmc *pm; KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), ("[arm64,%d] illegal CPU value %d", __LINE__, cpu)); KASSERT(ri >= 0 && ri < arm64_npmcs, ("[arm64,%d] illegal row-index %d", __LINE__, ri)); - pm = arm64_pcpu[cpu]->pc_arm64pmcs[ri].phw_pmc; - if (PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm))) v = ARMV8_RELOAD_COUNT_TO_PERFCTR_VALUE(v); @@ -307,14 +301,10 @@ arm64_config_pmc(int cpu, int ri, struct pmc *pm) } static int -arm64_start_pmc(int cpu, int ri) +arm64_start_pmc(int cpu, int ri, struct pmc *pm) { - struct pmc_hw *phw; uint32_t config; - struct pmc *pm; - phw = &arm64_pcpu[cpu]->pc_arm64pmcs[ri]; - pm = phw->phw_pmc; config = pm->pm_md.pm_arm64.pm_arm64_evsel; /* @@ -335,13 +325,8 @@ arm64_start_pmc(int cpu, int ri) } static int -arm64_stop_pmc(int cpu, int ri) +arm64_stop_pmc(int cpu, int ri, struct pmc *pm __unused) { - struct pmc_hw *phw; - struct pmc *pm; - - phw = &arm64_pcpu[cpu]->pc_arm64pmcs[ri]; - pm = phw->phw_pmc; /* * Disable the PMCs. @@ -413,10 +398,10 @@ arm64_intr(struct trapframe *tf) error = pmc_process_interrupt(PMC_HR, pm, tf); if (error) - arm64_stop_pmc(cpu, ri); + arm64_stop_pmc(cpu, ri, pm); /* Reload sampling count */ - arm64_write_pmc(cpu, ri, pm->pm_sc.pm_reloadcount); + arm64_write_pmc(cpu, ri, pm, pm->pm_sc.pm_reloadcount); } return (retval); diff --git a/sys/dev/hwpmc/hwpmc_armv7.c b/sys/dev/hwpmc/hwpmc_armv7.c index 2cfac1e857bd..052b97f35586 100644 --- a/sys/dev/hwpmc/hwpmc_armv7.c +++ b/sys/dev/hwpmc/hwpmc_armv7.c @@ -163,10 +163,9 @@ armv7_allocate_pmc(int cpu, int ri, struct pmc *pm, static int -armv7_read_pmc(int cpu, int ri, pmc_value_t *v) +armv7_read_pmc(int cpu, int ri, struct pmc *pm, pmc_value_t *v) { pmc_value_t tmp; - struct pmc *pm; register_t s; u_int reg; @@ -175,8 +174,6 @@ armv7_read_pmc(int cpu, int ri, pmc_value_t *v) KASSERT(ri >= 0 && ri < armv7_npmcs, ("[armv7,%d] illegal row index %d", __LINE__, ri)); - pm = armv7_pcpu[cpu]->pc_armv7pmcs[ri].phw_pmc; - s = intr_disable(); tmp = armv7_pmcn_read(ri, pm->pm_md.pm_armv7.pm_armv7_evsel); @@ -215,17 +212,14 @@ armv7_read_pmc(int cpu, int ri, pmc_value_t *v) } static int -armv7_write_pmc(int cpu, int ri, pmc_value_t v) +armv7_write_pmc(int cpu, int ri, struct pmc *pm, pmc_value_t v) { - struct pmc *pm; KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), ("[armv7,%d] illegal CPU value %d", __LINE__, cpu)); KASSERT(ri >= 0 && ri < armv7_npmcs, ("[armv7,%d] illegal row-index %d", __LINE__, ri)); - pm = armv7_pcpu[cpu]->pc_armv7pmcs[ri].phw_pmc; - if (PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm))) v = ARMV7_RELOAD_COUNT_TO_PERFCTR_VALUE(v); @@ -264,14 +258,10 @@ armv7_config_pmc(int cpu, int ri, struct pmc *pm) } static int -armv7_start_pmc(int cpu, int ri) +armv7_start_pmc(int cpu, int ri, struct pmc *pm) { - struct pmc_hw *phw; uint32_t config; - struct pmc *pm; - phw = &armv7_pcpu[cpu]->pc_armv7pmcs[ri]; - pm = phw->phw_pmc; config = pm->pm_md.pm_armv7.pm_armv7_evsel; /* @@ -293,14 +283,10 @@ armv7_start_pmc(int cpu, int ri) } static int -armv7_stop_pmc(int cpu, int ri) +armv7_stop_pmc(int cpu, int ri, struct pmc *pm) { - struct pmc_hw *phw; - struct pmc *pm; uint32_t config; - phw = &armv7_pcpu[cpu]->pc_armv7pmcs[ri]; - pm = phw->phw_pmc; config = pm->pm_md.pm_armv7.pm_armv7_evsel; if (config == PMC_EV_CPU_CYCLES) ri = 31; @@ -377,10 +363,10 @@ armv7_intr(struct trapframe *tf) error = pmc_process_interrupt(PMC_HR, pm, tf); if (error) - armv7_stop_pmc(cpu, ri); + armv7_stop_pmc(cpu, ri, pm); /* Reload sampling count */ - armv7_write_pmc(cpu, ri, pm->pm_sc.pm_reloadcount); + armv7_write_pmc(cpu, ri, pm, pm->pm_sc.pm_reloadcount); } return (retval); diff --git a/sys/dev/hwpmc/hwpmc_beri.c b/sys/dev/hwpmc/hwpmc_beri.c index ce15bb57fda4..77a419c6e82b 100644 --- a/sys/dev/hwpmc/hwpmc_beri.c +++ b/sys/dev/hwpmc/hwpmc_beri.c @@ -217,10 +217,9 @@ beri_allocate_pmc(int cpu, int ri, struct pmc *pm, } static int -beri_read_pmc(int cpu, int ri, pmc_value_t *v) +beri_read_pmc(int cpu, int ri, struct pmc *pm, pmc_value_t *v) { uint32_t config; - struct pmc *pm; pmc_value_t new; pmc_value_t start_val; pmc_value_t stop_val; @@ -232,7 +231,6 @@ beri_read_pmc(int cpu, int ri, pmc_value_t *v) KASSERT(ri >= 0 && ri < beri_npmcs, ("[beri,%d] illegal row index %d", __LINE__, ri)); - pm = beri_pcpu[cpu]->pc_beripmcs[ri].phw_pmc; config = pm->pm_md.pm_mips_evsel; start_val = beri_pcpu[cpu]->start_values[config]; @@ -260,9 +258,8 @@ beri_read_pmc(int cpu, int ri, pmc_value_t *v) } static int -beri_write_pmc(int cpu, int ri, pmc_value_t v) +beri_write_pmc(int cpu, int ri, struct pmc *pm, pmc_value_t v) { - struct pmc *pm; uint32_t config; KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), @@ -270,7 +267,6 @@ beri_write_pmc(int cpu, int ri, pmc_value_t v) KASSERT(ri >= 0 && ri < beri_npmcs, ("[beri,%d] illegal row-index %d", __LINE__, ri)); - pm = beri_pcpu[cpu]->pc_beripmcs[ri].phw_pmc; config = pm->pm_md.pm_mips_evsel; if (PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm))) @@ -310,15 +306,11 @@ beri_config_pmc(int cpu, int ri, struct pmc *pm) } static int -beri_start_pmc(int cpu, int ri) +beri_start_pmc(int cpu, int ri, struct pmc *pm) { uint32_t config; - struct pmc *pm; - struct pmc_hw *phw; pmc_value_t v; - phw = &beri_pcpu[cpu]->pc_beripmcs[ri]; - pm = phw->phw_pmc; config = pm->pm_md.pm_mips_evsel; v = beri_event_codes[config].get_func(); @@ -328,15 +320,11 @@ beri_start_pmc(int cpu, int ri) } static int -beri_stop_pmc(int cpu, int ri) +beri_stop_pmc(int cpu, int ri, struct pmc *pm) { uint32_t config; - struct pmc *pm; - struct pmc_hw *phw; pmc_value_t v; - phw = &beri_pcpu[cpu]->pc_beripmcs[ri]; - pm = phw->phw_pmc; config = pm->pm_md.pm_mips_evsel; v = beri_event_codes[config].get_func(); diff --git a/sys/dev/hwpmc/hwpmc_core.c b/sys/dev/hwpmc/hwpmc_core.c index ad9d323bdb9a..d80edeefb0d0 100644 --- a/sys/dev/hwpmc/hwpmc_core.c +++ b/sys/dev/hwpmc/hwpmc_core.c @@ -368,9 +368,8 @@ iaf_get_msr(int ri, uint32_t *msr) } static int -iaf_read_pmc(int cpu, int ri, pmc_value_t *v) +iaf_read_pmc(int cpu, int ri, struct pmc *pm, pmc_value_t *v) { - struct pmc *pm; pmc_value_t tmp; KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), @@ -378,12 +377,6 @@ iaf_read_pmc(int cpu, int ri, pmc_value_t *v) KASSERT(ri >= 0 && ri < core_iaf_npmc, ("[core,%d] illegal row-index %d", __LINE__, ri)); - pm = core_pcpu[cpu]->pc_corepmcs[ri + core_iaf_ri].phw_pmc; - - KASSERT(pm, - ("[core,%d] cpu %d ri %d(%d) pmc not configured", __LINE__, cpu, - ri, ri + core_iaf_ri)); - tmp = rdpmc(IAF_RI_TO_MSR(ri)); if (PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm))) @@ -421,9 +414,8 @@ iaf_release_pmc(int cpu, int ri, struct pmc *pmc) } static int -iaf_start_pmc(int cpu, int ri) +iaf_start_pmc(int cpu, int ri, struct pmc *pm) { - struct pmc *pm; struct core_cpu *cc; KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), @@ -434,8 +426,6 @@ iaf_start_pmc(int cpu, int ri) PMCDBG2(MDP,STA,1,"iaf-start cpu=%d ri=%d", cpu, ri); cc = core_pcpu[cpu]; - pm = cc->pc_corepmcs[ri + core_iaf_ri].phw_pmc; - cc->pc_iafctrl |= pm->pm_md.pm_iaf.pm_iaf_ctrl; wrmsr(IAF_CTRL, cc->pc_iafctrl); @@ -450,7 +440,7 @@ iaf_start_pmc(int cpu, int ri) } static int -iaf_stop_pmc(int cpu, int ri) +iaf_stop_pmc(int cpu, int ri, struct pmc *pm) { struct core_cpu *cc; @@ -476,10 +466,9 @@ iaf_stop_pmc(int cpu, int ri) } static int -iaf_write_pmc(int cpu, int ri, pmc_value_t v) +iaf_write_pmc(int cpu, int ri, struct pmc *pm, pmc_value_t v) { struct core_cpu *cc; - struct pmc *pm; KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), ("[core,%d] illegal cpu value %d", __LINE__, cpu)); @@ -487,10 +476,6 @@ iaf_write_pmc(int cpu, int ri, pmc_value_t v) ("[core,%d] illegal row-index %d", __LINE__, ri)); cc = core_pcpu[cpu]; - pm = cc->pc_corepmcs[ri + core_iaf_ri].phw_pmc; - - KASSERT(pm, - ("[core,%d] cpu %d ri %d pmc not configured", __LINE__, cpu, ri)); if (PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm))) v = iaf_reload_count_to_perfctr_value(v); @@ -846,9 +831,8 @@ iap_get_msr(int ri, uint32_t *msr) } static int -iap_read_pmc(int cpu, int ri, pmc_value_t *v) +iap_read_pmc(int cpu, int ri, struct pmc *pm, pmc_value_t *v) { - struct pmc *pm; pmc_value_t tmp; KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), @@ -856,12 +840,6 @@ iap_read_pmc(int cpu, int ri, pmc_value_t *v) KASSERT(ri >= 0 && ri < core_iap_npmc, ("[core,%d] illegal row-index %d", __LINE__, ri)); - pm = core_pcpu[cpu]->pc_corepmcs[ri].phw_pmc; - - KASSERT(pm, - ("[core,%d] cpu %d ri %d pmc not configured", __LINE__, cpu, - ri)); - tmp = rdpmc(ri); if (PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm))) *v = iap_perfctr_value_to_reload_count(tmp); @@ -894,9 +872,8 @@ iap_release_pmc(int cpu, int ri, struct pmc *pm) } static int -iap_start_pmc(int cpu, int ri) +iap_start_pmc(int cpu, int ri, struct pmc *pm) { - struct pmc *pm; uint64_t evsel; struct core_cpu *cc; @@ -906,11 +883,6 @@ iap_start_pmc(int cpu, int ri) ("[core,%d] illegal row-index %d", __LINE__, ri)); cc = core_pcpu[cpu]; - pm = cc->pc_corepmcs[ri].phw_pmc; - - KASSERT(pm, - ("[core,%d] starting cpu%d,ri%d with no pmc configured", - __LINE__, cpu, ri)); PMCDBG2(MDP,STA,1, "iap-start cpu=%d ri=%d", cpu, ri); @@ -943,23 +915,14 @@ iap_start_pmc(int cpu, int ri) } static int -iap_stop_pmc(int cpu, int ri) +iap_stop_pmc(int cpu, int ri, struct pmc *pm __unused) { - struct pmc *pm __diagused; - struct core_cpu *cc; KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), ("[core,%d] illegal cpu value %d", __LINE__, cpu)); KASSERT(ri >= 0 && ri < core_iap_npmc, ("[core,%d] illegal row index %d", __LINE__, ri)); - cc = core_pcpu[cpu]; - pm = cc->pc_corepmcs[ri].phw_pmc; - - KASSERT(pm, - ("[core,%d] cpu%d ri%d no configured PMC to stop", __LINE__, - cpu, ri)); - PMCDBG2(MDP,STO,1, "iap-stop cpu=%d ri=%d", cpu, ri); wrmsr(IAP_EVSEL0 + ri, 0); @@ -970,23 +933,14 @@ iap_stop_pmc(int cpu, int ri) } static int -iap_write_pmc(int cpu, int ri, pmc_value_t v) +iap_write_pmc(int cpu, int ri, struct pmc *pm, pmc_value_t v) { - struct pmc *pm; - struct core_cpu *cc; KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), ("[core,%d] illegal cpu value %d", __LINE__, cpu)); KASSERT(ri >= 0 && ri < core_iap_npmc, ("[core,%d] illegal row index %d", __LINE__, ri)); - cc = core_pcpu[cpu]; - pm = cc->pc_corepmcs[ri].phw_pmc; - - KASSERT(pm, - ("[core,%d] cpu%d ri%d no configured PMC to stop", __LINE__, - cpu, ri)); - if (PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm))) v = iap_reload_count_to_perfctr_value(v); diff --git a/sys/dev/hwpmc/hwpmc_e500.c b/sys/dev/hwpmc/hwpmc_e500.c index b82bada95fe3..020337830eb5 100644 --- a/sys/dev/hwpmc/hwpmc_e500.c +++ b/sys/dev/hwpmc/hwpmc_e500.c @@ -341,7 +341,7 @@ e500_pcpu_init(struct pmc_mdep *md, int cpu) for (i = 0; i < E500_MAX_PMCS; i++) /* Initialize the PMC to stopped */ - powerpc_stop_pmc(cpu, i); + e500_set_pmc(cpu, i, PMCN_NONE); /* Unfreeze global register. */ mtpmr(PMR_PMGC0, PMGC_PMIE | PMGC_FCECE); diff --git a/sys/dev/hwpmc/hwpmc_mips.c b/sys/dev/hwpmc/hwpmc_mips.c index 1ed3fdea8915..cf9550b4cbc9 100644 --- a/sys/dev/hwpmc/hwpmc_mips.c +++ b/sys/dev/hwpmc/hwpmc_mips.c @@ -113,9 +113,8 @@ mips_allocate_pmc(int cpu, int ri, struct pmc *pm, static int -mips_read_pmc(int cpu, int ri, pmc_value_t *v) +mips_read_pmc(int cpu, int ri, struct pmc *pm, pmc_value_t *v) { - struct pmc *pm; pmc_value_t tmp; KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), @@ -123,7 +122,6 @@ mips_read_pmc(int cpu, int ri, pmc_value_t *v) KASSERT(ri >= 0 && ri < mips_npmcs, ("[mips,%d] illegal row index %d", __LINE__, ri)); - pm = mips_pcpu[cpu]->pc_mipspmcs[ri].phw_pmc; tmp = mips_pmcn_read(ri); PMCDBG2(MDP,REA,2,"mips-read id=%d -> %jd", ri, tmp); @@ -136,17 +134,14 @@ mips_read_pmc(int cpu, int ri, pmc_value_t *v) } static int -mips_write_pmc(int cpu, int ri, pmc_value_t v) +mips_write_pmc(int cpu, int ri, struct pmc *pm, pmc_value_t v) { - struct pmc *pm; KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), ("[mips,%d] illegal CPU value %d", __LINE__, cpu)); KASSERT(ri >= 0 && ri < mips_npmcs, ("[mips,%d] illegal row-index %d", __LINE__, ri)); - pm = mips_pcpu[cpu]->pc_mipspmcs[ri].phw_pmc; - if (PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm))) v = (1UL << (mips_pmc_spec.ps_counter_width - 1)) - v; @@ -181,14 +176,10 @@ mips_config_pmc(int cpu, int ri, struct pmc *pm) } static int -mips_start_pmc(int cpu, int ri) +mips_start_pmc(int cpu, int ri, struct pmc *pm) { uint32_t config; - struct pmc *pm; - struct pmc_hw *phw; - phw = &mips_pcpu[cpu]->pc_mipspmcs[ri]; - pm = phw->phw_pmc; config = pm->pm_md.pm_mips_evsel; /* Enable the PMC. */ @@ -207,13 +198,8 @@ mips_start_pmc(int cpu, int ri) } static int -mips_stop_pmc(int cpu, int ri) +mips_stop_pmc(int cpu, int ri, struct pmc *pm __unused) { - struct pmc *pm; - struct pmc_hw *phw; - - phw = &mips_pcpu[cpu]->pc_mipspmcs[ri]; - pm = phw->phw_pmc; /* * Disable the PMCs. @@ -297,11 +283,11 @@ mips_pmc_intr(struct trapframe *tf) r0 = 0; else if (ri == 1) r2 = 0; - mips_stop_pmc(cpu, ri); + mips_stop_pmc(cpu, ri, pm); } /* Reload sampling count */ - mips_write_pmc(cpu, ri, pm->pm_sc.pm_reloadcount); + mips_write_pmc(cpu, ri, pm, pm->pm_sc.pm_reloadcount); } /* diff --git a/sys/dev/hwpmc/hwpmc_mod.c b/sys/dev/hwpmc/hwpmc_mod.c index 7434fbf15d0d..fb8679f65a38 100644 --- a/sys/dev/hwpmc/hwpmc_mod.c +++ b/sys/dev/hwpmc/hwpmc_mod.c @@ -1488,7 +1488,7 @@ pmc_process_csw_in(struct thread *td) PMCDBG3(CSW,SWI,1,"cpu=%d ri=%d new=%jd", cpu, ri, newvalue); - pcd->pcd_write_pmc(cpu, adjri, newvalue); + pcd->pcd_write_pmc(cpu, adjri, pm, newvalue); /* If a sampling mode PMC, reset stalled state. */ if (PMC_TO_MODE(pm) == PMC_MODE_TS) @@ -1498,7 +1498,7 @@ pmc_process_csw_in(struct thread *td) pm->pm_pcpu_state[cpu].pps_cpustate = 1; /* Start the PMC. */ - pcd->pcd_start_pmc(cpu, adjri); + pcd->pcd_start_pmc(cpu, adjri, pm); } /* @@ -1601,7 +1601,7 @@ pmc_process_csw_out(struct thread *td) */ pm->pm_pcpu_state[cpu].pps_cpustate = 0; if (pm->pm_pcpu_state[cpu].pps_stalled == 0) - pcd->pcd_stop_pmc(cpu, adjri); + pcd->pcd_stop_pmc(cpu, adjri, pm); KASSERT(counter_u64_fetch(pm->pm_runcount) > 0, ("[pmc,%d] pm=%p runcount %ld", __LINE__, (void *) pm, @@ -1625,7 +1625,7 @@ pmc_process_csw_out(struct thread *td) ("[pmc,%d] pp refcnt = %d", __LINE__, pp->pp_refcnt)); - pcd->pcd_read_pmc(cpu, adjri, &newvalue); + pcd->pcd_read_pmc(cpu, adjri, pm, &newvalue); if (mode == PMC_MODE_TS) { PMCDBG3(CSW,SWO,1,"cpu=%d ri=%d val=%jd (samp)", @@ -2824,7 +2824,7 @@ pmc_release_pmc_descriptor(struct pmc *pm) PMCDBG2(PMC,REL,2, "stopping cpu=%d ri=%d", cpu, ri); critical_enter(); - pcd->pcd_stop_pmc(cpu, adjri); + pcd->pcd_stop_pmc(cpu, adjri, pm); critical_exit(); } @@ -3246,7 +3246,7 @@ pmc_start(struct pmc *pm) pm->pm_state = PMC_STATE_RUNNING; critical_enter(); - if ((error = pcd->pcd_write_pmc(cpu, adjri, + if ((error = pcd->pcd_write_pmc(cpu, adjri, pm, PMC_IS_SAMPLING_MODE(mode) ? pm->pm_sc.pm_reloadcount : pm->pm_sc.pm_initial)) == 0) { @@ -3256,7 +3256,7 @@ pmc_start(struct pmc *pm) /* Indicate that we desire this to run. Start it. */ pm->pm_pcpu_state[cpu].pps_cpustate = 1; - error = pcd->pcd_start_pmc(cpu, adjri); + error = pcd->pcd_start_pmc(cpu, adjri, pm); } critical_exit(); @@ -3321,8 +3321,9 @@ pmc_stop(struct pmc *pm) pm->pm_pcpu_state[cpu].pps_cpustate = 0; critical_enter(); - if ((error = pcd->pcd_stop_pmc(cpu, adjri)) == 0) - error = pcd->pcd_read_pmc(cpu, adjri, &pm->pm_sc.pm_initial); + if ((error = pcd->pcd_stop_pmc(cpu, adjri, pm)) == 0) + error = pcd->pcd_read_pmc(cpu, adjri, pm, + &pm->pm_sc.pm_initial); critical_exit(); pmc_restore_cpu_binding(&pb); @@ -4400,7 +4401,7 @@ pmc_syscall_handler(struct thread *td, void *syscall_args) if ((pm->pm_flags & PMC_F_ATTACHED_TO_OWNER) && (pm->pm_state == PMC_STATE_RUNNING)) error = (*pcd->pcd_read_pmc)(cpu, adjri, - &oldvalue); + pm, &oldvalue); else oldvalue = pm->pm_gv.pm_savedvalue; } @@ -4425,13 +4426,14 @@ pmc_syscall_handler(struct thread *td, void *syscall_args) critical_enter(); /* save old value */ - if (prw.pm_flags & PMC_F_OLDVALUE) + if (prw.pm_flags & PMC_F_OLDVALUE) { if ((error = (*pcd->pcd_read_pmc)(cpu, adjri, - &oldvalue))) + pm, &oldvalue))) goto error; + } /* write out new value */ if (prw.pm_flags & PMC_F_NEWVALUE) - error = (*pcd->pcd_write_pmc)(cpu, adjri, + error = (*pcd->pcd_write_pmc)(cpu, adjri, pm, prw.pm_value); error: critical_exit(); @@ -5028,7 +5030,7 @@ pmc_process_samples(int cpu, ring_type_t ring) continue; pm->pm_pcpu_state[cpu].pps_stalled = 0; - (*pcd->pcd_start_pmc)(cpu, adjri); + (*pcd->pcd_start_pmc)(cpu, adjri, pm); } } @@ -5162,11 +5164,11 @@ pmc_process_exit(void *arg __unused, struct proc *p) if (pm->pm_pcpu_state[cpu].pps_cpustate) { pm->pm_pcpu_state[cpu].pps_cpustate = 0; if (!pm->pm_pcpu_state[cpu].pps_stalled) { - (void) pcd->pcd_stop_pmc(cpu, adjri); + (void) pcd->pcd_stop_pmc(cpu, adjri, pm); if (PMC_TO_MODE(pm) == PMC_MODE_TC) { pcd->pcd_read_pmc(cpu, adjri, - &newvalue); + pm, &newvalue); tmp = newvalue - PMC_PCPU_SAVED(cpu,ri); diff --git a/sys/dev/hwpmc/hwpmc_powerpc.c b/sys/dev/hwpmc/hwpmc_powerpc.c index 4c2a9cf84ef4..e8f6f536e471 100644 --- a/sys/dev/hwpmc/hwpmc_powerpc.c +++ b/sys/dev/hwpmc/hwpmc_powerpc.c @@ -262,19 +262,17 @@ powerpc_release_pmc(int cpu, int ri, struct pmc *pmc) } int -powerpc_start_pmc(int cpu, int ri) +powerpc_start_pmc(int cpu, int ri, struct pmc *pm) { - struct pmc *pm; PMCDBG2(MDP,STA,1,"powerpc-start cpu=%d ri=%d", cpu, ri); - pm = powerpc_pcpu[cpu]->pc_ppcpmcs[ri].phw_pmc; powerpc_set_pmc(cpu, ri, pm->pm_md.pm_powerpc.pm_powerpc_evsel); return (0); } int -powerpc_stop_pmc(int cpu, int ri) +powerpc_stop_pmc(int cpu, int ri, struct pmc *pm __unused) { PMCDBG2(MDP,STO,1, "powerpc-stop cpu=%d ri=%d", cpu, ri); powerpc_set_pmc(cpu, ri, PMCN_NONE); @@ -377,9 +375,8 @@ powerpc_pmcn_write_default(unsigned int pmc, uint32_t val) } int -powerpc_read_pmc(int cpu, int ri, pmc_value_t *v) +powerpc_read_pmc(int cpu, int ri, struct pmc *pm, pmc_value_t *v) { - struct pmc *pm; pmc_value_t p, r, tmp; KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), @@ -387,11 +384,6 @@ powerpc_read_pmc(int cpu, int ri, pmc_value_t *v) KASSERT(ri >= 0 && ri < ppc_max_pmcs, ("[powerpc,%d] illegal row index %d", __LINE__, ri)); - pm = powerpc_pcpu[cpu]->pc_ppcpmcs[ri].phw_pmc; - KASSERT(pm, - ("[core,%d] cpu %d ri %d pmc not configured", __LINE__, cpu, - ri)); - /* * After an interrupt occurs because of a PMC overflow, the PMC value * is not always MAX_PMC_VALUE + 1, but may be a little above it. @@ -430,9 +422,8 @@ powerpc_read_pmc(int cpu, int ri, pmc_value_t *v) } int -powerpc_write_pmc(int cpu, int ri, pmc_value_t v) +powerpc_write_pmc(int cpu, int ri, struct pmc *pm, pmc_value_t v) { - struct pmc *pm; pmc_value_t vlo; KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), @@ -440,8 +431,6 @@ powerpc_write_pmc(int cpu, int ri, pmc_value_t v) KASSERT(ri >= 0 && ri < ppc_max_pmcs, ("[powerpc,%d] illegal row-index %d", __LINE__, ri)); - pm = powerpc_pcpu[cpu]->pc_ppcpmcs[ri].phw_pmc; - if (PMC_IS_COUNTING_MODE(PMC_TO_MODE(pm))) { PPC_OVERFLOWCNT(pm) = v / (POWERPC_MAX_PMC_VALUE + 1); vlo = v % (POWERPC_MAX_PMC_VALUE + 1); @@ -496,7 +485,7 @@ powerpc_pmc_intr(struct trapframe *tf) if ((pm = pc->pc_ppcpmcs[i].phw_pmc) != NULL && PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm))) { if (pm->pm_state != PMC_STATE_RUNNING) { - powerpc_write_pmc(cpu, i, + powerpc_write_pmc(cpu, i, pm, pm->pm_sc.pm_reloadcount); continue; } @@ -518,11 +507,11 @@ powerpc_pmc_intr(struct trapframe *tf) PMCDBG3(MDP,INT,3, "cpu=%d ri=%d: error %d processing interrupt", cpu, i, error); - powerpc_stop_pmc(cpu, i); + powerpc_stop_pmc(cpu, i, pm); } /* Reload sampling count */ - powerpc_write_pmc(cpu, i, pm->pm_sc.pm_reloadcount); + powerpc_write_pmc(cpu, i, pm, pm->pm_sc.pm_reloadcount); } if (retval) diff --git a/sys/dev/hwpmc/hwpmc_powerpc.h b/sys/dev/hwpmc/hwpmc_powerpc.h index 25b041327b84..efd7aca1b9ef 100644 --- a/sys/dev/hwpmc/hwpmc_powerpc.h +++ b/sys/dev/hwpmc/hwpmc_powerpc.h @@ -101,13 +101,13 @@ int powerpc_pcpu_fini(struct pmc_mdep *md, int cpu); int powerpc_allocate_pmc(int cpu, int ri, struct pmc *pm, const struct pmc_op_pmcallocate *a); int powerpc_release_pmc(int cpu, int ri, struct pmc *pmc); -int powerpc_start_pmc(int cpu, int ri); -int powerpc_stop_pmc(int cpu, int ri); +int powerpc_start_pmc(int cpu, int ri, struct pmc *pm); +int powerpc_stop_pmc(int cpu, int ri, struct pmc *pm); int powerpc_config_pmc(int cpu, int ri, struct pmc *pm); pmc_value_t powerpc_pmcn_read_default(unsigned int pmc); void powerpc_pmcn_write_default(unsigned int pmc, uint32_t val); -int powerpc_read_pmc(int cpu, int ri, pmc_value_t *v); -int powerpc_write_pmc(int cpu, int ri, pmc_value_t v); +int powerpc_read_pmc(int cpu, int ri, struct pmc *pm, pmc_value_t *v); +int powerpc_write_pmc(int cpu, int ri, struct pmc *pm, pmc_value_t v); int powerpc_pmc_intr(struct trapframe *tf); #endif /* _KERNEL */ diff --git a/sys/dev/hwpmc/hwpmc_soft.c b/sys/dev/hwpmc/hwpmc_soft.c index f3a6ffc70677..30d8e5013972 100644 --- a/sys/dev/hwpmc/hwpmc_soft.c +++ b/sys/dev/hwpmc/hwpmc_soft.c @@ -257,22 +257,14 @@ soft_pcpu_init(struct pmc_mdep *md, int cpu) } static int -soft_read_pmc(int cpu, int ri, pmc_value_t *v) +soft_read_pmc(int cpu, int ri, struct pmc *pm __unused, pmc_value_t *v) { - struct pmc *pm __diagused; - const struct pmc_hw *phw; KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), ("[soft,%d] illegal CPU value %d", __LINE__, cpu)); KASSERT(ri >= 0 && ri < SOFT_NPMCS, ("[soft,%d] illegal row-index %d", __LINE__, ri)); - phw = &soft_pcpu[cpu]->soft_hw[ri]; - pm = phw->phw_pmc; - - KASSERT(pm != NULL, - ("[soft,%d] no owner for PHW [cpu%d,pmc%d]", __LINE__, cpu, ri)); - PMCDBG1(MDP,REA,1,"soft-read id=%d", ri); *v = soft_pcpu[cpu]->soft_values[ri]; @@ -281,20 +273,13 @@ soft_read_pmc(int cpu, int ri, pmc_value_t *v) } static int -soft_write_pmc(int cpu, int ri, pmc_value_t v) +soft_write_pmc(int cpu, int ri, struct pmc *pm __unused, pmc_value_t v) { - struct pmc *pm __diagused; - KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), ("[soft,%d] illegal cpu value %d", __LINE__, cpu)); KASSERT(ri >= 0 && ri < SOFT_NPMCS, ("[soft,%d] illegal row-index %d", __LINE__, ri)); - pm = soft_pcpu[cpu]->soft_hw[ri].phw_pmc; - - KASSERT(pm, - ("[soft,%d] cpu %d ri %d pmc not configured", __LINE__, cpu, ri)); - PMCDBG3(MDP,WRI,1, "soft-write cpu=%d ri=%d v=%jx", cpu, ri, v); soft_pcpu[cpu]->soft_values[ri] = v; @@ -335,10 +320,8 @@ soft_release_pmc(int cpu, int ri, struct pmc *pmc) } static int -soft_start_pmc(int cpu, int ri) +soft_start_pmc(int cpu, int ri, struct pmc *pm) { - struct pmc *pm; - struct soft_cpu *pc; struct pmc_soft *ps; *** 318 LINES SKIPPED *** From nobody Fri Jun 9 19:58:15 2023 X-Original-To: dev-commits-src-branches@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 4QdBhm0DLDz4cKTJ; Fri, 9 Jun 2023 19:58:16 +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 4QdBhl6vzfz4K3f; Fri, 9 Jun 2023 19:58:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686340696; 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=qj8529q1CEZGD0FiqX1BZAaLWxwbJQa0cIBnECrnRn0=; b=wpNAejHPq2oEZXUdgBcO2dmsrWCCiBgTQEMtHL8J9BFSMYWbSZp7Q3CiTzY/CYarCC7fsE 1XxiOt4zZQJnO7z5NF7XyoJ/LlidHnjB+3NBW8WqMX3yFzZ+jrm5xBuXHIMo1kKJ24TF25 XKzeiV/EAP+KATtSuzZZVyIlFLcc+svXSwk4/nQEyOlgHrq7tKYaMiWQP6yaDKuDB7qgna LVvFxUpTZ19vuF/298m9zMFHXSdVRyDFsTF1YE4WZ9MLhb4l1O6vb0bos9wCWfK0oaH/yC dqYNXbce5qV70b2VRGARaDMXL+ndgq5/ozB2+htQJSwSo8gfbqDoP5xoz6QSCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686340696; 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=qj8529q1CEZGD0FiqX1BZAaLWxwbJQa0cIBnECrnRn0=; b=DbR8U2Y6RLwFOsLyVZABdjBPt6ZfWej0EHMvbcxwKNKWHKDo3BSaIugpJ5Lhyri2ngj/Ss jthlg5ZCWCi2s70gktlVh/PFVixUeuyW5i3NcClLCpAsnulidcXz9Yvto6c6nsbAU09HOH y9erWPX71xWdsw17lh05gtIdm5Ne1HNi8rzwj3SKlGegRrf5SjbFOyd4TG6jR07HxzZdeg GH2qJh2tz8bC3hLiPvtoi7ebKAmHhyRL/sU0SgL7K2a95aZNObSDY8kfPQB1qQQW9eS8cc wJFTxJY4TA2459fy7DdSKROTwWo7qyRMwNYM4EzM5QMaz2fxX6gPi7XMYe/C8w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686340696; a=rsa-sha256; cv=none; b=ymD5ymuGz0luU+VSRcH5564qtlY7vQ/KqHesAfNHKboN4tYt2CMnF3R9ZZWrGaGTiV0hS9 hsH0ONJxTWB4R1X+qNdWBmLIHFOkF4kf1WNgGMWNf+U5dIQYqzwmEV/B+fV5BxdFhv7CCD YdtvWyl7RZMtdjRrLNk0Ge/2CfaeMhZRL6xkNzBIK52UEsG40WUKMUrodhS4Rnaa1zi0ok /yBaTEh3ovP21J3rD+YgtEy6qa0QczAfG5NjGKwEd08Z8ORGOhtXgUA+riaPYwzb98Vr66 n2/aDIfSsGydM3TUux/Ho/7EDhivj8+6ZaQA7QBXKei6VALKR8ffCWqZ4hvLDw== 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 4QdBhl60XGznbH; Fri, 9 Jun 2023 19:58:15 +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 359JwFt9072302; Fri, 9 Jun 2023 19:58:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 359JwFCP072301; Fri, 9 Jun 2023 19:58:15 GMT (envelope-from git) Date: Fri, 9 Jun 2023 19:58:15 GMT Message-Id: <202306091958.359JwFCP072301@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 927a2f62980b - stable/13 - hwpmc: remove pmd_pcpu_{init,fini} callbacks List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 927a2f62980b69f2bf95c9e3c0424458d06f3886 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=927a2f62980b69f2bf95c9e3c0424458d06f3886 commit 927a2f62980b69f2bf95c9e3c0424458d06f3886 Author: Mitchell Horne AuthorDate: 2023-05-05 21:59:33 +0000 Commit: Mitchell Horne CommitDate: 2023-06-09 19:48:06 +0000 hwpmc: remove pmd_pcpu_{init,fini} callbacks These are unused on all platforms. Reviewed by: jkoshy, emaste MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D39912 (cherry picked from commit 772b2dc3abc5072743e7598d35e0a8ad621e7b0d) --- sys/dev/hwpmc/hwpmc_amd.c | 2 -- sys/dev/hwpmc/hwpmc_core.c | 3 --- sys/dev/hwpmc/hwpmc_mod.c | 6 ------ sys/sys/pmc.h | 4 ---- 4 files changed, 15 deletions(-) diff --git a/sys/dev/hwpmc/hwpmc_amd.c b/sys/dev/hwpmc/hwpmc_amd.c index 36411da871ea..26ea46d3fc9f 100644 --- a/sys/dev/hwpmc/hwpmc_amd.c +++ b/sys/dev/hwpmc/hwpmc_amd.c @@ -1146,8 +1146,6 @@ pmc_amd_initialize(void) pcd->pcd_stop_pmc = amd_stop_pmc; pcd->pcd_write_pmc = amd_write_pmc; - pmc_mdep->pmd_pcpu_init = NULL; - pmc_mdep->pmd_pcpu_fini = NULL; pmc_mdep->pmd_intr = amd_intr; pmc_mdep->pmd_switch_in = amd_switch_in; pmc_mdep->pmd_switch_out = amd_switch_out; diff --git a/sys/dev/hwpmc/hwpmc_core.c b/sys/dev/hwpmc/hwpmc_core.c index d80edeefb0d0..02165898aeed 100644 --- a/sys/dev/hwpmc/hwpmc_core.c +++ b/sys/dev/hwpmc/hwpmc_core.c @@ -1248,9 +1248,6 @@ pmc_core_initialize(struct pmc_mdep *md, int maxcpu, int version_override) else md->pmd_intr = core_intr; - md->pmd_pcpu_fini = NULL; - md->pmd_pcpu_init = NULL; - return (0); } diff --git a/sys/dev/hwpmc/hwpmc_mod.c b/sys/dev/hwpmc/hwpmc_mod.c index fb8679f65a38..1ff427a1e965 100644 --- a/sys/dev/hwpmc/hwpmc_mod.c +++ b/sys/dev/hwpmc/hwpmc_mod.c @@ -5492,8 +5492,6 @@ pmc_generic_cpu_initialize(void) md->pmd_cputype = PMC_CPU_GENERIC; - md->pmd_pcpu_init = NULL; - md->pmd_pcpu_fini = NULL; md->pmd_switch_in = generic_switch_in; md->pmd_switch_out = generic_switch_out; @@ -5626,8 +5624,6 @@ pmc_initialize(void) pmc_pcpu[cpu] = malloc(sizeof(struct pmc_cpu) + md->pmd_npmc * sizeof(struct pmc_hw *), M_PMC, M_WAITOK|M_ZERO); - if (md->pmd_pcpu_init) - error = md->pmd_pcpu_init(md, cpu); for (n = 0; error == 0 && n < md->pmd_nclass; n++) error = md->pmd_classdep[n].pcd_pcpu_init(md, cpu); } @@ -5865,8 +5861,6 @@ pmc_cleanup(void) pmc_select_cpu(cpu); for (c = 0; c < md->pmd_nclass; c++) md->pmd_classdep[c].pcd_pcpu_fini(md, cpu); - if (md->pmd_pcpu_fini) - md->pmd_pcpu_fini(md, cpu); } if (md->pmd_cputype == PMC_CPU_GENERIC) diff --git a/sys/sys/pmc.h b/sys/sys/pmc.h index b771dac81e93..1983dbb91578 100644 --- a/sys/sys/pmc.h +++ b/sys/sys/pmc.h @@ -1046,10 +1046,6 @@ struct pmc_mdep { * Machine dependent methods. */ - /* per-cpu initialization and finalization */ - int (*pmd_pcpu_init)(struct pmc_mdep *_md, int _cpu); - int (*pmd_pcpu_fini)(struct pmc_mdep *_md, int _cpu); - /* thread context switch in/out */ int (*pmd_switch_in)(struct pmc_cpu *_p, struct pmc_process *_pp); int (*pmd_switch_out)(struct pmc_cpu *_p, struct pmc_process *_pp); From nobody Fri Jun 9 19:58:16 2023 X-Original-To: dev-commits-src-branches@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 4QdBhn30XMz4cKYf; Fri, 9 Jun 2023 19:58: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 4QdBhn0Z71z4K00; Fri, 9 Jun 2023 19:58:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686340697; 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=57K2Q0nJBznRys36w9mU+2dThMXFWxPFmSSClL7DgFo=; b=ZHeL0EXzO6RbUkAVjZB45/TTNCyVoKtjMGVTfe/iFKCCVTPsaeM4PTT+bfEjt6waZtoOqk gQkOpEjxysRoM6RbC1GD45vXV05qbhLeOk0rNbvvZj+JWfN/iBLWB5zv345LoyMRCld1/X 29EJ9Y01Nd97sNOrrdcV/fbxhovvHhwRd3FT1T1R18Y+wfDeAC2oQL8inQytxhoV7+W8QU X8KhWl1xLVA7IdAMP0g6myBCobZ71vb6bbQIlxAHflSkQswhIGakfDENYYGeadVN4HnKow A6CQChmyQwgAYy3fHDl/NPmMLz2rMw4vah/WEIDyMP0e0gzlPmXywNFmY9FqBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686340697; 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=57K2Q0nJBznRys36w9mU+2dThMXFWxPFmSSClL7DgFo=; b=OIkxbZwVspZ7v1CyOWzGfn+UjMbpF0Nx/xUBteC8dvoGH5C6ERRN245WsIB54hJDKGMXlF hFBpv3WgIP7n0ObFP6mp5cvj7P1Rg44sT3GevdgtIbPa0/Eq+9lDH16vIun9XzrOoYaTzl +BvVe+vxOfZ4eq13YRDSaliEzf284rV9bGiQuTQ9NvxXZfCsW0R4p6B0fIH+AX5tuIUhbm tSGiOFrFg0O2TNcQd5IMrdoHrShWF/1VbDD1kVc/aT/V2KHF4G23U+vDLV0BXZ5HWANb+V XDVDOE84U94Yr34EEkzBMfLTHT/Z84diHdGFfuPPzdPNEfL3gLY3CwgjoKcHDA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686340697; a=rsa-sha256; cv=none; b=jvnE5m+v8XbHvGP75SZwD+2LE/bSj3hmVMbXhWaIKL/BNQtyCpGokry7i1Ek6ny8m0qU/W AJr7LKlDtAXYGbbftcEh0swDJqAJaCGic9Q3FxnDp+yAdTTJ0ri51SPeKzHdMxOnfk5K5p MWaVVObLRpdKVAKqdC0qrmlXcwIFMBijFqpurMQ9k+1bvX4OvSyIvU7fDMC/CWM+ViazZe Rkfnh+QWmDbH4h6lPHPB0jBaqvXwOgwyCrXrq+Gr9VARE1R3hnpmIFSZJL1mBlNqwjQbqc jfHB+pjhQO/RHtVlbPQC/iibVrQkvk0fBPn/0hB+wlcbngJ+q87rEG1qPy+u0w== 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 4QdBhm6lgCznW3; Fri, 9 Jun 2023 19:58:16 +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 359JwGma072321; Fri, 9 Jun 2023 19:58:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 359JwGRx072320; Fri, 9 Jun 2023 19:58:16 GMT (envelope-from git) Date: Fri, 9 Jun 2023 19:58:16 GMT Message-Id: <202306091958.359JwGRx072320@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 406f97fa59d7 - stable/13 - hwpmc: remove stub pmd_switch_{in,out} methods List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 406f97fa59d73cd8242100fcfa79f35e5b494c1d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=406f97fa59d73cd8242100fcfa79f35e5b494c1d commit 406f97fa59d73cd8242100fcfa79f35e5b494c1d Author: Mitchell Horne AuthorDate: 2023-05-05 21:59:41 +0000 Commit: Mitchell Horne CommitDate: 2023-06-09 19:48:06 +0000 hwpmc: remove stub pmd_switch_{in,out} methods Most platforms (non-x86) don't require these methods and implement stub versions. If we initialize the pmc_mdep structure to always point to the generic versions, then we can purge the duplicate stubs. Reviewed by: jkoshy MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D39913 (cherry picked from commit fa88954fd8f16ef60084a73d446a23e791ed22e5) --- sys/dev/hwpmc/hwpmc_arm64.c | 24 ++---------------------- sys/dev/hwpmc/hwpmc_armv7.c | 24 ++---------------------- sys/dev/hwpmc/hwpmc_mod.c | 7 ++++--- sys/dev/hwpmc/hwpmc_powerpc.c | 17 ----------------- 4 files changed, 8 insertions(+), 64 deletions(-) diff --git a/sys/dev/hwpmc/hwpmc_arm64.c b/sys/dev/hwpmc/hwpmc_arm64.c index 36524072d50c..049294b43f9c 100644 --- a/sys/dev/hwpmc/hwpmc_arm64.c +++ b/sys/dev/hwpmc/hwpmc_arm64.c @@ -442,23 +442,6 @@ arm64_get_config(int cpu, int ri, struct pmc **ppm) return (0); } -/* - * XXX don't know what we should do here. - */ -static int -arm64_switch_in(struct pmc_cpu *pc, struct pmc_process *pp) -{ - - return (0); -} - -static int -arm64_switch_out(struct pmc_cpu *pc, struct pmc_process *pp) -{ - - return (0); -} - static int arm64_pcpu_init(struct pmc_mdep *md, int cpu) { @@ -598,11 +581,8 @@ pmc_arm64_initialize(void) pcd->pcd_stop_pmc = arm64_stop_pmc; pcd->pcd_write_pmc = arm64_write_pmc; - pmc_mdep->pmd_intr = arm64_intr; - pmc_mdep->pmd_switch_in = arm64_switch_in; - pmc_mdep->pmd_switch_out = arm64_switch_out; - - pmc_mdep->pmd_npmc += arm64_npmcs; + pmc_mdep->pmd_intr = arm64_intr; + pmc_mdep->pmd_npmc += arm64_npmcs; return (pmc_mdep); } diff --git a/sys/dev/hwpmc/hwpmc_armv7.c b/sys/dev/hwpmc/hwpmc_armv7.c index 052b97f35586..26fa6a88b98f 100644 --- a/sys/dev/hwpmc/hwpmc_armv7.c +++ b/sys/dev/hwpmc/hwpmc_armv7.c @@ -407,23 +407,6 @@ armv7_get_config(int cpu, int ri, struct pmc **ppm) return 0; } -/* - * XXX don't know what we should do here. - */ -static int -armv7_switch_in(struct pmc_cpu *pc, struct pmc_process *pp) -{ - - return 0; -} - -static int -armv7_switch_out(struct pmc_cpu *pc, struct pmc_process *pp) -{ - - return 0; -} - static int armv7_pcpu_init(struct pmc_mdep *md, int cpu) { @@ -542,11 +525,8 @@ pmc_armv7_initialize(void) pcd->pcd_stop_pmc = armv7_stop_pmc; pcd->pcd_write_pmc = armv7_write_pmc; - pmc_mdep->pmd_intr = armv7_intr; - pmc_mdep->pmd_switch_in = armv7_switch_in; - pmc_mdep->pmd_switch_out = armv7_switch_out; - - pmc_mdep->pmd_npmc += armv7_npmcs; + pmc_mdep->pmd_intr = armv7_intr; + pmc_mdep->pmd_npmc += armv7_npmcs; return (pmc_mdep); } diff --git a/sys/dev/hwpmc/hwpmc_mod.c b/sys/dev/hwpmc/hwpmc_mod.c index 1ff427a1e965..571b403538ed 100644 --- a/sys/dev/hwpmc/hwpmc_mod.c +++ b/sys/dev/hwpmc/hwpmc_mod.c @@ -5455,6 +5455,10 @@ pmc_mdep_alloc(int nclasses) sizeof(struct pmc_classdep), M_PMC, M_WAITOK|M_ZERO); md->pmd_nclass = n; + /* Default methods */ + md->pmd_switch_in = generic_switch_in; + md->pmd_switch_out = generic_switch_out; + /* Add base class. */ pmc_soft_initialize(md); return md; @@ -5492,9 +5496,6 @@ pmc_generic_cpu_initialize(void) md->pmd_cputype = PMC_CPU_GENERIC; - md->pmd_switch_in = generic_switch_in; - md->pmd_switch_out = generic_switch_out; - return (md); } diff --git a/sys/dev/hwpmc/hwpmc_powerpc.c b/sys/dev/hwpmc/hwpmc_powerpc.c index e8f6f536e471..364e66f77870 100644 --- a/sys/dev/hwpmc/hwpmc_powerpc.c +++ b/sys/dev/hwpmc/hwpmc_powerpc.c @@ -105,20 +105,6 @@ pmc_save_kernel_callchain(uintptr_t *cc, int maxsamples, return (frames); } -static int -powerpc_switch_in(struct pmc_cpu *pc, struct pmc_process *pp) -{ - - return (0); -} - -static int -powerpc_switch_out(struct pmc_cpu *pc, struct pmc_process *pp) -{ - - return (0); -} - int powerpc_describe(int cpu, int ri, struct pmc_info *pi, struct pmc **ppmc) { @@ -553,9 +539,6 @@ pmc_md_initialize(void) vers = mfpvr() >> 16; - pmc_mdep->pmd_switch_in = powerpc_switch_in; - pmc_mdep->pmd_switch_out = powerpc_switch_out; - switch (vers) { case MPC7447A: case MPC7448: From nobody Fri Jun 9 19:58:17 2023 X-Original-To: dev-commits-src-branches@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 4QdBhp2gj5z4cKbH; Fri, 9 Jun 2023 19:58:18 +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 4QdBhp1Bmwz4JwJ; Fri, 9 Jun 2023 19:58:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686340698; 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=JtFZwlugtfsX2EBmPFpaRFcZBCcbuCXj2+89Id6KZtI=; b=JJ0R0s8wnIQz+DndqVi7I1DKD/LUZ4PIMdoVbprNoYO8FayVK+7wfPlQ/Ec5Q3qKOY+o10 cJcU3AvWLAr4TJRXYrjmagc4ZL/j36GEwiHxCjH8fZufAjvevBajNi8j3q/vTkl+s++uA2 JjxMTj6dbSMQ9sO/oR0ltNcht+K9w+CKI3XNU4U66bCyodHOwK2CHNjjC9oIljf22gGof/ 3iQW/QO0kppxEnSVlxuQaXdurcgMDWHpNf4TA/LtbRQqAZO5mjUu/Y0yO+nyO8JKEpH2++ mylOnwjfnvCGsORKFbnk1pa35qn0XWbOtQ7KYBckuUCeOiPmmarMcN9j7KCOSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686340698; 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=JtFZwlugtfsX2EBmPFpaRFcZBCcbuCXj2+89Id6KZtI=; b=YhGEKOkhbeyPHIf+p9HvS4Ijf6EtlDCyFkFOxKG3Sugx0+mi9Q118LmbltZAD0iLd7OAHV 10UWzqVH/dBjU0/jrh4hTe4gN4M1bWBdJM2ZafuPYj2vNAskbUvxe+oQo49hHD1V1341X9 ZS1JvTSeD34L8i+yMvfYN3o7lCYmcCC/gXrQzQGkUgoFkBDzZoyNVqRyZV2DONtggvDtw6 KFil7fCEemDhjr6yZlU7OB/m19d1WYir8LV7eatr1fWzzDiSMqbJPRie4qp0xbglzUCSN1 6DNem9cJsuKFxuCcbi6cEpOKfOMcOFLh2ZgfYk12AG6E0zd7LSjbF80ULNbtgg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686340698; a=rsa-sha256; cv=none; b=I1wjGjwI81GLRZb4WiTxwoHOIhIhpgF7CLSwWk829j5U3tckDb0RstTf3hev/IBATW9/6o RtCMpw/howhBtyPmlv5jYjI7vI0PQwJI7xZUuS8nDHH80lQwub7beMR8qLiG+JzZ+jh/gK 0aKrdWOf8Eq8nZm9hOrqESzuu1adeYH+AvNs8hBvfjhnDwzIeCI/TIZrwZTc+ojm4hrpWE yc9Mt9KZ8d5hxe58WYEdZbvYwgAFZ36ecOkgCD1Q0YieLFXuvEIthyJ0mcKK0XEinBEJaK QaeCRbh6y17yYIgu8yaYxqbv7WrWluedm/+15rEGFck++Z+r4GO/VBfGVykQzA== 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 4QdBhp0JM1zp9D; Fri, 9 Jun 2023 19:58:18 +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 359JwH6b072340; Fri, 9 Jun 2023 19:58:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 359JwHto072339; Fri, 9 Jun 2023 19:58:17 GMT (envelope-from git) Date: Fri, 9 Jun 2023 19:58:17 GMT Message-Id: <202306091958.359JwHto072339@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 33e2f70d7d10 - stable/13 - ofw_cpu: whitespace cleanup List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 33e2f70d7d1065fddc66347f6d63c4d82dd9a7eb Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=33e2f70d7d1065fddc66347f6d63c4d82dd9a7eb commit 33e2f70d7d1065fddc66347f6d63c4d82dd9a7eb Author: Mitchell Horne AuthorDate: 2023-05-24 13:27:34 +0000 Commit: Mitchell Horne CommitDate: 2023-06-09 19:48:06 +0000 ofw_cpu: whitespace cleanup Reviewed by: jhb, emaste MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D40242 (cherry picked from commit 5edffecc4b4ec6c3e1f09174f155a3abdd928d01) --- sys/dev/ofw/ofw_cpu.c | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/sys/dev/ofw/ofw_cpu.c b/sys/dev/ofw/ofw_cpu.c index a033c7ef8725..832b3dd54565 100644 --- a/sys/dev/ofw/ofw_cpu.c +++ b/sys/dev/ofw/ofw_cpu.c @@ -91,10 +91,10 @@ static devclass_t ofw_cpulist_devclass; DRIVER_MODULE(ofw_cpulist, ofwbus, ofw_cpulist_driver, ofw_cpulist_devclass, 0, 0); -static int -ofw_cpulist_probe(device_t dev) +static int +ofw_cpulist_probe(device_t dev) { - const char *name; + const char *name; name = ofw_bus_get_name(dev); @@ -106,8 +106,8 @@ ofw_cpulist_probe(device_t dev) return (0); } -static int -ofw_cpulist_attach(device_t dev) +static int +ofw_cpulist_attach(device_t dev) { struct ofw_cpulist_softc *sc; phandle_t root, child; @@ -124,18 +124,18 @@ ofw_cpulist_attach(device_t dev) for (child = OF_child(root); child != 0; child = OF_peer(child)) { dinfo = malloc(sizeof(*dinfo), M_OFWCPU, M_WAITOK | M_ZERO); - if (ofw_bus_gen_setup_devinfo(dinfo, child) != 0) { - free(dinfo, M_OFWCPU); - continue; - } - cdev = device_add_child(dev, NULL, -1); - if (cdev == NULL) { - device_printf(dev, "<%s>: device_add_child failed\n", - dinfo->obd_name); - ofw_bus_gen_destroy_devinfo(dinfo); - free(dinfo, M_OFWCPU); - continue; - } + if (ofw_bus_gen_setup_devinfo(dinfo, child) != 0) { + free(dinfo, M_OFWCPU); + continue; + } + cdev = device_add_child(dev, NULL, -1); + if (cdev == NULL) { + device_printf(dev, "<%s>: device_add_child failed\n", + dinfo->obd_name); + ofw_bus_gen_destroy_devinfo(dinfo); + free(dinfo, M_OFWCPU); + continue; + } device_set_ivars(cdev, dinfo); } @@ -143,9 +143,9 @@ ofw_cpulist_attach(device_t dev) } static const struct ofw_bus_devinfo * -ofw_cpulist_get_devinfo(device_t dev, device_t child) +ofw_cpulist_get_devinfo(device_t dev, device_t child) { - return (device_get_ivars(child)); + return (device_get_ivars(child)); } static int ofw_cpu_probe(device_t); @@ -246,8 +246,8 @@ ofw_cpu_attach(device_t dev) struct cpuref cpuref; cell_t *servers; int i, nservers, rv; - - if ((nservers = OF_getencprop_alloc(node, + + if ((nservers = OF_getencprop_alloc(node, "ibm,ppc-interrupt-server#s", (void **)&servers)) < 0) return (ENXIO); nservers /= sizeof(cell_t); From nobody Fri Jun 9 19:58:19 2023 X-Original-To: dev-commits-src-branches@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 4QdBhq33Hlz4cK5g; Fri, 9 Jun 2023 19:58:19 +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 4QdBhq2B3Qz4KCf; Fri, 9 Jun 2023 19:58:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686340699; 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=Yoi0R3Yusbsr9EqqVPXw2Hnb1GVMTlkRBpHAc7rTZ1A=; b=xz5c4e0Di9LjujOQ+x2hmP6fFVhFo8r7w/Krbmf4pewIM+rafMqYNsFD73kS4pqfJJRmv+ b/AghFQHcXIGGAU1GJj8O0m3y0GA6RdIWcJE04EjaCBX6bqMolE160PnoVNBIsid+Dnnpt gdl89d/+zmr2Pe+wjuf0oZaTKPoD5kilUSt8o/rX7+KyOBc5jk+THsBiDctuUmA0CoSfC/ mncwCWok1p2LRXraYeyJnzay0kxcNp0ziN9lbS15jSWqGknzAcr6dtEyrmbqPtjulRwOmt 0g5iz/0HYnJjyRm+ZoV1q/DKO2gGszCeVUaKYHqGTc/h3Z2eFJqq7jpGJSsBUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686340699; 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=Yoi0R3Yusbsr9EqqVPXw2Hnb1GVMTlkRBpHAc7rTZ1A=; b=OLqjS8GS17HPn6jNulFaE9GrYSo5MG4lNxeeonI/MCOqe1M0avz57tuFzM4A3EIDU6wdVY SRnEI75hNlKEcLZQ7toWvbL8RC+3b/l6duMTkxYU0YfHHQW8ArYreAaCoHZnkOOrAXFOgF 0gxkIy/zizyRlmADRbgA42el4pxno24ATRTpQ8Lwp53Rhal52owlXhElLnDSBYZW0Rjvzc BBUNn9qHlmujqw4ANTolWgr6KYIcS+njAMnMuE78ZUbHTAN/X3Y+5Ase6jqdbXjaVN4uQI mzHeaLwJ9ImyGob8ix1kUqXc+Vz0xJAkdRAvcyJo12lq/0LCILs1ThhyXq2xww== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686340699; a=rsa-sha256; cv=none; b=avdmR5xMmd3P9Fx5kJj/Yu7OP60IZT5+HppG3OpjRYYwI69ZZ5LblLZ6IBYoPTL+UWN8wZ ZTGjuJxfjIzU2xZHfytQjAmmt1tBP5YDGL/Y7OiZ3fjN+JqqjpyX3E71xerQlZisC8RE4B Q0ZZoE2QOUg1AAl8B3/6jRqJAFwuHHb4MJ+wuSyCj0PNcuDoGmr/VKBVFRF81ydQnnmjG0 nvrsr8gXwKpUugs7bdHRK4JZthyD2/OFZw3Yi3PsWP+/gADWcKRBKlUZHZ8IhO67gUPnNA UXFlOJhrSW/iVaoW1sIsHCDSY7MMzC9SaYQO8nvcncOztjSHmri7ve1aWQOEug== 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 4QdBhq1BPRzp02; Fri, 9 Jun 2023 19:58:19 +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 359JwJ75072359; Fri, 9 Jun 2023 19:58:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 359JwJZR072358; Fri, 9 Jun 2023 19:58:19 GMT (envelope-from git) Date: Fri, 9 Jun 2023 19:58:19 GMT Message-Id: <202306091958.359JwJZR072358@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: e61a69e88a03 - stable/13 - ofw_cpu: quiet secondary CPU devices List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e61a69e88a03f4f4fb547c867a8953b4bb4ddfea Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=e61a69e88a03f4f4fb547c867a8953b4bb4ddfea commit e61a69e88a03f4f4fb547c867a8953b4bb4ddfea Author: Mitchell Horne AuthorDate: 2023-05-24 13:27:55 +0000 Commit: Mitchell Horne CommitDate: 2023-06-09 19:48:06 +0000 ofw_cpu: quiet secondary CPU devices We already do plenty to announce the different CPUs in dmesg. Follow the ACPI CPU strategy of reporting the first CPU device, but quieting the rest for non-verbose boot. This cuts down slightly on dmesg output. Reviewed by: manu, jhb MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D40243 (cherry picked from commit 08637d5d1580af743f4ed6504104d038e017f918) --- sys/dev/ofw/ofw_cpu.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/dev/ofw/ofw_cpu.c b/sys/dev/ofw/ofw_cpu.c index 832b3dd54565..714ecadc5c59 100644 --- a/sys/dev/ofw/ofw_cpu.c +++ b/sys/dev/ofw/ofw_cpu.c @@ -196,6 +196,11 @@ ofw_cpu_probe(device_t dev) return (ENXIO); device_set_desc(dev, "Open Firmware CPU"); + if (!bootverbose && device_get_unit(dev) != 0) { + device_quiet(dev); + device_quiet_children(dev); + } + return (0); } From nobody Fri Jun 9 19:58:20 2023 X-Original-To: dev-commits-src-branches@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 4QdBhr3gS7z4cKQb; Fri, 9 Jun 2023 19:58:20 +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 4QdBhr37JBz4K78; Fri, 9 Jun 2023 19:58:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686340700; 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=NpwF8JTWddMwGeEaxkVbwIhYL7rv2IsI7OlyXnEKT4E=; b=oxWP2mBdcTbfscXJw7hXnwG7eGl8nbkF7Cyzhzl1HpQLsiwJW4mtyFiQq8HFxWQLF0Tbzu o6mG8rPu1LuZJ6MXcSTTZGsGTcTAsjr77lBGdwDIoDQDRWXh1ruF89qUYeNxex/Fxx1cFw mMrscOmhZZgKvUCvbbWWlYLwKFwM5Ga3nhcIAP3mk0/F53P/YICs3y0zUNgjGo82r+Nzw3 mTp3+lCNAcoNrUmP26QEXKDfxQn4NEijOAEj1rrxn5DU/NSLJlCnyZtt7ZbMvesnt5N8oJ 7DnFME5UhgDdMk6djfEYQiZIuppertLIcj9yzEVHdDksUPm5UNpzwJYwdhh2nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686340700; 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=NpwF8JTWddMwGeEaxkVbwIhYL7rv2IsI7OlyXnEKT4E=; b=h/tBFUxibAZICwCyPSg65yyeRo1FSz/9Xhr8Gbhp/g9ZoGPYVZBxKvpEB4YS9M8KwpP2Zr OVeBXKh9Dby9cercvCY8x3aJyLntkvyW2bMcNBM82/K2JJwwPvIxPH2tYS2NOaec2eWqmP zqWXFb5AvX0mfUMKTStUIqFtKfKOskfD3YiX7nUZYE9jhPfTPoJxt7aJbB7F4UV3dqdcS3 tBnnWKdRiddCxRwDG9piDWSFWTri9pJS2UQzBE/SWSyBOfEkoT3wM7pnfTrXZcOozdpviL 0P6Aq+8nkqqKMBZdwOvqOUMjdb6uRk1W+/r7soieG8o3KH3BLpLIunx23H8Uhg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686340700; a=rsa-sha256; cv=none; b=iAW0OXDximRWCvXIRyxWC+gpWnOmZ9vm8q1Nw+R4L0zan841pPDfjHtQGOI0dKg+QmKjv3 jSO2rXsP0hZz+B+/7o6z+GBOR3GsRX07kgHCidJGt9oCKn4jVlilBy46KJUVRBKlbwH64j o+BBnhgLj9yJh8/LvithQT28JPHBoom7CxsCpE3/Jh8WpwIEX2zoxB4cGILRHLIdltOUHq 2KF5xvErzOee7i0fWo5YZfADUUXqCfM9xFT6adCqmZe65xhuzd5xq0Tc+sAxmKalCrmVi9 o0THsdmnrZTBL3ZSE5m0xnl+CZ1JD5Wki1yOAh3WEhdkqa/Wa08ZBrXQVn20iQ== 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 4QdBhr2Dlsznms; Fri, 9 Jun 2023 19:58:20 +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 359JwKE7072378; Fri, 9 Jun 2023 19:58:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 359JwKmo072377; Fri, 9 Jun 2023 19:58:20 GMT (envelope-from git) Date: Fri, 9 Jun 2023 19:58:20 GMT Message-Id: <202306091958.359JwKmo072377@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: b4567a48a946 - stable/13 - arm64/disassem.c: Add detection of xzr and sp List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b4567a48a9465912c2125bda37ee71a08ab52634 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=b4567a48a9465912c2125bda37ee71a08ab52634 commit b4567a48a9465912c2125bda37ee71a08ab52634 Author: Mykola Hohsadze AuthorDate: 2023-05-08 13:39:09 +0000 Commit: Mitchell Horne CommitDate: 2023-06-09 19:48:06 +0000 arm64/disassem.c: Add detection of xzr and sp Added support to distinguish between XZR/WZR and SP/WSP registers. Add new OP_ flags to indicate if the instruction allows the use of SP for a given register field. "wSP" and "SP" are removed from w_reg and x_reg, and helper functions are introduced for this purpose of detecting the correct name of the x31 register. mhorne: While here, adjust some whitespace issues from a previous commit. Reviewed by: mhorne MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D39862 (cherry picked from commit 9f60b8ce6085049c3886c3e2eb8d4034cef56627) --- sys/arm64/arm64/disassem.c | 142 +++++++++++++++++++++++++++------------------ 1 file changed, 87 insertions(+), 55 deletions(-) diff --git a/sys/arm64/arm64/disassem.c b/sys/arm64/arm64/disassem.c index 0f7b040e7b06..9db4ea040d37 100644 --- a/sys/arm64/arm64/disassem.c +++ b/sys/arm64/arm64/disassem.c @@ -49,19 +49,23 @@ __FBSDID("$FreeBSD$"); #define OP_MULT_4 (1UL << 2) /* Multiply immediate by 4 */ #define OP_SF32 (1UL << 3) /* Force 32-bit access */ #define OP_SF_INV (1UL << 6) /* SF is inverted (1 means 32 bit access) */ +#define OP_RD_SP (1UL << 7) /* Use sp for RD otherwise xzr */ +#define OP_RT_SP (1UL << 8) /* Use sp for RT otherwise xzr */ +#define OP_RN_SP (1UL << 9) /* Use sp for RN otherwise xzr */ +#define OP_RM_SP (1UL << 10) /* Use sp for RM otherwise xzr */ static const char *w_reg[] = { "w0", "w1", "w2", "w3", "w4", "w5", "w6", "w7", "w8", "w9", "w10", "w11", "w12", "w13", "w14", "w15", "w16", "w17", "w18", "w19", "w20", "w21", "w22", "w23", - "w24", "w25", "w26", "w27", "w28", "w29", "w30", "wSP", + "w24", "w25", "w26", "w27", "w28", "w29", "w30" }; static const char *x_reg[] = { "x0", "x1", "x2", "x3", "x4", "x5", "x6", "x7", "x8", "x9", "x10", "x11", "x12", "x13", "x14", "x15", "x16", "x17", "x18", "x19", "x20", "x21", "x22", "x23", - "x24", "x25", "x26", "x27", "x28", "x29", "LR", "SP", + "x24", "x25", "x26", "x27", "x28", "x29", "LR" }; static const char *shift_2[] = { @@ -142,69 +146,76 @@ struct arm64_insn { */ static struct arm64_insn arm64_i[] = { { "add", "SF(1)|0001011|SHIFT(2)|0|RM(5)|IMM(6)|RN(5)|RD(5)", - TYPE_01, 0 }, + TYPE_01, 0 }, /* add shifted register */ { "mov", "SF(1)|001000100000000000000|RN(5)|RD(5)", - TYPE_01, 0 }, + TYPE_01, OP_RD_SP | OP_RN_SP }, /* mov (to/from sp) */ { "add", "SF(1)|0010001|SHIFT(2)|IMM(12)|RN(5)|RD(5)", - TYPE_01, 0 }, + TYPE_01, OP_RD_SP | OP_RN_SP }, /* add immediate */ { "ldr", "1|SF(1)|111000010|IMM(9)|OPTION(2)|RN(5)|RT(5)", - TYPE_02, OP_SIGN_EXT }, /* ldr immediate post/pre index */ + TYPE_02, OP_SIGN_EXT | OP_RN_SP }, /* ldr immediate post/pre index */ { "ldr", "1|SF(1)|11100101|IMM(12)|RN(5)|RT(5)", - TYPE_02, 0 }, /* ldr immediate unsigned */ + TYPE_02, OP_RN_SP }, /* ldr immediate unsigned */ { "ldr", "1|SF(1)|111000011|RM(5)|OPTION(3)|SCALE(1)|10|RN(5)|RT(5)", - TYPE_02, 0 }, /* ldr register */ + TYPE_02, OP_RN_SP }, /* ldr register */ { "ldr", "0|SF(1)|011000|IMM(19)|RT(5)", TYPE_03, OP_SIGN_EXT | OP_LITERAL | OP_MULT_4 }, /* ldr literal */ { "ldrb", "00|111000010|IMM(9)|OPTION(2)|RN(5)|RT(5)", - TYPE_02, OP_SIGN_EXT | OP_SF32 }, /* ldrb immediate post/pre index */ + TYPE_02, OP_SIGN_EXT | OP_SF32 | OP_RN_SP }, + /* ldrb immediate post/pre index */ { "ldrb", "00|11100101|IMM(12)|RN(5)|RT(5)", - TYPE_02, OP_SF32 }, /* ldrb immediate unsigned */ + TYPE_02, OP_SF32 | OP_RN_SP }, /* ldrb immediate unsigned */ { "ldrb", "00|111000011|RM(5)|OPTION(3)|SCALE(1)|10|RN(5)|RT(5)", - TYPE_02, OP_SF32 }, /* ldrb register */ + TYPE_02, OP_SF32 | OP_RN_SP }, /* ldrb register */ { "ldrh", "01|111000010|IMM(9)|OPTION(2)|RN(5)|RT(5)", TYPE_02, - OP_SIGN_EXT | OP_SF32 }, /* ldrh immediate post/pre index */ + OP_SIGN_EXT | OP_SF32 | OP_RN_SP }, /* ldrh immediate post/pre index */ { "ldrh", "01|11100101|IMM(12)|RN(5)|RT(5)", - TYPE_02, OP_SF32 }, /* ldrh immediate unsigned */ + TYPE_02, OP_SF32 | OP_RN_SP }, /* ldrh immediate unsigned */ { "ldrh", "01|111000011|RM(5)|OPTION(3)|SCALE(1)|10|RN(5)|RT(5)", - TYPE_02, OP_SF32 }, /* ldrh register */ + TYPE_02, OP_SF32 | OP_RN_SP }, /* ldrh register */ { "ldrsb", "001110001|SF(1)|0|IMM(9)|OPTION(2)|RN(5)|RT(5)", - TYPE_02, OP_SIGN_EXT | OP_SF_INV }, /* ldrsb immediate post/pre index */ + TYPE_02, OP_SIGN_EXT | OP_SF_INV | OP_RN_SP }, + /* ldrsb immediate post/pre index */ { "ldrsb", "001110011|SF(1)|IMM(12)|RN(5)|RT(5)",\ - TYPE_02, OP_SF_INV}, /* ldrsb immediate unsigned */ + TYPE_02, OP_SF_INV | OP_RN_SP }, /* ldrsb immediate unsigned */ { "ldrsb", "001110001|SF(1)|1|RM(5)|OPTION(3)|SCALE(1)|10|RN(5)|RT(5)", - TYPE_02, OP_SF_INV }, /* ldrsb register */ + TYPE_02, OP_SF_INV | OP_RN_SP }, /* ldrsb register */ { "ldrsh", "011110001|SF(1)|0|IMM(9)|OPTION(2)|RN(5)|RT(5)", - TYPE_02, OP_SIGN_EXT | OP_SF_INV }, /* ldrsh immediate post/pre index */ + TYPE_02, OP_SIGN_EXT | OP_SF_INV | OP_RN_SP }, + /* ldrsh immediate post/pre index */ { "ldrsh", "011110011|SF(1)|IMM(12)|RN(5)|RT(5)", - TYPE_02, OP_SF_INV}, /* ldrsh immediate unsigned */ + TYPE_02, OP_SF_INV | OP_RN_SP }, /* ldrsh immediate unsigned */ { "ldrsh", "011110001|SF(1)|1|RM(5)|OPTION(3)|SCALE(1)|10|RN(5)|RT(5)", - TYPE_02, OP_SF_INV }, /* ldrsh register */ + TYPE_02, OP_SF_INV | OP_RN_SP }, /* ldrsh register */ { "ldrsw", "10111000100|IMM(9)|OPTION(2)|RN(5)|RT(5)", - TYPE_02, OP_SIGN_EXT }, /* ldrsw immediate post/pre index */ + TYPE_02, OP_SIGN_EXT | OP_RN_SP }, /* ldrsw immediate post/pre index */ { "ldrsw", "1011100110|IMM(12)|RN(5)|RT(5)", - TYPE_02, 0 }, /* ldrsw immediate unsigned */ + TYPE_02, OP_RN_SP }, /* ldrsw immediate unsigned */ { "ldrsw", "10111000101|RM(5)|OPTION(3)|SCALE(1)|10|RN(5)|RT(5)", - TYPE_02, 0 }, /* ldrsw register */ + TYPE_02, OP_RN_SP }, /* ldrsw register */ { "ldrsw", "10011000|IMM(19)|RT(5)", - TYPE_03, OP_SIGN_EXT | OP_LITERAL | OP_MULT_4 }, /* ldr literal */ - { "str", "1|SF(1)|111000000|IMM(9)|OPTION(2)|RN(5)|RT(5)", - TYPE_02, OP_SIGN_EXT }, /* str immediate post/pre index */ - { "str", "1|SF(1)|11100100|IMM(12)|RN(5)|RT(5)", - TYPE_02, 0 }, /* str immediate unsigned */ - { "str", "1|SF(1)|111000001|RM(5)|OPTION(3)|SCALE(1)|10|RN(5)|RT(5)", - TYPE_02, 0 }, /* str register */ - { "strb", "00111000000|IMM(9)|OPTION(2)|RN(5)|RT(5)", - TYPE_02, OP_SIGN_EXT | OP_SF32 }, /* strb immediate post/pre index */ - { "strb", "0011100100|IMM(12)|RN(5)|RT(5)", - TYPE_02, OP_SF32 }, /* strb immediate unsigned */ - { "strb", "00111000001|RM(5)|OPTION(3)|SCALE(1)|10|RN(5)|RT(5)", - TYPE_02, OP_SF32 }, /* strb register */ - { "strh", "01111000000|IMM(9)|OPTION(2)|RN(5)|RT(5)", - TYPE_02, OP_SF32 | OP_SIGN_EXT }, /* strh immediate post/pre index */ - { "strh", "0111100100|IMM(12)|RN(5)|RT(5)", - TYPE_02, OP_SF32 }, /* immediate unsigned */ - { "strh", "01111000001|RM(5)|OPTION(3)|SCALE(1)|10|RN(5)|RT(5)", - TYPE_02, OP_SF32 }, /* strh register */ + TYPE_03, OP_SIGN_EXT | OP_LITERAL | OP_MULT_4 }, /* ldrsw literal */ + { "str", "1|SF(1)|111000000|IMM(9)|OPTION(2)|RN(5)|RT(5)", + TYPE_02, OP_SIGN_EXT | OP_RN_SP }, /* str immediate post/pre index */ + { "str", "1|SF(1)|11100100|IMM(12)|RN(5)|RT(5)", + TYPE_02, OP_RN_SP }, /* str immediate unsigned */ + { "str", "1|SF(1)|111000001|RM(5)|OPTION(3)|SCALE(1)|10|RN(5)|RT(5)", + TYPE_02, OP_RN_SP }, /* str register */ + { "strb", "00111000000|IMM(9)|OPTION(2)|RN(5)|RT(5)", + TYPE_02, OP_SIGN_EXT | OP_SF32 | OP_RN_SP }, + /* strb immediate post/pre index */ + { "strb", "0011100100|IMM(12)|RN(5)|RT(5)", + TYPE_02, OP_SF32 | OP_RN_SP }, /* strb immediate unsigned */ + { "strb", "00111000001|RM(5)|OPTION(3)|SCALE(1)|10|RN(5)|RT(5)", + TYPE_02, OP_SF32 | OP_RN_SP }, /* strb register */ + { "strh", "01111000000|IMM(9)|OPTION(2)|RN(5)|RT(5)", + TYPE_02, OP_SF32 | OP_SIGN_EXT | OP_RN_SP }, + /* strh immediate post/pre index */ + { "strh", "0111100100|IMM(12)|RN(5)|RT(5)", + TYPE_02, OP_SF32 | OP_RN_SP }, + /* strh immediate unsigned */ + { "strh", "01111000001|RM(5)|OPTION(3)|SCALE(1)|10|RN(5)|RT(5)", + TYPE_02, OP_SF32 | OP_RN_SP }, + /* strh register */ { NULL, NULL } }; @@ -354,13 +365,27 @@ arm64_disasm_read_token_sign_ext(struct arm64_insn *insn, u_int opcode, } static const char * -arm64_reg(int b64, int num) +arm64_w_reg(int num, int wsp) { + if (num == 31) + return (wsp != 0 ? "wsp" : "wzr"); + return (w_reg[num]); +} - if (b64 != 0) - return (x_reg[num]); +static const char * +arm64_x_reg(int num, int sp) +{ + if (num == 31) + return (sp != 0 ? "sp" : "xzr"); + return (x_reg[num]); +} - return (w_reg[num]); +static const char * +arm64_reg(int b64, int num, int sp) +{ + if (b64 != 0) + return (arm64_x_reg(num, sp)); + return (arm64_w_reg(num, sp)); } vm_offset_t @@ -377,6 +402,8 @@ disasm(const struct disasm_interface *di, vm_offset_t loc, int altfmt) int inside; /* Print exclamation mark if pre-incremented */ int pre; + /* Indicate if x31 register should be printed as sp or xzr */ + int rm_sp, rt_sp, rd_sp, rn_sp; /* Initialize defaults, all are 0 except SF indicating 64bit access */ shift = rd = rm = rn = imm = idx = option = amount = scale = 0; @@ -416,6 +443,11 @@ disasm(const struct disasm_interface *di, vm_offset_t loc, int altfmt) if (i_ptr->special_ops & OP_MULT_4) imm <<= 2; + rm_sp = i_ptr->special_ops & OP_RM_SP; + rt_sp = i_ptr->special_ops & OP_RT_SP; + rd_sp = i_ptr->special_ops & OP_RD_SP; + rn_sp = i_ptr->special_ops & OP_RN_SP; + /* Print opcode by type */ switch (i_ptr->type) { case TYPE_01: @@ -438,12 +470,12 @@ disasm(const struct disasm_interface *di, vm_offset_t loc, int altfmt) arm64_disasm_read_token(i_ptr, insn, "SHIFT", &shift); rm_absent = arm64_disasm_read_token(i_ptr, insn, "RM", &rm); - di->di_printf("%s\t%s, %s", i_ptr->name, arm64_reg(sf, rd), - arm64_reg(sf, rn)); + di->di_printf("%s\t%s, %s", i_ptr->name, + arm64_reg(sf, rd, rd_sp), arm64_reg(sf, rn, rn_sp)); /* If RM is present use it, otherwise use immediate notation */ if (rm_absent == 0) { - di->di_printf(", %s", arm64_reg(sf, rm)); + di->di_printf(", %s", arm64_reg(sf, rm, rm_sp)); if (imm != 0) di->di_printf(", %s #%d", shift_2[shift], imm); } else { @@ -502,14 +534,14 @@ disasm(const struct disasm_interface *di, vm_offset_t loc, int altfmt) } di->di_printf("%s\t%s, ", i_ptr->name, - arm64_reg(sf, rt)); + arm64_reg(sf, rt, rt_sp)); if (inside != 0) { - di->di_printf("[%s", arm64_reg(1, rn)); + di->di_printf("[%s", arm64_reg(1, rn, rn_sp)); if (imm != 0) di->di_printf(", #%d", imm); di->di_printf("]"); } else { - di->di_printf("[%s]", arm64_reg(1, rn)); + di->di_printf("[%s]", arm64_reg(1, rn, rn_sp)); if (imm != 0) di->di_printf(", #%d", imm); } @@ -518,8 +550,8 @@ disasm(const struct disasm_interface *di, vm_offset_t loc, int altfmt) } else { /* Last bit of option field determines 32/64 bit offset */ di->di_printf("%s\t%s, [%s, %s", i_ptr->name, - arm64_reg(sf, rt), arm64_reg(1, rn), - arm64_reg(option & 1, rm)); + arm64_reg(sf, rt, rt_sp), arm64_reg(1, rn, rn_sp), + arm64_reg(option & 1, rm, rm_sp)); if (scale == 0) amount = 0; @@ -564,7 +596,7 @@ disasm(const struct disasm_interface *di, vm_offset_t loc, int altfmt) goto undefined; } - di->di_printf("%s\t%s, ", i_ptr->name, arm64_reg(sf, rt)); + di->di_printf("%s\t%s, ", i_ptr->name, arm64_reg(sf, rt, rt_sp)); if (i_ptr->special_ops & OP_LITERAL) di->di_printf("0x%lx", loc + imm); else From nobody Fri Jun 9 19:58:21 2023 X-Original-To: dev-commits-src-branches@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 4QdBhs5G3tz4cKkR; Fri, 9 Jun 2023 19:58:21 +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 4QdBhs3qsQz4KDy; Fri, 9 Jun 2023 19:58:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686340701; 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=JHcywQKtNyR1cUa7PEiTw0fHKk9reARRK8T8ls+6RSo=; b=x8f94//XxrmspI9TUD6wH3BnwEe4XhF7FcXyXHRWQiLLtfFbloxb2DRZMh1aQqSx9FoNKa MHF98Y6k/zpVmxF+hmtwBuEvyK78xtNFyKHz+g4pTCAqtiGyIeq5ESnm0iwfcVa1xwkSdz T+0gjlqgQ8mMeDP6/1hy10O12EWtzOvRWf69i9KpN8cazSICJ+hAYcJY6M02606RH0jLkc EVwmfCJo7XxeMp/6HIpDlyhWHWalW3r1H5lydcYmyTabFx3LRvVrmP53SMCt07p7d1mMkQ QtVfGrsmae/7RnG7RaWZhpQS/0Bj5VQ8naM/ebRErggVljgGFcUwprGzrS1ehw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686340701; 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=JHcywQKtNyR1cUa7PEiTw0fHKk9reARRK8T8ls+6RSo=; b=nLnlw8mol0eu4XVZZkORmgL5i22mw//pQJBZ8XMMr+mYkLi3uJobh2O6tjQQ18kL/Fk3N4 fW5Pz/qQ4JVQuOTRCGWzyWibmNhxf1DfracAjDwO0KGDTJyOKQ0D6TtFf/jiy2VCk5y5Ot ghAg/B1SLaUiF38jGnT2+EDxxnx66YIyotHN7D7VinxQhCBdFePmgbiWl8Dc+0Iqjb9yvO pfujCTvdUnfN6qIRjHvUpW/1b2udiEmBmJAU918CWWpXX1lomqxko+7c43qsRxxSTpoiC7 MAYxlYLxuXE1srNjnKV5JyMIHkMyBMIIBEwdLngspnfn7eTLzmExJXkaYefXKQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686340701; a=rsa-sha256; cv=none; b=hcJinnsMlMWWB+AaAdf2wTdiM+psIngDY8RsuOsI1lyA0qMH/hFzhBoNVwWFSXjyJ0nwM6 hY4vaYeiDB2p3aKa/MPn+6g00RqaEGJKVP7GqIo/P/5VP3AQ496F3puAOPzvNmwubur2nY 7qVVDUM7X1+uj4ulgR8knhX8FH8VVNvMOtwlqlR11ppv0GvERiESYb4uSeGemMjlKyQfWu dp4CX05hAZn7uHDT8Gjt5NaD/4mWfcytx+UMU0pkWKug4Csm/PvPfNCUGv3Ju4o7ugEJwD 6mINidi+DeZSnJq5upWS5S3nD8EBMhE39RfGo21kUmmplUwjPA5XKvikoNsvjg== 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 4QdBhs2jXSzp7R; Fri, 9 Jun 2023 19:58:21 +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 359JwLuF072409; Fri, 9 Jun 2023 19:58:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 359JwLhq072408; Fri, 9 Jun 2023 19:58:21 GMT (envelope-from git) Date: Fri, 9 Jun 2023 19:58:21 GMT Message-Id: <202306091958.359JwLhq072408@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: d0f5cb10d4f4 - stable/13 - arm64/disassem.c: Make output lowercase List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d0f5cb10d4f43830feee539351b31e9aafce8578 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=d0f5cb10d4f43830feee539351b31e9aafce8578 commit d0f5cb10d4f43830feee539351b31e9aafce8578 Author: Mykola Hohsadze AuthorDate: 2023-05-25 14:40:38 +0000 Commit: Mitchell Horne CommitDate: 2023-06-09 19:48:06 +0000 arm64/disassem.c: Make output lowercase Update the few uppercase fields fields to be consistent with others. Reviewed by: mhorne MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D39820 (cherry picked from commit 8a852d3e9ff7c4d6f93b65beba8d674127109fc4) --- sys/arm64/arm64/disassem.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/arm64/arm64/disassem.c b/sys/arm64/arm64/disassem.c index 9db4ea040d37..2ec0d04d5491 100644 --- a/sys/arm64/arm64/disassem.c +++ b/sys/arm64/arm64/disassem.c @@ -65,11 +65,11 @@ static const char *x_reg[] = { "x0", "x1", "x2", "x3", "x4", "x5", "x6", "x7", "x8", "x9", "x10", "x11", "x12", "x13", "x14", "x15", "x16", "x17", "x18", "x19", "x20", "x21", "x22", "x23", - "x24", "x25", "x26", "x27", "x28", "x29", "LR" + "x24", "x25", "x26", "x27", "x28", "x29", "lr" }; static const char *shift_2[] = { - "LSL", "LSR", "ASR", "RSV" + "lsl", "lsr", "asr", "rsv" }; /* @@ -482,7 +482,7 @@ disasm(const struct disasm_interface *di, vm_offset_t loc, int altfmt) if (imm != 0 || shift != 0) di->di_printf(", #0x%x", imm); if (shift != 0) - di->di_printf(" LSL #12"); + di->di_printf(" lsl #12"); } break; case TYPE_02: @@ -576,7 +576,7 @@ disasm(const struct disasm_interface *di, vm_offset_t loc, int altfmt) di->di_printf(", sxtx #%d", amount); break; default: - di->di_printf(", RSVD"); + di->di_printf(", rsv"); break; } di->di_printf("]"); From nobody Fri Jun 9 19:58:22 2023 X-Original-To: dev-commits-src-branches@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 4QdBht67gwz4cKWY; Fri, 9 Jun 2023 19:58: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QdBht4Xt1z4KGZ; Fri, 9 Jun 2023 19:58:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686340702; 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=0gq2lAcAgIDt8qGsF8ylONFjoVeMqkAavA2zxY6GDYo=; b=xewgRvYTHNueWW0gWUT2nQnuWV+R0SCSlG0YZbQ7s0pAL7lOoH57WNI9PZVyzB6oFn9JaA S3kll4YVhTMYKFKko4EFQZBX9lH2H273e0bDZbbDRTu37JLlRF5XT+IGZF+hcjkZNH4WrK H3Q9Kri4i1uGFcPJMvi0o8oH1iqlMjmu7pJZ0uF58jQ4jqjwYDtRMcYLtqm/jvmFhYwvfA bJlq4zmVacO3tZwQqxhbvMOq8vJKdjc1mejs46jjK0dyWgSRIy3FRuc7OMMKciheyWzqjI 2hiCCAYoEfhen1owlR70XvB6F/VOyg1ywfzabh79OzXTQ6DxqqEKDCf1pHXIaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686340702; 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=0gq2lAcAgIDt8qGsF8ylONFjoVeMqkAavA2zxY6GDYo=; b=LbyKClvgSRUlGy0qoVAJjOtniFz/Y5wG9xoOmeOpySRGg4wRQ3BIFRoEuEQdsHfyb/paPb J3N47uAF1vyD8Nff9R7jiewqNuibKaaFPEbAeEfszMoncm8aXliUl0TJqAAc0U6L2TcF61 ZZLhizCMQ5neMIPgmvT8BxeSWMqS66+0a/RGCSIwl5mQxWN0uGhdKO+CbvRB5rQlUjqfBG DfhhQ+ZXPK5K917XulBHt5Br4KkOpqZlhVqNd1oosRnuFCReESr1fTNtHNBGkeHqjf9/5F QnaBxnM8KHC9pZyk2gr2NfZ3QRCsmqXf+YmVbDALY7Lb5gVwwTfPSvRsQ2Ai+Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686340702; a=rsa-sha256; cv=none; b=PWAqjMaG1B4An6SKjK1UCgceYxfGHbi8srUhc7uu+k7SKXJRsQyxYSt3uXvXn/tTPP9VRe Sm2E6mXmzksPM2tWbATROerZcdRs4oVkbFjxBSihe4R19VvHQHX+r1vmfkE1AjlDKWfHlH OBfWAkvF8m10LWMwAO+Zdnzu2Uu+XS+R/rkexAx6mxDWzZfA1+wUOMnghpRznAa8Ln8+/0 oA+hTE7YYp7RR1N7GMPsivju8gpU8x+Eh1V2yldcJS2yqilsWdx0JzIxJF+o/2yUmAjk5y mDUK+H+PEvTKnu9ahH0C2bVx5mk1lb22uMmx4qKzt0oTPJG2kOQqo2y8ZDhrPA== 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 4QdBht3NBpznf2; Fri, 9 Jun 2023 19:58:22 +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 359JwMOs072428; Fri, 9 Jun 2023 19:58:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 359JwMYw072427; Fri, 9 Jun 2023 19:58:22 GMT (envelope-from git) Date: Fri, 9 Jun 2023 19:58:22 GMT Message-Id: <202306091958.359JwMYw072427@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 7396802b1ea2 - stable/13 - arm64/disassem.c: Add shifted register instruction definitions List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7396802b1ea2db1b695a4793678760b955b9c72f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=7396802b1ea2db1b695a4793678760b955b9c72f commit 7396802b1ea2db1b695a4793678760b955b9c72f Author: Mykola Hohsadze AuthorDate: 2023-05-25 14:41:55 +0000 Commit: Mitchell Horne CommitDate: 2023-06-09 19:48:06 +0000 arm64/disassem.c: Add shifted register instruction definitions Add disassembly support for the following shifted register instructions: * adds * subs * sub * neg * negs * cmp * cmn The 'Mandatory Tokens' checks are relaxed to allow for the alias instructions (e.g. cmp) which hard-code one or more registers as xzr. Reviewed by: mhorne MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D40006 (cherry picked from commit ffa75b573f043951c7958c200c1e0e1b1f703740) --- sys/arm64/arm64/disassem.c | 58 +++++++++++++++++++++++++++++++++------------- 1 file changed, 42 insertions(+), 16 deletions(-) diff --git a/sys/arm64/arm64/disassem.c b/sys/arm64/arm64/disassem.c index 2ec0d04d5491..f1a4f9206c1b 100644 --- a/sys/arm64/arm64/disassem.c +++ b/sys/arm64/arm64/disassem.c @@ -91,6 +91,8 @@ enum arm64_format_type { /* * OP , , {, #imm} SF32/64 * OP , , #{, } SF32/64 + * OP , {, # } + * OP , {, # } */ TYPE_01, @@ -151,6 +153,10 @@ static struct arm64_insn arm64_i[] = { TYPE_01, OP_RD_SP | OP_RN_SP }, /* mov (to/from sp) */ { "add", "SF(1)|0010001|SHIFT(2)|IMM(12)|RN(5)|RD(5)", TYPE_01, OP_RD_SP | OP_RN_SP }, /* add immediate */ + { "cmn", "SF(1)|0101011|SHIFT(2)|0|RM(5)|IMM(6)|RN(5)|11111", + TYPE_01, 0 }, /* cmn shifted register */ + { "adds", "SF(1)|0101011|SHIFT(2)|0|RM(5)|IMM(6)|RN(5)|RD(5)", + TYPE_01, 0 }, /* adds shifted register */ { "ldr", "1|SF(1)|111000010|IMM(9)|OPTION(2)|RN(5)|RT(5)", TYPE_02, OP_SIGN_EXT | OP_RN_SP }, /* ldr immediate post/pre index */ { "ldr", "1|SF(1)|11100101|IMM(12)|RN(5)|RT(5)", @@ -216,6 +222,16 @@ static struct arm64_insn arm64_i[] = { { "strh", "01111000001|RM(5)|OPTION(3)|SCALE(1)|10|RN(5)|RT(5)", TYPE_02, OP_SF32 | OP_RN_SP }, /* strh register */ + { "neg", "SF(1)|1001011|SHIFT(2)|0|RM(5)|IMM(6)|11111|RD(5)", + TYPE_01, 0 }, /* neg shifted register */ + { "sub", "SF(1)|1001011|SHIFT(2)|0|RM(5)|IMM(6)|RN(5)|RD(5)", + TYPE_01, 0 }, /* sub shifted register */ + { "cmp", "SF(1)|1101011|SHIFT(2)|0|RM(5)|IMM(6)|RN(5)|11111", + TYPE_01, 0 }, /* cmp shifted register */ + { "negs", "SF(1)|1101011|SHIFT(2)|0|RM(5)|IMM(6)|11111|RD(5)", + TYPE_01, 0 }, /* negs shifted register */ + { "subs", "SF(1)|1101011|SHIFT(2)|0|RM(5)|IMM(6)|RN(5)|RD(5)", + TYPE_01, 0 }, /* subs shifted register */ { NULL, NULL } }; @@ -397,7 +413,7 @@ disasm(const struct disasm_interface *di, vm_offset_t loc, int altfmt) int ret; int shift, rm, rt, rd, rn, imm, sf, idx, option, scale, amount; int sign_ext; - int rm_absent; + bool rm_absent, rd_absent, rn_absent; /* Indicate if immediate should be outside or inside brackets */ int inside; /* Print exclamation mark if pre-incremented */ @@ -454,27 +470,37 @@ disasm(const struct disasm_interface *di, vm_offset_t loc, int altfmt) /* * OP , , {, #} SF32/64 * OP , , #{, } SF32/64 + * OP , {, # } + * OP , {, # } */ - /* Mandatory tokens */ - ret = arm64_disasm_read_token(i_ptr, insn, "RD", &rd); - ret |= arm64_disasm_read_token(i_ptr, insn, "RN", &rn); - if (ret != 0) { - printf("ERROR: " - "Missing mandatory token for op %s type %d\n", - i_ptr->name, i_ptr->type); - goto undefined; - } - - /* Optional tokens */ - arm64_disasm_read_token(i_ptr, insn, "SHIFT", &shift); + rd_absent = arm64_disasm_read_token(i_ptr, insn, "RD", &rd); + rn_absent = arm64_disasm_read_token(i_ptr, insn, "RN", &rn); rm_absent = arm64_disasm_read_token(i_ptr, insn, "RM", &rm); + arm64_disasm_read_token(i_ptr, insn, "SHIFT", &shift); - di->di_printf("%s\t%s, %s", i_ptr->name, - arm64_reg(sf, rd, rd_sp), arm64_reg(sf, rn, rn_sp)); + di->di_printf("%s\t", i_ptr->name); + + /* + * If RD and RN are present, we will display the following + * patterns: + * - OP , , {, #} SF32/64 + * - OP , , #{, } SF32/64 + * Otherwise if only RD is present: + * - OP , {, # } + * Otherwise if only RN is present: + * - OP , {, # } + */ + if (!rd_absent && !rn_absent) + di->di_printf("%s, %s", arm64_reg(sf, rd, rd_sp), + arm64_reg(sf, rn, rn_sp)); + else if (!rd_absent) + di->di_printf("%s", arm64_reg(sf, rd, rd_sp)); + else + di->di_printf("%s", arm64_reg(sf, rn, rn_sp)); /* If RM is present use it, otherwise use immediate notation */ - if (rm_absent == 0) { + if (!rm_absent) { di->di_printf(", %s", arm64_reg(sf, rm, rm_sp)); if (imm != 0) di->di_printf(", %s #%d", shift_2[shift], imm); From nobody Fri Jun 9 19:58:23 2023 X-Original-To: dev-commits-src-branches@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 4QdBhv5r44z4cKfF; Fri, 9 Jun 2023 19:58:23 +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 4QdBhv5KVRz4KZt; Fri, 9 Jun 2023 19:58:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686340703; 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=DHFy3Z29pjqSfixu7tHwhumRMQhxENv6Q2i5+KMRDoM=; b=MTPcwZgRCIsq7rPO/bS9xGRpWpeNcvasfVn4InFt7n9iUcfgbDExVEjeURgvq+Di2saZeV je4rr3NTVV8EF8jM0TUExz+n/zjvZWuA5Xm8Z/3ij/RVFEYAJ4IvCcwnoZgtrMxQ1AbBdH 2jpUEZGbEcv7bCOiFshzFA8CwoAKbsRBavaQR4vY515dKnkmz8B5wj85/Y4aTXh3rC9uSZ PAsxbmJ0wLO89yUyjNhOMPmLJ0Belz+2sit5UM4ku9zYG0AaVXuEUWUKoMbXaQT8kj64/c FzFMvVzXakMh87YMKVtRGgi7Yz7NjBRb3wuaBHtOGz2gb4iEegzXGCgCIUwE/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686340703; 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=DHFy3Z29pjqSfixu7tHwhumRMQhxENv6Q2i5+KMRDoM=; b=AMhxPWvdbZDdiI5vHfV5ez7qFCJp/8LClt237+7+S0ga7yVt1GBl9RjTGTuURe4XAV/rr6 HF2ZtJYikDswtbhzr7tv1lPNYqsY4Or38IU2/UNdKMtTM4RlvyrbEP+CN3Z3wjy4VJYL6b dLH3ZWCuaHq1ds2C0+Br4ha+dvoogKIGMLG8jqI2e+j4J70LfbcDD1B6DKIyHe20X6tOye jSam+uhjfOEmI+FvPs3jum+BlOde9/vZtq1jSEixSUJanA7WfRW/TY5OucqwHJE5BxQEoG doNJNHpz36RRYfFoaBUGcgLxTlhgaNfvO/4WyxuOHAUJ3797EeTfifj1epRssg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686340703; a=rsa-sha256; cv=none; b=YUapNk0PcBPzIOO92mlC/zozDGBzYcgZ0d5Z/AnM+PE58B0D5AhhkJAw0SynWDvjTU0Jg/ am4S+BR0voYEq3Mjj/R+WXMPtcFWvZCL3qR2RUYcjWqu3+8FRnyrPpaNC6RfBDmiI67C40 NxzjhU8TVS25CW9rJWMiBg5Xbss8yh9K+dCJRfOprSL65fORnwAZFTd3Cc72LAraQD/ASP aNXAjliaoCcj/DfUlJceCmq91VEY9V3KWxTegh0a2Npk5yDuTpX5GB49iUHEFjAa25dIk3 UWnal+waCxoR+3Gkgy/kZ13FXp5PtQHCibJCNwfogmvc++DRuO3F/pPe8VizHA== 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 4QdBhv4NX3znbJ; Fri, 9 Jun 2023 19:58:23 +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 359JwN8c072447; Fri, 9 Jun 2023 19:58:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 359JwNvk072446; Fri, 9 Jun 2023 19:58:23 GMT (envelope-from git) Date: Fri, 9 Jun 2023 19:58:23 GMT Message-Id: <202306091958.359JwNvk072446@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: d3af72040679 - stable/13 - riscv: Use PMAP_MAPDEV_EARLY_SIZE in locore and pmap_bootstrap List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d3af72040679a1cd75889a69898e53bb699f4212 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=d3af72040679a1cd75889a69898e53bb699f4212 commit d3af72040679a1cd75889a69898e53bb699f4212 Author: Alfredo Mazzinghi AuthorDate: 2023-05-25 15:33:12 +0000 Commit: Mitchell Horne CommitDate: 2023-06-09 19:48:06 +0000 riscv: Use PMAP_MAPDEV_EARLY_SIZE in locore and pmap_bootstrap Use PMAP_MAPDEV_EARLY_SIZE instead of assuming that its value is always L2_SIZE. Add compile-time assertions to check that the size matches the expectations in locore. Reviewed by: mhorne MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D40110 (cherry picked from commit ef0a711fd5d0d389205c18c869c78b9a4d639ddb) --- sys/riscv/include/vmparam.h | 2 +- sys/riscv/riscv/genassym.c | 1 + sys/riscv/riscv/locore.S | 6 ++++-- sys/riscv/riscv/pmap.c | 13 +++++++++++-- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/sys/riscv/include/vmparam.h b/sys/riscv/include/vmparam.h index 6e1c9e11a3cc..5f76b312c7fd 100644 --- a/sys/riscv/include/vmparam.h +++ b/sys/riscv/include/vmparam.h @@ -250,7 +250,7 @@ extern vm_offset_t init_pt_va; #define ZERO_REGION_SIZE (64 * 1024) /* 64KB */ #define DEVMAP_MAX_VADDR VM_MAX_KERNEL_ADDRESS -#define PMAP_MAPDEV_EARLY_SIZE (L2_SIZE * 2) +#define PMAP_MAPDEV_EARLY_SIZE L2_SIZE /* * No non-transparent large page support in the pmap. diff --git a/sys/riscv/riscv/genassym.c b/sys/riscv/riscv/genassym.c index ff5e8fa01ddf..22b8cf3b8dbc 100644 --- a/sys/riscv/riscv/genassym.c +++ b/sys/riscv/riscv/genassym.c @@ -62,6 +62,7 @@ ASSYM(KERNBASE, KERNBASE); ASSYM(VM_MAXUSER_ADDRESS, VM_MAXUSER_ADDRESS); ASSYM(VM_MAX_KERNEL_ADDRESS, VM_MAX_KERNEL_ADDRESS); ASSYM(VM_EARLY_DTB_ADDRESS, VM_EARLY_DTB_ADDRESS); +ASSYM(PMAP_MAPDEV_EARLY_SIZE, PMAP_MAPDEV_EARLY_SIZE); ASSYM(TDF_ASTPENDING, TDF_ASTPENDING); ASSYM(TDF_NEEDRESCHED, TDF_NEEDRESCHED); diff --git a/sys/riscv/riscv/locore.S b/sys/riscv/riscv/locore.S index bf0ac8e122be..32d1b6198de8 100644 --- a/sys/riscv/riscv/locore.S +++ b/sys/riscv/riscv/locore.S @@ -162,7 +162,7 @@ pagetables: lla s2, pagetable_l2_devmap /* Link to next level PN */ srli s2, s2, PAGE_SHIFT - li a5, (VM_MAX_KERNEL_ADDRESS - L2_SIZE) + li a5, (VM_MAX_KERNEL_ADDRESS - PMAP_MAPDEV_EARLY_SIZE) srli a5, a5, L1_SHIFT /* >> L1_SHIFT */ andi a5, a5, Ln_ADDR_MASK /* & Ln_ADDR_MASK */ li t4, PTE_V @@ -191,7 +191,9 @@ pagetables: /* Store the L2 table entry for the DTB */ li a6, PTE_SIZE - li a5, 510 + li a5, VM_EARLY_DTB_ADDRESS + srli a5, a5, L2_SHIFT /* >> L2_SHIFT */ + andi a5, a5, Ln_ADDR_MASK /* & Ln_ADDR_MASK */ mulw a5, a5, a6 add t1, s1, a5 sd t0, (t1) diff --git a/sys/riscv/riscv/pmap.c b/sys/riscv/riscv/pmap.c index df473acef0e7..a6029f5d642d 100644 --- a/sys/riscv/riscv/pmap.c +++ b/sys/riscv/riscv/pmap.c @@ -254,6 +254,15 @@ vm_offset_t dmap_max_addr; /* The virtual address limit of the dmap */ CTASSERT((DMAP_MIN_ADDRESS & ~L1_OFFSET) == DMAP_MIN_ADDRESS); CTASSERT((DMAP_MAX_ADDRESS & ~L1_OFFSET) == DMAP_MAX_ADDRESS); +/* + * This code assumes that the early DEVMAP is L2_SIZE aligned and is fully + * contained within a single L2 entry. The early DTB is mapped immediately + * before the devmap L2 entry. + */ +CTASSERT((PMAP_MAPDEV_EARLY_SIZE & L2_OFFSET) == 0); +CTASSERT((VM_EARLY_DTB_ADDRESS & L2_OFFSET) == 0); +CTASSERT(VM_EARLY_DTB_ADDRESS < (VM_MAX_KERNEL_ADDRESS - PMAP_MAPDEV_EARLY_SIZE)); + static struct rwlock_padalign pvh_global_lock; static struct mtx_padalign allpmaps_lock; @@ -684,7 +693,7 @@ pmap_bootstrap(vm_offset_t l1pt, vm_paddr_t kernstart, vm_size_t kernlen) /* Create the l3 tables for the early devmap */ freemempos = pmap_bootstrap_l3(l1pt, - VM_MAX_KERNEL_ADDRESS - L2_SIZE, freemempos); + VM_MAX_KERNEL_ADDRESS - PMAP_MAPDEV_EARLY_SIZE, freemempos); /* * Invalidate the mapping we created for the DTB. At this point a copy @@ -738,7 +747,7 @@ pmap_bootstrap(vm_offset_t l1pt, vm_paddr_t kernstart, vm_size_t kernlen) msgbufp = (void *)msgbufpv; virtual_avail = roundup2(freemempos, L2_SIZE); - virtual_end = VM_MAX_KERNEL_ADDRESS - L2_SIZE; + virtual_end = VM_MAX_KERNEL_ADDRESS - PMAP_MAPDEV_EARLY_SIZE; kernel_vm_end = virtual_avail; pa = pmap_early_vtophys(l1pt, freemempos); From nobody Fri Jun 9 19:58:24 2023 X-Original-To: dev-commits-src-branches@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 4QdBhw6bm6z4cKQl; Fri, 9 Jun 2023 19:58:24 +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 4QdBhw66bbz4KYK; Fri, 9 Jun 2023 19:58:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686340704; 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=2VZ/6BlETEcA+mAAMRblLyv8ec3+eOSnFDRBiB7nJVY=; b=kdtKcop18ggPaf2baa0MrzzuSWKuWbT/A4ZSQIl5B0vGFDMgqkVOop/FQMahftWh1ctxmb k6iauQGU17Nz70tRQBRucckuqpP4bdmp2KvZ3hEH2hyh5gjiqy6s+Gy8jvX6zz8MvmgMo4 k+P4+M+e6XKoznPLqi7SsBqCpIlkm6H5VfW44Qi37ext76IxfdDlZoupBC+EynE6MD968B APCkmTDIA9j7naafCkkTezNVh6CiQEJXk3tPf7T5g83NO/TF9Cr4UC3tnTB5EOZ2Bta+c8 GqMFyBQ/iNnG+ETLHx2+aIKhFp27TMDauNjUQMnod/fm4yi7/lVT/Lu33pL1dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686340704; 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=2VZ/6BlETEcA+mAAMRblLyv8ec3+eOSnFDRBiB7nJVY=; b=eTxra2w830CiX3l9uewb8KAp7vI+M2ef2Jg4+mnElTNrCnS6g08MmvXmGHILZs4vnrsEXH CV5L5Pj+QrXTDoluSyJ7LuYMD+V1KG/e7qTQ1gJK6lY7rMG1ekBnLjnL9qalgM2ZVBjY4s MKs0COF5Tm3fNt5Dabhl/6+5qSQdsOYG3bS4AuWCWAaHFTObceecdWyHd3iW/YOwKXJwaK ol1QUowOCsOQCEWdk+vvDR1RRnFFVY3QWcRWRjBzXUhnkpX1uivVRtv95N7DNsZ/bYi6rN ElzkZeQeBlLeP8lA/zIdcJx82AKq++K2cEFZ8KfSA3nlgMHLtivOnbR56bmnig== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686340704; a=rsa-sha256; cv=none; b=vcaBVw4+x325laB2d3cBUt9wBftd+PCCsJULKY6ZLTaEVBGpaOzE/BanP8KJbtbqhNF/tt iILQ7VABJMMMWnZB1EwhiH5PQZnmrOigpd+KBbhQ0j1tLpzc/4Ds0hsoqGGLt7IxcvPMl5 FBehpxELXssCssvvDXMuL6yoccY59SDmp/2apD6pLZ0FXMaoOPLGVuZDvqBFhWGFMOgX4R GRvq0zrdElkzecRZaOfy1DNDX9219l1UewG4giIINbs0qJMyoUVNMs5B2To84wl0hdTTBn AXYVnQpO6dO0RtPAUu49fIT8z0nJM6wIT/6Z2jI4nBfuurFohZmKWHub9hcazA== 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 4QdBhw5DZNznbK; Fri, 9 Jun 2023 19:58:24 +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 359JwOIq072466; Fri, 9 Jun 2023 19:58:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 359JwOYr072465; Fri, 9 Jun 2023 19:58:24 GMT (envelope-from git) Date: Fri, 9 Jun 2023 19:58:24 GMT Message-Id: <202306091958.359JwOYr072465@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 984f74caad01 - stable/13 - hier(7): drop list of /usr/include subdirectories List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 984f74caad01f2a8e3de38e61cd6800fcb609c29 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=984f74caad01f2a8e3de38e61cd6800fcb609c29 commit 984f74caad01f2a8e3de38e61cd6800fcb609c29 Author: Mitchell Horne AuthorDate: 2023-05-10 12:52:47 +0000 Commit: Mitchell Horne CommitDate: 2023-06-09 19:48:06 +0000 hier(7): drop list of /usr/include subdirectories It is nice to have, however, the location of this information means that it will naturally be missed by developers adding or removing directories to the layout, so it trends out-of-date and it is out-of-date. The target audience for hier(7) is users and administrators. It is not expected to be a place that programmers should go to learn about the purposes of the different C headers provided by FreeBSD. Program authors needing FreeBSD-specific interfaces or libraries (#include , for instance) will either be following a more detailed man page, or consulting the header contents directly. Folks targeting standardized headers (#include ) will not need hier(7) to tell them where those headers are under /usr/include. In other words, this is more detail than necessary for this document. I'd go as far as to say that many of the existing entries in this list do little more than parrot the name of the directory. With all this in mind, let's drop the maintenance burden. Reviewed by: imp, emaste MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D40000 (cherry picked from commit c3b611e153e0480a354559f82fe5dc4c455bad4e) --- share/man/man7/hier.7 | 143 -------------------------------------------------- 1 file changed, 143 deletions(-) diff --git a/share/man/man7/hier.7 b/share/man/man7/hier.7 index 00784986062a..96225e8d33d0 100644 --- a/share/man/man7/hier.7 +++ b/share/man/man7/hier.7 @@ -215,149 +215,6 @@ and .It Pa include/ standard C include files .Pp -.Bl -tag -width "kerberos5/" -compact -.It Pa arpa/ -C include files for Internet service protocols -.It Pa bsnmp/ -C include files for the SNMP daemon -.It Pa c++/ -C++ include files -.It Pa cam/ -C include files for the Common Access Methods Layer -.Bl -tag -width "kerberos5/" -compact -.It Pa scsi/ -SCSI device on top of CAM -.El -.It Pa dev/ -C include files for programming various -.Fx -devices -.Bl -tag -width "kerberos5/" -compact -.It Pa ic/ -various header files describing driver- and bus-independent -hardware circuits -.It Pa ofw/ -Open Firmware support -.It Pa pbio/ -8255 PPI cards; -see -.Xr pbio 4 -.It Pa ppbus/ -parallel port bus; -see -.Xr ppbus 4 -.It Pa usb/ -USB subsystem -.El -.It Pa fs/ -.Bl -tag -width "kerberos5/" -compact -.It Pa fdescfs/ -per-process file descriptors file system -.It Pa msdosfs/ -MS-DOS file system -.It Pa nfs/ -C include files for NFS (Network File System) version 2, 3 and 4 -.It Pa nullfs/ -loopback file system -.It Pa procfs/ -process file system -.It Pa smbfs/ -SMB/CIFS file system -.It Pa udf/ -UDF file system -.It Pa unionfs -union file system -.El -.It Pa geom/ -GEOM framework -.Bl -tag -width "kerberos5/" -compact -.It Pa concat/ -CONCAT GEOM class -.It Pa gate/ -GATE GEOM class -.It Pa mirror/ -MIRROR GEOM class -.It Pa nop/ -NOP GEOM class -.It Pa raid3/ -RAID3 GEOM class -.It Pa stripe/ -STRIPE GEOM class -.El -.It Pa libmilter/ -C include files for libmilter, -the -.Xr sendmail 8 -mail filter API -.It Pa machine/ -machine-specific C include files -.It Pa net/ -miscellaneous network C include files -.Bl -tag -width Fl -compact -.It Pa altq/ -C include files for alternate packet queuing; see -.Xr altq 4 -.El -.It Pa net80211/ -C include files for 802.11 wireless networking; -see -.Xr net80211 4 -.It Pa netinet/ -C include files for Internet standard protocols; -see -.Xr inet 4 -.It Pa netinet6/ -C include files for Internet protocol version 6; -see -.Xr inet6 4 -.It Pa netipsec/ -kernel key-management service; -see -.Xr ipsec 4 -.It Pa netsmb/ -SMB/CIFS requester -.It Pa nfs/ -C include files for NFS (Network File System) version 2 and 3 (legacy) -.It Pa openssl/ -OpenSSL (Cryptography/SSL toolkit) headers -.It Pa protocols/ -C include files for Berkeley service protocols -.It Pa rpc/ -remote procedure calls; -see -.Xr rpc 3 -.It Pa rpcsvc/ -definition of RPC service structures; see -.Xr rpc 3 -.It Pa security/ -PAM; see -.Xr pam 3 -.It Pa sys/ -system C include files (kernel data structures) -.\" .It Pa tcl/ -.\" Tcl language; -.\" see -.\" .Xr Tcl n -.\" .Bl -tag -width "kerberos5/" -compact -.\" .It Pa generic/ -.\" ??? -.\" .It Pa unix/ -.\" ??? -.\" .El -.It Pa ufs/ -C include files for UFS (The U-word File System) -.Bl -tag -width "kerberos5/" -compact -.It Pa ffs/ -Fast file system -.It Pa ufs/ -UFS file system -.El -.It Pa vm/ -virtual memory; -see -.Xr vmstat 8 -.El -.Pp .It Pa lib/ shared and archive .Xr ar 1 Ns -type From nobody Fri Jun 9 19:58:25 2023 X-Original-To: dev-commits-src-branches@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 4QdBhy2k2Zz4cKfL; Fri, 9 Jun 2023 19:58:26 +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 4QdBhy0CKVz4KkV; Fri, 9 Jun 2023 19:58:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686340706; 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=zB34ESZ8UABltY+YEosU938LTuKoDghIUCv6LSybUXE=; b=Ddj9LHGPztpGAeLn6awo8CUqfP3EdYsJYCE4XZ8h6R3pV1AhQxH6fwbvuCBCdHoIO0wtAo ULAafk6UkmnKdy8OSa/8WBPuBNxZunIan7fiCfDPkRrIo/weDLzV/NVi+68EsarKOzCNV8 AdAzsIUzSm4DKtWzg+xPOXct+D/cg2KC87g8/OlohuyuOYwuwvXbKNhyBqsyb5mk8XU6VI /3CrR4xQIdcN2EAhq4hFctkV3ZEG0N8ppEpjB4/q2/xJHrze1/N+R7eJqFlg6pUyyKYpqw hyC7jrjkwv6wEOH7q0xSWYx8KcRMdGlpyGCav6SUzrFyDnUovNkY74YplN9UZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686340706; 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=zB34ESZ8UABltY+YEosU938LTuKoDghIUCv6LSybUXE=; b=GK/S9xIn1fVTyDoo/GCW5OnAFBYs9TRAvHntTyGg5u7qOjnoBUzHhTyafL7Oydxw5/O/wI rPIifm8A9nFF5c3R5OCpU3M11IYI+QFWjJ8nRZtR9PGrO7QEW+ErcalcH1LdrHaq28m+po NQ3qFl13Z0nI48UPSZstpOaRtShdrzv/MPG+cn+XVPPFeEyl/16H9ERTWuCLyCYNxSyr+N RUB/8FkdjXNsTo+tVN1Kn702qcQ2j9fel/v47S+FPZX6QGj3xHF20CyvBRz08BTIgWKHnX ML5VNQLNOLch/IBg3etjXYX0J5/DF2J/K5ZJmoX/6Yq/pd/SyTBw/CKfT62fKQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686340706; a=rsa-sha256; cv=none; b=aQtRkSad78P4ALmJKCPa1XxqJPHx8pSNc0dHmQFbt5WblkT0gMbkgwz6BSwTGWrKEqKbbm ZcmpC5pMZe5rb4UtDm9Da7ibFj3l0K1GWTFmOMCf9AVKdhJIhKdaeFomZ/JXtamnN/bKbr Ey3qqNQ6wz8TDHiqp7Ws1vizv2FaTD9de66dO3yyHlMtPrbg8YuK7XnT5twP5nAFFiNbjp fzpsoB6xtVA49oFMRpVhB00iYPyud7LpGvjpGd0P+kKlvoruVkcJJebflTpdJZgj8LWzS9 Yo12qXE03TOjxlQN/HKCa6bQjo3wRLz2bRebvUiukwTCegqSc0IU32JyvLndmw== 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 4QdBhx6PkcznbL; Fri, 9 Jun 2023 19:58:25 +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 359JwPW5072485; Fri, 9 Jun 2023 19:58:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 359JwP5c072484; Fri, 9 Jun 2023 19:58:25 GMT (envelope-from git) Date: Fri, 9 Jun 2023 19:58:25 GMT Message-Id: <202306091958.359JwP5c072484@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 64ad5d3c4743 - stable/13 - hier(7): drop list of /usr/share/doc subdirectories List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 64ad5d3c4743a84c61309f050b88cf6e0b10ab0a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=64ad5d3c4743a84c61309f050b88cf6e0b10ab0a commit 64ad5d3c4743a84c61309f050b88cf6e0b10ab0a Author: Mitchell Horne AuthorDate: 2023-05-10 12:53:40 +0000 Commit: Mitchell Horne CommitDate: 2023-06-09 19:48:06 +0000 hier(7): drop list of /usr/share/doc subdirectories Several entries are outdated, several new ones are missing. I do not think there is much value added in maintaining this. Reviewed by: imp, emaste MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D40001 (cherry picked from commit 1bc55f58393ffd9714ebfd1ad4e9555cff76e8f6) --- share/man/man7/hier.7 | 34 +--------------------------------- 1 file changed, 1 insertion(+), 33 deletions(-) diff --git a/share/man/man7/hier.7 b/share/man/man7/hier.7 index 96225e8d33d0..e46c226f9c2c 100644 --- a/share/man/man7/hier.7 +++ b/share/man/man7/hier.7 @@ -320,39 +320,7 @@ terms, proper names, and jargon words from Webster's Second International .El .It Pa doc/ -miscellaneous documentation; -source for most of the printed -.Bx -manuals (available -from the USENIX association) -.Bl -tag -width Fl -compact -.It Pa FAQ/ -Frequently Asked Questions -.It Pa IPv6/ -implementation notes for IPv6 -.It Pa es/ -Spanish translations of documents in /usr/share/doc -.It Pa handbook/ -.Fx -Handbook -.It Pa ja/ -Japanese translations of documents in /usr/share/doc -.It Pa legal/ -License files for vendor supplied firmware files -.It Pa ncurses/ -HTML documents pertaining to ncurses; -see -.Xr ncurses 3 -.It Pa ntp/ -HTML documents pertaining to the Network Time Protocol -.It Pa ru/ -Russian translations of documents in /usr/share/doc -.It Pa tutorials/ -.Fx -tutorials -.It Pa zh/ -Chinese translations of documents in /usr/share/doc -.El +miscellaneous documentation .It Pa examples/ various examples for users and programmers .It Pa firmware/ From nobody Fri Jun 9 19:58:26 2023 X-Original-To: dev-commits-src-branches@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 4QdBhz2109z4cKjV; Fri, 9 Jun 2023 19:58:27 +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 4QdBhz1KCqz4KZ4; Fri, 9 Jun 2023 19:58:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686340707; 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=wRVXWUhH5CXEYGVx0x78sNia8ij2gtFl8WO9NjY7R9w=; b=kyCf/I9Ew7+gFelphUmMPo3h4/QEL70Vbi+xFJpOtoDIaxwH3Jo1xZItQEZ+9fqx/7yafa Q6n9ofRx7wTQNSIKgROw2RHAg/d2qDjhafLzWHfjmll6bfEjZX1A0R1gl4ECreU0f36eT/ Y4SFPhA5JGjsUeWXomBA6/F9dh742/gkND46wwoXf7vlI6VBk08NtleSZ8KA9gEpUrnIaU DwX+uDYoLNSmy2Wl/XxEoiYlg/BuJs7yOoV2QcMcLlkCXIEX0ZLy05S2FvDOPZiddPJ2Ls yYaHgUv3dErRX/FFp7PsPpzCrru+4DzRHeAKs1gMFaxwPETvQtrhLs0TgTINgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686340707; 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=wRVXWUhH5CXEYGVx0x78sNia8ij2gtFl8WO9NjY7R9w=; b=yWAWW4kq/CinR4OLWQnjtGCeI0tQce94F0tJJJO+Yn+5+T6bRN8uA1P0i1UeGXCqIwqndl PbtBKVOK/k158HEvjTj/iFyUUhhA3Gv0XVgLCjReB7DzlP+IuzF3OOQfDknft3VW/Mgzle F4BZOdXDY9FJZGS9foQVr9lV/azUcAJzlrSYfPMB4F34HpXVMobHbm21N3lKoUYxCD4lS8 JY4YQm8dFoiO9DbrXyFOXw4gBQGqy4WO/l+Llbt45S7pyVqO7UpAHYh3W6k4yGAZfQBQ5Z +FlJO+KDLfvBBfwJfu6DVLDvWKIDUlXU3F2dz7VzGCn1Bm1mpqRGbeR1UsUrJA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686340707; a=rsa-sha256; cv=none; b=ugzVUxPF21btesWA81dd6El+nPCAihoIsA/13qpOAJhA1qgsHHKZXWNdInDmciVX3BJsjo mUrU3xQIRmYhdNIgc41FJ/mcPVoocjfqcPDKrdD35RF9PIAKfAvSNr9GgimfbTU2HesjJR Ro8GBRzrWiXEhtOH4J00cDZVFKrc1Xyfe66zWzMy/6Qtcl19u4OJuY4m8tYRs5a7O+V2UH hjZV8VbGkxDAkEOLf/IyKMd1IT3yqkJ9fpYPXHRRULUeOBkNtLIgUaxz2RHuECShMmSYWc vpYp6V78IbH8gaOMV3QEOoZ9leDrAGCgZNGLZSWzoOuxPh1DDeDx9XTcYmlHPg== 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 4QdBhz049Qznf3; Fri, 9 Jun 2023 19:58:27 +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 359JwQvD072511; Fri, 9 Jun 2023 19:58:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 359JwQAg072510; Fri, 9 Jun 2023 19:58:26 GMT (envelope-from git) Date: Fri, 9 Jun 2023 19:58:26 GMT Message-Id: <202306091958.359JwQAg072510@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 82e1e0e0f471 - stable/13 - hier(7): document /home/ and /usr/home/ List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 82e1e0e0f4714823eb716b9b574444041be21239 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=82e1e0e0f4714823eb716b9b574444041be21239 commit 82e1e0e0f4714823eb716b9b574444041be21239 Author: Mitchell Horne AuthorDate: 2023-05-10 12:53:56 +0000 Commit: Mitchell Horne CommitDate: 2023-06-09 19:48:07 +0000 hier(7): document /home/ and /usr/home/ Reviewed by: imp MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D40002 (cherry picked from commit 36db6b04962a01ff7b21592def02d4c570dac939) --- share/man/man7/hier.7 | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/share/man/man7/hier.7 b/share/man/man7/hier.7 index e46c226f9c2c..91c8f3328384 100644 --- a/share/man/man7/hier.7 +++ b/share/man/man7/hier.7 @@ -90,6 +90,10 @@ file descriptor files; see .Xr \&fd 4 .El +.It Pa /home/ +user HOME directories. +This is a symlink to +.Pa /usr/home/ .It Pa /etc/ system configuration files and scripts .Pp @@ -214,6 +218,12 @@ and .Xr bsdinstall 8 .It Pa include/ standard C include files +.It Pa home/ +users' HOME directories; +the layout is not standardized, but a typical interactive user +.Dv beastie +might receive their own directory under +.Pa /usr/home/beastie .Pp .It Pa lib/ shared and archive From nobody Fri Jun 9 19:58:28 2023 X-Original-To: dev-commits-src-branches@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 4QdBj02pP7z4cKfW; Fri, 9 Jun 2023 19:58:28 +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 4QdBj02D3gz4KX3; Fri, 9 Jun 2023 19:58:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686340708; 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=ck4rg5y0srjxKJmGhZ+8RTkonrQ52agpuICCpqB7etg=; b=JJm5EjURdcQzz1/mhiJLeMQnCs8gMY+8SSsf24x8gOl5y5VfNI9W6WHNr0wrlsj4/q+GWG C0HvUOjdf7IDYErs2e90AgZAnF7viuh2XvfoyNnjLd0yKV5h+gpHjVJ1IWLmxrjoB9NG1l 5GyNB5Owr6vR5fi2YrJ0Hv3x6s+3+pXmqErs0xG9y2LXwf3b+kBmWTgsZGLYH7YOAkJkWM fzXJedsuJMefIoLdgIV445AMkFZsqPsCY5n3kGc5PA2fyMdHbHNM/fEfEZsobHbmKBX4UL FxRBCf9m1VZb11AiIxawEUHwfrQSRB+w42q1YydjEV4ZO9HW9wnlUF0YndKy0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686340708; 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=ck4rg5y0srjxKJmGhZ+8RTkonrQ52agpuICCpqB7etg=; b=SIz4ERfLshsxKyo++Jw2jnDmWcuz5EUdVDXKnZpRMPB9vuKH+LB68RAElsE2NM5yetx21n EF5w12ffhc50X6ENZSl9a0fFU3xvguhbQTz7NN7x5QhTjc0ieHx7RH7NOhjW1WR6QQ/zec UEDNSjXsd2T7lH71+f9aHACHK0nP34macXhx+jP/8jHyKbQQIcm3OU2AjdAg5bw8dUNUe3 R3NfYIw3kmGe/3Hr46MZxA6aFqbBkGsCTRymP2p3frs71iQdhnMdHs/LvThwh/gtWdfWv6 DGRJoSitSMNad2MdboPXMtriPCLeP+3AoQDnbJ5IrvxUMTsqB4gnV+YFKuK0YA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686340708; a=rsa-sha256; cv=none; b=TYNuTekBRxdrqNGMeeDKao+C+u90beMVLrCmP6U1qKJb0lZ5Vq0TCKH4zvfMREorQA2Prz FlFEMW0fLKfZT8xd5k9zDc4ZVMHqvZKxn5qHpLdK7PqqZjTrLFKITmiJescHt76XvEmGI7 fIx4YjEfw+qMhu810G/Ko1bCDwOWmenfFVJb4nCWGSaqHToSnfS/CgWegmhQm0iV5mmDFc zwynZNv9Jg7GNgXO/Sw0a7EsO6BAV1rYvqvtgvP4asdqMg6+ELDhIQ3hwPKnzcQWQ+bQeR BgTni7NnPOBlbDOiqBE2KUUcHTXzCJAySjphnlyFpz+Zv0e3LWohp8m+uyQPcQ== 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 4QdBj01HH1znmw; Fri, 9 Jun 2023 19:58:28 +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 359JwSqY072532; Fri, 9 Jun 2023 19:58:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 359JwStJ072531; Fri, 9 Jun 2023 19:58:28 GMT (envelope-from git) Date: Fri, 9 Jun 2023 19:58:28 GMT Message-Id: <202306091958.359JwStJ072531@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: e48e530e1f3b - stable/13 - hier(7): fix a couple mandoc warnings List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e48e530e1f3b2cb8e4c90dcc3d57edf6396718bd Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=e48e530e1f3b2cb8e4c90dcc3d57edf6396718bd commit e48e530e1f3b2cb8e4c90dcc3d57edf6396718bd Author: Mitchell Horne AuthorDate: 2023-05-10 13:26:35 +0000 Commit: Mitchell Horne CommitDate: 2023-06-09 19:48:07 +0000 hier(7): fix a couple mandoc warnings These references are rendered correctly without the zero-width space. MFC after: 1 week Sponsored by: The FreeBSD Foundation (cherry picked from commit 031049cf3262ec5981cebc35d9b70623177a84bd) --- share/man/man7/hier.7 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/share/man/man7/hier.7 b/share/man/man7/hier.7 index 91c8f3328384..498dae503133 100644 --- a/share/man/man7/hier.7 +++ b/share/man/man7/hier.7 @@ -88,7 +88,7 @@ device special files managed by .It Pa fd/ file descriptor files; see -.Xr \&fd 4 +.Xr fd 4 .El .It Pa /home/ user HOME directories. @@ -472,7 +472,7 @@ see .It Pa at/ timed command scheduling files; see -.Xr \&at 1 +.Xr at 1 .Pp .Bl -tag -width Fl -compact .It Pa jobs/ @@ -545,7 +545,7 @@ see temporary home of files preserved after an accidental death of an editor; see -.Xr \&ex 1 +.Xr ex 1 .It Pa quotas/ file system quota information files .It Pa run/ From nobody Fri Jun 9 19:58:29 2023 X-Original-To: dev-commits-src-branches@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 4QdBj15KFpz4cKbc; Fri, 9 Jun 2023 19:58:29 +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 4QdBj13BFBz4KwJ; Fri, 9 Jun 2023 19:58:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686340709; 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=noAzM2iAT5dVng1J+z/Wz2zkEVgFyCIxJcGp+GHFHBQ=; b=dC0I13n5MwXWcI1Jidioa0HjQcgPwJfOoETe2ruy90xb/IUvk1iq8rMkc4ekUPxEAk9++2 NriUz79RXyEY20Q7pa83Fk/z1sYqntDMLgf7axs1rYGq2MuDx5EBut13tiazwkO4wbvzMy chQ1CLdNhLbTx63zmQviiapLqhiDIbrFUHNdEPMbv5sdetq+Sd14j/pi088I46VYbfgm6e gdMLQD1ts31RTIb1k1/m7HvJZAXV4ibTBo/XBxJRiKcVD4JBkET/fkWtFBrSymdq2ocusf fhAfZ+C6rV0lxE4ayU0pz4xzSvV2vA/RyXZZrdGhbwEkdKOFLk6/3Z3TE2dHTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686340709; 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=noAzM2iAT5dVng1J+z/Wz2zkEVgFyCIxJcGp+GHFHBQ=; b=ie0SqS/9IE4pgc0/ZZKuoFB0oZsRKSajpmWWadppMaj/jUh2pbu/pmmuOHae3JlmByvcp+ ryfJUSHqUUVb/j3+6eWpuu6DaI/jTTf29yr+2MYgk1Y8unVnM9vyU8bfsSQszx3ZTIMBNj 74Uag+AcwpQV8AlcZ8yfpT28S8EAY41hsrWqwRkCuSbGF9eeDrhF246B1cYRg42EcSkywS mxvcMcuic0gTjJc5WUaIDou+uodU/5NGLWbBRhIAeUMkOwUnEK42/s2Bm7iwL+Oo1KA4cC vN+kEbFxvTIhMZJc2sQFRQ0ZFQRbB4heywS49zI+lyWWCnoiV9iFSgpJ8M6nmw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686340709; a=rsa-sha256; cv=none; b=x/DcnX0fvTWrr2SjYURzCMskY7l05cH6BJKo4671j309IXf2xNDfmnzieJZEm40Z2FvEpV ePWOVdhhJNJX78SXqUt1/V3gmvAkUyIHH2vTQO2lehimha3HYujDBF4U/aUqg4/5ksLLR4 6A8F0sg73GHPsBWujGw1/oJNYoNxF0rS16e72r6oZI+FZ1faUmja5yWHTJrXyMVQmfEUuZ rIt9dwry0Xc5355ixIwinYxa32gRzE9frkqG9pMO87YMnQ685PKAYR8BwvenmEUfCcJeNI Rv8Kfn68OUnWM74JNe5ILjrIeS9ZWPT7e0Ukdpl1HQxUctw/d/3v8OJO4nSDmA== 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 4QdBj12HwJznmx; Fri, 9 Jun 2023 19:58:29 +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 359JwTN1072551; Fri, 9 Jun 2023 19:58:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 359JwTIF072550; Fri, 9 Jun 2023 19:58:29 GMT (envelope-from git) Date: Fri, 9 Jun 2023 19:58:29 GMT Message-Id: <202306091958.359JwTIF072550@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 4a0ea7a98b92 - stable/13 - bcm2835_gpio: Handle BCM2711 pin configuration List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4a0ea7a98b9260462e22f3144eb08e9bd8ba2765 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=4a0ea7a98b9260462e22f3144eb08e9bd8ba2765 commit 4a0ea7a98b9260462e22f3144eb08e9bd8ba2765 Author: Tetsuya Uemura AuthorDate: 2023-05-28 12:56:21 +0000 Commit: Mitchell Horne CommitDate: 2023-06-09 19:48:07 +0000 bcm2835_gpio: Handle BCM2711 pin configuration Add support for GPIO internal pull up/down configuration on RPi4 family. BCM2711 SoC on 4th generation Raspberry Pi changed the way to configure its GPIO pins' internal pull up/down resistors. NetBSD already have support for this change, and port it to FreeBSD is trivial. This patch, based on the NetBSD commit adds the appropriate method for BCM2711 and now we can properly configure the GPIO pins' pull status. PR: 256372 Reviewed by: mhorne Obtained from: NetBSD bb88cfa64ad8 Pull Request: https://github.com/freebsd/freebsd-src/pull/746 (cherry picked from commit 9d35469e9a6892b3845f66d3513f5c528fe68a77) --- sys/arm/broadcom/bcm2835/bcm2835_gpio.c | 81 +++++++++++++++++++++++++-------- 1 file changed, 61 insertions(+), 20 deletions(-) diff --git a/sys/arm/broadcom/bcm2835/bcm2835_gpio.c b/sys/arm/broadcom/bcm2835/bcm2835_gpio.c index 70b69eb154e8..82b38e925448 100644 --- a/sys/arm/broadcom/bcm2835/bcm2835_gpio.c +++ b/sys/arm/broadcom/bcm2835/bcm2835_gpio.c @@ -64,8 +64,10 @@ __FBSDID("$FreeBSD$"); #endif #define BCM_GPIO_IRQS 4 -#define BCM_GPIO_PINS 54 #define BCM_GPIO_PINS_PER_BANK 32 +#define BCM2835_GPIO_PINS 54 +#define BCM2711_GPIO_PINS 58 +#define BCM_GPIO_PINS BCM2711_GPIO_PINS #define BCM_GPIO_DEFAULT_CAPS (GPIO_PIN_INPUT | GPIO_PIN_OUTPUT | \ GPIO_PIN_PULLUP | GPIO_PIN_PULLDOWN | GPIO_INTR_LEVEL_LOW | \ @@ -85,6 +87,10 @@ __FBSDID("$FreeBSD$"); #define BCM2835_PUD_DOWN 1 #define BCM2835_PUD_UP 2 +#define BCM2711_PUD_OFF 0 +#define BCM2711_PUD_DOWN 2 +#define BCM2711_PUD_UP 1 + static struct resource_spec bcm_gpio_res_spec[] = { { SYS_RES_MEMORY, 0, RF_ACTIVE }, { SYS_RES_IRQ, 0, RF_ACTIVE }, /* bank 0 interrupt */ @@ -112,6 +118,8 @@ struct bcm_gpio_softc { bus_space_tag_t sc_bst; bus_space_handle_t sc_bsh; void * sc_intrhand[BCM_GPIO_IRQS]; + bool sc_is2711; + u_int sc_maxpins; int sc_gpio_npins; int sc_ro_npins; int sc_ro_pins[BCM_GPIO_PINS]; @@ -151,8 +159,13 @@ enum bcm_gpio_pud { #define BCM_GPIO_GPLEN(_bank) (0x70 + _bank * 4) /* Low Level irq */ #define BCM_GPIO_GPAREN(_bank) (0x7c + _bank * 4) /* Async Rising Edge */ #define BCM_GPIO_GPAFEN(_bank) (0x88 + _bank * 4) /* Async Falling Egde */ -#define BCM_GPIO_GPPUD(_bank) (0x94) /* Pin Pull up/down */ -#define BCM_GPIO_GPPUDCLK(_bank) (0x98 + _bank * 4) /* Pin Pull up clock */ +#define BCM2835_GPIO_GPPUD(_bank) (0x94) /* Pin Pull up/down */ +#define BCM2835_GPIO_GPPUDCLK(_bank) (0x98 + _bank * 4) /* Pin Pull up clock */ + +#define BCM2711_GPIO_GPPUD(x) (0x0e4 + (x) * sizeof(uint32_t)) /* Pin Pull up/down */ +#define BCM2711_GPIO_MASK (0x3) +#define BCM2711_GPIO_SHIFT(n) (((n) % 16) * 2) +#define BCM2711_GPIO_REGID(n) ((n) / 16) static struct ofw_compat_data compat_data[] = { {"broadcom,bcm2835-gpio", 1}, @@ -289,16 +302,39 @@ bcm_gpio_set_function(struct bcm_gpio_softc *sc, uint32_t pin, uint32_t f) static void bcm_gpio_set_pud(struct bcm_gpio_softc *sc, uint32_t pin, uint32_t state) { - uint32_t bank; - /* Must be called with lock held. */ BCM_GPIO_LOCK_ASSERT(sc); - bank = BCM_GPIO_BANK(pin); - BCM_GPIO_WRITE(sc, BCM_GPIO_GPPUD(0), state); - BCM_GPIO_WRITE(sc, BCM_GPIO_GPPUDCLK(bank), BCM_GPIO_MASK(pin)); - BCM_GPIO_WRITE(sc, BCM_GPIO_GPPUD(0), 0); - BCM_GPIO_WRITE(sc, BCM_GPIO_GPPUDCLK(bank), 0); + if (sc->sc_is2711) { /* BCM2711 */ + u_int regid = BCM2711_GPIO_REGID(pin); + u_int shift = BCM2711_GPIO_SHIFT(pin); + uint32_t reg; + + switch (state) { + case BCM2835_PUD_OFF: + state = BCM2711_PUD_OFF; + break; + case BCM2835_PUD_DOWN: + state = BCM2711_PUD_DOWN; + break; + case BCM2835_PUD_UP: + state = BCM2711_PUD_UP; + break; + } + + reg = BCM_GPIO_READ(sc, BCM2711_GPIO_GPPUD(regid)); + reg &= ~(BCM2711_GPIO_MASK << shift); + reg |= (state << shift); + BCM_GPIO_WRITE(sc, BCM2711_GPIO_GPPUD(regid), reg); + } else { /* BCM2835 */ + uint32_t bank; + + bank = BCM_GPIO_BANK(pin); + BCM_GPIO_WRITE(sc, BCM2835_GPIO_GPPUD(0), state); + BCM_GPIO_WRITE(sc, BCM2835_GPIO_GPPUDCLK(bank), BCM_GPIO_MASK(pin)); + BCM_GPIO_WRITE(sc, BCM2835_GPIO_GPPUD(0), 0); + BCM_GPIO_WRITE(sc, BCM2835_GPIO_GPPUDCLK(bank), 0); + } } static void @@ -376,8 +412,10 @@ bcm_gpio_get_bus(device_t dev) static int bcm_gpio_pin_max(device_t dev, int *maxpin) { + struct bcm_gpio_softc *sc; - *maxpin = BCM_GPIO_PINS - 1; + sc = device_get_softc(dev); + *maxpin = sc->sc_maxpins - 1; return (0); } @@ -770,16 +808,19 @@ bcm_gpio_attach(device_t dev) } sc->sc_bst = rman_get_bustag(sc->sc_res[0]); sc->sc_bsh = rman_get_bushandle(sc->sc_res[0]); - /* Setup the GPIO interrupt handler. */ - if (bcm_gpio_intr_attach(dev)) { - device_printf(dev, "unable to setup the gpio irq handler\n"); - goto fail; - } /* Find our node. */ gpio = ofw_bus_get_node(sc->sc_dev); if (!OF_hasprop(gpio, "gpio-controller")) /* Node is not a GPIO controller. */ goto fail; + /* Guess I'm BCM2711 or not. */ + sc->sc_is2711 = ofw_bus_node_is_compatible(gpio, "brcm,bcm2711-gpio"); + sc->sc_maxpins = sc->sc_is2711 ? BCM2711_GPIO_PINS : BCM2835_GPIO_PINS; + /* Setup the GPIO interrupt handler. */ + if (bcm_gpio_intr_attach(dev)) { + device_printf(dev, "unable to setup the gpio irq handler\n"); + goto fail; + } /* * Find the read-only pins. These are pins we never touch or bad * things could happen. @@ -787,7 +828,7 @@ bcm_gpio_attach(device_t dev) if (bcm_gpio_get_reserved_pins(sc) == -1) goto fail; /* Initialize the software controlled pins. */ - for (i = 0, j = 0; j < BCM_GPIO_PINS; j++) { + for (i = 0, j = 0; j < sc->sc_maxpins; j++) { snprintf(sc->sc_gpio_pins[i].gp_name, GPIOMAXNAME, "pin %d", j); func = bcm_gpio_get_function(sc, j); @@ -956,7 +997,7 @@ bcm_gpio_pic_attach(struct bcm_gpio_softc *sc) const char *name; name = device_get_nameunit(sc->sc_dev); - for (irq = 0; irq < BCM_GPIO_PINS; irq++) { + for (irq = 0; irq < sc->sc_maxpins; irq++) { sc->sc_isrcs[irq].bgi_irq = irq; sc->sc_isrcs[irq].bgi_mask = BCM_GPIO_MASK(irq); sc->sc_isrcs[irq].bgi_mode = GPIO_INTR_CONFORM; @@ -1044,7 +1085,7 @@ bcm_gpio_pic_map_fdt(struct bcm_gpio_softc *sc, struct intr_map_data_fdt *daf, return (EINVAL); irq = daf->cells[0]; - if (irq >= BCM_GPIO_PINS || bcm_gpio_pin_is_ro(sc, irq)) + if (irq >= sc->sc_maxpins || bcm_gpio_pin_is_ro(sc, irq)) return (EINVAL); /* Only reasonable modes are supported. */ @@ -1075,7 +1116,7 @@ bcm_gpio_pic_map_gpio(struct bcm_gpio_softc *sc, struct intr_map_data_gpio *dag, uint32_t mode; irq = dag->gpio_pin_num; - if (irq >= BCM_GPIO_PINS || bcm_gpio_pin_is_ro(sc, irq)) + if (irq >= sc->sc_maxpins || bcm_gpio_pin_is_ro(sc, irq)) return (EINVAL); mode = dag->gpio_intr_mode; From nobody Fri Jun 9 20:02:35 2023 X-Original-To: dev-commits-src-branches@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 4QdBnl2tB7z4cKsl; Fri, 9 Jun 2023 20:02:35 +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 4QdBnl26m5z3DFH; Fri, 9 Jun 2023 20:02:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686340955; 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=DhuuLBj1EcTtxTprnF0So8vWVQO2/1Zb+Z2rtMVgxb4=; b=djlEy/FtLsh/clk4k6D6DdF162MEfiE1p9xkSgHrReRr8oSA9Nk9twKu5IexVxvmuFLxze tPImbmzcGoI5kdg452r0SA3k1LkApltygkT7qdsdvHNCghDcKPmfVQfkfj2lVNeSNRNp2b S0NV5K66TixzO6qYutxSzvVf+TJa1tl6sYQWpb05Un4t6/iM5nnq21JQO22HfEJfsDPtwr ERBa8efDbQZzutu7OKb7sPxpXoNW+ud33FUjIWSJL6o5gjHF5O6Zy9xEcCwlo4A0zDBuDn Wmc5shagb+w7VGA9/zBWidjGPlpzO0IZVQFjuk2OkDw9GAhFCytsKyWgNq9BMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686340955; 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=DhuuLBj1EcTtxTprnF0So8vWVQO2/1Zb+Z2rtMVgxb4=; b=pg629crQ6ZYZhcUz2JtTh0V5WT1Edwqznjs2/40EwNPeyKhWBwboM7HubMqusObGzr8ljT 4fTWHfYyj77a6VJdna1PtRnHquQiPhRJNeFinoNSSD/+LaC7oYIl1MTxnS/PHgm86W5997 yFIzMgL7oRfsSLG/CuTEN/vrHhbyZ+UOhQaPfmrQHw4IEl2fN3o8QuXddssrXP5u+xGyoS Avz2QOnDQZs6jszDorQR/l5IPg5FIYLmMAgHcX1tQAIqer7lop26Ox5lDT6hUbsZtY7bKK 1bteoj5HbEqq5yFyL/QuywQ2U+FG1LGzvRNDMUgqtffMRB7jxSD46yv/oqpBnQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686340955; a=rsa-sha256; cv=none; b=foguO07jckobG04vu5+sCCNsO3sjMu7Z/7Gu+SXE/4Q355mYIn5yD7qKVtFablaSPmWd7D khRE9U9VHF2mG+dVYFN9IrkU3ekr90flHYgyqeliFQPmG7G8/Rrxu7O0+DBltFppZrbTmy nsAnRGBLbR/3Yuo9miIaWDvRO964GOMGe6CVGA2yd7wFknzl9dV+6rm6uTxUN688UNAMHu wUuUOFzuLR21oU9NrRRzfXCfTxC6pOvkMkdx2U6N9uhGCNvmuL0h0ECYJChPp5asfynlW3 u6pQxmuqadh/cflzbqDQXfpLuVen8y0CL4VJGbpoIbF2pJXYNmPIdj1/TWd1UA== 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 4QdBnl1Bf3zp12; Fri, 9 Jun 2023 20:02:35 +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 359K2Zsj089276; Fri, 9 Jun 2023 20:02:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 359K2ZAC089275; Fri, 9 Jun 2023 20:02:35 GMT (envelope-from git) Date: Fri, 9 Jun 2023 20:02:35 GMT Message-Id: <202306092002.359K2ZAC089275@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 13cc2842304c - stable/13 - libpmc: expand PMC_OP* defines List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 13cc2842304c8eb8730807e6b3a493cafefe8fd6 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=13cc2842304c8eb8730807e6b3a493cafefe8fd6 commit 13cc2842304c8eb8730807e6b3a493cafefe8fd6 Author: Mitchell Horne AuthorDate: 2023-06-01 18:19:22 +0000 Commit: Mitchell Horne CommitDate: 2023-06-09 20:01:55 +0000 libpmc: expand PMC_OP* defines When performing the syscall, specify the full name of the desired operation. This improves grep-ability. No functional change. Reviewed by: jkoshy MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D40334 (cherry picked from commit be75e578549fcc1da3754a29fc0e7b63672e7b44) --- lib/libpmc/libpmc.c | 47 +++++++++++++++++++++++------------------------ 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/lib/libpmc/libpmc.c b/lib/libpmc/libpmc.c index 0ccefad5ca7d..b4418a30f328 100644 --- a/lib/libpmc/libpmc.c +++ b/lib/libpmc/libpmc.c @@ -78,8 +78,7 @@ static int powerpc_allocate_pmc(enum pmc_event _pe, char* ctrspec, struct pmc_op_pmcallocate *_pmc_config); #endif /* __powerpc__ */ -#define PMC_CALL(cmd, params) \ - syscall(pmc_syscall, PMC_OP_##cmd, (params)) +#define PMC_CALL(op, params) syscall(pmc_syscall, (op), (params)) /* * Event aliases provide a way for the user to ask for generic events @@ -1082,7 +1081,7 @@ pmc_allocate(const char *ctrspec, enum pmc_mode mode, } found: - if (PMC_CALL(PMCALLOCATE, &pmc_config) == 0) { + if (PMC_CALL(PMC_OP_PMCALLOCATE, &pmc_config) == 0) { *pmcid = pmc_config.pm_pmcid; retval = 0; } @@ -1101,7 +1100,7 @@ pmc_attach(pmc_id_t pmc, pid_t pid) pmc_attach_args.pm_pmc = pmc; pmc_attach_args.pm_pid = pid; - return (PMC_CALL(PMCATTACH, &pmc_attach_args)); + return (PMC_CALL(PMC_OP_PMCATTACH, &pmc_attach_args)); } int @@ -1126,7 +1125,7 @@ pmc_configure_logfile(int fd) struct pmc_op_configurelog cla; cla.pm_logfd = fd; - if (PMC_CALL(CONFIGURELOG, &cla) < 0) + if (PMC_CALL(PMC_OP_CONFIGURELOG, &cla) < 0) return (-1); return (0); } @@ -1150,7 +1149,7 @@ pmc_detach(pmc_id_t pmc, pid_t pid) pmc_detach_args.pm_pmc = pmc; pmc_detach_args.pm_pid = pid; - return (PMC_CALL(PMCDETACH, &pmc_detach_args)); + return (PMC_CALL(PMC_OP_PMCDETACH, &pmc_detach_args)); } int @@ -1161,7 +1160,7 @@ pmc_disable(int cpu, int pmc) ssa.pm_cpu = cpu; ssa.pm_pmc = pmc; ssa.pm_state = PMC_STATE_DISABLED; - return (PMC_CALL(PMCADMIN, &ssa)); + return (PMC_CALL(PMC_OP_PMCADMIN, &ssa)); } int @@ -1172,7 +1171,7 @@ pmc_enable(int cpu, int pmc) ssa.pm_cpu = cpu; ssa.pm_pmc = pmc; ssa.pm_state = PMC_STATE_FREE; - return (PMC_CALL(PMCADMIN, &ssa)); + return (PMC_CALL(PMC_OP_PMCADMIN, &ssa)); } /* @@ -1292,13 +1291,13 @@ pmc_event_names_of_class(enum pmc_class cl, const char ***eventnames, int pmc_flush_logfile(void) { - return (PMC_CALL(FLUSHLOG,0)); + return (PMC_CALL(PMC_OP_FLUSHLOG, 0)); } int pmc_close_logfile(void) { - return (PMC_CALL(CLOSELOG,0)); + return (PMC_CALL(PMC_OP_CLOSELOG, 0)); } int @@ -1306,7 +1305,7 @@ pmc_get_driver_stats(struct pmc_driverstats *ds) { struct pmc_op_getdriverstats gms; - if (PMC_CALL(GETDRIVERSTATS, &gms) < 0) + if (PMC_CALL(PMC_OP_GETDRIVERSTATS, &gms) < 0) return (-1); /* copy out fields in the current userland<->library interface */ @@ -1327,7 +1326,7 @@ pmc_get_msr(pmc_id_t pmc, uint32_t *msr) struct pmc_op_getmsr gm; gm.pm_pmcid = pmc; - if (PMC_CALL(PMCGETMSR, &gm) < 0) + if (PMC_CALL(PMC_OP_PMCGETMSR, &gm) < 0) return (-1); *msr = gm.pm_msr; return (0); @@ -1357,7 +1356,7 @@ pmc_init(void) /* check the kernel module's ABI against our compiled-in version */ abi_version = PMC_VERSION; - if (PMC_CALL(GETMODULEVERSION, &abi_version) < 0) + if (PMC_CALL(PMC_OP_GETMODULEVERSION, &abi_version) < 0) return (pmc_syscall = -1); /* ignore patch & minor numbers for the comparison */ @@ -1367,7 +1366,7 @@ pmc_init(void) } bzero(&op_cpu_info, sizeof(op_cpu_info)); - if (PMC_CALL(GETCPUINFO, &op_cpu_info) < 0) + if (PMC_CALL(PMC_OP_GETCPUINFO, &op_cpu_info) < 0) return (pmc_syscall = -1); cpu_info.pm_cputype = op_cpu_info.pm_cputype; @@ -1391,7 +1390,7 @@ pmc_init(void) * Get soft events list. */ soft_event_info.pm_class = PMC_CLASS_SOFT; - if (PMC_CALL(GETDYNEVENTINFO, &soft_event_info) < 0) + if (PMC_CALL(PMC_OP_GETDYNEVENTINFO, &soft_event_info) < 0) return (pmc_syscall = -1); /* Map soft events to static list. */ @@ -1720,7 +1719,7 @@ pmc_pmcinfo(int cpu, struct pmc_pmcinfo **ppmci) pmci->pm_cpu = cpu; - if (PMC_CALL(GETPMCINFO, pmci) < 0) { + if (PMC_CALL(PMC_OP_GETPMCINFO, pmci) < 0) { free(pmci); return (-1); } @@ -1739,7 +1738,7 @@ pmc_read(pmc_id_t pmc, pmc_value_t *value) pmc_read_op.pm_flags = PMC_F_OLDVALUE; pmc_read_op.pm_value = -1; - if (PMC_CALL(PMCRW, &pmc_read_op) < 0) + if (PMC_CALL(PMC_OP_PMCRW, &pmc_read_op) < 0) return (-1); *value = pmc_read_op.pm_value; @@ -1752,7 +1751,7 @@ pmc_release(pmc_id_t pmc) struct pmc_op_simple pmc_release_args; pmc_release_args.pm_pmcid = pmc; - return (PMC_CALL(PMCRELEASE, &pmc_release_args)); + return (PMC_CALL(PMC_OP_PMCRELEASE, &pmc_release_args)); } int @@ -1764,7 +1763,7 @@ pmc_rw(pmc_id_t pmc, pmc_value_t newvalue, pmc_value_t *oldvaluep) pmc_rw_op.pm_flags = PMC_F_NEWVALUE | PMC_F_OLDVALUE; pmc_rw_op.pm_value = newvalue; - if (PMC_CALL(PMCRW, &pmc_rw_op) < 0) + if (PMC_CALL(PMC_OP_PMCRW, &pmc_rw_op) < 0) return (-1); *oldvaluep = pmc_rw_op.pm_value; @@ -1779,7 +1778,7 @@ pmc_set(pmc_id_t pmc, pmc_value_t value) sc.pm_pmcid = pmc; sc.pm_count = value; - if (PMC_CALL(PMCSETCOUNT, &sc) < 0) + if (PMC_CALL(PMC_OP_PMCSETCOUNT, &sc) < 0) return (-1); return (0); } @@ -1790,7 +1789,7 @@ pmc_start(pmc_id_t pmc) struct pmc_op_simple pmc_start_args; pmc_start_args.pm_pmcid = pmc; - return (PMC_CALL(PMCSTART, &pmc_start_args)); + return (PMC_CALL(PMC_OP_PMCSTART, &pmc_start_args)); } int @@ -1799,7 +1798,7 @@ pmc_stop(pmc_id_t pmc) struct pmc_op_simple pmc_stop_args; pmc_stop_args.pm_pmcid = pmc; - return (PMC_CALL(PMCSTOP, &pmc_stop_args)); + return (PMC_CALL(PMC_OP_PMCSTOP, &pmc_stop_args)); } int @@ -1826,7 +1825,7 @@ pmc_write(pmc_id_t pmc, pmc_value_t value) pmc_write_op.pm_pmcid = pmc; pmc_write_op.pm_flags = PMC_F_NEWVALUE; pmc_write_op.pm_value = value; - return (PMC_CALL(PMCRW, &pmc_write_op)); + return (PMC_CALL(PMC_OP_PMCRW, &pmc_write_op)); } int @@ -1835,5 +1834,5 @@ pmc_writelog(uint32_t userdata) struct pmc_op_writelog wl; wl.pm_userdata = userdata; - return (PMC_CALL(WRITELOG, &wl)); + return (PMC_CALL(PMC_OP_WRITELOG, &wl)); } From nobody Sat Jun 10 18:26:43 2023 X-Original-To: dev-commits-src-branches@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 4Qdmcg3gwXz4cJ0G; Sat, 10 Jun 2023 18:26:43 +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 4Qdmcg3CGZz463Y; Sat, 10 Jun 2023 18:26:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686421603; 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=GxX7bnOr8QiPGUNqG/Z9uBT9tB5TEgRwGL2YPG0RgXY=; b=PIGouiasBOg+0uFtgkNVDHAOaJgFImwAcY5D2depqOFYTa1BR2yIiDZHKgeh6Y97XfLyrb Of6MdpS+n29tnJvlphKYQu8RA6Ak5mQhgRimb2DAgQa/mjhQvleV/PQAqcTCHmR129fIIa drr5nzZ8kittlC0jntljM6z78LGEcA1un4U7zid2graLqHj4xsQEfJ+BNDKX4lQVbp/T5N v1VDPJokU9SMFMG5LxFnGJsB5z1DE4iWsYMKl5Ab7l2GupMr+yPXYY/j1945phW2Fkmgq/ CG3R0iGLlHVEZ1UvKvI5rwH/t+sPRmB6jSBrQ5RyIK9MeoWuYT2d/S1b7ABDNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686421603; 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=GxX7bnOr8QiPGUNqG/Z9uBT9tB5TEgRwGL2YPG0RgXY=; b=Rn2/Skx0u8NOVfN4D4WJC55AJFTnK9esM1wkCgkz+BJg+wZ7wSoVIxkf1qHdRDpcFFEyKr PSEZVad+Qjhhjc1tnuH/s0SJvqwCPFYpfXe4Hj7UwQq6jtb2y9EqNU8wazJMcadMi6hE18 ICDNQIi+lmUeGmDN8hUfBBE4xQA3GFY5r0JI5HUYC8mKIR+FuGGXgi3TaIxm/4jaC2gBkI e9DsIfGMlHMBRgdHHvfj56KQ9Tkra+gBefyCMPh05KbDyTTK2k5woTN8Z2TZSxQAbSbjWh BlM6FXzivO/+j0MemPrdxNRpMcDaFkGTA3e2GQVmCrVRgwGSvoXAfoVUFYgpKw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686421603; a=rsa-sha256; cv=none; b=JaHzExTnLNsRTd4bfvjmkaL5DaqujVBDvxK60dGUD1CaCVsrykfZomxvBnAPpOXRXs7lzA yRNfPi6kyZyuXGf06ZwR3t8IT9J1KlK6fixx8KBOTCtFMx+m4/FNfkkeMpyCIA5wuBIl1g Uk/2rAeUO1mo/Pmgh1ShOfynMle7EM9khNsHu9KlJ1WqyKSd2054kyl3EZpPXeNcmBmOy7 WyfozNC4C71v/Rqctkx/bmVkw+gbqLceEOYSb6PxLhS9zoWIYdUIUgd51KQ08jfskZgcTm BobE0U1kH3mQaSD/+EVwSdjX9MbngMbP82hSysAH0s/o84QV57iURRhGXZbPgQ== 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 4Qdmcg2FYKzRnZ; Sat, 10 Jun 2023 18:26:43 +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 35AIQhSm098921; Sat, 10 Jun 2023 18:26:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 35AIQh3r098920; Sat, 10 Jun 2023 18:26:43 GMT (envelope-from git) Date: Sat, 10 Jun 2023 18:26:43 GMT Message-Id: <202306101826.35AIQh3r098920@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Graham Perrin Subject: git: fedfe274225a - stable/12 - rc(8): document how to reload rc's configuration List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: grahamperrin X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: fedfe274225a60a9c7e3894b245027caab92470a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by grahamperrin: URL: https://cgit.FreeBSD.org/src/commit/?id=fedfe274225a60a9c7e3894b245027caab92470a commit fedfe274225a60a9c7e3894b245027caab92470a Author: Mina Galić AuthorDate: 2023-06-02 18:01:03 +0000 Commit: Graham Perrin CommitDate: 2023-06-10 18:23:06 +0000 rc(8): document how to reload rc's configuration The fact that rc(8) only reads its configuration once is in the man page, but how to trigger a reload is only in the code. Discovered while trying to make cloud-init disable and stop syslogd. Thanks to RhodiumToad for providing the words. Reviewed by: debdrup, grahamperrin Approved by: grahamperrin, imp Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D40329 (cherry picked from commit 0981275c75d5678172eb9dd8fbc89ef61c05c979) --- share/man/man8/rc.8 | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/share/man/man8/rc.8 b/share/man/man8/rc.8 index ebd28cd85c2a..ebffeca09d63 100644 --- a/share/man/man8/rc.8 +++ b/share/man/man8/rc.8 @@ -31,7 +31,7 @@ .\" @(#)rc.8 8.2 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd July 4, 2022 +.Dd June 1, 2023 .Dt RC 8 .Os .Sh NAME @@ -124,10 +124,9 @@ to load various .Xr rc.subr 8 shell functions to use. .It -Load the configuration files. +Load the configuration files (see below for reloading). .It -Determine if booting in a jail, -and add +Determine if booting in a jail, and add .Dq Li nojail (no jails allowed) or .Dq Li nojailvnet @@ -367,6 +366,17 @@ the command name (see the .Sx EXAMPLES section). .Pp +The configuration files are normally read only once at the start of a boot +sequence; if a script needs to +.Cm enable +or +.Cm disable +any other script that would run later in the sequence, it must send a +.Dv SIGALRM +to the rc process (identified by +.Ev $RC_PID ) +to have it re-read the files. +.Pp The following key points apply to old-style scripts in .Pa /usr/local/etc/rc.d/ : .Bl -bullet