From nobody Mon Apr 8 04:01:54 2024 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 4VCb4z23qqz5G2vZ; Mon, 8 Apr 2024 04:01: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 4VCb4y6Xnjz4Z5C; Mon, 8 Apr 2024 04:01:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712548914; 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=k1zj3Ccpr3JDZ4P98iX3lmCMTvPsSlX7vOb/U9baleA=; b=VYXI36ZGdOwhNgMZ15bPlMKJWYY1K33YhZsKRB6Yh56UKCQ8+a2QdppAMp3wwn+Z8sd7wI hA/ulMDiA2eA4oawThWJRXOoDhpCmu3RMWU2JDX/aSVNskHvK9WyCY1nMSHqUIJAfgw6gk 7xabIPW+Obm06e8PFzIGlDX9Ieqleqh2oofHF8WPK47nQhRY4XCSToSvKZ7JVn2rLJFGPb eRykTALMGtpKWnTw8SmzP2zJHAKC8BRIIGkBsMgoNYeZRIUQtR7l48RNziavWo2XdTI98m DpjGlfVqJpby6lJnR9vmnZZIs/+2cm6xXAvkfPl9o77jf4nVbipGE8AEcjDuNQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712548914; a=rsa-sha256; cv=none; b=sa+bVi2TOSfSTl/Yl0T/d00QfdZJyqLG+p+I1r/I1jBGAKtpb2bqxoacKeT5V/QosMpJ2m 7qGduQYx6eHqF/dHbGnWUG328gDTO8vQBU+yoCRNYTHNQFwJ/hZExC0FFLG6pjYrW3lFAP X0y0+quWEmdUb6WCHOshmiu7GGQZ01xn9gcTzHb3CJZvd11VrE+rBgFrPB9yDnxVfq7F3J ++D21SuUF0ShV6GHy9XUr3f3zV9Xtijc7Z4PWk0vEbPavTYHD2/EApEJoC5WE3xfMAT0yh rAQ08Z1yF+YT5fsva37G7R1Ayn/jjemNEkQg+ODzGATYdrFE06q1osUkXsH/CQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712548914; 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=k1zj3Ccpr3JDZ4P98iX3lmCMTvPsSlX7vOb/U9baleA=; b=CooMWB4dejKDXuQeNvKjtVrg4UA2SO5GC20BR5wqTC6g+hjuCxOarsb463Bx7fXkxUpGxM H0VzAvOncCGptt4MOIuvG0cR2SNoVzdjUyzjiJItO47xCpq1P5qSkDfhLWwv9WRWhC8lQl WFRXizeXCny5VUfDRh9iBoY8jxwUvSGHvusq2EiIAdbp5fitCNK4mwMyNomZ4rj0P5FrwO AOK6F8+fSwu9p6Gbnfut3JV0h+YbDgmf91h17sqrHnzCJiAPWEQxmAK0DlWKCFH3/xA8zT N1EOVDa6Fp8WxDBHMpI1cgrM27lPVprOUca19mLIHYKmir8vNmCbE/3aybV71g== 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 4VCb4y6748zwJ2; Mon, 8 Apr 2024 04:01:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43841sDY061548; Mon, 8 Apr 2024 04:01:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43841sYW061544; Mon, 8 Apr 2024 04:01:54 GMT (envelope-from git) Date: Mon, 8 Apr 2024 04:01:54 GMT Message-Id: <202404080401.43841sYW061544@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Xin LI Subject: git: a9288701dee1 - stable/14 - Revert "MFV: xz 5.6.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: delphij X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a9288701dee1dc0e696d0a9d858f8a5287beff66 Auto-Submitted: auto-generated The branch stable/14 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=a9288701dee1dc0e696d0a9d858f8a5287beff66 commit a9288701dee1dc0e696d0a9d858f8a5287beff66 Author: Xin LI AuthorDate: 2024-04-05 06:39:23 +0000 Commit: Xin LI CommitDate: 2024-04-08 04:01:09 +0000 Revert "MFV: xz 5.6.0" This commit reverts 8db56defa766eacdbaf89a37f25b11a57fd9787a, rolling back the vendor import of xz 5.6.0 and restoring the package to version 5.4.5. The revert was not directly due to the attack (CVE-2024-3094): our import process have removed the test cases and build scripts that would have enabled the attack. However, reverting would help to reduce potential confusion and false positives from security scanners that assess risk based solely on version numbers. Another commit will follow to restore binary compatibility with the liblzma 5.6.0 library by making the previously private symbol (lzma_mt_block_size) public. PR: 278127 (cherry picked from commit 2f9cd13d6c1824633251fb4267c9752d3b044a45) --- contrib/xz/AUTHORS | 40 +- contrib/xz/COPYING | 116 +- contrib/xz/COPYING.0BSD | 11 - contrib/xz/COPYING.CC-BY-SA-4.0 | 427 - contrib/xz/ChangeLog | 16270 +++++++++++-------- contrib/xz/README | 43 +- contrib/xz/THANKS | 7 - contrib/xz/TODO | 4 + contrib/xz/doxygen/Doxyfile | 6 +- contrib/xz/doxygen/footer.html | 13 - contrib/xz/doxygen/update-doxygen | 6 +- contrib/xz/src/common/mythread.h | 28 +- contrib/xz/src/common/sysdefs.h | 18 +- contrib/xz/src/common/tuklib_common.h | 27 +- contrib/xz/src/common/tuklib_config.h | 2 - contrib/xz/src/common/tuklib_cpucores.c | 5 +- contrib/xz/src/common/tuklib_cpucores.h | 5 +- contrib/xz/src/common/tuklib_exit.c | 5 +- contrib/xz/src/common/tuklib_exit.h | 9 +- contrib/xz/src/common/tuklib_gettext.h | 5 +- contrib/xz/src/common/tuklib_integer.h | 7 +- contrib/xz/src/common/tuklib_mbstr.h | 5 +- contrib/xz/src/common/tuklib_mbstr_fw.c | 5 +- contrib/xz/src/common/tuklib_mbstr_width.c | 5 +- contrib/xz/src/common/tuklib_open_stdxxx.c | 5 +- contrib/xz/src/common/tuklib_open_stdxxx.h | 5 +- contrib/xz/src/common/tuklib_physmem.c | 25 +- contrib/xz/src/common/tuklib_physmem.h | 5 +- contrib/xz/src/common/tuklib_progname.c | 5 +- contrib/xz/src/common/tuklib_progname.h | 5 +- contrib/xz/src/liblzma/api/lzma.h | 31 +- contrib/xz/src/liblzma/api/lzma/base.h | 23 +- contrib/xz/src/liblzma/api/lzma/bcj.h | 10 +- contrib/xz/src/liblzma/api/lzma/block.h | 5 +- contrib/xz/src/liblzma/api/lzma/check.h | 5 +- contrib/xz/src/liblzma/api/lzma/container.h | 43 +- contrib/xz/src/liblzma/api/lzma/delta.h | 5 +- contrib/xz/src/liblzma/api/lzma/filter.h | 11 +- contrib/xz/src/liblzma/api/lzma/hardware.h | 5 +- contrib/xz/src/liblzma/api/lzma/index.h | 36 +- contrib/xz/src/liblzma/api/lzma/index_hash.h | 5 +- contrib/xz/src/liblzma/api/lzma/lzma12.h | 7 +- contrib/xz/src/liblzma/api/lzma/stream_flags.h | 5 +- contrib/xz/src/liblzma/api/lzma/version.h | 9 +- contrib/xz/src/liblzma/api/lzma/vli.h | 5 +- contrib/xz/src/liblzma/check/check.c | 5 +- contrib/xz/src/liblzma/check/check.h | 5 +- contrib/xz/src/liblzma/check/crc32_arm64.h | 119 - contrib/xz/src/liblzma/check/crc32_fast.c | 187 +- contrib/xz/src/liblzma/check/crc32_small.c | 5 +- contrib/xz/src/liblzma/check/crc32_table.c | 36 +- contrib/xz/src/liblzma/check/crc32_table_be.h | 4 +- contrib/xz/src/liblzma/check/crc32_table_le.h | 4 +- contrib/xz/src/liblzma/check/crc32_tablegen.c | 21 +- contrib/xz/src/liblzma/check/crc32_x86.S | 5 +- contrib/xz/src/liblzma/check/crc64_fast.c | 450 +- contrib/xz/src/liblzma/check/crc64_small.c | 5 +- contrib/xz/src/liblzma/check/crc64_table.c | 16 +- contrib/xz/src/liblzma/check/crc64_table_be.h | 4 +- contrib/xz/src/liblzma/check/crc64_table_le.h | 4 +- contrib/xz/src/liblzma/check/crc64_tablegen.c | 13 +- contrib/xz/src/liblzma/check/crc64_x86.S | 5 +- contrib/xz/src/liblzma/check/crc_common.h | 143 - contrib/xz/src/liblzma/check/crc_macros.h | 30 + contrib/xz/src/liblzma/check/crc_x86_clmul.h | 435 - contrib/xz/src/liblzma/common/alone_decoder.c | 5 +- contrib/xz/src/liblzma/common/alone_decoder.h | 5 +- contrib/xz/src/liblzma/common/alone_encoder.c | 5 +- contrib/xz/src/liblzma/common/auto_decoder.c | 5 +- .../xz/src/liblzma/common/block_buffer_decoder.c | 5 +- .../xz/src/liblzma/common/block_buffer_encoder.c | 5 +- .../xz/src/liblzma/common/block_buffer_encoder.h | 5 +- contrib/xz/src/liblzma/common/block_decoder.c | 5 +- contrib/xz/src/liblzma/common/block_decoder.h | 5 +- contrib/xz/src/liblzma/common/block_encoder.c | 5 +- contrib/xz/src/liblzma/common/block_encoder.h | 5 +- .../xz/src/liblzma/common/block_header_decoder.c | 5 +- .../xz/src/liblzma/common/block_header_encoder.c | 5 +- contrib/xz/src/liblzma/common/block_util.c | 5 +- contrib/xz/src/liblzma/common/common.c | 5 +- contrib/xz/src/liblzma/common/common.h | 5 +- .../xz/src/liblzma/common/easy_buffer_encoder.c | 5 +- .../xz/src/liblzma/common/easy_decoder_memusage.c | 5 +- contrib/xz/src/liblzma/common/easy_encoder.c | 5 +- .../xz/src/liblzma/common/easy_encoder_memusage.c | 5 +- contrib/xz/src/liblzma/common/easy_preset.c | 5 +- contrib/xz/src/liblzma/common/easy_preset.h | 5 +- contrib/xz/src/liblzma/common/file_info.c | 5 +- .../xz/src/liblzma/common/filter_buffer_decoder.c | 5 +- .../xz/src/liblzma/common/filter_buffer_encoder.c | 5 +- contrib/xz/src/liblzma/common/filter_common.c | 14 +- contrib/xz/src/liblzma/common/filter_common.h | 5 +- contrib/xz/src/liblzma/common/filter_decoder.c | 13 +- contrib/xz/src/liblzma/common/filter_decoder.h | 5 +- contrib/xz/src/liblzma/common/filter_encoder.c | 39 +- contrib/xz/src/liblzma/common/filter_encoder.h | 11 +- .../xz/src/liblzma/common/filter_flags_decoder.c | 5 +- .../xz/src/liblzma/common/filter_flags_encoder.c | 5 +- .../xz/src/liblzma/common/hardware_cputhreads.c | 5 +- contrib/xz/src/liblzma/common/hardware_physmem.c | 5 +- contrib/xz/src/liblzma/common/index.c | 5 +- contrib/xz/src/liblzma/common/index.h | 5 +- contrib/xz/src/liblzma/common/index_decoder.c | 5 +- contrib/xz/src/liblzma/common/index_decoder.h | 5 +- contrib/xz/src/liblzma/common/index_encoder.c | 5 +- contrib/xz/src/liblzma/common/index_encoder.h | 5 +- contrib/xz/src/liblzma/common/index_hash.c | 5 +- contrib/xz/src/liblzma/common/lzip_decoder.c | 5 +- contrib/xz/src/liblzma/common/lzip_decoder.h | 5 +- contrib/xz/src/liblzma/common/memcmplen.h | 24 +- contrib/xz/src/liblzma/common/microlzma_decoder.c | 5 +- contrib/xz/src/liblzma/common/microlzma_encoder.c | 5 +- contrib/xz/src/liblzma/common/outqueue.c | 5 +- contrib/xz/src/liblzma/common/outqueue.h | 5 +- .../xz/src/liblzma/common/stream_buffer_decoder.c | 5 +- .../xz/src/liblzma/common/stream_buffer_encoder.c | 5 +- contrib/xz/src/liblzma/common/stream_decoder.c | 5 +- contrib/xz/src/liblzma/common/stream_decoder.h | 5 +- contrib/xz/src/liblzma/common/stream_decoder_mt.c | 5 +- contrib/xz/src/liblzma/common/stream_encoder.c | 5 +- contrib/xz/src/liblzma/common/stream_encoder_mt.c | 25 +- .../xz/src/liblzma/common/stream_flags_common.c | 5 +- .../xz/src/liblzma/common/stream_flags_common.h | 5 +- .../xz/src/liblzma/common/stream_flags_decoder.c | 5 +- .../xz/src/liblzma/common/stream_flags_encoder.c | 5 +- contrib/xz/src/liblzma/common/string_conversion.c | 14 +- contrib/xz/src/liblzma/common/vli_decoder.c | 5 +- contrib/xz/src/liblzma/common/vli_encoder.c | 5 +- contrib/xz/src/liblzma/common/vli_size.c | 5 +- contrib/xz/src/liblzma/delta/delta_common.c | 5 +- contrib/xz/src/liblzma/delta/delta_common.h | 5 +- contrib/xz/src/liblzma/delta/delta_decoder.c | 5 +- contrib/xz/src/liblzma/delta/delta_decoder.h | 5 +- contrib/xz/src/liblzma/delta/delta_encoder.c | 5 +- contrib/xz/src/liblzma/delta/delta_encoder.h | 5 +- contrib/xz/src/liblzma/delta/delta_private.h | 5 +- contrib/xz/src/liblzma/liblzma.pc.in | 6 +- contrib/xz/src/liblzma/liblzma_generic.map | 7 - contrib/xz/src/liblzma/liblzma_linux.map | 7 - contrib/xz/src/liblzma/lz/lz_decoder.c | 48 +- contrib/xz/src/liblzma/lz/lz_decoder.h | 116 +- contrib/xz/src/liblzma/lz/lz_encoder.c | 13 +- contrib/xz/src/liblzma/lz/lz_encoder.h | 21 +- contrib/xz/src/liblzma/lz/lz_encoder_hash.h | 5 +- contrib/xz/src/liblzma/lz/lz_encoder_hash_table.h | 4 +- contrib/xz/src/liblzma/lz/lz_encoder_mf.c | 5 +- contrib/xz/src/liblzma/lzma/fastpos.h | 5 +- contrib/xz/src/liblzma/lzma/fastpos_table.c | 4 +- contrib/xz/src/liblzma/lzma/fastpos_tablegen.c | 17 +- contrib/xz/src/liblzma/lzma/lzma2_decoder.c | 5 +- contrib/xz/src/liblzma/lzma/lzma2_decoder.h | 5 +- contrib/xz/src/liblzma/lzma/lzma2_encoder.c | 8 +- contrib/xz/src/liblzma/lzma/lzma2_encoder.h | 5 +- contrib/xz/src/liblzma/lzma/lzma_common.h | 41 +- contrib/xz/src/liblzma/lzma/lzma_decoder.c | 760 +- contrib/xz/src/liblzma/lzma/lzma_decoder.h | 5 +- contrib/xz/src/liblzma/lzma/lzma_encoder.c | 18 +- contrib/xz/src/liblzma/lzma/lzma_encoder.h | 5 +- .../src/liblzma/lzma/lzma_encoder_optimum_fast.c | 5 +- .../src/liblzma/lzma/lzma_encoder_optimum_normal.c | 7 +- contrib/xz/src/liblzma/lzma/lzma_encoder_presets.c | 5 +- contrib/xz/src/liblzma/lzma/lzma_encoder_private.h | 9 +- contrib/xz/src/liblzma/rangecoder/price.h | 5 +- contrib/xz/src/liblzma/rangecoder/price_table.c | 4 +- contrib/xz/src/liblzma/rangecoder/price_tablegen.c | 22 +- contrib/xz/src/liblzma/rangecoder/range_common.h | 14 +- contrib/xz/src/liblzma/rangecoder/range_decoder.h | 838 +- contrib/xz/src/liblzma/rangecoder/range_encoder.h | 5 +- contrib/xz/src/liblzma/simple/arm.c | 5 +- contrib/xz/src/liblzma/simple/arm64.c | 5 +- contrib/xz/src/liblzma/simple/armthumb.c | 5 +- contrib/xz/src/liblzma/simple/ia64.c | 5 +- contrib/xz/src/liblzma/simple/powerpc.c | 5 +- contrib/xz/src/liblzma/simple/riscv.c | 755 - contrib/xz/src/liblzma/simple/simple_coder.c | 5 +- contrib/xz/src/liblzma/simple/simple_coder.h | 14 +- contrib/xz/src/liblzma/simple/simple_decoder.c | 5 +- contrib/xz/src/liblzma/simple/simple_decoder.h | 5 +- contrib/xz/src/liblzma/simple/simple_encoder.c | 5 +- contrib/xz/src/liblzma/simple/simple_encoder.h | 5 +- contrib/xz/src/liblzma/simple/simple_private.h | 5 +- contrib/xz/src/liblzma/simple/sparc.c | 5 +- contrib/xz/src/liblzma/simple/x86.c | 5 +- contrib/xz/src/liblzma/validate_map.sh | 6 +- contrib/xz/src/lzmainfo/lzmainfo.1 | 4 +- contrib/xz/src/lzmainfo/lzmainfo.c | 5 +- contrib/xz/src/xz/args.c | 159 +- contrib/xz/src/xz/args.h | 8 +- contrib/xz/src/xz/coder.c | 648 +- contrib/xz/src/xz/coder.h | 31 +- contrib/xz/src/xz/file_io.c | 144 +- contrib/xz/src/xz/file_io.h | 21 +- contrib/xz/src/xz/hardware.c | 11 +- contrib/xz/src/xz/hardware.h | 5 +- contrib/xz/src/xz/list.c | 31 +- contrib/xz/src/xz/list.h | 5 +- contrib/xz/src/xz/main.c | 91 +- contrib/xz/src/xz/main.h | 5 +- contrib/xz/src/xz/message.c | 94 +- contrib/xz/src/xz/message.h | 15 +- contrib/xz/src/xz/mytime.c | 105 +- contrib/xz/src/xz/mytime.h | 11 +- contrib/xz/src/xz/options.c | 7 +- contrib/xz/src/xz/options.h | 5 +- contrib/xz/src/xz/private.h | 26 +- contrib/xz/src/xz/sandbox.c | 355 - contrib/xz/src/xz/sandbox.h | 43 - contrib/xz/src/xz/signals.c | 22 +- contrib/xz/src/xz/signals.h | 5 +- contrib/xz/src/xz/suffix.c | 17 +- contrib/xz/src/xz/suffix.h | 5 +- contrib/xz/src/xz/util.c | 36 +- contrib/xz/src/xz/util.h | 19 +- contrib/xz/src/xz/xz.1 | 439 +- contrib/xz/src/xzdec/xzdec.1 | 8 +- contrib/xz/src/xzdec/xzdec.c | 160 +- lib/liblzma/Makefile | 1 - lib/liblzma/Symbol.map | 5 +- lib/liblzma/Versions.def | 5 +- lib/liblzma/config.h | 120 +- usr.bin/xz/Makefile | 1 - 221 files changed, 11311 insertions(+), 13505 deletions(-) diff --git a/contrib/xz/AUTHORS b/contrib/xz/AUTHORS index 5012d0e01e83..69bbfc3ef609 100644 --- a/contrib/xz/AUTHORS +++ b/contrib/xz/AUTHORS @@ -9,13 +9,15 @@ Authors of XZ Utils specifically the LZMA SDK . Without this code, XZ Utils wouldn't exist. - The SHA-256 implementation in liblzma is based on code written by - Wei Dai in Crypto++ Library . + The SHA-256 implementation in liblzma is based on the code found from + 7-Zip , which has a modified version of the SHA-256 + code found from Crypto++ . The SHA-256 code + in Crypto++ was written by Kevin Springle and Wei Dai. - A few scripts have been adapted from GNU gzip. The original - versions were written by Jean-loup Gailly, Charles Levert, and - Paul Eggert. Andrew Dudman helped adapting the scripts and their - man pages for XZ Utils. + Some scripts have been adapted from gzip. The original versions + were written by Jean-loup Gailly, Charles Levert, and Paul Eggert. + Andrew Dudman helped adapting the scripts and their man pages for + XZ Utils. The initial version of the threaded .xz decompressor was written by Sebastian Andrzej Siewior. @@ -23,31 +25,15 @@ Authors of XZ Utils The initial version of the .lz (lzip) decoder was written by Michał Górny. - Architecture-specific CRC optimizations were contributed by - Ilya Kurdyukov, Hans Jansen, and Chenxi Mao. + CLMUL-accelerated CRC code was contributed by Ilya Kurdyukov. Other authors: - Jonathan Nieder - Joachim Henke - Many people have contributed improvements or reported bugs. - Most of these people are mentioned in the file THANKS. + The GNU Autotools-based build system contains files from many authors, + which I'm not trying to list here. - The translations of the command line tools and man pages have been - contributed by many people via the Translation Project: - - - https://translationproject.org/domain/xz.html - - https://translationproject.org/domain/xz-man.html - - The authors of the translated man pages are in the header comments - of the man page files. In the source package, the authors of the - translations are in po/*.po and po4a/*.po files. - - Third-party code whose authors aren't listed here: - - - GNU getopt_long() in the 'lib' directory is included for - platforms that don't have a usable getopt_long(). - - - The build system files from GNU Autoconf, GNU Automake, - GNU Libtool, GNU Gettext, Autoconf Archive, and related files. + Several people have contributed fixes or reported bugs. Most of them + are mentioned in the file THANKS. diff --git a/contrib/xz/COPYING b/contrib/xz/COPYING index a31477d62d31..e54eeacfbf3f 100644 --- a/contrib/xz/COPYING +++ b/contrib/xz/COPYING @@ -6,95 +6,71 @@ XZ Utils Licensing is a rough summary of which licenses apply to which parts of this package (but check the individual files to be sure!): - - liblzma is under the BSD Zero Clause License (0BSD). + - liblzma is in the public domain. - - The command line tools xz, xzdec, lzmadec, and lzmainfo are - under 0BSD except that, on systems that don't have a usable - getopt_long, GNU getopt_long is compiled and linked in from the - 'lib' directory. The getopt_long code is under GNU LGPLv2.1+. + - xz, xzdec, and lzmadec command line tools are in the public + domain unless GNU getopt_long had to be compiled and linked + in from the lib directory. The getopt_long code is under + GNU LGPLv2.1+. - The scripts to grep, diff, and view compressed files have been - adapted from GNU gzip. These scripts (xzgrep, xzdiff, xzless, - and xzmore) are under GNU GPLv2+. The man pages of the scripts - are under 0BSD; they aren't based on the man pages of GNU gzip. - - - Most of the XZ Utils specific documentation that is in - plain text files (like README, INSTALL, PACKAGERS, NEWS, - and ChangeLog) are under 0BSD unless stated otherwise in - the file itself. The files xz-file-format.txt and - lzma-file-format.xt are in the public domain but may - be distributed under the terms of 0BSD too. - - - Doxygen-generated HTML version of the liblzma API documentation: - While Doxygen is under the GNU GPLv2, the license information - in Doxygen includes the following exception: - - Documents produced by doxygen are derivative works - derived from the input used in their production; - they are not affected by this license. + adapted from gzip. These scripts and their documentation are + under GNU GPLv2+. + + - All the documentation in the doc directory and most of the + XZ Utils specific documentation files in other directories + are in the public domain. Note: The JavaScript files (under the MIT license) have - been removed from the Doxygen output. + been removed from the Doxygen-generated HTML version of the + liblzma API documentation. Doxygen itself is under the GNU GPL + but the remaining files generated by Doxygen are not affected + by the licenses used in Doxygen because Doxygen licensing has + the following exception: - - The XZ logo (xz-logo.png) included in the Doxygen-generated - documentation is under the Creative Commons BY-SA 4.0 license. + "Documents produced by doxygen are derivative works + derived from the input used in their production; + they are not affected by this license." - - Translated messages and man pages are under 0BSD except that - some old translations are in the public domain. + - Translated messages are in the public domain. - - Test files and test code in the 'tests' directory, and - debugging utilities in the 'debug' directory are under - the BSD Zero Clause License (0BSD). + - The build system contains public domain files, and files that + are under GNU GPLv2+ or GNU GPLv3+. None of these files end up + in the binaries being built. - - The GNU Autotools based build system contains files that are - under GNU GPLv2+, GNU GPLv3+, and a few permissive licenses. - These files don't affect the licensing of the binaries being - built. + - Test files and test code in the tests directory, and debugging + utilities in the debug directory are in the public domain. - - The extra directory contain files that are under various - free software licenses. + - The extra directory may contain public domain files, and files + that are under various free software licenses. - For the files under the BSD Zero Clause License (0BSD), if - a copyright notice is needed, the following is sufficient: + You can do whatever you want with the files that have been put into + the public domain. If you find public domain legally problematic, + take the previous sentence as a license grant. If you still find + the lack of copyright legally problematic, you have too many + lawyers. - Copyright (C) The XZ Utils authors and contributors + As usual, this software is provided "as is", without any warranty. - If you copy significant amounts of 0BSD-licensed code from XZ Utils + If you copy significant amounts of public domain code from XZ Utils into your project, acknowledging this somewhere in your software is polite (especially if it is proprietary, non-free software), but - it is not legally required by the license terms. Here is an example - of a good notice to put into "about box" or into documentation: + naturally it is not legally required. Here is an example of a good + notice to put into "about box" or into documentation: - This software includes code from XZ Utils - . + This software includes code from XZ Utils . The following license texts are included in the following files: - - COPYING.0BSD: BSD Zero Clause License - COPYING.LGPLv2.1: GNU Lesser General Public License version 2.1 - COPYING.GPLv2: GNU General Public License version 2 - COPYING.GPLv3: GNU General Public License version 3 - - COPYING.CC-BY-SA-4.0: Creative Commons Attribution-ShareAlike 4.0 - International Public License - - A note about old XZ Utils releases: - - XZ Utils releases 5.4.6 and older and 5.5.1alpha have a - significant amount of code put into the public domain and - that obviously remains so. The switch from public domain to - 0BSD for newer releases was made in Febrary 2024 because - public domain has (real or perceived) legal ambiguities in - some jurisdictions. - - There is very little *practical* difference between public - domain and 0BSD. The main difference likely is that one - shouldn't claim that 0BSD-licensed code is in the public - domain; 0BSD-licensed code is copyrighted but available under - an extremely permissive license. Neither 0BSD nor public domain - require retaining or reproducing author, copyright holder, or - license notices when distributing the software. (Compare to, - for example, BSD 2-Clause "Simplified" License which does have - such requirements.) - - If you have questions, don't hesitate to ask for more information. - The contact information is in the README file. + + Note that the toolchain (compiler, linker etc.) may add some code + pieces that are copyrighted. Thus, it is possible that e.g. liblzma + binary wouldn't actually be in the public domain in its entirety + even though it contains no copyrighted code from the XZ Utils source + package. + + If you have questions, don't hesitate to ask the author(s) for more + information. diff --git a/contrib/xz/COPYING.0BSD b/contrib/xz/COPYING.0BSD deleted file mode 100644 index 4322122aecf1..000000000000 --- a/contrib/xz/COPYING.0BSD +++ /dev/null @@ -1,11 +0,0 @@ -Permission to use, copy, modify, and/or distribute this -software for any purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL -WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL -THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR -CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, -NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN -CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/contrib/xz/COPYING.CC-BY-SA-4.0 b/contrib/xz/COPYING.CC-BY-SA-4.0 deleted file mode 100644 index 7d4f96c54aa1..000000000000 --- a/contrib/xz/COPYING.CC-BY-SA-4.0 +++ /dev/null @@ -1,427 +0,0 @@ -Attribution-ShareAlike 4.0 International - -======================================================================= - -Creative Commons Corporation ("Creative Commons") is not a law firm and -does not provide legal services or legal advice. Distribution of -Creative Commons public licenses does not create a lawyer-client or -other relationship. Creative Commons makes its licenses and related -information available on an "as-is" basis. Creative Commons gives no -warranties regarding its licenses, any material licensed under their -terms and conditions, or any related information. Creative Commons -disclaims all liability for damages resulting from their use to the -fullest extent possible. - -Using Creative Commons Public Licenses - -Creative Commons public licenses provide a standard set of terms and -conditions that creators and other rights holders may use to share -original works of authorship and other material subject to copyright -and certain other rights specified in the public license below. The -following considerations are for informational purposes only, are not -exhaustive, and do not form part of our licenses. - - Considerations for licensors: Our public licenses are - intended for use by those authorized to give the public - permission to use material in ways otherwise restricted by - copyright and certain other rights. Our licenses are - irrevocable. Licensors should read and understand the terms - and conditions of the license they choose before applying it. - Licensors should also secure all rights necessary before - applying our licenses so that the public can reuse the - material as expected. Licensors should clearly mark any - material not subject to the license. This includes other CC- - licensed material, or material used under an exception or - limitation to copyright. More considerations for licensors: - wiki.creativecommons.org/Considerations_for_licensors - - Considerations for the public: By using one of our public - licenses, a licensor grants the public permission to use the - licensed material under specified terms and conditions. If - the licensor's permission is not necessary for any reason--for - example, because of any applicable exception or limitation to - copyright--then that use is not regulated by the license. Our - licenses grant only permissions under copyright and certain - other rights that a licensor has authority to grant. Use of - the licensed material may still be restricted for other - reasons, including because others have copyright or other - rights in the material. A licensor may make special requests, - such as asking that all changes be marked or described. - Although not required by our licenses, you are encouraged to - respect those requests where reasonable. More considerations - for the public: - wiki.creativecommons.org/Considerations_for_licensees - -======================================================================= - -Creative Commons Attribution-ShareAlike 4.0 International Public -License - -By exercising the Licensed Rights (defined below), You accept and agree -to be bound by the terms and conditions of this Creative Commons -Attribution-ShareAlike 4.0 International Public License ("Public -License"). To the extent this Public License may be interpreted as a -contract, You are granted the Licensed Rights in consideration of Your -acceptance of these terms and conditions, and the Licensor grants You -such rights in consideration of benefits the Licensor receives from -making the Licensed Material available under these terms and -conditions. - - -Section 1 -- Definitions. - - a. Adapted Material means material subject to Copyright and Similar - Rights that is derived from or based upon the Licensed Material - and in which the Licensed Material is translated, altered, - arranged, transformed, or otherwise modified in a manner requiring - permission under the Copyright and Similar Rights held by the - Licensor. For purposes of this Public License, where the Licensed - Material is a musical work, performance, or sound recording, - Adapted Material is always produced where the Licensed Material is - synched in timed relation with a moving image. - - b. Adapter's License means the license You apply to Your Copyright - and Similar Rights in Your contributions to Adapted Material in - accordance with the terms and conditions of this Public License. - - c. BY-SA Compatible License means a license listed at - creativecommons.org/compatiblelicenses, approved by Creative - Commons as essentially the equivalent of this Public License. - - d. Copyright and Similar Rights means copyright and/or similar rights - closely related to copyright including, without limitation, - performance, broadcast, sound recording, and Sui Generis Database - Rights, without regard to how the rights are labeled or - categorized. For purposes of this Public License, the rights - specified in Section 2(b)(1)-(2) are not Copyright and Similar - Rights. - - e. Effective Technological Measures means those measures that, in the - absence of proper authority, may not be circumvented under laws - fulfilling obligations under Article 11 of the WIPO Copyright - Treaty adopted on December 20, 1996, and/or similar international - agreements. - - f. Exceptions and Limitations means fair use, fair dealing, and/or - any other exception or limitation to Copyright and Similar Rights - that applies to Your use of the Licensed Material. - - g. License Elements means the license attributes listed in the name - of a Creative Commons Public License. The License Elements of this - Public License are Attribution and ShareAlike. - - h. Licensed Material means the artistic or literary work, database, - or other material to which the Licensor applied this Public - License. - - i. Licensed Rights means the rights granted to You subject to the - terms and conditions of this Public License, which are limited to - all Copyright and Similar Rights that apply to Your use of the - Licensed Material and that the Licensor has authority to license. - - j. Licensor means the individual(s) or entity(ies) granting rights - under this Public License. - - k. Share means to provide material to the public by any means or - process that requires permission under the Licensed Rights, such - as reproduction, public display, public performance, distribution, - dissemination, communication, or importation, and to make material - available to the public including in ways that members of the - public may access the material from a place and at a time - individually chosen by them. - - l. Sui Generis Database Rights means rights other than copyright - resulting from Directive 96/9/EC of the European Parliament and of - the Council of 11 March 1996 on the legal protection of databases, - as amended and/or succeeded, as well as other essentially - equivalent rights anywhere in the world. - - m. You means the individual or entity exercising the Licensed Rights - under this Public License. Your has a corresponding meaning. - - -Section 2 -- Scope. - - a. License grant. - - 1. Subject to the terms and conditions of this Public License, - the Licensor hereby grants You a worldwide, royalty-free, - non-sublicensable, non-exclusive, irrevocable license to - exercise the Licensed Rights in the Licensed Material to: - - a. reproduce and Share the Licensed Material, in whole or - in part; and - - b. produce, reproduce, and Share Adapted Material. - - 2. Exceptions and Limitations. For the avoidance of doubt, where - Exceptions and Limitations apply to Your use, this Public - License does not apply, and You do not need to comply with - its terms and conditions. - - 3. Term. The term of this Public License is specified in Section - 6(a). - - 4. Media and formats; technical modifications allowed. The - Licensor authorizes You to exercise the Licensed Rights in - all media and formats whether now known or hereafter created, - and to make technical modifications necessary to do so. The - Licensor waives and/or agrees not to assert any right or - authority to forbid You from making technical modifications - necessary to exercise the Licensed Rights, including - technical modifications necessary to circumvent Effective - Technological Measures. For purposes of this Public License, - simply making modifications authorized by this Section 2(a) - (4) never produces Adapted Material. - - 5. Downstream recipients. - - a. Offer from the Licensor -- Licensed Material. Every - recipient of the Licensed Material automatically - receives an offer from the Licensor to exercise the - Licensed Rights under the terms and conditions of this - Public License. - - b. Additional offer from the Licensor -- Adapted Material. - Every recipient of Adapted Material from You - automatically receives an offer from the Licensor to - exercise the Licensed Rights in the Adapted Material - under the conditions of the Adapter's License You apply. - - c. No downstream restrictions. You may not offer or impose - any additional or different terms or conditions on, or - apply any Effective Technological Measures to, the - Licensed Material if doing so restricts exercise of the - Licensed Rights by any recipient of the Licensed - Material. - - 6. No endorsement. Nothing in this Public License constitutes or - may be construed as permission to assert or imply that You - are, or that Your use of the Licensed Material is, connected - with, or sponsored, endorsed, or granted official status by, - the Licensor or others designated to receive attribution as - provided in Section 3(a)(1)(A)(i). - - b. Other rights. - - 1. Moral rights, such as the right of integrity, are not - licensed under this Public License, nor are publicity, - privacy, and/or other similar personality rights; however, to - the extent possible, the Licensor waives and/or agrees not to - assert any such rights held by the Licensor to the limited - extent necessary to allow You to exercise the Licensed - Rights, but not otherwise. - - 2. Patent and trademark rights are not licensed under this - Public License. - - 3. To the extent possible, the Licensor waives any right to - collect royalties from You for the exercise of the Licensed - Rights, whether directly or through a collecting society - under any voluntary or waivable statutory or compulsory - licensing scheme. In all other cases the Licensor expressly - reserves any right to collect such royalties. - - -Section 3 -- License Conditions. - -Your exercise of the Licensed Rights is expressly made subject to the -following conditions. - - a. Attribution. - - 1. If You Share the Licensed Material (including in modified - form), You must: - - a. retain the following if it is supplied by the Licensor - with the Licensed Material: - - i. identification of the creator(s) of the Licensed - Material and any others designated to receive - attribution, in any reasonable manner requested by - the Licensor (including by pseudonym if - designated); - - ii. a copyright notice; - - iii. a notice that refers to this Public License; - - iv. a notice that refers to the disclaimer of - warranties; - - v. a URI or hyperlink to the Licensed Material to the - extent reasonably practicable; - - b. indicate if You modified the Licensed Material and - retain an indication of any previous modifications; and - - c. indicate the Licensed Material is licensed under this - Public License, and include the text of, or the URI or - hyperlink to, this Public License. - - 2. You may satisfy the conditions in Section 3(a)(1) in any - reasonable manner based on the medium, means, and context in - which You Share the Licensed Material. For example, it may be - reasonable to satisfy the conditions by providing a URI or - hyperlink to a resource that includes the required - information. - - 3. If requested by the Licensor, You must remove any of the - information required by Section 3(a)(1)(A) to the extent - reasonably practicable. - - b. ShareAlike. - - In addition to the conditions in Section 3(a), if You Share - Adapted Material You produce, the following conditions also apply. - - 1. The Adapter's License You apply must be a Creative Commons - license with the same License Elements, this version or - later, or a BY-SA Compatible License. - - 2. You must include the text of, or the URI or hyperlink to, the - Adapter's License You apply. You may satisfy this condition - in any reasonable manner based on the medium, means, and - context in which You Share Adapted Material. - - 3. You may not offer or impose any additional or different terms - or conditions on, or apply any Effective Technological - Measures to, Adapted Material that restrict exercise of the - rights granted under the Adapter's License You apply. - - -Section 4 -- Sui Generis Database Rights. - -Where the Licensed Rights include Sui Generis Database Rights that -apply to Your use of the Licensed Material: - - a. for the avoidance of doubt, Section 2(a)(1) grants You the right - to extract, reuse, reproduce, and Share all or a substantial - portion of the contents of the database; - - b. if You include all or a substantial portion of the database - contents in a database in which You have Sui Generis Database - Rights, then the database in which You have Sui Generis Database - Rights (but not its individual contents) is Adapted Material, - including for purposes of Section 3(b); and - - c. You must comply with the conditions in Section 3(a) if You Share - all or a substantial portion of the contents of the database. - -For the avoidance of doubt, this Section 4 supplements and does not -replace Your obligations under this Public License where the Licensed -Rights include other Copyright and Similar Rights. - - -Section 5 -- Disclaimer of Warranties and Limitation of Liability. - - a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE - EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS - AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF - ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, - IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, - WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR - PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, - ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT - KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT - ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. - - b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE - TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, - NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, - INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, - COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR - USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN - ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR - DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR - IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. - - c. The disclaimer of warranties and limitation of liability provided - above shall be interpreted in a manner that, to the extent - possible, most closely approximates an absolute disclaimer and - waiver of all liability. - - -Section 6 -- Term and Termination. - - a. This Public License applies for the term of the Copyright and - Similar Rights licensed here. However, if You fail to comply with - this Public License, then Your rights under this Public License - terminate automatically. - - b. Where Your right to use the Licensed Material has terminated under - Section 6(a), it reinstates: - - 1. automatically as of the date the violation is cured, provided - it is cured within 30 days of Your discovery of the - violation; or - - 2. upon express reinstatement by the Licensor. - - For the avoidance of doubt, this Section 6(b) does not affect any - right the Licensor may have to seek remedies for Your violations - of this Public License. - - c. For the avoidance of doubt, the Licensor may also offer the - Licensed Material under separate terms or conditions or stop - distributing the Licensed Material at any time; however, doing so - will not terminate this Public License. - - d. Sections 1, 5, 6, 7, and 8 survive termination of this Public - License. - - -Section 7 -- Other Terms and Conditions. - - a. The Licensor shall not be bound by any additional or different - terms or conditions communicated by You unless expressly agreed. - - b. Any arrangements, understandings, or agreements regarding the - Licensed Material not stated herein are separate from and - independent of the terms and conditions of this Public License. - - -Section 8 -- Interpretation. - - a. For the avoidance of doubt, this Public License does not, and - shall not be interpreted to, reduce, limit, restrict, or impose - conditions on any use of the Licensed Material that could lawfully - be made without permission under this Public License. - - b. To the extent possible, if any provision of this Public License is - deemed unenforceable, it shall be automatically reformed to the - minimum extent necessary to make it enforceable. If the provision - cannot be reformed, it shall be severed from this Public License - without affecting the enforceability of the remaining terms and - conditions. - - c. No term or condition of this Public License will be waived and no - failure to comply consented to unless expressly agreed to by the - Licensor. - - d. Nothing in this Public License constitutes or may be interpreted - as a limitation upon, or waiver of, any privileges and immunities - that apply to the Licensor or You, including from the legal - processes of any jurisdiction or authority. - - -======================================================================= - -Creative Commons is not a party to its public -licenses. Notwithstanding, Creative Commons may elect to apply one of -its public licenses to material it publishes and in those instances -will be considered the “Licensor.” The text of the Creative Commons -public licenses is dedicated to the public domain under the CC0 Public -Domain Dedication. Except for the limited purpose of indicating that -material is shared under a Creative Commons public license or as -otherwise permitted by the Creative Commons policies published at -creativecommons.org/policies, Creative Commons does not authorize the -use of the trademark "Creative Commons" or any other trademark or logo -of Creative Commons without its prior written consent including, -without limitation, in connection with any unauthorized modifications -to any of its public licenses or any other arrangements, -understandings, or agreements concerning use of licensed material. For -the avoidance of doubt, this paragraph does not form part of the -public licenses. - -Creative Commons may be contacted at creativecommons.org. diff --git a/contrib/xz/ChangeLog b/contrib/xz/ChangeLog index 54b68744af86..4dd0978ef313 100644 --- a/contrib/xz/ChangeLog +++ b/contrib/xz/ChangeLog @@ -1,9764 +1,11756 @@ -commit 2d7d862e3ffa8cec4fd3fdffcd84e984a17aa429 +commit 49053c0a649f4c8bd2b8d97ce915f401fbc0f3d9 Author: Jia Tan -Date: 2024-02-24 15:55:08 +0800 +Date: 2023-10-31 22:30:29 +0800 - Bump version and soname for 5.6.0. + Bump version and soname for 5.4.5. - src/liblzma/Makefile.am | 2 +- - src/liblzma/api/lzma/version.h | 6 +++--- - src/liblzma/liblzma_generic.map | 2 +- - src/liblzma/liblzma_linux.map | 2 +- - 4 files changed, 6 insertions(+), 6 deletions(-) + src/liblzma/Makefile.am | 2 +- + src/liblzma/api/lzma/version.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) -commit a18fb1edef0d0aac12a09eed05e9c448c777af7b +commit 84c0cfc556287628df871703672879e530d0391f Author: Jia Tan -Date: 2024-02-24 15:50:36 +0800 +Date: 2023-11-01 20:18:30 +0800 - Add NEWS for 5.6.0. + Add NEWS for 5.4.5. - NEWS | 143 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 143 insertions(+) + NEWS | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 74 insertions(+) -commit 24355c5280bc95e3d594432d60bb8432aa6af173 -Author: Jia Tan -Date: 2024-02-22 22:27:01 +0800 +commit d90ed84db9770712e2421e170076b43bda9b64a7 +Author: Lasse Collin +Date: 2023-10-31 21:41:09 +0200 - Translations: Remove obsolete and fuzzy matches from some translations. + liblzma: Fix compilation of fastpos_tablegen.c. - The French and Brazilian Portuguese man page translations have not been - updated since the switch from public domain to 0BSD. The old GPLv2 - strings have now been removed from these files. - - po4a/fr.po | 4702 +++++++++++++++++++++++++++++++++++++---------------- - po4a/pt_BR.po | 4987 ++++++++++++++++++++++++++++++++++++++++----------------- - 2 files changed, 6832 insertions(+), 2857 deletions(-) - -commit 02ca4a7d7b703e2ec63e00b70feec825e919dbc1 -Author: Jia Tan -Date: 2024-02-21 00:31:54 +0800 - - Translations: Patch man pages to avoid fuzzy matches. + The macro lzma_attr_visibility_hidden has to be defined to make + fastpos.h usable. The visibility attribute is irrelevant to + fastpos_tablegen.c so simply #define the macro to an empty value. - This will be fixed in the next round of translations, but this avoids - having a fuzzy match or not fixing the English version. - - po4a/de.po | 2 +- - po4a/ko.po | 2 +- - po4a/ro.po | 2 +- - po4a/uk.po | 2 +- - 4 files changed, 4 insertions(+), 4 deletions(-) - -commit 898aad9fc711e03452d24d9e2c5b7f77a6f9ce64 *** 32182 LINES SKIPPED *** From nobody Mon Apr 8 04:01:55 2024 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 4VCb500q9bz5G3HP; Mon, 8 Apr 2024 04:01: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 4VCb500DtTz4Ytr; Mon, 8 Apr 2024 04:01:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712548916; 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=5PoPDyJ/kVGZxdAb64oBPtSiqfz5ETdfv98Ym/O1pqE=; b=dR1lLsTScBg75Lu97mpd9HeM/L/8/zFhh1ucDpIA2jS7NU8YArkluXSD03c9yfgxbVOQHA fCIiyXpGE6pazlPswspLd4HQGE2y+GU71v9rh6088kwHlyoROsBs3Hiwz13VINOYF81JFr 8lnJd71Z2HtpW0iGmSjphllLzIkX0Isg9rzu7k/0xq1aREuUsCrSmofg+bZ9eegXxHSGHR UE0Tp8xcM2Lnl77VyZghkq3dcoy3YDdE3Y1Vdns1oGotEoDgEl0dwuhwNE63OayKmhs4ki by3FZKotiYo8R6CFC63bhZ4AfP941tVstZWRjGeGC7Cs6oiOPs16MLczsT6lQQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712548916; a=rsa-sha256; cv=none; b=PqoAcHwU1fehJukey/LsTKFyShHW8N6dj/Ayj0fMcFAKT701vHtSXWDOZZZh0iR6FoV96F XGm7Q6tX9pWqQHkntvug0fA+28LHhVIK311p7HjXuF9Yx04azTDy0b+IMZNkjA0bhDdXU7 CvPoLl6To8qM9Cl2W4pY4CpLSFWIFJXMydfKgj5cR/WbztQDktkoECmvMkT87CPqW35/K9 QYYQgvBuEocPa5ABn08bIifCtivqreD6+qkXvIVoGSawtBwo7VdujegjodSZJ2uz5lTMhr wjWf1ADu3vlJu85Qwl242sBsM3vcIvwedkICM+KSzee12P8Peiqol3/IoW+afw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712548916; 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=5PoPDyJ/kVGZxdAb64oBPtSiqfz5ETdfv98Ym/O1pqE=; b=pjBrNMZT5MMxnBzY3q6ogSJKOuSvwvugApsFVPf2lhD3h7NXQFVj25BrzTRDmSAZ3gdZw9 qjQ6WenbDmszD5sOm074kScw+kMbfQvb6cKLFbz5Y4Ub8eEj8kJELQjAnHdY8QYEKxtPPS i0x/q18nMAh83fRCFWRdQfmnUREbJDJ9k3aeg1qWxViBlsqrIoPrFOqxRmvOPB1nkXO05o VwrSye59V9njhi+WxmWTZd0zeKV+IVigTMLQhAJOxV0xaQPNutOcPzjrnAq+v2u/gtTFNG 8yN7QJD8pBUyftiSCbIQnMlocZQNs663KIhq1yHiJucM/hM4EpV4zTnY6XN6TA== 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 4VCb4z6xw6zwJ3; Mon, 8 Apr 2024 04:01:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43841trt061591; Mon, 8 Apr 2024 04:01:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43841t88061588; Mon, 8 Apr 2024 04:01:55 GMT (envelope-from git) Date: Mon, 8 Apr 2024 04:01:55 GMT Message-Id: <202404080401.43841t88061588@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Xin LI Subject: git: 2bfda18ff7bf - stable/14 - Backport export of lzma_mt_block_size symbol. 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: delphij X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 2bfda18ff7bfbf8e3710c15aa312f6e9d2e7cb66 Auto-Submitted: auto-generated The branch stable/14 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=2bfda18ff7bfbf8e3710c15aa312f6e9d2e7cb66 commit 2bfda18ff7bfbf8e3710c15aa312f6e9d2e7cb66 Author: Xin LI AuthorDate: 2024-04-05 06:39:33 +0000 Commit: Xin LI CommitDate: 2024-04-08 04:01:25 +0000 Backport export of lzma_mt_block_size symbol. This restores binary compatibility against liblzma 5.6.0 library. PR: 278127 (cherry picked from commit 5ffb19ac36c4b5c9e72d69048250c8e56acff739) --- contrib/xz/src/liblzma/api/lzma/container.h | 28 +++++++++++++++++++++++ contrib/xz/src/liblzma/common/filter_encoder.c | 16 ++++++++----- contrib/xz/src/liblzma/common/filter_encoder.h | 6 +---- contrib/xz/src/liblzma/common/stream_encoder_mt.c | 20 ++++++++-------- contrib/xz/src/liblzma/liblzma_generic.map | 5 ++++ contrib/xz/src/liblzma/liblzma_linux.map | 5 ++++ contrib/xz/src/liblzma/lz/lz_encoder.c | 4 +--- contrib/xz/src/liblzma/lz/lz_encoder.h | 8 +++++++ contrib/xz/src/liblzma/lzma/lzma2_encoder.c | 3 +++ lib/liblzma/Symbol.map | 5 +++- lib/liblzma/Versions.def | 5 +++- 11 files changed, 78 insertions(+), 27 deletions(-) diff --git a/contrib/xz/src/liblzma/api/lzma/container.h b/contrib/xz/src/liblzma/api/lzma/container.h index 2849fbfd3c51..4cbb1b7bf7b4 100644 --- a/contrib/xz/src/liblzma/api/lzma/container.h +++ b/contrib/xz/src/liblzma/api/lzma/container.h @@ -435,6 +435,34 @@ extern LZMA_API(lzma_ret) lzma_stream_encoder_mt( lzma_nothrow lzma_attr_warn_unused_result; +/** + * \brief Calculate recommended Block size for multithreaded .xz encoder + * + * This calculates a recommended Block size for multithreaded encoding given + * a filter chain. This is used internally by lzma_stream_encoder_mt() to + * determine the Block size if the block_size member is not set to the + * special value of 0 in the lzma_mt options struct. + * + * If one wishes to change the filters between Blocks, this function is + * helpful to set the block_size member of the lzma_mt struct before calling + * lzma_stream_encoder_mt(). Since the block_size member represents the + * maximum possible Block size for the multithreaded .xz encoder, one can + * use this function to find the maximum recommended Block size based on + * all planned filter chains. Otherwise, the multithreaded encoder will + * base its maximum Block size on the first filter chain used (if the + * block_size member is not set), which may unnecessarily limit the Block + * size for a later filter chain. + * + * \param filters Array of filters terminated with + * .id == LZMA_VLI_UNKNOWN. + * + * \return Recommended Block size in bytes, or UINT64_MAX if + * an error occurred. + */ +extern LZMA_API(uint64_t) lzma_mt_block_size(const lzma_filter *filters) + lzma_nothrow; + + /** * \brief Initialize .lzma encoder (legacy file format) * diff --git a/contrib/xz/src/liblzma/common/filter_encoder.c b/contrib/xz/src/liblzma/common/filter_encoder.c index 46fe8af1c153..0699bcee62a4 100644 --- a/contrib/xz/src/liblzma/common/filter_encoder.c +++ b/contrib/xz/src/liblzma/common/filter_encoder.c @@ -33,7 +33,8 @@ typedef struct { /// Calculates the recommended Uncompressed Size for .xz Blocks to /// which the input data can be split to make multithreaded /// encoding possible. If this is NULL, it is assumed that - /// the encoder is fast enough with single thread. + /// the encoder is fast enough with single thread. If the options + /// are invalid, UINT64_MAX is returned. uint64_t (*block_size)(const void *options); /// Tells the size of the Filter Properties field. If options are @@ -248,26 +249,29 @@ lzma_raw_encoder_memusage(const lzma_filter *filters) } -extern uint64_t +extern LZMA_API(uint64_t) lzma_mt_block_size(const lzma_filter *filters) { + if (filters == NULL) + return UINT64_MAX; + uint64_t max = 0; for (size_t i = 0; filters[i].id != LZMA_VLI_UNKNOWN; ++i) { const lzma_filter_encoder *const fe = encoder_find(filters[i].id); + if (fe == NULL) + return UINT64_MAX; + if (fe->block_size != NULL) { const uint64_t size = fe->block_size(filters[i].options); - if (size == 0) - return 0; - if (size > max) max = size; } } - return max; + return max == 0 ? UINT64_MAX : max; } diff --git a/contrib/xz/src/liblzma/common/filter_encoder.h b/contrib/xz/src/liblzma/common/filter_encoder.h index f1d5683fe793..da92be8b34da 100644 --- a/contrib/xz/src/liblzma/common/filter_encoder.h +++ b/contrib/xz/src/liblzma/common/filter_encoder.h @@ -1,6 +1,6 @@ /////////////////////////////////////////////////////////////////////////////// // -/// \file filter_encoder.c +/// \file filter_encoder.h /// \brief Filter ID mapping to filter-specific functions // // Author: Lasse Collin @@ -16,10 +16,6 @@ #include "common.h" -// FIXME: Might become a part of the public API. -extern uint64_t lzma_mt_block_size(const lzma_filter *filters); - - extern lzma_ret lzma_raw_encoder_init( lzma_next_coder *next, const lzma_allocator *allocator, const lzma_filter *filters); diff --git a/contrib/xz/src/liblzma/common/stream_encoder_mt.c b/contrib/xz/src/liblzma/common/stream_encoder_mt.c index f64de9bdbc57..64de526b6a17 100644 --- a/contrib/xz/src/liblzma/common/stream_encoder_mt.c +++ b/contrib/xz/src/liblzma/common/stream_encoder_mt.c @@ -979,20 +979,18 @@ get_options(const lzma_mt *options, lzma_options_easy *opt_easy, *filters = opt_easy->filters; } - // Block size - if (options->block_size > 0) { - if (options->block_size > BLOCK_SIZE_MAX) - return LZMA_OPTIONS_ERROR; - + // If the Block size is not set, determine it from the filter chain. + if (options->block_size > 0) *block_size = options->block_size; - } else { - // Determine the Block size from the filter chain. + else *block_size = lzma_mt_block_size(*filters); - if (*block_size == 0) - return LZMA_OPTIONS_ERROR; - assert(*block_size <= BLOCK_SIZE_MAX); - } + // UINT64_MAX > BLOCK_SIZE_MAX, so the second condition + // should be optimized out by any reasonable compiler. + // The second condition should be there in the unlikely event that + // the macros change and UINT64_MAX < BLOCK_SIZE_MAX. + if (*block_size > BLOCK_SIZE_MAX || *block_size == UINT64_MAX) + return LZMA_OPTIONS_ERROR; // Calculate the maximum amount output that a single output buffer // may need to hold. This is the same as the maximum total size of diff --git a/contrib/xz/src/liblzma/liblzma_generic.map b/contrib/xz/src/liblzma/liblzma_generic.map index bb82167ed57a..b251d366e15c 100644 --- a/contrib/xz/src/liblzma/liblzma_generic.map +++ b/contrib/xz/src/liblzma/liblzma_generic.map @@ -119,3 +119,8 @@ global: lzma_str_list_filters; lzma_str_to_filters; } XZ_5.2; + +XZ_5.5.0alpha { +global: + lzma_mt_block_size; +} XZ_5.4; diff --git a/contrib/xz/src/liblzma/liblzma_linux.map b/contrib/xz/src/liblzma/liblzma_linux.map index 449f5fd682db..25b393883693 100644 --- a/contrib/xz/src/liblzma/liblzma_linux.map +++ b/contrib/xz/src/liblzma/liblzma_linux.map @@ -134,3 +134,8 @@ global: lzma_str_list_filters; lzma_str_to_filters; } XZ_5.2; + +XZ_5.5.0alpha { +global: + lzma_mt_block_size; +} XZ_5.4; diff --git a/contrib/xz/src/liblzma/lz/lz_encoder.c b/contrib/xz/src/liblzma/lz/lz_encoder.c index 5489085a0860..8e724a035a13 100644 --- a/contrib/xz/src/liblzma/lz/lz_encoder.c +++ b/contrib/xz/src/liblzma/lz/lz_encoder.c @@ -196,9 +196,7 @@ lz_encoder_prepare(lzma_mf *mf, const lzma_allocator *allocator, // For now, the dictionary size is limited to 1.5 GiB. This may grow // in the future if needed, but it needs a little more work than just // changing this check. - if (lz_options->dict_size < LZMA_DICT_SIZE_MIN - || lz_options->dict_size - > (UINT32_C(1) << 30) + (UINT32_C(1) << 29) + if (!IS_ENC_DICT_SIZE_VALID(lz_options->dict_size) || lz_options->nice_len > lz_options->match_len_max) return true; diff --git a/contrib/xz/src/liblzma/lz/lz_encoder.h b/contrib/xz/src/liblzma/lz/lz_encoder.h index ffcba02ce931..b71f11805e50 100644 --- a/contrib/xz/src/liblzma/lz/lz_encoder.h +++ b/contrib/xz/src/liblzma/lz/lz_encoder.h @@ -17,6 +17,14 @@ #include "common.h" +// For now, the dictionary size is limited to 1.5 GiB. This may grow +// in the future if needed, but it needs a little more work than just +// changing this check. +#define IS_ENC_DICT_SIZE_VALID(size) \ + ((size) >= LZMA_DICT_SIZE_MIN \ + && (size) <= (UINT32_C(1) << 30) + (UINT32_C(1) << 29)) + + /// A table of these is used by the LZ-based encoder to hold /// the length-distance pairs found by the match finder. typedef struct { diff --git a/contrib/xz/src/liblzma/lzma/lzma2_encoder.c b/contrib/xz/src/liblzma/lzma/lzma2_encoder.c index 4b6b23118d70..5043a07e0fdf 100644 --- a/contrib/xz/src/liblzma/lzma/lzma2_encoder.c +++ b/contrib/xz/src/liblzma/lzma/lzma2_encoder.c @@ -409,6 +409,9 @@ lzma_lzma2_block_size(const void *options) { const lzma_options_lzma *const opt = options; + if (!IS_ENC_DICT_SIZE_VALID(opt->dict_size)) + return UINT64_MAX; + // Use at least 1 MiB to keep compression ratio better. return my_max((uint64_t)(opt->dict_size) * 3, UINT64_C(1) << 20); } diff --git a/lib/liblzma/Symbol.map b/lib/liblzma/Symbol.map index 9532da0a5bde..938b6191b4f4 100644 --- a/lib/liblzma/Symbol.map +++ b/lib/liblzma/Symbol.map @@ -114,6 +114,10 @@ XZ_5.4 { lzma_str_to_filters; }; +XZ_5.6 { + lzma_mt_block_size; +}; + XZprivate_1.0 { lzma_alloc; lzma_alloc_zero; @@ -173,7 +177,6 @@ XZprivate_1.0 { lzma_mf_hc3_skip; lzma_mf_hc4_find; lzma_mf_hc4_skip; - lzma_mt_block_size; lzma_next_end; lzma_next_filter_init; lzma_next_filter_update; diff --git a/lib/liblzma/Versions.def b/lib/liblzma/Versions.def index dea89514beda..25064d9d50e7 100644 --- a/lib/liblzma/Versions.def +++ b/lib/liblzma/Versions.def @@ -8,6 +8,9 @@ XZ_5.2 { XZ_5.4 { } XZ_5.2; -XZprivate_1.0 { +XZ_5.6 { } XZ_5.4; +XZprivate_1.0 { +} XZ_5.6; + From nobody Mon Apr 8 04:06:28 2024 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 4VCbBF1SNJz5G3Y3; Mon, 8 Apr 2024 04:06: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 4VCbBF1CH3z4ZXc; Mon, 8 Apr 2024 04:06:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712549189; 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=KcYJWVG6po4N+2+19V4O/g/RlGW0/ZeIPgwLeRr2sh0=; b=HzJwCM1M4KkbJY6SQxKBv1eBjE6YPKmSP9U5P11aJhFMyWN5sr6K8o4AWHdfzNK7MBTfhn XNhAVooELmdwJmHcAUPlheM7zaEceivh7+CsZtkUiB2T/RZkxIBX062hThuOXHxOY++hbV B7Cd9uWQrZlJZXvp/q3vMV+aILWUKhPOudGrmUySpjc45gzyhEAK1aALMENFR4HRWaK5pr /Gvh3jSUglMr40cYkYbkTIaDnUSnVfdqO2okVD1Q17PdCJ+Lh6I4P7Pv3vAmhS8k8jWahe oF14q0R/E+tro33JFJnMJYYgelIEPbFxsuRr4m4lpyq/dMET0VzWZyx6ichGpA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712549189; a=rsa-sha256; cv=none; b=cHf7ITB1uFPxiuszr0Hyx7LTdnInbUVz/INl9lqqJMeJyuMTHIF67NqrIEUxAamqHmFuOB xhtskJJmTLTUELt14Hqghj0RqigdxRhvKilYzylIjZ9/M3Y+sk+L/Gy1FwwAXhSkhm5LU5 cC+HUUzxXu7wx4ZhZu19/RCpBLeCA5689pZzRIKTw6s6LoUZzrCorXgoTpEJEOaIYfSI3d DN81VtKnT3OnSYTCB+cHX1llLxJt+lW0YmOkZKMSMzRqAclJwhH+50XidbipYE1ORIni/p hIk3yv4EoHOGvOrLS/r/d9WJyp2HqLJuHrpK3Kk2TCVUzmgu5W4H66dhcBHAIg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712549189; 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=KcYJWVG6po4N+2+19V4O/g/RlGW0/ZeIPgwLeRr2sh0=; b=Ff8/VL+pZ+Xqv9dEyy3rVIhPVWArymAcmMTkVy8XAFHii07WsanP/AofWhZgidQKEEj4OQ K/4GlqUIX91A1Wji5+EWBECo0cAVNiB8JVtdPQ5FQL95y/y3aIgjqP2V1Dhvt8the5ZFfB pxvpdwrz+xk34KLMRaVKfrLOKVt/NVCzI8FdN60XSn54QVCs/o47VINAKRuWn8VqOYd55A +36mZue024oNSgCqmQTHOD++vNS22hx9fVjn1P5iKTvwQY5zaBElEvKmXRfqENSdJWnScV dX76g9oG5B4nKIrQzsj6fTYm3HteG0g1fUUBhunz+dqae9YWk2S5tAE+BvJzxQ== 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 4VCbBF0Sq4zwVZ; Mon, 8 Apr 2024 04:06:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43846SoO062337; Mon, 8 Apr 2024 04:06:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43846ScV062334; Mon, 8 Apr 2024 04:06:28 GMT (envelope-from git) Date: Mon, 8 Apr 2024 04:06:28 GMT Message-Id: <202404080406.43846ScV062334@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Xin LI Subject: git: 6b55e41b3fac - stable/13 - Revert "MFV: xz 5.6.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: delphij X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6b55e41b3fac3102d82864f926636c23df46bba9 Auto-Submitted: auto-generated The branch stable/13 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=6b55e41b3fac3102d82864f926636c23df46bba9 commit 6b55e41b3fac3102d82864f926636c23df46bba9 Author: Xin LI AuthorDate: 2024-04-05 06:39:23 +0000 Commit: Xin LI CommitDate: 2024-04-08 04:06:12 +0000 Revert "MFV: xz 5.6.0" This commit reverts 8db56defa766eacdbaf89a37f25b11a57fd9787a, rolling back the vendor import of xz 5.6.0 and restoring the package to version 5.4.5. The revert was not directly due to the attack (CVE-2024-3094): our import process have removed the test cases and build scripts that would have enabled the attack. However, reverting would help to reduce potential confusion and false positives from security scanners that assess risk based solely on version numbers. Another commit will follow to restore binary compatibility with the liblzma 5.6.0 library by making the previously private symbol (lzma_mt_block_size) public. PR: 278127 (cherry picked from commit 2f9cd13d6c1824633251fb4267c9752d3b044a45) --- contrib/xz/AUTHORS | 40 +- contrib/xz/COPYING | 116 +- contrib/xz/COPYING.0BSD | 11 - contrib/xz/COPYING.CC-BY-SA-4.0 | 427 - contrib/xz/ChangeLog | 16270 +++++++++++-------- contrib/xz/README | 43 +- contrib/xz/THANKS | 7 - contrib/xz/TODO | 4 + contrib/xz/doxygen/Doxyfile | 6 +- contrib/xz/doxygen/footer.html | 13 - contrib/xz/doxygen/update-doxygen | 6 +- contrib/xz/src/common/mythread.h | 28 +- contrib/xz/src/common/sysdefs.h | 18 +- contrib/xz/src/common/tuklib_common.h | 27 +- contrib/xz/src/common/tuklib_config.h | 2 - contrib/xz/src/common/tuklib_cpucores.c | 5 +- contrib/xz/src/common/tuklib_cpucores.h | 5 +- contrib/xz/src/common/tuklib_exit.c | 5 +- contrib/xz/src/common/tuklib_exit.h | 9 +- contrib/xz/src/common/tuklib_gettext.h | 5 +- contrib/xz/src/common/tuklib_integer.h | 7 +- contrib/xz/src/common/tuklib_mbstr.h | 5 +- contrib/xz/src/common/tuklib_mbstr_fw.c | 5 +- contrib/xz/src/common/tuklib_mbstr_width.c | 5 +- contrib/xz/src/common/tuklib_open_stdxxx.c | 5 +- contrib/xz/src/common/tuklib_open_stdxxx.h | 5 +- contrib/xz/src/common/tuklib_physmem.c | 25 +- contrib/xz/src/common/tuklib_physmem.h | 5 +- contrib/xz/src/common/tuklib_progname.c | 5 +- contrib/xz/src/common/tuklib_progname.h | 5 +- contrib/xz/src/liblzma/api/lzma.h | 31 +- contrib/xz/src/liblzma/api/lzma/base.h | 23 +- contrib/xz/src/liblzma/api/lzma/bcj.h | 10 +- contrib/xz/src/liblzma/api/lzma/block.h | 5 +- contrib/xz/src/liblzma/api/lzma/check.h | 5 +- contrib/xz/src/liblzma/api/lzma/container.h | 43 +- contrib/xz/src/liblzma/api/lzma/delta.h | 5 +- contrib/xz/src/liblzma/api/lzma/filter.h | 11 +- contrib/xz/src/liblzma/api/lzma/hardware.h | 5 +- contrib/xz/src/liblzma/api/lzma/index.h | 36 +- contrib/xz/src/liblzma/api/lzma/index_hash.h | 5 +- contrib/xz/src/liblzma/api/lzma/lzma12.h | 7 +- contrib/xz/src/liblzma/api/lzma/stream_flags.h | 5 +- contrib/xz/src/liblzma/api/lzma/version.h | 9 +- contrib/xz/src/liblzma/api/lzma/vli.h | 5 +- contrib/xz/src/liblzma/check/check.c | 5 +- contrib/xz/src/liblzma/check/check.h | 5 +- contrib/xz/src/liblzma/check/crc32_arm64.h | 119 - contrib/xz/src/liblzma/check/crc32_fast.c | 187 +- contrib/xz/src/liblzma/check/crc32_small.c | 5 +- contrib/xz/src/liblzma/check/crc32_table.c | 36 +- contrib/xz/src/liblzma/check/crc32_table_be.h | 4 +- contrib/xz/src/liblzma/check/crc32_table_le.h | 4 +- contrib/xz/src/liblzma/check/crc32_tablegen.c | 21 +- contrib/xz/src/liblzma/check/crc32_x86.S | 5 +- contrib/xz/src/liblzma/check/crc64_fast.c | 450 +- contrib/xz/src/liblzma/check/crc64_small.c | 5 +- contrib/xz/src/liblzma/check/crc64_table.c | 16 +- contrib/xz/src/liblzma/check/crc64_table_be.h | 4 +- contrib/xz/src/liblzma/check/crc64_table_le.h | 4 +- contrib/xz/src/liblzma/check/crc64_tablegen.c | 13 +- contrib/xz/src/liblzma/check/crc64_x86.S | 5 +- contrib/xz/src/liblzma/check/crc_common.h | 143 - contrib/xz/src/liblzma/check/crc_macros.h | 30 + contrib/xz/src/liblzma/check/crc_x86_clmul.h | 435 - contrib/xz/src/liblzma/common/alone_decoder.c | 5 +- contrib/xz/src/liblzma/common/alone_decoder.h | 5 +- contrib/xz/src/liblzma/common/alone_encoder.c | 5 +- contrib/xz/src/liblzma/common/auto_decoder.c | 5 +- .../xz/src/liblzma/common/block_buffer_decoder.c | 5 +- .../xz/src/liblzma/common/block_buffer_encoder.c | 5 +- .../xz/src/liblzma/common/block_buffer_encoder.h | 5 +- contrib/xz/src/liblzma/common/block_decoder.c | 5 +- contrib/xz/src/liblzma/common/block_decoder.h | 5 +- contrib/xz/src/liblzma/common/block_encoder.c | 5 +- contrib/xz/src/liblzma/common/block_encoder.h | 5 +- .../xz/src/liblzma/common/block_header_decoder.c | 5 +- .../xz/src/liblzma/common/block_header_encoder.c | 5 +- contrib/xz/src/liblzma/common/block_util.c | 5 +- contrib/xz/src/liblzma/common/common.c | 5 +- contrib/xz/src/liblzma/common/common.h | 5 +- .../xz/src/liblzma/common/easy_buffer_encoder.c | 5 +- .../xz/src/liblzma/common/easy_decoder_memusage.c | 5 +- contrib/xz/src/liblzma/common/easy_encoder.c | 5 +- .../xz/src/liblzma/common/easy_encoder_memusage.c | 5 +- contrib/xz/src/liblzma/common/easy_preset.c | 5 +- contrib/xz/src/liblzma/common/easy_preset.h | 5 +- contrib/xz/src/liblzma/common/file_info.c | 5 +- .../xz/src/liblzma/common/filter_buffer_decoder.c | 5 +- .../xz/src/liblzma/common/filter_buffer_encoder.c | 5 +- contrib/xz/src/liblzma/common/filter_common.c | 14 +- contrib/xz/src/liblzma/common/filter_common.h | 5 +- contrib/xz/src/liblzma/common/filter_decoder.c | 13 +- contrib/xz/src/liblzma/common/filter_decoder.h | 5 +- contrib/xz/src/liblzma/common/filter_encoder.c | 39 +- contrib/xz/src/liblzma/common/filter_encoder.h | 11 +- .../xz/src/liblzma/common/filter_flags_decoder.c | 5 +- .../xz/src/liblzma/common/filter_flags_encoder.c | 5 +- .../xz/src/liblzma/common/hardware_cputhreads.c | 5 +- contrib/xz/src/liblzma/common/hardware_physmem.c | 5 +- contrib/xz/src/liblzma/common/index.c | 5 +- contrib/xz/src/liblzma/common/index.h | 5 +- contrib/xz/src/liblzma/common/index_decoder.c | 5 +- contrib/xz/src/liblzma/common/index_decoder.h | 5 +- contrib/xz/src/liblzma/common/index_encoder.c | 5 +- contrib/xz/src/liblzma/common/index_encoder.h | 5 +- contrib/xz/src/liblzma/common/index_hash.c | 5 +- contrib/xz/src/liblzma/common/lzip_decoder.c | 5 +- contrib/xz/src/liblzma/common/lzip_decoder.h | 5 +- contrib/xz/src/liblzma/common/memcmplen.h | 24 +- contrib/xz/src/liblzma/common/microlzma_decoder.c | 5 +- contrib/xz/src/liblzma/common/microlzma_encoder.c | 5 +- contrib/xz/src/liblzma/common/outqueue.c | 5 +- contrib/xz/src/liblzma/common/outqueue.h | 5 +- .../xz/src/liblzma/common/stream_buffer_decoder.c | 5 +- .../xz/src/liblzma/common/stream_buffer_encoder.c | 5 +- contrib/xz/src/liblzma/common/stream_decoder.c | 5 +- contrib/xz/src/liblzma/common/stream_decoder.h | 5 +- contrib/xz/src/liblzma/common/stream_decoder_mt.c | 5 +- contrib/xz/src/liblzma/common/stream_encoder.c | 5 +- contrib/xz/src/liblzma/common/stream_encoder_mt.c | 25 +- .../xz/src/liblzma/common/stream_flags_common.c | 5 +- .../xz/src/liblzma/common/stream_flags_common.h | 5 +- .../xz/src/liblzma/common/stream_flags_decoder.c | 5 +- .../xz/src/liblzma/common/stream_flags_encoder.c | 5 +- contrib/xz/src/liblzma/common/string_conversion.c | 14 +- contrib/xz/src/liblzma/common/vli_decoder.c | 5 +- contrib/xz/src/liblzma/common/vli_encoder.c | 5 +- contrib/xz/src/liblzma/common/vli_size.c | 5 +- contrib/xz/src/liblzma/delta/delta_common.c | 5 +- contrib/xz/src/liblzma/delta/delta_common.h | 5 +- contrib/xz/src/liblzma/delta/delta_decoder.c | 5 +- contrib/xz/src/liblzma/delta/delta_decoder.h | 5 +- contrib/xz/src/liblzma/delta/delta_encoder.c | 5 +- contrib/xz/src/liblzma/delta/delta_encoder.h | 5 +- contrib/xz/src/liblzma/delta/delta_private.h | 5 +- contrib/xz/src/liblzma/liblzma.pc.in | 6 +- contrib/xz/src/liblzma/liblzma_generic.map | 7 - contrib/xz/src/liblzma/liblzma_linux.map | 7 - contrib/xz/src/liblzma/lz/lz_decoder.c | 48 +- contrib/xz/src/liblzma/lz/lz_decoder.h | 116 +- contrib/xz/src/liblzma/lz/lz_encoder.c | 13 +- contrib/xz/src/liblzma/lz/lz_encoder.h | 21 +- contrib/xz/src/liblzma/lz/lz_encoder_hash.h | 5 +- contrib/xz/src/liblzma/lz/lz_encoder_hash_table.h | 4 +- contrib/xz/src/liblzma/lz/lz_encoder_mf.c | 5 +- contrib/xz/src/liblzma/lzma/fastpos.h | 5 +- contrib/xz/src/liblzma/lzma/fastpos_table.c | 4 +- contrib/xz/src/liblzma/lzma/fastpos_tablegen.c | 17 +- contrib/xz/src/liblzma/lzma/lzma2_decoder.c | 5 +- contrib/xz/src/liblzma/lzma/lzma2_decoder.h | 5 +- contrib/xz/src/liblzma/lzma/lzma2_encoder.c | 8 +- contrib/xz/src/liblzma/lzma/lzma2_encoder.h | 5 +- contrib/xz/src/liblzma/lzma/lzma_common.h | 41 +- contrib/xz/src/liblzma/lzma/lzma_decoder.c | 760 +- contrib/xz/src/liblzma/lzma/lzma_decoder.h | 5 +- contrib/xz/src/liblzma/lzma/lzma_encoder.c | 18 +- contrib/xz/src/liblzma/lzma/lzma_encoder.h | 5 +- .../src/liblzma/lzma/lzma_encoder_optimum_fast.c | 5 +- .../src/liblzma/lzma/lzma_encoder_optimum_normal.c | 7 +- contrib/xz/src/liblzma/lzma/lzma_encoder_presets.c | 5 +- contrib/xz/src/liblzma/lzma/lzma_encoder_private.h | 9 +- contrib/xz/src/liblzma/rangecoder/price.h | 5 +- contrib/xz/src/liblzma/rangecoder/price_table.c | 4 +- contrib/xz/src/liblzma/rangecoder/price_tablegen.c | 22 +- contrib/xz/src/liblzma/rangecoder/range_common.h | 14 +- contrib/xz/src/liblzma/rangecoder/range_decoder.h | 838 +- contrib/xz/src/liblzma/rangecoder/range_encoder.h | 5 +- contrib/xz/src/liblzma/simple/arm.c | 5 +- contrib/xz/src/liblzma/simple/arm64.c | 5 +- contrib/xz/src/liblzma/simple/armthumb.c | 5 +- contrib/xz/src/liblzma/simple/ia64.c | 5 +- contrib/xz/src/liblzma/simple/powerpc.c | 5 +- contrib/xz/src/liblzma/simple/riscv.c | 755 - contrib/xz/src/liblzma/simple/simple_coder.c | 5 +- contrib/xz/src/liblzma/simple/simple_coder.h | 14 +- contrib/xz/src/liblzma/simple/simple_decoder.c | 5 +- contrib/xz/src/liblzma/simple/simple_decoder.h | 5 +- contrib/xz/src/liblzma/simple/simple_encoder.c | 5 +- contrib/xz/src/liblzma/simple/simple_encoder.h | 5 +- contrib/xz/src/liblzma/simple/simple_private.h | 5 +- contrib/xz/src/liblzma/simple/sparc.c | 5 +- contrib/xz/src/liblzma/simple/x86.c | 5 +- contrib/xz/src/liblzma/validate_map.sh | 6 +- contrib/xz/src/lzmainfo/lzmainfo.1 | 4 +- contrib/xz/src/lzmainfo/lzmainfo.c | 5 +- contrib/xz/src/xz/args.c | 159 +- contrib/xz/src/xz/args.h | 8 +- contrib/xz/src/xz/coder.c | 648 +- contrib/xz/src/xz/coder.h | 31 +- contrib/xz/src/xz/file_io.c | 144 +- contrib/xz/src/xz/file_io.h | 21 +- contrib/xz/src/xz/hardware.c | 11 +- contrib/xz/src/xz/hardware.h | 5 +- contrib/xz/src/xz/list.c | 31 +- contrib/xz/src/xz/list.h | 5 +- contrib/xz/src/xz/main.c | 91 +- contrib/xz/src/xz/main.h | 5 +- contrib/xz/src/xz/message.c | 94 +- contrib/xz/src/xz/message.h | 15 +- contrib/xz/src/xz/mytime.c | 105 +- contrib/xz/src/xz/mytime.h | 11 +- contrib/xz/src/xz/options.c | 7 +- contrib/xz/src/xz/options.h | 5 +- contrib/xz/src/xz/private.h | 26 +- contrib/xz/src/xz/sandbox.c | 355 - contrib/xz/src/xz/sandbox.h | 43 - contrib/xz/src/xz/signals.c | 22 +- contrib/xz/src/xz/signals.h | 5 +- contrib/xz/src/xz/suffix.c | 17 +- contrib/xz/src/xz/suffix.h | 5 +- contrib/xz/src/xz/util.c | 36 +- contrib/xz/src/xz/util.h | 19 +- contrib/xz/src/xz/xz.1 | 439 +- contrib/xz/src/xzdec/xzdec.1 | 8 +- contrib/xz/src/xzdec/xzdec.c | 160 +- lib/liblzma/Makefile | 1 - lib/liblzma/Symbol.map | 5 +- lib/liblzma/Versions.def | 5 +- lib/liblzma/config.h | 120 +- usr.bin/xz/Makefile | 1 - 221 files changed, 11311 insertions(+), 13505 deletions(-) diff --git a/contrib/xz/AUTHORS b/contrib/xz/AUTHORS index 5012d0e01e83..69bbfc3ef609 100644 --- a/contrib/xz/AUTHORS +++ b/contrib/xz/AUTHORS @@ -9,13 +9,15 @@ Authors of XZ Utils specifically the LZMA SDK . Without this code, XZ Utils wouldn't exist. - The SHA-256 implementation in liblzma is based on code written by - Wei Dai in Crypto++ Library . + The SHA-256 implementation in liblzma is based on the code found from + 7-Zip , which has a modified version of the SHA-256 + code found from Crypto++ . The SHA-256 code + in Crypto++ was written by Kevin Springle and Wei Dai. - A few scripts have been adapted from GNU gzip. The original - versions were written by Jean-loup Gailly, Charles Levert, and - Paul Eggert. Andrew Dudman helped adapting the scripts and their - man pages for XZ Utils. + Some scripts have been adapted from gzip. The original versions + were written by Jean-loup Gailly, Charles Levert, and Paul Eggert. + Andrew Dudman helped adapting the scripts and their man pages for + XZ Utils. The initial version of the threaded .xz decompressor was written by Sebastian Andrzej Siewior. @@ -23,31 +25,15 @@ Authors of XZ Utils The initial version of the .lz (lzip) decoder was written by Michał Górny. - Architecture-specific CRC optimizations were contributed by - Ilya Kurdyukov, Hans Jansen, and Chenxi Mao. + CLMUL-accelerated CRC code was contributed by Ilya Kurdyukov. Other authors: - Jonathan Nieder - Joachim Henke - Many people have contributed improvements or reported bugs. - Most of these people are mentioned in the file THANKS. + The GNU Autotools-based build system contains files from many authors, + which I'm not trying to list here. - The translations of the command line tools and man pages have been - contributed by many people via the Translation Project: - - - https://translationproject.org/domain/xz.html - - https://translationproject.org/domain/xz-man.html - - The authors of the translated man pages are in the header comments - of the man page files. In the source package, the authors of the - translations are in po/*.po and po4a/*.po files. - - Third-party code whose authors aren't listed here: - - - GNU getopt_long() in the 'lib' directory is included for - platforms that don't have a usable getopt_long(). - - - The build system files from GNU Autoconf, GNU Automake, - GNU Libtool, GNU Gettext, Autoconf Archive, and related files. + Several people have contributed fixes or reported bugs. Most of them + are mentioned in the file THANKS. diff --git a/contrib/xz/COPYING b/contrib/xz/COPYING index a31477d62d31..e54eeacfbf3f 100644 --- a/contrib/xz/COPYING +++ b/contrib/xz/COPYING @@ -6,95 +6,71 @@ XZ Utils Licensing is a rough summary of which licenses apply to which parts of this package (but check the individual files to be sure!): - - liblzma is under the BSD Zero Clause License (0BSD). + - liblzma is in the public domain. - - The command line tools xz, xzdec, lzmadec, and lzmainfo are - under 0BSD except that, on systems that don't have a usable - getopt_long, GNU getopt_long is compiled and linked in from the - 'lib' directory. The getopt_long code is under GNU LGPLv2.1+. + - xz, xzdec, and lzmadec command line tools are in the public + domain unless GNU getopt_long had to be compiled and linked + in from the lib directory. The getopt_long code is under + GNU LGPLv2.1+. - The scripts to grep, diff, and view compressed files have been - adapted from GNU gzip. These scripts (xzgrep, xzdiff, xzless, - and xzmore) are under GNU GPLv2+. The man pages of the scripts - are under 0BSD; they aren't based on the man pages of GNU gzip. - - - Most of the XZ Utils specific documentation that is in - plain text files (like README, INSTALL, PACKAGERS, NEWS, - and ChangeLog) are under 0BSD unless stated otherwise in - the file itself. The files xz-file-format.txt and - lzma-file-format.xt are in the public domain but may - be distributed under the terms of 0BSD too. - - - Doxygen-generated HTML version of the liblzma API documentation: - While Doxygen is under the GNU GPLv2, the license information - in Doxygen includes the following exception: - - Documents produced by doxygen are derivative works - derived from the input used in their production; - they are not affected by this license. + adapted from gzip. These scripts and their documentation are + under GNU GPLv2+. + + - All the documentation in the doc directory and most of the + XZ Utils specific documentation files in other directories + are in the public domain. Note: The JavaScript files (under the MIT license) have - been removed from the Doxygen output. + been removed from the Doxygen-generated HTML version of the + liblzma API documentation. Doxygen itself is under the GNU GPL + but the remaining files generated by Doxygen are not affected + by the licenses used in Doxygen because Doxygen licensing has + the following exception: - - The XZ logo (xz-logo.png) included in the Doxygen-generated - documentation is under the Creative Commons BY-SA 4.0 license. + "Documents produced by doxygen are derivative works + derived from the input used in their production; + they are not affected by this license." - - Translated messages and man pages are under 0BSD except that - some old translations are in the public domain. + - Translated messages are in the public domain. - - Test files and test code in the 'tests' directory, and - debugging utilities in the 'debug' directory are under - the BSD Zero Clause License (0BSD). + - The build system contains public domain files, and files that + are under GNU GPLv2+ or GNU GPLv3+. None of these files end up + in the binaries being built. - - The GNU Autotools based build system contains files that are - under GNU GPLv2+, GNU GPLv3+, and a few permissive licenses. - These files don't affect the licensing of the binaries being - built. + - Test files and test code in the tests directory, and debugging + utilities in the debug directory are in the public domain. - - The extra directory contain files that are under various - free software licenses. + - The extra directory may contain public domain files, and files + that are under various free software licenses. - For the files under the BSD Zero Clause License (0BSD), if - a copyright notice is needed, the following is sufficient: + You can do whatever you want with the files that have been put into + the public domain. If you find public domain legally problematic, + take the previous sentence as a license grant. If you still find + the lack of copyright legally problematic, you have too many + lawyers. - Copyright (C) The XZ Utils authors and contributors + As usual, this software is provided "as is", without any warranty. - If you copy significant amounts of 0BSD-licensed code from XZ Utils + If you copy significant amounts of public domain code from XZ Utils into your project, acknowledging this somewhere in your software is polite (especially if it is proprietary, non-free software), but - it is not legally required by the license terms. Here is an example - of a good notice to put into "about box" or into documentation: + naturally it is not legally required. Here is an example of a good + notice to put into "about box" or into documentation: - This software includes code from XZ Utils - . + This software includes code from XZ Utils . The following license texts are included in the following files: - - COPYING.0BSD: BSD Zero Clause License - COPYING.LGPLv2.1: GNU Lesser General Public License version 2.1 - COPYING.GPLv2: GNU General Public License version 2 - COPYING.GPLv3: GNU General Public License version 3 - - COPYING.CC-BY-SA-4.0: Creative Commons Attribution-ShareAlike 4.0 - International Public License - - A note about old XZ Utils releases: - - XZ Utils releases 5.4.6 and older and 5.5.1alpha have a - significant amount of code put into the public domain and - that obviously remains so. The switch from public domain to - 0BSD for newer releases was made in Febrary 2024 because - public domain has (real or perceived) legal ambiguities in - some jurisdictions. - - There is very little *practical* difference between public - domain and 0BSD. The main difference likely is that one - shouldn't claim that 0BSD-licensed code is in the public - domain; 0BSD-licensed code is copyrighted but available under - an extremely permissive license. Neither 0BSD nor public domain - require retaining or reproducing author, copyright holder, or - license notices when distributing the software. (Compare to, - for example, BSD 2-Clause "Simplified" License which does have - such requirements.) - - If you have questions, don't hesitate to ask for more information. - The contact information is in the README file. + + Note that the toolchain (compiler, linker etc.) may add some code + pieces that are copyrighted. Thus, it is possible that e.g. liblzma + binary wouldn't actually be in the public domain in its entirety + even though it contains no copyrighted code from the XZ Utils source + package. + + If you have questions, don't hesitate to ask the author(s) for more + information. diff --git a/contrib/xz/COPYING.0BSD b/contrib/xz/COPYING.0BSD deleted file mode 100644 index 4322122aecf1..000000000000 --- a/contrib/xz/COPYING.0BSD +++ /dev/null @@ -1,11 +0,0 @@ -Permission to use, copy, modify, and/or distribute this -software for any purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL -WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL -THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR -CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, -NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN -CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/contrib/xz/COPYING.CC-BY-SA-4.0 b/contrib/xz/COPYING.CC-BY-SA-4.0 deleted file mode 100644 index 7d4f96c54aa1..000000000000 --- a/contrib/xz/COPYING.CC-BY-SA-4.0 +++ /dev/null @@ -1,427 +0,0 @@ -Attribution-ShareAlike 4.0 International - -======================================================================= - -Creative Commons Corporation ("Creative Commons") is not a law firm and -does not provide legal services or legal advice. Distribution of -Creative Commons public licenses does not create a lawyer-client or -other relationship. Creative Commons makes its licenses and related -information available on an "as-is" basis. Creative Commons gives no -warranties regarding its licenses, any material licensed under their -terms and conditions, or any related information. Creative Commons -disclaims all liability for damages resulting from their use to the -fullest extent possible. - -Using Creative Commons Public Licenses - -Creative Commons public licenses provide a standard set of terms and -conditions that creators and other rights holders may use to share -original works of authorship and other material subject to copyright -and certain other rights specified in the public license below. The -following considerations are for informational purposes only, are not -exhaustive, and do not form part of our licenses. - - Considerations for licensors: Our public licenses are - intended for use by those authorized to give the public - permission to use material in ways otherwise restricted by - copyright and certain other rights. Our licenses are - irrevocable. Licensors should read and understand the terms - and conditions of the license they choose before applying it. - Licensors should also secure all rights necessary before - applying our licenses so that the public can reuse the - material as expected. Licensors should clearly mark any - material not subject to the license. This includes other CC- - licensed material, or material used under an exception or - limitation to copyright. More considerations for licensors: - wiki.creativecommons.org/Considerations_for_licensors - - Considerations for the public: By using one of our public - licenses, a licensor grants the public permission to use the - licensed material under specified terms and conditions. If - the licensor's permission is not necessary for any reason--for - example, because of any applicable exception or limitation to - copyright--then that use is not regulated by the license. Our - licenses grant only permissions under copyright and certain - other rights that a licensor has authority to grant. Use of - the licensed material may still be restricted for other - reasons, including because others have copyright or other - rights in the material. A licensor may make special requests, - such as asking that all changes be marked or described. - Although not required by our licenses, you are encouraged to - respect those requests where reasonable. More considerations - for the public: - wiki.creativecommons.org/Considerations_for_licensees - -======================================================================= - -Creative Commons Attribution-ShareAlike 4.0 International Public -License - -By exercising the Licensed Rights (defined below), You accept and agree -to be bound by the terms and conditions of this Creative Commons -Attribution-ShareAlike 4.0 International Public License ("Public -License"). To the extent this Public License may be interpreted as a -contract, You are granted the Licensed Rights in consideration of Your -acceptance of these terms and conditions, and the Licensor grants You -such rights in consideration of benefits the Licensor receives from -making the Licensed Material available under these terms and -conditions. - - -Section 1 -- Definitions. - - a. Adapted Material means material subject to Copyright and Similar - Rights that is derived from or based upon the Licensed Material - and in which the Licensed Material is translated, altered, - arranged, transformed, or otherwise modified in a manner requiring - permission under the Copyright and Similar Rights held by the - Licensor. For purposes of this Public License, where the Licensed - Material is a musical work, performance, or sound recording, - Adapted Material is always produced where the Licensed Material is - synched in timed relation with a moving image. - - b. Adapter's License means the license You apply to Your Copyright - and Similar Rights in Your contributions to Adapted Material in - accordance with the terms and conditions of this Public License. - - c. BY-SA Compatible License means a license listed at - creativecommons.org/compatiblelicenses, approved by Creative - Commons as essentially the equivalent of this Public License. - - d. Copyright and Similar Rights means copyright and/or similar rights - closely related to copyright including, without limitation, - performance, broadcast, sound recording, and Sui Generis Database - Rights, without regard to how the rights are labeled or - categorized. For purposes of this Public License, the rights - specified in Section 2(b)(1)-(2) are not Copyright and Similar - Rights. - - e. Effective Technological Measures means those measures that, in the - absence of proper authority, may not be circumvented under laws - fulfilling obligations under Article 11 of the WIPO Copyright - Treaty adopted on December 20, 1996, and/or similar international - agreements. - - f. Exceptions and Limitations means fair use, fair dealing, and/or - any other exception or limitation to Copyright and Similar Rights - that applies to Your use of the Licensed Material. - - g. License Elements means the license attributes listed in the name - of a Creative Commons Public License. The License Elements of this - Public License are Attribution and ShareAlike. - - h. Licensed Material means the artistic or literary work, database, - or other material to which the Licensor applied this Public - License. - - i. Licensed Rights means the rights granted to You subject to the - terms and conditions of this Public License, which are limited to - all Copyright and Similar Rights that apply to Your use of the - Licensed Material and that the Licensor has authority to license. - - j. Licensor means the individual(s) or entity(ies) granting rights - under this Public License. - - k. Share means to provide material to the public by any means or - process that requires permission under the Licensed Rights, such - as reproduction, public display, public performance, distribution, - dissemination, communication, or importation, and to make material - available to the public including in ways that members of the - public may access the material from a place and at a time - individually chosen by them. - - l. Sui Generis Database Rights means rights other than copyright - resulting from Directive 96/9/EC of the European Parliament and of - the Council of 11 March 1996 on the legal protection of databases, - as amended and/or succeeded, as well as other essentially - equivalent rights anywhere in the world. - - m. You means the individual or entity exercising the Licensed Rights - under this Public License. Your has a corresponding meaning. - - -Section 2 -- Scope. - - a. License grant. - - 1. Subject to the terms and conditions of this Public License, - the Licensor hereby grants You a worldwide, royalty-free, - non-sublicensable, non-exclusive, irrevocable license to - exercise the Licensed Rights in the Licensed Material to: - - a. reproduce and Share the Licensed Material, in whole or - in part; and - - b. produce, reproduce, and Share Adapted Material. - - 2. Exceptions and Limitations. For the avoidance of doubt, where - Exceptions and Limitations apply to Your use, this Public - License does not apply, and You do not need to comply with - its terms and conditions. - - 3. Term. The term of this Public License is specified in Section - 6(a). - - 4. Media and formats; technical modifications allowed. The - Licensor authorizes You to exercise the Licensed Rights in - all media and formats whether now known or hereafter created, - and to make technical modifications necessary to do so. The - Licensor waives and/or agrees not to assert any right or - authority to forbid You from making technical modifications - necessary to exercise the Licensed Rights, including - technical modifications necessary to circumvent Effective - Technological Measures. For purposes of this Public License, - simply making modifications authorized by this Section 2(a) - (4) never produces Adapted Material. - - 5. Downstream recipients. - - a. Offer from the Licensor -- Licensed Material. Every - recipient of the Licensed Material automatically - receives an offer from the Licensor to exercise the - Licensed Rights under the terms and conditions of this - Public License. - - b. Additional offer from the Licensor -- Adapted Material. - Every recipient of Adapted Material from You - automatically receives an offer from the Licensor to - exercise the Licensed Rights in the Adapted Material - under the conditions of the Adapter's License You apply. - - c. No downstream restrictions. You may not offer or impose - any additional or different terms or conditions on, or - apply any Effective Technological Measures to, the - Licensed Material if doing so restricts exercise of the - Licensed Rights by any recipient of the Licensed - Material. - - 6. No endorsement. Nothing in this Public License constitutes or - may be construed as permission to assert or imply that You - are, or that Your use of the Licensed Material is, connected - with, or sponsored, endorsed, or granted official status by, - the Licensor or others designated to receive attribution as - provided in Section 3(a)(1)(A)(i). - - b. Other rights. - - 1. Moral rights, such as the right of integrity, are not - licensed under this Public License, nor are publicity, - privacy, and/or other similar personality rights; however, to - the extent possible, the Licensor waives and/or agrees not to - assert any such rights held by the Licensor to the limited - extent necessary to allow You to exercise the Licensed - Rights, but not otherwise. - - 2. Patent and trademark rights are not licensed under this - Public License. - - 3. To the extent possible, the Licensor waives any right to - collect royalties from You for the exercise of the Licensed - Rights, whether directly or through a collecting society - under any voluntary or waivable statutory or compulsory - licensing scheme. In all other cases the Licensor expressly - reserves any right to collect such royalties. - - -Section 3 -- License Conditions. - -Your exercise of the Licensed Rights is expressly made subject to the -following conditions. - - a. Attribution. - - 1. If You Share the Licensed Material (including in modified - form), You must: - - a. retain the following if it is supplied by the Licensor - with the Licensed Material: - - i. identification of the creator(s) of the Licensed - Material and any others designated to receive - attribution, in any reasonable manner requested by - the Licensor (including by pseudonym if - designated); - - ii. a copyright notice; - - iii. a notice that refers to this Public License; - - iv. a notice that refers to the disclaimer of - warranties; - - v. a URI or hyperlink to the Licensed Material to the - extent reasonably practicable; - - b. indicate if You modified the Licensed Material and - retain an indication of any previous modifications; and - - c. indicate the Licensed Material is licensed under this - Public License, and include the text of, or the URI or - hyperlink to, this Public License. - - 2. You may satisfy the conditions in Section 3(a)(1) in any - reasonable manner based on the medium, means, and context in - which You Share the Licensed Material. For example, it may be - reasonable to satisfy the conditions by providing a URI or - hyperlink to a resource that includes the required - information. - - 3. If requested by the Licensor, You must remove any of the - information required by Section 3(a)(1)(A) to the extent - reasonably practicable. - - b. ShareAlike. - - In addition to the conditions in Section 3(a), if You Share - Adapted Material You produce, the following conditions also apply. - - 1. The Adapter's License You apply must be a Creative Commons - license with the same License Elements, this version or - later, or a BY-SA Compatible License. - - 2. You must include the text of, or the URI or hyperlink to, the - Adapter's License You apply. You may satisfy this condition - in any reasonable manner based on the medium, means, and - context in which You Share Adapted Material. - - 3. You may not offer or impose any additional or different terms - or conditions on, or apply any Effective Technological - Measures to, Adapted Material that restrict exercise of the - rights granted under the Adapter's License You apply. - - -Section 4 -- Sui Generis Database Rights. - -Where the Licensed Rights include Sui Generis Database Rights that -apply to Your use of the Licensed Material: - - a. for the avoidance of doubt, Section 2(a)(1) grants You the right - to extract, reuse, reproduce, and Share all or a substantial - portion of the contents of the database; - - b. if You include all or a substantial portion of the database - contents in a database in which You have Sui Generis Database - Rights, then the database in which You have Sui Generis Database - Rights (but not its individual contents) is Adapted Material, - including for purposes of Section 3(b); and - - c. You must comply with the conditions in Section 3(a) if You Share - all or a substantial portion of the contents of the database. - -For the avoidance of doubt, this Section 4 supplements and does not -replace Your obligations under this Public License where the Licensed -Rights include other Copyright and Similar Rights. - - -Section 5 -- Disclaimer of Warranties and Limitation of Liability. - - a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE - EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS - AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF - ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, - IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, - WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR - PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, - ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT - KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT - ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. - - b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE - TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, - NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, - INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, - COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR - USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN - ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR - DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR - IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. - - c. The disclaimer of warranties and limitation of liability provided - above shall be interpreted in a manner that, to the extent - possible, most closely approximates an absolute disclaimer and - waiver of all liability. - - -Section 6 -- Term and Termination. - - a. This Public License applies for the term of the Copyright and - Similar Rights licensed here. However, if You fail to comply with - this Public License, then Your rights under this Public License - terminate automatically. - - b. Where Your right to use the Licensed Material has terminated under - Section 6(a), it reinstates: - - 1. automatically as of the date the violation is cured, provided - it is cured within 30 days of Your discovery of the - violation; or - - 2. upon express reinstatement by the Licensor. - - For the avoidance of doubt, this Section 6(b) does not affect any - right the Licensor may have to seek remedies for Your violations - of this Public License. - - c. For the avoidance of doubt, the Licensor may also offer the - Licensed Material under separate terms or conditions or stop - distributing the Licensed Material at any time; however, doing so - will not terminate this Public License. - - d. Sections 1, 5, 6, 7, and 8 survive termination of this Public - License. - - -Section 7 -- Other Terms and Conditions. - - a. The Licensor shall not be bound by any additional or different - terms or conditions communicated by You unless expressly agreed. - - b. Any arrangements, understandings, or agreements regarding the - Licensed Material not stated herein are separate from and - independent of the terms and conditions of this Public License. - - -Section 8 -- Interpretation. - - a. For the avoidance of doubt, this Public License does not, and - shall not be interpreted to, reduce, limit, restrict, or impose - conditions on any use of the Licensed Material that could lawfully - be made without permission under this Public License. - - b. To the extent possible, if any provision of this Public License is - deemed unenforceable, it shall be automatically reformed to the - minimum extent necessary to make it enforceable. If the provision - cannot be reformed, it shall be severed from this Public License - without affecting the enforceability of the remaining terms and - conditions. - - c. No term or condition of this Public License will be waived and no - failure to comply consented to unless expressly agreed to by the - Licensor. - - d. Nothing in this Public License constitutes or may be interpreted - as a limitation upon, or waiver of, any privileges and immunities - that apply to the Licensor or You, including from the legal - processes of any jurisdiction or authority. - - -======================================================================= - -Creative Commons is not a party to its public -licenses. Notwithstanding, Creative Commons may elect to apply one of -its public licenses to material it publishes and in those instances -will be considered the “Licensor.” The text of the Creative Commons -public licenses is dedicated to the public domain under the CC0 Public -Domain Dedication. Except for the limited purpose of indicating that -material is shared under a Creative Commons public license or as -otherwise permitted by the Creative Commons policies published at -creativecommons.org/policies, Creative Commons does not authorize the -use of the trademark "Creative Commons" or any other trademark or logo -of Creative Commons without its prior written consent including, -without limitation, in connection with any unauthorized modifications -to any of its public licenses or any other arrangements, -understandings, or agreements concerning use of licensed material. For -the avoidance of doubt, this paragraph does not form part of the -public licenses. - -Creative Commons may be contacted at creativecommons.org. diff --git a/contrib/xz/ChangeLog b/contrib/xz/ChangeLog index 54b68744af86..4dd0978ef313 100644 --- a/contrib/xz/ChangeLog +++ b/contrib/xz/ChangeLog @@ -1,9764 +1,11756 @@ -commit 2d7d862e3ffa8cec4fd3fdffcd84e984a17aa429 +commit 49053c0a649f4c8bd2b8d97ce915f401fbc0f3d9 Author: Jia Tan -Date: 2024-02-24 15:55:08 +0800 +Date: 2023-10-31 22:30:29 +0800 - Bump version and soname for 5.6.0. + Bump version and soname for 5.4.5. - src/liblzma/Makefile.am | 2 +- - src/liblzma/api/lzma/version.h | 6 +++--- - src/liblzma/liblzma_generic.map | 2 +- - src/liblzma/liblzma_linux.map | 2 +- - 4 files changed, 6 insertions(+), 6 deletions(-) + src/liblzma/Makefile.am | 2 +- + src/liblzma/api/lzma/version.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) -commit a18fb1edef0d0aac12a09eed05e9c448c777af7b +commit 84c0cfc556287628df871703672879e530d0391f Author: Jia Tan -Date: 2024-02-24 15:50:36 +0800 +Date: 2023-11-01 20:18:30 +0800 - Add NEWS for 5.6.0. + Add NEWS for 5.4.5. - NEWS | 143 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 143 insertions(+) + NEWS | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 74 insertions(+) -commit 24355c5280bc95e3d594432d60bb8432aa6af173 -Author: Jia Tan -Date: 2024-02-22 22:27:01 +0800 +commit d90ed84db9770712e2421e170076b43bda9b64a7 +Author: Lasse Collin +Date: 2023-10-31 21:41:09 +0200 - Translations: Remove obsolete and fuzzy matches from some translations. + liblzma: Fix compilation of fastpos_tablegen.c. - The French and Brazilian Portuguese man page translations have not been - updated since the switch from public domain to 0BSD. The old GPLv2 - strings have now been removed from these files. - - po4a/fr.po | 4702 +++++++++++++++++++++++++++++++++++++---------------- - po4a/pt_BR.po | 4987 ++++++++++++++++++++++++++++++++++++++++----------------- - 2 files changed, 6832 insertions(+), 2857 deletions(-) - -commit 02ca4a7d7b703e2ec63e00b70feec825e919dbc1 -Author: Jia Tan -Date: 2024-02-21 00:31:54 +0800 - - Translations: Patch man pages to avoid fuzzy matches. + The macro lzma_attr_visibility_hidden has to be defined to make + fastpos.h usable. The visibility attribute is irrelevant to + fastpos_tablegen.c so simply #define the macro to an empty value. - This will be fixed in the next round of translations, but this avoids - having a fuzzy match or not fixing the English version. - - po4a/de.po | 2 +- - po4a/ko.po | 2 +- - po4a/ro.po | 2 +- - po4a/uk.po | 2 +- - 4 files changed, 4 insertions(+), 4 deletions(-) - -commit 898aad9fc711e03452d24d9e2c5b7f77a6f9ce64 *** 32182 LINES SKIPPED *** From nobody Mon Apr 8 04:06:30 2024 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 4VCbBG3v3Hz5G3Y4; Mon, 8 Apr 2024 04:06: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 4VCbBG1lyWz4Zk3; Mon, 8 Apr 2024 04:06:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712549190; 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=7l+lmMmPORTWAi+QtBrz+fIuApnDfbw1kcXg1Gup7Bc=; b=kuN86Puq77A0D3/+LgmJf3W0hm0atyFuhoknH4Rm7+L5KCj7JWDy2qGasru127fTiDYrpn 01pQE5vZGIs82cRk2Sl65TwXtdAnpZYzISbzj6ks5ubxif20ZcaWjf1Ymy1gnG74ahEQf/ nnnApUxjvKynT6fbzzuDJJ63/VR1Epj3S25axWAwIieucG1qbxzKd1N7FgvX0f+SohIono 1DatinrouMmzZdwP6oLcnp4BV3RMSDrLK8g0BAf90jsRpY9iyxtPrWnnf4+s+1BhlXVe/v pzktrCZCeRjrsCudWGAwE5G2IIEFESmkzhZnkujdIUK8mP0+4O3DD6BKtgvs3A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712549190; a=rsa-sha256; cv=none; b=DE7mlQ9Z5tjKWaB2qSMI/fbWjzqHpkzO0JOIOXYoYHuU/HCW+2Lxq8YwMQF+WUi+xaRWmd BlMENI3jDE1i4qK33gm+69ovMZoXnIAOv9VznnUNUdsMmxtI1zwX8PnigIbWKLhhLJqHs6 hvBGxIOGY83vxPiz+lRQ2I7Qahxga3xA3wdWI2hR5v4Vy4XAQcxm9NZVQmAL8RagedP89d RZp2RSzHwcthi+r3/vhF+B8nzRH0iwn8Prmy+kOmSg7REst4HETfAXIYIG3xlR/S1tqlsE Cd94sjXIdCX6uA5dtOlMocKU0UbxHq6n5PT0LZc+hzGwfd+6YK5opd5vX/kDQQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712549190; 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=7l+lmMmPORTWAi+QtBrz+fIuApnDfbw1kcXg1Gup7Bc=; b=ejzn71rNFXF+g/k9JgPooVJgsUOsJLsN3PHCaCSd+nA+i7jv2oavsMxKsn8kAAerM664GG 3n1X1Vg1m4mIQems+pSDf9uT2PA1xEsJGv1xUalFVmZQ8Ereim8Ydo8rOzizPxxNT6p9Ov 3n0RkC9ib5uGmJ8ncFY4mI7q+Ym/Dj24CIMyIIv4OIeJy5VnrlT+UWs0KBZrT36MVN7e5k ClTlPytee/cfxMJTQraoHuNz6l0v74nWFbNvFHfoR4lZssidXycD8143xWu4NE9nZGxB1C 9F6MxiTGuEJZvYqbTl6dBCtgE+/7TrzQm0FE1LO8GDdlb+GGQ4/y/uDZfZx7Ow== 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 4VCbBG1BHhzwj6; Mon, 8 Apr 2024 04:06:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43846Ui4062386; Mon, 8 Apr 2024 04:06:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43846U7J062383; Mon, 8 Apr 2024 04:06:30 GMT (envelope-from git) Date: Mon, 8 Apr 2024 04:06:30 GMT Message-Id: <202404080406.43846U7J062383@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Xin LI Subject: git: 728293e74c90 - stable/13 - Backport export of lzma_mt_block_size symbol. 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: delphij X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 728293e74c90d45d7901dfd40c4872d7e6a787eb Auto-Submitted: auto-generated The branch stable/13 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=728293e74c90d45d7901dfd40c4872d7e6a787eb commit 728293e74c90d45d7901dfd40c4872d7e6a787eb Author: Xin LI AuthorDate: 2024-04-05 06:39:33 +0000 Commit: Xin LI CommitDate: 2024-04-08 04:06:13 +0000 Backport export of lzma_mt_block_size symbol. This restores binary compatibility against liblzma 5.6.0 library. PR: 278127 (cherry picked from commit 5ffb19ac36c4b5c9e72d69048250c8e56acff739) --- contrib/xz/src/liblzma/api/lzma/container.h | 28 +++++++++++++++++++++++ contrib/xz/src/liblzma/common/filter_encoder.c | 16 ++++++++----- contrib/xz/src/liblzma/common/filter_encoder.h | 6 +---- contrib/xz/src/liblzma/common/stream_encoder_mt.c | 20 ++++++++-------- contrib/xz/src/liblzma/liblzma_generic.map | 5 ++++ contrib/xz/src/liblzma/liblzma_linux.map | 5 ++++ contrib/xz/src/liblzma/lz/lz_encoder.c | 4 +--- contrib/xz/src/liblzma/lz/lz_encoder.h | 8 +++++++ contrib/xz/src/liblzma/lzma/lzma2_encoder.c | 3 +++ lib/liblzma/Symbol.map | 5 +++- lib/liblzma/Versions.def | 5 +++- 11 files changed, 78 insertions(+), 27 deletions(-) diff --git a/contrib/xz/src/liblzma/api/lzma/container.h b/contrib/xz/src/liblzma/api/lzma/container.h index 2849fbfd3c51..4cbb1b7bf7b4 100644 --- a/contrib/xz/src/liblzma/api/lzma/container.h +++ b/contrib/xz/src/liblzma/api/lzma/container.h @@ -435,6 +435,34 @@ extern LZMA_API(lzma_ret) lzma_stream_encoder_mt( lzma_nothrow lzma_attr_warn_unused_result; +/** + * \brief Calculate recommended Block size for multithreaded .xz encoder + * + * This calculates a recommended Block size for multithreaded encoding given + * a filter chain. This is used internally by lzma_stream_encoder_mt() to + * determine the Block size if the block_size member is not set to the + * special value of 0 in the lzma_mt options struct. + * + * If one wishes to change the filters between Blocks, this function is + * helpful to set the block_size member of the lzma_mt struct before calling + * lzma_stream_encoder_mt(). Since the block_size member represents the + * maximum possible Block size for the multithreaded .xz encoder, one can + * use this function to find the maximum recommended Block size based on + * all planned filter chains. Otherwise, the multithreaded encoder will + * base its maximum Block size on the first filter chain used (if the + * block_size member is not set), which may unnecessarily limit the Block + * size for a later filter chain. + * + * \param filters Array of filters terminated with + * .id == LZMA_VLI_UNKNOWN. + * + * \return Recommended Block size in bytes, or UINT64_MAX if + * an error occurred. + */ +extern LZMA_API(uint64_t) lzma_mt_block_size(const lzma_filter *filters) + lzma_nothrow; + + /** * \brief Initialize .lzma encoder (legacy file format) * diff --git a/contrib/xz/src/liblzma/common/filter_encoder.c b/contrib/xz/src/liblzma/common/filter_encoder.c index 46fe8af1c153..0699bcee62a4 100644 --- a/contrib/xz/src/liblzma/common/filter_encoder.c +++ b/contrib/xz/src/liblzma/common/filter_encoder.c @@ -33,7 +33,8 @@ typedef struct { /// Calculates the recommended Uncompressed Size for .xz Blocks to /// which the input data can be split to make multithreaded /// encoding possible. If this is NULL, it is assumed that - /// the encoder is fast enough with single thread. + /// the encoder is fast enough with single thread. If the options + /// are invalid, UINT64_MAX is returned. uint64_t (*block_size)(const void *options); /// Tells the size of the Filter Properties field. If options are @@ -248,26 +249,29 @@ lzma_raw_encoder_memusage(const lzma_filter *filters) } -extern uint64_t +extern LZMA_API(uint64_t) lzma_mt_block_size(const lzma_filter *filters) { + if (filters == NULL) + return UINT64_MAX; + uint64_t max = 0; for (size_t i = 0; filters[i].id != LZMA_VLI_UNKNOWN; ++i) { const lzma_filter_encoder *const fe = encoder_find(filters[i].id); + if (fe == NULL) + return UINT64_MAX; + if (fe->block_size != NULL) { const uint64_t size = fe->block_size(filters[i].options); - if (size == 0) - return 0; - if (size > max) max = size; } } - return max; + return max == 0 ? UINT64_MAX : max; } diff --git a/contrib/xz/src/liblzma/common/filter_encoder.h b/contrib/xz/src/liblzma/common/filter_encoder.h index f1d5683fe793..da92be8b34da 100644 --- a/contrib/xz/src/liblzma/common/filter_encoder.h +++ b/contrib/xz/src/liblzma/common/filter_encoder.h @@ -1,6 +1,6 @@ /////////////////////////////////////////////////////////////////////////////// // -/// \file filter_encoder.c +/// \file filter_encoder.h /// \brief Filter ID mapping to filter-specific functions // // Author: Lasse Collin @@ -16,10 +16,6 @@ #include "common.h" -// FIXME: Might become a part of the public API. -extern uint64_t lzma_mt_block_size(const lzma_filter *filters); - - extern lzma_ret lzma_raw_encoder_init( lzma_next_coder *next, const lzma_allocator *allocator, const lzma_filter *filters); diff --git a/contrib/xz/src/liblzma/common/stream_encoder_mt.c b/contrib/xz/src/liblzma/common/stream_encoder_mt.c index f64de9bdbc57..64de526b6a17 100644 --- a/contrib/xz/src/liblzma/common/stream_encoder_mt.c +++ b/contrib/xz/src/liblzma/common/stream_encoder_mt.c @@ -979,20 +979,18 @@ get_options(const lzma_mt *options, lzma_options_easy *opt_easy, *filters = opt_easy->filters; } - // Block size - if (options->block_size > 0) { - if (options->block_size > BLOCK_SIZE_MAX) - return LZMA_OPTIONS_ERROR; - + // If the Block size is not set, determine it from the filter chain. + if (options->block_size > 0) *block_size = options->block_size; - } else { - // Determine the Block size from the filter chain. + else *block_size = lzma_mt_block_size(*filters); - if (*block_size == 0) - return LZMA_OPTIONS_ERROR; - assert(*block_size <= BLOCK_SIZE_MAX); - } + // UINT64_MAX > BLOCK_SIZE_MAX, so the second condition + // should be optimized out by any reasonable compiler. + // The second condition should be there in the unlikely event that + // the macros change and UINT64_MAX < BLOCK_SIZE_MAX. + if (*block_size > BLOCK_SIZE_MAX || *block_size == UINT64_MAX) + return LZMA_OPTIONS_ERROR; // Calculate the maximum amount output that a single output buffer // may need to hold. This is the same as the maximum total size of diff --git a/contrib/xz/src/liblzma/liblzma_generic.map b/contrib/xz/src/liblzma/liblzma_generic.map index bb82167ed57a..b251d366e15c 100644 --- a/contrib/xz/src/liblzma/liblzma_generic.map +++ b/contrib/xz/src/liblzma/liblzma_generic.map @@ -119,3 +119,8 @@ global: lzma_str_list_filters; lzma_str_to_filters; } XZ_5.2; + +XZ_5.5.0alpha { +global: + lzma_mt_block_size; +} XZ_5.4; diff --git a/contrib/xz/src/liblzma/liblzma_linux.map b/contrib/xz/src/liblzma/liblzma_linux.map index 449f5fd682db..25b393883693 100644 --- a/contrib/xz/src/liblzma/liblzma_linux.map +++ b/contrib/xz/src/liblzma/liblzma_linux.map @@ -134,3 +134,8 @@ global: lzma_str_list_filters; lzma_str_to_filters; } XZ_5.2; + +XZ_5.5.0alpha { +global: + lzma_mt_block_size; +} XZ_5.4; diff --git a/contrib/xz/src/liblzma/lz/lz_encoder.c b/contrib/xz/src/liblzma/lz/lz_encoder.c index 5489085a0860..8e724a035a13 100644 --- a/contrib/xz/src/liblzma/lz/lz_encoder.c +++ b/contrib/xz/src/liblzma/lz/lz_encoder.c @@ -196,9 +196,7 @@ lz_encoder_prepare(lzma_mf *mf, const lzma_allocator *allocator, // For now, the dictionary size is limited to 1.5 GiB. This may grow // in the future if needed, but it needs a little more work than just // changing this check. - if (lz_options->dict_size < LZMA_DICT_SIZE_MIN - || lz_options->dict_size - > (UINT32_C(1) << 30) + (UINT32_C(1) << 29) + if (!IS_ENC_DICT_SIZE_VALID(lz_options->dict_size) || lz_options->nice_len > lz_options->match_len_max) return true; diff --git a/contrib/xz/src/liblzma/lz/lz_encoder.h b/contrib/xz/src/liblzma/lz/lz_encoder.h index ffcba02ce931..b71f11805e50 100644 --- a/contrib/xz/src/liblzma/lz/lz_encoder.h +++ b/contrib/xz/src/liblzma/lz/lz_encoder.h @@ -17,6 +17,14 @@ #include "common.h" +// For now, the dictionary size is limited to 1.5 GiB. This may grow +// in the future if needed, but it needs a little more work than just +// changing this check. +#define IS_ENC_DICT_SIZE_VALID(size) \ + ((size) >= LZMA_DICT_SIZE_MIN \ + && (size) <= (UINT32_C(1) << 30) + (UINT32_C(1) << 29)) + + /// A table of these is used by the LZ-based encoder to hold /// the length-distance pairs found by the match finder. typedef struct { diff --git a/contrib/xz/src/liblzma/lzma/lzma2_encoder.c b/contrib/xz/src/liblzma/lzma/lzma2_encoder.c index 4b6b23118d70..5043a07e0fdf 100644 --- a/contrib/xz/src/liblzma/lzma/lzma2_encoder.c +++ b/contrib/xz/src/liblzma/lzma/lzma2_encoder.c @@ -409,6 +409,9 @@ lzma_lzma2_block_size(const void *options) { const lzma_options_lzma *const opt = options; + if (!IS_ENC_DICT_SIZE_VALID(opt->dict_size)) + return UINT64_MAX; + // Use at least 1 MiB to keep compression ratio better. return my_max((uint64_t)(opt->dict_size) * 3, UINT64_C(1) << 20); } diff --git a/lib/liblzma/Symbol.map b/lib/liblzma/Symbol.map index 9532da0a5bde..938b6191b4f4 100644 --- a/lib/liblzma/Symbol.map +++ b/lib/liblzma/Symbol.map @@ -114,6 +114,10 @@ XZ_5.4 { lzma_str_to_filters; }; +XZ_5.6 { + lzma_mt_block_size; +}; + XZprivate_1.0 { lzma_alloc; lzma_alloc_zero; @@ -173,7 +177,6 @@ XZprivate_1.0 { lzma_mf_hc3_skip; lzma_mf_hc4_find; lzma_mf_hc4_skip; - lzma_mt_block_size; lzma_next_end; lzma_next_filter_init; lzma_next_filter_update; diff --git a/lib/liblzma/Versions.def b/lib/liblzma/Versions.def index dea89514beda..25064d9d50e7 100644 --- a/lib/liblzma/Versions.def +++ b/lib/liblzma/Versions.def @@ -8,6 +8,9 @@ XZ_5.2 { XZ_5.4 { } XZ_5.2; -XZprivate_1.0 { +XZ_5.6 { } XZ_5.4; +XZprivate_1.0 { +} XZ_5.6; + From nobody Mon Apr 8 07:46:31 2024 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 4VCh472QxYz5GSQ6; Mon, 8 Apr 2024 07:46: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 4VCh471Xtyz4H4J; Mon, 8 Apr 2024 07:46:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712562391; 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=FRh7f6nKHSrOcpcbHShECgDMBMEHhhaxvckeY5dv8Iw=; b=Gi7lVSTqFEYH+voaU7HYv4DS58IOcYlxR7fEJvG761YA+lowDYwj5RO+iqZkGU3mRhjy3M eVLo2tWNX/p0ZYrvbvQOfM0oNjLFhBx5aWdCRWsiXSOOXEV29GxQDfmBk4EkkXfnvgD+NX MQjWIV6maHFdrwIfLgn8wbQ9JF2WJDt5yfEOXEUdOrMEIdceWj3yefATLHvcH7JFU8PaUN WSglEHsfB6ZrfuDTR5u6OtiedXhcourCUsAag4oSuaicNnR/r70lWFex6w/AyXKPsfTkzk yw8jsLLqaQDPck9wq2lKGQpLPbXdStWmtpWdmkQ1SI1iQettBDkZNLiTp+7BHQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712562391; a=rsa-sha256; cv=none; b=FABI+PlQsSR8e3Fk3Qs1QnbuamHhyKOunQcJ/ziEdSmpgqC+BFpAEhZrmwqVCV0daB06HR cMlO9vmZWviqKmgqNt4etWKiLyQlp2BiS8pIfl456t3CJE3lQ7CCUSkIXSNJl72iFZ56z2 afTMidhB6LEy37fJ0TCx+WgdPINJGmfYbydo/dUThUSGB7DRfQ4oZCNY0szvQGiQ0h4cz8 jEd9Y/KWRsYDyBGuhBoEZ7xTiJMgvyTDcbJJEB8Ri/1AQ71GjHsLRUGweoLbSi+xZUYEpY 2SrxwRgbNStH4Y8JdXet09iNX9ieIgShdp7CA0IpSKCxg8bS98ntMHFfYr6gYg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712562391; 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=FRh7f6nKHSrOcpcbHShECgDMBMEHhhaxvckeY5dv8Iw=; b=BEwaso/0LhAOzPDgvQzgnd4m8ZV0fpDn1OHtewEjYelgV8d7rjs79//j5/7KsqpZgDcmg8 igut+DbnSF9ofuUb9PrEKP8bCb3sS9WnFUZnF/JEglAR2AYpaya5qJwQnA/vi2ORuVdGqC hQ5auMWtzRhe4Z8oI+ioJ/yq5+JpdkLtPxVC1Y2CI98UKnf491beBFgpCapGR2990mzH86 AMYPGzTYuGI6EfIcnTTBCxmp9gskyGP7MAn1Nae6sMw1Vatv6ftXesyQ0NcpRy+JPd8W8T JBUvPJhXSCLdpekP+lRdHPHylDW/1Eo0rmuHW8YiMAfxeKv9VTFISaVVLR9dww== 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 4VCh47127Gz1386; Mon, 8 Apr 2024 07:46:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 4387kVMa043412; Mon, 8 Apr 2024 07:46:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4387kVEZ043410; Mon, 8 Apr 2024 07:46:31 GMT (envelope-from git) Date: Mon, 8 Apr 2024 07:46:31 GMT Message-Id: <202404080746.4387kVEZ043410@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 928ea8066dd0 - stable/14 - Merge commit eb8f379567e8 from llvm-project (by Florian Hahn): 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: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 928ea8066dd0dee458633b1ebd5d0b6dcdc83357 Auto-Submitted: auto-generated The branch stable/14 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=928ea8066dd0dee458633b1ebd5d0b6dcdc83357 commit 928ea8066dd0dee458633b1ebd5d0b6dcdc83357 Author: Dimitry Andric AuthorDate: 2024-04-05 13:00:12 +0000 Commit: Dimitry Andric CommitDate: 2024-04-08 07:42:16 +0000 Merge commit eb8f379567e8 from llvm-project (by Florian Hahn): [DSE] Remove malloc from EarliestEscapeInfo before removing. (#84157) Not removing the malloc from earliest escape info leaves stale entries in the cache. Fixes https://github.com/llvm/llvm-project/issues/84051. PR: https://github.com/llvm/llvm-project/pull/84157 This fixes a crash in clang (usually a bus error, but can also be another memory error) when compiling the science/siconos port. PR: 278174 Reported by: yuri MFC after: 3 days (cherry picked from commit aaabed1dea7c1d16cdc5457bf6dee74164104e26) --- .../llvm-project/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/llvm-project/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp b/contrib/llvm-project/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp index d3fbe49439a8..62a9b6a41c5b 100644 --- a/contrib/llvm-project/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp +++ b/contrib/llvm-project/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp @@ -1893,6 +1893,7 @@ struct DSEState { Malloc->getArgOperand(0), IRB, TLI); if (!Calloc) return false; + MemorySSAUpdater Updater(&MSSA); auto *LastDef = cast(Updater.getMemorySSA()->getMemoryAccess(Malloc)); @@ -1901,9 +1902,8 @@ struct DSEState { LastDef); auto *NewAccessMD = cast(NewAccess); Updater.insertDef(NewAccessMD, /*RenameUses=*/true); - Updater.removeMemoryAccess(Malloc); Malloc->replaceAllUsesWith(Calloc); - Malloc->eraseFromParent(); + deleteDeadInstruction(Malloc); return true; } From nobody Mon Apr 8 07:47:10 2024 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 4VCh4v14TPz5GSSl; Mon, 8 Apr 2024 07:47: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 4VCh4v0Dvpz4HpJ; Mon, 8 Apr 2024 07:47:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712562431; 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=m2Qb6TdhixpL4i0jNXtfBwnCooozW3DrQvop2cOlTqs=; b=dzgAnBOSj0eGWPwxYtwwPal2XvyvY74obc58k/veIllcV4Jw90tWkeTWRy7sgVIHV8EAlk jaRIZvcKJLiVki8fSp55h4OtdqyVM9MonEOUm5ag+WUsbhBXJJkbtMUMtwjydYNIwq2OkW E5qBPbC0zuuvvRyLcYZ/Wj+GyXdEaTt8tKE/TamgSSN+Sa3nae4xfmxNnAdNpqIh2bqnat VFh7dGG2eNp68DCP018yBk08lVSqRj/y9Q5Tq8RYAuzZl0Blb8wUpT+bj7wm5opnUPq8NN Jn6fClYtizWIWgn+rhdtRk/WXD24hu9RZoeqBUE/NrZZQBugVH/JZEYEacxrTw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712562431; a=rsa-sha256; cv=none; b=qz5MoYoChxfmKXQNbHj2lN/4BX8itl5PlQ6whD1gxK78rI88nyen8EZgy7E+Zn9Uuwr5Hi zQ4a1Y5C3r24YVcR5K5ok4EIeMI/YoDa82kvikIiB3uMaaEVDe06YA5b93FY3tqfMt2SGO G7oIxEoZvu13efFC5OAHGVhRdhBOiPXPZjqfMboCi5Ihv0K97PbrbA99DVBo8RSZGYDaeB 3vq5YuCmoVto3m4lfV/gBO39PNCkhpp32DWSaP+mF/wCuuQ/yZhWHXCTFFDrUQIqqyRfNt pXRXAr7GXbVhg4GATmDO2fUGIq1M83G3XAtBU2sBO+0lsrxqPoK8vStDTS974Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712562431; 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=m2Qb6TdhixpL4i0jNXtfBwnCooozW3DrQvop2cOlTqs=; b=cNMFOI2pWnq1F6h4nn8iTFVUI1ZPux5CF5cfSBLmfyZ6vlhbokzrRcGBplNzU8dAoOkhnm Ubr+sckPsWqiK7zcFSFizzmNQL8/DlNNw/DMKkhNGecpGU5y1VxXCr+J5HdQ29eqN+oFBw L1UN0A7xpNKYsJPc3esduXaRsbfY6enVqci2voQ6ToXNhYcKjqZB1sb/ClY7RYdMYheQ/Q ucJ6p1FFB1lfIdgl9wAcQ5N6lgVvfAW9S3cnwLZSpzTO2JWuLuuICES60o3fO4UFzfRdRL zzpU/WGwEinrLsfUGdSsTHd9QS/zEHZwW+TC9fO9nmuBvXCGIvC+hhdouqbggg== 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 4VCh4t6xdgz139q; Mon, 8 Apr 2024 07:47:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 4387lAkv043665; Mon, 8 Apr 2024 07:47:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4387lAbE043662; Mon, 8 Apr 2024 07:47:10 GMT (envelope-from git) Date: Mon, 8 Apr 2024 07:47:10 GMT Message-Id: <202404080747.4387lAbE043662@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 17e32453b89d - stable/13 - Merge commit eb8f379567e8 from llvm-project (by Florian Hahn): 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: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 17e32453b89d48db0d2f9e8086952df7d423423c Auto-Submitted: auto-generated The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=17e32453b89d48db0d2f9e8086952df7d423423c commit 17e32453b89d48db0d2f9e8086952df7d423423c Author: Dimitry Andric AuthorDate: 2024-04-05 13:00:12 +0000 Commit: Dimitry Andric CommitDate: 2024-04-08 07:42:20 +0000 Merge commit eb8f379567e8 from llvm-project (by Florian Hahn): [DSE] Remove malloc from EarliestEscapeInfo before removing. (#84157) Not removing the malloc from earliest escape info leaves stale entries in the cache. Fixes https://github.com/llvm/llvm-project/issues/84051. PR: https://github.com/llvm/llvm-project/pull/84157 This fixes a crash in clang (usually a bus error, but can also be another memory error) when compiling the science/siconos port. PR: 278174 Reported by: yuri MFC after: 3 days (cherry picked from commit aaabed1dea7c1d16cdc5457bf6dee74164104e26) --- .../llvm-project/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/llvm-project/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp b/contrib/llvm-project/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp index d3fbe49439a8..62a9b6a41c5b 100644 --- a/contrib/llvm-project/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp +++ b/contrib/llvm-project/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp @@ -1893,6 +1893,7 @@ struct DSEState { Malloc->getArgOperand(0), IRB, TLI); if (!Calloc) return false; + MemorySSAUpdater Updater(&MSSA); auto *LastDef = cast(Updater.getMemorySSA()->getMemoryAccess(Malloc)); @@ -1901,9 +1902,8 @@ struct DSEState { LastDef); auto *NewAccessMD = cast(NewAccess); Updater.insertDef(NewAccessMD, /*RenameUses=*/true); - Updater.removeMemoryAccess(Malloc); Malloc->replaceAllUsesWith(Calloc); - Malloc->eraseFromParent(); + deleteDeadInstruction(Malloc); return true; } From nobody Mon Apr 8 10:11:03 2024 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 4VClGv43xmz5GhrD; Mon, 8 Apr 2024 10:11: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 4VClGv23Mnz4VBG; Mon, 8 Apr 2024 10:11:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712571063; 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=lsZdY5ERIUw78PsunJzO6t58G3/gwBhMp7kTthswCe4=; b=U4adsMTCnv+m2Ok7qf8jh+EpoB+vAvM11c6atMhksLQlljhmzmaZOCD8ElgY7azAWJQ2B8 PX2w+uI1QaKOn8wuqLxzxUO024GMaYXYNpaEjIJ547hRNbQB6RgcF2zLoesrjJqLM3QVOV SCgAI7KxpkYm/OMPm5rtkq7dulaeyjab7u6YzUTmT61nPKze1PLkLqAWkXsVaRSXhmJ9vV c11F0wtgkQKwtJRkcr2ZfhVVKvMZsl2sXEZ06/OWTUKtZsNJ4+AHy/+i77iteEywerNFha ZgQtgJZMrSP/7cW61NNIyZzg0tqjh2pMpGiAQwvtIE28eSye0o4tNq1dl1mHZQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712571063; a=rsa-sha256; cv=none; b=PSLfm3qSljqt058Dhksl13CCczU7O3vDYtMM409mXeLo8MZE330MGfGYZSy56bLyr6PGK+ i8cxT5c/xNWNVd43Tn08Yp30w1gzNA0df4R1kxifxFg4jTHz96x0utjviExS085AGW0BlH LwsoUt7MbXWtSLRvXXEq3gUMYkViF5nhBQu/GcpUmPMftQKm2o72vn53mPj82asaNpllzs jifdiKqxYxtBklftvaz2aoqW63+h9Oq+WfPRlErkGEyy8vf8ROpPwb/OkYs83WQKUHjKSW o3EsSVUAd8gszk0oSB+bSEcYFrvr+kfUZrmyLpE7dBuirkvm6cz+vaIPKJ+FNg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712571063; 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=lsZdY5ERIUw78PsunJzO6t58G3/gwBhMp7kTthswCe4=; b=RtMwIMyOU7IYf26I9X1uMoj63X9IbO+AEU5wQL0tF/V8YYMq/0DYvA/j/sssMkbBYPZ1Ke xPJfn+n2XHqnHoLL3MUIxMSA6Fn12SubwDzrzW95iSeHw+UHVwJbRTlYfH4cjq0UrclDgF u9rKzqKi4ebjhF20td3z+YRx0q4vs7MSZfvvECWifK0ibgSHdqTTNBPTEQJ7+IloS7YLNE In7TV4ScKkVRFzIxRtAeXOetrXLiCDqszjr3/afK9ro/qVbodyxZz7pk0r1dgYCm+ENOLo ttP1S3R408mVgRRYfX5x+DAPRIpCLH9GTyt+eKsPm4QJpe5JfgbferppNVwOjg== 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 4VClGv1g3Jz15v0; Mon, 8 Apr 2024 10:11:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 438AB30W091795; Mon, 8 Apr 2024 10:11:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 438AB34R091792; Mon, 8 Apr 2024 10:11:03 GMT (envelope-from git) Date: Mon, 8 Apr 2024 10:11:03 GMT Message-Id: <202404081011.438AB34R091792@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 2ad8333c6534 - stable/14 - cp: Improved conformance when copying directories. 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: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 2ad8333c653432a187ccea8c6b2de4a35eb6d0ff Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=2ad8333c653432a187ccea8c6b2de4a35eb6d0ff commit 2ad8333c653432a187ccea8c6b2de4a35eb6d0ff Author: Dag-Erling Smørgrav AuthorDate: 2024-04-01 17:28:58 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-04-08 10:10:41 +0000 cp: Improved conformance when copying directories. * When copying a directory, if the destination exists and is not a directory, we would previously emit an error message and exit. The correct behavior according to POSIX is to emit an error message and continue without descending further into the source directory. * When copying a directory, if the destination does not exist and we fail to create it, we would previously emit an error message and exit. The correct behavior according to POSIX is to emit an error message and continue. Whether to descend further into the source directory is explicitly left unspecified; GNU cp does not, which seems to me to be the safer and less surprising option, so let's not either. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D44577 (cherry picked from commit dd286b0dc187c351a9537a363840245d5505b15b) cp: Correct the list of non-portable flags. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D44576 (cherry picked from commit aaa1806f68ef3102a9b888a03360f166b88618c8) --- bin/cp/cp.1 | 8 +++++--- bin/cp/cp.c | 27 ++++++++++++++++++--------- 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/bin/cp/cp.1 b/bin/cp/cp.1 index d8d62ef076a1..90b1a158a131 100644 --- a/bin/cp/cp.1 +++ b/bin/cp/cp.1 @@ -31,7 +31,7 @@ .\" .\" @(#)cp.1 8.3 (Berkeley) 4/18/94 .\" -.Dd December 14, 2023 +.Dd March 28, 2024 .Dt CP 1 .Os .Sh NAME @@ -311,12 +311,14 @@ differ as they copy special files as normal files while recreating a hierarchy. .Pp The +.Fl a , .Fl l , +.Fl N , +.Fl n , .Fl s , .Fl v , -.Fl x and -.Fl n +.Fl x options are non-standard and their use in scripts is not recommended. .Sh SEE ALSO .Xr mv 1 , diff --git a/bin/cp/cp.c b/bin/cp/cp.c index 852868e65dcb..af7d5ffac398 100644 --- a/bin/cp/cp.c +++ b/bin/cp/cp.c @@ -519,9 +519,13 @@ copy(char *argv[], enum op type, int fts_options, struct stat *root_stat) * umask blocks owner writes, we fail. */ if (dne) { - if (mkdir(to.p_path, - curr->fts_statp->st_mode | S_IRWXU) < 0) - err(1, "%s", to.p_path); + mode = curr->fts_statp->st_mode | S_IRWXU; + if (mkdir(to.p_path, mode) != 0) { + warn("%s", to.p_path); + (void)fts_set(ftsp, curr, FTS_SKIP); + badcp = rval = 1; + break; + } /* * First DNE with a NULL root_stat is the root * path, so set root_stat. We can't really @@ -530,14 +534,19 @@ copy(char *argv[], enum op type, int fts_options, struct stat *root_stat) * first directory we created and use that. */ if (root_stat == NULL && - stat(to.p_path, &created_root_stat) == -1) { - err(1, "stat"); - } else if (root_stat == NULL) { - root_stat = &created_root_stat; + stat(to.p_path, &created_root_stat) != 0) { + warn("%s", to.p_path); + (void)fts_set(ftsp, curr, FTS_SKIP); + badcp = rval = 1; + break; } + if (root_stat == NULL) + root_stat = &created_root_stat; } else if (!S_ISDIR(to_stat.st_mode)) { - errno = ENOTDIR; - err(1, "%s", to.p_path); + warnc(ENOTDIR, "%s", to.p_path); + (void)fts_set(ftsp, curr, FTS_SKIP); + badcp = rval = 1; + break; } /* * Arrange to correct directory attributes later From nobody Mon Apr 8 10:11:04 2024 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 4VClGw4gbmz5Ghwv; Mon, 8 Apr 2024 10:11: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 4VClGw353Kz4V7X; Mon, 8 Apr 2024 10:11:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712571064; 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=AtPGOb+TPU5/0bi2tPFh/GXXVXcQuIys12caUVZHGlQ=; b=IzghxJ5v80W9IkJyYyOt38+OJK2XMEC9Ibt+5LA7lu6jREtlG5njKiLV+Sg+amx/LLURUx l6niUhoL3x/kKiIp0qhmQmydeyDyWt0Zsg+gKdi3q6wr12Bq/GhIjkBpaELIUsW8hw6Kv5 0g7NXr6sCR/Dfc9qAJhPN3dkm04ICBdCCWRf4LGsOcl5dZQ1IuEyG6bGeJXBUncIWpAkx3 8urN2g0h2UqKpL8+8lFRjacmnHpTH9Tc8NGzJx++cFqVO1cIccB3WTM/JyhhPkmd/BSTIY +Gom9gjGCUCGoN3XvwcSmYrCC70SPXSyexefniS0HS1D/PI1MEBc5TpHYiHFPg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712571064; a=rsa-sha256; cv=none; b=T/zNsvGfVtP9pUQC7c9GR5FknIwIkR7tke7y5WWRoftDlko05W6yqzxB3Zoaxu1a5my1I9 Et1yiniLHFtb7e/PEZRe6KjVBe/70jWUPAznCohBvDQyYl49UzGei0GLWFVhluKZjsu5PU oceFIJ0v6pff5L4Zf6oaF1sc/jpOMGcSQLHF8L08PaCXsZoiX9S9GaxervYBBCqW/6SSmI N0zWmITvUQXnFuhq1kSpcHSEKg7voGxBgf2QgQ8H1beRQZTU78xuteViQGXAb9la9W1v0T FMDqLlOsWm6l/mglrKgkJcUhqct8epNQi0oqZFbO966zZm6HEylrwD8DUN320Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712571064; 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=AtPGOb+TPU5/0bi2tPFh/GXXVXcQuIys12caUVZHGlQ=; b=ZdhJqiu4CkV6Zzy9QHaw5BvBCRRQtKTFw7KIIMbWmjEagz+U548tLv7n1pawYLRbH0TRa1 a8ROfjAJEodXbsMk0tR9xO/BbF+u5pYWfr0JEgXn31kgt3+uKXx8jltoYQ8q9OoU0jE4ph DcbSRNq/p3zo07kYexqT4ssUdJbVk4ZyhHf3FNPSpmo3T8LZBKxQ8tmkDtijizSLYcTwVY syTxYZdJJRQ/hLkBT1a4mz1mQP7w9UscAa/7tzXSM589O9AfobOwBqtN/jNVUr5Z/1UOec A1DD2qnLHW0WWjYN9v+XXO7H2jlVWnTRCcxG2ZBVlpe7aQ7w4/SZrnb2aBwXpw== 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 4VClGw2ffqz16ch; Mon, 8 Apr 2024 10:11:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 438AB4WK091849; Mon, 8 Apr 2024 10:11:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 438AB4EE091846; Mon, 8 Apr 2024 10:11:04 GMT (envelope-from git) Date: Mon, 8 Apr 2024 10:11:04 GMT Message-Id: <202404081011.438AB4EE091846@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 59c3e7a18c7c - stable/14 - tarfs: Support paths that spill into exthdrs. 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: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 59c3e7a18c7c1795f90705a3d9d6d5d7480b7364 Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=59c3e7a18c7c1795f90705a3d9d6d5d7480b7364 commit 59c3e7a18c7c1795f90705a3d9d6d5d7480b7364 Author: Dag-Erling Smørgrav AuthorDate: 2024-04-03 09:55:01 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-04-08 10:10:41 +0000 tarfs: Support paths that spill into exthdrs. MFC after: 3 days Sponsored by: Juniper Networks, Inc. Sponsored by: Klara, Inc. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D44599 (cherry picked from commit b1fd95c9e24791d44593e611406b41e57826a5b8) tarfs: Ignore global extended headers. Previously, we would error out if we encountered a global extended header, because we don't know what it means. This doesn't really matter though, and traditionally, tar implementations have either ignored them or treated them as plain files, so just ignore them. This allows tarfs to mount tar files created by `git archive`. MFC after: 3 days Sponsored by: Juniper Networks, Inc. Sponsored by: Klara, Inc. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D44600 (cherry picked from commit 584e1c355ae3c994331005b7196cc87a714e5317) tarfs: Fix 32-bit build. MFC after: 3 days Sponsored by: Juniper Networks, Inc. Sponsored by: Klara, Inc. Reviewed by: bapt Differential Revision: https://reviews.freebsd.org/D44613 (cherry picked from commit 0238d3711d9b888f678fce4274eccc9175168395) --- sys/fs/tarfs/tarfs_vfsops.c | 28 +++++++++------ tests/sys/fs/tarfs/tarfs_test.sh | 74 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 91 insertions(+), 11 deletions(-) diff --git a/sys/fs/tarfs/tarfs_vfsops.c b/sys/fs/tarfs/tarfs_vfsops.c index d1af7070e706..365234113168 100644 --- a/sys/fs/tarfs/tarfs_vfsops.c +++ b/sys/fs/tarfs/tarfs_vfsops.c @@ -80,7 +80,7 @@ struct ustar_header { CTASSERT(sizeof(struct ustar_header) == TARFS_BLOCKSIZE); -#define TAR_EOF ((off_t)-1) +#define TAR_EOF ((size_t)-1) #define TAR_TYPE_FILE '0' #define TAR_TYPE_HARDLINK '1' @@ -430,13 +430,13 @@ tarfs_free_mount(struct tarfs_mount *tmp) * failure. */ static int -tarfs_alloc_one(struct tarfs_mount *tmp, off_t *blknump) +tarfs_alloc_one(struct tarfs_mount *tmp, size_t *blknump) { char block[TARFS_BLOCKSIZE]; struct ustar_header *hdrp = (struct ustar_header *)block; struct sbuf *namebuf = NULL; char *exthdr = NULL, *name = NULL, *link = NULL; - off_t blknum = *blknump; + size_t blknum = *blknump; int64_t num; int endmarker = 0; char *namep, *sep; @@ -553,13 +553,14 @@ again: TARFS_DPF(ALLOC, "%s: [%c] %zu @%jd %o %d:%d\n", __func__, hdrp->typeflag[0], sz, (intmax_t)mtime, mode, uid, gid); - /* extended header? */ + /* global extended header? */ if (hdrp->typeflag[0] == TAR_TYPE_GLOBAL_EXTHDR) { - printf("%s: unsupported global extended header at %zu\n", - __func__, (size_t)(TARFS_BLOCKSIZE * (blknum - 1))); - error = EFTYPE; - goto bad; + TARFS_DPF(ALLOC, "%s: %zu-byte global extended header at %zu\n", + __func__, sz, TARFS_BLOCKSIZE * (blknum - 1)); + goto skip; } + + /* extended header? */ if (hdrp->typeflag[0] == TAR_TYPE_EXTHDR) { if (exthdr != NULL) { TARFS_DPF(IO, "%s: multiple extended headers at %zu\n", @@ -568,7 +569,7 @@ again: goto bad; } /* read the contents of the exthdr */ - TARFS_DPF(ALLOC, "%s: %zu-byte extended header at %zd\n", + TARFS_DPF(ALLOC, "%s: %zu-byte extended header at %zu\n", __func__, sz, TARFS_BLOCKSIZE * (blknum - 1)); exthdr = malloc(sz, M_TEMP, M_WAITOK); res = tarfs_io_read_buf(tmp, false, exthdr, @@ -614,7 +615,10 @@ again: value = sep + 1; TARFS_DPF(ALLOC, "%s: exthdr %s=%s\n", __func__, key, value); - if (strcmp(key, "linkpath") == 0) { + if (strcmp(key, "path") == 0) { + name = value; + namelen = eol - value; + } else if (strcmp(key, "linkpath") == 0) { link = value; linklen = eol - value; } else if (strcmp(key, "GNU.sparse.major") == 0) { @@ -857,7 +861,7 @@ tarfs_alloc_mount(struct mount *mp, struct vnode *vp, struct thread *td = curthread; struct tarfs_mount *tmp; struct tarfs_node *root; - off_t blknum; + size_t blknum; time_t mtime; int error; @@ -905,6 +909,8 @@ tarfs_alloc_mount(struct mount *mp, struct vnode *vp, blknum = 0; do { if ((error = tarfs_alloc_one(tmp, &blknum)) != 0) { + printf("unsupported or corrupt tar file at %zu\n", + TARFS_BLOCKSIZE * blknum); goto bad; } } while (blknum != TAR_EOF); diff --git a/tests/sys/fs/tarfs/tarfs_test.sh b/tests/sys/fs/tarfs/tarfs_test.sh index 2a5dfc434201..f1322033fbad 100644 --- a/tests/sys/fs/tarfs/tarfs_test.sh +++ b/tests/sys/fs/tarfs/tarfs_test.sh @@ -309,6 +309,77 @@ tarfs_checksum_cleanup() { tarfs_cleanup } +atf_test_case tarfs_long_names cleanup +tarfs_long_names_head() { + atf_set "descr" "Verify that tarfs supports long file names" + atf_set "require.user" "root" +} +tarfs_long_names_body() { + tarfs_setup + local a b c d e + a="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + b="bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" + c="cccccccccccccccccccccccccccccccccccccccc" + d="dddddddddddddddddddddddddddddddddddddddd" + e="eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee" + mkdir -p "${a}" + touch "${a}/${b}_${c}_${d}_${e}_foo" + ln "${a}/${b}_${c}_${d}_${e}_foo" "${a}/${b}_${c}_${d}_${e}_bar" + ln -s "${b}_${c}_${d}_${e}_bar" "${a}/${b}_${c}_${d}_${e}_baz" + tar -cf tarfs_long_names.tar "${a}" + atf_check mount -rt tarfs tarfs_long_names.tar "${mnt}" +} +tarfs_long_names_cleanup() { + tarfs_cleanup +} + +atf_test_case tarfs_long_paths cleanup +tarfs_long_paths_head() { + atf_set "descr" "Verify that tarfs supports long paths" + atf_set "require.user" "root" +} +tarfs_long_paths_body() { + tarfs_setup + local a b c d e + a="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + b="bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" + c="cccccccccccccccccccccccccccccccccccccccc" + d="dddddddddddddddddddddddddddddddddddddddd" + e="eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee" + mkdir -p "${a}/${b}/${c}/${d}/${e}" + touch "${a}/${b}/${c}/${d}/${e}/foo" + ln "${a}/${b}/${c}/${d}/${e}/foo" "${a}/${b}/${c}/${d}/${e}/bar" + ln -s "${b}/${c}/${d}/${e}/bar" "${a}/baz" + tar -cf tarfs_long_paths.tar "${a}" + atf_check mount -rt tarfs tarfs_long_paths.tar "${mnt}" +} +tarfs_long_paths_cleanup() { + tarfs_cleanup +} + +atf_test_case tarfs_git_archive cleanup +tarfs_git_archive_head() { + atf_set "descr" "Verify that tarfs supports archives created by git" + atf_set "require.user" "root" + atf_set "require.progs" "git" +} +tarfs_git_archive_body() { + tarfs_setup + mkdir foo + echo "Hello, world!" >foo/bar + git -C foo init --initial-branch=tarfs + git -C foo config user.name "File System" + git -C foo config user.email fs@freebsd.org + git -C foo add bar + git -C foo commit -m bar + git -C foo archive --output=../tarfs_git_archive.tar HEAD + atf_check mount -rt tarfs tarfs_git_archive.tar "${mnt}" + atf_check -o file:foo/bar cat "${mnt}"/bar +} +tarfs_git_archive_cleanup() { + tarfs_cleanup +} + atf_init_test_cases() { atf_add_test_case tarfs_basic atf_add_test_case tarfs_basic_gnu @@ -324,4 +395,7 @@ atf_init_test_cases() { atf_add_test_case tarfs_linktodir atf_add_test_case tarfs_linktononexistent atf_add_test_case tarfs_checksum + atf_add_test_case tarfs_long_names + atf_add_test_case tarfs_long_paths + atf_add_test_case tarfs_git_archive } From nobody Mon Apr 8 10:11:05 2024 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 4VClGx70fxz5Gj4k; Mon, 8 Apr 2024 10:11: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 4VClGx3xSbz4VMr; Mon, 8 Apr 2024 10:11:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712571065; 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=CCEy2eUy7EuQ4txAKI8H12nY9jdVQJDsYi7AtbrOqVQ=; b=GNzHgpjbxV0ZXfGBxJSS1aLeuJNzNxxnmB9SkpqBOy/c9iSatq7AfudnIbE49JeB2kTVMY OOg2WI1lqGZCKFV48huAeKHtyJ6mSltwRY/l99+DbbDvrIUc0deI0U5r/YUoCDCc9rKcvP 3wGnDYhULDdc3+xEVBdxYA21do1bfiDNR3HZ9Ng9k/a1Eh6S950uvWgAaE5r/YQ5A8DL3I QBKZZQB5frskGoAxDt+1vX9BbTkTcTeWatWwF9KMdU3AMZGqv2BOAL0l6IoDOHZcAMAMjx lD4yRlJoz1xuAbP3jmI0SDBM29k8xwMUxzPqimrHSxx0b657xfiPfeGMNq7x8w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712571065; a=rsa-sha256; cv=none; b=I4OOda7Y1WLBh8ZtTCGWzFRkiNSaj7z+QPTjEI7IWpav0JkbVuBvtbeWvdFVz+b1o+0yAM ox8L63rSG6oLJzLFwWDpkzoAt57j+qGt9Ney4cngn1uDXoRG7mNqegHa36ibMKvar4SHJ4 NXpee2CX+gv1Z0yu0BGy7Hky5pcoijpgUCXkPqQbQbeybQ8TB0L22zLRIFKPc/YgmMXDsK vvZzwuBqh7vQJaITpbf92AxL3g7oTZFGpnr7/39gWoGJq0VWDMFIzXhwvQ3JY72eBLAJku ++DYnAQc2zz/12WD20KmlqrxrQ7YzPGAlEUJ06XNYJWNpwqbIFUPhzN7tzMa2Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712571065; 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=CCEy2eUy7EuQ4txAKI8H12nY9jdVQJDsYi7AtbrOqVQ=; b=erbklC6tSuiB3OXOZhAFvBuRXSThWDIokwSAGdIWKbIXOVlGu/ZwaK5OSoj32FWU5ZjbJ0 NG7fuYgZBNLY9m4b9dSHP6v2x7iftsRCQv3L9Ig1DHojbrX5r+4e4puESvrpp+Tzbhd4dD DqHUPCOaR1qRtvscSyCGPeh0FLxOzQpfQrmpEhned5aPOD9MDEeou0R69P+AJlrR8RbQm+ UllnK6QGhiZ0bGs33F/sSwedv1Wur0gP535oNrHeGKkjRK0PdxdQVjDpexemtBndcctjQF JVxArnNW2FzxScXt1gtoLlh1Rid3veHL8kAyxasU7P/vBtVUU6ZwcGE4mVa49g== 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 4VClGx3MVyz16BT; Mon, 8 Apr 2024 10:11:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 438AB5ro091897; Mon, 8 Apr 2024 10:11:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 438AB5LV091894; Mon, 8 Apr 2024 10:11:05 GMT (envelope-from git) Date: Mon, 8 Apr 2024 10:11:05 GMT Message-Id: <202404081011.438AB5LV091894@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: e9ab8b45822f - stable/14 - ln: Improve link(1) variant of ln(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: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e9ab8b45822f30173c408480e8df975084135731 Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=e9ab8b45822f30173c408480e8df975084135731 commit e9ab8b45822f30173c408480e8df975084135731 Author: Dag-Erling Smørgrav AuthorDate: 2024-04-04 14:14:50 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-04-08 10:10:41 +0000 ln: Improve link(1) variant of ln(1). * Give link(1) its own usage message. * Use getprogname(3) instead of rolling our own. * Verify that the target file does not already exist. * Add tests specific to link(1). MFC after: 3 days Sponsored by: Klara, Inc. Reviewed by: allanjude Differential Revision: https://reviews.freebsd.org/D44635 (cherry picked from commit bee7cf9e97f6d7bdc918421a93270fa88659808b) --- bin/ln/ln.c | 32 +++++++++++++++--------- bin/ln/tests/ln_test.sh | 65 ++++++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 83 insertions(+), 14 deletions(-) diff --git a/bin/ln/ln.c b/bin/ln/ln.c index a0e19d702dea..3919494c3d4c 100644 --- a/bin/ln/ln.c +++ b/bin/ln/ln.c @@ -67,13 +67,14 @@ static bool wflag; /* Warn if symlink target does not static char linkch; static int linkit(const char *, const char *, bool); +static void link_usage(void) __dead2; static void usage(void) __dead2; int main(int argc, char *argv[]) { struct stat sb; - char *p, *targetdir; + char *targetdir; int ch, exitval; /* @@ -81,17 +82,20 @@ main(int argc, char *argv[]) * "link", for which the functionality provided is greatly * simplified. */ - if ((p = strrchr(argv[0], '/')) == NULL) - p = argv[0]; - else - ++p; - if (strcmp(p, "link") == 0) { + if (strcmp(getprogname(), "link") == 0) { while (getopt(argc, argv, "") != -1) - usage(); + link_usage(); argc -= optind; argv += optind; if (argc != 2) - usage(); + link_usage(); + if (lstat(argv[1], &sb) == 0) + errc(1, EEXIST, "%s", argv[1]); + /* + * We could simply call link(2) here, but linkit() + * performs additional checks and gives better + * diagnostics. + */ exit(linkit(argv[0], argv[1], false)); } @@ -349,12 +353,18 @@ linkit(const char *source, const char *target, bool isdir) return (0); } +static void +link_usage(void) +{ + (void)fprintf(stderr, "usage: link source_file target_file\n"); + exit(1); +} + static void usage(void) { - (void)fprintf(stderr, "%s\n%s\n%s\n", + (void)fprintf(stderr, "%s\n%s\n", "usage: ln [-s [-F] | -L | -P] [-f | -i] [-hnv] source_file [target_file]", - " ln [-s [-F] | -L | -P] [-f | -i] [-hnv] source_file ... target_dir", - " link source_file target_file"); + " ln [-s [-F] | -L | -P] [-f | -i] [-hnv] source_file ... target_dir"); exit(1); } diff --git a/bin/ln/tests/ln_test.sh b/bin/ln/tests/ln_test.sh index 8e5dcf81e61f..82bc556842d8 100644 --- a/bin/ln/tests/ln_test.sh +++ b/bin/ln/tests/ln_test.sh @@ -90,7 +90,7 @@ target_exists_hard_body() { atf_check touch A B atf_check -s exit:1 -e inline:'ln: B: File exists\n' \ - ln A B + ln A B } atf_test_case target_exists_symbolic @@ -103,7 +103,7 @@ target_exists_symbolic_body() { atf_check touch A B atf_check -s exit:1 -e inline:'ln: B: File exists\n' \ - ln -s A B + ln -s A B } atf_test_case shf_flag_dir @@ -210,10 +210,65 @@ sw_flag_head() sw_flag_body() { atf_check -s exit:0 -e inline:'ln: warning: A: No such file or directory\n' \ - ln -sw A B + ln -sw A B atf_check_symlink_to A B } +atf_test_case link_argc +link_argc_head() { + atf_set "descr" "Verify that link(1) requires exactly two arguments" +} +link_argc_body() { + atf_check -s exit:1 -e match:"usage: link" \ + link foo + atf_check -s exit:1 -e match:"No such file" \ + link foo bar + atf_check -s exit:1 -e match:"No such file" \ + link -- foo bar + atf_check -s exit:1 -e match:"usage: link" \ + link foo bar baz +} + +atf_test_case link_basic +link_basic_head() { + atf_set "descr" "Verify that link(1) creates a link" +} +link_basic_body() { + touch foo + atf_check link foo bar + atf_check_same_file foo bar + rm bar + ln -s foo bar + atf_check link bar baz + atf_check_same_file foo baz +} + +atf_test_case link_eexist +link_eexist_head() { + atf_set "descr" "Verify that link(1) fails if the target exists" +} +link_eexist_body() { + touch foo bar + atf_check -s exit:1 -e match:"bar.*exists" \ + link foo bar + ln -s non-existent baz + atf_check -s exit:1 -e match:"baz.*exists" \ + link foo baz +} + +atf_test_case link_eisdir +link_eisdir_head() { + atf_set "descr" "Verify that link(1) fails if the source is a directory" +} +link_eisdir_body() { + mkdir foo + atf_check -s exit:1 -e match:"foo.*directory" \ + link foo bar + ln -s foo bar + atf_check -s exit:1 -e match:"bar.*directory" \ + link bar baz +} + atf_init_test_cases() { atf_add_test_case L_flag @@ -229,4 +284,8 @@ atf_init_test_cases() atf_add_test_case s_flag atf_add_test_case s_flag_broken atf_add_test_case sw_flag + atf_add_test_case link_argc + atf_add_test_case link_basic + atf_add_test_case link_eexist + atf_add_test_case link_eisdir } From nobody Mon Apr 8 10:11:41 2024 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 4VClHd516hz5GjQW; Mon, 8 Apr 2024 10:11:41 +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 4VClHd3Z5bz4WNn; Mon, 8 Apr 2024 10:11:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712571101; 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=JlKHBr4NFyPm7k1Hjxl2YpF7yUod0MnAaeHwwCxuo2s=; b=VvVr8cbpLLYNYNyiudhsC0/SKSQqksKjW2Xa1s5L2JMDlFytscLsBlH0ZpSYPhAAcidU7Z 8GYYfxM/z19fdhRcHHMlOnWKZ3LuJrxid2wXprnexwlgnTQGcfdAxE+EaQATKJZH/iF8hh 2h+49aNJlZ10DnM8qnGjfc5ctSFd8mnp/L7u9azK47EFjmtnR1UPCq8OIirsKY6iuR6E4q qpGjPrHSC61Y8lyjD+BtB53JFJTuw1lGGpnzKL6FGF69KE7+8qdfmsbMwwEzsL+5+FhUi8 S/bfZK39iE9e92+cZZGSPGwqBKhuOsqI39lITgN9qcmxsedL/aXH/1tmZIIlCA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712571101; a=rsa-sha256; cv=none; b=eSo9ul9fXwdCdww4m9J5v+VPpMVtHLg4Dwn+wCpiZKQTzbzc/UTbq8SYnR/Q5foG1kcL7L u7s2HycLYQxZLgvflroY6EqW0i/gotNtVrSrMjQ/s9PrRSdMzDFLttweZnAslyV5X+Dzpr mfKonxHDG5bRBy6farfk8pEUC5IHjlE3EzUNraYUxHnYKpmGsOoN12v2hQkby5D64qbkl5 cKzguMpznNZe1jhLUZ7QU4ExD5afWY/fKRV0AFlUzpKJFzS1FLDaMAvoshW1idlGI3GWIQ 4JTWLDxokKHFPWQiQytQx2tA//FxOAE9WhE0+PM6n/RMVunSp2fBmVMC0PK6rA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712571101; 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=JlKHBr4NFyPm7k1Hjxl2YpF7yUod0MnAaeHwwCxuo2s=; b=i3yMNJbroBHKy88BO71YSALw8lFcE0zP6t3XJ/pOmT520c99TnpBR+BqBSEoA5qubUeHpc ZNvgGipWHABxhApJVJA8nq1shYyCEDZMPm5yQeBHxECmbJXm2dXOMhCXfzuHBtmddKfpVT 8dqlSJ6YYUvhL/ooBfHr+QBXUVGulR25rZIWiMa/Li/VpY1Q292GArRk6IN6uAbPk/7MkU V0tGMmZpYuJ9059icBFDGd/h1DKZodILCrfWlACVwygznWCG5STDPEGgyITIBgshqhcDqo eEN3U7z+pOUw8f6q6dDe6JiNNAKx1sfW+vGSDNSQTep6TCW2RB5a0WSQcGcipg== 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 4VClHd39hbz15vD; Mon, 8 Apr 2024 10:11:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 438ABfXL093368; Mon, 8 Apr 2024 10:11:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 438ABf6B093365; Mon, 8 Apr 2024 10:11:41 GMT (envelope-from git) Date: Mon, 8 Apr 2024 10:11:41 GMT Message-Id: <202404081011.438ABf6B093365@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 39d543db53a4 - stable/13 - cp: Improved conformance when copying directories. 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: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 39d543db53a456d97e3dec12b22ac191360b8866 Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=39d543db53a456d97e3dec12b22ac191360b8866 commit 39d543db53a456d97e3dec12b22ac191360b8866 Author: Dag-Erling Smørgrav AuthorDate: 2024-04-01 17:28:58 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-04-08 10:10:14 +0000 cp: Improved conformance when copying directories. * When copying a directory, if the destination exists and is not a directory, we would previously emit an error message and exit. The correct behavior according to POSIX is to emit an error message and continue without descending further into the source directory. * When copying a directory, if the destination does not exist and we fail to create it, we would previously emit an error message and exit. The correct behavior according to POSIX is to emit an error message and continue. Whether to descend further into the source directory is explicitly left unspecified; GNU cp does not, which seems to me to be the safer and less surprising option, so let's not either. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D44577 (cherry picked from commit dd286b0dc187c351a9537a363840245d5505b15b) cp: Correct the list of non-portable flags. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D44576 (cherry picked from commit aaa1806f68ef3102a9b888a03360f166b88618c8) --- bin/cp/cp.1 | 8 +++++--- bin/cp/cp.c | 27 ++++++++++++++++++--------- 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/bin/cp/cp.1 b/bin/cp/cp.1 index d8d62ef076a1..90b1a158a131 100644 --- a/bin/cp/cp.1 +++ b/bin/cp/cp.1 @@ -31,7 +31,7 @@ .\" .\" @(#)cp.1 8.3 (Berkeley) 4/18/94 .\" -.Dd December 14, 2023 +.Dd March 28, 2024 .Dt CP 1 .Os .Sh NAME @@ -311,12 +311,14 @@ differ as they copy special files as normal files while recreating a hierarchy. .Pp The +.Fl a , .Fl l , +.Fl N , +.Fl n , .Fl s , .Fl v , -.Fl x and -.Fl n +.Fl x options are non-standard and their use in scripts is not recommended. .Sh SEE ALSO .Xr mv 1 , diff --git a/bin/cp/cp.c b/bin/cp/cp.c index 852868e65dcb..af7d5ffac398 100644 --- a/bin/cp/cp.c +++ b/bin/cp/cp.c @@ -519,9 +519,13 @@ copy(char *argv[], enum op type, int fts_options, struct stat *root_stat) * umask blocks owner writes, we fail. */ if (dne) { - if (mkdir(to.p_path, - curr->fts_statp->st_mode | S_IRWXU) < 0) - err(1, "%s", to.p_path); + mode = curr->fts_statp->st_mode | S_IRWXU; + if (mkdir(to.p_path, mode) != 0) { + warn("%s", to.p_path); + (void)fts_set(ftsp, curr, FTS_SKIP); + badcp = rval = 1; + break; + } /* * First DNE with a NULL root_stat is the root * path, so set root_stat. We can't really @@ -530,14 +534,19 @@ copy(char *argv[], enum op type, int fts_options, struct stat *root_stat) * first directory we created and use that. */ if (root_stat == NULL && - stat(to.p_path, &created_root_stat) == -1) { - err(1, "stat"); - } else if (root_stat == NULL) { - root_stat = &created_root_stat; + stat(to.p_path, &created_root_stat) != 0) { + warn("%s", to.p_path); + (void)fts_set(ftsp, curr, FTS_SKIP); + badcp = rval = 1; + break; } + if (root_stat == NULL) + root_stat = &created_root_stat; } else if (!S_ISDIR(to_stat.st_mode)) { - errno = ENOTDIR; - err(1, "%s", to.p_path); + warnc(ENOTDIR, "%s", to.p_path); + (void)fts_set(ftsp, curr, FTS_SKIP); + badcp = rval = 1; + break; } /* * Arrange to correct directory attributes later From nobody Mon Apr 8 10:11:42 2024 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 4VClHg0HqMz5GjSg; Mon, 8 Apr 2024 10:11: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 4VClHf4WGPz4WJq; Mon, 8 Apr 2024 10:11:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712571102; 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=YuFr8oPzh7YJkPmOix+lXv+e9nsZg9egeISRmKoBOi8=; b=I1MOsueTjzD8AyY/GtNBmDfnhRzyhJRuaAWfVV1aTQufn0Fqdt4BrQN/aRoX9r/TjZQLzy GERolG2eTyVdIgd2DQUomQLNPHYxIP6OMDniI1aDrUA89MV3P2P9JqsZD/ys7l+GHVpp3d lE6yxoXTyvE4yu+QfEH06s4x90W35HYeUIEOMe/8YmGSoA1HMd2jhrYG2f1pilBd6TjKJM VDdG8be2MkvmCI/+I/+yxZWV4IXx5/HSuwIRjWlgSun0tbrl0SF5YlUJs6ewscUSFyFHyz nbcyYtAFfT1DR5njU81sg86fML7HLZzRxSkiyBe79zUOacH9m304FLXdhqlByQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712571102; a=rsa-sha256; cv=none; b=JJEbKWiTLeVAuyknbrz6gGRPiOkiuaDVGmvdss6CZPmde3NSrTduz/BnGaCRabYT23sbng Zp7zU0Tyf6bOvN5Jiipq4rTQSZ6Fa/8f7V0XXJpmW1lyLs4M4lYqBw7OySXQN8NrIsUe/5 bZdT7REU7zpmpFflRz36hLECrEwhpBDHdNOTFKyMmVl+1mIDRxLLiuGSv0CqrEsPRo7UN7 rzLxHycpeT4IWvyXojvThRx/RO3UeyhLtYPMfwA3kmaJ2G4Sghyv+LTV/W656OrN8XqwJs dK11dE1uk6QdrgU5aQffS/sp3Ng6MBuXKDQ6hMeOawJwFa8gzayLNC0BzqJS7A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712571102; 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=YuFr8oPzh7YJkPmOix+lXv+e9nsZg9egeISRmKoBOi8=; b=RG8smckG3EjEcpBfxf9oh9Oxk4DtUhQDOtr5a2Y2qIcvfnaBt9MNLoEIO/nB/BqfOF3t1U 7pAQrslW8UkEnZ8IKYgRYBA0D3i7u1oSKgmpeaKa6EpSgbbjvuQWURkKK4mOFHtOQ/HrMZ URDLVBHk0burlKlgSexqV86pUP/y17KbPB5VWMwDQ3MRAZoDvuKU/h4w/21N9bfQRwdwWf 1oyd8bFAyMkziIGlaBV8Uu/Qfv0T9r+Ew2KMYn+wDplxpPvtjLFyvnVJYURQfwte89oJe1 tlWtkmN+fw48MtfyALFRC3p+i7Ch0sfIcD9UrM0GspKrsIaD46HUmza2XO9fNw== 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 4VClHf46zSz16sN; Mon, 8 Apr 2024 10:11:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 438ABgId093417; Mon, 8 Apr 2024 10:11:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 438ABgHf093414; Mon, 8 Apr 2024 10:11:42 GMT (envelope-from git) Date: Mon, 8 Apr 2024 10:11:42 GMT Message-Id: <202404081011.438ABgHf093414@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: dc0087a3aa78 - stable/13 - ln: Improve link(1) variant of ln(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: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: dc0087a3aa788dbee4f3b4ab0270fdbb48bc20c9 Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=dc0087a3aa788dbee4f3b4ab0270fdbb48bc20c9 commit dc0087a3aa788dbee4f3b4ab0270fdbb48bc20c9 Author: Dag-Erling Smørgrav AuthorDate: 2024-04-04 14:14:50 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-04-08 10:10:15 +0000 ln: Improve link(1) variant of ln(1). * Give link(1) its own usage message. * Use getprogname(3) instead of rolling our own. * Verify that the target file does not already exist. * Add tests specific to link(1). MFC after: 3 days Sponsored by: Klara, Inc. Reviewed by: allanjude Differential Revision: https://reviews.freebsd.org/D44635 (cherry picked from commit bee7cf9e97f6d7bdc918421a93270fa88659808b) --- bin/ln/ln.c | 32 +++++++++++++++--------- bin/ln/tests/ln_test.sh | 65 ++++++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 83 insertions(+), 14 deletions(-) diff --git a/bin/ln/ln.c b/bin/ln/ln.c index a0e19d702dea..3919494c3d4c 100644 --- a/bin/ln/ln.c +++ b/bin/ln/ln.c @@ -67,13 +67,14 @@ static bool wflag; /* Warn if symlink target does not static char linkch; static int linkit(const char *, const char *, bool); +static void link_usage(void) __dead2; static void usage(void) __dead2; int main(int argc, char *argv[]) { struct stat sb; - char *p, *targetdir; + char *targetdir; int ch, exitval; /* @@ -81,17 +82,20 @@ main(int argc, char *argv[]) * "link", for which the functionality provided is greatly * simplified. */ - if ((p = strrchr(argv[0], '/')) == NULL) - p = argv[0]; - else - ++p; - if (strcmp(p, "link") == 0) { + if (strcmp(getprogname(), "link") == 0) { while (getopt(argc, argv, "") != -1) - usage(); + link_usage(); argc -= optind; argv += optind; if (argc != 2) - usage(); + link_usage(); + if (lstat(argv[1], &sb) == 0) + errc(1, EEXIST, "%s", argv[1]); + /* + * We could simply call link(2) here, but linkit() + * performs additional checks and gives better + * diagnostics. + */ exit(linkit(argv[0], argv[1], false)); } @@ -349,12 +353,18 @@ linkit(const char *source, const char *target, bool isdir) return (0); } +static void +link_usage(void) +{ + (void)fprintf(stderr, "usage: link source_file target_file\n"); + exit(1); +} + static void usage(void) { - (void)fprintf(stderr, "%s\n%s\n%s\n", + (void)fprintf(stderr, "%s\n%s\n", "usage: ln [-s [-F] | -L | -P] [-f | -i] [-hnv] source_file [target_file]", - " ln [-s [-F] | -L | -P] [-f | -i] [-hnv] source_file ... target_dir", - " link source_file target_file"); + " ln [-s [-F] | -L | -P] [-f | -i] [-hnv] source_file ... target_dir"); exit(1); } diff --git a/bin/ln/tests/ln_test.sh b/bin/ln/tests/ln_test.sh index 8e5dcf81e61f..82bc556842d8 100644 --- a/bin/ln/tests/ln_test.sh +++ b/bin/ln/tests/ln_test.sh @@ -90,7 +90,7 @@ target_exists_hard_body() { atf_check touch A B atf_check -s exit:1 -e inline:'ln: B: File exists\n' \ - ln A B + ln A B } atf_test_case target_exists_symbolic @@ -103,7 +103,7 @@ target_exists_symbolic_body() { atf_check touch A B atf_check -s exit:1 -e inline:'ln: B: File exists\n' \ - ln -s A B + ln -s A B } atf_test_case shf_flag_dir @@ -210,10 +210,65 @@ sw_flag_head() sw_flag_body() { atf_check -s exit:0 -e inline:'ln: warning: A: No such file or directory\n' \ - ln -sw A B + ln -sw A B atf_check_symlink_to A B } +atf_test_case link_argc +link_argc_head() { + atf_set "descr" "Verify that link(1) requires exactly two arguments" +} +link_argc_body() { + atf_check -s exit:1 -e match:"usage: link" \ + link foo + atf_check -s exit:1 -e match:"No such file" \ + link foo bar + atf_check -s exit:1 -e match:"No such file" \ + link -- foo bar + atf_check -s exit:1 -e match:"usage: link" \ + link foo bar baz +} + +atf_test_case link_basic +link_basic_head() { + atf_set "descr" "Verify that link(1) creates a link" +} +link_basic_body() { + touch foo + atf_check link foo bar + atf_check_same_file foo bar + rm bar + ln -s foo bar + atf_check link bar baz + atf_check_same_file foo baz +} + +atf_test_case link_eexist +link_eexist_head() { + atf_set "descr" "Verify that link(1) fails if the target exists" +} +link_eexist_body() { + touch foo bar + atf_check -s exit:1 -e match:"bar.*exists" \ + link foo bar + ln -s non-existent baz + atf_check -s exit:1 -e match:"baz.*exists" \ + link foo baz +} + +atf_test_case link_eisdir +link_eisdir_head() { + atf_set "descr" "Verify that link(1) fails if the source is a directory" +} +link_eisdir_body() { + mkdir foo + atf_check -s exit:1 -e match:"foo.*directory" \ + link foo bar + ln -s foo bar + atf_check -s exit:1 -e match:"bar.*directory" \ + link bar baz +} + atf_init_test_cases() { atf_add_test_case L_flag @@ -229,4 +284,8 @@ atf_init_test_cases() atf_add_test_case s_flag atf_add_test_case s_flag_broken atf_add_test_case sw_flag + atf_add_test_case link_argc + atf_add_test_case link_basic + atf_add_test_case link_eexist + atf_add_test_case link_eisdir } From nobody Mon Apr 8 13:15:43 2024 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 4VCqMz5C7Lz5H1Xc; Mon, 8 Apr 2024 13:15: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 4VCqMz4rVyz4rlT; Mon, 8 Apr 2024 13:15:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712582143; 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=rUUgWDt2CHJvICvXafGCqujTBOTlncE+REsFa6dFew0=; b=nKrl7I66gGQu9tceiWAUtuetrvXF1TJOYlUAaHAGrNnxdflYe6MgJ/9zhMJOGnIKeqDbDB z9GLokweBmfSQ9NtQS+CgTLyTogMxKN7ea38TCKqG4W3mjozp3vjokxU1qQaDbrgymF+4b DCTDZ736ZlYJBMaaSzMS9B/rc0smxmoSq8oLqgNLuMtKtWuIE5EQb5uMCgUJTA45MPtKbC 6xjQ+MlJKM8YZQlI9PTvNgeg0xMVcrrodqH5v5CU80cqymvE69yRY3NQBrzp0+s44kApA7 ZDTfRVbSayV8GpRyC7BHEdnfKEt2egv6SEHjFcP+gYzWVF7TvJcOHvNIVgRsjg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712582143; a=rsa-sha256; cv=none; b=XD28vU/0iDWMbZQ64xX7md/Cwkp5Vcf6lcvDPCBDr2/t2v99myyvl0vI/+pTZqwgDJIUQy 2m9XHwRBvu8QoEeziXiKeAIIeF2W9OA+LHqbrj3Md31QPVvnp2X2bwg0MXFroLIPeUPHyY Rn3IlLlWEb0RKS0wkcoAWCJ7+1DqqXu3++vRQpwu/QCBN5UMTvqeVtfvG9F8vNdWW6JTPH 9o8N/l/D852CTBbk2y2d9fM3celntu0VkH4mm871lVIqLjtbPb/Bnu6KjJeOwCYPPu8Qx0 zi1KQ8tKicoyAZzeLp4vqLXwTBQd4XH55hhDBkeDDjueIv5ICJtREjKlDg0mMQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712582143; 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=rUUgWDt2CHJvICvXafGCqujTBOTlncE+REsFa6dFew0=; b=krk3XlgmIwJ5LZEJ/IHOL2o35T+ov/c30PsvtmM/YdHGLrdkVGJmbSMGdlHx0a9gCQWSlk wtYh0GAq1XbJKKtdfgpm/tHjY3LRg+N8+2b7QyFzrbuIWKjMhR0u6iS4cpZZpNGHRsIY6c Cw0ESQ28gRtqnGUJHil7ziW2SXDhH1c+ZjR8K8N1ftBzqqDH1k7eEvIob0YxS5L0mPRkNo 7R0cy91rRC6tUlYzXieD7MpVFoG0neMxBHpYtHNzkh2LWr+kB69Wvu3lOAN29KrN3EIAf2 pbQ0cRftuVw5VK+LBsBAwvJIC+pUaC71PbaqhAgIutteoPbKC2CgYs6ESUEhMQ== 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 4VCqMz4P9bz1CB0; Mon, 8 Apr 2024 13:15:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 438DFh2H001329; Mon, 8 Apr 2024 13:15:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 438DFhSg001326; Mon, 8 Apr 2024 13:15:43 GMT (envelope-from git) Date: Mon, 8 Apr 2024 13:15:43 GMT Message-Id: <202404081315.438DFhSg001326@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 35f6b83049da - stable/14 - Update the Arm Optimized Routine library to v24.01 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: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 35f6b83049dabe18277ac0fcc73ede6ed7f3a1a6 Auto-Submitted: auto-generated The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=35f6b83049dabe18277ac0fcc73ede6ed7f3a1a6 commit 35f6b83049dabe18277ac0fcc73ede6ed7f3a1a6 Author: Andrew Turner AuthorDate: 2024-02-29 11:39:12 +0000 Commit: Andrew Turner CommitDate: 2024-04-08 13:15:18 +0000 Update the Arm Optimized Routine library to v24.01 Sponsored by: Arm Ltd (cherry picked from commit 5a02ffc32e777041dd2dad4e651ed2a0865a0a5d) --- contrib/arm-optimized-routines/README | 2 +- contrib/arm-optimized-routines/config.mk.dist | 13 +- contrib/arm-optimized-routines/math/Dir.mk | 6 +- .../arm-optimized-routines/math/aarch64/v_cos.c | 87 + .../arm-optimized-routines/math/aarch64/v_cosf.c | 82 + .../arm-optimized-routines/math/aarch64/v_exp.c | 125 + .../arm-optimized-routines/math/aarch64/v_exp2f.c | 113 + .../math/aarch64/v_exp2f_1u.c | 72 + .../math/aarch64/v_exp_data.c | 146 + .../arm-optimized-routines/math/aarch64/v_expf.c | 122 + .../math/aarch64/v_expf_1u.c | 77 + .../arm-optimized-routines/math/aarch64/v_log.c | 100 + .../math/aarch64/v_log_data.c | 156 + .../arm-optimized-routines/math/aarch64/v_logf.c | 74 + .../arm-optimized-routines/math/aarch64/v_math.h | 135 + .../arm-optimized-routines/math/aarch64/v_pow.c | 22 + .../arm-optimized-routines/math/aarch64/v_powf.c | 148 + .../arm-optimized-routines/math/aarch64/v_sin.c | 97 + .../arm-optimized-routines/math/aarch64/v_sinf.c | 82 + contrib/arm-optimized-routines/math/exp10.c | 129 + contrib/arm-optimized-routines/math/exp_data.c | 23 +- .../arm-optimized-routines/math/include/mathlib.h | 67 +- contrib/arm-optimized-routines/math/math_config.h | 61 +- contrib/arm-optimized-routines/math/s_cos.c | 6 - contrib/arm-optimized-routines/math/s_cosf.c | 6 - contrib/arm-optimized-routines/math/s_exp.c | 6 - contrib/arm-optimized-routines/math/s_exp2f.c | 6 - contrib/arm-optimized-routines/math/s_exp2f_1u.c | 6 - contrib/arm-optimized-routines/math/s_expf.c | 6 - contrib/arm-optimized-routines/math/s_expf_1u.c | 6 - contrib/arm-optimized-routines/math/s_log.c | 6 - contrib/arm-optimized-routines/math/s_logf.c | 6 - contrib/arm-optimized-routines/math/s_pow.c | 6 - contrib/arm-optimized-routines/math/s_powf.c | 6 - contrib/arm-optimized-routines/math/s_sin.c | 6 - contrib/arm-optimized-routines/math/s_sinf.c | 6 - .../arm-optimized-routines/math/test/mathbench.c | 152 +- .../math/test/mathbench_funcs.h | 50 +- .../math/test/mathbench_wrappers.h | 42 +- .../arm-optimized-routines/math/test/mathtest.c | 9 +- contrib/arm-optimized-routines/math/test/runulp.sh | 112 +- .../math/test/testcases/directed/exp10.tst | 15 + contrib/arm-optimized-routines/math/test/ulp.c | 81 +- contrib/arm-optimized-routines/math/test/ulp.h | 29 +- .../arm-optimized-routines/math/test/ulp_funcs.h | 50 +- .../math/test/ulp_wrappers.h | 36 +- contrib/arm-optimized-routines/math/tgamma128.c | 356 ++ contrib/arm-optimized-routines/math/tgamma128.h | 141 + .../math/tools/tgamma128_gen.jl | 212 ++ contrib/arm-optimized-routines/math/v_cos.c | 95 - contrib/arm-optimized-routines/math/v_cosf.c | 84 - contrib/arm-optimized-routines/math/v_exp.c | 128 - contrib/arm-optimized-routines/math/v_exp.h | 14 - contrib/arm-optimized-routines/math/v_exp2f.c | 117 - contrib/arm-optimized-routines/math/v_exp2f_1u.c | 75 - contrib/arm-optimized-routines/math/v_expf.c | 122 - contrib/arm-optimized-routines/math/v_expf_1u.c | 80 - contrib/arm-optimized-routines/math/v_log.c | 104 - contrib/arm-optimized-routines/math/v_log.h | 18 - contrib/arm-optimized-routines/math/v_log_data.c | 158 - contrib/arm-optimized-routines/math/v_logf.c | 73 - contrib/arm-optimized-routines/math/v_math.h | 661 ---- contrib/arm-optimized-routines/math/v_pow.c | 27 - contrib/arm-optimized-routines/math/v_powf.c | 235 -- contrib/arm-optimized-routines/math/v_sin.c | 103 - contrib/arm-optimized-routines/math/v_sinf.c | 88 - contrib/arm-optimized-routines/math/vn_cos.c | 12 - contrib/arm-optimized-routines/math/vn_cosf.c | 12 - contrib/arm-optimized-routines/math/vn_exp.c | 12 - contrib/arm-optimized-routines/math/vn_exp2f.c | 12 - contrib/arm-optimized-routines/math/vn_exp2f_1u.c | 11 - contrib/arm-optimized-routines/math/vn_expf.c | 12 - contrib/arm-optimized-routines/math/vn_expf_1u.c | 11 - contrib/arm-optimized-routines/math/vn_log.c | 12 - contrib/arm-optimized-routines/math/vn_logf.c | 12 - contrib/arm-optimized-routines/math/vn_pow.c | 12 - contrib/arm-optimized-routines/math/vn_powf.c | 12 - contrib/arm-optimized-routines/math/vn_sin.c | 12 - contrib/arm-optimized-routines/math/vn_sinf.c | 12 - contrib/arm-optimized-routines/pl/math/Dir.mk | 89 +- contrib/arm-optimized-routines/pl/math/acos_2u.c | 100 + contrib/arm-optimized-routines/pl/math/acosf_1u4.c | 99 + contrib/arm-optimized-routines/pl/math/asin_3u.c | 106 + contrib/arm-optimized-routines/pl/math/asin_data.c | 19 + contrib/arm-optimized-routines/pl/math/asinf_2u5.c | 100 + .../arm-optimized-routines/pl/math/asinf_data.c | 16 + contrib/arm-optimized-routines/pl/math/asinh_2u5.c | 5 +- .../arm-optimized-routines/pl/math/asinhf_3u5.c | 6 +- .../arm-optimized-routines/pl/math/atan_common.h | 40 +- contrib/arm-optimized-routines/pl/math/atanf_2u9.c | 12 +- .../arm-optimized-routines/pl/math/atanf_common.h | 33 +- contrib/arm-optimized-routines/pl/math/atanh_3u.c | 15 +- .../arm-optimized-routines/pl/math/atanhf_3u1.c | 12 +- contrib/arm-optimized-routines/pl/math/cbrt_2u.c | 5 +- contrib/arm-optimized-routines/pl/math/cbrtf_1u5.c | 9 +- contrib/arm-optimized-routines/pl/math/cosh_2u.c | 9 +- contrib/arm-optimized-routines/pl/math/coshf_1u9.c | 9 +- contrib/arm-optimized-routines/pl/math/cospi_3u1.c | 89 + .../arm-optimized-routines/pl/math/cospif_2u6.c | 84 + contrib/arm-optimized-routines/pl/math/erf_2u5.c | 102 + contrib/arm-optimized-routines/pl/math/erf_data.c | 788 +++++ contrib/arm-optimized-routines/pl/math/erfc_1u8.c | 153 + contrib/arm-optimized-routines/pl/math/erfc_4u5.c | 155 - contrib/arm-optimized-routines/pl/math/erfc_data.c | 3628 +++++++++++++++++++- contrib/arm-optimized-routines/pl/math/erfcf.h | 38 - contrib/arm-optimized-routines/pl/math/erfcf_1u7.c | 103 + contrib/arm-optimized-routines/pl/math/erfcf_2u.c | 133 - .../arm-optimized-routines/pl/math/erfcf_data.c | 703 +++- contrib/arm-optimized-routines/pl/math/erff_1u5.c | 108 - contrib/arm-optimized-routines/pl/math/erff_2u.c | 82 + contrib/arm-optimized-routines/pl/math/erff_data.c | 532 ++- .../arm-optimized-routines/pl/math/erfinv_24u5.c | 81 + .../arm-optimized-routines/pl/math/erfinvf_4u7.c | 74 + contrib/arm-optimized-routines/pl/math/erfinvl.c | 114 + contrib/arm-optimized-routines/pl/math/estrin.h | 16 - .../arm-optimized-routines/pl/math/estrin_wrap.h | 48 - contrib/arm-optimized-routines/pl/math/estrinf.h | 14 - contrib/arm-optimized-routines/pl/math/expf.c | 4 +- contrib/arm-optimized-routines/pl/math/expm1_2u5.c | 19 +- .../arm-optimized-routines/pl/math/expm1f_1u6.c | 11 +- .../arm-optimized-routines/pl/math/finite_pow.h | 365 ++ contrib/arm-optimized-routines/pl/math/horner.h | 14 - .../arm-optimized-routines/pl/math/horner_wrap.h | 34 - contrib/arm-optimized-routines/pl/math/hornerf.h | 14 - .../pl/math/include/mathlib.h | 238 +- .../pl/math/include/pl_test.h | 8 +- contrib/arm-optimized-routines/pl/math/log1p_2u.c | 17 +- .../arm-optimized-routines/pl/math/log1pf_2u1.c | 16 +- .../arm-optimized-routines/pl/math/math_config.h | 252 +- contrib/arm-optimized-routines/pl/math/math_err.c | 4 +- contrib/arm-optimized-routines/pl/math/math_errf.c | 4 +- .../pl/math/pairwise_horner.h | 14 - .../pl/math/pairwise_horner_wrap.h | 48 - .../pl/math/pairwise_hornerf.h | 14 - contrib/arm-optimized-routines/pl/math/pl_sig.h | 56 +- .../pl/math/poly_advsimd_f32.h | 24 + .../pl/math/poly_advsimd_f64.h | 24 + .../arm-optimized-routines/pl/math/poly_generic.h | 277 ++ .../pl/math/poly_scalar_f32.h | 24 + .../pl/math/poly_scalar_f64.h | 24 + .../arm-optimized-routines/pl/math/poly_sve_f32.h | 26 + .../arm-optimized-routines/pl/math/poly_sve_f64.h | 26 + .../pl/math/poly_sve_generic.h | 301 ++ .../arm-optimized-routines/pl/math/s_acosh_3u5.c | 6 - .../arm-optimized-routines/pl/math/s_acoshf_3u1.c | 6 - .../arm-optimized-routines/pl/math/s_asinh_3u5.c | 6 - .../arm-optimized-routines/pl/math/s_asinhf_2u7.c | 6 - .../arm-optimized-routines/pl/math/s_atan2_3u.c | 6 - .../arm-optimized-routines/pl/math/s_atan2f_3u.c | 6 - .../arm-optimized-routines/pl/math/s_atan_2u5.c | 6 - .../arm-optimized-routines/pl/math/s_atanf_3u.c | 6 - .../arm-optimized-routines/pl/math/s_atanh_3u5.c | 6 - .../arm-optimized-routines/pl/math/s_atanhf_3u1.c | 6 - contrib/arm-optimized-routines/pl/math/s_cbrt_2u.c | 6 - .../arm-optimized-routines/pl/math/s_cbrtf_1u5.c | 6 - contrib/arm-optimized-routines/pl/math/s_cosh_2u.c | 6 - .../arm-optimized-routines/pl/math/s_coshf_2u4.c | 6 - contrib/arm-optimized-routines/pl/math/s_erf_2u.c | 6 - contrib/arm-optimized-routines/pl/math/s_erfc_4u.c | 6 - .../arm-optimized-routines/pl/math/s_erfcf_1u.c | 6 - .../arm-optimized-routines/pl/math/s_erff_1u5.c | 6 - .../arm-optimized-routines/pl/math/s_exp_tail.c | 6 - contrib/arm-optimized-routines/pl/math/s_expf.c | 6 - .../arm-optimized-routines/pl/math/s_expm1_2u5.c | 6 - .../arm-optimized-routines/pl/math/s_expm1f_1u6.c | 6 - .../arm-optimized-routines/pl/math/s_log10_2u5.c | 6 - .../arm-optimized-routines/pl/math/s_log10f_3u5.c | 6 - .../arm-optimized-routines/pl/math/s_log1p_2u5.c | 6 - .../arm-optimized-routines/pl/math/s_log1pf_2u1.c | 6 - contrib/arm-optimized-routines/pl/math/s_log2_3u.c | 6 - .../arm-optimized-routines/pl/math/s_log2f_2u5.c | 6 - contrib/arm-optimized-routines/pl/math/s_sinh_3u.c | 6 - .../arm-optimized-routines/pl/math/s_sinhf_2u3.c | 6 - contrib/arm-optimized-routines/pl/math/s_tan_3u5.c | 6 - .../arm-optimized-routines/pl/math/s_tanf_3u5.c | 6 - contrib/arm-optimized-routines/pl/math/s_tanh_3u.c | 6 - .../arm-optimized-routines/pl/math/s_tanhf_2u6.c | 6 - contrib/arm-optimized-routines/pl/math/sinh_3u.c | 9 +- contrib/arm-optimized-routines/pl/math/sinhf_2u3.c | 9 +- contrib/arm-optimized-routines/pl/math/sinpi_3u.c | 90 + .../arm-optimized-routines/pl/math/sinpif_2u5.c | 83 + .../arm-optimized-routines/pl/math/sv_acos_2u.c | 91 + .../arm-optimized-routines/pl/math/sv_acosf_1u4.c | 84 + .../arm-optimized-routines/pl/math/sv_acosh_3u5.c | 50 + .../arm-optimized-routines/pl/math/sv_acoshf_2u8.c | 47 + .../arm-optimized-routines/pl/math/sv_asin_3u.c | 84 + .../arm-optimized-routines/pl/math/sv_asinf_2u5.c | 76 + .../arm-optimized-routines/pl/math/sv_asinh_3u0.c | 129 + .../arm-optimized-routines/pl/math/sv_asinhf_2u5.c | 55 + .../arm-optimized-routines/pl/math/sv_atan2_2u5.c | 111 +- .../arm-optimized-routines/pl/math/sv_atan2f_3u.c | 112 +- .../arm-optimized-routines/pl/math/sv_atan_2u5.c | 77 +- .../pl/math/sv_atan_common.h | 61 - .../arm-optimized-routines/pl/math/sv_atanf_2u9.c | 69 +- .../pl/math/sv_atanf_common.h | 47 - .../arm-optimized-routines/pl/math/sv_atanh_3u3.c | 60 + .../arm-optimized-routines/pl/math/sv_atanhf_2u8.c | 56 + .../arm-optimized-routines/pl/math/sv_cbrt_2u.c | 122 + .../arm-optimized-routines/pl/math/sv_cbrtf_1u7.c | 116 + .../arm-optimized-routines/pl/math/sv_cexpi_3u5.c | 45 + .../arm-optimized-routines/pl/math/sv_cexpif_1u8.c | 47 + .../arm-optimized-routines/pl/math/sv_cos_2u5.c | 104 +- .../arm-optimized-routines/pl/math/sv_cosf_2u1.c | 94 +- .../arm-optimized-routines/pl/math/sv_cosh_2u.c | 100 + .../arm-optimized-routines/pl/math/sv_coshf_2u.c | 56 + .../arm-optimized-routines/pl/math/sv_cospi_3u2.c | 63 + .../arm-optimized-routines/pl/math/sv_cospif_2u6.c | 59 + .../arm-optimized-routines/pl/math/sv_erf_2u5.c | 111 + contrib/arm-optimized-routines/pl/math/sv_erf_3u.c | 103 - .../arm-optimized-routines/pl/math/sv_erf_data.c | 1558 +++++++++ .../arm-optimized-routines/pl/math/sv_erfc_1u8.c | 164 + .../arm-optimized-routines/pl/math/sv_erfc_4u.c | 146 - .../arm-optimized-routines/pl/math/sv_erfcf_1u7.c | 111 + .../arm-optimized-routines/pl/math/sv_erff_1u3.c | 104 - .../arm-optimized-routines/pl/math/sv_erff_2u.c | 90 + .../arm-optimized-routines/pl/math/sv_erff_data.c | 1046 ++++++ .../arm-optimized-routines/pl/math/sv_exp10_1u5.c | 122 + .../arm-optimized-routines/pl/math/sv_exp10f_1u5.c | 87 + .../arm-optimized-routines/pl/math/sv_exp2_2u.c | 107 + .../arm-optimized-routines/pl/math/sv_exp2f_1u6.c | 80 + .../arm-optimized-routines/pl/math/sv_exp_1u5.c | 137 + .../arm-optimized-routines/pl/math/sv_exp_tail.h | 79 - .../arm-optimized-routines/pl/math/sv_expf_2u.c | 180 +- .../arm-optimized-routines/pl/math/sv_expf_data.c | 12 - .../pl/math/sv_expf_inline.h | 66 + .../arm-optimized-routines/pl/math/sv_expm1_2u5.c | 95 + .../arm-optimized-routines/pl/math/sv_expm1f_1u6.c | 93 + .../pl/math/sv_expm1f_inline.h | 73 + .../arm-optimized-routines/pl/math/sv_hypot_1u5.c | 51 + .../arm-optimized-routines/pl/math/sv_hypotf_1u5.c | 45 + .../arm-optimized-routines/pl/math/sv_log10_2u5.c | 94 +- .../arm-optimized-routines/pl/math/sv_log10f_3u5.c | 119 +- .../arm-optimized-routines/pl/math/sv_log1p_2u5.c | 116 + .../pl/math/sv_log1p_inline.h | 96 + .../arm-optimized-routines/pl/math/sv_log1pf_1u3.c | 97 + .../pl/math/sv_log1pf_inline.h | 65 + .../arm-optimized-routines/pl/math/sv_log2_3u.c | 94 +- .../arm-optimized-routines/pl/math/sv_log2f_2u5.c | 99 +- .../arm-optimized-routines/pl/math/sv_log_2u5.c | 101 +- .../arm-optimized-routines/pl/math/sv_log_data.c | 146 - .../arm-optimized-routines/pl/math/sv_logf_3u4.c | 99 +- .../arm-optimized-routines/pl/math/sv_logf_data.c | 12 - contrib/arm-optimized-routines/pl/math/sv_math.h | 220 +- .../arm-optimized-routines/pl/math/sv_pow_1u5.c | 444 +++ .../arm-optimized-routines/pl/math/sv_powf_2u6.c | 360 ++ contrib/arm-optimized-routines/pl/math/sv_powi.c | 25 +- contrib/arm-optimized-routines/pl/math/sv_powif.c | 26 +- contrib/arm-optimized-routines/pl/math/sv_sin_3u.c | 89 - .../arm-optimized-routines/pl/math/sv_sin_3u5.c | 96 + .../arm-optimized-routines/pl/math/sv_sincos_3u5.c | 61 + .../pl/math/sv_sincos_common.h | 85 + .../pl/math/sv_sincosf_1u8.c | 62 + .../pl/math/sv_sincosf_common.h | 81 + .../arm-optimized-routines/pl/math/sv_sinf_1u9.c | 103 +- .../pl/math/sv_sinf_poly_data.c | 19 - .../arm-optimized-routines/pl/math/sv_sinh_3u.c | 103 + .../arm-optimized-routines/pl/math/sv_sinhf_2u3.c | 64 + .../arm-optimized-routines/pl/math/sv_sinpi_3u1.c | 57 + .../arm-optimized-routines/pl/math/sv_sinpif_2u5.c | 53 + .../arm-optimized-routines/pl/math/sv_tan_3u5.c | 99 + .../arm-optimized-routines/pl/math/sv_tanf_3u5.c | 141 +- .../arm-optimized-routines/pl/math/sv_tanh_3u.c | 96 + .../arm-optimized-routines/pl/math/sv_tanhf_2u6.c | 59 + contrib/arm-optimized-routines/pl/math/tanf_3u3.c | 27 +- contrib/arm-optimized-routines/pl/math/tanh_3u.c | 22 +- contrib/arm-optimized-routines/pl/math/tanhf_2u6.c | 9 +- .../pl/math/test/mathbench_funcs.h | 55 +- .../pl/math/test/mathbench_wrappers.h | 159 +- .../arm-optimized-routines/pl/math/test/pl_test.h | 24 +- .../arm-optimized-routines/pl/math/test/runulp.sh | 56 +- .../pl/math/test/testcases/directed/acos.tst | 17 + .../pl/math/test/testcases/directed/acosf.tst | 21 + .../pl/math/test/testcases/directed/asin.tst | 24 + .../pl/math/test/testcases/directed/asinf.tst | 24 + .../pl/math/test/ulp_funcs.h | 54 +- .../pl/math/test/ulp_wrappers.h | 78 +- .../pl/math/tools/asin.sollya | 29 + .../pl/math/tools/asinf.sollya | 36 + .../pl/math/tools/erf.sollya | 25 + .../pl/math/tools/erfc.sollya | 60 +- .../pl/math/tools/erfcf.sollya | 41 +- .../pl/math/tools/erff.sollya | 20 + .../pl/math/tools/exp10.sollya | 55 + .../pl/math/tools/sincos.sollya | 33 + .../pl/math/tools/sincosf.sollya | 33 + .../pl/math/tools/sinpi.sollya | 33 + .../pl/math/trigpi_references.c | 57 + contrib/arm-optimized-routines/pl/math/v_acos_2u.c | 122 + .../arm-optimized-routines/pl/math/v_acosf_1u4.c | 113 + .../arm-optimized-routines/pl/math/v_acosh_3u5.c | 63 +- .../arm-optimized-routines/pl/math/v_acoshf_3u1.c | 70 +- contrib/arm-optimized-routines/pl/math/v_asin_3u.c | 113 + .../arm-optimized-routines/pl/math/v_asinf_2u5.c | 104 + .../arm-optimized-routines/pl/math/v_asinh_3u5.c | 176 +- .../arm-optimized-routines/pl/math/v_asinhf_2u7.c | 78 +- .../arm-optimized-routines/pl/math/v_atan2_3u.c | 117 +- .../arm-optimized-routines/pl/math/v_atan2f_3u.c | 112 +- .../arm-optimized-routines/pl/math/v_atan_2u5.c | 98 +- .../arm-optimized-routines/pl/math/v_atanf_3u.c | 96 +- .../arm-optimized-routines/pl/math/v_atanh_3u5.c | 69 +- .../arm-optimized-routines/pl/math/v_atanhf_3u1.c | 73 +- contrib/arm-optimized-routines/pl/math/v_cbrt_2u.c | 100 +- .../arm-optimized-routines/pl/math/v_cbrtf_1u5.c | 96 - .../arm-optimized-routines/pl/math/v_cbrtf_1u7.c | 116 + .../arm-optimized-routines/pl/math/v_cexpi_3u5.c | 45 + .../arm-optimized-routines/pl/math/v_cexpif_1u8.c | 47 + contrib/arm-optimized-routines/pl/math/v_cosh_2u.c | 130 +- .../arm-optimized-routines/pl/math/v_coshf_2u4.c | 76 +- .../arm-optimized-routines/pl/math/v_cospi_3u1.c | 86 + .../arm-optimized-routines/pl/math/v_cospif_3u2.c | 83 + contrib/arm-optimized-routines/pl/math/v_erf_2u.c | 116 - contrib/arm-optimized-routines/pl/math/v_erf_2u5.c | 158 + .../arm-optimized-routines/pl/math/v_erf_data.c | 119 - .../arm-optimized-routines/pl/math/v_erfc_1u8.c | 198 ++ contrib/arm-optimized-routines/pl/math/v_erfc_4u.c | 168 - .../arm-optimized-routines/pl/math/v_erfc_data.c | 96 - .../arm-optimized-routines/pl/math/v_erfcf_1u.c | 183 - .../arm-optimized-routines/pl/math/v_erfcf_1u7.c | 166 + .../arm-optimized-routines/pl/math/v_erff_1u5.c | 116 - contrib/arm-optimized-routines/pl/math/v_erff_2u.c | 118 + .../arm-optimized-routines/pl/math/v_erff_data.c | 18 - .../arm-optimized-routines/pl/math/v_erfinv_25u.c | 161 + .../arm-optimized-routines/pl/math/v_erfinvf_5u.c | 163 + .../arm-optimized-routines/pl/math/v_exp10_2u.c | 144 + .../arm-optimized-routines/pl/math/v_exp10f_2u4.c | 138 + contrib/arm-optimized-routines/pl/math/v_exp2_2u.c | 128 + .../arm-optimized-routines/pl/math/v_exp_data.c | 55 + .../arm-optimized-routines/pl/math/v_exp_tail.c | 75 - .../pl/math/v_exp_tail_data.c | 179 +- .../pl/math/v_exp_tail_inline.h | 102 + contrib/arm-optimized-routines/pl/math/v_expf.c | 83 - .../arm-optimized-routines/pl/math/v_expf_inline.h | 60 + .../arm-optimized-routines/pl/math/v_expm1_2u5.c | 139 +- .../arm-optimized-routines/pl/math/v_expm1f_1u6.c | 123 +- .../pl/math/v_expm1f_inline.h | 56 +- .../arm-optimized-routines/pl/math/v_hypot_1u5.c | 95 + .../arm-optimized-routines/pl/math/v_hypotf_1u5.c | 94 + .../arm-optimized-routines/pl/math/v_log10_2u5.c | 140 +- .../arm-optimized-routines/pl/math/v_log10_data.c | 298 +- .../arm-optimized-routines/pl/math/v_log10f_3u5.c | 114 +- .../arm-optimized-routines/pl/math/v_log10f_data.c | 13 - .../arm-optimized-routines/pl/math/v_log1p_2u5.c | 144 +- .../pl/math/v_log1p_inline.h | 82 +- .../arm-optimized-routines/pl/math/v_log1pf_2u1.c | 174 +- .../pl/math/v_log1pf_inline.h | 74 +- contrib/arm-optimized-routines/pl/math/v_log2_3u.c | 133 +- .../arm-optimized-routines/pl/math/v_log2_data.c | 278 +- .../arm-optimized-routines/pl/math/v_log2f_2u5.c | 93 +- .../arm-optimized-routines/pl/math/v_log2f_data.c | 15 - .../arm-optimized-routines/pl/math/v_log_data.c | 161 + .../arm-optimized-routines/pl/math/v_log_inline.h | 104 + .../arm-optimized-routines/pl/math/v_logf_inline.h | 59 + contrib/arm-optimized-routines/pl/math/v_math.h | 874 +---- contrib/arm-optimized-routines/pl/math/v_pow_1u5.c | 259 ++ .../v_exp_data.c => pl/math/v_pow_exp_data.c} | 164 +- .../pl/math/v_pow_log_data.c | 174 + .../arm-optimized-routines/pl/math/v_powf_data.c | 89 + .../arm-optimized-routines/pl/math/v_sincos_3u5.c | 57 + .../pl/math/v_sincos_common.h | 86 + .../arm-optimized-routines/pl/math/v_sincosf_1u8.c | 58 + .../pl/math/v_sincosf_common.h | 84 + contrib/arm-optimized-routines/pl/math/v_sinh_3u.c | 120 +- .../arm-optimized-routines/pl/math/v_sinhf_2u3.c | 91 +- .../arm-optimized-routines/pl/math/v_sinpi_3u1.c | 86 + .../arm-optimized-routines/pl/math/v_sinpif_3u.c | 81 + contrib/arm-optimized-routines/pl/math/v_tan_3u5.c | 124 +- .../arm-optimized-routines/pl/math/v_tan_data.c | 15 - .../arm-optimized-routines/pl/math/v_tanf_3u5.c | 134 +- contrib/arm-optimized-routines/pl/math/v_tanh_3u.c | 112 +- .../arm-optimized-routines/pl/math/v_tanhf_2u6.c | 80 +- .../arm-optimized-routines/pl/math/vn_acosh_3u5.c | 12 - .../arm-optimized-routines/pl/math/vn_acoshf_3u1.c | 12 - .../arm-optimized-routines/pl/math/vn_asinh_3u5.c | 12 - .../arm-optimized-routines/pl/math/vn_asinhf_2u7.c | 12 - .../arm-optimized-routines/pl/math/vn_atan2_3u.c | 12 - .../arm-optimized-routines/pl/math/vn_atan2f_3u.c | 12 - .../arm-optimized-routines/pl/math/vn_atan_2u5.c | 12 - .../arm-optimized-routines/pl/math/vn_atanf_3u.c | 12 - .../arm-optimized-routines/pl/math/vn_atanh_3u5.c | 12 - .../arm-optimized-routines/pl/math/vn_atanhf_3u1.c | 12 - .../arm-optimized-routines/pl/math/vn_cbrt_2u.c | 12 - .../arm-optimized-routines/pl/math/vn_cbrtf_1u5.c | 12 - .../arm-optimized-routines/pl/math/vn_cosh_2u.c | 12 - .../arm-optimized-routines/pl/math/vn_coshf_2u4.c | 12 - contrib/arm-optimized-routines/pl/math/vn_erf_2u.c | 12 - .../arm-optimized-routines/pl/math/vn_erfc_4u.c | 12 - .../arm-optimized-routines/pl/math/vn_erfcf_1u.c | 12 - .../arm-optimized-routines/pl/math/vn_erff_1u5.c | 12 - .../arm-optimized-routines/pl/math/vn_exp_tail.c | 11 - contrib/arm-optimized-routines/pl/math/vn_expf.c | 12 - .../arm-optimized-routines/pl/math/vn_expm1_2u5.c | 12 - .../arm-optimized-routines/pl/math/vn_expm1f_1u6.c | 12 - .../arm-optimized-routines/pl/math/vn_log10_2u5.c | 12 - .../arm-optimized-routines/pl/math/vn_log10f_3u5.c | 12 - .../arm-optimized-routines/pl/math/vn_log1p_2u5.c | 12 - .../arm-optimized-routines/pl/math/vn_log1pf_2u1.c | 12 - .../arm-optimized-routines/pl/math/vn_log2_3u.c | 12 - .../arm-optimized-routines/pl/math/vn_log2f_2u5.c | 12 - .../arm-optimized-routines/pl/math/vn_sinh_3u.c | 12 - .../arm-optimized-routines/pl/math/vn_sinhf_2u3.c | 12 - .../arm-optimized-routines/pl/math/vn_tan_3u5.c | 12 - .../arm-optimized-routines/pl/math/vn_tanf_3u5.c | 12 - .../arm-optimized-routines/pl/math/vn_tanh_3u.c | 12 - .../arm-optimized-routines/pl/math/vn_tanhf_2u6.c | 12 - .../string/aarch64/asmdefs.h | 14 + .../string/aarch64/memcpy-advsimd.S | 62 +- .../string/aarch64/memcpy-mops.S | 21 + .../string/aarch64/memmove-mops.S | 21 + .../string/aarch64/memset-mops.S | 20 + .../arm-optimized-routines/string/bench/memcpy.c | 5 +- .../string/include/stringlib.h | 7 +- .../arm-optimized-routines/string/test/memcpy.c | 5 +- .../arm-optimized-routines/string/test/memmove.c | 5 +- .../arm-optimized-routines/string/test/memset.c | 5 +- 414 files changed, 26613 insertions(+), 10731 deletions(-) diff --git a/contrib/arm-optimized-routines/README b/contrib/arm-optimized-routines/README index a2143a28488a..651ebdc84bc8 100644 --- a/contrib/arm-optimized-routines/README +++ b/contrib/arm-optimized-routines/README @@ -12,7 +12,7 @@ contribution requirements are documented in README.contributors of the appropriate subdirectory. Regular quarterly releases are tagged as vYY.MM, the latest -release is v23.01. +release is v24.01. Source code layout: diff --git a/contrib/arm-optimized-routines/config.mk.dist b/contrib/arm-optimized-routines/config.mk.dist index 7a8497507a81..03fb54db52fa 100644 --- a/contrib/arm-optimized-routines/config.mk.dist +++ b/contrib/arm-optimized-routines/config.mk.dist @@ -1,6 +1,6 @@ # Example config.mk # -# Copyright (c) 2018-2022, Arm Limited. +# Copyright (c) 2018-2023, Arm Limited. # SPDX-License-Identifier: MIT OR Apache-2.0 WITH LLVM-exception # Subprojects to build @@ -59,13 +59,14 @@ math-cflags += -ffp-contract=fast -fno-math-errno # Use with clang. #math-cflags += -ffp-contract=fast -# Disable vector math code -#math-cflags += -DWANT_VMATH=0 - -# Disable/enable SVE vector math code and tests +# Disable/enable SVE vector math code and tests. +# If WANT_SVE_MATH is enabled, math-sve-cflags is added for SVE +# routines only so that SVE code does not leak into scalar +# routines. It is also necessary to add it for tools (e.g. ulp, +# mathbench) WANT_SVE_MATH = 0 ifeq ($(WANT_SVE_MATH), 1) - math-cflags += -march=armv8.2-a+sve + math-sve-cflags = -march=armv8-a+sve endif math-cflags += -DWANT_SVE_MATH=$(WANT_SVE_MATH) diff --git a/contrib/arm-optimized-routines/math/Dir.mk b/contrib/arm-optimized-routines/math/Dir.mk index 2a9cad10d96a..5e9494a7bd3c 100644 --- a/contrib/arm-optimized-routines/math/Dir.mk +++ b/contrib/arm-optimized-routines/math/Dir.mk @@ -1,12 +1,14 @@ # Makefile fragment - requires GNU make # -# Copyright (c) 2019-2022, Arm Limited. +# Copyright (c) 2019-2023, Arm Limited. # SPDX-License-Identifier: MIT OR Apache-2.0 WITH LLVM-exception S := $(srcdir)/math B := build/math math-lib-srcs := $(wildcard $(S)/*.[cS]) +math-lib-srcs += $(wildcard $(S)/$(ARCH)/*.[cS]) + math-test-srcs := \ $(S)/test/mathtest.c \ $(S)/test/mathbench.c \ @@ -65,6 +67,8 @@ build/lib/libmathlib.a: $(math-lib-objs) $(math-host-tools): HOST_LDLIBS += -lm -lmpfr -lmpc $(math-tools): LDLIBS += $(math-ldlibs) -lm +# math-sve-cflags should be empty if WANT_SVE_MATH is not enabled +$(math-tools): CFLAGS_ALL += $(math-sve-cflags) build/bin/rtest: $(math-host-objs) $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ $^ $(HOST_LDLIBS) diff --git a/contrib/arm-optimized-routines/math/aarch64/v_cos.c b/contrib/arm-optimized-routines/math/aarch64/v_cos.c new file mode 100644 index 000000000000..9a73575bce89 --- /dev/null +++ b/contrib/arm-optimized-routines/math/aarch64/v_cos.c @@ -0,0 +1,87 @@ +/* + * Double-precision vector cos function. + * + * Copyright (c) 2019-2023, Arm Limited. + * SPDX-License-Identifier: MIT OR Apache-2.0 WITH LLVM-exception + */ + +#include "mathlib.h" +#include "v_math.h" + +static const struct data +{ + float64x2_t poly[7]; + float64x2_t range_val, shift, inv_pi, half_pi, pi_1, pi_2, pi_3; +} data = { + /* Worst-case error is 3.3 ulp in [-pi/2, pi/2]. */ + .poly = { V2 (-0x1.555555555547bp-3), V2 (0x1.1111111108a4dp-7), + V2 (-0x1.a01a019936f27p-13), V2 (0x1.71de37a97d93ep-19), + V2 (-0x1.ae633919987c6p-26), V2 (0x1.60e277ae07cecp-33), + V2 (-0x1.9e9540300a1p-41) }, + .inv_pi = V2 (0x1.45f306dc9c883p-2), + .half_pi = V2 (0x1.921fb54442d18p+0), + .pi_1 = V2 (0x1.921fb54442d18p+1), + .pi_2 = V2 (0x1.1a62633145c06p-53), + .pi_3 = V2 (0x1.c1cd129024e09p-106), + .shift = V2 (0x1.8p52), + .range_val = V2 (0x1p23) +}; + +#define C(i) d->poly[i] + +static float64x2_t VPCS_ATTR NOINLINE +special_case (float64x2_t x, float64x2_t y, uint64x2_t odd, uint64x2_t cmp) +{ + y = vreinterpretq_f64_u64 (veorq_u64 (vreinterpretq_u64_f64 (y), odd)); + return v_call_f64 (cos, x, y, cmp); +} + +float64x2_t VPCS_ATTR V_NAME_D1 (cos) (float64x2_t x) +{ + const struct data *d = ptr_barrier (&data); + float64x2_t n, r, r2, r3, r4, t1, t2, t3, y; + uint64x2_t odd, cmp; + +#if WANT_SIMD_EXCEPT + r = vabsq_f64 (x); + cmp = vcgeq_u64 (vreinterpretq_u64_f64 (r), + vreinterpretq_u64_f64 (d->range_val)); + if (unlikely (v_any_u64 (cmp))) + /* If fenv exceptions are to be triggered correctly, set any special lanes + to 1 (which is neutral w.r.t. fenv). These lanes will be fixed by + special-case handler later. */ + r = vbslq_f64 (cmp, v_f64 (1.0), r); +#else + cmp = vcageq_f64 (x, d->range_val); + r = x; +#endif + + /* n = rint((|x|+pi/2)/pi) - 0.5. */ + n = vfmaq_f64 (d->shift, d->inv_pi, vaddq_f64 (r, d->half_pi)); + odd = vshlq_n_u64 (vreinterpretq_u64_f64 (n), 63); + n = vsubq_f64 (n, d->shift); + n = vsubq_f64 (n, v_f64 (0.5)); + + /* r = |x| - n*pi (range reduction into -pi/2 .. pi/2). */ + r = vfmsq_f64 (r, d->pi_1, n); + r = vfmsq_f64 (r, d->pi_2, n); + r = vfmsq_f64 (r, d->pi_3, n); + + /* sin(r) poly approx. */ + r2 = vmulq_f64 (r, r); + r3 = vmulq_f64 (r2, r); + r4 = vmulq_f64 (r2, r2); + + t1 = vfmaq_f64 (C (4), C (5), r2); + t2 = vfmaq_f64 (C (2), C (3), r2); + t3 = vfmaq_f64 (C (0), C (1), r2); + + y = vfmaq_f64 (t1, C (6), r4); + y = vfmaq_f64 (t2, y, r4); + y = vfmaq_f64 (t3, y, r4); + y = vfmaq_f64 (r, y, r3); + + if (unlikely (v_any_u64 (cmp))) + return special_case (x, y, odd, cmp); + return vreinterpretq_f64_u64 (veorq_u64 (vreinterpretq_u64_f64 (y), odd)); +} diff --git a/contrib/arm-optimized-routines/math/aarch64/v_cosf.c b/contrib/arm-optimized-routines/math/aarch64/v_cosf.c new file mode 100644 index 000000000000..b9890b2998ad --- /dev/null +++ b/contrib/arm-optimized-routines/math/aarch64/v_cosf.c @@ -0,0 +1,82 @@ +/* + * Single-precision vector cos function. + * + * Copyright (c) 2019-2023, Arm Limited. + * SPDX-License-Identifier: MIT OR Apache-2.0 WITH LLVM-exception + */ + +#include "mathlib.h" +#include "v_math.h" + +static const struct data +{ + float32x4_t poly[4]; + float32x4_t range_val, inv_pi, half_pi, shift, pi_1, pi_2, pi_3; +} data = { + /* 1.886 ulp error. */ + .poly = { V4 (-0x1.555548p-3f), V4 (0x1.110df4p-7f), V4 (-0x1.9f42eap-13f), + V4 (0x1.5b2e76p-19f) }, + + .pi_1 = V4 (0x1.921fb6p+1f), + .pi_2 = V4 (-0x1.777a5cp-24f), + .pi_3 = V4 (-0x1.ee59dap-49f), + + .inv_pi = V4 (0x1.45f306p-2f), + .shift = V4 (0x1.8p+23f), + .half_pi = V4 (0x1.921fb6p0f), + .range_val = V4 (0x1p20f) +}; + +#define C(i) d->poly[i] + +static float32x4_t VPCS_ATTR NOINLINE +special_case (float32x4_t x, float32x4_t y, uint32x4_t odd, uint32x4_t cmp) +{ + /* Fall back to scalar code. */ + y = vreinterpretq_f32_u32 (veorq_u32 (vreinterpretq_u32_f32 (y), odd)); + return v_call_f32 (cosf, x, y, cmp); +} + +float32x4_t VPCS_ATTR V_NAME_F1 (cos) (float32x4_t x) +{ + const struct data *d = ptr_barrier (&data); + float32x4_t n, r, r2, r3, y; + uint32x4_t odd, cmp; + +#if WANT_SIMD_EXCEPT + r = vabsq_f32 (x); + cmp = vcgeq_u32 (vreinterpretq_u32_f32 (r), + vreinterpretq_u32_f32 (d->range_val)); + if (unlikely (v_any_u32 (cmp))) + /* If fenv exceptions are to be triggered correctly, set any special lanes + to 1 (which is neutral w.r.t. fenv). These lanes will be fixed by + special-case handler later. */ + r = vbslq_f32 (cmp, v_f32 (1.0f), r); +#else + cmp = vcageq_f32 (x, d->range_val); + r = x; +#endif + + /* n = rint((|x|+pi/2)/pi) - 0.5. */ + n = vfmaq_f32 (d->shift, d->inv_pi, vaddq_f32 (r, d->half_pi)); + odd = vshlq_n_u32 (vreinterpretq_u32_f32 (n), 31); + n = vsubq_f32 (n, d->shift); + n = vsubq_f32 (n, v_f32 (0.5f)); + + /* r = |x| - n*pi (range reduction into -pi/2 .. pi/2). */ + r = vfmsq_f32 (r, d->pi_1, n); + r = vfmsq_f32 (r, d->pi_2, n); + r = vfmsq_f32 (r, d->pi_3, n); + + /* y = sin(r). */ + r2 = vmulq_f32 (r, r); + r3 = vmulq_f32 (r2, r); + y = vfmaq_f32 (C (2), C (3), r2); + y = vfmaq_f32 (C (1), y, r2); + y = vfmaq_f32 (C (0), y, r2); + y = vfmaq_f32 (r, y, r3); + + if (unlikely (v_any_u32 (cmp))) + return special_case (x, y, odd, cmp); + return vreinterpretq_f32_u32 (veorq_u32 (vreinterpretq_u32_f32 (y), odd)); +} diff --git a/contrib/arm-optimized-routines/math/aarch64/v_exp.c b/contrib/arm-optimized-routines/math/aarch64/v_exp.c new file mode 100644 index 000000000000..bc5609faf4fc --- /dev/null +++ b/contrib/arm-optimized-routines/math/aarch64/v_exp.c @@ -0,0 +1,125 @@ +/* + * Double-precision vector e^x function. + * + * Copyright (c) 2019-2023, Arm Limited. + * SPDX-License-Identifier: MIT OR Apache-2.0 WITH LLVM-exception + */ + +#include "mathlib.h" +#include "v_math.h" + +#define N (1 << V_EXP_TABLE_BITS) +#define IndexMask (N - 1) + +const static volatile struct +{ + float64x2_t poly[3]; + float64x2_t inv_ln2, ln2_hi, ln2_lo, shift; +#if !WANT_SIMD_EXCEPT + float64x2_t special_bound, scale_thresh; +#endif +} data = { + /* maxerr: 1.88 +0.5 ulp + rel error: 1.4337*2^-53 + abs error: 1.4299*2^-53 in [ -ln2/256, ln2/256 ]. */ + .poly = { V2 (0x1.ffffffffffd43p-2), V2 (0x1.55555c75adbb2p-3), + V2 (0x1.55555da646206p-5) }, +#if !WANT_SIMD_EXCEPT + .scale_thresh = V2 (163840.0), /* 1280.0 * N. */ + .special_bound = V2 (704.0), +#endif + .inv_ln2 = V2 (0x1.71547652b82fep7), /* N/ln2. */ + .ln2_hi = V2 (0x1.62e42fefa39efp-8), /* ln2/N. */ + .ln2_lo = V2 (0x1.abc9e3b39803f3p-63), + .shift = V2 (0x1.8p+52) +}; + +#define C(i) data.poly[i] +#define Tab __v_exp_data + +#if WANT_SIMD_EXCEPT + +# define TinyBound v_u64 (0x2000000000000000) /* asuint64 (0x1p-511). */ +# define BigBound v_u64 (0x4080000000000000) /* asuint64 (0x1p9). */ +# define SpecialBound v_u64 (0x2080000000000000) /* BigBound - TinyBound. */ + +static float64x2_t VPCS_ATTR NOINLINE +special_case (float64x2_t x, float64x2_t y, uint64x2_t cmp) +{ + /* If fenv exceptions are to be triggered correctly, fall back to the scalar + routine to special lanes. */ + return v_call_f64 (exp, x, y, cmp); +} + +#else + +# define SpecialOffset v_u64 (0x6000000000000000) /* 0x1p513. */ +/* SpecialBias1 + SpecialBias1 = asuint(1.0). */ +# define SpecialBias1 v_u64 (0x7000000000000000) /* 0x1p769. */ +# define SpecialBias2 v_u64 (0x3010000000000000) /* 0x1p-254. */ + +static inline float64x2_t VPCS_ATTR +special_case (float64x2_t s, float64x2_t y, float64x2_t n) +{ + /* 2^(n/N) may overflow, break it up into s1*s2. */ + uint64x2_t b = vandq_u64 (vcltzq_f64 (n), SpecialOffset); + float64x2_t s1 = vreinterpretq_f64_u64 (vsubq_u64 (SpecialBias1, b)); + float64x2_t s2 = vreinterpretq_f64_u64 ( + vaddq_u64 (vsubq_u64 (vreinterpretq_u64_f64 (s), SpecialBias2), b)); + uint64x2_t cmp = vcagtq_f64 (n, data.scale_thresh); + float64x2_t r1 = vmulq_f64 (s1, s1); + float64x2_t r0 = vmulq_f64 (vfmaq_f64 (s2, y, s2), s1); + return vbslq_f64 (cmp, r1, r0); +} + +#endif + +float64x2_t VPCS_ATTR V_NAME_D1 (exp) (float64x2_t x) +{ + float64x2_t n, r, r2, s, y, z; + uint64x2_t cmp, u, e; + +#if WANT_SIMD_EXCEPT + /* If any lanes are special, mask them with 1 and retain a copy of x to allow + special_case to fix special lanes later. This is only necessary if fenv + exceptions are to be triggered correctly. */ + float64x2_t xm = x; + uint64x2_t iax = vreinterpretq_u64_f64 (vabsq_f64 (x)); + cmp = vcgeq_u64 (vsubq_u64 (iax, TinyBound), SpecialBound); + if (unlikely (v_any_u64 (cmp))) + x = vbslq_f64 (cmp, v_f64 (1), x); +#else + cmp = vcagtq_f64 (x, data.special_bound); +#endif + + /* n = round(x/(ln2/N)). */ + z = vfmaq_f64 (data.shift, x, data.inv_ln2); + u = vreinterpretq_u64_f64 (z); + n = vsubq_f64 (z, data.shift); + + /* r = x - n*ln2/N. */ + r = x; + r = vfmsq_f64 (r, data.ln2_hi, n); + r = vfmsq_f64 (r, data.ln2_lo, n); + + e = vshlq_n_u64 (u, 52 - V_EXP_TABLE_BITS); + + /* y = exp(r) - 1 ~= r + C0 r^2 + C1 r^3 + C2 r^4. */ + r2 = vmulq_f64 (r, r); + y = vfmaq_f64 (C (0), C (1), r); + y = vfmaq_f64 (y, C (2), r2); + y = vfmaq_f64 (r, y, r2); + + /* s = 2^(n/N). */ + u = (uint64x2_t){ Tab[u[0] & IndexMask], Tab[u[1] & IndexMask] }; + s = vreinterpretq_f64_u64 (vaddq_u64 (u, e)); + + if (unlikely (v_any_u64 (cmp))) +#if WANT_SIMD_EXCEPT + return special_case (xm, vfmaq_f64 (s, y, s), cmp); +#else + return special_case (s, y, n); +#endif + + return vfmaq_f64 (s, y, s); +} diff --git a/contrib/arm-optimized-routines/math/aarch64/v_exp2f.c b/contrib/arm-optimized-routines/math/aarch64/v_exp2f.c new file mode 100644 index 000000000000..e402205e98e6 --- /dev/null +++ b/contrib/arm-optimized-routines/math/aarch64/v_exp2f.c @@ -0,0 +1,113 @@ +/* + * Single-precision vector 2^x function. + * + * Copyright (c) 2019-2023, Arm Limited. + * SPDX-License-Identifier: MIT OR Apache-2.0 WITH LLVM-exception + */ + +#include "mathlib.h" +#include "v_math.h" + +static const struct data +{ + float32x4_t poly[5]; + uint32x4_t exponent_bias; +#if !WANT_SIMD_EXCEPT + float32x4_t special_bound, scale_thresh; +#endif +} data = { + /* maxerr: 1.962 ulp. */ + .poly = { V4 (0x1.59977ap-10f), V4 (0x1.3ce9e4p-7f), V4 (0x1.c6bd32p-5f), + V4 (0x1.ebf9bcp-3f), V4 (0x1.62e422p-1f) }, + .exponent_bias = V4 (0x3f800000), +#if !WANT_SIMD_EXCEPT + .special_bound = V4 (126.0f), + .scale_thresh = V4 (192.0f), +#endif +}; + +#define C(i) d->poly[i] + +#if WANT_SIMD_EXCEPT + +# define TinyBound v_u32 (0x20000000) /* asuint (0x1p-63). */ +# define BigBound v_u32 (0x42800000) /* asuint (0x1p6). */ +# define SpecialBound v_u32 (0x22800000) /* BigBound - TinyBound. */ + +static float32x4_t VPCS_ATTR NOINLINE +special_case (float32x4_t x, float32x4_t y, uint32x4_t cmp) +{ + /* If fenv exceptions are to be triggered correctly, fall back to the scalar + routine for special lanes. */ + return v_call_f32 (exp2f, x, y, cmp); +} + +#else + +# define SpecialOffset v_u32 (0x82000000) +# define SpecialBias v_u32 (0x7f000000) + +static float32x4_t VPCS_ATTR NOINLINE +special_case (float32x4_t poly, float32x4_t n, uint32x4_t e, uint32x4_t cmp1, + float32x4_t scale, const struct data *d) +{ + /* 2^n may overflow, break it up into s1*s2. */ + uint32x4_t b = vandq_u32 (vclezq_f32 (n), SpecialOffset); + float32x4_t s1 = vreinterpretq_f32_u32 (vaddq_u32 (b, SpecialBias)); + float32x4_t s2 = vreinterpretq_f32_u32 (vsubq_u32 (e, b)); + uint32x4_t cmp2 = vcagtq_f32 (n, d->scale_thresh); + float32x4_t r2 = vmulq_f32 (s1, s1); + float32x4_t r1 = vmulq_f32 (vfmaq_f32 (s2, poly, s2), s1); + /* Similar to r1 but avoids double rounding in the subnormal range. */ + float32x4_t r0 = vfmaq_f32 (scale, poly, scale); + float32x4_t r = vbslq_f32 (cmp1, r1, r0); + return vbslq_f32 (cmp2, r2, r); +} + +#endif + +float32x4_t VPCS_ATTR V_NAME_F1 (exp2) (float32x4_t x) +{ + const struct data *d = ptr_barrier (&data); + float32x4_t n, r, r2, scale, p, q, poly; + uint32x4_t cmp, e; + +#if WANT_SIMD_EXCEPT + /* asuint(|x|) - TinyBound >= BigBound - TinyBound. */ + uint32x4_t ia = vreinterpretq_u32_f32 (vabsq_f32 (x)); + cmp = vcgeq_u32 (vsubq_u32 (ia, TinyBound), SpecialBound); + float32x4_t xm = x; + /* If any lanes are special, mask them with 1 and retain a copy of x to allow + special_case to fix special lanes later. This is only necessary if fenv + exceptions are to be triggered correctly. */ + if (unlikely (v_any_u32 (cmp))) + x = vbslq_f32 (cmp, v_f32 (1), x); +#endif + + /* exp2(x) = 2^n (1 + poly(r)), with 1 + poly(r) in [1/sqrt(2),sqrt(2)] + x = n + r, with r in [-1/2, 1/2]. */ + n = vrndaq_f32 (x); + r = vsubq_f32 (x, n); + e = vshlq_n_u32 (vreinterpretq_u32_s32 (vcvtaq_s32_f32 (x)), 23); + scale = vreinterpretq_f32_u32 (vaddq_u32 (e, d->exponent_bias)); + +#if !WANT_SIMD_EXCEPT + cmp = vcagtq_f32 (n, d->special_bound); +#endif + + r2 = vmulq_f32 (r, r); + p = vfmaq_f32 (C (1), C (0), r); + q = vfmaq_f32 (C (3), C (2), r); + q = vfmaq_f32 (q, p, r2); + p = vmulq_f32 (C (4), r); + poly = vfmaq_f32 (p, q, r2); + + if (unlikely (v_any_u32 (cmp))) +#if WANT_SIMD_EXCEPT + return special_case (xm, vfmaq_f32 (scale, poly, scale), cmp); +#else + return special_case (poly, n, e, cmp, scale, d); +#endif + + return vfmaq_f32 (scale, poly, scale); +} diff --git a/contrib/arm-optimized-routines/math/aarch64/v_exp2f_1u.c b/contrib/arm-optimized-routines/math/aarch64/v_exp2f_1u.c new file mode 100644 index 000000000000..ba6b02fbb4bc --- /dev/null +++ b/contrib/arm-optimized-routines/math/aarch64/v_exp2f_1u.c @@ -0,0 +1,72 @@ +/* + * Single-precision vector 2^x function. + * + * Copyright (c) 2019-2023, Arm Limited. + * SPDX-License-Identifier: MIT OR Apache-2.0 WITH LLVM-exception + */ + +#include "mathlib.h" +#include "v_math.h" + +static const float Poly[] = { + /* maxerr: 0.878 ulp. */ + 0x1.416b5ep-13f, 0x1.5f082ep-10f, 0x1.3b2dep-7f, 0x1.c6af7cp-5f, 0x1.ebfbdcp-3f, 0x1.62e43p-1f +}; +#define C0 v_f32 (Poly[0]) +#define C1 v_f32 (Poly[1]) +#define C2 v_f32 (Poly[2]) +#define C3 v_f32 (Poly[3]) +#define C4 v_f32 (Poly[4]) +#define C5 v_f32 (Poly[5]) + +#define Shift v_f32 (0x1.8p23f) +#define InvLn2 v_f32 (0x1.715476p+0f) +#define Ln2hi v_f32 (0x1.62e4p-1f) +#define Ln2lo v_f32 (0x1.7f7d1cp-20f) + +static float32x4_t VPCS_ATTR NOINLINE +specialcase (float32x4_t poly, float32x4_t n, uint32x4_t e, float32x4_t absn) +{ + /* 2^n may overflow, break it up into s1*s2. */ + uint32x4_t b = (n <= v_f32 (0.0f)) & v_u32 (0x83000000); + float32x4_t s1 = vreinterpretq_f32_u32 (v_u32 (0x7f000000) + b); + float32x4_t s2 = vreinterpretq_f32_u32 (e - b); + uint32x4_t cmp = absn > v_f32 (192.0f); + float32x4_t r1 = s1 * s1; + float32x4_t r0 = poly * s1 * s2; + return vreinterpretq_f32_u32 ((cmp & vreinterpretq_u32_f32 (r1)) + | (~cmp & vreinterpretq_u32_f32 (r0))); +} + +float32x4_t VPCS_ATTR +_ZGVnN4v_exp2f_1u (float32x4_t x) +{ *** 42574 LINES SKIPPED *** From nobody Mon Apr 8 19:04:12 2024 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 4VCz645Vcmz5HYl6; Mon, 8 Apr 2024 19:04: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 4VCz644yPjz4fnN; Mon, 8 Apr 2024 19:04:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712603052; 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=2gXTkKpGoongtuFqaor4sI5oSyvuofWB9Igpfdu9ZpI=; b=d/7+Zbr+EQom1QSTcjCtM+30GdsUbg0kXlvbwAxh2OvXaG5+2Ncx6xRSQgoYQf/bRP6BcF EL+re3qQeO6hBUMynZhfTfLIthvtJEoXUiNXlQUJwGbH6pwKco0fqFB1Wi0Zn3TeHTumpf RU1augLsFLzdE4dNnshoTR92pP6MMlqS9Nwu089EMQX40T83qurUiFg8U6cTOH3xXRQYQe 7QmFahHU7Nb9yeV9McReOGBFkn4KAJWC2rO2XgEt0Hw+bwxxiBvf6lq+UeGyFcZ9pdwQ5z hDdj8XBOmITjgMSguL18i1ELKUEvxtfeSN9ZPva3mSQAq8p7+Jv/LSQY3IQ9Vg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712603052; a=rsa-sha256; cv=none; b=i+dAKV2wVCBKeNU3zrhCCnRPrOgx0x01rDaQm/kDjeZ4W+80vEcfFlWcHzxAjulNdtXDzV 9gOUoFai9H8n3ifM8fpJ2nRD95kGkwXwmkRGADSEpvkbQR5jcJKmGfMIldE03dKmnMX2zg pRFWPSlmC32CP2ksjCcg7H2D4My1QbMoWO+xNvF55Xf3TUtZuvnJWVGn6LaB304P79ltLl xwAxK5fG7OamoGsyLVZNUMs/prTJGfO890fz73m9eut4ik2NrCNJnUTqIbKfbxlpqqxzQF AK2bQEhJHRYxLofvyoUb/jzwvjy6pBmzL8EaB9PMkvaTOsFAbQDzWX/E2YhH0g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712603052; 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=2gXTkKpGoongtuFqaor4sI5oSyvuofWB9Igpfdu9ZpI=; b=S3iA+pidue9770VclJ42vPVYtKlkt79jZzz02MRzEpPHg0aQn3lUVOzeh1Pmh4paxIsx6s XKoGHEl26EeyTyft4Ki7lJxRyYfUgrViQaWLh8s12yhluyjbiVeAfsfg9nUN0u3+QaqzCe JB+hn1gEB3Qv47luHoxlc91ziIy6Xk9gY/26OMI1GdtwpjRw/a/aLPztS7tdfQ/8VXN6dS L0GCmAV8uFECze3255Z0Mmu3yRsKwTQ0ZOTSVFxHqffLWILMz/0G7CF+HNt3D0D9vtrCyE jMI1aw05nlAmYkc7e9tVcM1awlBr2vt7r5AWE3babnDvEHBI9jIK6eAbA9wUDA== 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 4VCz644VrmzNSj; Mon, 8 Apr 2024 19:04:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 438J4C7O093500; Mon, 8 Apr 2024 19:04:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 438J4CEg093497; Mon, 8 Apr 2024 19:04:12 GMT (envelope-from git) Date: Mon, 8 Apr 2024 19:04:12 GMT Message-Id: <202404081904.438J4CEg093497@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 1449754218d7 - stable/14 - cd9660: Add support for mask,dirmask,uid,gid options 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1449754218d7842043bf5b73a86b20fd9fa2371d Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=1449754218d7842043bf5b73a86b20fd9fa2371d commit 1449754218d7842043bf5b73a86b20fd9fa2371d Author: Ricardo Branco AuthorDate: 2024-01-08 20:24:53 +0000 Commit: John Baldwin CommitDate: 2024-04-08 17:25:46 +0000 cd9660: Add support for mask,dirmask,uid,gid options Reviewed by: jhb Pull Request: https://github.com/freebsd/freebsd-src/pull/982 (cherry picked from commit 82f2275b73e556580b155ea9bbf7f7e364458fa1) --- sbin/mount_cd9660/mount_cd9660.8 | 37 ++++++++++++++++++- sbin/mount_cd9660/mount_cd9660.c | 79 ++++++++++++++++++++++++++++++++++++++-- sys/fs/cd9660/cd9660_mount.h | 7 ++++ sys/fs/cd9660/cd9660_vfsops.c | 23 ++++++++++++ sys/fs/cd9660/cd9660_vnops.c | 24 ++++++++++-- sys/fs/cd9660/iso.h | 5 +++ 6 files changed, 167 insertions(+), 8 deletions(-) diff --git a/sbin/mount_cd9660/mount_cd9660.8 b/sbin/mount_cd9660/mount_cd9660.8 index a31e6d833245..af417d4d025e 100644 --- a/sbin/mount_cd9660/mount_cd9660.8 +++ b/sbin/mount_cd9660/mount_cd9660.8 @@ -31,7 +31,7 @@ .\" .\" @(#)mount_cd9660.8 8.3 (Berkeley) 3/27/94 .\" -.Dd August 11, 2018 +.Dd January 2, 2024 .Dt MOUNT_CD9660 8 .Os .Sh NAME @@ -41,8 +41,12 @@ .Nm .Op Fl begjrv .Op Fl C Ar charset +.Op Fl G Ar gid +.Op Fl m Ar mask +.Op Fl M Ar mask .Op Fl o Ar options .Op Fl s Ar startsector +.Op Fl U Ar uid .Ar special node .Sh DESCRIPTION The @@ -68,6 +72,37 @@ Do not strip version numbers on files. only the last one will be listed.) In either case, files may be opened without explicitly stating a version number. +.It Fl G Ar group +Set the group of the files in the file system to +.Ar group . +The default gid on non-Rockridge volumes is zero. +.It Fl U Ar user +Set the owner of the files in the file system to +.Ar user . +The default uid on non-Rockridge volumes is zero. +.It Fl m Ar mask +Specify the maximum file permissions for files +in the file system. +(For example, a +.Ar mask +of +.Li 755 +specifies that, by default, the owner should have +read, write, and execute permissions for files, but +others should only have read and execute permissions). +See +.Xr chmod 1 +for more information about octal file modes. +Only the nine low-order bits of +.Ar mask +are used. +The default +.Ar mask +on non-Rockridge volumes is 755. +.It Fl M Ar mask +Specify the maximum file permissions for directories +in the file system. +See the previous option's description for details. .It Fl j Do not use any Joliet extensions included in the file system. .It Fl o diff --git a/sbin/mount_cd9660/mount_cd9660.c b/sbin/mount_cd9660/mount_cd9660.c index f867e94da417..253b9eb32540 100644 --- a/sbin/mount_cd9660/mount_cd9660.c +++ b/sbin/mount_cd9660/mount_cd9660.c @@ -58,8 +58,11 @@ static char sccsid[] = "@(#)mount_cd9660.c 8.7 (Berkeley) 5/1/95"; #include +#include #include #include +#include +#include #include #include #include @@ -74,6 +77,9 @@ static struct mntopt mopts[] = { MOPT_END }; +static gid_t a_gid(const char *); +static uid_t a_uid(const char *); +static mode_t a_mask(const char *); static int get_ssector(const char *dev); static int set_charset(struct iovec **, int *iovlen, const char *); void usage(void); @@ -94,7 +100,7 @@ main(int argc, char **argv) mntflags = verbose = 0; ssector = -1; - while ((ch = getopt(argc, argv, "begjo:rs:vC:")) != -1) + while ((ch = getopt(argc, argv, "begG:jm:M:o:rs:U:vC:")) != -1) switch (ch) { case 'b': build_iovec(&iov, &iovlen, "brokenjoliet", NULL, (size_t)-1); @@ -105,6 +111,15 @@ main(int argc, char **argv) case 'g': build_iovec(&iov, &iovlen, "gens", NULL, (size_t)-1); break; + case 'G': + build_iovec_argf(&iov, &iovlen, "gid", "%d", a_gid(optarg)); + break; + case 'm': + build_iovec_argf(&iov, &iovlen, "mask", "%u", a_mask(optarg)); + break; + case 'M': + build_iovec_argf(&iov, &iovlen, "dirmask", "%u", a_mask(optarg)); + break; case 'j': build_iovec(&iov, &iovlen, "nojoliet", NULL, (size_t)-1); break; @@ -124,6 +139,9 @@ main(int argc, char **argv) case 's': ssector = atoi(optarg); break; + case 'U': + build_iovec_argf(&iov, &iovlen, "uid", "%d", a_uid(optarg)); + break; case 'v': verbose++; break; @@ -187,8 +205,8 @@ void usage(void) { (void)fprintf(stderr, -"usage: mount_cd9660 [-begjrv] [-C charset] [-o options] [-s startsector]\n" -" special node\n"); +"usage: mount_cd9660 [-begjrv] [-C charset] [-G gid] [-m mask] [-M mask]\n" +" [-o options] [-U uid] [-s startsector] special node\n"); exit(EX_USAGE); } @@ -268,3 +286,58 @@ set_charset(struct iovec **iov, int *iovlen, const char *localcs) return (0); } + +static gid_t +a_gid(const char *s) +{ + struct group *gr; + const char *gname; + gid_t gid; + + if ((gr = getgrnam(s)) != NULL) + gid = gr->gr_gid; + else { + for (gname = s; *s && isdigit(*s); ++s); + if (!*s) + gid = atoi(gname); + else + errx(EX_NOUSER, "unknown group id: %s", gname); + } + return (gid); +} + +static uid_t +a_uid(const char *s) +{ + struct passwd *pw; + const char *uname; + uid_t uid; + + if ((pw = getpwnam(s)) != NULL) + uid = pw->pw_uid; + else { + for (uname = s; *s && isdigit(*s); ++s); + if (!*s) + uid = atoi(uname); + else + errx(EX_NOUSER, "unknown user id: %s", uname); + } + return (uid); +} + +static mode_t +a_mask(const char *s) +{ + int done, rv; + char *ep; + + done = 0; + rv = -1; + if (*s >= '0' && *s <= '7') { + done = 1; + rv = strtol(optarg, &ep, 8); + } + if (!done || rv < 0 || *ep) + errx(EX_USAGE, "invalid file mode: %s", s); + return (rv); +} diff --git a/sys/fs/cd9660/cd9660_mount.h b/sys/fs/cd9660/cd9660_mount.h index 99642603cc7a..97637f66ad93 100644 --- a/sys/fs/cd9660/cd9660_mount.h +++ b/sys/fs/cd9660/cd9660_mount.h @@ -42,6 +42,10 @@ struct iso_args { char *fspec; /* block special device to mount */ struct oexport_args export; /* network export info */ + uid_t uid; /* uid that owns ISO-9660 files */ + gid_t gid; /* gid that owns ISO-9660 files */ + mode_t fmask; /* file mask to be applied for files */ + mode_t dmask; /* file mask to be applied for directories */ int flags; /* mounting flags, see below */ int ssector; /* starting sector, 0 for 1st session */ char *cs_disk; /* disk charset for Joliet cs conversion */ @@ -53,3 +57,6 @@ struct iso_args { #define ISOFSMNT_NOJOLIET 0x00000008 /* disable Joliet Ext.*/ #define ISOFSMNT_BROKENJOLIET 0x00000010/* allow broken Joliet disks */ #define ISOFSMNT_KICONV 0x00000020 /* Use libiconv to convert chars */ + +#define ISOFSMNT_UID 0x00000100 /* override uid */ +#define ISOFSMNT_GID 0x00000200 /* override gid */ diff --git a/sys/fs/cd9660/cd9660_vfsops.c b/sys/fs/cd9660/cd9660_vfsops.c index 38e80a761231..25a56ea1595e 100644 --- a/sys/fs/cd9660/cd9660_vfsops.c +++ b/sys/fs/cd9660/cd9660_vfsops.c @@ -107,6 +107,12 @@ cd9660_cmount(struct mntarg *ma, void *data, uint64_t flags) ma = mount_argsu(ma, "from", args.fspec, MAXPATHLEN); ma = mount_arg(ma, "export", &args.export, sizeof(args.export)); + if (args.flags & ISOFSMNT_UID) + ma = mount_argf(ma, "uid", "%d", args.uid); + if (args.flags & ISOFSMNT_GID) + ma = mount_argf(ma, "gid", "%d", args.gid); + ma = mount_argf(ma, "mask", "%d", args.fmask); + ma = mount_argf(ma, "dirmask", "%d", args.dmask); ma = mount_argsu(ma, "cs_disk", args.cs_disk, 64); ma = mount_argsu(ma, "cs_local", args.cs_local, 64); ma = mount_argf(ma, "ssector", "%u", args.ssector); @@ -221,6 +227,7 @@ iso_mountfs(struct vnode *devvp, struct mount *mp) struct g_consumer *cp; struct bufobj *bo; char *cs_local, *cs_disk; + int v; dev = devvp->v_rdev; dev_ref(dev); @@ -390,6 +397,7 @@ iso_mountfs(struct vnode *devvp, struct mount *mp) isomp->im_mountp = mp; isomp->im_dev = dev; isomp->im_devvp = devvp; + isomp->im_fmask = isomp->im_dmask = ACCESSPERMS; vfs_flagopt(mp->mnt_optnew, "norrip", &isomp->im_flags, ISOFSMNT_NORRIP); vfs_flagopt(mp->mnt_optnew, "gens", &isomp->im_flags, ISOFSMNT_GENS); @@ -397,6 +405,21 @@ iso_mountfs(struct vnode *devvp, struct mount *mp) vfs_flagopt(mp->mnt_optnew, "nojoliet", &isomp->im_flags, ISOFSMNT_NOJOLIET); vfs_flagopt(mp->mnt_optnew, "kiconv", &isomp->im_flags, ISOFSMNT_KICONV); + if (vfs_scanopt(mp->mnt_optnew, "uid", "%d", &v) == 1) { + isomp->im_flags |= ISOFSMNT_UID; + isomp->im_uid = v; + } + if (vfs_scanopt(mp->mnt_optnew, "gid", "%d", &v) == 1) { + isomp->im_flags |= ISOFSMNT_GID; + isomp->im_gid = v; + } + if (vfs_scanopt(mp->mnt_optnew, "mask", "%d", &v) == 1) { + isomp->im_fmask &= v; + } + if (vfs_scanopt(mp->mnt_optnew, "dirmask", "%d", &v) == 1) { + isomp->im_dmask &= v; + } + /* Check the Rock Ridge Extension support */ if (!(isomp->im_flags & ISOFSMNT_NORRIP)) { if ((error = bread(isomp->im_devvp, (isomp->root_extent + diff --git a/sys/fs/cd9660/cd9660_vnops.c b/sys/fs/cd9660/cd9660_vnops.c index 8601b31673c4..cb619379e2cc 100644 --- a/sys/fs/cd9660/cd9660_vnops.c +++ b/sys/fs/cd9660/cd9660_vnops.c @@ -59,6 +59,7 @@ #include #include +#include #include static vop_setattr_t cd9660_setattr; @@ -122,6 +123,9 @@ cd9660_access(struct vop_access_args *ap) struct vnode *vp = ap->a_vp; struct iso_node *ip = VTOI(vp); accmode_t accmode = ap->a_accmode; + accmode_t file_mode; + uid_t uid; + gid_t gid; if (vp->v_type == VCHR || vp->v_type == VBLK) return (EOPNOTSUPP); @@ -143,8 +147,16 @@ cd9660_access(struct vop_access_args *ap) } } - return (vaccess(vp->v_type, ip->inode.iso_mode, ip->inode.iso_uid, - ip->inode.iso_gid, ap->a_accmode, ap->a_cred)); + file_mode = ip->inode.iso_mode; + file_mode &= (vp->v_type == VDIR) ? ip->i_mnt->im_dmask : ip->i_mnt->im_fmask; + + uid = (ip->i_mnt->im_flags & ISOFSMNT_UID) ? + ip->i_mnt->im_uid : ip->inode.iso_uid; + gid = (ip->i_mnt->im_flags & ISOFSMNT_GID) ? + ip->i_mnt->im_gid : ip->inode.iso_gid; + + return (vaccess(vp->v_type, file_mode, uid, + gid, ap->a_accmode, ap->a_cred)); } static int @@ -172,9 +184,13 @@ cd9660_getattr(struct vop_getattr_args *ap) vap->va_fileid = ip->i_number; vap->va_mode = ip->inode.iso_mode; + vap->va_mode &= (vp->v_type == VDIR) ? ip->i_mnt->im_dmask : ip->i_mnt->im_fmask; + vap->va_nlink = ip->inode.iso_links; - vap->va_uid = ip->inode.iso_uid; - vap->va_gid = ip->inode.iso_gid; + vap->va_uid = (ip->i_mnt->im_flags & ISOFSMNT_UID) ? + ip->i_mnt->im_uid : ip->inode.iso_uid; + vap->va_gid = (ip->i_mnt->im_flags & ISOFSMNT_GID) ? + ip->i_mnt->im_gid : ip->inode.iso_gid; vap->va_atime = ip->inode.iso_atime; vap->va_mtime = ip->inode.iso_mtime; vap->va_ctime = ip->inode.iso_ctime; diff --git a/sys/fs/cd9660/iso.h b/sys/fs/cd9660/iso.h index ac3f61e56cc1..bf98e75c42d9 100644 --- a/sys/fs/cd9660/iso.h +++ b/sys/fs/cd9660/iso.h @@ -239,6 +239,11 @@ struct iso_mnt { struct g_consumer *im_cp; struct bufobj *im_bo; + uid_t im_uid; + gid_t im_gid; + mode_t im_fmask; + mode_t im_dmask; + int logical_block_size; int im_bshift; int im_bmask; From nobody Mon Apr 8 19:04:13 2024 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 4VCz656gnmz5HYVg; Mon, 8 Apr 2024 19:04: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 4VCz655rgVz4g1P; Mon, 8 Apr 2024 19:04:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712603053; 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=VZcp6tSjkwHlZ6d7jvOYl8h0g+S/Sc9RQlliC4YyLzI=; b=PjyR5k9ErGjS/NZg+HZ/OYwwTf5aI8qU2CXTFst7Wn8Y4Glhe3reTTHoQ3x2QOiXLycyUD 9Hm6v4he3HEc+Kjby0ihc/VjP1lyNmifiCvJywxrvXnHUTN2/pIzf30JW3YZXDBZ+CtVYp Zo7WKwu3T0LUgtgtf/oZON+6IGZE/x19qGEhU7oXmki1zJn6lD8JKH+ouiBpwMVo4bJRY2 qPHgCsRy18ud/wIrB86mG8uMDe1i2r9Il78CCoSZfZ2xLxdlVW/akh7ZTLAp19oGzk/yNu v8SA8uilJ/GKxpTfeLjTrMOfV1WcGsBkXgTUDrCcnseLaqlmgayTR5ba47r46g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712603053; a=rsa-sha256; cv=none; b=SPqyPkwudZ7K45FeOaa7wQmWXfPUm/+IjHt34BUXkeMx9Ny7UFpvx6ZK8hcS2Et2gCnYlo jQl7JqOsyqjV5T0rcwaPbBNUrHeOwfYLdKr0GqAn/eTovF8PsodjoHvZ4WOvFOBCqPUNja esS8CCKpgd3sTPazZUNJtOlc6VLbVmsFmok/UYBXizp9wow65tX5McXvavBs5PIK+AeXMr MR6W8a3ocOHk4FoOmHjn0J3hjTHi0+40Sh1BYPF0rkn1K4HELCQgJRVcl6lFEJ65sSGqH3 pEIYD7RIF4J6HEMOEIbqGQ/laWX5z/N5rC7NPbYRcB1YyL9ucXevQXSkqLNaGQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712603053; 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=VZcp6tSjkwHlZ6d7jvOYl8h0g+S/Sc9RQlliC4YyLzI=; b=k+kmDWnJeMJWcBbJaPzYL9IGKFfr3NgmCz3B1Gj4cUAc5jV+PkGWZG6kSj7EtN6Yrp9LwJ 1ZFE6cKQ9x1xeyAvoovQ3vpVtL55NP4xGEJZ6VpyTaxktES+FwGz9UD22h5qwCaQuzONWP pdOjHyx3ge7HWKDnquxoLZgTN1mH1jj8cRpathiiFZ4yKeGtuyx0M7mbVRHmG2ll7u8dtr CklTxZzaGLoS2oN421XvHc6koeE8tnBy3amhqqHDFffZmWUrim5RDktNrzstURwY9nIfHP KC/uTbsyNB+nJXmPcJWpcGSqWgmeaWolVdq8lOHoyEyT53QWyCwG6Wxbomd+TA== 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 4VCz655S5WzNN2; Mon, 8 Apr 2024 19:04:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 438J4DaU093546; Mon, 8 Apr 2024 19:04:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 438J4DdU093543; Mon, 8 Apr 2024 19:04:13 GMT (envelope-from git) Date: Mon, 8 Apr 2024 19:04:13 GMT Message-Id: <202404081904.438J4DdU093543@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 3b2b83bcef04 - stable/14 - Stop using expressions in _Alignof() 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 3b2b83bcef04857097666e2784653cfab78ba366 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=3b2b83bcef04857097666e2784653cfab78ba366 commit 3b2b83bcef04857097666e2784653cfab78ba366 Author: Minsoo Choo AuthorDate: 2024-01-12 23:37:53 +0000 Commit: John Baldwin CommitDate: 2024-04-08 17:26:16 +0000 Stop using expressions in _Alignof() _Alignof(expression) is a non-standard extension. This is not allowed in gnu11 and gnu17 which follow the C11 standard _Alignof(type). Reviewed by: arichardson, imp, jhb Fixes: 4a9cd9fc22d7 amd64 db_trace: Reject unaligned frame pointers Fixes: 7ccaf76a27f1 riscv db_trace: Ensure trapframe pointer is suitably aligned. Fixes: 638c68897fbd arm64 db_trace: Ensure trapframe pointer is suitably aligned. Differential Revision: https://reviews.freebsd.org/D43409 (cherry picked from commit 03d04bf49492fc70366e6d78194336a4122282a2) --- sys/amd64/amd64/db_trace.c | 3 ++- sys/arm64/arm64/db_trace.c | 2 +- sys/riscv/riscv/db_trace.c | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/amd64/amd64/db_trace.c b/sys/amd64/amd64/db_trace.c index f9a0c2b6a03e..73b03334ffae 100644 --- a/sys/amd64/amd64/db_trace.c +++ b/sys/amd64/amd64/db_trace.c @@ -206,7 +206,8 @@ db_nextframe(db_addr_t *fp, db_addr_t *ip, struct thread *td) */ tf_addr = *fp + 16; - if (!__is_aligned(tf_addr, _Alignof(*tf)) || !INKERNEL(tf_addr)) { + if (!__is_aligned(tf_addr, _Alignof(struct trapframe)) || + !INKERNEL(tf_addr)) { db_printf("--- invalid trapframe %p\n", (void *)tf_addr); *ip = 0; *fp = 0; diff --git a/sys/arm64/arm64/db_trace.c b/sys/arm64/arm64/db_trace.c index cb1c0789b03f..87ff4b725297 100644 --- a/sys/arm64/arm64/db_trace.c +++ b/sys/arm64/arm64/db_trace.c @@ -93,7 +93,7 @@ db_stack_trace_cmd(struct thread *td, struct unwind_state *frame) struct trapframe *tf; tf = (struct trapframe *)(uintptr_t)frame->fp - 1; - if (!__is_aligned(tf, _Alignof(*tf)) || + if (!__is_aligned(tf, _Alignof(struct trapframe)) || !kstack_contains(td, (vm_offset_t)tf, sizeof(*tf))) { db_printf("--- invalid trapframe %p\n", tf); diff --git a/sys/riscv/riscv/db_trace.c b/sys/riscv/riscv/db_trace.c index 12972839c29d..148ad88b3ffb 100644 --- a/sys/riscv/riscv/db_trace.c +++ b/sys/riscv/riscv/db_trace.c @@ -84,7 +84,7 @@ db_stack_trace_cmd(struct thread *td, struct unwind_state *frame) struct trapframe *tf; tf = (struct trapframe *)(uintptr_t)frame->sp; - if (!__is_aligned(tf, _Alignof(*tf)) || + if (!__is_aligned(tf, _Alignof(struct trapframe)) || !kstack_contains(td, (vm_offset_t)tf, sizeof(*tf))) { db_printf("--- invalid trapframe %p\n", tf); From nobody Mon Apr 8 19:04:14 2024 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 4VCz671Wvcz5HYVk; Mon, 8 Apr 2024 19:04: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 4VCz6703SHz4fr5; Mon, 8 Apr 2024 19:04:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712603055; 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=iu+YatGObTpd7gnIfKaBEvyCJ7S2Qa4DKY9dob2XnOM=; b=lEC4D0Wi4F/p+/8cCO2FDnfb6wsWZ8sF69QB7smjAvkWetRI2AzU1FoQxlmxr314AHbDlI SeaAxsqz2H5lO39aa/dhEigRndXd3JlSXFILDn+Ga5lwO4aOyXkmVTXaIg1C7vk5OMPbyp rhiwKPCi7NRu+eMeCX5j+M2WtO0bG/x+LHkBsUVnUwA7HuUSZM0/loL99nxoZDxH7R8ggW 9CwP/wRFlgboJDXOrf1C0pXJPmfOHaclzUvLcIFIfpqCTA7eGeosyHdyN16RO3ieTOquWw dOEDejJUIT7ud0dwcOls2EhvNcSogUEo9h75WAcFDUnxXdHf6yVixKa72vzWzg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712603055; a=rsa-sha256; cv=none; b=s1bI6hVrkuwgTlR5/dFXONUZVxc9ljYKR+EuyorTim76miftBrameIl/fqykBjmpA+MWon 2GudvuFDn1VtujuwjedJHO4lLKYz8w3q2oh4mnZNpflbhW9S7FxdIFUfMXR2MkBhYBde6c VqauLoiid+e9DFP+dcAXnLTqApavT+TDv/WopEQ5BGvlOIelKPzVsjS0L47nvdQc1m+Y86 TAuKB9Wat2rGrv186TrKzvTYqELCz3gqE4L/1lWOdNNlm153lv6qkPOwoGkCauWLNwbROC tKZH0TBCLWqxUueSZLK2+AXRvAOHenaqG1VphkeTkLO3HFehKxRJdsNlm/d2OA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712603055; 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=iu+YatGObTpd7gnIfKaBEvyCJ7S2Qa4DKY9dob2XnOM=; b=EZyRBWdR/kUk4wHk7iBJgcCsRRDqHNif2Qa8M+/FNz5DsOI2TaQYHb06UHtiN8Sj28qflE XuIXqmX4Rg3V+6Iuv1fq/VIxybSyN5PZ7P7a38EpyDydF5nWqBTYdlS+bq12SUVUydHEWq Tqq4VKC0y9CGyFeu/a5AJ3Lh5Y6o86S3yLaxMqgEhf7PcWbNFXXD+DWVKPDSg//XtCxzX6 gqIg9U+MwUFBzk2FjftLQZPz9/bp+SU/kquzNIGletAEUjxwuv3MavOKZfzJ1AP68Ni3Sk PjPcc/oOQKyn/XEBEGQSB/13VyCjYXkXY2AWdxW/yJ2DyJDBuJO0JYkgTb1A3g== 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 4VCz666TQkzNSk; Mon, 8 Apr 2024 19:04:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 438J4EeJ093615; Mon, 8 Apr 2024 19:04:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 438J4Eea093612; Mon, 8 Apr 2024 19:04:14 GMT (envelope-from git) Date: Mon, 8 Apr 2024 19:04:14 GMT Message-Id: <202404081904.438J4Eea093612@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 1aebbbc69bb6 - stable/14 - find: Allow '/' to be used with -perm for GNU 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1aebbbc69bb65f35c60493479df62486a7b74a04 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=1aebbbc69bb65f35c60493479df62486a7b74a04 commit 1aebbbc69bb65f35c60493479df62486a7b74a04 Author: Ricardo Branco AuthorDate: 2024-01-15 18:35:27 +0000 Commit: John Baldwin CommitDate: 2024-04-08 17:33:19 +0000 find: Allow '/' to be used with -perm for GNU compatibility In 2005, Gnu find deprecated '+' as the leading character for the -perm argument, instead preferring '/' with the same meaning. Implement that behavior here, and document it in the man page. Reviewed by: imp, emaste Pull Request: https://github.com/freebsd/freebsd-src/pull/1060 (cherry picked from commit 2a121b97e9673ff37062c9fa026eee969940d2e2) --- usr.bin/find/find.1 | 19 ++++++++++++++++--- usr.bin/find/function.c | 2 +- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/usr.bin/find/find.1 b/usr.bin/find/find.1 index afa4c7ab8215..a73196180e7c 100644 --- a/usr.bin/find/find.1 +++ b/usr.bin/find/find.1 @@ -30,7 +30,7 @@ .\" .\" @(#)find.1 8.7 (Berkeley) 5/9/95 .\" -.Dd December 22, 2023 +.Dd January 15, 2024 .Dt FIND 1 .Os .Sh NAME @@ -759,7 +759,7 @@ Slashes .Pq Dq Li / are treated as normal characters and do not have to be matched explicitly. -.It Ic -perm Oo Cm - Ns | Ns Cm + Oc Ns Ar mode +.It Ic -perm Oo Cm - Ns | Ns Cm + Ns | Ns Cm / Oc Ns Ar mode The .Ar mode may be either symbolic (see @@ -788,11 +788,14 @@ are set in the file's mode bits. If the .Ar mode is preceded by a plus -.Pq Dq Li + , +.Pq Dq Li + this primary evaluates to true if any of the bits in the .Ar mode are set in the file's mode bits. +A slash +.Pq Dq Li / +is also accepted with the same meaning as plus for compatibility with GNU find. Otherwise, this primary evaluates to true if the bits in the .Ar mode @@ -1118,6 +1121,16 @@ option was inspired by the equivalent and .Xr sed 1 options. +.Pp +The +.Ic -perm +primary accepts a leading slash +.Pq Dq Li / +as an alias for a leading plus +.Pq Dq Li + +for its argument as an extension of +.St -p1003.1-2001 +to be compatible with GNU find. .Sh HISTORY A simple .Nm diff --git a/usr.bin/find/function.c b/usr.bin/find/function.c index d887c8479099..9c1fd4df8731 100644 --- a/usr.bin/find/function.c +++ b/usr.bin/find/function.c @@ -1343,7 +1343,7 @@ c_perm(OPTION *option, char ***argvp) if (*perm == '-') { new->flags |= F_ATLEAST; ++perm; - } else if (*perm == '+') { + } else if (*perm == '+' || *perm == '/') { new->flags |= F_ANY; ++perm; } From nobody Mon Apr 8 19:04:15 2024 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 4VCz683sQ1z5HYVn; Mon, 8 Apr 2024 19:04: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 4VCz680qXQz4g1s; Mon, 8 Apr 2024 19:04:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712603056; 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=F02HvsLVpPfm0P24elFErZHTm83saaIaeE4VrzuSXjM=; b=DxmGeNQprE3f3O17bQjQtpeybUDxujgYX310uI5Ge4gODm6SVNv72QLi3dF2zbD5aj2dYQ MMwjczRiQQB+Btf9Y0iqiZvsDmPJMY8EIln8XbZIVg0nqirYmc36XZaQt1T8fFnKI+05ih J3qxkwPKugxEMjDoE1/qI4pd/kvVMgePfb8jekrnyiQbQ7dxbfgw4SFydDE4fwYIGiAZCR M2FNwFkx8tFNcqYYjrDepmk4RHJJEXi4EceSEb+vnXs1mirO5opwSXFMVAw1SXNMNHydgt Aw10TRhiwguWoEVTman6KlZHXUEzLhhACRkrJ4XTNzvzJTFlf6TIx2KCBwqIbQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712603056; a=rsa-sha256; cv=none; b=sjINibExDxfzyIR0uto7F1zayPGTTUEmKgSvCMb1uKyRf7rqFBUzFKXQDhdm8ZdhYvNg01 h9FJYMCTLICBXQfjwSDptcKal1AujZhyV3FVRn2DKuYLaIcELXzrxyGUFNgbumxoHcm76u IfSPGbrQ2RW8h/W4MPAI/mDmBJZAGHOYwEgq79uGJXY+McKfPr19JYUOsxvOwvzUU/AGkT obWfQZocNCyp0zJDjYqyvySHgyhfk7LcRV1KrUAGRRuQUS1nghc61VBI85pAUym8RwvFof RoF0Cixpr1Lpxafcsh7GEzP6l62Zwz8ReXlcRsAW6oCo2qqMkGryxepRzlC4WQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712603056; 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=F02HvsLVpPfm0P24elFErZHTm83saaIaeE4VrzuSXjM=; b=jh3pmUvpDrk7PgXcLGD2VABGvEYlLFgq6MLFL4Lw8LRe3n1CVT+qtcTA7FH+bDUefoXn1u 1DzK3rb2Q+r73wgXrznumPgJlx9bXS/eZdvbHRAhU6+OxGsfv/Y1r4Co//3f8iPLy1gmbq Wn0IqMaDVFZQuAIRC4ypPYpcdviOzNwmXAeopwzt/LkrEVFNdBeKLVHEkObF3Rrm1WpiWJ H2/B7sYlsjTNL9Xh7LmujFuV6zi0wD7cM3VBuAu62E0W5M/0rF5U5R/S2QMuwR+rv7Gq0G 19KLC2Wv8Z1odY5pR0eLlcKQnnHAbhmJj92f8UVCGinsC9hi02OHSdhySABMdw== 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 4VCz680RKLzNdg; Mon, 8 Apr 2024 19:04:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 438J4FjM093663; Mon, 8 Apr 2024 19:04:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 438J4FOv093660; Mon, 8 Apr 2024 19:04:15 GMT (envelope-from git) Date: Mon, 8 Apr 2024 19:04:15 GMT Message-Id: <202404081904.438J4FOv093660@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 551f4b478bf8 - stable/14 - find: Add -readable, -writable & -executable options 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 551f4b478bf833aa8b268299cad90508b1ff4311 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=551f4b478bf833aa8b268299cad90508b1ff4311 commit 551f4b478bf833aa8b268299cad90508b1ff4311 Author: Ricardo Branco AuthorDate: 2024-01-21 19:53:05 +0000 Commit: John Baldwin CommitDate: 2024-04-08 17:34:32 +0000 find: Add -readable, -writable & -executable options Reviewed by: jhb, Mina Galić Pull Request: https://github.com/freebsd/freebsd-src/pull/1080 (cherry picked from commit e4b646ce16105efc943bc8ac2242a2220dfe18d8) --- usr.bin/find/extern.h | 3 +++ usr.bin/find/find.1 | 20 +++++++++++++++++++- usr.bin/find/function.c | 39 +++++++++++++++++++++++++++++++++++++++ usr.bin/find/option.c | 3 +++ 4 files changed, 64 insertions(+), 1 deletion(-) diff --git a/usr.bin/find/extern.h b/usr.bin/find/extern.h index 8c98a6d86bcd..3436f8cf07bf 100644 --- a/usr.bin/find/extern.h +++ b/usr.bin/find/extern.h @@ -88,6 +88,7 @@ exec_f f_delete; exec_f f_depth; exec_f f_empty; exec_f f_exec; +exec_f f_executable; exec_f f_expr; exec_f f_false; exec_f f_flags; @@ -109,11 +110,13 @@ exec_f f_print; exec_f f_print0; exec_f f_prune; exec_f f_quit; +exec_f f_readable; exec_f f_regex; exec_f f_size; exec_f f_sparse; exec_f f_type; exec_f f_user; +exec_f f_writable; extern int ftsoptions, ignore_readdir_race, isdepth, isoutput; extern int issort, isxargs; diff --git a/usr.bin/find/find.1 b/usr.bin/find/find.1 index a73196180e7c..def6a82d0a97 100644 --- a/usr.bin/find/find.1 +++ b/usr.bin/find/find.1 @@ -30,7 +30,7 @@ .\" .\" @(#)find.1 8.7 (Berkeley) 5/9/95 .\" -.Dd January 15, 2024 +.Dd January 21, 2024 .Dt FIND 1 .Os .Sh NAME @@ -467,6 +467,12 @@ if at least one invocation of returns a non-zero exit status, .Nm will return a non-zero exit status. +.It Ic -executable +Matches files which are executable by the current user. +This test makes use of the +.Xr access 2 +system call, and so can be fooled by NFS servers which do UID mapping (or root-squashing). +This is a GNU find extension. .It Ic -flags Oo Cm - Ns | Ns Cm + Oc Ns Ar flags , Ns Ar notflags The flags are specified using symbolic names (see .Xr chflags 1 ) . @@ -831,6 +837,12 @@ option was specified. Causes .Nm to terminate immediately. +.It Ic -readable +Matches files which are readable by the current user. +This test makes use of the +.Xr access 2 +system call, and so can be fooled by NFS servers which do UID mapping (or root-squashing). +This is a GNU find extension. .It Ic -regex Ar pattern True if the whole path of the file matches .Ar pattern @@ -927,6 +939,12 @@ is treated as a user ID. The same thing as .Ic -path , for GNU find compatibility. +.It Ic -writable +Matches files which are writable by the current user. +This test makes use of the +.Xr access 2 +system call, and so can be fooled by NFS servers which do UID mapping (or root-squashing). +This is a GNU find extension. .El .Sh OPERATORS The primaries may be combined using the following operators. diff --git a/usr.bin/find/function.c b/usr.bin/find/function.c index 9c1fd4df8731..d28c0edced9e 100644 --- a/usr.bin/find/function.c +++ b/usr.bin/find/function.c @@ -1813,3 +1813,42 @@ f_quit(PLAN *plan __unused, FTSENT *entry __unused) } /* c_quit == c_simple */ + +/* + * -readable + * + * File is readable + */ +int +f_readable(PLAN *plan __unused, FTSENT *entry) +{ + return (access(entry->fts_path, R_OK) == 0); +} + +/* c_readable == c_simple */ + +/* + * -writable + * + * File is writable + */ +int +f_writable(PLAN *plan __unused, FTSENT *entry) +{ + return (access(entry->fts_path, W_OK) == 0); +} + +/* c_writable == c_simple */ + +/* + * -executable + * + * File is executable + */ +int +f_executable(PLAN *plan __unused, FTSENT *entry) +{ + return (access(entry->fts_path, X_OK) == 0); +} + +/* c_executable == c_simple */ diff --git a/usr.bin/find/option.c b/usr.bin/find/option.c index c5b461f3389b..dc5e5003b3fb 100644 --- a/usr.bin/find/option.c +++ b/usr.bin/find/option.c @@ -80,6 +80,7 @@ static OPTION const options[] = { { "-empty", c_empty, f_empty, 0 }, { "-exec", c_exec, f_exec, 0 }, { "-execdir", c_exec, f_exec, F_EXECDIR }, + { "-executable", c_simple, f_executable, 0 }, { "-false", c_simple, f_false, 0 }, #if HAVE_STRUCT_STAT_ST_FLAGS { "-flags", c_flags, f_flags, 0 }, @@ -154,6 +155,7 @@ static OPTION const options[] = { // -printf { "-prune", c_simple, f_prune, 0 }, { "-quit", c_simple, f_quit, 0 }, + { "-readable", c_simple, f_readable, 0 }, { "-regex", c_regex, f_regex, 0 }, { "-samefile", c_samefile, f_inum, 0 }, { "-size", c_size, f_size, 0 }, @@ -163,6 +165,7 @@ static OPTION const options[] = { { "-uid", c_user, f_user, 0 }, { "-user", c_user, f_user, 0 }, { "-wholename", c_name, f_path, 0 }, + { "-writable", c_simple, f_writable, 0 }, { "-xdev", c_xdev, f_always_true, 0 }, // -xtype }; From nobody Mon Apr 8 19:04:17 2024 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 4VCz695XbWz5HYlB; Mon, 8 Apr 2024 19:04: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 4VCz691sj3z4fyx; Mon, 8 Apr 2024 19:04:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712603057; 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=dsQkTde43qrA3/qdbR2yd6Tyzv3jIhHlaExpY7KAPyA=; b=iNFC+gtMwfT9sI6xwBy6FlIKAEd3rjCsGx+kKL3Vo0u0zyRu7Ie0AWc4ES4f7lBSBKPso2 3+HonxL+fv533q7hTR5+niMjawJxKsm/cgxSGYvSPlNrSU6t05vkeKOuyAdrnbeDD42gLZ HnyELxpOo6NpvTLK5J7GVqR62Qtq9Zh90BaEB10g0gvDgfRkOuA1t3F4CSYEwN/31qp2yI y8cDRRuR66CfhXU+nXm+uFFC8Keve6m7Nta3v5cqvY7MdYBWvAb1VXR5jSekCwT0Kaqk/z e/3pVLrzZQJ3UkpRs7vKBUrhnk0VyYWYkSkK0nhLt+4Mc/uzEZ8AsQljV86zXw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712603057; a=rsa-sha256; cv=none; b=lAlWO+u2RtFW0r48wk7CuovwE0FiQU79ocliESPkq3XWT+odbpJAYAcakALkkvSDT0/s4B gQ3f6JuiW5yiGSRyNMFMz7eP9rdLpxEyn7B98bR4nGXuUa0CflT4RAooBVzJ48n6h5HckK IDZcndbSml3SKMtGQJcUFpncUYMzTUtU+CbcjQK9v+IL8kfKxMqJxj62AA/8oJl5zUOG6v 1YN1QmX9p8mMBgUMpIzyUIDsj0mtEzJV+PHXrNZbN4M3SPgg+NCIeeitp86I37PeC+9P7K XJeVbX79xCQSQlFvF0RTtBOq+evx6tJ/UPoh4NfFGdiB3E+WxL+sDqTD3Mm4HQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712603057; 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=dsQkTde43qrA3/qdbR2yd6Tyzv3jIhHlaExpY7KAPyA=; b=VyIqqoQiiy9VcPyY3VY+zs+YU397mwectbNIlgn9I1iQJUZbv3ocTk8vAkxXcSgWSdSVIh pUO1aLjFjWgoplXYizCf9PFAYqTmMEnrn/hjmQ45c4Fh9jsr8qQ81RVH7PWKAe9QgrOWz0 YIUjVgbrp4/rb4ckQZ3/bgU5INuVD2JRz0PYxKGXq+5v0/Z52WTLVmbfzaCWHnkhR/VYR9 UK1cDQWVcNNAjIpRpOdA7+M+izrVa+7jzAHcrvG2BShPo5XohtPNRiIhXEOS0BZNa2QIPr D1upWcWaH4i8XoRQ1l/fEaOuTl6rYvubCWYuhUprgKP0pW7iaOLN/96T7XgXsA== 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 4VCz691ML4zNQ9; Mon, 8 Apr 2024 19:04:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 438J4HPD093696; Mon, 8 Apr 2024 19:04:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 438J4HRh093693; Mon, 8 Apr 2024 19:04:17 GMT (envelope-from git) Date: Mon, 8 Apr 2024 19:04:17 GMT Message-Id: <202404081904.438J4HRh093693@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 4fa4e6a3c80e - stable/14 - netlink.h: s/typeof/__typeof 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4fa4e6a3c80eb3a4f34877fcff60016e93e4be9d Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=4fa4e6a3c80eb3a4f34877fcff60016e93e4be9d commit 4fa4e6a3c80eb3a4f34877fcff60016e93e4be9d Author: Lexi Winter AuthorDate: 2024-01-18 02:34:39 +0000 Commit: John Baldwin CommitDate: 2024-04-08 17:37:44 +0000 netlink.h: s/typeof/__typeof typeof() does not exist in -std=c99 mode and the relevant #define is only for _KERNEL, so use __typeof here instead. Reviewed by: jhb MFC after: 2 weeks Pull Request: https://github.com/freebsd/freebsd-src/pull/1070 (cherry picked from commit 4261507a5e3e73ef6f9535935d22785056954b19) --- sys/netlink/netlink.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netlink/netlink.h b/sys/netlink/netlink.h index 759bbed6139c..2cffa7299ef4 100644 --- a/sys/netlink/netlink.h +++ b/sys/netlink/netlink.h @@ -204,7 +204,7 @@ enum nlmsginfo_attrs { #define NL_ITEM_OK(_ptr, _len, _hlen, _LEN_M) \ ((_len) >= _hlen && _LEN_M(_ptr) >= _hlen && _LEN_M(_ptr) <= (_len)) -#define NL_ITEM_NEXT(_ptr, _LEN_M) ((typeof(_ptr))((char *)(_ptr) + _LEN_M(_ptr))) +#define NL_ITEM_NEXT(_ptr, _LEN_M) ((__typeof(_ptr))((char *)(_ptr) + _LEN_M(_ptr))) #define NL_ITEM_ITER(_ptr, _len, _LEN_MACRO) \ ((_len) -= _LEN_MACRO(_ptr), NL_ITEM_NEXT(_ptr, _LEN_MACRO)) From nobody Mon Apr 8 19:04:18 2024 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 4VCz6B43P0z5HYdF; Mon, 8 Apr 2024 19:04: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 4VCz6B2P15z4g7G; Mon, 8 Apr 2024 19:04:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712603058; 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=TtMw/krmFZVUA83Ih8/8dMTYaKP8IWRSmUPGB/+uMLk=; b=ea6wRzTFaxlsQTO7sSGikEJ3ect60pvxq2jGm0BBK4e2+y5FDgH72bE1MolWoEuXcNTF/f Rf3s/Su1mlNEEXso3b4C+5LB9uxnQtQDvuXTyGMHgRSg+G+e5RtjBP7kdSE62xuVfVyO2g MbJbU1st0O6XG98tMT/k6wQnUFxgWJyz6R94Pm7cTzM2eWdF0V9nq7vYmoDEk4ko3AHs7T rYQmdGT7QmrHhqHsRCZzpDhfZ5PzpLAllw0zoWNgGQkTMoMFl8L/IJG1WcF/E+2swog212 YLXE0OJPhrHVWBPgH8nGJCUcmYZFRbOYl6QDAKJjO8IR4KkeEzdQSU4B11Xl0w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712603058; a=rsa-sha256; cv=none; b=rN5DnGJpXI1jv7AH2+vAPNEoG/ct2EZ/lvkpyqhwAl1mzn1JQwWuleZyFcVoqM7jno8bK+ QrN/sVjYqTaML896NChuqhWQprXwdOs4cFJIil79DgTvvQNLGVVu00BONm4oLUyBpZkwl0 EcIxVD/uTWxI3162UQHwIGPkODiZGRUu+5ymipgVEtXfBu7Drph5wO7fRU4SJV6xntPeki JQXaKW0IELiXmS88nzykL1+4LU4lV0daXf83UjNso+YsMoQmCtnilxSCGCONaYwiXClrWm ZcIycLM4Cwecx1bgG8DHUs3Q7Jl10oS5INMbLE85R0djswC70odI3a1svpiFBw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712603058; 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=TtMw/krmFZVUA83Ih8/8dMTYaKP8IWRSmUPGB/+uMLk=; b=bduOoFNawLY3QrvwxP6ksBPkoD42mjcgGTAx9FAnrbmvWBpZz9/X9qzwh0lwXkNwoSK0Sd hIunGfcgT0a0JrVoZpzXFgYJSugz/7ISOn/KpNYd7mSp9DGD+L56kBryGmXLH+kk70ocph ZIflySEEoYX1AEq3iOSCpUHpbJKJo3biVB64w+wJaI5JkSTR33GKr1NRiekU7Xwa5UcXaZ 8jR29o5JFEYldjWHIxNFpcwshCqgpaniB6LdmFZZ/1CCt2roq/GwAKiK0VsLDNZwV6EWO7 YtMTaKiRGgIDsgkhN3IzY6MPd9F+XAYX7e1zT1J2D1CJKUggYfXzvc1He4UwyA== 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 4VCz6B21RWzNN3; Mon, 8 Apr 2024 19:04:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 438J4Itt093748; Mon, 8 Apr 2024 19:04:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 438J4IJa093745; Mon, 8 Apr 2024 19:04:18 GMT (envelope-from git) Date: Mon, 8 Apr 2024 19:04:18 GMT Message-Id: <202404081904.438J4IJa093745@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: d32c600949d5 - stable/14 - newfs_msdos.8: example for specific cluster size 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d32c600949d5891c014e9e794562e60caa2859f1 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=d32c600949d5891c014e9e794562e60caa2859f1 commit d32c600949d5891c014e9e794562e60caa2859f1 Author: Alexander Ziaee AuthorDate: 2024-01-12 22:12:48 +0000 Commit: John Baldwin CommitDate: 2024-04-08 17:37:58 +0000 newfs_msdos.8: example for specific cluster size The usual use case in 2024 for newfs_msdosfs is creating filesystems on SD cards for older hardware. In most tutorials, they call the cluster size "allocation size". Therefore, add a small note next to cluster size that it is also called allocation size, and add an example for how to do this. Reviewed by: jhb Pull Request: https://github.com/freebsd/freebsd-src/pull/1045 (cherry picked from commit c8bf9f09ee3d5ac97d38218f2123893a7f1f0285) --- sbin/newfs_msdos/newfs_msdos.8 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sbin/newfs_msdos/newfs_msdos.8 b/sbin/newfs_msdos/newfs_msdos.8 index 278612548dc4..efa69c058453 100644 --- a/sbin/newfs_msdos/newfs_msdos.8 +++ b/sbin/newfs_msdos/newfs_msdos.8 @@ -23,7 +23,7 @@ .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd June 14, 2018 +.Dd January 12, 2024 .Dt NEWFS_MSDOS 8 .Os .Sh NAME @@ -134,7 +134,7 @@ File system block size (bytes per cluster). This should resolve to an acceptable number of sectors per cluster (see below). .It Fl c Ar cluster-size -Sectors per cluster. +Sectors per cluster, also called allocation size. Acceptable values are powers of 2 in the range 1 through 128. If the block or cluster size are not specified, the code @@ -224,6 +224,12 @@ Create a file system, using default parameters, on newfs_msdos /dev/ada0s1 .Ed .Pp +Create a FAT32 filesystem with a 32K allocation size on +.Pa /dev/mmcsd0s1 : +.Bd -literal -offset indent +newfs_msdos -F 32 -A -c 64 /dev/mmcsd0s1 +.Ed +.Pp Create a standard 1.44M file system, with volume label .Ar foo , on From nobody Mon Apr 8 19:04:19 2024 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 4VCz6C3y3Sz5HYZq; Mon, 8 Apr 2024 19:04: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 4VCz6C3501z4fwv; Mon, 8 Apr 2024 19:04:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712603059; 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=MfUSQ4+PahNDi/yoBIAv3XZudQf3Y0Mmi7vS1v/lUFw=; b=ZZmgpTp5dJRpt+Wd38i4cK17TpkpnvY/JJ7wVlcn1h0/dFNuD8+GSYXLMEAFaGRC5RVXNK W0FlOr73pFbeXNK2wwt0d3rJqVPYVliFF+QW0vsTjJ5EMoUmOvuqen35Ei028dYFjtj4m6 v0WPewERk1J8V8CNCPoCzNYIidu41ZmUr0EGsh84dL2lUY+UdIiYw4XEfd+gMX53xukAyr X73gnpyefFh6E7tlu584jDpMZAlNu54P4RgazORFu/lXxcYISrobm9Hv6Xhd1xBVa9Izd0 48Om5/TQczkuWlUpEnTYTae4vyxewxoW+3MHSHADscgCjQkRlUhMRsTzAIycbg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712603059; a=rsa-sha256; cv=none; b=u0l4bz0nPB0RhnlvhD6ySqx+DF9ziIA4vTKGfu6QBh01GEslK0mYuQv1MrHuIlRXdRI3AS i1cS7DVzVKBbJcHGVtq+9tYKaqh7RG8zeIbwKDv0k+11qIXVGJQZEyyK4+2ARdQDOS+nLd IFrzW8BtJxr6mhtG+JZHYiOJcq8JNftnHW/0uMpdlP7w8Q1XvB/9KNxWXOGh4ryXHNQGLu gs8rtxJ1iif75GkzdsPt2Vt9FX7Id+dysXmtXmf7bbqOqQoFeY26p85XkoWiqF78XEljw5 pJyLKVWlDCv+l9fFLZgj9bNrVVSeFAR5PgUOmoO+RAHgO12FPldM2zkYCeqDgg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712603059; 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=MfUSQ4+PahNDi/yoBIAv3XZudQf3Y0Mmi7vS1v/lUFw=; b=G/TjTkL++snbyAFJxdDovkwNYCMl7+WypwWdRBrWEXMlUW1ilN/DtwvNs/Vncmfwh1wuCP bx4zl4iaUwRisv/AfHU/lUmMXXmHUK6xSYvhOij7nYh32U0Y6e4Zdwd4BUhd+rb+eiC7/o 6pDWXudFSS8/N5Rz0kBktvJMjevVo7mczG1yowsqOzgls0rghTUH2eqZFewd05wQBvzQ1g K5C89EOI8GstvsXV7CUq/qthcTt4CjHxbGqyJc51vtxAq6L8hYys+SXW2I6OD2GjxlDE4C 6H+3HWfT9fjm5t2lyGp8C2HnDX/n0i5KT86TNo0AUrh97e0WEQxDSRea4hWhMA== 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 4VCz6C2gLfzNQB; Mon, 8 Apr 2024 19:04:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 438J4JEt093790; Mon, 8 Apr 2024 19:04:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 438J4J5k093787; Mon, 8 Apr 2024 19:04:19 GMT (envelope-from git) Date: Mon, 8 Apr 2024 19:04:19 GMT Message-Id: <202404081904.438J4J5k093787@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: aa61ecf00337 - stable/14 - syscallsubr.h: Sort kern_membarrier prototype alphabetically 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: aa61ecf00337e00502de97b9fe55449ed697a8ec Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=aa61ecf00337e00502de97b9fe55449ed697a8ec commit aa61ecf00337e00502de97b9fe55449ed697a8ec Author: John Baldwin AuthorDate: 2024-01-31 00:38:29 +0000 Commit: John Baldwin CommitDate: 2024-04-08 17:38:46 +0000 syscallsubr.h: Sort kern_membarrier prototype alphabetically (cherry picked from commit 14505c92bc8ca56d4c8a09072d043642f5e87ed7) --- sys/sys/syscallsubr.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/sys/syscallsubr.h b/sys/sys/syscallsubr.h index 29c7c364ccf6..50a936591dc7 100644 --- a/sys/sys/syscallsubr.h +++ b/sys/sys/syscallsubr.h @@ -221,13 +221,13 @@ int kern_lseek(struct thread *td, int fd, off_t offset, int whence); int kern_lutimes(struct thread *td, const char *path, enum uio_seg pathseg, const struct timeval *tptr, enum uio_seg tptrseg); int kern_madvise(struct thread *td, uintptr_t addr, size_t len, int behav); +int kern_membarrier(struct thread *td, int cmd, unsigned flags, + int cpu_id); int kern_mincore(struct thread *td, uintptr_t addr, size_t len, char *vec); int kern_minherit(struct thread *td, uintptr_t addr, size_t len, int inherit); int kern_mkdirat(struct thread *td, int fd, const char *path, enum uio_seg segflg, int mode); -int kern_membarrier(struct thread *td, int cmd, unsigned flags, - int cpu_id); int kern_mkfifoat(struct thread *td, int fd, const char *path, enum uio_seg pathseg, int mode); int kern_mknodat(struct thread *td, int fd, const char *path, From nobody Mon Apr 8 19:04:20 2024 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 4VCz6F0PdKz5HYSN; Mon, 8 Apr 2024 19:04: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 4VCz6D4W0rz4g7q; Mon, 8 Apr 2024 19:04:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712603060; 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=ZNTN8CF+s4X/Azs/miO3hyIHTqMvz0XUnRdE+K9sPqI=; b=g+BpMGskihq04gMZfCYcYP1nR226TzqgL39Nrp+ijLEFFs4thOsEc1x4rFlJQjdfMuzYgD ChiJujEXn7xqF2UPUPsI6F+Y4oRtp51gB1Fp5rA+dWQS0SjP9YhKsjtgsVklQT3LI4Va+P tww0aogPj5bOnxDW6prJ8DXXVSN6uTQoSfZO+R3kY5ZDvsqd0gpu1WangGTlDe2OgPx634 8o80zSUOySM3ZUrYoDEKoD08kxO93AYC9uUI6ykMNWatJ20Z/pP6Joxex/Bviwtxs/KFHh VuyHT3ybOTuKi+wDZXaGBQYLhdEH2DLCXmREegY+3roywEvZW72GhjqRmjW/qg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712603060; a=rsa-sha256; cv=none; b=wzu5JO7+oZbyupp8X2Z3PPi3vwF777X4mP11Iq7sQ6g9V45GgF1oHT59W4ZKApASlxK0aa y93OsFZmRa1IwAQHVOSNhH9+DZQH4TUmSKZ8FiryuWfXeGYEVimOVR9/Zuq1SVUxL8N8S1 ykeCGeLrafTCp8R1A3hYEROujPO7wIPBuwIVITMKIe81iZaBpQe0A8VACjuz0EDuwzUf8R oEBAQoc3qWl1jlSfQU6KlWrtYV/sYkR5aW/tyX9CZTkiruc+tR2iDI0zM8VEHiiF75rC1j hwvXTmmAcFGfh5sgIjznm3uavHQ3ptkRYEJE1HeIB9zfyQ3N6vOfvAu52MiyxQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712603060; 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=ZNTN8CF+s4X/Azs/miO3hyIHTqMvz0XUnRdE+K9sPqI=; b=YBp+lC97A99/lcRNdu3lIo4f0t/IiGHjQ5vHmQ7t47dZE46H4k6JMeb17dS4Vm2kQFiVbU UQfpPao/kJqcBvPDqWmP9FFSCyIq//YJgz4/0Pte8m3/vuLB2v4Z+4lvnWGqWAdaRBCp58 hKqVGAdvgD1Q3q3Gx5dpXC/pAP4M1l9zMTR7dvrQRGeQpOm2a5PWv59dpF4bqQztVLFoJI QZG4JCbt0VpvRNgF6f+O0YKYwonu//kyAZdijTQR9wMitSnG7mpdjNWIXodcuxx0JCJWJD +jQsow0uMEch/pNlHDAPUtYJU8ZkEzF9uKlvjZNwlgQb3kNHgHcD9WMOQkODCA== 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 4VCz6D46z4zNN4; Mon, 8 Apr 2024 19:04:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 438J4KQo093855; Mon, 8 Apr 2024 19:04:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 438J4Kdh093852; Mon, 8 Apr 2024 19:04:20 GMT (envelope-from git) Date: Mon, 8 Apr 2024 19:04:20 GMT Message-Id: <202404081904.438J4Kdh093852@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 138ed6fee2c2 - stable/14 - cxgbe: Add counters for POSIX async I/O requests handled by the driver 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 138ed6fee2c23f9412906c1212659aa6dbf66a39 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=138ed6fee2c23f9412906c1212659aa6dbf66a39 commit 138ed6fee2c23f9412906c1212659aa6dbf66a39 Author: John Baldwin AuthorDate: 2024-01-31 00:40:31 +0000 Commit: John Baldwin CommitDate: 2024-04-08 17:39:16 +0000 cxgbe: Add counters for POSIX async I/O requests handled by the driver Reviewed by: np Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D43668 (cherry picked from commit c3d4aea6c5bef0dcdc5194d4a828625f4d34a1dc) --- sys/dev/cxgbe/adapter.h | 4 ++++ sys/dev/cxgbe/t4_main.c | 4 ++++ sys/dev/cxgbe/t4_sge.c | 16 ++++++++++++++++ sys/dev/cxgbe/tom/t4_cpl_io.c | 6 +++++- sys/dev/cxgbe/tom/t4_ddp.c | 12 ++++++++++-- 5 files changed, 39 insertions(+), 3 deletions(-) diff --git a/sys/dev/cxgbe/adapter.h b/sys/dev/cxgbe/adapter.h index c3105ecacffd..3157d08cc67b 100644 --- a/sys/dev/cxgbe/adapter.h +++ b/sys/dev/cxgbe/adapter.h @@ -686,6 +686,8 @@ struct sge_ofld_rxq { uint64_t rx_iscsi_padding_errors; uint64_t rx_iscsi_header_digest_errors; uint64_t rx_iscsi_data_digest_errors; + uint64_t rx_aio_ddp_jobs; + uint64_t rx_aio_ddp_octets; u_long rx_toe_tls_records; u_long rx_toe_tls_octets; } __aligned(CACHE_LINE_SIZE); @@ -752,6 +754,8 @@ struct sge_ofld_txq { counter_u64_t tx_iscsi_pdus; counter_u64_t tx_iscsi_octets; counter_u64_t tx_iscsi_iso_wrs; + counter_u64_t tx_aio_jobs; + counter_u64_t tx_aio_octets; counter_u64_t tx_toe_tls_records; counter_u64_t tx_toe_tls_octets; } __aligned(CACHE_LINE_SIZE); diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 3b6cb7285e64..4fbc45e16464 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -12026,6 +12026,8 @@ clear_stats(struct adapter *sc, u_int port_id) counter_u64_zero(ofld_txq->tx_iscsi_pdus); counter_u64_zero(ofld_txq->tx_iscsi_octets); counter_u64_zero(ofld_txq->tx_iscsi_iso_wrs); + counter_u64_zero(ofld_txq->tx_aio_jobs); + counter_u64_zero(ofld_txq->tx_aio_octets); counter_u64_zero(ofld_txq->tx_toe_tls_records); counter_u64_zero(ofld_txq->tx_toe_tls_octets); } @@ -12043,6 +12045,8 @@ clear_stats(struct adapter *sc, u_int port_id) ofld_rxq->rx_iscsi_ddp_octets = 0; ofld_rxq->rx_iscsi_fl_pdus = 0; ofld_rxq->rx_iscsi_fl_octets = 0; + ofld_rxq->rx_aio_ddp_jobs = 0; + ofld_rxq->rx_aio_ddp_octets = 0; ofld_rxq->rx_toe_tls_records = 0; ofld_rxq->rx_toe_tls_octets = 0; } diff --git a/sys/dev/cxgbe/t4_sge.c b/sys/dev/cxgbe/t4_sge.c index b742f22a7d78..76293b06a6a9 100644 --- a/sys/dev/cxgbe/t4_sge.c +++ b/sys/dev/cxgbe/t4_sge.c @@ -4146,6 +4146,12 @@ add_ofld_rxq_sysctls(struct sysctl_ctx_list *ctx, struct sysctl_oid *oid, return; children = SYSCTL_CHILDREN(oid); + SYSCTL_ADD_U64(ctx, children, OID_AUTO, "rx_aio_ddp_jobs", + CTLFLAG_RD, &ofld_rxq->rx_aio_ddp_jobs, 0, + "# of aio_read(2) jobs completed via DDP"); + SYSCTL_ADD_U64(ctx, children, OID_AUTO, "rx_aio_ddp_octets", + CTLFLAG_RD, &ofld_rxq->rx_aio_ddp_octets, 0, + "# of octets placed directly for aio_read(2) jobs"); SYSCTL_ADD_ULONG(ctx, children, OID_AUTO, "rx_toe_tls_records", CTLFLAG_RD, &ofld_rxq->rx_toe_tls_records, "# of TOE TLS records received"); @@ -4809,6 +4815,8 @@ alloc_ofld_txq(struct vi_info *vi, struct sge_ofld_txq *ofld_txq, int idx) ofld_txq->tx_iscsi_pdus = counter_u64_alloc(M_WAITOK); ofld_txq->tx_iscsi_octets = counter_u64_alloc(M_WAITOK); ofld_txq->tx_iscsi_iso_wrs = counter_u64_alloc(M_WAITOK); + ofld_txq->tx_aio_jobs = counter_u64_alloc(M_WAITOK); + ofld_txq->tx_aio_octets = counter_u64_alloc(M_WAITOK); ofld_txq->tx_toe_tls_records = counter_u64_alloc(M_WAITOK); ofld_txq->tx_toe_tls_octets = counter_u64_alloc(M_WAITOK); add_ofld_txq_sysctls(&vi->ctx, oid, ofld_txq); @@ -4847,6 +4855,8 @@ free_ofld_txq(struct vi_info *vi, struct sge_ofld_txq *ofld_txq) counter_u64_free(ofld_txq->tx_iscsi_pdus); counter_u64_free(ofld_txq->tx_iscsi_octets); counter_u64_free(ofld_txq->tx_iscsi_iso_wrs); + counter_u64_free(ofld_txq->tx_aio_jobs); + counter_u64_free(ofld_txq->tx_aio_octets); counter_u64_free(ofld_txq->tx_toe_tls_records); counter_u64_free(ofld_txq->tx_toe_tls_octets); free_wrq(sc, &ofld_txq->wrq); @@ -4874,6 +4884,12 @@ add_ofld_txq_sysctls(struct sysctl_ctx_list *ctx, struct sysctl_oid *oid, SYSCTL_ADD_COUNTER_U64(ctx, children, OID_AUTO, "tx_iscsi_iso_wrs", CTLFLAG_RD, &ofld_txq->tx_iscsi_iso_wrs, "# of iSCSI segmentation offload work requests"); + SYSCTL_ADD_COUNTER_U64(ctx, children, OID_AUTO, "tx_aio_jobs", + CTLFLAG_RD, &ofld_txq->tx_aio_jobs, + "# of zero-copy aio_write(2) jobs transmitted"); + SYSCTL_ADD_COUNTER_U64(ctx, children, OID_AUTO, "tx_aio_octets", + CTLFLAG_RD, &ofld_txq->tx_aio_octets, + "# of payload octets in transmitted zero-copy aio_write(2) jobs"); SYSCTL_ADD_COUNTER_U64(ctx, children, OID_AUTO, "tx_toe_tls_records", CTLFLAG_RD, &ofld_txq->tx_toe_tls_records, "# of TOE TLS records transmitted"); diff --git a/sys/dev/cxgbe/tom/t4_cpl_io.c b/sys/dev/cxgbe/tom/t4_cpl_io.c index 235d4196226d..2f425c7b5c6d 100644 --- a/sys/dev/cxgbe/tom/t4_cpl_io.c +++ b/sys/dev/cxgbe/tom/t4_cpl_io.c @@ -2173,6 +2173,7 @@ t4_aiotx_process_job(struct toepcb *toep, struct socket *so, struct kaiocb *job) struct inpcb *inp; struct tcpcb *tp; struct mbuf *m; + u_int sent; int error, len; bool moretocome, sendmore; @@ -2275,7 +2276,9 @@ sendanother: goto out; } - job->aio_sent += m_length(m, NULL); + sent = m_length(m, NULL); + job->aio_sent += sent; + counter_u64_add(toep->ofld_txq->tx_aio_octets, sent); sbappendstream(sb, m, 0); m = NULL; @@ -2328,6 +2331,7 @@ sendanother: * socket. */ aiotx_free_job(job); + counter_u64_add(toep->ofld_txq->tx_aio_jobs, 1); out: if (error) { diff --git a/sys/dev/cxgbe/tom/t4_ddp.c b/sys/dev/cxgbe/tom/t4_ddp.c index c529639d9a1f..c50446d98e2b 100644 --- a/sys/dev/cxgbe/tom/t4_ddp.c +++ b/sys/dev/cxgbe/tom/t4_ddp.c @@ -319,8 +319,11 @@ insert_ddp_data(struct toepcb *toep, uint32_t n) placed = n; if (placed > job->uaiocb.aio_nbytes - copied) placed = job->uaiocb.aio_nbytes - copied; - if (placed > 0) + if (placed > 0) { job->msgrcv = 1; + toep->ofld_rxq->rx_aio_ddp_jobs++; + } + toep->ofld_rxq->rx_aio_ddp_octets += placed; if (!aio_clear_cancel_function(job)) { /* * Update the copied length for when @@ -560,6 +563,8 @@ handle_ddp_data(struct toepcb *toep, __be32 ddp_report, __be32 rcv_nxt, int len) CURVNET_RESTORE(); job->msgrcv = 1; + toep->ofld_rxq->rx_aio_ddp_jobs++; + toep->ofld_rxq->rx_aio_ddp_octets += len; if (db->cancel_pending) { /* * Update the job's length but defer completion to the @@ -724,8 +729,11 @@ handle_ddp_close(struct toepcb *toep, struct tcpcb *tp, __be32 rcv_nxt) placed = len; if (placed > job->uaiocb.aio_nbytes - copied) placed = job->uaiocb.aio_nbytes - copied; - if (placed > 0) + if (placed > 0) { job->msgrcv = 1; + toep->ofld_rxq->rx_aio_ddp_jobs++; + } + toep->ofld_rxq->rx_aio_ddp_octets += placed; if (!aio_clear_cancel_function(job)) { /* * Update the copied length for when From nobody Mon Apr 8 19:04:22 2024 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 4VCz6H0tLdz5HYdL; Mon, 8 Apr 2024 19:04: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 4VCz6G6R3Tz4gJL; Mon, 8 Apr 2024 19:04:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712603062; 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=+TUKT4RDAzNKgBww0UFxdhfsQeYtX7gVbGMWMIv7jIw=; b=Pv0SZjzpN5h/6P3c/4hArGq7RhsLcMWkWtyCDNhQCV/xHNPOBQvfS4jnQ2sPdsUsbrrhlv SfLdkany3KkW3GpI4lvw+hvakTWVb3l4CpT1J9f1RO4i+W8tRtdBJzpayw7FmPMMkFh6w6 3MGB+hGWdlaSWyUUcDNzN4YHhwSI4TGxtcT3UcZgbLNd56fv3FUYHMmgs6PzUL+7iqpkiG ayweOUy7vyD6aWTjavvN2Zpij6z+tALu9UbPIa6TwijbLdNs8O4uzxVgnCATLhC1oCmli8 B2BOsoTKKEi03bHTaNuYbibl4bCNJMycRSEMI9OL5h52GdkqJtCLZZS3LbLCGA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712603062; a=rsa-sha256; cv=none; b=BNL/dqCMrcvWP/jnIMhLhuGiVAzm14Gu9j05s3dDMTuv1Ok50H5qvp0qjIcxFb41oGhDA9 Dmbnt0Xyz/5CYHp3grMnoD5Z4tvytg7DCZnvekWbzqjbSBdrylgW08IsiuFhwhHF8yuxJ9 JnqTc7zzg12i1TXRFLL/tV7akwjOifcfmp8ex8mg3JZfO67tMVtvaXlEWVTtXGNzpdUjq+ dosPneWTAlECya1MipStyH7vNrf5GKOfZyzQqnU1gYRN0irVB2nGEqr2WthpfZcbnQ89Ri y+alrHEQeSow7TfFitLwfN9gLgqe94teMAXs4SRClWQfYVfh1ntVpvjvrFicew== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712603062; 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=+TUKT4RDAzNKgBww0UFxdhfsQeYtX7gVbGMWMIv7jIw=; b=Dqf4FcpVc7voZO7xCTxeaSFn/4AMnPtZOmEX81Tiby2EB+/FBnDexIAL2zWhc0FvtAHa5R IQfTbYAgxVMY8ehFahGQKvF4ja/IG/a8weIxmKvJWN8WLkjoTd9KE6aeUTgfEvr5u00fw0 u+txzFfE6s7aryTGunQgfI5lwqtZSKeXJJo6yxK4NPwohyMG7lebaVGITuuRDtoEd2iskn TYYeeXZlWGyzy5uteNAAnL+weKwISdG3QclJ76rGEXKwFFPUI11Gm3Iuss2P/mQyqBxaiJ F0vHLvO6NvnvAI15x5yNqC5/eobwowFxFETnEoDJ6h2qp52MZtu6pRcb2EED+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 4VCz6G62pDzN1D; Mon, 8 Apr 2024 19:04:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 438J4M7w093957; Mon, 8 Apr 2024 19:04:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 438J4Mcv093954; Mon, 8 Apr 2024 19:04:22 GMT (envelope-from git) Date: Mon, 8 Apr 2024 19:04:22 GMT Message-Id: <202404081904.438J4Mcv093954@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: b680e6da1398 - stable/14 - cxgbe tom: Enable ULP_MODE_TCPDDP on demand 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b680e6da13985f7462ddd8555d9f7fe83ba29a76 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=b680e6da13985f7462ddd8555d9f7fe83ba29a76 commit b680e6da13985f7462ddd8555d9f7fe83ba29a76 Author: John Baldwin AuthorDate: 2024-01-31 00:41:43 +0000 Commit: John Baldwin CommitDate: 2024-04-08 17:49:51 +0000 cxgbe tom: Enable ULP_MODE_TCPDDP on demand Most ULP modes in cxgbe's TOE are enabled on the fly when a protocol is needed (e.g. ULP_MODE_ISCSI is enabled by cxgbei when offloading a connection using iSCSI, and ULP_MODE_TLS is enabled when RX TLS keys are programmed for a TOE connection). The one exception to this is ULP_MODE_TCPDDP. Currently the cxgbe driver enables ULP_MODE_TCPDDP when a TOE connection is first created. However, since DDP connections cannot be converted to other connection types, this requires some special handling in the driver. For example, iSCSI daemons use the SO_NO_DDP socket option to ensure TOE connections use ULP_MODE_NONE so they can be converted to ULP_MODE_ISCSI. Similarly, using TLS receive offload (ULP_MODE_TLS) requires disabling TCP DDP for new connections by default. This commit changes cxgbe to instead switch a connection from ULP_MODE_NONE to ULP_MODE_TCPDDP when a connection first attempts to use TCP DDP via aio_read(2). This permits connections to always start as ULP_MODE_NONE and switch to a protocol-specific mode as needed. Reviewed by: np Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D43670 (cherry picked from commit a5a965d75934ae809884f8613bcad156bb5d7148) --- sys/dev/cxgbe/tom/t4_cpl_io.c | 11 +++--- sys/dev/cxgbe/tom/t4_ddp.c | 86 ++++++++++++++++++++++++++++++++++++++++++- sys/dev/cxgbe/tom/t4_tom.c | 17 +++------ sys/dev/cxgbe/tom/t4_tom.h | 1 - 4 files changed, 95 insertions(+), 20 deletions(-) diff --git a/sys/dev/cxgbe/tom/t4_cpl_io.c b/sys/dev/cxgbe/tom/t4_cpl_io.c index 2f425c7b5c6d..4d61189f5fe3 100644 --- a/sys/dev/cxgbe/tom/t4_cpl_io.c +++ b/sys/dev/cxgbe/tom/t4_cpl_io.c @@ -1753,17 +1753,18 @@ do_rx_data(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) if (changed) { if (toep->ddp.flags & DDP_SC_REQ) toep->ddp.flags ^= DDP_ON | DDP_SC_REQ; - else { - KASSERT(cpl->ddp_off == 1, - ("%s: DDP switched on by itself.", - __func__)); - + else if (cpl->ddp_off == 1) { /* Fell out of DDP mode */ toep->ddp.flags &= ~DDP_ON; CTR1(KTR_CXGBE, "%s: fell out of DDP mode", __func__); insert_ddp_data(toep, ddp_placed); + } else { + /* + * Data was received while still + * ULP_MODE_NONE, just fall through. + */ } } diff --git a/sys/dev/cxgbe/tom/t4_ddp.c b/sys/dev/cxgbe/tom/t4_ddp.c index c50446d98e2b..89cb7269e218 100644 --- a/sys/dev/cxgbe/tom/t4_ddp.c +++ b/sys/dev/cxgbe/tom/t4_ddp.c @@ -192,7 +192,7 @@ free_ddp_buffer(struct tom_data *td, struct ddp_buffer *db) free_pageset(td, db->ps); } -void +static void ddp_init_toep(struct toepcb *toep) { @@ -810,6 +810,78 @@ do_rx_ddp_complete(struct sge_iq *iq, const struct rss_header *rss, return (0); } +static bool +set_ddp_ulp_mode(struct toepcb *toep) +{ + struct adapter *sc = toep->vi->adapter; + struct wrqe *wr; + struct work_request_hdr *wrh; + struct ulp_txpkt *ulpmc; + int fields, len; + + if (!sc->tt.ddp) + return (false); + + fields = 0; + + /* Overlay region including W_TCB_RX_DDP_FLAGS */ + fields += 3; + + /* W_TCB_ULP_TYPE */ + fields++; + +#ifdef USE_DDP_RX_FLOW_CONTROL + /* W_TCB_T_FLAGS */ + fields++; +#endif + + len = sizeof(*wrh) + fields * roundup2(LEN__SET_TCB_FIELD_ULP, 16); + KASSERT(len <= SGE_MAX_WR_LEN, + ("%s: WR with %d TCB field updates too large", __func__, fields)); + + wr = alloc_wrqe(len, toep->ctrlq); + if (wr == NULL) + return (false); + + CTR(KTR_CXGBE, "%s: tid %u", __func__, toep->tid); + + wrh = wrtod(wr); + INIT_ULPTX_WRH(wrh, len, 1, 0); /* atomic */ + ulpmc = (struct ulp_txpkt *)(wrh + 1); + + /* + * Words 26/27 are zero except for the DDP_OFF flag in + * W_TCB_RX_DDP_FLAGS (27). + */ + ulpmc = mk_set_tcb_field_ulp(ulpmc, toep, 26, + 0xffffffffffffffff, (uint64_t)V_TF_DDP_OFF(1) << 32); + + /* Words 28/29 are zero. */ + ulpmc = mk_set_tcb_field_ulp(ulpmc, toep, 28, + 0xffffffffffffffff, 0); + + /* Words 30/31 are zero. */ + ulpmc = mk_set_tcb_field_ulp(ulpmc, toep, 30, + 0xffffffffffffffff, 0); + + /* Set the ULP mode to ULP_MODE_TCPDDP. */ + toep->params.ulp_mode = ULP_MODE_TCPDDP; + ulpmc = mk_set_tcb_field_ulp(ulpmc, toep, W_TCB_ULP_TYPE, + V_TCB_ULP_TYPE(M_TCB_ULP_TYPE), + V_TCB_ULP_TYPE(ULP_MODE_TCPDDP)); + +#ifdef USE_DDP_RX_FLOW_CONTROL + /* Set TF_RX_FLOW_CONTROL_DDP. */ + ulpmc = mk_set_tcb_field_ulp(ulpmc, toep, W_TCB_T_FLAGS, + V_TF_RX_FLOW_CONTROL_DDP(1), V_TF_RX_FLOW_CONTROL_DDP(1)); +#endif + + ddp_init_toep(toep); + + t4_wrq_tx(sc, wr); + return (true); +} + static void enable_ddp(struct adapter *sc, struct toepcb *toep) { @@ -2203,7 +2275,8 @@ t4_aio_cancel_queued(struct kaiocb *job) int t4_aio_queue_ddp(struct socket *so, struct kaiocb *job) { - struct tcpcb *tp = sototcpcb(so); + struct inpcb *inp = sotoinpcb(so); + struct tcpcb *tp = intotcpcb(inp); struct toepcb *toep = tp->t_toe; @@ -2211,6 +2284,15 @@ t4_aio_queue_ddp(struct socket *so, struct kaiocb *job) if (job->uaiocb.aio_lio_opcode != LIO_READ) return (EOPNOTSUPP); + INP_WLOCK(inp); + if (__predict_false(ulp_mode(toep) == ULP_MODE_NONE)) { + if (!set_ddp_ulp_mode(toep)) { + INP_WUNLOCK(inp); + return (EOPNOTSUPP); + } + } + INP_WUNLOCK(inp); + DDP_LOCK(toep); /* diff --git a/sys/dev/cxgbe/tom/t4_tom.c b/sys/dev/cxgbe/tom/t4_tom.c index 77b6ba5d4032..9bfe6ec818e4 100644 --- a/sys/dev/cxgbe/tom/t4_tom.c +++ b/sys/dev/cxgbe/tom/t4_tom.c @@ -179,8 +179,7 @@ init_toepcb(struct vi_info *vi, struct toepcb *toep) toep->ctrlq = &sc->sge.ctrlq[pi->port_id]; tls_init_toep(toep); - if (ulp_mode(toep) == ULP_MODE_TCPDDP) - ddp_init_toep(toep); + MPASS(ulp_mode(toep) != ULP_MODE_TCPDDP); toep->flags |= TPF_INITIALIZED; @@ -1216,10 +1215,7 @@ calc_options2(struct vi_info *vi, struct conn_params *cp) opt2 |= V_RX_COALESCE(M_RX_COALESCE); opt2 |= V_RX_FC_DDP(0) | V_RX_FC_DISABLE(0); -#ifdef USE_DDP_RX_FLOW_CONTROL - if (cp->ulp_mode == ULP_MODE_TCPDDP) - opt2 |= F_RX_FC_DDP; -#endif + MPASS(cp->ulp_mode != ULP_MODE_TCPDDP); return (htobe32(opt2)); } @@ -1327,11 +1323,7 @@ init_conn_params(struct vi_info *vi , struct offload_settings *s, cp->tx_align = 0; /* ULP mode. */ - if (s->ddp > 0 || - (s->ddp < 0 && sc->tt.ddp && (so_options_get(so) & SO_NO_DDP) == 0)) - cp->ulp_mode = ULP_MODE_TCPDDP; - else - cp->ulp_mode = ULP_MODE_NONE; + cp->ulp_mode = ULP_MODE_NONE; /* Rx coalescing. */ if (s->rx_coalesce >= 0) @@ -1972,7 +1964,8 @@ t4_aio_queue_tom(struct socket *so, struct kaiocb *job) if (SOLISTENING(so)) return (EINVAL); - if (ulp_mode(toep) == ULP_MODE_TCPDDP) { + if (ulp_mode(toep) == ULP_MODE_TCPDDP || + ulp_mode(toep) == ULP_MODE_NONE) { error = t4_aio_queue_ddp(so, job); if (error != EOPNOTSUPP) return (error); diff --git a/sys/dev/cxgbe/tom/t4_tom.h b/sys/dev/cxgbe/tom/t4_tom.h index b492fe86ae3a..d74f3f908286 100644 --- a/sys/dev/cxgbe/tom/t4_tom.h +++ b/sys/dev/cxgbe/tom/t4_tom.h @@ -505,7 +505,6 @@ int t4_aio_queue_ddp(struct socket *, struct kaiocb *); void t4_ddp_mod_load(void); void t4_ddp_mod_unload(void); void ddp_assert_empty(struct toepcb *); -void ddp_init_toep(struct toepcb *); void ddp_uninit_toep(struct toepcb *); void ddp_queue_toep(struct toepcb *); void release_ddp_resources(struct toepcb *toep); From nobody Mon Apr 8 19:04:21 2024 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 4VCz6F6FTWz5HYSP; Mon, 8 Apr 2024 19:04: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 4VCz6F5dG1z4g3H; Mon, 8 Apr 2024 19:04:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712603061; 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=S4N+6e66IAPneWc4469NaPdoiaakTpV+fgdDEeyP6SU=; b=EqXG9D9uEqZT266TPUFGa2WwydGMGKdzAUqUyXBVqdcfVULFeyLQBRaM7Hk3xQuflY0gvV gRajLotOM04CxVSLVE10Iq/pPM9S4zMI7E3NXVHKZmPPr7dyniHP1JpZDKgxscQRwZnPyw crtwBnyvDX4UN6HYdCH6UbAdNLeYL9ip+I3GRnV4ZVOc6rg9vy8JpEE/4Pj1+Flyj4fRl2 KXODpyzmsbLw4fZP2qrZfR3/YEdR5IwcsW2ygiOcf6L4wewQe/BDQstZetzNuMW/F1cXVT tKY3kTLOOWvBG5fs9y3zmBNJX4isvq4jC7LS+M4CFS5QtxPz9JSmn4JQ41UJWg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712603061; a=rsa-sha256; cv=none; b=RXO3Lw9EvQJy/fGn9J0KE04e+JBfxGBT3hRjPjMgCGEonVOsY5m8S0M68OwuvVrZbh0euV Z70qxmoE9tyhMfc2L1idne1FnicLDED3D+rrZn0uYGLENDQTBdztFe5EZV39JQa0EwmNTw kVRhNPpZga7Ti3sXY+kFLXFCCyPJ/en1ahoYObiD3KZkRnEy0Ey63b3RjmwVGCWOGNjY6/ 6bGPe+QQ+OMBe/1aKIVpnG24N3y9LoNEN1a75ThPvWRuryZvuiYfzgD/3C8ZgweqUQ6XLR KnYNkAte3U3+6veos1IRfe6S2QXr6Ib7Zi1MJC5X0BFqbG+vUHXunNVox570tA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712603061; 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=S4N+6e66IAPneWc4469NaPdoiaakTpV+fgdDEeyP6SU=; b=bh2eHgB5i/gZojusxI/Sr5P4fjL44VHCKgtkOHnjOcJjYBF1gZlJTssK8qZN9k1Lu3dqZN vPAuFTK4u9SThBE6nIsC2r9J2d6KVa5DSRwtjfz4lJruLuGZmpKFow+Sn0g7U8T5FUs878 1P0gmf6iRMavBTgTP2CAmSM0deLmItcmDnzsgmnRdFrqaUzyJlwvgiA2QdDs3THFH1SWsn pPyGsYCH55Aung/uBX0RwyiKJY2zODyz9NaSCMy8ED6wHtAvQefB6UQ3W55lble30piwZO +cDxOjEhjn33ZW1xxJy+cSnFOrzBnd4N9U4xhkWaZrTbdWyORD/LMYm6hRdTgw== 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 4VCz6F5CSNzMx6; Mon, 8 Apr 2024 19:04:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 438J4LdJ093912; Mon, 8 Apr 2024 19:04:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 438J4LO2093909; Mon, 8 Apr 2024 19:04:21 GMT (envelope-from git) Date: Mon, 8 Apr 2024 19:04:21 GMT Message-Id: <202404081904.438J4LO2093909@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 2b410bace4a0 - stable/14 - cxgbe tom: Limit TOE connections to 2 reassembly islands always 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 2b410bace4a04941b52887539ac0eed8c97b0a7e Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=2b410bace4a04941b52887539ac0eed8c97b0a7e commit 2b410bace4a04941b52887539ac0eed8c97b0a7e Author: John Baldwin AuthorDate: 2024-01-31 00:41:23 +0000 Commit: John Baldwin CommitDate: 2024-04-08 17:39:31 +0000 cxgbe tom: Limit TOE connections to 2 reassembly islands always Previously this was only limited on T6 cards to support switching from ULP_MODE_NONE to ULP_MODE_TLS. To support switching to ULP_MODE_TCPDDP, enable this for all adapters. Reviewed by: np Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D43669 (cherry picked from commit afaefb7737994293f9264953e361de095c666c18) --- sys/dev/cxgbe/t4_main.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 4fbc45e16464..e20c697d2865 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -5726,18 +5726,15 @@ set_params__post_init(struct adapter *sc) } #endif -#ifdef KERN_TLS - if (sc->cryptocaps & FW_CAPS_CONFIG_TLSKEYS && - sc->toecaps & FW_CAPS_CONFIG_TOE) { - /* - * Limit TOE connections to 2 reassembly "islands". - * This is required to permit migrating TOE - * connections to UPL_MODE_TLS. - */ - t4_tp_wr_bits_indirect(sc, A_TP_FRAG_CONFIG, - V_PASSMODE(M_PASSMODE), V_PASSMODE(2)); - } + /* + * Limit TOE connections to 2 reassembly "islands". This is + * required to permit migrating TOE connections to either + * ULP_MODE_TCPDDP or UPL_MODE_TLS. + */ + t4_tp_wr_bits_indirect(sc, A_TP_FRAG_CONFIG, V_PASSMODE(M_PASSMODE), + V_PASSMODE(2)); +#ifdef KERN_TLS if (is_ktls(sc)) { sc->tlst.inline_keys = t4_tls_inline_keys; sc->tlst.combo_wrs = t4_tls_combo_wrs; From nobody Mon Apr 8 19:04:23 2024 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 4VCz6J37djz5HYgq; Mon, 8 Apr 2024 19:04: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 4VCz6J0rLvz4gJf; Mon, 8 Apr 2024 19:04:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712603064; 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=Xa6Zz3qOukf+CAbIbKE7q4oSSHi5iwQtocD8+qZC9n4=; b=Ltqj05ulIA688edTp5kF9e/C0HMvbtxEhtwZ72HgiLwNB2SsYwJgcjSQYCdxaGAyO1Wuu8 Oma5G9fs8wLOSEpvUjh1cV2CwPazbuTI0Ql26jVrjguUpIkpjlk5F3wlbyvBooFYqwkZ3X qFMz0TgMgv80N8Yf0OCOsRNH5ejAjI/s3n6us53OopWt1XmgguknHe/WKKbgiMJycVdquN cP2kDdCW2YLqj28ny9L/FgcO83NWCxX5C+wwtr3jlctAyHXqwD/O7iRpUDgaEevemb5Ab2 FBmDAJAK/4Ezl2QZ1JqkSBWPvww3CdRfUGxytFAoy27gqxpb+RJ0bie27IL9ng== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712603064; a=rsa-sha256; cv=none; b=Zmm/fmUpZkJMkwfly9PpwvvJodcwLvWdeIlOnJhztgK4/bhJhlxSklFn+QPdfSKNLXz0zt iSwuboR6UoZ9zJfzf9526U9So0g/rsRVQsugPxAe4uFupzXdEoND74dw2RRMCItWy2F3W8 Pydw76VRtWPfLjt9ttDsEmJ3ctw3xOkLrG/foS9nq/GXWIl5wkXWz9jhiB+paBNG8qscES xdpnzsRkSv+8ntKwicnQ9oZicw7XASKZqeYEcjPz2JSjqGxlWSdSrpt5ps5EVaHbIBVURk 9TeDbhXyqCE39ElPWsUMwmO0MNDna8VNhuQ90roBEzBUqOdBPHXqVA5IEBZY7g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712603064; 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=Xa6Zz3qOukf+CAbIbKE7q4oSSHi5iwQtocD8+qZC9n4=; b=tGVlFDpIGEmuSCuvkf76dtlcKgPax8ZM4eSNtYW9JfhGzWPYUpVD2RCkZchBfflmEyhmki 9B04sN0/dOIGA/c/kL2TXOeUjzU7KhqJPwIXDCJDes3ckXgthP3ZOI1kF8g80Wn9plOsgw Zb2THb+8tZjX5BXQJMn3JxWUO5YGoIK6KudfhsaeeIgOfHCza8p4hN22f9LrQVtQiUGpqO fRyzB1ow3M/1SGVTHUhJpvJPXNK5DzinPhKyad/uZtNh7DE7Y+PfZtYCxXAAuSMU+dZbs6 rwc2SG9q7NGdNN+TxALTZTuAiIS1dWl+PXVQj4TiOPC1I8yntuSWxmahF74ASA== 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 4VCz6J0DvczNdh; Mon, 8 Apr 2024 19:04:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 438J4NgZ094004; Mon, 8 Apr 2024 19:04:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 438J4Nfl094001; Mon, 8 Apr 2024 19:04:23 GMT (envelope-from git) Date: Mon, 8 Apr 2024 19:04:23 GMT Message-Id: <202404081904.438J4Nfl094001@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: bf5387a9367e - stable/14 - timerfd: Move kern_timerfd_* prototypes to 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: bf5387a9367e2654d3d014277e4ca3135a9cc6df Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=bf5387a9367e2654d3d014277e4ca3135a9cc6df commit bf5387a9367e2654d3d014277e4ca3135a9cc6df Author: John Baldwin AuthorDate: 2024-01-31 17:15:58 +0000 Commit: John Baldwin CommitDate: 2024-04-08 17:49:59 +0000 timerfd: Move kern_timerfd_* prototypes to (cherry picked from commit 18cb422356f259f83ad3189cc4494e56265aef94) --- sys/kern/sys_timerfd.c | 1 + sys/sys/syscallsubr.h | 5 +++++ sys/sys/timerfd.h | 7 ------- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/sys/kern/sys_timerfd.c b/sys/kern/sys_timerfd.c index 80d1e9f4bfb2..8ac5b845f7ac 100644 --- a/sys/kern/sys_timerfd.c +++ b/sys/kern/sys_timerfd.c @@ -44,6 +44,7 @@ #include #include #include +#include #include #include #include diff --git a/sys/sys/syscallsubr.h b/sys/sys/syscallsubr.h index 50a936591dc7..87e29f5ca5fc 100644 --- a/sys/sys/syscallsubr.h +++ b/sys/sys/syscallsubr.h @@ -364,6 +364,11 @@ int kern_thr_alloc(struct proc *, int pages, struct thread **); int kern_thr_exit(struct thread *td); int kern_thr_new(struct thread *td, struct thr_param *param); int kern_thr_suspend(struct thread *td, struct timespec *tsp); +int kern_timerfd_create(struct thread *td, int clockid, int flags); +int kern_timerfd_gettime(struct thread *td, int fd, + struct itimerspec *curr_value); +int kern_timerfd_settime(struct thread *td, int fd, int flags, + const struct itimerspec *new_value, struct itimerspec *old_value); int kern_truncate(struct thread *td, const char *path, enum uio_seg pathseg, off_t length); int kern_funlinkat(struct thread *td, int dfd, const char *path, int fd, diff --git a/sys/sys/timerfd.h b/sys/sys/timerfd.h index cace3b71498c..06409a77f7d2 100644 --- a/sys/sys/timerfd.h +++ b/sys/sys/timerfd.h @@ -58,13 +58,6 @@ __END_DECLS #else /* _KERNEL */ -struct thread; - -int kern_timerfd_create(struct thread *td, int clockid, int flags); -int kern_timerfd_gettime(struct thread *td, int fd, - struct itimerspec *curr_value); -int kern_timerfd_settime(struct thread *td, int fd, int flags, - const struct itimerspec *new_value, struct itimerspec *old_value); void timerfd_jumped(void); #endif /* !_KERNEL */ From nobody Mon Apr 8 19:04:25 2024 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 4VCz6K3s0Qz5HYgr; Mon, 8 Apr 2024 19:04: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 4VCz6K1l9Bz4gVC; Mon, 8 Apr 2024 19:04:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712603065; 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=BZUHK7H3yhPPIz0U5eNH/fVV/dFxjQDgF3lb4nJhRAY=; b=EwwhEacIKrQS8VeEobMxFSTbppwYQC6lxxDqARyeWpUxuvGYLBiAYW2UVmQg8lrWNCp5sM 6HyEJCb2juDuRGfpJ1A6TvqMGRF0oYTxhHAIC8p9ucvv+2vXRDwf4akJnD3g0EdQOFZuVm LHpbkuq3d2qyijLkpXajOZRTeyMdbukyGk+7r9hU56xy5piuv/Tw3F2JJnS+Z1Fn7oLPnf yuAZFHLIYL0unkcsxDz9j+P/hhiptwHxsoUX4k/IqWm/nKU7SHk4qPouOaCOocveywPqTh eOuFjiGT0tQRTkCTGCFV1udMLSi5P1jfcvKPuiq9Nq7dMCjDCi7oyFZCWYPDXg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712603065; a=rsa-sha256; cv=none; b=tbrRlCi5QjYeelKULeojaWZCjqNcXhnkFcHzK37fHZ6Kifioo521oBaI8RwS2EWh0TcsVK 6pivGvT31DSpA68O37Q1VsjH34JXiwrD1C92Jq+bvz8dX/0peLEq+VNsKJXZ/o3S8bUayq /LNDps4cg1vvfZcS4uDeFEZ81ilLq7ulbpECmhKL5beE0DcMjKJer5cNw/7UbPoN0ji7LS RCSgjvO6m/arSStQT0fXWUL0gyHM3WOY7d8LAgwFaii6JRsoF913iYsLal38mRZ92VsyrG 43gKcjkmwl2uFzyef9x6t6UpxVwa+54yr2H+RAP6i+Tq8ekL7Lvb9egKLeloNg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712603065; 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=BZUHK7H3yhPPIz0U5eNH/fVV/dFxjQDgF3lb4nJhRAY=; b=elaJVFMrizkTTJXPf2SA6dJawb44Rb90DK5eVJMAhX7wuOz3tsirxLPFX23NYbUmUMt8PP I8hF5lyiZyCoW09tBxaaOZr1+gnp1vH/Y2mr1MckdBLYevRsDXCXN5ay6VfMNHpENTZ9xV lD6Rc4lj2ETLMbD5cCmOHGFbXgjvq8LlJuogRjd0hFBfGEsdcaBfdxZqkAkUtiNDP/y952 j53CfBa8iBqULMQDLrpCNFbtXnh1qW6rPaOV9U1dmqvVq01R4MKUD4nsPZaqbppVbdp/1J suLz9Zd3VMzKVvtxQLlm0zZDOw9D9vp68Js/N3kpDHe2Np4vptQ1I499xV4lmA== 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 4VCz6K1HgFzNSl; Mon, 8 Apr 2024 19:04:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 438J4PwS094066; Mon, 8 Apr 2024 19:04:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 438J4PcX094063; Mon, 8 Apr 2024 19:04:25 GMT (envelope-from git) Date: Mon, 8 Apr 2024 19:04:25 GMT Message-Id: <202404081904.438J4PcX094063@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: e24c1997bf5c - stable/14 - arm: pmap_extract() returns a PA not a boolean value 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e24c1997bf5cffc176906761fb04d90803ab838c Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=e24c1997bf5cffc176906761fb04d90803ab838c commit e24c1997bf5cffc176906761fb04d90803ab838c Author: John Baldwin AuthorDate: 2024-02-02 22:59:03 +0000 Commit: John Baldwin CommitDate: 2024-04-08 17:50:26 +0000 arm: pmap_extract() returns a PA not a boolean value Assume a PA of 0 indicates an invalid virtual address. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D43694 (cherry picked from commit afb1a3e30c05a0f69facff7df59547ec82e3531a) --- sys/arm/arm/db_interface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/arm/arm/db_interface.c b/sys/arm/arm/db_interface.c index 5478d9d56f25..8aad6a42316e 100644 --- a/sys/arm/arm/db_interface.c +++ b/sys/arm/arm/db_interface.c @@ -172,7 +172,7 @@ db_validate_address(vm_offset_t addr) else pmap = p->p_vmspace->vm_map.pmap; - return (pmap_extract(pmap, addr) == FALSE); + return (pmap_extract(pmap, addr) == 0); } /* From nobody Mon Apr 8 19:04:26 2024 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 4VCz6L49lvz5HYDT; Mon, 8 Apr 2024 19:04: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 4VCz6L2mhsz4gHC; Mon, 8 Apr 2024 19:04:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712603066; 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=6N5FhMmeKp6SZ/oVeXButwxcwAtCzuOKJlxmOkrff44=; b=pvhSTJLU0Wqn2lq3B0Io5MzQhKCzDQwQkDk+tqtf+p55FHRXQ60VHLou4ATw7oyipLaeUB 5D6rdd8hWhHYB5ccyAXEzBL3dT9YDLsu0jw5X3DOoT88P7aRcvErNlkVS0ZvHcC47fONOA A4165a6+lvT/fKn0oPTtBP1K5rerXBwGDswwCt1AckWgev16DvwkTAtIT9PmJbw/b5p237 TirhnXjoAhIcR1YEAszOM3/+EM65K7F5sjJRTk+li1JhtJ8oGhV9d1Hf8Lk8dTOYZJA46H owHMQFdv7+WmfCHMyp+GN+NGXWyRWZTIV9AJERZLlNGyW3DzrUiAzgStqc1+aw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712603066; a=rsa-sha256; cv=none; b=Tiu9Cs5TscaU3JUvjeGAG7j1J1eyQzZBPCYdzpxNCWnbGs+/dl0GTDVoQzFO4uibUCydPh BmXFnqZnlUZTx5C0UWpRfCd3HXBe3KxT097CDadtahqVSUPG9JSdGgUDP9iNaitN4tmj9D Mr9waoUod5sad9qkTCxOaZXRjYjaoxI2BHDzJpRarLXmcxy02Eo9dTb6mZWdTas1inOnWu x4+uqarVwNcbYkJZPvzguemLqBuuJ/R5EZ/ODfbSB0NSCTv5rKys/S2HKRaFdJEa0To4md 9ZbHnx0JiRLpgTCwjDrAXIUMZgekvrzN0UJnM+f7Ld2gA/8DUJkKMojmeSD71A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712603066; 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=6N5FhMmeKp6SZ/oVeXButwxcwAtCzuOKJlxmOkrff44=; b=rNe8rKW3tIduobRFTrLdpeJgI4cQtxFNVFf3UQhxrlkLsc0BT2XKMd6yrQM7V5yjAjRB6R O3NWdJp19dQmCGmqHnbM64lXELmAjvBv/slETABfClWXetYUbPnBjN4XiHX26D+IXCDQwC j0NhUSVOUzet5TYam/po3XVPW3Ps0MdcTCZySVDF3f7EVlXxxvwZ/89cIPAFBWWZr6UIan jccrYGmR5C7GtpUshL0vpduVtqCkPf8z4/JoQ9Hv7D2OA03DglJELmvAWlsXA2kFwkAZ8Y 24e8rAjBjdskt0soCxOyDv4k/qEtR3vq5IuJf5SQJNBXOR2VPSoxeT2grg4TDQ== 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 4VCz6L2KCkzNQC; Mon, 8 Apr 2024 19:04:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 438J4QEP094118; Mon, 8 Apr 2024 19:04:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 438J4Q4a094115; Mon, 8 Apr 2024 19:04:26 GMT (envelope-from git) Date: Mon, 8 Apr 2024 19:04:26 GMT Message-Id: <202404081904.438J4Q4a094115@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: cbc47b31cc66 - stable/14 - acpi: Use kobj typedefs for new-bus method prototypes 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: cbc47b31cc66c73104ac8420c8428f2fd8be8d59 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=cbc47b31cc66c73104ac8420c8428f2fd8be8d59 commit cbc47b31cc66c73104ac8420c8428f2fd8be8d59 Author: John Baldwin AuthorDate: 2024-02-09 18:27:44 +0000 Commit: John Baldwin CommitDate: 2024-04-08 17:51:56 +0000 acpi: Use kobj typedefs for new-bus method prototypes Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D43685 (cherry picked from commit 0e72b8d36562cb7ecf610dbd7357af830820e4b4) --- sys/dev/acpica/acpi.c | 80 ++++++++++++++++++++---------------------------- sys/dev/acpica/acpivar.h | 8 ++--- 2 files changed, 36 insertions(+), 52 deletions(-) diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index 61df797c7393..d6d1f825f63a 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -111,52 +111,46 @@ static BOOLEAN acpi_sleep_states[ACPI_S_STATE_COUNT]; static void acpi_lookup(void *arg, const char *name, device_t *dev); static int acpi_modevent(struct module *mod, int event, void *junk); -static int acpi_probe(device_t dev); -static int acpi_attach(device_t dev); -static int acpi_suspend(device_t dev); -static int acpi_resume(device_t dev); -static int acpi_shutdown(device_t dev); -static device_t acpi_add_child(device_t bus, u_int order, const char *name, - int unit); -static int acpi_print_child(device_t bus, device_t child); -static void acpi_probe_nomatch(device_t bus, device_t child); -static void acpi_driver_added(device_t dev, driver_t *driver); -static void acpi_child_deleted(device_t dev, device_t child); -static int acpi_read_ivar(device_t dev, device_t child, int index, - uintptr_t *result); -static int acpi_write_ivar(device_t dev, device_t child, int index, - uintptr_t value); -static struct resource_list *acpi_get_rlist(device_t dev, device_t child); + +static device_probe_t acpi_probe; +static device_attach_t acpi_attach; +static device_suspend_t acpi_suspend; +static device_resume_t acpi_resume; +static device_shutdown_t acpi_shutdown; + +static bus_add_child_t acpi_add_child; +static bus_print_child_t acpi_print_child; +static bus_probe_nomatch_t acpi_probe_nomatch; +static bus_driver_added_t acpi_driver_added; +static bus_child_deleted_t acpi_child_deleted; +static bus_read_ivar_t acpi_read_ivar; +static bus_write_ivar_t acpi_write_ivar; +static bus_get_resource_list_t acpi_get_rlist; +static bus_set_resource_t acpi_set_resource; +static bus_alloc_resource_t acpi_alloc_resource; +static bus_adjust_resource_t acpi_adjust_resource; +static bus_release_resource_t acpi_release_resource; +static bus_delete_resource_t acpi_delete_resource; +static bus_child_pnpinfo_t acpi_child_pnpinfo_method; +static bus_child_location_t acpi_child_location_method; +static bus_hint_device_unit_t acpi_hint_device_unit; +static bus_get_property_t acpi_bus_get_prop; +static bus_get_device_path_t acpi_get_device_path; + +static acpi_id_probe_t acpi_device_id_probe; +static acpi_evaluate_object_t acpi_device_eval_obj; +static acpi_get_property_t acpi_device_get_prop; +static acpi_scan_children_t acpi_device_scan_children; + +static isa_pnp_probe_t acpi_isa_pnp_probe; + static void acpi_reserve_resources(device_t dev); static int acpi_sysres_alloc(device_t dev); -static int acpi_set_resource(device_t dev, device_t child, int type, - int rid, rman_res_t start, rman_res_t count); -static struct resource *acpi_alloc_resource(device_t bus, device_t child, - int type, int *rid, rman_res_t start, rman_res_t end, - rman_res_t count, u_int flags); -static int acpi_adjust_resource(device_t bus, device_t child, int type, - struct resource *r, rman_res_t start, rman_res_t end); -static int acpi_release_resource(device_t bus, device_t child, int type, - int rid, struct resource *r); -static void acpi_delete_resource(device_t bus, device_t child, int type, - int rid); static uint32_t acpi_isa_get_logicalid(device_t dev); static int acpi_isa_get_compatid(device_t dev, uint32_t *cids, int count); -static ssize_t acpi_bus_get_prop(device_t bus, device_t child, const char *propname, - void *propvalue, size_t size, device_property_type_t type); -static int acpi_device_id_probe(device_t bus, device_t dev, char **ids, char **match); -static ACPI_STATUS acpi_device_eval_obj(device_t bus, device_t dev, - ACPI_STRING pathname, ACPI_OBJECT_LIST *parameters, - ACPI_BUFFER *ret); -static ACPI_STATUS acpi_device_get_prop(device_t bus, device_t dev, - ACPI_STRING propname, const ACPI_OBJECT **value); static ACPI_STATUS acpi_device_scan_cb(ACPI_HANDLE h, UINT32 level, void *context, void **retval); -static ACPI_STATUS acpi_device_scan_children(device_t bus, device_t dev, - int max_depth, acpi_scan_cb_t user_fn, void *arg); static ACPI_STATUS acpi_find_dsd(struct acpi_device *ad); -static int acpi_isa_pnp_probe(device_t bus, device_t child, - struct isa_pnp_id *ids); static void acpi_platform_osc(device_t dev); static void acpi_probe_children(device_t bus); static void acpi_probe_order(ACPI_HANDLE handle, int *order); @@ -181,15 +175,7 @@ static int acpi_supported_sleep_state_sysctl(SYSCTL_HANDLER_ARGS); static int acpi_sleep_state_sysctl(SYSCTL_HANDLER_ARGS); static int acpi_debug_objects_sysctl(SYSCTL_HANDLER_ARGS); static int acpi_pm_func(u_long cmd, void *arg, ...); -static int acpi_child_location_method(device_t acdev, device_t child, - struct sbuf *sb); -static int acpi_child_pnpinfo_method(device_t acdev, device_t child, - struct sbuf *sb); -static int acpi_get_device_path(device_t bus, device_t child, - const char *locator, struct sbuf *sb); static void acpi_enable_pcie(void); -static void acpi_hint_device_unit(device_t acdev, device_t child, - const char *name, int *unitp); static void acpi_reset_interfaces(device_t dev); static device_method_t acpi_methods[] = { diff --git a/sys/dev/acpica/acpivar.h b/sys/dev/acpica/acpivar.h index 4d76a77cdbf8..bb969821b945 100644 --- a/sys/dev/acpica/acpivar.h +++ b/sys/dev/acpica/acpivar.h @@ -462,8 +462,7 @@ EVENTHANDLER_DECLARE(acpi_video_event, acpi_event_handler_t); /* Device power control. */ ACPI_STATUS acpi_pwr_wake_enable(ACPI_HANDLE consumer, int enable); ACPI_STATUS acpi_pwr_switch_consumer(ACPI_HANDLE consumer, int state); -int acpi_device_pwr_for_sleep(device_t bus, device_t dev, - int *dstate); +acpi_pwr_for_sleep_t acpi_device_pwr_for_sleep; int acpi_set_powerstate(device_t child, int state); /* APM emulation */ @@ -578,9 +577,8 @@ int acpi_pxm_get_cpu_locality(int apic_id); * Returns the VM domain ID if found, or -1 if not found / invalid. */ int acpi_map_pxm_to_vm_domainid(int pxm); -int acpi_get_cpus(device_t dev, device_t child, enum cpu_sets op, - size_t setsize, cpuset_t *cpuset); -int acpi_get_domain(device_t dev, device_t child, int *domain); +bus_get_cpus_t acpi_get_cpus; +bus_get_domain_t acpi_get_domain; #ifdef __aarch64__ /* From nobody Mon Apr 8 19:04:27 2024 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 4VCz6M5MRtz5HYgx; Mon, 8 Apr 2024 19:04: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 4VCz6M3qPjz4gMW; Mon, 8 Apr 2024 19:04:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712603067; 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=XcJjhFIhXDLAPmxb95hsQBOwjAi8BS8xZGEMo+knWXA=; b=mIta+BLgA+VCzy85LaQ9IyjpNv8OVmNSsyNv5EZx1HgtY2u6Hs1ZLa9xS9Bo0dqcSfCmDF MZUjIQX3mWtO5qfMrDJ00u+U+qLb9gM/O3CPXV+U/klPlTSeSrA+SKgUrZYD4EwGGA+Z/f ri1akiG7eccagVCdZtzuI4Sr1zcWOzrgieLiqZZEIXcfmZfxeMk76dV1wbF9Hjb6DDZ8mA lE4gj73dCloG7ECVkuV2O7EzJwi5SX3qcjwGLjFnH24am7/JprxIxdOzTh7LYf981yB8jW pyk+sYnpowOywV76CU6hIs5CtwFfhNl1XVfBZpSEZAuJDL8NB031ixFD4V0p4g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712603067; a=rsa-sha256; cv=none; b=NRRA/4kvBBwfMBfExjKe63jvqLbOdHmbkWSkrMj8+UN92Df/ytz6NFEMXvNmJTUknWZ9xw 7Nss8xH2weGMV80VXmLV+cpMQdFwhXiVoL82qeUZtO0rEvtl7RIKe8dyLcikN/j6w8sNgY UbYUgj8RhlIgaQSBsF+taPIMV9ZDAI4/26oS1l8XCO/jng7vIuyOkan9nyPQrBNkNVAiMj vsae3+3Zmx16NLq0spn8iWG9hc38vkSwoBAKMAVTe87FpimzIXF5KcsnpHIdeG+ChZSZue b8e9LgBU1skQpD5tWBjnOlJ5U//OsCsEl0d7p6lLsrwkVQAVAXrdT1kfUh3mFA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712603067; 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=XcJjhFIhXDLAPmxb95hsQBOwjAi8BS8xZGEMo+knWXA=; b=E2ncuGv8Ipz2GPFaqjE/M5CH0BqxnZBhX4PcACQ6WoLAHGDepQ9fbPowVYCrbAmWK3OcSD l+KX3qUtudQvY7XG3Bn8gkBfOLKyhXvD8IPeFxtpQuYNbBtWqYb/LhNmtwgEYmnF9n2Zwz HWSFHXmIbOgrsn1NTrgK2AezbuoE1lNX/MTLeniOfA5Zdz7VlMGj9P/lG3SqzJ2A7qq+Lf 5SeDdyUjxKQKAhDtKlysd1QbgyC5zQreLsHYTj8UWcLGifgogNQFhtRhn+wYN3opyoGu+C fIombB8Ot2EXNFWUrSnk9/dSUrQ8MzMBpqeSVIqzhZudhFNUGssmdTP+7Hd0Iw== 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 4VCz6M3LVXzMx7; Mon, 8 Apr 2024 19:04:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 438J4RTb094178; Mon, 8 Apr 2024 19:04:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 438J4RjL094175; Mon, 8 Apr 2024 19:04:27 GMT (envelope-from git) Date: Mon, 8 Apr 2024 19:04:27 GMT Message-Id: <202404081904.438J4RjL094175@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 93d2cc308890 - stable/14 - pcib: Make various bus methods private to pci_pci.c 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 93d2cc30889026547c7942858cbbf1282848db60 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=93d2cc30889026547c7942858cbbf1282848db60 commit 93d2cc30889026547c7942858cbbf1282848db60 Author: John Baldwin AuthorDate: 2024-02-09 18:27:45 +0000 Commit: John Baldwin CommitDate: 2024-04-08 17:52:43 +0000 pcib: Make various bus methods private to pci_pci.c These functions are not used by pcib subclasses so do not need to be exposed in pcib_private.h. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D43688 (cherry picked from commit 03719c651430d46cd8aa95aead02a7f0c43dcb04) --- sys/dev/pci/pci_pci.c | 18 +++++++++++++----- sys/dev/pci/pcib_private.h | 10 ---------- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/sys/dev/pci/pci_pci.c b/sys/dev/pci/pci_pci.c index 6ef04251cd74..2659e64f364d 100644 --- a/sys/dev/pci/pci_pci.c +++ b/sys/dev/pci/pci_pci.c @@ -60,6 +60,15 @@ static int pcib_probe(device_t dev); static int pcib_suspend(device_t dev); static int pcib_resume(device_t dev); + +static bus_child_present_t pcib_child_present; +static bus_alloc_resource_t pcib_alloc_resource; +#ifdef NEW_PCIB +static bus_adjust_resource_t pcib_adjust_resource; +static bus_release_resource_t pcib_release_resource; +#endif +static int pcib_reset_child(device_t dev, device_t child, int flags); + static int pcib_power_for_sleep(device_t pcib, device_t dev, int *pstate); static int pcib_ari_get_id(device_t pcib, device_t dev, @@ -81,7 +90,6 @@ static void pcib_pcie_dll_timeout(void *arg, int pending); #endif static int pcib_request_feature_default(device_t pcib, device_t dev, enum pci_feature feature); -static int pcib_reset_child(device_t dev, device_t child, int flags); static device_method_t pcib_methods[] = { /* Device interface */ @@ -2269,7 +2277,7 @@ updatewin: * We have to trap resource allocation requests and ensure that the bridge * is set up to, or capable of handling them. */ -struct resource * +static struct resource * pcib_alloc_resource(device_t dev, device_t child, int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) { @@ -2358,7 +2366,7 @@ pcib_alloc_resource(device_t dev, device_t child, int type, int *rid, return (r); } -int +static int pcib_adjust_resource(device_t bus, device_t child, int type, struct resource *r, rman_res_t start, rman_res_t end) { @@ -2426,7 +2434,7 @@ pcib_adjust_resource(device_t bus, device_t child, int type, struct resource *r, return (rman_adjust_resource(r, start, end)); } -int +static int pcib_release_resource(device_t dev, device_t child, int type, int rid, struct resource *r) { @@ -2449,7 +2457,7 @@ pcib_release_resource(device_t dev, device_t child, int type, int rid, * We have to trap resource allocation requests and ensure that the bridge * is set up to, or capable of handling them. */ -struct resource * +static struct resource * pcib_alloc_resource(device_t dev, device_t child, int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) { diff --git a/sys/dev/pci/pcib_private.h b/sys/dev/pci/pcib_private.h index cf689026a033..d4c66407d739 100644 --- a/sys/dev/pci/pcib_private.h +++ b/sys/dev/pci/pcib_private.h @@ -174,19 +174,9 @@ void pcib_bridge_init(device_t dev); #ifdef NEW_PCIB const char *pcib_child_name(device_t child); #endif -int pcib_child_present(device_t dev, device_t child); int pcib_detach(device_t dev); int pcib_read_ivar(device_t dev, device_t child, int which, uintptr_t *result); int pcib_write_ivar(device_t dev, device_t child, int which, uintptr_t value); -struct resource *pcib_alloc_resource(device_t dev, device_t child, int type, int *rid, - rman_res_t start, rman_res_t end, - rman_res_t count, u_int flags); -#ifdef NEW_PCIB -int pcib_adjust_resource(device_t bus, device_t child, int type, - struct resource *r, rman_res_t start, rman_res_t end); -int pcib_release_resource(device_t dev, device_t child, int type, int rid, - struct resource *r); -#endif int pcib_maxslots(device_t dev); int pcib_maxfuncs(device_t dev); int pcib_route_interrupt(device_t pcib, device_t dev, int pin); From nobody Mon Apr 8 19:04:28 2024 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 4VCz6N6JhKz5HYSb; Mon, 8 Apr 2024 19:04: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 4VCz6N4rVKz4gQB; Mon, 8 Apr 2024 19:04:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712603068; 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=q8vLq9mMHmJ9FwK7M8vHcz60ARiVmE7xmZoy/+eqR5I=; b=EpJH8CJD5jKM01HDWtW6bajMLpkH3XJTmfLPT/ftUJOsEQKlLwI8QSqwSxHTfMnsxBnLYQ 7JOa1R7nKPmhVUlu5ynh/K5nIfkpgIHN062A0v/XrNCXBib3iFJWTO0sg98fX0xmStbwHg ig8kJC5ZlNQlZUfodZ4QwM+N6+pLGbC5MARfgpxqW70ZenAAg3vFr9M4gUTCBxZP83jXey 8RaP68YToUhuPwt4QdLXm1TtPJIfLuATDnDZAiP56YsLDBbHmWH8XYntF0FlwIqs70uBlh bd6TW4pCbAVYXbyZEiDWxNkZJ+tQBsbEkMdrat4VONNIQ+GErQ1aBR08S9LviA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712603068; a=rsa-sha256; cv=none; b=IldPc8Smfgji6Ys/y3YAZqyJH8z3tI0JFHnbpgjYVOiWOjPIPNNw2sPlXtQPZLgqC2tLHi w7vctdUW7J0tTH+i51+mJHLqpwhLJRrh8kMvE/EBoH87ImKy5zsgV1V846fSPziWKzMT3a A0y0tRHHU1xyBaoqdjNtB0jNh27B714CVH1x2Gw1i4dkftO/N/O3zLc54ONtVwyj4xOfUp QAqdWgIC1AkGWERn2svUj4BH4Wz6CrGfJI397UEroY7Scl5X6oZTRwVEgMCP+zMmXNYmsp z0xmofO52vukOYjNuhHurbbncrVpT2uKycj5+SSzYjzoNF/C6PByHbYQJLebOw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712603068; 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=q8vLq9mMHmJ9FwK7M8vHcz60ARiVmE7xmZoy/+eqR5I=; b=uul2cX5f6Ifuy5bBdFNnHJ3a8IS6If4hB7J92ByypDq1Y6SKqX0bn4RDCIuhfJIC1kwqlU tIRuTeVHMqW9Qilh+VBOAfL3HFqMBiPZVy5MYtk1E1V6P8WC+woYT51i3ciKTxkrYdUmCE dSPoa3H0VLP9b13KqmoaIudefIYHy0wJ8XPpWD0xgcp0DwtPwbD54ztOz+7HONogBbtmKo Thxo0lKJcrvZ8xVOKL+iP/zHPl6tgpBQ49F/FI0zXSvVOlbp9imyMAw0SfIfRP9z7KAmhH Cd405FF43JdaxYYnz1qcFGObddThoMG7/84u4Mwj7NipNYhy8roK0dAsHn+8EA== 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 4VCz6N4MY9zN1F; Mon, 8 Apr 2024 19:04:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 438J4SG6094226; Mon, 8 Apr 2024 19:04:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 438J4SEn094223; Mon, 8 Apr 2024 19:04:28 GMT (envelope-from git) Date: Mon, 8 Apr 2024 19:04:28 GMT Message-Id: <202404081904.438J4SEn094223@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 00dbe607b392 - stable/14 - acpi: Use bus_generic_alloc_resource instead of duplicating it 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 00dbe607b392c81ffec78f5e8123413cad606a7a Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=00dbe607b392c81ffec78f5e8123413cad606a7a commit 00dbe607b392c81ffec78f5e8123413cad606a7a Author: John Baldwin AuthorDate: 2024-02-09 18:27:45 +0000 Commit: John Baldwin CommitDate: 2024-04-08 17:53:25 +0000 acpi: Use bus_generic_alloc_resource instead of duplicating it No functional change, but it is cleaner to use the existing generic wrappers rather than KOBJ methods directly. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D43686 (cherry picked from commit 1fb5445206a5ef2351c32f8bc6beb67605593caa) --- sys/dev/acpica/acpi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index d6d1f825f63a..2e0a8a24610d 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -1542,7 +1542,7 @@ acpi_alloc_resource(device_t bus, device_t child, int type, int *rid, } } } else - res = BUS_ALLOC_RESOURCE(device_get_parent(bus), child, type, rid, + res = bus_generic_alloc_resource(bus, child, type, rid, start, end, count, flags); /* From nobody Mon Apr 8 19:04:29 2024 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 4VCz6Q27ZDz5HYlT; Mon, 8 Apr 2024 19:04: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 4VCz6P5xHBz4gHv; Mon, 8 Apr 2024 19:04:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712603069; 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=08l9zkbuA6gioykNTlYafNkjXyQyzgTn+WOAXOoxrHA=; b=H/ggri8XUXfZcmK9btiNYlZPqN8C4Ymixd5xtAkAja2VE8XsyyIIoZOWiu9s0vV1MKDMxe 3hzLC4ztsFpfm1vfeDu2lcLqgbOptUMGpx6noDnHUS/4top0ftRZCaNSb3+NDNqrUpLAvt uE1St8hkEy7NRuD7K8cEnI5auJlCfRCzFWgoTVxGtn0Y6luf69UIfbHhA9ETcdsx7fyVw9 ooPxK3ghZR8D76hOTTDkAKK51hJvU+h0rg6KpiA2awMF3pyb/QRXGYyQg/bzpeVV9SjTlM lwHAT/uMBckP/LKlfrAphq3hTjK4yBN3AjNnIaEbRvtC18hBFLBMj6ylf9TowQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712603069; a=rsa-sha256; cv=none; b=MLE13TJN4S119RJTWBbhBOa94eO7aRwl80dJta5ts4MwQNtJ5SQynY6OfM3mcnah0Nb12j ZL1+QC+qvElHbcsM1wD+WhyVtrxDffdh60du7kQlXApax6w17N2qfxpsZzMWDcJaHqZrp/ hMdPPx8t8A60mp5S2vuxDIuR2PNAY1nuqdSNxvFCryb8ij/oNttkYGpEejin18rpxw/PC6 axWtuVA5Ry1eB3NsYdFYhlBQQOxm4tGp0hDUW14Hvn7c4CwBMCUdCpNv2gULtMDK4Ey6xx XdPXI35uosrBXe+MbeefhqI4n2W+MrHYIWRRJbFQc+dvO71wMmfhL+3RboYPBQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712603069; 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=08l9zkbuA6gioykNTlYafNkjXyQyzgTn+WOAXOoxrHA=; b=hZwCxAqrbQUSxylgA6v5EuhNZaZpayuQ5lO8AeCh4URSRJuZxWNXe05Kro4gZzrQ+dSpN5 klpheCHMl6qahSsvmOCB+u9oZ7Wsr/M2mQgnyhu4LXKjADDChBkp/aZF5mggngBuni35s1 QqxsQd1I4/Ujhj7ZdgCM1ESlhIKLmhPHkfuYJvbQmVvcuF/KkSt/qE4s6Kg9L7Ka61H7xc Y5+c06y2uRKi8JjjWbpjEfUvEOVdiQXJiU9kFKp1KH9N+efWEl1C4M31hjxFXb36cZE0tp n+rmUjfH4kuvKoAjrq98l394E2gxVe2K4O2mB1qxMcH+VrXzlbBwnpL0RmkPlA== 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 4VCz6P5WRDzNSm; Mon, 8 Apr 2024 19:04:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 438J4T9O094295; Mon, 8 Apr 2024 19:04:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 438J4T3h094292; Mon, 8 Apr 2024 19:04:29 GMT (envelope-from git) Date: Mon, 8 Apr 2024 19:04:29 GMT Message-Id: <202404081904.438J4T3h094292@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 7d763eadd36e - stable/14 - cam: Check if cam_simq_alloc fails for the xpt bus during module init 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7d763eadd36e9b9419379756add71f5383f40af0 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=7d763eadd36e9b9419379756add71f5383f40af0 commit 7d763eadd36e9b9419379756add71f5383f40af0 Author: John Baldwin AuthorDate: 2024-02-09 19:53:43 +0000 Commit: John Baldwin CommitDate: 2024-04-08 17:53:43 +0000 cam: Check if cam_simq_alloc fails for the xpt bus during module init This is very unlikely to fail (and if it does, CAM isn't going to work regardless), but fail with an error rather than a gauranteed panic via NULL pointer dereference. PR: 276770 Reported by: Qiushi (cherry picked from commit eb86c6c5b462c996e44c45ba496937b75ef22da3) --- sys/cam/cam_xpt.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c index 6eac81c18160..3aa2f8a091a6 100644 --- a/sys/cam/cam_xpt.c +++ b/sys/cam/cam_xpt.c @@ -911,6 +911,8 @@ xpt_init(void *dummy) * perform other XPT functions. */ devq = cam_simq_alloc(16); + if (devq == NULL) + return (ENOMEM); xpt_sim = cam_sim_alloc(xptaction, xptpoll, "xpt", From nobody Mon Apr 8 19:04:30 2024 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 4VCz6R2p8Jz5HYXs; Mon, 8 Apr 2024 19:04: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 4VCz6Q737sz4gLY; Mon, 8 Apr 2024 19:04:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712603071; 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=dZm3DLTZ97+XbWco/Upxf6i480DvSp9Gor3BfoPkg9w=; b=mkLY2zmT3fn21CRypBB6S9gLs0IsEwL4O3azHWLZe0mArnqK2JyyG9RJswW8/OieEWPcAg umi92bm8H20rSH++E43wxnnsgI3+kVZU+SHE1pQ7kYbu3q6gdlza2qicSg7RGrebHo7csp vitwH33VHX/tLK6B8vCNFedrU1ML1mHd480v7aH7QxeYs/qH9rKCCQy8F3dlTCrjQ8wXqr QTA2geDnq2XcdEPwCvWLmnTWS9489lP8P5KDV/wukXH3dCbT6wD/V16aNFbYP5wWqkFycP lLEUPY3dPecHZR+Px2kbVTah2BcbncZ+gw2o6lHfkXPZoggOjjZyDm5M8ekTmg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712603071; a=rsa-sha256; cv=none; b=wKy0NWqfyOBqBw76grSpveMrOec+JJw/oA5CKHO14Ns6FrM9DkFB12TBPOqMP/pSh7UV4L QmPYwmYvMYjjNRNcBuT+Poz0qT+E3DRtW4h6Mh2cFnlf9RqHUwqVczDwtdDDmS/9uSfIdC SUGgO/T1aAt9L08Ie5t8s7eSeGByOp38jUbj2gfYOvOhz8LL2aH9xRFHf2J8MVy5CcsDID KU3M/sq/8wMMCvEsVhu01mwm8BLaVc2DL/U2gc68Lx034kZywHhI0l6aOCsatlTgTvlIg/ 9nm0+ggfiIkFXhA9EQRJJ8Jo4cGN9Wsmgfd81pMOhdQaDIfKeEbekpC1rnqD3A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712603071; 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=dZm3DLTZ97+XbWco/Upxf6i480DvSp9Gor3BfoPkg9w=; b=IUJBMp6wfE2VSL6ygcdkaJiFilt0ei7M6fG7OgBwamjXV5mAx28A9nGIiPhRHzO/O+Rk8K sWtzlWuefthWm04vI1bEQoIkX0Np2sXuVRFDq3WJ3ykbZ/gydI/jplv7urP48IBRpXf2a3 gs8SLfeYp16r46+sZLxSuXQ4k1W2c4tVwzXXPLIjsxj5+j6DHygc2CxTFe5/tFcXGOiBXD /HR84OxgaKbNvE3ETWaA91Ci25Kmqq3rJeK2qDMqbcsOax4FSvHCB23aRkxxCf26Ce+Sd6 7h+dtAS1chrXk9tpQJGmCV/W95C4arLL+y74Y/XSboc6z3CLehuzVdv3jqOoTQ== 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 4VCz6Q6fy0zNQD; Mon, 8 Apr 2024 19:04:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 438J4U8h094354; Mon, 8 Apr 2024 19:04:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 438J4UOg094351; Mon, 8 Apr 2024 19:04:30 GMT (envelope-from git) Date: Mon, 8 Apr 2024 19:04:30 GMT Message-Id: <202404081904.438J4UOg094351@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 75a63c968af9 - stable/14 - acpi: Allow child drivers to use bus_set_resource for more resources 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 75a63c968af999918fd2d6ba98ba5d86c0ea6188 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=75a63c968af999918fd2d6ba98ba5d86c0ea6188 commit 75a63c968af999918fd2d6ba98ba5d86c0ea6188 Author: John Baldwin AuthorDate: 2024-02-14 22:07:32 +0000 Commit: John Baldwin CommitDate: 2024-04-08 17:54:35 +0000 acpi: Allow child drivers to use bus_set_resource for more resources acpi_set_resource excludes certain types of resources for certain devices. The intention of this is to avoid adding resource entries for bogus resources enumerated via _CRS. However, this also prevents drivers from adding those resources explicitly if needed. To fix this, move the logic to exclude these resources into an ignore hook used when parsing _CRS to create the initial set of resources for each device. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D43892 (cherry picked from commit 055c1fe230ce5a2997c03a3cc2431baea1594566) --- sys/dev/acpica/acpi.c | 34 --------------------- sys/dev/acpica/acpi_resource.c | 69 ++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 67 insertions(+), 36 deletions(-) diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index 2e0a8a24610d..955c2b71b5ec 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -97,7 +97,6 @@ struct acpi_interface { }; static char *sysres_ids[] = { "PNP0C01", "PNP0C02", NULL }; -static char *pcilink_ids[] = { "PNP0C0F", NULL }; /* Global mutex for locking access to the ACPI subsystem. */ struct mtx acpi_mutex; @@ -1423,40 +1422,7 @@ acpi_set_resource(device_t dev, device_t child, int type, int rid, { struct acpi_device *ad = device_get_ivars(child); struct resource_list *rl = &ad->ad_rl; - ACPI_DEVICE_INFO *devinfo; rman_res_t end; - int allow; - - /* Ignore IRQ resources for PCI link devices. */ - if (type == SYS_RES_IRQ && - ACPI_ID_PROBE(dev, child, pcilink_ids, NULL) <= 0) - return (0); - - /* - * Ignore most resources for PCI root bridges. Some BIOSes - * incorrectly enumerate the memory ranges they decode as plain - * memory resources instead of as ResourceProducer ranges. Other - * BIOSes incorrectly list system resource entries for I/O ranges - * under the PCI bridge. Do allow the one known-correct case on - * x86 of a PCI bridge claiming the I/O ports used for PCI config - * access. - */ - if (type == SYS_RES_MEMORY || type == SYS_RES_IOPORT) { - if (ACPI_SUCCESS(AcpiGetObjectInfo(ad->ad_handle, &devinfo))) { - if ((devinfo->Flags & ACPI_PCI_ROOT_BRIDGE) != 0) { -#if defined(__i386__) || defined(__amd64__) - allow = (type == SYS_RES_IOPORT && start == CONF1_ADDR_PORT); -#else - allow = 0; -#endif - if (!allow) { - AcpiOsFree(devinfo); - return (0); - } - } - AcpiOsFree(devinfo); - } - } #ifdef INTRNG /* map with default for now */ diff --git a/sys/dev/acpica/acpi_resource.c b/sys/dev/acpica/acpi_resource.c index 373cc6da9820..e17b891d7974 100644 --- a/sys/dev/acpica/acpi_resource.c +++ b/sys/dev/acpica/acpi_resource.c @@ -34,6 +34,9 @@ #include #include +#if defined(__i386__) || defined(__amd64__) +#include +#endif #include #include #include @@ -62,6 +65,8 @@ struct lookup_irq_request { int pol; }; +static char *pcilink_ids[] = { "PNP0C0F", NULL }; + static ACPI_STATUS acpi_lookup_irq_handler(ACPI_RESOURCE *res, void *context) { @@ -575,6 +580,52 @@ struct acpi_res_context { void *ar_parent; }; +/* + * Some resources reported via _CRS should not be added as bus + * resources. This function returns true if a resource reported via + * _CRS should be ignored. + */ +static bool +acpi_res_ignore(device_t dev, int type, rman_res_t start, rman_res_t count) +{ + struct acpi_device *ad = device_get_ivars(dev); + ACPI_DEVICE_INFO *devinfo; + bool allow; + + /* Ignore IRQ resources for PCI link devices. */ + if (type == SYS_RES_IRQ && + ACPI_ID_PROBE(device_get_parent(dev), dev, pcilink_ids, NULL) <= 0) + return (true); + + /* + * Ignore most resources for PCI root bridges. Some BIOSes + * incorrectly enumerate the memory ranges they decode as plain + * memory resources instead of as ResourceProducer ranges. Other + * BIOSes incorrectly list system resource entries for I/O ranges + * under the PCI bridge. Do allow the one known-correct case on + * x86 of a PCI bridge claiming the I/O ports used for PCI config + * access. + */ + if (type == SYS_RES_MEMORY || type == SYS_RES_IOPORT) { + if (ACPI_SUCCESS(AcpiGetObjectInfo(ad->ad_handle, &devinfo))) { + if ((devinfo->Flags & ACPI_PCI_ROOT_BRIDGE) != 0) { +#if defined(__i386__) || defined(__amd64__) + allow = (type == SYS_RES_IOPORT && start == CONF1_ADDR_PORT); +#else + allow = false; +#endif + if (!allow) { + AcpiOsFree(devinfo); + return (true); + } + } + AcpiOsFree(devinfo); + } + } + + return (false); +} + static void acpi_res_set_init(device_t dev, void *arg, void **context) { @@ -605,6 +656,8 @@ acpi_res_set_ioport(device_t dev, void *context, uint64_t base, if (cp == NULL) return; + if (acpi_res_ignore(dev, SYS_RES_IOPORT, base, length)) + return; bus_set_resource(dev, SYS_RES_IOPORT, cp->ar_nio++, base, length); } @@ -630,6 +683,8 @@ acpi_res_set_iorange(device_t dev, void *context, uint64_t low, device_printf(dev, "_CRS has fixed I/O port range defined as relocatable\n"); + if (acpi_res_ignore(dev, SYS_RES_IOPORT, low, length)) + return; bus_set_resource(dev, SYS_RES_IOPORT, cp->ar_nio++, low, length); return; } @@ -645,6 +700,8 @@ acpi_res_set_memory(device_t dev, void *context, uint64_t base, if (cp == NULL) return; + if (acpi_res_ignore(dev, SYS_RES_MEMORY, base, length)) + return; bus_set_resource(dev, SYS_RES_MEMORY, cp->ar_nmem++, base, length); } @@ -669,8 +726,11 @@ acpi_res_set_irq(device_t dev, void *context, uint8_t *irq, int count, if (cp == NULL || irq == NULL) return; - for (i = 0; i < count; i++) + for (i = 0; i < count; i++) { + if (acpi_res_ignore(dev, SYS_RES_IRQ, irq[i], 1)) + continue; bus_set_resource(dev, SYS_RES_IRQ, cp->ar_nirq++, irq[i], 1); + } } static void @@ -683,8 +743,11 @@ acpi_res_set_ext_irq(device_t dev, void *context, uint32_t *irq, int count, if (cp == NULL || irq == NULL) return; - for (i = 0; i < count; i++) + for (i = 0; i < count; i++) { + if (acpi_res_ignore(dev, SYS_RES_IRQ, irq[i], 1)) + continue; bus_set_resource(dev, SYS_RES_IRQ, cp->ar_nirq++, irq[i], 1); + } } static void @@ -699,6 +762,8 @@ acpi_res_set_drq(device_t dev, void *context, uint8_t *drq, int count) if (count != 1) return; + if (acpi_res_ignore(dev, SYS_RES_DRQ, *drq, 1)) + return; bus_set_resource(dev, SYS_RES_DRQ, cp->ar_ndrq++, *drq, 1); } From nobody Mon Apr 8 19:04:31 2024 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 4VCz6S325sz5HYlc; Mon, 8 Apr 2024 19:04:32 +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 4VCz6S1PM8z4gf7; Mon, 8 Apr 2024 19:04:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712603072; 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=5V0APuppMW2or+w0B8bR4ZPZTBLo7OUVp9H9c5tiCCo=; b=Pr2Mqu084PwpZDrHwfOPO5aLlVBVRtvu77C5HUJDVGo/1yAwRQfNO1dGT+hlALwNtRW4OA hoS3QnULLQCFD/EcuEm85hkiOkNo1WrU761N1eL0GsPrMa/EDBQvFAZOCgwwJpYOEDqne+ fxHcmqJorYsLpdy5/4+zNjGYtqeKBwnBoxIEbtNRVsDESvA8aR+EUCDZmQNt8QQLjkMG7k X3y53EBWuKd8ZjTUuWMWHHCg1sK92WF8jO4cV4E5gcnklmurLelV/AZF79iFv/K5VXtLqr cLgLCzvmTvCxrXteZMOhsEgLbmjRLyHvIf7AWw4+8NDnfQ3PqPN0SkddrNZQmg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712603072; a=rsa-sha256; cv=none; b=WTSQGNOotqv0lvMfc/XnJyW0cWDjLFFPBo1bNqlwZ6JYZsL0j6tUfqyEb7bK0RdUF5gy25 WJkxCNgzSXTixsNO6suqNLUpJJ5pSTJ/4FnmE+PEIPZ3W9MrJs59gVWZVjRt/grne5f1zQ 95ZJWW05XDkRfYyZAk1EjvUQghr+BkDNG5aeKOCKG2oHkns5NFn6EsV7ngWoDAZugWrqzO /EK6oSi04CU+DFVCkJE0Iy8S046Gdg/jpUUl77s7PwN38Nbtjn+3A4eZEAb9k2PS3uNxDO eFHnFN4zZQl394k+h+oyfia6nfcUHXZFiNG8pakBofhSJI0cet+6hOnlw32e4Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712603072; 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=5V0APuppMW2or+w0B8bR4ZPZTBLo7OUVp9H9c5tiCCo=; b=fP+FtQsTKupBxDMhWCVTKIRdilwkRqvRmt5H7RhJq+PoZ1LJkyIGDV/uJW4lH+VLOeMmST plNpCmCJaoA6Y8JPZ5vN66cNemSzRDU/FcUZjyTNZ4BOi7aE6HyPxrPdMumBXoCb0iX45B LWkIs/YSZWRRO0aZhe+FnEqkhk3i180cWrqKSS4jarI56HC4Xz0u5F/BhHIta7roOQCWdt 2QSLbxqp1knXlt1WdLawxk5lVlqlzTV+wAnAbxwcEphG8TS3kpo7jGnBVw1JMk4oPo+UfU pXXo//eI6rFF/LxakvWxCnRxWtDg3+eDYKOYSwguqMyZL+M7S2o7o7qQEpXoKA== 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 4VCz6S0kG9zNdj; Mon, 8 Apr 2024 19:04:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 438J4WIg094408; Mon, 8 Apr 2024 19:04:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 438J4VM7094405; Mon, 8 Apr 2024 19:04:31 GMT (envelope-from git) Date: Mon, 8 Apr 2024 19:04:31 GMT Message-Id: <202404081904.438J4VM7094405@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 9c699850011b - stable/14 - pci_host_generic: Include the bridge's device name in rman descriptions 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9c699850011b216ed98cd0de866739e834f083d6 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=9c699850011b216ed98cd0de866739e834f083d6 commit 9c699850011b216ed98cd0de866739e834f083d6 Author: John Baldwin AuthorDate: 2024-02-14 22:07:32 +0000 Commit: John Baldwin CommitDate: 2024-04-08 17:54:50 +0000 pci_host_generic: Include the bridge's device name in rman descriptions The rman description strings now match those used in the PCI-PCI bridge driver. Using more specific names removes ambiguity in devinfo -u output on systems with multiple host to PCI bridges. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D43890 (cherry picked from commit 51f8ac224f3b87555ea17c7e7c4015a2a2b8b191) --- sys/dev/pci/pci_host_generic.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/sys/dev/pci/pci_host_generic.c b/sys/dev/pci/pci_host_generic.c index 90361a7258ed..082d083fc681 100644 --- a/sys/dev/pci/pci_host_generic.c +++ b/sys/dev/pci/pci_host_generic.c @@ -83,6 +83,7 @@ pci_host_generic_core_attach(device_t dev) uint64_t phys_base; uint64_t pci_base; uint64_t size; + char buf[64]; int domain, error; int rid, tuple; @@ -135,13 +136,19 @@ pci_host_generic_core_attach(device_t dev) sc->has_pmem = false; sc->pmem_rman.rm_type = RMAN_ARRAY; - sc->pmem_rman.rm_descr = "PCIe Prefetch Memory"; + snprintf(buf, sizeof(buf), "%s prefetch window", + device_get_nameunit(dev)); + sc->pmem_rman.rm_descr = strdup(buf, M_DEVBUF); sc->mem_rman.rm_type = RMAN_ARRAY; - sc->mem_rman.rm_descr = "PCIe Memory"; + snprintf(buf, sizeof(buf), "%s memory window", + device_get_nameunit(dev)); + sc->mem_rman.rm_descr = strdup(buf, M_DEVBUF); sc->io_rman.rm_type = RMAN_ARRAY; - sc->io_rman.rm_descr = "PCIe IO window"; + snprintf(buf, sizeof(buf), "%s I/O port window", + device_get_nameunit(dev)); + sc->io_rman.rm_descr = strdup(buf, M_DEVBUF); /* Initialize rman and allocate memory regions */ error = rman_init(&sc->pmem_rman); @@ -201,6 +208,9 @@ err_io_rman: err_mem_rman: rman_fini(&sc->pmem_rman); err_pmem_rman: + free(__DECONST(char *, sc->io_rman.rm_descr), M_DEVBUF); + free(__DECONST(char *, sc->mem_rman.rm_descr), M_DEVBUF); + free(__DECONST(char *, sc->pmem_rman.rm_descr), M_DEVBUF); if (sc->res != NULL) bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->res); err_resource: @@ -223,6 +233,9 @@ pci_host_generic_core_detach(device_t dev) rman_fini(&sc->io_rman); rman_fini(&sc->mem_rman); rman_fini(&sc->pmem_rman); + free(__DECONST(char *, sc->io_rman.rm_descr), M_DEVBUF); + free(__DECONST(char *, sc->mem_rman.rm_descr), M_DEVBUF); + free(__DECONST(char *, sc->pmem_rman.rm_descr), M_DEVBUF); if (sc->res != NULL) bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->res); bus_dma_tag_destroy(sc->dmat); From nobody Mon Apr 8 19:04:33 2024 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 4VCz6T4C9gz5HYXx; Mon, 8 Apr 2024 19:04:33 +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 4VCz6T2L5cz4gNp; Mon, 8 Apr 2024 19:04:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712603073; 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=MoKLe5OmuopajWI86N8ggn+me30j0tbVk5H2968ljM4=; b=oR0DSSfUXpMRp6ezd3hwHIBoFC42RlMJWoz4rs7R/d4HlQYfb7ain48UCXB9ytD2Co3zMY wTjg/qNcxZ3C94L5pLn6HmO7RQJU0r0jH3pnedzyc85AbBde0iVD+dUcpQUWwYUSzd71dn fYnaS3KHY1gEWEyqVg8UxcKoivtDk5Z/XlmRqSbb4xw/sDrWGMNNJVbWYfnj79gAw1vcQT bKHg9ij6pdc6HehzT0ANDx79nsiS6ni29tYF4DFdtl9ybrerpraUaMtf2dgQ94Q8ItwJ04 mvM38klREwetPuWayhfkezzhxZqJWWfDHITROz9x6PpIxaNyffDotVSqv12bLQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712603073; a=rsa-sha256; cv=none; b=phrNL5Zqj2YCuG+iu/dSw0d2Wry/mb6KDGc1noVIjYisg+gf7iTG6tnFU+qkPyPme203JT HijW1KV3Qnc6Rv2zgbdZW9ceY5cq77bPFQHBGAHbR0XxBc22vhFDR2ctgQFWJiXZdQ6DrX W4URGS/Sj2yM3xcLZRh+r1hTvR7kU+jMMiSlJwqlv4Fd8a7g2mrrfA246BSIup3NRWL0FT xcyV8ylqoV9fpAyfGpDbVi5jJCOBQCW0vtU1RA8wm0CkW6TEiFKUW//pLK6lYTmErSh02p g1/ySqOgwnh1AMN4K2BC//ynTGKzBLlqXHuCCu/zREZfquSW89W7+tOOfsHXTQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712603073; 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=MoKLe5OmuopajWI86N8ggn+me30j0tbVk5H2968ljM4=; b=gNOFuqq0/9/335E2+O6eyJHmLwPVOd73eqQyoxaH3HV0ci7TdfTBcdcqfDva1PWbIouJoZ FghsHDjaspTYlTN9bohe4nvGMbDszyJVNXqg7VhPWgRWl2yvtb64rcy06TMckRRpHKPtQG FzKkdKOTV1mYrpME3MrquiHx/IBDORuyF9S5NFv4o4rR5HG2gjY61eC5Z1YWw2H0USSbK6 jqpMr8Yb/3QHLvrGlKIe/0belFJoR//9Z8sV9a8Sh1njqzNljUnjp36ZuzHIAHatrvhAWN GUrxBhVmmRr5GeThogd67kmYoSby1M0Yq7gobFsWxMyrxHteKc0pXcA1Us6elg== 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 4VCz6T1sTmzMx8; Mon, 8 Apr 2024 19:04:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 438J4Xx2094456; Mon, 8 Apr 2024 19:04:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 438J4Xes094453; Mon, 8 Apr 2024 19:04:33 GMT (envelope-from git) Date: Mon, 8 Apr 2024 19:04:33 GMT Message-Id: <202404081904.438J4Xes094453@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 13926bcb9779 - stable/14 - pci_host_generic_fdt: Remove duplicate DEVMETHOD entries 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 13926bcb9779f8f2ba72ee25a094e179aa94d680 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=13926bcb9779f8f2ba72ee25a094e179aa94d680 commit 13926bcb9779f8f2ba72ee25a094e179aa94d680 Author: John Baldwin AuthorDate: 2024-02-14 22:07:32 +0000 Commit: John Baldwin CommitDate: 2024-04-08 17:55:37 +0000 pci_host_generic_fdt: Remove duplicate DEVMETHOD entries These are already inherited from generic_pcie_core_driver. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D43888 (cherry picked from commit 93923685d35d95e76bd2c125c007e13354b9428c) --- sys/dev/pci/pci_host_generic_fdt.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/dev/pci/pci_host_generic_fdt.c b/sys/dev/pci/pci_host_generic_fdt.c index e910e946421f..bcee6057ff3c 100644 --- a/sys/dev/pci/pci_host_generic_fdt.c +++ b/sys/dev/pci/pci_host_generic_fdt.c @@ -480,8 +480,6 @@ generic_pcie_ofw_bus_attach(device_t dev) static device_method_t generic_pcie_fdt_methods[] = { DEVMETHOD(device_probe, generic_pcie_fdt_probe), DEVMETHOD(device_attach, pci_host_generic_fdt_attach), - DEVMETHOD(bus_alloc_resource, pci_host_generic_core_alloc_resource), - DEVMETHOD(bus_release_resource, pci_host_generic_core_release_resource), /* pcib interface */ DEVMETHOD(pcib_route_interrupt, generic_pcie_fdt_route_interrupt), From nobody Mon Apr 8 19:04:34 2024 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 4VCz6V6FlCz5HYWD; Mon, 8 Apr 2024 19:04: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 4VCz6V3Wzjz4gkt; Mon, 8 Apr 2024 19:04:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712603074; 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=YmuAbye1AWhQBD2Bc0R3YJXJM65YIMgQwyeDq4alH3I=; b=AVC62pzWkoDhAtv8UO8pcq4/5jis37EKEhQGDqon9qoTtOxJhsr4O00ybuO/KP+qc+kZUx MrKJEPXWT98hTyODCMrsPYhN0MFEaVspp7z2sRAVLRZ0aqwv46ryAI03W+qAN2fxrXabAf 3uqhOzezpIRxKCweJr3oYZvp0OGEv9a92iJ5wfkv0GadeHTLGQAuMmBGgUosOa7XkQU+cP BJE2Gohv3WjOoNqNUco3JNJySSTv3Jx0oiw594hF8TU8lXJVmutvH0FkTpxblkjtnzsoVe GNKUP++3fogOli/kntiaJ1x0K2USIQ/BKWRSj7K92BtvWdaoIe76MIQtmUXWjA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712603074; a=rsa-sha256; cv=none; b=aQVHgPyMMGbzrm5H6WjIubmi8z/aY23GH3Ji9XYbJA08/lMskgS56sf7mnU+8IcuQmuvQC 5EzzxpNkZln+TV09FHs8Xrk4Dx5OTBMfEJohRfrY0nIQNs0k4bLRQ922Jnf4jaxl/PCFjH gGqyGjj4uPyU8sfFcdVMoWlIFlm9i1xvTWXgZYiPDxjRKM+7JzKhA0jFvfXwOBZnp3OVAx Y3hEykCKYi6nXczoTZ/pPzNNjBbTWBoCC/JMyrSSJ+ZKunTmCjxbK8vqEBi0Z8xPhKD56M rw9mdZbGTRIWKLuop4pCw47U1vVlDudx4HhIpqalLqwQuIWkB2FaiTG6xE0kTw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712603074; 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=YmuAbye1AWhQBD2Bc0R3YJXJM65YIMgQwyeDq4alH3I=; b=daSQDRbCQVE09l1xXumRdA060E4idsIWQc9JJLP+3rUkN2taEZFDDLi4BQAbMTcNTQq+KN kqzIIayZrFZY7nhGtmpcz74dv2GWtgOJgoSXr9uHg0P0ixQPTn1v6Xi+yHFTV/3lMbbLGv Ndgrxqa9Cv+IdrRk4UYeFGAdUHdqvAlUo/ZECnKMSO6nA6gzYc41x5tpXPeGE1ECY06vSo Ze+o31TIoAb2TNuHBrw//Usfmnku1hciNxsoCM195XuwSFdeLWiZaaPgT7TMPA1ot8XzT+ dmwNeHqVMv7AhwoQcz1sCwjevKzQW65aCwnejyls6nz3tL5VlD8M5dktgm0OUg== 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 4VCz6V337qzNQF; Mon, 8 Apr 2024 19:04:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 438J4Y8D094510; Mon, 8 Apr 2024 19:04:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 438J4Yns094507; Mon, 8 Apr 2024 19:04:34 GMT (envelope-from git) Date: Mon, 8 Apr 2024 19:04:34 GMT Message-Id: <202404081904.438J4Yns094507@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: cfb8cc9c5fa9 - stable/14 - acpi: Don't assume a resource is reserved in acpi_delete_resource 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: cfb8cc9c5fa942ef51d3738851efd63ba0aeaccd Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=cfb8cc9c5fa942ef51d3738851efd63ba0aeaccd commit cfb8cc9c5fa942ef51d3738851efd63ba0aeaccd Author: John Baldwin AuthorDate: 2024-02-14 22:07:32 +0000 Commit: John Baldwin CommitDate: 2024-04-08 17:55:58 +0000 acpi: Don't assume a resource is reserved in acpi_delete_resource This fixes a panic if a driver uses bus_set_resource to add a resource that fails to reserve and then deletes the resource via bus_delete_resource. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D43891 (cherry picked from commit e05436d577de98944b97b9cf510b29c4d2091b3f) --- sys/dev/acpica/acpi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index 955c2b71b5ec..0894f4464162 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -1619,7 +1619,8 @@ acpi_delete_resource(device_t bus, device_t child, int type, int rid) " (type=%d, rid=%d)\n", type, rid); return; } - resource_list_unreserve(rl, bus, child, type, rid); + if (resource_list_reserved(rl, type, rid)) + resource_list_unreserve(rl, bus, child, type, rid); resource_list_delete(rl, type, rid); } From nobody Mon Apr 8 19:04:35 2024 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 4VCz6W6gWCz5HYY2; Mon, 8 Apr 2024 19:04: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 4VCz6W4GSbz4gnL; Mon, 8 Apr 2024 19:04:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712603075; 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=tZolYAtd6ohR7XaQDcDHpqjnkjjjEEYjcnrQFLshCmY=; b=av+lJTx/xuVK/AenUI07ARSd4g9LqWtfTIvLPZPqk+nWXFEfRPe0yw+24h1mLRphPakWzt svQ/yXz6LfalG+JmGEZw1XjTGtp0otqyjmyYzcO9nn0lCKEclPFeXvWQVvIEq3Ps/igRli UKHNH1IPl8HB3MQ5VEWh7dTVUJuFzOuOOts0aRz2fp71lYfGq5F2LJu0AhisgW+ZCiQWhM g4+nP6jIDt7CdQQTVOkoBVmjOoPGyaJDb9zcqIKcV1BswQWvejpTJ2GUj+87LAzYb3BXtp CrQ+MngF/sx3WuI3fD1tcvwovtILnScxdBHAjP6hkJuhKVoZgy1sRw7aQhd4+w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712603075; a=rsa-sha256; cv=none; b=EG2mgA2VDJ92vzZervqAzywIQ2TpvnLK3VgpkblnjWxNs6NYu+oMGt1byZz3g+o7zOqd44 i1J0Vis67o00cRXKDJAeHT1X0TCiOqtODc51cUaznGAn++xY0wrAe1etcGjBa9jZFl4BRp 9fqKvR5R7RO9P28FX5XeWMhDyR/Ww8kVlNrCqSOucunSXi3Tl6MKmyJDckCHvSWPBRmX7X ovHpW+RbrIfzqICH2u8/bTuemwbAu1oXdAccUJ7SsvFb6qQH6rJk3Yl312kx0cmcpO4C3W 8KanRBL7xj5xFmNcPDTbMIcgRQ1E5IZWYxnE7CNaAq/v0jT938r1ipCGv4neMw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712603075; 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=tZolYAtd6ohR7XaQDcDHpqjnkjjjEEYjcnrQFLshCmY=; b=je+/lOBA99vjs1AL4jFstzWbJhnUILcmPUYH5VieiURJrEB64jqz0Jj68LxjPBEZuzHQM0 WrPtKtlTZTv9umDs4cpIYOD/I0MDtyY9/BjC/qNF4L2/yhTPiQXUo7Kv9dIqVse/XNsO38 zc3akAhamGlmxn8HATPhERRNLM8WeeHzYkjXPHwQL7/8eZl8Q7VDOCPgrNSU1LoX+o0L3M DsNkeMwzIEPn/ZJBUyZMcNeZoXsyuYfZXcLA4P7HEy2lUmgNm471KYxdFPWm+nvZEv135P AXg+pG4oySYVIHyEj6TJHJj3jdgOn12WL/pMOdUAVDhdIYv3xyzM6kLv1U3ufA== 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 4VCz6W3tkvzNQG; Mon, 8 Apr 2024 19:04:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 438J4ZdB094563; Mon, 8 Apr 2024 19:04:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 438J4ZMs094557; Mon, 8 Apr 2024 19:04:35 GMT (envelope-from git) Date: Mon, 8 Apr 2024 19:04:35 GMT Message-Id: <202404081904.438J4ZMs094557@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 50a4c3bb7aec - stable/14 - riscv: Add missing includes for DDB 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 50a4c3bb7aec0f699ac0f2eebdb7f707c55e6419 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=50a4c3bb7aec0f699ac0f2eebdb7f707c55e6419 commit 50a4c3bb7aec0f699ac0f2eebdb7f707c55e6419 Author: John Baldwin AuthorDate: 2024-02-15 20:20:30 +0000 Commit: John Baldwin CommitDate: 2024-04-08 17:56:24 +0000 riscv: Add missing includes for DDB The #ifdef DDB code in parse_metadata was dead code without opt_ddb.h. While here, update the call to db_fetch_ksymtab for changes in commit 02bc014a200a. Reviewed by: mhorne Obtained from: CheriBSD Differential Revision: https://reviews.freebsd.org/D43919 (cherry picked from commit 962b0bcbd924d308016237abc991280f15777e7f) --- sys/riscv/riscv/machdep.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/riscv/riscv/machdep.c b/sys/riscv/riscv/machdep.c index d5767e240c7e..5872ef9f94ac 100644 --- a/sys/riscv/riscv/machdep.c +++ b/sys/riscv/riscv/machdep.c @@ -33,6 +33,7 @@ * SUCH DAMAGE. */ +#include "opt_ddb.h" #include "opt_kstack_pages.h" #include "opt_platform.h" @@ -92,6 +93,10 @@ #include #include +#ifdef DDB +#include +#endif + #ifdef FDT #include #include @@ -456,7 +461,7 @@ parse_metadata(void) #ifdef DDB ksym_start = MD_FETCH(kmdp, MODINFOMD_SSYM, uintptr_t); ksym_end = MD_FETCH(kmdp, MODINFOMD_ESYM, uintptr_t); - db_fetch_ksymtab(ksym_start, ksym_end); + db_fetch_ksymtab(ksym_start, ksym_end, 0); #endif #ifdef FDT try_load_dtb(kmdp); From nobody Mon Apr 8 19:04:36 2024 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 4VCz6Y1hYfz5HYmN; Mon, 8 Apr 2024 19:04: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 4VCz6X5mJkz4gZp; Mon, 8 Apr 2024 19:04:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712603076; 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=+KA3Fe/fYWAD5Oy1WdXCpMw23L6Cn9C4e3wdo5eXRCs=; b=fujiPBfxOtC36wOpPkwZdhIM3CXA6EsNztd0yB8L6EMhJugY7ojiTBgOGz0BmoTsJIbqDB 9wSOy6EqdwNmb3kLJ+5rYmZN+mtTMVTTf6e7UqEuY6txr2wLbtjFsIYOjwQtLQYQEowgUz dfPdTdh6PG+9aL/cxNHAcE2SpXzQaC6EnmZKBBqwAoG38J+dcIgrV38H6kJoS9EIeMRYg/ rDDls4RCuoD0qiF8z1HyBKxQhTGHWZeJt4E0xTeww1vwJhoSO4rcld9zpVgtuh/CSQhUno ABZSOq2cKCbstIDSLQbTZO+RXhd4gQ5IfiZMQ4Xb1wMW1HF//YenVRNOBrJm4Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712603076; a=rsa-sha256; cv=none; b=rSop9PLylGQ6wA4JEmu6g48eDOhjsijB5C8odU8NVnP0s/vXOImzMnJc22s3yDyrMJk5RG cN07DlHRA7k9KjIhcyMV1Yj01XY3ZcT5X2TTCXXWOsEpyOIFVkTRUsmnAKWQ2YQ121uwvA WyqQxFIjICVf+GbHrQC1aM2oPFQrSxhs6EmuOhfuUp3zOKcB2VvlLViGBvAzG/PUr3ecN/ kdnpEUeCCTlmrNuaR+DwQZDqKmWcat9wu5+OYPeUJ/KETpdpqREDHhhgxeL5iQAMboJZth j6EaQ+APNspBhcTip8B6TLlO4CXN0jaxbh+AJQgbQV9h/boDwXsbH0q9ZrjzBA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712603076; 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=+KA3Fe/fYWAD5Oy1WdXCpMw23L6Cn9C4e3wdo5eXRCs=; b=cE6iWbF+rlDDmQwkUTbZ5MV5+XogXG1Dk1U9mOIgGfXmi4jL2io5cfBuzFpMEvD+4o/w5Y jf7UoFD6ta65IxVevOicJ3enLYENbVHokIBQnh7wwJLzGKsRo2VlYBxF4MrTNZgrvMDl0y yaFSFuDlRCvhqWn/oh1cyrQ9Gs3scFYRAVS8tMfAFNURKChEdFVXSJQVVBPF48QbBTW/Zv oBVYFwrsB+O+pU0+U7cJsR5Csq+crSlIt7ynziKDN/snh1al3h52aFbKCAjbCLA1LwZd7X PjzIM/wIH+iVq+G17NAOdLbYIvoGrIzjzWeMrCYRz6O++I7T9gbqPG8Kc1unBg== 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 4VCz6X53zhzNfM; Mon, 8 Apr 2024 19:04:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 438J4aLk094609; Mon, 8 Apr 2024 19:04:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 438J4aaK094606; Mon, 8 Apr 2024 19:04:36 GMT (envelope-from git) Date: Mon, 8 Apr 2024 19:04:36 GMT Message-Id: <202404081904.438J4aaK094606@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 00907525212d - stable/14 - vmd: Use bus_read/write_* instead of bus_space_read/write_* 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 00907525212d3cbac7f0ad7ea1ed6f65ce0e05aa Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=00907525212d3cbac7f0ad7ea1ed6f65ce0e05aa commit 00907525212d3cbac7f0ad7ea1ed6f65ce0e05aa Author: John Baldwin AuthorDate: 2024-02-15 20:26:19 +0000 Commit: John Baldwin CommitDate: 2024-04-08 17:57:24 +0000 vmd: Use bus_read/write_* instead of bus_space_read/write_* Using an explicit bus space tag and handle is deprecated. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D43885 (cherry picked from commit 76c678688634e9e2ea5f6369fb979aabddbfe426) --- sys/dev/vmd/vmd.c | 21 ++++++--------------- sys/dev/vmd/vmd.h | 2 -- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/sys/dev/vmd/vmd.c b/sys/dev/vmd/vmd.c index 395b789fdff4..7fc045032dc6 100644 --- a/sys/dev/vmd/vmd.c +++ b/sys/dev/vmd/vmd.c @@ -185,14 +185,11 @@ vmd_read_config(device_t dev, u_int b, u_int s, u_int f, u_int reg, int width) switch (width) { case 4: - return (bus_space_read_4(sc->vmd_btag, sc->vmd_bhandle, - offset)); + return (bus_read_4(sc->vmd_regs_res[0], offset)); case 2: - return (bus_space_read_2(sc->vmd_btag, sc->vmd_bhandle, - offset)); + return (bus_read_2(sc->vmd_regs_res[0], offset)); case 1: - return (bus_space_read_1(sc->vmd_btag, sc->vmd_bhandle, - offset)); + return (bus_read_1(sc->vmd_regs_res[0], offset)); default: __assert_unreachable(); return (0xffffffff); @@ -214,14 +211,11 @@ vmd_write_config(device_t dev, u_int b, u_int s, u_int f, u_int reg, switch (width) { case 4: - return (bus_space_write_4(sc->vmd_btag, sc->vmd_bhandle, - offset, val)); + return (bus_write_4(sc->vmd_regs_res[0], offset, val)); case 2: - return (bus_space_write_2(sc->vmd_btag, sc->vmd_bhandle, - offset, val)); + return (bus_write_2(sc->vmd_regs_res[0], offset, val)); case 1: - return (bus_space_write_1(sc->vmd_btag, sc->vmd_bhandle, - offset, val)); + return (bus_write_1(sc->vmd_regs_res[0], offset, val)); default: __assert_unreachable(); } @@ -283,9 +277,6 @@ vmd_attach(device_t dev) } } - sc->vmd_btag = rman_get_bustag(sc->vmd_regs_res[0]); - sc->vmd_bhandle = rman_get_bushandle(sc->vmd_regs_res[0]); - vid = pci_get_vendor(dev); did = pci_get_device(dev); for (t = vmd_devs; t->vmd_name != NULL; t++) { diff --git a/sys/dev/vmd/vmd.h b/sys/dev/vmd/vmd.h index a8156ba88a17..2ab943c07a6d 100644 --- a/sys/dev/vmd/vmd.h +++ b/sys/dev/vmd/vmd.h @@ -53,8 +53,6 @@ struct vmd_softc { #define VMD_MAX_BAR 3 int vmd_regs_rid[VMD_MAX_BAR]; struct resource *vmd_regs_res[VMD_MAX_BAR]; - bus_space_handle_t vmd_bhandle; - bus_space_tag_t vmd_btag; struct vmd_irq *vmd_irq; LIST_HEAD(,vmd_irq_user) vmd_users; int vmd_fist_vector; From nobody Mon Apr 8 19:04:38 2024 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 4VCz6b23Wcz5HYSj; Mon, 8 Apr 2024 19:04: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 4VCz6b0QPgz4glh; Mon, 8 Apr 2024 19:04:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712603079; 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=bu/oGPm/GEVY85CoY+x+NsoFzO1vd89MxvzUepjyl+I=; b=x16yopMXUPP2aQO2blM8oj6msvJVwkXORZjMPfGL5PiTQ17Kj+QmcF+xyDrTuI9OiP6RBZ E8mothGmi1GM4pzZa6GvAKKFmdQIB8zrv9s8cLH+rDP4hR7KfXGCk2iVYqlfmP2U3nqGFY IUWoSX3CyY13DG06KahIPy+y5yqbXKeUSJcMzE1e8eL9ynOhH7RJGflmwjDwxtJ0S+cwEp WWIx4ZEKkXsWPe5r0LqcDlfkQZMX3iB++CIqsWReH5iNcjWJ7Tb+GOPuDt3Tr7Mh+5l/iM ZBxvvhKYYS5FLPZJ1u3GTY7km5p41ZvV6kZNLzY6J9u88DyyIabDeY4+svTt0Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712603079; a=rsa-sha256; cv=none; b=oNBjVBvT+F0A7vFR6MS+UuSEpSp/evUe2AK8MjKksxxKv9WynhmUBhUYI6ksW5UybhIqC+ JwbrRUtImnp/udUNUi4D6H3JgiDRQGPzM3pSv2DoVB7y+Rp5RK7+FXxlBUH5j/aLeFTbAw iRNG1UEL4hQ76lvz4Lp/MQqrg9WBk64sbcg3X4aaRHA17duDL15T9puF9JpCF9EoFSeUFW 4vt5OXA358PP85Y89jIZJP00vfX/h15UZCuQtgJMtvSCZwjZ5tlK37mvg3tR3tJSwSboRO t7Z2c3h+qLPeY+L4cuPqc1x1PiJmnH4z763tBDvQsYkHu2EXMp40P4zGJaBI7Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712603079; 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=bu/oGPm/GEVY85CoY+x+NsoFzO1vd89MxvzUepjyl+I=; b=dX3YC4Yq7ePsdX371ScjrXHthVB+sqnn/wSU1f9XXSZSaoC14FhA5Xk9xkqBCvwXzLgwaC fMUrKdm1CmHXtOwZ70sxBa9N4Q67cNIsQzBllcP+08GYciunIFzRqFBG0WHECqDUwQbdmv 409KA8ITWjRPpKgsdvrXixFBqjG3F7HqrlzuTi43mAClV4ai49TCN30/bWxvRVbhUwlICq gVLoB/KI9BNyyaW/V8Ba/zOyXBqEmfPpMu3BiNoZVni3Kc9WDimk+9v9QILGn0AE5nHVV8 TioNE3E7MmQ4EjUR23LwWpLeegTkkdI/bDqgOVZaCu28z9FVirtgZ3i5j8L+mw== 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 4VCz6b01mgzN1H; Mon, 8 Apr 2024 19:04:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 438J4cbv094720; Mon, 8 Apr 2024 19:04:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 438J4cZn094717; Mon, 8 Apr 2024 19:04:38 GMT (envelope-from git) Date: Mon, 8 Apr 2024 19:04:38 GMT Message-Id: <202404081904.438J4cZn094717@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 794517a0f379 - stable/14 - netlink: Don't use a zero-length array 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 794517a0f3794131d79e3c9d0c12fcceb840ae80 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=794517a0f3794131d79e3c9d0c12fcceb840ae80 commit 794517a0f3794131d79e3c9d0c12fcceb840ae80 Author: John Baldwin AuthorDate: 2024-02-27 19:59:52 +0000 Commit: John Baldwin CommitDate: 2024-04-08 17:58:16 +0000 netlink: Don't use a zero-length array Define SNL_DECLARE_FIELD_PARSER* macros to create a parser that has no output attributes only input fields and use this to define the snl_donemsg_parser. This removes the need for the zero-length nla_p_donemsg[] variable. Zero length arrays are not valid in ISO C. Reviewed by: jrtc27, melifaro Differential Revision: https://reviews.freebsd.org/D43918 (cherry picked from commit 69945c49fea7ac2352c1fd7d22f70f2e3861ba81) --- sys/netlink/netlink_snl.h | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/sys/netlink/netlink_snl.h b/sys/netlink/netlink_snl.h index 7bdf5424ddf3..f8387132f78a 100644 --- a/sys/netlink/netlink_snl.h +++ b/sys/netlink/netlink_snl.h @@ -174,6 +174,18 @@ static const struct snl_hdr_parser _name = { \ #define SNL_DECLARE_PARSER(_name, _t, _fp, _np) \ SNL_DECLARE_PARSER_EXT(_name, sizeof(_t), 0, _fp, _np, NULL) +#define SNL_DECLARE_FIELD_PARSER_EXT(_name, _sz_h_in, _sz_out, _fp, _cb) \ +static const struct snl_hdr_parser _name = { \ + .in_hdr_size = _sz_h_in, \ + .out_size = _sz_out, \ + .fp = &((_fp)[0]), \ + .fp_size = NL_ARRAY_LEN(_fp), \ + .cb_post = _cb, \ +} + +#define SNL_DECLARE_FIELD_PARSER(_name, _t, _fp) \ + SNL_DECLARE_FIELD_PARSER_EXT(_name, sizeof(_t), 0, _fp, NULL) + #define SNL_DECLARE_ATTR_PARSER_EXT(_name, _sz_out, _np, _cb) \ static const struct snl_hdr_parser _name = { \ .out_size = _sz_out, \ @@ -909,14 +921,12 @@ SNL_DECLARE_PARSER(snl_errmsg_parser, struct nlmsgerr, nlf_p_errmsg, nla_p_errms #define _IN(_field) offsetof(struct nlmsgerr, _field) #define _OUT(_field) offsetof(struct snl_errmsg_data, _field) -static const struct snl_attr_parser nla_p_donemsg[] = {}; - static const struct snl_field_parser nlf_p_donemsg[] = { { .off_in = _IN(error), .off_out = _OUT(error), .cb = snl_field_get_uint32 }, }; #undef _IN #undef _OUT -SNL_DECLARE_PARSER(snl_donemsg_parser, struct nlmsgerr, nlf_p_donemsg, nla_p_donemsg); +SNL_DECLARE_FIELD_PARSER(snl_donemsg_parser, struct nlmsgerr, nlf_p_donemsg); static inline bool snl_parse_errmsg(struct snl_state *ss, struct nlmsghdr *hdr, struct snl_errmsg_data *e) From nobody Mon Apr 8 19:04:37 2024 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 4VCz6Z2Cl3z5HYY6; Mon, 8 Apr 2024 19:04: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 4VCz6Y6WV6z4glY; Mon, 8 Apr 2024 19:04:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712603077; 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=7OuVP1OfwWji1rWNfcVcKLNJwhH9j+Pqd5qrWClBCbk=; b=N6ZZYpnvVUWnNi1c3y8nBTdg7Gv9zERIB/N8tzs7M8hiwvJ1vokVg0Lc2s1OhG2pc0C7F1 0vAHl06uZ77L6bZZrTjM01VgOFPJCCugDKN2QUzbmepe78CbmSgusx7gihW08D2WcfzfkW xhoOCTFJqxK6m7AHhPKRE46T02RjJjnjF2k/66qyrJA3vKT2vS493oeHF2Qs6uHzeZkLxx Uv78pGUlHz6P93KqgCrzPiQK0nNplhQ92Y51QxayZCoveqv4/dqhv88HvpYt4IKSqg4Qs8 bLfGpDVSJjWDSQfazg87P8848ESZ6+H73xDzQUX5t/IzuOcePkQEK0rjL20SPQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712603077; a=rsa-sha256; cv=none; b=qU0ENO+Wz5TVKmlVPDGk+iSTkDWKSx3mldU5qFtba19ljZ09ZPtRBIVq0olVf3SwjhRJNk EmQ+cndLKzISfYFqp5UDwVXD31PFVqWiixlkbzxbInC0HDjdcA6gUorFvQ1WJLtlCjnWQK xrfqbZsvTGLbGFn+jCSord7G29ppmwYFh2CWvlT1AOdviGLUAODSfILUVthaWaNTWM7vSi taf7FsAs8ceJQou8BlQV6hT1DwcvsOjveK7cAhKq0I7QiNZ0dEyntVBBZCf4t79qFEMBSU w9AVWw2LSTVHKpZpbpcz4YijBME0uXpF9wuTPYT0N4F+gzYHLhPvxypye5Mv/Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712603077; 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=7OuVP1OfwWji1rWNfcVcKLNJwhH9j+Pqd5qrWClBCbk=; b=GmLn0f/jHG4498BrJ1NKfpNjgWjqG47D4KFFCecb+OuqVLnThwJP8WU6/PArF+8bfLEiD2 HeGsn9VdnwRjXwvZIJKFbu6Rhfwe2XJ+DbEeg5j7Jghh6mNiV/8KeSF41o9GjpYYxWAkTs Dac3VI1sSI9Xzf5egP3PFnhsU/8S2be6UfO3g76bL3BujrrzKhMavDT79Wh2nt8PKcC1pP lQx5MY4toNktvHBYruJ03Chgt9T/O3IvMRHHa9+CwAGssDT+GqJdmZ361wPoeF95s/66vM 1prByFDQPuKFn/rbQKto+Dktp+HVkfireVYVTPoN388w1kPEm2MP6CS3OzWXjw== 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 4VCz6Y67b9zN1G; Mon, 8 Apr 2024 19:04:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 438J4bWh094675; Mon, 8 Apr 2024 19:04:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 438J4bF9094672; Mon, 8 Apr 2024 19:04:37 GMT (envelope-from git) Date: Mon, 8 Apr 2024 19:04:37 GMT Message-Id: <202404081904.438J4bF9094672@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: d2c8cb41d1a2 - stable/14 - ipfw: Skip to the start of the loop when following a keep-state rule 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d2c8cb41d1a2e531737a6da4cb9958bc497477c3 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=d2c8cb41d1a2e531737a6da4cb9958bc497477c3 commit d2c8cb41d1a2e531737a6da4cb9958bc497477c3 Author: Karim Fodil-Lemelin AuthorDate: 2024-02-16 01:57:51 +0000 Commit: John Baldwin CommitDate: 2024-04-08 17:57:53 +0000 ipfw: Skip to the start of the loop when following a keep-state rule When a packet matches an existing dynamic rule for a keep-state rule, the matching engine advances the "instruction pointer" to the action portion of the rule skipping over the match conditions. However, the code was merely breaking out of the switch statement rather than doing a continue, so the remainder of the loop body after the switch was still executed. If the first action opcode contains an F_NOT but not an F_OR (such as an "untag" action), then match is toggled to 0, and the code exits the inner loop via a break which aborts processing of the actions. To fix, just use a continue instead of a break. PR: 276732 Reviewed by: jhb, ae MFC after: 2 weeks (cherry picked from commit 62b1faa3b7495de22a3225e42dabe6ce8c371e86) --- sys/netpfil/ipfw/ip_fw2.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/netpfil/ipfw/ip_fw2.c b/sys/netpfil/ipfw/ip_fw2.c index d2b01fde6944..e43d1a8fbbff 100644 --- a/sys/netpfil/ipfw/ip_fw2.c +++ b/sys/netpfil/ipfw/ip_fw2.c @@ -2886,8 +2886,7 @@ do { \ cmd = ACTION_PTR(f); l = f->cmd_len - f->act_ofs; cmdlen = 0; - match = 1; - break; + continue; } /* * Dynamic entry not found. If CHECK_STATE, From nobody Mon Apr 8 19:04:40 2024 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 4VCz6c4GR4z5HYmT; Mon, 8 Apr 2024 19:04: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 4VCz6c1NrHz4gx9; Mon, 8 Apr 2024 19:04:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712603080; 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=3v9P/LKTW9GmmIJwr/RJoThAlRM18/4ywFB2LVTpV6I=; b=rK0JdWP0PXg2I0udOU1xDYdUUmfvrfxjTlg1sHGgfbECnZEUX7ei2Qsm8xhAJ1s+PKnFGR xE+obQTiZ8sMWyl4CSIpUphAe94T0JTWIJSnSRfd2EcQmdY7yjGpSxtD/E7q2QzKcdQf+0 o6hYVyNuQV/nQ1zB8fZsCK4mxIJ9u5emSdEo+oy3oVk3OUV75MJzLH+TDlG2Us+YDc12Gk iSqv7GKBg2A3FVO2Y4AfQDPklz0XreZmh0gDL7AvaDN9sMg7z0fgyroPE9fRsTj0Li7C15 xS29CNvGLCYgAdM644K6RSqlIZk8jVGBPCC7gqgF4maFBUN5dMKbO6qWpr8YPA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712603080; a=rsa-sha256; cv=none; b=CTen7ZZNNBMtxzXoCZO7S82xjeX4glaSo0d8pxIUjvOcaiCCFRJY3TcjsUaqrHPOAnB2S8 3w665wMJbiZIIdBsPrBytvFrQka0oAf5FwZnuJ7Przo3S3OnGLA9pLmuvTwzl6iBpjfSDA wuDvxlQu+37jPipHWJICK+RyroGaNT7lJ+q3S0IUQv2/R74jbSxpEbSrY4lPSoqBFAd+0x ZqcRv1A+b/bidoJjDQvpiSQzS8g2MoRXvnICmDxquWswCwhP56vI2jpidakP1SWFF/wI7t 6TT0CZQvY8lmmky2C+EiO4EvSKsis+Z5B8GO6mGWlZ5TSfizROD/bHUK/1yjzw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712603080; 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=3v9P/LKTW9GmmIJwr/RJoThAlRM18/4ywFB2LVTpV6I=; b=LY6u6FsnAS+M4XXRALDks2a6JsqPgEA8RNX4Hhyk62MmV/t1pspbiby/5C9erj+3vZx/OP GSzl7u2rZq2Y72AlZu3gdEd7MvPFMZOA0hJor0GZejQ61dshAjj4wzZXg6VF+HmYpGtyvw +ju3VaDHPPWLYGFA4NV/77fwZa1tuO25r6wZAAdT8hYIxu/peVkfWLspFssY/ZwuOFhYQ4 XjePGhTL1mmzvD29IG7dWAPit1Rf2Zw/BfWXjUIlWQBjJ1PkZ2rmNaYg4TaVC5OiiVzUn7 f5ZXbYZx/YMrnzTKgvENegXvN0bNpmEDmBzctf5xTnUlimus9EAfX8T2L4LJjw== 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 4VCz6c11DgzNfN; Mon, 8 Apr 2024 19:04:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 438J4eEg094768; Mon, 8 Apr 2024 19:04:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 438J4edE094765; Mon, 8 Apr 2024 19:04:40 GMT (envelope-from git) Date: Mon, 8 Apr 2024 19:04:40 GMT Message-Id: <202404081904.438J4edE094765@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: e2d88351fdd8 - stable/14 - arm64: Fix typo in pagetable_l0_ttbr0_bootstrap symbol name 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e2d88351fdd8ed7f0a021a9924afacb2c6d49b55 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=e2d88351fdd8ed7f0a021a9924afacb2c6d49b55 commit e2d88351fdd8ed7f0a021a9924afacb2c6d49b55 Author: Alfredo Mazzinghi AuthorDate: 2024-03-01 18:32:43 +0000 Commit: John Baldwin CommitDate: 2024-04-08 18:00:06 +0000 arm64: Fix typo in pagetable_l0_ttbr0_bootstrap symbol name Obtained from: CheriBSD (cherry picked from commit c6a6ec85a70314b8270e25a06e77e2e7c95c7055) --- sys/arm64/arm64/locore.S | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/arm64/arm64/locore.S b/sys/arm64/arm64/locore.S index a87d7add4149..e97b393b90b4 100644 --- a/sys/arm64/arm64/locore.S +++ b/sys/arm64/arm64/locore.S @@ -211,8 +211,8 @@ ENTRY(mpentry) adrp x24, pagetable_l0_ttbr1 add x24, x24, :lo12:pagetable_l0_ttbr1 /* Load the identity page table */ - adrp x27, pagetable_l0_ttbr0_boostrap - add x27, x27, :lo12:pagetable_l0_ttbr0_boostrap + adrp x27, pagetable_l0_ttbr0_bootstrap + add x27, x27, :lo12:pagetable_l0_ttbr0_bootstrap /* Enable the mmu */ bl start_mmu @@ -910,7 +910,7 @@ pagetable_l2_ttbr0_bootstrap: .space PAGE_SIZE pagetable_l1_ttbr0_bootstrap: .space PAGE_SIZE -pagetable_l0_ttbr0_boostrap: +pagetable_l0_ttbr0_bootstrap: .space PAGE_SIZE pagetable_l0_ttbr0: .space PAGE_SIZE From nobody Mon Apr 8 19:04:41 2024 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 4VCz6d44byz5HYSm; Mon, 8 Apr 2024 19:04:41 +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 4VCz6d1s2Qz4h0K; Mon, 8 Apr 2024 19:04:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712603081; 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=Krft7X1np5mtq6NqMO9NR688pC5n0Z6IUZW0Xge9nRg=; b=rojIyJ21kT+PqZoldTE3K87LIYbxL1dp8OF8kEBkxIwqDTpVjOfH+Q3jGchaXzaJidfzxn jZqRq+A0g+nS7OeYY3nwIIO6C7mxPhhzPHbEzIPl+j5RU0NCKz5bxlTB3jfj0oPzcigORA PHooNE2vQSsIRiNjjd6HmSxfZ3ziAwcxF4be8Vi4ysnWJ+xhRLMD09laEcfmFV2qwP2Ync 8N7q6gKF8SCjXXmW4WKv/RwTWRj98O8QU4ifgMvCaLoAtHjI/GptOKueCfJ0QHodiUNedo ML/yEjBCKowU5EEEWfQuOscId7buA1b6xJ+uieE/EJM2kt+AlWsJfeUANXD63A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712603081; a=rsa-sha256; cv=none; b=xgwslym/2Mn3aigKBcIDoM1zXvvYeLKpVOJFX2DFjeAsqMJZzzOfUrNItJztkI84GEuLei +/x9bCHMVfoormCFHwy0l8ZQYmYvmBj6IOMoJYD4mS7kpqgBbIFbYtA+pzq4NBCOm+gmTB /zKiqXRJCyoQTKhWl26+eRmOmoBbOkuCtsRITsB2ri1Iai4JWZGr8OQzlSR/Bcb0ofhF1t /A+QfLBstSwMybB/lH5phX0fdqmYYeQTEsHEGF42ui/pjKwRvI3F3OPk9qSAsvHpIShxfG Z8/TItrminJKi65UJiflsvq6vqiSj4+g6z/y8ivynyFpnQTuGwwyXp+X4nvU1A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712603081; 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=Krft7X1np5mtq6NqMO9NR688pC5n0Z6IUZW0Xge9nRg=; b=OkR8pZF7vT/RjLua7naDsQpJlGbt7P6bsdqaiQU/mTwOG1uK0bXdQ/boYILzD9QCfbRv31 lK9Z1godSWbBzv4uok6q4W9ViiytOLjD0+ir+MVaQu+MyPV6hhIj6sYw0KJfdOaFFmOjjw JAoqFT2SjNH5cdWhQkUv8Hy2QsY3oAX00lefTlu2++qb9dVr2lxxQcDnbWNXjqcqtBd4uW +lhlXTfjM1GjELfH86I2amdrVLXrmgFsUehuelVEd5uJcCsxoERLyWtg2k77bO4awDqPft wQsLviw1I4IU5p0KoMugeNQ0n83NMGpwDtR51812ldTGHsyv1r1Qyr6IfomM0A== 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 4VCz6d1TBBzMx9; Mon, 8 Apr 2024 19:04:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 438J4fuF094837; Mon, 8 Apr 2024 19:04:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 438J4fn5094834; Mon, 8 Apr 2024 19:04:41 GMT (envelope-from git) Date: Mon, 8 Apr 2024 19:04:41 GMT Message-Id: <202404081904.438J4fn5094834@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 16089905240f - stable/14 - nvme: Firmware revisions in the firmware slot info logpage are ASCII strings 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 16089905240f848ba0070fa8ae6622a0e198e9d7 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=16089905240f848ba0070fa8ae6622a0e198e9d7 commit 16089905240f848ba0070fa8ae6622a0e198e9d7 Author: John Baldwin AuthorDate: 2024-03-01 22:18:43 +0000 Commit: John Baldwin CommitDate: 2024-04-08 18:01:02 +0000 nvme: Firmware revisions in the firmware slot info logpage are ASCII strings In particular, don't try to byteswap the values as 64-bit integers and always print a non-empty version as a string. Reviewed by: chuck, imp Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D44121 (cherry picked from commit 7485926e09a08fbfe83a9bc908e7d43aaca4c172) --- sbin/nvmecontrol/logpage.c | 13 ++----------- sys/dev/nvme/nvme.h | 14 ++------------ sys/dev/nvme/nvme_ctrlr.c | 4 ---- 3 files changed, 4 insertions(+), 27 deletions(-) diff --git a/sbin/nvmecontrol/logpage.c b/sbin/nvmecontrol/logpage.c index 725815edc475..31ec3a443716 100644 --- a/sbin/nvmecontrol/logpage.c +++ b/sbin/nvmecontrol/logpage.c @@ -230,10 +230,6 @@ read_logpage(int fd, uint8_t log_page, uint32_t nsid, uint8_t lsp, nvme_health_information_page_swapbytes( (struct nvme_health_information_page *)payload); break; - case NVME_LOG_FIRMWARE_SLOT: - nvme_firmware_page_swapbytes( - (struct nvme_firmware_page *)payload); - break; case NVME_LOG_CHANGED_NAMESPACE: nvme_ns_list_swapbytes((struct nvme_ns_list *)payload); break; @@ -429,15 +425,10 @@ print_log_firmware(const struct nvme_controller_data *cdata, void *buf, uint32_t else status = "Inactive"; - if (fw->revision[i] == 0LLU) + if (fw->revision[i][0] == '\0') printf("Empty\n"); else - if (isprint(*(char *)&fw->revision[i])) - printf("[%s] %.8s\n", status, - (char *)&fw->revision[i]); - else - printf("[%s] %016jx\n", status, - fw->revision[i]); + printf("[%s] %.8s\n", status, fw->revision[i]); } } diff --git a/sys/dev/nvme/nvme.h b/sys/dev/nvme/nvme.h index 3e39803f68ab..315dbdd5a3c8 100644 --- a/sys/dev/nvme/nvme.h +++ b/sys/dev/nvme/nvme.h @@ -1455,7 +1455,8 @@ _Static_assert(sizeof(struct nvme_health_information_page) == 512, "bad size for struct nvme_firmware_page { uint8_t afi; uint8_t reserved[7]; - uint64_t revision[7]; /* revisions for 7 slots */ + /* revisions for 7 slots */ + uint8_t revision[7][NVME_FIRMWARE_REVISION_LENGTH]; uint8_t reserved2[448]; } __packed __aligned(4); @@ -1997,17 +1998,6 @@ void nvme_health_information_page_swapbytes( #endif } -static inline -void nvme_firmware_page_swapbytes(struct nvme_firmware_page *s __unused) -{ -#if _BYTE_ORDER != _LITTLE_ENDIAN - int i; - - for (i = 0; i < 7; i++) - s->revision[i] = le64toh(s->revision[i]); -#endif -} - static inline void nvme_ns_list_swapbytes(struct nvme_ns_list *s __unused) { diff --git a/sys/dev/nvme/nvme_ctrlr.c b/sys/dev/nvme/nvme_ctrlr.c index 55573669562c..e659a3776957 100644 --- a/sys/dev/nvme/nvme_ctrlr.c +++ b/sys/dev/nvme/nvme_ctrlr.c @@ -714,10 +714,6 @@ nvme_ctrlr_async_event_log_page_cb(void *arg, const struct nvme_completion *cpl) nvme_health_information_page_swapbytes( (struct nvme_health_information_page *)aer->log_page_buffer); break; - case NVME_LOG_FIRMWARE_SLOT: - nvme_firmware_page_swapbytes( - (struct nvme_firmware_page *)aer->log_page_buffer); - break; case NVME_LOG_CHANGED_NAMESPACE: nvme_ns_list_swapbytes( (struct nvme_ns_list *)aer->log_page_buffer); From nobody Mon Apr 8 19:04:42 2024 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 4VCz6f613Kz5HYlr; Mon, 8 Apr 2024 19:04: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 4VCz6f39fkz4gsM; Mon, 8 Apr 2024 19:04:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712603082; 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=Nrhn/wFrCaBSUI0/jG6kJmSS16YK3u8+gDUl9Cwr4rY=; b=Ky1tLei7gBlKQYe1ncX1hj4iPE7wWaODjZvB36LJN8hmJFDGcfo4+QqEbxUYpfPWLpCnKJ nAO/IJRYjM1VxzmUAotj1A+5z89rgd4tWwy+r/Kqu+XIw0EeJuBWX+hEkS4oKjFCU2wmOy z5p4z0UvI0wRudaXdSKTPVJC096oJJxK0gV9lkjBCy09ouYCSWfelKyrLL+mteePAJFrL0 7OEc5/0ofRR9p3HrjrYFyNhEP4e735J5dWD7jfIU2Kc09B2ktwSB24wydJFMURYf8ruwfn dA4X/+wMest8kmWzdKjjYZgw4XlUqn+3oJ1lma1JFy6cmennJIsdQGbwHy/xCg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712603082; a=rsa-sha256; cv=none; b=Bk8cH5Auvn8a1q1w7FOWm76yU/Eev/EWxsvnUmO3DeXRVOqvmtxz5G+cce4kF5Osltwpzl qO1hpH2pi/qU2/WhQUFjdedHbKN6ou8ulcS5wb882bbbZq77QGgsGc+hbOfqBYBRDUgXkR rjPjAuwulffSc/dAB6POI/wNj5rtDz5YjFsOkdDgkIUVjvgbzB3Fekw+LerrAyOaQy92W7 /LKBQGDNZ7nhD35K7xYfCX8vzBb3yuEtwssgKcFuCP+f45IrIRQL4iFOK6ZFmBRSXhbPs0 uW4TWvsUM8s6VCq4btuO6AMb9j1TBZvSxOU6a0b9SpBchIpyPXJEB/hDIacR6A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712603082; 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=Nrhn/wFrCaBSUI0/jG6kJmSS16YK3u8+gDUl9Cwr4rY=; b=fu9WXbRBZ3uRQfDu07G8mUaO87va225jR5HyviGVl3r7NC18zEKzMELtHOCxHBPBqSVHHK MV46uEfUceiGH1H3ZMZZmNKek6QoATEVqT9DXQIB9B2ZqzhAOBLaUx8BNgHt7+VG94nvSD zJ5ZyjevVGTKNXuh5X0Jd4ybBCAsdAX3b09TrD4Y54lQSBoeMph2iGaGVYcpyvPhnGY2CD F9N5hX24WJHaW35W+mEAHeSlRgJtw69RZM7hdUmeam1qJXSN5W5UlU7e5nY560ltxgqVI0 hxLOIwuMUy/vGFva5IGybjGDVMrZZEOkBHcOjv1nUm6qyR+GF1UWO3CtokOeaA== 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 4VCz6f2pZhzNSn; Mon, 8 Apr 2024 19:04:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 438J4g46094894; Mon, 8 Apr 2024 19:04:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 438J4gOk094891; Mon, 8 Apr 2024 19:04:42 GMT (envelope-from git) Date: Mon, 8 Apr 2024 19:04:42 GMT Message-Id: <202404081904.438J4gOk094891@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 05a831511b78 - stable/14 - nvmecontrol: Update the test for a valid firmare revision slot 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 05a831511b787eba136c96dcd0985cacb18625f2 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=05a831511b787eba136c96dcd0985cacb18625f2 commit 05a831511b787eba136c96dcd0985cacb18625f2 Author: John Baldwin AuthorDate: 2024-03-15 15:18:47 +0000 Commit: John Baldwin CommitDate: 2024-04-08 18:01:30 +0000 nvmecontrol: Update the test for a valid firmare revision slot Reported by: Coverity Scan CID: 1539214 Fixes: 7485926e09a0 nvme: Firmware revisions in the firmware slot info logpage are ASCII strings (cherry picked from commit 1b38f851d809950cfe112c705029f40edd0579b3) --- sbin/nvmecontrol/firmware.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/nvmecontrol/firmware.c b/sbin/nvmecontrol/firmware.c index 256847ef8ac2..80bbff032cf2 100644 --- a/sbin/nvmecontrol/firmware.c +++ b/sbin/nvmecontrol/firmware.c @@ -105,7 +105,7 @@ slot_has_valid_firmware(int fd, int slot) read_logpage(fd, NVME_LOG_FIRMWARE_SLOT, NVME_GLOBAL_NAMESPACE_TAG, 0, 0, 0, &fw, sizeof(fw)); - if (fw.revision[slot-1] != 0LLU) + if (fw.revision[slot-1][0] != '\0') has_fw = true; return (has_fw); From nobody Mon Apr 8 19:04:43 2024 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 4VCz6g6hnCz5HYmY; Mon, 8 Apr 2024 19:04: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 4VCz6g4BZxz4h2q; Mon, 8 Apr 2024 19:04:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712603083; 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=J2pudNbWe68QApN2MPDal812Rk/K0L7CYJlXge5mBkA=; b=UtCzeTeq4wQwfHmRt70ZJ/aJiZtZllkhyjJLjsW3PT6umcZOlQS+YJ0jEOm1k6FUcgWVT1 xNbc8nCBwSdeqE+/9l97fqN/9oggjbBcGmYHP3KD6t35x3yZhJ41vTR7l2lJQ9WrCgd1CE PttPtIf2HzKve5bMfzWfQBpdp44Pru4hu+/Of1tzFYurftE2drgSZ5HZbJ0L7AJMSFxM1L EWH8sk1G6breaT6j7dvCFFtUYycZsNzeoSIJBCqU6B/0VqPlZgjpJfT4SPHRijik2Wi15y X0VOkCrbTMux2d6wgKJ3JzsezuEOn3DeFPw1WxcLv1gXM4TgjhMtQ8q+ow88xw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712603083; a=rsa-sha256; cv=none; b=TcRqr1j7QmOuA5059X5waErhOXCLF1hrTYaGE+8y0RAC7Stt9b6lyiGokauwysc3CcCca0 8eHvLsQqX5b4Zw3noC15M1qihBt1XJZ7RrN2/giHhOvMlAvftIUkEuw1bgA4R0dPfzCk+n LQtVBsUY5uBFDT7+7GEuFit00IrZr7324nrN+S36e7+zb4I7e6cqAZ+YYV5W1DeieUr1Qm dn2qw8pXrMX3sKc+2eT6o+WRueXZiNXUviE8zyJKe0CHm3V0d2EllPGTpYjkE4DZII4VtT 5+5r3XaNPHPG8ytvEaMS0rvoFzLFQOkwArARbgmJe/AC2f2Fb584DEE3lqPC1A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712603083; 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=J2pudNbWe68QApN2MPDal812Rk/K0L7CYJlXge5mBkA=; b=M1/Wl6TD8i4Nr7tUb0HNhtUVmejPq7a+6/gyS301qEm92tkyAMBCTe7bui9B6MR/RxgI68 erJlb+mqDHviFO1ytAO1hHQjHiPi7YY0loW2M4iadU0k0WMh6JxtM5mS7qByEoZ8igdg+v gxShX2lCp+5Hb9v0ISa3TqVVhBQzeX4iOGYh+rFGGyxi63LIqxdu9TNXMZfz8nCcBozsgq 7M4VVF9zgx1oIhjS6sD9xSxH91LpOHKD1eYKDDdlPC57VtWk9wcNem0OkuSbyVqeUMlLQZ F76oWHmtlZIKQwjjsmI0QeZCsXW/8DkR5wrLjEmV9xGOuSKV7G4P9KAhsBzXLw== 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 4VCz6g3pvdzNQH; Mon, 8 Apr 2024 19:04:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 438J4hOX094939; Mon, 8 Apr 2024 19:04:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 438J4hRU094936; Mon, 8 Apr 2024 19:04:43 GMT (envelope-from git) Date: Mon, 8 Apr 2024 19:04:43 GMT Message-Id: <202404081904.438J4hRU094936@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 85cdbae749e9 - stable/14 - .github: Switch to v4 of actions/checkout 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 85cdbae749e9d1e1f7f3e3adc6ffcbe5405ee217 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=85cdbae749e9d1e1f7f3e3adc6ffcbe5405ee217 commit 85cdbae749e9d1e1f7f3e3adc6ffcbe5405ee217 Author: John Baldwin AuthorDate: 2024-03-05 05:52:09 +0000 Commit: John Baldwin CommitDate: 2024-04-08 18:03:05 +0000 .github: Switch to v4 of actions/checkout GitHub is emitting a warning that v3 is deprecated due to using Node.js 16. (cherry picked from commit e6dccf00500d7e9e2311b372e28897df7c0421dd) --- .github/workflows/cross-bootstrap-tools.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cross-bootstrap-tools.yml b/.github/workflows/cross-bootstrap-tools.yml index ddfcb467126e..0aa1d9a35c1e 100644 --- a/.github/workflows/cross-bootstrap-tools.yml +++ b/.github/workflows/cross-bootstrap-tools.yml @@ -37,7 +37,7 @@ jobs: - target_arch: aarch64 target: arm64 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: install packages (Ubuntu) if: runner.os == 'Linux' run: | From nobody Mon Apr 8 19:04:44 2024 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 4VCz6h6hCxz5HYlx; Mon, 8 Apr 2024 19:04: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 4VCz6h5Dz0z4gmj; Mon, 8 Apr 2024 19:04:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712603084; 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=2IgKg/GvV6tpI/qr9GZi58LdDlnZwiC9brK+J7KhyWw=; b=F2okmC599zMTitZWkh9w/5eQlK9IfU5rpc9G5rrwgHzg+JdaNxYa0kSeevUXcNYwexhou2 fC8GM2VsCsLOwqdQvGQgI+u2/9J7tAMgB6OnR1cICZ2cVysLw6hzwTxN24TJKA8+StNlFt 9yK5faLUG5GvnMNAbAZDIOLq0URyg7I+PBgc/AtTm7QBzpAgnLWyL4nSz56p0Zf1jSqr5p kHA4T5ppWMaW2qB4uO4wqI/vSTTxbbba5l60kFdJ+NMevUpc91yibwC4N1bypttsSUe2H4 hOtxOEFS+uR9BGyu4ffclinOUpxL1Nm9HqdafhyLH6iYkCERtNYDTIM4m3XbUg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712603084; a=rsa-sha256; cv=none; b=n/ZIEirDhhZeawhBIfV2t34L/fvqs8LHDFpKkZmT5G9EgOYU79NLKNm4qpdLdrs4Ga2R+m yIJzL6mqUmX+FjCI0VDMDXOCoO1/VlKT/htM1qlslsf//uGxMnmQeVMhH7GSW/tdClYtpz 4L3EXoTO15SGIJPwGYAeUHnCXGrjnLekIbcUE0cGASjfVAGSttT5XhLh2FluGwKqS/fX9W sDU9o540zMgZvSgY6i6eJbj/2dQKPD817Us17XeE9/UdEFNCDCUtdPEFeuiP2W/5XURyix bEPrX8K6s1PX72TgFYQg7YImpqYeKAvxEcdYSIsEFChTBbd2zUDY0/wTuHsctA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712603084; 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=2IgKg/GvV6tpI/qr9GZi58LdDlnZwiC9brK+J7KhyWw=; b=YRltPf4XiFW2VkBY0/WZxHN9hj9KUmEmZHAB78HuA9/e8/tfv9XprbDfbOWlehCs5h+Gd3 Go5JKfv/qQJpZaV9mfbni0E5mU6hE9FhaoZqjuYar1NzZbHh0nuBMTtwBdi7eUFW4gXV1f Dg1uYexg9pTbYj5v4U9fbzwSs4tqzNPYfF6crnvRN6u9Zc4ARc4DUrU5PkgyOZOmo6nRn/ f4S4yJKprh9d1INbTGNenC+Rtrq2PU3IA3X+yUpDlcOjF8f8POzVMW4wirnRJT7kr2Ozsh O+fRTo/pvbS6qtKpkMZhjqpQMI1k9PMf6/ZkdPbcYD/izgNDzMgwhVJtGrBeTw== 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 4VCz6h4sYGzN1J; Mon, 8 Apr 2024 19:04:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 438J4iGY094989; Mon, 8 Apr 2024 19:04:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 438J4iOX094986; Mon, 8 Apr 2024 19:04:44 GMT (envelope-from git) Date: Mon, 8 Apr 2024 19:04:44 GMT Message-Id: <202404081904.438J4iOX094986@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: f091b71838aa - stable/14 - arm busdma: Fix parameter types to exclusion_bounce_check 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f091b71838aa17f16f4e162722837d8d4161f825 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=f091b71838aa17f16f4e162722837d8d4161f825 commit f091b71838aa17f16f4e162722837d8d4161f825 Author: John Baldwin AuthorDate: 2024-03-15 17:10:07 +0000 Commit: John Baldwin CommitDate: 2024-04-08 18:05:31 +0000 arm busdma: Fix parameter types to exclusion_bounce_check These are bus addresses not CPU virtual addresses. Reviewed by: andrew Sponsored by: University of Cambridge, Google, Inc. Differential Revision: https://reviews.freebsd.org/D44343 (cherry picked from commit 66658b0f2775824b2a80fb56ca15e6ceae2f8240) --- sys/arm/arm/busdma_machdep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/arm/arm/busdma_machdep.c b/sys/arm/arm/busdma_machdep.c index 8dd4f3bff23d..a4f2c803f30a 100644 --- a/sys/arm/arm/busdma_machdep.c +++ b/sys/arm/arm/busdma_machdep.c @@ -243,7 +243,7 @@ SYSINIT(busdma, SI_SUB_KMEM+1, SI_ORDER_FIRST, busdma_init, NULL); * express, so we take a fast out. */ static int -exclusion_bounce_check(vm_offset_t lowaddr, vm_offset_t highaddr) +exclusion_bounce_check(bus_addr_t lowaddr, bus_addr_t highaddr) { int i; From nobody Mon Apr 8 19:04:45 2024 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 4VCz6k1n1tz5HYhN; Mon, 8 Apr 2024 19:04: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 4VCz6j6RXNz4h83; Mon, 8 Apr 2024 19:04:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712603085; 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=ftzzHVo0p2B6ZtianVXIk3VewyefpDKvXsH4bjaqzKc=; b=p0h6tM8CyipF/i9qJ2nb0hFBo/dFMhvzZCX/n7OjVhWTwmYSAxH/7Kg7PP6SzA2G+BydEE yLRbb5t0R1TlHZgtQmzpTJEZjD4mk83dg6zPKKGvK7XTPH2UpAJLyWa7OncKnLzAxYozL5 QxUKQ4xqnULjz6euUMVL01kXuBhvxJiQe3CdM7leMz86PeWiE4iZQI7YzlWlDy1MGJM+ZX 5Vz6EaBvbZ/LlWepBUGBJD34cz0RYlGwDZVxmSFzFd18mkacPE5euBTnYtp63xUeDYIP+U AsvzsQVVcnSQLBEqVRKqUVVbGpX+PkZK68rYG8pMKMLXzhxKvIhq6YoNNrS0Cw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712603085; a=rsa-sha256; cv=none; b=fEP+ptL2cm3T9vp65D3o2GhKhC1Um73Ya08D86JPIkamnfz7qXfBj1mx8o4Gfyy5q8eTpX RsNxvokI4L+vs4etSn7sralXJ9iYHv6vIPtsliUp4Ei6moH2oPYpHzNXCt36kpbyk2L6sa mLOiwsk3E2PvFTUky5+dwwNOE9jaixjbSA7KVv74kO/qKKi0DVj6GTnRZci26ns8dfvLai m4KV5lno3d2n/otODn9p9wpupDZjM47JdM5ilje9H6KPNwumSW9q0kslXerSxNwBIBNN7c vsyD0v/giPODjg/wCjxB5YN3jPiKEeMrFaBRYV9F7mNQhI5+D9BP3VxCNBYeMA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712603085; 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=ftzzHVo0p2B6ZtianVXIk3VewyefpDKvXsH4bjaqzKc=; b=F6eoT33fXYLrjzodbhH9C26ROzHagUqEqtQReMCq13sh7jG1PN+ugN4K+gaizUj48q3uOd up0jFPw47qhfaX7qOZ/H3hEUiZPjwShNa+aQX8Oggv5KkVv1ZXdmLdFAaLoEjM6BTXZuSP dYEASQA3Yk4MccMZxpuVfIu4z2XhN7NG2OezDD00cmJwMBDz/MTLjUWsa2erQtH7r3bI8r /vdTY7IpTtMlbjywOP0Ruhf26LNPX/z9Q1nBpHmQl0f1wKUxHcWBGkvRXI0llzFk0FnVrM d/CM8wa/NCcD6HJn96YK010z+W9D5v1ezPVNGw31955tF/NaLwfQUw1DjcX/cQ== 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 4VCz6j5zWQzN1K; Mon, 8 Apr 2024 19:04:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 438J4jSe095053; Mon, 8 Apr 2024 19:04:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 438J4jUR095050; Mon, 8 Apr 2024 19:04:45 GMT (envelope-from git) Date: Mon, 8 Apr 2024 19:04:45 GMT Message-Id: <202404081904.438J4jUR095050@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 30eab966575f - stable/14 - kldxref: Properly handle reading strings near the end of an ELF file 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 30eab966575fccbb85d54902667530b6a6e66e45 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=30eab966575fccbb85d54902667530b6a6e66e45 commit 30eab966575fccbb85d54902667530b6a6e66e45 Author: John Baldwin AuthorDate: 2024-03-19 00:01:23 +0000 Commit: John Baldwin CommitDate: 2024-04-08 18:06:13 +0000 kldxref: Properly handle reading strings near the end of an ELF file If a string is at or near the end of an input file and the amount of remaining data in the file is smaller than the maximum string size, the pread(2) system call would return a short read which is treated as an error. Instead, add a new helper function for reading a string which permits short reads so long as the data read from the file contains a terminated string. Reported by: jrtc27 Reviewed by: jrtc27 Sponsored by: University of Cambridge, Google, Inc. Differential Revision: https://reviews.freebsd.org/D44419 (cherry picked from commit 785600d0fb13d6f0b4595bf4dbbc048113dda71d) --- usr.sbin/kldxref/ef.c | 9 +-------- usr.sbin/kldxref/ef.h | 4 ++++ usr.sbin/kldxref/ef_obj.c | 9 +-------- usr.sbin/kldxref/elf.c | 18 ++++++++++++++++++ 4 files changed, 24 insertions(+), 16 deletions(-) diff --git a/usr.sbin/kldxref/ef.c b/usr.sbin/kldxref/ef.c index 1ef27f2bc54a..77ddada946f2 100644 --- a/usr.sbin/kldxref/ef.c +++ b/usr.sbin/kldxref/ef.c @@ -549,7 +549,6 @@ static int ef_seg_read_string(elf_file_t ef, GElf_Addr address, size_t len, char *dest) { GElf_Off ofs; - int error; ofs = ef_get_offset(ef, address); if (ofs == 0) { @@ -559,13 +558,7 @@ ef_seg_read_string(elf_file_t ef, GElf_Addr address, size_t len, char *dest) return (EFAULT); } - error = elf_read_raw_data(ef->ef_efile, ofs, dest, len); - if (error != 0) - return (error); - if (strnlen(dest, len) == len) - return (EFAULT); - - return (0); + return (elf_read_raw_string(ef->ef_efile, ofs, dest, len)); } int diff --git a/usr.sbin/kldxref/ef.h b/usr.sbin/kldxref/ef.h index 25dc5216b169..9d3dc1b1b435 100644 --- a/usr.sbin/kldxref/ef.h +++ b/usr.sbin/kldxref/ef.h @@ -189,6 +189,10 @@ int elf_read_raw_data(struct elf_file *efile, off_t offset, void *dst, int elf_read_raw_data_alloc(struct elf_file *efile, off_t offset, size_t len, void **out); +/* Reads a single string at the given offset from an ELF file. */ +int elf_read_raw_string(struct elf_file *efile, off_t offset, char *dst, + size_t len); + /* * Read relocated data from an ELF file and return it in a * dynamically-allocated buffer. Note that no translation diff --git a/usr.sbin/kldxref/ef_obj.c b/usr.sbin/kldxref/ef_obj.c index 1274a14c10af..ac83137cd394 100644 --- a/usr.sbin/kldxref/ef_obj.c +++ b/usr.sbin/kldxref/ef_obj.c @@ -248,7 +248,6 @@ static int ef_obj_seg_read_string(elf_file_t ef, GElf_Addr address, size_t len, char *dest) { GElf_Off ofs; - int error; ofs = ef_obj_get_offset(ef, address); if (ofs == 0) { @@ -258,13 +257,7 @@ ef_obj_seg_read_string(elf_file_t ef, GElf_Addr address, size_t len, char *dest) return (EFAULT); } - error = elf_read_raw_data(ef->ef_efile, ofs, dest, len); - if (error != 0) - return (error); - if (strnlen(dest, len) == len) - return (EFAULT); - - return (0); + return (elf_read_raw_string(ef->ef_efile, ofs, dest, len)); } int diff --git a/usr.sbin/kldxref/elf.c b/usr.sbin/kldxref/elf.c index e5fe90169d2c..a93cf996ccc7 100644 --- a/usr.sbin/kldxref/elf.c +++ b/usr.sbin/kldxref/elf.c @@ -197,6 +197,24 @@ elf_read_raw_data_alloc(struct elf_file *efile, off_t offset, size_t len, return (0); } +int +elf_read_raw_string(struct elf_file *efile, off_t offset, char *dst, size_t len) +{ + ssize_t nread; + + nread = pread(efile->ef_fd, dst, len, offset); + if (nread == -1) + return (errno); + if (nread == 0) + return (EIO); + + /* A short read is ok so long as the data contains a terminator. */ + if (strnlen(dst, nread) == nread) + return (EFAULT); + + return (0); +} + int elf_read_data(struct elf_file *efile, Elf_Type type, off_t offset, size_t len, void **out) From nobody Mon Apr 8 19:04:48 2024 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 4VCz6m3pJRz5HYqN; Mon, 8 Apr 2024 19:04: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 4VCz6m17Htz4h6F; Mon, 8 Apr 2024 19:04:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712603088; 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=7nG3wlrWthJ7ckAhASJxf1S1MRvuFI0wADbYEDE1018=; b=MksgaKm+4s1evvuQX1VMdL3d3BvgGGB+hlFyFSLa4uQmFEXL1rxovnRVcDTFIkY0T5ypHx toB9AJzbZsU0MdZRJ08VHB0p63Rw+zmNgoJdDacqzP0HP1H4f2I/M/lUj5jNibrq5q3Dny EVU2T9dxXxCk9GhlQfE5RKUXxyOp8jMFDjlqfTAeM7CkMkFdgfr3bY2TcT3Rr482hFUcoD rM6LAjjwFGsmc17dbM303wFbUtvg/X+F4TmdBEm4R7i3r5eFgnKAHDo3JXyhdKWE8dVcEf +G2T/qaqpoqnfGbgw2luXr7U+OH+LPPku5VKi4gvPZvlqdZMQ6TU/s5He4DVOg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712603088; a=rsa-sha256; cv=none; b=pughCxDfhyFwvPzeHsUDy622+z6x92dXCGSpl1O9lmTdeY5D/MBAWGMJ5M7BzkFaA9Uajl DVTNLxt0xlRjVLAo1bY3p4Ao6+2jAaYyeOxpOqpIJ5lV/Fb1HiUWBtUUKf3Qo2evm066GG Pv+OjclL33AKYw8tVovla++Fe38FXREKiPjniF4VR0d0hlyrzUTM9+GBUy2n2Mwu+TMVX5 zfhZhy06Nfs9zoYg4mRA4bBEMAHaPWpOm5K35uOZ5nAr4XRC63D5JZVhEwPF6QrKdLTMGr KySRzkzOv8HfFLFk8Td61Zz+igE8VO6DfiygYE+gh/uFfcRigPnGPTdaCWqwgw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712603088; 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=7nG3wlrWthJ7ckAhASJxf1S1MRvuFI0wADbYEDE1018=; b=wyyEMIjU7XFxdTdTG+KdWE2HnZeqFKxNc4icBqqCE7mxZ2uJIPWjXqWsM3EN+hBGEyEAqW bSWGJTtrbYXODeQlmYns8luGiSLi1CIlrZZYOimbXd9GkgCxEAzDMU+/zsfWYFT5OTNgZK VcSdBdGalvb0AHC56dtAaMqEVaNoLbGQJtmAT869SI5IvTn6u64Xy4Re7Fb5wbUtC+htFm zZQGxfzvYAy/I79kdBUDrzReMulE/4wocMQ13q3vCLRzPGot/pb5LzzdKuRNIeY7WbB0WT qt7wdao1sDX3BXxjaz1GwkqwmQJnlTedsmZ1HWcoArCuExub2bu6nAB/wMvz4Q== 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 4VCz6m0lZXzNSp; Mon, 8 Apr 2024 19:04:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 438J4m9p095179; Mon, 8 Apr 2024 19:04:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 438J4mth095176; Mon, 8 Apr 2024 19:04:48 GMT (envelope-from git) Date: Mon, 8 Apr 2024 19:04:48 GMT Message-Id: <202404081904.438J4mth095176@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 7748f70561f3 - stable/14 - cxgbe tom: Handle a race condition when enabling TLS offload 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7748f70561f373a8d8e70c32223c99b02904ef51 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=7748f70561f373a8d8e70c32223c99b02904ef51 commit 7748f70561f373a8d8e70c32223c99b02904ef51 Author: John Baldwin AuthorDate: 2024-03-20 22:30:09 +0000 Commit: John Baldwin CommitDate: 2024-04-08 18:07:13 +0000 cxgbe tom: Handle a race condition when enabling TLS offload Use a separate state for when a request to set RX_QUIESCE has been sent but the resulting TCB reply has not been received. In particular, this correctly handles the case where data has been received and queued in the receive queue before the quiesce request takes effect. Reviewed by: np Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D44435 (cherry picked from commit 9978c6289d621ac9edc95acb4e0f527a62a49b03) --- sys/dev/cxgbe/tom/t4_tls.c | 12 ++++++++++-- sys/dev/cxgbe/tom/t4_tom.h | 5 +++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/sys/dev/cxgbe/tom/t4_tls.c b/sys/dev/cxgbe/tom/t4_tls.c index 3a0c1a392e6c..bdd03edd3a6f 100644 --- a/sys/dev/cxgbe/tom/t4_tls.c +++ b/sys/dev/cxgbe/tom/t4_tls.c @@ -315,7 +315,7 @@ tls_alloc_ktls(struct toepcb *toep, struct ktls_session *tls, int direction) tls->params.max_frame_len; toep->tls.tx_key_info_size = t4_tls_key_info_size(tls); } else { - toep->flags |= TPF_TLS_STARTING | TPF_TLS_RX_QUIESCED; + toep->flags |= TPF_TLS_STARTING | TPF_TLS_RX_QUIESCING; toep->tls.rx_version = tls->params.tls_vmajor << 8 | tls->params.tls_vminor; @@ -1243,6 +1243,10 @@ tls_received_starting_data(struct adapter *sc, struct toepcb *toep, { MPASS(toep->flags & TPF_TLS_STARTING); + /* Data was received before quiescing took effect. */ + if ((toep->flags & TPF_TLS_RX_QUIESCING) != 0) + return; + /* * A previous call to tls_check_rx_sockbuf needed more data. * Now that more data has arrived, quiesce receive again and @@ -1250,7 +1254,7 @@ tls_received_starting_data(struct adapter *sc, struct toepcb *toep, */ if ((toep->flags & TPF_TLS_RX_QUIESCED) == 0) { CTR(KTR_CXGBE, "%s: tid %d quiescing", __func__, toep->tid); - toep->flags |= TPF_TLS_RX_QUIESCED; + toep->flags |= TPF_TLS_RX_QUIESCING; t4_set_rx_quiesce(toep); return; } @@ -1287,6 +1291,10 @@ do_tls_tcb_rpl(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) if ((toep->flags & TPF_TLS_STARTING) == 0) panic("%s: connection is not starting TLS RX\n", __func__); + MPASS((toep->flags & TPF_TLS_RX_QUIESCING) != 0); + + toep->flags &= ~TPF_TLS_RX_QUIESCING; + toep->flags |= TPF_TLS_RX_QUIESCED; so = inp->inp_socket; sb = &so->so_rcv; diff --git a/sys/dev/cxgbe/tom/t4_tom.h b/sys/dev/cxgbe/tom/t4_tom.h index d74f3f908286..ddf7dec55784 100644 --- a/sys/dev/cxgbe/tom/t4_tom.h +++ b/sys/dev/cxgbe/tom/t4_tom.h @@ -73,8 +73,9 @@ enum { TPF_KTLS = (1 << 11), /* send TLS records from KTLS */ TPF_INITIALIZED = (1 << 12), /* init_toepcb has been called */ TPF_TLS_RECEIVE = (1 << 13), /* should receive TLS records */ - TPF_TLS_RX_QUIESCED = (1 << 14), /* RX quiesced for TLS RX startup */ - TPF_WAITING_FOR_FINAL = (1<< 15), /* waiting for wakeup on final CPL */ + TPF_TLS_RX_QUIESCING = (1 << 14), /* RX quiesced for TLS RX startup */ + TPF_TLS_RX_QUIESCED = (1 << 15), /* RX quiesced for TLS RX startup */ + TPF_WAITING_FOR_FINAL = (1<< 16), /* waiting for wakeup on final CPL */ }; enum { From nobody Mon Apr 8 19:04:46 2024 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 4VCz6l1ZnYz5HYmb; Mon, 8 Apr 2024 19:04: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 4VCz6k6v8Bz4h8N; Mon, 8 Apr 2024 19:04:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712603087; 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=yndoYaoLE3h2WHBtiBRqGffwFPZgou6yIT5xl5UA0OE=; b=Oh+Lu3nLIsqRwKQTK7o0eYvcUPrMoCWmE813tlNcP1Xq+sj6aBC3fA2YQqqoi8Eh2R6YXe atId6s7YqFWYktIPSlUHAv/PXK4MxLcA6lBn77KaL13AU8myg/wqMEGpMqCOVxGGOGaNGH Chpa2cStmxNQx63wN2aYRxPwjLj2RlLyUNaKOmJofr8Mp2OWHp7hOsnxEoC4KirR9eRpzL HbRRywtZK/3dzjpwomZTCsEJo2BoXwEV5Yx1Ubo0ecByEyOnIA+aLW3VrZDTb8hr1qmD+z /EnaygRe6nInkPhVExcdwYmzenGAsaZSFMJJ1tbLYbZW0pHsxSV8jwAxJjSnjg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712603087; a=rsa-sha256; cv=none; b=mY9864avHCQSYLhedKKg6gZ27C6s5rszxawlzy53K9eEPSNTvw7+lMj0z+MphxTQnsKCod Z0m/QeEQJzYwniZMJ6+ivzty+4Q/j4qo7NRdvUjpaQ4YEEmPXvws37rtxPOWlVwNBoQw1Y 03XvNhis+5lTzE7pSROten1Q7lvudQmultdBa3cDCo4n1s5rHQgnvJg444X/mNXGwhdc3S VZZ7rbMx07O+xBuGkao5zPibc66pi6wgBV70lH6Lbt+Srp/GDF1ODeyP1hGFAU76olx7tH ipwV/0mIuVKevRKVNPfWFOt4EQCXR8loagy/79jel+FUF2k83YOjMB1rbQNIKQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712603087; 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=yndoYaoLE3h2WHBtiBRqGffwFPZgou6yIT5xl5UA0OE=; b=UO1lJr82lj/1HdnCZrrZCBqXs568Hx4kRNGf+I+Hz/YkQ9Awwo2StJX0AlToYpickCtGZv TXmeZ2FdPgUCfPFgOORPiSTJRVqI5LtpfwMpNctDmXCKblcfOe5YpTeT/XX4AavyK4Y2Jk 7KJXgkfNP1BYSmeIP29rX/lPKkmcWML1emBJ53NMNzzsigWSVQxjsmRbhmZWneUcYbRX/d oS0AGqy0ArY2nNcFkSyF4u78Pi56lJvgxXhO0/zOv/1D1RfSE4wNxkMJM9ZP6XXR6ajdnw fbaJ4x1Xhk7eYw+cTfqJXGbLUK+ZTT92u6xyR9TwtKRPo0ex24QMbyFJro3zbw== 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 4VCz6k6TySzMxB; Mon, 8 Apr 2024 19:04:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 438J4khO095122; Mon, 8 Apr 2024 19:04:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 438J4kZY095119; Mon, 8 Apr 2024 19:04:46 GMT (envelope-from git) Date: Mon, 8 Apr 2024 19:04:46 GMT Message-Id: <202404081904.438J4kZY095119@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: d4ad8432aa57 - stable/14 - ddp: Clear active DDP buffer members to NULL to pacify an assertion 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d4ad8432aa5791e3b1c352c7f1758d416b2405c6 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=d4ad8432aa5791e3b1c352c7f1758d416b2405c6 commit d4ad8432aa5791e3b1c352c7f1758d416b2405c6 Author: John Baldwin AuthorDate: 2024-03-20 22:28:43 +0000 Commit: John Baldwin CommitDate: 2024-04-08 18:06:53 +0000 ddp: Clear active DDP buffer members to NULL to pacify an assertion Reviewed by: np Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D43999 (cherry picked from commit 25429e274371eba9a90ea27cbf73e88329916e0d) --- sys/dev/cxgbe/tom/t4_ddp.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sys/dev/cxgbe/tom/t4_ddp.c b/sys/dev/cxgbe/tom/t4_ddp.c index 89cb7269e218..1cd1ea68826c 100644 --- a/sys/dev/cxgbe/tom/t4_ddp.c +++ b/sys/dev/cxgbe/tom/t4_ddp.c @@ -186,10 +186,17 @@ free_ddp_buffer(struct tom_data *td, struct ddp_buffer *db) */ if (!aio_clear_cancel_function(db->job)) ddp_complete_one(db->job, 0); +#ifdef INVARIANTS + db->job = NULL; +#endif } - if (db->ps) + if (db->ps) { free_pageset(td, db->ps); +#ifdef INVARIANTS + db->ps = NULL; +#endif + } } static void From nobody Mon Apr 8 20:25:37 2024 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 4VD0w227nqz5Hhw8; Mon, 8 Apr 2024 20:25: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 4VD0w21SZDz3xTL; Mon, 8 Apr 2024 20:25:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712607938; 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=fa8UErRYzsXy49zoXCs0BaTBq5ZHmIQDXELizyhaKUk=; b=nJNFszt7khZxysQ3qnrvjKy6eggRXEebLauJIQfkKcWOzfxIA4AE6BiU2jjE48/gQlXwG+ fyyF8YKqfox0EPejtnkiYOPrCiWF8pZobnxFX6NH7uy0BL6suD+IOjkuG2JxtiE9FNdhoE KIZTTAmp6IOfx8F1+6KMxgQLV5IXFP0evPecPtCV9EOn8Ty+NEVWjgtPxKNLm5erz1oA0d 5So5b+4nkADVYMV0OVmoceDhum4zadwpHIOZb4/FY1ZRQ7x5LDR7Rg7MX2YC47qWvEb1ol tDF8hBFjMaMAe+XxD9UZ3BSv+2HUbSsdxY8DY4A2maReXw4glM1VFIuIsHB24w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712607938; a=rsa-sha256; cv=none; b=U6OSXCsc+poe6X5ofblhWvpvye50bWdQgrpQIhUWQkW2iwXRp8eZctaOeJjMZPKj9CwNMJ LTNdY0N24JKmpbIfyE3H6bqHqSN6am6MxIX+vmP1nIDKvzGQABebVswt9N9xqBGFJhUhZc fGs/c1cXeIOCaZwNK+EgBziBqSRJbH26Q+B0UZBJidW8AMXTVNSgY8kyIvCIAiglhnNx1f c3SikMBAAIKSsS2Xnncp07AO3suR5AX4CxSQTVW8jrmX+WKMcQb2hI5pfFZmuS/qcaG6Nw VSBGE/JaYfbOYKGZgZBTqagLLTg0hmZJkhVaaGAaDvBCjHUvBTTeV+piNg0M/w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712607938; 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=fa8UErRYzsXy49zoXCs0BaTBq5ZHmIQDXELizyhaKUk=; b=Tq/vWF8Kq0/WZVHeHtLt0o4eQX8hGgbaQtw9flr6rCbjxRu/0ZFPhh8l1nW2fqavD5ptvy sN0Yh6uZ609lZ+Hf/CgwDp+SUEaThQqXxsQ8osMykhTcWi29UHNgVgZbDubbosVid6J5gQ 68eonGmk8/zakf/ui3y4TYR9wcTbZKQG0uL4QUHvEEKKw+4jS0CzmVbSGnMySSANZqtk0R VPffUm5UiAWAGdtDysJVybXTs8KXYmbfIIjyDakx7RSkFsw4bhLpzAxEqGyJYqW9UXV9v/ b8sAu/XctmfVZeiu8HPYCmnGA9D1EWAEZwbdw9O92ARzj2VzZPcfjjnuchwEIQ== 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 4VD0w20xGgzQDN; Mon, 8 Apr 2024 20:25:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 438KPbV9039331; Mon, 8 Apr 2024 20:25:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 438KPbdc039328; Mon, 8 Apr 2024 20:25:37 GMT (envelope-from git) Date: Mon, 8 Apr 2024 20:25:37 GMT Message-Id: <202404082025.438KPbdc039328@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 470de7a717fc - stable/13 - cd9660: Add support for mask,dirmask,uid,gid options 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 470de7a717fc1c5954f1196c1d10b96fd9f2d524 Auto-Submitted: auto-generated The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=470de7a717fc1c5954f1196c1d10b96fd9f2d524 commit 470de7a717fc1c5954f1196c1d10b96fd9f2d524 Author: Ricardo Branco AuthorDate: 2024-01-08 20:24:53 +0000 Commit: John Baldwin CommitDate: 2024-04-08 17:29:11 +0000 cd9660: Add support for mask,dirmask,uid,gid options Reviewed by: jhb Pull Request: https://github.com/freebsd/freebsd-src/pull/982 (cherry picked from commit 82f2275b73e556580b155ea9bbf7f7e364458fa1) --- sbin/mount_cd9660/mount_cd9660.8 | 37 ++++++++++++++++++- sbin/mount_cd9660/mount_cd9660.c | 79 ++++++++++++++++++++++++++++++++++++++-- sys/fs/cd9660/cd9660_mount.h | 7 ++++ sys/fs/cd9660/cd9660_vfsops.c | 23 ++++++++++++ sys/fs/cd9660/cd9660_vnops.c | 24 ++++++++++-- sys/fs/cd9660/iso.h | 5 +++ 6 files changed, 167 insertions(+), 8 deletions(-) diff --git a/sbin/mount_cd9660/mount_cd9660.8 b/sbin/mount_cd9660/mount_cd9660.8 index a31e6d833245..af417d4d025e 100644 --- a/sbin/mount_cd9660/mount_cd9660.8 +++ b/sbin/mount_cd9660/mount_cd9660.8 @@ -31,7 +31,7 @@ .\" .\" @(#)mount_cd9660.8 8.3 (Berkeley) 3/27/94 .\" -.Dd August 11, 2018 +.Dd January 2, 2024 .Dt MOUNT_CD9660 8 .Os .Sh NAME @@ -41,8 +41,12 @@ .Nm .Op Fl begjrv .Op Fl C Ar charset +.Op Fl G Ar gid +.Op Fl m Ar mask +.Op Fl M Ar mask .Op Fl o Ar options .Op Fl s Ar startsector +.Op Fl U Ar uid .Ar special node .Sh DESCRIPTION The @@ -68,6 +72,37 @@ Do not strip version numbers on files. only the last one will be listed.) In either case, files may be opened without explicitly stating a version number. +.It Fl G Ar group +Set the group of the files in the file system to +.Ar group . +The default gid on non-Rockridge volumes is zero. +.It Fl U Ar user +Set the owner of the files in the file system to +.Ar user . +The default uid on non-Rockridge volumes is zero. +.It Fl m Ar mask +Specify the maximum file permissions for files +in the file system. +(For example, a +.Ar mask +of +.Li 755 +specifies that, by default, the owner should have +read, write, and execute permissions for files, but +others should only have read and execute permissions). +See +.Xr chmod 1 +for more information about octal file modes. +Only the nine low-order bits of +.Ar mask +are used. +The default +.Ar mask +on non-Rockridge volumes is 755. +.It Fl M Ar mask +Specify the maximum file permissions for directories +in the file system. +See the previous option's description for details. .It Fl j Do not use any Joliet extensions included in the file system. .It Fl o diff --git a/sbin/mount_cd9660/mount_cd9660.c b/sbin/mount_cd9660/mount_cd9660.c index f867e94da417..253b9eb32540 100644 --- a/sbin/mount_cd9660/mount_cd9660.c +++ b/sbin/mount_cd9660/mount_cd9660.c @@ -58,8 +58,11 @@ static char sccsid[] = "@(#)mount_cd9660.c 8.7 (Berkeley) 5/1/95"; #include +#include #include #include +#include +#include #include #include #include @@ -74,6 +77,9 @@ static struct mntopt mopts[] = { MOPT_END }; +static gid_t a_gid(const char *); +static uid_t a_uid(const char *); +static mode_t a_mask(const char *); static int get_ssector(const char *dev); static int set_charset(struct iovec **, int *iovlen, const char *); void usage(void); @@ -94,7 +100,7 @@ main(int argc, char **argv) mntflags = verbose = 0; ssector = -1; - while ((ch = getopt(argc, argv, "begjo:rs:vC:")) != -1) + while ((ch = getopt(argc, argv, "begG:jm:M:o:rs:U:vC:")) != -1) switch (ch) { case 'b': build_iovec(&iov, &iovlen, "brokenjoliet", NULL, (size_t)-1); @@ -105,6 +111,15 @@ main(int argc, char **argv) case 'g': build_iovec(&iov, &iovlen, "gens", NULL, (size_t)-1); break; + case 'G': + build_iovec_argf(&iov, &iovlen, "gid", "%d", a_gid(optarg)); + break; + case 'm': + build_iovec_argf(&iov, &iovlen, "mask", "%u", a_mask(optarg)); + break; + case 'M': + build_iovec_argf(&iov, &iovlen, "dirmask", "%u", a_mask(optarg)); + break; case 'j': build_iovec(&iov, &iovlen, "nojoliet", NULL, (size_t)-1); break; @@ -124,6 +139,9 @@ main(int argc, char **argv) case 's': ssector = atoi(optarg); break; + case 'U': + build_iovec_argf(&iov, &iovlen, "uid", "%d", a_uid(optarg)); + break; case 'v': verbose++; break; @@ -187,8 +205,8 @@ void usage(void) { (void)fprintf(stderr, -"usage: mount_cd9660 [-begjrv] [-C charset] [-o options] [-s startsector]\n" -" special node\n"); +"usage: mount_cd9660 [-begjrv] [-C charset] [-G gid] [-m mask] [-M mask]\n" +" [-o options] [-U uid] [-s startsector] special node\n"); exit(EX_USAGE); } @@ -268,3 +286,58 @@ set_charset(struct iovec **iov, int *iovlen, const char *localcs) return (0); } + +static gid_t +a_gid(const char *s) +{ + struct group *gr; + const char *gname; + gid_t gid; + + if ((gr = getgrnam(s)) != NULL) + gid = gr->gr_gid; + else { + for (gname = s; *s && isdigit(*s); ++s); + if (!*s) + gid = atoi(gname); + else + errx(EX_NOUSER, "unknown group id: %s", gname); + } + return (gid); +} + +static uid_t +a_uid(const char *s) +{ + struct passwd *pw; + const char *uname; + uid_t uid; + + if ((pw = getpwnam(s)) != NULL) + uid = pw->pw_uid; + else { + for (uname = s; *s && isdigit(*s); ++s); + if (!*s) + uid = atoi(uname); + else + errx(EX_NOUSER, "unknown user id: %s", uname); + } + return (uid); +} + +static mode_t +a_mask(const char *s) +{ + int done, rv; + char *ep; + + done = 0; + rv = -1; + if (*s >= '0' && *s <= '7') { + done = 1; + rv = strtol(optarg, &ep, 8); + } + if (!done || rv < 0 || *ep) + errx(EX_USAGE, "invalid file mode: %s", s); + return (rv); +} diff --git a/sys/fs/cd9660/cd9660_mount.h b/sys/fs/cd9660/cd9660_mount.h index 99642603cc7a..97637f66ad93 100644 --- a/sys/fs/cd9660/cd9660_mount.h +++ b/sys/fs/cd9660/cd9660_mount.h @@ -42,6 +42,10 @@ struct iso_args { char *fspec; /* block special device to mount */ struct oexport_args export; /* network export info */ + uid_t uid; /* uid that owns ISO-9660 files */ + gid_t gid; /* gid that owns ISO-9660 files */ + mode_t fmask; /* file mask to be applied for files */ + mode_t dmask; /* file mask to be applied for directories */ int flags; /* mounting flags, see below */ int ssector; /* starting sector, 0 for 1st session */ char *cs_disk; /* disk charset for Joliet cs conversion */ @@ -53,3 +57,6 @@ struct iso_args { #define ISOFSMNT_NOJOLIET 0x00000008 /* disable Joliet Ext.*/ #define ISOFSMNT_BROKENJOLIET 0x00000010/* allow broken Joliet disks */ #define ISOFSMNT_KICONV 0x00000020 /* Use libiconv to convert chars */ + +#define ISOFSMNT_UID 0x00000100 /* override uid */ +#define ISOFSMNT_GID 0x00000200 /* override gid */ diff --git a/sys/fs/cd9660/cd9660_vfsops.c b/sys/fs/cd9660/cd9660_vfsops.c index 90a8996c9651..c3339438fcd8 100644 --- a/sys/fs/cd9660/cd9660_vfsops.c +++ b/sys/fs/cd9660/cd9660_vfsops.c @@ -107,6 +107,12 @@ cd9660_cmount(struct mntarg *ma, void *data, uint64_t flags) ma = mount_argsu(ma, "from", args.fspec, MAXPATHLEN); ma = mount_arg(ma, "export", &args.export, sizeof(args.export)); + if (args.flags & ISOFSMNT_UID) + ma = mount_argf(ma, "uid", "%d", args.uid); + if (args.flags & ISOFSMNT_GID) + ma = mount_argf(ma, "gid", "%d", args.gid); + ma = mount_argf(ma, "mask", "%d", args.fmask); + ma = mount_argf(ma, "dirmask", "%d", args.dmask); ma = mount_argsu(ma, "cs_disk", args.cs_disk, 64); ma = mount_argsu(ma, "cs_local", args.cs_local, 64); ma = mount_argf(ma, "ssector", "%u", args.ssector); @@ -223,6 +229,7 @@ iso_mountfs(devvp, mp) struct g_consumer *cp; struct bufobj *bo; char *cs_local, *cs_disk; + int v; dev = devvp->v_rdev; dev_ref(dev); @@ -392,6 +399,7 @@ iso_mountfs(devvp, mp) isomp->im_mountp = mp; isomp->im_dev = dev; isomp->im_devvp = devvp; + isomp->im_fmask = isomp->im_dmask = ACCESSPERMS; vfs_flagopt(mp->mnt_optnew, "norrip", &isomp->im_flags, ISOFSMNT_NORRIP); vfs_flagopt(mp->mnt_optnew, "gens", &isomp->im_flags, ISOFSMNT_GENS); @@ -399,6 +407,21 @@ iso_mountfs(devvp, mp) vfs_flagopt(mp->mnt_optnew, "nojoliet", &isomp->im_flags, ISOFSMNT_NOJOLIET); vfs_flagopt(mp->mnt_optnew, "kiconv", &isomp->im_flags, ISOFSMNT_KICONV); + if (vfs_scanopt(mp->mnt_optnew, "uid", "%d", &v) == 1) { + isomp->im_flags |= ISOFSMNT_UID; + isomp->im_uid = v; + } + if (vfs_scanopt(mp->mnt_optnew, "gid", "%d", &v) == 1) { + isomp->im_flags |= ISOFSMNT_GID; + isomp->im_gid = v; + } + if (vfs_scanopt(mp->mnt_optnew, "mask", "%d", &v) == 1) { + isomp->im_fmask &= v; + } + if (vfs_scanopt(mp->mnt_optnew, "dirmask", "%d", &v) == 1) { + isomp->im_dmask &= v; + } + /* Check the Rock Ridge Extension support */ if (!(isomp->im_flags & ISOFSMNT_NORRIP)) { if ((error = bread(isomp->im_devvp, (isomp->root_extent + diff --git a/sys/fs/cd9660/cd9660_vnops.c b/sys/fs/cd9660/cd9660_vnops.c index 4fee81eb76ea..9598ecdd7712 100644 --- a/sys/fs/cd9660/cd9660_vnops.c +++ b/sys/fs/cd9660/cd9660_vnops.c @@ -59,6 +59,7 @@ #include #include +#include #include static vop_setattr_t cd9660_setattr; @@ -134,6 +135,9 @@ cd9660_access(ap) struct vnode *vp = ap->a_vp; struct iso_node *ip = VTOI(vp); accmode_t accmode = ap->a_accmode; + accmode_t file_mode; + uid_t uid; + gid_t gid; if (vp->v_type == VCHR || vp->v_type == VBLK) return (EOPNOTSUPP); @@ -155,8 +159,16 @@ cd9660_access(ap) } } - return (vaccess(vp->v_type, ip->inode.iso_mode, ip->inode.iso_uid, - ip->inode.iso_gid, ap->a_accmode, ap->a_cred)); + file_mode = ip->inode.iso_mode; + file_mode &= (vp->v_type == VDIR) ? ip->i_mnt->im_dmask : ip->i_mnt->im_fmask; + + uid = (ip->i_mnt->im_flags & ISOFSMNT_UID) ? + ip->i_mnt->im_uid : ip->inode.iso_uid; + gid = (ip->i_mnt->im_flags & ISOFSMNT_GID) ? + ip->i_mnt->im_gid : ip->inode.iso_gid; + + return (vaccess(vp->v_type, file_mode, uid, + gid, ap->a_accmode, ap->a_cred)); } static int @@ -196,9 +208,13 @@ cd9660_getattr(ap) vap->va_fileid = ip->i_number; vap->va_mode = ip->inode.iso_mode; + vap->va_mode &= (vp->v_type == VDIR) ? ip->i_mnt->im_dmask : ip->i_mnt->im_fmask; + vap->va_nlink = ip->inode.iso_links; - vap->va_uid = ip->inode.iso_uid; - vap->va_gid = ip->inode.iso_gid; + vap->va_uid = (ip->i_mnt->im_flags & ISOFSMNT_UID) ? + ip->i_mnt->im_uid : ip->inode.iso_uid; + vap->va_gid = (ip->i_mnt->im_flags & ISOFSMNT_GID) ? + ip->i_mnt->im_gid : ip->inode.iso_gid; vap->va_atime = ip->inode.iso_atime; vap->va_mtime = ip->inode.iso_mtime; vap->va_ctime = ip->inode.iso_ctime; diff --git a/sys/fs/cd9660/iso.h b/sys/fs/cd9660/iso.h index ac3f61e56cc1..bf98e75c42d9 100644 --- a/sys/fs/cd9660/iso.h +++ b/sys/fs/cd9660/iso.h @@ -239,6 +239,11 @@ struct iso_mnt { struct g_consumer *im_cp; struct bufobj *im_bo; + uid_t im_uid; + gid_t im_gid; + mode_t im_fmask; + mode_t im_dmask; + int logical_block_size; int im_bshift; int im_bmask; From nobody Mon Apr 8 20:25:39 2024 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 4VD0w33crKz5HhsX; Mon, 8 Apr 2024 20:25: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 4VD0w31kvgz3xTM; Mon, 8 Apr 2024 20:25:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712607939; 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=N+ISLryvi4iE9WTb1xnV87fJvvFTTkFhaCU7A2vaojg=; b=H++4LB1+qF0bReQT5Phb/PYn918p3IVzU4G3unwVzinQ0i/jLtT06OXVhvQ4q+pYbR0wEf 4n1LJjArudSNggS/P324T8JOV9xnDpHJ6ar6LSwZnyA8IukV+lom5gG+bbjM3tn9jz2+sP WCSeptzt7pJR5ZA4i1pyY4UUZE8JQXlM8L82bUFNtD24jJbE9LRLDEjmLnvwnSWsL61ci3 GGM2YiQeddCGKd7kNy0bptj8qUfAvGDnF1Z/nC6tTqQjD1un/6R82V5h7/REw0xXL2xsI7 Ttk0w2E2g0LPze/D9jh3JH0+4EocqKuTy7wSiu4po8Tep1f+zzoeS1lNZJr84w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712607939; a=rsa-sha256; cv=none; b=HhtbEzumyPyLM+Gnt3Wo/6wMHWcTo/XKs7frdLZplDuj8Zh86g6/ZCzDlroSlIMhy2sbDp tTHRrEESSY8BI+wwGYxWRgpezekJL8akyk5d4uhoZSlsnq8iuprZU0MXqmTGu+UVFf3H2u A9ROhXep3I3RDiMVRVkBNl3HeNf/Prxi6acBVds63RdGx2b8vJSqu7u1HM/v9mWl9uZLSn BSgvvhEoeIsUh6qBkF4PlF4zYB8PgnFG32wIstxIht/q2DAuLWqf4JtlZDgqPRPWwnUQGC WOyKxZzRU2ZLVy2e8/HavXsQM9zVVGrPeDDkhpGQkrxUHQkBReDVwMM9xuzoUg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712607939; 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=N+ISLryvi4iE9WTb1xnV87fJvvFTTkFhaCU7A2vaojg=; b=aupZiwR8mPeBwXobwd6L9Tl+0mv60gzq7aweR6ZGhpdGtK1zjnEk7g8LVHoyJ3Gb5LSFW/ RHYh3qLpj6AKtX0FzT2QmTXlnCbs8CUNXxkjiNjFAgBz7BEPAuKBWELzhmQ+Wrz1WTfc/E PgQ4uWNjbrTEZBsiHVAQro+VMQn95euSQOIVIIeSfe8jkSGvPv/L3/46qNSTNP5SdskU60 Nw8H4ZQQ6tobhRKhgbTx40z0D5Ob0+N45YAgoNUHKFXTxpsMtZPQi2fHHw7HjjD/DenWog 0/MbjjlNgcToDM82g8ZE02HlZmtOdIEXtuaA4nHLJSa28lAd6Z3wDjoie/ixYg== 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 4VD0w31LN5zQGR; Mon, 8 Apr 2024 20:25:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 438KPd1w039382; Mon, 8 Apr 2024 20:25:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 438KPdvv039379; Mon, 8 Apr 2024 20:25:39 GMT (envelope-from git) Date: Mon, 8 Apr 2024 20:25:39 GMT Message-Id: <202404082025.438KPdvv039379@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 402c6c331d73 - stable/13 - riscv db_trace: Ensure trapframe pointer is suitably aligned. 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 402c6c331d73491e5cc711336a7ec23fcc87d03c Auto-Submitted: auto-generated The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=402c6c331d73491e5cc711336a7ec23fcc87d03c commit 402c6c331d73491e5cc711336a7ec23fcc87d03c Author: John Baldwin AuthorDate: 2023-08-22 04:00:26 +0000 Commit: John Baldwin CommitDate: 2024-04-08 17:29:34 +0000 riscv db_trace: Ensure trapframe pointer is suitably aligned. Suggested by: jrtc27 Reviewed by: jrtc27 Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D41534 (cherry picked from commit 7ccaf76a27f138bde3f2b162a9c8ebb6216c05bc) --- sys/riscv/riscv/db_trace.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/riscv/riscv/db_trace.c b/sys/riscv/riscv/db_trace.c index 00ec1a750e33..12972839c29d 100644 --- a/sys/riscv/riscv/db_trace.c +++ b/sys/riscv/riscv/db_trace.c @@ -84,7 +84,8 @@ db_stack_trace_cmd(struct thread *td, struct unwind_state *frame) struct trapframe *tf; tf = (struct trapframe *)(uintptr_t)frame->sp; - if (!kstack_contains(td, (vm_offset_t)tf, + if (!__is_aligned(tf, _Alignof(*tf)) || + !kstack_contains(td, (vm_offset_t)tf, sizeof(*tf))) { db_printf("--- invalid trapframe %p\n", tf); break; From nobody Mon Apr 8 20:25:40 2024 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 4VD0w44kXDz5Hj1d; Mon, 8 Apr 2024 20:25: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 4VD0w42lFyz3xL0; Mon, 8 Apr 2024 20:25:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712607940; 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=F13VIpALjRbYc5SuA/D0m+A8cpRWSgQdav02M/Xs+Gc=; b=I6m/UpxepXUh6qFb+XV0L3EWPQd+Tn0rmPgfLuRqKLYSWpTo4Icn0ZIh9XmszEWBUdNFMT VKW3ilEGRSzYk6Kk0s/u1yaFfuTaFjuJb2gnN1vo3xsARDQkrKtMbwMi23+/k7hkB+PJ2y W0EfMJyCaBIuyUsIfKSSAh2xfm4YBTFkcFjB0MbyaUjYHUdOtFx8K1/EuvTsmWIY8/pqem lfs3vD+x2P99/Km1f2TYx6XpYq2B4ikuFs2jFWPYyaZyVTutdSQfUISH8bNCk+3X58GP0k m3vVln/YLU3x3NxOvq4FoIHZ3HJnx7+/G8O9CmSBhF7YBVRiVJCRbnNX6Tfp7A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712607940; a=rsa-sha256; cv=none; b=ttUb2OKSCVOUhomZzafpKZ9XOUdFRUct/gxtXP4v5WRzCZTQHywmHylbAV/K7NTly+NYNX Nf+S07mL1IqELwbXdrvUuO45bVNV847QHyIiNlpk/0gU/CfnH4OxUyGVxzMFI5YJ7nPI3R RKHIZc/UE+a+s7WJylIzE3uEbDWutDFn+MwSzp4cIswc720BVkXJL69dCrYL6V7UmAqyuW t0b9198j9hGx60DIyiowrOQhYLhctFoYfFtHNc39FHYF2hamFhWwAlNOBc879s03yslzT8 lvy/4+iN7UBLo/tRf4ENNi2QJkkba/zw0b/3hwY4hUSDYarcmyTglFuGA4Yu8w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712607940; 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=F13VIpALjRbYc5SuA/D0m+A8cpRWSgQdav02M/Xs+Gc=; b=XI3TvWYd7g1YeygATeKcIa4J2Y74A8UUdlk87WwALS4y7DL1MlNOxrVOJno+vdO6JStdVN jMnhgWtPenPY4aq69j4xVlijNFwz4BAkkZltFNiz5ZQG7yWCw1mmcz4fiSM+WfXyIuzyd1 +o7HyFVKyWO85DgtmOFXZ5/fMRBCuRFF56tIIpbh460mRkuIvZb6b11lgY7UBgWuhYwNtK P4nmSCWz7+JGMVy5OqnVFQkXl+JvGRZ/XCTFQyDHej/b7f7ezgwyN85t8jF3PqWuQtJz7Z cv5Ae7PAiQt8Kpyql7Saxms9LY2qThJ3FZ8j6/vgkuyM1FwLSM8MN2jXEcFHow== 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 4VD0w42M4FzQRt; Mon, 8 Apr 2024 20:25:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 438KPeHI039424; Mon, 8 Apr 2024 20:25:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 438KPe4E039421; Mon, 8 Apr 2024 20:25:40 GMT (envelope-from git) Date: Mon, 8 Apr 2024 20:25:40 GMT Message-Id: <202404082025.438KPe4E039421@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 2bc1e37e1d83 - stable/13 - Stop using expressions in _Alignof() 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2bc1e37e1d83392e1552616d5c17f49d79e52eda Auto-Submitted: auto-generated The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=2bc1e37e1d83392e1552616d5c17f49d79e52eda commit 2bc1e37e1d83392e1552616d5c17f49d79e52eda Author: Minsoo Choo AuthorDate: 2024-01-12 23:37:53 +0000 Commit: John Baldwin CommitDate: 2024-04-08 17:30:09 +0000 Stop using expressions in _Alignof() _Alignof(expression) is a non-standard extension. This is not allowed in gnu11 and gnu17 which follow the C11 standard _Alignof(type). Reviewed by: arichardson, imp, jhb Fixes: 4a9cd9fc22d7 amd64 db_trace: Reject unaligned frame pointers Fixes: 7ccaf76a27f1 riscv db_trace: Ensure trapframe pointer is suitably aligned. Fixes: 638c68897fbd arm64 db_trace: Ensure trapframe pointer is suitably aligned. Differential Revision: https://reviews.freebsd.org/D43409 (cherry picked from commit 03d04bf49492fc70366e6d78194336a4122282a2) --- sys/amd64/amd64/db_trace.c | 3 ++- sys/riscv/riscv/db_trace.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/amd64/amd64/db_trace.c b/sys/amd64/amd64/db_trace.c index 87a0c2aec7bf..9706e65c64af 100644 --- a/sys/amd64/amd64/db_trace.c +++ b/sys/amd64/amd64/db_trace.c @@ -206,7 +206,8 @@ db_nextframe(db_addr_t *fp, db_addr_t *ip, struct thread *td) */ tf_addr = *fp + 16; - if (!__is_aligned(tf_addr, _Alignof(*tf)) || !INKERNEL(tf_addr)) { + if (!__is_aligned(tf_addr, _Alignof(struct trapframe)) || + !INKERNEL(tf_addr)) { db_printf("--- invalid trapframe %p\n", (void *)tf_addr); *ip = 0; *fp = 0; diff --git a/sys/riscv/riscv/db_trace.c b/sys/riscv/riscv/db_trace.c index 12972839c29d..148ad88b3ffb 100644 --- a/sys/riscv/riscv/db_trace.c +++ b/sys/riscv/riscv/db_trace.c @@ -84,7 +84,7 @@ db_stack_trace_cmd(struct thread *td, struct unwind_state *frame) struct trapframe *tf; tf = (struct trapframe *)(uintptr_t)frame->sp; - if (!__is_aligned(tf, _Alignof(*tf)) || + if (!__is_aligned(tf, _Alignof(struct trapframe)) || !kstack_contains(td, (vm_offset_t)tf, sizeof(*tf))) { db_printf("--- invalid trapframe %p\n", tf); From nobody Mon Apr 8 20:25:41 2024 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 4VD0w55DcHz5HhVX; Mon, 8 Apr 2024 20:25:41 +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 4VD0w53pr1z3xcN; Mon, 8 Apr 2024 20:25:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712607941; 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=iK+b7ItSQi+d+diM/BXhaZvtalgiDhIjH+Q6caIkAN8=; b=B6dEhFw78MdB9MVAj4sHhFltFwL7BaeeGb36niBO40jyfmefD0ewDCOg6+BdZa81h/fbEW aSUtMA9z7LgUyHnDrEpmxYZndbw0i5ECO7ezff7wj23LApwyc7qyJi+Y+iupphkQ7hTd6V KJOrdvb2+oZkRzvuJ3e2JiXyX6uGMQDlZLmADfvzptR36cUizg81rAptOiwf6B5F1v3LER xNy6V61s9t266UJWprkNiLcCYu+wIl/PYx9RfdyyGabeTYJuk36Vo9pUWydZXciVuvd8z+ tMTWCYZaIzI6wXGrYfvRpJDyrolNQNIZF4FDg7wbg7i8zsN+FIHz85zd17Forg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712607941; a=rsa-sha256; cv=none; b=Lnaxj2BWMGTgigj9fzK9o49LDCx47M6gLKhCcFBhjk2zNFhI4Z8b+8i5MPxUl6uup1yIvL nS12+GM8hu8kjH+n7MTbz8VfaRDzeq7C4WCq+nON5/n0uzdX3KNYujLiK94fDHawWQj7B7 vWr0xbtM5fcKNCPZ1qI0idhPY5Ykgt0wej9x8KxqdzX+38QCwqB9GZNx3vYzv6eoJNhsq8 YtKZBPM6vOhZZ43g0B6pOqeFClB/KB/YmYGfcd3013PWum15vOoe1RSCLhHTf3EqxMdlnt mxd2iUEYwP94nCnHMnhZgcgwfcFpt4e9J11CrQ5qenbMZxMmMMiFHkiIM/q6dw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712607941; 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=iK+b7ItSQi+d+diM/BXhaZvtalgiDhIjH+Q6caIkAN8=; b=GUtJ3fqZL9YnIrYWQHMXMTcLdea0Om06gLAQWOfY6nrxdEnKItZQpPGyvOgf5/iIeIW2mx lo9JPxxwN2jyunBLrH4dkh3e+J0GuJ69hqo5MzoCsxD+MOCKgPaufkWAMxgvPlaOaPFCWb w6/O9Bjg1r2QFgj0mab9bF63LMBo7mshJlSp/5SzyjsjIlEdJW4CZtEp9zh/AP2Xt1jNyK KRPlkbqHeLLPOGIIE2G/5lYojzyOjVbhXaV6cnamWl4Rlg6bDfk8on3FcpYqGb8oSaWLYb 5iUeL+zwWAfGqQ7iXFUamfN8IVmwnod+QisQb1zdYcQadoI3Js1jQNYtI4p1sQ== 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 4VD0w53QDszQc0; Mon, 8 Apr 2024 20:25:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 438KPfWl039484; Mon, 8 Apr 2024 20:25:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 438KPfhL039481; Mon, 8 Apr 2024 20:25:41 GMT (envelope-from git) Date: Mon, 8 Apr 2024 20:25:41 GMT Message-Id: <202404082025.438KPfhL039481@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 77afa8bc52fc - stable/13 - find: Allow '/' to be used with -perm for GNU 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 77afa8bc52fcfbf3960751fe8589171dfcc9f9bf Auto-Submitted: auto-generated The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=77afa8bc52fcfbf3960751fe8589171dfcc9f9bf commit 77afa8bc52fcfbf3960751fe8589171dfcc9f9bf Author: Ricardo Branco AuthorDate: 2024-01-15 18:35:27 +0000 Commit: John Baldwin CommitDate: 2024-04-08 17:33:29 +0000 find: Allow '/' to be used with -perm for GNU compatibility In 2005, Gnu find deprecated '+' as the leading character for the -perm argument, instead preferring '/' with the same meaning. Implement that behavior here, and document it in the man page. Reviewed by: imp, emaste Pull Request: https://github.com/freebsd/freebsd-src/pull/1060 (cherry picked from commit 2a121b97e9673ff37062c9fa026eee969940d2e2) --- usr.bin/find/find.1 | 19 ++++++++++++++++--- usr.bin/find/function.c | 2 +- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/usr.bin/find/find.1 b/usr.bin/find/find.1 index afa4c7ab8215..a73196180e7c 100644 --- a/usr.bin/find/find.1 +++ b/usr.bin/find/find.1 @@ -30,7 +30,7 @@ .\" .\" @(#)find.1 8.7 (Berkeley) 5/9/95 .\" -.Dd December 22, 2023 +.Dd January 15, 2024 .Dt FIND 1 .Os .Sh NAME @@ -759,7 +759,7 @@ Slashes .Pq Dq Li / are treated as normal characters and do not have to be matched explicitly. -.It Ic -perm Oo Cm - Ns | Ns Cm + Oc Ns Ar mode +.It Ic -perm Oo Cm - Ns | Ns Cm + Ns | Ns Cm / Oc Ns Ar mode The .Ar mode may be either symbolic (see @@ -788,11 +788,14 @@ are set in the file's mode bits. If the .Ar mode is preceded by a plus -.Pq Dq Li + , +.Pq Dq Li + this primary evaluates to true if any of the bits in the .Ar mode are set in the file's mode bits. +A slash +.Pq Dq Li / +is also accepted with the same meaning as plus for compatibility with GNU find. Otherwise, this primary evaluates to true if the bits in the .Ar mode @@ -1118,6 +1121,16 @@ option was inspired by the equivalent and .Xr sed 1 options. +.Pp +The +.Ic -perm +primary accepts a leading slash +.Pq Dq Li / +as an alias for a leading plus +.Pq Dq Li + +for its argument as an extension of +.St -p1003.1-2001 +to be compatible with GNU find. .Sh HISTORY A simple .Nm diff --git a/usr.bin/find/function.c b/usr.bin/find/function.c index d887c8479099..9c1fd4df8731 100644 --- a/usr.bin/find/function.c +++ b/usr.bin/find/function.c @@ -1343,7 +1343,7 @@ c_perm(OPTION *option, char ***argvp) if (*perm == '-') { new->flags |= F_ATLEAST; ++perm; - } else if (*perm == '+') { + } else if (*perm == '+' || *perm == '/') { new->flags |= F_ANY; ++perm; } From nobody Mon Apr 8 20:25:42 2024 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 4VD0w66yvmz5HhVY; Mon, 8 Apr 2024 20:25: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 4VD0w65430z3xL3; Mon, 8 Apr 2024 20:25:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712607942; 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=55CDWSemFPGF0glIv+qW4HFmdmfvLZQQMbHSpQBd5N0=; b=uY1VbdRpfSb2OuegNSIhtoqz/ljDybBNRbIuYqo3do5hIJ7Ed7NA8zr8E98Y6JeFsJVoc5 NnVyK8O5qIwLBZXryPc37DJQ4OgSMpwRW2jK1ZuGcELygfvoHFwfHyYTE0KfSPBpEWQjtt cKfhpTAiqQBGT8/AfyEB4b1CSpXF0s8CJqvxKDLjGJBoyJuHmc6iFsOAyysWNFM461Xwc9 Fg3mZg9wOlljQNyYsm6VJOl7ttQrc71DMtoCHW13jRdVXRE1YvDAITR15JaOqCH8hOTPUg ltFAmpj1MtBUS9wjkz4YThFxSIQDWB2EngD3lGukUwzn+Q1vED6OV/zcek34Tw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712607942; a=rsa-sha256; cv=none; b=yHGAQqBXL2GuhgzpnNotRgu7hVSH8QWLU5vNXeSFszv7zECtkgfaQlCgt6H5ERN/Dx9fkN kj+mC/B+E1psSldyVV6gUI399HCB7MMuqkezNeRCsI++90+GchLWM18DXrC5haq3d+w5fk KcsRhAYP2NvfxOPFaa0aLN55JzykBMDyQUEcQD9H5UpX2K7XBc0NoOnQBHtFaVi69sygtP Y4wZC0f+6LAXexuz5z8c5OvxzrAlDBYE3LpGi1oC9qVo8T4eKPsaduxO4Hgt58WglHkw9l NQ35N5RYl+JmuQwQp1X5PO8wDICzOamVNhKHC8kMlxcvEcD16PH+W7Of1d+t2w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712607942; 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=55CDWSemFPGF0glIv+qW4HFmdmfvLZQQMbHSpQBd5N0=; b=epr5co+VTuj24HS4xjf6EBU7sO705++azwN0vogDN6/VoGM1WJW2esIM39msrnEBbCD9jm pMKgepI+x5dDNndazyDgmmYkoIOnjjUCH4bqRYIXfv3QHwGds8O8yxSMhHN6Vi4djzzxSz 5l5RVe/xO91KnVH2vNq5FK0oMLXXRYYqN171fy/dxaivoR2P2KNx5QhapkQJ1vV+rLsJMP GfkG6IDoafAu0Bc9o8Dz4duPaL4AePMDhyOUvIo8qMrcqPfG4XCnxDkgjSoewZBntxL3AW qqDyGj17qmwKjQiBBXxAZauFiYY5F+YrohQZ0F8GymRaYxJ4DSAioNN5k1jQ+Q== 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 4VD0w64d62zQDP; Mon, 8 Apr 2024 20:25:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 438KPg9J039533; Mon, 8 Apr 2024 20:25:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 438KPg3Y039530; Mon, 8 Apr 2024 20:25:42 GMT (envelope-from git) Date: Mon, 8 Apr 2024 20:25:42 GMT Message-Id: <202404082025.438KPg3Y039530@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: aed5216e95e0 - stable/13 - find: Add -readable, -writable & -executable options 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: aed5216e95e0d028a46851f24cfef285452a7719 Auto-Submitted: auto-generated The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=aed5216e95e0d028a46851f24cfef285452a7719 commit aed5216e95e0d028a46851f24cfef285452a7719 Author: Ricardo Branco AuthorDate: 2024-01-21 19:53:05 +0000 Commit: John Baldwin CommitDate: 2024-04-08 17:34:21 +0000 find: Add -readable, -writable & -executable options Reviewed by: jhb, Mina Galić Pull Request: https://github.com/freebsd/freebsd-src/pull/1080 (cherry picked from commit e4b646ce16105efc943bc8ac2242a2220dfe18d8) --- usr.bin/find/extern.h | 3 +++ usr.bin/find/find.1 | 20 +++++++++++++++++++- usr.bin/find/function.c | 39 +++++++++++++++++++++++++++++++++++++++ usr.bin/find/option.c | 3 +++ 4 files changed, 64 insertions(+), 1 deletion(-) diff --git a/usr.bin/find/extern.h b/usr.bin/find/extern.h index 8c98a6d86bcd..3436f8cf07bf 100644 --- a/usr.bin/find/extern.h +++ b/usr.bin/find/extern.h @@ -88,6 +88,7 @@ exec_f f_delete; exec_f f_depth; exec_f f_empty; exec_f f_exec; +exec_f f_executable; exec_f f_expr; exec_f f_false; exec_f f_flags; @@ -109,11 +110,13 @@ exec_f f_print; exec_f f_print0; exec_f f_prune; exec_f f_quit; +exec_f f_readable; exec_f f_regex; exec_f f_size; exec_f f_sparse; exec_f f_type; exec_f f_user; +exec_f f_writable; extern int ftsoptions, ignore_readdir_race, isdepth, isoutput; extern int issort, isxargs; diff --git a/usr.bin/find/find.1 b/usr.bin/find/find.1 index a73196180e7c..def6a82d0a97 100644 --- a/usr.bin/find/find.1 +++ b/usr.bin/find/find.1 @@ -30,7 +30,7 @@ .\" .\" @(#)find.1 8.7 (Berkeley) 5/9/95 .\" -.Dd January 15, 2024 +.Dd January 21, 2024 .Dt FIND 1 .Os .Sh NAME @@ -467,6 +467,12 @@ if at least one invocation of returns a non-zero exit status, .Nm will return a non-zero exit status. +.It Ic -executable +Matches files which are executable by the current user. +This test makes use of the +.Xr access 2 +system call, and so can be fooled by NFS servers which do UID mapping (or root-squashing). +This is a GNU find extension. .It Ic -flags Oo Cm - Ns | Ns Cm + Oc Ns Ar flags , Ns Ar notflags The flags are specified using symbolic names (see .Xr chflags 1 ) . @@ -831,6 +837,12 @@ option was specified. Causes .Nm to terminate immediately. +.It Ic -readable +Matches files which are readable by the current user. +This test makes use of the +.Xr access 2 +system call, and so can be fooled by NFS servers which do UID mapping (or root-squashing). +This is a GNU find extension. .It Ic -regex Ar pattern True if the whole path of the file matches .Ar pattern @@ -927,6 +939,12 @@ is treated as a user ID. The same thing as .Ic -path , for GNU find compatibility. +.It Ic -writable +Matches files which are writable by the current user. +This test makes use of the +.Xr access 2 +system call, and so can be fooled by NFS servers which do UID mapping (or root-squashing). +This is a GNU find extension. .El .Sh OPERATORS The primaries may be combined using the following operators. diff --git a/usr.bin/find/function.c b/usr.bin/find/function.c index 9c1fd4df8731..d28c0edced9e 100644 --- a/usr.bin/find/function.c +++ b/usr.bin/find/function.c @@ -1813,3 +1813,42 @@ f_quit(PLAN *plan __unused, FTSENT *entry __unused) } /* c_quit == c_simple */ + +/* + * -readable + * + * File is readable + */ +int +f_readable(PLAN *plan __unused, FTSENT *entry) +{ + return (access(entry->fts_path, R_OK) == 0); +} + +/* c_readable == c_simple */ + +/* + * -writable + * + * File is writable + */ +int +f_writable(PLAN *plan __unused, FTSENT *entry) +{ + return (access(entry->fts_path, W_OK) == 0); +} + +/* c_writable == c_simple */ + +/* + * -executable + * + * File is executable + */ +int +f_executable(PLAN *plan __unused, FTSENT *entry) +{ + return (access(entry->fts_path, X_OK) == 0); +} + +/* c_executable == c_simple */ diff --git a/usr.bin/find/option.c b/usr.bin/find/option.c index c5b461f3389b..dc5e5003b3fb 100644 --- a/usr.bin/find/option.c +++ b/usr.bin/find/option.c @@ -80,6 +80,7 @@ static OPTION const options[] = { { "-empty", c_empty, f_empty, 0 }, { "-exec", c_exec, f_exec, 0 }, { "-execdir", c_exec, f_exec, F_EXECDIR }, + { "-executable", c_simple, f_executable, 0 }, { "-false", c_simple, f_false, 0 }, #if HAVE_STRUCT_STAT_ST_FLAGS { "-flags", c_flags, f_flags, 0 }, @@ -154,6 +155,7 @@ static OPTION const options[] = { // -printf { "-prune", c_simple, f_prune, 0 }, { "-quit", c_simple, f_quit, 0 }, + { "-readable", c_simple, f_readable, 0 }, { "-regex", c_regex, f_regex, 0 }, { "-samefile", c_samefile, f_inum, 0 }, { "-size", c_size, f_size, 0 }, @@ -163,6 +165,7 @@ static OPTION const options[] = { { "-uid", c_user, f_user, 0 }, { "-user", c_user, f_user, 0 }, { "-wholename", c_name, f_path, 0 }, + { "-writable", c_simple, f_writable, 0 }, { "-xdev", c_xdev, f_always_true, 0 }, // -xtype }; From nobody Mon Apr 8 20:25:43 2024 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 4VD0w829hwz5Hj1f; Mon, 8 Apr 2024 20:25: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 4VD0w75ct9z3xcn; Mon, 8 Apr 2024 20:25:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712607943; 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=iBJt46Cy0C37MeZqPsSRTsyxeNGxfymjnuYGZ9MNj5A=; b=IdxLE/oNDNYRdruHBXUhRTqgvGB081i7Tq310g1UHUcvnZGLtXletrxq7rCbFTNOrfIZTX 8UKhtbY5U2MC0nvIjXrY6Fh7sz632NraJm+Man02UpPkmK5KL0vEB5P3WP5ldNSgBFvaYi Pm9Fsgkmg0pERnZJcPqQ8f0bW7leehE4CCS6dExkqd04SWcLxM38QLIuHStt4rCism0aIz bxlBvUCD8HLVjixLl5ZIRI9pyuRfyQ7cV+5W0XYh0hBssAXc9ZBnsvo++StaobANqJkavC IVQVyMEjtsAUJsP/cKV12n59ndysFixGWa8HQyHWYNgMK3AengMMZz5eCoUAtg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712607943; a=rsa-sha256; cv=none; b=uacm+2PTcoOuCb7tf14tBJr5pfek13rD9Hdx4ZqT2JVIuSaCS03Cygd1jRRr71kso3N90x y9SeTIfhTvC5GPLwKNJI7nz545+1gWcjv9Xgi5C7rpVQj2lQITbj5OzExZfGAUPGqPyM55 dbLFVqVlW/q+x6CMsgn1G65ncG7Y6F1c3UeG++ke9r2vJ1T0NeCVQnledKJGn0g5rXiICz esjuYLBYY7DXZrLdKiO5qQvUWM1nnTohFhXCZDWVAFrABgM1l/WVosLb5x6XI8HABf38Ko X2ZP4q/5dpnlEJh4wvPSSKJkrKvui60A7uxMj1+lbnU3RgxgJt6GMaLYoG4WMg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712607943; 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=iBJt46Cy0C37MeZqPsSRTsyxeNGxfymjnuYGZ9MNj5A=; b=cxwFSRTcpf190nEZ5qbzElEJFYDYTv2hyCvtiEJi+D6rj0/JT9W2O392zdrZJsBvpmpH+N WlE/cGvODNNQhf526GtbncMwbwbeYeEz+TGGDTsKku6xTF1TAdxLfy82eDseqoWN6zVjZT jb0UTkAN0Pw136AuEjdmrd5ZAhQgunXUGBeA/FzSkvfzNKBYR4N12QcomRsP46/6YiuM/D DEC9l2USuSsJOc+tWbvjrSWVgMiWd/geZGDtPWw6paosRihPEnbwGz5bf9++Z2NikQnGaR BiKY8sKM5pGr1+Gn6x55v/qc0+so40X4Z155TA+h4rGg/h+3/lekrhFe5xdIYA== 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 4VD0w75CtRzQRv; Mon, 8 Apr 2024 20:25:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 438KPhSZ039573; Mon, 8 Apr 2024 20:25:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 438KPh6s039570; Mon, 8 Apr 2024 20:25:43 GMT (envelope-from git) Date: Mon, 8 Apr 2024 20:25:43 GMT Message-Id: <202404082025.438KPh6s039570@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: c680577ec993 - stable/13 - netlink.h: s/typeof/__typeof 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c680577ec993959cd6c76adcdc6b26930588e30b Auto-Submitted: auto-generated The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=c680577ec993959cd6c76adcdc6b26930588e30b commit c680577ec993959cd6c76adcdc6b26930588e30b Author: Lexi Winter AuthorDate: 2024-01-18 02:34:39 +0000 Commit: John Baldwin CommitDate: 2024-04-08 17:37:49 +0000 netlink.h: s/typeof/__typeof typeof() does not exist in -std=c99 mode and the relevant #define is only for _KERNEL, so use __typeof here instead. Reviewed by: jhb MFC after: 2 weeks Pull Request: https://github.com/freebsd/freebsd-src/pull/1070 (cherry picked from commit 4261507a5e3e73ef6f9535935d22785056954b19) --- sys/netlink/netlink.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netlink/netlink.h b/sys/netlink/netlink.h index 9e6beef96cc6..ffbeb0a9c3f9 100644 --- a/sys/netlink/netlink.h +++ b/sys/netlink/netlink.h @@ -194,7 +194,7 @@ enum nlmsgerr_attrs { #define NL_ITEM_OK(_ptr, _len, _hlen, _LEN_M) \ ((_len) >= _hlen && _LEN_M(_ptr) >= _hlen && _LEN_M(_ptr) <= (_len)) -#define NL_ITEM_NEXT(_ptr, _LEN_M) ((typeof(_ptr))((char *)(_ptr) + _LEN_M(_ptr))) +#define NL_ITEM_NEXT(_ptr, _LEN_M) ((__typeof(_ptr))((char *)(_ptr) + _LEN_M(_ptr))) #define NL_ITEM_ITER(_ptr, _len, _LEN_MACRO) \ ((_len) -= _LEN_MACRO(_ptr), NL_ITEM_NEXT(_ptr, _LEN_MACRO)) From nobody Mon Apr 8 20:25:47 2024 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 4VD0wC58xZz5Hj1l; Mon, 8 Apr 2024 20:25: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 4VD0wC1xkcz3xXG; Mon, 8 Apr 2024 20:25:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712607947; 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=182bSwF/SA0PmO8KqJ/OBMyfa6tbzdvNDH5e1Pdg50g=; b=a/vshnY3KSF0N0SbqrDanmS+2Jb+bU45dAX8bfSpYMzMBTuwT7/DASul2NMmwO3hH/JyRR V69LgK9W3Vxbet8eL8HP13NaNFwdg/W6vm8//XF4eDtSTtyvSOaGmP8AzU/Lx7h/1Lq4rb DGrxxx+yrGmXEUKLYUqnpyACCZhFGVQikd8Q+q3Pyfrg4cJONuBU1n3uDdnDRYEcUOmDDH m0Pyrraac+B7cAQTSwbPqgk0BPNXRR1g9E7rlUhLqfrBJyWkyPb79XAwICtu56kxUTcxP7 pSeHt2XU03Sixrvi0AtVCAE8nB6Jx93n+moeNN9Uh0NReCFeWO6pTPHsVRDyxg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712607947; a=rsa-sha256; cv=none; b=LH82W05r62lITNYg51WsOjkWPQu+KLirIpYluq3i6/m499R6lfQP5eTXQ01L53cLm/mie5 VbcEt2HGTcv0zQ9NbNMM50G4jIle1bTvc4kUkG5R+TGvgkFGywhTHQFNkSgw52yv/ywV8o jaxvlqUHf8swfq4Jz+X3IsHHcikSMk4MnEhKrlyx1F67ie/oZu+/OnaIMAJ5dz4B0H1X7O PZh9aXh2RphGEmk4Uqa7nyNfBGe5G2O1/7isCRo/gAIUZgSUHZuPZf2VmMros1je4p5rL0 yCEXt0cddMunO46QETiBEMkJNI76My5ID/Y3YW+S3NHI9O+KnHc0uWqXBE5VFg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712607947; 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=182bSwF/SA0PmO8KqJ/OBMyfa6tbzdvNDH5e1Pdg50g=; b=XgEhgI62FLha1IHd3p8diaWNa+ZuAZN9nfxA/R5Y11Twl4/+TQ5S9R1iSbHdRy6Koml/1f 4Y80hYgF12LTxFEiRRMGWvnJQ7KRm9xCpWY2tyfIq+J1zG3vToMybN2vaBf69D+My8f5eT 5dhecFt9WNfI57hxaIVLJlMfWxVPZVvqhXPxtQ8Bu9jVYG5Cy+KnHtOINwEEKHyahMQG72 K/NcVg/qA9ynDP8FjGe5TOzR+U246EK4eh3NZKTVDB/vxYNmdVZwp5JqI2vJWao5a3h8bu UGDvxU59/irNxuHofYhIwXIDEi6VWCn7ez50LfHuIpVIxlrJmUDvCBzjP4AFMw== 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 4VD0wC1YnNzQc1; Mon, 8 Apr 2024 20:25:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 438KPlqL039724; Mon, 8 Apr 2024 20:25:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 438KPlJe039721; Mon, 8 Apr 2024 20:25:47 GMT (envelope-from git) Date: Mon, 8 Apr 2024 20:25:47 GMT Message-Id: <202404082025.438KPlJe039721@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: d50a1d0ace9d - stable/13 - cxgbe: Add counters for POSIX async I/O requests handled by the driver 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d50a1d0ace9def06df655189c4030d77aec976cf Auto-Submitted: auto-generated The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=d50a1d0ace9def06df655189c4030d77aec976cf commit d50a1d0ace9def06df655189c4030d77aec976cf Author: John Baldwin AuthorDate: 2024-01-31 00:40:31 +0000 Commit: John Baldwin CommitDate: 2024-04-08 17:39:21 +0000 cxgbe: Add counters for POSIX async I/O requests handled by the driver Reviewed by: np Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D43668 (cherry picked from commit c3d4aea6c5bef0dcdc5194d4a828625f4d34a1dc) --- sys/dev/cxgbe/adapter.h | 4 ++++ sys/dev/cxgbe/t4_main.c | 4 ++++ sys/dev/cxgbe/t4_sge.c | 16 ++++++++++++++++ sys/dev/cxgbe/tom/t4_cpl_io.c | 6 +++++- sys/dev/cxgbe/tom/t4_ddp.c | 12 ++++++++++-- 5 files changed, 39 insertions(+), 3 deletions(-) diff --git a/sys/dev/cxgbe/adapter.h b/sys/dev/cxgbe/adapter.h index 1896596df737..f6e58dc976c1 100644 --- a/sys/dev/cxgbe/adapter.h +++ b/sys/dev/cxgbe/adapter.h @@ -690,6 +690,8 @@ struct sge_ofld_rxq { uint64_t rx_iscsi_padding_errors; uint64_t rx_iscsi_header_digest_errors; uint64_t rx_iscsi_data_digest_errors; + uint64_t rx_aio_ddp_jobs; + uint64_t rx_aio_ddp_octets; u_long rx_toe_tls_records; u_long rx_toe_tls_octets; } __aligned(CACHE_LINE_SIZE); @@ -756,6 +758,8 @@ struct sge_ofld_txq { counter_u64_t tx_iscsi_pdus; counter_u64_t tx_iscsi_octets; counter_u64_t tx_iscsi_iso_wrs; + counter_u64_t tx_aio_jobs; + counter_u64_t tx_aio_octets; counter_u64_t tx_toe_tls_records; counter_u64_t tx_toe_tls_octets; } __aligned(CACHE_LINE_SIZE); diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index cbf15b5270ff..98f27c466bdc 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -12190,6 +12190,8 @@ clear_stats(struct adapter *sc, u_int port_id) counter_u64_zero(ofld_txq->tx_iscsi_pdus); counter_u64_zero(ofld_txq->tx_iscsi_octets); counter_u64_zero(ofld_txq->tx_iscsi_iso_wrs); + counter_u64_zero(ofld_txq->tx_aio_jobs); + counter_u64_zero(ofld_txq->tx_aio_octets); counter_u64_zero(ofld_txq->tx_toe_tls_records); counter_u64_zero(ofld_txq->tx_toe_tls_octets); } @@ -12207,6 +12209,8 @@ clear_stats(struct adapter *sc, u_int port_id) ofld_rxq->rx_iscsi_ddp_octets = 0; ofld_rxq->rx_iscsi_fl_pdus = 0; ofld_rxq->rx_iscsi_fl_octets = 0; + ofld_rxq->rx_aio_ddp_jobs = 0; + ofld_rxq->rx_aio_ddp_octets = 0; ofld_rxq->rx_toe_tls_records = 0; ofld_rxq->rx_toe_tls_octets = 0; } diff --git a/sys/dev/cxgbe/t4_sge.c b/sys/dev/cxgbe/t4_sge.c index 3e15e1507f68..a6f77a2b7430 100644 --- a/sys/dev/cxgbe/t4_sge.c +++ b/sys/dev/cxgbe/t4_sge.c @@ -4217,6 +4217,12 @@ add_ofld_rxq_sysctls(struct sysctl_ctx_list *ctx, struct sysctl_oid *oid, return; children = SYSCTL_CHILDREN(oid); + SYSCTL_ADD_U64(ctx, children, OID_AUTO, "rx_aio_ddp_jobs", + CTLFLAG_RD, &ofld_rxq->rx_aio_ddp_jobs, 0, + "# of aio_read(2) jobs completed via DDP"); + SYSCTL_ADD_U64(ctx, children, OID_AUTO, "rx_aio_ddp_octets", + CTLFLAG_RD, &ofld_rxq->rx_aio_ddp_octets, 0, + "# of octets placed directly for aio_read(2) jobs"); SYSCTL_ADD_ULONG(ctx, children, OID_AUTO, "rx_toe_tls_records", CTLFLAG_RD, &ofld_rxq->rx_toe_tls_records, "# of TOE TLS records received"); @@ -4880,6 +4886,8 @@ alloc_ofld_txq(struct vi_info *vi, struct sge_ofld_txq *ofld_txq, int idx) ofld_txq->tx_iscsi_pdus = counter_u64_alloc(M_WAITOK); ofld_txq->tx_iscsi_octets = counter_u64_alloc(M_WAITOK); ofld_txq->tx_iscsi_iso_wrs = counter_u64_alloc(M_WAITOK); + ofld_txq->tx_aio_jobs = counter_u64_alloc(M_WAITOK); + ofld_txq->tx_aio_octets = counter_u64_alloc(M_WAITOK); ofld_txq->tx_toe_tls_records = counter_u64_alloc(M_WAITOK); ofld_txq->tx_toe_tls_octets = counter_u64_alloc(M_WAITOK); add_ofld_txq_sysctls(&vi->ctx, oid, ofld_txq); @@ -4918,6 +4926,8 @@ free_ofld_txq(struct vi_info *vi, struct sge_ofld_txq *ofld_txq) counter_u64_free(ofld_txq->tx_iscsi_pdus); counter_u64_free(ofld_txq->tx_iscsi_octets); counter_u64_free(ofld_txq->tx_iscsi_iso_wrs); + counter_u64_free(ofld_txq->tx_aio_jobs); + counter_u64_free(ofld_txq->tx_aio_octets); counter_u64_free(ofld_txq->tx_toe_tls_records); counter_u64_free(ofld_txq->tx_toe_tls_octets); free_wrq(sc, &ofld_txq->wrq); @@ -4945,6 +4955,12 @@ add_ofld_txq_sysctls(struct sysctl_ctx_list *ctx, struct sysctl_oid *oid, SYSCTL_ADD_COUNTER_U64(ctx, children, OID_AUTO, "tx_iscsi_iso_wrs", CTLFLAG_RD, &ofld_txq->tx_iscsi_iso_wrs, "# of iSCSI segmentation offload work requests"); + SYSCTL_ADD_COUNTER_U64(ctx, children, OID_AUTO, "tx_aio_jobs", + CTLFLAG_RD, &ofld_txq->tx_aio_jobs, + "# of zero-copy aio_write(2) jobs transmitted"); + SYSCTL_ADD_COUNTER_U64(ctx, children, OID_AUTO, "tx_aio_octets", + CTLFLAG_RD, &ofld_txq->tx_aio_octets, + "# of payload octets in transmitted zero-copy aio_write(2) jobs"); SYSCTL_ADD_COUNTER_U64(ctx, children, OID_AUTO, "tx_toe_tls_records", CTLFLAG_RD, &ofld_txq->tx_toe_tls_records, "# of TOE TLS records transmitted"); diff --git a/sys/dev/cxgbe/tom/t4_cpl_io.c b/sys/dev/cxgbe/tom/t4_cpl_io.c index fe9dd4477ab3..e8a78b5f6c1b 100644 --- a/sys/dev/cxgbe/tom/t4_cpl_io.c +++ b/sys/dev/cxgbe/tom/t4_cpl_io.c @@ -2189,6 +2189,7 @@ t4_aiotx_process_job(struct toepcb *toep, struct socket *so, struct kaiocb *job) struct inpcb *inp; struct tcpcb *tp; struct mbuf *m; + u_int sent; int error, len; bool moretocome, sendmore; @@ -2292,7 +2293,9 @@ sendanother: goto out; } - job->aio_sent += m_length(m, NULL); + sent = m_length(m, NULL); + job->aio_sent += sent; + counter_u64_add(toep->ofld_txq->tx_aio_octets, sent); sbappendstream(sb, m, 0); m = NULL; @@ -2339,6 +2342,7 @@ sendanother: * socket. */ aiotx_free_job(job); + counter_u64_add(toep->ofld_txq->tx_aio_jobs, 1); out: if (error) { diff --git a/sys/dev/cxgbe/tom/t4_ddp.c b/sys/dev/cxgbe/tom/t4_ddp.c index 9ed71ebcde79..ff63b25c4db0 100644 --- a/sys/dev/cxgbe/tom/t4_ddp.c +++ b/sys/dev/cxgbe/tom/t4_ddp.c @@ -319,8 +319,11 @@ insert_ddp_data(struct toepcb *toep, uint32_t n) placed = n; if (placed > job->uaiocb.aio_nbytes - copied) placed = job->uaiocb.aio_nbytes - copied; - if (placed > 0) + if (placed > 0) { job->msgrcv = 1; + toep->ofld_rxq->rx_aio_ddp_jobs++; + } + toep->ofld_rxq->rx_aio_ddp_octets += placed; if (!aio_clear_cancel_function(job)) { /* * Update the copied length for when @@ -560,6 +563,8 @@ handle_ddp_data(struct toepcb *toep, __be32 ddp_report, __be32 rcv_nxt, int len) CURVNET_RESTORE(); job->msgrcv = 1; + toep->ofld_rxq->rx_aio_ddp_jobs++; + toep->ofld_rxq->rx_aio_ddp_octets += len; if (db->cancel_pending) { /* * Update the job's length but defer completion to the @@ -724,8 +729,11 @@ handle_ddp_close(struct toepcb *toep, struct tcpcb *tp, __be32 rcv_nxt) placed = len; if (placed > job->uaiocb.aio_nbytes - copied) placed = job->uaiocb.aio_nbytes - copied; - if (placed > 0) + if (placed > 0) { job->msgrcv = 1; + toep->ofld_rxq->rx_aio_ddp_jobs++; + } + toep->ofld_rxq->rx_aio_ddp_octets += placed; if (!aio_clear_cancel_function(job)) { /* * Update the copied length for when From nobody Mon Apr 8 20:25:44 2024 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 4VD0w93M7Kz5Hhq5; Mon, 8 Apr 2024 20:25:45 +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 4VD0w86hp2z3xkW; Mon, 8 Apr 2024 20:25:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712607944; 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=bHXiVIZ9Tye6+qYA3ZsiCqqeDcbc24EEMTUj++qQ+xs=; b=vo7ef6KFuBbiv29lBsmMKcIqbE8lzSoZkIKqXEjnfkSi7e2RAYYKDoSBQrwIsyiXGshGic 55l4zjPxzVwc0F74Nr/fT0blhccdFXBQ1LsgTKIdkdQmFTvR/4+KnvEdRGhrAZ2M1rf10r ffIehCE9VALWKUYkTJgk4CGB/qqeRg7R4M7FG+qWYw9N46PMN4NEbz+LZZufNyuKGVgUWW RTEaSxUVU5q8Ugp6GBV1LWbTmOT2eqRfiMTrJDf9+xPeZKxUBBU1x8iNuznmrPTdOFwjNV EZgmmyg5VfZOtHK6LpfN8bu2CtAlyo94fGrLWJcAAe7TGGkSfWrbyU1Idb+KCg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712607944; a=rsa-sha256; cv=none; b=caGiqRUsA5DA5sWIQ4HjifBv24Hp7oMmyUzKHW3/Dxq+lxKqGl0YMr+h/WS9VyodqVAab+ 9ubqw815KnvEfbrOXGdJViMfQaO3pH8dexuVEj0Yd56wwEkYNlzhjP48o005fZ31ozLxlz YmfANLGd58zEaZVr9CEX2MZTulBgLL7+zIu3VEVDdJi5h93riUrbPmR4ujV+jj1zDxJbTL M3R4trfOAPsN5dfjfunoXUWeHMmokeUvzuYjhX/t14z8friuvGfiaJSmgz63CuJyc7qb9c c+QYDEfeZyD6RZauW5rb+TPbNgZx42Cyh4mwKI8iDJJVAhwnx8RqamvwfIJVQw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712607944; 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=bHXiVIZ9Tye6+qYA3ZsiCqqeDcbc24EEMTUj++qQ+xs=; b=AozRcmM9dDZVQtmsn0EXd1qRYdkT1T+ndQs+kJKSn8OoV5j/vhFABk9dWbtHVoMFno27xh iDGcgxTXFLXpAbIROt5xQ1qoTPXv5948+j0+KKfYdFDhNvAbzskXxA5NiidDsfAHZnP6vx TCIZGWHpwOvQT7tmHfL7WnyyJORDFv9Xrpw6NXbknHHYC20VcMuBqHGIvhDkIct4MaXn8M JpC/FeTlN/0Rp2QRkXvb1eC01NF3bRAGDbuNBfXSudHJMJk/K4TTxGVxgUCcwxEA+wMgLZ tbDMCMvTIqzWnyBiJ4yMgIOsq/vPA6w83CpBH7iFDvWoGLEaLssJAT33uSFaLg== 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 4VD0w86HsSzQRw; Mon, 8 Apr 2024 20:25:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 438KPiWR039619; Mon, 8 Apr 2024 20:25:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 438KPiU6039616; Mon, 8 Apr 2024 20:25:44 GMT (envelope-from git) Date: Mon, 8 Apr 2024 20:25:44 GMT Message-Id: <202404082025.438KPiU6039616@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 975afd9c44a8 - stable/13 - newfs_msdos.8: example for specific cluster size 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 975afd9c44a847e01308a089a59daf1a77438109 Auto-Submitted: auto-generated The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=975afd9c44a847e01308a089a59daf1a77438109 commit 975afd9c44a847e01308a089a59daf1a77438109 Author: Alexander Ziaee AuthorDate: 2024-01-12 22:12:48 +0000 Commit: John Baldwin CommitDate: 2024-04-08 17:38:02 +0000 newfs_msdos.8: example for specific cluster size The usual use case in 2024 for newfs_msdosfs is creating filesystems on SD cards for older hardware. In most tutorials, they call the cluster size "allocation size". Therefore, add a small note next to cluster size that it is also called allocation size, and add an example for how to do this. Reviewed by: jhb Pull Request: https://github.com/freebsd/freebsd-src/pull/1045 (cherry picked from commit c8bf9f09ee3d5ac97d38218f2123893a7f1f0285) --- sbin/newfs_msdos/newfs_msdos.8 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sbin/newfs_msdos/newfs_msdos.8 b/sbin/newfs_msdos/newfs_msdos.8 index 278612548dc4..efa69c058453 100644 --- a/sbin/newfs_msdos/newfs_msdos.8 +++ b/sbin/newfs_msdos/newfs_msdos.8 @@ -23,7 +23,7 @@ .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd June 14, 2018 +.Dd January 12, 2024 .Dt NEWFS_MSDOS 8 .Os .Sh NAME @@ -134,7 +134,7 @@ File system block size (bytes per cluster). This should resolve to an acceptable number of sectors per cluster (see below). .It Fl c Ar cluster-size -Sectors per cluster. +Sectors per cluster, also called allocation size. Acceptable values are powers of 2 in the range 1 through 128. If the block or cluster size are not specified, the code @@ -224,6 +224,12 @@ Create a file system, using default parameters, on newfs_msdos /dev/ada0s1 .Ed .Pp +Create a FAT32 filesystem with a 32K allocation size on +.Pa /dev/mmcsd0s1 : +.Bd -literal -offset indent +newfs_msdos -F 32 -A -c 64 /dev/mmcsd0s1 +.Ed +.Pp Create a standard 1.44M file system, with volume label .Ar foo , on From nobody Mon Apr 8 20:25:45 2024 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 4VD0wC06Scz5Hhq6; Mon, 8 Apr 2024 20:25: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 4VD0wB3rRPz3xsw; Mon, 8 Apr 2024 20:25:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712607946; 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=nss3J//UzyX9RUcfskAkQFLZq0LInsWNejvypSYFk8k=; b=JVnRupAI/3pLtxTKZzLKUQOmAm/Jaw3eDsoF6khNgQrn8CfWS6drx76tLcQFkhyjDBI73N INvtHXOz2572DQ7/G4DBXz8zlLZ3HZcRLWJe9L3kxBXPdPjecY78V/NtU1gIdTTbvHOv8N GtNvFl/cNVV1mNvtvRqPcHhO/OMVplGGuUj+zuw3yeVyKARONy2doRmT6eSObU4VQucJjh 1GsHzsggKi/JErwiUvdw+pjw4D1MqpPrwXA3wC3tWBLmjsVdODAMxExuQiNJ8i4uAbY0TH Gm0DZdKRpmukzr6ti8xewWaSPNayuU5otVxiHNJ3YtWocOCY7l6PFgr236t14Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712607946; a=rsa-sha256; cv=none; b=c0CdBNciWsDnnMu764BTRE98l5BRTJRZUipsl55js0tA4wlIlWJ2p+VlHDCtbrFMuII9JG mQ0HSaKVRi3CvTh8cx/nIqf7uEdu360BYIUKewf3ljEcxfm/QnAnvgbhiBysjVGb0q7Jjk HlsL0EZkQ37iwPtYTRlSp7WzpqI60KLx5FqmXF2rvFY8y3IdhUBadhP4vh4qwWrP0HEW7p +J6RfZElb89k/TX8Fh3ualHDg5JHSSyhCYMfsC/dj2IiLf2YiM9teCW/RJbY3RsFhH4JbW JPEp0FLJk6YYCCQWtJ6yiegR8+ICV5HHiDrr+h5R53Fyhy5KmwH7R6xn86m4oA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712607946; 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=nss3J//UzyX9RUcfskAkQFLZq0LInsWNejvypSYFk8k=; b=yVnxqWFDMskiIxORdmzmVtOIcaZ3bK+FWf1egTLLtxdIgUV98uQPcl4qVEZqNo1pJrQh81 t/vsc4vEkewTg8wNfuyrh3W1KadK7ZleE9EG6jbR3njijkaQSAh1B8z1r+9b+O02EuD+mz HXaWdHHZ6JuYV0omvJ7OTxsWdspaAL3rayVSFiTDBxexhlWok9wtKT8AtAc6619QyPdwTK WIDy0LLi2E2lFcmTjRH2ylsNbY5ns7uMMlvvcjf7fiTBJsxvUFbcdZXQ6R2pMj+x8WNiWc Ss3KW10HNTbh6cemQb70ge15jhNjLir0+krZvfWIAplEAFrhP9wv+kRe+nKbSg== 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 4VD0wB0HFpzPm9; Mon, 8 Apr 2024 20:25:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 438KPjSB039661; Mon, 8 Apr 2024 20:25:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 438KPjNJ039658; Mon, 8 Apr 2024 20:25:45 GMT (envelope-from git) Date: Mon, 8 Apr 2024 20:25:45 GMT Message-Id: <202404082025.438KPjNJ039658@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: dff5ad136163 - stable/13 - syscallsubr.h: Sort kern_membarrier prototype alphabetically 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: dff5ad136163d8d1114fb96a6b6ea249bc04215c Auto-Submitted: auto-generated The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=dff5ad136163d8d1114fb96a6b6ea249bc04215c commit dff5ad136163d8d1114fb96a6b6ea249bc04215c Author: John Baldwin AuthorDate: 2024-01-31 00:38:29 +0000 Commit: John Baldwin CommitDate: 2024-04-08 17:38:50 +0000 syscallsubr.h: Sort kern_membarrier prototype alphabetically (cherry picked from commit 14505c92bc8ca56d4c8a09072d043642f5e87ed7) --- sys/sys/syscallsubr.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/sys/syscallsubr.h b/sys/sys/syscallsubr.h index c0ae30dff3c7..4710c3cf1406 100644 --- a/sys/sys/syscallsubr.h +++ b/sys/sys/syscallsubr.h @@ -198,13 +198,13 @@ int kern_lseek(struct thread *td, int fd, off_t offset, int whence); int kern_lutimes(struct thread *td, const char *path, enum uio_seg pathseg, struct timeval *tptr, enum uio_seg tptrseg); int kern_madvise(struct thread *td, uintptr_t addr, size_t len, int behav); +int kern_membarrier(struct thread *td, int cmd, unsigned flags, + int cpu_id); int kern_mincore(struct thread *td, uintptr_t addr, size_t len, char *vec); int kern_minherit(struct thread *td, uintptr_t addr, size_t len, int inherit); int kern_mkdirat(struct thread *td, int fd, const char *path, enum uio_seg segflg, int mode); -int kern_membarrier(struct thread *td, int cmd, unsigned flags, - int cpu_id); int kern_mkfifoat(struct thread *td, int fd, const char *path, enum uio_seg pathseg, int mode); int kern_mknodat(struct thread *td, int fd, const char *path, From nobody Mon Apr 8 20:25:49 2024 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 4VD0wG0J4xz5HhVm; Mon, 8 Apr 2024 20:25: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 4VD0wF4Q0sz3xqx; Mon, 8 Apr 2024 20:25:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712607949; 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=ZWLGOUXu1LGCPNjO/EIpvsN8FUupuwf4e8pBCnjG+Ms=; b=eZD3f5HUCHXHIAsRFSBTUZEBxcdEm/Nd87XlLrdMM1A4JMlI8GJnxzM0Syq41YFMH5/PmW 19Ejxx7Yru7p3KXl7yB7D6YFi8TSbnuhhW8PDL63F2IBxOZD8s+Nr6A6WuzQMVJt7aPWiE Yqn/ZCTtLSUo78redHM6BWZONMOes2CbKtIMh1VDKDV3zCJ1XxzrzSp9YguNi00JnhA+oC lw2jSKxvT04pOPxgZ1W6xUq5W2FWfpDbrJ7mMokoggKPzLJKYujHe7WrQO1WuZq4YZTFuE t15oYWCg81S/YK/4O701yR6yaXJX1gkQp/oPcKhSNEyNPcMwE2RMT8UoIGUiTA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712607949; a=rsa-sha256; cv=none; b=kj/u8K8GsLIK8rntN53F4rGeRQXcIdAqWvT+Q2eVEs2qc0mlD3B0QkeRy+xra+Vc/jadIk bz1+eSZbTo2WRQHvxLSJalsCw8AiPL8x1G9AW5g9guSmLwpAg/3Qh1fEo7h2LdgLxsNA1M ajfVqKOCzK1LnICbVJXSI+WsOj/GLiNAS1+fZ2vtB1U8T1WwXwsknz/ekPLomGAnuy+WuU k3SNaBrcS36jaZec90tR1Uk24VEsEICZYk7gm1E09TphmASqv/NqFmZRimqeqKuWuxbcT0 LGHLBfUjaOywoJ1hHAa50k2wu2wxpXrydIFJp/VdJ8dpUe7dPRz4hn96MBirsQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712607949; 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=ZWLGOUXu1LGCPNjO/EIpvsN8FUupuwf4e8pBCnjG+Ms=; b=eU42WELtpliT4gIG53YyWCZoRmxrTvADkVI83Deo1o8Jf1fFabbUCkMYyq96+zlUx/hgYx 0IUQ9l3dlhqc93IKdMRSEdPzX2FI/V/aannHuUeyxDOSDTHWdN9AiD+WI+IWQ+t/pGVTSr nSL/cG4FdZnoNEqc8iEWWyXfV7Bo5+DGhcKD3kiCNloIoMEc86a0BBDBj079jS/XVNCmp5 F/SNEJ+RUVFNG7ZoO4cdwCmMHw1tmCmgtgp/8wLyYf6fLCkBJ5CEWEZoKW/xfehn5VCxXv HqadTXKFxwYSC22mHBa4oXx8muyKDxHoxuo/tcZvMykxCS5RYtGS+wtnSqKI8w== 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 4VD0wF3hf5zQcV; Mon, 8 Apr 2024 20:25:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 438KPnJu039834; Mon, 8 Apr 2024 20:25:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 438KPn2c039831; Mon, 8 Apr 2024 20:25:49 GMT (envelope-from git) Date: Mon, 8 Apr 2024 20:25:49 GMT Message-Id: <202404082025.438KPn2c039831@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: b61c6451631f - stable/13 - pcib: Make various bus methods private to pci_pci.c 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b61c6451631ff2341e1f29a6eedee107319b44fe Auto-Submitted: auto-generated The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=b61c6451631ff2341e1f29a6eedee107319b44fe commit b61c6451631ff2341e1f29a6eedee107319b44fe Author: John Baldwin AuthorDate: 2024-02-09 18:27:45 +0000 Commit: John Baldwin CommitDate: 2024-04-08 17:52:54 +0000 pcib: Make various bus methods private to pci_pci.c These functions are not used by pcib subclasses so do not need to be exposed in pcib_private.h. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D43688 (cherry picked from commit 03719c651430d46cd8aa95aead02a7f0c43dcb04) --- sys/dev/pci/pci_pci.c | 18 +++++++++++++----- sys/dev/pci/pcib_private.h | 10 ---------- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/sys/dev/pci/pci_pci.c b/sys/dev/pci/pci_pci.c index dccc1dabb59b..9e90cccdf083 100644 --- a/sys/dev/pci/pci_pci.c +++ b/sys/dev/pci/pci_pci.c @@ -60,6 +60,15 @@ static int pcib_probe(device_t dev); static int pcib_suspend(device_t dev); static int pcib_resume(device_t dev); + +static bus_child_present_t pcib_child_present; +static bus_alloc_resource_t pcib_alloc_resource; +#ifdef NEW_PCIB +static bus_adjust_resource_t pcib_adjust_resource; +static bus_release_resource_t pcib_release_resource; +#endif +static int pcib_reset_child(device_t dev, device_t child, int flags); + static int pcib_power_for_sleep(device_t pcib, device_t dev, int *pstate); static int pcib_ari_get_id(device_t pcib, device_t dev, @@ -81,7 +90,6 @@ static void pcib_pcie_dll_timeout(void *arg, int pending); #endif static int pcib_request_feature_default(device_t pcib, device_t dev, enum pci_feature feature); -static int pcib_reset_child(device_t dev, device_t child, int flags); static device_method_t pcib_methods[] = { /* Device interface */ @@ -2272,7 +2280,7 @@ updatewin: * We have to trap resource allocation requests and ensure that the bridge * is set up to, or capable of handling them. */ -struct resource * +static struct resource * pcib_alloc_resource(device_t dev, device_t child, int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) { @@ -2361,7 +2369,7 @@ pcib_alloc_resource(device_t dev, device_t child, int type, int *rid, return (r); } -int +static int pcib_adjust_resource(device_t bus, device_t child, int type, struct resource *r, rman_res_t start, rman_res_t end) { @@ -2429,7 +2437,7 @@ pcib_adjust_resource(device_t bus, device_t child, int type, struct resource *r, return (rman_adjust_resource(r, start, end)); } -int +static int pcib_release_resource(device_t dev, device_t child, int type, int rid, struct resource *r) { @@ -2452,7 +2460,7 @@ pcib_release_resource(device_t dev, device_t child, int type, int rid, * We have to trap resource allocation requests and ensure that the bridge * is set up to, or capable of handling them. */ -struct resource * +static struct resource * pcib_alloc_resource(device_t dev, device_t child, int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) { diff --git a/sys/dev/pci/pcib_private.h b/sys/dev/pci/pcib_private.h index cf689026a033..d4c66407d739 100644 --- a/sys/dev/pci/pcib_private.h +++ b/sys/dev/pci/pcib_private.h @@ -174,19 +174,9 @@ void pcib_bridge_init(device_t dev); #ifdef NEW_PCIB const char *pcib_child_name(device_t child); #endif -int pcib_child_present(device_t dev, device_t child); int pcib_detach(device_t dev); int pcib_read_ivar(device_t dev, device_t child, int which, uintptr_t *result); int pcib_write_ivar(device_t dev, device_t child, int which, uintptr_t value); -struct resource *pcib_alloc_resource(device_t dev, device_t child, int type, int *rid, - rman_res_t start, rman_res_t end, - rman_res_t count, u_int flags); -#ifdef NEW_PCIB -int pcib_adjust_resource(device_t bus, device_t child, int type, - struct resource *r, rman_res_t start, rman_res_t end); -int pcib_release_resource(device_t dev, device_t child, int type, int rid, - struct resource *r); -#endif int pcib_maxslots(device_t dev); int pcib_maxfuncs(device_t dev); int pcib_route_interrupt(device_t pcib, device_t dev, int pin); From nobody Mon Apr 8 20:25:48 2024 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 4VD0wD43ZZz5Hhyc; Mon, 8 Apr 2024 20:25: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 4VD0wD30NCz3xlH; Mon, 8 Apr 2024 20:25:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712607948; 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=Ge4EjZ+N1FhahyLQgDOfWTfNyx+MoJNkLL29ad+J5k0=; b=ReVmY9E+gHNjHglKms4JcOpn1KDnhVFDQey0Qb8y/b3DTdmCgpjsNl4kdayrPg8USfKL+G YiKjGPsbdFm/9DheqD7wNyLbzIHviuUTa9R1+jvbeSHn+fQ/+6uOtdTRH8OKDG8WSE5tx1 8+PtIJ0jQ9zz/x71XRh1NMn73cs5MXdBCbrU6pKNIghLqkXMZRIH5e4iBsgctRRmeWLB3w O5iC3LLNY9nvlUCzi4gUzqg7sFdwrDzlWHn/QThYsSRDwQg8M0UMgFOEmHlNZJUrsw7k+Q eMg9b/5itRoFgGGCsKTk1L8538CQRiLR6Ulg492ETV5uFhpDxyeETuMhJOicCQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712607948; a=rsa-sha256; cv=none; b=PauIETGrOvoyxwkbRdKSuMztqmzFWcIdzoAdrpi4p+FfIXr9a6A5a6dBWzuw3E2rK60ECr oeYjFUAr9Dl5EVsl5ZWHkb5QBn++fb+JB+AhQHPCG4KznMJWn7LBEFvRPXBSxFEQL//Gp6 uwPLbY5jYUhZxvEmawuHrfysgVC5pcZ4vyOv5YicF4dtLYVuG+s9KEohAy+837Rsx/jmxM jQDfzWTXip/Vw/CCAaqrtcXbmdFxkDoygxeI5JMkl9nzCrEJCwSUMNMwBbxRr/yt85MdI8 Sl3/u8WsawLBYcBc+YkE6+o27x+10Fy3CqpGkI7KbBZibYP257v2HTAFXnuHdw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712607948; 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=Ge4EjZ+N1FhahyLQgDOfWTfNyx+MoJNkLL29ad+J5k0=; b=WShnlSooB+sXZ6ubIDb6X/wkC3FD/yoAa4DwuW3a+MkYAr5MIvUAZ4XvinNMwW3ibNPGPb rHrteP0c9O0N2CXsayWRlr80rD7CT2ciw+sFQDiITsNaz69fmwE6kXIk2EcEpJfk84Kjs2 Kc/wIEOgBIL53KXpwaQsTx3BV9wSsKg9BKyEkaiVxK2uCFuYo3jjYsikuV27xfCh85CJZh mkk9nF8KRV7svxue8tmR1fpClF9dTD0bW6jwgi4T5/9484jdc5DmuPz9CZBi7v/u+Nb7qm Jh4zDPxff8zAaCtN9Rr+VarocBUDWPWYQ7ZUcIYrvlzBGKrEpVA0C9mObpUiGA== 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 4VD0wD2ckczQGS; Mon, 8 Apr 2024 20:25:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 438KPmWO039778; Mon, 8 Apr 2024 20:25:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 438KPmL2039775; Mon, 8 Apr 2024 20:25:48 GMT (envelope-from git) Date: Mon, 8 Apr 2024 20:25:48 GMT Message-Id: <202404082025.438KPmL2039775@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: db522f6bd041 - stable/13 - arm: pmap_extract() returns a PA not a boolean value 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: db522f6bd04120a5d0b981398efa73555a098ad0 Auto-Submitted: auto-generated The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=db522f6bd04120a5d0b981398efa73555a098ad0 commit db522f6bd04120a5d0b981398efa73555a098ad0 Author: John Baldwin AuthorDate: 2024-02-02 22:59:03 +0000 Commit: John Baldwin CommitDate: 2024-04-08 17:50:38 +0000 arm: pmap_extract() returns a PA not a boolean value Assume a PA of 0 indicates an invalid virtual address. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D43694 (cherry picked from commit afb1a3e30c05a0f69facff7df59547ec82e3531a) --- sys/arm/arm/db_interface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/arm/arm/db_interface.c b/sys/arm/arm/db_interface.c index 174d0a7d5cc7..8802cce1d81b 100644 --- a/sys/arm/arm/db_interface.c +++ b/sys/arm/arm/db_interface.c @@ -172,7 +172,7 @@ db_validate_address(vm_offset_t addr) else pmap = p->p_vmspace->vm_map.pmap; - return (pmap_extract(pmap, addr) == FALSE); + return (pmap_extract(pmap, addr) == 0); } /* From nobody Mon Apr 8 20:25:50 2024 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 4VD0wH0MLfz5HhwP; Mon, 8 Apr 2024 20:25:51 +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 4VD0wG4lTLz3xm4; Mon, 8 Apr 2024 20:25:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712607950; 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=xlcxW7ulWajVW9prRYUa5kCQ+GzCsfxH9ZSVxma1YUg=; b=NHcGh0RjNp00mLwJdYKYXKlL0xGXSJVgP2kCQFK5PyzvOQ4vS+EbcD1a+ynLLU1AH/UoOm u/bJnyX32gquvF7WeIgn3zBjyUbp9tHtpv3tcJnHZpypOQHRW2WFIMuopZ0REewL0xWAGM L2VgbAfHqPfS9VQBbZpSUK/88p6OGzqt/pD+R4gdPAJDnJkqBDFYw5Gswh5k4OnM9q66Iz zMV/z7z8UfcTXAM9AYcKyR46BQ2WeOtOkJUBOaEM9a17xbgPMuJIGGK2FMt8mhShUQYnRM FR4HGOrcAM3UA46xtNcybXqgWksLmWAgbIoUpdpDxKG0jWYjOBARZuDR/JhaBw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712607950; a=rsa-sha256; cv=none; b=yQJ8q/QTx4NPadHa37zYKa3HOhxyF4+Eiup6BsdJMD5RbC++s+x6SeTeJ6fbeiINOjnItb Lbm8PE6+nUc49f6lcJqth27xVilsKeZcR9GXzeFjR3EsoBxm9Fihg/hKw4IrrqcSNp7Dcu ce/2zuiUKLTf5ewkdsmcUqaZ5TMFEHVJuIQEcx9+FaMBg65ZjKzNFWgN+Ucb2qdJ0jG5OL KjlXCI7d+hg+OHtw3XM/ia0gOJuab0qETvHexjSD6IMNKjUdKwXFXwi6nedi5oGZQbyoPk WDFa4I/DvxIjq26QluC3NLyCNTJ+XzmpPvKMvOgSKnQfYUT4ytXGY1N+GuSWyA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712607950; 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=xlcxW7ulWajVW9prRYUa5kCQ+GzCsfxH9ZSVxma1YUg=; b=CgdkvrSUQBkuO/XiY6Gqipwb9PsU5E1oyY1LV+Nq7dtygqi+ftmJoXMVKFUSwIdHeHMdT2 nhPfaxm+bXmBdUHdDdIKHXGy/rkQoR/4sTvX6VUpHgvaGPmJ7OwHL5IT2Rera7Gt+k/Lai r4c14oirzi/XiIlMWQmCcFliX7rEZqAroB8No1nJwefAcoTd4O7oXROnRcWVfdKIpbkIaS IVFh1es6VreeWGUXvVYDAB8wIwrgayT49HifDYTODA8I10jtXGmwudrlVh3kHJmP5LOlod llGjmoDt3TQy3abqb5f5hZ3ppsThoPy4Ppa2OzdKmOTgLzPw07fLwalXheKapg== 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 4VD0wG4KZYzQQQ; Mon, 8 Apr 2024 20:25:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 438KPooh039883; Mon, 8 Apr 2024 20:25:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 438KPodn039880; Mon, 8 Apr 2024 20:25:50 GMT (envelope-from git) Date: Mon, 8 Apr 2024 20:25:50 GMT Message-Id: <202404082025.438KPodn039880@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 1910a6ca6e83 - stable/13 - acpi: Use bus_generic_alloc_resource instead of duplicating it 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1910a6ca6e83fbab26dd86082c899dbde53efcc1 Auto-Submitted: auto-generated The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=1910a6ca6e83fbab26dd86082c899dbde53efcc1 commit 1910a6ca6e83fbab26dd86082c899dbde53efcc1 Author: John Baldwin AuthorDate: 2024-02-09 18:27:45 +0000 Commit: John Baldwin CommitDate: 2024-04-08 17:53:29 +0000 acpi: Use bus_generic_alloc_resource instead of duplicating it No functional change, but it is cleaner to use the existing generic wrappers rather than KOBJ methods directly. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D43686 (cherry picked from commit 1fb5445206a5ef2351c32f8bc6beb67605593caa) --- sys/dev/acpica/acpi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index 49153eedbcc0..7a5ada029ecf 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -1457,7 +1457,7 @@ acpi_alloc_resource(device_t bus, device_t child, int type, int *rid, } } } else - res = BUS_ALLOC_RESOURCE(device_get_parent(bus), child, type, rid, + res = bus_generic_alloc_resource(bus, child, type, rid, start, end, count, flags); /* From nobody Mon Apr 8 20:25:51 2024 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 4VD0wJ01Hcz5HhqJ; Mon, 8 Apr 2024 20:25:52 +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 4VD0wH5p2kz3y0s; Mon, 8 Apr 2024 20:25:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712607951; 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=rrF481fEdBwv1CFeOVj8D8hEyzToCXORAbo80ZD5HKA=; b=nf4YvFTRmBzsPBGx4g3/9bcnUIMuSCPhyW8ICn4VSXn7s9wj5RvWHHcYCocPGC/Qkkp6aq f0XkNHEtW8rm6j5NO46WWZ5CICsz6HFpcpIZ247rS0OGXFY0aqQtbMZ4/TZsnTj3YyGAMZ /GFNhVkM9WPuL+2SVKVixldKBSz77xUld0z5M5Wv0YmXIODdmgFxsz9IwWNsyedi6a615Z KEnaVF4ggy/t5VDPBxMbbsXrN+PXw0KW+J8VB+JXrfPqN8xqcxUXANfTPeAB9Ac9Ht8JRJ s1bAFbDkneRUDE+Q7kgxHIc3axK+cPWY082yXGWGGX0YCLy0zPxcK4oSGkrrwQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712607951; a=rsa-sha256; cv=none; b=O29aiH0+G8etE9k+N6KRmhTyssyUs8OffTIFjJi947GkIagj7PI4BH9Bt+hRUHP1WOMH1R ahUfYk6DfVIzR09Svwc3Omtp/VD956FCKDBs4M4n58zLrftk0yO6dBPzlJZHBn59/dGOeC cM2OrkqLOgmtyag6174nfDmlFQDBUjVIcgrcFCpyLren0aZvt+feFw91H9EfRzZcMeXVSc 00L/MSYLuzccIqsdPPS30cOYpKMmfPqsrxsOPas8kcZLlKgs+9PWU+U19VuIyGr9zwVtqZ n5E4H6cTtpOD3+Kj9dbmn5yQwIdlODZUSPCKioKue6f69kyTnxEEPhWpEVCw9A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712607951; 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=rrF481fEdBwv1CFeOVj8D8hEyzToCXORAbo80ZD5HKA=; b=FZR+/nUDAuVcqqQgS5+h7qCSWWiYrBqqoMhNHH3b6Oowh9k9Nzugb1eBux03ICXg49rv20 8Qkk6AIsl1q9nLGCOzmbj1aPVPT/fX8MGHWLLQ5f5vH3drkc81JsQVgcn7rF8dmQHGyhtf f4fko2+XcHP+0UQcxtJYAfJm4jbQSYywgFnNwoI8S0JP14AE005LoMcV8p4gGZxHCwAO4H Vvc3Aa7mu+KCSrWQufYg/861LkaHF8P1MFYFdOJKuRJmFTqhcUeAwV47TPBUnoFrRDH/dq LZ0jTSsUbBm1f82JS6u8rEHbreKjilH7/utTP/4fo7pwfOi5o7LXbI1U3NQnGg== 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 4VD0wH5P1JzQg1; Mon, 8 Apr 2024 20:25:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 438KPpQU039946; Mon, 8 Apr 2024 20:25:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 438KPpR4039943; Mon, 8 Apr 2024 20:25:51 GMT (envelope-from git) Date: Mon, 8 Apr 2024 20:25:51 GMT Message-Id: <202404082025.438KPpR4039943@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 9fc935855951 - stable/13 - cam: Check if cam_simq_alloc fails for the xpt bus during module init 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 9fc935855951ff8277c669b2aa248fde63a10175 Auto-Submitted: auto-generated The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=9fc935855951ff8277c669b2aa248fde63a10175 commit 9fc935855951ff8277c669b2aa248fde63a10175 Author: John Baldwin AuthorDate: 2024-02-09 19:53:43 +0000 Commit: John Baldwin CommitDate: 2024-04-08 17:53:54 +0000 cam: Check if cam_simq_alloc fails for the xpt bus during module init This is very unlikely to fail (and if it does, CAM isn't going to work regardless), but fail with an error rather than a gauranteed panic via NULL pointer dereference. PR: 276770 Reported by: Qiushi (cherry picked from commit eb86c6c5b462c996e44c45ba496937b75ef22da3) --- sys/cam/cam_xpt.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c index 177cc3a168d9..391a5b8ae2a2 100644 --- a/sys/cam/cam_xpt.c +++ b/sys/cam/cam_xpt.c @@ -913,6 +913,8 @@ xpt_init(void *dummy) * perform other XPT functions. */ devq = cam_simq_alloc(16); + if (devq == NULL) + return (ENOMEM); xpt_sim = cam_sim_alloc(xptaction, xptpoll, "xpt", From nobody Mon Apr 8 20:25:52 2024 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 4VD0wK29nDz5HhVs; Mon, 8 Apr 2024 20:25: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 4VD0wK06Jqz3xrK; Mon, 8 Apr 2024 20:25:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712607953; 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=buya3jnhaJc3FJPhgqQfuAw+PkYnEYPVzoILGAXA5k8=; b=xZZQySP186u0qGkjTYH8Ux+Qc5Jgjb8mu5NTqxftjxH6dzWq+/HsXkf6cr+LTKiKTkfuca leUclGs3D2QyXELb4U5BetD0xt9xMNcvp7CzyY38r1yanVwb6eDQUaXiGDlam6lkyO7K+m Rsfm05Ap5NBbWQnS8HnzDjMM/vF09EJ8cs08Wq3U33CvROLgDrSxwNkLVGrIkHKappOqSk em64HhoX8EBpIvUjL2VOkrRwmzT7OkwT3qcvd0N78YAauLIEZEid4kWu5WXqAUn8Nw8j+I fc4qIbzQzaU1nwqxTef2/bxZFKxZP54qWFfsEqYa5b7WHV9aOQq00qmcdI5HPg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712607953; a=rsa-sha256; cv=none; b=jfmumcvZv6tXxUIv8eQS+PlK1u4D8c9ahRMOs4rUmVhs5GNcgYwULhGOvSMCVcT9iM7xye 42hgaMWMJ4ELry5pf6H8lg059H55FZyqSX2sPtOKXLU7HBKMLZkZLd0lWlPu8pIBc2tRcI eoghayECNMQWcXw6DmFMWCVt5dSTDF8gambs+uFi1pinHU6uP1QDLrf47M9iyj29GVulhF pM0BR1K9uqAwYGacFTs8ZTqBHiDjPQkiwkmZjq8Y/3QYaXyWtPx4zaEp4qrE1JRh383Kc2 eSP00tlqd92iu7VbJ3NndPSqkqsiFSPobEIiFn55uN19auj+pWSYvoR0SGFeEg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712607953; 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=buya3jnhaJc3FJPhgqQfuAw+PkYnEYPVzoILGAXA5k8=; b=WvxCk+M439Sev3PTKC8JK9By8pXWDRsP9KwKLXLjUo+dq9RzReyRWSWkp9t08mQgaWiDGB 6qeB9jzs6CDRm5g/95LyOuwDqEycuTlOjm9bmyi+xg4qnmPmvbBDr70NUCkAB8KRInAvqj uqh+PvALOtkJoeHedh9FfdebwPrfaR/RTGkPadBGUcWTAlmNVZT9iL6jx9DPOUZ9wMmJKd 2+ZlermkzOvyWJtSWaMGA7h824Ev59oUPBcI6ufkQ5sBHVoGZaU7RVjDg1fcLxG0uJcmbI H0GNgO7D41YJQFwV5us6a/AFVYrMcmDfNv0LXoxZtose+i5LGRBvBt9Ioxe3Ww== 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 4VD0wJ6rS9zQc2; Mon, 8 Apr 2024 20:25:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 438KPqP1040003; Mon, 8 Apr 2024 20:25:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 438KPqdU040000; Mon, 8 Apr 2024 20:25:52 GMT (envelope-from git) Date: Mon, 8 Apr 2024 20:25:52 GMT Message-Id: <202404082025.438KPqdU040000@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 55c2c62f108a - stable/13 - acpi: Allow child drivers to use bus_set_resource for more resources 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 55c2c62f108a86e1912228a4a3ac8da3a0df913f Auto-Submitted: auto-generated The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=55c2c62f108a86e1912228a4a3ac8da3a0df913f commit 55c2c62f108a86e1912228a4a3ac8da3a0df913f Author: John Baldwin AuthorDate: 2024-02-14 22:07:32 +0000 Commit: John Baldwin CommitDate: 2024-04-08 17:54:40 +0000 acpi: Allow child drivers to use bus_set_resource for more resources acpi_set_resource excludes certain types of resources for certain devices. The intention of this is to avoid adding resource entries for bogus resources enumerated via _CRS. However, this also prevents drivers from adding those resources explicitly if needed. To fix this, move the logic to exclude these resources into an ignore hook used when parsing _CRS to create the initial set of resources for each device. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D43892 (cherry picked from commit 055c1fe230ce5a2997c03a3cc2431baea1594566) --- sys/dev/acpica/acpi.c | 34 --------------------- sys/dev/acpica/acpi_resource.c | 69 ++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 67 insertions(+), 36 deletions(-) diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index 7a5ada029ecf..c4b87e39ce41 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -97,7 +97,6 @@ struct acpi_interface { }; static char *sysres_ids[] = { "PNP0C01", "PNP0C02", NULL }; -static char *pcilink_ids[] = { "PNP0C0F", NULL }; /* Global mutex for locking access to the ACPI subsystem. */ struct mtx acpi_mutex; @@ -1338,40 +1337,7 @@ acpi_set_resource(device_t dev, device_t child, int type, int rid, { struct acpi_device *ad = device_get_ivars(child); struct resource_list *rl = &ad->ad_rl; - ACPI_DEVICE_INFO *devinfo; rman_res_t end; - int allow; - - /* Ignore IRQ resources for PCI link devices. */ - if (type == SYS_RES_IRQ && - ACPI_ID_PROBE(dev, child, pcilink_ids, NULL) <= 0) - return (0); - - /* - * Ignore most resources for PCI root bridges. Some BIOSes - * incorrectly enumerate the memory ranges they decode as plain - * memory resources instead of as ResourceProducer ranges. Other - * BIOSes incorrectly list system resource entries for I/O ranges - * under the PCI bridge. Do allow the one known-correct case on - * x86 of a PCI bridge claiming the I/O ports used for PCI config - * access. - */ - if (type == SYS_RES_MEMORY || type == SYS_RES_IOPORT) { - if (ACPI_SUCCESS(AcpiGetObjectInfo(ad->ad_handle, &devinfo))) { - if ((devinfo->Flags & ACPI_PCI_ROOT_BRIDGE) != 0) { -#if defined(__i386__) || defined(__amd64__) - allow = (type == SYS_RES_IOPORT && start == CONF1_ADDR_PORT); -#else - allow = 0; -#endif - if (!allow) { - AcpiOsFree(devinfo); - return (0); - } - } - AcpiOsFree(devinfo); - } - } #ifdef INTRNG /* map with default for now */ diff --git a/sys/dev/acpica/acpi_resource.c b/sys/dev/acpica/acpi_resource.c index 30ab08cd85eb..e81b5ec53f2d 100644 --- a/sys/dev/acpica/acpi_resource.c +++ b/sys/dev/acpica/acpi_resource.c @@ -34,6 +34,9 @@ #include #include +#if defined(__i386__) || defined(__amd64__) +#include +#endif #include #include #include @@ -62,6 +65,8 @@ struct lookup_irq_request { int pol; }; +static char *pcilink_ids[] = { "PNP0C0F", NULL }; + static ACPI_STATUS acpi_lookup_irq_handler(ACPI_RESOURCE *res, void *context) { @@ -573,6 +578,52 @@ struct acpi_res_context { void *ar_parent; }; +/* + * Some resources reported via _CRS should not be added as bus + * resources. This function returns true if a resource reported via + * _CRS should be ignored. + */ +static bool +acpi_res_ignore(device_t dev, int type, rman_res_t start, rman_res_t count) +{ + struct acpi_device *ad = device_get_ivars(dev); + ACPI_DEVICE_INFO *devinfo; + bool allow; + + /* Ignore IRQ resources for PCI link devices. */ + if (type == SYS_RES_IRQ && + ACPI_ID_PROBE(device_get_parent(dev), dev, pcilink_ids, NULL) <= 0) + return (true); + + /* + * Ignore most resources for PCI root bridges. Some BIOSes + * incorrectly enumerate the memory ranges they decode as plain + * memory resources instead of as ResourceProducer ranges. Other + * BIOSes incorrectly list system resource entries for I/O ranges + * under the PCI bridge. Do allow the one known-correct case on + * x86 of a PCI bridge claiming the I/O ports used for PCI config + * access. + */ + if (type == SYS_RES_MEMORY || type == SYS_RES_IOPORT) { + if (ACPI_SUCCESS(AcpiGetObjectInfo(ad->ad_handle, &devinfo))) { + if ((devinfo->Flags & ACPI_PCI_ROOT_BRIDGE) != 0) { +#if defined(__i386__) || defined(__amd64__) + allow = (type == SYS_RES_IOPORT && start == CONF1_ADDR_PORT); +#else + allow = false; +#endif + if (!allow) { + AcpiOsFree(devinfo); + return (true); + } + } + AcpiOsFree(devinfo); + } + } + + return (false); +} + static void acpi_res_set_init(device_t dev, void *arg, void **context) { @@ -603,6 +654,8 @@ acpi_res_set_ioport(device_t dev, void *context, uint64_t base, if (cp == NULL) return; + if (acpi_res_ignore(dev, SYS_RES_IOPORT, base, length)) + return; bus_set_resource(dev, SYS_RES_IOPORT, cp->ar_nio++, base, length); } @@ -628,6 +681,8 @@ acpi_res_set_iorange(device_t dev, void *context, uint64_t low, device_printf(dev, "_CRS has fixed I/O port range defined as relocatable\n"); + if (acpi_res_ignore(dev, SYS_RES_IOPORT, low, length)) + return; bus_set_resource(dev, SYS_RES_IOPORT, cp->ar_nio++, low, length); return; } @@ -643,6 +698,8 @@ acpi_res_set_memory(device_t dev, void *context, uint64_t base, if (cp == NULL) return; + if (acpi_res_ignore(dev, SYS_RES_MEMORY, base, length)) + return; bus_set_resource(dev, SYS_RES_MEMORY, cp->ar_nmem++, base, length); } @@ -667,8 +724,11 @@ acpi_res_set_irq(device_t dev, void *context, uint8_t *irq, int count, if (cp == NULL || irq == NULL) return; - for (i = 0; i < count; i++) + for (i = 0; i < count; i++) { + if (acpi_res_ignore(dev, SYS_RES_IRQ, irq[i], 1)) + continue; bus_set_resource(dev, SYS_RES_IRQ, cp->ar_nirq++, irq[i], 1); + } } static void @@ -681,8 +741,11 @@ acpi_res_set_ext_irq(device_t dev, void *context, uint32_t *irq, int count, if (cp == NULL || irq == NULL) return; - for (i = 0; i < count; i++) + for (i = 0; i < count; i++) { + if (acpi_res_ignore(dev, SYS_RES_IRQ, irq[i], 1)) + continue; bus_set_resource(dev, SYS_RES_IRQ, cp->ar_nirq++, irq[i], 1); + } } static void @@ -697,6 +760,8 @@ acpi_res_set_drq(device_t dev, void *context, uint8_t *drq, int count) if (count != 1) return; + if (acpi_res_ignore(dev, SYS_RES_DRQ, *drq, 1)) + return; bus_set_resource(dev, SYS_RES_DRQ, cp->ar_ndrq++, *drq, 1); } From nobody Mon Apr 8 20:25:55 2024 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 4VD0wM62Fnz5Hhsr; Mon, 8 Apr 2024 20:25: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 4VD0wM2nMCz3y1l; Mon, 8 Apr 2024 20:25:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712607955; 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=EYB5nHVhjEvJfrMocaw9dwMClKu8lH/xGU+63HMfy4A=; b=BTlVJ0wrP3SPcvP0IYeI779Av7+ce+XGG74Lrtzw/bo2Lx+kBJdFaWnmudLiuQmsXIyJIX 9QO1yyem1pxem+miBXnYDx4OvPiPKAS/H89p/XnRJDu4dGzkAnY7yjGNqwJKWfQ8nx+4Vq wR3sMcrhSFCbxqbQZAd4Ppg9p5H8mOstCiKyh5MDoRLBTxp5mgQHMqG2DpilBwM4GtNSGC FdEHcKGrZhafudbTBL6FwHsEMhDiS7cVHzivQi2RKwwnJTthEmEfKs0qwYSGJx6/mrrWnD yMYn1QNwhrpGUFoqfuFJRDoXEzZHD5DwhucTC3JvKeAsMYY0dR4obZ/g8DOPqg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712607955; a=rsa-sha256; cv=none; b=v5nFxXUgkMhn+mpfkddqfQUrrCeYnbzf3j0zN5wsmTmK7LV75LZrTAojWNdROx9IjZv9Wj 70VC+O80XL2JX2ONQZ372eInhq4dkbTyCCl7l/7dToF1QEUNi3T3Pd9e7x9c1JvB9yBPFC SbaQ0PekFA5i6hY1CjPa6esXvpLs7k8BptWGKZfgAx93AHPbZo/qM9sHiHlnqkb5MJmnW4 t9gv0XMEVj+xccAi006Qhp6xixvVts3j9JPKz+K7gXPrbDSJmHlHb32onxib+ycTLKA4CY FooW+GKD6sWFlzQguVzd5Swr9K8y7TW3P+LhrbLWziu2JqDi/JcmgWA0R5txaw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712607955; 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=EYB5nHVhjEvJfrMocaw9dwMClKu8lH/xGU+63HMfy4A=; b=oYAY9U9/X2CXcYgWvFwYpIoIB7uoq3o4sq6CzCRj+1YGbQ7kzxEaNEU2tEaA9dN9VeytCo HYnc4si8Fyd20vzwalbyeH1bMoN/BPybRIAVT9FV7/V+i8aaCFTl0roXzXLUwVTKz5xBS9 qzqrIjOEuSMd79gkqltA2cFANfCbjTVh0Mjtf1gnhL+a15J0h7ZEIQ0KQoiKxSt5/CqdW1 uZBnzS5EOoYFYnhn/y7zOXSRdogLjsg5b0eEWGMP1xTypRdiQJwvqL881YVs4w1uZqma/M oP8AbQm2cnw3AjMGgZfliPCxla1N8R8WBJJSpPfB5Z8lKz0QPWmwjb17CB1zEQ== 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 4VD0wM1yHvzQQR; Mon, 8 Apr 2024 20:25:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 438KPtqQ040108; Mon, 8 Apr 2024 20:25:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 438KPtGV040105; Mon, 8 Apr 2024 20:25:55 GMT (envelope-from git) Date: Mon, 8 Apr 2024 20:25:55 GMT Message-Id: <202404082025.438KPtGV040105@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: af5f73700c47 - stable/13 - riscv: Add missing includes for DDB 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: af5f73700c470b567a17490c0a05b970ec119a45 Auto-Submitted: auto-generated The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=af5f73700c470b567a17490c0a05b970ec119a45 commit af5f73700c470b567a17490c0a05b970ec119a45 Author: John Baldwin AuthorDate: 2024-02-15 20:20:30 +0000 Commit: John Baldwin CommitDate: 2024-04-08 17:57:06 +0000 riscv: Add missing includes for DDB The #ifdef DDB code in parse_metadata was dead code without opt_ddb.h. While here, update the call to db_fetch_ksymtab for changes in commit 02bc014a200a. Reviewed by: mhorne Obtained from: CheriBSD Differential Revision: https://reviews.freebsd.org/D43919 (cherry picked from commit 962b0bcbd924d308016237abc991280f15777e7f) --- sys/riscv/riscv/machdep.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/riscv/riscv/machdep.c b/sys/riscv/riscv/machdep.c index 79305cbc29d8..ff074c91973a 100644 --- a/sys/riscv/riscv/machdep.c +++ b/sys/riscv/riscv/machdep.c @@ -33,6 +33,7 @@ * SUCH DAMAGE. */ +#include "opt_ddb.h" #include "opt_kstack_pages.h" #include "opt_platform.h" @@ -95,6 +96,10 @@ #include #endif +#ifdef DDB +#include +#endif + #ifdef FDT #include #include @@ -459,7 +464,7 @@ parse_metadata(void) #ifdef DDB ksym_start = MD_FETCH(kmdp, MODINFOMD_SSYM, uintptr_t); ksym_end = MD_FETCH(kmdp, MODINFOMD_ESYM, uintptr_t); - db_fetch_ksymtab(ksym_start, ksym_end); + db_fetch_ksymtab(ksym_start, ksym_end, 0); #endif #ifdef FDT try_load_dtb(kmdp); From nobody Mon Apr 8 20:25:54 2024 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 4VD0wL4qFNz5HhwW; Mon, 8 Apr 2024 20:25: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 4VD0wL1XYWz3xgk; Mon, 8 Apr 2024 20:25:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712607954; 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=cQLAfb5C8ne5R4wC+ZTnTL2cXUdaWmqPixQ44fQvEIo=; b=yNggGLgP+WQFx6JD/bR/DJ95sNuR9yRcTglLM9LweFKU5fc0Y2XCH+6+w3ucG1RNNdBg9T S6JuJ4wVdZ2oGRHusT3cGSrij+fDFOd2Z/igcSjZ2T5k68r1qFt1AhIYabBCn2GAqnfbDh 1y4zDwCTAxbrzxCjm5RF8HBh/Qr7TV7URJ/yWfEgYyz3f1QoJqe0BFy9j9+FzsQeVCqbNK 6xRMMa5FXCffiDhy3OMaLaTRzy0/FssQzEJxZkRalMFV3+UWMT+Pj/PJ+sRlf4le2ltPAB U9EgaNteEIJC8IeozNKEA0X9C0zotxQ4r/qELo1cqox9AMIHbVkw5KqQGgfPsw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712607954; a=rsa-sha256; cv=none; b=bEBx6QbR5MshfHi/pZ9pUl1UeOarM995ehiQAMYUS0Q7rjxTlFLWXiz6kSOZqC357xMesv sGsLeTA1swPZg4zAH4PVw0anYedy0WeGv2VbZEzC20a6TLXP5GccCkSLrv7/0nbqyj5ABW tK6ub3cxUqY4JJmejkEYj6rtDwturoUXF7s3iHWr9SgJggSNMvGVPGQQCkO0P/1u4dRi32 FCM9Bfqzr2UwQuPv/Mt6gNFKQ5j8wwjb+mgvZ1yzjAbBhqRA9QZ3hAWcTFbt1mb2xNl30X dCYjUnZHbuDtml4HP3pm15TLwxJUeMxfvSAPehMGdvus5YAn78MceAv/9J5h9w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712607954; 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=cQLAfb5C8ne5R4wC+ZTnTL2cXUdaWmqPixQ44fQvEIo=; b=nB+CoI0Ooe/ihNxaJqlLh39Cuc2F1OdiNjWOzEq04WpZrqMcQiEy1eNbt4FxOviOz/6s+/ yyVq/3vbKYLuxhsq+YFUp2/oA/wx/m5RAhErxlcQL0vg30gCdC3fOy2xn4gTXv7KsGV1gV JUYN0PPHGfucuiqrki/OKYocGlgmF8anpi24ZiTJOu7pS2qQTaAZS9tE5Run0Z6WsoLB71 wEGXknJSTyj+c60qwREuTtzt4QTfVjIm/uliuLohXFIvr/SmhHf7Ul9n0mAO2kKNZ/jJTm I2ycybp6qPLLkc/hUWwF9wrVVfY36JyQRsn59v5O9lzDiusfu6cVX8o9D/06ag== 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 4VD0wL0yGvzQRx; Mon, 8 Apr 2024 20:25:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 438KPsx5040057; Mon, 8 Apr 2024 20:25:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 438KPsIp040054; Mon, 8 Apr 2024 20:25:54 GMT (envelope-from git) Date: Mon, 8 Apr 2024 20:25:54 GMT Message-Id: <202404082025.438KPsIp040054@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 7204a656fcfa - stable/13 - acpi: Don't assume a resource is reserved in acpi_delete_resource 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7204a656fcfab41200a0056bb5dba0c538d93052 Auto-Submitted: auto-generated The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=7204a656fcfab41200a0056bb5dba0c538d93052 commit 7204a656fcfab41200a0056bb5dba0c538d93052 Author: John Baldwin AuthorDate: 2024-02-14 22:07:32 +0000 Commit: John Baldwin CommitDate: 2024-04-08 17:56:03 +0000 acpi: Don't assume a resource is reserved in acpi_delete_resource This fixes a panic if a driver uses bus_set_resource to add a resource that fails to reserve and then deletes the resource via bus_delete_resource. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D43891 (cherry picked from commit e05436d577de98944b97b9cf510b29c4d2091b3f) --- sys/dev/acpica/acpi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index c4b87e39ce41..1706938e49a3 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -1534,7 +1534,8 @@ acpi_delete_resource(device_t bus, device_t child, int type, int rid) " (type=%d, rid=%d)\n", type, rid); return; } - resource_list_unreserve(rl, bus, child, type, rid); + if (resource_list_reserved(rl, type, rid)) + resource_list_unreserve(rl, bus, child, type, rid); resource_list_delete(rl, type, rid); } From nobody Mon Apr 8 20:25:57 2024 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 4VD0wQ0RrZz5HhqS; Mon, 8 Apr 2024 20:25: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 4VD0wP4ptRz3yBG; Mon, 8 Apr 2024 20:25:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712607957; 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=vy6oSYsUnJ/tjpbcMrZVDm0QmX/KTvxyi4Vtm/kTkBg=; b=iV4wUPfo6zh7FkzN6TRhZgpA2d5hUrAGWLUqJbYtKVNTBCSiLvB9NZjZHJ+w8ZdxHm2Ur9 FqJf7e+efCZnRjqJXQZlmBEUIl4g6nPhJlYNt4XpzX8qFdGdAAsa2RBgXgvcj6zLeVrRGr GtaPhvYhRM65Z63whoIIzVQHzrgxmh12LuOyorUIRPn+03SSS7myvGBYvKYigG538rsvfy qtczV/NnDpY0v17zfrsaP1LdBgmj+3zssUr3MZkIexjMslPSdZ1GDhBuI3GVFGf005QDj9 nwzB51NWX5EzwovJnCtIGKrTxo9SOFngwZBJvAGHTk94m8kcF1h0rtIGqr0vBw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712607957; a=rsa-sha256; cv=none; b=VUoYeQBeuZ990hWtC1cxX4j/f3PpEuRFP444iLds444ZdqfFT7lFIN9qpTkACi1xkhh7kw 0m67Bnfw1oEXL8ZMngECFCiMOENUegGiqOkekwmEQdIHZyvqurusV6Lf8NtbNXT9t3zf8h jLJKZC2G/xBdvHMdXsccdnlIZAVlzLEJeBc2eGAhD1M0Qru/9h80imQ8Lqiq8X6MTb5UQy 9UKKuiNEzPOzMYZKwX/d/VZ5HJVUfAu9s1RjNKd5otcjhTyADV0/PmmsR1ODlM7aihYEqS 8PKAApP+FJ0p9r8i6r+YmuhN4xRUznBFDbwahHry/wdrf0xVE55OGYTHLfvzAQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712607957; 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=vy6oSYsUnJ/tjpbcMrZVDm0QmX/KTvxyi4Vtm/kTkBg=; b=QYKZgoXr4bcPAzRUZD5he4fmleHXyGXHzBCxzd5jTdC4Xn6e2i6RxfntfEnTytV1KLePNE T3OVDJeyfZ+p4kVmt/xCrOcug5uWuTUMFBJnNfksRhKjhpg5oZhYbHVkz1pzqZTBsRgDHA ilChexX97oczUFJ2NvVi2dx8oDJfSW9ERWo+07zZuiV/j6Y9XP//2rrnWPSslorM9pKz8D aM28uoSbHQjBwf1WYrNAwDGwYxI8WCsCGgc25DH+elAkqsGMJ7Dt0DEh0GQWcyarB6i7IP 31PWPFmfyF+8f2tqNoEDP09XqD7BcgL1n7tD4zd7Zc7/nu8E1q3CKBdcuTvE3w== 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 4VD0wP4MhczPmB; Mon, 8 Apr 2024 20:25:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 438KPv6n040219; Mon, 8 Apr 2024 20:25:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 438KPvTl040216; Mon, 8 Apr 2024 20:25:57 GMT (envelope-from git) Date: Mon, 8 Apr 2024 20:25:57 GMT Message-Id: <202404082025.438KPvTl040216@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 3798c6487a21 - stable/13 - ipfw: Skip to the start of the loop when following a keep-state rule 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3798c6487a21454020493517b613cda9a1753faf Auto-Submitted: auto-generated The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=3798c6487a21454020493517b613cda9a1753faf commit 3798c6487a21454020493517b613cda9a1753faf Author: Karim Fodil-Lemelin AuthorDate: 2024-02-16 01:57:51 +0000 Commit: John Baldwin CommitDate: 2024-04-08 17:57:57 +0000 ipfw: Skip to the start of the loop when following a keep-state rule When a packet matches an existing dynamic rule for a keep-state rule, the matching engine advances the "instruction pointer" to the action portion of the rule skipping over the match conditions. However, the code was merely breaking out of the switch statement rather than doing a continue, so the remainder of the loop body after the switch was still executed. If the first action opcode contains an F_NOT but not an F_OR (such as an "untag" action), then match is toggled to 0, and the code exits the inner loop via a break which aborts processing of the actions. To fix, just use a continue instead of a break. PR: 276732 Reviewed by: jhb, ae MFC after: 2 weeks (cherry picked from commit 62b1faa3b7495de22a3225e42dabe6ce8c371e86) --- sys/netpfil/ipfw/ip_fw2.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/netpfil/ipfw/ip_fw2.c b/sys/netpfil/ipfw/ip_fw2.c index 59faaba2f79b..5a96872f9c4f 100644 --- a/sys/netpfil/ipfw/ip_fw2.c +++ b/sys/netpfil/ipfw/ip_fw2.c @@ -2849,8 +2849,7 @@ do { \ cmd = ACTION_PTR(f); l = f->cmd_len - f->act_ofs; cmdlen = 0; - match = 1; - break; + continue; } /* * Dynamic entry not found. If CHECK_STATE, From nobody Mon Apr 8 20:25:56 2024 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 4VD0wP2XKKz5HhqR; Mon, 8 Apr 2024 20:25: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 4VD0wN3n3Zz3y9y; Mon, 8 Apr 2024 20:25:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712607956; 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=QfjCH4ur9cXewCJVTik+kwbtfINuFQM6pbYMnqAN9H8=; b=kgP/TBprRYKYm/iFWJXNmtisAC3gZ7fZ08PhF2I6ZfrMphBvip7HXDRaA+PIoPNyXAVj65 yqD8DkRBaG7R/vtsFvVGBNuRPVG8IrqrYE3Vg+3cg9X3323C1cwEt9JUvOEDNrqSfQ9iIl OCmqj2m/ssh4ycf5wngM8D7GHoI5Yy9GTEnVqDbRIfe3fimzO96SeoLa05Iy34U2Nu1lGg uGYSkFLVV5kRfGiaEmmV/8H40x1rnk6rvAfTuOOk2h6K7iiwMZ0fwjOOBB2AWzd1bhGzQP 2dXL6VyLiDfy5vTcMBlhCDynfSVVkhCX1OW640hNOEGbTH9mrhmsjthazCtR1g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712607956; a=rsa-sha256; cv=none; b=S1A7PBjQ10atRvjh+5QMfgU8TAfn+M032r48a9uSrvBWTlQ3Hp/PEh8SwZ7u1auA3Nz+LM dcRGsjU/0TIRTbaRp9N45qPM85a0bg4NNVF37f/BOlC/+fTESUXIw8wxIg8NyWO8CvZNg6 mowgUF+a1rUrXZAhnEUWD3xmDdPlliOQ7jGwYbMgkrMtDhgRLfnZTy8nAZqu4G40mCiqQU wE2kazvRWAC/FMYX7JChy43K6NAu+Pqp1LkuxXDBHvsD5o+0T0jhnhaW4LQeHUQbey/CIc xJpnt/U5tuxOzW/idB1UHNjs53uoaZZr7dH7sxZpabKKnG+AQxXb0HIWpMqeDw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712607956; 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=QfjCH4ur9cXewCJVTik+kwbtfINuFQM6pbYMnqAN9H8=; b=k7fe8vyIRbaFUWOnxzHxZ5HHN6H6utni+//c17/WG3jOfv3stpgKZvVFXCVtUfSu/ysBoO 3e/IOm5z57A4Ngt/meS6CZEcD+YFZlCPpGoMO8lmrCd4X7sGWZPMx5K7fCEGc+/qnDltYQ gFFsp/95UQnJH7aPDrNYHew9soKg1I6hHwRtwF0TdU6cR2KQYelXvihCHRB9rRppS4kGj+ xsCho/rTFOnImFUooZj7pJZVpaBjHbLRx7FRi3vwQfUHG88Tpmrp7GT0WoISFiwO7MLCNj vZUeSayIAdBbE38dvI7X/nHs9PMdHo3rb1TarohL/bZcyhBUILoMsX9zgU+VVQ== 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 4VD0wN36qWzQcW; Mon, 8 Apr 2024 20:25:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 438KPuGd040153; Mon, 8 Apr 2024 20:25:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 438KPuH6040150; Mon, 8 Apr 2024 20:25:56 GMT (envelope-from git) Date: Mon, 8 Apr 2024 20:25:56 GMT Message-Id: <202404082025.438KPuH6040150@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 992262511493 - stable/13 - vmd: Use bus_read/write_* instead of bus_space_read/write_* 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 992262511493351139053a94da58099e746228b1 Auto-Submitted: auto-generated The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=992262511493351139053a94da58099e746228b1 commit 992262511493351139053a94da58099e746228b1 Author: John Baldwin AuthorDate: 2024-02-15 20:26:19 +0000 Commit: John Baldwin CommitDate: 2024-04-08 17:57:29 +0000 vmd: Use bus_read/write_* instead of bus_space_read/write_* Using an explicit bus space tag and handle is deprecated. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D43885 (cherry picked from commit 76c678688634e9e2ea5f6369fb979aabddbfe426) --- sys/dev/vmd/vmd.c | 21 ++++++--------------- sys/dev/vmd/vmd.h | 2 -- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/sys/dev/vmd/vmd.c b/sys/dev/vmd/vmd.c index e07f1de4983b..d72ae6152760 100644 --- a/sys/dev/vmd/vmd.c +++ b/sys/dev/vmd/vmd.c @@ -185,14 +185,11 @@ vmd_read_config(device_t dev, u_int b, u_int s, u_int f, u_int reg, int width) switch (width) { case 4: - return (bus_space_read_4(sc->vmd_btag, sc->vmd_bhandle, - offset)); + return (bus_read_4(sc->vmd_regs_res[0], offset)); case 2: - return (bus_space_read_2(sc->vmd_btag, sc->vmd_bhandle, - offset)); + return (bus_read_2(sc->vmd_regs_res[0], offset)); case 1: - return (bus_space_read_1(sc->vmd_btag, sc->vmd_bhandle, - offset)); + return (bus_read_1(sc->vmd_regs_res[0], offset)); default: __assert_unreachable(); return (0xffffffff); @@ -214,14 +211,11 @@ vmd_write_config(device_t dev, u_int b, u_int s, u_int f, u_int reg, switch (width) { case 4: - return (bus_space_write_4(sc->vmd_btag, sc->vmd_bhandle, - offset, val)); + return (bus_write_4(sc->vmd_regs_res[0], offset, val)); case 2: - return (bus_space_write_2(sc->vmd_btag, sc->vmd_bhandle, - offset, val)); + return (bus_write_2(sc->vmd_regs_res[0], offset, val)); case 1: - return (bus_space_write_1(sc->vmd_btag, sc->vmd_bhandle, - offset, val)); + return (bus_write_1(sc->vmd_regs_res[0], offset, val)); default: __assert_unreachable(); } @@ -283,9 +277,6 @@ vmd_attach(device_t dev) } } - sc->vmd_btag = rman_get_bustag(sc->vmd_regs_res[0]); - sc->vmd_bhandle = rman_get_bushandle(sc->vmd_regs_res[0]); - vid = pci_get_vendor(dev); did = pci_get_device(dev); for (t = vmd_devs; t->vmd_name != NULL; t++) { diff --git a/sys/dev/vmd/vmd.h b/sys/dev/vmd/vmd.h index a8156ba88a17..2ab943c07a6d 100644 --- a/sys/dev/vmd/vmd.h +++ b/sys/dev/vmd/vmd.h @@ -53,8 +53,6 @@ struct vmd_softc { #define VMD_MAX_BAR 3 int vmd_regs_rid[VMD_MAX_BAR]; struct resource *vmd_regs_res[VMD_MAX_BAR]; - bus_space_handle_t vmd_bhandle; - bus_space_tag_t vmd_btag; struct vmd_irq *vmd_irq; LIST_HEAD(,vmd_irq_user) vmd_users; int vmd_fist_vector; From nobody Mon Apr 8 20:25:58 2024 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 4VD0wR4SG6z5Hj69; Mon, 8 Apr 2024 20:25: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 4VD0wQ5y47z3yHB; Mon, 8 Apr 2024 20:25:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712607958; 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=6tiaT5dM3YIimyQqb3kZWRNF8PK+wmFg/EPmBsFBxz8=; b=W8W3ohxT4Bkxn3yv+zgrn9JhR03LzgxqbS3zTXwnp/ebC/0+0Yc3QBG4tpONQ5Rq1VRnC8 DgGKtm+lFAYFg3FXn/ic7hZcZBvHphnCFpSAon4McmvFrJWKMU1SSK/UZhYkJrdXzCQ0Sf +ppXO1+wJle7VSbZvftsM5ypncifR5YJYKkGHCta26M4kPdI/j8y0YnnJxes7ASRVABqm5 YD1TQi1do6bvfHsrzhMlmaRBRffIvssq0W5JGBbhmUVyY3ct4brvppPJzeweo/b0pr3Cxp PswyJXFeawA2ORRBdOWZIw+MDBN5cLckSykDMenetAwkga0+CZ+Eb6N2kyZX5Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712607958; a=rsa-sha256; cv=none; b=UB6BKmRgX9dk7D2SKcwN3vmuDwBFLiWd4nda7T9EMhIInws6vJ6SNO/VpABuwTVeDu8Bw8 FZVsMTulpkb6TAM3cUOsnQHoRyeUw69OaPOMDtbx56ktWJHxA8daOgyqkIstSfdzZUZI4G +yTiWLvvWilWFHJQLY+23D4wEhJo8POQC5qFyTR0BHczQrcCesCUef2bTtQWySNZuG2dKk Ml8zIbM7oLtx+buCS+VXoPq6JXryKGygM3il0Z5GZhw9AzBhNVHEKK8xGk3Fz4qTW/e9aK Y3e+uzsI5da/n/nDsk4aZ+27mbTqvfq7EZ0DAdeQRp0dH2/rbwVNzf+DG5SLsQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712607958; 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=6tiaT5dM3YIimyQqb3kZWRNF8PK+wmFg/EPmBsFBxz8=; b=uss0hx0Fnk8+9mJAJcPRmd02cYC7MM/D09KZlWuKoxzY2Y54YBk1gQ69z3e/f77JE+bFGI WuJQ9S0+SdjU4z27j/tjDlFx0xFrRTngWTzsdSpR29LNHAJoPHAwIU0ZabEO49sqDT+ovf f/RUGPOV7XN0pBqDcAplE82iw2KVgcBnUyp/4RcWMAGoQ/NxRIC4ay59h2dMWqMW3Mg0j5 g/y7/3kVfY1+CgKtoPa96d8ieaNc9+KGijDL/KIWtNP/67mIQ5Ohul8CFDpxpTscXczUim 2N29+lNEP0qk30kunJLw7bYMcmpokzLaPRjiaMTnRT/Gf9Y7j4JzKLWpo9eiAA== 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 4VD0wQ5YvvzQ28; Mon, 8 Apr 2024 20:25:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 438KPw6Y040274; Mon, 8 Apr 2024 20:25:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 438KPw3W040271; Mon, 8 Apr 2024 20:25:58 GMT (envelope-from git) Date: Mon, 8 Apr 2024 20:25:58 GMT Message-Id: <202404082025.438KPw3W040271@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: b7419f5b5e6f - stable/13 - arm64: Fix typo in pagetable_l0_ttbr0_bootstrap symbol name 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b7419f5b5e6fdcf88484b8d58bc54a2524f87abe Auto-Submitted: auto-generated The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=b7419f5b5e6fdcf88484b8d58bc54a2524f87abe commit b7419f5b5e6fdcf88484b8d58bc54a2524f87abe Author: Alfredo Mazzinghi AuthorDate: 2024-03-01 18:32:43 +0000 Commit: John Baldwin CommitDate: 2024-04-08 18:00:12 +0000 arm64: Fix typo in pagetable_l0_ttbr0_bootstrap symbol name Obtained from: CheriBSD (cherry picked from commit c6a6ec85a70314b8270e25a06e77e2e7c95c7055) --- sys/arm64/arm64/locore.S | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/arm64/arm64/locore.S b/sys/arm64/arm64/locore.S index 7d93d1de30c0..a93c95b18f44 100644 --- a/sys/arm64/arm64/locore.S +++ b/sys/arm64/arm64/locore.S @@ -186,8 +186,8 @@ ENTRY(mpentry) adrp x24, pagetable_l0_ttbr1 add x24, x24, :lo12:pagetable_l0_ttbr1 /* Load the identity page table */ - adrp x27, pagetable_l0_ttbr0_boostrap - add x27, x27, :lo12:pagetable_l0_ttbr0_boostrap + adrp x27, pagetable_l0_ttbr0_bootstrap + add x27, x27, :lo12:pagetable_l0_ttbr0_bootstrap /* Enable the mmu */ bl start_mmu @@ -778,7 +778,7 @@ pagetable_l0_ttbr1: .space PAGE_SIZE pagetable_l1_ttbr0_bootstrap: .space PAGE_SIZE -pagetable_l0_ttbr0_boostrap: +pagetable_l0_ttbr0_bootstrap: .space PAGE_SIZE pagetable_l0_ttbr0: .space PAGE_SIZE From nobody Mon Apr 8 20:25:59 2024 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 4VD0wS1z5yz5Hhst; Mon, 8 Apr 2024 20:26: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 4VD0wS0Vp0z3y4p; Mon, 8 Apr 2024 20:26:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712607960; 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=lRlfPPg+wG5cZ7XCHKDklyFMlraBNgXobH1S88omXmM=; b=U4WuPeAIY2xNjmYcrtvRa2q431pj3DWQ2ciwh/CV/eyR87xgKpIv3WNTG/nD/5AGgyfW38 Eda+vXthse700Mxr0OqeAoJcciERRa5RezYAv80/ZKW9VTwQF17p0O98ss4zqq8Y36k3UX H5yz0x8x+7Ch733RKQwXYOqxXHSpx5zVIj+7naHVacEr005sm4SsEZroMWx6CaIcv4E8Ty eYKEhfps6Msgvg0CCsjofuUzVsLKCovu3o6IxpWwmT44ub2pRwU5iUwN7RcP68QsgGw0eZ /8VAmiqrQZfXOYcXypo0LXL4AqNsmN3Ips57w+uOxmlmdkZis/pTIHAzQiMZnQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712607960; a=rsa-sha256; cv=none; b=PhRhBNhKEvXmlL4s5OGRdIPMEiPrl+QEy/Gv3pHeg5Y2xRWfkTg2R8nOCSENAJ9e7DO3nF NJObpAgQvbuYCwLR6D0QOQNFZJoxuj7iP1rChvin+qCqL5TmIY689YHF8eRr5i0hNrFza+ WvhfMlsn59xG+Xr342dZ4t/Ohd9H8Jh8fQ9OP9/szeHOavWptpeXBmdOfB7MKLAiiwD32O TSfVWJoXkkwLLqTxukXL2i3CsOt/d29qygfbMQlJ96MG3H5D7CqzHJS8pWTbWp10f8pYNB qow+SuFnJlvz5z+IlcKg9+onfVhxbuDqmiV6XZHZto9qO1lV7mgXwZc8GP/7QA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712607960; 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=lRlfPPg+wG5cZ7XCHKDklyFMlraBNgXobH1S88omXmM=; b=j1vEo8GjlRANjzTS4Q9GPfB6EcdoSaphLkab3XYbirprmF8lkcXsN7OmSdONMflsNkvVnl q6xgENVvkpx51cAi53Oza2uAZO9WKQ3pWMQjom8it9jGhOJVDlvuGRhkTDYd8YS9B9deGo bfnItaiHMOh9JkRRc2ti2k2phyLi3HyzMvlFfcUg1ntX6oBsLx3kv5Bol7SPS1GRDCEVa+ VG8krIEzEYv3TFs95Tou/VFoGhS7BCRXXizaAfRz6OFqI4z6h3/KTv4ZwfoHTXH2k6kAlX LeRgiWbiwag3B6A2zFzoGBN+ipfsK/7lP52CRGOPTzS+nRGu6cBvD9nCKe+ZBQ== 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 4VD0wR6g8SzPmC; Mon, 8 Apr 2024 20:25:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 438KPxwY040338; Mon, 8 Apr 2024 20:25:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 438KPxuD040335; Mon, 8 Apr 2024 20:25:59 GMT (envelope-from git) Date: Mon, 8 Apr 2024 20:25:59 GMT Message-Id: <202404082025.438KPxuD040335@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 4329e6ccfa4a - stable/13 - nvme: Firmware revisions in the firmware slot info logpage are ASCII strings 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4329e6ccfa4a493933700d267dd4918ba3592a3f Auto-Submitted: auto-generated The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=4329e6ccfa4a493933700d267dd4918ba3592a3f commit 4329e6ccfa4a493933700d267dd4918ba3592a3f Author: John Baldwin AuthorDate: 2024-03-01 22:18:43 +0000 Commit: John Baldwin CommitDate: 2024-04-08 18:01:07 +0000 nvme: Firmware revisions in the firmware slot info logpage are ASCII strings In particular, don't try to byteswap the values as 64-bit integers and always print a non-empty version as a string. Reviewed by: chuck, imp Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D44121 (cherry picked from commit 7485926e09a08fbfe83a9bc908e7d43aaca4c172) --- sbin/nvmecontrol/logpage.c | 13 ++----------- sys/dev/nvme/nvme.h | 14 ++------------ sys/dev/nvme/nvme_ctrlr.c | 4 ---- 3 files changed, 4 insertions(+), 27 deletions(-) diff --git a/sbin/nvmecontrol/logpage.c b/sbin/nvmecontrol/logpage.c index 35944993b32f..ad96c973acdf 100644 --- a/sbin/nvmecontrol/logpage.c +++ b/sbin/nvmecontrol/logpage.c @@ -230,10 +230,6 @@ read_logpage(int fd, uint8_t log_page, uint32_t nsid, uint8_t lsp, nvme_health_information_page_swapbytes( (struct nvme_health_information_page *)payload); break; - case NVME_LOG_FIRMWARE_SLOT: - nvme_firmware_page_swapbytes( - (struct nvme_firmware_page *)payload); - break; case NVME_LOG_CHANGED_NAMESPACE: nvme_ns_list_swapbytes((struct nvme_ns_list *)payload); break; @@ -424,15 +420,10 @@ print_log_firmware(const struct nvme_controller_data *cdata, void *buf, uint32_t else status = "Inactive"; - if (fw->revision[i] == 0LLU) + if (fw->revision[i][0] == '\0') printf("Empty\n"); else - if (isprint(*(char *)&fw->revision[i])) - printf("[%s] %.8s\n", status, - (char *)&fw->revision[i]); - else - printf("[%s] %016jx\n", status, - fw->revision[i]); + printf("[%s] %.8s\n", status, fw->revision[i]); } } diff --git a/sys/dev/nvme/nvme.h b/sys/dev/nvme/nvme.h index 298efb7a19ed..39f9ce1b5907 100644 --- a/sys/dev/nvme/nvme.h +++ b/sys/dev/nvme/nvme.h @@ -1420,7 +1420,8 @@ _Static_assert(sizeof(struct nvme_health_information_page) == 512, "bad size for struct nvme_firmware_page { uint8_t afi; uint8_t reserved[7]; - uint64_t revision[7]; /* revisions for 7 slots */ + /* revisions for 7 slots */ + uint8_t revision[7][NVME_FIRMWARE_REVISION_LENGTH]; uint8_t reserved2[448]; } __packed __aligned(4); @@ -1962,17 +1963,6 @@ void nvme_health_information_page_swapbytes( #endif } -static inline -void nvme_firmware_page_swapbytes(struct nvme_firmware_page *s __unused) -{ -#if _BYTE_ORDER != _LITTLE_ENDIAN - int i; - - for (i = 0; i < 7; i++) - s->revision[i] = le64toh(s->revision[i]); -#endif -} - static inline void nvme_ns_list_swapbytes(struct nvme_ns_list *s __unused) { diff --git a/sys/dev/nvme/nvme_ctrlr.c b/sys/dev/nvme/nvme_ctrlr.c index bcbc8dc26ee1..a3862113ed75 100644 --- a/sys/dev/nvme/nvme_ctrlr.c +++ b/sys/dev/nvme/nvme_ctrlr.c @@ -704,10 +704,6 @@ nvme_ctrlr_async_event_log_page_cb(void *arg, const struct nvme_completion *cpl) nvme_health_information_page_swapbytes( (struct nvme_health_information_page *)aer->log_page_buffer); break; - case NVME_LOG_FIRMWARE_SLOT: - nvme_firmware_page_swapbytes( - (struct nvme_firmware_page *)aer->log_page_buffer); - break; case NVME_LOG_CHANGED_NAMESPACE: nvme_ns_list_swapbytes( (struct nvme_ns_list *)aer->log_page_buffer); From nobody Mon Apr 8 20:26:00 2024 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 4VD0wT2ZWwz5Hhyv; Mon, 8 Apr 2024 20:26: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 4VD0wT0fhhz3xpY; Mon, 8 Apr 2024 20:26:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712607961; 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=HOUt+6jUFqH6IBGs5SZ3EJABXS+jRJzt3t3kQBABqGk=; b=UivEavaoYtMx0hwz02q8L55BSoGlqKmREjkDAAH4j9D+M2zAdKSKmgnxH9IQWMpWwWyY4S zX1q2sDN8qiSkFg7hIv7qoAYMSfQkaIm3Ipfj9iQqMtyHYOnGTOgnPaT5VvbgbKNQ9hkM9 jMrFMfz23e2pGBkX42EW0qeG5L+wb+xrZiDBMDrvO8gyCv2EAIks5gwGuYcDAjY/giMoCh 72Zyx1zCERClsV4A861DRPwsILt7VsC5DGbGgI4ueH5jNR8Uen1esng6TxLQDIw+stx3Xy g1VaIFrHtj3uOqik74eK1ADatJqYqy0mOIiFIOpZYJXGhuwWFVrcuUspFMVO7A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712607961; a=rsa-sha256; cv=none; b=MVZadQyr6wx2XLyiuEmAK3+XqRw1m2hPUPuhPUulZh4iS7Pis2tvD8kLOGg/M+PM8CHgv/ 2lIz5ptfujKeIlYxv4ad36M+fJamtow6/3j5vt/aGyCIclENN/yUul+0vuQD3dpBskh1GH AGeDemBuKrslvkfkr/yUBo2suGk0ye/p4DChJ8TRKCDwQ4H1yZdvXXIAtfeTYkGJl6tf9h CTzGyHGMPX1WFDmkFw88W/CX5Jm1/CLTbHK1eSpGtXthtOFgZJfDrE/zigW4rs2Ha33XTN MEfs4+quIbMRl3LcHPzaSntCW4znNEZt3DVCfcAEMmhNNhREf0cm01GCLZYcHQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712607961; 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=HOUt+6jUFqH6IBGs5SZ3EJABXS+jRJzt3t3kQBABqGk=; b=AQWFN2Crp8+Upkawj9YD7zBcL6lazv3IE5pz3FMOYOgkrKP+D6bGPc6XA3Js1LGfg6Gl4L Qn0H27IYQM80XGJySViW18NcCQUFhYBRqD6IbGT27nfJy2Xv9uoA0mYoxQnEm9CQyRxZv/ 26xWBuqmIps/h9y6z91QND29iVD5Svl/4vPGA45MCn+5nJ1S/KGTXyVxWYuTNBhZeC/Vp2 cH7CAU34W7UQTBL9Vjny1iIdcQ/twoT6AmuNrrmF9YwiQ1sUK/Uils3jjxnsYb+uZVOeFi 60rhg28nCeF46eLonj4mftXPaXijsmvqcLQnoLq1BtqCUU7ed+G3XgYl557vHQ== 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 4VD0wT0GdVzQGT; Mon, 8 Apr 2024 20:26:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 438KQ0xh040407; Mon, 8 Apr 2024 20:26:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 438KQ0i2040404; Mon, 8 Apr 2024 20:26:00 GMT (envelope-from git) Date: Mon, 8 Apr 2024 20:26:00 GMT Message-Id: <202404082026.438KQ0i2040404@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 661e3d4f1548 - stable/13 - nvmecontrol: Update the test for a valid firmare revision slot 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 661e3d4f1548707358c3e1e51eeaf806b0a6f786 Auto-Submitted: auto-generated The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=661e3d4f1548707358c3e1e51eeaf806b0a6f786 commit 661e3d4f1548707358c3e1e51eeaf806b0a6f786 Author: John Baldwin AuthorDate: 2024-03-15 15:18:47 +0000 Commit: John Baldwin CommitDate: 2024-04-08 18:01:32 +0000 nvmecontrol: Update the test for a valid firmare revision slot Reported by: Coverity Scan CID: 1539214 Fixes: 7485926e09a0 nvme: Firmware revisions in the firmware slot info logpage are ASCII strings (cherry picked from commit 1b38f851d809950cfe112c705029f40edd0579b3) --- sbin/nvmecontrol/firmware.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/nvmecontrol/firmware.c b/sbin/nvmecontrol/firmware.c index 256847ef8ac2..80bbff032cf2 100644 --- a/sbin/nvmecontrol/firmware.c +++ b/sbin/nvmecontrol/firmware.c @@ -105,7 +105,7 @@ slot_has_valid_firmware(int fd, int slot) read_logpage(fd, NVME_LOG_FIRMWARE_SLOT, NVME_GLOBAL_NAMESPACE_TAG, 0, 0, 0, &fw, sizeof(fw)); - if (fw.revision[slot-1] != 0LLU) + if (fw.revision[slot-1][0] != '\0') has_fw = true; return (has_fw); From nobody Mon Apr 8 20:26:03 2024 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 4VD0wW5G3lz5Hhwd; Mon, 8 Apr 2024 20:26: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 4VD0wW3Bn5z3ymK; Mon, 8 Apr 2024 20:26:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712607963; 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=XjsoSjW1hc/0TIYup4hWsJO/qvoA1bcizQk7/ENseUs=; b=yuHFR6jYrrQhai6Po3kc/tqVIC+rRzEBpaGrGhVihnEP3gB+dCoOC8uAWKhz5/zcZzLEwJ 4R8ZVCcgeno3K7HfSjHxKnTwiPKl2gKUNMgLFUWH77lgg2GKh7N+GuRNw5Gy2iUHc0ms+B 9qED9RyYFiroaiEXUWKrK/5Ilf9ft+GuOJRzpg00mtFJw7dryNbpGZvozkUQfm8s/ya8/1 AMfy9TZM3RX58PljDko7wMr/FrpxzVMv+pEiSq6Iq5nItvzmJw92/HpHBMAIfPRsnbKpTe Cy80+nhyBKCcl6IeT0ZP17pPqihcy/dKMPaOzK0XI4R4QymLXjG4+wmJ4c8gpg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712607963; a=rsa-sha256; cv=none; b=dVAm3QgTaOK60U97DP5EF67Uc7N5+bYJFUKDqfBMWEyOMCYhsp5JirPd8/pIHNSJthaye4 vdyigM1wAWIWrYjQMy9yHJoaP2YrUAXS53QmT3E+aUAWAz7Rn4JZd3LMvIp9j9u5jmM/rA JPWSpkUGWBPt9u3MhJumLIKtyhwW18Y3L2SYUcu3KuMPRvMmgSI3LgGKuctOEQOOvEq7Hp eCIJG1L47zzAhB/Fd2i9lk1+rUJTGIti+SxTrygj5v5iA16CACrfUiy8p4oN1H2H6OPk7u vdsdwYURMsuluMSeechMeDGVmfINtKMv2Qku7lW7sssQRjpeZJO8EqKrVTNYGw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712607963; 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=XjsoSjW1hc/0TIYup4hWsJO/qvoA1bcizQk7/ENseUs=; b=xvSDlW4q+mWJwIqFWCimfxkHADHXnU0usbx7+RFJbpYUrH9VR1I4M9yYSpK9sxHLcJ296U 9X+nCxoXqEqeYc7AYvuN/rjCN/IoyvTI5ynBHM8JuuyFFUB0fe4K2DRtRzw4NICUdeYDrC RfMsk6iAm4tbV5iVtxBuBD57Ziz5h+OKDt0p8mm5WaVyApsUhBbjI8w24UZ/JvdB/EoKm8 178A/+jquq2tOMmQxO7zuZLeOdO7cuM3YOAllD3jSe1wU1G4mo7RF4thv4lqgNkg252Eez dEBL5yR3Vn8RHNJ5K94GSCePWMi86jVSXXJD9hY9uq5xdfKngLtJ3ul2d4c1UA== 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 4VD0wW20KgzPmD; Mon, 8 Apr 2024 20:26:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 438KQ3Iv040501; Mon, 8 Apr 2024 20:26:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 438KQ3B1040498; Mon, 8 Apr 2024 20:26:03 GMT (envelope-from git) Date: Mon, 8 Apr 2024 20:26:03 GMT Message-Id: <202404082026.438KQ3B1040498@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: c0ee9e5e410d - stable/13 - arm busdma: Fix parameter types to exclusion_bounce_check 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c0ee9e5e410dbdbea04e2c30e7162d8e5f6c4076 Auto-Submitted: auto-generated The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=c0ee9e5e410dbdbea04e2c30e7162d8e5f6c4076 commit c0ee9e5e410dbdbea04e2c30e7162d8e5f6c4076 Author: John Baldwin AuthorDate: 2024-03-15 17:10:07 +0000 Commit: John Baldwin CommitDate: 2024-04-08 18:05:34 +0000 arm busdma: Fix parameter types to exclusion_bounce_check These are bus addresses not CPU virtual addresses. Reviewed by: andrew Sponsored by: University of Cambridge, Google, Inc. Differential Revision: https://reviews.freebsd.org/D44343 (cherry picked from commit 66658b0f2775824b2a80fb56ca15e6ceae2f8240) --- sys/arm/arm/busdma_machdep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/arm/arm/busdma_machdep.c b/sys/arm/arm/busdma_machdep.c index 9a3378141207..584a71d84546 100644 --- a/sys/arm/arm/busdma_machdep.c +++ b/sys/arm/arm/busdma_machdep.c @@ -284,7 +284,7 @@ SYSINIT(busdma, SI_SUB_KMEM+1, SI_ORDER_FIRST, busdma_init, NULL); * express, so we take a fast out. */ static int -exclusion_bounce_check(vm_offset_t lowaddr, vm_offset_t highaddr) +exclusion_bounce_check(bus_addr_t lowaddr, bus_addr_t highaddr) { int i; From nobody Mon Apr 8 20:26:02 2024 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 4VD0wV59bvz5Hj6F; Mon, 8 Apr 2024 20:26: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 4VD0wV39JXz3yJH; Mon, 8 Apr 2024 20:26:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712607962; 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=4EVIG3Xf5BYE1dP7SN0OTs0cEu9A3Ladz98FDqZAZEU=; b=pVrYmunfk0hjzwLOeGg8MfJAGQrEPqhIKKmR6emUDcpP0WSjHqX7cgrkRiYt6E8Ut5x2tH U8YibaPuD2JgA/kbDarh9ZLh75DT54mJzJOWZM0EcAxhEqqQY3SFQou593l5SjyziA51Bx sytoho/knNpbiFAA2/ap6jap0wYGIO46yp93uB6vudwllJbFcvgOon+aD0vqk6RQQ/Ne9X KE4kBNZcYqt//A/ZUTcd2nAxSaE5kP+PW/BunwrpUbNoDkh//SKrbPLRD0VRj+W8d5uFzl 3k3MS+WVfe2qPfYR5E0e47WBw9VhEZDw3Lv5fWzTkfR0qHck0Y0r5tMTfQN3Hw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712607962; a=rsa-sha256; cv=none; b=rf+wSq512lW2omg17mb51JyIiZLMt0Af7jN2WbUeaREgZFiSlr4vonJbzdTlxk7pP+7X4Z SMy/Z7tJOoOMN7EHqjfUUnN1wgXjImVoPoSr9X/hqWHi8iEX4ObE64GYnRKeGX/tugTiSu SB1qxnxxtQwBw5ITFwVfqyPrFB4c5WTrvwkN4C3aqhm9UbOMc0sxi8QrsAPSAfEgsVPDvn //br2mvBX7rD1O3fNmBkY7cU+2llVUcS/PDcVS+YU6dHqMf8yxBGQjSkKlrXP81Ytx+O5t OngoG1iWpf3XKQ3vVzonmfuhRAQrm6Hd2sWQec8iIQcgEm/0BnE75wDb1/dUag== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712607962; 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=4EVIG3Xf5BYE1dP7SN0OTs0cEu9A3Ladz98FDqZAZEU=; b=pk0X9X6pguLO5R9JeApZQuNG2fQmVjQ1Ust2wERvP6IvaLSCP0KQQ6/VgyV5NsErfAFL5p u7L9i3neLHaNtDI2QAjL8F63DuMTY3OG+O7RAcdKHpNy6i2f6C8XDI0gDsvHSNj8Wjv8Xr Fof5mBJN5s1s8tCY0PkSd42hGm0/RVGzpa1C9HDk+tAtrOiZHlfppesl99Bkn7VsIVn/m9 izSZ6vIN7joQXv9Y+JUvwQO0WYa1fDfpv8EVV1KF5ZjZyHr4ruXvEkVdanrjfKKBqHfO6M IDuCQdb7rKFsDWmilqOmQc8T30V6MQjfzDoW01zdIfLFYiUGZAg5XOQ10GIxqg== 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 4VD0wV1JbCzQjW; Mon, 8 Apr 2024 20:26:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 438KQ2uE040453; Mon, 8 Apr 2024 20:26:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 438KQ2qh040450; Mon, 8 Apr 2024 20:26:02 GMT (envelope-from git) Date: Mon, 8 Apr 2024 20:26:02 GMT Message-Id: <202404082026.438KQ2qh040450@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: dcedc7b7f29e - stable/13 - .github: Switch to v4 of actions/checkout 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: dcedc7b7f29eaa42152590037bb76fd6fc2d86f2 Auto-Submitted: auto-generated The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=dcedc7b7f29eaa42152590037bb76fd6fc2d86f2 commit dcedc7b7f29eaa42152590037bb76fd6fc2d86f2 Author: John Baldwin AuthorDate: 2024-03-05 05:52:09 +0000 Commit: John Baldwin CommitDate: 2024-04-08 18:03:08 +0000 .github: Switch to v4 of actions/checkout GitHub is emitting a warning that v3 is deprecated due to using Node.js 16. (cherry picked from commit e6dccf00500d7e9e2311b372e28897df7c0421dd) --- .github/workflows/cross-bootstrap-tools.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cross-bootstrap-tools.yml b/.github/workflows/cross-bootstrap-tools.yml index 9630470d0420..47349a517a1f 100644 --- a/.github/workflows/cross-bootstrap-tools.yml +++ b/.github/workflows/cross-bootstrap-tools.yml @@ -37,7 +37,7 @@ jobs: - target_arch: aarch64 target: arm64 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: install packages (Ubuntu) if: runner.os == 'Linux' run: | From nobody Mon Apr 8 20:26:05 2024 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 4VD0wZ0JFmz5Hj00; Mon, 8 Apr 2024 20:26: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 4VD0wY4qcmz3yvD; Mon, 8 Apr 2024 20:26:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712607965; 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=c0e5uPwC4IpC1IgOOy+sX0GXZZlrq95jiWhX4gcYGdY=; b=VGC9p1nReD3B/4Eerr3fnlEEvkOJdrmDpUs0U1koWpAa6IiOYr3I7t0SWtCchga4IwO2D1 EAHKDj9p238W3XtsSSVBCxjsosSrl32O5UTcVx7Se7y0N9yQniI33YbTcfhNbQGZHG59mq 3kDw1F+P/j3kTFganM31uGfKs3gd7psINcJDAeSJ21HtSsp9UgW5lJUjvtE++njHEfHX4D eNpuYL+p5/1Zk1tYPJZt6aFTK24fHwUpG2ncUo80khuktHa4uokYoucAWIP4C6OgLAtx8C whXoBLNM7MkFEEuC9CSiERaKqh7EvdJXzTKgQ/aBu+XlnNWYuA0CslP7TFw2cQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712607965; a=rsa-sha256; cv=none; b=E/WkxqtCAA8lDMOK9cdLcJMEi6n8LULPx+0maFUqurOLFdiqLUbeXB5uCdQUs2xu1rdFuP ImltY92kaXP+7QJiBC74WwCil9ZSHCeIhuZu+TNhrb1PgXYOu/qCitUp2zoJIRnK5NKs2D eITkMMko/XNvG8qBxbKtQ2KZpIieDWzQ4jI9plzuoy+ExGa1BMzKhIQSQqOgpA3zUEyv8d 9H2iTgLOXf5PQncfJYfuar3OZGflzpmEH/d4+LL6hVcslkfZha39RCa9rXCB0dvDYa1fI+ 2/cj+457vlhitqPRSAicpS5YB/CIewVaiJJ1gn2A4uU0GxKAs5Z7VuD1NwEV3Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712607965; 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=c0e5uPwC4IpC1IgOOy+sX0GXZZlrq95jiWhX4gcYGdY=; b=A2vfe0GHLXoizj9uj1w2kd/mx/AXqJZI6WAJWD8D+B+6KzrqUi9mW1Kz8EM+i+mSPTtbBc 68TFXZT19l0HBxRJGCCK3EfkjrRA7wR/8kcJ3FbzbhL4aMfmZ8xIMu7Pge4d8A9uXZzxoz GD2j8Q+aj1scQLfWZRo2nkU8D96bMpZ4WqgRLp+3Ap0MLjp75zTLRcH0u/KME2057KG1e8 7xOXSXKc4ToBOondNSIULlHIP3z0T4RB1rMYR7qVYu07OfEdRLI9k+DlaH4pzTFla2pex3 8HNMW5Jz5vl8maKaPLvtpwS9hCb3N1sMlsccscTwxC4NgXx5LKU6nhALM8dnfw== 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 4VD0wY4Q8kzQRy; Mon, 8 Apr 2024 20:26:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 438KQ5rx040627; Mon, 8 Apr 2024 20:26:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 438KQ5wF040624; Mon, 8 Apr 2024 20:26:05 GMT (envelope-from git) Date: Mon, 8 Apr 2024 20:26:05 GMT Message-Id: <202404082026.438KQ5wF040624@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 092dd9545f65 - stable/13 - ddp: Clear active DDP buffer members to NULL to pacify an assertion 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 092dd9545f65b18967390e269107d85fd309d7be Auto-Submitted: auto-generated The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=092dd9545f65b18967390e269107d85fd309d7be commit 092dd9545f65b18967390e269107d85fd309d7be Author: John Baldwin AuthorDate: 2024-03-20 22:28:43 +0000 Commit: John Baldwin CommitDate: 2024-04-08 18:06:58 +0000 ddp: Clear active DDP buffer members to NULL to pacify an assertion Reviewed by: np Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D43999 (cherry picked from commit 25429e274371eba9a90ea27cbf73e88329916e0d) --- sys/dev/cxgbe/tom/t4_ddp.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sys/dev/cxgbe/tom/t4_ddp.c b/sys/dev/cxgbe/tom/t4_ddp.c index ff63b25c4db0..961e069c1f83 100644 --- a/sys/dev/cxgbe/tom/t4_ddp.c +++ b/sys/dev/cxgbe/tom/t4_ddp.c @@ -186,10 +186,17 @@ free_ddp_buffer(struct tom_data *td, struct ddp_buffer *db) */ if (!aio_clear_cancel_function(db->job)) ddp_complete_one(db->job, 0); +#ifdef INVARIANTS + db->job = NULL; +#endif } - if (db->ps) + if (db->ps) { free_pageset(td, db->ps); +#ifdef INVARIANTS + db->ps = NULL; +#endif + } } void From nobody Mon Apr 8 20:26:04 2024 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 4VD0wX6zsVz5Hj2L; Mon, 8 Apr 2024 20:26: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 4VD0wX3mmbz3ynm; Mon, 8 Apr 2024 20:26:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712607964; 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=DUB2OarcR54MCcPM32qcFDvlOPQh9MHp5f4DR3Nuz4k=; b=dgOxI9bcUUw9g/QwmiL15uQ/v16H6cnts8pVTbbOe18kRuzQZHbq7S6+AkapTtLfQ84LQQ xg20J5rp6eeHJoMkJzJ1a6m1aAOuaIIo2uFJNKk3DO0HyfcknH8ygH7rRmDm3tqfBZNuBH AIVyD2DfnEydsrX7XcX+NY8PnWWjjRzHhYF894N7agACjN/IJsCJdsXXIRtcEHOjaUoczd 0vJkBbTF7GcG/oJALP9LvGTkaWQV1loNtbW3IsYW7ILurrQtr/PsWvAGDTDAuHPR/t/LsD E+zOmwtY90n3jsn9XifeuJouzAl6G2oSmniHYkThmmlNpgQPTf7kdnRKdzBFqA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712607964; a=rsa-sha256; cv=none; b=MNYffjB6O+IWwBnja+AkubQMhzPraNsUWCsIS+3Gez9iiYBqIzmuyr1+fbSfSt1blwmr8E RYcyyKOctH9Y/q71fQTPQY0Z1b0AKSa/JXohr+obeil8KyTWl33mgW7INxDzSaj2slCgnG yVRS7arFnid1giNk2+jMtBK3jef1ye//1wRpWeaXLuI4SdQ5kmZ2rRC0GThTNXRjDHOT7/ 3vdHd2EM2U8YNXzkeBUxHWzmx9yQkcPAiBi3SCbDeLXip7uNQFkO9fOtfSJTIWbySYX+Ax Dqzy4pcnJeYtWrqFQoVsb5BDukICpf7BDHtP5SMZEvrDDhFRlcrRUAHlkOEYtQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712607964; 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=DUB2OarcR54MCcPM32qcFDvlOPQh9MHp5f4DR3Nuz4k=; b=jlFMojjeBj9mcR4uFzfWOJp/wssCfC62Pp2FuGJwqOCULRzjZVxY2gZQUHzCyhbjFKwETc gDnaN0kENEdSA8TWAIuO8NAoYIHtY0NurBh1/+uZu0MDcWpiNP3rx0wN4adQis2HzrooV2 ZR1uF5tslrQG9UPtzKiXfq4JBj4jG+ruy/rvpSkfvZrg15n9vcm+qz1dskkMfhQ6qi3o7f 8F18vW8SaM2glCwjWLFmT3+VVdiy9sL57YJI6bYngrT+F3cwsJgggyfGfOK0D8/lRiYe/K uF0Hk9DwD5bbkS/BgdJLKPxZi5pUWCsN/B6hgRbJG+58q2ToYAZT3hEoZgezRQ== 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 4VD0wX3M22zQGV; Mon, 8 Apr 2024 20:26:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 438KQ4jT040564; Mon, 8 Apr 2024 20:26:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 438KQ4vo040561; Mon, 8 Apr 2024 20:26:04 GMT (envelope-from git) Date: Mon, 8 Apr 2024 20:26:04 GMT Message-Id: <202404082026.438KQ4vo040561@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 257f36a7dbce - stable/13 - kldxref: Properly handle reading strings near the end of an ELF file 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 257f36a7dbceda3f89c688aaedf0c56883a11f3d Auto-Submitted: auto-generated The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=257f36a7dbceda3f89c688aaedf0c56883a11f3d commit 257f36a7dbceda3f89c688aaedf0c56883a11f3d Author: John Baldwin AuthorDate: 2024-03-19 00:01:23 +0000 Commit: John Baldwin CommitDate: 2024-04-08 18:06:41 +0000 kldxref: Properly handle reading strings near the end of an ELF file If a string is at or near the end of an input file and the amount of remaining data in the file is smaller than the maximum string size, the pread(2) system call would return a short read which is treated as an error. Instead, add a new helper function for reading a string which permits short reads so long as the data read from the file contains a terminated string. Reported by: jrtc27 Reviewed by: jrtc27 Sponsored by: University of Cambridge, Google, Inc. Differential Revision: https://reviews.freebsd.org/D44419 (cherry picked from commit 785600d0fb13d6f0b4595bf4dbbc048113dda71d) --- usr.sbin/kldxref/ef.c | 9 +-------- usr.sbin/kldxref/ef.h | 4 ++++ usr.sbin/kldxref/ef_obj.c | 9 +-------- usr.sbin/kldxref/elf.c | 18 ++++++++++++++++++ 4 files changed, 24 insertions(+), 16 deletions(-) diff --git a/usr.sbin/kldxref/ef.c b/usr.sbin/kldxref/ef.c index 1ef27f2bc54a..77ddada946f2 100644 --- a/usr.sbin/kldxref/ef.c +++ b/usr.sbin/kldxref/ef.c @@ -549,7 +549,6 @@ static int ef_seg_read_string(elf_file_t ef, GElf_Addr address, size_t len, char *dest) { GElf_Off ofs; - int error; ofs = ef_get_offset(ef, address); if (ofs == 0) { @@ -559,13 +558,7 @@ ef_seg_read_string(elf_file_t ef, GElf_Addr address, size_t len, char *dest) return (EFAULT); } - error = elf_read_raw_data(ef->ef_efile, ofs, dest, len); - if (error != 0) - return (error); - if (strnlen(dest, len) == len) - return (EFAULT); - - return (0); + return (elf_read_raw_string(ef->ef_efile, ofs, dest, len)); } int diff --git a/usr.sbin/kldxref/ef.h b/usr.sbin/kldxref/ef.h index 25dc5216b169..9d3dc1b1b435 100644 --- a/usr.sbin/kldxref/ef.h +++ b/usr.sbin/kldxref/ef.h @@ -189,6 +189,10 @@ int elf_read_raw_data(struct elf_file *efile, off_t offset, void *dst, int elf_read_raw_data_alloc(struct elf_file *efile, off_t offset, size_t len, void **out); +/* Reads a single string at the given offset from an ELF file. */ +int elf_read_raw_string(struct elf_file *efile, off_t offset, char *dst, + size_t len); + /* * Read relocated data from an ELF file and return it in a * dynamically-allocated buffer. Note that no translation diff --git a/usr.sbin/kldxref/ef_obj.c b/usr.sbin/kldxref/ef_obj.c index 1274a14c10af..ac83137cd394 100644 --- a/usr.sbin/kldxref/ef_obj.c +++ b/usr.sbin/kldxref/ef_obj.c @@ -248,7 +248,6 @@ static int ef_obj_seg_read_string(elf_file_t ef, GElf_Addr address, size_t len, char *dest) { GElf_Off ofs; - int error; ofs = ef_obj_get_offset(ef, address); if (ofs == 0) { @@ -258,13 +257,7 @@ ef_obj_seg_read_string(elf_file_t ef, GElf_Addr address, size_t len, char *dest) return (EFAULT); } - error = elf_read_raw_data(ef->ef_efile, ofs, dest, len); - if (error != 0) - return (error); - if (strnlen(dest, len) == len) - return (EFAULT); - - return (0); + return (elf_read_raw_string(ef->ef_efile, ofs, dest, len)); } int diff --git a/usr.sbin/kldxref/elf.c b/usr.sbin/kldxref/elf.c index e5fe90169d2c..a93cf996ccc7 100644 --- a/usr.sbin/kldxref/elf.c +++ b/usr.sbin/kldxref/elf.c @@ -197,6 +197,24 @@ elf_read_raw_data_alloc(struct elf_file *efile, off_t offset, size_t len, return (0); } +int +elf_read_raw_string(struct elf_file *efile, off_t offset, char *dst, size_t len) +{ + ssize_t nread; + + nread = pread(efile->ef_fd, dst, len, offset); + if (nread == -1) + return (errno); + if (nread == 0) + return (EIO); + + /* A short read is ok so long as the data contains a terminator. */ + if (strnlen(dst, nread) == nread) + return (EFAULT); + + return (0); +} + int elf_read_data(struct elf_file *efile, Elf_Type type, off_t offset, size_t len, void **out) From nobody Tue Apr 9 04:11:15 2024 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 4VDCFJ07Gjz5GY5Z; Tue, 9 Apr 2024 04:11: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 4VDCFH6NrFz40LX; Tue, 9 Apr 2024 04:11:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712635875; 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=5HML0JfdLawuwUIHmEgQcPFw6iWP2WZu66PrZ6iubHw=; b=r8m3TKP3vxQITf+JDfP1nB3sJCuoWMYfvDVhN4ZRT86x4ZraLe0rSJ+cWfmnO33NY6q4eV etkyxTneF7GtMpXeZPs/CaQXY9gpEpwSFYe5/lFTEYYGLMhJBiWsjrIEW4rczJpR82ydkE 2DEjgI520GNzZrjH8hk0tuBmszuziK1HiTMGuAxQrzP8pUeOY6w/yvE2fLLmclbcYmy4cE TivNlhHn8xZVvLNVkOkd94BNLOI7kpgzzlekDH8Y7UK31+aKNDYTiGlzqzaqVXRA8iXHDx G4xsQrTeBqUMT7zwy1CXloySqwKznfuNhr02I9H177i6XVLbCkLmvUqnahtU6A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712635875; a=rsa-sha256; cv=none; b=IkyU6x9mIG5FKjlPmeS//XG1/K/FQ6BdvUpE8KP0tdrLM1jF2FkKBYQrkVb2lREdqgR6ta vvoe8FjneuGRZPtbghRyYTGBamU7TL9zJGcei56wu0IZ7ysW3OnvB/+dR+D3riwUfEcnLw WJS5wD08WA7VfdTKQFQIVlX0LVYm9a8h+pR3M5p4ZFJX/GQR9dZVtjijsDQHE+xf64se0u NVvd+65aWnDw68QR9AzeeFGTOpRanwD8pAaI4XUjyhnrkA/un8IGvOuaaWWGVgQrTD7e3c IXmD5iCODU/vFPAxCo7nj1DgMoFqV6EgNagc99dhl1SXnTyvS3mZyfVG64jBkQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712635875; 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=5HML0JfdLawuwUIHmEgQcPFw6iWP2WZu66PrZ6iubHw=; b=OASxYarhs2zZpznfiTEjGwq0ec2AFUAUOE3RR97RgGP68c6R/ArTpzCoWCtkyoDodhgv8i Y3/oCcBsh7XaSDeUR/rPUDUDqx/yy7eVfU6PdgyAA/ci03VUW6STEGQNfKseMtoemGMpO1 tAEL3l2MeISdLOvxTTsQPzG7UGhUTcu3xLqZqHPuLJTwquXXlGRmineUtF2heyCg35KyxP j2n9debtsodq3IgNGqGC/zI0nmajGLChK5Zg9fyLk0TSiO1DXfnHpfQeM2+EP7/2IIQ2ZD EoHIUs7lkrux7emfnJ7cjNOell07syt1+ZdTQp3c7JEodh+s0PHnfWtjm9w3aw== 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 4VDCFH6068zfch; Tue, 9 Apr 2024 04:11:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 4394BFak033220; Tue, 9 Apr 2024 04:11:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4394BFKO033217; Tue, 9 Apr 2024 04:11:15 GMT (envelope-from git) Date: Tue, 9 Apr 2024 04:11:15 GMT Message-Id: <202404090411.4394BFKO033217@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: f1994d1eb215 - stable/14 - kern linker: Do not unload a module if it has dependants 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: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f1994d1eb215a2b7cb644329797dc623ec883120 Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=f1994d1eb215a2b7cb644329797dc623ec883120 commit f1994d1eb215a2b7cb644329797dc623ec883120 Author: Zhenlei Huang AuthorDate: 2024-03-26 03:55:45 +0000 Commit: Zhenlei Huang CommitDate: 2024-04-09 04:10:07 +0000 kern linker: Do not unload a module if it has dependants Despite the name, linker_file_unload() will drop a reference and return success when the module file has dependants, i.e. it has more than one reference. When user request to unload such modules then the kernel should reject unambiguously and immediately. PR: 274986 Reviewed by: dfr, dab, jhb MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D42527 (cherry picked from commit f43ff3e15c8b4b161ce09c8ab008abc4222db26b) --- sys/kern/kern_linker.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/kern/kern_linker.c b/sys/kern/kern_linker.c index 2b220295f78e..69c746fe376d 100644 --- a/sys/kern/kern_linker.c +++ b/sys/kern/kern_linker.c @@ -1222,6 +1222,8 @@ kern_kldunload(struct thread *td, int fileid, int flags) printf("kldunload: attempt to unload file that was" " loaded by the kernel\n"); error = EBUSY; + } else if (lf->refs > 1) { + error = EBUSY; } else { lf->userrefs--; error = linker_file_unload(lf, flags); From nobody Tue Apr 9 04:11:16 2024 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 4VDCFK5nKRz5GXgx; Tue, 9 Apr 2024 04:11: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 4VDCFK0K3Lz40YM; Tue, 9 Apr 2024 04:11:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712635877; 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=vk8ja3fYgqpmVLnVaOeorTUHcGvwb606df1TwKLPMUg=; b=ViVUMU5LKIoR0TnnFNDV5/jllO/Bvacj7tlRdOojt9uze4hkDdR/GMDW6gZevGgCl1gQ7p uNcySZdU6J6d/moekdpW8At3UNyhKubKyaGDDcyqyJ5ighDEywqbKNPyhkjY77hfuDWk9e A8BxEvR5N3+NQP0Avf8rdxav/rKX8D36skkXp8TQsvwSpXYmddpxeMpQuWC5VepDbHSMnF 9BX4e/oftjpePeed9mmjj9anVuTwraVkYy6O+0mxXSbfk7TB+vVzR2kkvxq6jfGmElI9aJ qiRPB+iYrlX54TrAH/ysmGrlE3l2uSJ4SCzxyrZNAzHzlRdFMTLLT7TKeP9JIw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712635877; a=rsa-sha256; cv=none; b=AD/imKtoKVxlBTae4JPKH5LGaZjnAG7lcRdWyH+2XM+pzxtc+bK/2joRH2E/vBkUrGhdr1 84n4Rs9kXbMkR3PWkLEl5QcKglxSmOPsNL+zI14l/KeghWuf5Oce/ifEEUa9M++kd86oZp FJOtZi0CvydcbWJenFfilJiguTV9bMJXchZWdJUrcQgmWUSxlrCyjm97Dm3Y1HFyjy/Aqs iXYsx64por6/wtjbv8PrPHKOxhVyru5zMcXJ6YN4Tw0JRB8P78WZVyV1V9gc0PG0yBF78D mYZHhcKZgrX3c7wzDd9g6upZYwZz7oeRcO6edhJQP6mzSop4MoMu5xNnKsIPAQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712635877; 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=vk8ja3fYgqpmVLnVaOeorTUHcGvwb606df1TwKLPMUg=; b=jzsLqpnxbEJUW4o99qcwmrlyhUS5I7GGa9osZRw7mzAwiFnlVoO02KnTpYClcDpwhfyYhU T0s8fWBkKvlXM9w728A9L1U5NtMpOnkw1j/aDvI+k0FyHPOJF8WkjUmA0+RSnEjOANGG5m PLLdS4MOXmAakjd4aFTGYC7x9Cr7OKafEIGVCke5QAzYPdwqULSUzjZ7HpQtbXxfcmYdcv dXnVnZHhMV39Hu8VP+sohKWjJNT1r6gueVzNYkYZsGd63awagvcszz6B/7qJqgByLs/AS/ 8/Gi7UZq9w5B73habZN+WhZwewa0XB0pXGUFqJEKeKX79F1r1eL55oHxkyvnYQ== 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 4VDCFJ72QVzfck; Tue, 9 Apr 2024 04:11:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 4394BGfn033283; Tue, 9 Apr 2024 04:11:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4394BGTU033280; Tue, 9 Apr 2024 04:11:16 GMT (envelope-from git) Date: Tue, 9 Apr 2024 04:11:16 GMT Message-Id: <202404090411.4394BGTU033280@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 7da45efb0921 - stable/14 - kern linker: Do not touch userrefs of the kernel file 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: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7da45efb0921e9937353992226f34b25ae197545 Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=7da45efb0921e9937353992226f34b25ae197545 commit 7da45efb0921e9937353992226f34b25ae197545 Author: Zhenlei Huang AuthorDate: 2024-03-26 08:47:02 +0000 Commit: Zhenlei Huang CommitDate: 2024-04-09 04:10:25 +0000 kern linker: Do not touch userrefs of the kernel file A nonzero `userrefs` of a linker file indicates that the file, either loaded from kldload(2) or preloaded, can be unloaded via kldunload(2). As for the kernel file, it can be unloaded by the loader but should not be after initialization. This change fixes regression from d9ce8a41eac9 which incidentally increases `userrefs` of the kernel file. Reviewed by: dfr, dab, jhb Fixes: d9ce8a41eac9 kern_linker: Handle module-loading failures in preloaded .ko files MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D42530 (cherry picked from commit 39450eba8e6cd5b83def724481127b58ecc1fcc1) --- sys/kern/kern_linker.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/kern/kern_linker.c b/sys/kern/kern_linker.c index 69c746fe376d..c9e31437c7c6 100644 --- a/sys/kern/kern_linker.c +++ b/sys/kern/kern_linker.c @@ -1786,6 +1786,9 @@ linker_preload_finish(void *arg) sx_xlock(&kld_sx); TAILQ_FOREACH_SAFE(lf, &linker_files, link, nlf) { + if (lf == linker_kernel_file) + continue; + /* * If all of the modules in this file failed to load, unload * the file and return an error of ENOEXEC. (Parity with From nobody Tue Apr 9 04:14:02 2024 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 4VDCJV6p9dz5GY78; Tue, 9 Apr 2024 04:14: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 4VDCJV6HZ1z41Jq; Tue, 9 Apr 2024 04:14:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712636042; 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=hQurx+N9/l4J2ju8BG6HQWMCbKD83zZk9Qa7W8wlczs=; b=aUPNxqJf1I366TlwPGzGX4LrPBdsUNIajLC9obUpy2AELF8+s4TSEpWf8p9SdvoWB9/xnK dX5scykjiNQ8H1sqbUftgiKrGbRiEFQ4V5LDHYHAOLW2uBANq96pqfE4o28K954ptdCu5L xqgi0XVGkzsRkgwGVX/VCyuHJ5OKCzybK3ZcjzHMxiKk4VzyyDwXc0bPL/rY9hER22QFBu KyeVQiG29yOBd+feqYithmGRECc6n00kzfZIydFk9NdEl+geuyo7oOr+Phmt7JtESuPjHt yjV79HJkEJu8bo1JcV1ozuo+IAWUdiBBYmKELhDVYpOXHAJmuWVsi5eH51MnSg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712636042; a=rsa-sha256; cv=none; b=wHLalVys0Jjo3c6MZfONcXlyWxPMu4eTe39gdgikFzmutrvcktjdCbD42TJ/AuVXH4wXKc yIdfspmMBQ+yTHzvScK3hbrrbMKXrj5CzRqZ2CajsGQngz6S+ZuuLO8kPwPnauKJbnJ4ve qYV/4AnkDxXF7hwcGH2c9QS+XqgCJdznIztPxFcXp6L3uq3whc0/WcCWDwsktvIpw7exlC NWsSNsJusURpyY1FEFd+VU4QkibAatbH1bbIvllo4UllvuSn4Ppnu6fRKwgHEmK9Mp73P9 g3FhnVJWwLNM22ANddkYk9PSUK0ln+srxEAfKsGRH0SlxyzkMpDcXns0xftd1Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712636042; 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=hQurx+N9/l4J2ju8BG6HQWMCbKD83zZk9Qa7W8wlczs=; b=EMc1tLKsX5TgI1OSvmX7u+yYdd+WWuRZbumQCvjbQ9h1yEaubZHrAFA8qkNuZ492ES0XH4 bBTfbmNb/7ECobe+lpBrGBtnPkaavXsHvDDrxka8iw+6rly2dskbUbLZiYFMSpo4jkTamH D1pKd7lOTsdglNIAhjE9EPqcgTLQpyOVFM8wboMbLHolypgpUqtxwXWoN4mNhP1dDg8yfw HNMTNu5KVJQg+sepmgx8XO0ihMJmhZMVRURVFaxz8Le3W9wESDctbsB2G2LFdbgCbUaxSH WRsoHwXkACz6LF4lPVfwrGda8oCyV8AJXwhgB1ZtMqsSI71iJUL0rxWAXBD99g== 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 4VDCJV5tz5zg7Z; Tue, 9 Apr 2024 04:14:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 4394E24N039501; Tue, 9 Apr 2024 04:14:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4394E2Mw039498; Tue, 9 Apr 2024 04:14:02 GMT (envelope-from git) Date: Tue, 9 Apr 2024 04:14:02 GMT Message-Id: <202404090414.4394E2Mw039498@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: a2f57656620d - stable/13 - kern linker: Do not unload a module if it has dependants 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: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a2f57656620d2ffbb8b79789de34a6fc657286d5 Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=a2f57656620d2ffbb8b79789de34a6fc657286d5 commit a2f57656620d2ffbb8b79789de34a6fc657286d5 Author: Zhenlei Huang AuthorDate: 2024-03-26 03:55:45 +0000 Commit: Zhenlei Huang CommitDate: 2024-04-09 04:13:08 +0000 kern linker: Do not unload a module if it has dependants Despite the name, linker_file_unload() will drop a reference and return success when the module file has dependants, i.e. it has more than one reference. When user request to unload such modules then the kernel should reject unambiguously and immediately. PR: 274986 Reviewed by: dfr, dab, jhb MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D42527 (cherry picked from commit f43ff3e15c8b4b161ce09c8ab008abc4222db26b) (cherry picked from commit f1994d1eb215a2b7cb644329797dc623ec883120) --- sys/kern/kern_linker.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/kern/kern_linker.c b/sys/kern/kern_linker.c index bc2f477997e0..8f83fc4c474f 100644 --- a/sys/kern/kern_linker.c +++ b/sys/kern/kern_linker.c @@ -1207,6 +1207,8 @@ kern_kldunload(struct thread *td, int fileid, int flags) printf("kldunload: attempt to unload file that was" " loaded by the kernel\n"); error = EBUSY; + } else if (lf->refs > 1) { + error = EBUSY; } else { lf->userrefs--; error = linker_file_unload(lf, flags); From nobody Tue Apr 9 04:14:03 2024 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 4VDCJX1JRqz5GYJh; Tue, 9 Apr 2024 04:14: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 4VDCJX09X1z40tG; Tue, 9 Apr 2024 04:14:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712636044; 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=ASeIW4DS9PPYxBcmwARocuXylRQdBNyIP2nIJcyrlZA=; b=iY2BS2Xf1ukHik6RwScBWEr4Q+IlE+No7CbMVRCYemPFTR21TaIgrjpXRDz6M/VnRs8BZb Qpgkjj+f1ygpmcfgYdVdLl+8STGWRzld0tjFfJMLMefP/PbUFpLDY4q2luoZVaut40JR2Z 6qte21IHNIG9ievbDUk3gcyF9z+vDXEdWxtd/OY8Iv5DYZS4y2ordTaAGhaKkE3V9NPRzx ioLBsNBzbtZEA2pdb7T/7XpUMMjev4E7Mujfw2PH4JilzFbpxdECDTjcbUWpSGZLx5MJD+ H4POGm3n3jaPKJKe2ddmAGMCnxj2ZBaly5f+z+frfzIybIavc27jm5epJnIM1Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712636044; a=rsa-sha256; cv=none; b=p4nvCXz9ur4sIjFGkHm1p1k9G1+YV7P6tpvxVXTDhXnA5tXAc6rOwIPXGkEwVsovpZGQmv +fDSBYYFLBcKmIK4zgxT8Or1xLp4djkpao0ky0UT2V1d2si/0my5RKN7Iz8ZP3tEreXHdf W72YNANkjioJwLZ88D85Q1pfJlKF+2jMG7pNLLuD+WqWSni0LFKf4tIFSsWZpLLHkDo15E bPTFJMJ1yMdHm+qNTXVYAlI0CfqYpAsk9aSRdZn2yKa+E6aqq5uHM7Qsmf6VrAdgNFUM4N pvpPiXWla2HSTWqXo96dAWxmZRycQ1Xu5TQT3bY/3pmvn864XNitpw+lcXo4ig== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712636044; 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=ASeIW4DS9PPYxBcmwARocuXylRQdBNyIP2nIJcyrlZA=; b=v+ptOvkycFiAD00FwWcmShFEfcpeQ4IIfWfuTjBoNjR6XC9TLIfcDo9z+tGTsQRLgJCzxc 7uutB0gt9A3ILQzcs0wLhyBoTKPN8t19MqaAMwzhlob0trV0UvSm5qKu8IOlIqvWPFQ/5T hgYvG/1/P9IcsK2vixTHTo9RbE9ajNekgFEa2DkQcx+/6GS3pCksgW0euP7o5sXT2erwkS /YqmpD4VOyCGgYxl8xplnSGfAsJPIyRstqaDEfePqbgIi4oBLAwf51nGB9t5TpeKjB0JdJ Juxfu+9nsb/dPjJ7oO1aHzK3qsUcRm/4n10OMRHa9+W+UpBKP6cEooKNJxUZ4g== 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 4VDCJW6vQRzftx; Tue, 9 Apr 2024 04:14:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 4394E3Rd039561; Tue, 9 Apr 2024 04:14:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4394E32R039558; Tue, 9 Apr 2024 04:14:03 GMT (envelope-from git) Date: Tue, 9 Apr 2024 04:14:03 GMT Message-Id: <202404090414.4394E32R039558@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: a7b2c455505a - stable/13 - kern linker: Do not touch userrefs of the kernel file 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: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a7b2c455505ab472dabe84788ceb2109138664f1 Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=a7b2c455505ab472dabe84788ceb2109138664f1 commit a7b2c455505ab472dabe84788ceb2109138664f1 Author: Zhenlei Huang AuthorDate: 2024-03-26 08:47:02 +0000 Commit: Zhenlei Huang CommitDate: 2024-04-09 04:13:19 +0000 kern linker: Do not touch userrefs of the kernel file A nonzero `userrefs` of a linker file indicates that the file, either loaded from kldload(2) or preloaded, can be unloaded via kldunload(2). As for the kernel file, it can be unloaded by the loader but should not be after initialization. This change fixes regression from d9ce8a41eac9 which incidentally increases `userrefs` of the kernel file. Reviewed by: dfr, dab, jhb Fixes: d9ce8a41eac9 kern_linker: Handle module-loading failures in preloaded .ko files MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D42530 (cherry picked from commit 39450eba8e6cd5b83def724481127b58ecc1fcc1) (cherry picked from commit 7da45efb0921e9937353992226f34b25ae197545) --- sys/kern/kern_linker.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/kern/kern_linker.c b/sys/kern/kern_linker.c index 8f83fc4c474f..5271d002fba4 100644 --- a/sys/kern/kern_linker.c +++ b/sys/kern/kern_linker.c @@ -1771,6 +1771,9 @@ linker_preload_finish(void *arg) sx_xlock(&kld_sx); TAILQ_FOREACH_SAFE(lf, &linker_files, link, nlf) { + if (lf == linker_kernel_file) + continue; + /* * If all of the modules in this file failed to load, unload * the file and return an error of ENOEXEC. (Parity with From nobody Tue Apr 9 08:49:51 2024 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 4VDKQl2by9z5GVxG; Tue, 9 Apr 2024 08:49:51 +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 4VDKQl1gT6z4Y68; Tue, 9 Apr 2024 08:49:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712652591; 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=0vvgoWi2+vw/FFaTn1tWdOLEvg8O7CMDq3Cq3wvBAdM=; b=GQ4+sxhbRllwayPrgcm0TomYzP05OCY73t6zwHk57g3Qup8Txydo3P1+ZkZTpeZfqFpP96 slCjYCtg2+2D4BmTmAl5K/J00rTf3ql8t1R7tDSBlkLqYLxmlfamJHCPTlNgFzvwrvMMk2 eQl0PYPp+gr9/86rQ5z3sbtgBc31Nd3ONuMA8KYor31yMb6Jp3h14l9teyhYpHSdk8WdkL zSeNNVMStOxE6B1Feo3zVnaBGZoIm8NbXnluB/uzJ79d08OatVRft16lIjVD06qwCK/rZU 4/lmcUIs07f5u6bcLCfz1VLuXUISFOwtiUFf+CxrIz1E+Ly2U0i8zFDoOVzuaQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712652591; a=rsa-sha256; cv=none; b=Ni+AeO4Nw2Fh0OL4M9epiNNAvfkG09PA4GEnBqAJeyBOTujoYWZQBj5KzDhmsKjmXwnH3Z S4iKQtE7piRWB3krSuAvPJrTY2kvGu+5LqnK6B/gppFwHNoOqgW8GLvUTM4cOL04W3zEbc CtqHSi3ANLQYMDA2go9rsBOVnix/V3dYRlQBqM6XOYxiacMO4XSrHjprV2MS7CFcUqkY5i pZBLRH8OhBPvJm52Y7Tjm7I5hlOF9Q6UkQ98y5pcr4eEVow7CbZ29jByaFsQ7Coz6YBApO WdgNtyDIULqfKe0KN+bSA2TPLGCV3TGVccxf5AXgOaIZl2n6ml07WvuPhFfHSA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712652591; 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=0vvgoWi2+vw/FFaTn1tWdOLEvg8O7CMDq3Cq3wvBAdM=; b=tLiCEFaJ2NAe7/ULxCctCHv5g3JSWwQJSi1EOd7wAs28M0J1L0nCuFyqpzpSBO7ZW77NHs 36qIJ6VulvMaWz/o+VOmhE2Bhg04CGvXUr96HlsKFHiuEKFs3Pygx2mejzSELp4pcWbJcw ItfQimeLdn085MMs8orSkaxnMjUEzQidEF31p+CVapriRu/1q17ZOERtK0BAs+1zUSMm9W tlABZ1Tc+9QcsebaK+Akf9mFmW9MlRgUv6whJ4/nHXWQtMolOPj18TqJp9lUOQ5QSQInUn XewV+FdYRVt4OO5NgP/MTG8+x77JfmCoHg7cvyF6lRnEzoJkMXzZIbqSJIm3+A== 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 4VDKQl19yTznRv; Tue, 9 Apr 2024 08:49:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 4398npcO096571; Tue, 9 Apr 2024 08:49:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4398npvN096568; Tue, 9 Apr 2024 08:49:51 GMT (envelope-from git) Date: Tue, 9 Apr 2024 08:49:51 GMT Message-Id: <202404090849.4398npvN096568@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: e069c451f85e - stable/14 - tmpfs: Improve file time tests. 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: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e069c451f85e5a28f83bf4fba3b668777d2f9193 Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=e069c451f85e5a28f83bf4fba3b668777d2f9193 commit e069c451f85e5a28f83bf4fba3b668777d2f9193 Author: Dag-Erling Smørgrav AuthorDate: 2024-04-04 13:40:47 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-04-09 08:36:04 +0000 tmpfs: Improve file time tests. * The empty test case no longer fails because 89f1dcb3eb46 causes empty files to bypass the bug. * The bug still exists, so add a test case which exercises it. * While here, tighten up some of the checks. A similar patch has been submitted upstream. PR: 274615 X-MFC-With: 89f1dcb3eb46 Sponsored by: Juniper Networks, Inc. Sponsored by: Klara, Inc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D44609 (cherry picked from commit 8311bc5f17dec348749f763b82dfe2737bc53cd7) --- contrib/netbsd-tests/fs/tmpfs/t_times.sh | 38 +++++++++++++++++++++++++++----- 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/contrib/netbsd-tests/fs/tmpfs/t_times.sh b/contrib/netbsd-tests/fs/tmpfs/t_times.sh index f7676814fa71..2d8eb6f67aa0 100755 --- a/contrib/netbsd-tests/fs/tmpfs/t_times.sh +++ b/contrib/netbsd-tests/fs/tmpfs/t_times.sh @@ -36,10 +36,6 @@ empty_head() { atf_set "require.user" "root" } empty_body() { - # Begin FreeBSD - atf_expect_fail "Incorrect atime on FreeBSD: PR274615" - # End FreeBSD - test_mount atf_check -s eq:0 -o empty -e empty touch a @@ -49,13 +45,14 @@ empty_body() { [ ${ost_birthtime} -eq ${ost_mtime} ] || atf_fail "Incorrect mtime" sleep 1 - atf_check -s eq:0 -o ignore -e empty cat a + atf_check -s eq:0 -o empty -e empty cat a eval $(stat -s a) || atf_fail "stat failed" [ ${st_atime} -gt ${ost_atime} ] || atf_fail "Incorrect atime" [ ${st_ctime} -eq ${ost_ctime} ] || atf_fail "Incorrect ctime" [ ${st_mtime} -eq ${ost_mtime} ] || atf_fail "Incorrect mtime" sleep 1 + ost_atime=${st_atime} echo foo >a || atf_fail "Write failed" eval $(stat -s a) || atf_fail "stat failed" [ ${st_atime} -gt ${ost_atime} ] || atf_fail "Incorrect atime" @@ -65,6 +62,34 @@ empty_body() { test_unmount } +atf_test_case holey +holey_head() { + atf_set "descr" "Tests that creating a file consisting entirely" \ + "of a hole and later" \ + "manipulating it updates times correctly" + atf_set "require.user" "root" +} +holey_body() { + atf_expect_fail "https://bugs.freebsd.org/274615" + + test_mount + + atf_check -s eq:0 -o empty -e empty truncate -s 8k a + eval $(stat -s a | sed -e 's|st_|ost_|g') || atf_fail "stat failed" + [ ${ost_birthtime} -eq ${ost_atime} ] || atf_fail "Incorrect atime" + [ ${ost_birthtime} -eq ${ost_ctime} ] || atf_fail "Incorrect ctime" + [ ${ost_birthtime} -eq ${ost_mtime} ] || atf_fail "Incorrect mtime" + + sleep 1 + atf_check -s eq:0 -o ignore -e empty cat a + eval $(stat -s a) || atf_fail "stat failed" + [ ${st_atime} -gt ${ost_atime} ] || atf_fail "Incorrect atime" + [ ${st_ctime} -eq ${ost_ctime} ] || atf_fail "Incorrect ctime" + [ ${st_mtime} -eq ${ost_mtime} ] || atf_fail "Incorrect mtime" + + test_unmount +} + atf_test_case non_empty non_empty_head() { atf_set "descr" "Tests that creating a non-empty file and later" \ @@ -78,7 +103,7 @@ non_empty_body() { eval $(stat -s b | sed -e 's|st_|ost_|g') || atf_fail "stat failed" sleep 1 - atf_check -s eq:0 -o ignore -e empty cat b + atf_check -s eq:0 -o inline:"foo\n" -e empty cat b eval $(stat -s b) || atf_fail "stat failed" [ ${st_atime} -gt ${ost_atime} ] || atf_fail "Incorrect atime" [ ${st_ctime} -eq ${ost_ctime} ] || atf_fail "Incorrect ctime" @@ -139,6 +164,7 @@ atf_init_test_cases() { . $(atf_get_srcdir)/h_funcs.subr atf_add_test_case empty + atf_add_test_case holey atf_add_test_case non_empty atf_add_test_case link atf_add_test_case rename From nobody Tue Apr 9 10:08:17 2024 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 4VDM9F2cvqz5Gdkv; Tue, 9 Apr 2024 10:08: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 4VDM9F1hbRz4g03; Tue, 9 Apr 2024 10:08:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712657297; 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=1udsi19u6g3vMjw2IpDfQluLYgExB53R4cdxMXXnLGc=; b=sFsYhZhN/kNQKE0VYHsJwWJN+8cnqgI+mvc0OTGZYKMnry/Pa4Slh9q46C8SchwO5iVgEo X8j3S7kLk7UxrbYVXcBXhSwFoAOFII6kQheW1F4UsGETiyWG+193d8ZjpIsKm61I2Xnn5c uXsbTV5fT0xOOepH6AZaeLSiLzZiHp7q9/UX1joQMcXjJdbq0b53G6XpFeijf5dbHJWDdq WWDJX5PEia2ip3CycL7JbJZmEWN9V1+oLMCmagoXj+CTFDoZvws4s8i+MB/bWc6iaSVWGr TssDoPgkmu+G1M0knXM7+Gef7yYAa1A+WY38M4QmzC7SRLtYSMY+8Ao+qzwpPQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712657297; a=rsa-sha256; cv=none; b=mLxrdFT3jo5Qenxi4uOFDnVKJ/sAigq22kVCugGSIYeqDhji6kuEKQjs1iy0NQgj94NV7I MNfnP6on8eIWCSvxk6iPcHeltOuvG/3U5glfLeLqPrJXrxDN3+ROI0CS8KZb6yILCJ4CHC JKa6q0bygXOPE2OjDFL98LgLfn5Z5qndCNSrVYQIk+ycnx7qgQ7K59Gx+h5vcVIAcP5C+R 1+gX48Yies55xd75dFsoTHgLexmazl2FxgKA6r7a5WerfO2G8lH4VwmkuXxWMw6x2T/NJV i9gSffeAtFLOVBWnzADIQnOzXivg86ONII82P4mz5EeFlrK8RNRbf0vjKRQksw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712657297; 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=1udsi19u6g3vMjw2IpDfQluLYgExB53R4cdxMXXnLGc=; b=X+hD94hBibLH2DiVVci1IuoDeth81iEXFsghog9O7QSmtdwulolIO4h7cVmSKApTlJ8B95 S0CusTFmeDL5xogy6EZAvc3YPrnq6fY3/IMJw0RY7duy48TyJtg3BqjMfGF7khkiSh0GnO wzIxPQ0XWCxaLnqda7qCapepVrNsYnlrpZR0+VHyYlRzfrc2hsClt8G6byQt6R8oeIIH1q DSp1WcpJoW1xtplTQn2vkX2+6bcM7UdC5qCbLkgDn0+B5qE3jBSaCGAPmGW6768FnJjtZ5 04T3xD4WjS9+oaL/rCjHKtIs3K+LCu1IpkL/xChDbQVtiQZVMR7uR/wzbtvk1Q== 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 4VDM9F1HxRzql4; Tue, 9 Apr 2024 10:08:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 439A8HLQ033118; Tue, 9 Apr 2024 10:08:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 439A8HwA033115; Tue, 9 Apr 2024 10:08:17 GMT (envelope-from git) Date: Tue, 9 Apr 2024 10:08:17 GMT Message-Id: <202404091008.439A8HwA033115@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eugene Grosbein Subject: git: 9407889ec214 - stable/14 - MFC: if_bridge: use IF_MINMTU 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: dev-commits-src-branches+owner@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: eugen X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9407889ec214893ca639468e762efc4ba3875058 Auto-Submitted: auto-generated The branch stable/14 has been updated by eugen: URL: https://cgit.FreeBSD.org/src/commit/?id=9407889ec214893ca639468e762efc4ba3875058 commit 9407889ec214893ca639468e762efc4ba3875058 Author: Eugene Grosbein AuthorDate: 2024-04-01 03:31:51 +0000 Commit: Eugene Grosbein CommitDate: 2024-04-09 10:07:45 +0000 MFC: if_bridge: use IF_MINMTU Replace incorrect constant 576 with IF_MINMTU to check for minumum MTU. This unbreaks bridging tap interfaces with small mtu. (cherry picked from commit 319a5d086b50f38618b62c78e83b12931f00b508) --- sys/net/if_bridge.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c index fe5de468bf28..31758733adb1 100644 --- a/sys/net/if_bridge.c +++ b/sys/net/if_bridge.c @@ -960,7 +960,7 @@ bridge_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) case SIOCSIFMTU: oldmtu = sc->sc_ifp->if_mtu; - if (ifr->ifr_mtu < 576) { + if (ifr->ifr_mtu < IF_MINMTU) { error = EINVAL; break; } From nobody Tue Apr 9 10:23:26 2024 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 4VDMVk4gcxz5GgH5; Tue, 9 Apr 2024 10:23: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 4VDMVk3v9Cz4h4r; Tue, 9 Apr 2024 10:23:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712658206; 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=DHDWiyvi4MfXY8GDZ4Z/4qQpvwWtOG5iJi0KCvZZwzs=; b=QzDM1AdX984M4qeqgml9ryx3vJzcCv3MN0G4F/WoSOOnA1tnllt5SLa55bMo4kZU5g8kue eLmkFBNGgsbfW/9XpjWZAkXP5Pcdy9Vv+siJQIahw4BSQrxiVDTUoKFkANB8TVBxn/snD8 0al+WHGXQM2Cz93/erHcGspM3G8KmXtNvrvP2sYzuwNIccLiwi5pinEHAcN14lu2toeZR0 w7uWw0oKvaSkI+A+PiOpOrj/bAf8QMRCAvuSBX+5eRpG8cuu63Qb4K9rKtpMBQQBmuDKuf X9LHiBQSgiPp7MN4x4jJOdZxuVeBrcuEk+uco6fLUMUUdu5hvwi0qh+p+zr5WA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712658206; a=rsa-sha256; cv=none; b=alWe0X/35pCAAa72fBFp+KHxePQtq8bkfsHFtIbAmcmcQPupr8rjQu9QIg5xAzcrIxLdxO EAuBt38oggijLb3vOOL6Fq6xh8ncV6NJhfEU/I5dPugGxu4kI1mb1n1fUdBLEao6VUF8LN E9CT4lINKypR6NqGDLaDHjglSaTEIYoAh3U4mH/p58mqcx5sRVU/iGxNSo8NmDM5hpSqr+ u2ancqoDXT7F6uI5+pj30+9v1SsveGbMi2mTHvoDUXB5JG52C5KdkdlVa3HOVfjovvld29 3DwiELuJ/GYDMiO2vcs5cCLDytuTtx++rKj7PfMtVLFgmQI8tQqQUuZimm0H6A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712658206; 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=DHDWiyvi4MfXY8GDZ4Z/4qQpvwWtOG5iJi0KCvZZwzs=; b=EOIM+CKT+ASh/ejAUcl6eX56vJd/YT80XrubciqmOSjSRg2ukL9tSsuuZ0fHDGvktZKlzL YBKvzCxkHiVhfnsSbrkS60XnDG/X+tEw0T8It4DvO2eJu8w72TExmrODfwiSvbUB2w9RRz 7ozY2YOjZp/lDPWylzpXWpYP4hGqgbFmCWMU+/YcW15I+APIayiP485IYR746e6/guuxhu Aqo4QBD+yopubMnjuLrYrGCIrk9qTZzM7KDXO8yPARr95Uw95c5WulwvPHTJobI+S1zh2o 2Aj3xvzOUMc9K1Gra93eNSMlFVqGqCDybplfgXDmhYAppT56ns1E2sVyD4+l6g== 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 4VDMVk3TYDzrQg; Tue, 9 Apr 2024 10:23:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 439ANQR8064885; Tue, 9 Apr 2024 10:23:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 439ANQU7064882; Tue, 9 Apr 2024 10:23:26 GMT (envelope-from git) Date: Tue, 9 Apr 2024 10:23:26 GMT Message-Id: <202404091023.439ANQU7064882@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eugene Grosbein Subject: git: d3ce1a1b3780 - stable/13 - MFC: if_bridge: use IF_MINMTU 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: dev-commits-src-branches+owner@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: eugen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d3ce1a1b3780bc88475f23c5005d814e1826f46a Auto-Submitted: auto-generated The branch stable/13 has been updated by eugen: URL: https://cgit.FreeBSD.org/src/commit/?id=d3ce1a1b3780bc88475f23c5005d814e1826f46a commit d3ce1a1b3780bc88475f23c5005d814e1826f46a Author: Eugene Grosbein AuthorDate: 2024-04-01 03:31:51 +0000 Commit: Eugene Grosbein CommitDate: 2024-04-09 10:22:38 +0000 MFC: if_bridge: use IF_MINMTU Replace incorrect constant 576 with IF_MINMTU to check for minimum MTU. This unbreaks bridging tap interfaces with small mtu. MFC after: 1 week --- sys/net/if_bridge.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c index 8982dc61aec5..662b425bc89e 100644 --- a/sys/net/if_bridge.c +++ b/sys/net/if_bridge.c @@ -945,7 +945,7 @@ bridge_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) break; case SIOCSIFMTU: - if (ifr->ifr_mtu < 576) { + if (ifr->ifr_mtu < IF_MINMTU) { error = EINVAL; break; } From nobody Tue Apr 9 10:51:24 2024 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 4VDN705G4wz5Gjbr; Tue, 9 Apr 2024 10:51: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 4VDN703RCRz4kJJ; Tue, 9 Apr 2024 10:51:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712659884; 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=iCt3JfJ0zHH2MfwJg2fvkM2aN+dnHR9rNca6CuIok0A=; b=Tvbt7kxlIucORq57uOyPKJYuuOlolXFxYcuQK9avn4FSHrnhLAbqkY6IAhwkYqBIPNABml etUvysTO7SfVEgYwK0LV7BHptaV6yLWEq/pnY8Q7QAv/IUno8oJicGLEY1h89cSwffRakY WHik3+zg9Lq9OTA47vEGypUN0y9oizBK40aTnloAduTviNEUShvxDostvgWpEPXxvnFLNh +t1svk5vB2Fjr70xjSVBYgoC6ttD4q0t/7VJY39chlmGA1whVE28mAl9WovVRBq5i66WRA 94+4vGQmpfgEGmtHBm62roWiK6u2vk1UfXWjUy/T4Kz3ieCbxoLIhr1oRqDg4A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712659884; a=rsa-sha256; cv=none; b=wWwsSrsmKqTRlMNZKyr3z++wY61s4fsLPKbVXp0aAokxWnHK5nrkMu2UXS0DGAFaVuP4p7 P6PMRuvnDoAsYcEMaHefMYoN5G6X2iLRY46xDoDjNlTs7+RjQLesBTt29FbDaWrDVAZ4AC NlgeCrIezIX2eFPEdLo7YQDgPZxEuEDEy3TMymTmeF5xrNA8Du6aK6Vzy2bQunwPBlXnTj 9KYev2WUVDbE7sCImnkKNakpKXS8+uiivgwutwjHq3yPLn78ebuKtAPViwz+tHxEUJ8zp2 T7KQOljrzNos+it/dXUMYVoMkLhguBji55Dyzjj68beDIWQV/YRn0wfk9m/y/w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712659884; 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=iCt3JfJ0zHH2MfwJg2fvkM2aN+dnHR9rNca6CuIok0A=; b=RKsas+k9UnrucE1B8zabrKTkFVNhC8EQZBN2Zia7+M5q7VtXA5Sxo1SHpqUILShzxvzNxX BLr744f+Wqq+d9PoNUUhTFk6E2Oc7BWvWTSwAGMA0cNl7pc3dqp7BFXKc+bBMyGYMftGFi eQKumegPBUudw1Xc7ICmKQSli44XjKwGoLc8fsbPrmLWpXVXchvDJgLCLkBdzZs6usbrUt CHBZXG638P9Vp6tBaSAaFNUEKwvv3DSIMSBFGb64eV1C5l/cVVAq+8+dRu7CNxPzPLX0oy zaBlcTV+cpmvEKeERDlK5FUnanRqnnVSFHXmfEFoMNJ3CuJSf3bT11eeSTag1g== 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 4VDN702ycszrSG; Tue, 9 Apr 2024 10:51:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 439ApOZn012136; Tue, 9 Apr 2024 10:51:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 439ApObt012133; Tue, 9 Apr 2024 10:51:24 GMT (envelope-from git) Date: Tue, 9 Apr 2024 10:51:24 GMT Message-Id: <202404091051.439ApObt012133@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eugene Grosbein Subject: git: 1879f7affbf8 - stable/13 - MFC: if_bridge: change MTU for new members 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: dev-commits-src-branches+owner@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: eugen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1879f7affbf80c701c76081b2b8511f4c7dd81f5 Auto-Submitted: auto-generated The branch stable/13 has been updated by eugen: URL: https://cgit.FreeBSD.org/src/commit/?id=1879f7affbf80c701c76081b2b8511f4c7dd81f5 commit 1879f7affbf80c701c76081b2b8511f4c7dd81f5 Author: Eugene Grosbein AuthorDate: 2024-04-09 10:49:05 +0000 Commit: Eugene Grosbein CommitDate: 2024-04-09 10:50:20 +0000 MFC: if_bridge: change MTU for new members Rather than reject new bridge members because they have the wrong MTU change it to match the bridge. If that fails, reject the new interface. PR: 264883 Different Revision: https://reviews.freebsd.org/D35597 (cherry picked from commit 1865ebfb12ddaf3d0ff1458e6152b3cb1f1bdee8) --- sys/net/if_bridge.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c index 662b425bc89e..e0fe45e3d326 100644 --- a/sys/net/if_bridge.c +++ b/sys/net/if_bridge.c @@ -945,6 +945,8 @@ bridge_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) break; case SIOCSIFMTU: + oldmtu = sc->sc_ifp->if_mtu; + if (ifr->ifr_mtu < IF_MINMTU) { error = EINVAL; break; @@ -954,17 +956,27 @@ bridge_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) break; } CK_LIST_FOREACH(bif, &sc->sc_iflist, bif_next) { - if (bif->bif_ifp->if_mtu != ifr->ifr_mtu) { - log(LOG_NOTICE, "%s: invalid MTU: %u(%s)" - " != %d\n", sc->sc_ifp->if_xname, - bif->bif_ifp->if_mtu, - bif->bif_ifp->if_xname, ifr->ifr_mtu); + error = (*bif->bif_ifp->if_ioctl)(bif->bif_ifp, + SIOCSIFMTU, (caddr_t)ifr); + if (error != 0) { + log(LOG_NOTICE, "%s: invalid MTU: %u for" + " member %s\n", sc->sc_ifp->if_xname, + ifr->ifr_mtu, + bif->bif_ifp->if_xname); error = EINVAL; break; } } - if (!error) + if (error) { + /* Restore the previous MTU on all member interfaces. */ + ifr->ifr_mtu = oldmtu; + CK_LIST_FOREACH(bif, &sc->sc_iflist, bif_next) { + (*bif->bif_ifp->if_ioctl)(bif->bif_ifp, + SIOCSIFMTU, (caddr_t)ifr); + } + } else { sc->sc_ifp->if_mtu = ifr->ifr_mtu; + } break; default: /* From nobody Tue Apr 9 13:36:05 2024 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 4VDRn16L0wz5H2HP; Tue, 9 Apr 2024 13: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 4VDRn15SW1z43sK; Tue, 9 Apr 2024 13: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=1712669765; 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=F4Wgtn91x9nVlBCHfP6Vr53y+98miW9HzWNZAM2EaTU=; b=g1t/5eXNzV4nKFyMdZoDzSevslbf1/kNGwchfmo4O8ES4QUuBB4xOTjlkNeKMVaSt2xpGV koJ5uqWsH1Pszjfmy9gfEr6trBtGHGltCcriUVBv88HCW65qMI2dtb0Z4NIQeBrhfeo36x V3QvjJHo3YSlWo0h5GAYPLtbG8cX0oAaKInkeGJoM56RhyRB+ZCFUEP4b5MaR6DgABBtjC 7OFxTO6pb/zaozwaQ/lUqibPWCV0GCRbAHKkqDdTxVwccl6wKcE/Mnps6TtKf45+8zuWHo Hgw2vwMAz2exqeHnaWavgb0Wi771mFxnDNJrr2S1MAn/bwxe+7mZGC1lVwWGEg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712669765; a=rsa-sha256; cv=none; b=e2dRyKk/mxZxMJp/OpLK7NJ4yZmF/wGXkdBUK3mfGkF11MAHF+5Z5Hg4G/Mefzqj3HJNxX +hn+ibY1JqMBT3SNPBrSWcPI16ximncX935viZ5Qk6fGBhpsnLbH6VpitEV/um4xhvZYAv 0z2L4j/XzWmsLyKvdilrXzJ9LEBwgMpymcpv2JUXNP5mjxBnmocKDEYL3nlpdzuWEQek93 RSlhXssKwD7wBX2jthx7X80bdKNRvBOeQi3zuTcOl5D3jEPEaeIypzIN0uwU/rrQYDstzh Q+tr4f9h/gKnSZiTU62BsXH45XelJy17Jo+HUDITdqEAK1YlPG1dICnYCfl+aA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712669765; 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=F4Wgtn91x9nVlBCHfP6Vr53y+98miW9HzWNZAM2EaTU=; b=BkPh34EjgYuUZERKchEe5LpwAQ326RhSRlPYaZoO3f7ro+I4ntT4qoJYWQlFwx6A3HpQT9 9snJhrPYdHjeMETxYq+bnt3v6AdXbrEyuvqyUkXF6MgH07/tYoimDS3EBCCb8v0WVbpidq V8xLD8+iV75wUyuAoYkIuUDmNwBNB0XJFbbwpS9rXp/c+fufy7n1wCK1i7UdTUjlfS+RpO iDGgX46Qb99dDmEux1JJLToRrCfT8M+L6rhZLF38l7bo037nPsySRrVJmZG6Ot1sH2vaBa brx2mGUF7XzQtxSvLbyjby39E55ayeOu9gvzlTebHpMydjkSitSZ/Ckm5fQtPg== 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 4VDRn153lVzx6B; Tue, 9 Apr 2024 13:36:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 439Da5Ps086542; Tue, 9 Apr 2024 13:36:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 439Da5BV086539; Tue, 9 Apr 2024 13:36:05 GMT (envelope-from git) Date: Tue, 9 Apr 2024 13:36:05 GMT Message-Id: <202404091336.439Da5BV086539@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: 7ced57106295 - stable/14 - ccdconfig: reference gpart rather than fdisk and disklabel 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: dev-commits-src-branches+owner@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/14 X-Git-Reftype: branch X-Git-Commit: 7ced57106295ac92a0584ea03e0a05b66973ed73 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=7ced57106295ac92a0584ea03e0a05b66973ed73 commit 7ced57106295ac92a0584ea03e0a05b66973ed73 Author: Ed Maste AuthorDate: 2024-01-23 18:23:44 +0000 Commit: Ed Maste CommitDate: 2024-04-09 13:35:28 +0000 ccdconfig: reference gpart rather than fdisk and disklabel fdisk and disklabel are legacy tools for legacy disk partitioning schemes. Reviewed by: imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D43564 (cherry picked from commit 8669e516f0e6f48a5017db9e5f4768275f1deaa8) --- sbin/ccdconfig/ccdconfig.8 | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/sbin/ccdconfig/ccdconfig.8 b/sbin/ccdconfig/ccdconfig.8 index 4014a36b0771..07fa3e6348fc 100644 --- a/sbin/ccdconfig/ccdconfig.8 +++ b/sbin/ccdconfig/ccdconfig.8 @@ -27,7 +27,7 @@ .\" .\" $NetBSD: ccdconfig.8,v 1.4 1996/02/28 01:01:17 thorpej Exp $ .\" -.Dd January 24, 2024 +.Dd March 22, 2024 .Dt CCDCONFIG 8 .Os .Sh NAME @@ -176,9 +176,8 @@ ccdconfig -c /dev/ccd0 32 linux /dev/ada0s1 /dev/ada0s2 .Ed .Pp When you create a new ccd disk you generally want to -.Xr fdisk 8 -and -.Xr disklabel 8 +partition it using +.Xr gpart 8 it before doing anything else. Beware that changing any ccd parameters: interleave, flags, or the device list making up the ccd disk, will usually destroy any prior @@ -206,8 +205,7 @@ and .Sh SEE ALSO .Xr dd 1 , .Xr ccd 4 , -.Xr disklabel 8 , -.Xr fdisk 8 , +.Xr gpart 8 , .Xr gvinum 8 , .Xr rc 8 .Sh HISTORY From nobody Tue Apr 9 13:38:12 2024 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 4VDRqT13l3z5H2Mp; Tue, 9 Apr 2024 13:38: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 4VDRqT0YD8z44Rq; Tue, 9 Apr 2024 13:38:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712669893; 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=5jPLbfgTV957YGUGSxDAt8QnXkLEqIrEkCfESnXSZco=; b=FvMgfwV3jDvXWD1w5xedvflOMPwnW0WTlheVxZHOKlQLYXSXtmWV+EbrDB/yMMkquWUQZE sFZVauh8SQs3+sFM4uxuGXytA4aq3NR5WgQ+TlbI/i7ALHLWNvPiyCqZ8MF3VTS0K/8ZFd Q/cxcjavF/hFY+Ah24z4lAec+uP0GoYOszD0Eu3pYaOE+SDhmqjNeahCDin/Cp4z9A7oZF AMA8M/2dy3EFIko4exF0bbg7nCGd+3+j+H6b5ghAWjIY8p064ROgQ76YGaZNdA9kblwEEx aybERob0oRvQn4cG90p5CzLiOYaWygr3ol2yFlB7kDDqgdombY20lAjuyOZduA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712669893; a=rsa-sha256; cv=none; b=dLT5SAwK0ytsbK7v4sdRjrpU1HZfUrKA+koVsWy4ZQ0OEB+ioBTfb5gaxng+0VZmUQiauK +cR3kdRau/SSLBF7dZT3tLMjjpKBtTYjoipM3E7FCLFbTNWd+WOjSBqV35J3VPbn3Yw+fY j+okXgq3lpSfFqonh2VLNRq6rE3di5cHtfdPXPmv9ob+zLBOKez7TtS4ZjYMN9chAtHOUe J/RVV3UeEr8XtjVkMCNQ7vsxOsbzzsymG+MR31CfEwS60BQgOl7aD5ORDCHUS2XH2T6l9Z 0ratRG8dgdFJR/S7SIRWcXGFCvDPIPCTK+Bxw/MhL8A2p+kkenu0+LMNwPJ32A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712669893; 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=5jPLbfgTV957YGUGSxDAt8QnXkLEqIrEkCfESnXSZco=; b=pm8kFMNUqmyDamBtZ4fiE72Vkm5wkFQRifhfGvNjQMCbVqT+092lzAgul8Qh4nmryZVt1G Xi7/S/yxFABvRGndobd6YtLSim5GUJS3FehKVwrwprnu5maUQowuV5sUMb8Se2JIMVZB6n 49aO4HzBbsTYD6ps3/bOhf/t0yy8VQ2nHv4BSSVTpiJXRFXdNtXKqzbWFh65flsaz/rh+i Cbsa/8Lcw0LMsn63jZ7jEHdsHDIUvvCzUnbhQ7J+oWIVjFxNZG/8EkPyFn4XsMREClSmDn slRV5P8OihDSzHkXNJ79loqWspGpbNjL5QbXy960rqovCtH3LP+M7U80c4pPxg== 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 4VDRqT02W1zwCQ; Tue, 9 Apr 2024 13:38:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 439DcCPC086934; Tue, 9 Apr 2024 13:38:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 439DcCFH086931; Tue, 9 Apr 2024 13:38:12 GMT (envelope-from git) Date: Tue, 9 Apr 2024 13:38:12 GMT Message-Id: <202404091338.439DcCFH086931@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: da7a43501881 - stable/13 - ccdconfig: remove obsolete references to BSD disklabels 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: dev-commits-src-branches+owner@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: da7a43501881469ca0740b24322116d3314b0a58 Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=da7a43501881469ca0740b24322116d3314b0a58 commit da7a43501881469ca0740b24322116d3314b0a58 Author: Ed Maste AuthorDate: 2024-01-24 15:05:09 +0000 Commit: Ed Maste CommitDate: 2024-04-09 13:37:28 +0000 ccdconfig: remove obsolete references to BSD disklabels ccd(4) previoulsy had knowledge of BSD disklabels, and relied on their use on the underlying disks, but this hasn't been the case since 2003 (commit 0f76d6d822f4). Remove disklabel references from the man page. Reviewed by: imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D43574 (cherry picked from commit a3ed434a69c903fa58ef001c11c9466166d67c92) (cherry picked from commit b5ae8f217122258764e4c187dbfee712dbe6893e) --- sbin/ccdconfig/ccdconfig.8 | 42 +----------------------------------------- 1 file changed, 1 insertion(+), 41 deletions(-) diff --git a/sbin/ccdconfig/ccdconfig.8 b/sbin/ccdconfig/ccdconfig.8 index 2c7460f291f6..4014a36b0771 100644 --- a/sbin/ccdconfig/ccdconfig.8 +++ b/sbin/ccdconfig/ccdconfig.8 @@ -27,7 +27,7 @@ .\" .\" $NetBSD: ccdconfig.8,v 1.4 1996/02/28 01:01:17 thorpej Exp $ .\" -.Dd March 17, 2022 +.Dd January 24, 2024 .Dt CCDCONFIG 8 .Os .Sh NAME @@ -122,13 +122,6 @@ argument is optional. ccd0 16 none /dev/da2s1 /dev/da3s1 .Ed .Pp -The component devices need to name partitions of type -.Li FS_BSDFFS -(or -.Dq 4.2BSD -as shown by -.Xr disklabel 8 ) . -.Pp If you want to use the .Tn Linux .Xr md 4 @@ -187,30 +180,6 @@ When you create a new ccd disk you generally want to and .Xr disklabel 8 it before doing anything else. -Once you create the initial label you can -edit it, adding additional partitions. -The label itself takes up the first -16 sectors of the ccd disk. -If all you are doing is creating file systems -with newfs, you do not have to worry about this as newfs will skip the -label area. -However, if you intend to -.Xr dd 1 -to or from a ccd partition it is usually a good idea to construct the -partition such that it does not overlap the label area. -For example, if -you have A ccd disk with 10000 sectors you might create a 'd' partition -with offset 16 and size 9984. -.Bd -literal -# disklabel ccd0 > /tmp/disklabel.ccd0 -# disklabel -R ccd0 /tmp/disklabel.ccd0 -# disklabel -e ccd0 -.Ed -.Pp -The disklabeling of a ccd disk is usually a one-time affair. -If you reboot the machine and reconfigure the ccd disk, -the disklabel you -had created before will still be there and not require reinitialization. Beware that changing any ccd parameters: interleave, flags, or the device list making up the ccd disk, will usually destroy any prior data on that ccd disk. @@ -246,12 +215,3 @@ The .Nm utility first appeared in .Nx 1.1 . -.Sh BUGS -The initial disklabel returned by -.Xr ccd 4 -specifies only 3 partitions. -One needs to change the number of partitions to 8 using -.Dq Nm disklabel Fl e -to get the usual -.Bx -expectations. From nobody Tue Apr 9 13:38:14 2024 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 4VDRqV1nCVz5H2FR; Tue, 9 Apr 2024 13:38: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 4VDRqV1C5Nz44DP; Tue, 9 Apr 2024 13:38:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712669894; 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=fIOLsUoE3GTgrerMuJP4CWV75Dml+R9O4gRqFFwX5No=; b=taMuOJbv0c7fXIRyhyPbH8SQTvZcO4VrgDVOB+JlytuHcZnTx4AQru3TXUfiK83IAeodrU jmTceJlo8sWbLLdssWuvb4DOvXwJHapY6cScyE84Xcnhrx15+W8W+VQQ/nm4ZU3TSg551B xJvK0WPsZeal/h/BfmEOjCgDkcOmGdT9be6wVuUokpxjkYsqyCIclZDqlPbqSw0i3/3uQn W13Vwri/e9TUhK2sBodTLRTnW0XQGtAtu6SCMjKQyBf7yR8OQOyrnMD/CmoN7H2he34kBM /KX4ij/9eNeQej9iVqKHotXeiFZ6HYv4LRtWxyd0h76ggMf8klcJ7U5iUC2iPQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712669894; a=rsa-sha256; cv=none; b=egrOU9HR2jWsTn6Xxbm+y9uKUux1PK6RGeINwVZ3URnH89tUdm8WiMDFKwz3GMiuvxIRKM +QZSPNvBMjDG74GkqzVKCgiD1IZGsbnoOonX8P/+ipkZM4bRjMEZOv9yFjuAuL5rMzyPKm Egev/hm9pUCpud+6IUr9UAwWdRbmpNJJBCky/4jDIrm3jx4hzBGQQx9wBoX1P7NbG6L3QB bGssQQUCUZDGLEpwThZeA7ahgaHwXc/LzawYCVAoOKaUrGpnPOctwEeP3LyMNUy5GUFZgm P4tXHjhkU40jgEW8w2EIYxNOmHm49SdegiHqlClixKjaEo5Zz7JbeAOlWar6nw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712669894; 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=fIOLsUoE3GTgrerMuJP4CWV75Dml+R9O4gRqFFwX5No=; b=avx2QOrpENf5Z63YM3bmUr0L3P0oj9QVa4w7xTAf4zOPxvOKGCQ7LFGX+W3173DnIHQmXv YUQp8atjVNCd/3jVQ8cvD9rdpS1CHhwIhZ+YkeUcVCs2nk0z7oBGXcbUGGwaSOm/sk70BD K0LBIKT3sbKGxRZFHT/B9StG7nFsCY6oqdZs1VTHmMlfuPrIYb2PFLvopdwiqqrss51eN2 hDwNdSY+3NW9KZXy3EHvHJVBFzHS3RQrAJ6TFBrRUyvWaK5EDESCMPYmoTvjW+CRPZT1hr /HhwH8QqgNMaG5+rVssjABiqJQZvHnfvL+Aj1gtfuQEaPy7TORfToW09iHukvQ== 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 4VDRqV0pljzwxg; Tue, 9 Apr 2024 13:38:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 439DcEC5086985; Tue, 9 Apr 2024 13:38:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 439DcEvc086982; Tue, 9 Apr 2024 13:38:14 GMT (envelope-from git) Date: Tue, 9 Apr 2024 13:38:14 GMT Message-Id: <202404091338.439DcEvc086982@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: 8e8d76571f77 - stable/13 - ccdconfig: reference gpart rather than fdisk and disklabel 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: dev-commits-src-branches+owner@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: 8e8d76571f77be9533a83f4a8d7e16f39a31d7eb Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=8e8d76571f77be9533a83f4a8d7e16f39a31d7eb commit 8e8d76571f77be9533a83f4a8d7e16f39a31d7eb Author: Ed Maste AuthorDate: 2024-01-23 18:23:44 +0000 Commit: Ed Maste CommitDate: 2024-04-09 13:37:28 +0000 ccdconfig: reference gpart rather than fdisk and disklabel fdisk and disklabel are legacy tools for legacy disk partitioning schemes. Reviewed by: imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D43564 (cherry picked from commit 8669e516f0e6f48a5017db9e5f4768275f1deaa8) (cherry picked from commit 7ced57106295ac92a0584ea03e0a05b66973ed73) --- sbin/ccdconfig/ccdconfig.8 | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/sbin/ccdconfig/ccdconfig.8 b/sbin/ccdconfig/ccdconfig.8 index 4014a36b0771..07fa3e6348fc 100644 --- a/sbin/ccdconfig/ccdconfig.8 +++ b/sbin/ccdconfig/ccdconfig.8 @@ -27,7 +27,7 @@ .\" .\" $NetBSD: ccdconfig.8,v 1.4 1996/02/28 01:01:17 thorpej Exp $ .\" -.Dd January 24, 2024 +.Dd March 22, 2024 .Dt CCDCONFIG 8 .Os .Sh NAME @@ -176,9 +176,8 @@ ccdconfig -c /dev/ccd0 32 linux /dev/ada0s1 /dev/ada0s2 .Ed .Pp When you create a new ccd disk you generally want to -.Xr fdisk 8 -and -.Xr disklabel 8 +partition it using +.Xr gpart 8 it before doing anything else. Beware that changing any ccd parameters: interleave, flags, or the device list making up the ccd disk, will usually destroy any prior @@ -206,8 +205,7 @@ and .Sh SEE ALSO .Xr dd 1 , .Xr ccd 4 , -.Xr disklabel 8 , -.Xr fdisk 8 , +.Xr gpart 8 , .Xr gvinum 8 , .Xr rc 8 .Sh HISTORY From nobody Tue Apr 9 13:38:38 2024 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 4VDRqy3Jd9z5H2L0; Tue, 9 Apr 2024 13:38: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 4VDRqy2kYsz44gb; Tue, 9 Apr 2024 13:38:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712669918; 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=6DNIWoQUxXWzo0olmojq8ZzsY/8cZeJPaQWv1hBNncY=; b=IDLVZyLe82/dqwxc9SKjVWh2EDesAC9FYHrU0+FlUwkXDxy4Ksu2Q2TOe81zFjx10Mjx4P zdPkM39WYRMuUdu5XAoLF5j5ngk46M3FVcNzEUylcuZllcbS2XR5cZp63pdCXfeqtFluMa 4wQjnYxPoHyf0A+Y0L59bPYapyArdGZnWW6yqGe84M5dF0nhB+Rsb4hv8gDL4WrtmSzZzo N/D4VA8+fmR2LPticmF8quS+P+wjFLlwv+f9j+kgt4Ocmr4cmmmKTORBAOWh0baNxavd4S Fk6SyFz4NQDGkMO70xIt9paoj2F9+KjhBZoKmfvxAg3HlG1Pxpv8I7sKmWiikQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712669918; a=rsa-sha256; cv=none; b=ijmzsjtAyWY24rdvSNueSZ4jivkQJs/lcF0bmDC+STwUxXwY1sEEWGX6922N3eP3fUV1x/ zIaPuI7Hem/wJAKFXOAk+XvrRdDCbDGCBxFI6Gn0UkKr8atnbCP/f0aHGWEJQ+Ylbt8pf6 jfGOo4OhEdiKFmR0YkePp4ADRfGZ9D58XjhooQ4ZQaDKDJZ7MfRkE2Nl+9r/2AcbKn9WfK eOd/CyixAdoYhZeYVpbKR8ljCUDQPnUZCThJtc7CxkrkNojpoTnf73b/s4V5k7/YLJOYki acTVd6YLMe74q45MuJE1Hz8rak7CwvkkgBcbCbs3h1yYa1wwMhPwbMOGFeeU5Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712669918; 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=6DNIWoQUxXWzo0olmojq8ZzsY/8cZeJPaQWv1hBNncY=; b=i8Zgvv8IXNsSIVQa4vWBSK4rmyIn6GVvvwgzKhYystnseD7o8ycojPHt0HbP+6PQSPuBNa nKwEgu6iwE8HyrUdI+ok+rurELVRjNyPmE3Zf0guvAljtqmRnEbed3qetr59dzLvTCFvfG 4toFmOny/0Jo1gJlcm3SUdz3hnTBcPDs7HeqvjFBTceTDFpfb+6x7ODbczjzXRzqnTC1Ms 5fi1pFDa7v7Mt9xyLvasDET+I3n0u2+29hIHg7HF+QGfIoJEgfJSajbBjp0nEAKZd9RmFJ 0gq0yiM6ToQffM2i4gReVyoGuI4vmffBCY0vVPAFHUO0C7BiuWnm+ZmQEhcqwg== 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 4VDRqy2KxyzwCR; Tue, 9 Apr 2024 13:38:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 439DccgN087173; Tue, 9 Apr 2024 13:38:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 439DcceU087170; Tue, 9 Apr 2024 13:38:38 GMT (envelope-from git) Date: Tue, 9 Apr 2024 13:38:38 GMT Message-Id: <202404091338.439DcceU087170@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: c525951492dd - stable/13 - freebsd-update: Fix typo in 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: dev-commits-src-branches+owner@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: c525951492ddcef50b74af495b8d88048f3dc806 Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=c525951492ddcef50b74af495b8d88048f3dc806 commit c525951492ddcef50b74af495b8d88048f3dc806 Author: a-biardi AuthorDate: 2024-04-02 12:28:52 +0000 Commit: Ed Maste CommitDate: 2024-04-09 13:37:28 +0000 freebsd-update: Fix typo in comment s/patchname expansion/pathname expansion/ Signed-off-by: a.biardi@tiscali.it Pull-request: https://github.com/freebsd/freebsd-src/pull/1152 (cherry picked from commit 91811711625482f3a5778939e9999f53a0bea22a) (cherry picked from commit 507e18dfc32491d2617488b470c2208db88977e2) --- usr.sbin/freebsd-update/freebsd-update.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/freebsd-update/freebsd-update.sh b/usr.sbin/freebsd-update/freebsd-update.sh index 9af6e8d711ed..b6a8911e64b7 100644 --- a/usr.sbin/freebsd-update/freebsd-update.sh +++ b/usr.sbin/freebsd-update/freebsd-update.sh @@ -2895,7 +2895,7 @@ backup_kernel () { (cd ${BASEDIR}/${KERNELDIR} && find . -type f $FINDFILTER -exec \ cp -pl '{}' ${BASEDIR}/${BACKUPKERNELDIR}/'{}' \;) - # Re-enable patchname expansion. + # Re-enable pathname expansion. set +f } From nobody Tue Apr 9 13:38:39 2024 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 4VDRqz4h61z5H2CN; Tue, 9 Apr 2024 13:38: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 4VDRqz3MYRz44ln; Tue, 9 Apr 2024 13:38:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712669919; 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=q/vJAbRQCOluby9DaL6CE0HrR+YebVvbW9wbsB5Lmt8=; b=AOA/Vnh+AUra/E7BudS4lg7mTZnQfD3A9Ko1FFjtrhQwFBEqqZnit+kXHbOZBoYzyH0aqo nhwQmicJxDQerOE272dcer8ctDjWWoQcmvTmLk6X9xVPjOzVAjNYM1B+46ajtgPORXJ550 x7tigo07QyXo0MvbJtkEUMbfCPzqkyuIu4b0vT1lBgpGYAfrtuM24gjEwoFRySckmnqkp0 THjQgye9inpnIjE2ATWSbgLQopsyNgUo05ME2pbL0hCqi24UDsN33gTCy318Oo88tCW3Bo QT7ZB6Ea9Y6vHO2H1MhGcvZUBTSQnbJb6Syf9KPTLv6pRodrZVC5sccjUZxmaQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712669919; a=rsa-sha256; cv=none; b=PCS2PrGIjRzBS4seGevUv6ZHPAjEtvz2tAHaxDUkIn/OqQFoxk4Al1Vht2orefSlWEpHyX Te3ZeG87XZ56SqYHwWpRjTR1UcxIavmXm+GUeL2cVUnZ0I05/+p82MY6F8jeeSc22QY7YF 3krS9dflmfT9cG2ZzK8JwiRb/9oTOMW8lKTH/2iz9iLT6MAgyUANQVJUfggej3DAp8BsKY V0Pi0rUN7tpLD9sakxTe18s1ygeXNpMlJkEJZjMYvqy0wYGMvNNHKlib/JTQYU5uhKVbcW g4OXtaid8Ohn1GPXIUSwt0gR/geBxy0K7/BDM/JDkTbbkeHC7x906HSx846lmQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712669919; 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=q/vJAbRQCOluby9DaL6CE0HrR+YebVvbW9wbsB5Lmt8=; b=aGrPH4Ej3R1TaJ+m4+Mn1SSJbpnA8qLscR58M378WwijcCN4EyDyuwBvgXQbQRN8NotoS6 EGRi8wJsrVrNsXXR3CzIHiwrJDErKLcBG1Cbl93utImGUayYlZ+Y6WQBeYEp0cx20RLg/f 5o+10VulgLxsC6wuOX2hANpIMOcU1xUcsDcdK4nHEMmOaMamKw1j58rQzyEWlC2S68CWYE Z1dE3sRaRiMvwvbW1T6XftIgaBhr14mndlOKunaJ9lruRGxZp6kkvAAqhdUUId1a8qUrQZ fRFf3ZlrXj2zTn3iaOYT9OpjQ0gvhbQljebDCQQ3bvDnd7HftkUaF5JZW6IAqA== 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 4VDRqz2yzQzwvC; Tue, 9 Apr 2024 13:38:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 439DcdPN087214; Tue, 9 Apr 2024 13:38:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 439DcdWg087211; Tue, 9 Apr 2024 13:38:39 GMT (envelope-from git) Date: Tue, 9 Apr 2024 13:38:39 GMT Message-Id: <202404091338.439DcdWg087211@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: 54030e8a5df5 - stable/13 - dma.conf: 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: dev-commits-src-branches+owner@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: 54030e8a5df5c778d3bde7a32082051c39678a07 Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=54030e8a5df5c778d3bde7a32082051c39678a07 commit 54030e8a5df5c778d3bde7a32082051c39678a07 Author: Mikael Urankar AuthorDate: 2024-03-27 09:36:33 +0000 Commit: Ed Maste CommitDate: 2024-04-09 13:37:28 +0000 dma.conf: Fix typo Pull Request: https://github.com/freebsd/freebsd-src/pull/1150 (cherry picked from commit c92400a6f690a82ab84eb0b97cc8bf169e44e4e8) (cherry picked from commit bedc8daace2692efa9aad232c3eeff61f2c954c9) --- libexec/dma/dmagent/dma.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libexec/dma/dmagent/dma.conf b/libexec/dma/dmagent/dma.conf index e11fd67cd254..bb28306e342e 100644 --- a/libexec/dma/dmagent/dma.conf +++ b/libexec/dma/dmagent/dma.conf @@ -15,7 +15,7 @@ # SMTP authentication #AUTHPATH /etc/dma/auth.conf -# Uncomment if yout want TLS/SSL support +# Uncomment if you want TLS/SSL support #SECURETRANSFER # Uncomment if you want STARTTLS support (only used in combination with From nobody Thu Apr 11 12:01:56 2024 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 4VFdbT12tZz5HJXt; Thu, 11 Apr 2024 12:01: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 4VFdbT0X8xz4yyj; Thu, 11 Apr 2024 12:01:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712836917; 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=8usLEIxp+96C/ldVvDO1eYo5y4GkqNxoUIsbCnXhkGc=; b=hdajb9R+bfyPYjyzYUQG/VV1i+t9DStVAQ514m9AU23At5tTm0atveAn7z7KZOHZ1D3cDU pzGIZR9/BnNmty3evolN3/rA6XKGjCfHWwYrHSjZ2VjbvMEUZjO04fPEW4gx5jUgojPc9W eKT7gQ349mLn+dKZjzEwTyhPoHs5VPjG/8IQG01/V2WZR2HaVN+Jy45L7lH36ypZtk3fCl GjlDovegu8cimothosZhEsv6omCEYxKcJ80EJcNGNTz65QgAitQmVvd4PKhlS8yMRRvRjm qi6gU4qHqxHd0hNkrbfnLNyUU6F5qWh1Q1MHVpukinbofWCZU4qCluX+Kkvx2Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712836917; a=rsa-sha256; cv=none; b=gOjD9EuUN9o3Oin+qLhdTDMn+VFzJVXC8o1Nzxtv+FHXrmn5Ts/UEmPQ1baDWC8EORzEne 1dvfCDjMAc86SQixFEW/JK79FQRG2TI6QWhKJVHow98uDeCW22L2/eh/OhwgtGpiakUtvD BP+Ws+jEOiZUVYOlM4JyRwrQhxH3lIGwb7AtpfL4Wi2xunRxPD3risX1fXiUvMIFyDlCVq 3SJoIUve8xwq6xU28L29pOmcccV465U3Pr8NBNQIBGfzsbSO9XTJfq8++CjBTOV+cOKuAL UBaY7pDNm/ZUeAVe0JUijrnTmf/bMfFZrEc9JARXJHkrY1shkicXiyDf4n2X+w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712836917; 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=8usLEIxp+96C/ldVvDO1eYo5y4GkqNxoUIsbCnXhkGc=; b=RzW1QOkRxdduKv1R9a+X01UnUbzj5XsAkXmsNTlfS087D+kFwhgsZJaV1b+46ybpGpXQEv T5sKLq3do7MMql5yD7ZLHTxMZ4L2f1zqP5joKWVGyGvePEp6Rq1jU5eGRZf9msQWVHZvHB 81TDO6o7bWvebGOu68OvvEbjgxU3cRlAFttI4fbF9u9vJFK/ZyCYl1dWVo8sVDlGyS8xv9 qMiRwZd7Tz2Y6nfoAL6ocj/LW1NcfJXuLRD3gz4vkFoemRXycpsqplj70T+6NW2ERTk5nU 6Whp5MNllc1r2Kd2Uu6RJDp2x/Ab6BMeCPszQbS0pLSQb3Q+3djw2s+TPVwbNw== 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 4VFdbS6wrQz1Knr; Thu, 11 Apr 2024 12:01:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43BC1ukc009089; Thu, 11 Apr 2024 12:01:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43BC1uqn009086; Thu, 11 Apr 2024 12:01:56 GMT (envelope-from git) Date: Thu, 11 Apr 2024 12:01:56 GMT Message-Id: <202404111201.43BC1uqn009086@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: 16a6da44e28d - stable/14 - nuageinit: add basic support for cloudinit. 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: dev-commits-src-branches+owner@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: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 16a6da44e28d607f2383be7c7c325090979f531f Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=16a6da44e28d607f2383be7c7c325090979f531f commit 16a6da44e28d607f2383be7c7c325090979f531f Author: Baptiste Daroussin AuthorDate: 2022-11-23 19:00:39 +0000 Commit: Baptiste Daroussin CommitDate: 2024-04-11 11:52:52 +0000 nuageinit: add basic support for cloudinit. this is a very early script to support cloudinit, it does not intend to be a full featured cloudinit client, but will support a good enough subset to be viable in most case. It support nocloud and openstack config-2 config drive mode (iso9660 or msdosfs) The following features are currently supported: - adding users (including a default user named 'freebsd' with password 'freebsd' - adding groups - adding ssh keys - static ipv4, static ipv6, dynamic ipv4 With this one is able to use the 'bring your own image feature" out of box. It is expected that the script grows the support of other clouds supporting cloud-init, contributions are welcomed. It is designed to be only run once via the firstboot mecanism. Sponsored by: OVHCloud Differential Revision: https://reviews.freebsd.org/D44141 (cherry picked from commit a42d6f76018e4ed8324e319ab48aac904bda437c) (cherry picked from commit c051f22bce42d920abba61bd7cf4ef5b6a270ffa) (cherry picked from commit b8c053c9a612651d4909f7a323088f3e92485b7b) (cherry picked from commit 9eae9233fdcc946945f4191e1413f548adfa2943) --- etc/mtree/BSD.tests.dist | 2 + libexec/Makefile | 5 + libexec/nuageinit/Makefile | 11 + libexec/nuageinit/nuage.lua | 214 +++++++++++ libexec/nuageinit/nuageinit | 312 ++++++++++++++++ libexec/nuageinit/tests/Makefile | 13 + libexec/nuageinit/tests/addgroup.lua | 15 + libexec/nuageinit/tests/addsshkey.lua | 2 + libexec/nuageinit/tests/adduser.lua | 15 + libexec/nuageinit/tests/dirname.lua | 8 + libexec/nuageinit/tests/err.lua | 4 + libexec/nuageinit/tests/nuage.sh | 52 +++ libexec/nuageinit/tests/nuageinit.sh | 338 ++++++++++++++++++ libexec/nuageinit/tests/sethostname.lua | 4 + libexec/nuageinit/tests/utils.sh | 21 ++ libexec/nuageinit/tests/warn.lua | 4 + libexec/nuageinit/yaml.lua | 586 +++++++++++++++++++++++++++++++ libexec/rc/rc.d/Makefile | 6 + libexec/rc/rc.d/nuageinit | 67 ++++ release/packages/Makefile.package | 2 + share/mk/src.opts.mk | 1 + tools/build/mk/OptionalObsoleteFiles.inc | 21 ++ tools/build/options/WITHOUT_NUAGEINIT | 1 + 23 files changed, 1704 insertions(+) diff --git a/etc/mtree/BSD.tests.dist b/etc/mtree/BSD.tests.dist index a3c5cae09567..81cd5baca513 100644 --- a/etc/mtree/BSD.tests.dist +++ b/etc/mtree/BSD.tests.dist @@ -435,6 +435,8 @@ atf-sh .. .. + nuageinit + .. rc .. rtld-elf diff --git a/libexec/Makefile b/libexec/Makefile index bd1571edcfe4..204c7ef31bdb 100644 --- a/libexec/Makefile +++ b/libexec/Makefile @@ -29,6 +29,7 @@ SUBDIR= ${_atf} \ ${_rshd} \ ${_rtld-elf} \ save-entropy \ + ${_nuageinit} \ ${_smrsh} \ ${_tests} \ ${_tftp-proxy} \ @@ -121,6 +122,10 @@ _atf= atf _tests= tests .endif +.if ${MK_NUAGEINIT} != "no" +_nuageinit= nuageinit +.endif + .include .include diff --git a/libexec/nuageinit/Makefile b/libexec/nuageinit/Makefile new file mode 100644 index 000000000000..64c5ec316f3d --- /dev/null +++ b/libexec/nuageinit/Makefile @@ -0,0 +1,11 @@ +PACKAGE= nuageinit +SCRIPTS= nuageinit +FILES= nuage.lua yaml.lua +FILESDIR= ${SHAREDIR}/flua + +.include + +HAS_TESTS= +SUBDIR.${MK_TESTS}+= tests + +.include diff --git a/libexec/nuageinit/nuage.lua b/libexec/nuageinit/nuage.lua new file mode 100644 index 000000000000..55486ae2b122 --- /dev/null +++ b/libexec/nuageinit/nuage.lua @@ -0,0 +1,214 @@ +-- SPDX-License-Identifier: BSD-2-Clause +-- +-- Copyright(c) 2022 Baptiste Daroussin + +local pu = require("posix.unistd") + +local function warnmsg(str) + io.stderr:write(str.."\n") +end + +local function errmsg(str) + io.stderr:write(str.."\n") + os.exit(1) +end + +local function dirname(oldpath) + if not oldpath then + return nil + end + local path = oldpath:gsub("[^/]+/*$", "") + if path == "" then + return nil + end + return path +end + +local function mkdir_p(path) + if lfs.attributes(path, "mode") ~= nil then + return true + end + local r,err = mkdir_p(dirname(path)) + if not r then + return nil,err.." (creating "..path..")" + end + return lfs.mkdir(path) +end + +local function sethostname(hostname) + if hostname == nil then return end + local root = os.getenv("NUAGE_FAKE_ROOTDIR") + if not root then + root = "" + end + local hostnamepath = root .. "/etc/rc.conf.d/hostname" + + mkdir_p(dirname(hostnamepath)) + local f,err = io.open(hostnamepath, "w") + if not f then + warnmsg("Impossible to open "..hostnamepath .. ":" ..err) + return + end + f:write("hostname=\""..hostname.."\"\n") + f:close() +end + +local function splitlist(list) + local ret = {} + if type(list) == "string" then + for str in list:gmatch("([^, ]+)") do + ret[#ret + 1] = str + end + elseif type(list) == "table" then + ret = list + else + warnmsg("Invalid type ".. type(list) ..", expecting table or string") + end + return ret +end + +local function adduser(pwd) + if (type(pwd) ~= "table") then + warnmsg("Argument should be a table") + return nil + end + local f = io.popen("getent passwd "..pwd.name) + local pwdstr = f:read("*a") + f:close() + if pwdstr:len() ~= 0 then + return pwdstr:match("%a+:.+:%d+:%d+:.*:(.*):.*") + end + if not pwd.gecos then + pwd.gecos = pwd.name .. " User" + end + if not pwd.home then + pwd.home = "/home/" .. pwd.name + end + local extraargs="" + if pwd.groups then + local list = splitlist(pwd.groups) + extraargs = " -G ".. table.concat(list, ',') + end + -- pw will automatically create a group named after the username + -- do not add a -g option in this case + if pwd.primary_group and pwd.primary_group ~= pwd.name then + extraargs = extraargs .. " -g " .. pwd.primary_group + end + if not pwd.no_create_home then + extraargs = extraargs .. " -m " + end + if not pwd.shell then + pwd.shell = "/bin/sh" + end + local precmd = "" + local postcmd = "" + if pwd.passwd then + precmd = "echo "..pwd.passwd .. "| " + postcmd = " -H 0 " + elseif pwd.plain_text_passwd then + precmd = "echo "..pwd.plain_text_passwd .. "| " + postcmd = " -H 0 " + end + local root = os.getenv("NUAGE_FAKE_ROOTDIR") + local cmd = precmd .. "pw " + if root then + cmd = cmd .. "-R " .. root .. " " + end + cmd = cmd .. "useradd -n ".. pwd.name .. " -M 0755 -w none " + cmd = cmd .. extraargs .. " -c '".. pwd.gecos + cmd = cmd .. "' -d '" .. pwd.home .. "' -s "..pwd.shell .. postcmd + + local r = os.execute(cmd) + if not r then + warnmsg("nuageinit: fail to add user "..pwd.name); + warnmsg(cmd) + return nil + end + if pwd.locked then + cmd = "pw " + if root then + cmd = cmd .. "-R " .. root .. " " + end + cmd = cmd .. "lock " .. pwd.name + os.execute(cmd) + end + return pwd.home +end + +local function addgroup(grp) + if (type(grp) ~= "table") then + warnmsg("Argument should be a table") + return false + end + local f = io.popen("getent group "..grp.name) + local grpstr = f:read("*a") + f:close() + if grpstr:len() ~= 0 then + return true + end + local extraargs = "" + if grp.members then + local list = splitlist(grp.members) + extraargs = " -M " .. table.concat(list, ',') + end + local root = os.getenv("NUAGE_FAKE_ROOTDIR") + local cmd = "pw " + if root then + cmd = cmd .. "-R " .. root .. " " + end + cmd = cmd .. "groupadd -n ".. grp.name .. extraargs + local r = os.execute(cmd) + if not r then + warnmsg("nuageinit: fail to add group ".. grp.name); + warnmsg(cmd) + return false + end + return true +end + +local function addsshkey(homedir, key) + local chownak = false + local chowndotssh = false + local ak_path = homedir .. "/.ssh/authorized_keys" + local dotssh_path = homedir .. "/.ssh" + local dirattrs = lfs.attributes(ak_path) + if dirattrs == nil then + chownak = true + dirattrs = lfs.attributes(dotssh_path) + if dirattrs == nil then + if not lfs.mkdir(dotssh_path) then + warnmsg("nuageinit: impossible to create ".. dotssh_path) + return + end + chowndotssh = true + dirattrs = lfs.attributes(homedir) + end + end + + local f = io.open(ak_path, "a") + if not f then + warnmsg("nuageinit: impossible to open "..ak_path) + return + end + f:write(key .. "\n") + f:close() + if chownak then + pu.chown(ak_path, dirattrs.uid, dirattrs.gid) + end + if chowndotssh then + pu.chown(dotssh_path, dirattrs.uid, dirattrs.gid) + end +end + +local n = { + warn = warnmsg, + err = errmsg, + sethostname = sethostname, + adduser = adduser, + addgroup = addgroup, + addsshkey = addsshkey, + dirname = dirname, + mkdir_p = mkdir_p, +} + +return n diff --git a/libexec/nuageinit/nuageinit b/libexec/nuageinit/nuageinit new file mode 100755 index 000000000000..08224061d1b1 --- /dev/null +++ b/libexec/nuageinit/nuageinit @@ -0,0 +1,312 @@ +#!/usr/libexec/flua + +-- SPDX-License-Identifier: BSD-2-Clause-FreeBSD +-- +-- Copyright(c) 2022 Baptiste Daroussin + +local nuage = require("nuage") +local yaml = require("yaml") + +if #arg ~= 2 then + nuage.err("Usage ".. arg[0] .." [config-2|nocloud]") +end +local path = arg[1] +local citype = arg[2] +local ucl = require("ucl") + +local default_user = { + name = "freebsd", + homedir = "/home/freebsd", + groups = "wheel", + gecos = "FreeBSD User", + shell = "/bin/sh", + plain_text_passwd = "freebsd" +} + +local root = os.getenv("NUAGE_FAKE_ROOTDIR") +if not root then + root = "" +end + +local function open_config(name) + nuage.mkdir_p(root .. "/etc/rc.conf.d") + local f,err = io.open(root .. "/etc/rc.conf.d/" .. name, "w") + if not f then + nuage.err("nuageinit: unable to open "..name.." config: " .. err) + end + return f +end + +local function get_ifaces() + local parser = ucl.parser() + -- grab ifaces + local ns = io.popen('netstat -i --libxo json') + local netres = ns:read("*a") + ns:close() + local res,err = parser:parse_string(netres) + if not res then + nuage.warn("Error parsing netstat -i --libxo json outout: " .. err) + return nil + end + local ifaces = parser:get_object() + local myifaces = {} + for _,iface in pairs(ifaces["statistics"]["interface"]) do + if iface["network"]:match("") then + local s = iface["address"] + myifaces[s:lower()] = iface["name"] + end + end + return myifaces +end + +local function config2_network(p) + local parser = ucl.parser() + local f = io.open(p .. "/network_data.json") + if not f then + -- silently return no network configuration is provided + return + end + f:close() + local res,err = parser:parse_file(p .. "/network_data.json") + if not res then + nuage.warn("nuageinit: error parsing network_data.json: " .. err) + return + end + local obj = parser:get_object() + + local ifaces = get_ifaces() + if not ifaces then + nuage.warn("nuageinit: no network interfaces found") + return + end + local mylinks = {} + for _,v in pairs(obj["links"]) do + local s = v["ethernet_mac_address"]:lower() + mylinks[v["id"]] = ifaces[s] + end + + nuage.mkdir_p(root .. "/etc/rc.conf.d") + local network = open_config("network") + local routing = open_config("routing") + local ipv6 = {} + local ipv6_routes = {} + local ipv4 = {} + for _,v in pairs(obj["networks"]) do + local interface = mylinks[v["link"]] + if v["type"] == "ipv4_dhcp" then + network:write("ifconfig_"..interface.."=\"DHCP\"\n") + end + if v["type"] == "ipv4" then + network:write("ifconfig_"..interface.."=\"inet "..v["ip_address"].." netmask " .. v["netmask"] .. "\"\n") + if v["gateway"] then + routing:write("defaultrouter=\""..v["gateway"].."\"\n") + end + if v["routes"] then + for i,r in ipairs(v["routes"]) do + local rname = "cloudinit" .. i .. "_" .. interface + if v["gateway"] and v["gateway"] == r["gateway"] then goto next end + if r["network"] == "0.0.0.0" then + routing:write("defaultrouter=\""..r["gateway"].."\"\n") + goto next + end + routing:write("route_".. rname .. "=\"-net ".. r["network"] .. " ") + routing:write(r["gateway"] .. " " .. r["netmask"] .. "\"\n") + ipv4[#ipv4 + 1] = rname + ::next:: + end + end + end + if v["type"] == "ipv6" then + ipv6[#ipv6+1] = interface + ipv6_routes[#ipv6_routes+1] = interface + network:write("ifconfig_"..interface.."_ipv6=\"inet6 "..v["ip_address"].."\"\n") + if v["gateway"] then + routing:write("ipv6_defaultrouter=\""..v["gateway"].."\"\n") + routing:write("ipv6_route_"..interface.."=\""..v["gateway"]) + routing:write(" -prefixlen 128 -interface "..interface.."\"\n") + end + -- TODO compute the prefixlen for the routes + --if v["routes"] then + -- for i,r in ipairs(v["routes"]) do + -- local rname = "cloudinit" .. i .. "_" .. mylinks[v["link"]] + -- -- skip all the routes which are already covered by the default gateway, some provider + -- -- still list plenty of them. + -- if v["gateway"] == r["gateway"] then goto next end + -- routing:write("ipv6_route_" .. rname .. "\"\n") + -- ipv6_routes[#ipv6_routes+1] = rname + -- ::next:: + -- end + --end + end + end + if #ipv4 > 0 then + routing:write("static_routes=\"") + routing:write(table.concat(ipv4, " ") .. "\"\n") + end + if #ipv6 > 0 then + network:write("ipv6_network_interfaces=\"") + network:write(table.concat(ipv6, " ") .. "\"\n") + network:write("ipv6_default_interface=\""..ipv6[1].."\"\n") + end + if #ipv6_routes > 0 then + routing:write("ipv6_static_routes=\"") + routing:write(table.concat(ipv6, " ") .. "\"\n") + end + network:close() + routing:close() +end + +if citype == "config-2" then + local parser = ucl.parser() + local res,err = parser:parse_file(path..'/meta_data.json') + + if not res then + nuage.err("nuageinit: error parsing config-2: meta_data.json: " .. err) + end + local obj = parser:get_object() + local sshkeys = obj["public_keys"] + if sshkeys then + local homedir = nuage.adduser(default_user) + for _,v in pairs(sshkeys) do + nuage.addsshkey(root .. homedir, v) + end + end + nuage.sethostname(obj["hostname"]) + + -- network + config2_network(path) +elseif citype == "nocloud" then + local f,err = io.open(path.."/meta-data") + if err then + nuage.err("nuageinit: error parsing nocloud meta-data: ".. err) + end + local obj = yaml.eval(f:read("*a")) + f:close() + if not obj then + nuage.err("nuageinit: error parsing nocloud meta-data") + end + local hostname = obj['local-hostname'] + if not hostname then + hostname = obj['hostname'] + end + if hostname then + nuage.sethostname(hostname) + end +else + nuage.err("Unknown cloud init type: ".. citype) +end + +-- deal with user-data +local f = io.open(path..'/user-data', "r") +if not f then + os.exit(0) +end +local line = f:read('*l') +f:close() +if line == "#cloud-config" then + f = io.open(path.."/user-data") + local obj = yaml.eval(f:read("*a")) + f:close() + if not obj then + nuage.err("nuageinit: error parsing cloud-config file: user-data") + end + if obj.groups then + for n,g in pairs(obj.groups) do + if (type(g) == "string") then + local r = nuage.addgroup({name = g}) + if not r then + nuage.warn("nuageinit: failed to add group: ".. g) + end + elseif type(g) == "table" then + for k,v in pairs(g) do + nuage.addgroup({name = k, members = v}) + end + else + nuage.warn("nuageinit: invalid type : "..type(g).." for users entry number "..n); + end + end + end + if obj.users then + for n,u in pairs(obj.users) do + if type(u) == "string" then + if u == "default" then + nuage.adduser(default_user) + else + nuage.adduser({name = u}) + end + elseif type(u) == "table" then + -- ignore users without a username + if u.name == nil then + goto unext + end + local homedir = nuage.adduser(u) + if u.ssh_authorized_keys then + for _,v in ipairs(u.ssh_authorized_keys) do + nuage.addsshkey(homedir, v) + end + end + else + nuage.warn("nuageinit: invalid type : "..type(u).." for users entry number "..n); + end + ::unext:: + end + else + -- default user if none are defined + nuage.adduser(default_user) + end + if obj.ssh_authorized_keys then + local homedir = nuage.adduser(default_user) + for _,k in ipairs(obj.ssh_authorized_keys) do + nuage.addsshkey(homedir, k) + end + end + if obj.network then + local ifaces = get_ifaces() + nuage.mkdir_p(root .. "/etc/rc.conf.d") + local network = open_config("network") + local routing = open_config("routing") + local ipv6={} + for _,v in pairs(obj.network.ethernets) do + if not v.match then goto next end + if not v.match.macaddress then goto next end + if not ifaces[v.match.macaddress] then + nuage.warn("nuageinit: not interface matching: "..v.match.macaddress) + goto next + end + local interface = ifaces[v.match.macaddress] + if v.dhcp4 then + network:write("ifconfig_"..interface.."=\"DHCP\"\n") + elseif v.addresses then + for _,a in pairs(v.addresses) do + if a:match("^(%d+)%.(%d+)%.(%d+)%.(%d+)") then + network:write("ifconfig_"..interface.."=\"inet "..a.."\"\n") + else + network:write("ifconfig_"..interface.."_ipv6=\"inet6 "..a.."\"\n") + ipv6[#ipv6 +1] = interface + end + end + end + if v.gateway4 then + routing:write("defaultrouter=\""..v.gateway4.."\"\n") + end + if v.gateway6 then + routing:write("ipv6_defaultrouter=\""..v.gateway6.."\"\n") + routing:write("ipv6_route_"..interface.."=\""..v.gateway6) + routing:write(" -prefixlen 128 -interface "..interface.."\"\n") + end + ::next:: + end + if #ipv6 > 0 then + network:write("ipv6_network_interfaces=\"") + network:write(table.concat(ipv6, " ") .. "\"\n") + network:write("ipv6_default_interface=\""..ipv6[1].."\"\n") + end + network:close() + routing:close() + end +else + local res,err = os.execute(path..'/user-data') + if not res then + nuage.err("nuageinit: error executing user-data script: ".. err) + end +end diff --git a/libexec/nuageinit/tests/Makefile b/libexec/nuageinit/tests/Makefile new file mode 100644 index 000000000000..d5b3bd9dcc82 --- /dev/null +++ b/libexec/nuageinit/tests/Makefile @@ -0,0 +1,13 @@ +PACKAGE= tests + +ATF_TESTS_SH= nuage utils nuageinit + +${PACKAGE}FILES+= warn.lua +${PACKAGE}FILES+= err.lua +${PACKAGE}FILES+= dirname.lua +${PACKAGE}FILES+= sethostname.lua +${PACKAGE}FILES+= addsshkey.lua +${PACKAGE}FILES+= adduser.lua +${PACKAGE}FILES+= addgroup.lua + +.include diff --git a/libexec/nuageinit/tests/addgroup.lua b/libexec/nuageinit/tests/addgroup.lua new file mode 100644 index 000000000000..60a0d8346793 --- /dev/null +++ b/libexec/nuageinit/tests/addgroup.lua @@ -0,0 +1,15 @@ +#!/usr/libexec/flua + +local n = require("nuage") +if n.addgroup() then + n.err("addgroup should not accept empty value") +end +if n.addgroup("plop") then + n.err("addgroup should not accept empty value") +end +local gr = {} +gr.name = "impossible_groupname" +local res = n.addgroup(gr) +if not res then + n.err("valid addgroup should return a path") +end diff --git a/libexec/nuageinit/tests/addsshkey.lua b/libexec/nuageinit/tests/addsshkey.lua new file mode 100644 index 000000000000..3aa5f7619ec2 --- /dev/null +++ b/libexec/nuageinit/tests/addsshkey.lua @@ -0,0 +1,2 @@ +local n = require("nuage") +n.addsshkey(".", "mykey") diff --git a/libexec/nuageinit/tests/adduser.lua b/libexec/nuageinit/tests/adduser.lua new file mode 100644 index 000000000000..9366d2abd0f4 --- /dev/null +++ b/libexec/nuageinit/tests/adduser.lua @@ -0,0 +1,15 @@ +#!/usr/libexec/flua + +local n = require("nuage") +if n.adduser() then + n.err("adduser should not accept empty value") +end +if n.adduser("plop") then + n.err("adduser should not accept empty value") +end +local pw = {} +pw.name = "impossible_username" +local res = n.adduser(pw) +if not res then + n.err("valid adduser should return a path") +end diff --git a/libexec/nuageinit/tests/dirname.lua b/libexec/nuageinit/tests/dirname.lua new file mode 100644 index 000000000000..d1268e48575c --- /dev/null +++ b/libexec/nuageinit/tests/dirname.lua @@ -0,0 +1,8 @@ +local n = require("nuage") +print(n.dirname("/my/path/path1")) +if n.dirname("path") then + nuage.err("Expecting nil for n.dirname(\"path\")") +end +if n.dirname() then + nuage.err("Expecting nil for n.dirname") +end diff --git a/libexec/nuageinit/tests/err.lua b/libexec/nuageinit/tests/err.lua new file mode 100644 index 000000000000..c62fa1098f09 --- /dev/null +++ b/libexec/nuageinit/tests/err.lua @@ -0,0 +1,4 @@ +#!/usr/libexec/flua + +local n = require("nuage") +n.err("plop") diff --git a/libexec/nuageinit/tests/nuage.sh b/libexec/nuageinit/tests/nuage.sh new file mode 100644 index 000000000000..bbf306eae51f --- /dev/null +++ b/libexec/nuageinit/tests/nuage.sh @@ -0,0 +1,52 @@ +atf_test_case sethostname +atf_test_case addsshkey +atf_test_case adduser +atf_test_case addgroup + +sethostname_body() { + export NUAGE_FAKE_ROOTDIR="$(pwd)" + atf_check /usr/libexec/flua $(atf_get_srcdir)/sethostname.lua + if [ ! -f etc/rc.conf.d/hostname ]; then + atf_fail "hostname not written" + fi + atf_check -o inline:"hostname=\"myhostname\"\n" cat etc/rc.conf.d/hostname +} + +addsshkey_body() { + atf_check /usr/libexec/flua $(atf_get_srcdir)/addsshkey.lua + if [ ! -f .ssh/authorized_keys ]; then + atf_fail "ssh key not added" + fi + atf_check -o inline:"mykey\n" cat .ssh/authorized_keys + atf_check /usr/libexec/flua $(atf_get_srcdir)/addsshkey.lua + atf_check -o inline:"mykey\nmykey\n" cat .ssh/authorized_keys +} + +adduser_body() { + export NUAGE_FAKE_ROOTDIR="$(pwd)" + if [ $(id -u) -ne 0 ]; then + atf_skip "root required" + fi + mkdir etc + printf "root:*:0:0::0:0:Charlie &:/root:/bin/csh\n" > etc/master.passwd + pwd_mkdb -d etc etc/master.passwd + printf "wheel:*:0:root\n" > etc/group + atf_check -e inline:"Argument should be a table\nArgument should be a table\n" /usr/libexec/flua $(atf_get_srcdir)/adduser.lua + test -d home/impossible_username || atf_fail "home not created" + atf_check -o inline:"impossible_username::1001:1001::0:0:impossible_username User:/home/impossible_username:/bin/sh\n" grep impossible_username etc/master.passwd +} + +addgroup_body() { + export NUAGE_FAKE_ROOTDIR="$(pwd)" + mkdir etc + printf "wheel:*:0:root\n" > etc/group + atf_check -e inline:"Argument should be a table\nArgument should be a table\n" /usr/libexec/flua $(atf_get_srcdir)/addgroup.lua + atf_check -o inline:"impossible_groupname:*:1001:\n" grep impossible_groupname etc/group +} + +atf_init_test_cases() { + atf_add_test_case sethostname + atf_add_test_case addsshkey + atf_add_test_case adduser + atf_add_test_case addgroup +} diff --git a/libexec/nuageinit/tests/nuageinit.sh b/libexec/nuageinit/tests/nuageinit.sh new file mode 100644 index 000000000000..926233bcf66d --- /dev/null +++ b/libexec/nuageinit/tests/nuageinit.sh @@ -0,0 +1,338 @@ +atf_test_case args +atf_test_case nocloud +atf_test_case nocloud_userdata_script +atf_test_case nocloud_userdata_cloudconfig +atf_test_case nocloud_userdata_cloudconfig_users +atf_test_case nocloud_network +atf_test_case config2 +atf_test_case config2_pubkeys +atf_test_case config2_network +atf_test_case config2_network_static_v4 + + +args_body() +{ + atf_check -s exit:1 -e inline:"Usage /usr/libexec/nuageinit [config-2|nocloud]\n" /usr/libexec/nuageinit + atf_check -s exit:1 -e inline:"Usage /usr/libexec/nuageinit [config-2|nocloud]\n" /usr/libexec/nuageinit bla + atf_check -s exit:1 -e inline:"Usage /usr/libexec/nuageinit [config-2|nocloud]\n" /usr/libexec/nuageinit bla meh plop + atf_check -s exit:1 -e inline:"Unknown cloud init type: meh\n" /usr/libexec/nuageinit bla meh +} + +nocloud_body() +{ + here=$(pwd) + mkdir -p media/nuageinit + atf_check -s exit:1 -e match:"nuageinit: error parsing nocloud.*" /usr/libexec/nuageinit ${here}/media/nuageinit/ nocloud + export NUAGE_FAKE_ROOTDIR=$(pwd) + printf "instance-id: iid-local01\nlocal-hostname: cloudimg\n" > ${here}/media/nuageinit/meta-data + atf_check -s exit:0 /usr/libexec/nuageinit ${here}/media/nuageinit nocloud + atf_check -o inline:"hostname=\"cloudimg\"\n" cat etc/rc.conf.d/hostname + cat > media/nuageinit/meta-data << EOF +instance-id: iid-local01 +hostname: myhost +EOF + atf_check -s exit:0 /usr/libexec/nuageinit ${here}/media/nuageinit nocloud + atf_check -o inline:"hostname=\"myhost\"\n" cat etc/rc.conf.d/hostname +} + +nocloud_userdata_script_body() +{ + here=$(pwd) + mkdir -p media/nuageinit + printf "instance-id: iid-local01\n" > ${here}/media/nuageinit/meta-data + printf "#!/bin/sh\necho "yeah"\n" > ${here}/media/nuageinit/user-data + chmod 755 ${here}/media/nuageinit/user-data + atf_check -s exit:0 -o inline:"yeah\n" /usr/libexec/nuageinit ${here}/media/nuageinit nocloud +} + +nocloud_userdata_cloudconfig_users_body() +{ + here=$(pwd) + export NUAGE_FAKE_ROOTDIR=$(pwd) + if [ $(id -u) -ne 0 ]; then + atf_skip "root required" + fi + mkdir -p media/nuageinit + printf "instance-id: iid-local01\n" > ${here}/media/nuageinit/meta-data + mkdir -p etc + cat > etc/master.passwd < etc/group < media/nuageinit/user-data < expectedgroup << EOF +wheel:*:0:root,freebsd +users:*:1:foobar +admingroup:*:1001:root,sys +cloud-users:*:1002: +freebsd:*:1003: +foobar:*:1004: +EOF + cat > expectedpasswd << EOF +root:*:0:0::0:0:Charlie &:/root:/bin/csh +sys:*:1:0::0:0:Sys:/home/sys:/bin/csh +freebsd:freebsd:1001:1003::0:0:FreeBSD User:/home/freebsd:/bin/sh +foobar:H/1LT4f9/N3wpgNunhsIqtMj62OKiS3nyNwuizouQc3u7MbYCarYeAHWYPYb2FT.lbioDm2RrkJPb9BZMN1O/:1002:1004::0:0:Foo B. Bar:/home/foobar:/bin/sh +EOF + atf_check -o file:expectedpasswd cat ${here}/etc/master.passwd + atf_check -o file:expectedgroup cat ${here}/etc/group +} + +nocloud_network_body() +{ + here=$(pwd) + mkdir -p media/nuageinit + mkdir -p etc + cat > etc/master.passwd < etc/group < ${here}/media/nuageinit/meta-data + cat > media/nuageinit/user-data < network < routing < media/nuageinit/meta_data.json + atf_check /usr/libexec/nuageinit ${here}/media/nuageinit config-2 + cat > media/nuageinit/meta_data.json << EOF +{ + "hostname": "cloudimg", +} +EOF + export NUAGE_FAKE_ROOTDIR=$(pwd) + atf_check /usr/libexec/nuageinit ${here}/media/nuageinit config-2 + atf_check -o inline:"hostname=\"cloudimg\"\n" cat etc/rc.conf.d/hostname +} *** 960 LINES SKIPPED *** From nobody Thu Apr 11 12:01:58 2024 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 4VFdbV1gS1z5HJV6; Thu, 11 Apr 2024 12:01: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 4VFdbV0w9pz4yyl; Thu, 11 Apr 2024 12:01:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712836918; 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=bAdgqWVvANPyq+CtSNGd7rbhDYlCQsDwP9G+/GMRH0M=; b=Ef59RpKRUv9X3wk30aoNDyg9bTO6RELTBk/dKloChz8ZZhcEEoPMiEK0PmW4z3kTKbbHKR 4S6o4MImiCXJXGvQBjde8f85ihvEVlhoKJiIaki7hFUQj+rDD9L9eOobJy1GG1A72EGdev jRkGZ7depgUBp5SckQ0XFfYLXOLoW6pOYo82sgWbFbL+eu+kdVlozUuwHoIFpitqeMqaHb 9mO+s5Sxk41d/EygwUYE3Nc2KpnI4JCcHbDR3qvagIwO28fkeD0W5F2705fY5gc7Kfc1hW ZP5QFn7jYil5h9xRl13eoIP/M2RX+NBUd5/ycrC1arAKqJNnLqn74N7Dk5m4Vg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712836918; a=rsa-sha256; cv=none; b=NSBZk0F87L4hvDziJ7016HhItvAk1OsVnOJW3ZMhaxjL1+GCsRch8Tgdi1JinL1HjL/q25 h0xvxipZdQDyyIINRXA5Fk1OJiMWqifW2vz5XEfDHhEocC1TsGFpxzYybbwX0S4jU7FM7Z CDNLD+ky5RuVDLb9ktXh3dimYSfBpSIhUrWvbXh9TKDC01PmnGdaKKngiorPnPZPRA/Ahc PXtXUk5Bw57JDi7Rz5Mb7WOHP5hC7KHq2DwfV/8enAin7sx3vZ97/wqBq1pHYv360PEhXG H9zkkkKOoOP+VBbNNw6FX/vvnlhRDAZoImanzGf/VwW7pRhP5Bdako9xGjrCEQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712836918; 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=bAdgqWVvANPyq+CtSNGd7rbhDYlCQsDwP9G+/GMRH0M=; b=KSLnPPT9ei7PdgvcIvEzAxt7nK6+KPXHXK8d8ZOrUfN2wMlJgVScr1RZXD3ACCv1rJwcDm dBMNXZUDa23gZARBAqpTijrMKwaMOPAiIZUjL/WSL1s1Nrg1sW2HrUr/QUaYMvDPUVj6tP sRX9v1vvhihqh3kluxwan32ozRkPUTH6QVo/TNzb/JddTdif1EQrGGNobmIijVTw+q/VH6 71Xqt0UmJbo8chd9AsDmS2fPwbzCCTnWYjY9GCYSzmibI6Pn00b83oynJYNcWa8/9uqssv USdddboeAB7EDQU5WsvTQhv6U39GD1apZtyfULZDNAlKWL9afnGgmVH2lZTe2w== 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 4VFdbV0Wxpz1Kdq; Thu, 11 Apr 2024 12:01:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43BC1wpb009143; Thu, 11 Apr 2024 12:01:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43BC1wHf009140; Thu, 11 Apr 2024 12:01:58 GMT (envelope-from git) Date: Thu, 11 Apr 2024 12:01:58 GMT Message-Id: <202404111201.43BC1wHf009140@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: 8c093b649599 - stable/14 - src.conf(5): regen after addition of nuageinit 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: dev-commits-src-branches+owner@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: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8c093b6495998e671e0be27cbd8db6214489e706 Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=8c093b6495998e671e0be27cbd8db6214489e706 commit 8c093b6495998e671e0be27cbd8db6214489e706 Author: Baptiste Daroussin AuthorDate: 2024-03-15 08:21:17 +0000 Commit: Baptiste Daroussin CommitDate: 2024-04-11 12:01:20 +0000 src.conf(5): regen after addition of nuageinit (cherry picked from commit 0e2bf3002f7ea3f836fc71c135bdccd53ad78032) --- share/man/man5/src.conf.5 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5 index fbd99580ba35..eec250bcbca2 100644 --- a/share/man/man5/src.conf.5 +++ b/share/man/man5/src.conf.5 @@ -1,5 +1,5 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. -.Dd March 8, 2024 +.Dd April 11, 2024 .Dt SRC.CONF 5 .Os .Sh NAME @@ -1319,6 +1319,8 @@ will not be built either if this option is set. Do not build .Xr ntpd 8 and related programs. +.It Va WITHOUT_NUAGEINIT +Do not install the limited cloud init support scripts. .It Va WITHOUT_NVME Do not build nvme related tools and kernel modules. .Pp From nobody Thu Apr 11 12:05:32 2024 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 4VFdgc3vMTz5HJKG; Thu, 11 Apr 2024 12:05:32 +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 4VFdgc34lHz50gg; Thu, 11 Apr 2024 12:05:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712837132; 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=o36XvPqu0zSwDED6aNWmbOJsR/6Ar/utOI7KP1YnzkY=; b=NUeaK2kYc0RxocFmPjf/HN5Zk1iiH58d5Oxm6pLY13T+W+3mO8vYPiHtH42x87j8iGJ3Mp d5bV5I6c7NTdbKCWPT9bocog/FmsdQwn2KDv2MI5jjg7TyO63x4Uzp0JKI+cFdSpQOEzCU cqyfWMursV9eVUpNkgvo9Fg67j9FPWVNVvgKr1v9za6fHCaLqzrmrCJ/KzvIFiXbAL+rXi OGqDjlmVjLq1BnXutJNWeXTwQw8TIPuM+U6NgDjyS/P56gJ0Zlv8MCYis7LGtyQXWd67lC cvtDvfjP+em3e9s/1FMeBcjeWKyOjS+HWc51VumOc1XPZNRQcqTFyI4gJpwa7A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712837132; a=rsa-sha256; cv=none; b=NWquMr0V7KQGNLwIdgtO4B2zkyXb+kCVD81n8fPl6IKnJt5TN7jtPg0Q/lIBvwJN7BJk2G JO/FdZ0n6SG+oNw5w30RuFGzwIz+ieO26jFP8ljPmyO7vD+/dZlOGYF3dgaL+uaUPnCmDn nBMDyqDgd3KknyM8JZgb0cRMekHBkymAgeyLTaWkU+4k9qoOoLfketsYDKYKbOlsw9dlAw 82O5vzsGts7AwKCEbVOCMOmRGzZyYPvoh3pikXX07mObAb4uVqeev8cxDB+87yKlP5AR3l +Exybzo3TUUL2Zu1dQ27S/QVZOSiCUDg/XU5JUzuxNnmOxTH5Dtjf7QiM3G3OQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712837132; 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=o36XvPqu0zSwDED6aNWmbOJsR/6Ar/utOI7KP1YnzkY=; b=cpt/KJn/op2eajbqVPgPTc0Q/tXPluF3LUDRdV3XrByEXxDVt5Zv7T8/n35IqmJDdZaOH1 7vLZX3mHC3sbZIlhk0NhdIOM+EJyCM3+xdPmZJWv6xC/HFHspw0HJZDEv90DnNMlx6DYQa Yk4lCXxAkAG4q82mootbRf2L2uuZWNmSQkLtOm+ZjY57LjER09DzCL4brttTYJn+RItRi2 7jAJ1rdwODoDHxBTt14A/bQAYlVp/Jm+nw+/SXG3jmGjrlxLwRniIukCTwJ30W47V2pa5I avY0fZlhJFKCOl8Mv1xAlPiNfLVtf+RadI9sGMoy7hfTogx0pDp4CPcCLVWF3g== 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 4VFdgc2Yq7z1KKW; Thu, 11 Apr 2024 12:05:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43BC5WvT011595; Thu, 11 Apr 2024 12:05:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43BC5W9Q011592; Thu, 11 Apr 2024 12:05:32 GMT (envelope-from git) Date: Thu, 11 Apr 2024 12:05:32 GMT Message-Id: <202404111205.43BC5W9Q011592@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: 227e7a205edf - stable/14 - release: add basic cloudinit images 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: dev-commits-src-branches+owner@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: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 227e7a205edf782129cba606f2d06b40e4728d98 Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=227e7a205edf782129cba606f2d06b40e4728d98 commit 227e7a205edf782129cba606f2d06b40e4728d98 Author: Baptiste Daroussin AuthorDate: 2024-03-15 08:43:20 +0000 Commit: Baptiste Daroussin CommitDate: 2024-04-11 12:05:10 +0000 release: add basic cloudinit images Provide both zfs and ufs images which a 1MB partition reserved for the config drive wearing a GPT Label "config-drive" to allow consumer to know where they should push the config drive on the provided image. This has been tested on OVHCloud baremetal via "bring your own image" Also tested on openstack Reviewed by: emaste Sponsored by: OVHCloud Differential Revision: https://reviews.freebsd.org/D44369 (cherry picked from commit 78b6117dac99c80fe618979fef4ef322b97415fa) (cherry picked from commit a977444652a59332c53b652b912c38a1d1802b58) --- release/Makefile.vm | 4 ++++ release/tools/basic-cloudinit.conf | 36 ++++++++++++++++++++++++++++++++++++ release/tools/vmimage.subr | 5 +++++ 3 files changed, 45 insertions(+) diff --git a/release/Makefile.vm b/release/Makefile.vm index 3a3b3bcd5f9d..a936e6cb98ca 100644 --- a/release/Makefile.vm +++ b/release/Makefile.vm @@ -19,6 +19,7 @@ RAW_DESC= Unformatted raw disk image CLOUDWARE_TYPES?= AZURE \ BASIC-CI \ + BASIC-CLOUDINIT \ EC2 \ GCE \ OCI \ @@ -29,6 +30,9 @@ AZURE_DESC= Microsoft Azure platform image BASIC-CI_FORMAT= raw BASIC-CI_FSLIST= ufs BASIC-CI_DESC= Image for CI +BASIC-CLOUDINIT_FORMAT= raw +BASIC-CLOUDINIT_FSLIST?= ufs zfs +BASIC-CLOUDINIT_DESC?= Images for VM with cloudinit disk config support EC2_FORMAT= raw EC2_FSLIST= ufs zfs EC2_FLAVOURS= BASE CLOUD-INIT diff --git a/release/tools/basic-cloudinit.conf b/release/tools/basic-cloudinit.conf new file mode 100644 index 000000000000..da4bed5ea5b5 --- /dev/null +++ b/release/tools/basic-cloudinit.conf @@ -0,0 +1,36 @@ +#!/bin/sh +# +# + +# Should be enough for base image, image can be resized in needed +export VMSIZE=5g + +# 1M config drive should be enough in most cases +export CONFIG_DRIVE=YES +export CONFIG_DRIVE_SIZE=1M + +# Set to a list of third-party software to enable in rc.conf(5). +export VM_RC_LIST="sshd growfs nuageinit" + +vm_extra_pre_umount() { + cat << EOF >> ${DESTDIR}/etc/rc.conf +dumpdev="AUTO" +ifconfig_DEFAULT="DHCP" +sshd_enable="YES" +EOF + + cat << EOF >> ${DESTDIR}/boot/loader.conf +autoboot_delay="-1" +beastie_disable="YES" +loader_logo="none" +console="comconsole,vidconsole" +EOF + cat <> ${DESTDIR}/etc/ssh/sshd_config +PasswordAuthentication yes +UsePAM no +EOF + + touch ${DESTDIR}/firstboot + + return 0 +} diff --git a/release/tools/vmimage.subr b/release/tools/vmimage.subr index 6eaf17b07948..eda22e061c6d 100644 --- a/release/tools/vmimage.subr +++ b/release/tools/vmimage.subr @@ -242,6 +242,10 @@ vm_create_disk() { BOOTPARTSOFFSET=":${VM_BOOTPARTSOFFSET}" fi + if [ -n "${CONFIG_DRIVE}" ]; then + CONFIG_DRIVE="-p freebsd/config-drive::${CONFIG_DRIVE_SIZE}" + fi + case "${VMFS}" in ufs) FSPARTTYPE=freebsd-ufs @@ -315,6 +319,7 @@ vm_create_disk() { mkimg -s ${PARTSCHEME} -f ${VMFORMAT} \ ${BOOTPARTS} \ ${SWAPOPT} \ + ${CONFIG_DRIVE} \ ${ROOTFSPART} \ -o ${VMIMAGE} From nobody Thu Apr 11 12:08:27 2024 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 4VFdl00rt3z5HKDd; Thu, 11 Apr 2024 12:08: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 4VFdkz4ytcz51G4; Thu, 11 Apr 2024 12:08:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712837307; 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=7vj9L9f65cWdo5noDETsfb6FUpMJ1ZNU+101gfFJBNU=; b=Bxc+hpn20hI8oZBJaPCLb8I+Q/gbeyZHi70eliFh/1yCHjaBIcyKt/fJrSFEmFFRACWV8P fVrUqnzxJKdYZMDymYaW6p9agCeMXUWQq+RjpKMXL0UCSzQynNXsuM3U+v2UkT3DitxYMj j6zP/NLZPGYoG9yDhGtIugvaYX82J8+fttzxUHG2t7iFGHmtoHz0sKrQy7SFntbJlrJ1Q2 WZeLuHUV3YjpwznVKOJMb57j/gy+QqEIBallwcRRb71e/pLBB/41y48MLWjK86GtPLrt4G p46OTuyMwU1gBX2t7SQ3XILo0rm3njZcHnnZBq9tgnmBMhSsPYG5k9JZGQzqEQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712837307; a=rsa-sha256; cv=none; b=bKJZxv7/hDwAjFLmNYHLKRgDJ66saS0qaCeXnSjWodMkJowUjGBt1m1k1Ls32aY0+2FCkf 1KazW3zZV0QtuFnkMVphsWxJd0gr40xaMn9M3B/cSjNY1X3hEnldhMCpQzc+UjmavRdxmb 4Okk6dfU8JMHLcUza2VJo9455PR8/4Ra/6ltCWAfdD66uxBL2muQIKJdAQddaaxoCedxk2 bp4QBc4BB7I6I3RzHC+I/TQrj+PIw1t7ErqLbs0thhtjpgvIAHOANsBsmccO2KRvS6/MwZ R3YiI5AB4qSHd06XrmjE7v6lBmsFDCTHO5EfpwxxeYQ6wqFrVhocfNFKZFcuhQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712837307; 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=7vj9L9f65cWdo5noDETsfb6FUpMJ1ZNU+101gfFJBNU=; b=gcnwWbwoNPFguC7y8qecW0MLC6UCwLZhLMDw0Yj435osR7JG7LyXuG7fPFeMgVoyWQ6GJ1 CzfqRiya9uSiWCUNHAWCLT+ya8z0j023ZnuNMXYZ7Jg3svW5yDGW0yPiSpmIKI0Mvn+Txx eUff25l2hx1P/YfmuL/UNETpfXQDi4/oTp3CMU3Ciw3kXb1RU7AG998eue0HT3Snk6dLNq 5h3i5h5GaPoradGRvpTB7D7q1CG5kINr55GRgGZexWnZ7Wn3IAkY0JC4SkqTDa+nptrldo vj5MwFGeBQ52gD/4MgVswmeH2OLJ8Bcdpkbb2Rjmdj96JxWRfz4GIcGi6DiMig== 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 4VFdkz4ZJKz1KKb; Thu, 11 Apr 2024 12:08:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43BC8RFL012099; Thu, 11 Apr 2024 12:08:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43BC8RGE012096; Thu, 11 Apr 2024 12:08:27 GMT (envelope-from git) Date: Thu, 11 Apr 2024 12:08:27 GMT Message-Id: <202404111208.43BC8RGE012096@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: 85df63ddd235 - stable/14 - mem.4: Correct 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: dev-commits-src-branches+owner@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: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 85df63ddd235457f29250e769c3d2c43a3b5b4f6 Auto-Submitted: auto-generated The branch stable/14 has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=85df63ddd235457f29250e769c3d2c43a3b5b4f6 commit 85df63ddd235457f29250e769c3d2c43a3b5b4f6 Author: Gordon Bergling AuthorDate: 2024-03-24 05:10:39 +0000 Commit: Gordon Bergling CommitDate: 2024-04-11 12:08:16 +0000 mem.4: Correct the HISTORY section The history section (added in CSRG) claimed both first appeared in v6. Looking at the manuals in the TUHS archive, /dev/mem was in v1 and /dev/kmem was introduced in v5. Reviewed by: imp Obtained from: OpenBSD Differential Revision: https://reviews.freebsd.org/D44486 (cherry picked from commit 8a56ef8d75b42ee7228247466c8c1712de6e3b6f) --- share/man/man4/mem.4 | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/share/man/man4/mem.4 b/share/man/man4/mem.4 index 71e7c41937a0..5df074acc8f3 100644 --- a/share/man/man4/mem.4 +++ b/share/man/man4/mem.4 @@ -27,7 +27,7 @@ .\" .\" @(#)mem.4 5.3 (Berkeley) 5/2/91 .\" -.Dd March 11, 2022 +.Dd March 24, 2024 .Dt MEM 4 .Os .Sh NAME @@ -300,11 +300,13 @@ privilege. .Xr memcontrol 8 .Sh HISTORY The -.Nm mem +.Pa /dev/mem +file appeared in +.At v1 and -.Nm kmem -files appeared in -.At v6 . +.Pa /dev/kmem +in +.At v5 . The ioctl interface for memory range attributes was added in .Fx 3.2 . .Sh BUGS From nobody Thu Apr 11 12:11:04 2024 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 4VFdp06fsyz5HK6H; Thu, 11 Apr 2024 12:11: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 4VFdp05yRsz5275; Thu, 11 Apr 2024 12:11:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712837464; 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=J4Upspbh3qq1zsNMKdTfEQIlAmk193CtognHIVC96yA=; b=EYrvnbc7aks+Rr3JsH8592aU1B6U51uLyONyc5ett8HrBDhqDVA/YmpxqP0LQUCZkDuPWx 8hwSCyLRddBtGJkiIfsB2fO/mXRJ/BxMml645YQ8caVEsbJ2nKmz/6KK350Ie6iqkJ4Lbh pjJir3kZ4iYwnvaWGh+VoPt8rleelqgcFdC4eH0ABjBg+Is53RUKxIg1f8jC8Yjod3bUN4 q2YxtdKWMfxCbX1Ulx3qbFSpqP1IDxez1c60zr8WxPWRBiJddCN7QK7JW3Z9y4I/yu5YdA TDedztjgdWtfIfF1otDoKB0hT18FckqeQ0n2vomYWrFggOtJC5+NugKgov1SFA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712837464; a=rsa-sha256; cv=none; b=TORRQax2gCKPgOxvw/ycjG7gHTyKMkRxdr4YwEEUy6u6FgQdxu9BfscKtRrybNenVQv9IU 9cwS6qn3PxzK4Xf1ZM0MR1msw2U997YT2guR7/pZxkO9H69AxE28/CeNH2npn3kQvqvfye ei9eelKArNZ6+a68emCQ8mZI6Dv11OLHld11CFNTcKatxwf2kljFAKQ1ohXlmOUVjZ++Sa 3q+IwALKOK//ysH2v/8T7vBL1mVQHs8mMU1Fnku9yo4JoR4i5yZYR1enRimMT9K18LzJSR w/bESYRPc/vcYRNXcPFaQAoUv71d4Uz8/Q+icQIUqjCafCkj9sB/LOY4UwmxAg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712837464; 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=J4Upspbh3qq1zsNMKdTfEQIlAmk193CtognHIVC96yA=; b=jMlwGSordTd5Bd366ATeGXEEOPWs28Z1L7tj7dPaHM8ewKgsVZ+rJi8XI72/7sCgrDcMLw dc54kTuLMoOCnPpOlQp4Yl4mNnTFlA5WmyZappUdm3eaCxyGeH1b5Bm5tzEpFYGyJzSGL6 DlMPhcMIUU2aGI7+76Zd4blX3r2IKkrMsFcn1vrtK4eTQv0VtudAIG5mvbxQKOGyDwUKqk YLGG0fNuxZJ7LCZyWrWMw9rXjDJn5fl2jkaxcqRLVaxylrYFRI/PwJvLu4RXez5rB/Efay ln3Pqya+yTuit0PzBL1yYOdaDWy+OrhLnwy05KSvB28B/OHoWfZluPwqcBRHzg== 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 4VFdp05YPTz1Jh3; Thu, 11 Apr 2024 12:11:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43BCB4v2021154; Thu, 11 Apr 2024 12:11:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43BCB49Y021151; Thu, 11 Apr 2024 12:11:04 GMT (envelope-from git) Date: Thu, 11 Apr 2024 12:11:04 GMT Message-Id: <202404111211.43BCB49Y021151@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: 15ce8a1cc1be - stable/13 - mem.4: Correct 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: dev-commits-src-branches+owner@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: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 15ce8a1cc1be157e761f105bf8a5190de6a267f2 Auto-Submitted: auto-generated The branch stable/13 has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=15ce8a1cc1be157e761f105bf8a5190de6a267f2 commit 15ce8a1cc1be157e761f105bf8a5190de6a267f2 Author: Gordon Bergling AuthorDate: 2024-03-24 05:10:39 +0000 Commit: Gordon Bergling CommitDate: 2024-04-11 12:10:53 +0000 mem.4: Correct the HISTORY section The history section (added in CSRG) claimed both first appeared in v6. Looking at the manuals in the TUHS archive, /dev/mem was in v1 and /dev/kmem was introduced in v5. Reviewed by: imp Obtained from: OpenBSD Differential Revision: https://reviews.freebsd.org/D44486 (cherry picked from commit 8a56ef8d75b42ee7228247466c8c1712de6e3b6f) --- share/man/man4/mem.4 | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/share/man/man4/mem.4 b/share/man/man4/mem.4 index 71e7c41937a0..5df074acc8f3 100644 --- a/share/man/man4/mem.4 +++ b/share/man/man4/mem.4 @@ -27,7 +27,7 @@ .\" .\" @(#)mem.4 5.3 (Berkeley) 5/2/91 .\" -.Dd March 11, 2022 +.Dd March 24, 2024 .Dt MEM 4 .Os .Sh NAME @@ -300,11 +300,13 @@ privilege. .Xr memcontrol 8 .Sh HISTORY The -.Nm mem +.Pa /dev/mem +file appeared in +.At v1 and -.Nm kmem -files appeared in -.At v6 . +.Pa /dev/kmem +in +.At v5 . The ioctl interface for memory range attributes was added in .Fx 3.2 . .Sh BUGS From nobody Thu Apr 11 13:25:01 2024 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 4VFgRK35bgz5HQX2; Thu, 11 Apr 2024 13:25: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 4VFgRK2rFvz57Mj; Thu, 11 Apr 2024 13:25:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712841901; 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=UxwAVcZp7pNgBI3iOGd1Cynt4Qy4QYv5PphOziJkIoE=; b=VJG0vJUzYnw55Rt+nrc7qiBUarpm/1I6v8LVDRaYm0OBTyEvwNTc8OjKHyMlAKfa5TBjUM JMQryWRwdyLwB1FRqXWw/Zg9PMzXpvQTR+S5iptJYf7OpCKKSnfo2yqsIaLaod52lgOgo5 hhw5CR2hMMZdBVRRmrexL1Q+8wGWoiYiEZWTo6A0TJvEuthHfX+E9ex6OKr4Gh+0Tu+3Up 6/SBw4l+Y5iWwxvxBXo48q7clG4LpATU7RuIdAHNKLuZT/uBbR/9XYf9BwPVIeUynF4mH3 ar02eCXNOiRv0kfvJmU4GlmropMkSfe/ZUJQc76EpDp/b+VKjfA7ftISgMlLIQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712841901; a=rsa-sha256; cv=none; b=ncrgtUjGSHmhnYdLxHjvmGznu6dvPpvzuBNoscZpw/RDWGUkoYcZ8XaxRKAMavKSDDxVI5 o62KRgtOk5t4D3oScV+wxgSteFIzymwh/yPHp1awX8bQY0hko390xdML2dZI3LB8YvxjIi BOVwA+xa3/LQqCgcvqJrVfTc2KHl62kxxF7EyxwRGdjdtwhKTnjqFT7SDV1mS5JzaEYymO PMOKJlXWLXerEmfBLXK+5XA6m/rALNcjNgaUk+NSikjyak3OuJJDhV4k9xSYw3gLIt8OJh cwzx5EGFL1Xwd0E8noXiUG3BNfmFFxQ7o2tdwux80urTQlOs0Nq7fsAyJOcnqw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712841901; 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=UxwAVcZp7pNgBI3iOGd1Cynt4Qy4QYv5PphOziJkIoE=; b=XnzSAQPD6MmlOlKuu9YR1kkZoRHzUrar+ny9E99qpdwEDWnzT82qWjfgvW0d6j2Rlbq2M7 Gi/VL3t06Q5jgjGmFrLVIxTgaCJHrjAFR0OzKLNYJhdMK7tsuEJ5FByDfYwZVX6ihSQUqM y4U3HkgtGce03gjfM5rJ36a2gUVZHRTSUAvGqENTTzwUk/s/7zWcy8kjbmyq2xB7DHwLOn 0TP0OBQwOHDAgrINok3l773IE9cZPeFoGYJX1VAYFSJDtcuqjNYl+09qjtlnj6yXtjhBaV /w48ne/J+2LPTyLChYPazLf01BFjyvui8VfnFQ4vgV+mnhsWzcv/+U1P9REEXA== 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 4VFgRK2RW4z1MBv; Thu, 11 Apr 2024 13:25:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43BDP1mU046937; Thu, 11 Apr 2024 13:25:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43BDP1EE046934; Thu, 11 Apr 2024 13:25:01 GMT (envelope-from git) Date: Thu, 11 Apr 2024 13:25:01 GMT Message-Id: <202404111325.43BDP1EE046934@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: 155779894faa - stable/14 - pam: Add pam_xdg module 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: dev-commits-src-branches+owner@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: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 155779894faafa220a38fd57ed6ff9e3aa6eff23 Auto-Submitted: auto-generated The branch stable/14 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=155779894faafa220a38fd57ed6ff9e3aa6eff23 commit 155779894faafa220a38fd57ed6ff9e3aa6eff23 Author: Emmanuel Vadot AuthorDate: 2024-02-21 14:51:05 +0000 Commit: Emmanuel Vadot CommitDate: 2024-04-11 13:24:49 +0000 pam: Add pam_xdg module This is a module to setup the XDG directories and environment variables. For now the only usage is to have a XDG_RUNTIME_DIR environment setup at user login. All other environment variable have a default fallback so no need to export them in this module. The directory is created according to the XDG Base directory specification. The default base directory is /var/run/xdg/ but can be configured using the runtime_dir= module option. According to the spec the directory *must* not survive a reboot so adding var_run_enable="YES" to rc.conf is highly recommanded. Reviewed by: des, pauamma (manpages) Differential Revision: https://reviews.freebsd.org/D44011 Sponsored by: Beckhoff Automation GmbH & Co. KG (cherry picked from commit 6e69612d5df1c1d5bd86990ea4d9a170c030b292) --- lib/libpam/modules/modules.inc | 1 + lib/libpam/modules/pam_xdg/Makefile | 6 + lib/libpam/modules/pam_xdg/pam_xdg.8 | 56 +++++++ lib/libpam/modules/pam_xdg/pam_xdg.c | 311 +++++++++++++++++++++++++++++++++++ 4 files changed, 374 insertions(+) diff --git a/lib/libpam/modules/modules.inc b/lib/libpam/modules/modules.inc index ddbb326f0312..f3ab65333f4f 100644 --- a/lib/libpam/modules/modules.inc +++ b/lib/libpam/modules/modules.inc @@ -30,3 +30,4 @@ MODULES += pam_ssh .endif MODULES += pam_tacplus MODULES += pam_unix +MODULES += pam_xdg \ No newline at end of file diff --git a/lib/libpam/modules/pam_xdg/Makefile b/lib/libpam/modules/pam_xdg/Makefile new file mode 100644 index 000000000000..2a470e0850bf --- /dev/null +++ b/lib/libpam/modules/pam_xdg/Makefile @@ -0,0 +1,6 @@ + +LIB= pam_xdg +SRCS= pam_xdg.c +MAN= pam_xdg.8 + +.include diff --git a/lib/libpam/modules/pam_xdg/pam_xdg.8 b/lib/libpam/modules/pam_xdg/pam_xdg.8 new file mode 100644 index 000000000000..1a8b53def051 --- /dev/null +++ b/lib/libpam/modules/pam_xdg/pam_xdg.8 @@ -0,0 +1,56 @@ +.\" * SPDX-License-Identifier: BSD-2-Clause +.\" +.\" Copyright (c) 2024 Beckhoff Automation GmbH & Co. KG +.\" +.\" * Redistribution and use in source and binary forms, with or without +.\" * modification, are permitted provided that the following conditions +.\" * are met: +.\" * 1. Redistributions of source code must retain the above copyright +.\" * notice, this list of conditions and the following disclaimer. +.\" * 2. Redistributions in binary form must reproduce the above copyright +.\" * notice, this list of conditions and the following disclaimer in the +.\" * documentation and/or other materials provided with the distribution. +.\" * +.\" * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" * SUCH DAMAGE. +.Dd February 21, 2024 +.Dt PAM_XDG 8 +.Os +.Sh NAME +.Nm pam_xdg +.Nd XDG PAM module +.Sh SYNOPSIS +.Op Ar service-name +.Ar module-type +.Ar control-flag +.Pa pam_xdg +.Op Ar arguments +.Sh DESCRIPTION +The xdg service module for PAM sets up the runtime directory according +to the XDG specifications. +.Pp +By default the directory is created under +.Pa /var/run/xdg/ . +.Pp +The following option may be passed to the authentication module: +.Bl -tag -width ".Cm runtime_dir" +.It Cm runtime_dir Ns = Ns Ar directory +Use an alternate base directory +.El +.Sh SEE ALSO +.Xr pam 3 , +.Xr pam.conf 5 +.Sh AUTHORS +The +.Nm +module and this manual page were written by +.An Emmanuel Vadot Aq Mt manu@FreeBSD.org . diff --git a/lib/libpam/modules/pam_xdg/pam_xdg.c b/lib/libpam/modules/pam_xdg/pam_xdg.c new file mode 100644 index 000000000000..40012fe463e0 --- /dev/null +++ b/lib/libpam/modules/pam_xdg/pam_xdg.c @@ -0,0 +1,311 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2024 Beckhoff Automation GmbH & Co. KG + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define PAM_SM_SESSION + +#include +#include +#include + +#define BASE_RUNTIME_DIR_PREFIX "/var/run/xdg" +#define RUNTIME_DIR_PREFIX runtime_dir_prefix != NULL ? runtime_dir_prefix : BASE_RUNTIME_DIR_PREFIX + +#define RUNTIME_DIR_PREFIX_MODE 0711 +#define RUNTIME_DIR_MODE 0700 /* XDG spec */ + +#define XDG_MAX_SESSION 100 /* Arbitrary limit because we need one */ + +static int +_pam_xdg_open(pam_handle_t *pamh, int flags __unused, + int argc __unused, const char *argv[] __unused) +{ + struct passwd *passwd; + const char *user; + const char *runtime_dir_prefix; + struct stat sb; + char *runtime_dir = NULL; + char *xdg_session_file; + int rv, rt_dir_prefix, rt_dir, session_file, i; + + session_file = -1; + rt_dir_prefix = -1; + runtime_dir_prefix = openpam_get_option(pamh, "runtime_dir_prefix"); + + /* Get user info */ + rv = pam_get_item(pamh, PAM_USER, (const void **)&user); + if (rv != PAM_SUCCESS) { + PAM_VERBOSE_ERROR("Can't get user information"); + goto out; + } + if ((passwd = getpwnam(user)) == NULL) { + PAM_VERBOSE_ERROR("Can't get user information"); + rv = PAM_SESSION_ERR; + goto out; + } + + /* Open or create the base xdg directory */ + rt_dir_prefix = open(RUNTIME_DIR_PREFIX, O_DIRECTORY | O_NOFOLLOW); + if (rt_dir_prefix < 0) { + rt_dir_prefix = mkdir(RUNTIME_DIR_PREFIX, RUNTIME_DIR_PREFIX_MODE); + if (rt_dir_prefix != 0) { + PAM_VERBOSE_ERROR("Can't mkdir %s", RUNTIME_DIR_PREFIX); + rv = PAM_SESSION_ERR; + goto out; + } + rt_dir_prefix = open(RUNTIME_DIR_PREFIX, O_DIRECTORY | O_NOFOLLOW); + } + + /* Open or create the user xdg directory */ + rt_dir = openat(rt_dir_prefix, user, O_DIRECTORY | O_NOFOLLOW); + if (rt_dir < 0) { + rt_dir = mkdirat(rt_dir_prefix, user, RUNTIME_DIR_MODE); + if (rt_dir != 0) { + PAM_VERBOSE_ERROR("mkdir: %s/%s (%d)", RUNTIME_DIR_PREFIX, user, rt_dir); + rv = PAM_SESSION_ERR; + goto out; + } + rv = fchownat(rt_dir_prefix, user, passwd->pw_uid, passwd->pw_gid, 0); + if (rv != 0) { + PAM_VERBOSE_ERROR("fchownat: %s/%s (%d)", RUNTIME_DIR_PREFIX, user, rv); + rv = unlinkat(rt_dir_prefix, user, AT_REMOVEDIR); + if (rv == -1) + PAM_VERBOSE_ERROR("unlinkat: %s/%s (%d)", RUNTIME_DIR_PREFIX, user, errno); + rv = PAM_SESSION_ERR; + goto out; + } + } else { + /* Check that the already create dir is correctly owned */ + rv = fstatat(rt_dir_prefix, user, &sb, 0); + if (rv == -1) { + PAM_VERBOSE_ERROR("fstatat %s/%s failed (%d)", RUNTIME_DIR_PREFIX, user, errno); + rv = PAM_SESSION_ERR; + goto out; + } + if (sb.st_uid != passwd->pw_uid || + sb.st_gid != passwd->pw_gid) { + PAM_VERBOSE_ERROR("%s/%s isn't owned by %d:%d\n", RUNTIME_DIR_PREFIX, user, passwd->pw_uid, passwd->pw_gid); + rv = PAM_SESSION_ERR; + goto out; + } + /* Test directory mode */ + if ((sb.st_mode & 0x1FF) != RUNTIME_DIR_MODE) { + PAM_VERBOSE_ERROR("%s/%s have wrong mode\n", RUNTIME_DIR_PREFIX, user); + rv = PAM_SESSION_ERR; + goto out; + } + } + + /* Setup the environment variable */ + asprintf(&runtime_dir, "XDG_RUNTIME_DIR=%s/%s", RUNTIME_DIR_PREFIX, user); + rv = pam_putenv(pamh, runtime_dir); + if (rv != PAM_SUCCESS) { + PAM_VERBOSE_ERROR("pam_putenv: failed (%d)", rv); + rv = PAM_SESSION_ERR; + goto out; + } + + /* Setup the session count file */ + for (i = 0; i < XDG_MAX_SESSION; i++) { + asprintf(&xdg_session_file, "%s/xdg_session.%d", user, i); + printf("Trying to open %s\n", xdg_session_file); + session_file = openat(rt_dir_prefix, xdg_session_file, O_CREAT | O_EXCL, RUNTIME_DIR_MODE); + free(xdg_session_file); + if (session_file >= 0) + break; + } + if (session_file < 0) { + PAM_VERBOSE_ERROR("Too many sessions"); + rv = PAM_SESSION_ERR; + goto out; + } + +out: + if (session_file >= 0) + close(session_file); + if (rt_dir_prefix >= 0) + close(rt_dir_prefix); + + if (runtime_dir) + free(runtime_dir); + return (rv); +} + +static int +remove_dir(int fd) +{ + DIR *dirp; + struct dirent *dp; + + dirp = fdopendir(fd); + if (dirp == NULL) + return (-1); + + while ((dp = readdir(dirp)) != NULL) { + if (dp->d_type == DT_DIR) { + int dirfd; + + if (strcmp(dp->d_name, ".") == 0 || + strcmp(dp->d_name, "..") == 0) + continue; + dirfd = openat(fd, dp->d_name, 0); + remove_dir(dirfd); + close(dirfd); + unlinkat(fd, dp->d_name, AT_REMOVEDIR); + continue; + } + unlinkat(fd, dp->d_name, 0); + } + + return (0); +} + +static int +_pam_xdg_close(pam_handle_t *pamh __unused, int flags __unused, + int argc __unused, const char *argv[] __unused) +{ + struct passwd *passwd; + const char *user; + const char *runtime_dir_prefix; + struct stat sb; + char *xdg_session_file; + int rv, rt_dir_prefix, rt_dir, session_file, i; + + rt_dir = -1; + rt_dir_prefix = -1; + runtime_dir_prefix = openpam_get_option(pamh, "runtime_dir_prefix"); + + /* Get user info */ + rv = pam_get_item(pamh, PAM_USER, (const void **)&user); + if (rv != PAM_SUCCESS) { + PAM_VERBOSE_ERROR("Can't get user information"); + goto out; + } + if ((passwd = getpwnam(user)) == NULL) { + PAM_VERBOSE_ERROR("Can't get user information"); + rv = PAM_SESSION_ERR; + goto out; + } + + /* Open the xdg base directory */ + rt_dir_prefix = open(RUNTIME_DIR_PREFIX, O_DIRECTORY | O_NOFOLLOW); + if (rt_dir_prefix < 0) { + PAM_VERBOSE_ERROR("open: %s failed (%d)\n", runtime_dir_prefix, rt_dir_prefix); + rv = PAM_SESSION_ERR; + goto out; + } + /* Check that the already created dir is correctly owned */ + rv = fstatat(rt_dir_prefix, user, &sb, 0); + if (rv == -1) { + PAM_VERBOSE_ERROR("fstatat %s/%s failed (%d)", RUNTIME_DIR_PREFIX, user, errno); + rv = PAM_SESSION_ERR; + goto out; + } + if (sb.st_uid != passwd->pw_uid || + sb.st_gid != passwd->pw_gid) { + PAM_VERBOSE_ERROR("%s/%s isn't owned by %d:%d\n", RUNTIME_DIR_PREFIX, user, passwd->pw_uid, passwd->pw_gid); + rv = PAM_SESSION_ERR; + goto out; + } + /* Test directory mode */ + if ((sb.st_mode & 0x1FF) != RUNTIME_DIR_MODE) { + PAM_VERBOSE_ERROR("%s/%s have wrong mode\n", RUNTIME_DIR_PREFIX, user); + rv = PAM_SESSION_ERR; + goto out; + } + + /* Open the user xdg directory */ + rt_dir = openat(rt_dir_prefix, user, O_DIRECTORY | O_NOFOLLOW); + if (rt_dir < 0) { + PAM_VERBOSE_ERROR("openat: %s/%s failed (%d)\n", RUNTIME_DIR_PREFIX, user, rt_dir_prefix); + rv = PAM_SESSION_ERR; + goto out; + } + + /* Get the last session file created */ + for (i = XDG_MAX_SESSION; i >= 0; i--) { + asprintf(&xdg_session_file, "%s/xdg_session.%d", user, i); + session_file = openat(rt_dir_prefix, xdg_session_file, 0); + if (session_file >= 0) { + unlinkat(rt_dir_prefix, xdg_session_file, 0); + free(xdg_session_file); + break; + } + free(xdg_session_file); + } + if (session_file < 0) { + PAM_VERBOSE_ERROR("Can't find session number\n"); + rv = PAM_SESSION_ERR; + goto out; + } + close(session_file); + + /* Final cleanup if last user session */ + if (i == 0) { + remove_dir(rt_dir); + if (unlinkat(rt_dir_prefix, user, AT_REMOVEDIR) != 0) { + PAM_VERBOSE_ERROR("Can't cleanup %s/%s\n", runtime_dir_prefix, user); + rv = PAM_SESSION_ERR; + goto out; + } + } + + rv = PAM_SUCCESS; +out: + if (rt_dir >= 0) + close(rt_dir); + if (rt_dir_prefix >= 0) + close(rt_dir_prefix); + return (rv); +} + +PAM_EXTERN int +pam_sm_open_session(pam_handle_t *pamh, int flags, + int argc, const char *argv[]) +{ + + return (_pam_xdg_open(pamh, flags, argc, argv)); +} + +PAM_EXTERN int +pam_sm_close_session(pam_handle_t *pamh, int flags, + int argc, const char *argv[]) +{ + + return (_pam_xdg_close(pamh, flags, argc, argv)); +} + +PAM_MODULE_ENTRY("pam_xdg"); From nobody Thu Apr 11 13:25:03 2024 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 4VFgRN01Hnz5HQX6; Thu, 11 Apr 2024 13:25: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 4VFgRM4Xp1z57kV; Thu, 11 Apr 2024 13:25:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712841903; 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=LGWGfRIyY6yvtMuqrkL9vqN5SAmaqbmRXgsqmca/X/8=; b=ujdxL4fstTCxmIAfze+2izJBaPwFWWfBEEWxjqt6zzYsVFAF12e4MhrG1ItUbSBN8KqqfW b0zYFyhwaLPekxQOsjuQP+kS8Hlrh95UQBNQt1B8XhI9O19hsjaNGO/BeG1nxUjYrX/mt1 ncaB4vdwdetk9cb52P8TRIcBc+nfV5UkD4ZAX+OA4Q2AMB61+zUMHWqXWL1BxeOoQ5+gE7 7uHM6OgdIUTj3gm2QoBtfaD2fldb1mWqrYjEFBQNX8X4ZC4MeQZE0BpSh1FpJPuf9TGmZI 4T170VGpMUR32dV4LunWYVXhEslWocR41X8Mv8PpDVqQ4zDdrSta5NjqpF8vMA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712841903; a=rsa-sha256; cv=none; b=JGIP19HJEiot0Sndr6IpBcpYcHqTLNiW0heiRydQhloMkSZC9jyVtFtv4spkgasUMrHvEc Oy02fnbeg8OS1knUQg6C7Jlscy/Yxo623JrCrDZSf27U2mtrMjtPsRExqi2SWmp8TRFklc UY3dfnqwSasDGeouxwKwYIMmw0OGwk5vMIbsL3JaHt0v9obGvz6sDFw6E9Hu7PWwp5wFiv J/yAV0tKWytx5hA8WrhT/99ngEg7Tl2KoOcq0YP4O+H8obPHRhGHtBDQBCCnw2sFP3abMn lF1pRI740QSD7f+w3MibDE7uzWjuo4IwGaKOyifYu6p/XH5YDBH3KIrR5SQiNQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712841903; 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=LGWGfRIyY6yvtMuqrkL9vqN5SAmaqbmRXgsqmca/X/8=; b=dBh5l0ACiuX+3z69cpHZQ63sKphPdqveYrjuqqheng36fhA71CloMtGIDjDsjo46NWxiMC HkF/lWRO/0MTc5Jqje6DBE7ve3iLEUPi3WtnEfTrrMeVHqgPoibbgxbHTSl9a2aEU9SvM0 +wA8arX4UFQif0iFw0GVLXfyyuSUogZ9yP61peTcDkRzJYQ/5Tug2RQ8EmuQzlZcloe8BY MsZjvNSPKAMmAO5Es1qINS95QgzeqRzDmLiAGjsBgFCAj6mgDMFW8UKKn9CRdr5V/sDlzH ZmdErj5E5KkoqCS/wRtxmfKulnuyzHNvIX7rzU0mla2m+EugjZxGNbt7SzyxuA== 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 4VFgRM47jmz1MLh; Thu, 11 Apr 2024 13:25:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43BDP3jA047030; Thu, 11 Apr 2024 13:25:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43BDP30w047027; Thu, 11 Apr 2024 13:25:03 GMT (envelope-from git) Date: Thu, 11 Apr 2024 13:25:03 GMT Message-Id: <202404111325.43BDP30w047027@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: bb219e78dddd - stable/14 - pam_xdg: Remove leftover debug printf 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: dev-commits-src-branches+owner@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: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: bb219e78dddd57741fd392d2c99f8a17e54e69bf Auto-Submitted: auto-generated The branch stable/14 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=bb219e78dddd57741fd392d2c99f8a17e54e69bf commit bb219e78dddd57741fd392d2c99f8a17e54e69bf Author: Emmanuel Vadot AuthorDate: 2024-02-27 06:39:13 +0000 Commit: Emmanuel Vadot CommitDate: 2024-04-11 13:24:49 +0000 pam_xdg: Remove leftover debug printf Sponsored by: Beckhoff Automation GmbH & Co. KG Fixes: 6e69612d5df1 ("pam: Add pam_xdg module") (cherry picked from commit 84329908c522b428e4dc858a9bac769117927cd3) --- lib/libpam/modules/pam_xdg/pam_xdg.c | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/libpam/modules/pam_xdg/pam_xdg.c b/lib/libpam/modules/pam_xdg/pam_xdg.c index 40012fe463e0..d218bc0425f2 100644 --- a/lib/libpam/modules/pam_xdg/pam_xdg.c +++ b/lib/libpam/modules/pam_xdg/pam_xdg.c @@ -141,7 +141,6 @@ _pam_xdg_open(pam_handle_t *pamh, int flags __unused, /* Setup the session count file */ for (i = 0; i < XDG_MAX_SESSION; i++) { asprintf(&xdg_session_file, "%s/xdg_session.%d", user, i); - printf("Trying to open %s\n", xdg_session_file); session_file = openat(rt_dir_prefix, xdg_session_file, O_CREAT | O_EXCL, RUNTIME_DIR_MODE); free(xdg_session_file); if (session_file >= 0) From nobody Thu Apr 11 13:25:02 2024 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 4VFgRM0VRJz5HQYv; Thu, 11 Apr 2024 13:25: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 4VFgRL6pWGz57T8; Thu, 11 Apr 2024 13:25:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712841903; 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=6/5Dfz5WPLTNJQT1qsx5dlIDlaZOwetadyX5CEFBrOw=; b=ByXDsVBkF1UBMFG10A0RS/BwA4akHT2dSTJ1KqHo/+ksx5VKtx6L1hFXBHDh35mBN1uAW4 Yb/CF9kFO2/GXMHrP6KcnEwzGOyeyIuSa6E4zhhkRs8qvqpmzK3OfYvZnidP0VbtqwvJkd pUhJjSfPkfroxrMH5UIMQ0jg/GHFbCBa3sFCo2IZsu+bhoHVJoJA19pAWQGJHeyz8x/zuP 0llHdjfEJulciwwmxFXNCNH/lMvJsGh7aOmGIruh/RDxDNafIKjqR1owSAsj3W8s0CHI3G 1t21jLpz9xID+Alj/CezXKc6mdoatfQwPvbC1OiZZMkv6toDEpShM0KnUnO/jw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712841903; a=rsa-sha256; cv=none; b=b6eGUUOV3CLr1Rkxpipt4YKg0cfkyK2tpLeOyhjFK+tAZnK5sgPDrRDNiaMs7VlqzLl7ha V/D5oZslNUOF6QnUKV+LtXSoSr75QaVUSVyg4+C0ggazVxFxf/APCblUehzOm0IoR3lEwn 1pvco7ffQIBEFZhMgVIwjy21fSgFNgAphWO504iwfJzWmguNP+Bd21o0B34au1DqNKzwFw qyWqrFpeHzUv1LytO12cyDN2hN6rHjzlB1md2VQ2KPm/LgomClwcqbBVyME7BcanNKXb8D yTNvlAvYDHcxHbG85AJscaTmprsubZMG0D/6Fpqt63FIdFD1wvTOszNqSfPIWw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712841903; 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=6/5Dfz5WPLTNJQT1qsx5dlIDlaZOwetadyX5CEFBrOw=; b=d0m7F3KUkjahanGNWpk7KEyFHeYE04YqM9OclJjIv8FkNISdnB06u+sOWkVus/XnfSDdyp Yfqdgy9U6JN4Z/uMElrJPQNAK0+URCTxQjypZHyfz4dljjkpG5ObXFoP4hI+uhqFeJiiu+ fKyFJ9skbmtSe5G4Ler4eM8/IDHd2kg2BCQFWpei05CPm02YV1ZSywaOrvKKkdb93aFi1K rfJr9ReMfjP2CClMj6wk75z9ibzEBzCdkYLXDVaMaPuloMMyRexB7JHPMOsyVL87iSmMn3 Qfg7OqLHgO00n15z1HZt54/XFkjngKPl/2QIQhkBGuCrGQfQRRv4K2UYsDi32w== 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 4VFgRL5Vdnz1M6D; Thu, 11 Apr 2024 13:25:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43BDP21Z046988; Thu, 11 Apr 2024 13:25:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43BDP2lK046985; Thu, 11 Apr 2024 13:25:02 GMT (envelope-from git) Date: Thu, 11 Apr 2024 13:25:02 GMT Message-Id: <202404111325.43BDP2lK046985@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: 8bca4da5bca3 - stable/14 - pam: Always use pam_xdg for session and xdm 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: dev-commits-src-branches+owner@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: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8bca4da5bca3748a5e8a7d0f1d3de36e0e73b6d9 Auto-Submitted: auto-generated The branch stable/14 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=8bca4da5bca3748a5e8a7d0f1d3de36e0e73b6d9 commit 8bca4da5bca3748a5e8a7d0f1d3de36e0e73b6d9 Author: Emmanuel Vadot AuthorDate: 2024-02-22 05:46:08 +0000 Commit: Emmanuel Vadot CommitDate: 2024-04-11 13:24:49 +0000 pam: Always use pam_xdg for session and xdm This ensure that the XDG_RUNTIME_DIR is always created and the environment variable is present which is a must for any wayland user (at least). The only "cost" of it is a directory is created and unused. Reviewed by: des Differential Revision: https://reviews.freebsd.org/D44012 Sponsored by: Beckhoff Automation GmbH & Co. KG (cherry picked from commit 6b9e6f12e5bbfe347dba8ff8e1e161f9180a1edd) --- lib/libpam/pam.d/system | 1 + lib/libpam/pam.d/xdm | 1 + 2 files changed, 2 insertions(+) diff --git a/lib/libpam/pam.d/system b/lib/libpam/pam.d/system index 5ba5567ea9c8..0b5ae5c8fff8 100644 --- a/lib/libpam/pam.d/system +++ b/lib/libpam/pam.d/system @@ -16,6 +16,7 @@ account required pam_unix.so # session #session optional pam_ssh.so want_agent session required pam_lastlog.so no_fail +session required pam_xdg.so # password #password sufficient pam_krb5.so no_warn try_first_pass diff --git a/lib/libpam/pam.d/xdm b/lib/libpam/pam.d/xdm index da4ac9f65c28..7f603ab640fd 100644 --- a/lib/libpam/pam.d/xdm +++ b/lib/libpam/pam.d/xdm @@ -16,6 +16,7 @@ account required pam_unix.so # session #session required pam_ssh.so want_agent session required pam_lastlog.so no_fail +session required pam_xdg.so # password password required pam_deny.so From nobody Thu Apr 11 13:25:04 2024 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 4VFgRP0BKsz5HQfc; Thu, 11 Apr 2024 13:25: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 4VFgRN5Vx5z57hQ; Thu, 11 Apr 2024 13:25:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712841904; 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=VhOfHe/mFdBp0gxT+q2Vugw7yILHoAKKUsV0JX48a6I=; b=F2L9mPdo8y1y+EhgXJP/RKmlKISbm4+1+BH131GJM6IV3eMz/VO7KGpXfbLrnDhosJCcJ9 +pDMQ+jQHt/htUp2/GFQ0F4OPtOl6rd772ZIWaQSpzSi8u5MuAzWIBHw5MOhTS2n7KVy2z /SKOIPXCBiwxAXMm4pabQhdlwYqJFlfRD4LDyMpYKpKpXql21O6UiiGBb5mTXpgLEMi9kA Zj4HmzImVANSbd9Nc0fbye4OrJ8NnL1lpaxwXWNveXPQNCfu3sXjvcgWwrGsoOGXOVfbe9 gKQlEvgO+6gxHLzog7Q8qeFMtd7Aifgp/Di4ZG7CnAn7tadrCfsj06v49RdBEw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712841904; a=rsa-sha256; cv=none; b=t7R726adCE3Q0RlMslRjIK4APev+LhfXjIcDC4wDozW1RlJ4qnaPKA7GYlatsSx2qZfv0I IyR0d/4G6oyKlIz0oCpgwmrxp1oDg7UCvyMRrRiil4mqTx4KqcBzKB2zaCFQuu10iNJ6xy WtRQ7Q7Ud+kQmjA9/epgVGxGWKyHphoucCtM6/hX/TAKVX3TpJUyBPFKmjeG137RCXyEpK CY9edoHyp9LlYCA8wv4zfji40eg5GJlfj5X6myzL1HvriFRZwJ721Zsbsd/SObeKCKysnB XebroHvwxNs6qoPBEGX+k9dZ77UqARnQF7nivc900LMbw6JUygjjSZN5cKyyhQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712841904; 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=VhOfHe/mFdBp0gxT+q2Vugw7yILHoAKKUsV0JX48a6I=; b=JOl0BMSjdUxJhN4aO9IUUiVmhvpfm1c1w+02zGxa90XhaNGnKppcZ0bvRusysSxU/frTzC PG7QeOP60LgAmgOU1UJnm+sMTa5kgxeFufHC/5SVUPE51XExm+1AZs1VAgBsBPBcagSZ1N 06wFw3ZtWB8cLlDo52eZMHInL92JdGyDDCmySpi3LlzRUYwaAgnQHoUCNF+/v/UjM67uIM daw5fg0Wy7aQwj2yn1L3ygIePq+7NUq2osEHehnXj3CAmcca8lY1Jd7tSl5XH5DDT98cnT oDZaKK1dw058ghTdBgyIoafcQL6Cq6nLO0BH+Q/lSzZjnSwCs4XRPBLbqp/opQ== 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 4VFgRN57DJz1Mfv; Thu, 11 Apr 2024 13:25:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43BDP4AZ047072; Thu, 11 Apr 2024 13:25:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43BDP4hK047069; Thu, 11 Apr 2024 13:25:04 GMT (envelope-from git) Date: Thu, 11 Apr 2024 13:25:04 GMT Message-Id: <202404111325.43BDP4hK047069@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: cd9fff7b0431 - stable/14 - pam_xdg: Check asprintf return value 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: dev-commits-src-branches+owner@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: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: cd9fff7b0431953db2f50d10fb1ba87809bcc6d6 Auto-Submitted: auto-generated The branch stable/14 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=cd9fff7b0431953db2f50d10fb1ba87809bcc6d6 commit cd9fff7b0431953db2f50d10fb1ba87809bcc6d6 Author: Emmanuel Vadot AuthorDate: 2024-02-27 06:41:59 +0000 Commit: Emmanuel Vadot CommitDate: 2024-04-11 13:24:49 +0000 pam_xdg: Check asprintf return value Reported by: Shawn Webb Sponsored by: Beckhoff Automation GmbH & Co. KG Fixes: 6e69612d5df1 ("pam: Add pam_xdg module") (cherry picked from commit 2d2950c889335b24af7a92f3aaf9946de47bb0bc) --- lib/libpam/modules/pam_xdg/pam_xdg.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/lib/libpam/modules/pam_xdg/pam_xdg.c b/lib/libpam/modules/pam_xdg/pam_xdg.c index d218bc0425f2..d8ba6899da2f 100644 --- a/lib/libpam/modules/pam_xdg/pam_xdg.c +++ b/lib/libpam/modules/pam_xdg/pam_xdg.c @@ -130,7 +130,12 @@ _pam_xdg_open(pam_handle_t *pamh, int flags __unused, } /* Setup the environment variable */ - asprintf(&runtime_dir, "XDG_RUNTIME_DIR=%s/%s", RUNTIME_DIR_PREFIX, user); + rv = asprintf(&runtime_dir, "XDG_RUNTIME_DIR=%s/%s", RUNTIME_DIR_PREFIX, user); + if (rv < 0) { + PAM_VERBOSE_ERROR("asprintf failed %d\n", rv); + rv = PAM_SESSION_ERR; + goto out; + } rv = pam_putenv(pamh, runtime_dir); if (rv != PAM_SUCCESS) { PAM_VERBOSE_ERROR("pam_putenv: failed (%d)", rv); @@ -140,7 +145,12 @@ _pam_xdg_open(pam_handle_t *pamh, int flags __unused, /* Setup the session count file */ for (i = 0; i < XDG_MAX_SESSION; i++) { - asprintf(&xdg_session_file, "%s/xdg_session.%d", user, i); + rv = asprintf(&xdg_session_file, "%s/xdg_session.%d", user, i); + if (rv < 0) { + PAM_VERBOSE_ERROR("asprintf failed %d\n", rv); + rv = PAM_SESSION_ERR; + goto out; + } session_file = openat(rt_dir_prefix, xdg_session_file, O_CREAT | O_EXCL, RUNTIME_DIR_MODE); free(xdg_session_file); if (session_file >= 0) @@ -256,7 +266,12 @@ _pam_xdg_close(pam_handle_t *pamh __unused, int flags __unused, /* Get the last session file created */ for (i = XDG_MAX_SESSION; i >= 0; i--) { - asprintf(&xdg_session_file, "%s/xdg_session.%d", user, i); + rv = asprintf(&xdg_session_file, "%s/xdg_session.%d", user, i); + if (rv < 0) { + PAM_VERBOSE_ERROR("asprintf failed %d\n", rv); + rv = PAM_SESSION_ERR; + goto out; + } session_file = openat(rt_dir_prefix, xdg_session_file, 0); if (session_file >= 0) { unlinkat(rt_dir_prefix, xdg_session_file, 0); From nobody Thu Apr 11 13:25:05 2024 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 4VFgRQ1NjFz5HQHY; Thu, 11 Apr 2024 13:25: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 4VFgRQ09NDz57WV; Thu, 11 Apr 2024 13:25:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712841906; 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=TSBLpHBV/24tJ84DxPUaARB1y6zWrPlxz3X9ctKx57Y=; b=t2q79QVi29pbXLr6cHwqmPebucYU9O6QzUqJkji8wm3OJeXbZLL4ZbJSdsav431d7ba7Sv k/KyCGqZOeLEDSw2DJSj0eLSv/baksnoB1WLLBCWJfnIngUB1UoRIg4r7pCGtqfP8TJrcl PymlpH3NKp1SUi7OuVBDbrnN9vlIHcGvGTpCMqyLcDu48IVMY3tCzSaH25eFmIWgQBYWnq tYIt2m0Km7wv4pjV8BLfjQMJoIK+hcHmCVynYAIRZexlihzxgYmsH8W5olbYBN3LClB69j uTjUiDB+zPuUzC4vSieqOAPuCPGu5G0prYE5k25QeTIIsxq3qoKXMNpXnczieg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712841906; a=rsa-sha256; cv=none; b=WxVXnDPpbucG3uL0oV0I8ETMMRrgxZJnZMulnKoI7qlgcqEbcj6m1ZuIORhC7YuCrDMfb7 l0XJ6qfEbVypuxk2Vgplltg/wUI6hVY8BgUbrz+WgJkvZP7Vvh5eawbg9WoIoOcRSh/3ve 7UWrndqieszMe+fRXoYYuexp79SEj1yJNVc4vpYMdMZoMSU7LsmLxwDd3BjySMKTslptcC ciALIBcSDUu+NvjVjBRH193Md1sPaClsWcGlDeEzqwb/CD/Ksh0N9xLe5IXXYxchH5AdYg V2/AMaDKnS5wIOT/oSo2UhwkpAc0ZZGWXCBfx41Iy/j/JOavBmdNKveqWWB9UQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712841906; 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=TSBLpHBV/24tJ84DxPUaARB1y6zWrPlxz3X9ctKx57Y=; b=XJh6e0NuR0qtRrotUY6w4qMgpN/yimdCvcxfdZUAkh4z1HdYoAe0PiKxDGdcsTZLfrTWNA 7Z9pEY67q+LPMOH/q6Yplqbr80zqt2rnlVahdSaS1Fi1FOzX4yutDo2l2H1i3tZaZ9nTcN OGT7DpH72Lzitac34oY6rX5oEmtjiywQsRIf256ZbpeQoUguR+mXBYLFzLyUfPyNTedH1b Bcs5kNNBgDBKnNL1fGMOo3/UsEA0+qcjSXSTgcqGoBXVvDDxpX95pdVNAOWEnS7asKvoUP ho1IK+kY5rCdocRyJK8yvojp0rTNlyrLGiDa+89voq30ptazP22OUT/iB3OGfg== 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 4VFgRP68Nsz1Mfw; Thu, 11 Apr 2024 13:25:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43BDP54A047127; Thu, 11 Apr 2024 13:25:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43BDP50D047124; Thu, 11 Apr 2024 13:25:05 GMT (envelope-from git) Date: Thu, 11 Apr 2024 13:25:05 GMT Message-Id: <202404111325.43BDP50D047124@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: 4d2dad92ee23 - stable/14 - pam_xdg: Reset rv to 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: dev-commits-src-branches+owner@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: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4d2dad92ee23f49c38d6dd72581fbee35a2f81b2 Auto-Submitted: auto-generated The branch stable/14 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=4d2dad92ee23f49c38d6dd72581fbee35a2f81b2 commit 4d2dad92ee23f49c38d6dd72581fbee35a2f81b2 Author: Emmanuel Vadot AuthorDate: 2024-02-27 07:05:00 +0000 Commit: Emmanuel Vadot CommitDate: 2024-04-11 13:24:49 +0000 pam_xdg: Reset rv to 0 Otherwise on success it ontain the return value of asprintf. Sponsored by: Beckhoff Automation GmbH & Co. KG Fixes: 2d2950c88933 ("pam_xdg: Check asprintf return value") (cherry picked from commit 5acbe6d1fb552eeaf44955c2780f2e9d4a70cad3) --- lib/libpam/modules/pam_xdg/pam_xdg.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/libpam/modules/pam_xdg/pam_xdg.c b/lib/libpam/modules/pam_xdg/pam_xdg.c index d8ba6899da2f..f1a9b13d581c 100644 --- a/lib/libpam/modules/pam_xdg/pam_xdg.c +++ b/lib/libpam/modules/pam_xdg/pam_xdg.c @@ -151,6 +151,7 @@ _pam_xdg_open(pam_handle_t *pamh, int flags __unused, rv = PAM_SESSION_ERR; goto out; } + rv = 0; session_file = openat(rt_dir_prefix, xdg_session_file, O_CREAT | O_EXCL, RUNTIME_DIR_MODE); free(xdg_session_file); if (session_file >= 0) @@ -272,6 +273,7 @@ _pam_xdg_close(pam_handle_t *pamh __unused, int flags __unused, rv = PAM_SESSION_ERR; goto out; } + rv = 0; session_file = openat(rt_dir_prefix, xdg_session_file, 0); if (session_file >= 0) { unlinkat(rt_dir_prefix, xdg_session_file, 0); From nobody Thu Apr 11 13:25:06 2024 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 4VFgRR264Jz5HQgl; Thu, 11 Apr 2024 13:25: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 4VFgRR0VXcz57hs; Thu, 11 Apr 2024 13:25:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712841907; 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=CvQZOlXoKi1Mf+sylcPQ+2quV/qMf6msEPOrq3PzjwM=; b=lEPYAOCKbirruQNxFmIhhLUFT+hXaRfFksYC+yijlM/J3FUpYyGlltYtAtfI+76BNB07yz Ymu0w+tS2SD11jEhZn/UhiznOB4LTF1oc7YaAdTjBY7RGLnZ1rebjj9aSTWr6u068M7R9S Y3KKhw2tMZfftLR/eyfugg4x2LseWpD6KDrbpHaC6z/DsbejHEUF7U5hv6BBPsBeSn5C3O vcAkDoF4zr2Y3NVh5kFRYjFY+oEUw8j0oiScu2oklSV5frxPC4uS6VzO1eKRGpja1z7HlJ G00SFaS0r0PLHvJ+BJo1nXVoDJ/G/uG4v7K/M/f2XPTI7Of4L0pCpC7Gwu75kA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712841907; a=rsa-sha256; cv=none; b=acjOFYAn7VLz8q7zC3rD4Y+zAmFQAr4co3EOIRqt7HMyOHit3ZtbPu4/lvfOdt33tIntHl 6d3Ii2t/vDfEn25wQwVAfmD87hLua1pB5X9W1rNrOQ5fMgv8wvR49TopfbXlJ6BVOTXdS6 GHjNvjXrmUHIzNEtKApexdWRI18l4/HDqGf7Ujs8g0cKERHX7+Seb0IEDGQPLA0yL23L26 LFAN9ynE8pQyY+CVP4D7z0OxrV0fjUuFM3C/eXVc0K4c9Xq9ZUlnWkIPtRScZ9R+EI1c8q y2f4aaszJIXSc7Am3ttrqlDzLXK/Sa/9PtdDh37Ni1Udjq9YROfRPIfl3wEr5w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712841907; 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=CvQZOlXoKi1Mf+sylcPQ+2quV/qMf6msEPOrq3PzjwM=; b=Az80ZPCikNuILpHh5R8oHFIjHeLu75J/skSIk/or30MxX7z0z1A2apjXKk8+b18ZXnQYnf nJY+wUyEC/hvYi/H0ofTBOsDB/3xcryG7S3tNsbjR7QQh5tlHaNQvJT7UguBVuKWunwMcG 5lY+SCO47ftKq1olaP/k4tLBS2+x9slmFvyZVkjsWWoGCc+cjXTsGQZQZgOTaYZVtH2Kuw cmxJB6h01SzMKJ/5f9aJlvqT53Qx+DkF/wxGesBe4iarDlQ7LVsuM/vI+zyL4aWSusXmJ4 pMrz8Kr4/HW6vx1bGIySR6xskzIj9Ub8evnvb7P5gb2CWaObAcEI0/MvXBG6ng== 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 4VFgRR03Qkz1MBw; Thu, 11 Apr 2024 13:25:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43BDP67Y047184; Thu, 11 Apr 2024 13:25:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43BDP6Gv047181; Thu, 11 Apr 2024 13:25:06 GMT (envelope-from git) Date: Thu, 11 Apr 2024 13:25:06 GMT Message-Id: <202404111325.43BDP6Gv047181@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: b556c37f83b0 - stable/14 - pam_xdg: Close the dir after removal 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: dev-commits-src-branches+owner@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: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b556c37f83b03432af6dd9af1a4e143fc8b2e100 Auto-Submitted: auto-generated The branch stable/14 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=b556c37f83b03432af6dd9af1a4e143fc8b2e100 commit b556c37f83b03432af6dd9af1a4e143fc8b2e100 Author: Emmanuel Vadot AuthorDate: 2024-03-01 13:49:16 +0000 Commit: Emmanuel Vadot CommitDate: 2024-04-11 13:24:49 +0000 pam_xdg: Close the dir after removal CID: 1534878 Sponsored by: Beckhoff Automation GmbH & Co. KG (cherry picked from commit 56ec98a04d19fec3750e47d12eb581c139c8b405) --- lib/libpam/modules/pam_xdg/pam_xdg.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/libpam/modules/pam_xdg/pam_xdg.c b/lib/libpam/modules/pam_xdg/pam_xdg.c index f1a9b13d581c..4d586a21566a 100644 --- a/lib/libpam/modules/pam_xdg/pam_xdg.c +++ b/lib/libpam/modules/pam_xdg/pam_xdg.c @@ -199,6 +199,7 @@ remove_dir(int fd) } unlinkat(fd, dp->d_name, 0); } + closedir(dirp); return (0); } From nobody Fri Apr 12 01:10:14 2024 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 4VFz5231K1z5GWbt; Fri, 12 Apr 2024 01:10: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 4VFz522Hd5z4NX5; Fri, 12 Apr 2024 01:10:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712884214; 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=pqcs468MDNEzq+mFNmh/GqkksXZdb2VOhC1/BDDMQoU=; b=sg/9iPzjLW+3JEaTNT9qSGmwGfHE3v6UBY7tIkOmgAoq0GyP0LoeT+towxxnS6bn+tzTZ+ X+gjO3GF/knOa7YUkp69ED4ZMeUnloDZ/lR3TjVKsopqUxqb2F/PGVNXDVQnOOszzD9JiL N1FLRKYBCKAG8mvWNfyHwRXTGMRNp1jwTs74LMORCMaOGwDDUMVPRGb7fQ7uvFZ8VOg5tm VjQ4wxqYg97cEY+viNL1pL0ssOprH9yKTmznsxxd3cyj7IbwWwIFy+7wvb0u60t6MNygGZ zpl9fdag0JUz0pUJtgjIQeFfnnBvGp///ia9gCGdHd4ZwYEZqjGit0ppejut3w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712884214; a=rsa-sha256; cv=none; b=xgO8S2XXjwCc94H4OQ1zQvSXSh81iEK/tFQjKTX0ZcAC14sBEwMzj14QsULjj0vLmalelf QjfHVwHT88GBicGSvzQknAolCI7R7wfQjr/uUB5cST6xZ8aDrFKdbsTNlO4hZDJdnsk4nX 86C5m6i1Or8GRFCZn45MM4GDLUKbwDWbpN4uI2ujMvQ0aryyhsHjyBYHyIhivMJsmrjCCy SotQApoPP5ND1zBy2h3RWJXWcMnitHVdyviYZJDYr1PwtgcZ7hSzHTv97rlrdcX7bNPBNY YoVSF+4IuIBnS+jut+nQQW/DfHvLolaT3btvxBXW4aaa4k/VK5qdDXyyBL+gOA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712884214; 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=pqcs468MDNEzq+mFNmh/GqkksXZdb2VOhC1/BDDMQoU=; b=dnHYSaHSfv32fsFIwMPjNHPvXQYSIoeoW3hHgAFEErj8lf6jbvwKqW2BrQEkLmA7DxJlZ7 faAyEy/uo1sJkaxl3TqwdoNNrbzGr0rzp+CwJzwYBEiQzFlsj7eLxJ5wazUBTfF4oNt/+q hTqCKGpf6D16lbpfD2MfeQUvDdymC2T7c20PZB1aDAHf7RdPiZJQHz6yn5GwqJ2Vr5uizp a+n74H1D+1LCm7tE2SCVVoSraUG7q14FAjy1UMae71SKqHE3WQslkN9J0XtRB6mDHOr+My /oW7Jdomya6Zzo6TJ5f3HR01yBnY/HWTFqVSW5f/QMqxSIpK1PZAdD14l8/QNw== 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 4VFz521mt0zTC6; Fri, 12 Apr 2024 01:10:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43C1AEVF039984; Fri, 12 Apr 2024 01:10:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43C1AED5039975; Fri, 12 Apr 2024 01:10:14 GMT (envelope-from git) Date: Fri, 12 Apr 2024 01:10:14 GMT Message-Id: <202404120110.43C1AED5039975@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: ea2275e72cda - stable/14 - sound: Drain buffer selinfo in sndbuf_free() 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: dev-commits-src-branches+owner@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: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ea2275e72cdae3672f3aabde18e3ff55ea101a0a Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=ea2275e72cdae3672f3aabde18e3ff55ea101a0a commit ea2275e72cdae3672f3aabde18e3ff55ea101a0a Author: Christos Margiolis AuthorDate: 2024-03-29 15:29:23 +0000 Commit: Christos Margiolis CommitDate: 2024-04-12 01:09:51 +0000 sound: Drain buffer selinfo in sndbuf_free() Prevent a use-after-free in kern_poll() by making sure the buffer's selinfo is drained. This is required for a subsequent patch that implements asynchronous audio device detach. Reported by: KASAN Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D44544 (cherry picked from commit fba54d0179aabb3d94211ca80f94fe5b98ac6d3b) --- sys/dev/sound/pcm/buffer.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/sound/pcm/buffer.c b/sys/dev/sound/pcm/buffer.c index 915c9110f107..afb4b95e357a 100644 --- a/sys/dev/sound/pcm/buffer.c +++ b/sys/dev/sound/pcm/buffer.c @@ -147,6 +147,7 @@ sndbuf_free(struct snd_dbuf *b) } else free(b->buf, M_DEVBUF); } + seldrain(sndbuf_getsel(b)); b->tmpbuf = NULL; b->shadbuf = NULL; From nobody Fri Apr 12 01:10:15 2024 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 4VFz534PGvz5GWnS; Fri, 12 Apr 2024 01:10: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 4VFz532Sm6z4Nmn; Fri, 12 Apr 2024 01:10:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712884215; 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=KjCJl1IKZ0Eo9Sj8xx2tSzMtzPBgh4EqQkfmUJaaw6g=; b=ufYmXECMnxpia27wRPH0dSiJ3elsTnUoXlUy9LdrfvKWr96QSnzxIrAvHrXQkJelJbrZO4 R19QdPZ4EacEdawqVyDcIKzdw/OgAzUb3Fqama5jwVSp+SiQnFlj41ZrG+crKly3Cip1pQ CtDQd+KKfE8+e/HiYrLFfGF871UyEK+QvgzLVssH8PmxUZZOrlmzMUsPvrD+nVo8qkQedN MIbNormK8ErfspIP8SYUc3Fc/Q7+mbdoaPMF0p3WhduJuxAE2DftZ9t/xoTfwAKnLsFCE/ vpocbYW/yU4JkJQ/BuTLsyGqsS/kMAGfteRmqNAhz8X2B54e7xpX7pwp9Ds7/A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712884215; a=rsa-sha256; cv=none; b=bLx4/M9FwzNUTnLgZEypeEKV2IhaKSTPRTXBsTmYzjXCzsdXxpEQNaTwnGb4w6dEVrgCUt ndRpg7aqsswukKijm0eVz0hy5eePkFfERFj3G9OF2z386MkOQdrUhCmKJkU+OM8irzvCD9 EP61ezIxv1ljpoOx7wMY8e2KQfM0QOUZnJtyS++Bhnz/zR4K3rLtLng1m5kCdyaSWkwFsw r3k5X+Y4vcnAdCyG5/khhKJNqL91JHoZz0aO2NjGiMxEbqvBBqNYqgmRsTHnJJrR77Oyie vT6GXF64udbuHmXrhWcuCds2TSrP1qgPN/Q/pUaXofu6rH9sReXXeoRSP9IRnw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712884215; 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=KjCJl1IKZ0Eo9Sj8xx2tSzMtzPBgh4EqQkfmUJaaw6g=; b=IWGPVbINnKqy4c5FSQlx/EtVKiQPzlsKELLcNgcTzGtwaZoxMBK/ticZiZHxA+eXgckOFb G8wKRFw5O4scw8/Os0FjaoPeWkPQ99BU22or65tgjq4HtP4W8MNDmjz5soG8JekfABA8LQ KYLSXCxVnB/ebKJS4XEcWUjsvM9/j+0U2Vs0BOFuy4iRT6mWzonsLJRhSgyAGm/C8E+vfc Cs/Po5kUcIL5Tc2aK+q7pyqa9eUodTslSEM+xtUaVUD9MVc9NNVAXEajUU/AFaTYJCiO0h UmCpX/uHiE+W0vBg4mWutWG0RaThtT72jXod6n72LIfAnZ2KhksXO+DfOD8mkQ== 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 4VFz53240YzSjl; Fri, 12 Apr 2024 01:10:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43C1AFUS040718; Fri, 12 Apr 2024 01:10:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43C1AFOM040709; Fri, 12 Apr 2024 01:10:15 GMT (envelope-from git) Date: Fri, 12 Apr 2024 01:10:15 GMT Message-Id: <202404120110.43C1AFOM040709@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 4dfb88f3dea5 - stable/14 - sound: Get rid of pcm/sndstat.h and turn macros into regular code 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: dev-commits-src-branches+owner@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: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4dfb88f3dea5708ab3c514736e1c8bab1a4a225c Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=4dfb88f3dea5708ab3c514736e1c8bab1a4a225c commit 4dfb88f3dea5708ab3c514736e1c8bab1a4a225c Author: Christos Margiolis AuthorDate: 2024-03-29 15:29:43 +0000 Commit: Christos Margiolis CommitDate: 2024-04-12 01:09:51 +0000 sound: Get rid of pcm/sndstat.h and turn macros into regular code There is no reason to have macros for this. Putting the code in sndstat_prepare_pcm() directly makes it easier to work with it. No functional change intended. Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D44545 (cherry picked from commit 6d1cee1640e1c360917e483ece5ec1bde423b788) --- sys/dev/sound/pcm/sndstat.h | 169 -------------------------------------------- sys/dev/sound/pcm/sound.c | 136 +++++++++++++++++++++++++++++++++-- 2 files changed, 132 insertions(+), 173 deletions(-) diff --git a/sys/dev/sound/pcm/sndstat.h b/sys/dev/sound/pcm/sndstat.h deleted file mode 100644 index 62722e560a54..000000000000 --- a/sys/dev/sound/pcm/sndstat.h +++ /dev/null @@ -1,169 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause - * - * Copyright (c) 2007-2009 Ariff Abdullah - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef _SND_SNDSTAT_H_ -#define _SND_SNDSTAT_H_ - -#define SNDSTAT_PREPARE_PCM_ARGS \ - struct sbuf *s, device_t dev, int verbose - -#define SNDSTAT_PREPARE_PCM_BEGIN() do { \ - struct snddev_info *d; \ - struct pcm_channel *c; \ - struct pcm_feeder *f; \ - \ - d = device_get_softc(dev); \ - PCM_BUSYASSERT(d); \ - \ - if (CHN_EMPTY(d, channels.pcm)) { \ - sbuf_printf(s, " (mixer only)"); \ - return (0); \ - } \ - \ - if (verbose < 1) { \ - sbuf_printf(s, " (%s%s%s", \ - d->playcount ? "play" : "", \ - (d->playcount && d->reccount) ? "/" : "", \ - d->reccount ? "rec" : ""); \ - } else { \ - sbuf_printf(s, " (%dp:%dv/%dr:%dv", \ - d->playcount, d->pvchancount, \ - d->reccount, d->rvchancount); \ - } \ - sbuf_printf(s, "%s)%s", \ - ((d->playcount != 0 && d->reccount != 0) && \ - (d->flags & SD_F_SIMPLEX)) ? " simplex" : "", \ - (device_get_unit(dev) == snd_unit) ? " default" : "") - -#define SNDSTAT_PREPARE_PCM_END() \ - if (verbose <= 1) \ - return (0); \ - \ - sbuf_printf(s, "\n\t"); \ - sbuf_printf(s, "snddev flags=0x%b", d->flags, SD_F_BITS); \ - \ - CHN_FOREACH(c, d, channels.pcm) { \ - \ - KASSERT(c->bufhard != NULL && c->bufsoft != NULL, \ - ("hosed pcm channel setup")); \ - \ - sbuf_printf(s, "\n\t"); \ - \ - sbuf_printf(s, "%s[%s]: ", \ - (c->parentchannel != NULL) ? \ - c->parentchannel->name : "", c->name); \ - sbuf_printf(s, "spd %d", c->speed); \ - if (c->speed != sndbuf_getspd(c->bufhard)) \ - sbuf_printf(s, "/%d", \ - sndbuf_getspd(c->bufhard)); \ - sbuf_printf(s, ", fmt 0x%08x", c->format); \ - if (c->format != sndbuf_getfmt(c->bufhard)) \ - sbuf_printf(s, "/0x%08x", \ - sndbuf_getfmt(c->bufhard)); \ - sbuf_printf(s, ", flags 0x%08x, 0x%08x", \ - c->flags, c->feederflags); \ - if (c->pid != -1) \ - sbuf_printf(s, ", pid %d (%s)", \ - c->pid, c->comm); \ - sbuf_printf(s, "\n\t"); \ - \ - sbuf_printf(s, "interrupts %d, ", c->interrupts); \ - \ - if (c->direction == PCMDIR_REC) \ - sbuf_printf(s, \ - "overruns %d, feed %u, hfree %d, " \ - "sfree %d [b:%d/%d/%d|bs:%d/%d/%d]", \ - c->xruns, c->feedcount, \ - sndbuf_getfree(c->bufhard), \ - sndbuf_getfree(c->bufsoft), \ - sndbuf_getsize(c->bufhard), \ - sndbuf_getblksz(c->bufhard), \ - sndbuf_getblkcnt(c->bufhard), \ - sndbuf_getsize(c->bufsoft), \ - sndbuf_getblksz(c->bufsoft), \ - sndbuf_getblkcnt(c->bufsoft)); \ - else \ - sbuf_printf(s, \ - "underruns %d, feed %u, ready %d " \ - "[b:%d/%d/%d|bs:%d/%d/%d]", \ - c->xruns, c->feedcount, \ - sndbuf_getready(c->bufsoft), \ - sndbuf_getsize(c->bufhard), \ - sndbuf_getblksz(c->bufhard), \ - sndbuf_getblkcnt(c->bufhard), \ - sndbuf_getsize(c->bufsoft), \ - sndbuf_getblksz(c->bufsoft), \ - sndbuf_getblkcnt(c->bufsoft)); \ - sbuf_printf(s, "\n\t"); \ - \ - sbuf_printf(s, "channel flags=0x%b", c->flags, \ - CHN_F_BITS); \ - sbuf_printf(s, "\n\t"); \ - \ - sbuf_printf(s, "{%s}", \ - (c->direction == PCMDIR_REC) ? "hardware" : \ - "userland"); \ - sbuf_printf(s, " -> "); \ - f = c->feeder; \ - while (f->source != NULL) \ - f = f->source; \ - while (f != NULL) { \ - sbuf_printf(s, "%s", f->class->name); \ - if (f->desc->type == FEEDER_FORMAT) \ - sbuf_printf(s, "(0x%08x -> 0x%08x)", \ - f->desc->in, f->desc->out); \ - else if (f->desc->type == FEEDER_MATRIX) \ - sbuf_printf(s, "(%d.%d -> %d.%d)", \ - AFMT_CHANNEL(f->desc->in) - \ - AFMT_EXTCHANNEL(f->desc->in), \ - AFMT_EXTCHANNEL(f->desc->in), \ - AFMT_CHANNEL(f->desc->out) - \ - AFMT_EXTCHANNEL(f->desc->out), \ - AFMT_EXTCHANNEL(f->desc->out)); \ - else if (f->desc->type == FEEDER_RATE) \ - sbuf_printf(s, \ - "(0x%08x q:%d %d -> %d)", \ - f->desc->out, \ - FEEDER_GET(f, FEEDRATE_QUALITY), \ - FEEDER_GET(f, FEEDRATE_SRC), \ - FEEDER_GET(f, FEEDRATE_DST)); \ - else \ - sbuf_printf(s, "(0x%08x)", \ - f->desc->out); \ - sbuf_printf(s, " -> "); \ - f = f->parent; \ - } \ - sbuf_printf(s, "{%s}", \ - (c->direction == PCMDIR_REC) ? "userland" : \ - "hardware"); \ - } \ - \ - return (0); \ -} while (0) - -#endif /* !_SND_SNDSTAT_H_ */ diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c index 186e7b194f27..c03e4fa435e1 100644 --- a/sys/dev/sound/pcm/sound.c +++ b/sys/dev/sound/pcm/sound.c @@ -37,7 +37,6 @@ #include #include #include -#include #include #include #include @@ -76,10 +75,139 @@ SYSCTL_STRING(_hw_snd, OID_AUTO, version, CTLFLAG_RD, &snd_driver_version, struct unrhdr *pcmsg_unrhdr = NULL; static int -sndstat_prepare_pcm(SNDSTAT_PREPARE_PCM_ARGS) +sndstat_prepare_pcm(struct sbuf *s, device_t dev, int verbose) { - SNDSTAT_PREPARE_PCM_BEGIN(); - SNDSTAT_PREPARE_PCM_END(); + struct snddev_info *d; + struct pcm_channel *c; + struct pcm_feeder *f; + + d = device_get_softc(dev); + PCM_BUSYASSERT(d); + + if (CHN_EMPTY(d, channels.pcm)) { + sbuf_printf(s, " (mixer only)"); + return (0); + } + + if (verbose < 1) { + sbuf_printf(s, " (%s%s%s", + d->playcount ? "play" : "", + (d->playcount && d->reccount) ? "/" : "", + d->reccount ? "rec" : ""); + } else { + sbuf_printf(s, " (%dp:%dv/%dr:%dv", + d->playcount, d->pvchancount, + d->reccount, d->rvchancount); + } + sbuf_printf(s, "%s)%s", + ((d->playcount != 0 && d->reccount != 0) && + (d->flags & SD_F_SIMPLEX)) ? " simplex" : "", + (device_get_unit(dev) == snd_unit) ? " default" : ""); + + if (verbose <= 1) + return (0); + + sbuf_printf(s, "\n\t"); + sbuf_printf(s, "snddev flags=0x%b", d->flags, SD_F_BITS); + + CHN_FOREACH(c, d, channels.pcm) { + KASSERT(c->bufhard != NULL && c->bufsoft != NULL, + ("hosed pcm channel setup")); + + sbuf_printf(s, "\n\t"); + + sbuf_printf(s, "%s[%s]: ", + (c->parentchannel != NULL) ? + c->parentchannel->name : "", c->name); + sbuf_printf(s, "spd %d", c->speed); + if (c->speed != sndbuf_getspd(c->bufhard)) { + sbuf_printf(s, "/%d", + sndbuf_getspd(c->bufhard)); + } + sbuf_printf(s, ", fmt 0x%08x", c->format); + if (c->format != sndbuf_getfmt(c->bufhard)) { + sbuf_printf(s, "/0x%08x", + sndbuf_getfmt(c->bufhard)); + } + sbuf_printf(s, ", flags 0x%08x, 0x%08x", + c->flags, c->feederflags); + if (c->pid != -1) { + sbuf_printf(s, ", pid %d (%s)", + c->pid, c->comm); + } + sbuf_printf(s, "\n\t"); + + sbuf_printf(s, "interrupts %d, ", c->interrupts); + + if (c->direction == PCMDIR_REC) { + sbuf_printf(s, + "overruns %d, feed %u, hfree %d, " + "sfree %d [b:%d/%d/%d|bs:%d/%d/%d]", + c->xruns, c->feedcount, + sndbuf_getfree(c->bufhard), + sndbuf_getfree(c->bufsoft), + sndbuf_getsize(c->bufhard), + sndbuf_getblksz(c->bufhard), + sndbuf_getblkcnt(c->bufhard), + sndbuf_getsize(c->bufsoft), + sndbuf_getblksz(c->bufsoft), + sndbuf_getblkcnt(c->bufsoft)); + } else { + sbuf_printf(s, + "underruns %d, feed %u, ready %d " + "[b:%d/%d/%d|bs:%d/%d/%d]", + c->xruns, c->feedcount, + sndbuf_getready(c->bufsoft), + sndbuf_getsize(c->bufhard), + sndbuf_getblksz(c->bufhard), + sndbuf_getblkcnt(c->bufhard), + sndbuf_getsize(c->bufsoft), + sndbuf_getblksz(c->bufsoft), + sndbuf_getblkcnt(c->bufsoft)); + } + sbuf_printf(s, "\n\t"); + + sbuf_printf(s, "channel flags=0x%b", c->flags, CHN_F_BITS); + sbuf_printf(s, "\n\t"); + + sbuf_printf(s, "{%s}", + (c->direction == PCMDIR_REC) ? "hardware" : "userland"); + sbuf_printf(s, " -> "); + f = c->feeder; + while (f->source != NULL) + f = f->source; + while (f != NULL) { + sbuf_printf(s, "%s", f->class->name); + if (f->desc->type == FEEDER_FORMAT) { + sbuf_printf(s, "(0x%08x -> 0x%08x)", + f->desc->in, f->desc->out); + } else if (f->desc->type == FEEDER_MATRIX) { + sbuf_printf(s, "(%d.%d -> %d.%d)", + AFMT_CHANNEL(f->desc->in) - + AFMT_EXTCHANNEL(f->desc->in), + AFMT_EXTCHANNEL(f->desc->in), + AFMT_CHANNEL(f->desc->out) - + AFMT_EXTCHANNEL(f->desc->out), + AFMT_EXTCHANNEL(f->desc->out)); + } else if (f->desc->type == FEEDER_RATE) { + sbuf_printf(s, + "(0x%08x q:%d %d -> %d)", + f->desc->out, + FEEDER_GET(f, FEEDRATE_QUALITY), + FEEDER_GET(f, FEEDRATE_SRC), + FEEDER_GET(f, FEEDRATE_DST)); + } else { + sbuf_printf(s, "(0x%08x)", + f->desc->out); + } + sbuf_printf(s, " -> "); + f = f->parent; + } + sbuf_printf(s, "{%s}", + (c->direction == PCMDIR_REC) ? "userland" : "hardware"); + } + + return (0); } void * From nobody Fri Apr 12 01:10:16 2024 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 4VFz545Njnz5GWlP; Fri, 12 Apr 2024 01:10: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 4VFz543M57z4NqL; Fri, 12 Apr 2024 01:10:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712884216; 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=02PyhPqr6POex55YtFX37sHwM2cC9oNMTCNDF1eMVpI=; b=YPfEypLwJHfZ5jOC3kmka7C/MaOQLhyxb8BuSZPmyf0M1SQIoER/4VBZOhT8kq7PR5mhrR YLatvSwcFgMqjWD/Ob2v/IJyMfewNColQWgz36rkfL6ll+BD7/WOh5TpBNdOG/+qvwRpLs xYtgRcVKtTiKM733jkVmuwDtx0AlvuhStbIKzin5mojAUHr9DZugEQRaLWz15jUHMYCmJB U4p9IXQodyZnUR+MWDvBxzCVVXgJjssPrOfDfOGoEa0/cNoG4Wr8zTqP+VjcfwzAebQ7Or ZfgiJl0RFrQqiSJi9Y4ZsMgCinEKadgza39gpto/qBG/vYbTmXyW03W7wc+d+w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712884216; a=rsa-sha256; cv=none; b=H/0bUVVOX5lv5Ivu68KCamWXfIFMUK3oZIKn7LEDLknAzJb9+2nz9chK7Qsn78Kb6xkDYw nzXLtHcPYi8goX0zs50J/dbnSMT+uD5pCbATlwnqOScm/swdMBpmWMkYSA9EVRn/Ed28UI kSxy4af2OwEWvj5xev9P7u1eccxWDB09r+xiXS0v/bOtUrcACJhNst5Mben4jnCOYxLM5E h0Byvu74+DMOj1qtE/nG4/hImKAJG65l4oF2w67mWAy+ZOVU99xbwDJsOazpjDHBnqGOYJ rPc11Lp7+VCZaUEB02M+fvG4zBc/4HddVZ0QlqCQBf2GBSa60egJ+EjkQrdOjg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712884216; 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=02PyhPqr6POex55YtFX37sHwM2cC9oNMTCNDF1eMVpI=; b=ZNXMLgqJ88e375jnL1uSu6Vdg/xAh92uRr2++S5Xib3DVUrKhH0wmVMCfzWAEjTWi5Ui4C 1OJ7xmhUyD+GDbk5UctHpFcc9iY6mndVRFZoZR32kdFyIJ2ssJsdN1U5epJoSurck/Jkbq ZIhLWPtk8o+5XKTtnGk3g4Ujb26x7qqd3OiAgPrnDZniZHNh+0z0MJaOQ+5m3LtzHmH/S1 OBjGNxRH9urbRyXgRp25SUH10/TDp5xcRavDcmC/DK21fAY3wV3y8rn7vAP/aU+PEef6wz HZiEy8tR7+X4n1YJmlKY7IAvfSFfLPqTjmtriOyfZziMhwwGZJreJK1edM4l8A== 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 4VFz542zJszSjm; Fri, 12 Apr 2024 01:10:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43C1AGsT041353; Fri, 12 Apr 2024 01:10:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43C1AGif041345; Fri, 12 Apr 2024 01:10:16 GMT (envelope-from git) Date: Fri, 12 Apr 2024 01:10:16 GMT Message-Id: <202404120110.43C1AGif041345@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 578a8fb50c39 - stable/14 - sound: Fix SND_DIAGNOSTIC ifdef 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: dev-commits-src-branches+owner@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: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 578a8fb50c3968b2efdcf7f45acc554ae339e2f6 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=578a8fb50c3968b2efdcf7f45acc554ae339e2f6 commit 578a8fb50c3968b2efdcf7f45acc554ae339e2f6 Author: Christos Margiolis AuthorDate: 2024-03-29 15:32:13 +0000 Commit: Christos Margiolis CommitDate: 2024-04-12 01:09:51 +0000 sound: Fix SND_DIAGNOSTIC ifdef comment Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D44555 (cherry picked from commit c136e6180e4762c1180d89cd2291fd9a935a721d) --- sys/dev/sound/pcm/sound.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/sound/pcm/sound.h b/sys/dev/sound/pcm/sound.h index 4af56a2c411a..0a8144e97c24 100644 --- a/sys/dev/sound/pcm/sound.h +++ b/sys/dev/sound/pcm/sound.h @@ -519,7 +519,7 @@ int sound_oss_card_info(oss_card_info *); mtx_unlock(&Giant); \ } \ } while (0) -#else /* SND_DIAGNOSTIC */ +#else /* !SND_DIAGNOSTIC */ #define PCM_WAIT(x) do { \ PCM_LOCKASSERT(x); \ while ((x)->flags & SD_F_BUSY) \ @@ -590,7 +590,7 @@ int sound_oss_card_info(oss_card_info *); mtx_unlock(&Giant); \ } \ } while (0) -#endif /* !SND_DIAGNOSTIC */ +#endif /* SND_DIAGNOSTIC */ #define PCM_GIANT_LEAVE(x) \ PCM_GIANT_EXIT(x); \ From nobody Fri Apr 12 01:10:17 2024 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 4VFz560Gykz5GWWF; Fri, 12 Apr 2024 01:10: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 4VFz554F9mz4Nfy; Fri, 12 Apr 2024 01:10:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712884217; 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=pcHZ19ZqwSER1dj2YB5x2Tyje7gOjaUTF6e1EGo6f6E=; b=ydjA40FPZ17UaQPlLiYfLZJaJETmcju/MrfZ1D7d7iiUW3dapMpWFFenmcYg97LGTRqdTy 4B5ubQdOSaq/YCyFjSzflENc3IvXsvpLKaSQ6hEPTav6HQDAIA/eoKiC/CDA6Mt9KpTM69 CEwXNLA9lHlRNXT5diA1D9iaEZQW/FR7K0s/kKjk0Jd0t2DR95I3L/IUvDilnkSqs2Inu1 utQT6GZJLkcoR+e9Cx7SCP4SxZ0hYJTPnSE+HUcHPb+1Fef/4H1zlq6AbNP6xXXO9I3TB2 JOF+GvQQnFccCJOjsKqd9zqSPW3GTp6DcUeGZXkVvFqLilkYv8eeRnyF7JCDLA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712884217; a=rsa-sha256; cv=none; b=YvX+eMVO7m2F11wpxb9G5Nab3QqByQ++2uLti/YDb6pw1OLI/eJGIZ8JgfXu0SYJ7WuYUs Lw+wMYrpQ03Vp6UfWFGq41yG6CS/zXo8XzWoL2z1LmS+Kx2fL1qk5JrYEak6DFs2RMvvW6 Xog63c9A00mhqoxYjV6EEEzrLkrssdcwShSmrE+2u9Hinuoqvk1gwEYQIx/vOFRyJ4x8sS T+uohLk/QBfK6Tf4moApwyFrlpy8xW10HFy0RPbFZ/VGvGcPbqEVKpoyVSIGRgGDmCYA3F mMV3s8vJtFHx68lKYRkdtprx47ckykMoG30ROmV01H/rDJu/gLP1jurbISnNbw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712884217; 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=pcHZ19ZqwSER1dj2YB5x2Tyje7gOjaUTF6e1EGo6f6E=; b=sgBnBkrLQhu2JL69VU9s1CD/87g4V5B2Cs217NwTt6DAX6HflR6ZYKnyzoBI84LQ+PB8MS hXQRzPppKiHXGN42MX9NBaCAtlqPmW5yw7sIQx5438FWEbuQE3cJRgMeJxTFTeN2Zd728o RTZfehH+aeJU6dzIyLfpyUODtyGY3SMiNGFJblQsXiuWlYThNve/veSztd/46kpCGsbdYo HZLWxT3mHPe28FcGg3l2pOrZ1Qv52HRKeF4fPV5j/IwD0m0b0TgMVncJ9ItCP5O+W1/Cut zwsBnQpxotiVu+d7e8mPU1q8Uby9BnGXCxVcT1wO0FbfFqWfvnU1WBuzsbrc9A== 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 4VFz553ntVzTC7; Fri, 12 Apr 2024 01:10:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43C1AHp7041982; Fri, 12 Apr 2024 01:10:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43C1AHge041971; Fri, 12 Apr 2024 01:10:17 GMT (envelope-from git) Date: Fri, 12 Apr 2024 01:10:17 GMT Message-Id: <202404120110.43C1AHge041971@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 7e0c6e00b3c9 - stable/14 - sound: Remove unused SND_DEV_LAST and SND_DEV_MAX constants 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: dev-commits-src-branches+owner@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: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7e0c6e00b3c9087d5e845e48d6009c88ae6844df Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=7e0c6e00b3c9087d5e845e48d6009c88ae6844df commit 7e0c6e00b3c9087d5e845e48d6009c88ae6844df Author: Christos Margiolis AuthorDate: 2024-03-29 15:32:38 +0000 Commit: Christos Margiolis CommitDate: 2024-04-12 01:09:51 +0000 sound: Remove unused SND_DEV_LAST and SND_DEV_MAX constants Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D44554 (cherry picked from commit b5e55dbf357472ffa39345b30b8b781e988a440f) --- sys/dev/sound/pcm/sound.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/sys/dev/sound/pcm/sound.h b/sys/dev/sound/pcm/sound.h index 0a8144e97c24..51d1624b2d7e 100644 --- a/sys/dev/sound/pcm/sound.h +++ b/sys/dev/sound/pcm/sound.h @@ -287,9 +287,6 @@ struct snd_mixer; #define SND_DEV_DSP_SPDIFOUT 19 /* /dev/dsp_spdifout */ #define SND_DEV_DSP_SPDIFIN 20 /* /dev/dsp_spdifin */ -#define SND_DEV_LAST SND_DEV_DSP_SPDIFIN -#define SND_DEV_MAX PCMMAXDEV - #define DSP_DEFAULT_SPEED 8000 #define ON 1 From nobody Fri Apr 12 01:18:39 2024 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 4VFzGl4K38z5GXj7; Fri, 12 Apr 2024 01:18: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 4VFzGl3pRCz4Pln; Fri, 12 Apr 2024 01:18:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712884719; 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=I1kGUlNjbE0b2rwHbN/MO1Hh3hdw6ip6yuzf8SaG5vU=; b=exH0mGtmMeiAZKRiXJCMVlaGvA+34o5hDz/0RFFQa+ACIeRcZ9NEkN5Fl4hdkOqAUnhImy YwM2Zj+4bIEsbihAQPrNc/6de+pYZ7t+zXNW8+ZjxdalzKmrF0objcUDEQ8vVzW7ydiBCL w2iSi+gVIsr5IJ2NDrzDOh8SbbNWKaSWXRwu1tDw8KpSvd73vdNN9dcBpHR+UytAkUcWBm 30r4DQ53+hNQMjrLRr8KA1sPXX1ZNxv0KD6uqDYFskxM4Mdpi3Wa6p9z6lJaIbnsvoPcLQ mA63pArrvM1HKreGBKw7mTcbkyx7AnFXZFz6LgjoDfZpoIGZASBmvqC6V0qqhg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712884719; a=rsa-sha256; cv=none; b=H3dmhXao0uy3v0GDQKw5zYzHmmoFxO5E5xh+8PfcGJ4k+whr5vGsyy7ge/oxV+Uk3kqfbq /SCje7vxYXUxspUhovU4ZDk03YTrs+MrSDurtyx+qkmH3zF+n/fzh6xxPhPoFKjBElUkuO +WiWk+TfMs/uoakS7iApnMSG2ojdMRJuTWvdYEg44Wc06VuwyibukodFEP/dfQcPIho9hR uPILdZmxtXU4sakj6gfKrEzNNsqu5T8wmsuDQQclcNqb5iniyXBiBiPTibPk0WZRXPymYZ WZMyNPO0VDqFFrcBTo1UVPVSKZ40GgUQ4jILuBZTxr5951RBS9k+dFgfsRd+hQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712884719; 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=I1kGUlNjbE0b2rwHbN/MO1Hh3hdw6ip6yuzf8SaG5vU=; b=NF5T6FNwM+usxAapJiQFt8DhSmakQdkJlQisEu4RuMNPushaFBRGh4tSRuMaenzYqs7O1a mvtyfKVNRWkYsPNPJV/qqRu9bhIVhRgcpYl/Fc6rYL2jOSa4uUoLy+VMJPlF7vZeCiY5Lq oOpFyN9fUZzV2eJDF+OqBvfeOMA9rBLlbCUxZp1VQ/Yvkbch9bhiT2HM971OeJu3W848wl 4dwRPgNZLuJ34SwE+DAi8sGopkBHjhNsdInitXbsEoq6VSfBd4FlHX66IKtfgh7uqfNKen T+2QNq/YZm5cruM93b8ubj+IgDPzwWYMOgf9UfWTbvDIE/ZbTZGVIE2MD4g5vQ== 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 4VFzGl3HdrzSyb; Fri, 12 Apr 2024 01:18:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43C1IdQ7050196; Fri, 12 Apr 2024 01:18:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43C1IdS8050193; Fri, 12 Apr 2024 01:18:39 GMT (envelope-from git) Date: Fri, 12 Apr 2024 01:18:39 GMT Message-Id: <202404120118.43C1IdS8050193@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: a648f68c9254 - stable/14 - stop_all_proc(): skip traced or signal-stoped processes 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: dev-commits-src-branches+owner@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/14 X-Git-Reftype: branch X-Git-Commit: a648f68c9254158af772ee589884adbc85a9a504 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=a648f68c9254158af772ee589884adbc85a9a504 commit a648f68c9254158af772ee589884adbc85a9a504 Author: Konstantin Belousov AuthorDate: 2024-04-04 19:24:32 +0000 Commit: Konstantin Belousov CommitDate: 2024-04-12 01:18:32 +0000 stop_all_proc(): skip traced or signal-stoped processes (cherry picked from commit 235436d6311ea5ad00edcc1e553012f0736ea86d) --- sys/kern/kern_proc.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index 936d410133eb..b52455f140b2 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -3479,7 +3479,8 @@ allproc_loop: LIST_REMOVE(cp, p_list); LIST_INSERT_AFTER(p, cp, p_list); PROC_LOCK(p); - if ((p->p_flag & (P_KPROC | P_SYSTEM | P_TOTAL_STOP)) != 0) { + if ((p->p_flag & (P_KPROC | P_SYSTEM | P_TOTAL_STOP | + P_STOPPED_SIG)) != 0) { PROC_UNLOCK(p); continue; } @@ -3500,6 +3501,16 @@ allproc_loop: PROC_UNLOCK(p); continue; } + if ((p->p_flag & P_TRACED) != 0) { + /* + * thread_single() below cannot stop traced p, + * so skip it. OTOH, we cannot require + * restart because debugger might be either + * already stopped or traced as well. + */ + PROC_UNLOCK(p); + continue; + } sx_xunlock(&allproc_lock); _PHOLD(p); r = thread_single(p, SINGLE_ALLPROC); From nobody Fri Apr 12 01:18:40 2024 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 4VFzGm4fSHz5GXfb; Fri, 12 Apr 2024 01:18: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 4VFzGm45lYz4Pnw; Fri, 12 Apr 2024 01:18:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712884720; 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=YZmpx2skt/D11bbEighZl3xFxt+av3oxwNdyg5TQCXw=; b=EU9u97qbsjGlQubdcXcEy+Z+vKo9sH65KjCB2Up2g7U3O2Ksaqs/TWKt3X/zB9IuEN97WV 6jAoDIa4eTAyHsmSm60L6d9VmEzG3PxEanPhPElb7gElCfamf0QWUZHoljBKLcJ3DQY8e1 6Hb+NQqE9o0kkJ3lkwI8T9dITgmivOIMlzeoRA2T/xeu9bCBuzkQEbpitSSItwGzxpCBo2 7qAciWq9RdsNRVthh5Eh1qs9/yiJAOQ4Tz9z5woDCTe517uBiIr0chLpEdt3xphfn5F+zb LlTwUGfjqAYu4PdSYm33pmiIJM+UUuo9SsiYy8WyFoRsxDatLP5b6ujfRihTmw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712884720; a=rsa-sha256; cv=none; b=nSziRZMRy65E/vPSs7i2E0wIn7e8eBvNgH45xoDOz41vgWG925foOO43K7It1oS07wIPCN r+iqQBy+INXpAuhARMv1bAQwXx6bmfM0WRktJMfZaCu8Cxbv/N1n4gyEDQkjHTB6/S7MzZ 2m1AAbFo+5+zWMk7a0qT+e4wbuDfjXD4Ik4KiWc8BnI5IxtnqwOx/U1N3rWv0w50g6/2ZF wRedXB+WvjmMUMExuA2iNAIWLQrE1E3sneCPzX4py9HlK2gJv4C9mvNPXzSGedQcyXk8RT xMc6A6uyVUBd/YjzKcpBOOUNgyOwBw49lIoJQ5kZYUR6ae0rw0da+M5f8mrQ0Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712884720; 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=YZmpx2skt/D11bbEighZl3xFxt+av3oxwNdyg5TQCXw=; b=Tap4C2pp2KapVnU7r92VylhrRf7ogl5XZPmUbYKbb6iWbRDqZ3tQnWEidg12pgJFwqxzbj 5RBfKn7/lP17sdyNUkNWA0MypIWDMUielK8nW6M6/4NLoyDGh5guJjL9O+Bhf+Cl2Mfs4W purcADEBCSPfA7h61GDSrGfqDfpIcUXbXrkwA/77NdKUyx4NiRAF6hr5s+LxJ6eruV9RWe N2przgz4Z0Sq3JhTuGIdJlFArukgOYYQ2q+NPjiBa5zOmHNOaHR7rDhCnND4jb7E45ipqi u9xJLHDPTTc8idyHdQo9uAhjTClXOIFBnZynLJqzSh3oialcLmLJbKSdj41bbg== 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 4VFzGm3jt9zSrq; Fri, 12 Apr 2024 01:18:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43C1IebG050245; Fri, 12 Apr 2024 01:18:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43C1Ieui050241; Fri, 12 Apr 2024 01:18:40 GMT (envelope-from git) Date: Fri, 12 Apr 2024 01:18:40 GMT Message-Id: <202404120118.43C1Ieui050241@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: 2bb6e35f3b9f - stable/14 - acpidump: silent the warning about unaligned uuid 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: dev-commits-src-branches+owner@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/14 X-Git-Reftype: branch X-Git-Commit: 2bb6e35f3b9fb898ea2c4abf339cf89dc8f516f4 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=2bb6e35f3b9fb898ea2c4abf339cf89dc8f516f4 commit 2bb6e35f3b9fb898ea2c4abf339cf89dc8f516f4 Author: Konstantin Belousov AuthorDate: 2024-04-03 02:58:28 +0000 Commit: Konstantin Belousov CommitDate: 2024-04-12 01:18:32 +0000 acpidump: silent the warning about unaligned uuid (cherry picked from commit de937ecb75ed4d61fc06dd380f9bf6be998502e9) --- usr.sbin/acpi/acpidump/acpi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/acpi/acpidump/acpi.c b/usr.sbin/acpi/acpidump/acpi.c index 3ebfefcc591f..c851e97e9e37 100644 --- a/usr.sbin/acpi/acpidump/acpi.c +++ b/usr.sbin/acpi/acpidump/acpi.c @@ -1596,7 +1596,7 @@ acpi_print_nfit(ACPI_NFIT_HEADER *nfit) printf("\tRangeIndex=%u\n", (u_int)sysaddr->RangeIndex); printf("\tProximityDomain=%u\n", (u_int)sysaddr->ProximityDomain); - uuid_to_string((uuid_t *)(sysaddr->RangeGuid), + uuid_to_string((uuid_t *)(uintptr_t)(sysaddr->RangeGuid), &uuidstr, &status); if (status != uuid_s_ok) errx(1, "uuid_to_string: status=%u", status); From nobody Fri Apr 12 01:18:41 2024 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 4VFzGp0Y4Lz5GXjF; Fri, 12 Apr 2024 01:18: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 4VFzGn5F48z4QGG; Fri, 12 Apr 2024 01:18:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712884721; 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=iNoxKFeGLzVo0kr3mMIHWXmPDW6XBugljVhvDByu4Bo=; b=xr5nm33dZEOa+5OODcGqEyNv7DIObI8mTiIjbYOev8DQyeC1BM/E+7MXSv8e6a7rTk3HPD 2VLsjnruyBI2wP8WvBLUuYD/vhhd9naMV3CP0u4Qn8u9/2yvKttAeCXH6BA6CIva+MJ5Nw jgQwMmRfOXgRAS5WSOQm9c/5m1yGmNe+M1XXdRKGw14YdSYG/MghLcjdOYWmUroidAg19Y Y1Oz0cbGiGMvJ2jwak4xLK+VfNz5fNlNpSa5aIdU/TYw1qfymI0EwgAR+qk0DvEiKGxyAy XX7ENlrzOSVhuXkGOXKiizKGm2JG/ErT7HvOOYNx2O+JbblclFN5BSn324K96g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712884721; a=rsa-sha256; cv=none; b=FBObR9k4dR0OxGHUq363NGmctHR2/DB1++/GGAfHyXd3CCYmAY49Yz39vg8ZWv/DBQb+XT ZxuyvjlojidqNfgY7KZQH+aBO2IDVGRultgvtKUEocSzi3NevtZe6WAabRg7RT7eGNtr7h ixNTkNbjrTek9dBwvnya6L13x4gvOowwitq2PBt4rXpOkEkbacprWLemj6ctciabjBOvrL vF0+OxKd/lPiynAuMlHeI1MrYliH95sGHDzXEls/hW6YI+HDw8hQOXjou23HZicSjjU0R4 ADaxeCoTlnH7js1oLN5ghARHtCxFKk07m8Bg1bq+LqC1iNkG9ohgrBc6jnCN/Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712884721; 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=iNoxKFeGLzVo0kr3mMIHWXmPDW6XBugljVhvDByu4Bo=; b=jAu4bYUpDLrynP3RfUrcbccR2Qm1It+urEWJXFR6sca6CkKOTm5cca1Z4CNp49xuFys3RN ErRhc1ITkfulmpZeix1EWEM856d+xorf6pIWE1H2LeMBNFAQ0bYcrGYt491cThM/deBhRL S67unyfHmBXY+R4TXFj35lizQW5T1oI3gH4bqU2SjNZDQRYUz2YD5v3ekuontDm+EXOaXk O6aXGVx9oTXxVeuWgl8DSeOeztxA5GMjtz4MI/ZSYWgQktQd6MeWRmGg072rr15ZPf3RgP o/r7zGqJp543czMb8inV79U2vzn7WhF8IMEQUbTHjiXc/J9hB1OeV3yVjZpFxg== 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 4VFzGn4lLlzTCp; Fri, 12 Apr 2024 01:18:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43C1IflD050295; Fri, 12 Apr 2024 01:18:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43C1IfJa050292; Fri, 12 Apr 2024 01:18:41 GMT (envelope-from git) Date: Fri, 12 Apr 2024 01:18:41 GMT Message-Id: <202404120118.43C1IfJa050292@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: 0b5c1913b0fe - stable/14 - acpidump: the acpi_get_fadt_revision() argument is unused 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: dev-commits-src-branches+owner@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/14 X-Git-Reftype: branch X-Git-Commit: 0b5c1913b0fe3eb5c588f7c012f7d12fae1b9333 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=0b5c1913b0fe3eb5c588f7c012f7d12fae1b9333 commit 0b5c1913b0fe3eb5c588f7c012f7d12fae1b9333 Author: Konstantin Belousov AuthorDate: 2024-04-04 15:42:36 +0000 Commit: Konstantin Belousov CommitDate: 2024-04-12 01:18:32 +0000 acpidump: the acpi_get_fadt_revision() argument is unused (cherry picked from commit 4262ad56a074b973f18fee09bb03d52153bd35c2) --- usr.sbin/acpi/acpidump/acpi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/acpi/acpidump/acpi.c b/usr.sbin/acpi/acpidump/acpi.c index c851e97e9e37..9875a4798085 100644 --- a/usr.sbin/acpi/acpidump/acpi.c +++ b/usr.sbin/acpi/acpidump/acpi.c @@ -209,7 +209,7 @@ acpi_print_gas(ACPI_GENERIC_ADDRESS *gas) /* The FADT revision indicates whether we use the DSDT or X_DSDT addresses. */ static int -acpi_get_fadt_revision(ACPI_TABLE_FADT *fadt) +acpi_get_fadt_revision(ACPI_TABLE_FADT *fadt __unused) { int fadt_revision; From nobody Fri Apr 12 01:18:42 2024 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 4VFzGq17ZNz5GXVh; Fri, 12 Apr 2024 01:18: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 4VFzGp6QH3z4Q7t; Fri, 12 Apr 2024 01:18:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712884722; 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=vne1/DOjFEu1u7GbZkQ2NidUyIBhpMCxnOnJeg1CMec=; b=bQ1YzTOhqBmSFjVgroJVicxQR9Nyjj+yQPsmHXlsLlo4N98vt4zQ87JQfrBcr/UWM9H1ON roEOqIVupSPKmgux0SsdAHkqloEwvO0BwKF1FhK5vmFEDDCACfNF8vM1sLANis0ia3OIFq UQWrrktmusvYAy29P+JSfMtmSdvvHkjEayNgXS6N9S4G3ONtBQKtm7sGdFLNY1yd21NpiC tvMj7ckKxUkmZNZwRxTc+cO4KfRZP9byEPfThQ1s3wbD8GtozydGpnSP0Qlj96AyiA3msb eImguXZyG4UG8iVytDMc8WStacB8HEBt77uujj/YJqp0crAxJMC8JX6X4akIow== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712884722; a=rsa-sha256; cv=none; b=RJRjq13t8GekuHXhLbtxODFKA8aEOR9HzcjZ/3WXyefP9lwtRsJa4xtD1cUfrLGD/09plt numNnCfXLanqvRYM4EvkWzRG0ijQ4oHQkCC+3sd58/ywahxYu5o5RXCaRq6K9oGM9ZTXL+ q3jDxWr/mpXEXCw40I8xqPtsxAwETu0gIj+J345rQ70tnyjlDCvU7i69RGEQmXWuvFYzpt 4Hjrc3KM1clPavdKbhrNz/8NmeFarG4rXEpr38X+PNYeWeHoS9D9eOtxXsXOWoCGNJNkt+ rssqbFrP64+XN9pgDIc2d4vsX2GRKsiKpmjlFc6OQxxfjbLGxLDNQ8+/j9RlPw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712884722; 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=vne1/DOjFEu1u7GbZkQ2NidUyIBhpMCxnOnJeg1CMec=; b=croO7mh8Vvz49m5aSY7P8iU30iao57ElZoAdcopCt2RqAye4qK8oJqcim4Fp5Pnk3xpD4b n4YlRUncqmHvdtfpkjS/IP+N+eIJvQe4NiTgMfKlyxG1DDHqN03ivLapnYtM8KMXE4aCks 6r16n3P6dRtHqk8aT19rkHr8RSL+RyA3RfzQvBYTJmeGdRMqo1LCYFVhFK21JSw2J7770A IXmfX75pqLvQUqeeZKFjrknpsJFP2YFWuRwsyEmcsSgPIaL1fJ8GUhlfiUyl0YUF7ycAbK 6dEGlVyzIOdid+IXJtzZnAqg+FXnDhikMQOScnirvlNh+/C+REWB91mcPngffQ== 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 4VFzGp5zfjzTbt; Fri, 12 Apr 2024 01:18:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43C1IgWG050338; Fri, 12 Apr 2024 01:18:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43C1Igq0050335; Fri, 12 Apr 2024 01:18:42 GMT (envelope-from git) Date: Fri, 12 Apr 2024 01:18:42 GMT Message-Id: <202404120118.43C1Igq0050335@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: 0a7de174b779 - stable/14 - acpidump: bump WARNS to 6 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: dev-commits-src-branches+owner@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/14 X-Git-Reftype: branch X-Git-Commit: 0a7de174b77988437035e4ec333dd1e93cfd6413 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=0a7de174b77988437035e4ec333dd1e93cfd6413 commit 0a7de174b77988437035e4ec333dd1e93cfd6413 Author: Konstantin Belousov AuthorDate: 2024-04-03 03:00:25 +0000 Commit: Konstantin Belousov CommitDate: 2024-04-12 01:18:32 +0000 acpidump: bump WARNS to 6 (cherry picked from commit 29a6b72775eeed08a5ecb8f6c1b0c364196d73df) --- usr.sbin/acpi/acpidump/Makefile | 1 - usr.sbin/acpi/acpidump/acpidump.h | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/usr.sbin/acpi/acpidump/Makefile b/usr.sbin/acpi/acpidump/Makefile index 9bd54a80f779..d0bb14284c1a 100644 --- a/usr.sbin/acpi/acpidump/Makefile +++ b/usr.sbin/acpi/acpidump/Makefile @@ -2,6 +2,5 @@ PROG= acpidump MAN= acpidump.8 SRCS= acpi.c acpi_user.c acpidump.c -WARNS?= 3 .include diff --git a/usr.sbin/acpi/acpidump/acpidump.h b/usr.sbin/acpi/acpidump/acpidump.h index 857d230bb871..80f86a748d76 100644 --- a/usr.sbin/acpi/acpidump/acpidump.h +++ b/usr.sbin/acpi/acpidump/acpidump.h @@ -30,9 +30,12 @@ #ifndef _ACPIDUMP_H_ #define _ACPIDUMP_H_ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" #include #include #include +#pragma GCC diagnostic pop /* GAS address space ID constants. */ #define ACPI_GAS_MEMORY 0 From nobody Fri Apr 12 01:18:43 2024 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 4VFzGr1607z5GX1r; Fri, 12 Apr 2024 01:18: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 4VFzGr0HN3z4QMK; Fri, 12 Apr 2024 01:18:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712884724; 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=bfL8bqZDq2aHW1t1w/4nfmqxFlqA7WhR4c06WUEmc3Y=; b=YIDC645FTKKjKs0UcIBErNfG2ZO08BLCIZJokGe0MMhcL51H6X/ceK7+vHYFEeOSqDKUzy vkpvCqw0Gt0J24Y9A397ZLspyxpoBVqqtmMAC0NJ2l2d1FuPeTDMzI5vLA3ULj6AffhKTU EEIta54BVZ7kwSGVYxbqp+1wB+k9MHkyoUh7fAjIsCUumjv2E/zaanWOt4KVzueqQk7TrX Dd1vHYfeK2ZPOLUCOGmCmirs5eWWJWRaDI9TPNmQ0/ai1sGaSIJnCSSlvuaUCThGAIhRnC F9HhaQhap43+3GuvzmnDaDLCHOedJ8oXYG9osCdilOPWfUEkjGkKPDjc5/HuGA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712884724; a=rsa-sha256; cv=none; b=nqdGRK1H/SVYDe2FE3BQstnlUprEGd/6plyNtExrEF6ICwqcWGFCr3/MNWkbEHmGT0TC59 JhR7BUrU8vS+M7oSzkMBy4QFa7aeXSJoEsuOy8N9JQmD6lL/3KlKs51DPClz4BGZOxlANA eSErNHtWJNVXwTqHbx1u/C+yhBOwWT12rp99kU9sbGPBYnnYwX2o7ZpfMP72yRbjQ63EFm 2UWHYzh7e+A0NRBciwWXl1JvVErbNEo5QwfEMOXFVaBO+FVVkxevOqFh3vbYBvsKEMB438 VMTdrFr+9cbPG2/RKEhwDSp+WtTErl/TUv2JlpM+XjS2AwLLxzgfL3nD9pNLDg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712884724; 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=bfL8bqZDq2aHW1t1w/4nfmqxFlqA7WhR4c06WUEmc3Y=; b=TbpQak9D/Ef40jSbz0iOhc6F4UxrJW06CO8u6YjU69u87Oo6TXEmMyV5otIby2DzmG0ZL2 gJAO/RcPPCuGoeK86U3k8MsrdkvyY6seHUjfdXrrP9C54CDoRLN1PNDTksFZ0zjyJipd8l gIYhXyLvFx78fQFbhlblEDDi3hU/OiGLRqJ7DLpm7vSmugc/iE7sTwg82Bp3tAjglzzbXK czqGKpxPYFbs5jCs9qs/D19RV5ZwusR+XURq+LpFV4KALsHix8t25I3KQnBj3ygN7WKOPs GSHjvJRUyCkmrWSHAdaZLgeh5Hq4j1lmTJcsJV3a4u1Wrv77aOjsrOwXsLqMnw== 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 4VFzGq6xXczT0h; Fri, 12 Apr 2024 01:18:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43C1IhZV050377; Fri, 12 Apr 2024 01:18:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43C1IhFL050374; Fri, 12 Apr 2024 01:18:43 GMT (envelope-from git) Date: Fri, 12 Apr 2024 01:18:43 GMT Message-Id: <202404120118.43C1IhFL050374@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: 9ab216e2646a - stable/14 - acpidump: add printfield() 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: dev-commits-src-branches+owner@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/14 X-Git-Reftype: branch X-Git-Commit: 9ab216e2646a52caeacc56d763877ca866e167c3 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=9ab216e2646a52caeacc56d763877ca866e167c3 commit 9ab216e2646a52caeacc56d763877ca866e167c3 Author: Konstantin Belousov AuthorDate: 2024-04-04 04:49:21 +0000 Commit: Konstantin Belousov CommitDate: 2024-04-12 01:18:32 +0000 acpidump: add printfield() helper (cherry picked from commit 969a4b8be5a7d8edf55bd8945a5a071f57386b0e) --- usr.sbin/acpi/acpidump/acpi.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/usr.sbin/acpi/acpidump/acpi.c b/usr.sbin/acpi/acpidump/acpi.c index 9875a4798085..391310b44c7c 100644 --- a/usr.sbin/acpi/acpidump/acpi.c +++ b/usr.sbin/acpi/acpidump/acpi.c @@ -156,6 +156,18 @@ printflag(uint64_t var, uint64_t mask, const char *name) } } +static void +printfield(uint64_t var, int lbit, int hbit, const char *name) +{ + uint64_t mask; + int len; + + len = hbit - lbit + 1; + mask = ((1 << (len + 1)) - 1) << lbit; + printf("%c%s=%#jx", pf_sep, name, (uintmax_t)((var & mask) >> lbit)); + pf_sep = ','; +} + static void acpi_print_string(char *s, size_t length) { From nobody Fri Apr 12 01:18:45 2024 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 4VFzGs3dwFz5GXFr; Fri, 12 Apr 2024 01:18:45 +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 4VFzGs1NHNz4QF0; Fri, 12 Apr 2024 01:18:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712884725; 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=S06ORsYaY45unwO/f8kNC4LIVUqOoQipOMEKEPFiWnY=; b=CmtlruQm26LTtnjyuj4JkVm4a3/IkvQ+f3zCP15jJLoDSYpsrSZEUZVRERA6rALNsyplpT Hyy9lx5FX4ZC73zk9MVMDg3SGX1Io3emaBjXiwo93iGS7QXn9zCFRBlO6gn85o9u0iWSgy jORX4rTro2h5irNSSH36f7qEsDcdrmHsEBZ1DHfm10yoI7NHqeO7YhbKVhysCBk6xVjwUH L1eZfKth/BQRTR4n7e/OLne9YrEVjTRgBdGWKkRFIqb6VtAcCjt0VoKVUaCeFPAzvJYsSr YKBGqxNM1JHkVOegd/XXVyxz9+q7xsMKg/7dTQN6sDhSd8FlyQzdj+xZdMHi7w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712884725; a=rsa-sha256; cv=none; b=x0uCfgo4MDjpUSnlHw2TPh0KBA5KuhWUdGP6PsPKclwaaruuIYsBq64Lu7/cY/IG2xcAUR d4ZFNOGGLNAGBY42M6mUvOr7jynjN+St/ibS2LhLQS3mBl+igCWdEl4sUtkJs1pMzmwwMs Q1EIKUcVyFTEmfa9Im3Qckxfi7cZ0Jd23MNsTayy6FICl+zehM8GTl9o+Bokpxij5TXXor c+asIrpOOu+cR8Y3a5aVC5/c+Tv60ULp7uop3mUZkvLPmFBU6dZPEH5cikqM3zDXntG3CV A7dSODbfRM6wTYTl+m+BEWFHv+yGA9E1yIR5vN/ueYpRiIaLbu0XJsfoIY03JA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712884725; 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=S06ORsYaY45unwO/f8kNC4LIVUqOoQipOMEKEPFiWnY=; b=Pp/m0q7Hq9RGUenvtEGrXfIbBdkpwLR8yWpTT22iaNnkD+Mxj7nGKV4p/dD1LUmRnKa77D SK9FVeBrBx6n/0vXKJQ7vElgn00ir7NG4UQsIKK+iy6EoNoyS+bEqMIuDKUyCpPUmO8lop fDIFXFWv5W5g8VeqML2LXPHjfc9xstgsVtAegozG4I5zRec+iuHUXIwOVoCVy/eEcHjqyA roFXbSQUh6kXRnQfs7/YnTI8k1jqNaaSjF8AzpKyDHw14mOprY7/KlmX03CiABLmgr/imP sxxP69LKBUWxsQg1dW3/c2LWIm4qbiXPs6uFuUhkUYfr05j6hcCS7BXZIUAS9g== 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 4VFzGs0xnnzSyc; Fri, 12 Apr 2024 01:18:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43C1IjQT050429; Fri, 12 Apr 2024 01:18:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43C1IjYb050426; Fri, 12 Apr 2024 01:18:45 GMT (envelope-from git) Date: Fri, 12 Apr 2024 01:18:45 GMT Message-Id: <202404120118.43C1IjYb050426@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: ec9952bd472e - stable/14 - acpidump: dump AMD IVRS table describing IOMMU layout 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: dev-commits-src-branches+owner@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/14 X-Git-Reftype: branch X-Git-Commit: ec9952bd472e72f52890dd3194e7f24738d9c2c3 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=ec9952bd472e72f52890dd3194e7f24738d9c2c3 commit ec9952bd472e72f52890dd3194e7f24738d9c2c3 Author: Konstantin Belousov AuthorDate: 2024-03-31 23:30:37 +0000 Commit: Konstantin Belousov CommitDate: 2024-04-12 01:18:32 +0000 acpidump: dump AMD IVRS table describing IOMMU layout (cherry picked from commit 6d789b6126afe1c23b65eef2c5cf4c6bd258c26f) --- usr.sbin/acpi/acpidump/acpi.c | 372 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 372 insertions(+) diff --git a/usr.sbin/acpi/acpidump/acpi.c b/usr.sbin/acpi/acpidump/acpi.c index 391310b44c7c..b0d759631ce7 100644 --- a/usr.sbin/acpi/acpidump/acpi.c +++ b/usr.sbin/acpi/acpidump/acpi.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -1496,6 +1497,375 @@ acpi_handle_dmar(ACPI_TABLE_HEADER *sdp) printf(END_COMMENT); } +static void +acpi_handle_ivrs_ivhd_header(ACPI_IVRS_HEADER *addr) +{ + printf("\n\tIVHD Type=%#x IOMMUId=%x\n\tFlags=", + addr->Type, addr->DeviceId); +#define PRINTFLAG(flag, name) printflag(addr->Flags, flag, #name) + PRINTFLAG(ACPI_IVHD_TT_ENABLE, HtTunEn); + PRINTFLAG(ACPI_IVHD_ISOC, PassPW); + PRINTFLAG(ACPI_IVHD_RES_PASS_PW, ResPassPW); + PRINTFLAG(ACPI_IVHD_ISOC, Isoc); + PRINTFLAG(ACPI_IVHD_TT_ENABLE, IotlbSup); + PRINTFLAG((1 << 5), Coherent); + PRINTFLAG((1 << 6), PreFSup); + PRINTFLAG((1 << 7), PPRSup); +#undef PRINTFLAG + PRINTFLAG_END(); +} + +static void +acpi_handle_ivrs_ivhd_dte(UINT8 dte) +{ + if (dte == 0) { + printf("\n"); + return; + } + printf(" DTE="); +#define PRINTFLAG(flag, name) printflag(dte, flag, #name) + PRINTFLAG(ACPI_IVHD_INIT_PASS, INITPass); + PRINTFLAG(ACPI_IVHD_EINT_PASS, EIntPass); + PRINTFLAG(ACPI_IVHD_NMI_PASS, NMIPass); + PRINTFLAG(ACPI_IVHD_SYSTEM_MGMT, SysMgtPass); + PRINTFLAG(ACPI_IVHD_LINT0_PASS, Lint0Pass); + PRINTFLAG(ACPI_IVHD_LINT1_PASS, Lint1Pass); +#undef PRINTFLAG + PRINTFLAG_END(); +} + +static void +acpi_handle_ivrs_ivhd_edte(UINT32 edte) +{ + if (edte == 0) + return; + printf("\t\t ExtDTE="); +#define PRINTFLAG(flag, name) printflag(edte, flag, #name) + PRINTFLAG(ACPI_IVHD_ATS_DISABLED, AtsDisabled); +#undef PRINTFLAG + PRINTFLAG_END(); +} + +static const char * +acpi_handle_ivrs_ivhd_variety(UINT8 v) +{ + switch (v) { + case ACPI_IVHD_IOAPIC: + return ("IOAPIC"); + case ACPI_IVHD_HPET: + return ("HPET"); + default: + return ("UNKNOWN"); + } +} + +static void +acpi_handle_ivrs_ivhd_devs(ACPI_IVRS_DE_HEADER *d, char *de) +{ + char *db; + ACPI_IVRS_DEVICE4 *d4; + ACPI_IVRS_DEVICE8A *d8a; + ACPI_IVRS_DEVICE8B *d8b; + ACPI_IVRS_DEVICE8C *d8c; + ACPI_IVRS_DEVICE_HID *dh; + size_t len; + UINT32 x32; + + for (; (char *)d < de; d = (ACPI_IVRS_DE_HEADER *)(db + len)) { + db = (char *)d; + if (d->Type == ACPI_IVRS_TYPE_PAD4) { + len = sizeof(*d4); + } else if (d->Type == ACPI_IVRS_TYPE_ALL) { + d4 = (ACPI_IVRS_DEVICE4 *)db; + len = sizeof(*d4); + printf("\t\tDev Type=%#x Id=ALL", d4->Header.Type); + acpi_handle_ivrs_ivhd_dte(d4->Header.DataSetting); + } else if (d->Type == ACPI_IVRS_TYPE_SELECT) { + d4 = (ACPI_IVRS_DEVICE4 *)db; + len = sizeof(*d4); + printf("\t\tDev Type=%#x Id=%#06x", d4->Header.Type, + d4->Header.Id); + acpi_handle_ivrs_ivhd_dte(d4->Header.DataSetting); + } else if (d->Type == ACPI_IVRS_TYPE_START) { + d4 = (ACPI_IVRS_DEVICE4 *)db; + len = 2 * sizeof(*d4); + printf("\t\tDev Type=%#x Id=%#06x-%#06x", + d4->Header.Type, + d4->Header.Id, (d4 + 1)->Header.Id); + acpi_handle_ivrs_ivhd_dte(d4->Header.DataSetting); + } else if (d->Type == ACPI_IVRS_TYPE_END) { + d4 = (ACPI_IVRS_DEVICE4 *)db; + len = 2 * sizeof(*d4); + printf("\t\tDev Type=%#x Id=%#06x BIOS BUG\n", + d4->Header.Type, d4->Header.Id); + } else if (d->Type == ACPI_IVRS_TYPE_PAD8) { + len = sizeof(*d8a); + } else if (d->Type == ACPI_IVRS_TYPE_ALIAS_SELECT) { + d8a = (ACPI_IVRS_DEVICE8A *)db; + len = sizeof(*d8a); + printf("\t\tDev Type=%#x Id=%#06x AliasId=%#06x", + d8a->Header.Type, d8a->Header.Id, d8a->UsedId); + acpi_handle_ivrs_ivhd_dte(d8a->Header.DataSetting); + } else if (d->Type == ACPI_IVRS_TYPE_ALIAS_START) { + d8a = (ACPI_IVRS_DEVICE8A *)db; + d4 = (ACPI_IVRS_DEVICE4 *)(db + sizeof(*d8a)); + len = sizeof(*d8a) + sizeof(*d4); + printf("\t\tDev Type=%#x Id=%#06x-%#06x AliasId=%#06x", + d8a->Header.Type, d8a->Header.Id, d4->Header.Id, + d8a->UsedId); + acpi_handle_ivrs_ivhd_dte(d8a->Header.DataSetting); + } else if (d->Type == ACPI_IVRS_TYPE_EXT_SELECT) { + d8b = (ACPI_IVRS_DEVICE8B *)db; + len = sizeof(*d8b); + printf("\t\tDev Type=%#x Id=%#06x", + d8a->Header.Type, d8a->Header.Id); + acpi_handle_ivrs_ivhd_dte(d8b->Header.DataSetting); + printf("\t\t"); + acpi_handle_ivrs_ivhd_edte(d8b->ExtendedData); + } else if (d->Type == ACPI_IVRS_TYPE_EXT_START) { + d8b = (ACPI_IVRS_DEVICE8B *)db; + len = sizeof(*d8b); + d4 = (ACPI_IVRS_DEVICE4 *)(db + sizeof(*d8a)); + len = sizeof(*d8a) + sizeof(*d4); + printf("\t\tDev Type=%#x Id=%#06x-%#06x", + d8a->Header.Type, d8a->Header.Id, d4->Header.Id); + acpi_handle_ivrs_ivhd_dte(d8b->Header.DataSetting); + acpi_handle_ivrs_ivhd_edte(d8b->ExtendedData); + } else if (d->Type == ACPI_IVRS_TYPE_SPECIAL) { + d8c = (ACPI_IVRS_DEVICE8C *)db; + len = sizeof(*d8c); + printf("\t\tDev Type=%#x Id=%#06x Handle=%#x " + "Variety=%d(%s)", + d8c->Header.Type, d8c->UsedId, d8c->Handle, + d8c->Variety, + acpi_handle_ivrs_ivhd_variety(d8c->Variety)); + acpi_handle_ivrs_ivhd_dte(d8c->Header.DataSetting); + } else if (d->Type == ACPI_IVRS_TYPE_HID) { + dh = (ACPI_IVRS_DEVICE_HID *)db; + len = sizeof(*dh) + dh->UidLength; + printf("\t\tDev Type=%#x Id=%#06x HID=", + dh->Header.Type, dh->Header.Id); + acpi_print_string((char *)&dh->AcpiHid, + sizeof(dh->AcpiHid)); + printf(" CID="); + acpi_print_string((char *)&dh->AcpiCid, + sizeof(dh->AcpiCid)); + printf(" UID="); + switch (dh->UidType) { + case ACPI_IVRS_UID_NOT_PRESENT: + default: + printf("none"); + break; + case ACPI_IVRS_UID_IS_INTEGER: + memcpy(&x32, dh + 1, sizeof(x32)); + printf("%#x", x32); + break; + case ACPI_IVRS_UID_IS_STRING: + acpi_print_string((char *)(dh + 1), + dh->UidLength); + break; + } + acpi_handle_ivrs_ivhd_dte(dh->Header.DataSetting); + } else { + printf("\t\tDev Type=%#x Unknown\n", d->Type); + if (d->Type <= 63) + len = sizeof(*d4); + else if (d->Type <= 127) + len = sizeof(*d8a); + else { + printf("Abort, cannot advance iterator.\n"); + return; + } + } + } +} + +static void +acpi_handle_ivrs_ivhd_10(ACPI_IVRS_HARDWARE1 *addr, bool efrsup) +{ + acpi_handle_ivrs_ivhd_header(&addr->Header); + printf("\tCapOffset=%#x Base=%#jx PCISeg=%#x Unit=%#x MSIlog=%d\n", + addr->CapabilityOffset, (uintmax_t)addr->BaseAddress, + addr->PciSegmentGroup, (addr->Info & ACPI_IVHD_UNIT_ID_MASK) >> 8, + addr->Info & ACPI_IVHD_MSI_NUMBER_MASK); + if (efrsup) { +#define PRINTFLAG(flag, name) printflag(addr->FeatureReporting, flag, #name) +#define PRINTFIELD(lbit, hbit, name) \ + printfield(addr->FeatureReporting, lbit, hbit, #name) + PRINTFIELD(30, 31, HATS); + PRINTFIELD(28, 29, GATS); + PRINTFIELD(23, 27, MsiNumPPR); + PRINTFIELD(17, 22, PNBanks); + PRINTFIELD(13, 16, PNCounters); + PRINTFIELD(8, 12, PASmax); + PRINTFLAG(1 << 7, HESup); + PRINTFLAG(1 << 6, GASup); + PRINTFLAG(1 << 5, UASup); + PRINTFIELD(3, 2, GLXSup); + PRINTFLAG(1 << 1, NXSup); + PRINTFLAG(1 << 0, XTSup); +#undef PRINTFLAG +#undef PRINTFIELD + PRINTFLAG_END(); + } + acpi_handle_ivrs_ivhd_devs((ACPI_IVRS_DE_HEADER *)(addr + 1), + (char *)addr + addr->Header.Length); +} + +static void +acpi_handle_ivrs_ivhd_info_11(ACPI_IVRS_HARDWARE2 *addr) +{ + acpi_handle_ivrs_ivhd_header(&addr->Header); + printf("\tCapOffset=%#x Base=%#jx PCISeg=%#x Unit=%#x MSIlog=%d\n", + addr->CapabilityOffset, (uintmax_t)addr->BaseAddress, + addr->PciSegmentGroup, (addr->Info >> 8) & 0x1f, + addr->Info & 0x5); + printf("\tAttr="); +#define PRINTFIELD(lbit, hbit, name) \ + printfield(addr->Attributes, lbit, hbit, #name) + PRINTFIELD(23, 27, MsiNumPPR); + PRINTFIELD(17, 22, PNBanks); + PRINTFIELD(13, 16, PNCounters); +#undef PRINTFIELD + PRINTFLAG_END(); +} + +static void +acpi_handle_ivrs_ivhd_11(ACPI_IVRS_HARDWARE2 *addr) +{ + acpi_handle_ivrs_ivhd_info_11(addr); + printf("\tEFRreg=%#018jx\n", (uintmax_t)addr->EfrRegisterImage); + acpi_handle_ivrs_ivhd_devs((ACPI_IVRS_DE_HEADER *)(addr + 1), + (char *)addr + addr->Header.Length); +} + +static void +acpi_handle_ivrs_ivhd_40(ACPI_IVRS_HARDWARE2 *addr) +{ + acpi_handle_ivrs_ivhd_info_11(addr); + printf("\tEFRreg=%#018jx EFR2reg=%#018jx\n", + (uintmax_t)addr->EfrRegisterImage, (uintmax_t)addr->Reserved); + acpi_handle_ivrs_ivhd_devs((ACPI_IVRS_DE_HEADER *)(addr + 1), + (char *)addr + addr->Header.Length); +} + +static const char * +acpi_handle_ivrs_ivmd_type(ACPI_IVRS_MEMORY *addr) +{ + switch (addr->Header.Type) { + case ACPI_IVRS_TYPE_MEMORY1: + return ("ALL"); + case ACPI_IVRS_TYPE_MEMORY2: + return ("specified"); + case ACPI_IVRS_TYPE_MEMORY3: + return ("range"); + default: + return ("unknown"); + } +} + +static void +acpi_handle_ivrs_ivmd(ACPI_IVRS_MEMORY *addr) +{ + printf("\tMem Type=%#x(%s) ", + addr->Header.Type, acpi_handle_ivrs_ivmd_type(addr)); + switch (addr->Header.Type) { + case ACPI_IVRS_TYPE_MEMORY2: + printf("Id=%#06x PCISeg=%#x ", addr->Header.DeviceId, + *(UINT16 *)&addr->Reserved); + break; + case ACPI_IVRS_TYPE_MEMORY3: + printf("Id=%#06x-%#06x PCISeg=%#x", addr->Header.DeviceId, + addr->AuxData, *(UINT16 *)&addr->Reserved); + break; + } + printf("Start=%#18jx Length=%#jx Flags=", + (uintmax_t)addr->StartAddress, (uintmax_t)addr->MemoryLength); +#define PRINTFLAG(flag, name) printflag(addr->Header.Flags, flag, #name) + PRINTFLAG(ACPI_IVMD_EXCLUSION_RANGE, ExclusionRange); + PRINTFLAG(ACPI_IVMD_WRITE, IW); + PRINTFLAG(ACPI_IVMD_READ, IR); + PRINTFLAG(ACPI_IVMD_UNITY, Unity); +#undef PRINTFLAG + PRINTFLAG_END(); +} + +static int +acpi_handle_ivrs_blocks(void *addr, int remaining, bool efrsup) +{ + ACPI_IVRS_HEADER *hdr = addr; + + if (remaining < (int)sizeof(ACPI_IVRS_HEADER)) + return (-1); + + if (remaining < hdr->Length) + return (-1); + + switch (hdr->Type) { + case ACPI_IVRS_TYPE_HARDWARE1: + acpi_handle_ivrs_ivhd_10(addr, efrsup); + break; + case ACPI_IVRS_TYPE_HARDWARE2: + if (!efrsup) + printf("\t!! Found IVHD block 0x11 but !EFRsup\n"); + acpi_handle_ivrs_ivhd_11(addr); + break; + case ACPI_IVRS_TYPE_HARDWARE3: + if (!efrsup) + printf("\t!! Found IVHD block 0x40 but !EFRsup\n"); + acpi_handle_ivrs_ivhd_40(addr); + break; + case ACPI_IVRS_TYPE_MEMORY1: + case ACPI_IVRS_TYPE_MEMORY2: + case ACPI_IVRS_TYPE_MEMORY3: + acpi_handle_ivrs_ivmd(addr); + break; + default: + printf("\n"); + printf("\tType=%d\n", hdr->Type); + printf("\tLength=%d\n", hdr->Length); + break; + } + return (hdr->Length); +} + +#define ACPI_IVRS_DMAREMAP 0x00000002 +#define ACPI_IVRS_EFRSUP 0x00000001 +#define ACPI_IVRS_GVA_SIZE 0x000000e0 + +static void +acpi_handle_ivrs(ACPI_TABLE_HEADER *sdp) +{ + ACPI_TABLE_IVRS *ivrs; + char *cp; + int remaining, consumed; + bool efrsup; + + printf(BEGIN_COMMENT); + acpi_print_sdt(sdp); + ivrs = (ACPI_TABLE_IVRS *)sdp; + efrsup = (ivrs->Info & ACPI_IVRS_EFRSUP) != 0; + printf("\tVAsize=%d PAsize=%d GVAsize=%d\n", + (ivrs->Info & ACPI_IVRS_VIRTUAL_SIZE) >> 15, + (ivrs->Info & ACPI_IVRS_PHYSICAL_SIZE) >> 8, + (ivrs->Info & ACPI_IVRS_GVA_SIZE) >> 5); + printf("\tATS_resp_res=%d DMA_preboot_remap=%d EFRsup=%d\n", + (ivrs->Info & ACPI_IVRS_ATS_RESERVED) != 0, + (ivrs->Info & ACPI_IVRS_DMAREMAP) != 0, efrsup); + + remaining = sdp->Length - sizeof(ACPI_TABLE_IVRS); + while (remaining > 0) { + cp = (char *)sdp + sdp->Length - remaining; + consumed = acpi_handle_ivrs_blocks(cp, remaining, efrsup); + if (consumed <= 0) + break; + else + remaining -= consumed; + } + + printf(END_COMMENT); +} + static void acpi_print_srat_memory(ACPI_SRAT_MEM_AFFINITY *mp) { @@ -2084,6 +2454,8 @@ acpi_handle_rsdt(ACPI_TABLE_HEADER *rsdp) acpi_handle_tcpa(sdp); else if (!memcmp(sdp->Signature, ACPI_SIG_DMAR, 4)) acpi_handle_dmar(sdp); + else if (!memcmp(sdp->Signature, ACPI_SIG_IVRS, 4)) + acpi_handle_ivrs(sdp); else if (!memcmp(sdp->Signature, ACPI_SIG_NFIT, 4)) acpi_handle_nfit(sdp); else if (!memcmp(sdp->Signature, ACPI_SIG_WDDT, 4)) From nobody Fri Apr 12 01:18:46 2024 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 4VFzGt3WqHz5GX20; Fri, 12 Apr 2024 01:18: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 4VFzGt2LfJz4QBs; Fri, 12 Apr 2024 01:18:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712884726; 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=4ovfx5jQERDpzP8VlG0GBS1LVnbu7KkK5B/HpwAaFp4=; b=nKKPRLJULBJ6VY+3YlY/wJ80r83aLbrCcRBU+JRlWs4g5ea7T5eoiaW81d2wgIh2trEM7Q 8Irg30kuDqVICElYeTZNwUMFefkwWf/fec3R/dZ2BN8e6PBRXb91NnyFZTHmjFGvy3ZSQj oPkX5iXrgtktF11KYrdjGLtzaH2zHHEmpOE2AJDcjup9baYkR7/qdJgc4+CiJc43fF+teG tl5q8veqv8sRL4afPqbD3dQM9qnK8RynWuPdAhvNb1l+1J0UEeqhAoxv8QZpOTP15ViXPe lOvvUXw9xms5SdsvflP89wfog1yXTZzL6yuk75isOqf+Kr0Yo9IgDvQukWfZWw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712884726; a=rsa-sha256; cv=none; b=lJfaVTrORkYrJWnkfhXvnHeWBQIr3XdCAuHfM4ptCjcVOtllaLflaCSO/G2pECqVSUt0Bq 2/63KVGm00k0qE5T+5Oqm5h+vCUROztOlc6gpMQjN3aoqQosYC3iv70fVVZVPbxkVKTsqR qWkI1+aIAsLp+fs6DUvmx04C3mfj6Chr8fBEoIr6yo+9p9BmJ55m00u87lhrGJJbXU55Dz 2qK/Oha48INnPLtlQTfRGAIR17as5fDKfVImKfR6NNgdDUMLLwrFG3jk6oRHnJwHw3UBx5 GAfWF5BL9B4e+EFxfxY6enA87QDeF6MWgNFE5rAkOl4h/BjiXoPk8zKynC3NVw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712884726; 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=4ovfx5jQERDpzP8VlG0GBS1LVnbu7KkK5B/HpwAaFp4=; b=xGPyT7gZI5tKgk89zdgs+7wj3FNv0am+c6mjtIkqh4pZfryFNNho5rPYP0KhDxHMOULltB yHtywA4VsPzGIyu2Oa2Wmm8latDhqI5Xa9b7Y2YQTszpnTuXcvzbRKcdBrFt6yzVyJWjvc ORy2mr38A5zHmaw5gjOQA8Gs9R0Jc+aPQiXLZodlQVUDOpTRDbQpfiMV0aeQb93UDkGV47 s14wCydg7211PwV+s+16kJxytt1XjSHcD+JUjbURrOHU/g5Lx5iHWTkdslJl7Dor38ofh6 u1GfV0DLrjEiNuLxKPgM1+6VsGksUB7u65ff026AgPsuWdgPpr9NLgenPoOrHQ== 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 4VFzGt1xpMzTbv; Fri, 12 Apr 2024 01:18:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43C1Iko3050471; Fri, 12 Apr 2024 01:18:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43C1IkZ8050468; Fri, 12 Apr 2024 01:18:46 GMT (envelope-from git) Date: Fri, 12 Apr 2024 01:18:46 GMT Message-Id: <202404120118.43C1IkZ8050468@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: 80bf64732ce5 - stable/14 - acpidump: add Foundation copyright 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: dev-commits-src-branches+owner@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/14 X-Git-Reftype: branch X-Git-Commit: 80bf64732ce56aa3c932eb9a21d080edc31581f3 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=80bf64732ce56aa3c932eb9a21d080edc31581f3 commit 80bf64732ce56aa3c932eb9a21d080edc31581f3 Author: Konstantin Belousov AuthorDate: 2024-04-05 14:57:19 +0000 Commit: Konstantin Belousov CommitDate: 2024-04-12 01:18:32 +0000 acpidump: add Foundation copyright (cherry picked from commit f1519a8229d71fc1093c8bd27362c5a9f703dd4b) --- usr.sbin/acpi/acpidump/acpi.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/usr.sbin/acpi/acpidump/acpi.c b/usr.sbin/acpi/acpidump/acpi.c index b0d759631ce7..adef488065f6 100644 --- a/usr.sbin/acpi/acpidump/acpi.c +++ b/usr.sbin/acpi/acpidump/acpi.c @@ -4,8 +4,12 @@ * Copyright (c) 1998 Doug Rabson * Copyright (c) 2000 Mitsuru IWASAKI * Copyright (c) 2020 Alexander Motin + * Copyright (c) 2024 The FreeBSD Foundation * All rights reserved. * + * Portions of this software were developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: From nobody Fri Apr 12 01:18:47 2024 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 4VFzGv5sKtz5GXFw; Fri, 12 Apr 2024 01:18: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 4VFzGv3dv7z4QHd; Fri, 12 Apr 2024 01:18:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712884727; 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=bFSWd8EDPkzyyuTx/SH0hZmX/9KMZO3xbR8Wxva/HEw=; b=baYQLlpv2JwSCTkHzN7NH0KiAzs1cWVC3k8K71VRAY+m5Z5MeMuMMqBlYXSE3zlIVicrve VPv6OPDd2MJo0m+fYyC+tE1r1XaRoRvm5ut08aupq8E/2s+/oUBBWO/W1d0xxCoPdhTVpc uuqE9egbnN9H2ozooNa6MyNs0uVlecboi2pbiouJzC8GI9iFzqy2o5+VbY/xCogtf7XxL5 XM88N6GkB9kmDtuj54tU/KBHxBP3zFCSHkgISCL1HQFWmYI4vCyDH/zzkmEy9otmrdG7eD z3kznybnPb6YyurraLOLKC7y/Oss0DvGNR6DpAe4LQyejoCqVsPl3+HQRhDd9g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712884727; a=rsa-sha256; cv=none; b=ioDdsHCxdXonwxL1N0NqXC8bK0GDW+G7zdwRM4+Bp3r/Xl4Qf0HE5vmpMu5yQkSbc+dLin 8LMn0tYChhlVmDW/xmVTtLnjxuNlp+f78caHyqjrblNdA0WzN4rzLFes6kh52RIImkMYOy /IQ8ybk/J9dtDVfyLPl1HgAYrliFPZ4oEvrWD4BPoLecJXO6Wrt/UNc7xqs0h4iuJBFput yxy4vaSA6+uar8Iwf51rSfYu6of1tchMDSj6Av79qhH1n7zgCqZmRv7hS/zbFofJqHO4zL nnfwGEhoLWgfpMki0rCcMsGogkdtGbDaMaJ1DoDYIkOmEGJNTy6y+kW9LiZc1Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712884727; 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=bFSWd8EDPkzyyuTx/SH0hZmX/9KMZO3xbR8Wxva/HEw=; b=tKuLYKGVMy7hs/wGvsKc2Hd0ZL5sCPcYWkYcVmsGIahP1F6wtj020Ib2kKqu8TJSO2xEoB 9uGkycSCAoB5DrDGM+WPg5fc0h77cMSYRMHGyxdV5Kx0x0IVYVgW78xmk1ffal9PjUJr/4 uSbFIWV7aXWZEir7d8Mh2X603w8D/UyTzMYcQTs0PIA5iOccC+0o4LCN2oTyAMX61BLyk4 iefqs8OnGAf6vON6oAzCma3MZr3CrSyrerq91zcEdW5OpJFdcG1vq4gg2tdb8g/T94rZnt sEEe0KkGdjqwgzPFg2ndBeQSmYM3OnYy5sn2czqbHyebsrfu+eE5hGH2wMV9IQ== 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 4VFzGv2wsCzTQp; Fri, 12 Apr 2024 01:18:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43C1IlBa050512; Fri, 12 Apr 2024 01:18:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43C1IlvE050509; Fri, 12 Apr 2024 01:18:47 GMT (envelope-from git) Date: Fri, 12 Apr 2024 01:18:47 GMT Message-Id: <202404120118.43C1IlvE050509@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: 83fe75d6c16e - stable/14 - pcireg.h: add include guard 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: dev-commits-src-branches+owner@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/14 X-Git-Reftype: branch X-Git-Commit: 83fe75d6c16e64ab0cdc0ccab37095e2cac3ea07 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=83fe75d6c16e64ab0cdc0ccab37095e2cac3ea07 commit 83fe75d6c16e64ab0cdc0ccab37095e2cac3ea07 Author: Konstantin Belousov AuthorDate: 2024-04-07 01:27:46 +0000 Commit: Konstantin Belousov CommitDate: 2024-04-12 01:18:32 +0000 pcireg.h: add include guard (cherry picked from commit 1cd9868f04c3e91929974dca3444a79047f4e602) --- sys/dev/pci/pcireg.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/dev/pci/pcireg.h b/sys/dev/pci/pcireg.h index ef9b7799f534..c94decd8ef2a 100644 --- a/sys/dev/pci/pcireg.h +++ b/sys/dev/pci/pcireg.h @@ -26,6 +26,9 @@ * */ +#ifndef __PCI_PCIREG_H +#define __PCI_PCIREG_H + /* * PCIM_xxx: mask to locate subfield in register * PCIR_xxx: config register offset @@ -1121,3 +1124,5 @@ #define PCIM_ACS_USP_MEM_TGT_ACC_CTL 0x0c00 #define PCIM_ACS_UNCLAIMED_REQ_REDIRECT_CTL 0x1000 #define PCIR_ACS_EGRESS_CONTROL_VECTOR 0x8 + +#endif /* __PCI_PCIREG_H */ From nobody Fri Apr 12 01:18:48 2024 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 4VFzGw5V5qz5GXWv; Fri, 12 Apr 2024 01:18: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 4VFzGw4L7lz4QSQ; Fri, 12 Apr 2024 01:18:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712884728; 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=CW2WycW2omcZeOSiMEPl+uSld6gsvFRgnunAYuBzvls=; b=F0WdsOwB6JtWwKBroMRI7PFUrU4iGDigAbfeCElTn4QQQMEKR31xjuicVlafbHPXTDjOP7 /N6oKD9w7QkGKFRALwYEXu1nS+FrK761amEBQH/gPzY2JAL3ZqbrtWEh9LJUTGwkVZKFXO InYMeQGgbHq+yPWVKIOOoVhBlpaDZtLCxqqK5JqLt2EBqwmwK19eifRJheMCFoiY10g7WW 9G4l9LvBZ1H8Rq4o3RdAeElSQIBI2NQmmj9vhsZAIXj97pA4Th1/XHFRFgo2wqc/OPpz3P 6TRYyLKATUIoCYi0eIdCfUcm1z39HCj+zTw80Rmlmxfe7rY7xed2XKW4iCLu9w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712884728; a=rsa-sha256; cv=none; b=vopetAYQ4DJe5hwsPJ7Jdi4GVo/rmD2LUyO/5fRETT7XqPoW+ZgPMuuRu6pGrSh1hK105m IEajumwc1fLiexC2gtNDojlVF7O38Co05FSuSh1w02zCnRulSxmEFIuUeJ+sAdGE5KAVC6 evGtoE358ki2b6w9Jc9wDHhFpSSHhhcMpUrG42RySfkghLlt1FNNVqkxuX6PMibrHvxZdk z1mXuo0Miw2zWHSgHBosfZMow3YUv9Zy4c+QWT0E+SI7flGShlO/hZcZ636BMT0xq/FjUz 9WBWvaotGMnMabFpOnlHV9RFoTI+KDx7WWdWSkyD7HdGm9XTzPh8sSQJhUY2LQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712884728; 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=CW2WycW2omcZeOSiMEPl+uSld6gsvFRgnunAYuBzvls=; b=c5fShk6+bsCB70Yqxfi6SP6Jf1t5CuCn0Iz82l2QCE6Rt+CjOrrZ65/SJmQW2kRsuDp73j oMttbJwOx4FiPoO2cNd/9t6SFAvNZGihBBjPGHnfYl5NF6ROOvtg3eiRjczetyAk4z+2Zd jm36XwF6t+aLcy6ypFtQP/yIYnyzLg2D+EAIq6eR8Uv3r/h2eiJsj+K3mnzueeZq/4PV2u jFXM54zWQoq5x3RhLj0DcYMaFjJsfwdkAWRyxdRNxo2cGC3G+JJ1TD/isODx3CU7+uBPZh LqovjSFCPS33GutGGJJbJVdu/srqMeRunAEVP+/XzonWmrf6OSQ14lS9VA/G1w== 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 4VFzGw3y5BzTCq; Fri, 12 Apr 2024 01:18:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43C1Im9v050560; Fri, 12 Apr 2024 01:18:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43C1ImfT050557; Fri, 12 Apr 2024 01:18:48 GMT (envelope-from git) Date: Fri, 12 Apr 2024 01:18:48 GMT Message-Id: <202404120118.43C1ImfT050557@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: fd02cfeb9ade - stable/14 - pcireg.h: Add AMD IOMMU Base Cap 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: dev-commits-src-branches+owner@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/14 X-Git-Reftype: branch X-Git-Commit: fd02cfeb9ade687912849c57227ee37a5728e5f8 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=fd02cfeb9ade687912849c57227ee37a5728e5f8 commit fd02cfeb9ade687912849c57227ee37a5728e5f8 Author: Konstantin Belousov AuthorDate: 2024-04-07 01:25:46 +0000 Commit: Konstantin Belousov CommitDate: 2024-04-12 01:18:32 +0000 pcireg.h: Add AMD IOMMU Base Cap definitions (cherry picked from commit 33adb388c78ee48efbdc9b497fe2224397fdee84) --- sys/dev/pci/pcireg.h | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/sys/dev/pci/pcireg.h b/sys/dev/pci/pcireg.h index c94decd8ef2a..623deb8b4505 100644 --- a/sys/dev/pci/pcireg.h +++ b/sys/dev/pci/pcireg.h @@ -1125,4 +1125,56 @@ #define PCIM_ACS_UNCLAIMED_REQ_REDIRECT_CTL 0x1000 #define PCIR_ACS_EGRESS_CONTROL_VECTOR 0x8 +/* + * AMD IOMMU Base Capability + * From AMD I/O Virtualization Technology (IOMMU) Specification + * Publication # 48882 Revision: 3.09-PUB Date: October 2023 + */ +#define PCIR_AMDIOMMU_CAP_HEADER 0x0000 +#define PCIR_AMDIOMMU_BASE_LOW 0x0004 +#define PCIR_AMDIOMMU_BASE_HIGH 0x0008 +#define PCIR_AMDIOMMU_RANGE 0x000c +#define PCIR_AMDIOMMU_MISC0 0x0010 +#define PCIR_AMDIOMMU_MISC1 0x0014 + +#define PCIM_AMDIOMMU_CAP_CAPEXT (1 << 28) +#define PCIM_AMDIOMMU_CAP_EFR (1 << 27) +#define PCIM_AMDIOMMU_CAP_NPCACHE (1 << 26) +#define PCIM_AMDIOMMU_CAP_HTTUN (1 << 25) +#define PCIM_AMDIOMMU_CAP_IOTLB (1 << 24) +#define PCIM_AMDIOMMU_CAP_REV_MASK (0x1f << 19) +#define PCIM_AMDIOMMU_CAP_REV_VAL (0x1 << 19) +#define PCIM_AMDIOMMU_CAP_TYPE_MASK (7 << 16) +#define PCIM_AMDIOMMU_CAP_TYPE_VAL (0x3 << 16) + +#define PCIM_AMDIOMMU_BASE_LOW_EN 0x00000001 +#define PCIM_AMDIOMMU_BASE_LOW_ADDRM 0xffffc000 + +#define PCIM_AMDIOMMU_RANGE_UNITID_MASK 0x1f +#define PCIM_AMDIOMMU_RANGE_RNGVALID (1 << 7) +#define PCIM_AMDIOMMU_RANGE_BUSNUM_MASK (0xffffu << 8) +#define PCIM_AMDIOMMU_RANGE_FIRSTDEV_MASK (0xffffu << 16) +#define PCIM_AMDIOMMU_RANGE_LASTDEV_MASK (0xffffu << 24) + +#define PCIM_AMDIOMMU_MISC0_MSINUMPPR_MASK (0x1f << 27) +#define PCIM_AMDIOMMU_MISC0_HTATSRESV (1 << 22) +#define PCIM_AMDIOMMU_MISC0_VASIZE_MASK (0x7f << 15) +#define PCIM_AMDIOMMU_MISC0_PASIZE_MASK (0x7f << 8) +#define PCIM_AMDIOMMU_MISC0_GVASIZE_MASK (0x3 << 5) +#define PCIM_AMDIOMMU_MISC0_MSINUM_MASK 0x1f + +#define PCIM_AMDIOMMU_MISC0_VASIZE_32 (0x20 << 15) +#define PCIM_AMDIOMMU_MISC0_VASIZE_40 (0x28 << 15) +#define PCIM_AMDIOMMU_MISC0_VASIZE_48 (0x30 << 15) +#define PCIM_AMDIOMMU_MISC0_VASIZE_64 (0x40 << 15) + +#define PCIM_AMDIOMMU_MISC0_PASIZE_40 (0x28 << 8) +#define PCIM_AMDIOMMU_MISC0_PASIZE_48 (0x30 << 8) +#define PCIM_AMDIOMMU_MISC0_PASIZE_52 (0x34 << 8) + +#define PCIM_AMDIOMMU_MISC0_GVASIZE_48 (0x2 << 5) +#define PCIM_AMDIOMMU_MISC0_GVASIZE_57 (0x3 << 5) + +#define PCIM_AMDIOMMU_MISC1_MSINUMGA_MASK 0x1f + #endif /* __PCI_PCIREG_H */ From nobody Fri Apr 12 01:18:49 2024 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 4VFzGx6VZLz5GXZK; Fri, 12 Apr 2024 01:18:49 +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 4VFzGx5Pnrz4QNk; Fri, 12 Apr 2024 01:18:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712884729; 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=78kc/AFvm0cfbPLLiPC02YfLRbF2a7Qjqax3g8cgdYE=; b=L3uWtt4NMbe1RWN/Sj2ZEBcnueiIp0MZGS0HGng16lkk6YF4hF0OY77hcgwuVh02r96yYE 8TQarT6mpJOU/x5p6mo132tQ2h+uvpRWvzxly/2+U0J11E7ii8XvJPeddn8DUQd12/JUMm rUe5Y5ZjQDQJ09MkPYycnkHb4kZnzHpQCPHBfccUe1UAgUFBmDKR5rW/7AiMyQ+urZ/zxn alKpWUO/gi8wUsQiPziz98KXtQBYbLHHYMUbWUM6r5vHUkTE7q7iMWzV5g0xkoL7wSJ8li NSLVXZpx2xii6Q7myt9O68SSJ36F6g5/Y5C3F0iERW28atrha8xSjoUxnFuLLg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712884729; a=rsa-sha256; cv=none; b=dcv+mjhdB7E9Vas/JaqfDbueDm2kVLWY93M4/MZhHMEGaeJBHN7JFL3oQxIfkwRc1KOrur s3Q13LIFZZjJeLUsjKpoIyvbeCSLVj+CkLQhp734l550uT3W7Yyp33cTDVF16BmHcWFONp k3SMQOGikxk+hPyIe0KTNAihK3amKQn6GUr7HZ7zJgsJLmpLkwU/F86op89cx/rXT5FHMK wyVbsaLN9Mw9uOSnsIaqPMR4emL9WevBrldtDkJAkwqNudw606kYe59UrGPG3iiSG+19yE GxNYRwjuyEO0QwwtU6b5Bg1JT5/VFGShfCX26GYvrjHcGOn00AetoqZHqJl7NA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712884729; 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=78kc/AFvm0cfbPLLiPC02YfLRbF2a7Qjqax3g8cgdYE=; b=HmsFvYf4wcR5bi0gsBP6ZCa7hfN3ochTKjRHvAeZunHqIwJKm6lw0LYONRRY6NlZI1RHkc qCqi0fqPcHPtz2zPHpOv23GTTah0gWgoA+Xqk7DRT6LH0VWXLmdVJA+WudCnyH12Or49Mh uYsrKLw6JuiaS//k0Wodu5nB4thkFTo04lej3HfoL3Xmmxz9urZDIPhslfRLo20T13xVKM 9/91ew4SYzUxsv6j3cyRQ7eBwp4oD0zWKMTayalIqHhEHJWioR+ksz4LPqWW/oSj6T34lH cm9aRxvxccH3twETM436qDECWTkl8S7E9+KJ3xcOFRjHZ5cXA4ZoW9Bc8QcK6Q== 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 4VFzGx51hBzTQL; Fri, 12 Apr 2024 01:18:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43C1InIC050605; Fri, 12 Apr 2024 01:18:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43C1Inkf050602; Fri, 12 Apr 2024 01:18:49 GMT (envelope-from git) Date: Fri, 12 Apr 2024 01:18:49 GMT Message-Id: <202404120118.43C1Inkf050602@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: fb8eb2042dbe - stable/14 - pciconf(8): dump AMD IOMMU Base Capability 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: dev-commits-src-branches+owner@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/14 X-Git-Reftype: branch X-Git-Commit: fb8eb2042dbea85047f40da67d775fb670671742 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=fb8eb2042dbea85047f40da67d775fb670671742 commit fb8eb2042dbea85047f40da67d775fb670671742 Author: Konstantin Belousov AuthorDate: 2024-04-09 22:13:59 +0000 Commit: Konstantin Belousov CommitDate: 2024-04-12 01:18:33 +0000 pciconf(8): dump AMD IOMMU Base Capability (cherry picked from commit 1e6db7be692198acfa7f02dea83aa9aa1dfce273) --- usr.sbin/pciconf/cap.c | 115 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) diff --git a/usr.sbin/pciconf/cap.c b/usr.sbin/pciconf/cap.c index 8595bff3d3d7..e252926ab9be 100644 --- a/usr.sbin/pciconf/cap.c +++ b/usr.sbin/pciconf/cap.c @@ -376,6 +376,118 @@ cap_subvendor(int fd, struct pci_conf *p, uint8_t ptr) printf("PCI Bridge subvendor=0x%04x subdevice=0x%04x", ssvid, ssid); } +static const char * +cap_secdev_amdiommu_decode_vasize(uint32_t misc0) +{ + switch (misc0 & PCIM_AMDIOMMU_MISC0_VASIZE_MASK) { + case PCIM_AMDIOMMU_MISC0_VASIZE_32: + return ("32bit"); + case PCIM_AMDIOMMU_MISC0_VASIZE_40: + return ("40bit"); + case PCIM_AMDIOMMU_MISC0_VASIZE_48: + return ("48bit"); + case PCIM_AMDIOMMU_MISC0_VASIZE_64: + return ("64bit"); + default: + return ("unknown"); + } +} + +static const char * +cap_secdev_amdiommu_decode_pasize(uint32_t misc0) +{ + switch (misc0 & PCIM_AMDIOMMU_MISC0_PASIZE_MASK) { + case PCIM_AMDIOMMU_MISC0_PASIZE_40: + return ("40bit"); + case PCIM_AMDIOMMU_MISC0_PASIZE_48: + return ("48bit"); + case PCIM_AMDIOMMU_MISC0_PASIZE_52: + return ("52bit"); + default: + return ("unknown"); + } +} + +static const char * +cap_secdev_amdiommu_decode_gvasize(uint32_t misc0) +{ + switch (misc0 & PCIM_AMDIOMMU_MISC0_GVASIZE_MASK) { + case PCIM_AMDIOMMU_MISC0_GVASIZE_48: + return ("48bit"); + case PCIM_AMDIOMMU_MISC0_GVASIZE_57: + return ("57bit"); + default: + return ("unknown"); + } +} + +static void +cap_secdev(int fd, struct pci_conf *p, uint8_t ptr) +{ + uint32_t cap_h; + uint32_t cap_type, cap_rev; + uint32_t base_low, base_high; + uint32_t range; + uint32_t misc0, misc1; + const char *delim; + + cap_h = read_config(fd, &p->pc_sel, ptr + PCIR_AMDIOMMU_CAP_HEADER, 4); + cap_type = cap_h & PCIM_AMDIOMMU_CAP_TYPE_MASK; + cap_rev = cap_h & PCIM_AMDIOMMU_CAP_REV_MASK; + if (cap_type != PCIM_AMDIOMMU_CAP_TYPE_VAL || + cap_rev != PCIM_AMDIOMMU_CAP_REV_VAL) { + printf("Secure Device Type=0x%1x Rev=0x%02x\n", + cap_type >> 16, cap_rev >> 19); + return; + } + base_low = read_config(fd, &p->pc_sel, ptr + PCIR_AMDIOMMU_BASE_LOW, + 4); + base_high = read_config(fd, &p->pc_sel, ptr + PCIR_AMDIOMMU_BASE_HIGH, + 4); + printf("AMD IOMMU Base Capability Base=%#018jx/%sabled", + (uintmax_t)(base_low & PCIM_AMDIOMMU_BASE_LOW_ADDRM) + + ((uintmax_t)base_high << 32), + (base_low & PCIM_AMDIOMMU_BASE_LOW_EN) != 0 ? "En" : "Dis"); + + delim = "\n\t\t"; +#define PRINTCAP(bit, name) \ + if ((cap_h & PCIM_AMDIOMMU_CAP_ ##bit) != 0) { \ + printf("%s%s", delim, #name); \ + delim = ","; \ + } + PRINTCAP(CAPEXT, CapExt); + PRINTCAP(EFR, EFRSup); + PRINTCAP(NPCACHE, NpCache); + PRINTCAP(HTTUN, HtTunnel); + PRINTCAP(IOTLB, IotlbSup); +#undef PRINTCAP + + range = read_config(fd, &p->pc_sel, ptr + PCIR_AMDIOMMU_RANGE, 4); + printf("\n\t\tUnitId=%d", range & PCIM_AMDIOMMU_RANGE_UNITID_MASK); + if ((range & PCIM_AMDIOMMU_RANGE_RNGVALID) != 0) { + printf(" BusNum=%#06x FirstDev=%#06x LastDev=%#06x", + (range & PCIM_AMDIOMMU_RANGE_BUSNUM_MASK) >> 8, + (range & PCIM_AMDIOMMU_RANGE_FIRSTDEV_MASK) >> 16, + (range & PCIM_AMDIOMMU_RANGE_LASTDEV_MASK) >> 24); + } + + misc0 = read_config(fd, &p->pc_sel, ptr + PCIR_AMDIOMMU_MISC0, 4); + printf("\n\t\tMsiNum=%d MsiNumPPR=%d HtAtsResv=%d", + misc0 & PCIM_AMDIOMMU_MISC0_MSINUM_MASK, + (misc0 & PCIM_AMDIOMMU_MISC0_MSINUMPPR_MASK) >> 27, + (misc0 & PCIM_AMDIOMMU_MISC0_HTATSRESV) != 0); + if ((cap_h & PCIM_AMDIOMMU_CAP_CAPEXT) != 0) { + misc1 = read_config(fd, &p->pc_sel, + ptr + PCIR_AMDIOMMU_MISC1, 4); + printf(" MsiNumGA=%d", + misc1 & PCIM_AMDIOMMU_MISC1_MSINUMGA_MASK); + } + printf("\n\t\tVAsize=%s PAsize=%s GVAsize=%s", + cap_secdev_amdiommu_decode_vasize(misc0), + cap_secdev_amdiommu_decode_pasize(misc0), + cap_secdev_amdiommu_decode_gvasize(misc0)); +} + #define MAX_PAYLOAD(field) (128 << (field)) static const char * @@ -813,6 +925,9 @@ list_caps(int fd, struct pci_conf *p, int level) case PCIY_SUBVENDOR: cap_subvendor(fd, p, ptr); break; + case PCIY_SECDEV: + cap_secdev(fd, p, ptr); + break; case PCIY_EXPRESS: express = 1; cap_express(fd, p, ptr); From nobody Fri Apr 12 11:26:23 2024 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 4VGDlz2Wn7z5HD9w; Fri, 12 Apr 2024 11:26: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 4VGDlz22bSz4Ncq; Fri, 12 Apr 2024 11:26:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712921183; 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=kaVaOQPLmUwwcKWx1sAAd9QmQ08SDv3s1MnIOk2C5m4=; b=NmJyNjgmAFKTsseugqUAQMoIAdv+Nz1LBkQ2dk6lOsFZMtskyJnrJCm/z3bAVWuPpvUdAh vMbHhmno/ig8vOlh2sDnDt/MXyS6XvgTXMtr8cQZObLRc3DD/929+9M5JDuLSvaWjY5zGl kqYwFeEPhRCFtaSmvvKAAHfBGvXKDwjX7Es5Y31sFLx6tXF13nvxSt9qT/kWKBUxOyJ5su dCzERqCi01x9k/Qg4J8tBsWyOCy1bso8hOV8zeB7oUFOnTKaPrpV2TfJY2V2ZW1FuMZ0ds 7QomX59H5DoGveAhRecLr7ZsrwS71LbwWXwcRBEIOFWNvkXMSJHUSRrao6neEA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712921183; a=rsa-sha256; cv=none; b=UtmGTOPz/eE3Ufl0YmeIa3Nyi9MWdLL8V+eNlsfPYh9T+KkN/ULaw1WoDlSLEvbox3pHOb xdF7xtv+Jdf7ox2OyZs2S8pWEpeNW43PHPXMYMzoJD25u9/mdhcL7uAm+B7b/vbMExuiQs 8nweCtGcpWC+26tzNWSTknEFJAdiLkWW0M1keu5i3tqjU2bAWYa+V8N8nRs4GRBIhzVGYY b1u5K2MbJ8bNG5j4VYvnOTTGp04zFylf/s/8b0o9yjItGDw9IqrkcO/ruMPVYZmFbqw1h2 0MFGfWWZTQwb4FjM0HRmDk6svRTcTalEmanAHwJQFknXTS7crY6Tpqrq4Lq8Dg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712921183; 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=kaVaOQPLmUwwcKWx1sAAd9QmQ08SDv3s1MnIOk2C5m4=; b=lu2hlAq+97xu6+EKU0926DhxGC1JAiHoiLvfJUDlIy7xIrcRgiBgR664rDl0cLipC8YJYD S9wOGNkD83C6lFM1hC8Nc/IpAj1e/AEK0FWjF5Aas/diiA790TKMJx/nxmP1iOBwrm+rad hV7rjmScN6fFePo3pGGslyT6B5q6VU0RJDcQY5bIwNbf1Dhi9nhuyRUB6dkCWfQhlMhvKM znWXN+d4icnK0nuI2taCb8bVFYNFnqxTRNBBhkqD2xyfdnQ4M78nZK234N509Wl07QX+4R oDhh9L3ooyzIXcquSomOoq3sCd9M0jqJOl6X7MtGHV1bLwXoNV+iYRYarWzkvg== 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 4VGDlz1WQrznC7; Fri, 12 Apr 2024 11:26:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43CBQNA3083203; Fri, 12 Apr 2024 11:26:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43CBQNbv083200; Fri, 12 Apr 2024 11:26:23 GMT (envelope-from git) Date: Fri, 12 Apr 2024 11:26:23 GMT Message-Id: <202404121126.43CBQNbv083200@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: d4d5aed66a3f - stable/14 - LinuxKPI: Remove the temporary variable fileid from the macro request_module 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: 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: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d4d5aed66a3f4323cf23f1a849b98d8570b403bf Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=d4d5aed66a3f4323cf23f1a849b98d8570b403bf commit d4d5aed66a3f4323cf23f1a849b98d8570b403bf Author: Zhenlei Huang AuthorDate: 2024-04-05 16:26:09 +0000 Commit: Zhenlei Huang CommitDate: 2024-04-12 11:25:17 +0000 LinuxKPI: Remove the temporary variable fileid from the macro request_module The variable fileid stores the result from kern_kldload() but never gets used. Since the third parameter `*fileid` of kern_kldload() can be NULL, this unused variable can be safely removed. No functional change intended. Reviewed by: emaste, bz, #linuxkpi MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D44583 (cherry picked from commit 317cc829ee227cfdffe7b25125c070112ce0c2f1) --- sys/compat/linuxkpi/common/include/linux/kmod.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/kmod.h b/sys/compat/linuxkpi/common/include/linux/kmod.h index 278d64db9df3..b3cbe2ed2e02 100644 --- a/sys/compat/linuxkpi/common/include/linux/kmod.h +++ b/sys/compat/linuxkpi/common/include/linux/kmod.h @@ -39,9 +39,8 @@ #define request_module(...) \ ({\ char modname[128]; \ - int fileid; \ snprintf(modname, sizeof(modname), __VA_ARGS__); \ - kern_kldload(curthread, modname, &fileid); \ + kern_kldload(curthread, modname, NULL); \ }) #define request_module_nowait request_module From nobody Fri Apr 12 11:28:10 2024 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 4VGDp30ZWhz5HDF7; Fri, 12 Apr 2024 11:28: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 4VGDp3043Yz4P8D; Fri, 12 Apr 2024 11:28:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712921291; 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=O5bAY5khXR6FZSjKIV6mhzzbkPBLRYrSU0YiZX0ZDGk=; b=iW4ZNMtkB+Gvm8pk3A5cUfzDKIaEI53uYjtHtOac/mYv4X3ygx/bIFMeNvS+pf/PBgGgIG 3kiyslcLfaCyNrUWJmHPrwUVhpr6oePwj88k7IDvcKIri96OL+xrsm8/COptF4ZkdCd5OM xjaX94FUnkXJ2eYsMlvNPXyRF17zt0BDqTIA6rdt3PL1deyGNRNbf+QLx8n2eKFHIwwxcE 0vihkG+FYFxfpFhq2Ztvq0mK0LZotnzkpDD5zLKCYl7/R3YnDAHHD3nqPQ4T875ERC4zc0 4zgAlYcGl1CynH9H1lF7QeBgznfZHzAhd0WZirctx3YyW+lP36IqqiH+PE+zow== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712921291; a=rsa-sha256; cv=none; b=ETsSLm+q95N/AfbWB1j1f02ONaUUh8sS+w/ynOtvT0mcyFLs+VtzDFRqZCo7kq0oyOEw4i TicnSzwghbIYN0ieACTTD8svJGCjZswC++GEL1tZuQMqBh5BUQj9bgayLcqjnaPpU4FS/c YbqFjOBaJbjvIAU+dEq290TavnkoeXjZt3SIafVn6hTj+bDdDbUvM6uqbhu7yiW23KRDO5 2oNkQgKkwaI+mVK4FUrEIneWSPH2574StMJyi1l+beJB7mSoQGleAx948ljKnD1caRILxb vhzHibEkEUl6e6p5qgrCi5d55AFnOwdhW63OiWiwXqh6iPV3qOcrIpuC3fEjHw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712921291; 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=O5bAY5khXR6FZSjKIV6mhzzbkPBLRYrSU0YiZX0ZDGk=; b=fIoveO1RSs5F49lkay56BhBHqpMRn+U+Hw/gfhFn9N/csvCm3SJpxpVM/RctWXz2mpPVzY 8cP5IVdX2uft3R5jjkCgRGq624KvKRk9kjm6nV5N1tnatymnQHI6AsV2V9Ii/T9WvkfJRn +MjRYEZ34Hk96Z583ovIEm638rrxKNfsNWcIny80VA/NU2wXiJWbsaz4WgIwhakpQ8fKeN tKX7KwJRCpv7akqfqy3szcKu7YmVc3DTSzVXW0ooaTpYN3ognGYV/EEF3ea+6FX6OsSl4/ Fr8I/oVBye4lIw8VQMasY5DEWGD2tM7cWEsYcgRI6GGmmCKHd7UCqk4QbMmjxw== 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 4VGDp26nKVznFc; Fri, 12 Apr 2024 11:28:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43CBSA3w083611; Fri, 12 Apr 2024 11:28:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43CBSATn083608; Fri, 12 Apr 2024 11:28:10 GMT (envelope-from git) Date: Fri, 12 Apr 2024 11:28:10 GMT Message-Id: <202404121128.43CBSATn083608@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: f0edd08b27d7 - stable/13 - LinuxKPI: Remove the temporary variable fileid from the macro request_module 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: 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: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f0edd08b27d78a27a05e16c894a4cafa1fc386e3 Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=f0edd08b27d78a27a05e16c894a4cafa1fc386e3 commit f0edd08b27d78a27a05e16c894a4cafa1fc386e3 Author: Zhenlei Huang AuthorDate: 2024-04-05 16:26:09 +0000 Commit: Zhenlei Huang CommitDate: 2024-04-12 11:27:13 +0000 LinuxKPI: Remove the temporary variable fileid from the macro request_module The variable fileid stores the result from kern_kldload() but never gets used. Since the third parameter `*fileid` of kern_kldload() can be NULL, this unused variable can be safely removed. No functional change intended. Reviewed by: emaste, bz, #linuxkpi MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D44583 (cherry picked from commit 317cc829ee227cfdffe7b25125c070112ce0c2f1) (cherry picked from commit d4d5aed66a3f4323cf23f1a849b98d8570b403bf) --- sys/compat/linuxkpi/common/include/linux/kmod.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/kmod.h b/sys/compat/linuxkpi/common/include/linux/kmod.h index 278d64db9df3..b3cbe2ed2e02 100644 --- a/sys/compat/linuxkpi/common/include/linux/kmod.h +++ b/sys/compat/linuxkpi/common/include/linux/kmod.h @@ -39,9 +39,8 @@ #define request_module(...) \ ({\ char modname[128]; \ - int fileid; \ snprintf(modname, sizeof(modname), __VA_ARGS__); \ - kern_kldload(curthread, modname, &fileid); \ + kern_kldload(curthread, modname, NULL); \ }) #define request_module_nowait request_module From nobody Fri Apr 12 13:01:05 2024 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 4VGGsF42MMz5HM9P; Fri, 12 Apr 2024 13:01: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 4VGGsF2YtDz4VTS; Fri, 12 Apr 2024 13:01:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712926865; 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=EpTF7x37MWZ4wRm1PsnP5ra0k+LiCtvsmvj/gk5LuAs=; b=cBO2lho7Mh2x7xtdvxyvU0JGAnbY+L2XSbgwLysw7P39aHfMe2EhlheDCd8xVhrNvxKMmE lt9rF5beIomOI0qL874uo3JxozJnH6M3v+iw7dfIKtYlk1HIwZ9XAxjXH3SXhshZtyVD35 n1qMQiajKscAdpbUz/ythSesgQmmfsUGJUe4ABeyYDrWSW4tf3V2d7Qk2REDHkbirhTCPN nnQx2WrqSncjUNScI7HPisdQDutCBv12+Mc0eW8EadYuYCUthD+EysxOmjOCFlq8l0KppQ TAFrZ3StUEFncxpM/Ol3BM/WpV/JxKrQ6MaYvCLwOcJL7AwI4yGDw6EkXXJCGQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712926865; a=rsa-sha256; cv=none; b=tS7IUa6kxcnl28ItHrlDhXbGSVrOFpArPH2LRdIz3YFRdvdmPR2rcUiodvQPEDRP1PzxQo i0+KlnD75VlGudqyViOSuB3POLyEEh1UF/+hMO2LXuwQ1WuXWsfnxZVS3TiaKb0poyihFf uVLACoC4h7f+oBNJkV5iMaWU5VRp4v1szhxyKnNKO8569n3762Mm5JF25lI+R9iFqSxVPe m/zgspKd9lAmx2hgy6IZ+UGYcg9EmwsAOexbHKx1un84dJLng/FeaU2nGxzhl1P2h/gV8W OTSxNC9bvD+Z0afO1+m+7X+tivVfIzBFXc6g66bC6AorTGcCSpxiRR6IufCr/A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712926865; 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=EpTF7x37MWZ4wRm1PsnP5ra0k+LiCtvsmvj/gk5LuAs=; b=YeFmROtdslDKpMW3axbbb9cTUkKpVhHD0aNLd/B2YYajD0K8lzyT43oUpCFkSH6tS6mntk T8izAPJJWjZcWfm1tvrO+UFB9P+MISdhRzdt/fucX3PNT0YyzZmvORe85C2aOVVcJs39Gd E9BZTYZhfqpz3UDQTBNQV2W+smim8Sx2kGFLfZN76eLB8XD6mNbNjuDZFaMYwkriHJqYMT +6FoGFSWD7K8gqW7FCr+R5RbiJmQgqQ5kxPNx4MlLLacsDJU7bfRFL8DhCe/IIk1oGOXL8 zMqlD7wbpx31kSKoMW5bWpBWL/0miXabadaQdtKKztm8MTSf3yUJeYC0s85t3w== 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 4VGGsF2B11zqt5; Fri, 12 Apr 2024 13:01:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43CD15x0048510; Fri, 12 Apr 2024 13:01:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43CD15cj048507; Fri, 12 Apr 2024 13:01:05 GMT (envelope-from git) Date: Fri, 12 Apr 2024 13:01:05 GMT Message-Id: <202404121301.43CD15cj048507@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 330954bdb822 - stable/13 - Unify arc_prune_async() code, fix excessive ARC pruning 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: 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: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 330954bdb822af6bc07d487b1ecd7f8fda9c4def Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=330954bdb822af6bc07d487b1ecd7f8fda9c4def commit 330954bdb822af6bc07d487b1ecd7f8fda9c4def Author: Alexander Motin AuthorDate: 2023-10-30 23:56:04 +0000 Commit: Olivier Certner CommitDate: 2024-04-12 13:00:11 +0000 Unify arc_prune_async() code, fix excessive ARC pruning There is no sense to have separate implementations for FreeBSD and Linux. Make Linux code shared as more functional and just register FreeBSD-specific prune callback with arc_add_prune_callback() API. Aside of code cleanup this fixes excessive pruning on FreeBSD. [olce: This code comes from the OpenZFS pull request: https://github.com/openzfs/zfs/pull/16083, vendor-merged into our tree. Its commit message has been slightly adapted to the present context. The upstream pull request has been reviewed and merged into 'zfs-2.1.16-staging' as 5b81b1bf5e6d6aeb8a87175dcb12b529185cac2f, which should come into our tree at the next vendor import. This is the same code that was merged into stable/14 and main as part of vendor merges, and released as an EN (FreeBSD-EN-23:18.openzfs) over releng/14.0 by markj@.] PR: 275594, 274698 Reported by: Seigo Tanimura , markj, and others Tested by: olce Approved by: emaste (mentor) Obtained from: OpenZFS Sponsored by: iXsystems, Inc. Sponsored by: The FreeBSD Foundation Signed-off-by: Alexander Motin --- sys/contrib/openzfs/include/os/linux/zfs/sys/zpl.h | 2 +- sys/contrib/openzfs/include/sys/arc.h | 2 +- sys/contrib/openzfs/include/sys/arc_impl.h | 1 - sys/contrib/openzfs/module/os/freebsd/zfs/arc_os.c | 62 ---------------------- .../openzfs/module/os/freebsd/zfs/zfs_vfsops.c | 32 +++++++++++ sys/contrib/openzfs/module/os/linux/zfs/arc_os.c | 51 ------------------ .../openzfs/module/os/linux/zfs/zpl_super.c | 2 +- sys/contrib/openzfs/module/zfs/arc.c | 52 ++++++++++++++++++ 8 files changed, 87 insertions(+), 117 deletions(-) diff --git a/sys/contrib/openzfs/include/os/linux/zfs/sys/zpl.h b/sys/contrib/openzfs/include/os/linux/zfs/sys/zpl.h index 69b6c1185bb1..5ac9aa543ebb 100644 --- a/sys/contrib/openzfs/include/os/linux/zfs/sys/zpl.h +++ b/sys/contrib/openzfs/include/os/linux/zfs/sys/zpl.h @@ -52,7 +52,7 @@ extern const struct file_operations zpl_file_operations; extern const struct file_operations zpl_dir_file_operations; /* zpl_super.c */ -extern void zpl_prune_sb(int64_t nr_to_scan, void *arg); +extern void zpl_prune_sb(uint64_t nr_to_scan, void *arg); extern const struct super_operations zpl_super_operations; extern const struct export_operations zpl_export_operations; diff --git a/sys/contrib/openzfs/include/sys/arc.h b/sys/contrib/openzfs/include/sys/arc.h index 5d8176894e60..9b762c01c159 100644 --- a/sys/contrib/openzfs/include/sys/arc.h +++ b/sys/contrib/openzfs/include/sys/arc.h @@ -81,7 +81,7 @@ typedef struct arc_prune arc_prune_t; typedef void arc_read_done_func_t(zio_t *zio, const zbookmark_phys_t *zb, const blkptr_t *bp, arc_buf_t *buf, void *priv); typedef void arc_write_done_func_t(zio_t *zio, arc_buf_t *buf, void *priv); -typedef void arc_prune_func_t(int64_t bytes, void *priv); +typedef void arc_prune_func_t(uint64_t bytes, void *priv); /* Shared module parameters */ extern int zfs_arc_average_blocksize; diff --git a/sys/contrib/openzfs/include/sys/arc_impl.h b/sys/contrib/openzfs/include/sys/arc_impl.h index db6238fda61e..118bf33632fb 100644 --- a/sys/contrib/openzfs/include/sys/arc_impl.h +++ b/sys/contrib/openzfs/include/sys/arc_impl.h @@ -994,7 +994,6 @@ extern void arc_wait_for_eviction(uint64_t, boolean_t); extern void arc_lowmem_init(void); extern void arc_lowmem_fini(void); -extern void arc_prune_async(int64_t); extern int arc_memory_throttle(spa_t *spa, uint64_t reserve, uint64_t txg); extern uint64_t arc_free_memory(void); extern int64_t arc_available_memory(void); diff --git a/sys/contrib/openzfs/module/os/freebsd/zfs/arc_os.c b/sys/contrib/openzfs/module/os/freebsd/zfs/arc_os.c index 3dd49f05521b..9641bf8bd591 100644 --- a/sys/contrib/openzfs/module/os/freebsd/zfs/arc_os.c +++ b/sys/contrib/openzfs/module/os/freebsd/zfs/arc_os.c @@ -51,11 +51,6 @@ #include #include -#if __FreeBSD_version >= 1300139 -static struct sx arc_vnlru_lock; -static struct vnode *arc_vnlru_marker; -#endif - extern struct vfsops zfs_vfsops; uint_t zfs_arc_free_target = 0; @@ -151,53 +146,6 @@ arc_default_max(uint64_t min, uint64_t allmem) return (MAX(allmem * 5 / 8, size)); } -/* - * Helper function for arc_prune_async() it is responsible for safely - * handling the execution of a registered arc_prune_func_t. - */ -static void -arc_prune_task(void *arg) -{ - int64_t nr_scan = (intptr_t)arg; - -#ifndef __ILP32__ - if (nr_scan > INT_MAX) - nr_scan = INT_MAX; -#endif - -#if __FreeBSD_version >= 1300139 - sx_xlock(&arc_vnlru_lock); - vnlru_free_vfsops(nr_scan, &zfs_vfsops, arc_vnlru_marker); - sx_xunlock(&arc_vnlru_lock); -#else - vnlru_free(nr_scan, &zfs_vfsops); -#endif -} - -/* - * Notify registered consumers they must drop holds on a portion of the ARC - * buffered they reference. This provides a mechanism to ensure the ARC can - * honor the arc_meta_limit and reclaim otherwise pinned ARC buffers. This - * is analogous to dnlc_reduce_cache() but more generic. - * - * This operation is performed asynchronously so it may be safely called - * in the context of the arc_reclaim_thread(). A reference is taken here - * for each registered arc_prune_t and the arc_prune_task() is responsible - * for releasing it once the registered arc_prune_func_t has completed. - */ -void -arc_prune_async(int64_t adjust) -{ - -#ifndef __LP64__ - if (adjust > INTPTR_MAX) - adjust = INTPTR_MAX; -#endif - taskq_dispatch(arc_prune_taskq, arc_prune_task, - (void *)(intptr_t)adjust, TQ_SLEEP); - ARCSTAT_BUMP(arcstat_prune); -} - uint64_t arc_all_memory(void) { @@ -248,10 +196,6 @@ arc_lowmem_init(void) { arc_event_lowmem = EVENTHANDLER_REGISTER(vm_lowmem, arc_lowmem, NULL, EVENTHANDLER_PRI_FIRST); -#if __FreeBSD_version >= 1300139 - arc_vnlru_marker = vnlru_alloc_marker(); - sx_init(&arc_vnlru_lock, "arc vnlru lock"); -#endif } void @@ -259,12 +203,6 @@ arc_lowmem_fini(void) { if (arc_event_lowmem != NULL) EVENTHANDLER_DEREGISTER(vm_lowmem, arc_event_lowmem); -#if __FreeBSD_version >= 1300139 - if (arc_vnlru_marker != NULL) { - vnlru_free_marker(arc_vnlru_marker); - sx_destroy(&arc_vnlru_lock); - } -#endif } void diff --git a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c index 6ffd36885655..33581d018256 100644 --- a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c +++ b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c @@ -2097,6 +2097,26 @@ zfs_vnodes_adjust_back(void) #endif } +#if __FreeBSD_version >= 1300139 +static struct sx zfs_vnlru_lock; +static struct vnode *zfs_vnlru_marker; +#endif +static arc_prune_t *zfs_prune; + +static void +zfs_prune_task(uint64_t nr_to_scan, void *arg __unused) +{ + if (nr_to_scan > INT_MAX) + nr_to_scan = INT_MAX; +#if __FreeBSD_version >= 1300139 + sx_xlock(&zfs_vnlru_lock); + vnlru_free_vfsops(nr_to_scan, &zfs_vfsops, zfs_vnlru_marker); + sx_xunlock(&zfs_vnlru_lock); +#else + vnlru_free(nr_to_scan, &zfs_vfsops); +#endif +} + void zfs_init(void) { @@ -2123,11 +2143,23 @@ zfs_init(void) dmu_objset_register_type(DMU_OST_ZFS, zpl_get_file_info); zfsvfs_taskq = taskq_create("zfsvfs", 1, minclsyspri, 0, 0, 0); + +#if __FreeBSD_version >= 1300139 + zfs_vnlru_marker = vnlru_alloc_marker(); + sx_init(&zfs_vnlru_lock, "zfs vnlru lock"); +#endif + zfs_prune = arc_add_prune_callback(zfs_prune_task, NULL); } void zfs_fini(void) { + arc_remove_prune_callback(zfs_prune); +#if __FreeBSD_version >= 1300139 + vnlru_free_marker(zfs_vnlru_marker); + sx_destroy(&zfs_vnlru_lock); +#endif + taskq_destroy(zfsvfs_taskq); zfsctl_fini(); zfs_znode_fini(); diff --git a/sys/contrib/openzfs/module/os/linux/zfs/arc_os.c b/sys/contrib/openzfs/module/os/linux/zfs/arc_os.c index 19540221d688..5ba923487bac 100644 --- a/sys/contrib/openzfs/module/os/linux/zfs/arc_os.c +++ b/sys/contrib/openzfs/module/os/linux/zfs/arc_os.c @@ -491,57 +491,6 @@ arc_unregister_hotplug(void) } #endif /* _KERNEL */ -/* - * Helper function for arc_prune_async() it is responsible for safely - * handling the execution of a registered arc_prune_func_t. - */ -static void -arc_prune_task(void *ptr) -{ - arc_prune_t *ap = (arc_prune_t *)ptr; - arc_prune_func_t *func = ap->p_pfunc; - - if (func != NULL) - func(ap->p_adjust, ap->p_private); - - zfs_refcount_remove(&ap->p_refcnt, func); -} - -/* - * Notify registered consumers they must drop holds on a portion of the ARC - * buffered they reference. This provides a mechanism to ensure the ARC can - * honor the arc_meta_limit and reclaim otherwise pinned ARC buffers. This - * is analogous to dnlc_reduce_cache() but more generic. - * - * This operation is performed asynchronously so it may be safely called - * in the context of the arc_reclaim_thread(). A reference is taken here - * for each registered arc_prune_t and the arc_prune_task() is responsible - * for releasing it once the registered arc_prune_func_t has completed. - */ -void -arc_prune_async(int64_t adjust) -{ - arc_prune_t *ap; - - mutex_enter(&arc_prune_mtx); - for (ap = list_head(&arc_prune_list); ap != NULL; - ap = list_next(&arc_prune_list, ap)) { - - if (zfs_refcount_count(&ap->p_refcnt) >= 2) - continue; - - zfs_refcount_add(&ap->p_refcnt, ap->p_pfunc); - ap->p_adjust = adjust; - if (taskq_dispatch(arc_prune_taskq, arc_prune_task, - ap, TQ_SLEEP) == TASKQID_INVALID) { - zfs_refcount_remove(&ap->p_refcnt, ap->p_pfunc); - continue; - } - ARCSTAT_BUMP(arcstat_prune); - } - mutex_exit(&arc_prune_mtx); -} - /* BEGIN CSTYLED */ ZFS_MODULE_PARAM(zfs_arc, zfs_arc_, shrinker_limit, INT, ZMOD_RW, "Limit on number of pages that ARC shrinker can reclaim at once"); diff --git a/sys/contrib/openzfs/module/os/linux/zfs/zpl_super.c b/sys/contrib/openzfs/module/os/linux/zfs/zpl_super.c index c2fd3fee1401..9300a7199296 100644 --- a/sys/contrib/openzfs/module/os/linux/zfs/zpl_super.c +++ b/sys/contrib/openzfs/module/os/linux/zfs/zpl_super.c @@ -334,7 +334,7 @@ zpl_kill_sb(struct super_block *sb) } void -zpl_prune_sb(int64_t nr_to_scan, void *arg) +zpl_prune_sb(uint64_t nr_to_scan, void *arg) { struct super_block *sb = (struct super_block *)arg; int objects = 0; diff --git a/sys/contrib/openzfs/module/zfs/arc.c b/sys/contrib/openzfs/module/zfs/arc.c index 1180853da038..eacc2104a6a6 100644 --- a/sys/contrib/openzfs/module/zfs/arc.c +++ b/sys/contrib/openzfs/module/zfs/arc.c @@ -868,6 +868,8 @@ static void l2arc_do_free_on_write(void); static void l2arc_hdr_arcstats_update(arc_buf_hdr_t *hdr, boolean_t incr, boolean_t state_only); +static void arc_prune_async(uint64_t adjust); + #define l2arc_hdr_arcstats_increment(hdr) \ l2arc_hdr_arcstats_update((hdr), B_TRUE, B_FALSE) #define l2arc_hdr_arcstats_decrement(hdr) \ @@ -6521,6 +6523,56 @@ arc_remove_prune_callback(arc_prune_t *p) kmem_free(p, sizeof (*p)); } +/* + * Helper function for arc_prune_async() it is responsible for safely + * handling the execution of a registered arc_prune_func_t. + */ +static void +arc_prune_task(void *ptr) +{ + arc_prune_t *ap = (arc_prune_t *)ptr; + arc_prune_func_t *func = ap->p_pfunc; + + if (func != NULL) + func(ap->p_adjust, ap->p_private); + + zfs_refcount_remove(&ap->p_refcnt, func); +} + +/* + * Notify registered consumers they must drop holds on a portion of the ARC + * buffers they reference. This provides a mechanism to ensure the ARC can + * honor the metadata limit and reclaim otherwise pinned ARC buffers. + * + * This operation is performed asynchronously so it may be safely called + * in the context of the arc_reclaim_thread(). A reference is taken here + * for each registered arc_prune_t and the arc_prune_task() is responsible + * for releasing it once the registered arc_prune_func_t has completed. + */ +static void +arc_prune_async(uint64_t adjust) +{ + arc_prune_t *ap; + + mutex_enter(&arc_prune_mtx); + for (ap = list_head(&arc_prune_list); ap != NULL; + ap = list_next(&arc_prune_list, ap)) { + + if (zfs_refcount_count(&ap->p_refcnt) >= 2) + continue; + + zfs_refcount_add(&ap->p_refcnt, ap->p_pfunc); + ap->p_adjust = adjust; + if (taskq_dispatch(arc_prune_taskq, arc_prune_task, + ap, TQ_SLEEP) == TASKQID_INVALID) { + zfs_refcount_remove(&ap->p_refcnt, ap->p_pfunc); + continue; + } + ARCSTAT_BUMP(arcstat_prune); + } + mutex_exit(&arc_prune_mtx); +} + /* * Notify the arc that a block was freed, and thus will never be used again. */ From nobody Fri Apr 12 15:28:54 2024 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 4VGL7p6Zcpz5HZ2D; Fri, 12 Apr 2024 15:28: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 4VGL7p5Wzsz4jQD; Fri, 12 Apr 2024 15:28:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712935734; 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=b3RoKgisMD/VIgI42uiuXgkWZUhC4qLB7h1V9FWHEjo=; b=qPhDoOrFZp5NOPMQAdXV9TaGclKWS7vKbuMH7jQZXmD4p1rZiSNv+lRiv+A6lRR79ckUSa w8IlBFMr6LSWcygZ8by2yVkGtJ8nVLn5GN1g8PO6ALGBl2GJObWfCxBz3mtmC/ZakSPPWh gDX3dzpHwHl1MO1crW0Cz4TEUvJImTdwZ7Ky7pzQbFVRoRlmP9vRkCruHIVzs//7VMFuV+ iDakzB00OmhKj4xdbDFbd1T/3cXMyXLHyhm0BtvUEbL05woiHWF1xmw8e6cVat29wSGn39 OmTpQFbNVsr7xxDZ+B0pm56xHXK0uZvUMJzR13XrMcKK5YvsixXo296Gre8qeg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712935734; a=rsa-sha256; cv=none; b=Fa2FlDkKtwOvgNYM6gBa8RvPDbx0vm0Hp6Cx50ix1E4fjwQVPhXYk6FO7zFV1nVbGAbTuB 6XKNhmnaIVIOsj/Ryu9GjGksJVw/1M+K6oYJY3/TZRz4KUsOs4TlA+cfn5RNZjKucqOXfG TEwvTMEHXo+PkORp7Xsv8O0Vdw1DBRsK5DN2zEFLV+26oD8DALV/5XpSafWxV3KqFUPIn5 KPU5FuofD5QQwKySCIifo9UZ5+8p1U/qSOlv0CB862TKEPvtWpvWsEJVjtmPgPJeErvMoh pjm2wiwyHctcA8CnSZaak34kvVnDa7I63mJ82/rhA1PLWsST4lMao/KwaYF+lQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712935734; 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=b3RoKgisMD/VIgI42uiuXgkWZUhC4qLB7h1V9FWHEjo=; b=SyotNHlEAD+yZ8VYoV1k6kD6YP7T7n+1fCWNmwocUr96AqXEar7jddmUtmeqp142IcI9rq pAbKfasehYh3xqYlB2IyY3tt1RbgcJ59Hu3CWzAx2YPYzYrgzLyDscmFpHtlraPwrYmE8L D3ZJ8iB8qUqiVWb1xFPEtlWfoAXilQOg7F+KRo5DCjBtZDQmebDpri/gSy+cxsdeOXc37p 844FDJC8MS6rHJRrRDa8zTqc00MmhnV36AzngpxY5NzdRoT1TSoZI2PoMQAK2a/z/Tr9D+ UqiPyUJEDym+L45YNg5wgtmT7WuwPceU7zabeYCICAydAiwMCNqKl6tor9mHXA== 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 4VGL7p549MztvT; Fri, 12 Apr 2024 15:28:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43CFSspg087936; Fri, 12 Apr 2024 15:28:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43CFSsEn087933; Fri, 12 Apr 2024 15:28:54 GMT (envelope-from git) Date: Fri, 12 Apr 2024 15:28:54 GMT Message-Id: <202404121528.43CFSsEn087933@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Murray Subject: git: 8df6c930c151 - stable/14 - lib/msun: Fix tgammal(3) on IEEE 128-bit platforms 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: 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: markm X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8df6c930c15121a1b6a9d21e12f4421ef78617bb Auto-Submitted: auto-generated The branch stable/14 has been updated by markm: URL: https://cgit.FreeBSD.org/src/commit/?id=8df6c930c15121a1b6a9d21e12f4421ef78617bb commit 8df6c930c15121a1b6a9d21e12f4421ef78617bb Author: Mark Murray AuthorDate: 2024-03-01 15:53:58 +0000 Commit: Mark Murray CommitDate: 2024-04-12 15:27:21 +0000 lib/msun: Fix tgammal(3) on IEEE 128-bit platforms Undo the 80-bit "stub" implementation of the 128-bit long double tgammal(3) function. The latest (as of Feb 2024) version of the src/contrib/arm-optimised-routines library includes a standalone, full 128-bit replacement. This needs a small bit of wrapping to fit it in, but is otherwise a drop-in replacement. Testing this is hard, as most maths packages blow up as soon as their 80-bit floating-point capability is exceeded. With 128-bit tgammal(), this is easy to do, and this is the range that needs to be checked the most carefully. Using my copy of Maple, I was able to check that the output was within a few ULP of the correct answer, right up to the point of 128-bit over- and underflow. Additionally, the results are no worse, and indeed better than the 80-bit version. Steve Kargl sent me his libm testing code, which I used to verify that the excpetions for certain key values were correct. Tested in this case were +-Inf, +-NaN, +-1 and +-0. Differential Revision: https://reviews.freebsd.org/D44168 Reviewed by: theraven, andrew, imp (cherry-picked from commit e38f2308273c8a51ec45f013d22c963590917cca) --- lib/msun/Makefile | 2 +- lib/msun/ld128/b_tgammal.c | 53 +++++----------------------------------------- lib/msun/man/lgamma.3 | 21 ++++++++---------- 3 files changed, 15 insertions(+), 61 deletions(-) diff --git a/lib/msun/Makefile b/lib/msun/Makefile index 9b64674bbe7d..4b164545f0b8 100644 --- a/lib/msun/Makefile +++ b/lib/msun/Makefile @@ -28,7 +28,7 @@ CFLAGS+= -I${.CURDIR}/x86 CFLAGS+= -I${.CURDIR}/ld80 .elif ${LDBL_PREC} == 113 .PATH: ${.CURDIR}/ld128 -CFLAGS+= -I${.CURDIR}/ld128 +CFLAGS+= -I${.CURDIR}/ld128 -I${SRCTOP}/contrib/arm-optimized-routines/math .endif CFLAGS+= -I${.CURDIR}/${ARCH_SUBDIR} diff --git a/lib/msun/ld128/b_tgammal.c b/lib/msun/ld128/b_tgammal.c index 4bae4f3aded6..6df7264a4c9e 100644 --- a/lib/msun/ld128/b_tgammal.c +++ b/lib/msun/ld128/b_tgammal.c @@ -1,55 +1,12 @@ /*- * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2013 David Chisnall - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. + * Copyright (c) 2024 The FreeBSD Foundation */ -#include -#include - /* - * If long double is not the same size as double, then these will lose - * precision and we should emit a warning whenever something links against - * them. + * This is a pure C function generously donated by ARM. + * See src/contrib/arm-optimized-routines/math/tgamma128.[ch]. */ -#if (LDBL_MANT_DIG > 53) -#define WARN_IMPRECISE(x) \ - __warn_references(x, # x " has lower than advertised precision"); -#else -#define WARN_IMPRECISE(x) -#endif -/* - * Declare the functions as weak variants so that other libraries providing - * real versions can override them. - */ -#define DECLARE_WEAK(x)\ - __weak_reference(imprecise_## x, x);\ - WARN_IMPRECISE(x) - -#define DECLARE_IMPRECISE(f) \ - long double imprecise_ ## f ## l(long double v) { return f(v); }\ - DECLARE_WEAK(f ## l) - -DECLARE_IMPRECISE(tgamma); +#define tgamma128 tgammal +#include "tgamma128.c" diff --git a/lib/msun/man/lgamma.3 b/lib/msun/man/lgamma.3 index cf80c9e7f365..41d680e41bda 100644 --- a/lib/msun/man/lgamma.3 +++ b/lib/msun/man/lgamma.3 @@ -25,9 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)lgamma.3 6.6 (Berkeley) 12/3/92 -.\" -.Dd December 8, 2017 +.Dd April 12, 2024 .Dt LGAMMA 3 .Os .Sh NAME @@ -169,15 +167,6 @@ non-positive integers. For large non-integer negative values, .Fn tgamma will underflow. -.Sh BUGS -To conform with newer C/C++ standards, a stub implementation for -.Nm tgammal -was committed to the math library, where -.Nm tgammal -is mapped to -.Nm tgamma . -Thus, the numerical accuracy is at most that of the 53-bit double -precision implementation. .Sh SEE ALSO .Xr math 3 .Sh STANDARDS @@ -214,3 +203,11 @@ The .Fn tgamma function appeared in .Fx 5.0 . +The 128-bit +.Ft long double +version of +.Fn tgammal +replaced the 80-bit stub version in +version in +.Fx 14.1 , +thanks to an appropriate implementation from Arm. From nobody Fri Apr 12 21:31:27 2024 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 4VGVB81Bfkz5G9YX; Fri, 12 Apr 2024 21:31: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 4VGVB80lKHz4jdP; Fri, 12 Apr 2024 21:31:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712957488; 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=nqcFnmi2q+toOpDQV1ZrU1u3UNJGcfJPv9j9OvDkyd8=; b=q8sLIMGtVtNHB7AGBYQhtpKLDD0VPFYTMzQKgUhDJeSRgKbD6MOFpiZ4eJN+t9smWejDgL 7GTb2eDz0nIpQnH7V0OhDujIhmwZYIhobW/wm9aI6rjngJUNs8HI+Bf+Qm6kqM94ksi0le bGYg0+BMDMtmIPHEHIEKxEn9woI+XxNmXj402pKO4g5/zXCl0nkYtUcV37g2aNhRuPi7oc 2yTkiiCHoDEmdli+LQHgkhS8y6Uz01cRfr7IZ2extchUqXF5fgM0/7Jh7T6n50q7SeJUdl ikTL9rZuQnB5Wmbhp6Py39AimoBNFbJlkaqET8C2cPr0MFtxIF99xWJTnUiQfA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712957488; a=rsa-sha256; cv=none; b=Iz7jogvowZnkbVA4dEeP8Digpe7P+6eggEgueyWbmem0Ny1rBqP//bQj2oUKuijYudDA2k t51mmf1NZtV2Xb6O15EjSYhV/0oJhjCNLEof1P2gQ7h58aXQAu76MrcIuWei+qhMGzYeFx BCxCDPD+ulyIq/hhJYAEjLl9VZNwLjaPJsEn2/xcLLo0KnqVzLIeCZIKb3zX9i/TbTajtE PbDuwIbPypUAQGJnJzq1aJOzOQjiU+QuWkkbQQ/O8/Rg/vyJwPznckw5aWBYX7JKeUEfP6 f5xGMoF0t+hi7EPkNro2evXx9EDCRwlrhpA4sLS7omHKbMX0Iq43toqt+vlwjQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712957488; 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=nqcFnmi2q+toOpDQV1ZrU1u3UNJGcfJPv9j9OvDkyd8=; b=btXPc5glUY4XXWPrCfaaDY5wgiVsdTKBmoY2uXrt5Ap8mCWZ/B2TU47U4WQQVN1cwfACFJ aywCLhkyRrzHQM6gDpQ7NYjzjRPuj0ChdEvUEXfI6P4hI980qZGTba+YefrNTQLh8b6imh OF7jE4OIzGnQhuzepAS7lxTAOacBATeS2Pkvbg6sF8msBHAgsqmow5BPHFDKOpIEnyPz6T USZztGjGj3kgCIEVfFXNRuc2cQeyMT53keUR3l0gUfA5XkcE38bmpmM2igqQvBWx+A37Fh Nq6DZ64dOuJWxKQEdy771HHeT6UGrm6mC2ys0If+VZWGZkAP7GxZPNIclkJwHA== 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 4VGVB80L3tz15cs; Fri, 12 Apr 2024 21:31:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43CLVRob011724; Fri, 12 Apr 2024 21:31:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43CLVRR8011721; Fri, 12 Apr 2024 21:31:27 GMT (envelope-from git) Date: Fri, 12 Apr 2024 21:31:27 GMT Message-Id: <202404122131.43CLVRR8011721@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: ce5a6a3adda6 - stable/14 - tcp: Add a new kernel-only TCP_USE_DDP socket option 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: 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ce5a6a3adda64b3385312ffc9453b8ea9f556e80 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=ce5a6a3adda64b3385312ffc9453b8ea9f556e80 commit ce5a6a3adda64b3385312ffc9453b8ea9f556e80 Author: John Baldwin AuthorDate: 2024-03-20 22:29:02 +0000 Commit: John Baldwin CommitDate: 2024-04-12 19:25:11 +0000 tcp: Add a new kernel-only TCP_USE_DDP socket option This socket option can be used by in-kernel consumers (like NFS) to request a NIC to use optimized receive of large buffers for a connection. The current use case is to support DDP by the TOE on Chelsio NICs. Reviewed by: rscheff, tuexen, glebius Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D44000 (cherry picked from commit 3d0a736796a99fe70be9de97beec8f10970c6905) --- sys/netinet/tcp.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/netinet/tcp.h b/sys/netinet/tcp.h index bfb825930c66..56271203bc18 100644 --- a/sys/netinet/tcp.h +++ b/sys/netinet/tcp.h @@ -187,6 +187,9 @@ struct tcphdr { #define TCP_RXTLS_MODE 42 /* Receive TLS mode */ #define TCP_IWND_NB 43 /* Override initial window (units: bytes) */ #define TCP_IWND_NSEG 44 /* Override initial window (units: MSS segs) */ +#ifdef _KERNEL +#define TCP_USE_DDP 45 /* Use direct data placement for so_rcvbuf */ +#endif #define TCP_LOGID_CNT 46 /* get number of connections with the same ID */ #define TCP_LOG_TAG 47 /* configure tag for grouping logs */ #define TCP_USER_LOG 48 /* userspace log event */ From nobody Fri Apr 12 21:31:29 2024 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 4VGVB91sTxz5G9P8; Fri, 12 Apr 2024 21:31: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 4VGVB91Wyvz4jkK; Fri, 12 Apr 2024 21:31:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712957489; 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=v+zdwn/YbpsUyIE5JvYpAoYJKSDik0bkWX8RfkJgTFY=; b=JnZrYcPHsE2572GiF/d1f2Yqm1jGMP/uqVsNPwPiSkUR9BtJjxOhtWEY9Ve4H6mnBli6KT ZZOn+lWyclK+usY7VmtAzlLKY9NndKRk2m3SfGiu1KCxeoqLw7smSkYqsTx/S7zSwoaUpx 68LKEVPhpvx/BLcrLygG4+d4MZcnTV6tM0Lj0zdaIQMibcNFpyPAmvzBnw9ZurB9UpK1VJ ihqmr6j2VMLnWTtoCREUU/pWeJHlXNfqI8m6VjgB8mHIrnl3J2ZxAf+oAFbG2xTpaiMmzc M7RQP01xsxojAQxVoC9Ye0hr/ggrsA2GMWOBevEixQe8zNV9BFZL4MaPDudaig== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712957489; a=rsa-sha256; cv=none; b=hQU19B9SZRNVCGAa636Ig4ww0c1ue1eWrxjVwwLojXzWaNqYHKXzxMfMG30s/uGwFDp2eh 9uIyXgTD/rghYZAXRzRCLt3fevUjQETXAR3somEDGv6hIZ/C3j1g6+Nup240Pt2m9rai4V DijNn5j3IIoCW/D9FGKE/G79MLqzWxP4j/ZuBFXNq+6rIcw+Y+HwHoO2NEED8pvW+iBqrY 0BRhkg/okii8+IvV41Hj3hlm9G9EQn4g1eHA/LDm49mKyAryQoDi8wjPb5d/yYka7wrhBo Gw4hkI9CwUVFY+6iZhGHSdrFJdCse2Yx+inOyqCBz/jvAgvq58JhDsRH8jUwpw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712957489; 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=v+zdwn/YbpsUyIE5JvYpAoYJKSDik0bkWX8RfkJgTFY=; b=jQDQCK+uPp8E/CpE7Pfh3YHo0/bTU6YpgvYuNA9jK+7vXfne+NozVufI9m8iE6JsKQQBND 916liMZYx+pwv9yyVP0SnhOtEpkZDmeh951p7TM7lQG0btNkIKAJGw0iCuMEdOmigwYnEL 8GNK/wJK/4RH4B99T4X/f/XB9Ce1IuhYFTJh6IXv8t6WISaGwidovNvXOelmWDP41T5sGn s/9baVykuBcZZ6P7PtbHZH82pKQjilEMQ21wGFNdxU7BKwbssqjfjJTCoIAU2yX4cY5Y7L M95Oo3We4mmGw4DyBhbDjTA4H5TXCuQ88OxaL11YTOEG5YCO61IoZr+gr4PjQA== 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 4VGVB9181fz14mM; Fri, 12 Apr 2024 21:31:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43CLVTAF011779; Fri, 12 Apr 2024 21:31:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43CLVTp3011776; Fri, 12 Apr 2024 21:31:29 GMT (envelope-from git) Date: Fri, 12 Apr 2024 21:31:29 GMT Message-Id: <202404122131.43CLVTp3011776@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: bf5956c185a1 - stable/14 - cxgbe: Support TCP_USE_DDP on offloaded TOE connections 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: 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: bf5956c185a13d77ef4466e4dec846f5fbd9dd2e Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=bf5956c185a13d77ef4466e4dec846f5fbd9dd2e commit bf5956c185a13d77ef4466e4dec846f5fbd9dd2e Author: John Baldwin AuthorDate: 2024-03-20 22:29:28 +0000 Commit: John Baldwin CommitDate: 2024-04-12 19:25:17 +0000 cxgbe: Support TCP_USE_DDP on offloaded TOE connections When this socket option is enabled, relatively large contiguous buffers are allocated and used to receive data from the remote connection. When data is received a wrapper M_EXT mbuf is queued to the socket's receive buffer. This reduces the length of the linked list of received mbufs and allows consumers to consume receive data in larger chunks. To minimize reprogramming the page pods in the adapter, receive buffers for a given connection are recycled. When a buffer has been fully consumed by the receiver and freed, the buffer is placed on a per-connection free buffers list. The size of the receive buffers defaults to 256k and can be set via the hw.cxgbe.toe.ddp_rcvbuf_len sysctl. The hw.cxgbe.toe.ddp_rcvbuf_cache sysctl (defaults to 4) determines the maximum number of free buffers cached per connection. Note that this limit does not apply to "in-flight" receive buffers that are associated with mbufs in the socket's receive buffer. Co-authored-by: Navdeep Parhar Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D44001 (cherry picked from commit eba13bbc37ab4f45a8a3502d59c37d56d9a04ca5) --- sys/dev/cxgbe/adapter.h | 6 + sys/dev/cxgbe/t4_main.c | 13 + sys/dev/cxgbe/t4_sge.c | 18 + sys/dev/cxgbe/tom/t4_cpl_io.c | 7 +- sys/dev/cxgbe/tom/t4_ddp.c | 786 +++++++++++++++++++++++++++++++++++++++--- sys/dev/cxgbe/tom/t4_tom.c | 31 ++ sys/dev/cxgbe/tom/t4_tom.h | 51 ++- 7 files changed, 853 insertions(+), 59 deletions(-) diff --git a/sys/dev/cxgbe/adapter.h b/sys/dev/cxgbe/adapter.h index 3157d08cc67b..b9780809421f 100644 --- a/sys/dev/cxgbe/adapter.h +++ b/sys/dev/cxgbe/adapter.h @@ -690,6 +690,10 @@ struct sge_ofld_rxq { uint64_t rx_aio_ddp_octets; u_long rx_toe_tls_records; u_long rx_toe_tls_octets; + u_long rx_toe_ddp_octets; + counter_u64_t ddp_buffer_alloc; + counter_u64_t ddp_buffer_reuse; + counter_u64_t ddp_buffer_free; } __aligned(CACHE_LINE_SIZE); static inline struct sge_ofld_rxq * @@ -1344,6 +1348,8 @@ extern int t4_tmr_idx; extern int t4_pktc_idx; extern unsigned int t4_qsize_rxq; extern unsigned int t4_qsize_txq; +extern int t4_ddp_rcvbuf_len; +extern unsigned int t4_ddp_rcvbuf_cache; extern device_method_t cxgbe_methods[]; int t4_os_find_pci_capability(struct adapter *, int); diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index e20c697d2865..6cb434295b42 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -412,6 +412,15 @@ SYSCTL_INT(_hw_cxgbe_toe_rexmt_backoff, OID_AUTO, 14, CTLFLAG_RDTUN, &t4_toe_rexmt_backoff[14], 0, ""); SYSCTL_INT(_hw_cxgbe_toe_rexmt_backoff, OID_AUTO, 15, CTLFLAG_RDTUN, &t4_toe_rexmt_backoff[15], 0, ""); + +int t4_ddp_rcvbuf_len = 256 * 1024; +SYSCTL_INT(_hw_cxgbe_toe, OID_AUTO, ddp_rcvbuf_len, CTLFLAG_RWTUN, + &t4_ddp_rcvbuf_len, 0, "length of each DDP RX buffer"); + +unsigned int t4_ddp_rcvbuf_cache = 4; +SYSCTL_UINT(_hw_cxgbe_toe, OID_AUTO, ddp_rcvbuf_cache, CTLFLAG_RWTUN, + &t4_ddp_rcvbuf_cache, 0, + "maximum number of free DDP RX buffers to cache per connection"); #endif #ifdef DEV_NETMAP @@ -12046,6 +12055,10 @@ clear_stats(struct adapter *sc, u_int port_id) ofld_rxq->rx_aio_ddp_octets = 0; ofld_rxq->rx_toe_tls_records = 0; ofld_rxq->rx_toe_tls_octets = 0; + ofld_rxq->rx_toe_ddp_octets = 0; + counter_u64_zero(ofld_rxq->ddp_buffer_alloc); + counter_u64_zero(ofld_rxq->ddp_buffer_reuse); + counter_u64_zero(ofld_rxq->ddp_buffer_free); } #endif diff --git a/sys/dev/cxgbe/t4_sge.c b/sys/dev/cxgbe/t4_sge.c index 76293b06a6a9..2ef05b5a9f86 100644 --- a/sys/dev/cxgbe/t4_sge.c +++ b/sys/dev/cxgbe/t4_sge.c @@ -4098,6 +4098,9 @@ alloc_ofld_rxq(struct vi_info *vi, struct sge_ofld_rxq *ofld_rxq, int idx, ofld_rxq->rx_iscsi_ddp_setup_ok = counter_u64_alloc(M_WAITOK); ofld_rxq->rx_iscsi_ddp_setup_error = counter_u64_alloc(M_WAITOK); + ofld_rxq->ddp_buffer_alloc = counter_u64_alloc(M_WAITOK); + ofld_rxq->ddp_buffer_reuse = counter_u64_alloc(M_WAITOK); + ofld_rxq->ddp_buffer_free = counter_u64_alloc(M_WAITOK); add_ofld_rxq_sysctls(&vi->ctx, oid, ofld_rxq); } @@ -4132,6 +4135,9 @@ free_ofld_rxq(struct vi_info *vi, struct sge_ofld_rxq *ofld_rxq) MPASS(!(ofld_rxq->iq.flags & IQ_SW_ALLOCATED)); counter_u64_free(ofld_rxq->rx_iscsi_ddp_setup_ok); counter_u64_free(ofld_rxq->rx_iscsi_ddp_setup_error); + counter_u64_free(ofld_rxq->ddp_buffer_alloc); + counter_u64_free(ofld_rxq->ddp_buffer_reuse); + counter_u64_free(ofld_rxq->ddp_buffer_free); bzero(ofld_rxq, sizeof(*ofld_rxq)); } } @@ -4158,6 +4164,18 @@ add_ofld_rxq_sysctls(struct sysctl_ctx_list *ctx, struct sysctl_oid *oid, SYSCTL_ADD_ULONG(ctx, children, OID_AUTO, "rx_toe_tls_octets", CTLFLAG_RD, &ofld_rxq->rx_toe_tls_octets, "# of payload octets in received TOE TLS records"); + SYSCTL_ADD_ULONG(ctx, children, OID_AUTO, + "rx_toe_ddp_octets", CTLFLAG_RD, &ofld_rxq->rx_toe_ddp_octets, + "# of payload octets received via TCP DDP"); + SYSCTL_ADD_COUNTER_U64(ctx, children, OID_AUTO, + "ddp_buffer_alloc", CTLFLAG_RD, &ofld_rxq->ddp_buffer_alloc, + "# of DDP RCV buffers allocated"); + SYSCTL_ADD_COUNTER_U64(ctx, children, OID_AUTO, + "ddp_buffer_reuse", CTLFLAG_RD, &ofld_rxq->ddp_buffer_reuse, + "# of DDP RCV buffers reused"); + SYSCTL_ADD_COUNTER_U64(ctx, children, OID_AUTO, + "ddp_buffer_free", CTLFLAG_RD, &ofld_rxq->ddp_buffer_free, + "# of DDP RCV buffers freed"); oid = SYSCTL_ADD_NODE(ctx, children, OID_AUTO, "iscsi", CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "TOE iSCSI statistics"); diff --git a/sys/dev/cxgbe/tom/t4_cpl_io.c b/sys/dev/cxgbe/tom/t4_cpl_io.c index 4d61189f5fe3..842e72bf8b2b 100644 --- a/sys/dev/cxgbe/tom/t4_cpl_io.c +++ b/sys/dev/cxgbe/tom/t4_cpl_io.c @@ -1352,8 +1352,6 @@ do_peer_close(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) if (toep->flags & TPF_ABORT_SHUTDOWN) goto done; - so = inp->inp_socket; - socantrcvmore(so); if (ulp_mode(toep) == ULP_MODE_TCPDDP) { DDP_LOCK(toep); if (__predict_false(toep->ddp.flags & @@ -1361,6 +1359,8 @@ do_peer_close(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) handle_ddp_close(toep, tp, cpl->rcv_nxt); DDP_UNLOCK(toep); } + so = inp->inp_socket; + socantrcvmore(so); if (ulp_mode(toep) == ULP_MODE_RDMA || (ulp_mode(toep) == ULP_MODE_ISCSI && chip_id(sc) >= CHELSIO_T6)) { @@ -1782,7 +1782,8 @@ do_rx_data(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) sbappendstream_locked(sb, m, 0); t4_rcvd_locked(&toep->td->tod, tp); - if (ulp_mode(toep) == ULP_MODE_TCPDDP && toep->ddp.waiting_count > 0 && + if (ulp_mode(toep) == ULP_MODE_TCPDDP && + (toep->ddp.flags & DDP_AIO) != 0 && toep->ddp.waiting_count > 0 && sbavail(sb) != 0) { CTR2(KTR_CXGBE, "%s: tid %u queueing AIO task", __func__, tid); diff --git a/sys/dev/cxgbe/tom/t4_ddp.c b/sys/dev/cxgbe/tom/t4_ddp.c index 1cd1ea68826c..c1d4af45fd70 100644 --- a/sys/dev/cxgbe/tom/t4_ddp.c +++ b/sys/dev/cxgbe/tom/t4_ddp.c @@ -81,6 +81,10 @@ static void aio_ddp_requeue_task(void *context, int pending); static void ddp_complete_all(struct toepcb *toep, int error); static void t4_aio_cancel_active(struct kaiocb *job); static void t4_aio_cancel_queued(struct kaiocb *job); +static int t4_alloc_page_pods_for_rcvbuf(struct ppod_region *pr, + struct ddp_rcv_buffer *drb); +static int t4_write_page_pods_for_rcvbuf(struct adapter *sc, + struct sge_wrq *wrq, int tid, struct ddp_rcv_buffer *drb); static TAILQ_HEAD(, pageset) ddp_orphan_pagesets; static struct mtx ddp_orphan_pagesets_lock; @@ -89,15 +93,15 @@ static struct task ddp_orphan_task; #define MAX_DDP_BUFFER_SIZE (M_TCB_RX_DDP_BUF0_LEN) /* - * A page set holds information about a buffer used for DDP. The page - * set holds resources such as the VM pages backing the buffer (either - * held or wired) and the page pods associated with the buffer. - * Recently used page sets are cached to allow for efficient reuse of - * buffers (avoiding the need to re-fault in pages, hold them, etc.). - * Note that cached page sets keep the backing pages wired. The - * number of wired pages is capped by only allowing for two wired - * pagesets per connection. This is not a perfect cap, but is a - * trade-off for performance. + * A page set holds information about a user buffer used for AIO DDP. + * The page set holds resources such as the VM pages backing the + * buffer (either held or wired) and the page pods associated with the + * buffer. Recently used page sets are cached to allow for efficient + * reuse of buffers (avoiding the need to re-fault in pages, hold + * them, etc.). Note that cached page sets keep the backing pages + * wired. The number of wired pages is capped by only allowing for + * two wired pagesets per connection. This is not a perfect cap, but + * is a trade-off for performance. * * If an application ping-pongs two buffers for a connection via * aio_read(2) then those buffers should remain wired and expensive VM @@ -174,8 +178,99 @@ ddp_complete_one(struct kaiocb *job, int error) } static void -free_ddp_buffer(struct tom_data *td, struct ddp_buffer *db) +free_ddp_rcv_buffer(struct toepcb *toep, struct ddp_rcv_buffer *drb) { + t4_free_page_pods(&drb->prsv); + contigfree(drb->buf, drb->len, M_CXGBE); + free(drb, M_CXGBE); + counter_u64_add(toep->ofld_rxq->ddp_buffer_free, 1); + free_toepcb(toep); +} + +static void +recycle_ddp_rcv_buffer(struct toepcb *toep, struct ddp_rcv_buffer *drb) +{ + DDP_CACHE_LOCK(toep); + if (!(toep->ddp.flags & DDP_DEAD) && + toep->ddp.cached_count < t4_ddp_rcvbuf_cache) { + TAILQ_INSERT_HEAD(&toep->ddp.cached_buffers, drb, link); + toep->ddp.cached_count++; + DDP_CACHE_UNLOCK(toep); + } else { + DDP_CACHE_UNLOCK(toep); + free_ddp_rcv_buffer(toep, drb); + } +} + +static struct ddp_rcv_buffer * +alloc_cached_ddp_rcv_buffer(struct toepcb *toep) +{ + struct ddp_rcv_buffer *drb; + + DDP_CACHE_LOCK(toep); + if (!TAILQ_EMPTY(&toep->ddp.cached_buffers)) { + drb = TAILQ_FIRST(&toep->ddp.cached_buffers); + TAILQ_REMOVE(&toep->ddp.cached_buffers, drb, link); + toep->ddp.cached_count--; + counter_u64_add(toep->ofld_rxq->ddp_buffer_reuse, 1); + } else + drb = NULL; + DDP_CACHE_UNLOCK(toep); + return (drb); +} + +static struct ddp_rcv_buffer * +alloc_ddp_rcv_buffer(struct toepcb *toep, int how) +{ + struct tom_data *td = toep->td; + struct adapter *sc = td_adapter(td); + struct ddp_rcv_buffer *drb; + int error; + + drb = malloc(sizeof(*drb), M_CXGBE, how | M_ZERO); + if (drb == NULL) + return (NULL); + + drb->buf = contigmalloc(t4_ddp_rcvbuf_len, M_CXGBE, how, 0, ~0, + t4_ddp_rcvbuf_len, 0); + if (drb->buf == NULL) { + free(drb, M_CXGBE); + return (NULL); + } + drb->len = t4_ddp_rcvbuf_len; + drb->refs = 1; + + error = t4_alloc_page_pods_for_rcvbuf(&td->pr, drb); + if (error != 0) { + contigfree(drb->buf, drb->len, M_CXGBE); + free(drb, M_CXGBE); + return (NULL); + } + + error = t4_write_page_pods_for_rcvbuf(sc, toep->ctrlq, toep->tid, drb); + if (error != 0) { + t4_free_page_pods(&drb->prsv); + contigfree(drb->buf, drb->len, M_CXGBE); + free(drb, M_CXGBE); + return (NULL); + } + + hold_toepcb(toep); + counter_u64_add(toep->ofld_rxq->ddp_buffer_alloc, 1); + return (drb); +} + +static void +free_ddp_buffer(struct toepcb *toep, struct ddp_buffer *db) +{ + if ((toep->ddp.flags & DDP_RCVBUF) != 0) { + if (db->drb != NULL) + free_ddp_rcv_buffer(toep, db->drb); +#ifdef INVARIANTS + db->drb = NULL; +#endif + return; + } if (db->job) { /* @@ -192,7 +287,7 @@ free_ddp_buffer(struct tom_data *td, struct ddp_buffer *db) } if (db->ps) { - free_pageset(td, db->ps); + free_pageset(toep->td, db->ps); #ifdef INVARIANTS db->ps = NULL; #endif @@ -203,11 +298,10 @@ static void ddp_init_toep(struct toepcb *toep) { - TAILQ_INIT(&toep->ddp.aiojobq); - TASK_INIT(&toep->ddp.requeue_task, 0, aio_ddp_requeue_task, toep); toep->ddp.flags = DDP_OK; toep->ddp.active_id = -1; mtx_init(&toep->ddp.lock, "t4 ddp", NULL, MTX_DEF); + mtx_init(&toep->ddp.cache_lock, "t4 ddp cache", NULL, MTX_DEF); } void @@ -215,24 +309,38 @@ ddp_uninit_toep(struct toepcb *toep) { mtx_destroy(&toep->ddp.lock); + mtx_destroy(&toep->ddp.cache_lock); } void release_ddp_resources(struct toepcb *toep) { + struct ddp_rcv_buffer *drb; struct pageset *ps; int i; DDP_LOCK(toep); + DDP_CACHE_LOCK(toep); toep->ddp.flags |= DDP_DEAD; + DDP_CACHE_UNLOCK(toep); for (i = 0; i < nitems(toep->ddp.db); i++) { - free_ddp_buffer(toep->td, &toep->ddp.db[i]); + free_ddp_buffer(toep, &toep->ddp.db[i]); } - while ((ps = TAILQ_FIRST(&toep->ddp.cached_pagesets)) != NULL) { - TAILQ_REMOVE(&toep->ddp.cached_pagesets, ps, link); - free_pageset(toep->td, ps); + if ((toep->ddp.flags & DDP_AIO) != 0) { + while ((ps = TAILQ_FIRST(&toep->ddp.cached_pagesets)) != NULL) { + TAILQ_REMOVE(&toep->ddp.cached_pagesets, ps, link); + free_pageset(toep->td, ps); + } + ddp_complete_all(toep, 0); + } + if ((toep->ddp.flags & DDP_RCVBUF) != 0) { + DDP_CACHE_LOCK(toep); + while ((drb = TAILQ_FIRST(&toep->ddp.cached_buffers)) != NULL) { + TAILQ_REMOVE(&toep->ddp.cached_buffers, drb, link); + free_ddp_rcv_buffer(toep, drb); + } + DDP_CACHE_UNLOCK(toep); } - ddp_complete_all(toep, 0); DDP_UNLOCK(toep); } @@ -242,13 +350,20 @@ ddp_assert_empty(struct toepcb *toep) { int i; - MPASS(!(toep->ddp.flags & DDP_TASK_ACTIVE)); + MPASS((toep->ddp.flags & (DDP_TASK_ACTIVE | DDP_DEAD)) != DDP_TASK_ACTIVE); for (i = 0; i < nitems(toep->ddp.db); i++) { - MPASS(toep->ddp.db[i].job == NULL); - MPASS(toep->ddp.db[i].ps == NULL); + if ((toep->ddp.flags & DDP_AIO) != 0) { + MPASS(toep->ddp.db[i].job == NULL); + MPASS(toep->ddp.db[i].ps == NULL); + } else + MPASS(toep->ddp.db[i].drb == NULL); + } + if ((toep->ddp.flags & DDP_AIO) != 0) { + MPASS(TAILQ_EMPTY(&toep->ddp.cached_pagesets)); + MPASS(TAILQ_EMPTY(&toep->ddp.aiojobq)); } - MPASS(TAILQ_EMPTY(&toep->ddp.cached_pagesets)); - MPASS(TAILQ_EMPTY(&toep->ddp.aiojobq)); + if ((toep->ddp.flags & DDP_RCVBUF) != 0) + MPASS(TAILQ_EMPTY(&toep->ddp.cached_buffers)); } #endif @@ -256,13 +371,18 @@ static void complete_ddp_buffer(struct toepcb *toep, struct ddp_buffer *db, unsigned int db_idx) { + struct ddp_rcv_buffer *drb; unsigned int db_flag; toep->ddp.active_count--; if (toep->ddp.active_id == db_idx) { if (toep->ddp.active_count == 0) { - KASSERT(toep->ddp.db[db_idx ^ 1].job == NULL, - ("%s: active_count mismatch", __func__)); + if ((toep->ddp.flags & DDP_AIO) != 0) + KASSERT(toep->ddp.db[db_idx ^ 1].job == NULL, + ("%s: active_count mismatch", __func__)); + else + KASSERT(toep->ddp.db[db_idx ^ 1].drb == NULL, + ("%s: active_count mismatch", __func__)); toep->ddp.active_id = -1; } else toep->ddp.active_id ^= 1; @@ -276,10 +396,18 @@ complete_ddp_buffer(struct toepcb *toep, struct ddp_buffer *db, ("%s: active count mismatch", __func__)); } - db->cancel_pending = 0; - db->job = NULL; - recycle_pageset(toep, db->ps); - db->ps = NULL; + if ((toep->ddp.flags & DDP_AIO) != 0) { + db->cancel_pending = 0; + db->job = NULL; + recycle_pageset(toep, db->ps); + db->ps = NULL; + } else { + drb = db->drb; + if (atomic_fetchadd_int(&drb->refs, -1) == 1) + recycle_ddp_rcv_buffer(toep, drb); + db->drb = NULL; + db->placed = 0; + } db_flag = db_idx == 1 ? DDP_BUF1_ACTIVE : DDP_BUF0_ACTIVE; KASSERT(toep->ddp.flags & db_flag, @@ -288,6 +416,47 @@ complete_ddp_buffer(struct toepcb *toep, struct ddp_buffer *db, toep->ddp.flags &= ~db_flag; } +/* Called when m_free drops the last reference. */ +static void +ddp_rcv_mbuf_done(struct mbuf *m) +{ + struct toepcb *toep = m->m_ext.ext_arg1; + struct ddp_rcv_buffer *drb = m->m_ext.ext_arg2; + + recycle_ddp_rcv_buffer(toep, drb); +} + +static void +queue_ddp_rcvbuf_mbuf(struct toepcb *toep, u_int db_idx, u_int len) +{ + struct inpcb *inp = toep->inp; + struct sockbuf *sb; + struct ddp_buffer *db; + struct ddp_rcv_buffer *drb; + struct mbuf *m; + + m = m_gethdr(M_NOWAIT, MT_DATA); + if (m == NULL) { + printf("%s: failed to allocate mbuf", __func__); + return; + } + m->m_pkthdr.rcvif = toep->vi->ifp; + + db = &toep->ddp.db[db_idx]; + drb = db->drb; + m_extaddref(m, (char *)drb->buf + db->placed, len, &drb->refs, + ddp_rcv_mbuf_done, toep, drb); + m->m_pkthdr.len = len; + m->m_len = len; + + sb = &inp->inp_socket->so_rcv; + SOCKBUF_LOCK_ASSERT(sb); + sbappendstream_locked(sb, m, 0); + + db->placed += len; + toep->ofld_rxq->rx_toe_ddp_octets += len; +} + /* XXX: handle_ddp_data code duplication */ void insert_ddp_data(struct toepcb *toep, uint32_t n) @@ -302,10 +471,12 @@ insert_ddp_data(struct toepcb *toep, uint32_t n) #ifdef INVARIANTS unsigned int db_flag; #endif + bool ddp_rcvbuf; INP_WLOCK_ASSERT(inp); DDP_ASSERT_LOCKED(toep); + ddp_rcvbuf = (toep->ddp.flags & DDP_RCVBUF) != 0; tp->rcv_nxt += n; #ifndef USE_DDP_RX_FLOW_CONTROL KASSERT(tp->rcv_wnd >= n, ("%s: negative window size", __func__)); @@ -321,6 +492,16 @@ insert_ddp_data(struct toepcb *toep, uint32_t n) #endif MPASS((toep->ddp.flags & db_flag) != 0); db = &toep->ddp.db[db_idx]; + if (ddp_rcvbuf) { + placed = n; + if (placed > db->drb->len - db->placed) + placed = db->drb->len - db->placed; + if (placed != 0) + queue_ddp_rcvbuf_mbuf(toep, db_idx, placed); + complete_ddp_buffer(toep, db, db_idx); + n -= placed; + continue; + } job = db->job; copied = job->aio_received; placed = n; @@ -423,12 +604,13 @@ mk_rx_data_ack_ulp(struct ulp_txpkt *ulpmc, struct toepcb *toep) static struct wrqe * mk_update_tcb_for_ddp(struct adapter *sc, struct toepcb *toep, int db_idx, - struct pageset *ps, int offset, uint64_t ddp_flags, uint64_t ddp_flags_mask) + struct ppod_reservation *prsv, int offset, uint32_t len, + uint64_t ddp_flags, uint64_t ddp_flags_mask) { struct wrqe *wr; struct work_request_hdr *wrh; struct ulp_txpkt *ulpmc; - int len; + int wrlen; KASSERT(db_idx == 0 || db_idx == 1, ("%s: bad DDP buffer index %d", __func__, db_idx)); @@ -441,21 +623,21 @@ mk_update_tcb_for_ddp(struct adapter *sc, struct toepcb *toep, int db_idx, * The ULPTX master commands that follow must all end at 16B boundaries * too so we round up the size to 16. */ - len = sizeof(*wrh) + 3 * roundup2(LEN__SET_TCB_FIELD_ULP, 16) + + wrlen = sizeof(*wrh) + 3 * roundup2(LEN__SET_TCB_FIELD_ULP, 16) + roundup2(LEN__RX_DATA_ACK_ULP, 16); - wr = alloc_wrqe(len, toep->ctrlq); + wr = alloc_wrqe(wrlen, toep->ctrlq); if (wr == NULL) return (NULL); wrh = wrtod(wr); - INIT_ULPTX_WRH(wrh, len, 1, 0); /* atomic */ + INIT_ULPTX_WRH(wrh, wrlen, 1, 0); /* atomic */ ulpmc = (struct ulp_txpkt *)(wrh + 1); /* Write the buffer's tag */ ulpmc = mk_set_tcb_field_ulp(ulpmc, toep, W_TCB_RX_DDP_BUF0_TAG + db_idx, V_TCB_RX_DDP_BUF0_TAG(M_TCB_RX_DDP_BUF0_TAG), - V_TCB_RX_DDP_BUF0_TAG(ps->prsv.prsv_tag)); + V_TCB_RX_DDP_BUF0_TAG(prsv->prsv_tag)); /* Update the current offset in the DDP buffer and its total length */ if (db_idx == 0) @@ -464,14 +646,14 @@ mk_update_tcb_for_ddp(struct adapter *sc, struct toepcb *toep, int db_idx, V_TCB_RX_DDP_BUF0_OFFSET(M_TCB_RX_DDP_BUF0_OFFSET) | V_TCB_RX_DDP_BUF0_LEN(M_TCB_RX_DDP_BUF0_LEN), V_TCB_RX_DDP_BUF0_OFFSET(offset) | - V_TCB_RX_DDP_BUF0_LEN(ps->len)); + V_TCB_RX_DDP_BUF0_LEN(len)); else ulpmc = mk_set_tcb_field_ulp(ulpmc, toep, W_TCB_RX_DDP_BUF1_OFFSET, V_TCB_RX_DDP_BUF1_OFFSET(M_TCB_RX_DDP_BUF1_OFFSET) | V_TCB_RX_DDP_BUF1_LEN((u64)M_TCB_RX_DDP_BUF1_LEN << 32), V_TCB_RX_DDP_BUF1_OFFSET(offset) | - V_TCB_RX_DDP_BUF1_LEN((u64)ps->len << 32)); + V_TCB_RX_DDP_BUF1_LEN((u64)len << 32)); /* Update DDP flags */ ulpmc = mk_set_tcb_field_ulp(ulpmc, toep, W_TCB_RX_DDP_FLAGS, @@ -484,7 +666,8 @@ mk_update_tcb_for_ddp(struct adapter *sc, struct toepcb *toep, int db_idx, } static int -handle_ddp_data(struct toepcb *toep, __be32 ddp_report, __be32 rcv_nxt, int len) +handle_ddp_data_aio(struct toepcb *toep, __be32 ddp_report, __be32 rcv_nxt, + int len) { uint32_t report = be32toh(ddp_report); unsigned int db_idx; @@ -607,11 +790,239 @@ out: return (0); } +static bool +queue_ddp_rcvbuf(struct toepcb *toep, struct ddp_rcv_buffer *drb) +{ + struct adapter *sc = td_adapter(toep->td); + struct ddp_buffer *db; + struct wrqe *wr; + uint64_t ddp_flags, ddp_flags_mask; + int buf_flag, db_idx; + + DDP_ASSERT_LOCKED(toep); + + KASSERT((toep->ddp.flags & DDP_DEAD) == 0, ("%s: DDP_DEAD", __func__)); + KASSERT(toep->ddp.active_count < nitems(toep->ddp.db), + ("%s: no empty DDP buffer slot", __func__)); + + /* Determine which DDP buffer to use. */ + if (toep->ddp.db[0].drb == NULL) { + db_idx = 0; + } else { + MPASS(toep->ddp.db[1].drb == NULL); + db_idx = 1; + } + + /* + * Permit PSH to trigger a partial completion without + * invalidating the rest of the buffer, but disable the PUSH + * timer. + */ + ddp_flags = 0; + ddp_flags_mask = 0; + if (db_idx == 0) { + ddp_flags |= V_TF_DDP_PSH_NO_INVALIDATE0(1) | + V_TF_DDP_PUSH_DISABLE_0(0) | V_TF_DDP_PSHF_ENABLE_0(1) | + V_TF_DDP_BUF0_VALID(1); + ddp_flags_mask |= V_TF_DDP_PSH_NO_INVALIDATE0(1) | + V_TF_DDP_PUSH_DISABLE_0(1) | V_TF_DDP_PSHF_ENABLE_0(1) | + V_TF_DDP_BUF0_FLUSH(1) | V_TF_DDP_BUF0_VALID(1); + buf_flag = DDP_BUF0_ACTIVE; + } else { + ddp_flags |= V_TF_DDP_PSH_NO_INVALIDATE1(1) | + V_TF_DDP_PUSH_DISABLE_1(0) | V_TF_DDP_PSHF_ENABLE_1(1) | + V_TF_DDP_BUF1_VALID(1); + ddp_flags_mask |= V_TF_DDP_PSH_NO_INVALIDATE1(1) | + V_TF_DDP_PUSH_DISABLE_1(1) | V_TF_DDP_PSHF_ENABLE_1(1) | + V_TF_DDP_BUF1_FLUSH(1) | V_TF_DDP_BUF1_VALID(1); + buf_flag = DDP_BUF1_ACTIVE; + } + MPASS((toep->ddp.flags & buf_flag) == 0); + if ((toep->ddp.flags & (DDP_BUF0_ACTIVE | DDP_BUF1_ACTIVE)) == 0) { + MPASS(db_idx == 0); + MPASS(toep->ddp.active_id == -1); + MPASS(toep->ddp.active_count == 0); + ddp_flags_mask |= V_TF_DDP_ACTIVE_BUF(1); + } + + /* + * The TID for this connection should still be valid. If + * DDP_DEAD is set, SBS_CANTRCVMORE should be set, so we + * shouldn't be this far anyway. + */ + wr = mk_update_tcb_for_ddp(sc, toep, db_idx, &drb->prsv, 0, drb->len, + ddp_flags, ddp_flags_mask); + if (wr == NULL) { + recycle_ddp_rcv_buffer(toep, drb); + printf("%s: mk_update_tcb_for_ddp failed\n", __func__); + return (false); + } + +#ifdef VERBOSE_TRACES + CTR(KTR_CXGBE, + "%s: tid %u, scheduling DDP[%d] (flags %#lx/%#lx)", __func__, + toep->tid, db_idx, ddp_flags, ddp_flags_mask); +#endif + /* + * Hold a reference on scheduled buffers that is dropped in + * complete_ddp_buffer. + */ + drb->refs = 1; + + /* Give the chip the go-ahead. */ + t4_wrq_tx(sc, wr); + db = &toep->ddp.db[db_idx]; + db->drb = drb; + toep->ddp.flags |= buf_flag; + toep->ddp.active_count++; + if (toep->ddp.active_count == 1) { + MPASS(toep->ddp.active_id == -1); + toep->ddp.active_id = db_idx; + CTR2(KTR_CXGBE, "%s: ddp_active_id = %d", __func__, + toep->ddp.active_id); + } + return (true); +} + +static int +handle_ddp_data_rcvbuf(struct toepcb *toep, __be32 ddp_report, __be32 rcv_nxt, + int len) +{ + uint32_t report = be32toh(ddp_report); + struct inpcb *inp = toep->inp; + struct tcpcb *tp; + struct socket *so; + struct sockbuf *sb; + struct ddp_buffer *db; + struct ddp_rcv_buffer *drb; + unsigned int db_idx; + bool invalidated; + + db_idx = report & F_DDP_BUF_IDX ? 1 : 0; + + invalidated = (report & F_DDP_INV) != 0; + + INP_WLOCK(inp); + so = inp_inpcbtosocket(inp); + sb = &so->so_rcv; + DDP_LOCK(toep); + + KASSERT(toep->ddp.active_id == db_idx, + ("completed DDP buffer (%d) != active_id (%d) for tid %d", db_idx, + toep->ddp.active_id, toep->tid)); + db = &toep->ddp.db[db_idx]; + + if (__predict_false(inp->inp_flags & INP_DROPPED)) { + /* + * This can happen due to an administrative tcpdrop(8). + * Just ignore the received data. + */ + CTR5(KTR_CXGBE, "%s: tid %u, seq 0x%x, len %d, inp_flags 0x%x", + __func__, toep->tid, be32toh(rcv_nxt), len, inp->inp_flags); + if (invalidated) + complete_ddp_buffer(toep, db, db_idx); + goto out; + } + + tp = intotcpcb(inp); + + /* + * For RX_DDP_COMPLETE, len will be zero and rcv_nxt is the + * sequence number of the next byte to receive. The length of + * the data received for this message must be computed by + * comparing the new and old values of rcv_nxt. + * + * For RX_DATA_DDP, len might be non-zero, but it is only the + * length of the most recent DMA. It does not include the + * total length of the data received since the previous update + * for this DDP buffer. rcv_nxt is the sequence number of the + * first received byte from the most recent DMA. + */ + len += be32toh(rcv_nxt) - tp->rcv_nxt; + tp->rcv_nxt += len; + tp->t_rcvtime = ticks; +#ifndef USE_DDP_RX_FLOW_CONTROL + KASSERT(tp->rcv_wnd >= len, ("%s: negative window size", __func__)); + tp->rcv_wnd -= len; +#endif +#ifdef VERBOSE_TRACES + CTR5(KTR_CXGBE, "%s: tid %u, DDP[%d] placed %d bytes (%#x)", __func__, + toep->tid, db_idx, len, report); +#endif + + /* receive buffer autosize */ + MPASS(toep->vnet == so->so_vnet); + CURVNET_SET(toep->vnet); + SOCKBUF_LOCK(sb); + if (sb->sb_flags & SB_AUTOSIZE && + V_tcp_do_autorcvbuf && + sb->sb_hiwat < V_tcp_autorcvbuf_max && + len > (sbspace(sb) / 8 * 7)) { + struct adapter *sc = td_adapter(toep->td); + unsigned int hiwat = sb->sb_hiwat; + unsigned int newsize = min(hiwat + sc->tt.autorcvbuf_inc, + V_tcp_autorcvbuf_max); + + if (!sbreserve_locked(so, SO_RCV, newsize, NULL)) + sb->sb_flags &= ~SB_AUTOSIZE; + } + + if (len > 0) { + queue_ddp_rcvbuf_mbuf(toep, db_idx, len); + t4_rcvd_locked(&toep->td->tod, tp); + } + sorwakeup_locked(so); + SOCKBUF_UNLOCK_ASSERT(sb); + CURVNET_RESTORE(); + + if (invalidated) + complete_ddp_buffer(toep, db, db_idx); + else + KASSERT(db->placed < db->drb->len, + ("%s: full DDP buffer not invalidated", __func__)); + + if (toep->ddp.active_count != nitems(toep->ddp.db)) { + drb = alloc_cached_ddp_rcv_buffer(toep); + if (drb == NULL) + drb = alloc_ddp_rcv_buffer(toep, M_NOWAIT); + if (drb == NULL) + ddp_queue_toep(toep); + else { + if (!queue_ddp_rcvbuf(toep, drb)) { + ddp_queue_toep(toep); + } + } + } +out: + DDP_UNLOCK(toep); + INP_WUNLOCK(inp); + + return (0); +} + +static int +handle_ddp_data(struct toepcb *toep, __be32 ddp_report, __be32 rcv_nxt, int len) +{ + if ((toep->ddp.flags & DDP_RCVBUF) != 0) + return (handle_ddp_data_rcvbuf(toep, ddp_report, rcv_nxt, len)); + else + return (handle_ddp_data_aio(toep, ddp_report, rcv_nxt, len)); +} + void handle_ddp_indicate(struct toepcb *toep) { DDP_ASSERT_LOCKED(toep); + if ((toep->ddp.flags & DDP_RCVBUF) != 0) { + /* + * Indicates are not meaningful for RCVBUF since + * buffers are activated when the socket option is + * set. + */ + return; + } + MPASS(toep->ddp.active_count == 0); MPASS((toep->ddp.flags & (DDP_BUF0_ACTIVE | DDP_BUF1_ACTIVE)) == 0); if (toep->ddp.waiting_count == 0) { @@ -654,6 +1065,8 @@ do_ddp_tcb_rpl(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) /* * XXX: This duplicates a lot of code with handle_ddp_data(). */ + KASSERT((toep->ddp.flags & DDP_AIO) != 0, + ("%s: DDP_RCVBUF", __func__)); db_idx = G_COOKIE(cpl->cookie) - CPL_COOKIE_DDP0; MPASS(db_idx < nitems(toep->ddp.db)); INP_WLOCK(inp); @@ -707,6 +1120,8 @@ do_ddp_tcb_rpl(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) void handle_ddp_close(struct toepcb *toep, struct tcpcb *tp, __be32 rcv_nxt) { + struct socket *so = toep->inp->inp_socket; + struct sockbuf *sb = &so->so_rcv; struct ddp_buffer *db; struct kaiocb *job; long copied; @@ -715,14 +1130,19 @@ handle_ddp_close(struct toepcb *toep, struct tcpcb *tp, __be32 rcv_nxt) unsigned int db_flag; #endif int len, placed; + bool ddp_rcvbuf; INP_WLOCK_ASSERT(toep->inp); DDP_ASSERT_LOCKED(toep); + ddp_rcvbuf = (toep->ddp.flags & DDP_RCVBUF) != 0; + /* - 1 is to ignore the byte for FIN */ len = be32toh(rcv_nxt) - tp->rcv_nxt - 1; tp->rcv_nxt += len; + CTR(KTR_CXGBE, "%s: tid %d placed %u bytes before FIN", __func__, + toep->tid, len); while (toep->ddp.active_count > 0) { MPASS(toep->ddp.active_id != -1); db_idx = toep->ddp.active_id; @@ -731,6 +1151,20 @@ handle_ddp_close(struct toepcb *toep, struct tcpcb *tp, __be32 rcv_nxt) #endif MPASS((toep->ddp.flags & db_flag) != 0); db = &toep->ddp.db[db_idx]; + if (ddp_rcvbuf) { + placed = len; + if (placed > db->drb->len - db->placed) + placed = db->drb->len - db->placed; + if (placed != 0) { + SOCKBUF_LOCK(sb); + queue_ddp_rcvbuf_mbuf(toep, db_idx, placed); + sorwakeup_locked(so); + SOCKBUF_UNLOCK_ASSERT(sb); + } + complete_ddp_buffer(toep, db, db_idx); + len -= placed; + continue; + } job = db->job; copied = job->aio_received; placed = len; @@ -758,7 +1192,8 @@ handle_ddp_close(struct toepcb *toep, struct tcpcb *tp, __be32 rcv_nxt) } MPASS(len == 0); - ddp_complete_all(toep, 0); + if ((toep->ddp.flags & DDP_AIO) != 0) + ddp_complete_all(toep, 0); } #define DDP_ERR (F_DDP_PPOD_MISMATCH | F_DDP_LLIMIT_ERR | F_DDP_ULIMIT_ERR |\ @@ -892,6 +1327,7 @@ set_ddp_ulp_mode(struct toepcb *toep) static void enable_ddp(struct adapter *sc, struct toepcb *toep) { + uint64_t ddp_flags; KASSERT((toep->ddp.flags & (DDP_ON | DDP_OK | DDP_SC_REQ)) == DDP_OK, ("%s: toep %p has bad ddp_flags 0x%x", @@ -900,13 +1336,16 @@ enable_ddp(struct adapter *sc, struct toepcb *toep) CTR3(KTR_CXGBE, "%s: tid %u (time %u)", __func__, toep->tid, time_uptime); + ddp_flags = 0; + if ((toep->ddp.flags & DDP_AIO) != 0) + ddp_flags |= V_TF_DDP_BUF0_INDICATE(1) | + V_TF_DDP_BUF1_INDICATE(1); DDP_ASSERT_LOCKED(toep); toep->ddp.flags |= DDP_SC_REQ; t4_set_tcb_field(sc, toep->ctrlq, toep, W_TCB_RX_DDP_FLAGS, V_TF_DDP_OFF(1) | V_TF_DDP_INDICATE_OUT(1) | V_TF_DDP_BUF0_INDICATE(1) | V_TF_DDP_BUF1_INDICATE(1) | - V_TF_DDP_BUF0_VALID(1) | V_TF_DDP_BUF1_VALID(1), - V_TF_DDP_BUF0_INDICATE(1) | V_TF_DDP_BUF1_INDICATE(1), 0, 0); + V_TF_DDP_BUF0_VALID(1) | V_TF_DDP_BUF1_VALID(1), ddp_flags, 0, 0); t4_set_tcb_field(sc, toep->ctrlq, toep, W_TCB_T_FLAGS, V_TF_RCV_COALESCE_ENABLE(1), 0, 0, 0); } @@ -1103,6 +1542,19 @@ have_pgsz: return (0); } +static int +t4_alloc_page_pods_for_rcvbuf(struct ppod_region *pr, + struct ddp_rcv_buffer *drb) +{ + struct ppod_reservation *prsv = &drb->prsv; + + KASSERT(prsv->prsv_nppods == 0, + ("%s: page pods already allocated", __func__)); + + return (t4_alloc_page_pods_for_buf(pr, (vm_offset_t)drb->buf, drb->len, + prsv)); +} + int t4_alloc_page_pods_for_sgl(struct ppod_region *pr, struct ctl_sg_entry *sgl, int entries, struct ppod_reservation *prsv) @@ -1223,7 +1675,6 @@ t4_write_page_pods_for_ps(struct adapter *sc, struct sge_wrq *wrq, int tid, ddp_pgsz = 1 << pr->pr_page_shift[G_PPOD_PGSZ(prsv->prsv_tag)]; ppod_addr = pr->pr_start + (prsv->prsv_tag & pr->pr_tag_mask); for (i = 0; i < prsv->prsv_nppods; ppod_addr += chunk) { - /* How many page pods are we writing in this cycle */ n = min(prsv->prsv_nppods - i, NUM_ULP_TX_SC_IMM_PPODS); chunk = PPOD_SZ(n); @@ -1276,6 +1727,96 @@ t4_write_page_pods_for_ps(struct adapter *sc, struct sge_wrq *wrq, int tid, return (0); } +static int +t4_write_page_pods_for_rcvbuf(struct adapter *sc, struct sge_wrq *wrq, int tid, + struct ddp_rcv_buffer *drb) +{ + struct wrqe *wr; + struct ulp_mem_io *ulpmc; + struct ulptx_idata *ulpsc; + struct pagepod *ppod; + int i, j, k, n, chunk, len, ddp_pgsz; + u_int ppod_addr, offset; + uint32_t cmd; + struct ppod_reservation *prsv = &drb->prsv; + struct ppod_region *pr = prsv->prsv_pr; + uintptr_t end_pva, pva; + vm_paddr_t pa; + + MPASS(prsv->prsv_nppods > 0); + *** 425 LINES SKIPPED *** From nobody Fri Apr 12 21:31:30 2024 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 4VGVBB4M6lz5G9PB; Fri, 12 Apr 2024 21:31: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 4VGVBB2blkz4jkX; Fri, 12 Apr 2024 21:31:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712957490; 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=p37EE+Zb98vUxQxmZDxcPyPiKwo1Buw4bLqWIlPimkc=; b=q49FkNySL/URGnGqk8JlX/HzOElkDXxfy+MGFC+w+fZO1tnyLP5OcPO1hPMSBsbsu6Srqf WsWeX+3hhh9oE6ljkkRdjeXuSF5KqwBQPWs8JOfJfANnDDjTEi8RTbCk0KqZPW2rbDDUG8 GeE7ExDaxpJgVAaBN12FgZaf/v2yVA2UtyUlCN/lAmtprSVMrX1h2Ai3/3roYMM33Davdp nmlBo4Eko7yfXJGI96LM+4/LtFlYjxIWUjIG40ckw7FqN5Fq/hnf6/MxkI3/vH42KcQca2 m4VEaICIfeN+zeTV8sS8Ia+3VPQHzfl1s2dI07QoqjAnvtJEPmGp6h63xzqlSQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712957490; a=rsa-sha256; cv=none; b=oV82pxOHv+/VpPDdIdKlej+IBaGcKpdnMpkXAqq63utYj/BdHQuy/lOpswyGwMgiYjQW9Q U71HBEJdLqpLYN2W+wugzVnZstrMnljkr2X5vGydL6jb1uVqBEQB8JXsb7zH0xfpEDjnIY EcMJ1a037XsXfWW3fLyTaNKYoyaQ6gl00+KVLxE7FkhSSl26zAcTTxdJ3iMveGTqFuUHr5 gCAKfclq39ncs9061Nwd0LhDzb2yXREuRJU6+m0oNAIRjoOVBpKWskTCNXJW22JcRYgm+H D2QmyxHX2aqnjahJUfWIreZer3LvF9lJQkJd7Td8r3yE2Juyzza//5lz8sny9Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712957490; 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=p37EE+Zb98vUxQxmZDxcPyPiKwo1Buw4bLqWIlPimkc=; b=pzYMlGxOkj47AmT3kzvSRP/fVGA4fUgR/fSU5WfaazziEy5scC2mSG2yLxx+2/xb14aD9w UwRzeoJdHK28JeNnyRZ2ZomGeCnlQFppsNzIRoUuEtk6JHKTQBC08BS3/TaMZrrk8YTpFf 79FEV/mYaT7sr7kY+bLJgiRHUU/StQvkPnPXZtXGAXTR5ANxb6IBmmic9SBbXhcTMu6cZi n2RzntK02GrxDzKJim7CLPtOnO0mNK/Tl5aS7WmJdiQe9lY4sBOxxHzFXF2eBtxUITtm7S 8TeIlm8wz2t3KOQxtnzMo0r1tHEFiwMQk6c3IEO6ecVpYO8U/qPaVHphYAXJOA== 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 4VGVBB2CgRz15Qn; Fri, 12 Apr 2024 21:31:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43CLVU9f011834; Fri, 12 Apr 2024 21:31:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43CLVU3E011831; Fri, 12 Apr 2024 21:31:30 GMT (envelope-from git) Date: Fri, 12 Apr 2024 21:31:30 GMT Message-Id: <202404122131.43CLVU3E011831@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 260d7b58547e - stable/14 - NFS: Request use of TCP_USE_DDP for in-kernel TCP sockets 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: 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 260d7b58547e150e3751bb786e97b15ff049f2e8 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=260d7b58547e150e3751bb786e97b15ff049f2e8 commit 260d7b58547e150e3751bb786e97b15ff049f2e8 Author: John Baldwin AuthorDate: 2024-03-20 22:29:51 +0000 Commit: John Baldwin CommitDate: 2024-04-12 19:25:27 +0000 NFS: Request use of TCP_USE_DDP for in-kernel TCP sockets Since this is an optimization, ignore failures to enable the option. For the server side, defer enabling DDP until the first non-NULLPROC RPC is received. This allows TLS handling (which uses NULLPROC RPCs) to enable TLS offload first. Reviewed by: rmacklem Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D44002 (cherry picked from commit a16ff32f04b5b891a2d9b0427a2fd9c48e866da3) --- sys/rpc/clnt_rc.c | 8 ++++++++ sys/rpc/svc.c | 20 ++++++++++++++++++++ sys/rpc/svc.h | 1 + 3 files changed, 29 insertions(+) diff --git a/sys/rpc/clnt_rc.c b/sys/rpc/clnt_rc.c index fbd471ea6f5e..73a9e2631b7b 100644 --- a/sys/rpc/clnt_rc.c +++ b/sys/rpc/clnt_rc.c @@ -43,6 +43,8 @@ #include #include +#include + #include #include #include @@ -213,6 +215,12 @@ clnt_reconnect_connect(CLIENT *cl) goto out; } } + if (newclient != NULL) { + int optval = 1; + + (void)so_setsockopt(so, IPPROTO_TCP, TCP_USE_DDP, + &optval, sizeof(optval)); + } if (newclient != NULL && rc->rc_reconcall != NULL) (*rc->rc_reconcall)(newclient, rc->rc_reconarg, rc->rc_ucred); diff --git a/sys/rpc/svc.c b/sys/rpc/svc.c index 848e719a7cca..6d19a0b1ea7d 100644 --- a/sys/rpc/svc.c +++ b/sys/rpc/svc.c @@ -54,6 +54,7 @@ static char *sccsid = "@(#)svc.c 2.4 88/08/11 4.0 RPCSRC"; #include #include #include +#include #include #include #include @@ -61,6 +62,8 @@ static char *sccsid = "@(#)svc.c 2.4 88/08/11 4.0 RPCSRC"; #include #include +#include + #include #include #include @@ -991,6 +994,23 @@ svc_getreq(SVCXPRT *xprt, struct svc_req **rqstp_ret) goto call_done; } + /* + * Defer enabling DDP until the first non-NULLPROC RPC + * is received to allow STARTTLS authentication to + * enable TLS offload first. + */ + if (xprt->xp_doneddp == 0 && r->rq_proc != NULLPROC && + atomic_cmpset_int(&xprt->xp_doneddp, 0, 1)) { + if (xprt->xp_socket->so_proto->pr_protocol == + IPPROTO_TCP) { + int optval = 1; + + (void)so_setsockopt(xprt->xp_socket, + IPPROTO_TCP, TCP_USE_DDP, &optval, + sizeof(optval)); + } + } + /* * Everything checks out, return request to caller. */ diff --git a/sys/rpc/svc.h b/sys/rpc/svc.h index 9eaf972c097b..b240e75afdb0 100644 --- a/sys/rpc/svc.h +++ b/sys/rpc/svc.h @@ -188,6 +188,7 @@ typedef struct __rpc_svcxprt { int xp_ngrps; /* Cred. from TLS cert. */ uid_t xp_uid; gid_t *xp_gidp; + int xp_doneddp; #else int xp_fd; u_short xp_port; /* associated port number */ From nobody Fri Apr 12 21:31:31 2024 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 4VGVBC5wl2z5G9dX; Fri, 12 Apr 2024 21:31: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 4VGVBC3bJmz4jhH; Fri, 12 Apr 2024 21:31:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712957491; 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=BDyucATqazpz98zEWUUeawtNzXNMjltbADC4L34WiBo=; b=Zf6jgmPo5qKzB7tdVOFTIyA7GAclGQj6vgjtDxdNkQWoq85IT1pB3DID+2dO0MlfqywZ1p A8PobC7mTJWWOqNewe0y0Eh9oY/eh2jzL6jsuucaDoizfTNOVlbzNYkn+AqPE9roDB9YQA Z13B+N8aYqjmsuudKef+Kb8WPFPmist8wp7jgAyyFjwlCYvr0WwPFMD8tMnk7aZIeRR2pf eBSr8YLDHHBbPzN72EuvWo8imC1crS9pEs+VfELvtzAH+MbvUKi9b/gp9vvmEgkR1jkeh6 g3ci/qP+DFMt48G+lYNTfkBBXEBOjIban0eh/YFSiKi6N4tsysF11avipm7NRA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712957491; a=rsa-sha256; cv=none; b=FlEie8ZvS8UbHOAXF3lub079D6CVjotzCXNwCH+KYOFMuTNmbvhUkU/QqFlJly6c4fKVUU bsVH8yZfj65TvYqmFxd+z6W9h11LnkXUpkrYadGRdX9hbTlSo4cAAo+7WmXDbUMV9YPGVw acgaQQTwQhGjmYEtP06maMRzqQWT6KQ1wrj3qvt+GavmZxxU9yw5N5b+mPNmhi4nz4HSTD ja+GE+Oh6W2He5BP3gqt1BHG3ZCtZta4czKovkgRMfy44EjEEe7eTMU823heSvP0d2Dqct ML4CK9GdmdgyMkRdCkePBsBKpOKz4hrwFrSrLB7oT44P9qz0NQfPksPx5lDnzg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712957491; 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=BDyucATqazpz98zEWUUeawtNzXNMjltbADC4L34WiBo=; b=B2Un3dQIes21Oa4RTehKrgR+OpbbsmefkkatSnwdEkMwmAyO2/kHzGx8i9xWD7s4SvFmRp jeIc1pf25Xnl1uym4pElb43XqcF9QvT7Z4WcafXbCfxX/hWYENSWzX6bZv32gtz/VDGylX ms8O0b74YRzMflOV7AY9cU2nipCEBijUCI8UPzTjz+eDqChgCcMQIr8imOGqIiPTJDjhx5 +ubHyr+nUXWdr6n+oFTBpCl+QO/TaVXa+CeW3yzqz6SZSqICr2koT9BUgFaTZYYuuluCQk ABIruO4Kd5EO4lv+z8S9GN84KEJ5zzNcsEXWrvLIyGV82RdDY9KCm39HiKPijQ== 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 4VGVBC3Cpfz15ct; Fri, 12 Apr 2024 21:31:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43CLVVNu011878; Fri, 12 Apr 2024 21:31:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43CLVVdO011875; Fri, 12 Apr 2024 21:31:31 GMT (envelope-from git) Date: Fri, 12 Apr 2024 21:31:31 GMT Message-Id: <202404122131.43CLVVdO011875@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 50f771371356 - stable/14 - libsysdecode: fix build after 3d0a736796a9 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: 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 50f7713713560f93a18a97b70105e303718f1c40 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=50f7713713560f93a18a97b70105e303718f1c40 commit 50f7713713560f93a18a97b70105e303718f1c40 Author: Kyle Evans AuthorDate: 2024-03-21 03:14:49 +0000 Commit: John Baldwin CommitDate: 2024-04-12 20:14:35 +0000 libsysdecode: fix build after 3d0a736796a9 TCP_USE_DDP is a kernel-only macro, so we must exclude it in libsysdecode to avoid breaking the build. Fixes: 3d0a736796a9 ("tcp: Add a new kernel-only TCP_USE_DDP [...]") (cherry picked from commit 6b3db5d7793f57fa0020a78d61aae7ec318557cc) --- lib/libsysdecode/mktables | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libsysdecode/mktables b/lib/libsysdecode/mktables index beb18e97f898..8a990e0408d5 100644 --- a/lib/libsysdecode/mktables +++ b/lib/libsysdecode/mktables @@ -141,7 +141,7 @@ gen_table "sockopt" "SO_[A-Z_]+[[:space:]]+0x[0-9]+" "sys/ gen_table "sockoptip" "(IP_[[:alnum:]_]+|MCAST_[[:alnum:]_]+_GROUP)[[:space:]]+" "netinet/in.h" "IP_DEFAULT|IP_MIN|IP_MAX|IP_PORTRANGE" gen_table "sockoptipv6" "IPV6_[[:alnum:]_]+[[:space:]]+[0-9]+" "netinet6/in6.h" "IPV6_ADDR_|IPV6_TAG_DIRECT|IPV6_OPTIONS|IPV6_RECVOPTS|IPV6_RECVRETOPTS|IPV6_RECVDSTADDR|IPV6_RETOPTS|IPV6_2292|IPV6_RECVRTHDRDSTOPTS|IPV6_REACHCONF|IPV6_PKTOPTIONS" gen_table "sockoptsctp" "SCTP_[[:alnum:]_]+[[:space:]]+[0-9]+" "netinet/sctp.h" -gen_table "sockopttcp" "TCP_[[:alnum:]_]+[[:space:]]+[0-9]+" "netinet/tcp.h" "TCP_MIN|TCP_MAX[^S]|TCP_MSS|TCP_[[:alnum:]_]+_MAX|TCP_FASTOPEN_MIN_COOKIE_LEN|TCP_FASTOPEN_PSK_LEN" +gen_table "sockopttcp" "TCP_[[:alnum:]_]+[[:space:]]+[0-9]+" "netinet/tcp.h" "TCP_MIN|TCP_MAX[^S]|TCP_MSS|TCP_[[:alnum:]_]+_MAX|TCP_FASTOPEN_MIN_COOKIE_LEN|TCP_FASTOPEN_PSK_LEN|TCP_USE_DDP" gen_table "sockoptudp" "UDP_[[:alnum:]]+[[:space:]]+[0-9]+" "netinet/udp.h" "UDP_ENCAP_" gen_table "sockoptudplite" "UDPLITE_[[:alnum:]_]+[[:space:]]+[0-9]+" "netinet/udplite.h" gen_table "socktype" "SOCK_[A-Z]+[[:space:]]+[1-9]+[0-9]*" "sys/socket.h" From nobody Sun Apr 14 01:03:45 2024 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 4VHBrd3Gv6z5GcfL; Sun, 14 Apr 2024 01:03:45 +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 4VHBrd2cTTz47Lp; Sun, 14 Apr 2024 01:03:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713056625; 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=cgUUfMNTyaSsJoOvknrXTpwnAlYW6OvuJckzonpmGYM=; b=RVTUiX3GjFSMdmVqcmAr4LsLezEOyfuEs97IoVNN12dFiTX/Ez6HebORRVq+hfp0/0u47N XeR1mps76F+b2yvjqqRdGFj8GpLhyasxGejMijcFz07HGDu17IA1vmpIoZ67cbzTm9p4dR NVPo11d12L1sdpa11E1H6NroxVOZnMuIdpm18NpyVmYHUTmXcENkn493ab55vmqxaml8Cw M2XtjdU5evutQF7HjAPyQGKpxMEkduYTScIBjOV/OhhvFJTWMGM1oLBvgEv+SB3oQpfItR kttxfy1vm5q3dEdlT95OY+V4uLkf8o1sOsg41tRQs8ufS9a8mzKGfduVs6lr6Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1713056625; a=rsa-sha256; cv=none; b=Y7y96ZO8Fnq2jQNaFjTIkNvfKBmvBVUaW54xEnW1k0Om0LYIp9DdE7lGHeRg3RgBnfy9WP 7bFipuHoLtXYYSZZTyL7F7jiNIFMGR11OuV5JUCKMMSINj2URCwbmcyaFz6rLxxriJiXgY a+9tEcoG4IDNohBfxezBUZgypbiQv0NEKlc/T0Dt9jSDUIo0i2NqT16/rWcxEMz/A1Qizi cEvAq1sksQcRptrbjJZkC0Vvdgx5ag18jw9OJ0X1exJQXORwDpIQ/QjOqNVzNmjx3CZXJv gGKtJGI+6AqxXORV5mc3mjgpei5BjhEYfbG3nMJz02otCr2ZkUGFPSvLIi1KIw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713056625; 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=cgUUfMNTyaSsJoOvknrXTpwnAlYW6OvuJckzonpmGYM=; b=O6eUJhQvv9v/ViwZLeBnRk1LpOpemeF97r0U7JQEBF/x90aRCQjmxqb7Whz8bFAW0+eE95 t8f0q2ZtxDpZLKpAoktSUg+7nhFinGf7cBKa8vOA8YvSNmeTZDpJbk8EnWUPdiPNptWw1a yzv3QRoPFsgtanO/IUm1bpKrkEgo+Pwo+/GjgcQJ7ZDbj0ctI7uOJz/Us1S6UOKmyVEw1/ PNaOgB498a1i/6yUUOZZA6jEFMWjzkvXkeNdQWAOQQ3LM4OVAf661VW8CVsxG/dwFGKxa1 JEX+xv7rbFyN/DhN+HAximx/sCUJ9uzmkWQ8zr2K1Fv7UBSMWZ1Z2AJaxPBo6A== 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 4VHBrd2CWzzw3S; Sun, 14 Apr 2024 01:03:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43E13jJO012421; Sun, 14 Apr 2024 01:03:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43E13jTF012418; Sun, 14 Apr 2024 01:03:45 GMT (envelope-from git) Date: Sun, 14 Apr 2024 01:03:45 GMT Message-Id: <202404140103.43E13jTF012418@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 58fdd8509cf1 - stable/14 - mountd.c: Add warning messages for administrative controls 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: 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: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 58fdd8509cf1a6846cc4124c2bfa03d9343ab910 Auto-Submitted: auto-generated The branch stable/14 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=58fdd8509cf1a6846cc4124c2bfa03d9343ab910 commit 58fdd8509cf1a6846cc4124c2bfa03d9343ab910 Author: Rick Macklem AuthorDate: 2024-03-31 19:00:08 +0000 Commit: Rick Macklem CommitDate: 2024-04-14 01:02:33 +0000 mountd.c: Add warning messages for administrative controls When "administrative controls" (which are exports of subdirectories within a NFS server's local file system) are used, they export the entire local server file system. (The subdirectory only applies to the Mount protocol used for NFSv3 mounts.) To minimize the risk that this causes confusion w.r.t. what is exported to NFS client(s), this patch generates warning messages for these. Only one message is generated for each server local file system. The messages can be silenced via a new "-A" command line option. The mountd.8 man page will be patched via a separate commit. (cherry picked from commit fefb7c399b39403e1a31157e925a541f1cc24f0b) --- usr.sbin/mountd/mountd.c | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/usr.sbin/mountd/mountd.c b/usr.sbin/mountd/mountd.c index 33c19a81a0cf..6583bfbc0ffb 100644 --- a/usr.sbin/mountd/mountd.c +++ b/usr.sbin/mountd/mountd.c @@ -143,10 +143,11 @@ struct exportlist { SLIST_ENTRY(exportlist) entries; }; /* ex_flag bits */ -#define EX_LINKED 0x1 -#define EX_DONE 0x2 -#define EX_DEFSET 0x4 -#define EX_PUBLICFH 0x8 +#define EX_LINKED 0x01 +#define EX_DONE 0x02 +#define EX_DEFSET 0x04 +#define EX_PUBLICFH 0x08 +#define EX_ADMINWARN 0x10 SLIST_HEAD(exportlisthead, exportlist); @@ -285,6 +286,7 @@ static char *exnames_default[2] = { _PATH_EXPORTS, NULL }; static char **exnames; static char **hosts = NULL; static int force_v2 = 0; +static int warn_admin = 1; static int resvport_only = 1; static int nhosts = 0; static int dir_only = 1; @@ -447,11 +449,14 @@ main(int argc, char **argv) else close(s); - while ((c = getopt(argc, argv, "2deh:lnp:RrS")) != -1) + while ((c = getopt(argc, argv, "2Adeh:lnp:RrS")) != -1) switch (c) { case '2': force_v2 = 1; break; + case 'A': + warn_admin = 0; + break; case 'e': /* now a no-op, since this is the default */ break; @@ -1709,6 +1714,20 @@ get_exportlist_one(int passno) fsb.f_fsid.val[1]); } + if (warn_admin != 0 && + (ep->ex_flag & EX_ADMINWARN) == 0 && + strcmp(unvis_dir, fsb.f_mntonname) != + 0) { + if (debug) + warnx("exporting %s exports entire " + "%s file system", unvis_dir, + fsb.f_mntonname); + syslog(LOG_ERR, "Warning: exporting %s " + "exports entire %s file system", + unvis_dir, fsb.f_mntonname); + ep->ex_flag |= EX_ADMINWARN; + } + /* * Add dirpath to export mount point. */ From nobody Sun Apr 14 01:11:30 2024 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 4VHC1c1vJNz5GdcP; Sun, 14 Apr 2024 01:11:32 +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 4VHC1b42xLz47v9; Sun, 14 Apr 2024 01:11:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713057091; 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=jLy6Hs8E1SWpxlS/Eo+/IqASDwEtdJAjitWr2BRvtFw=; b=bnjdAyRe2yTPXaf/0I3LJfv1OeqF6KwPTcq98ZT69jY2MmzznST7/Xm7yNXN4aAyjDx1s3 p+dgScwy7TKOntoNvxCFjxLEWeiQrmsV8qjHUCRLW5+wlUfaGSLVdbVBmEq49vsqngUH1Z /LJiMELB/WUndoJ26YoLTi1biFmqz3qx1kmZu0fI1Xs7Ooj4EBRK0M4N6XRhkzV7wKXfL+ 3dC1fnls9Rc3JNBooEJoj3An/uvX5yKYiCEGVD9aMHnUl/KLmkH2ZSH5sByS2IZ+ZCCZGD 8gH1wt+Z4PdYzbdYYFw9SM9EHyYpr7wr0qFsN8LTOu6z+Ccu5vNO5c0VrmEIDQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1713057091; a=rsa-sha256; cv=none; b=E1tSK1lrVu+V9+XQ8yFRuGbBoo2lm8Gp2idP215BFuCjzp8l5Zck+acilRaxoT6AHLewyQ 9SFtMALpkVaEVyhhMfO8kxr8+egJK8VdxiYhpX0d3Nc8DxJJBcxG/p3xrxZwseEmxP5b3x tX7zE6riqEnFpncA/ZalQDe3ySiTujmiwaeHzfHQdkdlotVqFoyaci7ETNvglaPbBUm0tf 1c41Gx5xlfxwc1xUvDlRGJ9z8GvCnHGXpm7FwKN75Ij8NA8kl/9Ns8U2n20L/1oV03KVvt GZ8HoF19Qwp7HmUurEKRlPctuVG1PtqGtmpjAidCI12VFmyKwucm0LwJ82ou7g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713057091; 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=jLy6Hs8E1SWpxlS/Eo+/IqASDwEtdJAjitWr2BRvtFw=; b=VIW6R5SyFNpjCLsJiuIBmiJnbKDxnNtZHwBITU/nP0MSMjC4SCcQsZXs16mU19NS6r56zk 9CfjTjN8+le8m6YNvruLmtttReaJY+5QQksVhAw/8FJarOChOY4ibf89p18b63Yvch/jwD rBy1/PO5hFVoT+CydjW/7+JxscbpwVx3KEL+65yhlRevWdlc/0CQGHVnTiatQy7v2Pctcq z8BtLtJZ909EiwEVMS/dw7Y6q8xecZ2IBeXbptzC7jdOOu7C+Ze/Tnetx6THpoa7oKPCWa xn8o7c5UZPitC+8H/VfqcuwRbUTKEDRPaXuPvafDrKQHjXXjoTvtmybmMB9Cjg== 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 4VHC1b0yKszw7T; Sun, 14 Apr 2024 01:11:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43E1BUgF024126; Sun, 14 Apr 2024 01:11:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43E1BUpE024123; Sun, 14 Apr 2024 01:11:30 GMT (envelope-from git) Date: Sun, 14 Apr 2024 01:11:30 GMT Message-Id: <202404140111.43E1BUpE024123@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 4ce277a31523 - stable/14 - exports.5: Add RFC number for NFS over TLS 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: 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: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4ce277a31523eb0217cfddddd5fcee560f377a25 Auto-Submitted: auto-generated The branch stable/14 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=4ce277a31523eb0217cfddddd5fcee560f377a25 commit 4ce277a31523eb0217cfddddd5fcee560f377a25 Author: Rick Macklem AuthorDate: 2024-04-07 23:35:55 +0000 Commit: Rick Macklem CommitDate: 2024-04-14 01:10:39 +0000 exports.5: Add RFC number for NFS over TLS This is a content change. (cherry picked from commit 401c0f8aa1ce5f15eaa546df1b44fd68c0f11928) --- usr.sbin/mountd/exports.5 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.sbin/mountd/exports.5 b/usr.sbin/mountd/exports.5 index e394bb036046..aa249c1a882b 100644 --- a/usr.sbin/mountd/exports.5 +++ b/usr.sbin/mountd/exports.5 @@ -27,7 +27,7 @@ .\" .\" @(#)exports.5 8.3 (Berkeley) 3/29/95 .\" -.Dd December 21, 2023 +.Dd April 7, 2024 .Dt EXPORTS 5 .Os .Sh NAME @@ -261,7 +261,7 @@ The and .Fl tlscertuser export options are used to require the client to use TLS for the mount(s) -per RFC NNNN. +per RFC 9289. For NFS mounts using TLS to work, .Xr rpc.tlsservd 8 must be running on the server. @@ -616,7 +616,7 @@ The implementation is based on the following documents: .Re .It .Rs -.%T "Towards Remote Procedure Call Encryption By Default, RFC nnnn" +.%T "Towards Remote Procedure Call Encryption by Default, RFC 9289" .Re .El .Sh BUGS From nobody Sun Apr 14 01:16:34 2024 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 4VHC7R109Gz5GfFD; Sun, 14 Apr 2024 01:16: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 4VHC7R0V69z49NJ; Sun, 14 Apr 2024 01:16:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713057395; 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=iXOdE7q+65jaVCqn5HmVGd7mAQGUIGoijFZ2b+OU4Ig=; b=yfCASYwbrG0XKZvV3rET9QrkhjUuzFJPmNqi82umZPcyC44DBJxuvtxYJvVPWQr9QQr8ur lzNz0q53onwpXaxU6XJq0g6E3c/Mf6FMnuZ7SMQaV00Cc0VppWlkehiwB9Bai8OmfQZpgg 0vDy1KDFT/zT66h3gKiMg1gkgYE6C5n8ovRVjHxwnkq48UnN4LM8rFzZc3ayE7gmnZ0+RF vipN2net1rHP8/K7RqArGnkLP3s303agO/hss3s1fKCwVjU30DC1AzRSJFYwH1NTpVb8li 9+dtUx8OtSu+LOF+foUvxDozgI8Q3DCrbcL4ihmNCez9PRM9DQufHR4C/YDSbg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1713057395; a=rsa-sha256; cv=none; b=H2Xme8HLrZJytkjcsc1yp4SuxMKpUDmSBDwA/0OKsNL4N6MVcqKCnxuHvhGBdUm2GFLczA tPhuQ9vNYtVPYiajY8E1vVS1BwVId/rF5OLZokvRp8/7PGVO7PSyTk6yaWCd0eKMe8vnUD t22BXXB8AyHmyLNl+BL5e5tcd4BGvyxeFNSaXjeB87oXHD48fIVbOcvt+XCvEAWr1yuKdi xnvXIXKSCivAW+tJTiXhg7K87BDxudPo+65OkO2AjFZ/gmhi6DQminMlb/qncTFosY4w9r eG1xucQOudrR8I5YeTrz6qLoT7wc7l4X3A15kBqYUJ+/aXr9Co2Ae+t97BNILg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713057395; 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=iXOdE7q+65jaVCqn5HmVGd7mAQGUIGoijFZ2b+OU4Ig=; b=U1PnbEG9gOiXsVx7QMcCxxW+DtnOicY7DgS8bdIiBsUvzZINIkPfJ19xxdOFMlCbxeQwo8 zlND4UEiHfvJXfKe3ElEQZYZhAPuIn3nAm/3DrgzJWKrj7N64c+96mhCSlbsARrXGpnF8c LQ+kUsuZlG0EqOsAedmfaxmebKoYTjQI85yoJboMTLBbHJkLlXzydUYsf+4TILdOC8/2jO SM8eQwV/FH+7a/57FPpr5r0llSllMdg0e64jTwXuIV5wHjCAmJ6n2rthGpa2rnGCG6thwP uCoEcRz7n4WtyYQ4pEe9GqdI0vT65hx67JksMfLOi97E8qBgAIZJfVHhADz0lQ== 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 4VHC7R05jNzw52; Sun, 14 Apr 2024 01:16:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43E1GYMW029823; Sun, 14 Apr 2024 01:16:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43E1GYHb029820; Sun, 14 Apr 2024 01:16:34 GMT (envelope-from git) Date: Sun, 14 Apr 2024 01:16:34 GMT Message-Id: <202404140116.43E1GYHb029820@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: c39938ddd3a7 - stable/13 - exports.5: Add RFC number for NFS over TLS 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: 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: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c39938ddd3a7e7354db01401712fd7c41aafecff Auto-Submitted: auto-generated The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=c39938ddd3a7e7354db01401712fd7c41aafecff commit c39938ddd3a7e7354db01401712fd7c41aafecff Author: Rick Macklem AuthorDate: 2024-04-07 23:35:55 +0000 Commit: Rick Macklem CommitDate: 2024-04-14 01:15:46 +0000 exports.5: Add RFC number for NFS over TLS This is a content change. (cherry picked from commit 401c0f8aa1ce5f15eaa546df1b44fd68c0f11928) --- usr.sbin/mountd/exports.5 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.sbin/mountd/exports.5 b/usr.sbin/mountd/exports.5 index 56facef29a12..d135184cd464 100644 --- a/usr.sbin/mountd/exports.5 +++ b/usr.sbin/mountd/exports.5 @@ -27,7 +27,7 @@ .\" .\" @(#)exports.5 8.3 (Berkeley) 3/29/95 .\" -.Dd August 16, 2022 +.Dd April 7, 2024 .Dt EXPORTS 5 .Os .Sh NAME @@ -250,7 +250,7 @@ The and .Fl tlscertuser export options are used to require the client to use TLS for the mount(s) -per RFC NNNN. +per RFC 9289. For NFS mounts using TLS to work, .Xr rpc.tlsservd 8 must be running on the server. @@ -603,7 +603,7 @@ The implementation is based on the following documents: .Re .It .Rs -.%T "Towards Remote Procedure Call Encryption By Default, RFC nnnn" +.%T "Towards Remote Procedure Call Encryption by Default, RFC 9289" .Re .El .Sh BUGS