From nobody Sun Jul 16 01:29:08 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R3SL35GH5z4md7d; Sun, 16 Jul 2023 01:29: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 4R3SL34kfdz3jx2; Sun, 16 Jul 2023 01:29:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689470955; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+7hrP8ppGO0jmIyQj2gzhSrxPm8pMKLmchgyimv1okk=; b=qqawLc/OOeGbHbLfvM0YaAifyJmZTQsq5cIIrZx68au5K262ZZjgsoOrH8e9K3ROMrrlTe bbyjep+2+pNoei24pzaoCR577H5Qd4jMM9p8bOV716yYMyikaU4QXeMkfMj7SyUXcD40Ik UgXXo6QjEzXuMk76KzxFbBvG15CX2BLDKLtIe7QVgoubHTju5FQd0XxbdItwJbZ3xqJNki sDqG09uBU4NnFLY94t/Ip3w2qapYHIqY8rYPLFdhhLx+P1aBT693Qrj0g06yfFbM6kvNrX dEIDce/gZciUiojnB4tGx/6ifWhca3GoN6lGPQYF+N5ZZhBSrNE5j/MA1mQ+XQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689470955; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+7hrP8ppGO0jmIyQj2gzhSrxPm8pMKLmchgyimv1okk=; b=fRvRT16xwimBlOp6XzV6OvPE5Mr+Tnu8HyL4pWqIcP39Oz6Bz2/sbjgWKsxWezVCFXwBM9 bjX9t7fSab+W+aNMrRaVlxWNA2G2L10uC9S5JckIwWbArCZBIGvm7bQFS7ijFAhAzKgrbO d6N1aS0yzhrcNxrm3xE8+J2p5cLazEjVlaM4wTAt/NrHVY3bn8hr3b+NFEuTnjOFTyFSg8 RsMIKWLSEQKjjFXrKemufj3fU+f4Wy+SHVycQyvGiFdJRhRko3zfGnlWQ/M4fGMKMkBF2R Wg1Z/6OulACOeLyNreE0kVVgiPcg9rmM8q5A4jsonSeOPtRJ20i/K+YlVV3msw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689470955; a=rsa-sha256; cv=none; b=ErEmQhmuNu2z6MAbcLKL1twY66SumxHyUlxzXZrzTm/5+V4DBXmoRiA+PMxdYrO+HEdas3 UNofKKssrhG9dL3D6+aoURGT7DlUwFO1RRgsrd87+eECWQS40rfPrmrEzZJsXbsCl6tHTo 6Et/EWJqQ6UlCPttvuJXispiWeox0tXOgP+j/Osx/rUbd6PIrMc6XuHltAZ7pcfJCRShoi ol3IsU5LyYsVIzUuH4wdFBrfYOMcWDYifwsNTGbU9O5cnoVwzmPKA2LAaki/KifhFLOoox EhVSjLOfIhVwpzIDkk7NZlzDCY2L/W2NmCG/AWKL2qODiEYwyd55vZC6PGO2lg== 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 4R3SL33jGRzN31; Sun, 16 Jul 2023 01:29: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 36G1TFlJ072686; Sun, 16 Jul 2023 01:29:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36G1T8S4072679; Sun, 16 Jul 2023 01:29:08 GMT (envelope-from git) Date: Sun, 16 Jul 2023 01:29:08 GMT Message-Id: <202307160129.36G1T8S4072679@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: a9490b81b032 - main - Merge LUA 5.4.6 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a9490b81b032b43cdb3c8c76b4d01bbad9ff82c1 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=a9490b81b032b43cdb3c8c76b4d01bbad9ff82c1 commit a9490b81b032b43cdb3c8c76b4d01bbad9ff82c1 Merge: 5ac2a874d070 71944acbe7e5 Author: Warner Losh AuthorDate: 2023-07-15 17:31:04 +0000 Commit: Warner Losh CommitDate: 2023-07-15 17:31:04 +0000 Merge LUA 5.4.6 This is a bug fix to Lua 5.4.4 (5.4.5 was withdrawn due to ABI issues and 5.4.6 is 5.4.5 with those fixed). contrib/lua/Makefile | 4 +- contrib/lua/README | 2 +- contrib/lua/doc/contents.html | 12 +- contrib/lua/doc/lua.1 | 16 +- contrib/lua/doc/manual.html | 311 ++++--- contrib/lua/doc/readme.html | 13 +- contrib/lua/src/Makefile | 5 +- contrib/lua/src/lapi.c | 249 +++--- contrib/lua/src/lapi.h | 17 +- contrib/lua/src/lauxlib.c | 56 +- contrib/lua/src/lcode.c | 137 ++- contrib/lua/src/lcorolib.c | 4 +- contrib/lua/src/ldebug.c | 80 +- contrib/lua/src/ldebug.h | 2 +- contrib/lua/src/ldo.c | 229 ++--- contrib/lua/src/ldo.h | 17 +- contrib/lua/src/ldump.c | 8 +- contrib/lua/src/lfunc.c | 54 +- contrib/lua/src/lfunc.h | 6 +- contrib/lua/src/lgc.c | 106 ++- contrib/lua/src/lgc.h | 19 +- contrib/lua/src/llex.c | 6 +- contrib/lua/src/llimits.h | 21 +- contrib/lua/src/lmathlib.c | 10 +- contrib/lua/src/lmem.c | 68 +- contrib/lua/src/loadlib.c | 9 +- contrib/lua/src/lobject.c | 38 +- contrib/lua/src/lobject.h | 19 +- contrib/lua/src/lopcodes.h | 2 +- contrib/lua/src/loslib.c | 36 +- contrib/lua/src/lparser.c | 31 +- contrib/lua/src/lstate.c | 65 +- contrib/lua/src/lstate.h | 25 +- contrib/lua/src/lstrlib.c | 2 +- contrib/lua/src/ltable.c | 8 +- contrib/lua/src/ltable.h | 1 - contrib/lua/src/ltablib.c | 2 +- contrib/lua/src/ltests.c | 1977 +++++++++++++++++++++++++++++++++++++++++ contrib/lua/src/ltests.h | 151 ++++ contrib/lua/src/ltm.c | 38 +- contrib/lua/src/ltm.h | 5 +- contrib/lua/src/lua.c | 39 +- contrib/lua/src/lua.h | 27 +- contrib/lua/src/luac.c | 6 +- contrib/lua/src/luaconf.h | 13 +- contrib/lua/src/lundump.c | 8 +- contrib/lua/src/lutf8lib.c | 27 +- contrib/lua/src/lvm.c | 235 +++-- contrib/lua/src/lvm.h | 5 + 49 files changed, 3355 insertions(+), 866 deletions(-) diff --cc contrib/lua/Makefile index fef1af4821e6,000000000000..8efa2eb3fdd6 mode 100644,000000..100644 --- a/contrib/lua/Makefile +++ b/contrib/lua/Makefile @@@ -1,106 -1,0 +1,106 @@@ +# Makefile for installing Lua +# See doc/readme.html for installation and customization instructions. + +# == CHANGE THE SETTINGS BELOW TO SUIT YOUR ENVIRONMENT ======================= + +# Your platform. See PLATS for possible values. +PLAT= guess + +# Where to install. The installation starts in the src and doc directories, +# so take care if INSTALL_TOP is not an absolute path. See the local target. +# You may want to make INSTALL_LMOD and INSTALL_CMOD consistent with +# LUA_ROOT, LUA_LDIR, and LUA_CDIR in luaconf.h. +INSTALL_TOP= /usr/local +INSTALL_BIN= $(INSTALL_TOP)/bin +INSTALL_INC= $(INSTALL_TOP)/include +INSTALL_LIB= $(INSTALL_TOP)/lib +INSTALL_MAN= $(INSTALL_TOP)/man/man1 +INSTALL_LMOD= $(INSTALL_TOP)/share/lua/$V +INSTALL_CMOD= $(INSTALL_TOP)/lib/lua/$V + +# How to install. If your install program does not support "-p", then +# you may have to run ranlib on the installed liblua.a. +INSTALL= install -p +INSTALL_EXEC= $(INSTALL) -m 0755 +INSTALL_DATA= $(INSTALL) -m 0644 +# +# If you don't have "install" you can use "cp" instead. +# INSTALL= cp -p +# INSTALL_EXEC= $(INSTALL) +# INSTALL_DATA= $(INSTALL) + +# Other utilities. +MKDIR= mkdir -p +RM= rm -f + +# == END OF USER SETTINGS -- NO NEED TO CHANGE ANYTHING BELOW THIS LINE ======= + +# Convenience platforms targets. - PLATS= guess aix bsd c89 freebsd generic linux linux-readline macosx mingw posix solaris ++PLATS= guess aix bsd c89 freebsd generic ios linux linux-readline macosx mingw posix solaris + +# What to install. +TO_BIN= lua luac +TO_INC= lua.h luaconf.h lualib.h lauxlib.h lua.hpp +TO_LIB= liblua.a +TO_MAN= lua.1 luac.1 + +# Lua version and release. +V= 5.4 - R= $V.4 ++R= $V.6 + +# Targets start here. +all: $(PLAT) + +$(PLATS) help test clean: + @cd src && $(MAKE) $@ + +install: dummy + cd src && $(MKDIR) $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB) $(INSTALL_MAN) $(INSTALL_LMOD) $(INSTALL_CMOD) + cd src && $(INSTALL_EXEC) $(TO_BIN) $(INSTALL_BIN) + cd src && $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC) + cd src && $(INSTALL_DATA) $(TO_LIB) $(INSTALL_LIB) + cd doc && $(INSTALL_DATA) $(TO_MAN) $(INSTALL_MAN) + +uninstall: + cd src && cd $(INSTALL_BIN) && $(RM) $(TO_BIN) + cd src && cd $(INSTALL_INC) && $(RM) $(TO_INC) + cd src && cd $(INSTALL_LIB) && $(RM) $(TO_LIB) + cd doc && cd $(INSTALL_MAN) && $(RM) $(TO_MAN) + +local: + $(MAKE) install INSTALL_TOP=../install + +# make may get confused with install/ if it does not support .PHONY. +dummy: + +# Echo config parameters. +echo: + @cd src && $(MAKE) -s echo + @echo "PLAT= $(PLAT)" + @echo "V= $V" + @echo "R= $R" + @echo "TO_BIN= $(TO_BIN)" + @echo "TO_INC= $(TO_INC)" + @echo "TO_LIB= $(TO_LIB)" + @echo "TO_MAN= $(TO_MAN)" + @echo "INSTALL_TOP= $(INSTALL_TOP)" + @echo "INSTALL_BIN= $(INSTALL_BIN)" + @echo "INSTALL_INC= $(INSTALL_INC)" + @echo "INSTALL_LIB= $(INSTALL_LIB)" + @echo "INSTALL_MAN= $(INSTALL_MAN)" + @echo "INSTALL_LMOD= $(INSTALL_LMOD)" + @echo "INSTALL_CMOD= $(INSTALL_CMOD)" + @echo "INSTALL_EXEC= $(INSTALL_EXEC)" + @echo "INSTALL_DATA= $(INSTALL_DATA)" + +# Echo pkg-config data. +pc: + @echo "version=$R" + @echo "prefix=$(INSTALL_TOP)" + @echo "libdir=$(INSTALL_LIB)" + @echo "includedir=$(INSTALL_INC)" + +# Targets that do not create files (not all makes understand .PHONY). +.PHONY: all $(PLATS) help test clean install uninstall local dummy echo pc + +# (end of Makefile) diff --cc contrib/lua/src/ltests.c index 000000000000,7d184c0d8ee1..7d184c0d8ee1 mode 000000,100644..100644 --- a/contrib/lua/src/ltests.c +++ b/contrib/lua/src/ltests.c diff --cc contrib/lua/src/ltests.h index 000000000000,ec520498bde4..ec520498bde4 mode 000000,100644..100644 --- a/contrib/lua/src/ltests.h +++ b/contrib/lua/src/ltests.h From nobody Sun Jul 16 12:34:48 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R3l612355z4mYwT; Sun, 16 Jul 2023 12:34: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 4R3l611crjz3L8f; Sun, 16 Jul 2023 12:34:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689510889; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VzvkWP3vSdVm9S/D5gkpezREpaTrXpgVvxQJ24G7UGg=; b=ZIZr8eryHDzNSKOKv8YaGWI912aE5vkW+ZZr+Hlvs0KnsQEiHEklB8FtYVEhl3PvYN1Uly 6oQvTVyRZxkxjUNHm+PuAFtNL9t19wv93/xfIX7kqgNkw65olJNfbGAMRXkN4XGhE9Uq6q ScEv6SsGEsORc/gd2zOONHfyhE66qItXRjG/s1GRSkVXtcZLj2zxem1jMIOpz3r5PqeWKu NReE3+NOZtarkMMYeWr9yF9xZcF+FMb7t28ofhPeZvpsenRhYkZUEDnNuSD6TIklsSpEQM kT5kXLzdI1EbQkPJJ8CUNOu7x/fscE51JOPancttFnG1uec7DN+PzB/6HDNy9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689510889; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VzvkWP3vSdVm9S/D5gkpezREpaTrXpgVvxQJ24G7UGg=; b=ipZLxG1BAF1AmNnsD/zR14W+T5lK67lOiHNkXd/Gdv0bYg7GuLLIVaYeVaDAgMMETKLyiZ 4nsl1le8JbFTbl2hYK+CageUQsnPTGg3WYrWpXz5UOu/nsbmuLKm7QWJwPNw791FS+Yorn MiaLjPe6ZkYTtC8BCUJI5fwj8BhTo1VSNNrO/C7ZMXXS1NIt3qrwVKfMMM4/FwNV57Sco2 8qQn9tzOzoQjUvs5M2zVmqlxwt4/oWAMOoM1DuO/CJVhFBKum+tTEOZaFoervU/+ggW3qu g1eIYael7fLPbw3GSJpKEohHvK7xTW146bnwfiQS7N3yTFuwJTPVsqCfcY9y1Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689510889; a=rsa-sha256; cv=none; b=F9OTqbTThwysfAnDeny91grlOMSgVVYn+f0AdZ+o2sn7LiIH///nZnMXLTmtFZXJXBE+P3 LnClLQJEYTqpzS789N4VSzI8NWb2KFZmtr1B6KacrL+Vfs0mvhE39f2OjZdhYI4JgCqZh8 tEX2Ey8mZ9XkW85q/84qk1y5/74ioLl2hGg0NiJisWYxKh3+caWQqbem5dei59NfDq829g OVmCacRACLFpjLfAXF2QohXD0m2Pz1ocDTr6WepgZJ6GrW4ounUzAojUZmOiMAEbTWGF3R SZeYeyJ7KxvLsxEWH2oiL53xpPy0PdhG6oqtYqAzv08SXck1W4n1dzcIMplpWw== 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 4R3l610b48zhZq; Sun, 16 Jul 2023 12:34: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 36GCYmad082257; Sun, 16 Jul 2023 12:34:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36GCYmEK082256; Sun, 16 Jul 2023 12:34:48 GMT (envelope-from git) Date: Sun, 16 Jul 2023 12:34:48 GMT Message-Id: <202307161234.36GCYmEK082256@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 80c558849567 - main - libthr: some style in thr_rwlock.c List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 80c5588495674fc6501700fccb0ed4a37183c89c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=80c5588495674fc6501700fccb0ed4a37183c89c commit 80c5588495674fc6501700fccb0ed4a37183c89c Author: Konstantin Belousov AuthorDate: 2023-07-13 15:55:50 +0000 Commit: Konstantin Belousov CommitDate: 2023-07-16 12:34:23 +0000 libthr: some style in thr_rwlock.c Sponsored by: The FreeBSD Foundation MFC after: 1 week --- lib/libthr/thread/thr_rwlock.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libthr/thread/thr_rwlock.c b/lib/libthr/thread/thr_rwlock.c index 3e8af974fa18..135d565b0d42 100644 --- a/lib/libthr/thread/thr_rwlock.c +++ b/lib/libthr/thread/thr_rwlock.c @@ -343,14 +343,14 @@ rwlock_wrlock_common(pthread_rwlock_t *rwlock, const struct timespec *abstime) int _Tthr_rwlock_wrlock(pthread_rwlock_t *rwlock) { - return (rwlock_wrlock_common (rwlock, NULL)); + return (rwlock_wrlock_common(rwlock, NULL)); } int _pthread_rwlock_timedwrlock(pthread_rwlock_t * __restrict rwlock, const struct timespec * __restrict abstime) { - return (rwlock_wrlock_common (rwlock, abstime)); + return (rwlock_wrlock_common(rwlock, abstime)); } int From nobody Sun Jul 16 12:34:50 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R3l622l90z4mZ7C; Sun, 16 Jul 2023 12:34: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 4R3l622Fmkz3L6p; Sun, 16 Jul 2023 12:34:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689510890; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7joexk35AZovzHlCvIJlgjZ59ihSuuIZuyTTPfW8SUA=; b=nLtTvElrmBqmqBohbVpIGXe45bCgEIczWa75IYlI+TfLVtWD1v0LcwAiWAVGGfT3ddJqKH TL7EvkOGr17j6KLRnxj1CQ5XMWmnRXXlq7O9PRZcgaAoWFmFBLTmrlBVJAbFRJdjviHHqs gGPGwqpNfoZNpLsNmIxewT6R7p+eUcxM/vnPiSD3XfQJFp1CbHFRv0/ajmsrXBU9fDgiuu cyP+rG8zZX9DOSpA3rLeHt9qUpLWMtf1P2yc1wI3fCeCECbfdFbMcmBiqk4qSYcktFOOU1 fR+61v+kJh6mT1M0rgC33uG3grMakqNGlIBkCWswC3ignm3RdqK0+j5MsnjMMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689510890; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7joexk35AZovzHlCvIJlgjZ59ihSuuIZuyTTPfW8SUA=; b=hcTrQ4EyacJkNVPZqxPI3CxwkXLGaQ8eKxOPN70dSQFGFqDouR2QpAfbGEdm3qlWDoMpfx Vo8g8pLBXK0u9LScYndqbDPmKxlH0D/TByO9pz7YOBlfLDRgZ4ovV0bXTGZW82EGgF/StB VZ6DfNOwU1XqXX3c/H99fnvv89zvkIzAZXRJfpufjnXzzTksac0hSO8Q1hvwdLhOqKNxB8 22kYx43g5S0DlNhNjHLoSRh1OyKoNrty2POT6mtm+uKRlqxYpk2sAKPhkUvlLdBw/jVCBL my6hdQHA/r/9BjSi+gBUVG8EUftxqytPtCLuSv9gXZrwFvHfC/C71saZY7PVcg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689510890; a=rsa-sha256; cv=none; b=EZ9RJTy4BHlMQeBpeMQa5hPn8lvRMiGPqoiMXzg5tGE6unYm05HWLD9MNDyYPr5Ir4Bhxb lDmhraaKC486VLc8wzpwte7KuprtfFQ+S1vtGl8VhL9USzP8VAmJxFKvf6nWFOexPDgNYQ sQq6xHkES5wfxzdlG+k0KlsBgC0idptxe/pfqdg8Zdi9ncETO28+/UH81epmIGpLzf1Jbw /hPNqIf2y42ss7Wf92jmdOuslrw2zmzdijI7mWA5CK6RSpmvwjjnrZKQTQADzz0S9xMuy1 uAUTXz/ZOLGzaOb19XCo1B86pre/hYN8DxQkMP7M74SJM+WU1YGj7hDuuuEfkA== 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 4R3l620nfpzjN2; Sun, 16 Jul 2023 12:34: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 36GCYoHb082277; Sun, 16 Jul 2023 12:34:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36GCYoIV082276; Sun, 16 Jul 2023 12:34:50 GMT (envelope-from git) Date: Sun, 16 Jul 2023 12:34:50 GMT Message-Id: <202307161234.36GCYoIV082276@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: ad056b5d35d9 - main - libthr: trigger library initialization on rwlock calls List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: ad056b5d35d9957b1bd023abeb6461601449b725 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=ad056b5d35d9957b1bd023abeb6461601449b725 commit ad056b5d35d9957b1bd023abeb6461601449b725 Author: Konstantin Belousov AuthorDate: 2023-07-13 15:56:11 +0000 Commit: Konstantin Belousov CommitDate: 2023-07-16 12:34:34 +0000 libthr: trigger library initialization on rwlock calls Reviewed by: tijl Sponsored by: The FreeBSD Foundation MFC after: 1 week --- lib/libthr/thread/thr_rwlock.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/libthr/thread/thr_rwlock.c b/lib/libthr/thread/thr_rwlock.c index 135d565b0d42..af32b09963d9 100644 --- a/lib/libthr/thread/thr_rwlock.c +++ b/lib/libthr/thread/thr_rwlock.c @@ -163,6 +163,7 @@ int _thr_rwlock_init(pthread_rwlock_t *rwlock, const pthread_rwlockattr_t *attr) { + _thr_check_init(); *rwlock = NULL; return (rwlock_init(rwlock, attr)); } @@ -231,6 +232,7 @@ rwlock_rdlock_common(pthread_rwlock_t *rwlock, const struct timespec *abstime) int _Tthr_rwlock_rdlock(pthread_rwlock_t *rwlock) { + _thr_check_init(); return (rwlock_rdlock_common(rwlock, NULL)); } @@ -238,21 +240,24 @@ int _pthread_rwlock_timedrdlock(pthread_rwlock_t * __restrict rwlock, const struct timespec * __restrict abstime) { + _thr_check_init(); return (rwlock_rdlock_common(rwlock, abstime)); } int _Tthr_rwlock_tryrdlock(pthread_rwlock_t *rwlock) { - struct pthread *curthread = _get_curthread(); + struct pthread *curthread; pthread_rwlock_t prwlock; int flags; int ret; + _thr_check_init(); ret = check_and_init_rwlock(rwlock, &prwlock); if (ret != 0) return (ret); + curthread = _get_curthread(); if (curthread->rdlock_count) { /* * To avoid having to track all the rdlocks held by @@ -280,14 +285,16 @@ _Tthr_rwlock_tryrdlock(pthread_rwlock_t *rwlock) int _Tthr_rwlock_trywrlock(pthread_rwlock_t *rwlock) { - struct pthread *curthread = _get_curthread(); + struct pthread *curthread; pthread_rwlock_t prwlock; int ret; + _thr_check_init(); ret = check_and_init_rwlock(rwlock, &prwlock); if (ret != 0) return (ret); + curthread = _get_curthread(); ret = _thr_rwlock_trywrlock(&prwlock->lock); if (ret == 0) prwlock->owner = TID(curthread); @@ -343,6 +350,7 @@ rwlock_wrlock_common(pthread_rwlock_t *rwlock, const struct timespec *abstime) int _Tthr_rwlock_wrlock(pthread_rwlock_t *rwlock) { + _thr_check_init(); return (rwlock_wrlock_common(rwlock, NULL)); } @@ -350,6 +358,7 @@ int _pthread_rwlock_timedwrlock(pthread_rwlock_t * __restrict rwlock, const struct timespec * __restrict abstime) { + _thr_check_init(); return (rwlock_wrlock_common(rwlock, abstime)); } From nobody Sun Jul 16 12:34:51 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R3l6350q1z4mZGM; Sun, 16 Jul 2023 12:34: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 4R3l632vN5z3LCm; Sun, 16 Jul 2023 12:34:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689510891; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Mj+0OS9O9pHXMmgcnVnFzdD5DgSfUxgJCISMNk4aRAY=; b=XiDnTQ34frT04hJ8sXuT4SUN8OPjZPnQ+UvifNiQ5iznu/00n+vUlZ4FkooeQ6/UoyciwW F0RJgK/6FtRLl8VwWr+9y4sGnJzqTci4a9MmJsVqzRLsC7a05L2UifYklQGqYLEtVOIT4E YZ6XuUY8IJ4hJ911esqqQ91G41LRSPhigc3S2lP3KowyWyn2fHdfMm+nctL/8iEvvzHa8R 0y2ei/iK/+XSLKWnfat+7Y1jotx6zWd2Dspr8FDGHnMEt4tS/DXLeArLa9LX+n9QZYoYMG nislVo4p/jitIycVhEGlLOqaduT4C5b2hMKtKLseAka+vYLqmZu2D/4Mm9CUYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689510891; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Mj+0OS9O9pHXMmgcnVnFzdD5DgSfUxgJCISMNk4aRAY=; b=uF9tPAxkz8U7y5DgwxkEE9dQ+GWF0fZSjNZHKZ4Fr24dxM70FKNVrZzaAwakPw/LjcV2wf O1umJ3CnUpAysCMRzoCrJ4p/uVTcT9rEV2Oaqf5rO4UL+W3zqxgY5AUWHEMmHWyfRtea7X YIT16/+WEjKgbcRiaV4sK1eIeej1gnS+I1KCtl9MFHnhMtNk5qqKoveSgOGrITmbxIJBOf xCCb1urqrEewR1mUv9e714+FmHz4A6A9uscYgyK1+6im1X+khmAilLPbSwdCmaqP2TXJO5 fZTmUPKC3XC+0Apb6fdSKXtl9gqeENNZu3GctYHmscIji4940+xhZfv25RrFog== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689510891; a=rsa-sha256; cv=none; b=JGGTp4uksQDEEf4tHf0S/50bt0Hkl2r+Gen7w3gdHU249Dql7hPO3OfRP1sPANkisrkmIf ZrsJKBbTjOCI8oZ8K7vZlz076X//gcUcavo8fB4m/Z2zJ5RR/g6Y+u32PV9MLFN8AerXya b2ABEeJVVuhHif+PVeMIUK/Vv5CR7U3Aysjy9upfXFpxFNOzBC64WbJUvGbFPZiokkS70v 4Erf+oUH8lnYdKPFK03mRYG5D/WHz+MdooeYYOsVhbZrU3fcJJpjCSkRbk9Vki+L55gDQB IoQW8NkOal7xJT0pfMh3AgX5cKXhuqokoEwtPcXcXtKb6uI2ChMjS0zT7/YdBg== 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 4R3l631jySzjNd; Sun, 16 Jul 2023 12:34: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 36GCYpRu082297; Sun, 16 Jul 2023 12:34:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36GCYplB082296; Sun, 16 Jul 2023 12:34:51 GMT (envelope-from git) Date: Sun, 16 Jul 2023 12:34:51 GMT Message-Id: <202307161234.36GCYplB082296@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 1005d3d05362 - main - rtld: fix dlopen() for an object that is already mapped but not yet initialized List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 1005d3d05362de368b1ea7aeb8eb20cee993e122 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=1005d3d05362de368b1ea7aeb8eb20cee993e122 commit 1005d3d05362de368b1ea7aeb8eb20cee993e122 Author: Konstantin Belousov AuthorDate: 2023-07-14 13:38:03 +0000 Commit: Konstantin Belousov CommitDate: 2023-07-16 12:34:34 +0000 rtld: fix dlopen() for an object that is already mapped but not yet initialized For instance, dso might be mapped as needed but not yet initialized from the other subtree of needed objects, while current object' constructor does dlopen() for the dso. Right now rtld does relocations and other processing based on the arrival of new objects in the global list, which is not happens there. Directly check for the initialization state of the object, for which we would return the handle. One practical use case of this support is e.g. dlopen("libthr.so", RTLD_NOLOAD) by libraries that are threading-aware but happy to live with libc pthread shims if the program is not multithreaded. Reviewed by: tijl Sponsored by: The FreeBSD Foundation MFC after: 2 weeks --- libexec/rtld-elf/rtld.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 5c96405be62c..83315d5023ba 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -3714,7 +3714,6 @@ static Obj_Entry * dlopen_object(const char *name, int fd, Obj_Entry *refobj, int lo_flags, int mode, RtldLockState *lockstate) { - Obj_Entry *old_obj_tail; Obj_Entry *obj; Objlist initlist; RtldLockState mlockstate; @@ -3731,7 +3730,6 @@ dlopen_object(const char *name, int fd, Obj_Entry *refobj, int lo_flags, } GDB_STATE(RT_ADD,NULL); - old_obj_tail = globallist_curr(TAILQ_LAST(&obj_list, obj_entry_q)); obj = NULL; if (name == NULL && fd == -1) { obj = obj_main; @@ -3744,9 +3742,9 @@ dlopen_object(const char *name, int fd, Obj_Entry *refobj, int lo_flags, obj->dl_refcount++; if (mode & RTLD_GLOBAL && objlist_find(&list_global, obj) == NULL) objlist_push_tail(&list_global, obj); - if (globallist_next(old_obj_tail) != NULL) { - /* We loaded something new. */ - assert(globallist_next(old_obj_tail) == obj); + + if (!obj->init_done) { + /* We loaded something new and have to init something. */ if ((lo_flags & RTLD_LO_DEEPBIND) != 0) obj->symbolic = true; result = 0; From nobody Sun Jul 16 15:42:44 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R3qGr2Vqhz4n5X5; Sun, 16 Jul 2023 15:42: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 4R3qGr1ssXz4T0f; Sun, 16 Jul 2023 15:42:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689522164; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=truzyeu59rqPEbKInQl3LMna66AhI+F4336BGlnRZnk=; b=hsGeawTj5W1UJ+eTf5I6Ayin4hv7e4p4ASTCU9ayBFH+e2294nLccudqnqMT9MHfKkIhhM bIVGZXgjVEJiJA9uzXRKgahk+eGVTap4IV5iFJC1pJ3Iti4lWFSNIWmuLm2kbh84DMBMDZ 7J4yrnxYujKd51Qqzbm6A3rfZfw2fdMWxehP/aIId9avcJjJq1UZEJgIPw0LZVhimKNOtm BqzVR2S0P2pT2NkT2n4bJXjhNdPHRZPU7W4yQta3dkXaUujH0LwhFD4pV9FJi5YUlB42Bx NPtTlHQp6var+YjcKB/Q9uzJNWDvZ2ZLRwEDApMNJBIGQHvKYGRZOFGX+GgMbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689522164; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=truzyeu59rqPEbKInQl3LMna66AhI+F4336BGlnRZnk=; b=Ixo+MLi26V5JK4BhPi3dKJYUeVzNfxJYeYW8yAVLCOnn1jTvKlTd1xltayX37L5w5QQMfs bq0xOMwKiloiAYR2ONf85UlLtV4XjL0E83zUlQrVMkrZ+UROvthAskeid9noUdgUxCgACl 4fgetgQAgF4qeTNTSUMfKrOjdvemoKeJlAaBJOOEiLP8aWgpx1115PAZQdxhNLsMe1yJmp wdKG5ffIk2MOZ5IIRwKnQjTB3YRZxL7Ne1P+cILcECICy3dIr7EJKhg5wq4g2M4PDfVYmN IL4hh4+SNwR/S+kVZB5cSqZwQiXzj3RAD2c4TwKJZqhBCpnOS6qFB1EWP8VYmw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689522164; a=rsa-sha256; cv=none; b=UfGn9dimq9t3btUrzB2/drxeTYwrc5wYbrY/Hc7fEoBDIi0w9XRkdaycXRonnuIOpnP20E 5uW/yrv+Jncf2y7iZdSMVl78FqhQqS5tDNt2iSgkM+POMSD8tAp/oBe2kQOCcG/ZAOFOuo uqv5+WHuHDx3x8STF4TGUNkpj/ey5svOmdUUuUyvxRqQpSxyog/3KreRAHOq7VEB2Md3Tl 17ulFUE+qOt+3bbSJxxPRxz0JEL7rLgZJdZOhFCREHUXCbidFRGKAw4RQsB4f6iof4ov0e S3Ssx/2c9UhrIBh/G80BvXk00BXgp8GWva/8ZA37hq88/t253OtKUzBhc6y0Ag== 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 4R3qGr0dkZznvx; Sun, 16 Jul 2023 15:42: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 36GFgiPv096191; Sun, 16 Jul 2023 15:42:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36GFgiFE096190; Sun, 16 Jul 2023 15:42:44 GMT (envelope-from git) Date: Sun, 16 Jul 2023 15:42:44 GMT Message-Id: <202307161542.36GFgiFE096190@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Robert Clausecker Subject: git: c1e63e352e34 - main - libexec/rtld-elf/rtld-libc/Makefile.inc: do not use machdep string functions List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fuz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c1e63e352e34b55ad577011fa4729f0638fb3fdf Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by fuz: URL: https://cgit.FreeBSD.org/src/commit/?id=c1e63e352e34b55ad577011fa4729f0638fb3fdf commit c1e63e352e34b55ad577011fa4729f0638fb3fdf Author: Robert Clausecker AuthorDate: 2023-06-28 17:18:15 +0000 Commit: Robert Clausecker CommitDate: 2023-07-16 15:41:55 +0000 libexec/rtld-elf/rtld-libc/Makefile.inc: do not use machdep string functions With ifunc based SIMD dispatch, we cannot use the amd64 assembly implementations of string functions. Modify rtld to instead use the generic functions. To avoid an architecture-specific special case, this change is applied to all architectures. This change is a prerequisite to and formerly part of D40693. Sponsored by: FreeBSD Foundation Approved by: kib See also: D40693 Differential Revision: https://reviews.freebsd.org/D41050 --- libexec/rtld-elf/rtld-libc/Makefile.inc | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/libexec/rtld-elf/rtld-libc/Makefile.inc b/libexec/rtld-elf/rtld-libc/Makefile.inc index 99da16d06509..5033b2207e32 100644 --- a/libexec/rtld-elf/rtld-libc/Makefile.inc +++ b/libexec/rtld-elf/rtld-libc/Makefile.inc @@ -38,11 +38,21 @@ SRCS+= errlst.c getcwd.c getprogname.c raise.c sigsetops.c sysctlnametomib.c \ # errlst.c needs the errlst.h header from libc: CFLAGS.errlst.c+=-I${LIBC_SRCTOP}/include -# Use the string and memory .o files from libc instead of rebuilding them (they -# might be using optimized assembly and duplicating that logic here is awkward). -_libc_string_objects= bcmp bcopy bzero memset memchr memcmp memcpy memmove \ - stpncpy strcat strchr strchrnul strcmp stpcpy strcpy strcspn strdup \ - strlcat strlcpy strlen strncmp strncpy strrchr strsep strspn strstr strtok +# use generic versions of string functions to avoid potential ifunc dispatch +.PATH: ${LIBC_SRCTOP}/string +SRCS+= bcopy.c bzero.c memchr.c memcmp.c memcpy.c memmove.c memset.c strcat.c \ + strchr.c strchrnul.c strcmp.c strcpy.c strcspn.c strdup.c strlcat.c \ + strlcpy.c strlen.c strncmp.c strncpy.c strrchr.c strsep.c strspn.c \ + strstr.c strtok.c +CFLAGS.memchr.c+=-Wno-cast-qual +CFLAGS.strchr.c+=-Wno-cast-qual +CFLAGS.strchrnul.c+=-Wno-cast-qual +CFLAGS.strcspn.c+=-Wno-sign-compare +CFLAGS.strrchr.c+=-Wno-cast-qual +CFLAGS.strspn.c+=-Wno-sign-compare +CFLAGS.strstr.c+=-Wno-cast-qual -Wno-sign-compare +CFLAGS.strtok.c+=-Wno-cast-qual + # Also use all the syscall .o files from libc_nossp_pic: _libc_other_objects= sigsetjmp lstat stat fstat fstatat fstatfs syscall \ cerror geteuid getegid sigfastblock munmap mprotect \ @@ -71,7 +81,7 @@ _libc_other_objects+=syncicache # we don't accidentally pull in the interposing table or similar by linking # directly against libc_nossp_pic.a _rtld_libc_objs= -.for _obj in ${_libc_other_objects} ${_libc_string_objects} +.for _obj in ${_libc_other_objects} _rtld_libc_objs+=${_obj}.nossppico CLEANFILES+=${_obj}.nossppico # LDFLAGS+= -Wl,--trace-symbol=${_obj} From nobody Sun Jul 16 17:36:58 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R3spf74Lkz4nBtm; Sun, 16 Jul 2023 17:36: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 4R3spf6dPmz3tb9; Sun, 16 Jul 2023 17:36:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689529018; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KhpSAimZHh4DIwVbgZymgVRMi1Ftf27OnOImeDaTz4o=; b=J7X7Dim6zm93LmMpwF9qolmVA31cSSc89ro+55fKHUAhuz4xNnJ4z3j5pud/bv8qtHfgjl LEmKdQGO9GxwIfpEk970oHG8CcCT7F+vv3dtliJi3OnAU+AAun9S0Oa7BzbaH03aFGmIOu L/ScfgqSVpNFJR3qYBRW2LAQMOywSPXme0+ROggx6thOLoxgqSnJvYV6UUO1O5NYkc81J3 Zs5h5gSkM+7ijhIJsl5S8upWYITIJaIXzDn0sqtSjKemq339LLF95qEN/UwPTWneudcx7K nF1YfR6HR6diUONObPMUuIC4Q/+qgRwWmUcK25XrHAnrI6y5vpinqMQXSiUKBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689529018; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KhpSAimZHh4DIwVbgZymgVRMi1Ftf27OnOImeDaTz4o=; b=EeO8ozPO/+LLW5cvrTKJK6r1Ezc9JHwaOmWaCRFHsACVyJrZ5LcBH7oCtkQnBPPkgjV8B9 CgAWQm8P5LubiOVwokuh+9aJXmow04NAM9d/ArBpgPNfU4jWynsDEhLAKVkuuam7eJVRrE m/W5NOMqf/XmhoWkAuIbD4dCSPFPQyWxGw3Qy5njfXWZhb32aKS+EG4I8A2AFjRcztRWqx 5Z4Uvjlf7GqN8Pi/WBIdEZEAsZu7iUYb1YtavjQQp92SU7d2axxnh4ZARZ9Kcskcp1YTAK A0UYza5RNBPYW1gK7xOIn6m3QT3NGgbraVqsARpOd+W8+TINjOgAwQK+64F+xw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689529018; a=rsa-sha256; cv=none; b=ZnfE7P9B2JSALK+XWZ12UhRaQQBmsnRd0vvXljJevRtXVGwHmShUXj2ANkuf8cAqQ3mrw4 X3vrEkCVC0dig7ayecaFu6/N0baedbAacKe+EkQy5Ti/xwoDKIqxFe+Or0ctu4QpbDmPuN kN90j5GvRKKhSrLZmtc9xwyCjE39LSe7+p96a2WDotVJfnoPpZUe5OJcw4Hz0CwVaMsD/a WzL5iYNMAOzNB1KS7jaBBY9FNlFQjSg+9jY8h45r4B3ahTnRtRuCk82QGM4UzVzvzrGZwQ rFbq8N5gYPrFxwIhogxnUfLS5lIB/wdciRcnaOh/gi5tF6mJNpGuI1oCVO//nQ== 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 4R3spf5hJgzrcn; Sun, 16 Jul 2023 17:36: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 36GHawAn078805; Sun, 16 Jul 2023 17:36:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36GHaw3h078804; Sun, 16 Jul 2023 17:36:58 GMT (envelope-from git) Date: Sun, 16 Jul 2023 17:36:58 GMT Message-Id: <202307161736.36GHaw3h078804@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Robert Clausecker Subject: git: 4da7282a1882 - main - lib/libc/string/bcmp.c: fix integer overflow bug List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fuz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4da7282a1882fc03c99591c27d44a2e6dfda364b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by fuz: URL: https://cgit.FreeBSD.org/src/commit/?id=4da7282a1882fc03c99591c27d44a2e6dfda364b commit 4da7282a1882fc03c99591c27d44a2e6dfda364b Author: Robert Clausecker AuthorDate: 2023-07-12 18:23:21 +0000 Commit: Robert Clausecker CommitDate: 2023-07-16 17:36:17 +0000 lib/libc/string/bcmp.c: fix integer overflow bug bcmp() returned the number of remaining bytes when the main loop exits. In case of a match, this is zero, else a positive integer. On systems where SIZE_MAX > INT_MAX, the implicit conversion from size_t to int in the return value may cause the number of remaining bytes to overflow, becoming zero and falsely indicating a successful comparison. Fix the bug by always returning 0 on equality, 1 otherwise. PR: 272474 Approved by: emaste Reviewed by: imp MFC After: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D41011 --- lib/libc/string/bcmp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libc/string/bcmp.c b/lib/libc/string/bcmp.c index 96cd49039eee..c42fe79ddb2f 100644 --- a/lib/libc/string/bcmp.c +++ b/lib/libc/string/bcmp.c @@ -51,7 +51,7 @@ bcmp(const void *b1, const void *b2, size_t length) p2 = (char *)b2; do if (*p1++ != *p2++) - break; + return (1); while (--length); - return (length); + return (0); } From nobody Sun Jul 16 18:46:03 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R3vLN0fgGz4mpKd; Sun, 16 Jul 2023 18:46: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 4R3vLM5VGcz4FRs; Sun, 16 Jul 2023 18:46:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689533163; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wZJ4yuxamjsLW3fVDb69ICmr/dGl1j4IPQohDnAgVc0=; b=puk3OYBp1VNdt25A9QIm0h//Fejjr2P2LyEnK3pI3hwU3VAprIVdewyh8/zGaNQ3MbGwDP E6WOSGqpYQfjBcAQxkkHoU/r+V5HZ3Bv4dUzsXi6FyW9hkSOjj6+wSj9P97D+BvVztyQpn XTNDfAQcy+tmfGgYpoMqy2zjiA1ca4kTT3nYNfazPBfu2zscPIUfWH5EbSVw4ikzM/LMVi 7zNYMhvqyAuhVB9PrX5CZyLs14rA3Lfvu5FPIHPT5q+7tY/aghqI+L6fU6AdZK/VYcWD2z 4pZIU8PJu/FYo1lab3t2DdOmJEwe0dGU+uAPT7Dd/6LG+t0sKp1f1LsVC4L1eA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689533163; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wZJ4yuxamjsLW3fVDb69ICmr/dGl1j4IPQohDnAgVc0=; b=rVOm5yjf0wc5XfDKhvECdW1CT8nzg6VAYDl4t//TbgvlnuMrenLr76qdV7736LPRUNZ+q/ DRXQaBWIe4e4fx/Bwio0B7KlRnMJ9vEvF/wxBJ3t1mv7B8V3B9MzM1KGNOSBkC/0VKiQUJ rUx0/Pw9dkJxzMf8AaYY5s0DKHR3mR66EQza82Izkn8CfEhktVhNR51hydOm3q1qY8JXl+ npNyZmGRmQCloEKPz4tBtIbojfsNNyo3lhE7TQSPVegw4xwyjW8Sz5Qwx6bEFvgUnD1IWO WG44rxTurQlGoiYR3onNc3PRyc01bI/PAeHiwjEe9xGJEOwdcQ0tE1z5nKJLVQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689533163; a=rsa-sha256; cv=none; b=L4S1Rx94RLt2GjSLYGpyCYBUkoMvgjBrl+arWHxebjquojB5CyBZKBWFG6vKSFb5Rgufej XCR1C9CN2qiJN4L1clemS+nG1LGDHT1vLv4mNQ3NEOfDuMTJ006cY4MJ956juJgEEnSljA rnx9LRS4xALmgUCnELwmiRaSRhJNb9ndfNqliYk7z5C7wcqBdS3FJkCxToWX3gD9W1LWcJ J2+XGXoUOX34Tb3rBvOzJoLVJo/YeyYTR91fKn4sb2qUhK9jTBgQ3Ys329ws5GgKEA5oMf J5CillYWEExVWD3jb711WcZlEdFQ+yqwfJWLrglfL6/4ZjOyrbElwEEXdGkKNQ== 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 4R3vLM4VTYzshB; Sun, 16 Jul 2023 18:46: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 36GIk3JG095751; Sun, 16 Jul 2023 18:46:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36GIk3Yb095750; Sun, 16 Jul 2023 18:46:03 GMT (envelope-from git) Date: Sun, 16 Jul 2023 18:46:03 GMT Message-Id: <202307161846.36GIk3Yb095750@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: 881fc203567e - main - Merge commit 8757ce490130 from llvm-project (by Simon Pilgrim): List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 881fc203567e85648f2f591a75c4674be2bee0ed Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=881fc203567e85648f2f591a75c4674be2bee0ed commit 881fc203567e85648f2f591a75c4674be2bee0ed Author: Dimitry Andric AuthorDate: 2023-07-16 18:45:29 +0000 Commit: Dimitry Andric CommitDate: 2023-07-16 18:45:29 +0000 Merge commit 8757ce490130 from llvm-project (by Simon Pilgrim): [PowerPC] Replace PPCISD::VABSD cases with generic ISD::ABDU(X,Y) node A move towards using the generic ISD::ABDU nodes on more backends Also support ISD::ABDS for v4i32 types using the existing signbit flip trick PowerPC has a select(icmp_ugt(x,y),sub(x,y),sub(y,x)) -> abdu(x,y) combine that I intend to move to DAGCombiner in a future patch. The ABS(SUB(X,Y)) -> PPCISD::VABSD(X,Y,1) v4i32 combine wasn't legal (https://alive2.llvm.org/ce/z/jc2hLU) - so I've removed it, having already added the legal sub nsw tests equivalent. Differential Revision: https://reviews.llvm.org/D142313 This fixes a "Wasn't expecting to be able to lower this!" fatal error when compiling graphics/opencv for PowerPC. Requested by: pkubaj PR: 271047 MFC after: 1 month --- .../llvm/lib/Target/PowerPC/PPCISelLowering.cpp | 85 ++++------------------ .../llvm/lib/Target/PowerPC/PPCISelLowering.h | 16 ---- .../llvm/lib/Target/PowerPC/PPCInstrVSX.td | 23 +++--- 3 files changed, 24 insertions(+), 100 deletions(-) diff --git a/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCISelLowering.cpp b/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCISelLowering.cpp index 77630cf027fa..cf1cdad3fee6 100644 --- a/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCISelLowering.cpp +++ b/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCISelLowering.cpp @@ -1299,6 +1299,11 @@ PPCTargetLowering::PPCTargetLowering(const PPCTargetMachine &TM, setOperationAction(ISD::SIGN_EXTEND_INREG, MVT::v2i16, Legal); setOperationAction(ISD::SIGN_EXTEND_INREG, MVT::v2i32, Legal); setOperationAction(ISD::SIGN_EXTEND_INREG, MVT::v2i64, Legal); + + setOperationAction(ISD::ABDU, MVT::v16i8, Legal); + setOperationAction(ISD::ABDU, MVT::v8i16, Legal); + setOperationAction(ISD::ABDU, MVT::v4i32, Legal); + setOperationAction(ISD::ABDS, MVT::v4i32, Legal); } if (Subtarget.hasP10Vector()) { @@ -1386,7 +1391,7 @@ PPCTargetLowering::PPCTargetLowering(const PPCTargetMachine &TM, } if (Subtarget.hasP9Altivec()) { - setTargetDAGCombine({ISD::ABS, ISD::VSELECT}); + setTargetDAGCombine({ISD::VSELECT}); } setLibcallName(RTLIB::LOG_F128, "logf128"); @@ -1743,7 +1748,6 @@ const char *PPCTargetLowering::getTargetNodeName(unsigned Opcode) const { case PPCISD::RFEBB: return "PPCISD::RFEBB"; case PPCISD::XXSWAPD: return "PPCISD::XXSWAPD"; case PPCISD::SWAP_NO_CHAIN: return "PPCISD::SWAP_NO_CHAIN"; - case PPCISD::VABSD: return "PPCISD::VABSD"; case PPCISD::BUILD_FP128: return "PPCISD::BUILD_FP128"; case PPCISD::BUILD_SPE64: return "PPCISD::BUILD_SPE64"; case PPCISD::EXTRACT_SPE: return "PPCISD::EXTRACT_SPE"; @@ -16008,8 +16012,6 @@ SDValue PPCTargetLowering::PerformDAGCombine(SDNode *N, } case ISD::BUILD_VECTOR: return DAGCombineBuildVector(N, DCI); - case ISD::ABS: - return combineABS(N, DCI); case ISD::VSELECT: return combineVSelect(N, DCI); } @@ -17437,24 +17439,6 @@ SDValue PPCTargetLowering::combineTRUNCATE(SDNode *N, SDLoc dl(N); SDValue Op0 = N->getOperand(0); - // fold (truncate (abs (sub (zext a), (zext b)))) -> (vabsd a, b) - if (Subtarget.hasP9Altivec() && Op0.getOpcode() == ISD::ABS) { - EVT VT = N->getValueType(0); - if (VT != MVT::v4i32 && VT != MVT::v8i16 && VT != MVT::v16i8) - return SDValue(); - SDValue Sub = Op0.getOperand(0); - if (Sub.getOpcode() == ISD::SUB) { - SDValue SubOp0 = Sub.getOperand(0); - SDValue SubOp1 = Sub.getOperand(1); - if ((SubOp0.getOpcode() == ISD::ZERO_EXTEND) && - (SubOp1.getOpcode() == ISD::ZERO_EXTEND)) { - return DCI.DAG.getNode(PPCISD::VABSD, dl, VT, SubOp0.getOperand(0), - SubOp1.getOperand(0), - DCI.DAG.getTargetConstant(0, dl, MVT::i32)); - } - } - } - // Looking for a truncate of i128 to i64. if (Op0.getValueType() != MVT::i128 || N->getValueType(0) != MVT::i64) return SDValue(); @@ -17664,54 +17648,12 @@ isMaskAndCmp0FoldingBeneficial(const Instruction &AndI) const { return true; } -// Transform (abs (sub (zext a), (zext b))) to (vabsd a b 0) -// Transform (abs (sub (zext a), (zext_invec b))) to (vabsd a b 0) -// Transform (abs (sub (zext_invec a), (zext_invec b))) to (vabsd a b 0) -// Transform (abs (sub (zext_invec a), (zext b))) to (vabsd a b 0) -// Transform (abs (sub a, b) to (vabsd a b 1)) if a & b of type v4i32 -SDValue PPCTargetLowering::combineABS(SDNode *N, DAGCombinerInfo &DCI) const { - assert((N->getOpcode() == ISD::ABS) && "Need ABS node here"); - assert(Subtarget.hasP9Altivec() && - "Only combine this when P9 altivec supported!"); - EVT VT = N->getValueType(0); - if (VT != MVT::v4i32 && VT != MVT::v8i16 && VT != MVT::v16i8) - return SDValue(); - - SelectionDAG &DAG = DCI.DAG; - SDLoc dl(N); - if (N->getOperand(0).getOpcode() == ISD::SUB) { - // Even for signed integers, if it's known to be positive (as signed - // integer) due to zero-extended inputs. - unsigned SubOpcd0 = N->getOperand(0)->getOperand(0).getOpcode(); - unsigned SubOpcd1 = N->getOperand(0)->getOperand(1).getOpcode(); - if ((SubOpcd0 == ISD::ZERO_EXTEND || - SubOpcd0 == ISD::ZERO_EXTEND_VECTOR_INREG) && - (SubOpcd1 == ISD::ZERO_EXTEND || - SubOpcd1 == ISD::ZERO_EXTEND_VECTOR_INREG)) { - return DAG.getNode(PPCISD::VABSD, dl, N->getOperand(0).getValueType(), - N->getOperand(0)->getOperand(0), - N->getOperand(0)->getOperand(1), - DAG.getTargetConstant(0, dl, MVT::i32)); - } - - // For type v4i32, it can be optimized with xvnegsp + vabsduw - if (N->getOperand(0).getValueType() == MVT::v4i32 && - N->getOperand(0).hasOneUse()) { - return DAG.getNode(PPCISD::VABSD, dl, N->getOperand(0).getValueType(), - N->getOperand(0)->getOperand(0), - N->getOperand(0)->getOperand(1), - DAG.getTargetConstant(1, dl, MVT::i32)); - } - } - - return SDValue(); -} - // For type v4i32/v8ii16/v16i8, transform -// from (vselect (setcc a, b, setugt), (sub a, b), (sub b, a)) to (vabsd a, b) -// from (vselect (setcc a, b, setuge), (sub a, b), (sub b, a)) to (vabsd a, b) -// from (vselect (setcc a, b, setult), (sub b, a), (sub a, b)) to (vabsd a, b) -// from (vselect (setcc a, b, setule), (sub b, a), (sub a, b)) to (vabsd a, b) +// from (vselect (setcc a, b, setugt), (sub a, b), (sub b, a)) to (abdu a, b) +// from (vselect (setcc a, b, setuge), (sub a, b), (sub b, a)) to (abdu a, b) +// from (vselect (setcc a, b, setult), (sub b, a), (sub a, b)) to (abdu a, b) +// from (vselect (setcc a, b, setule), (sub b, a), (sub a, b)) to (abdu a, b) +// TODO: Move this to DAGCombiner? SDValue PPCTargetLowering::combineVSelect(SDNode *N, DAGCombinerInfo &DCI) const { assert((N->getOpcode() == ISD::VSELECT) && "Need VSELECT node here"); @@ -17762,9 +17704,8 @@ SDValue PPCTargetLowering::combineVSelect(SDNode *N, TrueOpnd.getOperand(1) == CmpOpnd2 && FalseOpnd.getOperand(0) == CmpOpnd2 && FalseOpnd.getOperand(1) == CmpOpnd1) { - return DAG.getNode(PPCISD::VABSD, dl, N->getOperand(1).getValueType(), - CmpOpnd1, CmpOpnd2, - DAG.getTargetConstant(0, dl, MVT::i32)); + return DAG.getNode(ISD::ABDU, dl, N->getOperand(1).getValueType(), CmpOpnd1, + CmpOpnd2, DAG.getTargetConstant(0, dl, MVT::i32)); } return SDValue(); diff --git a/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCISelLowering.h b/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCISelLowering.h index b80479427c2e..1a01cadbeedb 100644 --- a/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCISelLowering.h +++ b/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCISelLowering.h @@ -440,21 +440,6 @@ namespace llvm { /// and thereby have no chain. SWAP_NO_CHAIN, - /// An SDNode for Power9 vector absolute value difference. - /// operand #0 vector - /// operand #1 vector - /// operand #2 constant i32 0 or 1, to indicate whether needs to patch - /// the most significant bit for signed i32 - /// - /// Power9 VABSD* instructions are designed to support unsigned integer - /// vectors (byte/halfword/word), if we want to make use of them for signed - /// integer vectors, we have to flip their sign bits first. To flip sign bit - /// for byte/halfword integer vector would become inefficient, but for word - /// integer vector, we can leverage XVNEGSP to make it efficiently. eg: - /// abs(sub(a,b)) => VABSDUW(a+0x80000000, b+0x80000000) - /// => VABSDUW((XVNEGSP a), (XVNEGSP b)) - VABSD, - /// FP_EXTEND_HALF(VECTOR, IDX) - Custom extend upper (IDX=0) half or /// lower (IDX=1) half of v4f32 to v2f64. FP_EXTEND_HALF, @@ -1422,7 +1407,6 @@ namespace llvm { SDValue combineFMALike(SDNode *N, DAGCombinerInfo &DCI) const; SDValue combineTRUNCATE(SDNode *N, DAGCombinerInfo &DCI) const; SDValue combineSetCC(SDNode *N, DAGCombinerInfo &DCI) const; - SDValue combineABS(SDNode *N, DAGCombinerInfo &DCI) const; SDValue combineVSelect(SDNode *N, DAGCombinerInfo &DCI) const; SDValue combineVectorShuffle(ShuffleVectorSDNode *SVN, SelectionDAG &DAG) const; diff --git a/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCInstrVSX.td b/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCInstrVSX.td index 3c742075b111..2e52fbd3c333 100644 --- a/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCInstrVSX.td +++ b/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCInstrVSX.td @@ -76,9 +76,6 @@ def SDT_PPCxxswapd : SDTypeProfile<1, 1, [ def SDTVecConv : SDTypeProfile<1, 2, [ SDTCisVec<0>, SDTCisVec<1>, SDTCisPtrTy<2> ]>; -def SDTVabsd : SDTypeProfile<1, 3, [ - SDTCisVec<0>, SDTCisSameAs<0, 1>, SDTCisSameAs<0, 2>, SDTCisVT<3, i32> -]>; def SDT_PPCld_vec_be : SDTypeProfile<1, 1, [ SDTCisVec<0>, SDTCisPtrTy<1> ]>; @@ -105,7 +102,6 @@ def PPCmtvsrz : SDNode<"PPCISD::MTVSRZ", SDTUnaryOp, []>; def PPCsvec2fp : SDNode<"PPCISD::SINT_VEC_TO_FP", SDTVecConv, []>; def PPCuvec2fp: SDNode<"PPCISD::UINT_VEC_TO_FP", SDTVecConv, []>; def PPCswapNoChain : SDNode<"PPCISD::SWAP_NO_CHAIN", SDT_PPCxxswapd>; -def PPCvabsd : SDNode<"PPCISD::VABSD", SDTVabsd, []>; def PPCfpexth : SDNode<"PPCISD::FP_EXTEND_HALF", SDT_PPCfpexth, []>; def PPCldvsxlh : SDNode<"PPCISD::LD_VSX_LH", SDT_PPCldvsxlh, @@ -4808,20 +4804,23 @@ def : Pat<(f128 (uint_to_fp (i32 (PPCmfvsr f64:$src)))), // Any Power9 VSX subtarget that supports Power9 Altivec. let Predicates = [HasVSX, HasP9Altivec] in { -// Put this P9Altivec related definition here since it's possible to be -// selected to VSX instruction xvnegsp, avoid possible undef. -def : Pat<(v4i32 (PPCvabsd v4i32:$A, v4i32:$B, (i32 0))), +// Unsigned absolute-difference. +def : Pat<(v4i32 (abdu v4i32:$A, v4i32:$B)), (v4i32 (VABSDUW $A, $B))>; -def : Pat<(v8i16 (PPCvabsd v8i16:$A, v8i16:$B, (i32 0))), +def : Pat<(v8i16 (abdu v8i16:$A, v8i16:$B)), (v8i16 (VABSDUH $A, $B))>; -def : Pat<(v16i8 (PPCvabsd v16i8:$A, v16i8:$B, (i32 0))), +def : Pat<(v16i8 (abdu v16i8:$A, v16i8:$B)), (v16i8 (VABSDUB $A, $B))>; -// As PPCVABSD description, the last operand indicates whether do the -// sign bit flip. -def : Pat<(v4i32 (PPCvabsd v4i32:$A, v4i32:$B, (i32 1))), +// Signed absolute-difference. +// Power9 VABSD* instructions are designed to support unsigned integer +// vectors (byte/halfword/word), if we want to make use of them for signed +// integer vectors, we have to flip their sign bits first. To flip sign bit +// for byte/halfword integer vector would become inefficient, but for word +// integer vector, we can leverage XVNEGSP to make it efficiently. +def : Pat<(v4i32 (abds v4i32:$A, v4i32:$B)), (v4i32 (VABSDUW (XVNEGSP $A), (XVNEGSP $B)))>; } // HasVSX, HasP9Altivec From nobody Sun Jul 16 20:51:30 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R3y770sN8z4n072; Sun, 16 Jul 2023 20:51: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 4R3y7707CJz3nts; Sun, 16 Jul 2023 20:51:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689540691; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KfKcWwUtNJSX9g9/TytGDMn4seEt3kUNIdHzzRjzR90=; b=MJIGEwk2trX8LJICblMTQ54jMoHGnSiFucc54tMknlaq/NEXplNcBZXSqVNigV8sunsZfc jJWigHTw5/gLCXPY5v3wu7L65vsZOoGyi29bxz8E2n7VcVduKwQXq8SqoBpntxz/lfjDHE QVUD8rbIfzL1SYT6QKkm5hYQ4/tElgHE4lVl93xLPSeKoBto0+fuybgfmCDkAoJU1eY4/0 fEH0p1kEyk7PWAS/h3ViDes97+tYmiA4t1K3ekJYkniSsDJoU57/vaz8U7gIqJW+q7BHxc KaIqYDyW2/NRs+7+D2pZ4zWFUs811kPHy7/ELjWUUNv7gSkwmMc/SQ95mrdzbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689540691; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KfKcWwUtNJSX9g9/TytGDMn4seEt3kUNIdHzzRjzR90=; b=gY+Tcq8UHSZ4QFC6H5aDqeLn9RlXBv/UqWT6GwqeY4hgxKOowXTAdvDF758J9Fa2jbqyYe PQG29m0APqt7IYqDET6PPkYdF63J9EF5FlX68xdm19IpV/YpHlwDN9RU1+OKElZQaoSOwb l3Vm6Vy7bRb6ExBaLsWRYE3uJfCgux9pJ8ECGzdhxGUY7Aj4FBhNOsVnpne9gkiosmir9l g02SK06PtdaSVrSd19g88rUjG/cIWzRg9VvsuTikAUL54pJp7Kn09Qh27DO1NdJdQ9idzo 5sLUMh7kU0YNalQUvdtGCqhWoVuA6Ol2/Ep5PCs2PB7jbWCaQTWxbZyXdQfNFA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689540691; a=rsa-sha256; cv=none; b=r06AvjnnxUHjaTyulRGYaoRyJtOzjmw6/kY9sUTwrCYAz0kEqZxd2yKX/BeDV7j9tZVqGF nTUXpcczCplH0tmbp5v7/52mXhMBiEAjk/DXg5LD8Gg8i9tC7C+FAg78L+aHaph5W0UOWn DwoMTrJHZxCyMVALrgtlkzeH0tuSD44uLisrQ+h3ICF63QQqD61Yo9EleEe8VNL3whdbib wQDcbyPRx/tHEOPNShdC92uy1ObVjIyNk8cEUR+LnY6uPD0092C+ovFqFaY9yoDGDeSi3K sPQfjP9LBCBfzNUkO3/HKh9+ZEETAoJ4Sqq6obZ1JXoFGm35Gr+DbSNOjsvoIA== 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 4R3y766Jcqzwn6; Sun, 16 Jul 2023 20:51: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 36GKpUfC009128; Sun, 16 Jul 2023 20:51:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36GKpUPI009127; Sun, 16 Jul 2023 20:51:30 GMT (envelope-from git) Date: Sun, 16 Jul 2023 20:51:30 GMT Message-Id: <202307162051.36GKpUPI009127@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Doug Moore Subject: git: b8cc13fa21df - main - riscv pmap: another vm_radix_init List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dougm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b8cc13fa21df6081f11eb845e064ade37172195a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=b8cc13fa21df6081f11eb845e064ade37172195a commit b8cc13fa21df6081f11eb845e064ade37172195a Author: Doug Moore AuthorDate: 2023-07-16 20:48:43 +0000 Commit: Doug Moore CommitDate: 2023-07-16 20:48:43 +0000 riscv pmap: another vm_radix_init pmap_pinit0 also needs to initialize a vm_radix, in case vm_radix_init does anything but zeroing fields. Reported by: alc Reviewed by: alc Differential Revision: https://reviews.freebsd.org/D41055 --- sys/riscv/riscv/pmap.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/riscv/riscv/pmap.c b/sys/riscv/riscv/pmap.c index 6cada93cdc91..7580f091ad86 100644 --- a/sys/riscv/riscv/pmap.c +++ b/sys/riscv/riscv/pmap.c @@ -1327,6 +1327,7 @@ pmap_pinit0(pmap_t pmap) pmap->pm_satp = pmap_satp_mode() | (vtophys(pmap->pm_top) >> PAGE_SHIFT); CPU_ZERO(&pmap->pm_active); + vm_radix_init(&pmap->pm_root); pmap_activate_boot(pmap); } From nobody Mon Jul 17 05:25:37 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R49XK62lvz4n8WT; Mon, 17 Jul 2023 05:25: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 4R49XK5XMSz3vhl; Mon, 17 Jul 2023 05:25:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689571537; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/bH05i4FzFUBNqdX5SSrrGYRQ8Np+YkRo92P9/NbQ3o=; b=ktM7qDqORCsBi8aD6OzaMkd1Q1j+wfWQFE3xo8HCrhz1Kx0UnMX+JcVmfWXtA12e9WrjIa 7temQswvMxBU+fd+tIjP1TCJvkVsfPaueA1UD1DlZvY+QfAbs1+TeVXHlVE1Cf+yly0EPc Ev49dpti2DYOh9vZd1v1/SP/JgST3C33kYkb4Vv25/DL1/Og/hI7mY+kpAUCxdurBe0QX7 Hq4aluUVfzs0fqLlQvwDelEs954Bx+AZnhGE9y7wr8A+UewCLX6jTGlbE+zUTnsm8+pUj0 kZv2aLgrXa6UBZRo3veiXmHP9BSjf6G6sRFeErWKPmNPyUHQhg2T8YJaX3wR9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689571537; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/bH05i4FzFUBNqdX5SSrrGYRQ8Np+YkRo92P9/NbQ3o=; b=I/4L0pH605VpbZFW2q1bvX8PXg+DLxslrENMVwpm5ySCU/j+QzY0wKwGE4Tb3rfagcOK53 d/5mtTz6H8Qje4Za8SxKQa2azSGp7yo9IrS7DigOgEBIOuDwEZCtwSPSJTZx+6qF7PhvUT XTG9awnW4gKMmW+rq6Bc8W3kg6DqHq/YMwEjk4BNVLKUypEZ1U5urumN+almbRZ8x/kcd1 PfP+DzA/WVPygrooCTyr4pH/Ozk+RG2LcrdHJHekLsRYtt89BmR8JT0ccMO9BbL1nd1ItH Oal0sn9OhRYXYTGvis7JHD/1XjdsiV9xwYvFrdIwJ8dp3TYRUy0bnO6eCCIw9w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689571537; a=rsa-sha256; cv=none; b=lj+bhM+cQreoxEKEeeoMRMnEJB/HTTIb2FGqAGsXtmfqV5FouLC88mzS/zW5AozH2ozWXe OtYBFr51ICslxyPn1ooNFh/2rgvZsTV66FLWr/8Wooc055kpLyu/GldldII87cXIVyQTU9 qX2/H24wAmv6YI1VIVoNC+0PULETI6SGvBWWwcidleUoJ5CV+9x4jqo0F5sV5aXnUOvE3a P9CNxpUWWLin8N3GC+jhCL+j4eZTo5JTdy9Nk9jG0D8IZkOkxXtMyw0yCKoTGPaf1HbRFi mWzCwDY/mbEwAU1qBeiqmvLhHZZj8ZSZsSyBbu+3dvlZS6UIVzlzZbCpJoq97g== 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 4R49XK4cTNz1BK7; Mon, 17 Jul 2023 05:25: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 36H5PbbR054299; Mon, 17 Jul 2023 05: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 36H5PbFo054298; Mon, 17 Jul 2023 05:25:37 GMT (envelope-from git) Date: Mon, 17 Jul 2023 05:25:37 GMT Message-Id: <202307170525.36H5PbFo054298@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: be4c7f273508 - main - libm: correctly test for for NaN and Infinity in sinpi(), cospi(), and tanpi() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: be4c7f273508994638b68d2fae742be37d3cb117 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=be4c7f273508994638b68d2fae742be37d3cb117 commit be4c7f273508994638b68d2fae742be37d3cb117 Author: Steve Kargl AuthorDate: 2023-07-17 05:19:28 +0000 Commit: Konstantin Belousov CommitDate: 2023-07-17 05:23:27 +0000 libm: correctly test for for NaN and Infinity in sinpi(), cospi(), and tanpi() The current versions of lib/msun/src/s_cospi.c, s_sinpi.c and s_tanpi.c all exhibit the same defect. After checking for various numeric ranges, they check to see whether the input argument is a NaN or an Infinity. However, the code uses a value of 0x7f80000 instead of the correct value of 0x7ff00000. If you review s_cospif.c, s_sinpif.c, and s_tanpif.c, you will see that the equivalent statements in these functions are accurate and have appropriate source comments. The impact of these defects is to flag some valid input values as invalid and raise a pole error (divide by zero). Reported by: Paul Green PR: 272539 MFC after: 1 week --- lib/msun/src/s_cospi.c | 3 ++- lib/msun/src/s_sinpi.c | 3 ++- lib/msun/src/s_tanpi.c | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/msun/src/s_cospi.c b/lib/msun/src/s_cospi.c index 860219efd3e4..2e2f92733a86 100644 --- a/lib/msun/src/s_cospi.c +++ b/lib/msun/src/s_cospi.c @@ -138,7 +138,8 @@ cospi(double x) return (j0 & 1 ? -c : c); } - if (ix >= 0x7f800000) + /* x = +-inf or nan. */ + if (ix >= 0x7ff00000) return (vzero / vzero); /* diff --git a/lib/msun/src/s_sinpi.c b/lib/msun/src/s_sinpi.c index 858459a5fcb4..bc3759e567a3 100644 --- a/lib/msun/src/s_sinpi.c +++ b/lib/msun/src/s_sinpi.c @@ -155,7 +155,8 @@ sinpi(double x) return ((hx & 0x80000000) ? -s : s); } - if (ix >= 0x7f800000) + /* x = +-inf or nan. */ + if (ix >= 0x7ff00000) return (vzero / vzero); /* diff --git a/lib/msun/src/s_tanpi.c b/lib/msun/src/s_tanpi.c index 01d4c74367fd..f911d56156b3 100644 --- a/lib/msun/src/s_tanpi.c +++ b/lib/msun/src/s_tanpi.c @@ -163,7 +163,7 @@ tanpi(double x) } /* x = +-inf or nan. */ - if (ix >= 0x7f800000) + if (ix >= 0x7ff00000) return (vzero / vzero); /* From nobody Mon Jul 17 12:54:02 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R4MTk50w5z4nBBB; Mon, 17 Jul 2023 12:54: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 4R4MTk4NFlz43xS; Mon, 17 Jul 2023 12:54:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689598442; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=K238ZALnd714axJ9ZQw4MN9ZVK/gYCYUE1gLuoIL+HA=; b=Udt5EnQlb7/hrm6QWG8KV8GPiUMTjuQ/b9yTC88C92/k7QjOcJbWX44clc5QygclzeqPKc 6WMkTUufQ6x1lIFoscmSfnyLw7s9a8kR2k/KCqwdF3bTrab7ulaNrAtxopftFcxQryAJh1 wbX8VJkzWT7XkCYhv8sIrkzw+g2Q4ObyW6wuJpWt/T0qFxNlNbaycNha+I8TzeURZhD9vJ Nu9PKSvHdO3rgKgGi0/RqJVytfT3QzvejiGR5PBkUv8J+1gJe5R0h8uV6WNHU7kxuEtq80 fWDmr6qeyDXLvcREepTWLGG6UKccj4e2Qm82SGeLuytgM7XgjGkMbX6IrFD6FQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689598442; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=K238ZALnd714axJ9ZQw4MN9ZVK/gYCYUE1gLuoIL+HA=; b=g5W4ip/MtaENdVVyXQ7lpl+g6CRYPRP4r+u0X5/YLWk8FEfJJ+u0FF8+vV4mJRzc08i6t9 CSrMlUg9yO7wdiSxb2DqgKHNDmURvICfmfCUFAK1ObtTkP+UoyCo7VxD9NJFXqQfAdMj3n LN2wCSlLI8bUPrLgoTrYU+Hz3Ba0JOkDte9D+pG1spq+F2l8VSsByx/TU1b3xgc4zrYzTa BFN7E+y4pPzUiWNfK9WyT4zNtVZAos9qwdFZA8Bdm5J7yWQKdbibCWcEB+WwQWGieHX1i2 Dk9XlkgUJA9UxNu/NM5rxyJsmhKHRoxQfK+hb9b1nup+I7diDzJslDe4w3B2+Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689598442; a=rsa-sha256; cv=none; b=XYCDtFqqubQ+laBqABZuwiiZkSfBV4oRxdE4bXqYNjBl5W+HzN02FAwB60qqHF3WQ5UiVJ VxIB0Q3piluQniRDwRCmRr38hIhHPL1SMOceYASqjuBoOFgjcbVJf04Ki+6GYFcXneXqq/ IwKngvbJEM25MUE+Mnj5EU5so1ESaqhTEU4tUjVM/whe4FhZuoDPy2s7dsinUE2mC4/MCR xelWPG16PThaTkml3XMSxItTWutEwWduLa+FXGaSYWpe+jwtz908ZWrx0rFMmeKb0xB0mS SKHx7HDOaXfytX06So1T9tIqsmKa8LHwfI1of/CMo/WJDLKno0qRknFFPggCXw== 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 4R4MTk3S6czPXC; Mon, 17 Jul 2023 12:54: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 36HCs2RS097836; Mon, 17 Jul 2023 12:54:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36HCs21f097835; Mon, 17 Jul 2023 12:54:02 GMT (envelope-from git) Date: Mon, 17 Jul 2023 12:54:02 GMT Message-Id: <202307171254.36HCs21f097835@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 73fb7a7a7342 - main - style.Makefile.5: Stop documenting NO_MAN List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 73fb7a7a7342bb590ba53e406b564df0d90c3304 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=73fb7a7a7342bb590ba53e406b564df0d90c3304 commit 73fb7a7a7342bb590ba53e406b564df0d90c3304 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2023-07-17 12:50:33 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2023-07-17 12:52:28 +0000 style.Makefile.5: Stop documenting NO_MAN NO_MAN has been an error since 2020 according to UPDATING. PR: 231357 MFC after: 3 days --- share/man/man5/style.Makefile.5 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/share/man/man5/style.Makefile.5 b/share/man/man5/style.Makefile.5 index 4ced85704640..575fb0f38d2f 100644 --- a/share/man/man5/style.Makefile.5 +++ b/share/man/man5/style.Makefile.5 @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 18, 2021 +.Dd July 17, 2023 .Dt STYLE.MAKEFILE 5 .Os .Sh NAME @@ -66,7 +66,7 @@ order is: .Va PROG Ns / Ns Oo Va SH Oc Ns Va LIB Ns / Ns Va SCRIPTS .Va FILES .Va LINKS -.Oo Va NO_ Oc Ns Va MAN +.Va MAN .Va MLINKS .Va INCS .Va SRCS @@ -88,7 +88,7 @@ order is: .Va INCS .Va FILES .Va LINKS -.Oo Va NO_ Oc Ns Va MAN +.Va MAN .Va MLINKS . .It Omit From nobody Mon Jul 17 13:07:35 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R4MnM5L4Rz4nJrd; Mon, 17 Jul 2023 13:07: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 4R4MnM4wGpz47Xd; Mon, 17 Jul 2023 13:07:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689599255; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AcQn8y6IIqzPrJMx9sLKhl8nMIROfYEdkBl37h92x0k=; b=JX69HfD/nOJuWuwoNuPYGgn+TWdwSdNo6hsGwdr2lCE815ocFE3qys4kQK5K+O6nPeJjHK EDullyzMgghNFe87Lq19ow87yvkwLQwP7uwqkI0xewX+Vc3VnxjRLsvr/tCiHnzleTRjSA WftcKHOApIDclsR49karn2tqtAVJTdTJ5FXNwRAkmMhmD5c3S1yIOCLeQW+a2kipShmh3Y H53UJ1E6v5aYne+gJEHSGwdCaXI+q73jbGxhF7vC3BrKGY3WkEbniaJSq7WAnSR6SkDYs3 OHuadTUwjEZwGE+MEfCloneIxTcj5MNZFt7pVOmzFuP+O0zHPu5ASl8pzXlIJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689599255; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AcQn8y6IIqzPrJMx9sLKhl8nMIROfYEdkBl37h92x0k=; b=qm3ZRfjAagAHCSQQr3MugOMHrx1/XqChNjqJ6KvpJu7yatjrikPiySknGsApz7qNxFGdWj H24EIgO7rmfOAb39ByMf8WP9uYHEHMvCm2vDxQx0QyN73vVtXJgBmaNl8e8s24sRZaO/4g 1hngwdPrPNiiBWOLdOkT7G+tuq0ZgoWvX4zfcPl5abc5Z8AVfvJE7iJTUg/GhEKcpVjFLw PwsS9n2LJKfmnXIsxqXLt43qchVpqaqapRnojUchAJO9V5mmYnt7EKmZ2bpY0D0+fEPJe+ LCOp9O5metSN4x9p8i5kl5Wkrm7OlVEtX0He83Y5T+v3H6TyRuFBygCDjxppwg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689599255; a=rsa-sha256; cv=none; b=t3cVVIP5WYUT+em8HGbMfP3K6T3ERrtnG9WUq/9qtSd96ztdjY/Prr27svCVsEDgFREU23 mj98APemfY5q3/5eLFkaXfOSJZokrAML+mJnbXgRjqDXOMCYgIKQwye+vV3ibzQp4L6k37 Ini+5aNbnC5nTm7UcGMqi2lcmWpNPbO/6Kd7T6ZPNUepjxAVSTSA4z/yOJLuTD4Lv3/wza NQZTYSrGVJoYX1f4dHsRIc2eQKYNTm6114sTi+i+XXh9f9C9u15lzVMtZiVz34SBNk734r nlG4Om5Eg1lv+qMY+na7uQ8R5WZkB3Pb2g+AyMlarE+Mg8WV1JrlGI/GIeAAug== 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 4R4MnM3yjvzPfT; Mon, 17 Jul 2023 13:07: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 36HD7Zdv016353; Mon, 17 Jul 2023 13:07:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36HD7ZO8016352; Mon, 17 Jul 2023 13:07:35 GMT (envelope-from git) Date: Mon, 17 Jul 2023 13:07:35 GMT Message-Id: <202307171307.36HD7ZO8016352@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 22faf70d7e13 - main - style.Makefile.5: Remove $FreeBSD$ from examples List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 22faf70d7e137f39b6afe7da967679a7cdbe3507 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=22faf70d7e137f39b6afe7da967679a7cdbe3507 commit 22faf70d7e137f39b6afe7da967679a7cdbe3507 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2023-07-17 13:01:52 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2023-07-17 13:01:52 +0000 style.Makefile.5: Remove $FreeBSD$ from examples MFC after: 3 days --- share/man/man5/style.Makefile.5 | 4 ---- 1 file changed, 4 deletions(-) diff --git a/share/man/man5/style.Makefile.5 b/share/man/man5/style.Makefile.5 index 575fb0f38d2f..da475420013a 100644 --- a/share/man/man5/style.Makefile.5 +++ b/share/man/man5/style.Makefile.5 @@ -243,8 +243,6 @@ The simplest program .Pa Makefile is: .Bd -literal -offset indent -# $FreeBSD\&$ - PROG= foo \&.include @@ -254,8 +252,6 @@ The simplest library .Pa Makefile is: .Bd -literal -offset indent -# $FreeBSD\&$ - LIB= foo SHLIB_MAJOR= 1 MAN= libfoo.3 From nobody Mon Jul 17 13:07:36 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R4MnN6Z4Kz4nJdl; Mon, 17 Jul 2023 13:07:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R4MnN62N1z47YC; Mon, 17 Jul 2023 13:07:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689599256; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fy9/WctSyr1u6kCKWcjEDa/Op0gsXVoDHkigdB2bRI0=; b=mZqaayMPLe0Ay1vLf0klWc3uASQJ/a6W5o8qbQsddxAXyw1RJQ0F/tb9sSi8OSNMNnYOCe zwGI4+5jzaF4YBF7CrSvkX0+AEtnRt80lVYs0Ayf+KeWdoCBZxlPj5mMii5v5BETgbHp3s pZBrkX+086rAC3RJceeXBWWQXEkwAggmdrKxQE1ng++ojPODbBnK+U1X68KkwLm/TGH8OS 949iCaFiPVo0HPEIgfcAWGSbtX/X3rUjoTT+gVtGnRaIBlP+Ed5QYxK9XnI99atWhEsSvl 4dZx2kuAF4UhRriog8nzqcQJpYYUP8jxCa2ZU20/7+MQG+ygQ0vmYI2swp7lNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689599256; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fy9/WctSyr1u6kCKWcjEDa/Op0gsXVoDHkigdB2bRI0=; b=DVsXL/IqET2inO8GMKk0qfopgoFNkMXyJPRhnUps+Oe9z0XSn780FsuRYeaHVQoVF+/Fmw aPv5Yt2MjrvVeBJBqznFbQByITWCUTU2AE122vjSD7pivFt3+BWWAyVDgCeIjQECeP4GU/ UyaX9A5ZKOfeF/LDAgWdgknq3uuDpUQRuJNqdvO+SzA6VYmGNoAxyKzf5ee9wIVvwfjTN+ KtV26iQCiG/9OVb5kWfRZY7AZ4jlvwZMJQkqKg3HwvZkzxb30rabl4FNXwKi05vvuoFnJc lEuDZJpisAnEvskhREX36+Vae8015lURLXZ/1kiTGox5ENwbKNaDwQGxflcWFg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689599256; a=rsa-sha256; cv=none; b=PFaEq7YapMGOPPrJ1KP0CIFNuFpkby8NCNuir9bN4NS7BfY/in3PNPm2v9ZgzIFhJZ3AgI MGPBpFycrM+DHgP0Z1z4xoXJN1rF5rpismLNpn7RhGIqIRAlloYhQnEpY427HxPFsL+CZZ OYYJcUW9kil41N/cJS16SgWSqEnbMK6rDO23yf3bBbcuoC7l3U2+RQHx9Eq0z8VepGNLmr lI3yKhEuZKZPWa2jB7nk2bQ0vtHWRVgOJlyxp42+g3ikSfyu9e5S/hcV+ZzL5f+gc72WW3 okN3KEAJx7S86hqWdXD0pTTVZO64Fs+RoiyeUt/KcRxN6YmV3GwHfTH5AMXnwA== 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 4R4MnN585PzPfV; Mon, 17 Jul 2023 13:07: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 36HD7a7n016372; Mon, 17 Jul 2023 13:07:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36HD7avC016371; Mon, 17 Jul 2023 13:07:36 GMT (envelope-from git) Date: Mon, 17 Jul 2023 13:07:36 GMT Message-Id: <202307171307.36HD7avC016371@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 9e850513daf9 - main - style.Makefile.5: Wordsmith .PATH description List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9e850513daf9cd1db7980f1f38ef7051331293fd Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=9e850513daf9cd1db7980f1f38ef7051331293fd commit 9e850513daf9cd1db7980f1f38ef7051331293fd Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2023-07-17 13:06:02 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2023-07-17 13:06:02 +0000 style.Makefile.5: Wordsmith .PATH description MFC after: 3 days Fixes: 1ac5586c6d86 style.Makefile.5: Do not require $FreeBSD$ SCM IDs --- share/man/man5/style.Makefile.5 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man5/style.Makefile.5 b/share/man/man5/style.Makefile.5 index da475420013a..7cf8bdc53c9d 100644 --- a/share/man/man5/style.Makefile.5 +++ b/share/man/man5/style.Makefile.5 @@ -43,7 +43,7 @@ source tree. .Bl -bullet .It .Cm .PATH : -comes next if needed, and is spelled +comes first if needed, and is spelled .Dq Li ".PATH: " , with a single .Tn ASCII From nobody Mon Jul 17 15:20:15 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R4QkR5Yjjz4nG5R; Mon, 17 Jul 2023 15:20: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 4R4QkR4DC6z3l10; Mon, 17 Jul 2023 15:20:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689607215; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1sE+k9yNXOtTiel3Gy2TyS1e7Opf5BmxF0KEnTPT3Kg=; b=TF8YNZ49bH/J+FCO6iNCh8DUnXVOePKp+pZPzQdYXYAZ7woRK5WeooZvD5e3SSEB0gJr6o CbXU48Y27HL+boxVQ3VaiLBLA6j3FTov0cZ3b4FrrT1/VquPc+2T4Ri7M/m5rjnkwWwBPy rVmw8LGMefou1LlBM7ZviGQerF13o7ZLZi9Cl27lrzwj5orGCkLFqqGGkRRvWrVzF29ZJY cb9DfvDxsDiKkjgBJo/p2WfQBRCPdT6qO9TrndK45WhKdGuKWqartPekFhI/h6oju+0Q38 f10vzWxbi0XqvODlk+RxotZuRfd3ZiLpMM1QZqMkIHMVEsK8iRfic+5WcOH0aA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689607215; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1sE+k9yNXOtTiel3Gy2TyS1e7Opf5BmxF0KEnTPT3Kg=; b=Bi3z3IfiHZ04YZsLtm20pu7H7AUxSJ9/HyncN8upZCLEFdSnCxMRlCa5/vTtpG/Y3WfLwE qM/INLSwF/231HaB8D+NAXaIXBh9zg2/dmKmcmPJs/e540GWg9Gv8sWVygbi1apGWa78dL +InOVURIPCIhBMkb7AYJ6uaRvTp6vBIV0vFUMN/OrE5L7ci2MyZp31EQmFgWcEOk5jR5Tz oGNsVotWWTMbOQJEtUg/7dFuNw9bqtFPgVrrQpMskINCsjdJL+p1viw+srza6A7LhEdXdl lKrwCIOQSxwIKWTmkppUUkSajkn2D6b47ng0HC7+rIBfsyiL+DC/8NmlJakvWA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689607215; a=rsa-sha256; cv=none; b=vSLrzU53x8vM2OMHOWDQ3IepwT9HPttBXS4deHepyg+PJ5n/t0shSpniy/Dqpts439lA7r K+8mph2VMeOg2Ktzsq5HpGs4u4i27mi+o+/iHUQRmDcYjsi/OldhZsG7olSXlTTILgs261 uXGSoK2NCqevo5A45qVE07FBDnV8TawEK0xyj1S2qvBEXrIIgRsjs31Ljtd4UqGw8Dcj8y saj9f7xEBLXDSJj7qQB7qizT2EwO8H91aaINT3PhLGz035b0szJCU6Juoq1YD0TQOnLUi1 4rQp4DYgUJYA0xJXLHZDuSR4LMaubF7GrsN7jtd1MxAeZbaVyZoFJe/puhiYOQ== 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 4R4QkR3BnwzT0t; Mon, 17 Jul 2023 15:20: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 36HFKFNK037722; Mon, 17 Jul 2023 15:20:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36HFKFFq037715; Mon, 17 Jul 2023 15:20:15 GMT (envelope-from git) Date: Mon, 17 Jul 2023 15:20:15 GMT Message-Id: <202307171520.36HFKFFq037715@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 0855749d296c - main - bhyve: Fix whitespace in bhyverun.c List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0855749d296c5e91d0eecea4a7871ac86259911f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=0855749d296c5e91d0eecea4a7871ac86259911f commit 0855749d296c5e91d0eecea4a7871ac86259911f Author: Mark Johnston AuthorDate: 2023-07-17 15:11:20 +0000 Commit: Mark Johnston CommitDate: 2023-07-17 15:15:49 +0000 bhyve: Fix whitespace in bhyverun.c No functional change intended. MFC after: 1 week --- usr.sbin/bhyve/bhyverun.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/usr.sbin/bhyve/bhyverun.c b/usr.sbin/bhyve/bhyverun.c index 2feb78a0bdf0..2a2a0f028d9d 100644 --- a/usr.sbin/bhyve/bhyverun.c +++ b/usr.sbin/bhyve/bhyverun.c @@ -208,7 +208,7 @@ static void usage(int code) { - fprintf(stderr, + fprintf(stderr, "Usage: %s [-AaCDeHhPSuWwxY]\n" " %*s [-c [[cpus=]numcpus][,sockets=n][,cores=n][,threads=n]]\n" " %*s [-G port] [-k config_file] [-l lpc] [-m mem] [-o var=value]\n" @@ -1032,7 +1032,7 @@ fbsdrun_set_capabilities(struct vcpu *vcpu) exit(4); } vm_set_capability(vcpu, VM_CAP_PAUSE_EXIT, 1); - } + } if (get_config_bool_default("x86.x2apic", false)) err = vm_set_x2apic_state(vcpu, X2APIC_ENABLED); @@ -1249,12 +1249,12 @@ main(int argc, char *argv[]) set_config_bool("destroy_on_poweroff", true); break; case 'p': - if (pincpu_parse(optarg) != 0) { - errx(EX_USAGE, "invalid vcpu pinning " - "configuration '%s'", optarg); - } + if (pincpu_parse(optarg) != 0) { + errx(EX_USAGE, "invalid vcpu pinning " + "configuration '%s'", optarg); + } break; - case 'c': + case 'c': if (topology_parse(optarg) != 0) { errx(EX_USAGE, "invalid cpu topology " "'%s'", optarg); @@ -1302,7 +1302,7 @@ main(int argc, char *argv[]) case 'S': set_config_bool("memory.wired", true); break; - case 'm': + case 'm': set_config_value("memory.size", optarg); break; case 'o': From nobody Mon Jul 17 15:20:16 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R4QkS5dT6z4nGLF; Mon, 17 Jul 2023 15:20: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 4R4QkS4gzLz3l33; Mon, 17 Jul 2023 15:20:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689607216; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TUPJzSAPftXTco+mgfUbQ9ZKuR2OIM17FbQqlvbDung=; b=nzpUGLrLFrZqY0+FnQ2TC1Wo3JIgeObWQV/URDQtcYeQqLHmlAgca/KQZ9gpo215Kp5JeP dwrb/2pzXPDp3qp764s1MdsHquIkkhVZpOIiWB2NHF4gl46V1yDLqeQ7UBAmOduZ803R+e DHFfYWodyMt98ArVGHFv92jCFacdke48U60RwXl9PCUKwIJfJa0PqhYOnfj96ulAFBmGkP varnqVMcx9fEwXEQKx/BJylbHaNkFwOFSoL6FG8g+7/KJ76UAuZbIMq7YufNTNqlp/OKPP M5snu78mSgmYS++v2cjoAn7WfnWTn2uZe1fIIQh/AUrjYsmQ+RANwrA8LcS88A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689607216; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TUPJzSAPftXTco+mgfUbQ9ZKuR2OIM17FbQqlvbDung=; b=jCE6MAraO+IkW43kzFvQIuwqc/v6rNsWoT/+Ua9ft2BrX/4D/O/DSO/+LOUPE7pR94h6tT XKWrF4t2M5H3mDSQ6iASWZGqFOxTZ+wpSjzpmr2flLkAQ7m3U0ui9FONer2vihI8kq25u/ S+ywm6TZbC0ztNrqDPdZGYwgCLKOYr13NUqlyihzYBYIT3dOFQcCaGIT0EIjxibSsjQYo2 NqzVeDO1e4qpsTS1F6PxXrgP4pb4GkK7ctVJxEE7P6EJjj8CX651oiYdXbBJdUTX/tZ0/j DsvOc/k+0LoaOreNUtHv2Jzd8zRFHjqaX3meCYPUnqR6WT/iJ8Vz+MC43nwinQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689607216; a=rsa-sha256; cv=none; b=SU7hJboTTS/Hmo22khTdOs8zu7UfhFEOBM6U1MMi+BWg91bHbPg762+46whsfdpTQAVUsR 8g2kCFI1gzkgJ5n9pFEzdK7j/AfJkugW3UeuqAxpQ1s3/NWhhTqRCBeozCJEEp3pVyny2x qleE6ZgD/S+vZyZzNO3a93ei04vuT0GSTlA3KmaHPi5ffI9PTKtWVC2AFRNPO5jUAIR+Fw SUhjCbNlQ1RM8UBi1BNwHdooJ5VWkyNA65KXYDng8TVJfZinxHGhCm9oaB/RLXBnb/iqBR TCgSJeQXD/kq/PJzaZaM3PP1ZJZPhrTcGbRk/Kd3bAQJSnjmjDC+YcyPkUVmww== 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 4R4QkS3jLdzSrY; Mon, 17 Jul 2023 15:20: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 36HFKGGY038346; Mon, 17 Jul 2023 15:20:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36HFKGud038340; Mon, 17 Jul 2023 15:20:16 GMT (envelope-from git) Date: Mon, 17 Jul 2023 15:20:16 GMT Message-Id: <202307171520.36HFKGud038340@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: af20d58ef1e2 - main - bhyve: Remove an unneeded vm_get_register() call in main() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: af20d58ef1e250f1b207a80834445e39b06fdc48 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=af20d58ef1e250f1b207a80834445e39b06fdc48 commit af20d58ef1e250f1b207a80834445e39b06fdc48 Author: Mark Johnston AuthorDate: 2023-07-05 20:59:20 +0000 Commit: Mark Johnston CommitDate: 2023-07-17 15:15:54 +0000 bhyve: Remove an unneeded vm_get_register() call in main() At one point the RIP value was passed to fbsdrun_addcpu(), but this is no longer the case. No functional change intended. Reviewed by: jhb, corvink Sponsored by: Innovate UK MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D40988 --- usr.sbin/bhyve/bhyverun.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/usr.sbin/bhyve/bhyverun.c b/usr.sbin/bhyve/bhyverun.c index 2a2a0f028d9d..9fedab646002 100644 --- a/usr.sbin/bhyve/bhyverun.c +++ b/usr.sbin/bhyve/bhyverun.c @@ -1218,7 +1218,6 @@ main(int argc, char *argv[]) struct vcpu *bsp; struct vmctx *ctx; struct qemu_fwcfg_item *e820_fwcfg_item; - uint64_t rip; size_t memsize; const char *optstr, *value, *vmname; #ifdef BHYVE_SNAPSHOT @@ -1539,9 +1538,6 @@ main(int argc, char *argv[]) } #endif - error = vm_get_register(bsp, VM_REG_GUEST_RIP, &rip); - assert(error == 0); - /* * build the guest tables, MP etc. */ From nobody Mon Jul 17 15:48:29 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R4RMC0lY1z4nW1T; Mon, 17 Jul 2023 15:48:39 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.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 mx1.freebsd.org (Postfix) with ESMTPS id 4R4RM91lGXz3tQm; Mon, 17 Jul 2023 15:48:37 +0000 (UTC) (envelope-from kostikbel@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=none; spf=softfail (mx1.freebsd.org: 2001:470:d5e7:1::1 is neither permitted nor denied by domain of kostikbel@gmail.com) smtp.mailfrom=kostikbel@gmail.com; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=gmail.com (policy=none) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.17.1/8.17.1) with ESMTPS id 36HFmTs1082668 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 17 Jul 2023 18:48:33 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 36HFmTs1082668 Received: (from kostik@localhost) by tom.home (8.17.1/8.17.1/Submit) id 36HFmTLj082667; Mon, 17 Jul 2023 18:48:29 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 17 Jul 2023 18:48:29 +0300 From: Konstantin Belousov To: John Baldwin Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 60381fd1ee86 - main - memdesc: Retire MEMDESC_CCB. Message-ID: References: <202307141841.36EIf3f0019403@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202307141841.36EIf3f0019403@gitrepo.freebsd.org> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.0 X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-14) on tom.home X-Spamd-Result: default: False [-2.93 / 15.00]; NEURAL_HAM_LONG(-0.99)[-0.992]; NEURAL_HAM_MEDIUM(-0.97)[-0.973]; NEURAL_HAM_SHORT(-0.97)[-0.967]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : No valid SPF, No valid DKIM,none]; MIME_GOOD(-0.10)[text/plain]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org,dev-commits-src-main@freebsd.org]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; FREEMAIL_ENVFROM(0.00)[gmail.com]; R_SPF_SOFTFAIL(0.00)[~all]; TO_DN_SOME(0.00)[]; HAS_XAW(0.00)[]; FROM_HAS_DN(0.00)[]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; RCVD_TLS_LAST(0.00)[] X-Rspamd-Queue-Id: 4R4RM91lGXz3tQm X-Spamd-Bar: -- X-ThisMailContainsUnwantedMimeParts: N On Fri, Jul 14, 2023 at 06:41:03PM +0000, John Baldwin wrote: > The branch main has been updated by jhb: > > URL: https://cgit.FreeBSD.org/src/commit/?id=60381fd1ee8668ea1e4676a6128883d987cab858 > > commit 60381fd1ee8668ea1e4676a6128883d987cab858 > Author: John Baldwin > AuthorDate: 2023-07-14 18:30:31 +0000 > Commit: John Baldwin > CommitDate: 2023-07-14 18:32:16 +0000 > > memdesc: Retire MEMDESC_CCB. > > Instead, change memdesc_ccb to examine the CCB and return a memdesc of > a more generic type describing the data buffer. > diff --git a/sys/kern/subr_bus_dma.c b/sys/kern/subr_bus_dma.c > index 65a08aeba17c..bfaad30b37d3 100644 > --- a/sys/kern/subr_bus_dma.c > +++ b/sys/kern/subr_bus_dma.c > @@ -304,94 +304,6 @@ bus_dmamap_load_ma_triv(bus_dma_tag_t dmat, bus_dmamap_t map, > @@ -566,49 +478,18 @@ bus_dmamap_load_ccb(bus_dma_tag_t dmat, bus_dmamap_t map, union ccb *ccb, > + mem = memdesc_ccb(ccb); > + return (bus_dmamap_load_mem(dmat, map, &mem, callback, callback_arg, > + flags)); > } This makes kernel not linkable if CAM is not included into it. From nobody Mon Jul 17 17:15:31 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R4THV0Tx5z4nHcw; Mon, 17 Jul 2023 17:15:34 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.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 "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R4THV04H2z4SSX; Mon, 17 Jul 2023 17:15:34 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689614134; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=F3sAUeNTcvmpwvWuezM8fqThkDvxFe2f3JuNsd475Vg=; b=bQKdksoL2rLvy34I/2S+d7ocBhGdf06jk+PyMit4OB1eMf+TKJyEqMi7IK0wFwgHuVVAlI w8Njhbh0ZDJolEtyCr79V1hymv5/RRZA6NkrqxNWDuKkcVqZp9XKrONqbxB2B4pa4dJkvK qMNxMGTNpB0Dbp9nTZLWSXn50GQwR55bqLH4Osk3+lSwmmn/iWAtBh+titnelSxNyAGXkM UxgIsgo6gw1Ifk+XhXvbmo6UL/LHsZ9vvKApZKEKYH0+F8l2udN9ApXDmloZfkl69YReCD FYDY1DbUICE/YZ67ZA28RPQjRV2gaAkstbJ15nOPPb+OD0DsWWKf/l9Ucf4aVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689614134; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=F3sAUeNTcvmpwvWuezM8fqThkDvxFe2f3JuNsd475Vg=; b=eMibPgdPH4EiU3GavRHVVNoW36WNMghQrUxcCdB4hSEm1gLUzj7JmkSzFf0ya0qQzvyrQN D3Z7aMZFhQGHM2ifUTSe0aZItA0pMBeA4GSHrj0A44avHRBL5F1slKQO434K4h2+dFcfoi CmoIz8xwNPCY2xmo4Me5IMmagF4OWlKoIvUPHSWo8FcyA7yCaDxAFPP1uCRwrDWB4Pp1pq aDimQJA9IT2HVKqsqE6X7G2ey3ke9jC5AOl5ON4RIDQ5xtRhJemQqSRDUn+uqGckILCg3t a3Iny4d32txJ/LyNt+0cwta4K9hsQRWXjBPw5afzFg7inXd4fYWveX/8JVYRkQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689614134; a=rsa-sha256; cv=none; b=iu06+dUFvUeqbP8e/xRG/jUmMEWtnU1dAvSXXTygx58NqP7eVxqL8+8L4UlL3Yq0ykS0ng gav/3G5yQr87wJeJanCIAtjsGZvzkqCzbvsxVWx6YGbzIGLdPPKBqbJOcLrJzDYSg+vtyF k6ZrMrhcSxNWYqV2paTYg4R22/gR2O19+oj4GKutzrVYp7l7rQumJZiOGJaypvrcaz6Ula 55uQWjjrhAoSL8wCFeWMhwgrmzztKPXWgS0prqw026pKBYtcGIxl2q0mN/kD6mni2DfS6H NX+cPVMuUFp06w9ltIYb4tpY9PO4qBWewTdZJIbPUF9sFgrrlb4dOS2Fr7HwjQ== Received: from [IPV6:2601:648:8680:16b0:8880:dd2f:6436:cf5] (unknown [IPv6:2601:648:8680:16b0:8880:dd2f:6436:cf5]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4R4THS5RJTz1Mxt; Mon, 17 Jul 2023 17:15:32 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <65d7d8d8-9f98-abd2-1ce3-ae3a2d3bf111@FreeBSD.org> Date: Mon, 17 Jul 2023 10:15:31 -0700 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: git: 60381fd1ee86 - main - memdesc: Retire MEMDESC_CCB. Content-Language: en-US To: Konstantin Belousov Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202307141841.36EIf3f0019403@gitrepo.freebsd.org> From: John Baldwin In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ThisMailContainsUnwantedMimeParts: N On 7/17/23 8:48 AM, Konstantin Belousov wrote: > On Fri, Jul 14, 2023 at 06:41:03PM +0000, John Baldwin wrote: >> The branch main has been updated by jhb: >> >> URL: https://cgit.FreeBSD.org/src/commit/?id=60381fd1ee8668ea1e4676a6128883d987cab858 >> >> commit 60381fd1ee8668ea1e4676a6128883d987cab858 >> Author: John Baldwin >> AuthorDate: 2023-07-14 18:30:31 +0000 >> Commit: John Baldwin >> CommitDate: 2023-07-14 18:32:16 +0000 >> >> memdesc: Retire MEMDESC_CCB. >> >> Instead, change memdesc_ccb to examine the CCB and return a memdesc of >> a more generic type describing the data buffer. > >> diff --git a/sys/kern/subr_bus_dma.c b/sys/kern/subr_bus_dma.c >> index 65a08aeba17c..bfaad30b37d3 100644 >> --- a/sys/kern/subr_bus_dma.c >> +++ b/sys/kern/subr_bus_dma.c >> @@ -304,94 +304,6 @@ bus_dmamap_load_ma_triv(bus_dma_tag_t dmat, bus_dmamap_t map, >> @@ -566,49 +478,18 @@ bus_dmamap_load_ccb(bus_dma_tag_t dmat, bus_dmamap_t map, union ccb *ccb, >> + mem = memdesc_ccb(ccb); >> + return (bus_dmamap_load_mem(dmat, map, &mem, callback, callback_arg, >> + flags)); >> } > This makes kernel not linkable if CAM is not included into it. Hmmm, ok. I can either move the memdesc_ccb routine into sys/kern somewhere (like the kern_memdesc.c file in my other pending review), or we can #ifdef this function. It probably doesn't make sense to have a bus_dmamap_load_ccb if you don't have CAM, so I think I prefer the second option. -- John Baldwin From nobody Mon Jul 17 17:29:20 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R4Tbd2Tvbz4nQVv for ; Mon, 17 Jul 2023 17:29:33 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R4Tbd0sZxz4Xct for ; Mon, 17 Jul 2023 17:29:33 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ed1-x530.google.com with SMTP id 4fb4d7f45d1cf-51a52a7d859so12440278a12.0 for ; Mon, 17 Jul 2023 10:29:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20221208.gappssmtp.com; s=20221208; t=1689614972; x=1692206972; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=fg+dJeASVYPiLzg333HImWtRPW+FLdhoPC3yxshm3Dk=; b=DyJvnqEwCtsyKeneU/LczhtHer9xrOdbZVWzBTFSke1vLt5OQTpW0IvweToZYwezC8 yiEb6VgxWyEuy7bYm76GVx4cDn9JovXh1D7+4MJX5+yztJxFTRLrGP9UrjMc1zBgQ0dk Fxg/DpOn+lKcm1uHQQkFfcWTIHowX11r4teLJYME3XB5GNUIoKMDheRmAXvsHSjcauJg l766cmZRwKz/ENfomZNvzsn9pxLBugPL8ytKp834V4uZDw6tC487vMUMwvt52ftqf48n 8rTMOPeBgqqW0lzDxD5ZaVhxPHoJkbqy0xlNg3X7UbHTK8d/yh+sylkRbvqRCgi32LHu ojMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689614972; x=1692206972; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=fg+dJeASVYPiLzg333HImWtRPW+FLdhoPC3yxshm3Dk=; b=kWQtxS5tpHr9QjxaapErsuoGeVvZbW7MHzdCEjx5bIDgVGjHK7T/23Sz+dk6zs/QFa pyR5aGrJ6E1yTIzRxrZNPzaymYaeHYH53AmcbZ56Ecc0jDYoXaFHFXVSvn0YKG9JiM5H MU8EL21lBWlq+5ds6M5BUzmWf1bS7tkhK+YCainFSj+WpcAg36Lgtez20hE3CCKsEcL2 5BfqU+DpMinHfrGSm6xiHrkVWgnnDikZ3EDNI82JOb0Q7cOK6bYuCNNFPAgWajbFdXcz hkMBnjMcf+2QLaHe6/M8wSVyPBhGZaY+fyF6wooOR2otoiD1ESaE3HPqyEybq5d2TOOh AIPw== X-Gm-Message-State: ABy/qLaG7t8BABqQj84nSq2e20/ErcqH+7hfjaq3cQHNJSCtDVPoHu2O w/mu2sAPTw3tOQvV4qqJWR4FfWUmIK91LqPTJIzbrw== X-Google-Smtp-Source: APBJJlENXExmteN8q3vZosf8JqWFiQ+Hq+ew2HVPBDuUWXWVSsiubJQGUxojjbqB2VIETiAtAM5DCps+vYYDug4HrFw= X-Received: by 2002:a05:6402:270a:b0:51d:b184:efd with SMTP id y10-20020a056402270a00b0051db1840efdmr10016526edd.20.1689614971653; Mon, 17 Jul 2023 10:29:31 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <202307141841.36EIf3f0019403@gitrepo.freebsd.org> <65d7d8d8-9f98-abd2-1ce3-ae3a2d3bf111@FreeBSD.org> In-Reply-To: <65d7d8d8-9f98-abd2-1ce3-ae3a2d3bf111@FreeBSD.org> From: Warner Losh Date: Mon, 17 Jul 2023 11:29:20 -0600 Message-ID: Subject: Re: git: 60381fd1ee86 - main - memdesc: Retire MEMDESC_CCB. To: John Baldwin Cc: Konstantin Belousov , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="000000000000316b670600b224d2" X-Rspamd-Queue-Id: 4R4Tbd0sZxz4Xct X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N --000000000000316b670600b224d2 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Jul 17, 2023 at 11:15=E2=80=AFAM John Baldwin wro= te: > On 7/17/23 8:48 AM, Konstantin Belousov wrote: > > On Fri, Jul 14, 2023 at 06:41:03PM +0000, John Baldwin wrote: > >> The branch main has been updated by jhb: > >> > >> URL: > https://cgit.FreeBSD.org/src/commit/?id=3D60381fd1ee8668ea1e4676a6128883d= 987cab858 > >> > >> commit 60381fd1ee8668ea1e4676a6128883d987cab858 > >> Author: John Baldwin > >> AuthorDate: 2023-07-14 18:30:31 +0000 > >> Commit: John Baldwin > >> CommitDate: 2023-07-14 18:32:16 +0000 > >> > >> memdesc: Retire MEMDESC_CCB. > >> > >> Instead, change memdesc_ccb to examine the CCB and return a > memdesc of > >> a more generic type describing the data buffer. > > > >> diff --git a/sys/kern/subr_bus_dma.c b/sys/kern/subr_bus_dma.c > >> index 65a08aeba17c..bfaad30b37d3 100644 > >> --- a/sys/kern/subr_bus_dma.c > >> +++ b/sys/kern/subr_bus_dma.c > >> @@ -304,94 +304,6 @@ bus_dmamap_load_ma_triv(bus_dma_tag_t dmat, > bus_dmamap_t map, > >> @@ -566,49 +478,18 @@ bus_dmamap_load_ccb(bus_dma_tag_t dmat, > bus_dmamap_t map, union ccb *ccb, > >> + mem =3D memdesc_ccb(ccb); > >> + return (bus_dmamap_load_mem(dmat, map, &mem, callback, > callback_arg, > >> + flags)); > >> } > > This makes kernel not linkable if CAM is not included into it. > > Hmmm, ok. I can either move the memdesc_ccb routine into sys/kern > somewhere > (like the kern_memdesc.c file in my other pending review), or we can #ifd= ef > this function. It probably doesn't make sense to have a > bus_dmamap_load_ccb > if you don't have CAM, so I think I prefer the second option. > MINIMAL doesn't have CAM configured, but it is loadable as a module. I'd think we'd want a dummy one fo these with weak symbol binding and have the actual one live in cam somewhere that overrides this symbol. I just hit this in building MINIMAL for other reasons.... Warner --000000000000316b670600b224d2 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Mon, Jul 17, 2023 at 11:15=E2=80= =AFAM John Baldwin <jhb@freebsd.org> wrote:
On= 7/17/23 8:48 AM, Konstantin Belousov wrote:
> On Fri, Jul 14, 2023 at 06:41:03PM +0000, John Baldwin wrote:
>> The branch main has been updated by jhb:
>>
>> URL:
http= s://cgit.FreeBSD.org/src/commit/?id=3D60381fd1ee8668ea1e4676a6128883d987cab= 858
>>
>> commit 60381fd1ee8668ea1e4676a6128883d987cab858
>> Author:=C2=A0 =C2=A0 =C2=A0John Baldwin <jhb@FreeBSD.org> >> AuthorDate: 2023-07-14 18:30:31 +0000
>> Commit:=C2=A0 =C2=A0 =C2=A0John Baldwin <jhb@FreeBSD.org> >> CommitDate: 2023-07-14 18:32:16 +0000
>>
>>=C2=A0 =C2=A0 =C2=A0 memdesc: Retire MEMDESC_CCB.
>>=C2=A0 =C2=A0 =C2=A0
>>=C2=A0 =C2=A0 =C2=A0 Instead, change memdesc_ccb to examine the CCB= and return a memdesc of
>>=C2=A0 =C2=A0 =C2=A0 a more generic type describing the data buffer= .
>
>> diff --git a/sys/kern/subr_bus_dma.c b/sys/kern/subr_bus_dma.c
>> index 65a08aeba17c..bfaad30b37d3 100644
>> --- a/sys/kern/subr_bus_dma.c
>> +++ b/sys/kern/subr_bus_dma.c
>> @@ -304,94 +304,6 @@ bus_dmamap_load_ma_triv(bus_dma_tag_t dmat, b= us_dmamap_t map,
>> @@ -566,49 +478,18 @@ bus_dmamap_load_ccb(bus_dma_tag_t dmat, bus_= dmamap_t map, union ccb *ccb,
>> +=C2=A0 =C2=A0 mem =3D memdesc_ccb(ccb);
>> +=C2=A0 =C2=A0 return (bus_dmamap_load_mem(dmat, map, &mem, ca= llback, callback_arg,
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 flags));
>>=C2=A0 =C2=A0}
> This makes kernel not linkable if CAM is not included into it.

Hmmm, ok.=C2=A0 I can either move the memdesc_ccb routine into sys/kern som= ewhere
(like the kern_memdesc.c file in my other pending review), or we can #ifdef=
this function.=C2=A0 It probably doesn't make sense to have a bus_dmama= p_load_ccb
if you don't have CAM, so I think I prefer the second option.

MINIMAL doesn't have CAM configured, but it = is loadable as a module.

I'd think we'd wa= nt a dummy one fo these with weak symbol binding and have the actual
<= div>one live in cam somewhere that overrides this=C2=A0 symbol.
<= br>
I just hit this in building MINIMAL for other reasons....
=

Warner
--000000000000316b670600b224d2-- From nobody Mon Jul 17 17:35:50 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R4Tkt56g1z4nTVc; Mon, 17 Jul 2023 17:35: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 4R4Tkt4hrRz4ZRd; Mon, 17 Jul 2023 17:35:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689615350; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PAon1OZUhZ1cwWClhIpT2Rd4gNpgG4VP2VsYsPejzuE=; b=d2zd95Fl3tYnlg9Hqqe3d0m6gImRVJs6xCY46hY+NkTd2Rdzd8UvGP1wF2eXkJec5uwzGw weVjQdD1JGKRM5wfeF3Ip5No9DJKZ1kBGI9gFlkSb5/RhYiANzKI6GQ20pZ75qjT/9M4yj gx5F/rhMipLTzmwlt/LAFpnLGmvbMzHnxgtJfZWYUIJIH/OaaO70Gnf47kRbhU5KLhCNqC g6RwI8hKuSoG25UrErd+4kmL7rjGJROWTzRriU51OhRjZP5DGHCMaiulda/VMW154Bw2qw kbYsnty3wIfN4MdDGfLuIjGjrMa9z1+3+A3w24A6noaa2YTKI20MwLLzvhTJZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689615350; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PAon1OZUhZ1cwWClhIpT2Rd4gNpgG4VP2VsYsPejzuE=; b=XokUtW8Mt6v8E2gDIbrTLUTDqDIbNWhCs2oq7mCmXZdXrkp+u1TIUvXHICWHTEmcSgvK+K 04nUy8jsfvxF+yKqDUWee3iMjucbq5SU9sbnjdCf8uB4vvOmvPHPWDI0qoVo92xmyXF26Z ITpBuRBHaaEx7ehmbTKNCvBL+ZqyLvIJ4NvaPLA5SNrM59ZAqjM9AVE/vmuPlfngyGrx68 kO4AYCy2hSbT8QilYZ7imyzsGpQWF07SSOAzLPceRzkCfqDm7wPnut5Hb9/LDJOpps5KQG o9YyO1tBT6/WhjtQNwyGoljBt4s5yXOW0293QOSrCst0pv/ifj2V8MY4TTHWKA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689615350; a=rsa-sha256; cv=none; b=RPhkPTHVLF44ns3Z0eSKZRwRQvJm4nGADuFUu34tqY/3phTSneVNa5WUyPHEa+7AjwD6+N l1ELF/GSLw8Dq8LIx/jXZ4IbspLlj+2e1JBsXgky+sqZjCKpT1KwHEJkdDajHi4MGB0l5F pULEwHrCtGM4zfzch7oYBzOj2FYLi9nVH+Ts9lP1bzXg2YyDaq8q3brZjdFfyVIqRrPm1G gvS53YS6I0TgsRxIFarqxHsIcASinBSNlm9UXL3Sy1i0DQGBob17ZrmF4NXItFQAzdJXRn s6/il3KeFM7WfYzXvd6CHspL84V2PKk+29lYKzs3dzgGIgpPPwXvRKCGukiOGA== 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 4R4Tkt3np9zXK9; Mon, 17 Jul 2023 17:35: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 36HHZoXM063455; Mon, 17 Jul 2023 17:35:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36HHZonv063454; Mon, 17 Jul 2023 17:35:50 GMT (envelope-from git) Date: Mon, 17 Jul 2023 17:35:50 GMT Message-Id: <202307171735.36HHZonv063454@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: d3152ab23e0e - main - tcbpcb: Always define t_osd List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d3152ab23e0e7bee5a0f988ecca2a1187ab82057 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=d3152ab23e0e7bee5a0f988ecca2a1187ab82057 commit d3152ab23e0e7bee5a0f988ecca2a1187ab82057 Author: Warner Losh AuthorDate: 2023-07-17 17:22:45 +0000 Commit: Warner Losh CommitDate: 2023-07-17 17:22:45 +0000 tcbpcb: Always define t_osd Always define t_osd. congestion control modules access it unconditionally. This fixes the build. However, this is, at best, a temporary band-aide until the larger issues are sorted. Sponsored by: Netflix --- sys/netinet/tcp_var.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h index 587998331fbf..8e89f2aef0f2 100644 --- a/sys/netinet/tcp_var.h +++ b/sys/netinet/tcp_var.h @@ -482,9 +482,7 @@ struct tcpcb { struct mbufq t_inpkts; /* List of saved input packets. */ struct mbufq t_outpkts; /* List of saved output packets. */ #endif -#ifdef TCP_HHOOK struct osd t_osd; /* storage for Khelp module data */ -#endif uint8_t _t_logpoint; /* Used when a BB log points is enabled */ #ifdef TCP_REQUEST_TRK /* Response tracking addons. */ From nobody Mon Jul 17 17:45:33 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R4Ty74G0Jz4nZHd; Mon, 17 Jul 2023 17:45:35 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.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 "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R4Ty73pfBz4cnD; Mon, 17 Jul 2023 17:45:35 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689615935; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=x28pI7KpLvb2jGdNQuXq/LvDrcBSaUX+1AFxfbiPaKw=; b=KVkZRlzrtxQ9GI2zBIkO8K9E+1bo59oYwG1rBEQpb/9ICnK4qiiSQcHa2XAzjI/GQ5vv9q 1LtYPsVqkDgJNqjYNW/9CyOkgN55ka57ogPiYlxJXu2yc2Oj33Gzl0gLOp4tr4Yo2Newz/ 2vjQmKktrTf//z1qAjV+O+Uya5QAKU1K0C5UdYEnGVFUpY8FMSfBruO1FEK7DwPEiPbgmO RkDkxH/qdCI4f23LvYmarT/kH3sByKF7U9HvhIovPQ8Sb/vFU6Lr4RGjQMh6bS7o+vmZQR /6Ln6YVf90XC3nnoSH4+GfwH817lmsm/qT/StKBP45MbCtyo5r2pPWKM/qAkvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689615935; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=x28pI7KpLvb2jGdNQuXq/LvDrcBSaUX+1AFxfbiPaKw=; b=SSmSOhBrUigC+2C77yCNa5DoLGc2vfxGD8l5enRSqXVhfGMwgIJspM1j1kKaYfIHUJyYtW ASLcMLAOLpGVsArE9PofCLSH9jTGNksbjXdflVapFqveULEpMJq2uDK9CXdWoGsBkctEQK Ur4ysMwSGWj4lQelJKRJGwcoYOYAqokPpXIMrJvI05fOT59i0l6UIKww0ZHiQqSs3HE3vU ZuzCt2UbJdXtQyqM46QG9zMfoxpQA4q6Sf7TtpoKCvLxywpYfTEpjcklLQk7Xo9GaPRIgG d1aFz0wFjiS2MAmGCd8jbmy5RqZsLldB+ypywNhQaX3ZaLZOCxHPW++uHs0T/g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689615935; a=rsa-sha256; cv=none; b=TcKhqUy06Dkiudm8Pf4qoiLK7Vx+7uDjeWYZpA4MHY9owaktqVJ7Bka2fgmKrg2cE4Q7rG vJciyQBsR/ikLw4yw3KPMDJ+w072LoB6wAt6sZQUbVYB6FwJfVyEdbbrZ7nxb+jK5JGkm4 ohqUm46PZpAO6WkDRFoINe/LgrJj9GP83+KM5/5qL82c7wJz+EuJ5VcC5Zy/U8KG9YRTlK jVqWDxyNQfVYdviKOCBkeA6HWlNiKVxXLTnqRmNf9hhLh50iNnLJw4ByUgjB5/RM/7twjT d1gnUbJioME3EHE16Y1L+9P+LvVG8lINSzAUt7jVEXuXO0MHGQV6p/zubR26vA== Received: from [IPV6:2601:648:8680:16b0:2c33:b8f1:d09:3750] (unknown [IPv6:2601:648:8680:16b0:2c33:b8f1:d09:3750]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4R4Ty66GZKz1Mfk; Mon, 17 Jul 2023 17:45:34 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <17cd00bb-c6f2-5afa-a1ac-b7e14c3c758e@FreeBSD.org> Date: Mon, 17 Jul 2023 10:45:33 -0700 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: git: 60381fd1ee86 - main - memdesc: Retire MEMDESC_CCB. Content-Language: en-US To: Warner Losh Cc: Konstantin Belousov , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202307141841.36EIf3f0019403@gitrepo.freebsd.org> <65d7d8d8-9f98-abd2-1ce3-ae3a2d3bf111@FreeBSD.org> From: John Baldwin In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ThisMailContainsUnwantedMimeParts: N On 7/17/23 10:29 AM, Warner Losh wrote: > On Mon, Jul 17, 2023 at 11:15 AM John Baldwin wrote: > >> On 7/17/23 8:48 AM, Konstantin Belousov wrote: >>> On Fri, Jul 14, 2023 at 06:41:03PM +0000, John Baldwin wrote: >>>> The branch main has been updated by jhb: >>>> >>>> URL: >> https://cgit.FreeBSD.org/src/commit/?id=60381fd1ee8668ea1e4676a6128883d987cab858 >>>> >>>> commit 60381fd1ee8668ea1e4676a6128883d987cab858 >>>> Author: John Baldwin >>>> AuthorDate: 2023-07-14 18:30:31 +0000 >>>> Commit: John Baldwin >>>> CommitDate: 2023-07-14 18:32:16 +0000 >>>> >>>> memdesc: Retire MEMDESC_CCB. >>>> >>>> Instead, change memdesc_ccb to examine the CCB and return a >> memdesc of >>>> a more generic type describing the data buffer. >>> >>>> diff --git a/sys/kern/subr_bus_dma.c b/sys/kern/subr_bus_dma.c >>>> index 65a08aeba17c..bfaad30b37d3 100644 >>>> --- a/sys/kern/subr_bus_dma.c >>>> +++ b/sys/kern/subr_bus_dma.c >>>> @@ -304,94 +304,6 @@ bus_dmamap_load_ma_triv(bus_dma_tag_t dmat, >> bus_dmamap_t map, >>>> @@ -566,49 +478,18 @@ bus_dmamap_load_ccb(bus_dma_tag_t dmat, >> bus_dmamap_t map, union ccb *ccb, >>>> + mem = memdesc_ccb(ccb); >>>> + return (bus_dmamap_load_mem(dmat, map, &mem, callback, >> callback_arg, >>>> + flags)); >>>> } >>> This makes kernel not linkable if CAM is not included into it. >> >> Hmmm, ok. I can either move the memdesc_ccb routine into sys/kern >> somewhere >> (like the kern_memdesc.c file in my other pending review), or we can #ifdef >> this function. It probably doesn't make sense to have a >> bus_dmamap_load_ccb >> if you don't have CAM, so I think I prefer the second option. >> > > MINIMAL doesn't have CAM configured, but it is loadable as a module. > > I'd think we'd want a dummy one fo these with weak symbol binding and have > the actual > one live in cam somewhere that overrides this symbol. > > I just hit this in building MINIMAL for other reasons.... Yeah, I was testing MINIMAL locally (which is still broken due to recent TCP commits) to try out possible fixes. One could possibly move bus_dmamap_load_ccb into cam.ko entirely? Especially this current version doesn't really have any bus_dma-specific knowledge anymore but is just a thin wrapper around bus_dmamap_load_mem: int bus_dmamap_load_ccb(bus_dma_tag_t dmat, bus_dmamap_t map, union ccb *ccb, bus_dmamap_callback_t *callback, void *callback_arg, int flags) { struct ccb_hdr *ccb_h; struct memdesc mem; ccb_h = &ccb->ccb_h; if ((ccb_h->flags & CAM_DIR_MASK) == CAM_DIR_NONE) { callback(callback_arg, NULL, 0, 0); return (0); } mem = memdesc_ccb(ccb); return (bus_dmamap_load_mem(dmat, map, &mem, callback, callback_arg, flags)); } -- John Baldwin From nobody Mon Jul 17 17:52:07 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R4V5y3shDz4ndFT for ; Mon, 17 Jul 2023 17:52:22 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R4V5x6Bltz3Bqx for ; Mon, 17 Jul 2023 17:52:21 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ed1-x52c.google.com with SMTP id 4fb4d7f45d1cf-51cff235226so9945695a12.0 for ; Mon, 17 Jul 2023 10:52:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20221208.gappssmtp.com; s=20221208; t=1689616339; x=1692208339; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=GjjyCks/+P0ZDesVVFSCCa3rc4u1l3rfKIb3ELGp3/M=; b=CSXSC3tv+3rxwKVmgHDK37mBgEBa/eBiWi3jFv9p29LEv5CuX2I1xGz3KOXNq1w9t6 IHl7/TzX7tDUftFSo5mSKS06b04a6Js0XGiejRqH9XeBwIroaoQDv1IpAi+M8yBJcau3 YPzhMjl0UzjrrJsfnrWS/OGvFWGmRo2Ilk3rtKNS15Ck+lFMYMqfxJaDGzYO23MtZNIm M7XGuNz5jxmmCAFy5iMoQKCCYKEEV7iTMdS0KYbx6Be1EvX7PrTtQRYB3sCdtx7LYGOL eTy4hCzmUo+9AuR9H28cgXWp3Jt/z/2nxCmhC3w4VZFsQ4i+UjEp1fKnzDKLUnSSTdEH Nnwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689616339; x=1692208339; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=GjjyCks/+P0ZDesVVFSCCa3rc4u1l3rfKIb3ELGp3/M=; b=XDJNDsyNKQ2Gi1iV8UcDbf0C1dzX3uNZxV6MB9oR4hhJ15NZKcjb4p+7Py4CPgz2uB JlB+mMHQtmnWJhmLR979c/Bqx2ptaI/ez1woMzitA5NIYI3ht8qX0tarCrplMhWeXEPL SSgMCBs8p1hONF8CcY1WvpBzm//Q4mFOk0g/CZoXpVCtwl/6zkDToaY3HLNq9SbpIkiO 6tmvB/RJeXyupMCXqrUwnmyxUNmVq3BzkBWq170IYsj/nv7wPPlfUhz4Jyy2O3a9aH+n V0FUF9i/nuMKsZs2D76hBygAF1H1cse0odpAbB4pGettPKCgmyKopYWrnecV+iPrd39P 8DDg== X-Gm-Message-State: ABy/qLaIau/+qQON/gaqNwON62fH+Pk7SqQ3+CLUqVc5JMqXPNthuXYt aW3O3y6sJa/L6J2FKZz9mWGegFXYPLc4elXp7MPn/Q== X-Google-Smtp-Source: APBJJlEvnLU7u6Pm8d7JAZ0yj8dIXQ8ps8weJaLhSprkarqTBYppST3unPNmmzH4gCcaDjSzIRu662zWrpuH8uzjaiU= X-Received: by 2002:a05:6402:42cc:b0:51f:e0f0:f2cd with SMTP id i12-20020a05640242cc00b0051fe0f0f2cdmr12173297edc.3.1689616338839; Mon, 17 Jul 2023 10:52:18 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <202307141841.36EIf3f0019403@gitrepo.freebsd.org> <65d7d8d8-9f98-abd2-1ce3-ae3a2d3bf111@FreeBSD.org> <17cd00bb-c6f2-5afa-a1ac-b7e14c3c758e@FreeBSD.org> In-Reply-To: <17cd00bb-c6f2-5afa-a1ac-b7e14c3c758e@FreeBSD.org> From: Warner Losh Date: Mon, 17 Jul 2023 11:52:07 -0600 Message-ID: Subject: Re: git: 60381fd1ee86 - main - memdesc: Retire MEMDESC_CCB. To: John Baldwin Cc: Konstantin Belousov , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="000000000000aefcf40600b2750f" X-Rspamd-Queue-Id: 4R4V5x6Bltz3Bqx X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N --000000000000aefcf40600b2750f Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Jul 17, 2023 at 11:45=E2=80=AFAM John Baldwin wro= te: > On 7/17/23 10:29 AM, Warner Losh wrote: > > On Mon, Jul 17, 2023 at 11:15=E2=80=AFAM John Baldwin = wrote: > > > >> On 7/17/23 8:48 AM, Konstantin Belousov wrote: > >>> On Fri, Jul 14, 2023 at 06:41:03PM +0000, John Baldwin wrote: > >>>> The branch main has been updated by jhb: > >>>> > >>>> URL: > >> > https://cgit.FreeBSD.org/src/commit/?id=3D60381fd1ee8668ea1e4676a6128883d= 987cab858 > >>>> > >>>> commit 60381fd1ee8668ea1e4676a6128883d987cab858 > >>>> Author: John Baldwin > >>>> AuthorDate: 2023-07-14 18:30:31 +0000 > >>>> Commit: John Baldwin > >>>> CommitDate: 2023-07-14 18:32:16 +0000 > >>>> > >>>> memdesc: Retire MEMDESC_CCB. > >>>> > >>>> Instead, change memdesc_ccb to examine the CCB and return a > >> memdesc of > >>>> a more generic type describing the data buffer. > >>> > >>>> diff --git a/sys/kern/subr_bus_dma.c b/sys/kern/subr_bus_dma.c > >>>> index 65a08aeba17c..bfaad30b37d3 100644 > >>>> --- a/sys/kern/subr_bus_dma.c > >>>> +++ b/sys/kern/subr_bus_dma.c > >>>> @@ -304,94 +304,6 @@ bus_dmamap_load_ma_triv(bus_dma_tag_t dmat, > >> bus_dmamap_t map, > >>>> @@ -566,49 +478,18 @@ bus_dmamap_load_ccb(bus_dma_tag_t dmat, > >> bus_dmamap_t map, union ccb *ccb, > >>>> + mem =3D memdesc_ccb(ccb); > >>>> + return (bus_dmamap_load_mem(dmat, map, &mem, callback, > >> callback_arg, > >>>> + flags)); > >>>> } > >>> This makes kernel not linkable if CAM is not included into it. > >> > >> Hmmm, ok. I can either move the memdesc_ccb routine into sys/kern > >> somewhere > >> (like the kern_memdesc.c file in my other pending review), or we can > #ifdef > >> this function. It probably doesn't make sense to have a > >> bus_dmamap_load_ccb > >> if you don't have CAM, so I think I prefer the second option. > >> > > > > MINIMAL doesn't have CAM configured, but it is loadable as a module. > > > > I'd think we'd want a dummy one fo these with weak symbol binding and > have > > the actual > > one live in cam somewhere that overrides this symbol. > > > > I just hit this in building MINIMAL for other reasons.... > > Yeah, I was testing MINIMAL locally (which is still broken due to recent > TCP commits) to try out possible fixes. One could possibly move > bus_dmamap_load_ccb into cam.ko entirely? Especially this current versio= n > doesn't really have any bus_dma-specific knowledge anymore but is just a > thin wrapper around bus_dmamap_load_mem: > > int > bus_dmamap_load_ccb(bus_dma_tag_t dmat, bus_dmamap_t map, union ccb *ccb, > bus_dmamap_callback_t *callback, void *callback_arg, > int flags) > { > struct ccb_hdr *ccb_h; > struct memdesc mem; > > ccb_h =3D &ccb->ccb_h; > if ((ccb_h->flags & CAM_DIR_MASK) =3D=3D CAM_DIR_NONE) { > callback(callback_arg, NULL, 0, 0); > return (0); > } > > mem =3D memdesc_ccb(ccb); > return (bus_dmamap_load_mem(dmat, map, &mem, callback, > callback_arg, > flags)); > } > And who calls bus_dmamap_load_ccb? If this were entirely in cam.ko, then callers of it would need to resolve it. sys/dev/nvme/nvme_qpair.c is not otherwise dependent on cam, and would be unresolved for a minimal + nvme + nvd kernel. Warner --000000000000aefcf40600b2750f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Mon, Jul 17, 2023 at 11:45=E2=80= =AFAM John Baldwin <jhb@freebsd.org> wrote:
On= 7/17/23 10:29 AM, Warner Losh wrote:
> On Mon, Jul 17, 2023 at 11:15=E2=80=AFAM John Baldwin <
jhb@freebsd.org> wrote:
>
>> On 7/17/23 8:48 AM, Konstantin Belousov wrote:
>>> On Fri, Jul 14, 2023 at 06:41:03PM +0000, John Baldwin wrote:<= br> >>>> The branch main has been updated by jhb:
>>>>
>>>> URL:
>> https://c= git.FreeBSD.org/src/commit/?id=3D60381fd1ee8668ea1e4676a6128883d987cab858
>>>>
>>>> commit 60381fd1ee8668ea1e4676a6128883d987cab858
>>>> Author:=C2=A0 =C2=A0 =C2=A0John Baldwin <jhb@FreeBSD.or= g>
>>>> AuthorDate: 2023-07-14 18:30:31 +0000
>>>> Commit:=C2=A0 =C2=A0 =C2=A0John Baldwin <jhb@FreeBSD.or= g>
>>>> CommitDate: 2023-07-14 18:32:16 +0000
>>>>
>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0memdesc: Retire MEMDESC_CCB.
>>>>
>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0Instead, change memdesc_ccb to e= xamine the CCB and return a
>> memdesc of
>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0a more generic type describing t= he data buffer.
>>>
>>>> diff --git a/sys/kern/subr_bus_dma.c b/sys/kern/subr_bus_d= ma.c
>>>> index 65a08aeba17c..bfaad30b37d3 100644
>>>> --- a/sys/kern/subr_bus_dma.c
>>>> +++ b/sys/kern/subr_bus_dma.c
>>>> @@ -304,94 +304,6 @@ bus_dmamap_load_ma_triv(bus_dma_tag_t= dmat,
>> bus_dmamap_t map,
>>>> @@ -566,49 +478,18 @@ bus_dmamap_load_ccb(bus_dma_tag_t dm= at,
>> bus_dmamap_t map, union ccb *ccb,
>>>> +=C2=A0 =C2=A0 mem =3D memdesc_ccb(ccb);
>>>> +=C2=A0 =C2=A0 return (bus_dmamap_load_mem(dmat, map, &= ;mem, callback,
>> callback_arg,
>>>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 flags));
>>>>=C2=A0 =C2=A0 }
>>> This makes kernel not linkable if CAM is not included into it.=
>>
>> Hmmm, ok.=C2=A0 I can either move the memdesc_ccb routine into sys= /kern
>> somewhere
>> (like the kern_memdesc.c file in my other pending review), or we c= an #ifdef
>> this function.=C2=A0 It probably doesn't make sense to have a<= br> >> bus_dmamap_load_ccb
>> if you don't have CAM, so I think I prefer the second option.<= br> >>
>
> MINIMAL doesn't have CAM configured, but it is loadable as a modul= e.
>
> I'd think we'd want a dummy one fo these with weak symbol bind= ing and have
> the actual
> one live in cam somewhere that overrides this=C2=A0 symbol.
>
> I just hit this in building MINIMAL for other reasons....

Yeah, I was testing MINIMAL locally (which is still broken due to recent TCP commits) to try out possible fixes.=C2=A0 One could possibly move
bus_dmamap_load_ccb into cam.ko entirely?=C2=A0 Especially this current ver= sion
doesn't really have any bus_dma-specific knowledge anymore but is just = a
thin wrapper around bus_dmamap_load_mem:

int
bus_dmamap_load_ccb(bus_dma_tag_t dmat, bus_dmamap_t map, union ccb *ccb, =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 bus_d= mamap_callback_t *callback, void *callback_arg,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 int f= lags)
{
=C2=A0 =C2=A0 =C2=A0 =C2=A0 struct ccb_hdr *ccb_h;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 struct memdesc mem;

=C2=A0 =C2=A0 =C2=A0 =C2=A0 ccb_h =3D &ccb->ccb_h;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 if ((ccb_h->flags & CAM_DIR_MASK) =3D=3D= CAM_DIR_NONE) {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 callback(callback_a= rg, NULL, 0, 0);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return (0);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 }

=C2=A0 =C2=A0 =C2=A0 =C2=A0 mem =3D memdesc_ccb(ccb);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 return (bus_dmamap_load_mem(dmat, map, &mem= , callback, callback_arg,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 flags));
}


--000000000000aefcf40600b2750f-- From nobody Mon Jul 17 17:52:24 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R4V6242D3z4nd4c; Mon, 17 Jul 2023 17:52:26 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.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 "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R4V622tF6z3C2k; Mon, 17 Jul 2023 17:52:26 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689616346; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hkvTB3+nYbvEKxicsSmCKRHbOy8z66ZLkwS/qiEmdTQ=; b=QAFskyscKSqEbCnL3P577iRaZBKV64o9NK1ukNS4LupX9h5/yz/KqvBQqo6ISUC6SWqoP0 HkxtHsJa3nBC9djiXNjljb4t/g6U9/hn6896OTqnR1TY9LkhsFZ14BSVkdL/JIIjaNuusW xD356FrYr6xB35irxeAWWemp4HR943pvmlkNVqJ+RVa+R11WQ//hoXetronXWxfa/1Qxl5 aRn8RjDzRa96UDgEEQc9NZBTZcJnwcOwGVlt+VooNCB/VHGd183IeOIzDyyV7CbHxpqDDa cTFBn1APaq7d7OpkLWF+YeuC22aJ+9xJKFYCd4XVltuSDsOLEoFL534IYw7CLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689616346; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hkvTB3+nYbvEKxicsSmCKRHbOy8z66ZLkwS/qiEmdTQ=; b=ZttfuurMgxVMGPc/hztwjmyLf/Mey6o6DWkE3fN7Le4x084rVHU1d2RomAvynt9TkipjTU dNEwHX6eZvtELYlTVbPPlTf6PqArwBHM1mDL4oOdz5IUD+86HSGPzIuR1Ot7KXugIGg5ie sam5kYibaLJCyFLvUXWtEFb2dmkD4+bFrG3HVnkLoK+vcYHk55BD6VFWnlelPtmAEnidau Y7HbkK+k2z6dfb1/5GO+MNW49x8JKIX85FHyShWnz5sEK0w/d+t3qTizoOdDIgFDVTzbPE uXPdcuAk4kM9X0N0XaOWsbFN6otr1q/f0HAe9Q0xVBls/ETlz0u7EiPcXe55HQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689616346; a=rsa-sha256; cv=none; b=YpHrr4//M+ASUE9qPwp3ZAWsBL9MGoUscex8UJ/1L8fvtPv4BJdEsBtC7Tkew/jTE9bDpe Hb40EOrdJTAK/xrcI27JmXi1xgZchKxF7ii39MOfTppKPNRu+xL13rrEAcbi7O3vjPspyo dLrcaSgAnwUyC9Hxs1yr8GKzWEloX9iOyyXDbqPINlYQDXKUUibPqDw54H3czhTzELB5t/ /rAbUXjJXUQS8R9bhTqF3EInhOiOuE/KlOOdA1WXOEd8VSrcuAP+147+d1FQKpMh5rVk3B OUIKAP1wlZcBq4SG7PDKecvbrvgR5rbqP7Kr9D7rkZVcUtFZZStln0c2tqNbYg== Received: from [IPV6:2601:648:8680:16b0:2c33:b8f1:d09:3750] (unknown [IPv6:2601:648:8680:16b0:2c33:b8f1:d09:3750]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4R4V6165rVz1MSl; Mon, 17 Jul 2023 17:52:25 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: Date: Mon, 17 Jul 2023 10:52:24 -0700 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: git: d3152ab23e0e - main - tcbpcb: Always define t_osd Content-Language: en-US To: Warner Losh , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202307171735.36HHZonv063454@gitrepo.freebsd.org> From: John Baldwin In-Reply-To: <202307171735.36HHZonv063454@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ThisMailContainsUnwantedMimeParts: N On 7/17/23 10:35 AM, Warner Losh wrote: > The branch main has been updated by imp: > > URL: https://cgit.FreeBSD.org/src/commit/?id=d3152ab23e0e7bee5a0f988ecca2a1187ab82057 > > commit d3152ab23e0e7bee5a0f988ecca2a1187ab82057 > Author: Warner Losh > AuthorDate: 2023-07-17 17:22:45 +0000 > Commit: Warner Losh > CommitDate: 2023-07-17 17:22:45 +0000 > > tcbpcb: Always define t_osd > > Always define t_osd. congestion control modules access it > unconditionally. This fixes the build. > > However, this is, at best, a temporary band-aide until the > larger issues are sorted. > > Sponsored by: Netflix FWIW, I find that #ifdef's based on kernel options in "core" structures like this shared with modules is a recipe for disaster. -- John Baldwin From nobody Mon Jul 17 17:54:09 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R4V8G6KVPz4nf2y for ; Mon, 17 Jul 2023 17:54:22 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com [IPv6:2a00:1450:4864:20::52e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R4V8G492pz3D5S for ; Mon, 17 Jul 2023 17:54:22 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ed1-x52e.google.com with SMTP id 4fb4d7f45d1cf-51bece5d935so6866521a12.1 for ; Mon, 17 Jul 2023 10:54:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20221208.gappssmtp.com; s=20221208; t=1689616461; x=1692208461; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=mIrbgHnYsjmoJjRnm1DyOFH1NhKbnvOABJ0PrhVgdHc=; b=DY+r7CmLzoqkCQJ4ExtbZmx8MV9+/VFbpQ3m014LGnzlpPZUpJDpn/j5vF4pkM1L2R XkKhm/fLtZTEJ5yRUnPl5a6Ul+woZ9ZvU2WfUGE1rjEHNClwSSUYtIh33FZJ9gGdRaAh 3Kxay+eHAse4UIgN5/9gJmhZgoAnkycsR23qo13Ypm+TETdsUMW/A3YChsbc7bIUJ7Vy bXU849+DoN6veUZ7yC8GopIzw4bNyMQ5lQJ8RpnSE5oAqk9T//lY3jZdHkPPGIWf67zI EZL67/G79jCFfZjXILymQx/eC4Xx05zbkjw4gMo9sz38Vqudsrb0e0dKbip2vCJIujL3 KS/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689616461; x=1692208461; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=mIrbgHnYsjmoJjRnm1DyOFH1NhKbnvOABJ0PrhVgdHc=; b=Wlo5jTuNAZ/SxlYhXbOxdkoSz8fEuGt3gXtzo5VJibyWy0IvTeYoY4ywYWTXwMcQQv 3zdBX5YPBBEV6bmQPDkQNZJx5tKIWPDSIxjteXMwto1+CYj9aO2swnLVhWz0ZGM4d2rA /EqHfN/oEH/bZyvkJodXQ0OqWQeKqH7HZE2M0n4eIYXzLkBYT2oPWWallixK9GW9K146 dJWdzAC66v7SBvigYrtMgZsN/TJD80Au14uaf0/acyLRrq63TtyRyRjL79LWKrqVNGOW bzYupqnaXJKpTVh4qz6pL93dOBDvQ+QDUGjdTn02pGy+OMcDxkj0/Ljo5yrhg7/0ZDEo YCRQ== X-Gm-Message-State: ABy/qLa6FqcTCl0SN8pM5eNBpPohuadjzzmQB0g91tqxDiLWZZn3pX1i URNNSBajBwlrD1KG+E16LWuExzz8gt66juYq9A2aqQ== X-Google-Smtp-Source: APBJJlFm5QvNc8rB1p8emcdEwWVicJNcs+ryWQSM49OeJlg/iYMfZqEQbHaVWAfy0oAd7OyW+2JDfMrUbFYP/Xnbj+4= X-Received: by 2002:aa7:de0a:0:b0:51d:8835:90a1 with SMTP id h10-20020aa7de0a000000b0051d883590a1mr12482922edv.30.1689616460589; Mon, 17 Jul 2023 10:54:20 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <202307171735.36HHZonv063454@gitrepo.freebsd.org> In-Reply-To: From: Warner Losh Date: Mon, 17 Jul 2023 11:54:09 -0600 Message-ID: Subject: Re: git: d3152ab23e0e - main - tcbpcb: Always define t_osd To: John Baldwin Cc: Warner Losh , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="000000000000f1aeb60600b27ccf" X-Rspamd-Queue-Id: 4R4V8G492pz3D5S X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N --000000000000f1aeb60600b27ccf Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Jul 17, 2023 at 11:52=E2=80=AFAM John Baldwin wro= te: > On 7/17/23 10:35 AM, Warner Losh wrote: > > The branch main has been updated by imp: > > > > URL: > https://cgit.FreeBSD.org/src/commit/?id=3Dd3152ab23e0e7bee5a0f988ecca2a11= 87ab82057 > > > > commit d3152ab23e0e7bee5a0f988ecca2a1187ab82057 > > Author: Warner Losh > > AuthorDate: 2023-07-17 17:22:45 +0000 > > Commit: Warner Losh > > CommitDate: 2023-07-17 17:22:45 +0000 > > > > tcbpcb: Always define t_osd > > > > Always define t_osd. congestion control modules access it > > unconditionally. This fixes the build. > > > > However, this is, at best, a temporary band-aide until the > > larger issues are sorted. > > > > Sponsored by: Netflix > > FWIW, I find that #ifdef's based on kernel options in "core" structures > like this > shared with modules is a recipe for disaster. > Agreed 100% Just trying to get to closure on that concept with all the concerned parties.... Warner --000000000000f1aeb60600b27ccf Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On= 7/17/23 10:35 AM, Warner Losh wrote:
> The branch main has been updated by imp:
>
> URL:
https://= cgit.FreeBSD.org/src/commit/?id=3Dd3152ab23e0e7bee5a0f988ecca2a1187ab82057<= /a>
>
> commit d3152ab23e0e7bee5a0f988ecca2a1187ab82057
> Author:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org>
> AuthorDate: 2023-07-17 17:22:45 +0000
> Commit:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org>
> CommitDate: 2023-07-17 17:22:45 +0000
>
>=C2=A0 =C2=A0 =C2=A0 tcbpcb: Always define t_osd
>=C2=A0 =C2=A0 =C2=A0
>=C2=A0 =C2=A0 =C2=A0 Always define t_osd. congestion control modules ac= cess it
>=C2=A0 =C2=A0 =C2=A0 unconditionally. This fixes the build.
>=C2=A0 =C2=A0 =C2=A0
>=C2=A0 =C2=A0 =C2=A0 However, this is, at best, a temporary band-aide u= ntil the
>=C2=A0 =C2=A0 =C2=A0 larger issues are sorted.
>=C2=A0 =C2=A0 =C2=A0
>=C2=A0 =C2=A0 =C2=A0 Sponsored by:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0Netflix

FWIW, I find that #ifdef's based on kernel options in "core" = structures like this
shared with modules is a recipe for disaster.
--000000000000f1aeb60600b27ccf-- From nobody Mon Jul 17 17:54:14 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R4V8J329Rz4nf5F; Mon, 17 Jul 2023 17:54:24 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.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 mx1.freebsd.org (Postfix) with ESMTPS id 4R4V8H6JChz3CsL; Mon, 17 Jul 2023 17:54:23 +0000 (UTC) (envelope-from kostikbel@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.17.1/8.17.1) with ESMTPS id 36HHsETM013111 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 17 Jul 2023 20:54:17 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 36HHsETM013111 Received: (from kostik@localhost) by tom.home (8.17.1/8.17.1/Submit) id 36HHsEki013110; Mon, 17 Jul 2023 20:54:14 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 17 Jul 2023 20:54:14 +0300 From: Konstantin Belousov To: Warner Losh Cc: John Baldwin , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 60381fd1ee86 - main - memdesc: Retire MEMDESC_CCB. Message-ID: References: <202307141841.36EIf3f0019403@gitrepo.freebsd.org> <65d7d8d8-9f98-abd2-1ce3-ae3a2d3bf111@FreeBSD.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.0 X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-14) on tom.home X-Rspamd-Queue-Id: 4R4V8H6JChz3CsL X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On Mon, Jul 17, 2023 at 11:29:20AM -0600, Warner Losh wrote: > On Mon, Jul 17, 2023 at 11:15 AM John Baldwin wrote: > > > On 7/17/23 8:48 AM, Konstantin Belousov wrote: > > > On Fri, Jul 14, 2023 at 06:41:03PM +0000, John Baldwin wrote: > > >> The branch main has been updated by jhb: > > >> > > >> URL: > > https://cgit.FreeBSD.org/src/commit/?id=60381fd1ee8668ea1e4676a6128883d987cab858 > > >> > > >> commit 60381fd1ee8668ea1e4676a6128883d987cab858 > > >> Author: John Baldwin > > >> AuthorDate: 2023-07-14 18:30:31 +0000 > > >> Commit: John Baldwin > > >> CommitDate: 2023-07-14 18:32:16 +0000 > > >> > > >> memdesc: Retire MEMDESC_CCB. > > >> > > >> Instead, change memdesc_ccb to examine the CCB and return a > > memdesc of > > >> a more generic type describing the data buffer. > > > > > >> diff --git a/sys/kern/subr_bus_dma.c b/sys/kern/subr_bus_dma.c > > >> index 65a08aeba17c..bfaad30b37d3 100644 > > >> --- a/sys/kern/subr_bus_dma.c > > >> +++ b/sys/kern/subr_bus_dma.c > > >> @@ -304,94 +304,6 @@ bus_dmamap_load_ma_triv(bus_dma_tag_t dmat, > > bus_dmamap_t map, > > >> @@ -566,49 +478,18 @@ bus_dmamap_load_ccb(bus_dma_tag_t dmat, > > bus_dmamap_t map, union ccb *ccb, > > >> + mem = memdesc_ccb(ccb); > > >> + return (bus_dmamap_load_mem(dmat, map, &mem, callback, > > callback_arg, > > >> + flags)); > > >> } > > > This makes kernel not linkable if CAM is not included into it. > > > > Hmmm, ok. I can either move the memdesc_ccb routine into sys/kern > > somewhere > > (like the kern_memdesc.c file in my other pending review), or we can #ifdef > > this function. It probably doesn't make sense to have a > > bus_dmamap_load_ccb > > if you don't have CAM, so I think I prefer the second option. > > > > MINIMAL doesn't have CAM configured, but it is loadable as a module. > > I'd think we'd want a dummy one fo these with weak symbol binding and have > the actual > one live in cam somewhere that overrides this symbol. The symbol resolution does not work this way in kernel. And it cannot made working this way even in theory, because cam.ko is loadable at runtime. I believe the only feasible solution is to move memdesc_ccb() into kernel unconditionally. > > I just hit this in building MINIMAL for other reasons.... From nobody Mon Jul 17 17:58:55 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R4VFn4YBcz4nfpf for ; Mon, 17 Jul 2023 17:59:09 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R4VFm5g1Kz3DpK for ; Mon, 17 Jul 2023 17:59:08 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-4fbbfaacfc1so7698275e87.1 for ; Mon, 17 Jul 2023 10:59:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20221208.gappssmtp.com; s=20221208; t=1689616747; x=1692208747; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=6LUpG4c0ikXDgzFkpX7egKXQVV83YcFRAfzVaMLfaqU=; b=sy5fNQOW9de8NaKoJj5NyyQX1duL2UX1x7GkTaJafMPuPQlwLyZuhIb8CN1VP7DHFC NXcA/9/8Kj7+sl7Ke2ohWXBlkOkbpQ/lodtNdAJiH2iK+rEgskUZEc9D8PL1a0oIIGmu TJxJqz+DXnCjlJDEPe/lg3BrTg8yN+xRafjZs8iuGECjmAX/f3QJR3Ibp4EBnOFrqqTW T2bGOUybzLNPyONSLPLh8AZe7+CuE9ys4dlm07uWrwoUYO7vQxm1AZ3mX4bLkHyPFPX3 y2i3Kl9DHegbw9uM45zyjZf/KvAh+WTPrub+ET7ObxNu6rrjUrUHbJjQMJ4qVcgp9iZV W14g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689616747; x=1692208747; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=6LUpG4c0ikXDgzFkpX7egKXQVV83YcFRAfzVaMLfaqU=; b=cXEX4H+Ny4f7PUh7e6Zl2ql9NTmCAOE7sQ8YoYLgyhn5oDtP/UQhlQtQu70l6v+N5b YQLlwmNmBZ0qhkgzdBj/ddobWQp/Phe78nmT2BYccwg0F1fbBeD8i7kRGsFwAC/Qoo37 U/vYz+kqgAi1vWvWQeWw7IP7J5VfggCAPA20eF+pr5XFdmeH08VU3MWUxspwYp8IezIY OoHQS8XaeEvDLdfyFJdt4/r4Qteys8hNHmEbO7jqsAK5NXe0RQDVR6/2vDgtO567+PQy fs+sD6jd6fuA6jeSKS7m+7B/awNP8WnG0KdFxu/wmjKGaUSaCY73y+/+U2gK53HOLpxy U5Wg== X-Gm-Message-State: ABy/qLZpDtycswuvzOBL2c0ylfP1/OJrHQTlioEpiOe6mHfjlxxSbAu9 aYTkSRdr1UM34Iqe2eu6rHhvxHFA/PP4aIuK3scfGQ== X-Google-Smtp-Source: APBJJlHpnRwGHk60z00GXu6MGeGQnaUcXhVF3arG9Xe+IWYul4Rrxs0Cvj981oEUfOVVjXuVUkodYgJg3Wxm3ZOXK8E= X-Received: by 2002:a05:6512:705:b0:4f8:4245:ed57 with SMTP id b5-20020a056512070500b004f84245ed57mr8245485lfs.35.1689616746540; Mon, 17 Jul 2023 10:59:06 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <202307141841.36EIf3f0019403@gitrepo.freebsd.org> <65d7d8d8-9f98-abd2-1ce3-ae3a2d3bf111@FreeBSD.org> In-Reply-To: From: Warner Losh Date: Mon, 17 Jul 2023 11:58:55 -0600 Message-ID: Subject: Re: git: 60381fd1ee86 - main - memdesc: Retire MEMDESC_CCB. To: Konstantin Belousov Cc: John Baldwin , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="000000000000fc0c310600b28d2b" X-Rspamd-Queue-Id: 4R4VFm5g1Kz3DpK X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N --000000000000fc0c310600b28d2b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Jul 17, 2023 at 11:54=E2=80=AFAM Konstantin Belousov wrote: > On Mon, Jul 17, 2023 at 11:29:20AM -0600, Warner Losh wrote: > > On Mon, Jul 17, 2023 at 11:15=E2=80=AFAM John Baldwin = wrote: > > > > > On 7/17/23 8:48 AM, Konstantin Belousov wrote: > > > > On Fri, Jul 14, 2023 at 06:41:03PM +0000, John Baldwin wrote: > > > >> The branch main has been updated by jhb: > > > >> > > > >> URL: > > > > https://cgit.FreeBSD.org/src/commit/?id=3D60381fd1ee8668ea1e4676a6128883d= 987cab858 > > > >> > > > >> commit 60381fd1ee8668ea1e4676a6128883d987cab858 > > > >> Author: John Baldwin > > > >> AuthorDate: 2023-07-14 18:30:31 +0000 > > > >> Commit: John Baldwin > > > >> CommitDate: 2023-07-14 18:32:16 +0000 > > > >> > > > >> memdesc: Retire MEMDESC_CCB. > > > >> > > > >> Instead, change memdesc_ccb to examine the CCB and return a > > > memdesc of > > > >> a more generic type describing the data buffer. > > > > > > > >> diff --git a/sys/kern/subr_bus_dma.c b/sys/kern/subr_bus_dma.c > > > >> index 65a08aeba17c..bfaad30b37d3 100644 > > > >> --- a/sys/kern/subr_bus_dma.c > > > >> +++ b/sys/kern/subr_bus_dma.c > > > >> @@ -304,94 +304,6 @@ bus_dmamap_load_ma_triv(bus_dma_tag_t dmat, > > > bus_dmamap_t map, > > > >> @@ -566,49 +478,18 @@ bus_dmamap_load_ccb(bus_dma_tag_t dmat, > > > bus_dmamap_t map, union ccb *ccb, > > > >> + mem =3D memdesc_ccb(ccb); > > > >> + return (bus_dmamap_load_mem(dmat, map, &mem, callback, > > > callback_arg, > > > >> + flags)); > > > >> } > > > > This makes kernel not linkable if CAM is not included into it. > > > > > > Hmmm, ok. I can either move the memdesc_ccb routine into sys/kern > > > somewhere > > > (like the kern_memdesc.c file in my other pending review), or we can > #ifdef > > > this function. It probably doesn't make sense to have a > > > bus_dmamap_load_ccb > > > if you don't have CAM, so I think I prefer the second option. > > > > > > > MINIMAL doesn't have CAM configured, but it is loadable as a module. > > > > I'd think we'd want a dummy one fo these with weak symbol binding and > have > > the actual > > one live in cam somewhere that overrides this symbol. > The symbol resolution does not work this way in kernel. And it cannot > made working this way even in theory, because cam.ko is loadable at > runtime. > Yea... It could, if we have perfect knowledge of all the places that it is called. But I don't think we do, now that I think about it... so yes, it's good to want things, but in this case my desire cannot exist, I agree. > I believe the only feasible solution is to move memdesc_ccb() into kernel > unconditionally. > Or if it was in cam.h and made a static inline. It's short enough that won't bloat the kernel in the half a dozen places its called, and it would give similar performance to what we have today with the half a dozen nearly identical copies of this routine. And since it's all done with structure dancing, there's no other bits of CAM that would be brought into the kernel. Warner --000000000000fc0c310600b28d2b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Mon, Jul 17, 2023 at 11:29:20AM -0600, Warner Losh wrote: > On Mon, Jul 17, 2023 at 11:15=E2=80=AFAM John Baldwin <jhb@freebsd.org> wrote:
>
> > On 7/17/23 8:48 AM, Konstantin Belousov wrote:
> > > On Fri, Jul 14, 2023 at 06:41:03PM +0000, John Baldwin wrote= :
> > >> The branch main has been updated by jhb:
> > >>
> > >> URL:
> > https://= cgit.FreeBSD.org/src/commit/?id=3D60381fd1ee8668ea1e4676a6128883d987cab858<= /a>
> > >>
> > >> commit 60381fd1ee8668ea1e4676a6128883d987cab858
> > >> Author:=C2=A0 =C2=A0 =C2=A0John Baldwin <jhb@FreeBSD.= org>
> > >> AuthorDate: 2023-07-14 18:30:31 +0000
> > >> Commit:=C2=A0 =C2=A0 =C2=A0John Baldwin <jhb@FreeBSD.= org>
> > >> CommitDate: 2023-07-14 18:32:16 +0000
> > >>
> > >>=C2=A0 =C2=A0 =C2=A0 memdesc: Retire MEMDESC_CCB.
> > >>
> > >>=C2=A0 =C2=A0 =C2=A0 Instead, change memdesc_ccb to exami= ne the CCB and return a
> > memdesc of
> > >>=C2=A0 =C2=A0 =C2=A0 a more generic type describing the d= ata buffer.
> > >
> > >> diff --git a/sys/kern/subr_bus_dma.c b/sys/kern/subr_bus= _dma.c
> > >> index 65a08aeba17c..bfaad30b37d3 100644
> > >> --- a/sys/kern/subr_bus_dma.c
> > >> +++ b/sys/kern/subr_bus_dma.c
> > >> @@ -304,94 +304,6 @@ bus_dmamap_load_ma_triv(bus_dma_tag= _t dmat,
> > bus_dmamap_t map,
> > >> @@ -566,49 +478,18 @@ bus_dmamap_load_ccb(bus_dma_tag_t = dmat,
> > bus_dmamap_t map, union ccb *ccb,
> > >> +=C2=A0 =C2=A0 mem =3D memdesc_ccb(ccb);
> > >> +=C2=A0 =C2=A0 return (bus_dmamap_load_mem(dmat, map, &a= mp;mem, callback,
> > callback_arg,
> > >> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 flags));
> > >>=C2=A0 =C2=A0}
> > > This makes kernel not linkable if CAM is not included into i= t.
> >
> > Hmmm, ok.=C2=A0 I can either move the memdesc_ccb routine into sy= s/kern
> > somewhere
> > (like the kern_memdesc.c file in my other pending review), or we = can #ifdef
> > this function.=C2=A0 It probably doesn't make sense to have a=
> > bus_dmamap_load_ccb
> > if you don't have CAM, so I think I prefer the second option.=
> >
>
> MINIMAL doesn't have CAM configured, but it is loadable as a modul= e.
>
> I'd think we'd want a dummy one fo these with weak symbol bind= ing and have
> the actual
> one live in cam somewhere that overrides this=C2=A0 symbol.
The symbol resolution does not work this way in kernel.=C2=A0 And it cannot=
made working this way even in theory, because cam.ko is loadable at
runtime.

<= div>=C2=A0
I believe the only feasible solution is to move memdesc_ccb() into kernel unconditionally.

<= div>the kernel in the half a dozen places its called, and it would give sim= ilar performance
--000000000000fc0c310600b28d2b-- From nobody Mon Jul 17 18:02:13 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R4VKN206Zz4nhCM; Mon, 17 Jul 2023 18:02:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.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 "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R4VKN1W3cz3G3W; Mon, 17 Jul 2023 18:02:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689616936; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dGzdUZ967JcQnT7c+KJ5BUBH0fRYSUH8F2RtydIbrw4=; b=Mj//PGfEvrNCS+vRPnHz3Bog9YpXBtCSdQrgyPBSStqHaFEkEMGEVovVdJOwiWGgB5/MlE WatvduQR4FAvUUP9D18kk7de2FROS265bELORZL0C5UildkFCby3k/8edz4a2J237rRXzo 0UCC8nfFa91jt9ibByeS7KvUkb2pJrTz84JaIPy4OxxjU2B//IZG4Ub6fmG3PEx87kgvTu QFnYMVvB21S8JXuozRYlTy+qOqlhK7FbCyYLSo4eNpMOugasoOQkql1k3m0nnysMDqAG0Q v8bnq20of05aFh/phrexbwa+s8g4nNKxkj84dzKhqFqikCV4y8xvYbEHab9d+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689616936; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dGzdUZ967JcQnT7c+KJ5BUBH0fRYSUH8F2RtydIbrw4=; b=VWFWy04o7+6pFOMhCSktETECCXFtpdjGul14lbo4Lgccovo1FVUq+pNM+asSTexv0hBwaF yZ6W/BBhBxvLppelmAynBfk2SfrXklNQWWEBAkxDuuEbl0nG2IF4+g/dCTai8Jv+tVQMLz l/YcgCxElHuMHwQIFM3jqSHcpRDGJ5w+CR/E5DOk/R80ZcKQHe4cqEPilEl3Yqyb5v1PTF jX8w/fnbxhU+rbvBBhJq7WdIe3FN9DvIC2NORqVzB5FrY8upwV6s4xC3/i4f9sexACfjol FJScGd/eg1ETRfu8J6b/1jaL3di70awzvHRtscIv9DsAD576V5K+9AaXGy/VkQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689616936; a=rsa-sha256; cv=none; b=kDmMOkOJJ0Tqd8zh/5S6XW+SH1epr0531lKMVYlOkSyAR/PPUeJ3ZxE6pC2o7DArkqEIe2 ZXijRD6YTz0WlLkeuJfH3A9bp0JurV+Oxb/+gbtESauno/gKrdA0s0QrIZgGpf0dn6lPjp h94wT8SCxfoDDvEyDUSyuW+M2ncEAx9QbGHWv2Dte6IDXtnC+pZY/HlBXnlnOt5IhLwjlO yBIP3ZMINYPD4CQ0UH9bqGsTNJBYuGTnHSazfE3UhM1jrllEIbThRpB1z4EHHWrqe40d03 xBfv8GdRbGga8BHv7ECMRPwOuyIJNd22QY/4sdE6ZbM2Nla3A0QO4eo9/miDnQ== Received: from [IPV6:2601:648:8680:16b0:2c33:b8f1:d09:3750] (unknown [IPv6:2601:648:8680:16b0:2c33:b8f1:d09:3750]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4R4VKM1hzdz1NRH; Mon, 17 Jul 2023 18:02:15 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <92656b28-8bfa-23a9-2683-23ccb817b8a7@FreeBSD.org> Date: Mon, 17 Jul 2023 11:02:13 -0700 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: git: 60381fd1ee86 - main - memdesc: Retire MEMDESC_CCB. Content-Language: en-US To: Warner Losh , Konstantin Belousov Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202307141841.36EIf3f0019403@gitrepo.freebsd.org> <65d7d8d8-9f98-abd2-1ce3-ae3a2d3bf111@FreeBSD.org> From: John Baldwin In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ThisMailContainsUnwantedMimeParts: N On 7/17/23 10:58 AM, Warner Losh wrote: > On Mon, Jul 17, 2023 at 11:54 AM Konstantin Belousov > wrote: > >> On Mon, Jul 17, 2023 at 11:29:20AM -0600, Warner Losh wrote: >>> On Mon, Jul 17, 2023 at 11:15 AM John Baldwin wrote: >>> >>>> On 7/17/23 8:48 AM, Konstantin Belousov wrote: >>>>> On Fri, Jul 14, 2023 at 06:41:03PM +0000, John Baldwin wrote: >>>>>> The branch main has been updated by jhb: >>>>>> >>>>>> URL: >>>> >> https://cgit.FreeBSD.org/src/commit/?id=60381fd1ee8668ea1e4676a6128883d987cab858 >>>>>> >>>>>> commit 60381fd1ee8668ea1e4676a6128883d987cab858 >>>>>> Author: John Baldwin >>>>>> AuthorDate: 2023-07-14 18:30:31 +0000 >>>>>> Commit: John Baldwin >>>>>> CommitDate: 2023-07-14 18:32:16 +0000 >>>>>> >>>>>> memdesc: Retire MEMDESC_CCB. >>>>>> >>>>>> Instead, change memdesc_ccb to examine the CCB and return a >>>> memdesc of >>>>>> a more generic type describing the data buffer. >>>>> >>>>>> diff --git a/sys/kern/subr_bus_dma.c b/sys/kern/subr_bus_dma.c >>>>>> index 65a08aeba17c..bfaad30b37d3 100644 >>>>>> --- a/sys/kern/subr_bus_dma.c >>>>>> +++ b/sys/kern/subr_bus_dma.c >>>>>> @@ -304,94 +304,6 @@ bus_dmamap_load_ma_triv(bus_dma_tag_t dmat, >>>> bus_dmamap_t map, >>>>>> @@ -566,49 +478,18 @@ bus_dmamap_load_ccb(bus_dma_tag_t dmat, >>>> bus_dmamap_t map, union ccb *ccb, >>>>>> + mem = memdesc_ccb(ccb); >>>>>> + return (bus_dmamap_load_mem(dmat, map, &mem, callback, >>>> callback_arg, >>>>>> + flags)); >>>>>> } >>>>> This makes kernel not linkable if CAM is not included into it. >>>> >>>> Hmmm, ok. I can either move the memdesc_ccb routine into sys/kern >>>> somewhere >>>> (like the kern_memdesc.c file in my other pending review), or we can >> #ifdef >>>> this function. It probably doesn't make sense to have a >>>> bus_dmamap_load_ccb >>>> if you don't have CAM, so I think I prefer the second option. >>>> >>> >>> MINIMAL doesn't have CAM configured, but it is loadable as a module. >>> >>> I'd think we'd want a dummy one fo these with weak symbol binding and >> have >>> the actual >>> one live in cam somewhere that overrides this symbol. >> The symbol resolution does not work this way in kernel. And it cannot >> made working this way even in theory, because cam.ko is loadable at >> runtime. >> > > Yea... It could, if we have perfect knowledge of all the places that it is > called. > But I don't think we do, now that I think about it... so yes, it's good to > want things, > but in this case my desire cannot exist, I agree. > > >> I believe the only feasible solution is to move memdesc_ccb() into kernel >> unconditionally. >> > > Or if it was in cam.h and made a static inline. It's short enough that > won't bloat > the kernel in the half a dozen places its called, and it would give similar > performance > to what we have today with the half a dozen nearly identical copies of > this routine. > And since it's all done with structure dancing, there's no other bits of > CAM that would > be brought into the kernel. I would be happy with an inline actually, I wasn't sure originally if that was too invasive in terms of the header bloat it would entail, in particular if it lived in sys/memdesc.h, but maybe it could live in cam_ccb.h? -- John Baldwin From nobody Mon Jul 17 18:07:18 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R4VRR215Pz4nkSd for ; Mon, 17 Jul 2023 18:07:31 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com [IPv6:2a00:1450:4864:20::52b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R4VRR1GvGz3Hyq for ; Mon, 17 Jul 2023 18:07:31 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ed1-x52b.google.com with SMTP id 4fb4d7f45d1cf-51ff0e3d8c1so6429323a12.0 for ; Mon, 17 Jul 2023 11:07:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20221208.gappssmtp.com; s=20221208; t=1689617250; x=1692209250; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=CAiGct4Kwgbcxtc8KYL/QbhmHtpv8pkn7Cp/8NCsYYM=; b=y/9RuUO66DM44vNrHsIWK9nIEs6aH3eOdnAA1B7N3dtHBbZPYsbnE1BvL3HUgw8IQF 0M2V2O3sm8b5qrS9xJPXpuiPY4Yzc6piwLQJ5PXwOK1sHYkXPQfLKFDhKGtnPIey17eu DtfBTO7mM9rBDXkqvFoSSO74OqhEKs600SePu394/XX//3iC5WYFyZ14ja1m4rRIa+7F nbwJfh9ssarVFlWraHZiJ39nmtHvYOyH8LBnCemxHBFOC/6wSmnS71Q+Ng3JBvb+Le84 d1moPtalkx8ttcOf1yencFzUT9th18naaS4VSjSCdXl2//Lryvb3EgHGL2UWjV0cGPpu wrwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689617250; x=1692209250; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=CAiGct4Kwgbcxtc8KYL/QbhmHtpv8pkn7Cp/8NCsYYM=; b=DD/BeR+xVGodcJAYADvMj+ew9BG+uN12jiU1OSGGDgfP2dNKoSrqoU35nNDI9Nzy3q 8PiATQyP+6Syp1o/ll5C4WNaMtTUmnCKihahaQiNXjDk2GqidZd0N9rRlGYeIyKptqiL hn0iN4Mw3rylAUInbj7G64EXDRzpXoIt8T1nKMg4DbvL3SmumBctpSjgWGbNb5tMOqjd HSTNDxjs91CYbfS1TAungpY5nIUjQY/Rdy3XKkLUcLo9NuIOgtQnvRTpqct+FFoJkUxi zYodQbUm6Aa/omOFe0ym4C6s5x85IMRS5ACoM0RK42bHG7UTca/9KXW4s8dAH9qnS16u UTWg== X-Gm-Message-State: ABy/qLbUkG5fjxUkbecuGvuN1SgsvRV7RWG04qVN/yM1bIziEF3Z3WuU 7FT/u4Kj5ocD+mL5DBN0JVYmjgrq+gpqgEleEu1bpA== X-Google-Smtp-Source: APBJJlFAINnF7ilTn4NqEaxSlhCZI7kVqq6AgUodzYt7ctOQxnBiATB7Da92bcx5Wv9KRtMCevOX5swLxujyu+QfZe8= X-Received: by 2002:aa7:d418:0:b0:51e:291b:cc66 with SMTP id z24-20020aa7d418000000b0051e291bcc66mr12367417edq.36.1689617249799; Mon, 17 Jul 2023 11:07:29 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <202307141841.36EIf3f0019403@gitrepo.freebsd.org> <65d7d8d8-9f98-abd2-1ce3-ae3a2d3bf111@FreeBSD.org> <92656b28-8bfa-23a9-2683-23ccb817b8a7@FreeBSD.org> In-Reply-To: <92656b28-8bfa-23a9-2683-23ccb817b8a7@FreeBSD.org> From: Warner Losh Date: Mon, 17 Jul 2023 12:07:18 -0600 Message-ID: Subject: Re: git: 60381fd1ee86 - main - memdesc: Retire MEMDESC_CCB. To: John Baldwin Cc: Konstantin Belousov , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="000000000000fb29400600b2abd3" X-Rspamd-Queue-Id: 4R4VRR1GvGz3Hyq X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N --000000000000fb29400600b2abd3 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Jul 17, 2023 at 12:02=E2=80=AFPM John Baldwin wro= te: > On 7/17/23 10:58 AM, Warner Losh wrote: > > On Mon, Jul 17, 2023 at 11:54=E2=80=AFAM Konstantin Belousov < > kostikbel@gmail.com> > > wrote: > > > >> On Mon, Jul 17, 2023 at 11:29:20AM -0600, Warner Losh wrote: > >>> On Mon, Jul 17, 2023 at 11:15=E2=80=AFAM John Baldwin wrote: > >>> > >>>> On 7/17/23 8:48 AM, Konstantin Belousov wrote: > >>>>> On Fri, Jul 14, 2023 at 06:41:03PM +0000, John Baldwin wrote: > >>>>>> The branch main has been updated by jhb: > >>>>>> > >>>>>> URL: > >>>> > >> > https://cgit.FreeBSD.org/src/commit/?id=3D60381fd1ee8668ea1e4676a6128883d= 987cab858 > >>>>>> > >>>>>> commit 60381fd1ee8668ea1e4676a6128883d987cab858 > >>>>>> Author: John Baldwin > >>>>>> AuthorDate: 2023-07-14 18:30:31 +0000 > >>>>>> Commit: John Baldwin > >>>>>> CommitDate: 2023-07-14 18:32:16 +0000 > >>>>>> > >>>>>> memdesc: Retire MEMDESC_CCB. > >>>>>> > >>>>>> Instead, change memdesc_ccb to examine the CCB and return a > >>>> memdesc of > >>>>>> a more generic type describing the data buffer. > >>>>> > >>>>>> diff --git a/sys/kern/subr_bus_dma.c b/sys/kern/subr_bus_dma.c > >>>>>> index 65a08aeba17c..bfaad30b37d3 100644 > >>>>>> --- a/sys/kern/subr_bus_dma.c > >>>>>> +++ b/sys/kern/subr_bus_dma.c > >>>>>> @@ -304,94 +304,6 @@ bus_dmamap_load_ma_triv(bus_dma_tag_t dmat, > >>>> bus_dmamap_t map, > >>>>>> @@ -566,49 +478,18 @@ bus_dmamap_load_ccb(bus_dma_tag_t dmat, > >>>> bus_dmamap_t map, union ccb *ccb, > >>>>>> + mem =3D memdesc_ccb(ccb); > >>>>>> + return (bus_dmamap_load_mem(dmat, map, &mem, callback, > >>>> callback_arg, > >>>>>> + flags)); > >>>>>> } > >>>>> This makes kernel not linkable if CAM is not included into it. > >>>> > >>>> Hmmm, ok. I can either move the memdesc_ccb routine into sys/kern > >>>> somewhere > >>>> (like the kern_memdesc.c file in my other pending review), or we can > >> #ifdef > >>>> this function. It probably doesn't make sense to have a > >>>> bus_dmamap_load_ccb > >>>> if you don't have CAM, so I think I prefer the second option. > >>>> > >>> > >>> MINIMAL doesn't have CAM configured, but it is loadable as a module. > >>> > >>> I'd think we'd want a dummy one fo these with weak symbol binding and > >> have > >>> the actual > >>> one live in cam somewhere that overrides this symbol. > >> The symbol resolution does not work this way in kernel. And it cannot > >> made working this way even in theory, because cam.ko is loadable at > >> runtime. > >> > > > > Yea... It could, if we have perfect knowledge of all the places that it > is > > called. > > But I don't think we do, now that I think about it... so yes, it's good > to > > want things, > > but in this case my desire cannot exist, I agree. > > > > > >> I believe the only feasible solution is to move memdesc_ccb() into > kernel > >> unconditionally. > >> > > > > Or if it was in cam.h and made a static inline. It's short enough that > > won't bloat > > the kernel in the half a dozen places its called, and it would give > similar > > performance > > to what we have today with the half a dozen nearly identical copies of > > this routine. > > And since it's all done with structure dancing, there's no other bits o= f > > CAM that would > > be brought into the kernel. > > I would be happy with an inline actually, I wasn't sure originally if tha= t > was > too invasive in terms of the header bloat it would entail, in particular > if it > lived in sys/memdesc.h, but maybe it could live in cam_ccb.h? > cam_ccb.h likely is fine, and logically it does belong there more than cam.= h now that you mention it... And only sys/kern/subr_bus_dma.c needs it, since that's the only place that calls if my grep can be believed. Warner --000000000000fb29400600b2abd3 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On= 7/17/23 10:58 AM, Warner Losh wrote:
> On Mon, Jul 17, 2023 at 11:54=E2=80=AFAM Konstantin Belousov <
kostikbel@gmail.com= >
> wrote:
>
>> On Mon, Jul 17, 2023 at 11:29:20AM -0600, Warner Losh wrote:
>>> On Mon, Jul 17, 2023 at 11:15=E2=80=AFAM John Baldwin <jhb@freebsd.org> wr= ote:
>>>
>>>> On 7/17/23 8:48 AM, Konstantin Belousov wrote:
>>>>> On Fri, Jul 14, 2023 at 06:41:03PM +0000, John Baldwin= wrote:
>>>>>> The branch main has been updated by jhb:
>>>>>>
>>>>>> URL:
>>>>
>> https://c= git.FreeBSD.org/src/commit/?id=3D60381fd1ee8668ea1e4676a6128883d987cab858
>>>>>>
>>>>>> commit 60381fd1ee8668ea1e4676a6128883d987cab858 >>>>>> Author:=C2=A0 =C2=A0 =C2=A0John Baldwin <jhb@Fr= eeBSD.org>
>>>>>> AuthorDate: 2023-07-14 18:30:31 +0000
>>>>>> Commit:=C2=A0 =C2=A0 =C2=A0John Baldwin <jhb@Fr= eeBSD.org>
>>>>>> CommitDate: 2023-07-14 18:32:16 +0000
>>>>>>
>>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0memdesc: Retire MEMDESC_= CCB.
>>>>>>
>>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0Instead, change memdesc_= ccb to examine the CCB and return a
>>>> memdesc of
>>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0a more generic type desc= ribing the data buffer.
>>>>>
>>>>>> diff --git a/sys/kern/subr_bus_dma.c b/sys/kern/su= br_bus_dma.c
>>>>>> index 65a08aeba17c..bfaad30b37d3 100644
>>>>>> --- a/sys/kern/subr_bus_dma.c
>>>>>> +++ b/sys/kern/subr_bus_dma.c
>>>>>> @@ -304,94 +304,6 @@ bus_dmamap_load_ma_triv(bus_d= ma_tag_t dmat,
>>>> bus_dmamap_t map,
>>>>>> @@ -566,49 +478,18 @@ bus_dmamap_load_ccb(bus_dma_= tag_t dmat,
>>>> bus_dmamap_t map, union ccb *ccb,
>>>>>> +=C2=A0 =C2=A0 mem =3D memdesc_ccb(ccb);
>>>>>> +=C2=A0 =C2=A0 return (bus_dmamap_load_mem(dmat, m= ap, &mem, callback,
>>>> callback_arg,
>>>>>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 flags));
>>>>>>=C2=A0 =C2=A0 }
>>>>> This makes kernel not linkable if CAM is not included = into it.
>>>>
>>>> Hmmm, ok.=C2=A0 I can either move the memdesc_ccb routine = into sys/kern
>>>> somewhere
>>>> (like the kern_memdesc.c file in my other pending review),= or we can
>> #ifdef
>>>> this function.=C2=A0 It probably doesn't make sense to= have a
>>>> bus_dmamap_load_ccb
>>>> if you don't have CAM, so I think I prefer the second = option.
>>>>
>>>
>>> MINIMAL doesn't have CAM configured, but it is loadable as= a module.
>>>
>>> I'd think we'd want a dummy one fo these with weak sym= bol binding and
>> have
>>> the actual
>>> one live in cam somewhere that overrides this=C2=A0 symbol. >> The symbol resolution does not work this way in kernel.=C2=A0 And = it cannot
>> made working this way even in theory, because cam.ko is loadable a= t
>> runtime.
>>
>
> Yea... It could, if we have perfect knowledge of all the places that i= t is
> called.
> But I don't think we do, now that I think about it... so yes, it&#= 39;s good to
> want things,
> but in this case my desire cannot exist, I agree.
>
>
>> I believe the only feasible solution is to move memdesc_ccb() into= kernel
>> unconditionally.
>>
>
> Or if it was in cam.h and made a static inline. It's short enough = that
> won't bloat
> the kernel in the half a dozen places its called, and it would give si= milar
> performance
> to what we have today with the half a dozen nearly identical copies of=
> this routine.
> And since it's all done with structure dancing, there's no oth= er bits of
> CAM that would
> be brought into the kernel.

I would be happy with an inline actually, I wasn't sure originally if t= hat was
too invasive in terms of the header bloat it would entail, in particular if= it
lived in sys/memdesc.h, but maybe it could live in cam_ccb.h?

cam_ccb.h likely is fine, and logically it does belo= ng there more than cam.h
now that you mention it...=C2=A0 And onl= y sys/kern/subr_bus_dma.c needs it,
since that's the only pla= ce that calls if my grep can be believed.

Warner
--000000000000fb29400600b2abd3-- From nobody Mon Jul 17 18:11:54 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R4VXW56txz4nmNh; Mon, 17 Jul 2023 18:11:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.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 "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R4VXW4bkFz3KRV; Mon, 17 Jul 2023 18:11:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689617515; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KbhjIqneWzFLPAcF8X//2Aneg1LCGMXfm5lTbgwkTqo=; b=BLpMDKhk6SFcHXzo/2qbv41K5H1trQeC7UN1ZC5B1rE/703KN3U7yW3JrwYFVT9umS4aBo jYt57olIOK+PuxrGKk0Z42MeC8zzvOcQuBl5UpISgndRiNBlO8HfdoYVCo+5jVjqGnEMS+ V3SO9RO7CF/ff361nzDox/KNVqIwg7ma8UFS7jfg3X48G0TII04G8HR4Q/snznbhomovg6 wzxi5g2/MfqDYFRzHcDttdrs7hACRatM6zAQ+l9WNbqOY79+n1BDoxJ33dYd5NE8Z5dE/X rNq8oSA41IZziTi5z5+LkB1uL18fMB1sMwIEVUckRHngS9KtoPuN8wI4A2zbBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689617515; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KbhjIqneWzFLPAcF8X//2Aneg1LCGMXfm5lTbgwkTqo=; b=OmNhVuMR+p8drpnGYQhFeQjoVwq7c6CjT40hyoxcb5S6WHoNn8Mmu11OgFKF5BnJi22bIk LYPKn/6Ekj5k/gnqck1ubtbBlBu+7wa6s+6kON6WP7AOmYB2dNBL4J4Cel2rTBPMTn/+ec 5+EEbj1RJSqv8WekqzVFvT9whHdtI5gRBbP+Qx73T2T46lz6Yi/ts8Rz5GPhfR89eFm6ef 8HyZ9Ar+BFRiPpQf3FAvxHW6Qc7NnNzHQ2UExVrOWcN4F1Z72dJKgWwqlYrn0MIybqxMp8 2fXqv0LlOQ6w058QXo4t7wxo8cfVcZPcBSWURxhy0yK/04Xo22ZGtPvGqIzrhg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689617515; a=rsa-sha256; cv=none; b=iQOXp0Itfoqv2S0cyhWRcdyvLB/ywwQ+GdDejXIAQ+fG0mFM/3XKu0g0ilfVXt3RNNFsLA dwC9cFPPbB74nDKdZIFrejTBpsFIyVIv0eyJ1izWFha9Yj7uCFma6AGjdiP3nkW9zRK2oR mIn0FO3ZDuQtfFyIXV0sj56m6n7HYQ4sOoN2EQRr/DBaGDVd23dSsqXHVKPS2sUabGYbQW J5VRDuPPtM0ZeqQYYz05VHsyWPZfSVWjJtJmaPH2chHrFoXFcD5uqrpbN10X4hUg/rs9SA U+A6Iz8eHBzP0kebXawQ1Mwg8LR51h3fjXuL/zDuwbBJ29vtRNX4gu1BQ68IZw== Received: from [IPV6:2601:648:8680:16b0:2c33:b8f1:d09:3750] (unknown [IPv6:2601:648:8680:16b0:2c33:b8f1:d09:3750]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4R4VXW03pPz1Nx7; Mon, 17 Jul 2023 18:11:54 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <09687219-240b-c1a5-8e5a-956b231854d5@FreeBSD.org> Date: Mon, 17 Jul 2023 11:11:54 -0700 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: git: 60381fd1ee86 - main - memdesc: Retire MEMDESC_CCB. Content-Language: en-US To: Warner Losh Cc: Konstantin Belousov , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202307141841.36EIf3f0019403@gitrepo.freebsd.org> <65d7d8d8-9f98-abd2-1ce3-ae3a2d3bf111@FreeBSD.org> <92656b28-8bfa-23a9-2683-23ccb817b8a7@FreeBSD.org> From: John Baldwin In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ThisMailContainsUnwantedMimeParts: N On 7/17/23 11:07 AM, Warner Losh wrote: > On Mon, Jul 17, 2023 at 12:02 PM John Baldwin wrote: > >> On 7/17/23 10:58 AM, Warner Losh wrote: >>> On Mon, Jul 17, 2023 at 11:54 AM Konstantin Belousov < >> kostikbel@gmail.com> >>> wrote: >>> Or if it was in cam.h and made a static inline. It's short enough that >>> won't bloat >>> the kernel in the half a dozen places its called, and it would give >> similar >>> performance >>> to what we have today with the half a dozen nearly identical copies of >>> this routine. >>> And since it's all done with structure dancing, there's no other bits of >>> CAM that would >>> be brought into the kernel. >> >> I would be happy with an inline actually, I wasn't sure originally if that >> was >> too invasive in terms of the header bloat it would entail, in particular >> if it >> lived in sys/memdesc.h, but maybe it could live in cam_ccb.h? >> > > cam_ccb.h likely is fine, and logically it does belong there more than cam.h > now that you mention it... And only sys/kern/subr_bus_dma.c needs it, > since that's the only place that calls if my grep can be believed. I use it in my NVMeoF host, but that is also already including cam_ccb.h since it needs to know about CCB internals anyway. -- John Baldwin From nobody Mon Jul 17 18:20:04 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R4Vk91JC0z4nqtj for ; Mon, 17 Jul 2023 18:20:17 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R4Vk90vmyz3NjP for ; Mon, 17 Jul 2023 18:20:17 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ed1-x52f.google.com with SMTP id 4fb4d7f45d1cf-51cff235226so10001845a12.0 for ; Mon, 17 Jul 2023 11:20:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20221208.gappssmtp.com; s=20221208; t=1689618016; x=1692210016; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=GtLHzIGNIexbYaVc7vAE90iDks3XGSLuvIK7UQ7+620=; b=oFP0EYm1+ZIJyl6PVd6/BbhYmzCDPRfIC1CwDEIsdSfoeztdLgv3JRrTZutTeZsupy AcZh3iB4W2IHCqASFV6wXU6WRtSvyNvHhcIYYKX48PRaeicXEN/fbIo+N2fQa3U/XWzz OXChzasnJyagCwxdByif0fGa+0Kd2ES9b9eN/E1ePxuEIY8YiD/vql7n3vG1bA8cZTsY 2s7mbEgyC9gYvemRYk4rwa3nbys4HEGkZSqFIslmYh2nFGWI2a4EZH2uwHUqPObTchqe bsgrK+F2UgEdNqFqsreAZV+6FpaSQ0QFeQSqQpP0ogFKyLTsFeMR5fxC+20P+QfHG1nE iLOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689618016; x=1692210016; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=GtLHzIGNIexbYaVc7vAE90iDks3XGSLuvIK7UQ7+620=; b=Ro5iEarXb2123laWZ07pxHDfAI79PezwR+8jv7rBuCRZFs/DzXHEgCGQiUd/JvSaL+ QX/p1fQ1TQvhmyO6rSyrwGL8idquD376mTjZVXlZIMKRZOqy3sc35y2XBtRkSQ37qMft /KoguLpVHHmvDULqQgRqPmM367aQCZ8E5Ofsh2c55QlQHq6YpuIITrTD7G0nPAbHKp/+ n4ngtTdjy5Awhe8xWP4SFOmgJKPN884MOpQkzk1H61VJoHlGxQhr0YghGQbaWFrrquVh VdzoURBdOXoJ4QODfTdf65Fu9agW51Q6kV2jta2iJDiWXBYlnIJWDGW4W3ltLAqZ1yBf vdzw== X-Gm-Message-State: ABy/qLYBQE45F/eo2EGUXJ4XBtrZf0wGF63Qxex4CUohBuBgxCbNtsAd UKz3ASCEvzDgYNonHjH8vbezEdkRAA6LxDQWmUk592Yrh0weuu5nKWk= X-Google-Smtp-Source: APBJJlEFBnFqRs6Vx5jI/FizuzVrUgJqEOgadoTJooUtcaOpkI4+lyEgrHP6j2N1r5uSAu51Xvv7U3h/yFJf4KSRs0U= X-Received: by 2002:a05:6402:1857:b0:521:7667:3c7a with SMTP id v23-20020a056402185700b0052176673c7amr7698444edy.19.1689618015858; Mon, 17 Jul 2023 11:20:15 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <202307141841.36EIf3f0019403@gitrepo.freebsd.org> <65d7d8d8-9f98-abd2-1ce3-ae3a2d3bf111@FreeBSD.org> <92656b28-8bfa-23a9-2683-23ccb817b8a7@FreeBSD.org> <09687219-240b-c1a5-8e5a-956b231854d5@FreeBSD.org> In-Reply-To: <09687219-240b-c1a5-8e5a-956b231854d5@FreeBSD.org> From: Warner Losh Date: Mon, 17 Jul 2023 12:20:04 -0600 Message-ID: Subject: Re: git: 60381fd1ee86 - main - memdesc: Retire MEMDESC_CCB. To: John Baldwin Cc: Konstantin Belousov , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="000000000000a445b00600b2d9d1" X-Rspamd-Queue-Id: 4R4Vk90vmyz3NjP X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N --000000000000a445b00600b2d9d1 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Jul 17, 2023 at 12:11=E2=80=AFPM John Baldwin wro= te: > On 7/17/23 11:07 AM, Warner Losh wrote: > > On Mon, Jul 17, 2023 at 12:02=E2=80=AFPM John Baldwin = wrote: > > > >> On 7/17/23 10:58 AM, Warner Losh wrote: > >>> On Mon, Jul 17, 2023 at 11:54=E2=80=AFAM Konstantin Belousov < > >> kostikbel@gmail.com> > >>> wrote: > >>> Or if it was in cam.h and made a static inline. It's short enough tha= t > >>> won't bloat > >>> the kernel in the half a dozen places its called, and it would give > >> similar > >>> performance > >>> to what we have today with the half a dozen nearly identical copies o= f > >>> this routine. > >>> And since it's all done with structure dancing, there's no other bits > of > >>> CAM that would > >>> be brought into the kernel. > >> > >> I would be happy with an inline actually, I wasn't sure originally if > that > >> was > >> too invasive in terms of the header bloat it would entail, in particul= ar > >> if it > >> lived in sys/memdesc.h, but maybe it could live in cam_ccb.h? > >> > > > > cam_ccb.h likely is fine, and logically it does belong there more than > cam.h > > now that you mention it... And only sys/kern/subr_bus_dma.c needs it, > > since that's the only place that calls if my grep can be believed. > > I use it in my NVMeoF host, but that is also already including cam_ccb.h > since > it needs to know about CCB internals anyway. > Yea, that sounds like 2 copies in memory of a routine that's kinda small and might be worth the performance improvement with fewer function calls (and even if it not, the hundred or so bytes is a small price to fix this issue, and we do way worse for much flimsier reasons elsewhere in the kernel). Warner --000000000000a445b00600b2d9d1 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On= 7/17/23 11:07 AM, Warner Losh wrote:
> On Mon, Jul 17, 2023 at 12:02=E2=80=AFPM John Baldwin <
jhb@freebsd.org> wrote:
>
>> On 7/17/23 10:58 AM, Warner Losh wrote:
>>> On Mon, Jul 17, 2023 at 11:54=E2=80=AFAM Konstantin Belousov &= lt;
>> kostikbel= @gmail.com>
>>> wrote:
>>> Or if it was in cam.h and made a static inline. It's short= enough that
>>> won't bloat
>>> the kernel in the half a dozen places its called, and it would= give
>> similar
>>> performance
>>> to what we have today with the half a dozen nearly identical c= opies of
>>> this routine.
>>> And since it's all done with structure dancing, there'= s no other bits of
>>> CAM that would
>>> be brought into the kernel.
>>
>> I would be happy with an inline actually, I wasn't sure origin= ally if that
>> was
>> too invasive in terms of the header bloat it would entail, in part= icular
>> if it
>> lived in sys/memdesc.h, but maybe it could live in cam_ccb.h?
>>
>
> cam_ccb.h likely is fine, and logically it does belong there more than= cam.h
> now that you mention it...=C2=A0 And only sys/kern/subr_bus_dma.c need= s it,
> since that's the only place that calls if my grep can be believed.=

I use it in my NVMeoF host, but that is also already including cam_ccb.h si= nce
it needs to know about CCB internals anyway.

Yea, that sounds like 2 copies in memory of a routine that's kind= a small and might
be worth the performance improvement with fewer= function calls (and even if it not,
the hundred or so bytes is a= small price to fix this issue, and we do way worse for
much flim= sier reasons elsewhere in the kernel).

Warner=C2= =A0
--000000000000a445b00600b2d9d1-- From nobody Mon Jul 17 18:31:41 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R4VzR17vSz4nx5M; Mon, 17 Jul 2023 18:31:47 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from drew.franken.de (mail-n.franken.de [193.175.24.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.franken.de", Issuer "Sectigo RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R4VzQ6GTGz3h3k; Mon, 17 Jul 2023 18:31:46 +0000 (UTC) (envelope-from tuexen@freebsd.org) Authentication-Results: mx1.freebsd.org; none Received: from smtpclient.apple (unknown [IPv6:2a02:8109:1140:c3d:d9af:819d:341a:8c06]) (Authenticated sender: micmac) by mail-n.franken.de (Postfix) with ESMTPSA id 049A47120E83E; Mon, 17 Jul 2023 20:31:41 +0200 (CEST) Content-Type: text/plain; charset=utf-8 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.600.7\)) Subject: Re: git: d3152ab23e0e - main - tcbpcb: Always define t_osd From: tuexen@freebsd.org In-Reply-To: Date: Mon, 17 Jul 2023 20:31:41 +0200 Cc: John Baldwin , Warner Losh , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <98645F20-A699-4C32-8485-7ECF4C95E8A6@freebsd.org> References: <202307171735.36HHZonv063454@gitrepo.freebsd.org> To: Warner Losh X-Mailer: Apple Mail (2.3731.600.7) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, T_SCC_BODY_TEXT_LINE autolearn=disabled version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail-n.franken.de X-Rspamd-Queue-Id: 4R4VzQ6GTGz3h3k X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:680, ipnet:193.174.0.0/15, country:DE] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N > On 17. Jul 2023, at 19:54, Warner Losh wrote: >=20 >=20 >=20 > On Mon, Jul 17, 2023 at 11:52=E2=80=AFAM John Baldwin = wrote: > On 7/17/23 10:35 AM, Warner Losh wrote: >> The branch main has been updated by imp: >>=20 >> URL: = https://cgit.FreeBSD.org/src/commit/?id=3Dd3152ab23e0e7bee5a0f988ecca2a118= 7ab82057 >>=20 >> commit d3152ab23e0e7bee5a0f988ecca2a1187ab82057 >> Author: Warner Losh >> AuthorDate: 2023-07-17 17:22:45 +0000 >> Commit: Warner Losh >> CommitDate: 2023-07-17 17:22:45 +0000 >>=20 >> tcbpcb: Always define t_osd >>=20 >> Always define t_osd. congestion control modules access it >> unconditionally. This fixes the build. >>=20 >> However, this is, at best, a temporary band-aide until the >> larger issues are sorted. >>=20 >> Sponsored by: Netflix >=20 > FWIW, I find that #ifdef's based on kernel options in "core" = structures like this > shared with modules is a recipe for disaster. >=20 > Agreed 100% Just trying to get to closure on that concept with all the = concerned > parties.... Just discussed this issue with rrs@. The proposal includes this. Will = bring up a review shortly. I will put you on the reviewers list. Best regards Michael >=20 > Warner=20 From nobody Mon Jul 17 18:46:50 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R4WJt2QnGz4mrBS; Mon, 17 Jul 2023 18:46:54 +0000 (UTC) (envelope-from tuexen@fh-muenster.de) Received: from mx-out-01.fh-muenster.de (mx-out-01.fh-muenster.de [185.149.214.63]) (using TLSv1.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 "mx.fh-muenster.de", Issuer "GEANT OV RSA CA 4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R4WJt0LwBz3lR0; Mon, 17 Jul 2023 18:46:53 +0000 (UTC) (envelope-from tuexen@fh-muenster.de) Authentication-Results: mx1.freebsd.org; none Received: from mail-director-01.fh-muenster.de (mail-director-01.fh-muenster.de [185.149.215.227]) by mx-out-01.fh-muenster.de (Postfix) with ESMTPS id C21352003D; Mon, 17 Jul 2023 20:46:51 +0200 (CEST) Received: from smtpclient.apple (ip4d15f6ca.dynamic.kabel-deutschland.de [77.21.246.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: tuexen) by mail-director-01.fh-muenster.de (Postfix) with ESMTPSA id 24B5D1A004B; Mon, 17 Jul 2023 20:46:51 +0200 (CEST) Content-Type: multipart/signed; boundary="Apple-Mail=_72731636-4149-4BFF-BCD7-A9BF492B7E3A"; protocol="application/pkcs7-signature"; micalg=sha-256 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.600.7\)) Subject: Re: git: d3152ab23e0e - main - tcbpcb: Always define t_osd From: tuexen@fh-muenster.de In-Reply-To: Date: Mon, 17 Jul 2023 20:46:50 +0200 Cc: John Baldwin , Warner Losh , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <202307171735.36HHZonv063454@gitrepo.freebsd.org> To: Warner Losh X-Mailer: Apple Mail (2.3731.600.7) X-Rspamd-Queue-Id: 4R4WJt0LwBz3lR0 X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:680, ipnet:185.149.212.0/22, country:DE] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N --Apple-Mail=_72731636-4149-4BFF-BCD7-A9BF492B7E3A Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On 17. Jul 2023, at 19:54, Warner Losh wrote: >=20 >=20 >=20 > On Mon, Jul 17, 2023 at 11:52=E2=80=AFAM John Baldwin = wrote: > On 7/17/23 10:35 AM, Warner Losh wrote: > > The branch main has been updated by imp: > >=20 > > URL: = https://cgit.FreeBSD.org/src/commit/?id=3Dd3152ab23e0e7bee5a0f988ecca2a118= 7ab82057 > >=20 > > commit d3152ab23e0e7bee5a0f988ecca2a1187ab82057 > > Author: Warner Losh > > AuthorDate: 2023-07-17 17:22:45 +0000 > > Commit: Warner Losh > > CommitDate: 2023-07-17 17:22:45 +0000 > >=20 > > tcbpcb: Always define t_osd > > =20 > > Always define t_osd. congestion control modules access it > > unconditionally. This fixes the build. > > =20 > > However, this is, at best, a temporary band-aide until the > > larger issues are sorted. > > =20 > > Sponsored by: Netflix >=20 > FWIW, I find that #ifdef's based on kernel options in "core" = structures like this > shared with modules is a recipe for disaster. >=20 > Agreed 100% Just trying to get to closure on that concept with all the = concerned > parties.... Have a look at https://reviews.freebsd.org/D41059 and let us come to an agreement there. Best regards Michael >=20 > Warner=20 --Apple-Mail=_72731636-4149-4BFF-BCD7-A9BF492B7E3A Content-Disposition: attachment; filename=smime.p7s Content-Type: application/pkcs7-signature; name=smime.p7s Content-Transfer-Encoding: base64 MIAGCSqGSIb3DQEHAqCAMIACAQExDzANBglghkgBZQMEAgEFADCABgkqhkiG9w0BBwEAAKCCEfMw ggUSMIID+qADAgECAgkA4wvV+K8l2YEwDQYJKoZIhvcNAQELBQAwgYIxCzAJBgNVBAYTAkRFMSsw KQYDVQQKDCJULVN5c3RlbXMgRW50ZXJwcmlzZSBTZXJ2aWNlcyBHbWJIMR8wHQYDVQQLDBZULVN5 c3RlbXMgVHJ1c3QgQ2VudGVyMSUwIwYDVQQDDBxULVRlbGVTZWMgR2xvYmFsUm9vdCBDbGFzcyAy MB4XDTE2MDIyMjEzMzgyMloXDTMxMDIyMjIzNTk1OVowgZUxCzAJBgNVBAYTAkRFMUUwQwYDVQQK EzxWZXJlaW4genVyIEZvZXJkZXJ1bmcgZWluZXMgRGV1dHNjaGVuIEZvcnNjaHVuZ3NuZXR6ZXMg ZS4gVi4xEDAOBgNVBAsTB0RGTi1QS0kxLTArBgNVBAMTJERGTi1WZXJlaW4gQ2VydGlmaWNhdGlv biBBdXRob3JpdHkgMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMtg1/9moUHN0vqH l4pzq5lN6mc5WqFggEcVToyVsuXPztNXS43O+FZsFVV2B+pG/cgDRWM+cNSrVICxI5y+NyipCf8F XRgPxJiZN7Mg9mZ4F4fCnQ7MSjLnFp2uDo0peQcAIFTcFV9Kltd4tjTTwXS1nem/wHdN6r1ZB+Ba L2w8pQDcNb1lDY9/Mm3yWmpLYgHurDg0WUU2SQXaeMpqbVvAgWsRzNI8qIv4cRrKO+KA3Ra0Z3qL NupOkSk9s1FcragMvp0049ENF4N1xDkesJQLEvHVaY4l9Lg9K7/AjsMeO6W/VRCrKq4Xl14zzsjz 9AkH4wKGMUZrAcUQDBHHWekCAwEAAaOCAXQwggFwMA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQU k+PYMiba1fFKpZFK4OpL4qIMz+EwHwYDVR0jBBgwFoAUv1kgNgB5oKAia4zV8mHSuCzLgkowEgYD VR0TAQH/BAgwBgEB/wIBAjAzBgNVHSAELDAqMA8GDSsGAQQBga0hgiwBAQQwDQYLKwYBBAGBrSGC LB4wCAYGZ4EMAQICMEwGA1UdHwRFMEMwQaA/oD2GO2h0dHA6Ly9wa2kwMzM2LnRlbGVzZWMuZGUv cmwvVGVsZVNlY19HbG9iYWxSb290X0NsYXNzXzIuY3JsMIGGBggrBgEFBQcBAQR6MHgwLAYIKwYB BQUHMAGGIGh0dHA6Ly9vY3NwMDMzNi50ZWxlc2VjLmRlL29jc3ByMEgGCCsGAQUFBzAChjxodHRw Oi8vcGtpMDMzNi50ZWxlc2VjLmRlL2NydC9UZWxlU2VjX0dsb2JhbFJvb3RfQ2xhc3NfMi5jZXIw DQYJKoZIhvcNAQELBQADggEBAIcL/z4Cm2XIVi3WO5qYi3FP2ropqiH5Ri71sqQPrhE4eTizDnS6 dl2e6BiClmLbTDPo3flq3zK9LExHYFV/53RrtCyD2HlrtrdNUAtmB7Xts5et6u5/MOaZ/SLick0+ hFvu+c+Z6n/XUjkurJgARH5pO7917tALOxrN5fcPImxHhPalR6D90Bo0fa3SPXez7vTXTf/D6OWS T1k+kEcQSrCFWMBvf/iu7QhCnh7U3xQuTY+8npTD5+32GPg8SecmqKc22CzeIs2LgtjZeOJVEqM7 h0S2EQvVDFKvaYwPBt/QolOLV5h7z/0HJPT8vcP9SpIClxvyt7bPZYoaorVyGTkwggWsMIIElKAD AgECAgcbY7rQHiw9MA0GCSqGSIb3DQEBCwUAMIGVMQswCQYDVQQGEwJERTFFMEMGA1UEChM8VmVy ZWluIHp1ciBGb2VyZGVydW5nIGVpbmVzIERldXRzY2hlbiBGb3JzY2h1bmdzbmV0emVzIGUuIFYu MRAwDgYDVQQLEwdERk4tUEtJMS0wKwYDVQQDEyRERk4tVmVyZWluIENlcnRpZmljYXRpb24gQXV0 aG9yaXR5IDIwHhcNMTYwNTI0MTEzODQwWhcNMzEwMjIyMjM1OTU5WjCBjTELMAkGA1UEBhMCREUx RTBDBgNVBAoMPFZlcmVpbiB6dXIgRm9lcmRlcnVuZyBlaW5lcyBEZXV0c2NoZW4gRm9yc2NodW5n c25ldHplcyBlLiBWLjEQMA4GA1UECwwHREZOLVBLSTElMCMGA1UEAwwcREZOLVZlcmVpbiBHbG9i YWwgSXNzdWluZyBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJ07eRxH3h+Gy8Zp 1xCeOdfZojDbchwFfylfS2jxrRnWTOFrG7ELf6Gr4HuLi9gtzm6IOhDuV+UefwRRNuu6cG1joL6W LkDh0YNMZj0cZGnlm6Stcq5oOVGHecwX064vXWNxSzl660Knl5BpBb+Q/6RAcL0D57+eGIgfn5mI TQ5HjUhfZZkQ0tkqSe3BuS0dnxLLFdM/fx5ULzquk1enfnjK1UriGuXtQX1TX8izKvWKMKztFwUk P7agCwf9TRqaA1KgNpzeJIdl5Of6x5ZzJBTN0OgbaJ4YWa52fvfRCng8h0uwN89Tyjo4EPPLR22M ZD08WkVKusqAfLjz56dMTM0CAwEAAaOCAgUwggIBMBIGA1UdEwEB/wQIMAYBAf8CAQEwDgYDVR0P AQH/BAQDAgEGMCkGA1UdIAQiMCAwDQYLKwYBBAGBrSGCLB4wDwYNKwYBBAGBrSGCLAEBBDAdBgNV HQ4EFgQUazqYi/nyU4na4K2yMh4JH+iqO3QwHwYDVR0jBBgwFoAUk+PYMiba1fFKpZFK4OpL4qIM z+EwgY8GA1UdHwSBhzCBhDBAoD6gPIY6aHR0cDovL2NkcDEucGNhLmRmbi5kZS9nbG9iYWwtcm9v dC1nMi1jYS9wdWIvY3JsL2NhY3JsLmNybDBAoD6gPIY6aHR0cDovL2NkcDIucGNhLmRmbi5kZS9n bG9iYWwtcm9vdC1nMi1jYS9wdWIvY3JsL2NhY3JsLmNybDCB3QYIKwYBBQUHAQEEgdAwgc0wMwYI KwYBBQUHMAGGJ2h0dHA6Ly9vY3NwLnBjYS5kZm4uZGUvT0NTUC1TZXJ2ZXIvT0NTUDBKBggrBgEF BQcwAoY+aHR0cDovL2NkcDEucGNhLmRmbi5kZS9nbG9iYWwtcm9vdC1nMi1jYS9wdWIvY2FjZXJ0 L2NhY2VydC5jcnQwSgYIKwYBBQUHMAKGPmh0dHA6Ly9jZHAyLnBjYS5kZm4uZGUvZ2xvYmFsLXJv b3QtZzItY2EvcHViL2NhY2VydC9jYWNlcnQuY3J0MA0GCSqGSIb3DQEBCwUAA4IBAQCBeEWkTqR/ DlXwCbFqPnjMaDWpHPOVnj/z+N9rOHeJLI21rT7H8pTNoAauusyosa0zCLYkhmI2THhuUPDVbmCN T1IxQ5dGdfBi5G5mUcFCMWdQ5UnnOR7Ln8qGSN4IFP8VSytmm6A4nwDO/afr0X9XLchMX9wQEZc+ lgQCXISoKTlslPwQkgZ7nu7YRrQbtQMMONncsKk/cQYLsgMHM8KNSGMlJTx6e1du94oFOO+4oK4v 9NsH1VuEGMGpuEvObJAaguS5Pfp38dIfMwK/U+d2+dwmJUFvL6Yb+qQTkPp8ftkLYF3sv8pBoGH7 EUkp2KgtdRXYShjqFu9VNCIaE40GMIIHKTCCBhGgAwIBAgIMJrRClNKRzetB0jc/MA0GCSqGSIb3 DQEBCwUAMIGNMQswCQYDVQQGEwJERTFFMEMGA1UECgw8VmVyZWluIHp1ciBGb2VyZGVydW5nIGVp bmVzIERldXRzY2hlbiBGb3JzY2h1bmdzbmV0emVzIGUuIFYuMRAwDgYDVQQLDAdERk4tUEtJMSUw IwYDVQQDDBxERk4tVmVyZWluIEdsb2JhbCBJc3N1aW5nIENBMB4XDTIyMDUzMDEzMjIxNVoXDTI1 MDUyOTEzMjIxNVowgcQxCzAJBgNVBAYTAkRFMRwwGgYDVQQIDBNOb3JkcmhlaW4tV2VzdGZhbGVu MREwDwYDVQQHDAhNdWVuc3RlcjEUMBIGA1UECgwLRkggTXVlbnN0ZXIxMjAwBgNVBAsMKUZhY2hi ZXJlaWNoIEVsZWt0cm90ZWNobmlrIHVuZCBJbmZvcm1hdGlrMQ8wDQYDVQQEDAZUdWV4ZW4xEDAO BgNVBCoMB01pY2hhZWwxFzAVBgNVBAMMDk1pY2hhZWwgVHVleGVuMIICIjANBgkqhkiG9w0BAQEF AAOCAg8AMIICCgKCAgEA2QZ7Uheto325SEnX2BTxBvYnz7u/BVmzxKlogaR4K0MA8ZcfNIdQkiJU efjL6imq21BSFsr/tXcODFZmPrvx9aIxjntCxmEFr7qFaw3e3mUIxJyj5n6BxjzZ/hyJte8LBDbj zj+e8WPUzXmYbSxtrh9kgw8NMx3+bo3Hslic+PkKEGx9JJp2I2TEs88xD0rHC2Ljwcfk6bS9jC+/ BAuY/TsbJoq+8d64DYSLGiIYbvMMuxM2C8BlpHLIOLx2FaH+uMqdH2dLVvCacZJ9YzHvvZY8O2nQ OBFCG1UMpX5YLHN8g/t02a+IBt+oe97JMdJ/kZsPjolI98dcRdzz0hTXZql2xvp6zlocm9iGTRcv dCSxy+0x4CIZD1EkVX9zCPGpzdTXnrU+zvnz14Uq3Wbfl3GiVgK0Avr1enfZepruAxAy7KGIm2zi /qY3XSkN8fvWJmYnomOjCRjaPtqS/azmnyeodsxlVhqQKbES65u/PbOXjOlhiYAvemS0IbK4iR76 3iSmkpwSNpJt6BCtFJN+w3Y8tztCP66KPPC1Fri1oj27KPaf04J66MkSjlQdpI7POS6lDyN7X2Hw tgZKRVA94h/JvZp4ld7mTzXTEW2tdO5azPILsL9xOYjSS5VIyUFF4MoxSbfZtXWaZFsMC1fXDNNL uRDrISotdwADuU75Fe0CAwEAAaOCAk4wggJKMD4GA1UdIAQ3MDUwDwYNKwYBBAGBrSGCLAEBBDAQ Bg4rBgEEAYGtIYIsAQEECjAQBg4rBgEEAYGtIYIsAgEECjAJBgNVHRMEAjAAMA4GA1UdDwEB/wQE AwIF4DAdBgNVHSUEFjAUBggrBgEFBQcDAgYIKwYBBQUHAwQwHQYDVR0OBBYEFFDbROYIxDr3fvlX tkXqx7T8lihxMB8GA1UdIwQYMBaAFGs6mIv58lOJ2uCtsjIeCR/oqjt0MCAGA1UdEQQZMBeBFXR1 ZXhlbkBmaC1tdWVuc3Rlci5kZTCBjQYDVR0fBIGFMIGCMD+gPaA7hjlodHRwOi8vY2RwMS5wY2Eu ZGZuLmRlL2Rmbi1jYS1nbG9iYWwtZzIvcHViL2NybC9jYWNybC5jcmwwP6A9oDuGOWh0dHA6Ly9j ZHAyLnBjYS5kZm4uZGUvZGZuLWNhLWdsb2JhbC1nMi9wdWIvY3JsL2NhY3JsLmNybDCB2wYIKwYB BQUHAQEEgc4wgcswMwYIKwYBBQUHMAGGJ2h0dHA6Ly9vY3NwLnBjYS5kZm4uZGUvT0NTUC1TZXJ2 ZXIvT0NTUDBJBggrBgEFBQcwAoY9aHR0cDovL2NkcDEucGNhLmRmbi5kZS9kZm4tY2EtZ2xvYmFs LWcyL3B1Yi9jYWNlcnQvY2FjZXJ0LmNydDBJBggrBgEFBQcwAoY9aHR0cDovL2NkcDIucGNhLmRm bi5kZS9kZm4tY2EtZ2xvYmFsLWcyL3B1Yi9jYWNlcnQvY2FjZXJ0LmNydDANBgkqhkiG9w0BAQsF AAOCAQEALubmL854icQMxKxOxQK+deXTjC6CLYnUDwB8MvnDC+BSeh3tUHT37fSgsK1ShNUSNJX0 YF0VYLfZ6+lPyaFYLArVrAIHqvDiVURaulB9NA+3gck/VSuRz4ILYBy61XbcGQQ8Wx+g6TcqsjsF oOhqEBycj5QuITj+EFmX8nvfo0dJtVa2OPDk1N9beLfQBcLhspJ/nv0pKhpNWv5YETG26YqYfsC7 FA/ZNGvRcoOPkjkDhBTtG+qq9DDD75XtGEBZhYXbnG15tn4/UV07B+UyK4/cqQSA+My5FML3YsQw EYrV9klVD/mLMOdZV5+95xt7O8IdYeHrBapVlhANH5bFazGCBJ0wggSZAgEBMIGeMIGNMQswCQYD VQQGEwJERTFFMEMGA1UECgw8VmVyZWluIHp1ciBGb2VyZGVydW5nIGVpbmVzIERldXRzY2hlbiBG b3JzY2h1bmdzbmV0emVzIGUuIFYuMRAwDgYDVQQLDAdERk4tUEtJMSUwIwYDVQQDDBxERk4tVmVy ZWluIEdsb2JhbCBJc3N1aW5nIENBAgwmtEKU0pHN60HSNz8wDQYJYIZIAWUDBAIBBQCgggHPMBgG CSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJKoZIhvcNAQkFMQ8XDTIzMDcxNzE4NDY1MFowLwYJ KoZIhvcNAQkEMSIEIP/oF9XLvk/OzGts4pbGpBrr4JCzrfSNvMWEzRuKLIYYMIGvBgkrBgEEAYI3 EAQxgaEwgZ4wgY0xCzAJBgNVBAYTAkRFMUUwQwYDVQQKDDxWZXJlaW4genVyIEZvZXJkZXJ1bmcg ZWluZXMgRGV1dHNjaGVuIEZvcnNjaHVuZ3NuZXR6ZXMgZS4gVi4xEDAOBgNVBAsMB0RGTi1QS0kx JTAjBgNVBAMMHERGTi1WZXJlaW4gR2xvYmFsIElzc3VpbmcgQ0ECDCa0QpTSkc3rQdI3PzCBsQYL KoZIhvcNAQkQAgsxgaGggZ4wgY0xCzAJBgNVBAYTAkRFMUUwQwYDVQQKDDxWZXJlaW4genVyIEZv ZXJkZXJ1bmcgZWluZXMgRGV1dHNjaGVuIEZvcnNjaHVuZ3NuZXR6ZXMgZS4gVi4xEDAOBgNVBAsM B0RGTi1QS0kxJTAjBgNVBAMMHERGTi1WZXJlaW4gR2xvYmFsIElzc3VpbmcgQ0ECDCa0QpTSkc3r QdI3PzANBgkqhkiG9w0BAQsFAASCAgBDRnt+HzqKV0beo7YRr1d4iu/d6vRazSaWSohCCfvueHNk rfgiLHGxBwRaLaFuioMPWdc3fjwkIJPvZ/EdgVNtHkIZBccf8OsGkvO/pqzK4RIyk5UfV6qt8i9P RKyF9OWHYX5Nk49iAoWw//L9uqVamrJ1vcWde4MwizgDrAobcijHMby18c+EbPePt/ewiH2+y40o UE3ljI3QkrmpkCFiD7c7/tcz9YJ9ccXPXkNb+yLffk2dHz5wsHtWYuPj/mmsXXhgUu0iBM0hlkit Ry0afZ8tHc22iOj5hzFsrCEW/qc9LGxykgpQRqrrbScsYkpTOesQPmbNmB5FjUhO1grCtb69nYrM lHkFqfJD9GPf5ks8pZm1aHDUb5IJQUJY00HqjFS8Gjna87GZWGNkRaeKplzAC3fvBOEuRkoGDLcY XqCxja+6my0nVf4nDC1/h3J/tYOXGB6iTDXhtiCB7dDaykSMpCqInmdqwu0TRugONE6aTycWppng FLIHe+tI/Inch2l5ah+4TqrWKIUrUwv2DWGk7pu7lSZLd+puDq3MwB/pqXlK6ymErxDq4jHmdPYf YZl6uzRbspvI7O1dNx7rMpRk3/dEDgkuEY0mtbSiMRIlpS6Vro3lxqtTEqwHCN7z6jnVMv74Qm3Q 1waOk6xcrWp/1FmG1zB5TdyLnC1FwQAAAAAAAA== --Apple-Mail=_72731636-4149-4BFF-BCD7-A9BF492B7E3A-- From nobody Mon Jul 17 19:04:21 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R4Wj12NNFz4n0Kj; Mon, 17 Jul 2023 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 4R4Wj11sqdz3q38; Mon, 17 Jul 2023 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=1689620661; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=g4DUtZoL0EX3VHHEMYKwhxJu2j7g7cUXhypWl+cKMWM=; b=I4PYLcLkrymb/DW2jfshxor1zbLf4c8Gr9WD2vyGfjRy3N9HqQFN6p+HQVq3zFxPjGC8UP 4Pyh0Ec6T68s6dFN+viAHuc24+3bjg/xDEZPnVtVuPn87HUI4hdTJQLFVDMm4skE2uzx+H cYrlZIotOn0TlOalrOr7wRrYA+4U5FvELZda7BZJblli1FBCaA9MJkCB9lpWWelhZ5vx8j J7OQwJXiZSjzN/crHUh6VvV0P9cd3OszVtKTZtFxhDMoviJx+SbEOsatLb0o8KHlP6Bjmk wtbMKB5bRm8qc0L8oytXyjALfvdfs+qsHR+L45BoLfIifvQoqZnIdTOCYVHkfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689620661; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=g4DUtZoL0EX3VHHEMYKwhxJu2j7g7cUXhypWl+cKMWM=; b=BUHBc2WxuxBcYQtOD9VaRz6vlZfzyYlgvOa24e39PtNBjQ5KwRcHLLPnaTpBBg8nUVahB2 kfZdDlf0CqYIUNDuwhILSMgn61hFlLypbEeL2sVC0BaF7tCGsTm4joFeYduNNjXSNhsTUr g1sWIYSfWWunqOYIFbq4W98A1uW72guWiTmaOPuM1VJ/dVQjMETZM9wZ3hiZ/8t542tZ+L eiN2RCjlDghnCaPc0eUbIRa2rSgTCUnr8TIvoM/kcSP5kEke/wI0G6luc2FTdtNck0UrHj xhjkMkLsEWwtQoaVVxtHrVbRWFRCgi3uQHhEyiXEZXfr7vUQzqqyF7C3+JdLYA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689620661; a=rsa-sha256; cv=none; b=sYwo0SEeEkBwZSyBpFwNVkgK6GzlwgnCgJoaG9uQ0tcgNodZwgdi55eBRii45pMUpk4TC0 pn/DBq46bAYvE/dEVp5XrTA/COjaQlJLWvrawVtpOtLkjZxo+opVaow4O6pns38M5GrMiK mXVcPbMP5OTglwDbTvB7RZvYXdsQcsHQvIsysG8lrSm+LYP3u1RYcLIaZKTfYVUcRd5Uaa MG45HhUG0T7P1wp5SYLQd55b4AolPuhVsxTeVQkoT7BVX7aLi2F7BhsY0dS8WW3eKBhbBu O4Ppl9Rp/3i7mBd7QA/+PNlnx2zn7w5aXAt7fWFBVPNhEwaZQSSvqPlKfqNX7g== 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 4R4Wj10rmFzbZT; Mon, 17 Jul 2023 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 36HJ4LtA013462; Mon, 17 Jul 2023 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 36HJ4L1l013461; Mon, 17 Jul 2023 19:04:21 GMT (envelope-from git) Date: Mon, 17 Jul 2023 19:04:21 GMT Message-Id: <202307171904.36HJ4L1l013461@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Simon J. Gerraty" Subject: git: 89f361f742ae - main - kern.post.mk allow NEWVERS_{ENV,ARGS} List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: sjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 89f361f742aeae11c8b2e28eae3d015882b6c0ee Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by sjg: URL: https://cgit.FreeBSD.org/src/commit/?id=89f361f742aeae11c8b2e28eae3d015882b6c0ee commit 89f361f742aeae11c8b2e28eae3d015882b6c0ee Author: Simon J. Gerraty AuthorDate: 2023-07-17 19:03:35 +0000 Commit: Simon J. Gerraty CommitDate: 2023-07-17 19:03:35 +0000 kern.post.mk allow NEWVERS_{ENV,ARGS} Allow makefiles better control of newvers.sh env and args. Also allow variable overrides on command line. Reviewed by: imp, stevek Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D41012 --- sys/conf/kern.post.mk | 5 +++-- sys/conf/newvers.sh | 16 +++++++++++++--- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/sys/conf/kern.post.mk b/sys/conf/kern.post.mk index c368d5f40df8..45df83e2d16b 100644 --- a/sys/conf/kern.post.mk +++ b/sys/conf/kern.post.mk @@ -444,11 +444,12 @@ config.o env.o hints.o vers.o vnode_if.o: ${NORMAL_C} ${NORMAL_CTFCONVERT} +NEWVERS_ENV+= MAKE="${MAKE}" .if ${MK_REPRODUCIBLE_BUILD} != "no" -REPRO_FLAG="-R" +NEWVERS_ARGS+= -R .endif vers.c: .NOMETA_CMP $S/conf/newvers.sh $S/sys/param.h ${SYSTEM_DEP:Nvers.*} - MAKE="${MAKE}" sh $S/conf/newvers.sh ${REPRO_FLAG} ${KERN_IDENT} + ${NEWVERS_ENV} sh $S/conf/newvers.sh ${NEWVERS_ARGS} ${KERN_IDENT} vnode_if.c: $S/tools/vnode_if.awk $S/kern/vnode_if.src ${AWK} -f $S/tools/vnode_if.awk $S/kern/vnode_if.src -c diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index 85346b1cdc29..e21b3f5ce2e2 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -58,13 +58,23 @@ BRANCH="CURRENT" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi -RELEASE="${REVISION}-${BRANCH}" -VERSION="${TYPE} ${RELEASE}" if [ -z "${SYSDIR}" ]; then - SYSDIR=$(dirname $0)/.. + SYSDIR=$(dirname $0)/.. fi +# allow random overrides +while : +do + case "$1" in + *=*) eval "$1"; shift;; + *) break;; + esac +done + +RELEASE="${RELEASE:-${REVISION}-${BRANCH}}" +VERSION="${VERSION:-${TYPE} ${RELEASE}}" + RELDATE=$(awk '/^#define[[:space:]]*__FreeBSD_version/ {print $3}' ${PARAMFILE:-${SYSDIR}/sys/param.h}) if [ -r "${SYSDIR}/../COPYRIGHT" ]; then From nobody Mon Jul 17 19:08:53 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R4WpF46XKz4n2Qt; Mon, 17 Jul 2023 19:08: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 4R4WpF3cWgz3r1G; Mon, 17 Jul 2023 19:08:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689620933; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=D4P3i5F8eIjmWmJHphUpnx/p1Obqhkq4/eJKEe4WRk4=; b=Ipf5WNhpgacUkqWjQtvKD5v5Q7Qsw1IRd3rkYNfDE6Vgbe+vJXY3ZIrDJJ4S4e6DL/0rrZ 8bUzIH0GsXh8lLvgzcBnmo+WdbJQbf+c5VvhCNBTIeUGF1GWSMz6t+VSvwGiXgNhhv+eX/ PN00Q/cOv3TstOW2qfw6GW9xRZnpOBZV0va69SsNxFWUJIeMCe8KbTtEQcufjQpuUS7u8i JR6i0QF+HMD14VKy/ITF1XgXNmxdM0Zb8QP7XC93cbR0Jgj7mBs5bXKniCISgodPo3Lfja /WfSkTaUh70hIkEsmAov7PxramFOpd5Za8lmveW4cCnhWq8WPlf5HzKAKcwf+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689620933; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=D4P3i5F8eIjmWmJHphUpnx/p1Obqhkq4/eJKEe4WRk4=; b=gfoY4FFLIuWC3/pEfltgrWIgaxpPN5c5XzZ623jri3bhNjC+pDftPD+rPxY0e1GQIcGXdt BoYklnyN9HRezVCuLc33AutRpM5Vb400S8Rz7zxIAaarwF9hNThVE2pk0FRvIvpWcSh12y bItDkY/BP03SK4QXeBx0uurPOjosW0J5sTz8chFR2kEXbVKrzxIhAKLKxtoLlKfvIg6xGY EjtxXcJXMpnAh4Ctfp7KDZLUsBrecOQgdFQrAuX2fwMEsBXesf7R+mK/yaGGcGc/mTU+1G GB82qIDkM6r5On23BzOft97qAsnpeQ9yMUGFcsxcqncSa9gXUZ2XAVtZvgct6g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689620933; a=rsa-sha256; cv=none; b=t8Oa794HlVOumCi/r6Vod2J0ShVKoedq+zA6V8MnRvuhcSK5v+ui/K25/MVitLsr4LGeaK 8IiJbGOmkB32LZcEQhivy/bcVix/CvlSbuMEedhoXB9gPZP5faP8tPrGQEZRJ/UQMzQoZF BFT0XjkG+W5Sy8ir3EqcNyP6xDcJxnZd25BzAleTOSze2GBjeLVO4/C4ij9DqG1uru2fgx 5W0jreCbMO9Sdntf9x4DO/HTuZWhzOi2L+1UxjmCgUBCsE5w14JQalfQNE5136f4+qqFhP K4jMz3xHuOLECzW9JicR1ziSGqSBJEoyByWaopaFbowFqRRBOxN1QHyeBMFXvQ== 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 4R4WpF2hmFzZxX; Mon, 17 Jul 2023 19:08:53 +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 36HJ8rpx014213; Mon, 17 Jul 2023 19:08:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36HJ8rdL014212; Mon, 17 Jul 2023 19:08:53 GMT (envelope-from git) Date: Mon, 17 Jul 2023 19:08:53 GMT Message-Id: <202307171908.36HJ8rdL014212@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 4b426cf3a46a - main - libbe: recursively promote deep BE datasets List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4b426cf3a46a429474e2a138d3360acc23411563 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=4b426cf3a46a429474e2a138d3360acc23411563 commit 4b426cf3a46a429474e2a138d3360acc23411563 Author: R. Christian McDonald AuthorDate: 2023-07-17 19:06:28 +0000 Commit: Kyle Evans CommitDate: 2023-07-17 19:08:32 +0000 libbe: recursively promote deep BE datasets beadm will recursively promote deep BE datasets. In order to match the beadm behavior, we need to recursively iterate over child filesystems and promote them along the way. This patch further refines the work from D40903, completing the fix for promotion. Reviewed by: kevans, rew Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D40972 --- lib/libbe/be.c | 40 +++++++++++++++++++++++++++++++--------- sbin/bectl/tests/bectl_test.sh | 12 +++++------- 2 files changed, 36 insertions(+), 16 deletions(-) diff --git a/lib/libbe/be.c b/lib/libbe/be.c index 31836c623c4a..e607ab12215b 100644 --- a/lib/libbe/be.c +++ b/lib/libbe/be.c @@ -1266,12 +1266,38 @@ be_deactivate(libbe_handle_t *lbh, const char *ds, bool temporary) return (0); } +static int +be_zfs_promote_cb(zfs_handle_t *zhp, void *data) +{ + char origin[BE_MAXPATHLEN]; + bool *found_origin = (bool *)data; + int err; + + if (zfs_prop_get(zhp, ZFS_PROP_ORIGIN, origin, sizeof(origin), + NULL, NULL, 0, true) == 0) { + *found_origin = true; + err = zfs_promote(zhp); + if (err) + return (err); + } + + return (zfs_iter_filesystems(zhp, be_zfs_promote_cb, data)); +} + +static int +be_zfs_promote(zfs_handle_t *zhp, bool *found_origin) +{ + *found_origin = false; + return (be_zfs_promote_cb(zhp, (void *)found_origin)); +} + int be_activate(libbe_handle_t *lbh, const char *bootenv, bool temporary) { - char be_path[BE_MAXPATHLEN], origin[BE_MAXPATHLEN]; + char be_path[BE_MAXPATHLEN]; zfs_handle_t *zhp; int err; + bool found_origin; be_root_concat(lbh, bootenv, be_path); @@ -1297,19 +1323,15 @@ be_activate(libbe_handle_t *lbh, const char *bootenv, bool temporary) if (zhp == NULL) return (-1); - if (zfs_prop_get(zhp, ZFS_PROP_ORIGIN, origin, sizeof(origin), - NULL, NULL, 0, 1) != 0) { - zfs_close(zhp); - break; - } + err = be_zfs_promote(zhp, &found_origin); - err = zfs_promote(zhp); zfs_close(zhp); - if (err) + if (!found_origin) break; + if (err) + return (err); } - if (err) return (-1); } diff --git a/sbin/bectl/tests/bectl_test.sh b/sbin/bectl/tests/bectl_test.sh index 7ca7af8a1abf..75884029d93e 100755 --- a/sbin/bectl/tests/bectl_test.sh +++ b/sbin/bectl/tests/bectl_test.sh @@ -528,7 +528,6 @@ bectl_jail_cleanup() atf_test_case bectl_promotion cleanup bectl_promotion_head() { - atf_set "descr" "Check bectl promotion upon activation" atf_set "require.user" root } @@ -550,7 +549,7 @@ bectl_promotion_body() mount=${cwd}/mnt root=${mount}/root - bectl_create_setup ${zpool} ${disk} ${mount} + bectl_create_deep_setup ${zpool} ${disk} ${mount} atf_check mkdir -p ${root} # Sleeps interspersed to workaround some naming quirks; notably, @@ -560,23 +559,22 @@ bectl_promotion_body() # with the same name, and the promotion will fail. atf_check bectl -r ${zpool}/ROOT rename default A sleep 1 - atf_check bectl -r ${zpool}/ROOT create -e A B + atf_check bectl -r ${zpool}/ROOT create -r -e A B sleep 1 - atf_check bectl -r ${zpool}/ROOT create -e B C + atf_check bectl -r ${zpool}/ROOT create -r -e B C # C should be a clone of B to start with - atf_check -o not-inline:"-" zfs list -H -o origin ${zpool}/ROOT/C + atf_check -o not-inline:"-" zfs list -Hr -o origin ${zpool}/ROOT/C # Activating it should then promote it all the way out of clone-hood. # This entails two promotes internally, as the first would promote it to # a snapshot of A before finally promoting it the second time out of # clone status. atf_check -o not-empty bectl -r ${zpool}/ROOT activate C - atf_check -o inline:"-\n" zfs list -H -o origin ${zpool}/ROOT/C + atf_check -o inline:"-\n-\n" zfs list -Hr -o origin ${zpool}/ROOT/C } bectl_promotion_cleanup() { - bectl_cleanup $(get_zpool_name) } From nobody Mon Jul 17 20:16:58 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R4YJq02h5z4ng1v; Mon, 17 Jul 2023 20:16: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 4R4YJp6k7tz48wd; Mon, 17 Jul 2023 20:16:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689625018; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LvB3E/xf9yxphlJKEPlKLp4fCxZIC2zGUVREXEFlzYU=; b=C6BHaDJMSMUXma9O1Be6K9Svyb1b9jrwwK1cFSKlev9OfIAOV1TUhpKU/vTp9uYfL0ZpEo YkZOCmnNCt96nGD+IUmDOemWQTtDEE9qSouLe9JXO6BAaPSEgnC4iM1VdPdEJGR7lOhm+z AGPgX5jJSTV1dbaSaOTdB9ZpkTEUqyLB9efQ11mszAJrt/+d1U6bgn60lS/wH0M7VKKXYs wLK9md7ZeUc2jFzS24znysy3e5knUJku+fuig95Y4+bgSY1XRFF9V4l8y2Tj+E+DDXEVsW dxxJPeafPowtZtt5HEgZ3DKA/NxpLvYrgY9HdDOLKY7oo/OU43adbrndocdt6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689625018; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LvB3E/xf9yxphlJKEPlKLp4fCxZIC2zGUVREXEFlzYU=; b=a47k8+miqOtxGynI9PYQQ3hWagP8+Qg54vRULlk0TLaHkQkv/JCrPsKdj9J9EFKfFaUskF mvVVfHErwi4hjEYDL6eNjSw2wQu+q+RU5QrZWvP5r+1OnMD2+DFmttmuQOfGRsJof2DZYW I1/IaX0hKP48o9970Ow1wbmudX16z2LgbrnuSMUv95/nue+DCAvL2LoKvs3lxTabMX1qhu MI4gLRdJ6/FGpWcL6+lvuwA+sb15wGTLdFuc6v3JshdP2rGjwTuHTMEzaQNhGH8YrGaEbK rQ+q1jPSAK9zAJQQGW0JLzg7SOscRf1+eevWVywtfRiPmWUK66nF3d33w5gPgQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689625018; a=rsa-sha256; cv=none; b=SNzgw3qfaBRwTahSJKmy2NJm0IAYKygpBo880BcbNQSn3DfZ1OYTfvN8UyrnOHTJ3tXu5u PodQ0fOImJUjvRwXyFNpziQnayZGosjnUzzCkgkFLFvmAURknPp5GeU9sot4V+mzsdO/Pc xoFevKWZYuI0rreYCsocK54JSQZVNlIHrVQgq7nQIaKY9PgB+/2b3XOVA6zzCUioR5+7Th b4Wwr+LAdNd+FUi/bMA5z5NbbB6L5QkiaNxtYlVWSsF4YxICAPrnp66BVOUCdvoouEQOte VCySPrFpNH4zgLVeGWyBTRxotzc26xjiZrcfUs3cjKeBPJVyUSmpIVFeKPGOFQ== 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 4R4YJp5k5Zzd1r; Mon, 17 Jul 2023 20:16: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 36HKGwt9029822; Mon, 17 Jul 2023 20:16:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36HKGwqh029821; Mon, 17 Jul 2023 20:16:58 GMT (envelope-from git) Date: Mon, 17 Jul 2023 20:16:58 GMT Message-Id: <202307172016.36HKGwqh029821@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Glen Barber Subject: git: b24c35b326db - main - release: adjust lang/python* dependencies for GCE List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gjb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b24c35b326dbd355070335e63d02e7c29ee58bf0 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by gjb: URL: https://cgit.FreeBSD.org/src/commit/?id=b24c35b326dbd355070335e63d02e7c29ee58bf0 commit b24c35b326dbd355070335e63d02e7c29ee58bf0 Author: Glen Barber AuthorDate: 2023-07-17 20:16:46 +0000 Commit: Glen Barber CommitDate: 2023-07-17 20:16:46 +0000 release: adjust lang/python* dependencies for GCE The lang/python3 port had failed to properly install because it did in fact already exist and FORCE_PKG_REGISTER was not set. So, behaviorally everything here was correct. However, installing lang/python3 is in fact not correct and not needed, so only install the lang/python port to provide symbolic links. PR: 272354 MFC after: 3 days MFC with: 510fd83138001b0a6e45b3fa6a7249377f806171 MFC with: cd8cad0ef5cd534dc7ae1dd9a470cac2057ed957 MFC with: 0ed426276fd52e917506ab87c05a61c6641ae298 Sponsored by: GoFundMe https://www.gofundme.com/f/gjbbsd --- release/Makefile.gce | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/release/Makefile.gce b/release/Makefile.gce index ff364c9287c5..17f4974b1c53 100644 --- a/release/Makefile.gce +++ b/release/Makefile.gce @@ -46,13 +46,11 @@ gce-check-depends: . if !exists(/usr/local/sbin/pkg-static) env ASSUME_ALWAYS_YES=yes pkg bootstrap -yf . endif - env ASSUME_ALWAYS_YES=yes pkg install -y net/google-cloud-sdk - env ASSUME_ALWAYS_YES=yes pkg install -y lang/python lang/python3 \ - net/google-cloud-sdk + env ASSUME_ALWAYS_YES=yes pkg install -y net/google-cloud-sdk \ + lang/python . else env UNAME_r=${UNAME_r} make -C ${PORTSDIR}/net/google-cloud-sdk BATCH=1 all install clean env UNAME_r=${UNAME_r} make -C ${PORTSDIR}/lang/python BATCH=1 all install clean - env UNAME_r=${UNAME_r} make -C ${PORTSDIR}/lang/python3 BATCH=1 all install clean . endif .endif From nobody Tue Jul 18 00:29:22 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R4fw300lgz4ms7M; Tue, 18 Jul 2023 00:29: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 4R4fw240l6z4JXp; Tue, 18 Jul 2023 00:29:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689640162; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FnI+KvDs39C2eHPKyU7s8O2NiWcB7wgcz8RQSxa7avk=; b=eLEEsZuUNYyiNdkpPxADv18J5oqHTXa6JwMkRc39u2hOZuUV0MXHEYus5IOv///BhTYgbV v/Epkka5INhSRclac1KRXkXyOTjPdc/YC9nfyzXdvvFnXgixv4xHy/o+Rn+BsEbA4p4/rv UJInHNCrZCvFFGq/jg+oLHP2lHodt8CCDjoU0rjzZVU5gXMIRhSCK+fQfU5lfiXi7IXGP1 nxNhyvom1L+9P64ciXLvRf1KbQM6qp1V0ZbVJTymqWvOh40EZOjpTMVi+T5uY9ex7LpKRi rlxyVw1JCKixIrto0IxDuqN/MkMDkXGdAH6Vd2zCB83Vhp2jBTfChyiebWDu6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689640162; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FnI+KvDs39C2eHPKyU7s8O2NiWcB7wgcz8RQSxa7avk=; b=PcSmiaUpDIgK+h0s7XROiJrOvCBsyjDIeIH/r7LtWpgqKIsy9D10zzpM4KzAqe6UdtTZX0 pEzKtTLkieQS9TDJRud2tuWei7qAfOooGpLWtoU+51neHWv8pc7R29z49P0fBQ3lxs1LQx Z9J8OraOMV2QNqQHvEtI8oqZoUv4bWx1tl/HcjxUFVOoqRwi5gGBZ2rXpDsJgVG/QvugyX CZ0IeuJgHOwlZauBuxdag0qhczJA2hMKg+U01i3VSPtH1uf0JPPAbwa10MfLpt4+JWHJZx qUBau06ZaxJLxMmAczlLfNENITCpu+BUGqDF8xf/iI4LIjMb/AyhO5/p+mfLbw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689640162; a=rsa-sha256; cv=none; b=o39jGVbmORCqCBJgPs3SjWjYVRwHVpKTkStejETBMZl1Dpd25Tse64BKZiNNRCVCITpjdF tF+CQdxfkKrtxB2aoZXAQQWYtP1C/x/2JCAUIhsAuH987FN8GHOmllR5qyyEYti3JWZZNF M16YHbgsQ64U0PNFwkcitCIb6KL/eT0vQXG//KlWtEeFxKbmPiexrRdX9U0hcm/OchK9Ls AURlxWoxK5q/IVcb75peXbUBZxuJAYqud32NVNWJJklOaN+5ztrjTtYUE9VQAKVtXDY3qs txqTJCAYjPBdsg3voDp/pAVU7cb/dU57P00dOCTJaZDk4o3CSn8hVqVv58ttwA== 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 4R4fw235xBzkfg; Tue, 18 Jul 2023 00:29: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 36I0TMuj042205; Tue, 18 Jul 2023 00:29:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36I0TMRh042204; Tue, 18 Jul 2023 00:29:22 GMT (envelope-from git) Date: Tue, 18 Jul 2023 00:29:22 GMT Message-Id: <202307180029.36I0TMRh042204@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kirk McKusick Subject: git: 239597e0309d - main - Text format cleanups. No functional changes intended. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 239597e0309d4d8e84c35929513aa4a2470735ad Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=239597e0309d4d8e84c35929513aa4a2470735ad commit 239597e0309d4d8e84c35929513aa4a2470735ad Author: Kirk McKusick AuthorDate: 2023-07-18 00:28:07 +0000 Commit: Kirk McKusick CommitDate: 2023-07-18 00:29:09 +0000 Text format cleanups. No functional changes intended. MFC-after: 1 week Sponsored-by: The FreeBSD Foundation --- sbin/fsck_ffs/fsck.h | 6 +++--- sbin/fsck_ffs/gjournal.c | 15 ++++----------- sbin/fsck_ffs/globs.c | 24 ++++++++++++------------ sbin/fsck_ffs/main.c | 8 +++++--- sbin/fsck_ffs/pass1.c | 2 +- sbin/fsck_ffs/pass5.c | 34 ++++++++++++++++++++++------------ sbin/fsck_ffs/suj.c | 27 +++++++++++++++------------ 7 files changed, 62 insertions(+), 54 deletions(-) diff --git a/sbin/fsck_ffs/fsck.h b/sbin/fsck_ffs/fsck.h index 3b80169c1e3c..e48f3e0aa692 100644 --- a/sbin/fsck_ffs/fsck.h +++ b/sbin/fsck_ffs/fsck.h @@ -112,7 +112,7 @@ struct inostat { #define FSTATE 0x2 /* inode is file */ #define FZLINK 0x3 /* inode is file with a link count of zero */ #define DSTATE 0x4 /* inode is directory */ -#define DZLINK 0x5 /* inode is directory with a zero link count */ +#define DZLINK 0x5 /* inode is directory with a zero link count */ #define DFOUND 0x6 /* directory found during descent */ /* 0x7 UNUSED - see S_IS_DVALID() definition */ #define DCLEAR 0x8 /* directory is to be cleared */ @@ -297,8 +297,8 @@ struct dups { struct dups *next; ufs2_daddr_t dup; }; -extern struct dups *duplist; /* head of dup list */ -extern struct dups *muldup; /* end of unique duplicate dup block numbers */ +extern struct dups *duplist; /* head of dup list */ +extern struct dups *muldup; /* end of unique duplicate dup block numbers */ /* * Inode cache data structures. diff --git a/sbin/fsck_ffs/gjournal.c b/sbin/fsck_ffs/gjournal.c index f3bdd5a66907..03bf7f08b662 100644 --- a/sbin/fsck_ffs/gjournal.c +++ b/sbin/fsck_ffs/gjournal.c @@ -77,7 +77,6 @@ gjournal_check(const char *filesys) fs = &sblock; /* Are there any unreferenced inodes in this file system? */ if (fs->fs_unrefs == 0) { - //printf("No unreferenced inodes.\n"); sbdirty(); ckfini(1); return; @@ -105,7 +104,6 @@ gjournal_check(const char *filesys) /* Are there any unreferenced inodes in this cylinder group? */ if (cgp->cg_unrefs == 0) continue; - //printf("Analizing cylinder group %d (count=%d)\n", cg, cgp->cg_unrefs); /* * Now go through the list of all inodes in this cylinder group * to find unreferenced ones. @@ -150,20 +148,15 @@ gjournal_check(const char *filesys) inodirty(&ip); irelse(&ip); cgdirty(cgbp); - if (cgp->cg_unrefs == 0) { - //printf("No more unreferenced inodes in cg=%d.\n", cg); + if (cgp->cg_unrefs == 0) break; - } } /* - * If there are no more unreferenced inodes, there is no need to - * check other cylinder groups. + * If there are no more unreferenced inodes, there is no + * need to check other cylinder groups. */ - if (fs->fs_unrefs == 0) { - //printf("No more unreferenced inodes (cg=%d/%d).\n", cg, - // fs->fs_ncg); + if (fs->fs_unrefs == 0) break; - } } /* Write back updated statistics and super-block. */ sbdirty(); diff --git a/sbin/fsck_ffs/globs.c b/sbin/fsck_ffs/globs.c index 7aef7364eeba..22b15186ecaa 100644 --- a/sbin/fsck_ffs/globs.c +++ b/sbin/fsck_ffs/globs.c @@ -60,18 +60,18 @@ ino_t cursnapshot; long dirhash, inplast; unsigned long numdirs, listmax; long countdirs; /* number of directories we actually found */ -int adjrefcnt[MIBSIZE]; /* MIB command to adjust inode reference cnt */ -int adjblkcnt[MIBSIZE]; /* MIB command to adjust inode block count */ -int setsize[MIBSIZE]; /* MIB command to set inode size */ -int adjndir[MIBSIZE]; /* MIB command to adjust number of directories */ -int adjnbfree[MIBSIZE]; /* MIB command to adjust number of free blocks */ -int adjnifree[MIBSIZE]; /* MIB command to adjust number of free inodes */ -int adjnffree[MIBSIZE]; /* MIB command to adjust number of free frags */ -int adjnumclusters[MIBSIZE]; /* MIB command to adjust number of free clusters */ +int adjrefcnt[MIBSIZE]; /* MIB cmd to adjust inode reference cnt */ +int adjblkcnt[MIBSIZE]; /* MIB cmd to adjust inode block count */ +int setsize[MIBSIZE]; /* MIB cmd to set inode size */ +int adjndir[MIBSIZE]; /* MIB cmd to adjust number of directories */ +int adjnbfree[MIBSIZE]; /* MIB cmd to adjust number of free blocks */ +int adjnifree[MIBSIZE]; /* MIB cmd to adjust number of free inodes */ +int adjnffree[MIBSIZE]; /* MIB cmd to adjust number of free frags */ +int adjnumclusters[MIBSIZE]; /* MIB cmd to adjust number of free clusters */ int adjdepth[MIBSIZE]; /* MIB cmd to adjust directory depth count */ -int freefiles[MIBSIZE]; /* MIB command to free a set of files */ -int freedirs[MIBSIZE]; /* MIB command to free a set of directories */ -int freeblks[MIBSIZE]; /* MIB command to free a set of data blocks */ +int freefiles[MIBSIZE]; /* MIB cmd to free a set of files */ +int freedirs[MIBSIZE]; /* MIB cmd to free a set of directories */ +int freeblks[MIBSIZE]; /* MIB cmd to free a set of data blocks */ struct fsck_cmd cmd; /* sysctl file system update commands */ char snapname[BUFSIZ]; /* when doing snapshots, the name of the file */ char *cdevname; /* name of device being checked */ @@ -91,7 +91,7 @@ char ckclean; /* only do work if not cleanly unmounted */ int cvtlevel; /* convert to newer file system format */ int ckhashadd; /* check hashes to be added */ int bkgrdcheck; /* determine if background check is possible */ -int bkgrdsumadj; /* whether the kernel have ability to adjust superblock summary */ +int bkgrdsumadj; /* kernel able to adjust superblock summary */ char usedsoftdep; /* just fix soft dependency inconsistencies */ char preen; /* just fix normal inconsistencies */ char rerun; /* rerun fsck. Only used in non-preen mode */ diff --git a/sbin/fsck_ffs/main.c b/sbin/fsck_ffs/main.c index 60a542785541..56883d682ce8 100644 --- a/sbin/fsck_ffs/main.c +++ b/sbin/fsck_ffs/main.c @@ -351,16 +351,18 @@ checkfilesys(char *filesys) * Determine if we can and should do journal recovery. */ if ((sblock.fs_flags & FS_SUJ) == FS_SUJ) { - if ((sblock.fs_flags & FS_NEEDSFSCK) != FS_NEEDSFSCK && skipclean) { + if ((sblock.fs_flags & FS_NEEDSFSCK) != FS_NEEDSFSCK && + skipclean) { sujrecovery = 1; if (suj_check(filesys) == 0) { - printf("\n***** FILE SYSTEM MARKED CLEAN *****\n"); + pwarn("\n**** FILE SYSTEM MARKED CLEAN ****\n"); if (chkdoreload(mntp, pwarn) == 0) exit(0); exit(4); } sujrecovery = 0; - printf("** Skipping journal, falling through to full fsck\n\n"); + pwarn("Skipping journal, " + "falling through to full fsck\n"); } if (fswritefd != -1) { /* diff --git a/sbin/fsck_ffs/pass1.c b/sbin/fsck_ffs/pass1.c index d328234220ad..5b27cf8cbfbe 100644 --- a/sbin/fsck_ffs/pass1.c +++ b/sbin/fsck_ffs/pass1.c @@ -104,7 +104,7 @@ pass1(void) if (!reply("REBUILD CYLINDER GROUP")) { cgheader_corrupt = 1; if (!nflag) { - printf("YOU WILL NEED TO RERUN FSCK.\n"); + pwarn("YOU WILL NEED TO RERUN FSCK.\n"); rerun = 1; } } else { diff --git a/sbin/fsck_ffs/pass5.c b/sbin/fsck_ffs/pass5.c index 58143a0e8211..d973183eb36a 100644 --- a/sbin/fsck_ffs/pass5.c +++ b/sbin/fsck_ffs/pass5.c @@ -411,43 +411,53 @@ pass5(void) printf("adjndir by %+" PRIi64 "\n", cmd.value); if (bkgrdsumadj == 0 || sysctl(adjndir, MIBSIZE, 0, 0, &cmd, sizeof cmd) == -1) - rwerror("ADJUST NUMBER OF DIRECTORIES", cmd.value); + rwerror("ADJUST NUMBER OF DIRECTORIES", + cmd.value); } cmd.value = cstotal.cs_nbfree - fs->fs_cstotal.cs_nbfree; if (cmd.value != 0) { if (debug) - printf("adjnbfree by %+" PRIi64 "\n", cmd.value); + printf("adjnbfree by %+" PRIi64 "\n", + cmd.value); if (bkgrdsumadj == 0 || sysctl(adjnbfree, MIBSIZE, 0, 0, &cmd, sizeof cmd) == -1) - rwerror("ADJUST NUMBER OF FREE BLOCKS", cmd.value); + rwerror("ADJUST NUMBER OF FREE BLOCKS", + cmd.value); } cmd.value = cstotal.cs_nifree - fs->fs_cstotal.cs_nifree; if (cmd.value != 0) { if (debug) - printf("adjnifree by %+" PRIi64 "\n", cmd.value); + printf("adjnifree by %+" PRIi64 "\n", + cmd.value); if (bkgrdsumadj == 0 || sysctl(adjnifree, MIBSIZE, 0, 0, &cmd, sizeof cmd) == -1) - rwerror("ADJUST NUMBER OF FREE INODES", cmd.value); + rwerror("ADJUST NUMBER OF FREE INODES", + cmd.value); } cmd.value = cstotal.cs_nffree - fs->fs_cstotal.cs_nffree; if (cmd.value != 0) { if (debug) - printf("adjnffree by %+" PRIi64 "\n", cmd.value); + printf("adjnffree by %+" PRIi64 "\n", + cmd.value); if (bkgrdsumadj == 0 || sysctl(adjnffree, MIBSIZE, 0, 0, &cmd, sizeof cmd) == -1) - rwerror("ADJUST NUMBER OF FREE FRAGS", cmd.value); + rwerror("ADJUST NUMBER OF FREE FRAGS", + cmd.value); } - cmd.value = cstotal.cs_numclusters - fs->fs_cstotal.cs_numclusters; + cmd.value = cstotal.cs_numclusters - + fs->fs_cstotal.cs_numclusters; if (cmd.value != 0) { if (debug) - printf("adjnumclusters by %+" PRIi64 "\n", cmd.value); - if (bkgrdsumadj == 0 || sysctl(adjnumclusters, MIBSIZE, 0, 0, - &cmd, sizeof cmd) == -1) - rwerror("ADJUST NUMBER OF FREE CLUSTERS", cmd.value); + printf("adjnumclusters by %+" PRIi64 "\n", + cmd.value); + if (bkgrdsumadj == 0 || sysctl(adjnumclusters, MIBSIZE, + 0, 0, &cmd, sizeof cmd) == -1) + rwerror("ADJUST NUMBER OF FREE CLUSTERS", + cmd.value); } } } diff --git a/sbin/fsck_ffs/suj.c b/sbin/fsck_ffs/suj.c index 92f786fda38e..eb0d0d682aef 100644 --- a/sbin/fsck_ffs/suj.c +++ b/sbin/fsck_ffs/suj.c @@ -502,7 +502,8 @@ blk_free(ino_t ino, ufs2_daddr_t bno, int mask, int frags) * deallocate the fragment */ for (i = 0; i < frags; i++) - if ((mask & (1 << i)) == 0 && isclr(blksfree, cgbno +i)) { + if ((mask & (1 << i)) == 0 && + isclr(blksfree, cgbno +i)) { freefrags++; setbit(blksfree, cgbno + i); } @@ -1304,8 +1305,8 @@ ino_trunc(ino_t ino, off_t size) return; } if (debug) - printf("Truncating ino %ju, mode %o to size %jd from size %jd\n", - (uintmax_t)ino, mode, size, cursize); + printf("Truncating ino %ju, mode %o to size %jd from " + "size %jd\n", (uintmax_t)ino, mode, size, cursize); /* Skip datablocks for short links and devices. */ if (mode == 0 || mode == IFBLK || mode == IFCHR || @@ -1511,8 +1512,8 @@ blk_check(struct suj_blk *sblk) sino->si_blkadj = 1; } if (debug) - printf("op %d blk %jd ino %ju lbn %jd frags %d isat %d (%d)\n", - brec->jb_op, blk, (uintmax_t)brec->jb_ino, + printf("op %d blk %jd ino %ju lbn %jd frags %d isat %d " + "(%d)\n", brec->jb_op, blk, (uintmax_t)brec->jb_ino, brec->jb_lbn, brec->jb_frags, isat, frags); /* * If we found the block at this address we still have to @@ -2335,8 +2336,8 @@ restart: recsize <= fs->fs_bsize) goto restart; if (debug) - printf("Found invalid segsize %d > %d\n", - recsize, size); + printf("Found invalid segsize " + "%d > %d\n", recsize, size); recsize = real_dev_bsize; jblocks_advance(suj_jblocks, recsize); continue; @@ -2479,7 +2480,8 @@ suj_check(const char *filesys) cg_apply(cg_adj_blk); cg_apply(cg_check_ino); } - if (preen == 0 && (jrecs > 0 || jbytes > 0) && reply("WRITE CHANGES") == 0) + if (preen == 0 && (jrecs > 0 || jbytes > 0) && + reply("WRITE CHANGES") == 0) return (0); /* * Check block counts of snapshot inodes and @@ -2507,10 +2509,11 @@ suj_check(const char *filesys) sbdirty(); ckfini(1); if (jrecs > 0 || jbytes > 0) { - printf("** %jd journal records in %jd bytes for %.2f%% utilization\n", - jrecs, jbytes, ((float)jrecs / (float)(jbytes / JREC_SIZE)) * 100); - printf("** Freed %jd inodes (%jd dirs) %jd blocks, and %jd frags.\n", - freeinos, freedir, freeblocks, freefrags); + printf("** %jd journal records in %jd bytes for %.2f%% " + "utilization\n", jrecs, jbytes, + ((float)jrecs / (float)(jbytes / JREC_SIZE)) * 100); + printf("** Freed %jd inodes (%jd dirs) %jd blocks, and %jd " + "frags.\n", freeinos, freedir, freeblocks, freefrags); } return (0); From nobody Tue Jul 18 09:21:38 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R4tkB431nz4kPWv; Tue, 18 Jul 2023 09:21: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 4R4tkB3W9kz3MXp; Tue, 18 Jul 2023 09:21:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689672098; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=w3WY8bSwFc4VwI7QML9KTFysgTWDN2WjJxwynwYi4xc=; b=hOxXRl6m9btUH+Q2sbfAG87WBF1b53k7aspySIbGhfvcwR7rJHBJv7z7MZdkgG28+3ZJIA iAr8qQrnyoEG1Z5DhJz1Y4AvtXsjL0zC16D3VU2xMMH5xdeEYgJ0L+ba8HC9ZI20vc7kMM 2oq+Qu+8/KQwZ2yIVcSLyD/JAKRGldJ0vR4LLS2y8wfVtbA89grz0SqqMVCacuqzru3VgK uSucAT2P6DZysnTZSiKGlCcGTlAH/6QEjZkyCCbTRKvhX9DnOg8TAHdbS0Ah69g7NkXaCL 9P/BmjTPWX4j3RyVsPmmMtNJSWomNuW7UNz2vkW1oA860a08UJJxSaMMbArWkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689672098; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=w3WY8bSwFc4VwI7QML9KTFysgTWDN2WjJxwynwYi4xc=; b=w4LoU0QMWuRdXHyZHspC0FLmIdNs6NegOTDWS6oPQoasw+L7/hn5e4jO7bEqNTKHLWe5VY xR1GjtNxTRAQKTrG8+fGgPx8QHEdp307X4gP93kDdmTLFJ9CNon6ETjPZEJ1Oo5L8md1vB y+hCm5lan576kpG7GCFcXV8S5OerAg8oAMY+jFr9MIGMrzq0gj8tVjgR1OH9gCvMrg8niW Y+AO8igdz+lHWkN9nCprBZ0PAFVjypl95495g9whjMcvcit2ViJ+NWgZ0/Z/pzytsy1jOV WW2634G/HZQnAUQYBAnlwu9reCC+h33skzmDJSK4MebRFJUwuEQNnTTBNFEywg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689672098; a=rsa-sha256; cv=none; b=wt2eROGLzT5HzfOPWsga77Hc+nrbkHMEsn3FYKiUSyVhM7yFOAZs5CmedP4oFaghFxTp9P Nx5tcYbYm0S27KGuXVT49i7Ma1m1oJOZ/VTtFycAI0PCYrCFw4HgFspxb7hX9rxKUjsW5a zJpzABkBi5al5Yx0gFGtFjh/1f9SoLZAuyO1bEij2AZXKKmQ4Pe+QWFCEl7JOfwydR6YG1 kL3cn+br4VtJozCRIfP1TXhfV9YZ1aUnDMR43qj/aY9RHw+QsP2tmFzflIXJLsjjvqdBpd k3vqv1vr6YREA98KDgw4ViJR4uJcmCYalnzy3tM/wHyTRXshFh3951Bt/Tq9Bg== 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 4R4tkB2YzHz10Zd; Tue, 18 Jul 2023 09:21: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 36I9LcQk030474; Tue, 18 Jul 2023 09:21:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36I9LcWP030473; Tue, 18 Jul 2023 09:21:38 GMT (envelope-from git) Date: Tue, 18 Jul 2023 09:21:38 GMT Message-Id: <202307180921.36I9LcWP030473@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Yuri Pankov Subject: git: b36f469a15ec - main - zfs: set autotrim default to 'off' List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: yuripv X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b36f469a15ecf508a2fdc2b58a76f0f2b4a0b88d Auto-Submitted: auto-generated The branch main has been updated by yuripv: URL: https://cgit.FreeBSD.org/src/commit/?id=b36f469a15ecf508a2fdc2b58a76f0f2b4a0b88d commit b36f469a15ecf508a2fdc2b58a76f0f2b4a0b88d Author: Yuri Pankov AuthorDate: 2023-07-17 09:12:53 +0000 Commit: Yuri Pankov CommitDate: 2023-07-18 09:20:11 +0000 zfs: set autotrim default to 'off' As it turns out having autotrim default to 'on' on FreeBSD never really worked due to mess with defines where userland and kernel module were getting different default values (userland was defaulting to 'off', module was thinking it's 'on'). PR: 264234 Reviewed by: mav (zfs) Differential Revision: https://reviews.freebsd.org/D41056 --- sys/conf/kern.pre.mk | 3 +-- sys/contrib/openzfs/include/sys/spa.h | 6 ------ sys/contrib/openzfs/module/zcommon/zpool_prop.c | 2 +- sys/modules/zfs/Makefile | 2 +- 4 files changed, 3 insertions(+), 10 deletions(-) diff --git a/sys/conf/kern.pre.mk b/sys/conf/kern.pre.mk index e401a652bf97..8314f4489ca8 100644 --- a/sys/conf/kern.pre.mk +++ b/sys/conf/kern.pre.mk @@ -252,8 +252,7 @@ CDDL_C= ${CC} -c ${CDDL_CFLAGS} ${WERROR} ${.IMPSRC} # Special flags for managing the compat compiles for ZFS ZFS_CFLAGS+= -I$S/contrib/openzfs/module/icp/include \ ${CDDL_CFLAGS} -DBUILDING_ZFS -DHAVE_UIO_ZEROCOPY \ - -DWITH_NETDUMP -D__KERNEL__ -D_SYS_CONDVAR_H_ -DSMP \ - -DIN_FREEBSD_BASE + -DWITH_NETDUMP -D__KERNEL__ -D_SYS_CONDVAR_H_ -DSMP .if ${MACHINE_ARCH} == "amd64" ZFS_CFLAGS+= -D__x86_64 -DHAVE_SSE2 -DHAVE_SSSE3 -DHAVE_SSE4_1 -DHAVE_SSE4_2 \ diff --git a/sys/contrib/openzfs/include/sys/spa.h b/sys/contrib/openzfs/include/sys/spa.h index 1fa2044008dc..b90855687411 100644 --- a/sys/contrib/openzfs/include/sys/spa.h +++ b/sys/contrib/openzfs/include/sys/spa.h @@ -723,16 +723,10 @@ typedef enum spa_mode { * Send TRIM commands in-line during normal pool operation while deleting. * OFF: no * ON: yes - * NB: IN_FREEBSD_BASE is defined within the FreeBSD sources. */ typedef enum { SPA_AUTOTRIM_OFF = 0, /* default */ SPA_AUTOTRIM_ON, -#ifdef IN_FREEBSD_BASE - SPA_AUTOTRIM_DEFAULT = SPA_AUTOTRIM_ON, -#else - SPA_AUTOTRIM_DEFAULT = SPA_AUTOTRIM_OFF, -#endif } spa_autotrim_t; /* diff --git a/sys/contrib/openzfs/module/zcommon/zpool_prop.c b/sys/contrib/openzfs/module/zcommon/zpool_prop.c index 459ff62fc996..c4aca04a96bd 100644 --- a/sys/contrib/openzfs/module/zcommon/zpool_prop.c +++ b/sys/contrib/openzfs/module/zcommon/zpool_prop.c @@ -160,7 +160,7 @@ zpool_prop_init(void) "wait | continue | panic", "FAILMODE", failuremode_table, sfeatures); zprop_register_index(ZPOOL_PROP_AUTOTRIM, "autotrim", - SPA_AUTOTRIM_DEFAULT, PROP_DEFAULT, ZFS_TYPE_POOL, + SPA_AUTOTRIM_OFF, PROP_DEFAULT, ZFS_TYPE_POOL, "on | off", "AUTOTRIM", boolean_table, sfeatures); /* hidden properties */ diff --git a/sys/modules/zfs/Makefile b/sys/modules/zfs/Makefile index 2cfdf06f8f01..8964e461cdd2 100644 --- a/sys/modules/zfs/Makefile +++ b/sys/modules/zfs/Makefile @@ -38,7 +38,7 @@ CFLAGS+= -I${.CURDIR} CFLAGS+= -D__KERNEL__ -DFREEBSD_NAMECACHE -DBUILDING_ZFS \ -DHAVE_UIO_ZEROCOPY -DWITHOUT_NETDUMP -D__KERNEL -D_SYS_CONDVAR_H_ \ - -D_SYS_VMEM_H_ -DIN_FREEBSD_BASE + -D_SYS_VMEM_H_ .if ${MACHINE_ARCH} == "amd64" CFLAGS+= -D__x86_64 -DHAVE_SSE2 -DHAVE_SSSE3 -DHAVE_SSE4_1 -DHAVE_SSE4_2 \ From nobody Tue Jul 18 13:49:27 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R50gN3JkSz4mxTN; Tue, 18 Jul 2023 13:49:36 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.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 "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R50gN2mQ9z3ldK; Tue, 18 Jul 2023 13:49:36 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689688176; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3ejVLOQIXh+dPXa1Sy31TIDFFs8XY4bLwd02rgTzEjQ=; b=vGzUxPEiaq2/W0U4+ER++bovQZSsQPs4rf0T5N5D63eRwduo46hrfd6EK9AHgY0mNg+ofX kpPgKunnoFhPd2gQEOswwVz2JSPPE1JZYfKTwIVTKYyi9BqvDvSOjbnrE3Xo+82iiHbVwb tdmgcNb/CO/UXkNLxkZ2RamMZ4fsioC8F+ke5lUaYQ+hdod6+KYbts/esOl0EnGMmgcbJA A+MLdLVOMzR2NLDSClb/H0yIrLoYm4AvKI91j1KS6k2+P3UKOVLoVGFsofaFZa0STTg7Pk eK3vGum4sxuOdM4e3eRNBOu9IItXGvfadB8wFggNkUMoZeuk++D/E5KFCpZd6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689688176; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3ejVLOQIXh+dPXa1Sy31TIDFFs8XY4bLwd02rgTzEjQ=; b=x96J3LyXxBLhFihvMkEVZFcO7Y4ZZ6Cx6jT8c7KeKfb6bHIk0US4ggZzY/g9qDxaiApvb5 UpEoKHb40/iSIPga2jUAEdOVjZhG4egkO1ib9pneQETQLizytNYQWrSkY388xJhFz7pPfj 9CyCRthB58TNQ99xwbjOF0oVFH+ExszE73GUjnlvVvWTK9kmuxoJUsAAaKfnOCpSmXSEii +mMMk6owD1s2Js6tmr012i67WvCEa/Nq9qv58xU7dtUPgj5zZRJv6mMvzHZA9iU8UtPVXH b4zl/mNgVjAB0IEYnwBuAATt4p60EWzcoMeZzC+VVxsKBPK31b6RC1zbbdQULw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689688176; a=rsa-sha256; cv=none; b=BuCO4wS0LTwko/IfpShgon4gHDoaPCQdS7R/sjiaKGC2epi1mbpS3Lg7p2XZDnQIGMHccS MS1C6k4jZmSNzu3tADpLTgLxsv6hnGutDnwa0uYdccohoUz5uET7IBn1mdfWnPtoChnOOy hZnfK13g9xYXZK3tIf5UH5BP71xIHWhUlY3QoBpzL0OPPKj8n7sSjE2DRYA/bpMAdg4UOw BP1onBJ5xBJP93P62eyIl4dXnRBcSZpKFk7Ke1n9tME9ctxhDhXmc9cmV92vborE4N9Lbv meJVenznnx/WGxfS++UMyZA7bYltjS5vdjpL+7+ODjJicUXrqWFWQ03WJefWyA== Received: from ralga.knownspace (ip-163-182-7-56.dynamic.fuse.net [163.182.7.56]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jhibbits) by smtp.freebsd.org (Postfix) with ESMTPSA id 4R50gM6xJwzWTl; Tue, 18 Jul 2023 13:49:35 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Date: Tue, 18 Jul 2023 09:49:27 -0400 From: Justin Hibbits To: Jessica Clarke Cc: Ka Ho Ng , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Subject: Re: git: 034c0856018c - main - modules: fix freebsd32_modstat on big endian platforms Message-ID: <20230718094927.1474f972@ralga.knownspace> In-Reply-To: References: <202307070424.3674OBaa074389@gitrepo.freebsd.org> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.37; powerpc64le-unknown-linux-gnu) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Fri, 7 Jul 2023 18:59:41 +0100 Jessica Clarke wrote: > On 7 Jul 2023, at 05:24, Ka Ho Ng wrote: > >=20 > > The branch main has been updated by khng: > >=20 > > URL: > > https://cgit.FreeBSD.org/src/commit/?id=3D034c0856018ccf73c0f2d6140825f= 3edf43f47b2 > >=20 > > commit 034c0856018ccf73c0f2d6140825f3edf43f47b2 > > Author: Ka Ho Ng > > AuthorDate: 2023-07-07 04:21:01 +0000 > > Commit: Ka Ho Ng > > CommitDate: 2023-07-07 04:22:59 +0000 > >=20 > > modules: fix freebsd32_modstat on big endian platforms > >=20 > > The layout of modspecific_t on both little endian and big endian > > are as follows: > > |0|1|2|3|4|5|6|7| > > +-------+-------+ > > |uintval| | > > +-------+-------+ > > |ulongval | > > +-------+-------+ > >=20 > > For the following code snippet: > > CP(mod->data, data32, longval); > > CP(mod->data, data32, ulongval); > > It only takes care of little endian platforms that it truncates > > the highest 32bit automatically. However on big endian platforms it > > takes the highest 32bit instead. This eventually returns a garbage > > syscall number to the 32bit userland. =20 >=20 > This fixes the case where uintval is the active member, but breaks the > case where ulongval is the active member, since it=E2=80=99ll take bytes = 0, 1, > 2 and 3 which are the high bytes for BE, not the low bytes. This is an > intrinsic issue with BE; LE is very permissive when you access the > wrong union member for different-width integer types, but BE is not > and you have to access the right one. How does userspace know which > member to access, anyway? The kernel needs to repeat that and copy > the right member based on that information, otherwise it is > inherently impossible to have both cases work on BE. >=20 > > Since modspecific_t's usage currently is for the use of syscall > > modules, we only initialize modspecific32_t with uintval. =20 >=20 > Is this saying that uintval is always the active member, never > ulongval? If so, there need to be comments, both in freebsd32_modstat > to justify this and on the type to say =E2=80=9CDO NOT USE (u)longval=E2= =80=9D, > otherwise there is a significant risk someone will start using > (u)longval and we=E2=80=99ll be stuck. Perhaps (u)longval should even be > renamed to be ABI-compatibility padding (and aligning). >=20 > Jess A better solution is to make these fields fixed size, so we don't run into this problem again. Is this feasible, factoring in any other consumers? - Justin >=20 > > Now on both BE and LE > > 64-bit platforms it always pick up the first 4 bytes. > >=20 > > Sponsored by: Juniper Networks, Inc. > > Reviewed by: markj > > Differential Revision: https://reviews.freebsd.org/D40814 > > MFC after: 1 week > > --- > > sys/kern/kern_module.c | 5 ++--- > > 1 file changed, 2 insertions(+), 3 deletions(-) > >=20 > > diff --git a/sys/kern/kern_module.c b/sys/kern/kern_module.c > > index 40e47868481c..d4edc64a5ce4 100644 > > --- a/sys/kern/kern_module.c > > +++ b/sys/kern/kern_module.c > > @@ -520,10 +520,9 @@ freebsd32_modstat(struct thread *td, struct > > freebsd32_modstat_args *uap) id =3D mod->id; > > refs =3D mod->refs; > > name =3D mod->name; > > - CP(mod->data, data32, intval); > > + _Static_assert(sizeof(data32) =3D=3D sizeof(data32.uintval), > > + "bad modspecific32_t size"); > > CP(mod->data, data32, uintval); > > - CP(mod->data, data32, longval); > > - CP(mod->data, data32, ulongval); > > MOD_SUNLOCK; > > stat32 =3D uap->stat; > > =20 From nobody Tue Jul 18 16:27:12 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R549F1gxJz4dVYy; Tue, 18 Jul 2023 16:27: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 4R549F1FjPz3KpH; Tue, 18 Jul 2023 16:27:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689697633; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AWok5OqVYIvuenSXZcT+R9CkjIlXPpz08iNxyPto5Ns=; b=J/bzaxtwDQ4j5M2+vTjQrUr/NTL3D6XgllZdADIIjpfjtItd4HsdqztV4O8tzvKVE1PlO3 oiRX+a5qM5wvcmaVOwVRlP5wGQ33FHNLp147tKjOyDA5Z9ax2M/ZqnCnxXLhtk6l8Vm80p ev3ODO7WpBx62C+Ku5AQ+i55nMyUJ5S7pGeEwCBBae3iVeDEoCR9EVjojQuKkzSq+TAZcQ +mZI6Z5G+/wp7CJ3Mi4aaNP7q97bB/7gCmrnG6iQSjYL/NzUQA8f0raRr2DafhK9ttr7AQ EQplKTeaYHRedy3XRmsc89hv+onDSgbsKUcNx0IZGD7ntjrGWuOJI1NFqBVkxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689697633; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AWok5OqVYIvuenSXZcT+R9CkjIlXPpz08iNxyPto5Ns=; b=WlvS2vm6liq0xxxY1Eiulh3I6vCaYMx+kIyz528FFLFYCFF5pqXkJVBI2zYqE0gQaQd5k/ 5Gwndw8bTnZ8+q3hgezh/GeYiLyuM8xIrZYxoWQBwn47wLEW7TMoUVC6p1fhiJRB3wvv1S wglsaQzp22zPHtIimr/N6ufand/N3U76uS5OQX18XW+SLzuHmmuvYmfO12C7ex6slvc4Km VPnG2s5MkiH1nNxhhC534JaiY+PQB9l7VAw6WFPdhjHDhlilzdT6mi+sSBT5Uv0MVv950+ I2xyGkj/Ic88T7/n6sWqTbNl5zQGUjWEaOfsMmwVkkQV6r3/JUYNjQbK9714Vw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689697633; a=rsa-sha256; cv=none; b=K4eR5Nvx8x+HvTqxvNQe3BvONMUKQyNUBZzrCIAtOBhFcnE4ucGSYn/kaLTt8fhiBPU3XZ 5yioXPohAbEl4gMo/7KAL5TfVSJZOZU7z1ErOvrQRw7ll6NmzYGnbnN5rGHGJbZAGuxA4L PWe6uEz2DA6eXzAKb2fdW4LECMfvrnVW8qQ7ubF9kOWdL5HdUNUbbypFRHmzH0tFkareyF F9b621w285E4Ee6KWeGYuOZqZ99bM3bhgum4SAc6IxgNjvZOTIzP97YiLL9VIuvq0xTzGp 9oOqso7/ZXbLkhM/jFIOBM3WY3Cr5g+V0pHkIHOLW3zwFMGhNcsAZvurhhZbqQ== 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 4R549F0Bwsz1BdN; Tue, 18 Jul 2023 16:27: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 36IGRC1o031601; Tue, 18 Jul 2023 16:27:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36IGRCqF031600; Tue, 18 Jul 2023 16:27:12 GMT (envelope-from git) Date: Tue, 18 Jul 2023 16:27:12 GMT Message-Id: <202307181627.36IGRCqF031600@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: d5e2d0f140ce - main - openssh: document a locally-applied workaround List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: d5e2d0f140cef6d09c4ddeb594cee027642366a7 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=d5e2d0f140cef6d09c4ddeb594cee027642366a7 commit d5e2d0f140cef6d09c4ddeb594cee027642366a7 Author: Ed Maste AuthorDate: 2023-07-18 16:23:31 +0000 Commit: Ed Maste CommitDate: 2023-07-18 16:27:02 +0000 openssh: document a locally-applied workaround We have a local hacky workaround for an issue caused by a hacky upstream autoconf test. Reported upstream on the OpenSSH mailing list: https://lists.mindrot.org/pipermail/openssh-unix-dev/2022-May/040242.html PR: 209441 Sponsored by: The FreeBSD Foundation --- crypto/openssh/FREEBSD-upgrade | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/crypto/openssh/FREEBSD-upgrade b/crypto/openssh/FREEBSD-upgrade index caf9597b0d6b..905b65ec4e3d 100644 --- a/crypto/openssh/FREEBSD-upgrade +++ b/crypto/openssh/FREEBSD-upgrade @@ -187,6 +187,14 @@ recognize and ignore the configuration options to avoid breaking existing configurations. +12) PrintLastLog bugfix + + Upstream's autoconf sets DISABLE_LASTLOG if the system does not have + lastlog.ll_line, but uses it to disable the PrintLastLog configuration + option altogether. There is a hacky SKIP_DISABLE_LASTLOG_DEFINE=yes to + skip setting DISABLE_LASTLOG which we've applied for FreeBSD, but the + autoconf machinery really ought to be reworked. Reported upstream at + https://lists.mindrot.org/pipermail/openssh-unix-dev/2022-May/040242.html This port was brought to you by (in no particular order) DARPA, NAI From nobody Tue Jul 18 17:04:03 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R54zm0nXzz4nKJN; Tue, 18 Jul 2023 17:04: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 4R54zm0JDfz3nKk; Tue, 18 Jul 2023 17:04:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689699844; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mQGbv65GJmk8xaxfPdc+OpJNkBGgK6TNxJAb5GJUVeA=; b=cTmie3NpbKFAyLYe9y3OkIUaesEep9HIY+CCraq212yRkr8dQ3eFr0XIP2cAYc3wg9FVDO bw4ZAC0SIq+jtN8qktUnamplYFQCoOn0Tz68K7bODQWi67WhURZP7vs0rYn1sFdLv2tSry 7uS1J97qS0FqBUEap3+OORArRaJXnnhjmG4ycT2IpNm82QAnTPDCKvwbF0y164vqfosDCw h6WPd/KlzYpsOAfIOGz+/LU1lmo7DVYZWhwm4JGBGo1kt74FhuLAp/nIaDId4fb23n2n7V tE6K6EaAi02Zuav0PkJW+eDaYD/qK3cO4pvDc7N8g1ZGYrzZgh0zFzLVor9jsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689699844; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mQGbv65GJmk8xaxfPdc+OpJNkBGgK6TNxJAb5GJUVeA=; b=vubP5exbx/v6bQDZjvkNlY5efXPUGiFuTAFTd02ejl20mQaVdlLg4wWMmCnHlEuEX05M+n 8CnbiDDrRuhy5LwvVXfKRruE/296V8RGAWE+OTQLczJp/aDdBf5H6TQe0GNbrOzfA5JInq H7EVxykr6wq7iJg2J06N+Gzwt/Q0vHWZ3TCDCSfr2tXRdu58vGhCiBbSLadBQTZfRTrcnZ Gjh3/aF3jhGCPqosuXf6zAaQTx6eXClSco+tP1xvyo/uCuJT1JcrrvQMmhy3e1cpLnIZyn /mJFFmgfhAtQAEwdmwfJSu5AQ9k9QUMxzI5lr+r6dgMYaIKkhknUE+D1C5UFFw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689699844; a=rsa-sha256; cv=none; b=S+qoZQK6fB/zv15q6O0LSSSk6kM6C6BGgKhKy6tbMtJ+OjSMWvUHOKL5l1VR9B3RyDHAki uU2N+dT+sMDFpRg7320Eb0Abm7pYHDftKDLdL0W3hZLDqvHlL4dKfySrFhq8evLECWi035 stEkFu+MD6qWJCu51qb7S6rzVcDxwUuCVBhfLQvoqtBYM51EEQGJqN49//w/MqYasHWiJf U5ng0Kn95THligvF7DoCHAj8vO/dJVoWz25v2VijjwpS1od9HW7y1WagXnnXjawQUJ2xJz nTjtF0lumuxXtgb7vM+9a4CuwkNNhYTY0i/Wpw768R9pTYftwl57gt2TLFTxEg== 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 4R54zl6BfVz1Ctg; Tue, 18 Jul 2023 17:04: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 36IH43Rk097909; Tue, 18 Jul 2023 17:04:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36IH43FZ097908; Tue, 18 Jul 2023 17:04:03 GMT (envelope-from git) Date: Tue, 18 Jul 2023 17:04:03 GMT Message-Id: <202307181704.36IH43FZ097908@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 3bfbb521fef5 - main - ls: Improve POSIX compatibility for -g and -n. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 3bfbb521fef5764ecabc2bf3fdc76f47258171f8 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=3bfbb521fef5764ecabc2bf3fdc76f47258171f8 commit 3bfbb521fef5764ecabc2bf3fdc76f47258171f8 Author: Minsoo Choo AuthorDate: 2023-07-18 16:49:59 +0000 Commit: John Baldwin CommitDate: 2023-07-18 17:03:09 +0000 ls: Improve POSIX compatibility for -g and -n. - Change -g (ignored for BSD 4.3 compatibility since BSD 4.4) to use POSIX semantics of implying -l but omitting the owner's name. - Change -n to imply -l. The -o option remains unchanged (POSIX defines -o as a complement to -g that implies -l but omits group names whereas BSD defines -o to add file flags to -l). This compromise is the same used by both NetBSD and OpenBSD. PR: 70813 Reviewed by: jhb, Pau Amma Co-authored-by: John Baldwin Differential Revision: https://reviews.freebsd.org/D34747 --- bin/ls/ls.1 | 11 +++-------- bin/ls/ls.c | 10 +++++++++- bin/ls/ls.h | 1 + bin/ls/print.c | 8 +++++--- bin/ls/tests/ls_tests.sh | 19 ++++++++++--------- 5 files changed, 28 insertions(+), 21 deletions(-) diff --git a/bin/ls/ls.1 b/bin/ls/ls.1 index fb1b4f6ba606..b3563eb38921 100644 --- a/bin/ls/ls.1 +++ b/bin/ls/ls.1 @@ -32,7 +32,7 @@ .\" @(#)ls.1 8.7 (Berkeley) 7/29/94 .\" $FreeBSD$ .\" -.Dd October 31, 2022 +.Dd July 18, 2023 .Dt LS 1 .Os .Sh NAME @@ -301,14 +301,9 @@ and .Fl s options. .It Fl g -This option has no effect. -It is only available for compatibility with -.Bx 4.3 , -where it was used to display the group name in the long +Display the long .Pq Fl l -format output. -This option is incompatible with -.St -p1003.1-2008 . +format output without the file owner's name or number. .It Fl h When used with the .Fl l diff --git a/bin/ls/ls.c b/bin/ls/ls.c index bd7bd283c317..b027e34afc2c 100644 --- a/bin/ls/ls.c +++ b/bin/ls/ls.c @@ -144,6 +144,7 @@ static int f_singlecol; /* use single column output */ static int f_sizesort; int f_slash; /* similar to f_type, but only for dirs */ int f_sortacross; /* sort across rows, not down columns */ + int f_sowner; /* disable showing owner's name */ int f_statustime; /* use time of last mode change */ static int f_stream; /* stream the output, separate with commas */ int f_thousands; /* show file sizes with thousands separators */ @@ -402,7 +403,11 @@ main(int argc, char *argv[]) f_listdir = 1; f_recursive = 0; break; - case 'g': /* Compatibility with 4.3BSD. */ + case 'g': + f_longform = 1; + f_singlecol = 0; + f_stream = 0; + f_sowner = 1; break; case 'h': f_humanval = 1; @@ -421,6 +426,9 @@ main(int argc, char *argv[]) break; case 'n': f_numericonly = 1; + f_longform = 1; + f_singlecol = 0; + f_stream = 0; break; case 'o': f_flags = 1; diff --git a/bin/ls/ls.h b/bin/ls/ls.h index 410246ec9903..1f19858720bf 100644 --- a/bin/ls/ls.h +++ b/bin/ls/ls.h @@ -56,6 +56,7 @@ extern int f_sectime; /* print the real time for all files */ extern int f_size; /* list size in short listing */ extern int f_slash; /* append a '/' if the file is a directory */ extern int f_sortacross; /* sort across rows, not down columns */ +extern int f_sowner; /* disable showing the owner's name */ extern int f_statustime; /* use time of last mode change */ extern int f_thousands; /* show file sizes with thousands separators */ extern char *f_timeformat; /* user-specified time format */ diff --git a/bin/ls/print.c b/bin/ls/print.c index 5e8a54ca0620..b01b2e1e61db 100644 --- a/bin/ls/print.c +++ b/bin/ls/print.c @@ -234,9 +234,11 @@ printlong(const DISPLAY *dp) strmode(sp->st_mode, buf); aclmode(buf, p); np = p->fts_pointer; - (void)printf("%s %*ju %-*s %-*s ", buf, dp->s_nlink, - (uintmax_t)sp->st_nlink, dp->s_user, np->user, dp->s_group, - np->group); + (void)printf("%s %*ju ", buf, dp->s_nlink, + (uintmax_t)sp->st_nlink); + if (!f_sowner) + (void)printf("%-*s ", dp->s_user, np->user); + (void)printf("%-*s ", dp->s_group, np->group); if (f_flags) (void)printf("%-*s ", dp->s_flags, np->flags); if (f_label) diff --git a/bin/ls/tests/ls_tests.sh b/bin/ls/tests/ls_tests.sh index 117156b5cb0e..a85e43ecb938 100755 --- a/bin/ls/tests/ls_tests.sh +++ b/bin/ls/tests/ls_tests.sh @@ -525,18 +525,19 @@ f_flag_body() atf_test_case g_flag g_flag_head() { - atf_set "descr" "Verify that -g does nothing (compatibility flag)" + atf_set "descr" "Verify that -g implies -l but omits the owner name field" } g_flag_body() { - create_test_inputs2 - for file in $files; do - atf_check -e empty -o match:"$(ls -a $file)" -s exit:0 \ - ls -ag $file - atf_check -e empty -o match:"$(ls -la $file)" -s exit:0 \ - ls -alg $file - done + atf_check -e empty -o empty -s exit:0 touch a.file + + mtime_in_secs=$(stat -f "%m" -t "%s" a.file) + mtime=$(date -j -f "%s" $mtime_in_secs +"%b[[:space:]]+%e[[:space:]]+%H:%M") + + expected_output=$(stat -f "%Sp[[:space:]]+%l[[:space:]]+%Sg[[:space:]]+%z[[:space:]]+$mtime[[:space:]]+a\\.file" a.file) + + atf_check -e empty -o match:"$expected_output" -s exit:0 ls -g a.file } atf_test_case h_flag @@ -689,7 +690,7 @@ n_flag_body() atf_check -e empty \ -o match:'\-rw\-r\-\-r\-\-[[:space:]]+1[[:space:]]+'"$nobody_uid[[:space:]]+$daemon_gid"'[[:space:]]+.+a\.file' \ - ls -ln a.file + ls -n a.file } From nobody Tue Jul 18 17:08:34 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R555042Ynz4nMfx; Tue, 18 Jul 2023 17:08:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.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 "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R55503cGSz3prl; Tue, 18 Jul 2023 17:08:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689700116; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=y1kDniyYLiFCzmswFdtQBZW+ucvr88RE33WpSNSkw8g=; b=BROFClAQmzpfX0MfkDOEAIAIUqJKaKJGDL/LvI3R9TqJ/y33oc93hGnTRGtUxkwmOq23rM bsargrLZZToisYsxHi7pOS5vUfF29n46KxFTvsMxjqFBtxEy5F3PVO0lIhsQjkemtOMld1 H9dZOEMfazT2ErdLomcQcpPvBEzUHck0ufOmX18VceUUEt5zlqGRir66zW6FrIAK/YsTbn wqr3q4wbLtAN13u+SWypnehMKm24gcCegfKU0pNFm3/KOe9/+D9SlVS29wOrFFMnsCSbzt LYDcxi9KCA7uvLeikp9YhD7yAfgKqv5aYRuX8ySeq7LD/Fn5cEN7MXxhK9or4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689700116; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=y1kDniyYLiFCzmswFdtQBZW+ucvr88RE33WpSNSkw8g=; b=G4WSZq122pj7FVVLoVSYPIKTb732dGhlZ/jF6LG0gV57G139TM1VXnlEplVe/61ouGfnK5 sueLrXegU+s1f1JUNkf52a5K3goCIBdGrxx5Z3vDViCZYerbvS9SA5+eiloc3/0iKq2g4r D2vm9R4ocqJnhWQZ9mfauu2Xx5DAccjJwpeoBrnTFG8ndjGOVfFpP9mgCsK8R+3B0a4iwr X6R5X73W/TwIba5Ou7CkyrY729FqGP6zwxGzFHvndgC2zI+ZiwvSHz0EF9c4c1TMo/dUSG f4IphYoRyXwLN74TOMq48f5W+w78Dh8Vu573sFshRPVOhKBrm7WvAKGUj9nKPA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689700116; a=rsa-sha256; cv=none; b=lii3V+oL+AfIOkDRP9NzwegETdsX60jouUUkdMfE8NdYQf0RF/wWkNrRmXA7wWgXo46OIj XuCtxdPq5MFzLVFuGNP8/XhAjD1qHi9bMrsrIfMkch2kKu18acJf4VLUiIKLPT1omlSwW/ 0Pymbv+b4iPzYPSaxoxyoQDcV6+h1xIwRy8eW1QKGFEVQbScIqj/KhJW4RZNX1nh0iMT0x ay4HtBf2zyad9Fd1o3Btce1zTCLR8YsA8SLET8i5BFt/Yrc+IABMTMBkHCuSnFA44QKx9D fV/166vyGYIHU3vBy0QorMt7pN9drbkbPxeyohqtzcHAKk4ejQ9LMAjgNp49xA== Received: from [IPV6:2601:648:8680:16b0:3089:8f56:4b42:5b7b] (unknown [IPv6:2601:648:8680:16b0:3089:8f56:4b42:5b7b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4R554z75g3zbCK; Tue, 18 Jul 2023 17:08:35 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <5c74c6a9-32bc-f965-f407-6cd68b550b07@FreeBSD.org> Date: Tue, 18 Jul 2023 10:08:34 -0700 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: git: 3bfbb521fef5 - main - ls: Improve POSIX compatibility for -g and -n. Content-Language: en-US From: John Baldwin To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202307181704.36IH43FZ097908@gitrepo.freebsd.org> In-Reply-To: <202307181704.36IH43FZ097908@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 7/18/23 10:04 AM, John Baldwin wrote: > The branch main has been updated by jhb: > > URL: https://cgit.FreeBSD.org/src/commit/?id=3bfbb521fef5764ecabc2bf3fdc76f47258171f8 > > commit 3bfbb521fef5764ecabc2bf3fdc76f47258171f8 > Author: Minsoo Choo > AuthorDate: 2023-07-18 16:49:59 +0000 > Commit: John Baldwin > CommitDate: 2023-07-18 17:03:09 +0000 > > ls: Improve POSIX compatibility for -g and -n. > > - Change -g (ignored for BSD 4.3 compatibility since BSD 4.4) > to use POSIX semantics of implying -l but omitting the owner's > name. > > - Change -n to imply -l. > > The -o option remains unchanged (POSIX defines -o as a complement to > -g that implies -l but omits group names whereas BSD defines -o to add > file flags to -l). This compromise is the same used by both NetBSD > and OpenBSD. > > PR: 70813 > Reviewed by: jhb, Pau Amma > Co-authored-by: John Baldwin > Differential Revision: https://reviews.freebsd.org/D34747 FWIW, macOS uses '-O' to display file flags instead of '-o' (which has POSIX semantics there). Currently there is no way to get the equivalent of POSIX -o output from ls, but breaking compatability for -o seems too large (as noted in discussion in the review) vs this compromise that matches NetBSD and OpenBSD. -- John Baldwin From nobody Tue Jul 18 17:39:27 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R55mc24cJz4ngqk; Tue, 18 Jul 2023 17:39: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 4R55mc1gdGz40W8; Tue, 18 Jul 2023 17:39:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689701968; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0f1GZdGCoS0ztcArfqM0qWitLzwrgF67IwBItHaOonE=; b=i0Qrj7fRcCrUpPtaFc5QNAJlrIIfSeLIMqM7r0RiURoP1F04ghWSfWRkujBmubBZuXkd+8 PjWGkmixRMZ3BItM1QdxBzFiIX42eMwn5oKO1zQAPFMbEPuM6koGjfKAhZ/aBmyIbQL6/B hrgDYTZIfdn7nttREnUu0UUQC+jhdJA/6DLKhBz3COq/UgDqeoRu2h7HkzEVvAPRk/o8Ml Fv5mte6KRFhCTILzmmYomOAPNHBHC1TM4Bj/0uIaeewC70a+1bvu8/bw7b+b9LOuzkKz+t 8T62q3DgGwpTQ4TxEYr8vz3DS58oJvesOYipEYYhWxgBIHN23dE5qZvB/GV0Cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689701968; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0f1GZdGCoS0ztcArfqM0qWitLzwrgF67IwBItHaOonE=; b=yDMu3KbMBWYuVbKP/czji+PESjOgHn6UTxEumB6zHT5UbFMZH0ZKxwKVmZGCxT1d0SGYxY Ya7q3ncU7pnSh5TX3MBvz057qHbznSVb82N1CBUbsyPR+hZubWXbGzKLP5qdHVErZBqss+ Tmfu8j36E3jsAzKd/WyCq5qFQ/c8tCQnPQk9s8H4zD/SqMP15KhgxaadXsmglHnnumD2Jp c0B34esD1bHMouyTdmGGyErmRXkLeafnBMPM7gIatOZLh34goRp83H4aRRDpE8qPElbKIu 0Ybklfq6CkS9kD136LT57HBWX1nuViz1rzfixiS+LZcGfrMESpniZOJ4pYlFxw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689701968; a=rsa-sha256; cv=none; b=X7XgE/6feTeNmmGW2xBIvIkegB80QBDeffGvklTXOAZd3yA1X/OWISgKF9+8SkKz7nmKXP SFkKcZo51bBJmqRjcA/4cEShjt5q+QjFwNBouo+azsaW8nndLjYEcnEH/9ImXTN9UhKjdJ IoPrUXNk8dbvj4BDbCHU11z08zPjDo0I0U3Fs9Xo5tJXj7qE52GYv4PiJQTizR8jA/Llv1 vuoLRbIOF8opa23K4qZG4Q8v0XkwaFYZnKalbSXfexT/g8N+TYVfOGHwaCNIsNF8ABytKU OikjZQGuq5aaj23FC2GLOuNdztf5pO6IgE4YZGVp1EVk95/XkDfA4BsmhwTuxQ== 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 4R55mc0bNCzFN9; Tue, 18 Jul 2023 17:39: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 36IHdRnG048242; Tue, 18 Jul 2023 17:39:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36IHdRfU048241; Tue, 18 Jul 2023 17:39:27 GMT (envelope-from git) Date: Tue, 18 Jul 2023 17:39:27 GMT Message-Id: <202307181739.36IHdRfU048241@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 9efad6f9e108 - main - add defaults for adduser.sh (OK? [yes] & additional user [no]) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 9efad6f9e1084e97dd6e2599562e7db0bd31a4ab Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=9efad6f9e1084e97dd6e2599562e7db0bd31a4ab commit 9efad6f9e1084e97dd6e2599562e7db0bd31a4ab Author: Sven Ruediger AuthorDate: 2023-07-18 17:37:48 +0000 Commit: John Baldwin CommitDate: 2023-07-18 17:37:48 +0000 add defaults for adduser.sh (OK? [yes] & additional user [no]) Event: Kitchener-Waterloo Hackathon 202305 Differential Revision: https://reviews.freebsd.org/D40157 --- usr.sbin/adduser/adduser.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/usr.sbin/adduser/adduser.sh b/usr.sbin/adduser/adduser.sh index fb4b51fc23e3..75db900c4524 100644 --- a/usr.sbin/adduser/adduser.sh +++ b/usr.sbin/adduser/adduser.sh @@ -657,6 +657,8 @@ input_interactive() { _usepass="yes" _logingroup_ok="no" _groups_ok="no" + _all_ok="yes" + _another_user="no" case $passwdtype in none) _emptypass="yes" @@ -817,8 +819,11 @@ input_interactive() { printf "%-10s : %s\n" "Shell" "$ushell" printf "%-10s : %s\n" "Locked" "$_disable" while : ; do - echo -n "OK? (yes/no): " + echo -n "OK? (yes/no) [$_all_ok]: " read _input + if [ -z "$_input" ]; then + _input=$_all_ok + fi case $_input in [Nn][Oo]|[Nn]) return 1 @@ -1030,11 +1035,14 @@ else input_interactive while : ; do if [ -z "$configflag" ]; then - echo -n "Add another user? (yes/no): " + echo -n "Add another user? (yes/no) [$_another_user]: " else - echo -n "Re-edit the default configuration? (yes/no): " + echo -n "Re-edit the default configuration? (yes/no) [$_another_user]: " fi read _input + if [ -z "$_input" ]; then + _input=$_another_user + fi case $_input in [Yy][Ee][Ss]|[Yy][Ee]|[Yy]) uidstart=`get_nextuid $uidstart` From nobody Tue Jul 18 21:44:54 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5CCp4KKWz4dTNs; Tue, 18 Jul 2023 21:44: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 4R5CCp3vtBz421V; Tue, 18 Jul 2023 21:44:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689716694; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nvfVXNjhy3rZ4UinJVL1qL8kauxVG1m/hVWSH7sQvLM=; b=B9TInihoGHrGOnjss1h5ToRz31fbWEeCL7RJ+KMv4UOsoGMLugPbw3Vvcc9/ePrmGHC0GX A2rGQ+oRePynALciAQlUZpjDf1xqnzUV9Im4h1o4c2thFpgGNSh27qLFosCSsLalJwFZ8i 25jWtzhpE9XBSiOL3b+sw/fAP9Zain4rAd9/rnhLj5IivmUtxF7i0mbxK40EJGc+NMEoeh 95kXDX66mdZcJvDBH8AJgEDBQkUFpBOQ1lh3CtAMPiTmrGU42ZRbEwdU9Zn0gyVUNbrVob hlsyddfTbWIlIMivfceGCptXm7prrpRY/BPw0TuNL9cCXvz+mor7mJ+DsU12cQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689716694; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nvfVXNjhy3rZ4UinJVL1qL8kauxVG1m/hVWSH7sQvLM=; b=JEGMll3+TVmA2bRtQoQVoKd8C94F89vwByMcmpAW+nkmygBoCSVdnfmiEjpWQg5i34MLhT ZKzE/DWNd6dPziPx0F7J8404KauhOPtdLbmIFfKu4Xl/fhLBMqXEJvLC57y1wLHbuUZDFK h6s5PUgEdAXSuw/x6goVGxiFa8RnYhzADCfmm8Hk7kCyXzDd9KdkaYmnsf7VUg5PLfIIFX 9muL71xrel+z6/VzwQDvSGChkdlrDMDCxvI9LaUU/mcumrq1JcHDzU1q9kIvGNoWegYjk/ XzLIZn5XKB+OnWrnITob3hIGGGAcycNeKPiglQkskNaSdm4ejDC6GYTQaCWaFg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689716694; a=rsa-sha256; cv=none; b=KbfGolJcsF+oZM6qBWY02C60Cq53zHziG1ljmdyUaguMLmcojF6vgqLXfkkdSgTKP43iNp NZoYnnp78ivKs25iaatOvTCXlHIT1Yo6rcmkCrCRreAlpu42jGoEO0L7fEztNOaWesGfgF DMndBnITprXWgV42+x8AtiEeUNFPwxh9jIToaENeg2fxu5WE79xfJlBvxjkgYcvFOR9XZE G0w0BB4vT65pm8Nmf3RRi4DjRe/1xiUr/hNvqp/D5pjSINIZTH4DQP1kAJ24n9rVlm9h62 zRAKCMSYO9X8G2PdsoQhUkuJ/oVBEMS7jqp8KdkIm3vWLCqSxYwTBoE6ZGQ1WQ== 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 4R5CCp2zv6zMKG; Tue, 18 Jul 2023 21:44: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 36ILisso061790; Tue, 18 Jul 2023 21:44:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36ILisGM061789; Tue, 18 Jul 2023 21:44:54 GMT (envelope-from git) Date: Tue, 18 Jul 2023 21:44:54 GMT Message-Id: <202307182144.36ILisGM061789@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Chagin Subject: git: fc1c787aa015 - main - linux(4): Properly allocate buffer for kern_getdirentries in readdir List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fc1c787aa0157090e765ebba484e6e290e99f177 Auto-Submitted: auto-generated The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=fc1c787aa0157090e765ebba484e6e290e99f177 commit fc1c787aa0157090e765ebba484e6e290e99f177 Author: Dmitry Chagin AuthorDate: 2023-07-18 21:44:15 +0000 Commit: Dmitry Chagin CommitDate: 2023-07-18 21:44:15 +0000 linux(4): Properly allocate buffer for kern_getdirentries in readdir Looks like prior to ino64 project the size of the struct linux_dirent was greater (or equal) to the size of the native struct dirent so the native dirent fit into the buffer. After ino64 project the size of the native struct dirent has increased. Spotted by gcc12. MFC after: 2 weeks --- sys/compat/linux/linux_file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/compat/linux/linux_file.c b/sys/compat/linux/linux_file.c index 4e8c3f435261..a5b8a4270dc0 100644 --- a/sys/compat/linux/linux_file.c +++ b/sys/compat/linux/linux_file.c @@ -560,7 +560,7 @@ linux_readdir(struct thread *td, struct linux_readdir_args *args) struct l_dirent *linux_dirent; int buflen, error; - buflen = LINUX_RECLEN(LINUX_NAME_MAX); + buflen = sizeof(*bdp); buf = malloc(buflen, M_TEMP, M_WAITOK); error = kern_getdirentries(td, args->fd, buf, buflen, From nobody Tue Jul 18 21:44:55 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5CCq5GX9z4dTNt; Tue, 18 Jul 2023 21:44: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 4R5CCq4cJDz41q2; Tue, 18 Jul 2023 21:44:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689716695; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mbO0zBruuhr50lyTw+9hPmfaYRvkmnz4BSepTg7q1hw=; b=JKOv+DgEpLPRSwNdLaHzNfP1zMFBhi4i15BqK9UTn/odSvkNpd8EI6hV4JHhisbyZG7Udj 8rjfoxA/6U62lN9wXhd5RGvLB9VyFQc8UZBcWIH/M3+4tLgBVr33xurVuETHV0aTALTppx hinNWf1s9l94eSlevYSEOwntEmyzASrhaiKrJNcwXKwe/vzVTju47x+7DHaI++aGLkHr9u urm74+3I5eMOn39jjsWStb4ibbfeVLAliFJNRuwVV3tg/imJ/gZY+Tr7l+yP6fD3AZOIlx DYm4QN03BJxbXoNWy+AMv/xTG0DydjATX515TOlzuJq5K4asO6UBEDl2fWu2Uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689716695; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mbO0zBruuhr50lyTw+9hPmfaYRvkmnz4BSepTg7q1hw=; b=bGTak2OXgdKMMSAwG/gDctjvLL9MDIHjxMCnRupuEUn2dOKVwlr1dLh1CfhpINa+dvMjyf L73D23IPOiGhadpbkq28sXjtCRllwfq7uf6lEPGI5cvS7YR09NoxF1WB092G9suHWzYEtl pCtbR7bOnWEJI5YBelDCxB5GAc/Smo4iHPUuXbfUfzbwXTz4ip+FTxNuHZihjw/iOIADxy S0T5cXAEVeoPV3J4kYjJ7GMoIUR5gtZs5m0GyNxU6xIUSP/K+jLvN6r+/XgbJwlzfCoflh M2hnOgormvZMeMGrvGGRaDuPbY1ouJIITrsqSfmeaTPJcFF8cYwW2k/3DWNFxA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689716695; a=rsa-sha256; cv=none; b=iJL3a2UPRxiH0oeg8GOuTuCkYvrp2mfJGPWnxOClhJG/DHaAymCJiPui1u6+oAg9Qyr83C B7W1oAUSQx8i2C0n2P9EuCV0yxQzqjQzg7tC028vT7Uzf8qKHTuUcMCiIgMGgN9pa4Yogy 5JYi40TS6SGO4UPAG/sBd0HoxKmbEk/2wmcGjBtJB8imSoePxPqt3j84Qhx+I3jEhyGgBu rJSLCDu3VgY7zUOx4uy889XowRQ8xiILguELCTo6s1EKMLEbAhewIblxGx6SavQv/pbJQx wZgAAQq0UYLdJIoGl81meOIV8QJ9ffY759rRUKnof3yZ1inCGPRbKBcnQ2xTrg== 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 4R5CCq3h7xzMNY; Tue, 18 Jul 2023 21:44: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 36ILitXj061809; Tue, 18 Jul 2023 21:44:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36ILit3d061808; Tue, 18 Jul 2023 21:44:55 GMT (envelope-from git) Date: Tue, 18 Jul 2023 21:44:55 GMT Message-Id: <202307182144.36ILit3d061808@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Chagin Subject: git: fffb2e8de691 - main - linux(4): Delete a useless variable in readdir List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fffb2e8de691ba6677616f7e0e5c442f4e7e722a Auto-Submitted: auto-generated The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=fffb2e8de691ba6677616f7e0e5c442f4e7e722a commit fffb2e8de691ba6677616f7e0e5c442f4e7e722a Author: Dmitry Chagin AuthorDate: 2023-07-18 21:44:15 +0000 Commit: Dmitry Chagin CommitDate: 2023-07-18 21:44:15 +0000 linux(4): Delete a useless variable in readdir MFC after: 2 weeks --- sys/compat/linux/linux_file.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/sys/compat/linux/linux_file.c b/sys/compat/linux/linux_file.c index a5b8a4270dc0..951ea852ae44 100644 --- a/sys/compat/linux/linux_file.c +++ b/sys/compat/linux/linux_file.c @@ -555,9 +555,8 @@ linux_readdir(struct thread *td, struct linux_readdir_args *args) struct dirent *bdp; caddr_t buf; /* BSD-format */ int linuxreclen; /* Linux-format */ - caddr_t lbuf; /* Linux-format */ off_t base; - struct l_dirent *linux_dirent; + struct l_dirent *linux_dirent; /* Linux-format */ int buflen, error; buflen = sizeof(*bdp); @@ -572,12 +571,12 @@ linux_readdir(struct thread *td, struct linux_readdir_args *args) if (td->td_retval[0] == 0) goto out; - lbuf = malloc(LINUX_RECLEN(LINUX_NAME_MAX), M_TEMP, M_WAITOK | M_ZERO); + linux_dirent = malloc(LINUX_RECLEN(LINUX_NAME_MAX), M_TEMP, + M_WAITOK | M_ZERO); bdp = (struct dirent *) buf; linuxreclen = LINUX_RECLEN(bdp->d_namlen); - linux_dirent = (struct l_dirent*)lbuf; linux_dirent->d_ino = bdp->d_fileno; linux_dirent->d_off = bdp->d_off; linux_dirent->d_reclen = bdp->d_namlen; @@ -587,7 +586,7 @@ linux_readdir(struct thread *td, struct linux_readdir_args *args) if (error == 0) td->td_retval[0] = linuxreclen; - free(lbuf, M_TEMP); + free(linux_dirent, M_TEMP); out: free(buf, M_TEMP); return (error); From nobody Tue Jul 18 21:44:56 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5CCr6MSYz4dTZJ; Tue, 18 Jul 2023 21:44: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 4R5CCr5k6nz424x; Tue, 18 Jul 2023 21:44:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689716696; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QnRNyxTElgh989GBLMDaCF+cjsCBj50QcCyWz+5gZz0=; b=yq4PzcNggAx81/tj9N/+aBM/ckNTcuXtucQ3cEuqEIugtGLW8/Z6CDbEiLIHfXliqfCFWj vv1MK3zc/25vHMljiQ90Q6ZatImddUGH9FVApvNaiPaRNGKKl/VCnhtQ5zy3nDSlY72pyr D5iD28JRsrNe+kQyaOLCOSoSeijYzgqnJyO0TuoBh79UN4gMXGAQIsm+KwSqLBvlpGk6g1 OqMeGU+LHTGnLEtN6IY+D3YzjqLV89NoQZHt4rhYqNNIrFskpE3QhGVj8zJUMe7GQuCg0K ER5Cu390OV+RaZsbLJ1LBeOexDHFwKd74ck/ll7nSruqwQuIY18XFZzWsCYODQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689716696; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QnRNyxTElgh989GBLMDaCF+cjsCBj50QcCyWz+5gZz0=; b=tC90M7W/ZLwr0AhBoIhUxV6HC/URHBKTKD9Uofes80bH4WLjq72M8rXKQzGGoEOodg3HHm QxSbrv4AjSZfxXNllGc8NHzxnxXhUl52Mu51HGDOcDiADzqFwgMVP4hanpbwLGKYSIMXxn eLxtLDcXgWzTzrTJBlkrNy0HsBvtyHBNYUXnzrNgdwrORsgr3aLe9uIaNaLNqG4WxT/n0J tJcH9gLOzcA7XCPtwoHuGMGzqJD4JXfkswyXdEzB2V8ndKHRv8MEgf3eHx9KUs++NsVuHn pNPFeuk56TAmITqiD1hHK9KA8ckd4ajUa2MC1LM82PSLbZA9FJ/qp3mJHcCMHQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689716696; a=rsa-sha256; cv=none; b=E6XPc9N8/wWugLG1YsZa/hNC0b8KclqaHjimL9K/TXzdfdAkxDNIAxdERZAD0gKJUhFv94 otnOuSdC6C5I6li8eXFXekzmnhokIZvX+8WXG9Xsgt2FUvr0M4m6vsXbp4MqUd51ciWJqi 6ZY9ncaOc5hmNGA0oplXmiRKEllviNqe0TTTKdNp/CIBZn340iwO2ym18Iv764FbHyQfso LnAv7ssPhrsijLR/z0UygJaLJJ6aG41oFzQVXBrYKkpmBDgSdnFqczWZ2CxQ0mqmaBDQ7t MV5YnjrJ8zitaz+qlIEVWv1ER0nLz0sIwgynGu+RbArXoqtOZsI5xAgJg7Qvaw== 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 4R5CCr4pzlzMXr; Tue, 18 Jul 2023 21:44: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 36ILiumV061835; Tue, 18 Jul 2023 21:44:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36ILiuXM061834; Tue, 18 Jul 2023 21:44:56 GMT (envelope-from git) Date: Tue, 18 Jul 2023 21:44:56 GMT Message-Id: <202307182144.36ILiuXM061834@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Chagin Subject: git: 13d049ab8dd7 - main - linux(4): Use M_LINUX for malloc type in readdir List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 13d049ab8dd718d0723229d54062c91b2fc68fda Auto-Submitted: auto-generated The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=13d049ab8dd718d0723229d54062c91b2fc68fda commit 13d049ab8dd718d0723229d54062c91b2fc68fda Author: Dmitry Chagin AuthorDate: 2023-07-18 21:44:15 +0000 Commit: Dmitry Chagin CommitDate: 2023-07-18 21:44:15 +0000 linux(4): Use M_LINUX for malloc type in readdir MFC after: 2 weeks --- sys/compat/linux/linux_file.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/compat/linux/linux_file.c b/sys/compat/linux/linux_file.c index 951ea852ae44..37a06dd81c67 100644 --- a/sys/compat/linux/linux_file.c +++ b/sys/compat/linux/linux_file.c @@ -560,7 +560,7 @@ linux_readdir(struct thread *td, struct linux_readdir_args *args) int buflen, error; buflen = sizeof(*bdp); - buf = malloc(buflen, M_TEMP, M_WAITOK); + buf = malloc(buflen, M_LINUX, M_WAITOK); error = kern_getdirentries(td, args->fd, buf, buflen, &base, NULL, UIO_SYSSPACE); @@ -571,7 +571,7 @@ linux_readdir(struct thread *td, struct linux_readdir_args *args) if (td->td_retval[0] == 0) goto out; - linux_dirent = malloc(LINUX_RECLEN(LINUX_NAME_MAX), M_TEMP, + linux_dirent = malloc(LINUX_RECLEN(LINUX_NAME_MAX), M_LINUX, M_WAITOK | M_ZERO); bdp = (struct dirent *) buf; @@ -586,9 +586,9 @@ linux_readdir(struct thread *td, struct linux_readdir_args *args) if (error == 0) td->td_retval[0] = linuxreclen; - free(linux_dirent, M_TEMP); + free(linux_dirent, M_LINUX); out: - free(buf, M_TEMP); + free(buf, M_LINUX); return (error); } #endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */ From nobody Tue Jul 18 21:44:57 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5CCt2bQ5z4dTjs; Tue, 18 Jul 2023 21:44: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 4R5CCs6Mjqz42TS; Tue, 18 Jul 2023 21:44:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689716697; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zqfyzufFiflMxCBOw9fd3nyo6wehYcalVVrR2iLAFM8=; b=JjYeIrF2lhtE8ljAoq+/DL188poprxxmBl5TSZLWO85cuSR0vOkpewqGI7ZxBeMV2Gxrf8 KxbWeuI7aAPhYnsRrNp9jXBSorOHlOBlub3+fNH0PHEJcJzV7O42+TZzXUDeNKJPo+6NbT MllnQ29H2Tyjuy1pbwQP44T/14tZhHT3J0KK9LNlc+D1x/au+9PCCcjaBNVg+NVhz2uZhh QVAhKdg9tcqPF8XqBwWyVAFMSd7Vg8ygOikKoG43DUvu8xek+I/9/UbVLu/TpxGdJCIejC jxxUHKG8ULIDUPRTZsLYLVBFgPL0EiIbf+Y1E2HWM9xR8MdJMMWoeUuZgfZ9eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689716697; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zqfyzufFiflMxCBOw9fd3nyo6wehYcalVVrR2iLAFM8=; b=nCBaenNkpiJu0rcSKZRY0b+TQKUqqifBuUiVzKQ7FjITKPTYbnCje/X+ndHzDEq3R3QcTB Wgaz4qR+ln0LIhGL7BUWB0hAye7uni9sht+Tvj+w9RbK8ElfvDKxobRymHT7/2x54FCPGB bVTC6D0srUunU5lEN9dfq3NTmlo+yFJ466R3I4B0n4uBtoLq5ZWyCQ3uuPSHYglYC+v4uN 0Rcath2t1u2nfm+qaqKLlPLGGFwYn9JnZjYvYBEJw67PRFB8MRsizgI7f9po0MTfFaN3La TFJWHcvWazj5jlCaWVO8Q0x274KkbKMhLWgmPRtcizYC8Mzw9hGVN1Qp01legw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689716697; a=rsa-sha256; cv=none; b=psz7LAC9A3RpW39gg6G/7hh2+4vWNUUART8QvulKY8+BZAKdYa+dXC9Kx047m0S0/FHs/k 0PPIQ1nltzrmdqOoQLR04FUUPkcySLK+0bo1+1ysBf4uC6YCPIbvUw/nxiIa4R+MdHT2zF /q7oGd/xharU4OsNE01FWsnUs/4Gv1BJ5vPrX3N/L8K3gKy7xWnAxWtcKx9rYwO+rR3IB9 zg+Kphu63PunRoMP23nFyauA7fhE/C+93he6St37jrz7XGnpDBGAHHBAczA2dk+De3RfSC 9mCTPfb/BAnVYHNffzmMXtQOHpqSenxcwtWeW7HstPjBYrXg6wG17Rpi/1i+dA== 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 4R5CCs5TN5zLyc; Tue, 18 Jul 2023 21:44: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 36ILivs4061854; Tue, 18 Jul 2023 21:44:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36ILivKP061853; Tue, 18 Jul 2023 21:44:57 GMT (envelope-from git) Date: Tue, 18 Jul 2023 21:44:57 GMT Message-Id: <202307182144.36ILivKP061853@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Chagin Subject: git: b27f3237c82b - main - linux(4): Delete a useless variable in getdents64 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b27f3237c82bde866cb24f7299eaa356e8b29eb2 Auto-Submitted: auto-generated The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=b27f3237c82bde866cb24f7299eaa356e8b29eb2 commit b27f3237c82bde866cb24f7299eaa356e8b29eb2 Author: Dmitry Chagin AuthorDate: 2023-07-18 21:44:16 +0000 Commit: Dmitry Chagin CommitDate: 2023-07-18 21:44:16 +0000 linux(4): Delete a useless variable in getdents64 MFC after: 2 weeks --- sys/compat/linux/linux_file.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sys/compat/linux/linux_file.c b/sys/compat/linux/linux_file.c index 37a06dd81c67..d186daa493f4 100644 --- a/sys/compat/linux/linux_file.c +++ b/sys/compat/linux/linux_file.c @@ -483,7 +483,6 @@ linux_getdents64(struct thread *td, struct linux_getdents64_args *args) int len, reclen; /* BSD-format */ caddr_t outp; /* Linux-format */ int resid, linuxreclen; /* Linux-format */ - caddr_t lbuf; /* Linux-format */ off_t base; struct l_dirent64 *linux_dirent64; int buflen, error; @@ -499,7 +498,8 @@ linux_getdents64(struct thread *td, struct linux_getdents64_args *args) goto out1; } - lbuf = malloc(LINUX_RECLEN64(LINUX_NAME_MAX), M_TEMP, M_WAITOK | M_ZERO); + linux_dirent64 = malloc(LINUX_RECLEN64(LINUX_NAME_MAX), M_TEMP, + M_WAITOK | M_ZERO); len = td->td_retval[0]; inp = buf; @@ -520,7 +520,6 @@ linux_getdents64(struct thread *td, struct linux_getdents64_args *args) goto out; } - linux_dirent64 = (struct l_dirent64*)lbuf; linux_dirent64->d_ino = bdp->d_fileno; linux_dirent64->d_off = bdp->d_off; linux_dirent64->d_reclen = linuxreclen; @@ -542,7 +541,7 @@ linux_getdents64(struct thread *td, struct linux_getdents64_args *args) td->td_retval[0] = retval; out: - free(lbuf, M_TEMP); + free(linux_dirent64, M_TEMP); out1: free(buf, M_TEMP); return (error); From nobody Tue Jul 18 21:44:58 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5CCv146Lz4dTnJ; Tue, 18 Jul 2023 21:44: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 4R5CCv0W1Nz42Lg; Tue, 18 Jul 2023 21:44:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689716699; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dgGCg6gZDnFYk7EtyYZIG1wSLTgLqyOs2Bx433ppmmo=; b=s/H9UEeegWZPgjMxBDpBfJ62H8P7kck1DQf8AUy9q9jWlaF4sNb+ckulwSqEVNUSGbC+w9 5KCOgEJ7UxJM+BS8Yg6X7rLhQ/EyHwzRyCo2ftrwg6mb61/FKXBErOxhc8NpRF95EceOHS g81xHaNGzUpYph9Kd0rUywYuEu8sTCKBHN5Q2yQS8/i9cpW/VQAxtWK1Z3CKgWoI8AQ4on YYDtf3+mPuNV4rx9XEJkTQvMVAg76KHHbKu/XykRgokF2TBKLzWEGPk5v1HBaOvweoST1W fTG1ajouoUXtW0s+UVY+GK45KpcSt0U/voOd1VwX65+qiy/g/wuNQoHwmKfuzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689716699; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dgGCg6gZDnFYk7EtyYZIG1wSLTgLqyOs2Bx433ppmmo=; b=QjenNSbKOQIBWHNE451AzT1jmnI3SkzLZOAWg5kDW5JfDFmi72Jss9YFcPKAwZ5WVB+hIU NwlgYczKdL/UVWsipEAXoUod555hphZ+Dxw0d/OTlsafPG0kSzB8l335rqDvkJOD3gV0a9 2FrxjaLvtUx+ZE1TpLGdtj+5rhNRlHN/AFFi4Qp0DBvNV1PCovhqr3HMqUIC11kGWOToxI E2KQHliplEzn4h+Dap/xpfCQn5YJ1/uupQlhgDgXV/6gbqOOBud/IshUZ6+524OJucb4y4 /KAZOdr5/MbPPk5Alyng3d8bmDIGOhbAz4j7Mfwvmdk4zrInP58Z+tZqONFOwQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689716699; a=rsa-sha256; cv=none; b=JD+cd1gzCIdJy7kX3Ja2R0Pr2Uqqb44eF2/cLh/qwJ7/gQNrq8zC1GK9/wX3ZD+x+DRC5S zCee3YoW4BYqv8PUrVxZG8Frq7B5P6v7hbJ39rPvgZjvnnFSe3cbDu0wxUt4EpFORoDFy/ +SZsegOs2yFgrsmn80wGYb0GeMkEll+3N5ZlnzJRdrpe6yItVhK5OVjLGP2wFtOCsxVqRv 2+069+6QttV+/p1WEzyFcPcJltDAa+ZXK1/AiWA3pPGGH+Ju7aJw32sj81HF7TkmjZDZh6 nX+rKbrzf5jPIAWlJPpHj1N9tpS+n5AyUNe/LkCVZGeSr1bhbGJrUkXZXtQF2Q== 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 4R5CCt6g1zzLqD; Tue, 18 Jul 2023 21:44: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 36ILiwx7061875; Tue, 18 Jul 2023 21:44:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36ILiwOx061874; Tue, 18 Jul 2023 21:44:58 GMT (envelope-from git) Date: Tue, 18 Jul 2023 21:44:58 GMT Message-Id: <202307182144.36ILiwOx061874@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Chagin Subject: git: e27e3fa71c8f - main - linux(4): Use M_LINUX for malloc type in getdents64 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e27e3fa71c8f31304efa5e065876a34ee603a388 Auto-Submitted: auto-generated The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=e27e3fa71c8f31304efa5e065876a34ee603a388 commit e27e3fa71c8f31304efa5e065876a34ee603a388 Author: Dmitry Chagin AuthorDate: 2023-07-18 21:44:16 +0000 Commit: Dmitry Chagin CommitDate: 2023-07-18 21:44:16 +0000 linux(4): Use M_LINUX for malloc type in getdents64 MFC after: 2 weeks --- sys/compat/linux/linux_file.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/compat/linux/linux_file.c b/sys/compat/linux/linux_file.c index d186daa493f4..0538fdd12b73 100644 --- a/sys/compat/linux/linux_file.c +++ b/sys/compat/linux/linux_file.c @@ -489,7 +489,7 @@ linux_getdents64(struct thread *td, struct linux_getdents64_args *args) size_t retval; buflen = min(args->count, MAXBSIZE); - buf = malloc(buflen, M_TEMP, M_WAITOK); + buf = malloc(buflen, M_LINUX, M_WAITOK); error = kern_getdirentries(td, args->fd, buf, buflen, &base, NULL, UIO_SYSSPACE); @@ -498,7 +498,7 @@ linux_getdents64(struct thread *td, struct linux_getdents64_args *args) goto out1; } - linux_dirent64 = malloc(LINUX_RECLEN64(LINUX_NAME_MAX), M_TEMP, + linux_dirent64 = malloc(LINUX_RECLEN64(LINUX_NAME_MAX), M_LINUX, M_WAITOK | M_ZERO); len = td->td_retval[0]; @@ -541,9 +541,9 @@ linux_getdents64(struct thread *td, struct linux_getdents64_args *args) td->td_retval[0] = retval; out: - free(linux_dirent64, M_TEMP); + free(linux_dirent64, M_LINUX); out1: - free(buf, M_TEMP); + free(buf, M_LINUX); return (error); } From nobody Tue Jul 18 21:44:59 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5CCw2g6rz4dTk5; Tue, 18 Jul 2023 21:45: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 4R5CCw1Hc3z42MM; Tue, 18 Jul 2023 21:45:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689716700; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XiYGQfsJULTaPkZ64UI+kLAbDRAoWzBtHAPFVIvz4b4=; b=glJ7zRojCzB5JYFpjDDpohVwlRagBY9Qx2knauWNIc18iq93NM3vEGI3YIkOBWvjuZTlZ2 JPcWuRuKoHKVwBz+nf3sM6dZqJ3g6SYV5v5TbMdpAdvF01Ta4a6lp5DwaIdbQD/CtJFh5H T6pAEbJ9YMHTIRVlQ1NRCFTdIcQMA0qpSoGp/JAOUR1UKemafiBKJOM5YWuRJKFQcPNW3r QYxfGOn96hp750ySiNrOLdl1Om+F/03yJS/DQRxGHWULNuod+AU/EE//JROGkF1H8AZBUb rfXcmAOL6UpuZ9HJiXbckwWAunXuSYUu7y33wmYTbSmNX9g6YXU8ozyhK73d4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689716700; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XiYGQfsJULTaPkZ64UI+kLAbDRAoWzBtHAPFVIvz4b4=; b=B0Ua63Ydec5+o9ffnIJ/Hn+QZzJQD1Ol8Z1OCfXB4IFbkjome9eM7LanbeaE09UrZ7Fqpx reW2XEYnmkxNcQu8FDv/Kiu+UNLswKcfLSDOM41Ks9hFkU5hHJZL+Tce0K2OrWGoR8jXTO wZpY2w+l/pI1QIcSsAognLXUtPsBtHsBBgJeEh0nf5HSpxHdyQhK4vnSidfjivYSqbHpr/ ZA+0JCORDvP/ub3vrPao2C6VL/Wp/gLdo35pdraL8a1vufJJ6MxyrmrGKRd7fYnswlURpS w1fQYcCxOAjLTEzipfN2qm4yXRporC9GAo8HkhFtdWrHZhNoR7slvvzUnzhWRg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689716700; a=rsa-sha256; cv=none; b=Nn4iyqo0Gp8ZGW4dv3y47nBNj3M9n5fQ+uhyzVLSXQOtb97jpBUTBgoyqe09zlFUDN2aGt dRpWs8uVPX1XD8OwhKhzRqTjkvp4xBRpmDpU/sXIrWaJsWjYbZ9s7cCbud9QgLEUfq+dql YhrVm3NEdITefAGo4Ig0Ya5/TGEEE9y50jZ2mNfR1naV7E57Q54aDnDVpJDbyTJf4mD1tZ Uk6jTnZZAZlz2NA9f9OoB1Fa+T/5pYe0iQHnhyB/8pbqE+M5/nOyqfI7o5MMsRrKh6tcM1 nR99ykI9Ozhj6JpvlPM42zWku4HnQNODdoSVCBfPW1P/PK7r5WCpGANE2TnxmQ== 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 4R5CCw0CMWzMKH; Tue, 18 Jul 2023 21:45:00 +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 36ILix6p061895; Tue, 18 Jul 2023 21:44:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36ILix3M061894; Tue, 18 Jul 2023 21:44:59 GMT (envelope-from git) Date: Tue, 18 Jul 2023 21:44:59 GMT Message-Id: <202307182144.36ILix3M061894@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Chagin Subject: git: 772946778167 - main - linux(4): Use M_LINUX for malloc type in getdents List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7729467781670a84059d50c4726dc94cbf4500e9 Auto-Submitted: auto-generated The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=7729467781670a84059d50c4726dc94cbf4500e9 commit 7729467781670a84059d50c4726dc94cbf4500e9 Author: Dmitry Chagin AuthorDate: 2023-07-18 21:44:16 +0000 Commit: Dmitry Chagin CommitDate: 2023-07-18 21:44:16 +0000 linux(4): Use M_LINUX for malloc type in getdents MFC after: 2 weeks --- sys/compat/linux/linux_file.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/compat/linux/linux_file.c b/sys/compat/linux/linux_file.c index 0538fdd12b73..33b357f222b2 100644 --- a/sys/compat/linux/linux_file.c +++ b/sys/compat/linux/linux_file.c @@ -413,7 +413,7 @@ linux_getdents(struct thread *td, struct linux_getdents_args *args) size_t retval; buflen = min(args->count, MAXBSIZE); - buf = malloc(buflen, M_TEMP, M_WAITOK); + buf = malloc(buflen, M_LINUX, M_WAITOK); error = kern_getdirentries(td, args->fd, buf, buflen, &base, NULL, UIO_SYSSPACE); @@ -422,7 +422,7 @@ linux_getdents(struct thread *td, struct linux_getdents_args *args) goto out1; } - lbuf = malloc(LINUX_RECLEN(LINUX_NAME_MAX), M_TEMP, M_WAITOK | M_ZERO); + lbuf = malloc(LINUX_RECLEN(LINUX_NAME_MAX), M_LINUX, M_WAITOK | M_ZERO); len = td->td_retval[0]; inp = buf; @@ -468,9 +468,9 @@ linux_getdents(struct thread *td, struct linux_getdents_args *args) td->td_retval[0] = retval; out: - free(lbuf, M_TEMP); + free(lbuf, M_LINUX); out1: - free(buf, M_TEMP); + free(buf, M_LINUX); return (error); } #endif From nobody Tue Jul 18 21:45:01 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5CCx2pQtz4dTqj; Tue, 18 Jul 2023 21:45: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 4R5CCx275Sz42XG; Tue, 18 Jul 2023 21:45:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689716701; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YYSz5W4kK8v02QNxd2la0isw3z+C3JkIb7FLzgR/D1g=; b=lSY+pDP/gMf1oKc9i4r+QkwSKQou1RggghI/GRQp6IhA3LpR6V/cQnq2q3ZeETAlOos1Wo 6EYKg/nz11NpNG5OQjxbCuX+x6nNkYue98FgRB92G96xIY20az49ndUIoTFynsYrxhWJHO m0Opr379eY7Ocq0NbpGo/3jks7wJIoR4xS85Gy3qabnrLHxPO2UDFZwbnSSEfrwELQWgRM WemTb3MnZKgW5IBzptG6OQdZHOO0TRYqPEonYkaFGS7YldCtQ11439pPBPGvoNDSbA4oN8 u44BOF6POYnS27IcS7kNjHEYP8o9EAeNmfkN9iX88BvcY06u1N5t8IJbVpOCNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689716701; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YYSz5W4kK8v02QNxd2la0isw3z+C3JkIb7FLzgR/D1g=; b=RFJ6D7ulFBa4n3nnfrU/tAeG+4TF49E9H5DNsQzYQ7UxkJxbYDEHibAYTW0V2EgKeWev4Q Y6Z2S7Or8GpLg5s+PLn5YOJfrmxOrYM8OCHDGIt31T2vfmBAuyEdooa9KUcFKWHc1rpU2P 0okiNVl6oMKG80EYdZXI4EGou3+HiWFZ7TzwhFSleoDTn513REvVXqn9VIZEjWs1C6YO3C L1rM9qx7PxgIKA77aOh7Az6x7vnJ8sHPuMq6F+m1Ehu8+7KOxep5ZJqBEHCiZocZUtwKpO CyIe5VQzSbxJMUJVNfHEiBh+wzXkMToGOb4//BAabaOwE2nxEr3xazVxRg12ew== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689716701; a=rsa-sha256; cv=none; b=b53SP09Vs66+o7QoUEulAPoTT9lH68jAdBGUprzft1WWgGplv3vn/PpxLzZ2He5rOShBEV MmSwkJGYYKpt4/TQRaWD7AIkl/4M7ONy2hKIe3NRAP5fOLeh7l8UrmFl7JYEQRZ2KzIklW kntjqmiwuhDizzrdM2NaA3OVk2CNeBPUdTNckwxfFpo2LodnE+bsw+Ran/qdi4M+Ei1Pl+ sVSx3pjl2JSz09yf12TRcXvY4VbtykR85qyvdIuhHsyZhXcinCwKwDpayY5aDwfTuaMF6/ fMZVWywBPTdbjNuk1vlArRGxXnbxS2u3B5of8MoJw49KAANteFSPjk9Ytaa81w== 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 4R5CCx0yNQzMXs; Tue, 18 Jul 2023 21:45: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 36ILj1U9061930; Tue, 18 Jul 2023 21:45:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36ILj1xL061929; Tue, 18 Jul 2023 21:45:01 GMT (envelope-from git) Date: Tue, 18 Jul 2023 21:45:01 GMT Message-Id: <202307182145.36ILj1xL061929@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Chagin Subject: git: b834497c6d0c - main - linux(4): Use M_LINUX for malloc type of proc emuldata List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b834497c6d0cccaeebad8d94a32c8dd3ec0d3f9b Auto-Submitted: auto-generated The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=b834497c6d0cccaeebad8d94a32c8dd3ec0d3f9b commit b834497c6d0cccaeebad8d94a32c8dd3ec0d3f9b Author: Dmitry Chagin AuthorDate: 2023-07-18 21:44:17 +0000 Commit: Dmitry Chagin CommitDate: 2023-07-18 21:44:17 +0000 linux(4): Use M_LINUX for malloc type of proc emuldata MFC after: 2 weeks --- sys/compat/linux/linux_emul.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/compat/linux/linux_emul.c b/sys/compat/linux/linux_emul.c index 6a2ea1f26fe5..8384d6a42962 100644 --- a/sys/compat/linux/linux_emul.c +++ b/sys/compat/linux/linux_emul.c @@ -147,7 +147,7 @@ linux_proc_init(struct thread *td, struct thread *newtd, bool init_thread) p = newtd->td_proc; /* non-exec call */ - em = malloc(sizeof(*em), M_TEMP, M_WAITOK | M_ZERO); + em = malloc(sizeof(*em), M_LINUX, M_WAITOK | M_ZERO); if (init_thread) { LINUX_CTR1(proc_init, "thread newtd(%d)", newtd->td_tid); @@ -250,7 +250,7 @@ linux_common_execve(struct thread *td, struct image_args *eargs) p->p_emuldata = NULL; PROC_UNLOCK(p); - free(em, M_TEMP); + free(em, M_LINUX); free(pem, M_LINUX); } return (EJUSTRETURN); @@ -328,7 +328,7 @@ linux_thread_dtor(struct thread *td) LINUX_CTR1(thread_dtor, "thread(%d)", em->em_tid); - free(em, M_TEMP); + free(em, M_LINUX); } void From nobody Tue Jul 18 22:50:44 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5Dgv57hkz4nNS3; Tue, 18 Jul 2023 22:50:51 +0000 (UTC) (envelope-from matteo@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.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 "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R5Dgv4Y56z4NrR; Tue, 18 Jul 2023 22:50:51 +0000 (UTC) (envelope-from matteo@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689720651; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=gMC9lmmvajP5iUlr9ec7qHWXb69139Gvlw5EEPQFxOs=; b=sJ5h6hDWCft+AwR+amJw82lasw4uoWjmDsq+Z/Xa4Bru2ABlgsXNQoq3KGoh7b+8OLp0ne UQwiwi+2C5Mn/V4EOYiqafmyt0ntR7yzxxOH7ntZmW07CkZm8gR/baZx7bS4xBjyE04sR4 GCBJ5ffHTbpsAyQ9RyhWhOxDjrsKeCdXLukjCoDRlYefaI2bD+bpKXCAXZEixQmjQ/3/4O /QSnPf7H81xB0l+iQ8I/1Rmg5g/4e63UvGtgF8lsDhCnSgtlLcpZgRqUogB3pxkkBfPLqS zQnx5UhB7RFm7bnTndhUkT+0S0wyUX804CsMwgudqkHomELd25/XX70lXLSGBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689720651; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=gMC9lmmvajP5iUlr9ec7qHWXb69139Gvlw5EEPQFxOs=; b=qb4aDkGd2yqJKmEqQWzFGqQwHdp08G/Sfv1BU8XJ1YSiifnw+sfS9fSf4AD+Om1CtrtNS4 /0aY9UFDtrWvf4xJvXYgv3qZDZGbNaKO8Equ91Hby+KZmK+rjXcAAsn2olhCwPctQ4OlLI eykdNZJWe7KVeu5vYYaQHqi+SpBcz52FEuC3kGyUchsPw6gJw57ly9WSVCTmNjx1Il/k12 Ii+9pX1ZJm28FS8B9IcgFalA4jBWoMpLJawQ3WnOmaxcxhk5qgr9oOZ0jE1pYlNAQx3Tnc i/ztQOLpbXJZSB3f9BbuliRbpDGme6DJzKD7hjL8bn6P8Yf0gT43pcCo/xseXg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689720651; a=rsa-sha256; cv=none; b=UtbPBDv6m/Hxn52TXi3VKIwVTjUVmoZSDc/rd1criI2/karYbPqPpARa6x2J8tYRzfF8xf l6jUz9iD+B7GmtvYYjOk8FkpKeVlkHDTSapg7l4o5JIHUEmtJ8H2G60XwNrm/WjHAIbN3s 7BGsZB5nc7NJWMEUtteBPE7/I9N6a5zScCGbs3S+C+P/MZTGPI6F6BnfPdVIAasXQxky+9 KvHfbPSBn49p4MXfkNFCDd/XqRQfpMiIoJVPi0pnzF6mPrVnFr51d6b0gUEqWVAZ5oE/g9 0/+78rjoCHLzZ7O2PcfcMCewOgP99WaLlTqkNlI8/aHjb9BJrpbyDPhA7O14MQ== Received: from ubertino.local (unknown [73.4.221.34]) (using TLSv1.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) (Authenticated sender: matteo/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4R5Dgv27y9zhrx; Tue, 18 Jul 2023 22:50:51 +0000 (UTC) (envelope-from matteo@freebsd.org) Date: Tue, 18 Jul 2023 18:50:44 -0400 From: Matteo Riondato To: Doug Rabson , Kristof Provost Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 3a1f834b5228 - main - pf: Add code to enable filtering for locally delivered packets Message-ID: <7vbajkgkvsxkbsl2am3wnpn2ogh6tsty6tquurko2we22rjcjm@ilb45u4llxsv> X-PGP-Key: http://rionda.to/files/matteogpg.asc References: <202306201435.35KEZtHN062484@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="dcahvzwmiwrnfdrr" Content-Disposition: inline In-Reply-To: --dcahvzwmiwrnfdrr Content-Type: text/plain; charset=utf-8; format=flowed Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2023-06-20 at 11:57 EDT, Matteo Riondato wrote: >On 2023-06-20 at 10:35 EDT, Doug Rabson wrote: > >>The branch main has been updated by dfr: >> >>URL: https://cgit.FreeBSD.org/src/commit/?id=3D3a1f834b5228986a7c14fd60da= 13cf2700e80996 >> >>commit 3a1f834b5228986a7c14fd60da13cf2700e80996 >>Author: Doug Rabson >>AuthorDate: 2023-06-20 13:01:58 +0000 >>Commit: Doug Rabson >>CommitDate: 2023-06-20 14:34:01 +0000 >> >> pf: Add code to enable filtering for locally delivered packets >> >> This is disabled by default since it potentially changes the behavior = of=20 >> existing filter rule sets. To enable this extra filter for packets bei= ng=20 >> delivered locally, use: >> >> sysctl net.pf.filter_local=3D1 >> service pf restart >> >> PR: 268717 >> Reviewed-by: kp >> MFC-after: 2 weeks >> Differential Revision: https://reviews.freebsd.org/D40373 >>--- >>UPDATING | 12 ++++++++++++ >>sys/netpfil/pf/pf_ioctl.c | 20 ++++++++++++++++++++ >>tests/sys/netpfil/common/utils.subr | 3 +-- >>tests/sys/netpfil/pf/fragmentation_compat.sh | 3 ++- >>tests/sys/netpfil/pf/fragmentation_pass.sh | 3 ++- >>tests/sys/netpfil/pf/killstate.sh | 24=20 >>++++++++++++++++-------- >>tests/sys/netpfil/pf/map_e.sh | 3 ++- >>tests/sys/netpfil/pf/pass_block.sh | 3 ++- >>tests/sys/netpfil/pf/pfsync.sh | 1 + >>tests/sys/netpfil/pf/route_to.sh | 3 ++- >>tests/sys/netpfil/pf/set_skip.sh | 2 +- >>tests/sys/netpfil/pf/table.sh | 6 ++++-- >>12 files changed, 65 insertions(+), 18 deletions(-) >> >>diff --git a/UPDATING b/UPDATING >>index 1980411c1853..f4e13d97006d 100644 >>--- a/UPDATING >>+++ b/UPDATING >>@@ -27,6 +27,18 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 14.x IS SLOW: >> world, or to merely disable the most expensive debugging=20 >> functionality >> at runtime, run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) >> >>+20230619: >>+ To enable pf rdr rules for connections initiated from the host, pf >>+ filter rules can be optionally enabled for packets delivered >>+ locally. This can change the behavior of rules which match packets >>+ delivered to lo0. To enable this feature: >>+ >>+ sysctl net.pf.filter_local=3D1 >>+ service pf restart > >It seems a bit weird to suggest an action that is not permanent (does=20 >not survive reboot). See proposed rewording below. > >>+ >>+ When enabled, its best to ensure that packets delivered locally are not > >s/its/it is/ > >>+ filtered, e.g. by adding a 'skip on lo' rule. > >TBH, I find the phrasing a bit confusing: "to enable pf rdr rules for=20 >connections =E2=80=A6, pf filter rules can *optionally* be enabled for=20 >packets delivered locally". That "optionally" makes it sound as if it=20 >is not *required* to enable pf filter rules for packets delivered=20 >locally in order to enable pf rdr rules for connections etc etc., but,=20 >given this change, I assume it is. > >Perhaps a better phrasing (assuming I understand the feature) would be: > >"The new sysctl net.pf.filter_local controls whether PF filter rules=20 >are enabled for packets originating from localhost and delivered=20 >locally. > >This feature can be useful for, e.g., enabling rdr rules for=20 >connections initiated from localhost and redirected to a different=20 >port on localhost. Setting the sysctl to 1 may change the behavior of=20 >rules which match packets delivered to lo0, so it may be necessary to=20 >add enable the "skip on lo" option." > >Note that "skip on" is not a rule, even if it is translated to a pair=20 >of rules: it's part of the options, and requires "set" before it, per=20 >pf.conf(5). Also, I'm assuming (and mention in the rewording) we are=20 >talking about rdr rules for port remapping, not rdr rules that=20 >redirect to other destinations, but please confirm or adjust. > >More generally, this new feature should likely also be documented=20 >somewhere else (pf(4) ? pfctl(8)? pf.conf(5)?). > >But apart from the above, I'm a little puzzled: does it mean that=20 >until now (and continuing to do so, unless one sets the sysctl to 1),=20 >packets originating locally and destined locally were not filtered by=20 >pf? I.e., that filtering rules on lo0 had no effect on incoming=20 >traffic from localhost? Hi Doug and Kristof, A ping about what I said below, as I think there is a need to better=20 document this sysctl. Additionally, I'm also a little worried about the name of the sysctl,=20 which seems extremely generic, while its use may be much more specific.=20 If the name could be made more specific, that should probably be done=20 before 14 is branched. Thanks, Matteo --dcahvzwmiwrnfdrr Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJHBAABCgAxFiEEa9uKZL0hP4E8Nl5vGwL9SVQlVQEFAmS3FzsTGGhrcHM6Ly9w Z3AubWl0LmVkdQAKCRAbAv1JVCVVAQv2EACPHxidWvhTdzuSrm4tt/HgNC474rjG OJ6zPG+Io2Z6GMIfyanZWjnaXX5pzDsA0ggjNE8qp+15I+jJEMnsaqHAC0LHyWQI zz7fSp7K+CPjs4GJvmK81JB0ntuZgOb2/++ZiQtcfFxWnhgMGxjHyc7A5S+QEFao RilE6E8yh4OaFFroq6rfM+DhOpxQC3PH184ZuBKGsBItPu1eJBRHd6izKiwFidhs SxTh+RVhm1WuqHMREWo7d+snSJBNsIPKHxDHmOZX5uDjURwfd/sUqU8s0wVm7CQX y+po+5NPdaFBFQ8gyvrLZ3aLpeIprqrMAsTTaNlYWWJ5LMOGNbi1KlM1x/2Is3FH MOjFpStZ1EteMQB7/jCCl6eDq4Ps39WASPJ3YEXpZjo9kNOwQYi9MdEfYiCgX3Fv MtxGGvqzl7dZlFEGw68LHFOvL/XoF82Rtmg3pU79hc5VS8rLdOd4cTP9wB7hj4NH 0SdD8R9j3aKYRn5DbiALK6zh68cr6ovLS2mf1n/vic+H9ooWYf6+lXkX090oiITG U/jcxz06YakFIzi0mvKnZ7NbKMfzn82lUSSrxBIBNU1fvVIoBB/toXiHc4kPqhCd vJyl5OuxQqaPi/4gsjW4udBskH4gMIMz1yA07ClBzPRuNR/IUXNalvE6cG+e5AXC 6Ir3vpW/Gx2zSw== =NHyY -----END PGP SIGNATURE----- --dcahvzwmiwrnfdrr-- From nobody Wed Jul 19 01:20:01 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5J012g3nz4dbTs; Wed, 19 Jul 2023 01:20: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 4R5J0129t8z4DKS; Wed, 19 Jul 2023 01:20:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689729601; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GD3Nozf51W0n/1Kq9lD9hw4tZGg06NGBeItr0eQ3Bq8=; b=shsnryYdXbDbFrVaEardrfx+N4Njtn+nvhNIbCDKZqUTjfF/+0cDJ0nLkMZBWu6zDGZfvH mpmKFOVqXCdntxT0QNxokkvh5qex3LnI/nLw3gHS5V/rS4mV6kkVb3YTHmmjjmw30OyJ+E k5AUQ7ahgJfUV8eeTQEJ/EYAt7TAK8ujdIv9szzg3EhqUkjMkCSeQsg31LJdmDFSvqBwu+ fqCSG99YyjLibnajdtt9qrrlWpKtmosvDhnwFqDzTuPLtJKc4enP9hN2MrhdWy2CDqzZKw clJpmTk785sihDmWZZpQrczigzpTMWph52T1GkTSQwQs9f+UL3c8Ou6hwo/B+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689729601; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GD3Nozf51W0n/1Kq9lD9hw4tZGg06NGBeItr0eQ3Bq8=; b=RZi/U2zrEfD8pleztQsfhDABlvPm9hRF30uNgcamSiRPMk/90cO7NNR88qdpUKOVIgp28y F/810uc5zVJZ4ciz9hwWzLrHUYXpY2KFxDgGuCOlFTaG3BE+/x+P3hqWoXh8UGWKEx29oP VhS0+fqdiNQ+F9u0S0ZjT+NX76kuIKHFHrDVa44Sj+ShC/lN/CK84iOd1KlCrT/lUurC5l sb1RtLcdnIoIyaoRhgxrv41K1h5ZZ3YuNV0Nf3AakYGBSGa7vFuhoZbNfalhD107FU+WhF lNrsGsQd3o+BdxEryLq+7VEujSx99DmEWb4k/9yrYf2CJ+dlh5f/zgvx1vHM8A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689729601; a=rsa-sha256; cv=none; b=YY6KuRYrmaYYgJEiW/GvkKntZOjwx4+YTgsg1CMAgDoReTroSJiwhdqVz57MOGPg9+Enir 3rt6AALqsJziaOLbTb+fIYxHIKXIEtBt6slcymT1VQLin6myxcsarxKnxRNt0V9pTTx0eW UWBitnLesoMkn9263Iw+LFwfVm1+lZlWXl6L+Pxpvi3mm4FNi5xGZN8oF9MUHCYUSrwgpK l8dDNQLXaf0GRVFGvUK9VIraFMOBYdYgUg1kL3wLWqfEkjhLn4jhptIp8GlSVcbzE2OLcW A/vfGzQWo09k57BY6vzcQlrpTkQ01Ts5jNR/kt/dYJ/PEHjPUWXgvMghlXZf+g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R5J011FkBzSKk; Wed, 19 Jul 2023 01:20: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 36J1K1O1011421; Wed, 19 Jul 2023 01:20:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36J1K1mQ011397; Wed, 19 Jul 2023 01:20:01 GMT (envelope-from git) Date: Wed, 19 Jul 2023 01:20:01 GMT Message-Id: <202307190120.36J1K1mQ011397@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: c5312bd79e66 - main - cam: Move bus_dmamap_load_ccb into cam.c. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: c5312bd79e66ce8ef50655ce7f3eca06d6b6e24f Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=c5312bd79e66ce8ef50655ce7f3eca06d6b6e24f commit c5312bd79e66ce8ef50655ce7f3eca06d6b6e24f Author: John Baldwin AuthorDate: 2023-07-19 01:19:27 +0000 Commit: John Baldwin CommitDate: 2023-07-19 01:19:27 +0000 cam: Move bus_dmamap_load_ccb into cam.c. This routine is specific to CAM and no longer assumes any internal bus_dma knowledge as it is simple wrapper around bus_dmamap_load_mem. Fixes: 60381fd1ee86 memdesc: Retire MEMDESC_CCB. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D41058 --- sys/cam/cam.c | 20 ++++++++++++++++++++ sys/kern/subr_bus_dma.c | 19 ------------------- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/sys/cam/cam.c b/sys/cam/cam.c index ce7dc81b3495..7d9d8602d009 100644 --- a/sys/cam/cam.c +++ b/sys/cam/cam.c @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #ifdef _KERNEL #include +#include #include #include @@ -642,4 +643,23 @@ memdesc_ccb(union ccb *ccb) panic("%s: flags 0x%X unimplemented", __func__, ccb_h->flags); } } + +int +bus_dmamap_load_ccb(bus_dma_tag_t dmat, bus_dmamap_t map, union ccb *ccb, + bus_dmamap_callback_t *callback, void *callback_arg, + int flags) +{ + struct ccb_hdr *ccb_h; + struct memdesc mem; + + ccb_h = &ccb->ccb_h; + if ((ccb_h->flags & CAM_DIR_MASK) == CAM_DIR_NONE) { + callback(callback_arg, NULL, 0, 0); + return (0); + } + + mem = memdesc_ccb(ccb); + return (bus_dmamap_load_mem(dmat, map, &mem, callback, callback_arg, + flags)); +} #endif diff --git a/sys/kern/subr_bus_dma.c b/sys/kern/subr_bus_dma.c index da7a2ee4cdc9..683b41d0047c 100644 --- a/sys/kern/subr_bus_dma.c +++ b/sys/kern/subr_bus_dma.c @@ -449,25 +449,6 @@ bus_dmamap_load_uio(bus_dma_tag_t dmat, bus_dmamap_t map, struct uio *uio, return (error); } -int -bus_dmamap_load_ccb(bus_dma_tag_t dmat, bus_dmamap_t map, union ccb *ccb, - bus_dmamap_callback_t *callback, void *callback_arg, - int flags) -{ - struct ccb_hdr *ccb_h; - struct memdesc mem; - - ccb_h = &ccb->ccb_h; - if ((ccb_h->flags & CAM_DIR_MASK) == CAM_DIR_NONE) { - callback(callback_arg, NULL, 0, 0); - return (0); - } - - mem = memdesc_ccb(ccb); - return (bus_dmamap_load_mem(dmat, map, &mem, callback, callback_arg, - flags)); -} - int bus_dmamap_load_bio(bus_dma_tag_t dmat, bus_dmamap_t map, struct bio *bio, bus_dmamap_callback_t *callback, void *callback_arg, From nobody Wed Jul 19 01:44:24 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5JXN3nqkz4nJ4X for ; Wed, 19 Jul 2023 01:44:36 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R5JXN23zpz4Lnt for ; Wed, 19 Jul 2023 01:44:36 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ej1-x631.google.com with SMTP id a640c23a62f3a-992af8b3b1bso867367566b.1 for ; Tue, 18 Jul 2023 18:44:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20221208.gappssmtp.com; s=20221208; t=1689731074; x=1692323074; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=uCY2iLvxJQ7R7H/8GFV90s6FgishoJFgEqh1Nq6fVbE=; b=HKtCtM8+pVKXGW8VaKBZQ2K3ztN3g7Zo0ajNfuvqpwzjYi4haCPciFzY/+2XVa7lpq kAM0nNQEjsLgoNkpIb4GPaGIGQ+t4ATr94fOv3hC+YVJ/UPkdfAfVMxYKy6Zhz2DERmB 7Px1AFJ/a+g6pSCohfZ+2V3QFPoWhLUGH3rfIwL/I2bkuRwfWdPIdhtS8Vhc+XBxvYTW zVUpHePZY2I/lLHg5VwOZZ5IOZZRHdDuuKuWwxHCVtqM+uPpAHhupO9Zb9uhM7tQj9r3 19WdBgGrpH9lAHBr7JYvaTr1pqqBdyf36ezXUA2TsL4VJ9OlbiZL15fCrhw7myKpG+F/ qLKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689731074; x=1692323074; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=uCY2iLvxJQ7R7H/8GFV90s6FgishoJFgEqh1Nq6fVbE=; b=VVNcj5qX9OXfaYyRPMmfT9YbMYNBxyJOLpWBIKdjlkTasIO51cqhP61kvU3Ph51CRJ xykZIgsbONhzUk1CZJ2xOyuRxnv2MoSB/S7My9iQi0ZlZ/H57YH/y38ZrAi2NYTBPxw1 1fyj5s+xv0EeMtDQ2kBrN4sTOCC5P1n6mE5D4o9W6VrV92CNxDnFpS2cFzkjriip9aSD eSDO2GOBbSbWFH3DHNy+POW7wWb7th82s0UdwRaTAPnchSwRpH/82z8Ebnc0gOevFaGq ehdjep02aq5WwpS/95K7Rd3CHloYcwKOoTaq/DQYhtLXNNAdcbOD7dF3FrLTCLJL9xjY f3SA== X-Gm-Message-State: ABy/qLZjryJOge6cA+gLt9zs9tm52y16l4cLek5kFP1FG14ATXaJaK1E h32Ed6H9TqQSPVyISwf5d2C5znWi5KvjqKX3ez3rzg== X-Google-Smtp-Source: APBJJlELcwSAQd3/BAKFlfR4Cj376T9WCdz7RpIMk6mjUjFirDRrZAANAnt4gk+4E4RugJg2NumPM/lH5pJBhYP2/p4= X-Received: by 2002:a05:6402:1849:b0:51e:3bb0:aa4e with SMTP id v9-20020a056402184900b0051e3bb0aa4emr1200144edy.15.1689731074471; Tue, 18 Jul 2023 18:44:34 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <202307190120.36J1K1mQ011397@gitrepo.freebsd.org> In-Reply-To: <202307190120.36J1K1mQ011397@gitrepo.freebsd.org> From: Warner Losh Date: Tue, 18 Jul 2023 19:44:24 -0600 Message-ID: Subject: Re: git: c5312bd79e66 - main - cam: Move bus_dmamap_load_ccb into cam.c. To: John Baldwin Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="00000000000075cc400600cd2ca2" X-Rspamd-Queue-Id: 4R5JXN23zpz4Lnt X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated --00000000000075cc400600cd2ca2 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable As predicted in the review, this is broken: -- command output -- linking kernel.full ld: error: undefined symbol: bus_dmamap_load_ccb >>> referenced by nvme_qpair.c:1209 (/usr/home/imp/git/freebsd/src/sys/dev/nvme/nvme_qpair.c:1209) >>> nvme_qpair.o:(_nvme_qpair_submit_request) _ from using sys/amd64/conf/EX include MINIMAL device nvme device nvd This has to be in the header file. The MODULE_DEPENDS stuff doesn't pull anything in for the static kernel case. Please, lets' do this in the header with a static inline like I suggested to get around this issue. Warner On Tue, Jul 18, 2023 at 7:20=E2=80=AFPM John Baldwin wrot= e: > The branch main has been updated by jhb: > > URL: > https://cgit.FreeBSD.org/src/commit/?id=3Dc5312bd79e66ce8ef50655ce7f3eca0= 6d6b6e24f > > commit c5312bd79e66ce8ef50655ce7f3eca06d6b6e24f > Author: John Baldwin > AuthorDate: 2023-07-19 01:19:27 +0000 > Commit: John Baldwin > CommitDate: 2023-07-19 01:19:27 +0000 > > cam: Move bus_dmamap_load_ccb into cam.c. > > This routine is specific to CAM and no longer assumes any internal > bus_dma knowledge as it is simple wrapper around bus_dmamap_load_mem. > > Fixes: 60381fd1ee86 memdesc: Retire MEMDESC_CCB. > Reviewed by: kib > Differential Revision: https://reviews.freebsd.org/D41058 > --- > sys/cam/cam.c | 20 ++++++++++++++++++++ > sys/kern/subr_bus_dma.c | 19 ------------------- > 2 files changed, 20 insertions(+), 19 deletions(-) > > diff --git a/sys/cam/cam.c b/sys/cam/cam.c > index ce7dc81b3495..7d9d8602d009 100644 > --- a/sys/cam/cam.c > +++ b/sys/cam/cam.c > @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); > > #ifdef _KERNEL > #include > +#include > #include > #include > > @@ -642,4 +643,23 @@ memdesc_ccb(union ccb *ccb) > panic("%s: flags 0x%X unimplemented", __func__, > ccb_h->flags); > } > } > + > +int > +bus_dmamap_load_ccb(bus_dma_tag_t dmat, bus_dmamap_t map, union ccb *ccb= , > + bus_dmamap_callback_t *callback, void *callback_arg, > + int flags) > +{ > + struct ccb_hdr *ccb_h; > + struct memdesc mem; > + > + ccb_h =3D &ccb->ccb_h; > + if ((ccb_h->flags & CAM_DIR_MASK) =3D=3D CAM_DIR_NONE) { > + callback(callback_arg, NULL, 0, 0); > + return (0); > + } > + > + mem =3D memdesc_ccb(ccb); > + return (bus_dmamap_load_mem(dmat, map, &mem, callback, > callback_arg, > + flags)); > +} > #endif > diff --git a/sys/kern/subr_bus_dma.c b/sys/kern/subr_bus_dma.c > index da7a2ee4cdc9..683b41d0047c 100644 > --- a/sys/kern/subr_bus_dma.c > +++ b/sys/kern/subr_bus_dma.c > @@ -449,25 +449,6 @@ bus_dmamap_load_uio(bus_dma_tag_t dmat, bus_dmamap_t > map, struct uio *uio, > return (error); > } > > -int > -bus_dmamap_load_ccb(bus_dma_tag_t dmat, bus_dmamap_t map, union ccb *ccb= , > - bus_dmamap_callback_t *callback, void *callback_arg, > - int flags) > -{ > - struct ccb_hdr *ccb_h; > - struct memdesc mem; > - > - ccb_h =3D &ccb->ccb_h; > - if ((ccb_h->flags & CAM_DIR_MASK) =3D=3D CAM_DIR_NONE) { > - callback(callback_arg, NULL, 0, 0); > - return (0); > - } > - > - mem =3D memdesc_ccb(ccb); > - return (bus_dmamap_load_mem(dmat, map, &mem, callback, > callback_arg, > - flags)); > -} > - > int > bus_dmamap_load_bio(bus_dma_tag_t dmat, bus_dmamap_t map, struct bio *bi= o, > bus_dmamap_callback_t *callback, void *callback_arg, > --00000000000075cc400600cd2ca2 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
As predicted in the review, this is = broken:

-- command output --
linking kernel.ful= l
ld: error: undefined symbol: bus_dmamap_load_ccb
>>> refer= enced by nvme_qpair.c:1209 (/usr/home/imp/git/freebsd/src/sys/dev/nvme/nvme= _qpair.c:1209)
>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 nvme_qpair.o:(_nvme_qpair_submit_request)
_
from using = sys/amd64/conf/EX
include MINIMAL
device nvme
device nvd

This has to= be in the header file. The MODULE_DEPENDS stuff doesn't pull anything = in for the
static kernel case.

Please, lets' do = this in the header with a static inline like I suggested to get around this= issue.

= Warner

On Tue, Jul 18, 2023 at 7:20=E2=80=AFPM John Bal= dwin <jhb@freebsd.org> wrote:<= br>
The branch main = has been updated by jhb:

URL: https://cgit.= FreeBSD.org/src/commit/?id=3Dc5312bd79e66ce8ef50655ce7f3eca06d6b6e24f
commit c5312bd79e66ce8ef50655ce7f3eca06d6b6e24f
Author:=C2=A0 =C2=A0 =C2=A0John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2023-07-19 01:19:27 +0000
Commit:=C2=A0 =C2=A0 =C2=A0John Baldwin <jhb@FreeBSD.org>
CommitDate: 2023-07-19 01:19:27 +0000

=C2=A0 =C2=A0 cam: Move bus_dmamap_load_ccb into cam.c.

=C2=A0 =C2=A0 This routine is specific to CAM and no longer assumes any int= ernal
=C2=A0 =C2=A0 bus_dma knowledge as it is simple wrapper around bus_dmamap_l= oad_mem.

=C2=A0 =C2=A0 Fixes:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 60381fd1ee86 memdesc= : Retire MEMDESC_CCB.
=C2=A0 =C2=A0 Reviewed by:=C2=A0 =C2=A0 kib
=C2=A0 =C2=A0 Differential Revision:=C2=A0 https://reviews.freebsd= .org/D41058
---
=C2=A0sys/cam/cam.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| 20 ++++++++++= ++++++++++
=C2=A0sys/kern/subr_bus_dma.c | 19 -------------------
=C2=A02 files changed, 20 insertions(+), 19 deletions(-)

diff --git a/sys/cam/cam.c b/sys/cam/cam.c
index ce7dc81b3495..7d9d8602d009 100644
--- a/sys/cam/cam.c
+++ b/sys/cam/cam.c
@@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$");

=C2=A0#ifdef _KERNEL
=C2=A0#include <sys/libkern.h>
+#include <machine/bus.h>
=C2=A0#include <cam/cam_queue.h>
=C2=A0#include <cam/cam_xpt.h>

@@ -642,4 +643,23 @@ memdesc_ccb(union ccb *ccb)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 panic("%s: fla= gs 0x%X unimplemented", __func__, ccb_h->flags);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 }
=C2=A0}
+
+int
+bus_dmamap_load_ccb(bus_dma_tag_t dmat, bus_dmamap_t map, union ccb *ccb,<= br> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0bus_d= mamap_callback_t *callback, void *callback_arg,
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0int f= lags)
+{
+=C2=A0 =C2=A0 =C2=A0 =C2=A0struct ccb_hdr *ccb_h;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0struct memdesc mem;
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0ccb_h =3D &ccb->ccb_h;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0if ((ccb_h->flags & CAM_DIR_MASK) =3D=3D= CAM_DIR_NONE) {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0callback(callback_a= rg, NULL, 0, 0);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return (0);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0}
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0mem =3D memdesc_ccb(ccb);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0return (bus_dmamap_load_mem(dmat, map, &mem= , callback, callback_arg,
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0flags));
+}
=C2=A0#endif
diff --git a/sys/kern/subr_bus_dma.c b/sys/kern/subr_bus_dma.c
index da7a2ee4cdc9..683b41d0047c 100644
--- a/sys/kern/subr_bus_dma.c
+++ b/sys/kern/subr_bus_dma.c
@@ -449,25 +449,6 @@ bus_dmamap_load_uio(bus_dma_tag_t dmat, bus_dmamap_t m= ap, struct uio *uio,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 return (error);
=C2=A0}

-int
-bus_dmamap_load_ccb(bus_dma_tag_t dmat, bus_dmamap_t map, union ccb *ccb,<= br> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0bus_d= mamap_callback_t *callback, void *callback_arg,
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0int f= lags)
-{
-=C2=A0 =C2=A0 =C2=A0 =C2=A0struct ccb_hdr *ccb_h;
-=C2=A0 =C2=A0 =C2=A0 =C2=A0struct memdesc mem;
-
-=C2=A0 =C2=A0 =C2=A0 =C2=A0ccb_h =3D &ccb->ccb_h;
-=C2=A0 =C2=A0 =C2=A0 =C2=A0if ((ccb_h->flags & CAM_DIR_MASK) =3D=3D= CAM_DIR_NONE) {
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0callback(callback_a= rg, NULL, 0, 0);
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return (0);
-=C2=A0 =C2=A0 =C2=A0 =C2=A0}
-
-=C2=A0 =C2=A0 =C2=A0 =C2=A0mem =3D memdesc_ccb(ccb);
-=C2=A0 =C2=A0 =C2=A0 =C2=A0return (bus_dmamap_load_mem(dmat, map, &mem= , callback, callback_arg,
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0flags));
-}
-
=C2=A0int
=C2=A0bus_dmamap_load_bio(bus_dma_tag_t dmat, bus_dmamap_t map, struct bio = *bio,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 bus_d= mamap_callback_t *callback, void *callback_arg,
--00000000000075cc400600cd2ca2-- From nobody Wed Jul 19 02:42:36 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5KqZ4Y8Tz4nsmW for ; Wed, 19 Jul 2023 02:42:50 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R5KqY15Cpz3Nfb for ; Wed, 19 Jul 2023 02:42:49 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20221208.gappssmtp.com header.s=20221208 header.b=kNyltHFh; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2a00:1450:4864:20::130) smtp.mailfrom=wlosh@bsdimp.com; dmarc=none Received: by mail-lf1-x130.google.com with SMTP id 2adb3069b0e04-4fdd14c1fbfso2008045e87.1 for ; Tue, 18 Jul 2023 19:42:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20221208.gappssmtp.com; s=20221208; t=1689734567; x=1692326567; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Yzk2Nf2nbtsTTGPYD5nqapnJVziAE/3S0vvkhWXh0yI=; b=kNyltHFhg5ceYHnLHK96gSMEZ2aqA1dkG41TMP8Wsjr56Psv5KEqLOyGt7OaS3xWeE IOfMmCRnEX6uzi4Y5Vo1bw2F3IUHgX6G/Ca7oqllu2PGJ5sSLlt3OmMp1kw5PBRzvTJp +I0bNFx3p1gUGnLLSf3R5cKmtNzLg0UDGLmhbqEw5jLNMFySHL0lWNcYoOWj2Eh0MCbw sbSYz1ox8q9Dx31XmJw00WYZ9Bb4jqxP3nwsbJAtqg+8I6H6DA6UyoKikGgLKzTwSzCS xekdnibnYDIVukX/FnxioCEBdwTbXTInLg2MU6lJ7rJqMP05TfUzx+it3k9YuwaA/2Es u2jA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689734567; x=1692326567; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Yzk2Nf2nbtsTTGPYD5nqapnJVziAE/3S0vvkhWXh0yI=; b=cQS0aWCZi211vgvFHDnvuTGFb/yLnfNi4+VHzFlwXYHbSJyFjSnBtfinYtxaey4wF+ i739gkMpQf3QA88sDJPwPVr0h3TGvgxeogIxlzSiPh3KykvK+E86PkJxjeLwEaZew9dZ sXbv2qgrWd/+Q51hC/z4MXuPWM8e3aoJ6rERiMXLeQkVD03NDJweJxObX4bQm2qiCqQ+ l6Fzp4FzPPvvA0hdBKLuw4IUfTuvmtXITe0uK2EobakKOFtYZpdcLe7Ci1TyyBbBK+bI OPgx0KsSnf1JMfNAsnnoXwz41RO77qDk8eT3/lmhRNpkZ6pvghy5kJLWQzOPSBqudigD OvVw== X-Gm-Message-State: ABy/qLaylmQR8NCVwgplb8CJwME+jgAWN2Q3rHrNXI18ve5xeHRcyWUa AnmaUJCDZUOyEUQ4Uj94oNwez1jQ4BWdOX91n15modXrhhxwLXJBFPE9Vg== X-Google-Smtp-Source: APBJJlFEH4hZFrllTV42JkeOrSwdVJqNPvCLEz/mtGX3S5doeJrZL1lr4Mps7TO048SByd0Q1LwL3h5B7Q74RRBI1jc= X-Received: by 2002:a19:5f11:0:b0:4fd:c771:ed76 with SMTP id t17-20020a195f11000000b004fdc771ed76mr734519lfb.38.1689734566679; Tue, 18 Jul 2023 19:42:46 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <202307190120.36J1K1mQ011397@gitrepo.freebsd.org> In-Reply-To: From: Warner Losh Date: Tue, 18 Jul 2023 20:42:36 -0600 Message-ID: Subject: Re: git: c5312bd79e66 - main - cam: Move bus_dmamap_load_ccb into cam.c. To: John Baldwin Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="0000000000009cb26d0600cdfc44" X-Spamd-Result: default: False [-2.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.96)[-0.964]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20221208.gappssmtp.com:s=20221208]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; R_SPF_NA(0.00)[no SPF record]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org]; ARC_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RCVD_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::130:from]; DKIM_TRACE(0.00)[bsdimp-com.20221208.gappssmtp.com:+]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCPT_COUNT_THREE(0.00)[4]; FROM_HAS_DN(0.00)[]; BLOCKLISTDE_FAIL(0.00)[2a00:1450:4864:20::130:server fail]; TO_DN_SOME(0.00)[]; DMARC_NA(0.00)[bsdimp.com]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-main@freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com] X-Rspamd-Queue-Id: 4R5KqY15Cpz3Nfb X-Spamd-Bar: -- --0000000000009cb26d0600cdfc44 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sorry for the top post. Two ways forward that I see: Two proposed fixes https://reviews.freebsd.org/D41077 which makes loading the dma for a nvme request a function pointer (and keeps all ccb knowledge in nvme_sim.c) https://reviews.freebsd.org/D41078 which moves renames memdesc_ccb to cam_memdesc_ccb and moves it to cam_cch.h '78 is ready to commit as is. I think it's fine, but don't like the dependency graph. '77 likely needs some polish before it's pushed in, especially with naming. I like its dependency graph, but don't like the extra call through a function pointer for all nvme requests. Warner P.S. Sorry if I sounded too grumpy in other replies... it's been a frustrating day in $REAL_LIFE and I let that infect those replies. On Tue, Jul 18, 2023 at 7:44=E2=80=AFPM Warner Losh wrote: > As predicted in the review, this is broken: > > -- command output -- > linking kernel.full > ld: error: undefined symbol: bus_dmamap_load_ccb > >>> referenced by nvme_qpair.c:1209 > (/usr/home/imp/git/freebsd/src/sys/dev/nvme/nvme_qpair.c:1209) > >>> nvme_qpair.o:(_nvme_qpair_submit_request) > _ > from using sys/amd64/conf/EX > include MINIMAL > device nvme > device nvd > > This has to be in the header file. The MODULE_DEPENDS stuff doesn't pull > anything in for the > static kernel case. > > Please, lets' do this in the header with a static inline like I suggested > to get around this issue. > > Warner > > On Tue, Jul 18, 2023 at 7:20=E2=80=AFPM John Baldwin wr= ote: > >> The branch main has been updated by jhb: >> >> URL: >> https://cgit.FreeBSD.org/src/commit/?id=3Dc5312bd79e66ce8ef50655ce7f3eca= 06d6b6e24f >> >> commit c5312bd79e66ce8ef50655ce7f3eca06d6b6e24f >> Author: John Baldwin >> AuthorDate: 2023-07-19 01:19:27 +0000 >> Commit: John Baldwin >> CommitDate: 2023-07-19 01:19:27 +0000 >> >> cam: Move bus_dmamap_load_ccb into cam.c. >> >> This routine is specific to CAM and no longer assumes any internal >> bus_dma knowledge as it is simple wrapper around bus_dmamap_load_mem= . >> >> Fixes: 60381fd1ee86 memdesc: Retire MEMDESC_CCB. >> Reviewed by: kib >> Differential Revision: https://reviews.freebsd.org/D41058 >> --- >> sys/cam/cam.c | 20 ++++++++++++++++++++ >> sys/kern/subr_bus_dma.c | 19 ------------------- >> 2 files changed, 20 insertions(+), 19 deletions(-) >> >> diff --git a/sys/cam/cam.c b/sys/cam/cam.c >> index ce7dc81b3495..7d9d8602d009 100644 >> --- a/sys/cam/cam.c >> +++ b/sys/cam/cam.c >> @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); >> >> #ifdef _KERNEL >> #include >> +#include >> #include >> #include >> >> @@ -642,4 +643,23 @@ memdesc_ccb(union ccb *ccb) >> panic("%s: flags 0x%X unimplemented", __func__, >> ccb_h->flags); >> } >> } >> + >> +int >> +bus_dmamap_load_ccb(bus_dma_tag_t dmat, bus_dmamap_t map, union ccb *cc= b, >> + bus_dmamap_callback_t *callback, void *callback_arg, >> + int flags) >> +{ >> + struct ccb_hdr *ccb_h; >> + struct memdesc mem; >> + >> + ccb_h =3D &ccb->ccb_h; >> + if ((ccb_h->flags & CAM_DIR_MASK) =3D=3D CAM_DIR_NONE) { >> + callback(callback_arg, NULL, 0, 0); >> + return (0); >> + } >> + >> + mem =3D memdesc_ccb(ccb); >> + return (bus_dmamap_load_mem(dmat, map, &mem, callback, >> callback_arg, >> + flags)); >> +} >> #endif >> diff --git a/sys/kern/subr_bus_dma.c b/sys/kern/subr_bus_dma.c >> index da7a2ee4cdc9..683b41d0047c 100644 >> --- a/sys/kern/subr_bus_dma.c >> +++ b/sys/kern/subr_bus_dma.c >> @@ -449,25 +449,6 @@ bus_dmamap_load_uio(bus_dma_tag_t dmat, bus_dmamap_= t >> map, struct uio *uio, >> return (error); >> } >> >> -int >> -bus_dmamap_load_ccb(bus_dma_tag_t dmat, bus_dmamap_t map, union ccb *cc= b, >> - bus_dmamap_callback_t *callback, void *callback_arg, >> - int flags) >> -{ >> - struct ccb_hdr *ccb_h; >> - struct memdesc mem; >> - >> - ccb_h =3D &ccb->ccb_h; >> - if ((ccb_h->flags & CAM_DIR_MASK) =3D=3D CAM_DIR_NONE) { >> - callback(callback_arg, NULL, 0, 0); >> - return (0); >> - } >> - >> - mem =3D memdesc_ccb(ccb); >> - return (bus_dmamap_load_mem(dmat, map, &mem, callback, >> callback_arg, >> - flags)); >> -} >> - >> int >> bus_dmamap_load_bio(bus_dma_tag_t dmat, bus_dmamap_t map, struct bio >> *bio, >> bus_dmamap_callback_t *callback, void *callback_arg, >> > --0000000000009cb26d0600cdfc44 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Sorry for the top post. Two ways for= ward that I see:


=
'78 is ready to commit as is. I think it's fine, but don't= like the dependency graph.
'77 likely needs some polish befo= re it's pushed in, especially with naming. I like its dependency graph,= but don't like the extra call through a function pointer for all nvme = requests.

Warner

P.S. Sor= ry if I sounded too grumpy in other replies... it's been a frustrating = day in $REAL_LIFE and I let that infect those replies.


On Tue, Jul 18, 2023 at 7:44=E2=80=AFPM Warner Losh <imp@bsdimp.com> wrote:
As = predicted in the review, this is broken:

-- comman= d output --
linking kernel.full
ld: error: undefined symbol: bus_dmam= ap_load_ccb
>>> referenced by nvme_qpair.c:1209 (/usr/home/imp/= git/freebsd/src/sys/dev/nvme/nvme_qpair.c:1209)
>>> =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 nvme_qpair.o:(_nvme_qpair_submit_req= uest)
_
from using sys/amd64/conf/EX
include MINIMAL
de= vice nvme
device nvd

This has to be in the header file. The MODULE_DEPENDS = stuff doesn't pull anything in for the
s= tatic kernel case.

Please, lets' do this in the header with a static inline lik= e I suggested to get around this issue.

=
Warner

On Tue, Jul 18, = 2023 at 7:20=E2=80=AFPM John Baldwin <jhb@freebsd.org> wrote:
The branch main has been updated by jhb:<= br>
URL: https://cgit.= FreeBSD.org/src/commit/?id=3Dc5312bd79e66ce8ef50655ce7f3eca06d6b6e24f
commit c5312bd79e66ce8ef50655ce7f3eca06d6b6e24f
Author:=C2=A0 =C2=A0 =C2=A0John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2023-07-19 01:19:27 +0000
Commit:=C2=A0 =C2=A0 =C2=A0John Baldwin <jhb@FreeBSD.org>
CommitDate: 2023-07-19 01:19:27 +0000

=C2=A0 =C2=A0 cam: Move bus_dmamap_load_ccb into cam.c.

=C2=A0 =C2=A0 This routine is specific to CAM and no longer assumes any int= ernal
=C2=A0 =C2=A0 bus_dma knowledge as it is simple wrapper around bus_dmamap_l= oad_mem.

=C2=A0 =C2=A0 Fixes:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 60381fd1ee86 memdesc= : Retire MEMDESC_CCB.
=C2=A0 =C2=A0 Reviewed by:=C2=A0 =C2=A0 kib
=C2=A0 =C2=A0 Differential Revision:=C2=A0 https://reviews.freebsd= .org/D41058
---
=C2=A0sys/cam/cam.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| 20 ++++++++++= ++++++++++
=C2=A0sys/kern/subr_bus_dma.c | 19 -------------------
=C2=A02 files changed, 20 insertions(+), 19 deletions(-)

diff --git a/sys/cam/cam.c b/sys/cam/cam.c
index ce7dc81b3495..7d9d8602d009 100644
--- a/sys/cam/cam.c
+++ b/sys/cam/cam.c
@@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$");

=C2=A0#ifdef _KERNEL
=C2=A0#include <sys/libkern.h>
+#include <machine/bus.h>
=C2=A0#include <cam/cam_queue.h>
=C2=A0#include <cam/cam_xpt.h>

@@ -642,4 +643,23 @@ memdesc_ccb(union ccb *ccb)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 panic("%s: fla= gs 0x%X unimplemented", __func__, ccb_h->flags);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 }
=C2=A0}
+
+int
+bus_dmamap_load_ccb(bus_dma_tag_t dmat, bus_dmamap_t map, union ccb *ccb,<= br> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0bus_d= mamap_callback_t *callback, void *callback_arg,
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0int f= lags)
+{
+=C2=A0 =C2=A0 =C2=A0 =C2=A0struct ccb_hdr *ccb_h;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0struct memdesc mem;
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0ccb_h =3D &ccb->ccb_h;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0if ((ccb_h->flags & CAM_DIR_MASK) =3D=3D= CAM_DIR_NONE) {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0callback(callback_a= rg, NULL, 0, 0);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return (0);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0}
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0mem =3D memdesc_ccb(ccb);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0return (bus_dmamap_load_mem(dmat, map, &mem= , callback, callback_arg,
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0flags));
+}
=C2=A0#endif
diff --git a/sys/kern/subr_bus_dma.c b/sys/kern/subr_bus_dma.c
index da7a2ee4cdc9..683b41d0047c 100644
--- a/sys/kern/subr_bus_dma.c
+++ b/sys/kern/subr_bus_dma.c
@@ -449,25 +449,6 @@ bus_dmamap_load_uio(bus_dma_tag_t dmat, bus_dmamap_t m= ap, struct uio *uio,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 return (error);
=C2=A0}

-int
-bus_dmamap_load_ccb(bus_dma_tag_t dmat, bus_dmamap_t map, union ccb *ccb,<= br> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0bus_d= mamap_callback_t *callback, void *callback_arg,
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0int f= lags)
-{
-=C2=A0 =C2=A0 =C2=A0 =C2=A0struct ccb_hdr *ccb_h;
-=C2=A0 =C2=A0 =C2=A0 =C2=A0struct memdesc mem;
-
-=C2=A0 =C2=A0 =C2=A0 =C2=A0ccb_h =3D &ccb->ccb_h;
-=C2=A0 =C2=A0 =C2=A0 =C2=A0if ((ccb_h->flags & CAM_DIR_MASK) =3D=3D= CAM_DIR_NONE) {
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0callback(callback_a= rg, NULL, 0, 0);
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return (0);
-=C2=A0 =C2=A0 =C2=A0 =C2=A0}
-
-=C2=A0 =C2=A0 =C2=A0 =C2=A0mem =3D memdesc_ccb(ccb);
-=C2=A0 =C2=A0 =C2=A0 =C2=A0return (bus_dmamap_load_mem(dmat, map, &mem= , callback, callback_arg,
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0flags));
-}
-
=C2=A0int
=C2=A0bus_dmamap_load_bio(bus_dma_tag_t dmat, bus_dmamap_t map, struct bio = *bio,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 bus_d= mamap_callback_t *callback, void *callback_arg,
--0000000000009cb26d0600cdfc44-- From nobody Wed Jul 19 12:50:43 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5bK00j5sz4nXny; Wed, 19 Jul 2023 12:50: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 4R5bJz5jTzz449T; Wed, 19 Jul 2023 12:50:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689771043; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TA4K97P0zjN6EnzrbyoqmmCR4cysOf6pH5slqYJ+PkM=; b=FzD4Bx8jg+YeIZwCxoJjkP80Ml6xPBPVbeK91tQklBhFZWFbrZflppvz9AJcxvpURKgcgr KwU2GrRAK2z/LH0T5ipwOGK1su7/dcxRDuYuPVvXljWNmqapKEMp5YkLosQoRbNBpe/thg 7GifUChWLEp3w60uOgWYaDI3qN9qJAn0k5x/NwuQA+jSB+J5MvIPm9lsYqGwwZL6QnL0OD FLX4qaGggdM2l4evHLDze7NJKRh3K6ak7RMsyMYfBpDZeU0IjMsEM2hoU0mbLsvOhsxHr+ Nzxd70RXWEWg8g0kD92x8yL8JrC2HTdwnC3LHov4pgbsAaitJ4TO3SK7+2Wp5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689771043; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TA4K97P0zjN6EnzrbyoqmmCR4cysOf6pH5slqYJ+PkM=; b=XjW5EZi/fxgkV9Vtx0ilPx5TM8UhofqxXKo19SSGRiVo/Gbp8GXT2dofgZWdCPVSDRcr+E rTj3cGA/KfYYCr+Eq7rOsraaY9xbh56GVhBof+KEirB5P9ltfYxJ44f4PTjU+uvD1hX7qn qnZTHSx1bRKOzYpRYZE5PRKXCqe3aI7SJL7qNDj9sdhXSAmP1J2iMjG62Ux7POMHqOXT6I Jv4ZaUZ9glRVQhju+GUzbOIlGO6ZPFXL6tYuCFVtslFS+kGXL7UfoOT2oZ9+DYGdg1fyL6 I/oiNmXYLlk7Mjis1AJeprtwdjaRuJhDLOV0Lj/uNchcdMu3O7uOT8bDrQtfrQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689771043; a=rsa-sha256; cv=none; b=cJ/rha9VI1rR4NB/a+heBwQx1jqyJQCYLk+gCihUSyHsyfwvaFER80jt41jit6ujm+qBkZ Z3mTdksKgcNMuxYCDS7SQt/hATA/d4yJryjoUpCxS1k4PzvzXxPM5XN2NFI/DRI4aWsHZS JTZossjw9D1Uit5a2QM2Sx3jkO9CvZq6eqlVBuLgFo1yEV91GUGeztZISooacm66itzkFf CMhAlpwxgZQoD4GZFNUMFRfWE6UHYU91RaizIDmHPKDYqJOO5P7BuDhSXxLkq81nBHaYth FJEQFt00SLS997qD8Mm64pp2kYdro7luwAwPRLQOLk9V7gu5O9PwvHdgmTq+Lw== 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 4R5bJz4VLYznxx; Wed, 19 Jul 2023 12:50: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 36JCohLW060534; Wed, 19 Jul 2023 12:50:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36JCohNt060533; Wed, 19 Jul 2023 12:50:43 GMT (envelope-from git) Date: Wed, 19 Jul 2023 12:50:43 GMT Message-Id: <202307191250.36JCohNt060533@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: e4a873bf10b7 - main - tcp: improve layout of struct tcpcb List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e4a873bf10b7cc8fa67087a7291a640d09e430f2 Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=e4a873bf10b7cc8fa67087a7291a640d09e430f2 commit e4a873bf10b7cc8fa67087a7291a640d09e430f2 Author: Michael Tuexen AuthorDate: 2023-07-19 12:47:36 +0000 Commit: Michael Tuexen CommitDate: 2023-07-19 12:47:36 +0000 tcp: improve layout of struct tcpcb Put optional fields at the end to minimize run time problems in case CC modules are build from within its directory. Reviewed by: cc, gallatin, glebius, imp Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D41059 --- sys/netinet/tcp_var.h | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h index 8e89f2aef0f2..0f57fec74865 100644 --- a/sys/netinet/tcp_var.h +++ b/sys/netinet/tcp_var.h @@ -442,15 +442,6 @@ struct tcpcb { const char *t_output_caller; /* Function that called tcp_output */ struct statsblob *t_stats; /* Per-connection stats */ /* Should these be a pointer to the arrays or an array? */ -#ifdef TCP_ACCOUNTING - uint64_t tcp_cnt_counters[TCP_NUM_CNT_COUNTERS]; - uint64_t tcp_proc_time[TCP_NUM_CNT_COUNTERS]; -#endif -#ifdef TCP_REQUEST_TRK - uint32_t tcp_hybrid_start; /* Num of times we started hybrid pacing */ - uint32_t tcp_hybrid_stop; /* Num of times we stopped hybrid pacing */ - uint32_t tcp_hybrid_error; /* Num of times we failed to start hybrid pacing */ -#endif uint32_t t_logsn; /* Log "serial number" */ uint32_t gput_ts; /* Time goodput measurement started */ tcp_seq gput_seq; /* Outbound measurement seq */ @@ -478,10 +469,6 @@ struct tcpcb { uint8_t t_end_info_bytes[TCP_END_BYTE_INFO]; uint64_t t_end_info; }; -#ifdef TCPPCAP - struct mbufq t_inpkts; /* List of saved input packets. */ - struct mbufq t_outpkts; /* List of saved output packets. */ -#endif struct osd t_osd; /* storage for Khelp module data */ uint8_t _t_logpoint; /* Used when a BB log points is enabled */ #ifdef TCP_REQUEST_TRK @@ -489,8 +476,19 @@ struct tcpcb { uint8_t t_tcpreq_req; /* Request count */ uint8_t t_tcpreq_open; /* Number of open range requests */ uint8_t t_tcpreq_closed; /* Number of closed range requests */ + uint32_t tcp_hybrid_start; /* Num of times we started hybrid pacing */ + uint32_t tcp_hybrid_stop; /* Num of times we stopped hybrid pacing */ + uint32_t tcp_hybrid_error; /* Num of times we failed to start hybrid pacing */ struct tcp_sendfile_track t_tcpreq_info[MAX_TCP_TRK_REQ]; #endif +#ifdef TCP_ACCOUNTING + uint64_t tcp_cnt_counters[TCP_NUM_CNT_COUNTERS]; + uint64_t tcp_proc_time[TCP_NUM_CNT_COUNTERS]; +#endif +#ifdef TCPPCAP + struct mbufq t_inpkts; /* List of saved input packets. */ + struct mbufq t_outpkts; /* List of saved output packets. */ +#endif }; #endif /* _KERNEL || _WANT_TCPCB */ From nobody Wed Jul 19 13:39:46 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5cPd2Qwqz4nyDf; Wed, 19 Jul 2023 13:39: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 4R5cPb4HTpz4JRP; Wed, 19 Jul 2023 13:39:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689773987; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=C0b/2DIZ9YAXKTkbLM4m29MjtAbvBbtJC90HXo6zxpg=; b=H7xXJr7KWklcLSCNbuo7T052+QhC1BsPgMLbOnyDCTNevtLaNEQ23FeHiW5VGFu56lWFp3 aSfUalNDamulOLO/M4V2Ql5yDVJ8IWIom5k4FnzBrNdv8a3O2PeOHIfhv/xWJaRQIHopvh 5xl6mkPnXAU2i2HukO6I34UhPmQ8NBGdUrM3qgrIbr60sAZ1uH55uXJe+0j2wtKPUf4Y7v f9z9Ht/KMgZFOQHHO7jGH3OXpdLX3Urc+MmMJ92Z4fyqlCdfr+d0OhEJKlWDonFzI7E/4I xg8btYYTk/P4VpyEscPTZqtlNgjEibUZXw8FWHldHSHOHq/2kXUZLV69/kM8dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689773987; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=C0b/2DIZ9YAXKTkbLM4m29MjtAbvBbtJC90HXo6zxpg=; b=Urjwft38GEBa42wtuhM9lqckGuSf+30jlkCbKy+/Zzh60SW0neqbxa4xp6viOXDfGx6Hs6 +OTwRlcM0Dv6LbdauuDxftmV3jXpo2vMjVbjDv+vE2/w61BECSWpq1IMz97qpjgJ3cuE4w WFbpkPrPMP3g3lA0D08tYLwIXtodRBaIpWvLADiJKgFJhpEOgrt7saOfEUvdW1i8CZQEmi UeZr1A0FvboJEaB7TtNvYd9pNyfmmTTEeJXPB33e8rwVbSekXqF9AwoiRP6wkuKErKxHEW RTSmpoL8FgGoDH6tAwOBF5P9ttIaR1mBxynKnFk1xrKKKTtfM7qta9CUdQhQgw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689773987; a=rsa-sha256; cv=none; b=WtwKNKcYkXMg1+W3WM08iIdkX06YCXdYXzDf9biAYiSXV1BCE+SFcdxsVW1jQuMYepaaKc 6WRMESDwdGIkgSx/el/zlTgWeFqQYhRNYMTim5GJx3gYcaYBAPt7TkUG2yqw43y0CkDpoZ 3ftU11r7ntyj4qJRbvy/d+56Ri/XKakuSHiVrebCR0S5zArZAoCbsaBE1cy/bU647QB7AX Mwy96TpYhJu7UQXoHFLREvVCtkyNipNguKLYofuIXbOjK/jGgzbhhWQ+5Gzo9DzUwfrk0k kHdPXJlNXHz+w+0CmpI3DewHGLyfaNg0ejL09tLv1pTlqePvL3NV3M6tNit7Lg== 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 4R5cPb07ljzq87; Wed, 19 Jul 2023 13:39: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 36JDdk2b034074; Wed, 19 Jul 2023 13:39:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36JDdkUX034073; Wed, 19 Jul 2023 13:39:46 GMT (envelope-from git) Date: Wed, 19 Jul 2023 13:39:46 GMT Message-Id: <202307191339.36JDdkUX034073@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Joseph Mingrone Subject: git: 17839f45d86e - main - pw: Ensure group membership is not duplicated List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 17839f45d86e79065a65ad3e2522dd69b29a652c Auto-Submitted: auto-generated The branch main has been updated by jrm: URL: https://cgit.FreeBSD.org/src/commit/?id=17839f45d86e79065a65ad3e2522dd69b29a652c commit 17839f45d86e79065a65ad3e2522dd69b29a652c Author: Naman Sood AuthorDate: 2023-07-19 12:44:21 +0000 Commit: Joseph Mingrone CommitDate: 2023-07-19 13:36:09 +0000 pw: Ensure group membership is not duplicated Fix the following problem: 1. A nonexistent user, someuser, is added to somegroup in /etc/group. 2. someuser is then created with membership in somegroup. The entry for somegroup in /etc/group will then contain somegroup:*:12345:someuser,someuser With this fix, the entry will be somegroup:*:12345:someuser PR: 238995 Reviewed by: bapt, jrm Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D41076 --- usr.sbin/pw/pw.h | 2 ++ usr.sbin/pw/pw_group.c | 2 +- usr.sbin/pw/pw_user.c | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/usr.sbin/pw/pw.h b/usr.sbin/pw/pw.h index fb1ba9a44f84..6eb5a25e56ec 100644 --- a/usr.sbin/pw/pw.h +++ b/usr.sbin/pw/pw.h @@ -114,3 +114,5 @@ extern const char *Which[]; uintmax_t strtounum(const char * __restrict, uintmax_t, uintmax_t, const char ** __restrict); + +bool grp_has_member(struct group *grp, const char *name); diff --git a/usr.sbin/pw/pw_group.c b/usr.sbin/pw/pw_group.c index 277763041f0a..48f999d3e1d3 100644 --- a/usr.sbin/pw/pw_group.c +++ b/usr.sbin/pw/pw_group.c @@ -418,7 +418,7 @@ pw_group_del(int argc, char **argv, char *arg1) return (EXIT_SUCCESS); } -static bool +bool grp_has_member(struct group *grp, const char *name) { int j; diff --git a/usr.sbin/pw/pw_user.c b/usr.sbin/pw/pw_user.c index bea248c802ed..9029069c6a9f 100644 --- a/usr.sbin/pw/pw_user.c +++ b/usr.sbin/pw/pw_user.c @@ -1408,6 +1408,9 @@ pw_user_add(int argc, char **argv, char *arg1) if (cmdcnf->groups != NULL) { for (i = 0; i < cmdcnf->groups->sl_cur; i++) { grp = GETGRNAM(cmdcnf->groups->sl_str[i]); + /* gr_add doesn't check if new member is already in group */ + if (grp_has_member(grp, pwd->pw_name)) + continue; grp = gr_add(grp, pwd->pw_name); /* * grp can only be NULL in 2 cases: From nobody Wed Jul 19 13:41:54 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5cS248pbz4nyhJ; Wed, 19 Jul 2023 13:41: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 4R5cS23J48z4KKB; Wed, 19 Jul 2023 13:41:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689774114; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fHnCHgbXU3EnZQTPTntIv3DjsJUdrN6NUgI/QEqHEI8=; b=awP8gBDFkj/isujrZeamrYO3VDfpiaWa0wqT22CQcmYWyxEcPPoRdwhDqw8bKvq+IjKW2c fmNu+umciYBgk8u1Pa4MBU4yW11AGAkZI06FOCMXNfJMjinpMp7JUC8GNDTy5wCiadSpBQ pJSEA4sPafcl2XyZurHKywgzEhjhzN/GvgWNHXNaPNJ96ZJrhX4V7W54g/PpJpUv1uPkyz Fxy1L+NDiB0W/I/BBhgb20z4pSyg/tcypUvWRWxOaUNiHdW8pW0Jpdx9J9TmYv9GktJquU kk7PoBh6jVF3BIdSNMLLaLhqJ0tAixNlXtgK3AU6RUX6mhPxDS498Dt5s8JmVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689774114; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fHnCHgbXU3EnZQTPTntIv3DjsJUdrN6NUgI/QEqHEI8=; b=Bo/3GgS6muOfRSXWXec64ii353xP9K3VY9oWeF75quFPbhU569bEuHcGmbPVybhdPcmqr3 azti7Qc/LAFJ32SXBUxw1U1jPyXO3sRMYdaSWWTMsP1B2T5IXLxzndBMjUO6b3Jne7IamC 6P9871AqLMWnZB1YjYjkxbJHFTygCxPgSqp/1N0jR4QBmmOyFKAFxv/qKX1+VMs/VSH422 GPyKygRjPYyw5J2FkQIBxhHwnwkTHSxB7+8wA3aokD7mVgHemL6AM/ODyzLRd1HDjAwC7c NdRMxEcZG9DdObplnuUN4M4e5SmMDDasF/+mW7KW6dsZbHW2mYeuWDRBw7MVhg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689774114; a=rsa-sha256; cv=none; b=R8PcT9pPF39v6vF3bCbAHqd+sncS9V3ZXNEuanKOgESxp1xH0vh2DR5d1N+HNpVY97Vp8m 5YvGf1IIZmzKPvJ1klVl/UrkxF7+kZjKT0/54IeWdDcCi8S0G5W+gfjzctO3p/QUKRus6J RKOliCEf/RCn9v9yoIoY37/aHXop+fCrUo5EzlWB4udiFIHUVopwBdzyKcc4+fKwrpPN5T +NMMt7idkrqbxIj5YegtOAlrxZHFPgEocKbQNrsrTYJ++o5z/VFKKd3ID0NZuAIHWvAVDJ EEeAPtrcnEUYPYj+OzZRE3iAGdpQZBVGFxkFOcjgdDA7SCTFNgH/EBlJTSQIAA== 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 4R5cS22BDVzqC5; Wed, 19 Jul 2023 13:41: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 36JDfsTZ045354; Wed, 19 Jul 2023 13:41:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36JDfs6j045347; Wed, 19 Jul 2023 13:41:54 GMT (envelope-from git) Date: Wed, 19 Jul 2023 13:41:54 GMT Message-Id: <202307191341.36JDfs6j045347@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Joseph Mingrone Subject: git: 1a8d37b8cffc - main - pw: Use existing group entry, even if it already has members List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1a8d37b8cffc805626a3954496845b7a14a45bea Auto-Submitted: auto-generated The branch main has been updated by jrm: URL: https://cgit.FreeBSD.org/src/commit/?id=1a8d37b8cffc805626a3954496845b7a14a45bea commit 1a8d37b8cffc805626a3954496845b7a14a45bea Author: Naman Sood AuthorDate: 2023-07-19 13:06:06 +0000 Commit: Joseph Mingrone CommitDate: 2023-07-19 13:40:53 +0000 pw: Use existing group entry, even if it already has members Fix the following problem: 1. A nonexistent user, someuser, is added to /etc/group as someuser:*:12345:someuser. 2. someuser is then created with the default login group. A second group entry for someuser will be created. someuser:*:12345:someuser someuser:*:12346: With this fix, the existing group entry will be used. PR: 238995 Reviewed by: bapt, jrm Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D41057 --- usr.sbin/pw/pw_user.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/usr.sbin/pw/pw_user.c b/usr.sbin/pw/pw_user.c index 9029069c6a9f..3e5a9841c5f3 100644 --- a/usr.sbin/pw/pw_user.c +++ b/usr.sbin/pw/pw_user.c @@ -378,8 +378,7 @@ pw_gidpolicy(struct userconf *cnf, char *grname, char *nam, gid_t prefer, bool d grp = GETGRGID(gid); } gid = grp->gr_gid; - } else if ((grp = GETGRNAM(nam)) != NULL && - (grp->gr_mem == NULL || grp->gr_mem[0] == NULL)) { + } else if ((grp = GETGRNAM(nam)) != NULL) { gid = grp->gr_gid; /* Already created? Use it anyway... */ } else { intmax_t grid = -1; From nobody Wed Jul 19 13:46:20 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5cY8675cz4p1Gm; Wed, 19 Jul 2023 13:46:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R5cY84mQzz4LvY; Wed, 19 Jul 2023 13:46:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689774380; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CvybD3KIoiLYLaYCIFVtGZiben1n6f80ATC6IVR3jeA=; b=tc010b/pPzXaqGiUvkNE09VpwupLRecoNbjZfWaPUqofYupLyt4WYUKMVYpjYNY8URPLOv DSF40NCNSuzQDgOPtZR2nEu73X6oYzYElCLYaNro7vJhN05r3d4RQtslhG1/DExf+CrIbN t2g6Gqm6fx1tY1yOmzUHPpmODHadg7+paZhP1dQGOAVbRsdoAk2NTfCOx9IhkIXDjTCnP5 LHp4H05/aVri2+405jshDJoZe2dFZ99/AXcfmIjupN43BdNiRfRHafvVSRkrpAs4JaZsl2 9uhqiaHHqQft3NKOCW4+48tklz48jK9BDR32IxJVQjYi9avxqRME3DaMAu0zNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689774380; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CvybD3KIoiLYLaYCIFVtGZiben1n6f80ATC6IVR3jeA=; b=seYzI+nWcbav7EhdHIjsl06Xr3R0Hl7x0p7F0jqtDzzx+sSTsipUmEzJQHsbxiydhePfMD /g/XFY6uyoNm58LvxFiLHJm4tuSgjtFhG6G04sYXW2GM80Yk6IxyWcerAkC791TqSY4eDJ MVGU+jjpZDGSa8CMh9OHiscG/J3+euXcW1CDoXcc+tB3KaiAGMvwP4G0TbsIZfq011Xykw CHBuWA+wrI5Gf1Y4zjCYhyWvVwjrMv8cC4W5OvCxv6et3F5vh1RZHw6Jpgvdnq27r+WBM6 bR1QDtBAXCmMZ56EQcvvcv9psJ5RZF6doOQaV6QFEdIqgPmNgUqtg+iu13Dx1g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689774380; a=rsa-sha256; cv=none; b=HEwHO2n4Q5wUMdSu9u84B9crHzLpJz6Lj9fPGiT/CnO7guXzHnnMle32WOLU6Si5botvMb E6l7MhN3DS/9uWroUGuR082ifsR+WQXzRv9/4z24zQsR5RBPCNxVoip4LkXXv8fQOMIk8o /bKWTXB644+6VL9kz3QFUBNi9CGsPZTHNjGhqxDiTXcRbUsJIItJJ0SrEfIgLaumyNB5tO B21tEBOWHO1gfya3VuesJ8k0oAWrxXNkF7uvKgvFlNEN96+F/C+66qRceU6iAXIv/OvPbw tKYnIC1l/0V/YJisAcSSbfIoVHDLFWNGZldNVCgzKlaZ5mgCbaEHuTExWO4caQ== 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 4R5cY83sF2zq5X; Wed, 19 Jul 2023 13:46: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 36JDkKaH050983; Wed, 19 Jul 2023 13:46:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36JDkK7W050982; Wed, 19 Jul 2023 13:46:20 GMT (envelope-from git) Date: Wed, 19 Jul 2023 13:46:20 GMT Message-Id: <202307191346.36JDkK7W050982@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Joseph Mingrone Subject: git: 181692ab0896 - main - pw: Add regression tests for useradd bug fixes List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 181692ab0896637bc174ab3e1ef319991dfa371f Auto-Submitted: auto-generated The branch main has been updated by jrm: URL: https://cgit.FreeBSD.org/src/commit/?id=181692ab0896637bc174ab3e1ef319991dfa371f commit 181692ab0896637bc174ab3e1ef319991dfa371f Author: Naman Sood AuthorDate: 2023-07-19 13:27:14 +0000 Commit: Joseph Mingrone CommitDate: 2023-07-19 13:43:12 +0000 pw: Add regression tests for useradd bug fixes PR: 238995 Reviewed by: jrm Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D41080 --- usr.sbin/pw/tests/pw_useradd_test.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/usr.sbin/pw/tests/pw_useradd_test.sh b/usr.sbin/pw/tests/pw_useradd_test.sh index e9d0a3aa20af..ac24b0df6693 100755 --- a/usr.sbin/pw/tests/pw_useradd_test.sh +++ b/usr.sbin/pw/tests/pw_useradd_test.sh @@ -463,6 +463,29 @@ user_add_conf_defaultpasswd_body() grep defaultpasswd ${HOME}/pw.conf } +atf_test_case user_add_existing_login_group +user_add_existing_login_group_body() +{ + populate_etc_skel + + atf_check -s exit:0 ${PW} groupadd testuser + atf_check -s exit:0 ${PW} useradd user1 -G testuser + atf_check -s exit:0 ${PW} useradd testuser + atf_check -o match:"1" \ + sh -c "grep testuser ${HOME}/group | wc -l" +} + +atf_test_case user_add_already_in_group +user_add_already_in_group_body() +{ + populate_etc_skel + + echo "testgroup:*:4242:testuser" >> ${HOME}/group + atf_check -s exit:0 ${PW} useradd testuser -G testgroup + atf_check -o not-match:"testuser,testuser" \ + grep testuser ${HOME}/group +} + atf_init_test_cases() { atf_add_test_case user_add atf_add_test_case user_add_noupdate @@ -503,4 +526,6 @@ atf_init_test_cases() { atf_add_test_case user_add_defaultgroup atf_add_test_case user_add_conf_defaultpasswd + atf_add_test_case user_add_existing_login_group + atf_add_test_case user_add_already_in_group } From nobody Wed Jul 19 13:52:05 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5cgp2Whtz4dQDJ; Wed, 19 Jul 2023 13:52: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 4R5cgn6kV5z4Ng0; Wed, 19 Jul 2023 13:52:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689774725; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RFbfhXX60PKQzJQsjYEzRYWX00Ucp91wgCYnuvf9GiM=; b=x6OwRP7+03MPT/DIHsIVqlEhxYt+m5pXi7Xllynl9pLiHBTEqudpigHH8vbkNhN/JbF55O aFrtn72+Bi4F0S5plDvpTiGTeKfdO7gempE5/zSlLmm1Ze6vKBkuvsODLXL4g0AwiK1eSe K02WsNIbr/IUocso/LjToN4SLPgfU3Jz/s/OjNxqL8tbgjS3evdL+qOdrVsOmu6eWq17jx wWnEsNHcRNcYfWr9p6tXgQnrg5QQXwiUrp/skPSUyPv4f8bK8wqTxFW6cd9L5SAgGp3T9M AA46bipnL7Lj88iagcX82K60YWbb9RrPCYVKQNUGB704AF3Oa9YVsx1+UMrhEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689774725; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RFbfhXX60PKQzJQsjYEzRYWX00Ucp91wgCYnuvf9GiM=; b=DzGky5mzgN9O3CUjd6yrYY2qoH20Gj8sXw6rhGlBRd3WhNCdyUsikl8dfjvSach6tT/qm4 4YAS91VNZFpkHzcTfFLjomSZSZ42dLa377LuKIuI9n/WOwImcz2dbvSCT2HuKr4HgXbfz4 tYvcPW/1Mdq8RzgecFKn+++qarD6y9NA/cVIaCngdKACKEUxmB5HSYG8OmVEHp2vfHKZIA eiBtJ4ZDtAWF3JMwgtUao40kcSYXNoVeoHnKUF2o48D8yce3QsqIFhZQs1OiWhWNk1NDcD SOoQkOlb3FN6HMouEJHpQPbkCdsPuaQtvVoB3NI2MgdrU38VmvvxlR08gQQg6A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689774725; a=rsa-sha256; cv=none; b=tjadDXX1wtAAiqAmr6HCf4i/njkxoB5lb00ve3p2Rb384JkjIweFqAhZoN+uSQJyY/dFAU w/9ZVj/K1OZxNVgT/hFKTWSM3yntWwz3BOLkQvRVXpsRumw9soYjzAWVpRUhh3QO1/AyEF qQBqfJ2RBuT4SGnAJ1YJCuD3Uln+h4gnmrLk8e1CuAtQPerKYATbbTkBcFAcrs9oQtTo2z vGgIYIeu9JCjtiOGN+yx5IaopuMo/SRreOfJDURWzjcgm9ky9PCoqabsi6+z6/UP1ROOBA nufNf1jS51mHMM9QmACQz9HfUSVM+LXLEN6iE0xS01hErl//5+wOR7NpCYuaqg== 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 4R5cgn5p2gzqVM; Wed, 19 Jul 2023 13:52: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 36JDq5nA066118; Wed, 19 Jul 2023 13:52:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36JDq5Gb066117; Wed, 19 Jul 2023 13:52:05 GMT (envelope-from git) Date: Wed, 19 Jul 2023 13:52:05 GMT Message-Id: <202307191352.36JDq5Gb066117@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Chagin Subject: git: e38c634b77de - main - vfs: Add a parenthese to vn_lock_pair() asserts to silence gcc List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e38c634b77dec76c03613bd84b37ae22d3bb5699 Auto-Submitted: auto-generated The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=e38c634b77dec76c03613bd84b37ae22d3bb5699 commit e38c634b77dec76c03613bd84b37ae22d3bb5699 Author: Dmitry Chagin AuthorDate: 2023-07-19 13:51:07 +0000 Commit: Dmitry Chagin CommitDate: 2023-07-19 13:51:07 +0000 vfs: Add a parenthese to vn_lock_pair() asserts to silence gcc Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D41070 --- sys/kern/vfs_vnops.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index 41a80da75a4f..83e95731d7c4 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -4028,9 +4028,9 @@ vn_lock_pair(struct vnode *vp1, bool vp1_locked, int lkflags1, { int error; - MPASS((lkflags1 & LK_SHARED) != 0 ^ (lkflags1 & LK_EXCLUSIVE) != 0); + MPASS(((lkflags1 & LK_SHARED) != 0) ^ ((lkflags1 & LK_EXCLUSIVE) != 0)); MPASS((lkflags1 & ~(LK_SHARED | LK_EXCLUSIVE | LK_NODDLKTREAT)) == 0); - MPASS((lkflags2 & LK_SHARED) != 0 ^ (lkflags2 & LK_EXCLUSIVE) != 0); + MPASS(((lkflags2 & LK_SHARED) != 0) ^ ((lkflags2 & LK_EXCLUSIVE) != 0)); MPASS((lkflags2 & ~(LK_SHARED | LK_EXCLUSIVE | LK_NODDLKTREAT)) == 0); if (vp1 == NULL && vp2 == NULL) From nobody Wed Jul 19 14:45:21 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5dsF2WJfz4nMYm; Wed, 19 Jul 2023 14:45: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 4R5dsF1QJ8z3R4J; Wed, 19 Jul 2023 14:45:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689777921; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EHQQomC+jud4je8H2wP9zU2PTArOvu3pbI55FlONRyo=; b=fuVEz59Zjvjpxg3Zh4r5BVJilDQhDVbTN/tXFxK8PtyYB7QZNgbtvtQ+7h5p2b0wicTAm5 Cg2FfAt59lIxjnyWAFjJty+z5aQ5T+8IjiZmclNNQ+u9alvH2R95cvZImA51gTjvxug/Wi hsnFnuGaY6Uqevv6veAzz6B59i95knXL2rF0Z3SQvgUB6C1kGJq4QGJtXP3Cpg0Fpibisu oKc1TquLLum5GGViP0UVbgiglnVwhNHAFmbJlfZyoKBFYIySDGLrgHznxEiKzkT12GiCTz H3/P4xDpxqWiZj7nH5gP1oD/3+KrzMBPc2G1FPdQgdAx4r7evBfHiJNxb8U9Bw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689777921; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EHQQomC+jud4je8H2wP9zU2PTArOvu3pbI55FlONRyo=; b=vgE/8CU1WIGAjgw3fLECCn/vSDElekRXyP1MuEglJ3dxh0I0nPV0GNyRQ67Umls5UQssMY cn9+MOPJ4tUff1Z925NPeWRi5im3+QE4OoGKjYJwzhzkiRSs1kLJ+IA084XhWsc26iCQmM HibR48kb6hwmVFpNOr2k0S2aulM3kgIVeRYOi88o1/P0yQ+D9Jdg2jSU4kl9Uk9mCcQ5Sz TcYK4xxNZV+UqkY5lkrDiV+2NaZ2lrQ4vt6qRPpT8vmn9vnsS6XjHFxkKy5I5KhYhOpSeV fjWS9Cm8LkAmiAGsQEXD6Juiwu5OKf/LFkEC/om1wEMNazOtp1++qBNxYWCGiQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689777921; a=rsa-sha256; cv=none; b=n2xCRS5Gk+HnMe6QVIC4E/fb/VGJXV3g/O78RUpCHAcAOmjjdNhIFkq+e6VvEiq7fJfe0T LX1I0xXsR1aVJL3p5ua5zJVV5HTENxyJfhtMz4uhZrwv5efG8ERr/7+Pfl5y2BgmNU5ZgA BQjl+yDGnhXgJqW+1DxR5f5sABqekASRAUKrR9OKgxe+Q4Oo0PTTys/c6VRhyHs+C5+g+g iyUqTHqdhSIhdp4fxWAGZiBk8IYmDoWVcP5Ddx5ycjX7/JFKsijgA4fV5hF3hS+uYN4Ysg iSniE3CAcmJIvuCTUUx6zWE4VCIaUXvsoWEveNJ3IHuCtkQ8zD5YnliKPQlrJQ== 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 4R5dsF0VVJzrGT; Wed, 19 Jul 2023 14:45: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 36JEjLLD049968; Wed, 19 Jul 2023 14:45:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36JEjLsT049967; Wed, 19 Jul 2023 14:45:21 GMT (envelope-from git) Date: Wed, 19 Jul 2023 14:45:21 GMT Message-Id: <202307191445.36JEjLsT049967@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Doug Moore Subject: git: 6f251ef228e6 - main - radix_trie: simplify ge, le lookups List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dougm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6f251ef228e6ea3891cd7364c1e6d161297a2f90 Auto-Submitted: auto-generated The branch main has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=6f251ef228e6ea3891cd7364c1e6d161297a2f90 commit 6f251ef228e6ea3891cd7364c1e6d161297a2f90 Author: Doug Moore AuthorDate: 2023-07-19 14:43:31 +0000 Commit: Doug Moore CommitDate: 2023-07-19 14:43:31 +0000 radix_trie: simplify ge, le lookups Replace the implementations of lookup_le and lookup_ge with ones that do not use a stack or climb back up the tree, and instead exploit the popmap field to quickly identify the place to resume searching if the straightforward indexed search fails. The code size of the original functions shrinks by a combined 160 bytes on amd64, and the cumulative cycle count per invocation of the two functions together is reduced 20% in a buildworld test. Reviewed by: alc, markj Tested by: pho Differential Revision: https://reviews.freebsd.org/D40936 --- sys/kern/subr_pctrie.c | 290 ++++++++++++++++++++----------------------------- sys/vm/vm_radix.c | 285 +++++++++++++++++++----------------------------- 2 files changed, 228 insertions(+), 347 deletions(-) diff --git a/sys/kern/subr_pctrie.c b/sys/kern/subr_pctrie.c index ae8408a6e1ef..4cd7f4b085ba 100644 --- a/sys/kern/subr_pctrie.c +++ b/sys/kern/subr_pctrie.c @@ -472,211 +472,151 @@ pctrie_lookup_unlocked(struct pctrie *ptree, uint64_t index, smr_t smr) } /* - * Look up the nearest entry at a position bigger than or equal to index, - * assuming access is externally synchronized by a lock. + * Returns the value with the least index that is greater than or equal to the + * specified index, or NULL if there are no such values. + * + * Requires that access be externally synchronized by a lock. */ uint64_t * pctrie_lookup_ge(struct pctrie *ptree, uint64_t index) { - struct pctrie_node *stack[PCTRIE_LIMIT]; + struct pctrie_node *node, *succ; uint64_t *m; - struct pctrie_node *child, *node; -#ifdef INVARIANTS - int loops = 0; -#endif - unsigned tos; int slot; + /* + * Descend the trie as if performing an ordinary lookup for the + * specified value. However, unlike an ordinary lookup, as we descend + * the trie, we use "succ" to remember the last branching-off point, + * that is, the interior node under which the least value that is both + * outside our current path down the trie and greater than the specified + * index resides. (The node's popmap makes it fast and easy to + * recognize a branching-off point.) If our ordinary lookup fails to + * yield a value that is greater than or equal to the specified index, + * then we will exit this loop and perform a lookup starting from + * "succ". If "succ" is not NULL, then that lookup is guaranteed to + * succeed. + */ node = pctrie_root_load(ptree, NULL, PCTRIE_LOCKED); - if (node == NULL) - return (NULL); - else if (pctrie_isleaf(node)) { - m = pctrie_toval(node); - if (*m >= index) - return (m); - else - return (NULL); - } - tos = 0; - for (;;) { - /* - * If the keys differ before the current bisection node, - * then the search key might rollback to the earliest - * available bisection node or to the smallest key - * in the current node (if the owner is greater than the - * search key). - */ - if (pctrie_keybarr(node, index)) { - if (index > node->pn_owner) { -ascend: - KASSERT(++loops < 1000, - ("pctrie_lookup_ge: too many loops")); - - /* - * Pop nodes from the stack until either the - * stack is empty or a node that could have a - * matching descendant is found. - */ - do { - if (tos == 0) - return (NULL); - node = stack[--tos]; - } while (pctrie_slot(index, - node->pn_clev) == (PCTRIE_COUNT - 1)); - - /* - * The following computation cannot overflow - * because index's slot at the current level - * is less than PCTRIE_COUNT - 1. - */ - index = pctrie_trimkey(index, - node->pn_clev); - index += PCTRIE_UNITLEVEL(node->pn_clev); - } else - index = node->pn_owner; - KASSERT(!pctrie_keybarr(node, index), - ("pctrie_lookup_ge: keybarr failed")); - } - slot = pctrie_slot(index, node->pn_clev); - child = pctrie_node_load(&node->pn_child[slot], NULL, - PCTRIE_LOCKED); - if (pctrie_isleaf(child)) { - m = pctrie_toval(child); + succ = NULL; + while (node != NULL) { + if (pctrie_isleaf(node)) { + m = pctrie_toval(node); if (*m >= index) return (m); - } else if (child != NULL) - goto descend; - - /* Find the first set bit beyond the first slot+1 bits. */ - slot = ffs(node->pn_popmap & (-2 << slot)) - 1; - if (slot < 0) { + break; + } + if (pctrie_keybarr(node, index)) { /* - * A value or edge greater than the search slot is not - * found in the current node; ascend to the next - * higher-level node. + * If all values in this subtree are > index, then the + * least value in this subtree is the answer. */ - goto ascend; + if (node->pn_owner > index) + succ = node; + break; } - child = pctrie_node_load(&node->pn_child[slot], - NULL, PCTRIE_LOCKED); - KASSERT(child != NULL, ("%s: bad popmap slot %d in node %p", - __func__, slot, node)); - if (pctrie_isleaf(child)) - return (pctrie_toval(child)); - index = pctrie_trimkey(index, node->pn_clev + 1) + - slot * PCTRIE_UNITLEVEL(node->pn_clev); -descend: - KASSERT(node->pn_clev > 0, - ("pctrie_lookup_ge: pushing leaf's parent")); - KASSERT(tos < PCTRIE_LIMIT, - ("pctrie_lookup_ge: stack overflow")); - stack[tos++] = node; - node = child; + slot = pctrie_slot(index, node->pn_clev); + + /* + * Just in case the next search step leads to a subtree of all + * values < index, check popmap to see if a next bigger step, to + * a subtree of all pages with values > index, is available. If + * so, remember to restart the search here. + */ + if ((node->pn_popmap >> slot) > 1) + succ = node; + node = pctrie_node_load(&node->pn_child[slot], NULL, + PCTRIE_LOCKED); } + + /* + * Restart the search from the last place visited in the subtree that + * included some values > index, if there was such a place. + */ + if (succ == NULL) + return (NULL); + if (succ != node) { + /* + * Take a step to the next bigger sibling of the node chosen + * last time. In that subtree, all values > index. + */ + slot = pctrie_slot(index, succ->pn_clev) + 1; + KASSERT((succ->pn_popmap >> slot) != 0, + ("%s: no popmap siblings past slot %d in node %p", + __func__, slot, succ)); + slot += ffs(succ->pn_popmap >> slot) - 1; + succ = pctrie_node_load(&succ->pn_child[slot], NULL, + PCTRIE_LOCKED); + } + + /* + * Find the value in the subtree rooted at "succ" with the least index. + */ + while (!pctrie_isleaf(succ)) { + KASSERT(succ->pn_popmap != 0, + ("%s: no popmap children in node %p", __func__, succ)); + slot = ffs(succ->pn_popmap) - 1; + succ = pctrie_node_load(&succ->pn_child[slot], NULL, + PCTRIE_LOCKED); + } + return (pctrie_toval(succ)); } /* - * Look up the nearest entry at a position less than or equal to index, - * assuming access is externally synchronized by a lock. + * Returns the value with the greatest index that is less than or equal to the + * specified index, or NULL if there are no such values. + * + * Requires that access be externally synchronized by a lock. */ uint64_t * pctrie_lookup_le(struct pctrie *ptree, uint64_t index) { - struct pctrie_node *stack[PCTRIE_LIMIT]; + struct pctrie_node *node, *pred; uint64_t *m; - struct pctrie_node *child, *node; -#ifdef INVARIANTS - int loops = 0; -#endif - unsigned tos; int slot; + /* + * Mirror the implementation of pctrie_lookup_ge, described above. + */ node = pctrie_root_load(ptree, NULL, PCTRIE_LOCKED); - if (node == NULL) - return (NULL); - else if (pctrie_isleaf(node)) { - m = pctrie_toval(node); - if (*m <= index) - return (m); - else - return (NULL); - } - tos = 0; - for (;;) { - /* - * If the keys differ before the current bisection node, - * then the search key might rollback to the earliest - * available bisection node or to the largest key - * in the current node (if the owner is smaller than the - * search key). - */ + pred = NULL; + while (node != NULL) { + if (pctrie_isleaf(node)) { + m = pctrie_toval(node); + if (*m <= index) + return (m); + break; + } if (pctrie_keybarr(node, index)) { - if (index > node->pn_owner) { - index = node->pn_owner + PCTRIE_COUNT * - PCTRIE_UNITLEVEL(node->pn_clev); - } else { -ascend: - KASSERT(++loops < 1000, - ("pctrie_lookup_le: too many loops")); - - /* - * Pop nodes from the stack until either the - * stack is empty or a node that could have a - * matching descendant is found. - */ - do { - if (tos == 0) - return (NULL); - node = stack[--tos]; - } while (pctrie_slot(index, - node->pn_clev) == 0); - - /* - * The following computation cannot overflow - * because index's slot at the current level - * is greater than 0. - */ - index = pctrie_trimkey(index, - node->pn_clev); - } - index--; - KASSERT(!pctrie_keybarr(node, index), - ("pctrie_lookup_le: keybarr failed")); + if (node->pn_owner < index) + pred = node; + break; } slot = pctrie_slot(index, node->pn_clev); - child = pctrie_node_load(&node->pn_child[slot], NULL, + if ((node->pn_popmap & ((1 << slot) - 1)) != 0) + pred = node; + node = pctrie_node_load(&node->pn_child[slot], NULL, + PCTRIE_LOCKED); + } + if (pred == NULL) + return (NULL); + if (pred != node) { + slot = pctrie_slot(index, pred->pn_clev); + KASSERT((pred->pn_popmap & ((1 << slot) - 1)) != 0, + ("%s: no popmap siblings before slot %d in node %p", + __func__, slot, pred)); + slot = fls(pred->pn_popmap & ((1 << slot) - 1)) - 1; + pred = pctrie_node_load(&pred->pn_child[slot], NULL, + PCTRIE_LOCKED); + } + while (!pctrie_isleaf(pred)) { + KASSERT(pred->pn_popmap != 0, + ("%s: no popmap children in node %p", __func__, pred)); + slot = fls(pred->pn_popmap) - 1; + pred = pctrie_node_load(&pred->pn_child[slot], NULL, PCTRIE_LOCKED); - if (pctrie_isleaf(child)) { - m = pctrie_toval(child); - if (*m <= index) - return (m); - } else if (child != NULL) - goto descend; - - /* Find the last set bit among the first slot bits. */ - slot = fls(node->pn_popmap & ((1 << slot) - 1)) - 1; - if (slot < 0) { - /* - * A value or edge smaller than the search slot is not - * found in the current node; ascend to the next - * higher-level node. - */ - goto ascend; - } - child = pctrie_node_load(&node->pn_child[slot], - NULL, PCTRIE_LOCKED); - if (pctrie_isleaf(child)) - return (pctrie_toval(child)); - index = pctrie_trimkey(index, node->pn_clev + 1) + - (slot + 1) * PCTRIE_UNITLEVEL(node->pn_clev) - 1; -descend: - KASSERT(node->pn_clev > 0, - ("pctrie_lookup_le: pushing leaf's parent")); - KASSERT(tos < PCTRIE_LIMIT, - ("pctrie_lookup_le: stack overflow")); - stack[tos++] = node; - node = child; } + return (pctrie_toval(pred)); } /* diff --git a/sys/vm/vm_radix.c b/sys/vm/vm_radix.c index f6bdda70539b..6504d5031460 100644 --- a/sys/vm/vm_radix.c +++ b/sys/vm/vm_radix.c @@ -513,205 +513,146 @@ vm_radix_lookup_unlocked(struct vm_radix *rtree, vm_pindex_t index) } /* - * Look up the nearest entry at a position greater than or equal to index. + * Returns the page with the least pindex that is greater than or equal to the + * specified pindex, or NULL if there are no such pages. + * + * Requires that access be externally synchronized by a lock. */ vm_page_t vm_radix_lookup_ge(struct vm_radix *rtree, vm_pindex_t index) { - struct vm_radix_node *stack[VM_RADIX_LIMIT]; + struct vm_radix_node *rnode, *succ; vm_page_t m; - struct vm_radix_node *child, *rnode; -#ifdef INVARIANTS - int loops = 0; -#endif - int slot, tos; + int slot; + /* + * Descend the trie as if performing an ordinary lookup for the page + * with the specified pindex. However, unlike an ordinary lookup, as we + * descend the trie, we use "succ" to remember the last branching-off + * point, that is, the interior node under which the page with the least + * pindex that is both outside our current path down the trie and more + * than the specified pindex resides. (The node's popmap makes it fast + * and easy to recognize a branching-off point.) If our ordinary lookup + * fails to yield a page with a pindex that is greater than or equal to + * the specified pindex, then we will exit this loop and perform a + * lookup starting from "succ". If "succ" is not NULL, then that lookup + * is guaranteed to succeed. + */ rnode = vm_radix_root_load(rtree, LOCKED); - if (rnode == NULL) - return (NULL); - else if (vm_radix_isleaf(rnode)) { - m = vm_radix_topage(rnode); - if (m->pindex >= index) - return (m); - else - return (NULL); - } - tos = 0; - for (;;) { - /* - * If the keys differ before the current bisection node, - * then the search key might rollback to the earliest - * available bisection node or to the smallest key - * in the current node (if the owner is greater than the - * search key). - */ - if (vm_radix_keybarr(rnode, index)) { - if (index > rnode->rn_owner) { -ascend: - KASSERT(++loops < 1000, - ("vm_radix_lookup_ge: too many loops")); - - /* - * Pop nodes from the stack until either the - * stack is empty or a node that could have a - * matching descendant is found. - */ - do { - if (tos == 0) - return (NULL); - rnode = stack[--tos]; - } while (vm_radix_slot(index, - rnode->rn_clev) == (VM_RADIX_COUNT - 1)); - - /* - * The following computation cannot overflow - * because index's slot at the current level - * is less than VM_RADIX_COUNT - 1. - */ - index = vm_radix_trimkey(index, - rnode->rn_clev); - index += VM_RADIX_UNITLEVEL(rnode->rn_clev); - } else - index = rnode->rn_owner; - KASSERT(!vm_radix_keybarr(rnode, index), - ("vm_radix_lookup_ge: keybarr failed")); - } - slot = vm_radix_slot(index, rnode->rn_clev); - child = vm_radix_node_load(&rnode->rn_child[slot], LOCKED); - if (vm_radix_isleaf(child)) { - m = vm_radix_topage(child); + succ = NULL; + while (rnode != NULL) { + if (vm_radix_isleaf(rnode)) { + m = vm_radix_topage(rnode); if (m->pindex >= index) return (m); - } else if (child != NULL) - goto descend; - - /* Find the first set bit beyond the first slot+1 bits. */ - slot = ffs(rnode->rn_popmap & (-2 << slot)) - 1; - if (slot < 0) { + break; + } + if (vm_radix_keybarr(rnode, index)) { /* - * A page or edge greater than the search slot is not - * found in the current node; ascend to the next - * higher-level node. + * If all pages in this subtree have pindex > index, + * then the page in this subtree with the least pindex + * is the answer. */ - goto ascend; + if (rnode->rn_owner > index) + succ = rnode; + break; } - child = vm_radix_node_load(&rnode->rn_child[slot], LOCKED); - KASSERT(child != NULL, ("%s: bad popmap slot %d in rnode %p", - __func__, slot, rnode)); - if (vm_radix_isleaf(child)) - return (vm_radix_topage(child)); - index = vm_radix_trimkey(index, rnode->rn_clev + 1) + - slot * VM_RADIX_UNITLEVEL(rnode->rn_clev); -descend: - KASSERT(rnode->rn_clev > 0, - ("vm_radix_lookup_ge: pushing leaf's parent")); - KASSERT(tos < VM_RADIX_LIMIT, - ("vm_radix_lookup_ge: stack overflow")); - stack[tos++] = rnode; - rnode = child; + slot = vm_radix_slot(index, rnode->rn_clev); + + /* + * Just in case the next search step leads to a subtree of all + * pages with pindex < index, check popmap to see if a next + * bigger step, to a subtree of all pages with pindex > index, + * is available. If so, remember to restart the search here. + */ + if ((rnode->rn_popmap >> slot) > 1) + succ = rnode; + rnode = vm_radix_node_load(&rnode->rn_child[slot], LOCKED); + } + + /* + * Restart the search from the last place visited in the subtree that + * included some pages with pindex > index, if there was such a place. + */ + if (succ == NULL) + return (NULL); + if (succ != rnode) { + /* + * Take a step to the next bigger sibling of the node chosen + * last time. In that subtree, all pages have pindex > index. + */ + slot = vm_radix_slot(index, succ->rn_clev) + 1; + KASSERT((succ->rn_popmap >> slot) != 0, + ("%s: no popmap siblings past slot %d in node %p", + __func__, slot, succ)); + slot += ffs(succ->rn_popmap >> slot) - 1; + succ = vm_radix_node_load(&succ->rn_child[slot], LOCKED); } + + /* + * Find the page in the subtree rooted at "succ" with the least pindex. + */ + while (!vm_radix_isleaf(succ)) { + KASSERT(succ->rn_popmap != 0, + ("%s: no popmap children in node %p", __func__, succ)); + slot = ffs(succ->rn_popmap) - 1; + succ = vm_radix_node_load(&succ->rn_child[slot], LOCKED); + } + return (vm_radix_topage(succ)); } /* - * Look up the nearest entry at a position less than or equal to index. + * Returns the page with the greatest pindex that is less than or equal to the + * specified pindex, or NULL if there are no such pages. + * + * Requires that access be externally synchronized by a lock. */ vm_page_t vm_radix_lookup_le(struct vm_radix *rtree, vm_pindex_t index) { - struct vm_radix_node *stack[VM_RADIX_LIMIT]; + struct vm_radix_node *pred, *rnode; vm_page_t m; - struct vm_radix_node *child, *rnode; -#ifdef INVARIANTS - int loops = 0; -#endif - int slot, tos; + int slot; + /* + * Mirror the implementation of vm_radix_lookup_ge, described above. + */ rnode = vm_radix_root_load(rtree, LOCKED); - if (rnode == NULL) - return (NULL); - else if (vm_radix_isleaf(rnode)) { - m = vm_radix_topage(rnode); - if (m->pindex <= index) - return (m); - else - return (NULL); - } - tos = 0; - for (;;) { - /* - * If the keys differ before the current bisection node, - * then the search key might rollback to the earliest - * available bisection node or to the largest key - * in the current node (if the owner is smaller than the - * search key). - */ - if (vm_radix_keybarr(rnode, index)) { - if (index > rnode->rn_owner) { - index = rnode->rn_owner + VM_RADIX_COUNT * - VM_RADIX_UNITLEVEL(rnode->rn_clev); - } else { -ascend: - KASSERT(++loops < 1000, - ("vm_radix_lookup_le: too many loops")); - - /* - * Pop nodes from the stack until either the - * stack is empty or a node that could have a - * matching descendant is found. - */ - do { - if (tos == 0) - return (NULL); - rnode = stack[--tos]; - } while (vm_radix_slot(index, - rnode->rn_clev) == 0); - - /* - * The following computation cannot overflow - * because index's slot at the current level - * is greater than 0. - */ - index = vm_radix_trimkey(index, - rnode->rn_clev); - } - index--; - KASSERT(!vm_radix_keybarr(rnode, index), - ("vm_radix_lookup_le: keybarr failed")); - } - slot = vm_radix_slot(index, rnode->rn_clev); - child = vm_radix_node_load(&rnode->rn_child[slot], LOCKED); - if (vm_radix_isleaf(child)) { - m = vm_radix_topage(child); + pred = NULL; + while (rnode != NULL) { + if (vm_radix_isleaf(rnode)) { + m = vm_radix_topage(rnode); if (m->pindex <= index) return (m); - } else if (child != NULL) - goto descend; - - /* Find the last set bit among the first slot bits. */ - slot = fls(rnode->rn_popmap & ((1 << slot) - 1)) - 1; - if (slot < 0) { - /* - * A page or edge smaller than the search slot is not - * found in the current node; ascend to the next - * higher-level node. - */ - goto ascend; + break; } - child = vm_radix_node_load(&rnode->rn_child[slot], LOCKED); - KASSERT(child != NULL, ("%s: bad popmap slot %d in rnode %p", - __func__, slot, rnode)); - if (vm_radix_isleaf(child)) - return (vm_radix_topage(child)); - index = vm_radix_trimkey(index, rnode->rn_clev + 1) + - (slot + 1) * VM_RADIX_UNITLEVEL(rnode->rn_clev) - 1; -descend: - KASSERT(rnode->rn_clev > 0, - ("vm_radix_lookup_le: pushing leaf's parent")); - KASSERT(tos < VM_RADIX_LIMIT, - ("vm_radix_lookup_le: stack overflow")); - stack[tos++] = rnode; - rnode = child; + if (vm_radix_keybarr(rnode, index)) { + if (rnode->rn_owner < index) + pred = rnode; + break; + } + slot = vm_radix_slot(index, rnode->rn_clev); + if ((rnode->rn_popmap & ((1 << slot) - 1)) != 0) + pred = rnode; + rnode = vm_radix_node_load(&rnode->rn_child[slot], LOCKED); + } + if (pred == NULL) + return (NULL); + if (pred != rnode) { + slot = vm_radix_slot(index, pred->rn_clev); + KASSERT((pred->rn_popmap & ((1 << slot) - 1)) != 0, + ("%s: no popmap siblings before slot %d in node %p", + __func__, slot, pred)); + slot = fls(pred->rn_popmap & ((1 << slot) - 1)) - 1; + pred = vm_radix_node_load(&pred->rn_child[slot], LOCKED); + } + while (!vm_radix_isleaf(pred)) { + KASSERT(pred->rn_popmap != 0, + ("%s: no popmap children in node %p", __func__, pred)); + slot = fls(pred->rn_popmap) - 1; + pred = vm_radix_node_load(&pred->rn_child[slot], LOCKED); } + return (vm_radix_topage(pred)); } /* From nobody Wed Jul 19 14:47:46 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5dw31cqdz4nNnH; Wed, 19 Jul 2023 14:47: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 4R5dw308Wrz3hKB; Wed, 19 Jul 2023 14:47:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689778067; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7B8qOsge/rSMeVraufGPBGhEqzFIzT5ViYsba3UBhuY=; b=wtDI1JHJNPA3+bE7kBlPMYGHhxfibzYVZk9FhTmQ373em6xHRRV5Gvx8z20X2AuOnN2iWh xwC0rjURMTFnX/otct0lyOJsjPsuBvyjviSeIfQo9kyfjywrTWZKESgJ3KvmTkxNYNOk8m lh0LYVu98Hxb73Rtzd5VsmiTGbfOZeJ8+iDFlvxDZEoLchfe14d0q2T+3Yd2+JWklkyaRH 5uLJ0h441ZnjujVK5Ddnwaohmdo5DXo+ExVHUAKcXnTbdb2lounuM+Ng0j5JltoJwG3Fo2 tD42CWBzzEY3r4kNjpibLQRyMilQktqB4Vnd+PAaLo9h56BpiYedhRMLzhLiZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689778067; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7B8qOsge/rSMeVraufGPBGhEqzFIzT5ViYsba3UBhuY=; b=F0M8A6HyNB/4KisuYJ+7Re+yVo/MDTef69tVRNQ/HkcD63cpe3ZP/mUEmBQRedlipRaTUC OpUUMNZ3UfAkPy8y8Rf/7qSuNvL73wY4U1YoPtzOaGoEfTjAj4SBMylM1qmVLMR2jOVvay pKJzOWVF6Knbh7s9Ueqaw/ODf/bIjEy+IRZU6mRhR66dMeZ+4JseaGdrmzdRmXbYU/QCOs MvAUWyf4OdzBTnWtAYeKubRojTwR97TQo8/1qVim3BFa7LVKXm5DDeRRva0/ZUFO2kvz1P 3gZ7aSPZFAWl9XnQmyQsxHh1rV38KJRJ+qszoMxBTKbtuN9Q2UN2QyCsafMvnA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689778067; a=rsa-sha256; cv=none; b=nro/F9NyRYQifSCpob28D9XC6yXahcmJ8fZJQ22KSbzzcasWLn0ALa7UAsHYM5mImUfaMU qepm/fpY/O1ggWtN1MSP6tfPzswHNc9lsyDault2oL08gfA3uAZELzr28NtP73NcXBbbGd 7cRSY3wEFF+x3fUWF74MCDOKw4T3Y7K5zCm7AEZ2LOibKPqLWpX+NH5slb45/1C8O835JR omk8r/wozbYTnisLABqeLl/2TXEnKyjVdTz8JYJ5i7nxI9UGS89aaXgCaBkkeJsWpug9kW 2OrJ19cVbtVUr1YXIKY3fqx2z/KvBIOZy+qZkYuvQs+ETohrqgo218dyUTa4Xw== 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 4R5dw26KD1zqwD; Wed, 19 Jul 2023 14:47: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 36JElkXm050423; Wed, 19 Jul 2023 14:47:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36JElkmF050422; Wed, 19 Jul 2023 14:47:46 GMT (envelope-from git) Date: Wed, 19 Jul 2023 14:47:46 GMT Message-Id: <202307191447.36JElkmF050422@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Dag-Erling=20Sm=C3=B8rgrav?= Subject: git: a122c3c49278 - main - unifdef: Fix case where a multiline comment follows a directive. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: a122c3c49278f8247296fdc1c097129e4862e472 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=a122c3c49278f8247296fdc1c097129e4862e472 commit a122c3c49278f8247296fdc1c097129e4862e472 Author: Dag-Erling Smørgrav AuthorDate: 2023-07-19 14:25:56 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-07-19 14:47:23 +0000 unifdef: Fix case where a multiline comment follows a directive. Sponsored by: Klara, Inc. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D41026 --- usr.bin/unifdef/tests/Makefile | 1 + usr.bin/unifdef/tests/unifdef_test.sh | 22 ++++++++++++++++++++++ usr.bin/unifdef/unifdef.c | 5 +++-- 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/usr.bin/unifdef/tests/Makefile b/usr.bin/unifdef/tests/Makefile index ddcfbdc6146e..a27c58285c20 100644 --- a/usr.bin/unifdef/tests/Makefile +++ b/usr.bin/unifdef/tests/Makefile @@ -2,6 +2,7 @@ PACKAGE= tests +ATF_TESTS_SH= unifdef_test NETBSD_ATF_TESTS_SH= basic_test ${PACKAGE}FILES+= d_basic.in diff --git a/usr.bin/unifdef/tests/unifdef_test.sh b/usr.bin/unifdef/tests/unifdef_test.sh new file mode 100644 index 000000000000..98adef3adfdc --- /dev/null +++ b/usr.bin/unifdef/tests/unifdef_test.sh @@ -0,0 +1,22 @@ +# +# Copyright (c) 2023 Klara, Inc. +# +# SPDX-License-Identifier: BSD-2-Clause +# + +atf_test_case hash_comment +hash_comment_head() { + atf_set descr "multiline comment follows directive" +} +hash_comment_body() { + cat >f < To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 8ada3f78e68f - main - kinst.h: reorder function declarations based on implementation file List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 8ada3f78e68fe8827d6c84e9fd5f808f93984ca7 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=8ada3f78e68fe8827d6c84e9fd5f808f93984ca7 commit 8ada3f78e68fe8827d6c84e9fd5f808f93984ca7 Author: Christos Margiolis AuthorDate: 2023-07-19 14:50:24 +0000 Commit: Christos Margiolis CommitDate: 2023-07-19 14:50:24 +0000 kinst.h: reorder function declarations based on implementation file Reviewed by: markj Approved by: markj (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D41032 --- sys/cddl/dev/kinst/kinst.h | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/sys/cddl/dev/kinst/kinst.h b/sys/cddl/dev/kinst/kinst.h index d2ccac50595c..0a47eb4f3583 100644 --- a/sys/cddl/dev/kinst/kinst.h +++ b/sys/cddl/dev/kinst/kinst.h @@ -50,23 +50,26 @@ extern struct kinst_probe_list *kinst_probetab; struct linker_file; struct linker_symval; +/* kinst.c */ volatile void *kinst_memcpy(volatile void *, volatile const void *, size_t); bool kinst_excluded(const char *); -bool kinst_md_excluded(const char *); +void kinst_probe_create(struct kinst_probe *, struct linker_file *); + +/* arch/kinst_isa.c */ int kinst_invop(uintptr_t, struct trapframe *, uintptr_t); +void kinst_patch_tracepoint(struct kinst_probe *, kinst_patchval_t); int kinst_make_probe(struct linker_file *, int, struct linker_symval *, void *); -void kinst_patch_tracepoint(struct kinst_probe *, kinst_patchval_t); -void kinst_probe_create(struct kinst_probe *, struct linker_file *); +int kinst_md_init(void); +void kinst_md_deinit(void); +bool kinst_md_excluded(const char *); +/* trampoline.c */ int kinst_trampoline_init(void); int kinst_trampoline_deinit(void); uint8_t *kinst_trampoline_alloc(int); void kinst_trampoline_dealloc(uint8_t *); -int kinst_md_init(void); -void kinst_md_deinit(void); - #ifdef MALLOC_DECLARE MALLOC_DECLARE(M_KINST); #endif /* MALLOC_DECLARE */ From nobody Wed Jul 19 14:59:49 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5f9y20Dyz4nTh0; Wed, 19 Jul 2023 14:59: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 4R5f9x6kBYz3mPK; Wed, 19 Jul 2023 14:59:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689778789; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RVEU1qaprwaIDKYo3ahxXr0n5/BXwBWKOEafAfkjjrU=; b=TfMy7m5EZT7Z/9GZhgYdSydFw/8MTmjln0nUJleJPqtrxYveXuj9uhXCbBqQyANX3/4/HW gxnaZYfHmnuSfeMvbtsdZ+q06FpVXROldjMWPgnMqreLNlpuQwIgXGMfoDqURNRkh/Lv1s 1kpSJykCUbugLsxk8XyMisTlPzTY2kbX7MmzHRcRceVas/5ln1EdSWpdiR8hLziqFnCo/T a3zULWoXvcJP3SUQbGSPEgCV0aidSRQ+einlaVe6jLkkHkFCWgBDuGfDks861klZB+m3n6 pl3DaHI3/oe7yHwIBmHCqJ1vrIOWd2OsSI73G5+SJaKyFpUXVt8RlHTMRVh9sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689778789; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RVEU1qaprwaIDKYo3ahxXr0n5/BXwBWKOEafAfkjjrU=; b=AU7xk0WS7Mv7aCHuDjRppsousE4bc6NvC2kyztQuGxA/urzEOapN1QRQEPpA2eHejZtetx z51DzYsP+TBHiH4dAfRmWIr+j2DIwshIKKlTHy5IrYZjXAyYjsq9kJA23cpoL4IlYeChWv ax0uxPdyjr2Vnf3bGlBMRpdxzXJudo3gyNNDPz93/PnNmlDN7Vv1YLGHrdVc80UDhpX5/t QUcH6BbrFH1VK1U1zXisWQ2Ds7rDIVIiVbvMgXKnTzMJu5SdOX6Yhgy9rNE9X1lmRuAHg1 Cagvcef5Y/RMgG0im+2VYCdwVA9mei06w4853uGF4ZVbRQY4S8tVHUjGoD39yQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689778789; a=rsa-sha256; cv=none; b=nWwk/EywZdviBcSu/212yPyi299I6keG+WWnlmCAYm067zTqI5Hmu1jQZWWjhxk2MqeTrs 8FcLHfiRzzNWkBmSG15uWvFx3tO3S309THUro6L72FUzorkCyklStA4/duIdpah27JdUGo Lq6VzkSCGbAvF8QzO/49xM7EAORztpecwBrQsaj2ZbRCaThKlML8WYGubnaE4e0xZbvuPy M0Hj85ja6HiDJM/fkg05e2ST3/P1XoRiW/ELCcNQLirMXgbzBjN1xnq+ptuxjporAPvB0e 8KozcjoupUInEbZiyhfh2eLyUNmQXU0kDbeXO4d8UQM+QBCAr5mdLC9FNFuBYw== 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 4R5f9x5QDXzrh6; Wed, 19 Jul 2023 14:59: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 36JExn7M067548; Wed, 19 Jul 2023 14:59:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36JExn2c067547; Wed, 19 Jul 2023 14:59:49 GMT (envelope-from git) Date: Wed, 19 Jul 2023 14:59:49 GMT Message-Id: <202307191459.36JExn2c067547@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: ea89133dbc5f - main - kinst: check for 'push %rbp' anywhere in the function List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: ea89133dbc5f29cbb8db48ecc09a47ea22d8aa9e Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=ea89133dbc5f29cbb8db48ecc09a47ea22d8aa9e commit ea89133dbc5f29cbb8db48ecc09a47ea22d8aa9e Author: Christos Margiolis AuthorDate: 2023-07-19 14:53:08 +0000 Commit: Christos Margiolis CommitDate: 2023-07-19 14:53:08 +0000 kinst: check for 'push %rbp' anywhere in the function Currently kinst checks if only the first instruction is 'push %rbp', essentially excluding functions that do push RBP, but not in the first instruction. This patch modifies kinst to check for 'push %rbp', as well, as a following 'pop %rbp', anywhere in the function. This behavior also matches that of FBT. Reviewed by: markj Approved by: markj (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D40283 --- sys/cddl/dev/kinst/amd64/kinst_isa.c | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/sys/cddl/dev/kinst/amd64/kinst_isa.c b/sys/cddl/dev/kinst/amd64/kinst_isa.c index 908dc79e9247..398f30a281c0 100644 --- a/sys/cddl/dev/kinst/amd64/kinst_isa.c +++ b/sys/cddl/dev/kinst/amd64/kinst_isa.c @@ -22,6 +22,7 @@ #include "kinst.h" #define KINST_PUSHL_RBP 0x55 +#define KINST_POPL_RBP 0x5d #define KINST_STI 0xfb #define KINST_POPF 0x9d @@ -500,7 +501,8 @@ kinst_make_probe(linker_file_t lf, int symindx, linker_symval_t *symval, dtrace_kinst_probedesc_t *pd; const char *func; int error, instrsize, n, off; - uint8_t *instr, *limit; + uint8_t *instr, *limit, *tmp; + bool push_found, pop_found; pd = opaque; func = symval->name; @@ -515,12 +517,21 @@ kinst_make_probe(linker_file_t lf, int symindx, linker_symval_t *symval, return (0); /* - * Ignore functions not beginning with the usual function prologue. - * These might correspond to exception handlers with which we should not - * meddle. This does however exclude functions which can be safely - * traced, such as cpu_switch(). + * Refuse to instrument functions lacking the usual frame pointer + * manipulations since they might correspond to exception handlers. */ - if (*instr != KINST_PUSHL_RBP) + tmp = instr; + push_found = pop_found = false; + while (tmp < limit) { + if (*tmp == KINST_PUSHL_RBP) + push_found = true; + else if (*tmp == KINST_POPL_RBP) + pop_found = true; + if (push_found && pop_found) + break; + tmp += dtrace_instr_size(tmp); + } + if (!push_found || !pop_found) return (0); n = 0; From nobody Wed Jul 19 14:59:50 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5f9z4Cm9z4nTrg; Wed, 19 Jul 2023 14:59: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 4R5f9z0RC1z3mGw; Wed, 19 Jul 2023 14:59:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689778791; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sSnmx454LLSwzoQykkb2JmPYYG/owJK1XDfiBLWU6go=; b=RCWobkb7N6gTPua71la5Z9J9dr/hnBRJTJ2co+qyMsTtaVier5ZpVn3z3hkPqKPDxD1YMS UbTNELkHiTUIFhg+E/T8SWENH1bPDPlMVYnlMTxg3tKmSl4m7klxrz87yb4aoFjiLYNyaO YyX98jw4Z97///C398hOdklZebj7sfsrENneVII8Uy3H7fazzo75mftDWUwDptRWU/EvGT KGOAdPTr0fOhgDHC5qw6uP/FsjIk4/L9L6sXkzEUfIq7wohke35vWyhZdtjo1+yw8NQUue KLRyVumlYsl6QjtbDHR+wJK2apZpEHc1XrIx5J4LNvd9LDTeY+6LZgs+GSaGvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689778791; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sSnmx454LLSwzoQykkb2JmPYYG/owJK1XDfiBLWU6go=; b=k/w11jROki3T8FoLeXMYGggkJz070DIxGvWI97UuYSf+vxJdwhDuK6iRFkzhheR+tJ5s9+ c5n4STmQU4JeNn4bEnSjEA5W72aPxkgH0TlWdQzWD2W74ss7ikTu/YriY0xa1MXU7QwbKU aWgP1+HCcnTrUytVKm5X2RMhptRrQadbmASQgBDmeftf60i7KSZWmyo0pRnE9bp1Vcfzdz bb6SOTR6S2eupAaMiAHoC/i4WJzsl9rjDPv4eWrZBk144Ef57hWH3icH0FlQQrAk3/N1pp H3zL8CfCy93VaTrP/ajS5yr1VHQcFtmTCsZKCf6gBxDBnOXksPObDOngyyVFMQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689778791; a=rsa-sha256; cv=none; b=vrOhNl9UPOcjgsSWBSjbY5wFy4nHtdXR52l2WjD4ntGlJZ9PW3DTpQd+sHWNc+XoYsVQRp cWmRyTTnZsb3UkEmcfR4CECfzUzZfEFITOgLtONZx97omZCiRgNDu7goJ4pzvRes2ja6Gf Wgffg59/aokHEAOKumDOHiqXfdniuszeEez5FcReaKM4m5BGLX9KdIazz4uwoPQXENLyiS eJsYyYSP/foqqo5fuBU0oA5MOMFIXGOKSJQInrr0HL4eZD62Ihdg9KAmUkob1edhdL1Tqr EXAzsGXtTVIRMMepfuFRdjKi5xiGrVP4S8yd+jSIXT3PjaXA8UXdLCT6k2Nwkg== 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 4R5f9y6MK8zrwR; Wed, 19 Jul 2023 14:59: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 36JExo8f067567; Wed, 19 Jul 2023 14:59:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36JExoaw067566; Wed, 19 Jul 2023 14:59:50 GMT (envelope-from git) Date: Wed, 19 Jul 2023 14:59:50 GMT Message-Id: <202307191459.36JExoaw067566@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: eb1413c9a6c7 - main - kinst: exclude cpu_switch List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: eb1413c9a6c785920421664dedd8e5c23fd89834 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=eb1413c9a6c785920421664dedd8e5c23fd89834 commit eb1413c9a6c785920421664dedd8e5c23fd89834 Author: Christos Margiolis AuthorDate: 2023-07-19 14:56:29 +0000 Commit: Christos Margiolis CommitDate: 2023-07-19 14:56:29 +0000 kinst: exclude cpu_switch Reviewed by: markj Approved by: markj (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D40985 --- sys/cddl/dev/kinst/kinst.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sys/cddl/dev/kinst/kinst.c b/sys/cddl/dev/kinst/kinst.c index 1c5b4372055d..4bd3047f49db 100644 --- a/sys/cddl/dev/kinst/kinst.c +++ b/sys/cddl/dev/kinst/kinst.c @@ -96,6 +96,13 @@ kinst_excluded(const char *name) if (kinst_md_excluded(name)) return (true); + /* + * cpu_switch() can cause a crash if it modifies the value of curthread + * while in probe context. + */ + if (strcmp(name, "cpu_switch") == 0) + return (true); + /* * Anything beginning with "dtrace_" may be called from probe context * unless it explicitly indicates that it won't be called from probe From nobody Wed Jul 19 14:59:51 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5fB02PSjz4nTkF; Wed, 19 Jul 2023 14:59: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 4R5fB01Dfgz3mN1; Wed, 19 Jul 2023 14:59:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689778792; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EhWSKzhZ5cgUmfAgm+55T1ACqrZgbmXcwp6anuwaaiI=; b=aBnZIGPawlhbNiKTUaG+dqR37Aq8bVXtSlbXuRrMrM3seSDuKAAccjZiZ8qbuwWwQq9hxC LpJqVK5enbCT+qsoHiqPAwpMrdqbtt1oChAxGJTQ0pLmID3aQoyfAys/WZt4YxAe0cI1gt 4on2+0UE5feopvHEwu62Q5ZGvH9+Gjpvv+iMvkXBcWh8PSApl02zJbaJXCFmON1yPwee+Q huMuZUId/gvkCUR2jbIAtHBWcLuBQ+Mnay03mEnS5JNF4BjrvG9qmFgdQF/5TC7o/bic6M 8xLfX+1Kn6yoet0+bSR3mRwf/6SaKmRFNsP4pSHgA6zydQkxSDZHJbX2d6TfUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689778792; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EhWSKzhZ5cgUmfAgm+55T1ACqrZgbmXcwp6anuwaaiI=; b=pJXgni6z/Tf7mvd3NCSj4Rol4tj69E7RxTfEs/uj3aa2Mx1nUCwxdY5aI9GqXRr2EIeaer W3Z2pBfCmUaUaXLudh1YytSP5I2o174SnhfKUeiyyN65bkC+PKWWlypc/kdyYAGPoubLxw byQ8pCZdGEU3UNjS/Smjq4wNxCI+toAv9lh6+rMmHIYg/EFQUIJLrAlrEtAj05pGPxYV2G XGJXVrdR7Xr7cym9ELGrVIZZqLXgAd2ZEfg/p2QQabF51dzqDFXxvfwqo62GjxZ1uLTQDF jFe1ZfizBtw6Zdh6fSIXmSxWqO1vzkdQ870VXE1W2BxcpLx0yfZm5JBoSLzxXg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689778792; a=rsa-sha256; cv=none; b=rXMSU0phZllOQ+D7CLhy7toDt9t1GCe30p707VKXFsjmNofFD3/UTYVhZa0yD0diTvymJJ xfImvYjU060IphpRcQQq1Z+leHhWQx+Ybby399th10RnNZJNmOK46G+yG1CXI0XnZYgLBO /n8CxevJ+kENYXroQtBS/1z/FMhToiBWsRfyg59RLxFkqERQQ5EsXGjzEkniYJNTcOuM8K uY146qmF47lQLwGHdlK7iTpdaf6R/cqNB+Rv2ljgpuVrHrtmazz16mT0bEkwVIyCFbaJMD PuIeiRs2k55gYmJQFk7rNvAn3rDaqUlI4zY6v/yEF/fipepBnuYN39Ihajco5g== 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 4R5fB00B9Szs6s; Wed, 19 Jul 2023 14:59: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 36JExpeC067586; Wed, 19 Jul 2023 14:59:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36JExpHT067585; Wed, 19 Jul 2023 14:59:51 GMT (envelope-from git) Date: Wed, 19 Jul 2023 14:59:51 GMT Message-Id: <202307191459.36JExpHT067585@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 5b701ed19c2e - main - kinst: start moving towards per-probe trampolines List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 5b701ed19c2ed439457b0177681472aac21fde94 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=5b701ed19c2ed439457b0177681472aac21fde94 commit 5b701ed19c2ed439457b0177681472aac21fde94 Author: Christos Margiolis AuthorDate: 2023-07-19 14:57:21 +0000 Commit: Christos Margiolis CommitDate: 2023-07-19 14:57:21 +0000 kinst: start moving towards per-probe trampolines Using per-CPU and per-thread trampolines is expensive and error-prone, since we're rewriting the same memory blocks constantly. Per-probe trampolines solve this problem by giving each probe its own block of executable memory, which more or less remains the same after the initial write. What this patch does, is get rid of the initialization code which allocates a trampoline for each thread, and instead let each port of kinst allocate a trampoline for each new probe created. It also sets up the infrastructure needed to support the new trampoline scheme. This change is not currently supported on amd64, as the amd64 port needs further changes to work, so this is a temporary/gradual patch to fix the riscv and arm64 ports. Reviewed by: markj Approved by: markj (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D40962 --- sys/cddl/dev/kinst/kinst.c | 3 +++ sys/cddl/dev/kinst/kinst.h | 28 ++++++++++++++++++++++++++++ sys/cddl/dev/kinst/trampoline.c | 35 ++++++++++++++++++++++++++++++----- 3 files changed, 61 insertions(+), 5 deletions(-) diff --git a/sys/cddl/dev/kinst/kinst.c b/sys/cddl/dev/kinst/kinst.c index 4bd3047f49db..60400a452b95 100644 --- a/sys/cddl/dev/kinst/kinst.c +++ b/sys/cddl/dev/kinst/kinst.c @@ -228,6 +228,9 @@ kinst_destroy(void *arg, dtrace_id_t id, void *parg) struct kinst_probe *kp = parg; LIST_REMOVE(kp, kp_hashnext); +#ifndef __amd64__ + kinst_trampoline_dealloc(kp->kp_tramp); +#endif free(kp, M_KINST); } diff --git a/sys/cddl/dev/kinst/kinst.h b/sys/cddl/dev/kinst/kinst.h index 0a47eb4f3583..390a2d1c13bf 100644 --- a/sys/cddl/dev/kinst/kinst.h +++ b/sys/cddl/dev/kinst/kinst.h @@ -35,10 +35,38 @@ struct kinst_probe { kinst_patchval_t kp_patchval; kinst_patchval_t kp_savedval; kinst_patchval_t *kp_patchpoint; + uint8_t *kp_tramp; struct kinst_probe_md kp_md; }; +struct kinst_cpu_state { + /* + * kinst uses a breakpoint to return from the trampoline and resume + * execution. To do this safely, kinst implements a per-CPU state + * machine; the state is set to KINST_PROBE_FIRED for the duration of + * the trampoline execution (i.e from the time we transfer execution to + * it, until we return). Upon return, the state is set to + * KINST_PROBE_ARMED to indicate that a probe is not currently firing. + * All CPUs have their state initialized to KINST_PROBE_ARMED when + * kinst is loaded. + */ + enum { + KINST_PROBE_ARMED, + KINST_PROBE_FIRED, + } state; + /* + * Points to the probe whose trampoline we're currently executing. + */ + struct kinst_probe *kp; + /* + * Because we execute trampolines with interrupts disabled, we have to + * cache the CPU's status in order to restore it when we return from + * the trampoline. + */ + uint64_t status; +}; + LIST_HEAD(kinst_probe_list, kinst_probe); extern struct kinst_probe_list *kinst_probetab; diff --git a/sys/cddl/dev/kinst/trampoline.c b/sys/cddl/dev/kinst/trampoline.c index 87c01e39745b..adc4eaa7fceb 100644 --- a/sys/cddl/dev/kinst/trampoline.c +++ b/sys/cddl/dev/kinst/trampoline.c @@ -49,8 +49,10 @@ static TAILQ_HEAD(, trampchunk) kinst_trampchunks = TAILQ_HEAD_INITIALIZER(kinst_trampchunks); static struct sx kinst_tramp_sx; SX_SYSINIT(kinst_tramp_sx, &kinst_tramp_sx, "kinst tramp"); +#ifdef __amd64__ static eventhandler_tag kinst_thread_ctor_handler; static eventhandler_tag kinst_thread_dtor_handler; +#endif /* * Fill the trampolines with KINST_TRAMP_FILL_PATTERN so that the kernel will @@ -150,12 +152,14 @@ kinst_trampoline_alloc_locked(int how) if ((how & M_NOWAIT) != 0) return (NULL); - /* - * We didn't find any free trampoline in the current list, - * allocate a new one. If that fails the provider will no - * longer be reliable, so try to warn the user. - */ if ((chunk = kinst_trampchunk_alloc()) == NULL) { +#ifdef __amd64__ + /* + * We didn't find any free trampoline in the current + * list, allocate a new one. If that fails the + * provider will no longer be reliable, so try to warn + * the user. + */ static bool once = true; if (once) { @@ -164,6 +168,7 @@ kinst_trampoline_alloc_locked(int how) "kinst: failed to allocate trampoline, " "probes may not fire"); } +#endif return (NULL); } off = 0; @@ -220,6 +225,7 @@ kinst_trampoline_dealloc(uint8_t *tramp) sx_xunlock(&kinst_tramp_sx); } +#ifdef __amd64__ static void kinst_thread_ctor(void *arg __unused, struct thread *td) { @@ -240,10 +246,12 @@ kinst_thread_dtor(void *arg __unused, struct thread *td) */ kinst_trampoline_dealloc(tramp); } +#endif int kinst_trampoline_init(void) { +#ifdef __amd64__ struct proc *p; struct thread *td; void *tramp; @@ -296,12 +304,21 @@ retry: out: sx_xunlock(&kinst_tramp_sx); sx_sunlock(&allproc_lock); +#else + int error = 0; + + sx_xlock(&kinst_tramp_sx); + TAILQ_INIT(&kinst_trampchunks); + sx_xunlock(&kinst_tramp_sx); +#endif + return (error); } int kinst_trampoline_deinit(void) { +#ifdef __amd64__ struct trampchunk *chunk, *tmp; struct proc *p; struct thread *td; @@ -324,6 +341,14 @@ kinst_trampoline_deinit(void) TAILQ_FOREACH_SAFE(chunk, &kinst_trampchunks, next, tmp) kinst_trampchunk_free(chunk); sx_xunlock(&kinst_tramp_sx); +#else + struct trampchunk *chunk, *tmp; + + sx_xlock(&kinst_tramp_sx); + TAILQ_FOREACH_SAFE(chunk, &kinst_trampchunks, next, tmp) + kinst_trampchunk_free(chunk); + sx_xunlock(&kinst_tramp_sx); +#endif return (0); } From nobody Wed Jul 19 14:59:53 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5fB12jktz4nTrq; Wed, 19 Jul 2023 14:59: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 4R5fB11k5pz3mVs; Wed, 19 Jul 2023 14:59:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689778793; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uT3jS0eyj8/neeZRFzOHMtVKF6XaNb2kIjVDRs5xnOU=; b=YWKPJC6rjPg0o6Kk5sqXd4lVSjkMQFYNi0qFqIzuMeHEDuLf5PWCN1BbDo0P850pbh6WuU 07fdUGxAHa8ufu+5RrurAcGkNLrjMmlgWzgOgr1h//sy+E10VNiYVXbEDlyU1R+KNSSQNP eB5PP5kWUNKwpdLefbfLqXP7Jaw/HDoPHBYV7QkCboIkgIojB3b6NzhJduvV3zTzLEjrAb p39fE6/uEMl8uEN2Bp/QipXp8xhDI42iRJ+T1ne1z6xT3rgloNvzqdt1PJ6KYkc4Wwp6kx e2A6hR4wvQsjHC+FOBAL9GtXY9/bpWpamvyknviO8kAmy4dXX+mdBCMdTEeu9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689778793; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uT3jS0eyj8/neeZRFzOHMtVKF6XaNb2kIjVDRs5xnOU=; b=TVWvxA64fFyJTV/HqsVFrsAgpd8S0DxQpICQVLUzJ7JOfb/H/YF3nrHA6SrCvcGbjAa/jb JcFd+zd1+fKD+WsbymemIyYaepFTixqBUQVuu8L+iGD+z5GNUBbs2LiB8HGkLjkW++gLLr J5YQs2lgi8Z/2gLB2QGZrvch5QUcmGym3CGktM8gv0IgbJd4N46LmaKNklVq1iuf8MAC58 P0ffRGtHwmdump+yRnTW4w1yhz1JWhVpSrHz/MrnD4ofnw2KIY7rgf2dvhNYntJBLErYeS pmbM+r+QKEt71eyjnkeY9Y0VyOUX49Cauqu2pIiM0AM7LLcCuGzhF5BJRiSgAA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689778793; a=rsa-sha256; cv=none; b=gQK63FL5LStsw5z8BNjOyAt95Ln30wrczZBm7u14YUaJjoI+5xPqu2uRk/5+wI2CKF7wK/ ToOe841wGLV5rvbTq6S+OgSZbHj+Br81jNH5nnuOlFDRjYbNVXPFDANfQf31cwSwU0VnsA mSnTiOpiW4c5MKMwPfJLU2td2W1r9P5UzAby5J+X4wm1MCLP6bwTP/pf2P2FiwZF+/+CE9 QDZL5xMXC/4NiUut64T9keXKBQLUmpjfm7yEWuF53qnS48+Ntb4dTlg+c9ZNwIawCCvIf6 xXM0I8SOPmp/n3aCGnXCrrpVVW+P9skJwkoqEx30tIFTuZ8coY1YFTBAq3yK+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 4R5fB10pzBzrkH; Wed, 19 Jul 2023 14:59:53 +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 36JExrSs067605; Wed, 19 Jul 2023 14:59:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36JExr0H067604; Wed, 19 Jul 2023 14:59:53 GMT (envelope-from git) Date: Wed, 19 Jul 2023 14:59:53 GMT Message-Id: <202307191459.36JExr0H067604@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 2517b2085b58 - main - kinst: use per-probe trampolines in riscv List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 2517b2085b58e0ca4837faecd94b91ad80872547 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=2517b2085b58e0ca4837faecd94b91ad80872547 commit 2517b2085b58e0ca4837faecd94b91ad80872547 Author: Christos Margiolis AuthorDate: 2023-07-19 14:57:59 +0000 Commit: Christos Margiolis CommitDate: 2023-07-19 14:57:59 +0000 kinst: use per-probe trampolines in riscv Reviewed by: markj Approved by: markj (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D40963 --- sys/cddl/dev/kinst/riscv/kinst_isa.c | 113 +++++++++++++---------------------- 1 file changed, 42 insertions(+), 71 deletions(-) diff --git a/sys/cddl/dev/kinst/riscv/kinst_isa.c b/sys/cddl/dev/kinst/riscv/kinst_isa.c index 8bd4449a027a..9c1f4a239f83 100644 --- a/sys/cddl/dev/kinst/riscv/kinst_isa.c +++ b/sys/cddl/dev/kinst/riscv/kinst_isa.c @@ -14,20 +14,7 @@ #include "kinst.h" -/* - * Per-CPU trampolines used when the interrupted thread is executing with - * interrupts disabled. If an interrupt is raised while executing a trampoline, - * the interrupt thread cannot safely overwrite its trampoline if it hits a - * kinst probe while executing the interrupt handler. - */ -DPCPU_DEFINE_STATIC(uint8_t *, intr_tramp); - -/* - * The double-breakpoint mechanism needs to save the current probe for the next - * call to kinst_invop(). As with per-CPU trampolines, this also has to be done - * per-CPU when interrupts are disabled. - */ -DPCPU_DEFINE_STATIC(struct kinst_probe *, intr_probe); +DPCPU_DEFINE_STATIC(struct kinst_cpu_state, kinst_state); #define _MATCH_REG(reg) \ (offsetof(struct trapframe, tf_ ## reg) / sizeof(register_t)) @@ -78,7 +65,7 @@ kinst_c_regoff(struct trapframe *frame, int n) #undef _MATCH_REG static int -kinst_emulate(struct trapframe *frame, struct kinst_probe *kp) +kinst_emulate(struct trapframe *frame, const struct kinst_probe *kp) { kinst_patchval_t instr = kp->kp_savedval; register_t prevpc; @@ -244,23 +231,23 @@ kinst_emulate(struct trapframe *frame, struct kinst_probe *kp) } static int -kinst_jump_next_instr(struct trapframe *frame, struct kinst_probe *kp) +kinst_jump_next_instr(struct trapframe *frame, const struct kinst_probe *kp) { - frame->tf_sepc = (register_t)((uint8_t *)kp->kp_patchpoint + + frame->tf_sepc = (register_t)((const uint8_t *)kp->kp_patchpoint + kp->kp_md.instlen); return (MATCH_C_NOP); } static void -kinst_trampoline_populate(struct kinst_probe *kp, uint8_t *tramp) +kinst_trampoline_populate(struct kinst_probe *kp) { static uint16_t nop = MATCH_C_NOP; static uint32_t ebreak = MATCH_EBREAK; int ilen; ilen = kp->kp_md.instlen; - kinst_memcpy(tramp, &kp->kp_savedval, ilen); + kinst_memcpy(kp->kp_tramp, &kp->kp_savedval, ilen); /* * Since we cannot encode large displacements in a single instruction @@ -273,9 +260,9 @@ kinst_trampoline_populate(struct kinst_probe *kp, uint8_t *tramp) * Add a NOP after a compressed instruction for padding. */ if (ilen == INSN_C_SIZE) - kinst_memcpy(&tramp[ilen], &nop, INSN_C_SIZE); + kinst_memcpy(&kp->kp_tramp[ilen], &nop, INSN_C_SIZE); - kinst_memcpy(&tramp[INSN_SIZE], &ebreak, INSN_SIZE); + kinst_memcpy(&kp->kp_tramp[INSN_SIZE], &ebreak, INSN_SIZE); fence_i(); } @@ -306,27 +293,26 @@ int kinst_invop(uintptr_t addr, struct trapframe *frame, uintptr_t scratch) { solaris_cpu_t *cpu; - struct kinst_probe *kp; - uint8_t *tramp; + struct kinst_cpu_state *ks; + const struct kinst_probe *kp; - /* - * Use per-CPU trampolines and probes if the thread executing the - * instruction was executing with interrupts disabled. - */ - if ((frame->tf_sstatus & SSTATUS_SPIE) == 0) { - tramp = DPCPU_GET(intr_tramp); - kp = DPCPU_GET(intr_probe); - } else { - tramp = curthread->t_kinst_tramp; - kp = curthread->t_kinst_curprobe; - } + ks = DPCPU_PTR(kinst_state); /* * Detect if the breakpoint was triggered by the trampoline, and * manually set the PC to the next instruction. */ - if (addr == (uintptr_t)(tramp + INSN_SIZE)) - return (kinst_jump_next_instr(frame, kp)); + if (ks->state == KINST_PROBE_FIRED && + addr == (uintptr_t)(ks->kp->kp_tramp + INSN_SIZE)) { + /* + * Restore interrupts if they were enabled prior to the first + * breakpoint. + */ + if ((ks->status & SSTATUS_SPIE) != 0) + frame->tf_sstatus |= SSTATUS_SPIE; + ks->state = KINST_PROBE_ARMED; + return (kinst_jump_next_instr(frame, ks->kp)); + } LIST_FOREACH(kp, KINST_GETPROBE(addr), kp_hashnext) { if ((uintptr_t)kp->kp_patchpoint == addr) @@ -343,26 +329,16 @@ kinst_invop(uintptr_t addr, struct trapframe *frame, uintptr_t scratch) if (kp->kp_md.emulate) return (kinst_emulate(frame, kp)); - if (tramp == NULL) { - /* - * A trampoline allocation failed, so this probe is - * effectively disabled. Restore the original - * instruction. - * - * We can't safely print anything here, but the - * trampoline allocator should have left a breadcrumb in - * the dmesg. - */ - kinst_patch_tracepoint(kp, kp->kp_savedval); - frame->tf_sepc = (register_t)kp->kp_patchpoint; - } else { - kinst_trampoline_populate(kp, tramp); - frame->tf_sepc = (register_t)tramp; - if ((frame->tf_sstatus & SSTATUS_SPIE) == 0) - DPCPU_SET(intr_probe, kp); - else - curthread->t_kinst_curprobe = kp; - } + ks->state = KINST_PROBE_FIRED; + ks->kp = kp; + + /* + * Cache the current SSTATUS and clear interrupts for the + * duration of the double breakpoint. + */ + ks->status = frame->tf_sstatus; + frame->tf_sstatus &= ~SSTATUS_SPIE; + frame->tf_sepc = (register_t)kp->kp_tramp; return (MATCH_C_NOP); } @@ -427,6 +403,9 @@ kinst_instr_dissect(struct kinst_probe *kp, int instrsize) break; } } + + if (!kpmd->emulate) + kinst_trampoline_populate(kp); } static bool @@ -556,6 +535,10 @@ kinst_make_probe(linker_file_t lf, int symindx, linker_symval_t *symval, kp->kp_patchval = KINST_PATCHVAL; else kp->kp_patchval = KINST_C_PATCHVAL; + if ((kp->kp_tramp = kinst_trampoline_alloc(M_WAITOK)) == NULL) { + KINST_LOG("cannot allocate trampoline for %p", instr); + return (ENOMEM); + } kinst_instr_dissect(kp, instrsize); kinst_probe_create(kp, lf); @@ -571,14 +554,12 @@ cont: int kinst_md_init(void) { - uint8_t *tramp; + struct kinst_cpu_state *ks; int cpu; CPU_FOREACH(cpu) { - tramp = kinst_trampoline_alloc(M_WAITOK); - if (tramp == NULL) - return (ENOMEM); - DPCPU_ID_SET(cpu, intr_tramp, tramp); + ks = DPCPU_PTR(kinst_state); + ks->state = KINST_PROBE_ARMED; } return (0); @@ -587,16 +568,6 @@ kinst_md_init(void) void kinst_md_deinit(void) { - uint8_t *tramp; - int cpu; - - CPU_FOREACH(cpu) { - tramp = DPCPU_ID_GET(cpu, intr_tramp); - if (tramp != NULL) { - kinst_trampoline_dealloc(tramp); - DPCPU_ID_SET(cpu, intr_tramp, NULL); - } - } } /* From nobody Wed Jul 19 14:59:54 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5fB23tQ0z4nThW; Wed, 19 Jul 2023 14:59: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 4R5fB22fTQz3mkd; Wed, 19 Jul 2023 14:59:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689778794; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qFKVei4bXd+wBNcybx2Gwbm4iwkJMeP351Y8qeFUKYs=; b=jL7lQBTkmFSQjXahxW+W0g8zy7W3HMtAgxQw69v42FBMygCXuopvpjpX5SwhGqqYicXN3Q A08nlZpZi+g2ClD6FeNAh3PoI2XSWcvr5Zq6u+ooIO0Q8A4m5BdCjjGHcjnSv3ptF0MQof otCQ8qKbZNfFi0aZkBb8t1mnEwGzrUFiPonAHgAzBwexwwNweMYU5OWt1TwhjFM6BaXM+7 iELAp4PqwpzgCNvt/QE7LvjOeLTNV94M8eI4YzkPbV4pzrWVm5FYnoioHgLN+bLi4PJTtP tQFaTXMoZf6nXZnX3PImE/89k9rrnaDLcp2XZwhh20PuJHUey2htWIFnGmcX/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689778794; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qFKVei4bXd+wBNcybx2Gwbm4iwkJMeP351Y8qeFUKYs=; b=XceWer4iAV1xY103m8pDFvpInV1J0y0Ji+YrWnXcM11a7P1ekVl7yuE39r7GZC6Y+eW9rZ 7B/y6jaUVXHpcJwjdfxJ0g2UdVFqnh2/ihQT8VaAPoOH/oBTYuTdrvdjphKphUkRt9rXEB 9ApLRXZi+nLfzJTbwWc1IY38a5Nthytb8q+z4LGbmGnQ4xkgz3fpGvY5eeli6enKb+Y/PU 39XE9xW5US9ZyiR7HaYbIpfH56Vl+wbfgSf0LE+xvL2qeMtCggoxDg39UmR5mP2MsuYN6r WbbwS2IArZR9x3UUQ+F/1DJa2sxghUG67cUBIVJz5wG3uFF24D+daYrzzitB1A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689778794; a=rsa-sha256; cv=none; b=XD7iMlqMIDD9yjrtViD6tvZCRhrJpm6jZwt0ghaRa6zmsmKZZ9GEUVkXfrCgtwISNBPeec jpzkiMpwPE6BhjFbOYRMi1X8QlkeShvd/Qgg1vhCu+pillVTTGJO4OOepMy8RsTLMTBS47 R1y35xLo25bI6u/mHGmoqPBPwAMve83xRYrFp5MtT1l9G7pQFh40HVZQbw1s1OiJ6XxyR8 N7v/l44n5T/Rx/iPfKgHdSqIH8jXtbZ0jLg7ZR6wNKuPtf6tn41imJCrcR3++acYLHQUY/ LMcNOgFO4man7942OzhKYINqeemUwAzdD7Tt6frDmJ/YZx07ZDWKQwr5CCh2Qg== 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 4R5fB21lYtzrh7; Wed, 19 Jul 2023 14:59: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 36JExstZ067624; Wed, 19 Jul 2023 14:59:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36JExsm8067623; Wed, 19 Jul 2023 14:59:54 GMT (envelope-from git) Date: Wed, 19 Jul 2023 14:59:54 GMT Message-Id: <202307191459.36JExsm8067623@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 07864a8a2466 - main - kinst: port to arm64 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 07864a8a2466b8ab3d6fa6623a7eaaf0834c0b51 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=07864a8a2466b8ab3d6fa6623a7eaaf0834c0b51 commit 07864a8a2466b8ab3d6fa6623a7eaaf0834c0b51 Author: Christos Margiolis AuthorDate: 2023-07-19 14:58:18 +0000 Commit: Christos Margiolis CommitDate: 2023-07-19 14:58:18 +0000 kinst: port to arm64 Reviewed by: markj Approved by: markj (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D40337 --- sys/cddl/dev/kinst/aarch64/kinst_isa.c | 455 +++++++++++++++++++++++++++++++++ sys/cddl/dev/kinst/aarch64/kinst_isa.h | 26 ++ sys/modules/dtrace/Makefile | 2 +- 3 files changed, 482 insertions(+), 1 deletion(-) diff --git a/sys/cddl/dev/kinst/aarch64/kinst_isa.c b/sys/cddl/dev/kinst/aarch64/kinst_isa.c new file mode 100644 index 000000000000..bf3ab1d35de3 --- /dev/null +++ b/sys/cddl/dev/kinst/aarch64/kinst_isa.c @@ -0,0 +1,455 @@ +/* + * SPDX-License-Identifier: CDDL 1.0 + * + * Copyright (c) 2022 Christos Margiolis + * Copyright (c) 2022 Mark Johnston + * Copyright (c) 2023 The FreeBSD Foundation + * + * Portions of this software were developed by Christos Margiolis + * under sponsorship from the FreeBSD Foundation. + */ + +#include + +#include +#include + +#include "kinst.h" + +DPCPU_DEFINE_STATIC(struct kinst_cpu_state, kinst_state); + +static int +kinst_emulate(struct trapframe *frame, const struct kinst_probe *kp) +{ + kinst_patchval_t instr = kp->kp_savedval; + uint64_t imm; + uint8_t cond, reg, bitpos; + bool res; + + if (((instr >> 24) & 0x1f) == 0b10000) { + /* adr/adrp */ + reg = instr & 0x1f; + imm = (instr >> 29) & 0x3; + imm |= ((instr >> 5) & 0x0007ffff) << 2; + if (((instr >> 31) & 0x1) == 0) { + /* adr */ + if (imm & 0x0000000000100000) + imm |= 0xfffffffffff00000; + frame->tf_x[reg] = frame->tf_elr + imm; + } else { + /* adrp */ + imm <<= 12; + if (imm & 0x0000000100000000) + imm |= 0xffffffff00000000; + frame->tf_x[reg] = (frame->tf_elr & ~0xfff) + imm; + } + frame->tf_elr += INSN_SIZE; + } else if (((instr >> 26) & 0x3f) == 0b000101) { + /* b */ + imm = instr & 0x03ffffff; + if (imm & 0x0000000002000000) + imm |= 0xfffffffffe000000; + frame->tf_elr += imm << 2; + } else if (((instr >> 24) & 0xff) == 0b01010100) { + /* b.cond */ + imm = (instr >> 5) & 0x0007ffff; + if (imm & 0x0000000000040000) + imm |= 0xfffffffffffc0000; + cond = instr & 0xf; + switch ((cond >> 1) & 0x7) { + case 0b000: /* eq/ne */ + res = (frame->tf_spsr & PSR_Z) != 0; + break; + case 0b001: /* cs/cc */ + res = (frame->tf_spsr & PSR_C) != 0; + break; + case 0b010: /* mi/pl */ + res = (frame->tf_spsr & PSR_N) != 0; + break; + case 0b011: /* vs/vc */ + res = (frame->tf_spsr & PSR_V) != 0; + break; + case 0b100: /* hi/ls */ + res = ((frame->tf_spsr & PSR_C) != 0) && + ((frame->tf_spsr & PSR_Z) == 0); + break; + case 0b101: /* ge/lt */ + res = ((frame->tf_spsr & PSR_N) != 0) == + ((frame->tf_spsr & PSR_V) != 0); + break; + case 0b110: /* gt/le */ + res = ((frame->tf_spsr & PSR_Z) == 0) && + (((frame->tf_spsr & PSR_N) != 0) == + ((frame->tf_spsr & PSR_V) != 0)); + break; + case 0b111: /* al */ + res = 1; + break; + } + if ((cond & 0x1) && cond != 0b1111) + res = !res; + if (res) + frame->tf_elr += imm << 2; + else + frame->tf_elr += INSN_SIZE; + } else if (((instr >> 26) & 0x3f) == 0b100101) { + /* bl */ + imm = instr & 0x03ffffff; + if (imm & 0x0000000002000000) + imm |= 0xfffffffffe000000; + frame->tf_lr = frame->tf_elr + INSN_SIZE; + frame->tf_elr += imm << 2; + } else if (((instr >> 25) & 0x3f) == 0b011010) { + /* cbnz/cbz */ + cond = (instr >> 24) & 0x1; + reg = instr & 0x1f; + imm = (instr >> 5) & 0x0007ffff; + if (imm & 0x0000000000040000) + imm |= 0xfffffffffffc0000; + if (cond == 1 && frame->tf_x[reg] != 0) + /* cbnz */ + frame->tf_elr += imm << 2; + else if (cond == 0 && frame->tf_x[reg] == 0) + /* cbz */ + frame->tf_elr += imm << 2; + else + frame->tf_elr += INSN_SIZE; + } else if (((instr >> 25) & 0x3f) == 0b011011) { + /* tbnz/tbz */ + cond = (instr >> 24) & 0x1; + reg = instr & 0x1f; + bitpos = (instr >> 19) & 0x1f; + bitpos |= ((instr >> 31) & 0x1) << 5; + imm = (instr >> 5) & 0x3fff; + if (imm & 0x0000000000002000) + imm |= 0xffffffffffffe000; + if (cond == 1 && (frame->tf_x[reg] & (1 << bitpos)) != 0) + /* tbnz */ + frame->tf_elr += imm << 2; + else if (cond == 0 && (frame->tf_x[reg] & (1 << bitpos)) == 0) + /* tbz */ + frame->tf_elr += imm << 2; + else + frame->tf_elr += INSN_SIZE; + } + + return (0); +} + +static int +kinst_jump_next_instr(struct trapframe *frame, const struct kinst_probe *kp) +{ + frame->tf_elr = (register_t)((const uint8_t *)kp->kp_patchpoint + + INSN_SIZE); + + return (0); +} + +static void +kinst_trampoline_populate(struct kinst_probe *kp) +{ + static uint32_t bpt = KINST_PATCHVAL; + + kinst_memcpy(kp->kp_tramp, &kp->kp_savedval, INSN_SIZE); + kinst_memcpy(&kp->kp_tramp[INSN_SIZE], &bpt, INSN_SIZE); + + cpu_icache_sync_range((vm_offset_t)kp->kp_tramp, + (vm_size_t)KINST_TRAMP_SIZE); +} + +/* + * There are two ways by which an instruction is traced: + * + * - By using the trampoline. + * - By emulating it in software (see kinst_emulate()). + * + * The trampoline is used for instructions that can be copied and executed + * as-is without additional modification. However, instructions that use + * PC-relative addressing have to be emulated, because ARM64 doesn't allow + * encoding of large displacements in a single instruction, and since we cannot + * clobber a register in order to encode the two-instruction sequence needed to + * create large displacements, we cannot use the trampoline at all. + * Fortunately, the instructions are simple enough to be emulated in just a few + * lines of code. + * + * The problem discussed above also means that, unlike amd64, we cannot encode + * a far-jump back from the trampoline to the next instruction. The mechanism + * employed to achieve this functionality, is to use a breakpoint instead of a + * jump after the copied instruction. This breakpoint is detected and handled + * by kinst_invop(), which performs the jump back to the next instruction + * manually (see kinst_jump_next_instr()). + */ +int +kinst_invop(uintptr_t addr, struct trapframe *frame, uintptr_t scratch) +{ + solaris_cpu_t *cpu; + struct kinst_cpu_state *ks; + const struct kinst_probe *kp; + + ks = DPCPU_PTR(kinst_state); + + /* + * Detect if the breakpoint was triggered by the trampoline, and + * manually set the PC to the next instruction. + */ + if (ks->state == KINST_PROBE_FIRED && + addr == (uintptr_t)(ks->kp->kp_tramp + INSN_SIZE)) { + /* + * Restore interrupts if they were enabled prior to the first + * breakpoint. + */ + if ((ks->status & PSR_I) == 0) + frame->tf_spsr &= ~PSR_I; + ks->state = KINST_PROBE_ARMED; + return (kinst_jump_next_instr(frame, ks->kp)); + } + + LIST_FOREACH(kp, KINST_GETPROBE(addr), kp_hashnext) { + if ((uintptr_t)kp->kp_patchpoint == addr) + break; + } + if (kp == NULL) + return (0); + + cpu = &solaris_cpu[curcpu]; + cpu->cpu_dtrace_caller = addr; + dtrace_probe(kp->kp_id, 0, 0, 0, 0, 0); + cpu->cpu_dtrace_caller = 0; + + if (kp->kp_md.emulate) + return (kinst_emulate(frame, kp)); + + ks->state = KINST_PROBE_FIRED; + ks->kp = kp; + + /* + * Cache the current SPSR and clear interrupts for the duration + * of the double breakpoint. + */ + ks->status = frame->tf_spsr; + frame->tf_spsr |= PSR_I; + frame->tf_elr = (register_t)kp->kp_tramp; + + return (0); +} + +void +kinst_patch_tracepoint(struct kinst_probe *kp, kinst_patchval_t val) +{ + vm_offset_t addr; + + if (!arm64_get_writable_addr((vm_offset_t)kp->kp_patchpoint, &addr)) + panic("%s: Unable to write new instruction", __func__); + *(kinst_patchval_t *)addr = val; + cpu_icache_sync_range((vm_offset_t)kp->kp_patchpoint, + (vm_size_t)INSN_SIZE); +} + +static void +kinst_instr_dissect(struct kinst_probe *kp) +{ + struct kinst_probe_md *kpmd; + kinst_patchval_t instr = kp->kp_savedval; + + kpmd = &kp->kp_md; + kpmd->emulate = false; + + if (((instr >> 24) & 0x1f) == 0b10000) + kpmd->emulate = true; /* adr/adrp */ + else if (((instr >> 26) & 0x3f) == 0b000101) + kpmd->emulate = true; /* b */ + else if (((instr >> 24) & 0xff) == 0b01010100) + kpmd->emulate = true; /* b.cond */ + else if (((instr >> 26) & 0x3f) == 0b100101) + kpmd->emulate = true; /* bl */ + else if (((instr >> 25) & 0x3f) == 0b011010) + kpmd->emulate = true; /* cbnz/cbz */ + else if (((instr >> 25) & 0x3f) == 0b011011) + kpmd->emulate = true; /* tbnz/tbz */ + + if (!kpmd->emulate) + kinst_trampoline_populate(kp); +} + +static bool +kinst_instr_ldx(kinst_patchval_t instr) +{ + if (((instr >> 22) & 0xff) == 0b00100001) + return (true); + + return (false); +} + +static bool +kinst_instr_stx(kinst_patchval_t instr) +{ + if (((instr >> 22) & 0xff) == 0b00100000) + return (true); + + return (false); +} + +int +kinst_make_probe(linker_file_t lf, int symindx, linker_symval_t *symval, + void *opaque) +{ + struct kinst_probe *kp; + dtrace_kinst_probedesc_t *pd; + const char *func; + kinst_patchval_t *instr, *limit, *tmp; + int n, off; + bool ldxstx_block, found; + + pd = opaque; + func = symval->name; + + if (kinst_excluded(func)) + return (0); + if (strcmp(func, pd->kpd_func) != 0) + return (0); + + instr = (kinst_patchval_t *)(symval->value); + limit = (kinst_patchval_t *)(symval->value + symval->size); + if (instr >= limit) + return (0); + + tmp = instr; + + /* + * Ignore any bti instruction at the start of the function + * we need to keep it there for any indirect branches calling + * the function on Armv8.5+ + */ + if ((*tmp & BTI_MASK) == BTI_INSTR) + tmp++; + + /* Look for stp (pre-indexed) operation */ + found = false; + + /* + * If the first instruction is a nop it's a specially marked + * asm function. We only support a nop first as it's not a normal + * part of the function prologue. + */ + if (*tmp == NOP_INSTR) + found = true; + for (; !found && tmp < limit; tmp++) { + /* + * Functions start with "stp xt1, xt2, [xn, ]!" or + * "sub sp, sp, ". + * + * Sometimes the compiler will have a sub instruction that is + * not of the above type so don't stop if we see one. + */ + if ((*tmp & LDP_STP_MASK) == STP_64) { + /* + * Assume any other store of this type means we are + * past the function prolog. + */ + if (((*tmp >> ADDR_SHIFT) & ADDR_MASK) == 31) + found = true; + } else if ((*tmp & SUB_MASK) == SUB_INSTR && + ((*tmp >> SUB_RD_SHIFT) & SUB_R_MASK) == 31 && + ((*tmp >> SUB_RN_SHIFT) & SUB_R_MASK) == 31) + found = true; + } + + if (!found) + return (0); + + ldxstx_block = false; + for (n = 0; instr < limit; instr++) { + off = (int)((uint8_t *)instr - (uint8_t *)symval->value); + + /* + * Skip LDX/STX blocks that contain atomic operations. If a + * breakpoint is placed in a LDX/STX block, we violate the + * operation and the loop might fail. + */ + if (kinst_instr_ldx(*instr)) + ldxstx_block = true; + else if (kinst_instr_stx(*instr)) { + ldxstx_block = false; + continue; + } + if (ldxstx_block) + continue; + + /* + * XXX: Skip ADR and ADRP instructions. The arm64 exception + * handler has a micro-optimization where it doesn't restore + * callee-saved registers when returning from exceptions in + * EL1. This results in a panic when the kinst emulation code + * modifies one of those registers. + */ + if (((*instr >> 24) & 0x1f) == 0b10000) + continue; + + if (pd->kpd_off != -1 && off != pd->kpd_off) + continue; + + /* + * Prevent separate dtrace(1) instances from creating copies of + * the same probe. + */ + LIST_FOREACH(kp, KINST_GETPROBE(instr), kp_hashnext) { + if (strcmp(kp->kp_func, func) == 0 && + strtol(kp->kp_name, NULL, 10) == off) + return (0); + } + if (++n > KINST_PROBETAB_MAX) { + KINST_LOG("probe list full: %d entries", n); + return (ENOMEM); + } + kp = malloc(sizeof(struct kinst_probe), M_KINST, + M_WAITOK | M_ZERO); + kp->kp_func = func; + snprintf(kp->kp_name, sizeof(kp->kp_name), "%d", off); + kp->kp_patchpoint = instr; + kp->kp_savedval = *instr; + kp->kp_patchval = KINST_PATCHVAL; + if ((kp->kp_tramp = kinst_trampoline_alloc(M_WAITOK)) == NULL) { + KINST_LOG("cannot allocate trampoline for %p", instr); + return (ENOMEM); + } + + kinst_instr_dissect(kp); + kinst_probe_create(kp, lf); + } + if (ldxstx_block) + KINST_LOG("warning: unterminated LDX/STX block"); + + return (0); +} + +int +kinst_md_init(void) +{ + struct kinst_cpu_state *ks; + int cpu; + + CPU_FOREACH(cpu) { + ks = DPCPU_PTR(kinst_state); + ks->state = KINST_PROBE_ARMED; + } + + return (0); +} + +void +kinst_md_deinit(void) +{ +} + +/* + * Exclude machine-dependent functions that are not safe-to-trace. + */ +bool +kinst_md_excluded(const char *name) +{ + if (strcmp(name, "handle_el1h_sync") == 0 || + strcmp(name, "do_el1h_sync") == 0) + return (true); + + return (false); +} diff --git a/sys/cddl/dev/kinst/aarch64/kinst_isa.h b/sys/cddl/dev/kinst/aarch64/kinst_isa.h new file mode 100644 index 000000000000..7e1fd8d123e9 --- /dev/null +++ b/sys/cddl/dev/kinst/aarch64/kinst_isa.h @@ -0,0 +1,26 @@ +/* + * SPDX-License-Identifier: CDDL 1.0 + * + * Copyright (c) 2023 The FreeBSD Foundation + * + * This software was developed by Christos Margiolis + * under sponsorship from the FreeBSD Foundation. + */ + +#ifndef _KINST_ISA_H_ +#define _KINST_ISA_H_ + +#define KINST_PATCHVAL DTRACE_PATCHVAL + +/* + * The trampoline contains [instruction, brk]. + */ +#define KINST_TRAMP_SIZE 8 + +typedef uint32_t kinst_patchval_t; + +struct kinst_probe_md { + bool emulate; /* emulate in sw */ +}; + +#endif /* _KINST_ISA_H_ */ diff --git a/sys/modules/dtrace/Makefile b/sys/modules/dtrace/Makefile index e38e2687e8a7..73bbbff80640 100644 --- a/sys/modules/dtrace/Makefile +++ b/sys/modules/dtrace/Makefile @@ -21,7 +21,7 @@ SUBDIR+= fasttrap systrace_linux SUBDIR+= systrace_linux32 SUBDIR+= kinst .endif -.if ${MACHINE_CPUARCH} == "riscv" +.if ${MACHINE_CPUARCH} == "riscv" || ${MACHINE_CPUARCH} == "aarch64" SUBDIR+= kinst .endif .if ${MACHINE_CPUARCH} == "powerpc" From nobody Wed Jul 19 14:59:55 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5fB34ZZGz4nTf2; Wed, 19 Jul 2023 14:59: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 4R5fB33YR9z3mcQ; Wed, 19 Jul 2023 14:59:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689778795; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GR73p0vKXrA8KeKG4f4KHgoffnfXopKfrq04uzO0fS8=; b=JamImZFJ9fuTcfOcIWaIWVbwv0zsFJWzeCr/HM92ojLJvfqb1714TocHnnfWsWSzzG8DdY repf9vpqvq+p5m39xptDVXdkZl70tnq7ODWIX8x/RoAewhcoKGZnwzTRNwpeQgg97Qfp5E w7GbcpqM0d+5sUrUoXYONWdoCYR6Rx2oonMpUAdsFCCTLkhsJfvJ9nLD9g7Dz9p5ViNi4A nRsyZGvPivfowYmlrHvcDVBfe05bhLLQfj8RHk3b8CzDOV08T1CBPOW//K63rrmZI8q3r/ ahmY1xI07yWqwURd6b49p2fenZ3b022H7FyP0A5dhv30dJC7FfgH9m/aJNzjvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689778795; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GR73p0vKXrA8KeKG4f4KHgoffnfXopKfrq04uzO0fS8=; b=k20jWc6YIxrYDR8qoSRk4ObkFs7EFZ1FA6Qg8xa+AXJ70yUg93dhuojN+VJnA5iStoo4C4 RaxZ8XccIb0dpTvSdRUkNzvlDsp7hoOMXmNX1bBQk028DogwRZrd8W/NPocw3zp0bGo6fy QaWh2oCJdcpuqnkZmUMwIL+HmsUeNHKVktF7yRFqWLkTPwk9qtko/vvlund7pCKi1Q824G BKCi94KE9vjf+G5dY5/VvQ6xYZPuHuCmYlZ7lnoa2rfs5P7taA4Ea5wa0WD35BTMQ5yOU+ ln/zRX6Ubj1XgrPLkawfU3se8XmQL7YxSGTNQo2cc2IP8fNvdFScVHq3CQe8OA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689778795; a=rsa-sha256; cv=none; b=jr53wfR+fvj/YDmTeiUP+kg4s1QfIdsYZ4T1eecBm9GuaRLs2Es3yMKLHP8qjngYdBBHMy jI++3qgllH68lu3XYERRhALPyKixoLsJ+6WIRZI7zOm7qC+//pA/grUmokKh7gRqjEI2+x W58S6jYxsob5ewGMi1r52/+CrlYbOYCmLMOHFV8BxxWBLz6EL8H1Vs/whgc6otg4jsV+9x 6XOD4QKS2Ig3Ue/tKp0zwkCeFDPYv8XXO7n7+DsBvqXFwVeOZPF0FKKPeHzYOvWZyqkraR yANgct21zD/87dvqcYvCph9PaWlTlpjnHGzoBItOuRDU2WZyIbNRCkQPZExZaw== 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 4R5fB32gV2zs51; Wed, 19 Jul 2023 14:59: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 36JExtTV067649; Wed, 19 Jul 2023 14:59:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36JExt3J067647; Wed, 19 Jul 2023 14:59:55 GMT (envelope-from git) Date: Wed, 19 Jul 2023 14:59:55 GMT Message-Id: <202307191459.36JExt3J067647@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: e967a9a5d5da - main - Revert "dtrace: cache current probe in kdtrace_thread_t" List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: e967a9a5d5da7762a0c6832ea36b8ccfe3b33ca2 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=e967a9a5d5da7762a0c6832ea36b8ccfe3b33ca2 commit e967a9a5d5da7762a0c6832ea36b8ccfe3b33ca2 Author: Christos Margiolis AuthorDate: 2023-07-19 14:58:49 +0000 Commit: Christos Margiolis CommitDate: 2023-07-19 14:58:49 +0000 Revert "dtrace: cache current probe in kdtrace_thread_t" This reverts commit 22508c8b6c284ad9ad1385c703e224e1ed3fbd7c. The t_kinst_curprobe field is no longer needed by kinst. Reviewed by: markj Approved by: markj (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D41031 --- sys/cddl/dev/dtrace/dtrace_cddl.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/cddl/dev/dtrace/dtrace_cddl.h b/sys/cddl/dev/dtrace/dtrace_cddl.h index 6a4aba15bfab..720c231bfca8 100644 --- a/sys/cddl/dev/dtrace/dtrace_cddl.h +++ b/sys/cddl/dev/dtrace/dtrace_cddl.h @@ -89,7 +89,6 @@ typedef struct kdtrace_thread { uint64_t td_fasttrap_tp_gen; /* Tracepoint hash table gen. */ struct trapframe *td_dtrace_trapframe; /* Trap frame from invop. */ void *td_kinst_tramp; - void *td_kinst_curprobe; } kdtrace_thread_t; /* @@ -120,7 +119,6 @@ typedef struct kdtrace_thread { #define t_fasttrap_tp_gen td_dtrace->td_fasttrap_tp_gen #define t_dtrace_trapframe td_dtrace->td_dtrace_trapframe #define t_kinst_tramp td_dtrace->td_kinst_tramp -#define t_kinst_curprobe td_dtrace->td_kinst_curprobe #define p_dtrace_helpers p_dtrace->p_dtrace_helpers #define p_dtrace_count p_dtrace->p_dtrace_count #define p_dtrace_probes p_dtrace->p_dtrace_probes From nobody Wed Jul 19 16:44:26 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5hVl24TWz4nSrp; Wed, 19 Jul 2023 16:44:31 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from drew.franken.de (mail-n.franken.de [193.175.24.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.franken.de", Issuer "Sectigo RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R5hVk62Ycz4MjZ; Wed, 19 Jul 2023 16:44:30 +0000 (UTC) (envelope-from tuexen@freebsd.org) Authentication-Results: mx1.freebsd.org; none Received: from smtpclient.apple (unknown [IPv6:2a02:8109:1140:c3d:c1c3:905:51d0:8c41]) (Authenticated sender: micmac) by mail-n.franken.de (Postfix) with ESMTPSA id 9304271BCEB81; Wed, 19 Jul 2023 18:44:26 +0200 (CEST) Content-Type: text/plain; charset=us-ascii List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.600.7\)) Subject: Re: git: 07864a8a2466 - main - kinst: port to arm64 From: tuexen@freebsd.org In-Reply-To: <202307191459.36JExsm8067623@gitrepo.freebsd.org> Date: Wed, 19 Jul 2023 18:44:26 +0200 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: References: <202307191459.36JExsm8067623@gitrepo.freebsd.org> To: Christos Margiolis X-Mailer: Apple Mail (2.3731.600.7) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, T_SCC_BODY_TEXT_LINE autolearn=disabled version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail-n.franken.de X-Rspamd-Queue-Id: 4R5hVk62Ycz4MjZ X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:680, ipnet:193.174.0.0/15, country:DE] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated > On 19. Jul 2023, at 16:59, Christos Margiolis = wrote: >=20 > The branch main has been updated by christos: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D07864a8a2466b8ab3d6fa6623a7eaaf0= 834c0b51 >=20 > commit 07864a8a2466b8ab3d6fa6623a7eaaf0834c0b51 > Author: Christos Margiolis > AuthorDate: 2023-07-19 14:58:18 +0000 > Commit: Christos Margiolis > CommitDate: 2023-07-19 14:58:18 +0000 >=20 > kinst: port to arm64 >=20 > Reviewed by: markj > Approved by: markj (mentor) > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D40337 > --- > sys/cddl/dev/kinst/aarch64/kinst_isa.c | 455 = +++++++++++++++++++++++++++++++++ > sys/cddl/dev/kinst/aarch64/kinst_isa.h | 26 ++ > sys/modules/dtrace/Makefile | 2 +- > 3 files changed, 482 insertions(+), 1 deletion(-) >=20 This doesn't compile on my system: =3D=3D=3D> dtrace/kinst (all) cc -target aarch64-unknown-freebsd14.0 = --sysroot=3D/usr/obj/usr/home/tuexen/freebsd-src/arm64.aarch64/tmp = -B/usr/obj/usr/home/tuexen/freebsd-src/arm64.aarch64/tmp/usr/bin -O2 = -pipe -fno-common -D_SYS_VMEM_H_ -D__KERNEL__ -nostdinc -DSMP = -I/usr/home/tuexen/freebsd-src/sys/contrib/openzfs/include = -I/usr/home/tuexen/freebsd-src/sys/contrib/openzfs/include/os/freebsd = -I/usr/home/tuexen/freebsd-src/sys/contrib/openzfs/include/os/freebsd/spl = = -I/usr/home/tuexen/freebsd-src/sys/contrib/openzfs/include/os/freebsd/zfs = -I/usr/home/tuexen/freebsd-src/sys/cddl/compat/opensolaris = -I/usr/home/tuexen/freebsd-src/sys/cddl/contrib/opensolaris/uts/common = -include = /usr/home/tuexen/freebsd-src/sys/contrib/openzfs/include/os/freebsd/spl/sy= s/ccompile.h -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE = -DKLD_TIED -nostdinc -I/usr/home/tuexen/freebsd-src/sys/cddl/dev/kinst = -I/usr/home/tuexen/freebsd-src/sys/cddl/dev/kinst/aarch64 = -I/usr/home/tuexen/freebsd-src/sys/cddl/dev/dtrace/aarch64 = -DHAVE_KERNEL_OPTION_HEADERS -include = /usr/obj/usr/home/tuexen/freebsd-src/arm64.aarch64/sys/TCP/opt_global.h = -I. -I/usr/home/tuexen/freebsd-src/sys = -I/usr/home/tuexen/freebsd-src/sys/contrib/ck/include -fno-common -g = -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fPIC = -fdebug-prefix-map=3D./machine=3D/usr/home/tuexen/freebsd-src/sys/arm64/in= clude -I/usr/obj/usr/home/tuexen/freebsd-src/arm64.aarch64/sys/TCP = -mstack-protector-guard=3Dsysreg -mstack-protector-guard-reg=3Dsp_el0 = -mstack-protector-guard-offset=3D0 -MD -MF.depend.kinst_isa.o = -MTkinst_isa.o -mgeneral-regs-only -ffixed-x18 -ffreestanding -fwrapv = -fstack-protector -Wall -Wstrict-prototypes -Wmissing-prototypes = -Wpointer-arith -Wcast-qual -Wundef -Wno-pointer-sign = -D__printf__=3D__freebsd_kprintf__ -Wmissing-include-dirs = -fdiagnostics-show-option -Wno-unknown-pragmas = -Wno-error=3Dtautological-compare -Wno-error=3Dempty-body = -Wno-error=3Dparentheses-equality -Wno-error=3Dunused-function = -Wno-error=3Dpointer-sign -Wno-error=3Dshift-negative-value = -Wno-address-of-packed-member -Wno-format-zero-length -std=3Dgnu99 = -include = /usr/home/tuexen/freebsd-src/sys/cddl/compat/opensolaris/sys/debug_compat.= h -c /usr/home/tuexen/freebsd-src/sys/cddl/dev/kinst/aarch64/kinst_isa.c = -o kinst_isa.o = /usr/home/tuexen/freebsd-src/sys/cddl/dev/kinst/aarch64/kinst_isa.c:223:9:= error: assigning to 'struct kinst_probe *' from 'const struct = kinst_probe *' discards qualifiers = [-Werror,-Wincompatible-pointer-types-discards-qualifiers] ks->kp =3D kp; ^ ~~ 1 error generated. *** Error code 1 Stop. make[5]: stopped in = /usr/home/tuexen/freebsd-src/sys/modules/dtrace/kinst *** Error code 1 Stop. make[4]: stopped in /usr/home/tuexen/freebsd-src/sys/modules/dtrace *** Error code 1 Stop. make[3]: stopped in /usr/home/tuexen/freebsd-src/sys/modules *** Error code 1 Stop. make[2]: stopped in = /usr/obj/usr/home/tuexen/freebsd-src/arm64.aarch64/sys/TCP 3.00 real 1.97 user 1.07 sys *** Error code 1 Stop. make[1]: stopped in /usr/home/tuexen/freebsd-src *** Error code 1 Stop. make: stopped in /usr/home/tuexen/freebsd-src Best regards Michael= From nobody Wed Jul 19 16:54:48 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5hkr3vlyz4nZb6; Wed, 19 Jul 2023 16:55:00 +0000 (UTC) (envelope-from christos@freebsd.org) Received: from margiolis.net (mail.margiolis.net [95.179.159.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA512) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4R5hkq58XFz4RNM; Wed, 19 Jul 2023 16:54:59 +0000 (UTC) (envelope-from christos@freebsd.org) Authentication-Results: mx1.freebsd.org; none DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=default; bh=C16BGI7fOZjJ vII6R0JsxG3MIz/PZU6b3e1n5wAsHWE=; h=in-reply-to:references:subject:cc: to:from:date; d=margiolis.net; b=RYLu26bObXNleUnU3qRBQYxzrNnK0S0KHmmwp LF4TlQ1m9Ud0XxVhy+JdkOA6apzzTevNjaJ3LcrdClvjrxcC5PyUyb8rgV/gMXzgA3AdE4 Om2GinYr9ysKGm0A+hL65EbxOOrFEV4jbjK0BB9Ib+/qOWx1awPBpJF7Yu22o1BI= Received: from pleb (ppp-94-66-59-15.home.otenet.gr [94.66.59.15]) by margiolis.net (OpenSMTPD) with ESMTPSA id 72060a1c (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Wed, 19 Jul 2023 16:54:50 +0000 (UTC) Date: Wed, 19 Jul 2023 19:54:48 +0300 From: Christos Margiolis To: tuexen@freebsd.org Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Subject: Re: git: 07864a8a2466 - main - kinst: port to arm64 Message-ID: <20230719165448.f45hbzqgg44v4ns3@pleb> References: <202307191459.36JExsm8067623@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4R5hkq58XFz4RNM X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:20473, ipnet:95.179.144.0/20, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated tuexen@freebsd.org wrote: > This doesn't compile on my system: > [...] Forgot to bring over a recent change to kinst.h from my local branch. Pushing the fix now. Thanks for letting me know and sorry for the inconvenience. Christos From nobody Wed Jul 19 16:57:58 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5hpH17Rhz4nbxk; Wed, 19 Jul 2023 16:57:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R5hpG6s1sz4SGk; Wed, 19 Jul 2023 16:57:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689785879; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6DqFIKuKFd17aV2Fq7TsfRQ/g8dRw2SJaGx12Gfq3hg=; b=k7hETLMEoD4xx3EDQda9ZuSlcgGaZzn9sBLya6smvKDty8d+riHrAHNZcAmn3nR44s94gx djuMR6026cjRqKq3/927LEpJaqUvMUYj8RP2XPmrAy+CjnU7SzhR1hLOU5fj416es1pM/Z zq7l1FBFqLcGcbgzAgt+kr9aVpZzeoS3bOYNXkUXXiW4bTF2ohLuodPjBElsGlJBIHur6+ FkQ+v8zQPTW3OEC8mJVKArV1Iz0MdCE65P7CopdRZwGWmlvRI31BXDu4iwaWXrS9hydO9R 1QjV5lnTOxq5gvWnEl7a72mwXcSamnkT2JKF9UU/0DW60l5dD5KCusHHUrjrwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689785879; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6DqFIKuKFd17aV2Fq7TsfRQ/g8dRw2SJaGx12Gfq3hg=; b=o2lsXx6aPrcGpZ9WpVgMJx3k8ocDxOv8z2Xpc+X1R87ASEjApjVRAPLb4KMn9MV5gVoTTv 3MtR0Z1WbgWZGyVVvp6yWnt0idoVEID4f7ltYM1bkudncMj5oGFUsO/hYlAtG1Fe+W5XzY 2RZTMk+FVO2Cy5EFX/XlKMcM7AGW+cVnGPQyYvE5T+QQMEtkE4lSMNEe8Ccw4Kn7nrf8zP Zu/F+mW899wBcpEq+XkzaTpm0ruJ19H4V3tEVw/+Qm/sJVCYAzn+5EsC88jc/qpaFMBojw 0Lj+fg1nxCgsXpUaLxZkFsz0RIwmHDvtURKQkFGKET4AkWYWofURQ+CFpiKetQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689785879; a=rsa-sha256; cv=none; b=kXUByqbSYe/RQVpoDW+OA52ZxIiCa+y9R50UyCmawlprPg2DsM3Mdzt+m9Ac+R2QSkey8v 6NgXZj9gY3imBTwHA4OwiYpF0oHnX8KeTtDoxeBmsTMv/GSxTlcLcjvk0skhZ0N0DDZ1xE I7wqcrBwPJw85E9CQTHGmlWzhWile+aKgzbvw2Mla4ln8uQX2cg/5CGjmxtj6KVpkqkZYl 9Wr7FghASkmPh3+76bI37Cdmp/EjNOnFWBbLHYXUD7tPL7vBt1B+XWMo3C90SUbKzu0Yij urS4CN+cJmtKRcGJYZjpG2imeCHFlVJWCQieiQY+4JBKH6L9ZBQPPP55mVL1CQ== 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 4R5hpG5w2BzwGr; Wed, 19 Jul 2023 16:57: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 36JGvwOh066705; Wed, 19 Jul 2023 16:57:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36JGvwUN066704; Wed, 19 Jul 2023 16:57:58 GMT (envelope-from git) Date: Wed, 19 Jul 2023 16:57:58 GMT Message-Id: <202307191657.36JGvwUN066704@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 02402ec88896 - main - kinst.h: make pointer to probe in kinst_cpu_state const List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 02402ec88896eda56be4ae41779ddc719f6b0e9d Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=02402ec88896eda56be4ae41779ddc719f6b0e9d commit 02402ec88896eda56be4ae41779ddc719f6b0e9d Author: Christos Margiolis AuthorDate: 2023-07-19 16:56:10 +0000 Commit: Christos Margiolis CommitDate: 2023-07-19 16:57:44 +0000 kinst.h: make pointer to probe in kinst_cpu_state const Fixes: 5b701ed19c2e ("kinst: start moving towards per-probe trampolines") Sponsored by: The FreeBSD Foundation --- sys/cddl/dev/kinst/kinst.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/cddl/dev/kinst/kinst.h b/sys/cddl/dev/kinst/kinst.h index 390a2d1c13bf..f0811a4a88d8 100644 --- a/sys/cddl/dev/kinst/kinst.h +++ b/sys/cddl/dev/kinst/kinst.h @@ -58,7 +58,7 @@ struct kinst_cpu_state { /* * Points to the probe whose trampoline we're currently executing. */ - struct kinst_probe *kp; + const struct kinst_probe *kp; /* * Because we execute trampolines with interrupts disabled, we have to * cache the CPU's status in order to restore it when we return from From nobody Wed Jul 19 17:01:23 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5htD0Pdpz4ndN2; Wed, 19 Jul 2023 17:01: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 4R5htC6bqfz4Td7; Wed, 19 Jul 2023 17:01:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689786083; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dMSQbDIlUIIlfYPhnKcNIFC6xndMZ8ajTIZHxPxY3Do=; b=O69SuUacbDCxXkT3lnoiSLGDKPh2cCmfAKq3f6v3siKBLB0WaVVIG3XVQ2mChw3XEp0dwv FF9e+RPH6kDaE+B7adB+yVAo6i7MFrVEVS5qQLTiY0on2B/kCpekKvqjC074LCYKIidfR/ 5MTM3laZoF5oNPjlZ7jGm1bKv9Y1vK98UdXT7iYavOuwwIIkIVBMRJL1vldwAHIFmMIS1Q liFzQATa0gdmz5SqLmEoCgMH0hi/H/vBYJqUnkuXiHJ23WxuMLzlWtd3IiUcuaF7XjJMok ltSvcSp6JK4hqA3krKGCRdTbbrYFHJuSfDhRU33lP5pGh2J6JiMNZ95FKsLKLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689786083; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dMSQbDIlUIIlfYPhnKcNIFC6xndMZ8ajTIZHxPxY3Do=; b=iaPp7dbj/P6jl1NqNR4nrF45FQA0P54QMhyrC/RL9sz29KnvhI70shtTVBNdFDXQbvKkJY E2aNVmvU5ywIWvsXAUHD2LKmrFo9EM8My4ADTyoGrc/obpwsqsis1gCvp+EPkkm1ToDCSK O3haEFMimV6jUSXDJnPfOeTe3zyv5fEWjc7nW4G/McqKIf+xXk7Q4/8FKGNFZiCpiuUBqP Xk2rWRhekx7gvdOOhiS0JTi8MFX0dR57pXVBUxbHooLmlBqw2pDrgxRt59CU6QrMz/mCEb VuLjY10T3YLJT4IS/xeXZZUmlzfDYv5RJ+/xnHiLgO4wcTC8SwsJXBH6yJKX+w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689786083; a=rsa-sha256; cv=none; b=GVpu3NkgayGfbdtNcvOaS5UREw+8v9vZJlS8ALGEcmojmlNdbKxpDtktobShNPMsWr2L4X V46fp/3RaMcifNde7aFoHmV2PZHoY7jtol6h5kON39BcKwzJgH4Xn8cOUqgPCs2Mhh+V0+ QnhQO5oZDj0XnRvQCu05JybsIFmImGN/fjhH6LbmxYqd1Bu0ROu4kdxlU0DfL+gW4Z0v8D leQMjQJQQlpno2CZ8BOgI/WIVgwHFh8L04UOOdXcPWSXqbm2iKCEhI5KcfdiuZM1y2GygM cFce6KXU/aFYPDqElik6rtVXOy4fZm+6Noqt9/BLMXZzVa0EZAIeCc3UdScFLQ== 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 4R5htC5dHGzwKD; Wed, 19 Jul 2023 17:01: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 36JH1NnM080191; Wed, 19 Jul 2023 17:01:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36JH1Nwg080190; Wed, 19 Jul 2023 17:01:23 GMT (envelope-from git) Date: Wed, 19 Jul 2023 17:01:23 GMT Message-Id: <202307191701.36JH1Nwg080190@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Marius Strobl Subject: git: 13d1f5cb62d7 - main - enic(4): Remove unused dupe prototype List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: marius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 13d1f5cb62d796397312e87ce93b6aff36f9b75d Auto-Submitted: auto-generated The branch main has been updated by marius: URL: https://cgit.FreeBSD.org/src/commit/?id=13d1f5cb62d796397312e87ce93b6aff36f9b75d commit 13d1f5cb62d796397312e87ce93b6aff36f9b75d Author: Marius Strobl AuthorDate: 2023-07-16 07:43:13 +0000 Commit: Marius Strobl CommitDate: 2023-07-19 16:58:51 +0000 enic(4): Remove unused dupe prototype --- sys/dev/enic/if_enic.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/dev/enic/if_enic.c b/sys/dev/enic/if_enic.c index 537e613efa2d..a386191a51ef 100644 --- a/sys/dev/enic/if_enic.c +++ b/sys/dev/enic/if_enic.c @@ -1029,8 +1029,6 @@ enic_update_admin_status(if_ctx_t ctx) enic_link_status(softc); } -uint32_t iflib_get_flags(if_ctx_t ctx); - static void enic_txq_timer(if_ctx_t ctx, uint16_t qid) { From nobody Wed Jul 19 17:01:24 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5htF1V6mz4ndV8; Wed, 19 Jul 2023 17:01: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 4R5htF05jxz4Tfy; Wed, 19 Jul 2023 17:01:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689786085; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ke0cDudMAYF3cIXnGO/y7+TwEqFL08pGiglyO06FnKQ=; b=e4QrRjzWtNn86zoNYF2tu7/FeWwFsSZ23su1pxImahUdU0/8WVOf1EL+sZ+xdkIPYCmNAU Z/fMAs5fheCtWrRhusa5OeRoBCvyiDDvRN+T7TBA5LLkwyJfZHug5Hl7A0PhLF1wQMYgS4 MuBpCQ9PqedsbGkKRh73kJzFc0Uh1JLuST5khx67xksdTy7QjI9Y4WzSBYqtiVUaSKH9oI JuvPVdLv0RPOTTbs5O3RQsgRbZIg04AD0N7GSwvRpntsDPUEO8mtY73hnUk9ziAbjk2y34 inihAhXu8HJd88UWqxzy3IUDuNAPnguxjgYYydCjUggKdd6zU7TP2rZ9x7quMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689786085; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ke0cDudMAYF3cIXnGO/y7+TwEqFL08pGiglyO06FnKQ=; b=oQ86neRrCuHfXCQMK870RZzIQL3J7l+l0u08bNvwMZ/sB/liIek/z8aARlbrPwfVOAYazL ZCDndETcIw7+iJtitxfRWcA3fO3RFWtvqGbcLxIM6TBvMjYEMn0Se7n/wukhNQ/aloiOhW g5lv3UfwqJOOrPVzzgwWy7jhUF9mHbjgDLph8sY4FyZnaNTCQunLBgWjPm/OFGSL35XVgk 2MD8h5lu/0fcvz+5lYOE/7GwbQ//mkXtJcJNr35jfaADkL1tjAwFPd6z7lfQQrllxV5hat UYISARKGw6YBvu7sP73VKXrlzh9zL1PkJRilFCQnx4lUiCUtdkxaTaT8OgcHAg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689786085; a=rsa-sha256; cv=none; b=coHVydYXlNTO94hseS4cbMLYUN2+72K1b58+09FjUSntfDKcGZliJEG9CMfeyMrYWd3M2p hGkn4joAxgI9+6Sqd3v/GXrsvaYCVb/ME08FmqWmfylybzDPt0+4HaQuw0vxgRsDoDjSdh aA9/mmUcx2jp5YS4xhudS+v9KuY4wsd+vFCs4OHOdtSE4reECBJ7ok7uMv3G5z8Sy16277 NjtfzFbQQhN0vemSQf1J5ZIgIBoQb7kQETHfHZd+QZ7fdgjMUxFvtrleWtu1C3rg9IkRX1 jpUNinxCZ33lMYnXeYskcw2TxhM1AbmJunZqRVHU30nFnT1FAEOXW3Dn74XOJg== 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 4R5htD6JYNzwH9; Wed, 19 Jul 2023 17:01: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 36JH1Oph080210; Wed, 19 Jul 2023 17:01:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36JH1OsP080209; Wed, 19 Jul 2023 17:01:24 GMT (envelope-from git) Date: Wed, 19 Jul 2023 17:01:24 GMT Message-Id: <202307191701.36JH1OsP080209@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Marius Strobl Subject: git: 37eec7f68a79 - main - ObsoleteFiles.inc: Remove leading slash from 20230714 entry List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: marius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 37eec7f68a79d100d8f5d439138acc21cd8b4efa Auto-Submitted: auto-generated The branch main has been updated by marius: URL: https://cgit.FreeBSD.org/src/commit/?id=37eec7f68a79d100d8f5d439138acc21cd8b4efa commit 37eec7f68a79d100d8f5d439138acc21cd8b4efa Author: Marius Strobl AuthorDate: 2023-07-19 16:56:35 +0000 Commit: Marius Strobl CommitDate: 2023-07-19 17:00:14 +0000 ObsoleteFiles.inc: Remove leading slash from 20230714 entry Fixes: c3f58005d92e signal: Remove gsignal references from manuals --- ObsoleteFiles.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index ccc57c3406c3..80e106d63db8 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -53,7 +53,7 @@ # done # 20230714: gsignal -OLD_FILES+=/usr/share/man/man9/gsignal.9.gz +OLD_FILES+=usr/share/man/man9/gsignal.9.gz # 20230626: Only install sys/dev/nvme/nvme.h to /usr/include OLD_FILES+=usr/include/dev/nvme/nvme_private.h From nobody Wed Jul 19 17:02:39 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5hvj6Y0Pz4nfKL; Wed, 19 Jul 2023 17:02:41 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from drew.franken.de (mail-n.franken.de [193.175.24.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.franken.de", Issuer "Sectigo RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R5hvj52Y1z4Vkk; Wed, 19 Jul 2023 17:02:41 +0000 (UTC) (envelope-from tuexen@freebsd.org) Authentication-Results: mx1.freebsd.org; none Received: from smtpclient.apple (ip4d15f6ca.dynamic.kabel-deutschland.de [77.21.246.202]) (Authenticated sender: micmac) by mail-n.franken.de (Postfix) with ESMTPSA id DAC2881546F22; Wed, 19 Jul 2023 19:02:39 +0200 (CEST) Content-Type: text/plain; charset=us-ascii List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.600.7\)) Subject: Re: git: 07864a8a2466 - main - kinst: port to arm64 From: tuexen@freebsd.org In-Reply-To: <20230719165448.f45hbzqgg44v4ns3@pleb> Date: Wed, 19 Jul 2023 19:02:39 +0200 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: References: <202307191459.36JExsm8067623@gitrepo.freebsd.org> <20230719165448.f45hbzqgg44v4ns3@pleb> To: Christos Margiolis X-Mailer: Apple Mail (2.3731.600.7) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, T_SCC_BODY_TEXT_LINE autolearn=disabled version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail-n.franken.de X-Rspamd-Queue-Id: 4R5hvj52Y1z4Vkk X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:680, ipnet:193.174.0.0/15, country:DE] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated > On 19. Jul 2023, at 18:54, Christos Margiolis = wrote: >=20 > tuexen@freebsd.org wrote: >> This doesn't compile on my system: >> [...] >=20 > Forgot to bring over a recent change to kinst.h from my local branch. > Pushing the fix now. >=20 > Thanks for letting me know and sorry for the inconvenience. No problem. I can confirm that the push fixed actually fixes the issue = for me. Thanks for the quick response. Best regards Michael >=20 > Christos From nobody Wed Jul 19 17:04:21 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5hxf43YDz4nfyY; Wed, 19 Jul 2023 17:04:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R5hxf1xtvz4WPB; Wed, 19 Jul 2023 17: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=1689786262; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oyX/m4lCUXXrNKCrStaIu94HU6oXiZBFgdL1B0CRNb4=; b=bw0tRZuE40sLUB167ntMSiCQ8/QEjcxX/CF30EoaKE9Mm9NG3lR1It6XUgKTzBxv1nWJrb riLZ/pmmaYsmKR19AI+a7koJR02o8hXt3CTuXoOqTo0bi5fo/MclgMqRIpLRyf8LsDQ/4A CCBUhUbYMNnmblVFNo8i0lSCEkTU5cLw0OtFj1nkm9JelPigo9wHdv+Dt3qcZtjs1K9TjQ WNANzMLPju4yeQJWjBe0UaIiC+n9denUyKn9Ij3rU7ZvtWZYG3ljsZzq0FBWY190S9VLXy 4PypsoqcDhDQXU619mpfyIq7RGXGotynCaDvL1C3LRhZTq25daAuBOkd/8k4XA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689786262; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oyX/m4lCUXXrNKCrStaIu94HU6oXiZBFgdL1B0CRNb4=; b=LvEHzpxFFCY2UIO5Gyn0Jrvugtrct3Qj1VenXeE60YX7gfCAqjpeRw4PxRwumd+i9FxHaj yBC13rk7oi5AXS6V0Q64PmNqK0CTQaOnafTofv0I0Lqfjok3RhcWEldTH5eLWXjd8Mjz1c hkXY3bvGqsinplEZfZMwBraOhfvJzNVrcjyqXa9o6W1bOlu1zVQWrbAWhNFZXEtE6jk+Hs DxJMxjzN2DqsWDjGYhcJucpgb/tlJzNrCLt5WPwaq5cvtSzzqJfRE55UtHZrAbRXS7i+Wy kdHuY8Veqhx93whhZrkHYGs4H2tYErkjUB1nNIIXVbcsagZvepJYzP5S9u+3jw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689786262; a=rsa-sha256; cv=none; b=tmiqx/RUEDmEi6Wx5lU2WKlKZiCxo2qbsnzqhwQ5DdxBpcBi6IeTfv/DA23NTBLBkM1Mu1 52rdpYwZowsO3nDzFGj+Mo+537EHd065clDoVcaRtqYqQ3CLQrolfbqwbqZiipe7Z2/psI fI+8iblwrEPpMOpsqIS/zDPW9BaqQO2k8jqVy7719gcZdhC53BEjMbkGXBFKvoeDAlvwP5 m4Xo5qJF5kKFQcHalBBAN5BYvBQYVGCJ7P+dbu1DQPVg5MOq3hORbkb5RtIxteCZ1KwaOD 40vTq7owv3MpkbYTwt9jYKjIAo/u1lx05CnMsslxybGzAFO08NXgRGUZu/GOYA== 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 4R5hxf12D0zwm2; Wed, 19 Jul 2023 17: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 36JH4MLX083570; Wed, 19 Jul 2023 17: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 36JH4Lip083569; Wed, 19 Jul 2023 17:04:21 GMT (envelope-from git) Date: Wed, 19 Jul 2023 17:04:21 GMT Message-Id: <202307191704.36JH4Lip083569@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 66fd12cf4896 - main - ssh: Update to OpenSSH 9.3p2 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 66fd12cf4896eb08ad8e7a2627537f84ead84dd3 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=66fd12cf4896eb08ad8e7a2627537f84ead84dd3 commit 66fd12cf4896eb08ad8e7a2627537f84ead84dd3 Merge: 37eec7f68a79 e524ba4db420 Author: Ed Maste AuthorDate: 2023-07-19 17:02:33 +0000 Commit: Ed Maste CommitDate: 2023-07-19 17:02:33 +0000 ssh: Update to OpenSSH 9.3p2 From the release notes: Changes since OpenSSH 9.3 ========================= This release fixes a security bug. Security ======== Fix CVE-2023-38408 - a condition where specific libaries loaded via ssh-agent(1)'s PKCS#11 support could be abused to achieve remote code execution via a forwarded agent socket if the following conditions are met: * Exploitation requires the presence of specific libraries on the victim system. * Remote exploitation requires that the agent was forwarded to an attacker-controlled system. Exploitation can also be prevented by starting ssh-agent(1) with an empty PKCS#11/FIDO allowlist (ssh-agent -P '') or by configuring an allowlist that contains only specific provider libraries. This vulnerability was discovered and demonstrated to be exploitable by the Qualys Security Advisory team. In addition to removing the main precondition for exploitation, this release removes the ability for remote ssh-agent(1) clients to load PKCS#11 modules by default (see below). Potentially-incompatible changes -------------------------------- * ssh-agent(8): the agent will now refuse requests to load PKCS#11 modules issued by remote clients by default. A flag has been added to restore the previous behaviour "-Oallow-remote-pkcs11". Note that ssh-agent(8) depends on the SSH client to identify requests that are remote. The OpenSSH >=8.9 ssh(1) client does this, but forwarding access to an agent socket using other tools may circumvent this restriction. CVE: CVE-2023-38408 Sponsored by: The FreeBSD Foundation crypto/openssh/ChangeLog | 1867 +--------------------------- crypto/openssh/README | 2 +- crypto/openssh/contrib/redhat/openssh.spec | 2 +- crypto/openssh/contrib/suse/openssh.spec | 2 +- crypto/openssh/ssh-agent.1 | 22 +- crypto/openssh/ssh-agent.c | 21 +- crypto/openssh/ssh-pkcs11.c | 6 +- crypto/openssh/sshd_config | 2 +- crypto/openssh/sshd_config.5 | 2 +- crypto/openssh/version.h | 4 +- 10 files changed, 82 insertions(+), 1848 deletions(-) diff --cc crypto/openssh/sshd_config index e3228f94f94a,36894ace503d..767024db5209 --- a/crypto/openssh/sshd_config +++ b/crypto/openssh/sshd_config @@@ -104,8 -100,7 +104,8 @@@ AuthorizedKeysFile .ssh/authorized_key #MaxStartups 10:30:100 #PermitTunnel no #ChrootDirectory none -#VersionAddendum none +#UseBlacklist no - #VersionAddendum FreeBSD-20230316 ++#VersionAddendum FreeBSD-20230719 # no default banner path #Banner none diff --cc crypto/openssh/sshd_config.5 index 9bd447e47863,9a1578f75e86..d960bbda5e0f --- a/crypto/openssh/sshd_config.5 +++ b/crypto/openssh/sshd_config.5 @@@ -1927,10 -1900,7 +1927,10 @@@ The default i Optionally specifies additional text to append to the SSH protocol banner sent by the server upon connection. The default is - .Qq FreeBSD-20230316 . -.Cm none . ++.Qq FreeBSD-20230719 . +The value +.Cm none +may be used to disable this. .It Cm X11DisplayOffset Specifies the first display number available for .Xr sshd 8 Ns 's diff --cc crypto/openssh/version.h index 24c778283020,000000000000..7132fd7b0780 mode 100644,000000..100644 --- a/crypto/openssh/version.h +++ b/crypto/openssh/version.h @@@ -1,8 -1,0 +1,8 @@@ +/* $OpenBSD: version.h,v 1.97 2023/03/15 21:19:57 djm Exp $ */ + +#define SSH_VERSION "OpenSSH_9.3" + - #define SSH_PORTABLE "p1" ++#define SSH_PORTABLE "p2" +#define SSH_RELEASE SSH_VERSION SSH_PORTABLE + - #define SSH_VERSION_FREEBSD "FreeBSD-20230316" ++#define SSH_VERSION_FREEBSD "FreeBSD-20230719" From nobody Wed Jul 19 17:15:05 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5jB94Ztwz4nlN9; Wed, 19 Jul 2023 17:15:11 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.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 "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R5jB66nxKz4Z0x; Wed, 19 Jul 2023 17:15:10 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689786911; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BHS6qVGZWKnTxtxmMKEep7C21HDFqSP0xtnNO8WEdyQ=; b=ytd4lfzaBmFonWbCtwjoLF32LauvL25+X7P37wfknGz/yyxw1yjoHtn9Y4IwZWwuFslkD6 iYj54u89HiWT2GdHVppDHVgsS5paA2JW98loKxExtZxa4otrljG3QTzU7hxQbgEpi7C47n +2Rz8qTnqmRjs+BKkNA7IDZbliwzJl6m68XG85gTESOsKw7lPiVfCxQF//8X5+NTDRKkWG wAg/ncvasLsdJPh0KJcWH5GMu7SGu9r3pcY/NWP+CKC15oIK6y9IXw/Kn4KXkPtnHvrDyj XQvLkGfI1tlmJlhx03PwNUzj6unsCN+nJKMSoVjr9A5eMtzVkMg7/NCqEgmd4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689786911; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BHS6qVGZWKnTxtxmMKEep7C21HDFqSP0xtnNO8WEdyQ=; b=DBpw6CTwwMt+MCaEvmTbH1RFIjykAZUCiIxy9FXQmAby/e9mZlPwKm8PxOjNBaSYuG8UG4 5DbcekLOlA9XIdBRh+xZJRGOlW2nwyhHcWAQpOXmw8qxqiiE0QSA6FnvryEED8KnvVrIJ2 c80g+bWWdLeWFo1UtyxyicS9XBSYq93SpfgmH0fkOnDogaAeX1UXI3qB4a9HGU3PLYAnRA t9ejZY2VQnm9rFe4p6UWv4YRsiZ/3WVXPByKCB9RUHQJQmy2EPR9vynP6pNYqDVRA5zfZg k/ZIoS3lfZIhPAMKtAcN4BPv11xlvHWH/QrG1U4oYNclxycCRNhmKt60tjvXow== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689786911; a=rsa-sha256; cv=none; b=XPOycmQbf9E7BL9vrlx2OWs2FiRtTLMubQ93KzTHSV0AvCDU2BgwyIdYnaWZintBo5z+zl H8TWiyGufsSE2uV7o319bB3JrgOwIqQmL83JWDUqwnvXoBl0DeBBzNDfWKUKXB6soqKxNb bamTWksafh70Og1Mvxq4e6/y90Z23XuH75WTA0pZ0+vtXthNhxhMr+3+PJMCYOnajAWUzL hy8GBh5+b3FslaQbo51RLB+CIASScnG+JbhibI1BziiSZaLfA2IsvMuUPchzazOT6k5IhL s922KJUDeq1kpQ7cKMePSR/BmU7jwSosdoz5/4u2DSX7PqMYwDbZWkwe1Q+ieQ== Received: from [IPV6:2601:648:8680:16b0:c91:7cca:6422:a0ad] (unknown [IPv6:2601:648:8680:16b0:c91:7cca:6422:a0ad]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4R5jB46sjTz151G; Wed, 19 Jul 2023 17:15:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <95cf4d0b-218f-aa25-a038-484d340bd622@FreeBSD.org> Date: Wed, 19 Jul 2023 10:15:05 -0700 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: git: c5312bd79e66 - main - cam: Move bus_dmamap_load_ccb into cam.c. Content-Language: en-US To: Warner Losh Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202307190120.36J1K1mQ011397@gitrepo.freebsd.org> From: John Baldwin In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 7/18/23 6:44 PM, Warner Losh wrote: > As predicted in the review, this is broken: > > -- command output -- > linking kernel.full > ld: error: undefined symbol: bus_dmamap_load_ccb >>>> referenced by nvme_qpair.c:1209 > (/usr/home/imp/git/freebsd/src/sys/dev/nvme/nvme_qpair.c:1209) >>>> nvme_qpair.o:(_nvme_qpair_submit_request) > _ > from using sys/amd64/conf/EX > include MINIMAL > device nvme > device nvd > > This has to be in the header file. The MODULE_DEPENDS stuff doesn't pull > anything in for the > static kernel case. > > Please, lets' do this in the header with a static inline like I suggested > to get around this issue. I only committed it because kib@ requested it to fix the build. I'm still happy to make memdesc_ccb an inline function. However, it's also true that this case (a storage driver with both CAM and non-CAM frontends) is very unique and is not something we probably intend to support long term. Requesting those folks to add 'device scbus' to their kernel is not the worst tradeoff for this unusual case (esp. given we are defacto deprecating it by making nda the default in 14.0) -- John Baldwin From nobody Wed Jul 19 17:33:23 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5jb76HLlz4ntVT; Wed, 19 Jul 2023 17:33: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 4R5jb759h3z3CdS; Wed, 19 Jul 2023 17:33:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689788003; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JT7xsILXoDLRWFH1v5WYQDIPGfC1OivFWDe00Yznu48=; b=aQ3pvXhS40q+HyFUpcdCdATlLOosRE6CwO0rWdRcXzKdSdxSxYCig/p83lSqRYoafdv5dV PJy1LnbGgHsAxcjDOnedTVHWoDduU+Gh48v5QvHcwFAjN9smRZO3+8G5jJtkfwByRr5+gE N5f4KoduOuzTFyX1nA1wt0Y7Qon0TN9c/XCPtXl0//+KFouUqZigNa1o7anMTo8LTrwq7y rqIXzNr2p9ZHIs6k9q4ydgpoJ1BcxuH4zpYFd6HXz7cELAFYVKlBpv4qNW7TgYjmNLat4z SjznXwGCFo7oCW1AsF9N0eeQ0v5bFWWPWHK8+Nu0OnqZs2jgxhujl0tsBYyCag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689788003; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JT7xsILXoDLRWFH1v5WYQDIPGfC1OivFWDe00Yznu48=; b=B0xGPic5M+a+Mm5O4H+lIOCnlynfQghOVRUWwyFpQTl1wRAkiOQS5a/Cv3VWlo5UJP3Ebn PcbzpQwj30YIFCf2t1hh3hQPDyhW/c6EgzjA736dGyHcBAku9/5JfCilRosOaO/2FVKfw9 q2dhpldvV69KPdYX2Y+66clwVO4PiIkrNdisMzJZj7QLe6zw0KWfFsXhI2chAoArjXraeL CouBkklcQ99Qa8xlq8sGTTmrOrM+1kGx1Unw4XoFzcgh41bWcmEB7sCDcxRgmNT1UOMpMk hzm1T2ayZXl/pnFXDfBj19S8BgQFAc3w1s2ufAD2ZF0B2j1OPMWs5dkZ3tY2Mw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689788003; a=rsa-sha256; cv=none; b=ODPHHqBnBczgOjCrLRUPO2dyIOEslJ8nmimCponhIK5xf0ZmSE9+ChdHiICirsiBPROv6o MVdswqqwtihYWnhMZgzxG0CqMODKWKzYYD7zUtFPmWUfWiZxZpSZ2+kN5Vjdnpc+r32s/i XR6Eo4KygNTBdo831DKabV0qoTNrOUhJCaS1m2shwVZqXxeeEFUuD+NTNmzSHvBXEbWkO0 hHOwabvhGJCjYcRKbezvwhGmGwewnh+CmIk6E/vvpLeB/OsT9btXX84Xsy6U4Zd/zHMxE2 iYIkZap4Qx9RriVolXspCtLQjlp0Lz8HZhv0AQlHfTIs6qzSoqn2O3v56qye8A== 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 4R5jb74FbFzx7X; Wed, 19 Jul 2023 17:33: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 36JHXNJG033084; Wed, 19 Jul 2023 17:33:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36JHXNXj033083; Wed, 19 Jul 2023 17:33:23 GMT (envelope-from git) Date: Wed, 19 Jul 2023 17:33:23 GMT Message-Id: <202307191733.36JHXNXj033083@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: 8d0cab8800e1 - main - Merge commit 9ca395b5ade1 from llvm-project (by Haojian Wu): List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 8d0cab8800e19cddc56d4a532abdbe9f0ac6c620 Auto-Submitted: auto-generated The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=8d0cab8800e19cddc56d4a532abdbe9f0ac6c620 commit 8d0cab8800e19cddc56d4a532abdbe9f0ac6c620 Author: Dimitry Andric AuthorDate: 2023-07-19 09:18:50 +0000 Commit: Dimitry Andric CommitDate: 2023-07-19 17:14:23 +0000 Merge commit 9ca395b5ade1 from llvm-project (by Haojian Wu): [clang][AST] Propagate the contains-errors bit to DeclRefExpr from VarDecl's initializer. Similar to the https://reviews.llvm.org/D86048 (it only sets the bit for C++ code), we propagate the contains-errors bit for C-code path. Fixes https://github.com/llvm/llvm-project/issues/50236 Fixes https://github.com/llvm/llvm-project/issues/50243 Fixes https://github.com/llvm/llvm-project/issues/48636 Fixes https://github.com/llvm/llvm-project/issues/50320 Differential Revision: https://reviews.llvm.org/D154861 This fixes an assertion ('Assertion failed: ((LHSExpr->containsErrors() || RHSExpr->containsErrors()) && "Should only occur in error-recovery path."), function BuildBinOp') when building parts of dtrace in certain scenarios. Reported by: dstolfa PR: 271047 MFC after: 1 month --- contrib/llvm-project/clang/lib/AST/ComputeDependence.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/contrib/llvm-project/clang/lib/AST/ComputeDependence.cpp b/contrib/llvm-project/clang/lib/AST/ComputeDependence.cpp index eb9afbdb1c87..b5c783b07d92 100644 --- a/contrib/llvm-project/clang/lib/AST/ComputeDependence.cpp +++ b/contrib/llvm-project/clang/lib/AST/ComputeDependence.cpp @@ -489,7 +489,7 @@ ExprDependence clang::computeDependence(DeclRefExpr *E, const ASTContext &Ctx) { // more bullets here that we handle by treating the declaration as having a // dependent type if they involve a placeholder type that can't be deduced.] if (Type->isDependentType()) - return Deps | ExprDependence::TypeValueInstantiation; + Deps |= ExprDependence::TypeValueInstantiation; else if (Type->isInstantiationDependentType()) Deps |= ExprDependence::Instantiation; @@ -525,13 +525,13 @@ ExprDependence clang::computeDependence(DeclRefExpr *E, const ASTContext &Ctx) { // - it names a potentially-constant variable that is initialized with an // expression that is value-dependent if (const auto *Var = dyn_cast(Decl)) { - if (Var->mightBeUsableInConstantExpressions(Ctx)) { - if (const Expr *Init = Var->getAnyInitializer()) { - if (Init->isValueDependent()) - Deps |= ExprDependence::ValueInstantiation; - if (Init->containsErrors()) - Deps |= ExprDependence::Error; - } + if (const Expr *Init = Var->getAnyInitializer()) { + if (Init->containsErrors()) + Deps |= ExprDependence::Error; + + if (Var->mightBeUsableInConstantExpressions(Ctx) && + Init->isValueDependent()) + Deps |= ExprDependence::ValueInstantiation; } // - it names a static data member that is a dependent member of the From nobody Wed Jul 19 18:17:12 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5kYj0k1Rz4mpRS; Wed, 19 Jul 2023 18:17: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 4R5kYh5c4Hz3Pp7; Wed, 19 Jul 2023 18:17:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689790632; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gDB+Jll5TxJYx+WpMYlycvk2F9brrxXXNKYlr2P8vJo=; b=Mi83FNvj5ifN3NcFco5JcM/kLw/SjAba1DOJcoeNxoES6wH3MJrGQ2QJhGzeBYshvBprE5 cv3dwuNIhgDZdL6YEZg3Dm2Zzc2TGQEe/js2pagYV04YCy7nIlgaX1sSgAX/HMheNrj9Sr 67rfhYDnIvvi+jpi3IKfiTLHD7h9BFdqluvh877lcgmVMoyuUvAwOrKL+gG68GUUDoQ2iJ rC27YV9IsZfCzRnBjNcsRLX2Dd4MgdNiGJWt50xCeWZbjpkWECoop3Dy6xD7EfNA8L9NQM pu2yvMj0Ui+dZQK2b+8psOeKUh41T5+tf7Pm/uuZAUKcqUyNWrlimdEj+isvlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689790632; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gDB+Jll5TxJYx+WpMYlycvk2F9brrxXXNKYlr2P8vJo=; b=gljZT2Z6c7vgkoDjW+KLhAkJzVAMCXboXWQXF28P/dB12lZ1g37vr3U6vTYlPDs+lG71hG eax5QIRjLKGD9VoruFp3vH009BK8pq2yZeIAYy2XrmjSydtH5nk0T9OPTQvaCKzHAsD9Do Jj1W3+16Xo23XbrFRJrAMsxdRRqGnSyVgSV7/yXCya+H63YeoDj3KbDrtaENyX0AsVQl2L 0dq36z/zSTTMaBdYJXthQull7eqt9y6AMqXAS8GWmTu4ijRaaKQ9XCocmVft0YwliaCfBq ZY6yaK2nA8y3MV7l1DulEIM0/jdpeAq1kZYvpCJtf0bVGMPp2Qf1RZHxVqAdZg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689790632; a=rsa-sha256; cv=none; b=af8RFvTpIrpj6Kv38lrTC9iClrBGmXhD7Y24IW23Cz+jYedN7CxYxM+u/TUT3pc+CoAok+ qTnPHVu7H/J9rrNo8jxH+qwbVdA6757NfOW87NRM9xYUCzPoKdLqcDBLy3smpCx2A9d2W4 lKLYhSUGCvlY50E3B+07plW4r86UF5XBTngJtSdgJN7CAQIp0+VG51bV5zU252SFfpSkWM bsjHMzC76LiS5RT/yvvdeocu0y9jaFA5iIHKCPf7x1avWKpIuYuU9WySthjB3FW2zyCMad eM0m7PVWVZpbcyI1eEbystE3cCyzkLqD1c+HqvCbPRCBNGYXSIgvjahxkYUnFw== 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 4R5kYh4WnpzyXQ; Wed, 19 Jul 2023 18:17: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 36JIHCFo000232; Wed, 19 Jul 2023 18:17:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36JIHCk7000231; Wed, 19 Jul 2023 18:17:12 GMT (envelope-from git) Date: Wed, 19 Jul 2023 18:17:12 GMT Message-Id: <202307191817.36JIHCk7000231@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Navdeep Parhar Subject: git: c721694a1ca8 - main - ktls_alloc_rcv_tag: Fix capability checks for RXTLS4/6. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c721694a1ca8c1649b32a1ea6faa79a606cd19a6 Auto-Submitted: auto-generated The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=c721694a1ca8c1649b32a1ea6faa79a606cd19a6 commit c721694a1ca8c1649b32a1ea6faa79a606cd19a6 Author: Navdeep Parhar AuthorDate: 2023-07-19 17:56:03 +0000 Commit: Navdeep Parhar CommitDate: 2023-07-19 18:12:14 +0000 ktls_alloc_rcv_tag: Fix capability checks for RXTLS4/6. IFCAP2_* has the bit position and not the shifted value. Reviewed by: kib@ MFC after: 1 week Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D41100 --- sys/kern/uipc_ktls.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/kern/uipc_ktls.c b/sys/kern/uipc_ktls.c index df4fe4b77c04..750e612cb273 100644 --- a/sys/kern/uipc_ktls.c +++ b/sys/kern/uipc_ktls.c @@ -993,12 +993,12 @@ ktls_alloc_rcv_tag(struct inpcb *inp, struct ktls_session *tls, INP_RUNLOCK(inp); if (inp->inp_vflag & INP_IPV6) { - if ((if_getcapenable2(ifp) & IFCAP2_RXTLS6) == 0) { + if ((if_getcapenable2(ifp) & IFCAP2_BIT(IFCAP2_RXTLS6)) == 0) { error = EOPNOTSUPP; goto out; } } else { - if ((if_getcapenable2(ifp) & IFCAP2_RXTLS4) == 0) { + if ((if_getcapenable2(ifp) & IFCAP2_BIT(IFCAP2_RXTLS4)) == 0) { error = EOPNOTSUPP; goto out; } From nobody Wed Jul 19 18:21:36 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5kfm71vcz4ms79; Wed, 19 Jul 2023 18:21:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R5kfm6HzHz3R3s; Wed, 19 Jul 2023 18:21:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689790896; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2dyJxVXaTh9WptHk1/gmuuPy3UO8ZTnJNiA9x9O8Cg4=; b=CqWIQt8S/ot7Ril02tjNO4OWCjTawUn4O7+Mk72GN0a9b+9WOVP/rlmbYoZ78f0kKKYUL5 EjZgVfj+c6MGAcIJo2OkAH29XYqjQWOz5yiOVI3jW8FTY5v07TUQwtMBWQ8Qw+P1Mn0AC/ N6zabbDm6eboduznhdBPAwZGLYLsaUZPieXhkjxMqFHYSTDnxwDZd76YltAP2hZh7DjVFb fYHTjX4eaNvykoqt7VkE+FtKo2WOsU2hM4LA9c4IoV751dXewDtytpByHAL+fNaYC+4oU/ i7YJOmZE6TqWzPaNlimfcg/WWN1h5uYS0GSdha4zgL/N90Krvc2r29MX3EL7QQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689790896; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2dyJxVXaTh9WptHk1/gmuuPy3UO8ZTnJNiA9x9O8Cg4=; b=TxSjjpgvUge8HFvZYAJMkeyP/Ac1h5qWhLi0d74x887+ryFCqiZehs2KbvU9ZTcI+5bgHx 30duwZv40PeC8b9/e3/jw+P+ntvBEMK/2nHlJg3BFAEGwdYNh5EG64XDBoajzdQPgFkqBZ zZ666vTpo1I1ouv+pDhWtIIa+xr73nHHlhFH+CN7mHp0IOm5HB8pkQDLRGTfLhV79EL4Ga Tr1tYqY8QJ3nq4QvytO7dofg2Ky20PLEFhhTDIv5RWNaPDm8waSws1bTQ5erpIx4Hcw+zN mI0FuxapbcIPtT3wyKQaTe7k5GHA3/6Fx/noxdS8pBlmfiR1PE7Rm3m1OxXOZg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689790896; a=rsa-sha256; cv=none; b=Bnl2UV3E6XrSN+vGOF9qyF06JhqnCkW38yqQrkUCU2H2PZi32fGG2Y1xk5YVrq0Yt4SYi3 el2EmDzXmsDFKPGSjmAO1fhOkmwBe0I9wM1m7nA/U1WrdzIDHoCzeMXIev5TcIRKxz8z7X 1jkArjLt4Phv9rELgQQkU9L0NnUxPcdRcb1IxnfspzFsQ1LrcMUNyyZ/yM4fNwBzsK5e7R mBNcCM+LODYrzUfbr8Vs6Ez/7o+mqJNiKyZ/OTkeVp8+tU++goIkxJ4UYnIxiBmW3y1DGf I7y7IGhpOGoREQoJoiGVgAxThVqPoLIRzrUprw/IPQ82nvplB9McYw46KpTJ+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 4R5kfm5Pb0zydT; Wed, 19 Jul 2023 18:21: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 36JILas0009338; Wed, 19 Jul 2023 18:21:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36JILaDo009337; Wed, 19 Jul 2023 18:21:36 GMT (envelope-from git) Date: Wed, 19 Jul 2023 18:21:36 GMT Message-Id: <202307191821.36JILaDo009337@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Chagin Subject: git: c84617e87a70 - main - i386: Switch to PIC kernel modules List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c84617e87a70f4aea5df46fa521835aefa7d8163 Auto-Submitted: auto-generated The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=c84617e87a70f4aea5df46fa521835aefa7d8163 commit c84617e87a70f4aea5df46fa521835aefa7d8163 Author: Dmitry Chagin AuthorDate: 2023-07-19 18:21:04 +0000 Commit: Dmitry Chagin CommitDate: 2023-07-19 18:21:04 +0000 i386: Switch to PIC kernel modules It seems since the last llvm project update, the lld linker has started creating a PLT dependent kernel module object files. Reviewed by: kib, jhb, emaste Differential Revision: https://reviews.freebsd.org/D41088 --- sys/conf/kmod.mk | 2 +- sys/i386/i386/elf_machdep.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/conf/kmod.mk b/sys/conf/kmod.mk index 246af5ba1e81..a83d64eb8bf7 100644 --- a/sys/conf/kmod.mk +++ b/sys/conf/kmod.mk @@ -166,7 +166,7 @@ CFLAGS+= -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer .endif .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "riscv" || \ - ${MACHINE_CPUARCH} == "powerpc" + ${MACHINE_CPUARCH} == "powerpc" || ${MACHINE_CPUARCH} == "i386" CFLAGS+= -fPIC .endif diff --git a/sys/i386/i386/elf_machdep.c b/sys/i386/i386/elf_machdep.c index d8b7ab9c586b..5d8b41a16672 100644 --- a/sys/i386/i386/elf_machdep.c +++ b/sys/i386/i386/elf_machdep.c @@ -244,6 +244,7 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbase, const void *data, break; case R_386_GLOB_DAT: /* S */ + case R_386_JMP_SLOT: /* S */ error = lookup(lf, symidx, 1, &addr); if (error != 0) return (-1); From nobody Wed Jul 19 18:53:58 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5lN65SFlz4nRH2; Wed, 19 Jul 2023 18:53: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 4R5lN64sJFz3qZD; Wed, 19 Jul 2023 18:53:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689792838; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Vo+68o4ae1OMN8arfg5JHB36jy3Jb+xa6AVl9hf+sH8=; b=t9GqfmOrEtxq1prkKSmejAkoKkcUyvLdfVqovWR3dPBLp8vbbdDkBU+p1yQgBEXb3YQSU7 wT18XjperzaIBC0832lJ9L+cfb8gykx8IuTdwVH4d9iW+nABVutcx0DY7tOyonqYbi/TqO 5O6szaPGQbL1Xo8nQ80FVFeKc8Mrx5HrPSvpqIhI1KQA9khUZJxMFLMxij5PdTAlFG0RgE mjF6ZawnCCDvzIAMiNH9KtIGCTCURySZyyb1PNNCY375OLBhW6DrqtWbmsF/5GzSSca6xj 2P6FjFZbEeDP0rkJvJ4+KoRmevGeydJt5DIh7ZvKCMsqFjjnS7WJcOwJBK7akg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689792838; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Vo+68o4ae1OMN8arfg5JHB36jy3Jb+xa6AVl9hf+sH8=; b=oDxppGX8NubZF5XjWgQzZHcUF52CXeOkemAwS1I1dfaM3c4TtsYGDSKPeZ+eqsoaY1hu9d FtbWlFuyOdudYVbbp9NfrKUfdonDOouLL8Sw3IaAn+SGm+5P/x2378MAr2LO+Hz7wgi33l zU62lQy70X09nStLv2NPXnFoy7SUcv3hhfRLIrrTLF6ve69fxhbYaZPfifXgu/2pyVwDj1 IUBkUl+DtOzN/Y7RiB9C++YmGLXfpzs5Lb7vtKqoehNvYyfSoNjJhA9EtpUHHe9ikkJv4s +vTyvEom1xMXktsXAcqBL5ldrhGD2aZjGM+YyMN3PSUNlUU0gVgZBPSlD3fAJQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689792838; a=rsa-sha256; cv=none; b=mov87pNKtx0IugvR9IahywWN92h7l70vBztVk9wpGgxTjdq9s02rFasAV1LbOfefmRo3Wy RAG2aFUotdBX9dwZ8colrNUIJOyTbLBAe06m7bCukg7LD++tL6z+A/GuRGtX2HU7WWuUPs PQKvzX4uPNAMkDwa7bEjIpZbSUANDNK3/tYF2QETkVaFSLDII179y7AHlIiq+vxQZhN1Ll RsLpHn6G6FAc3zhSv5Dpt/4HtdA9GnC5EL/TkIf7aeiVdgw7zJKXtdVhc5QXt0yjqfhtNZ rr6TxcBiNLgQYck6E7Y9Zg+fyPxD8S+tLOhtjhOrlnWRudYpAqVzgn8bAnF65Q== 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 4R5lN63vklz10Dt; Wed, 19 Jul 2023 18:53: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 36JIrwuR065409; Wed, 19 Jul 2023 18:53:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36JIrwV0065408; Wed, 19 Jul 2023 18:53:58 GMT (envelope-from git) Date: Wed, 19 Jul 2023 18:53:58 GMT Message-Id: <202307191853.36JIrwV0065408@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: e5c4737955d5 - main - amd64 crt1: Explicitly use a PLT entry for main in the PIC case. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: e5c4737955d54d868e73a22beae7e8bb15703779 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=e5c4737955d54d868e73a22beae7e8bb15703779 commit e5c4737955d54d868e73a22beae7e8bb15703779 Author: John Baldwin AuthorDate: 2023-07-19 18:53:33 +0000 Commit: John Baldwin CommitDate: 2023-07-19 18:53:33 +0000 amd64 crt1: Explicitly use a PLT entry for main in the PIC case. This ensures GNU as generates a R_X86_64_PLT32 relocation instead of R_X86_64_32. Reviewed by: kib Fixes: c969310c992a csu: Implement _start using as to satisfy unwinders on x86_64 Differential Revision: https://reviews.freebsd.org/D41101 --- lib/csu/amd64/crt1_s.S | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/csu/amd64/crt1_s.S b/lib/csu/amd64/crt1_s.S index 0c1c3b960bda..f7ea076d94f1 100644 --- a/lib/csu/amd64/crt1_s.S +++ b/lib/csu/amd64/crt1_s.S @@ -60,10 +60,11 @@ _start: addq %rax, %rdx /* env += argc */ #ifdef PIC /* - * XXX. %rip relative addressing does not intended to use in the - * large memory model due to offset from %rip is limited to 32 bits. + * XXX. %rip relative addressing is not intended for use in the + * large memory model due to the offset from %rip being limited + * to 32 bits. */ - leaq main(%rip), %r8 + leaq main@plt(%rip), %r8 #else movabsq $main, %r8 #endif From nobody Wed Jul 19 19:02:46 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5lZK6n0vz4nXcf; Wed, 19 Jul 2023 19:02:49 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.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 "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R5lZK65Cyz3tZJ; Wed, 19 Jul 2023 19:02:49 +0000 (UTC) (envelope-from tijl@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689793369; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tbDqXrIevHDURYRlUxtw+E+8sGFdH3L6r3XoLTGTY5E=; b=hJFU0mOvvHlkZt4p4ORnGarMFaKZgzIzyvj0qZMc7pRCBeg4Lb/K7cJpt+MEUQfzsIqYLT qDB4laFUIWrTJjFMuLvT62t3XvzkeiVZhVnXt1LYR3J9becwjdQFKFiCqXZCPgM4ASuiv9 BIUOIa5HpzI2EtlLuLBrMl8EPmijQLifyv9aeOcMUbijkYY0JQ8MvYhiENGPbVKhEyYYx2 fCgxqovwnqo3kS7idlwhmNlSqyAms5iVeiV0ueCUNNi8JvYcWzB7MJ0h4MVtsqgMMbkwiN lA0fhoyseiuUka+MJibElQJsrUT6ewnqRO2aTV/YRTH26C6CvV9q+roL/10ijA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689793369; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tbDqXrIevHDURYRlUxtw+E+8sGFdH3L6r3XoLTGTY5E=; b=Weaq5pzXoH8S80ULeO75kRVXC+PAVoPo0CU7de2b+0EYzIxfG7eStMTrzRMSU1tJGybIXZ br33PiPmo2xA8nmO+Zy3unY6wO2xgoZ3/3zdCwmLuA4EZtqq8la28Gk0O4eG8e6g0SBPpr gOISzy8Z9FlwS7svdz4p0LsUJY6fi+1p/X0QSW2mukoFFxnFz684gLWhaMC79ZMn0LbT8j Pt8E4IgNjA0O0Z3f2a+HxoILvidDDpeDzwRPL2yW0PMmssFxPBiSNAQ0z3garOrN1hSlhm E54dnkdPK4c4EUpuV4CXAR0bpOUms1/3/n+8GlKFDEgBHe4oBq2aj0hSyKOn9g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689793369; a=rsa-sha256; cv=none; b=wap2/xkb0HbhmNEU3W/9hNquAgcbSLu6AAn6hoqZ3fHkgOorYg0CTb1GGhQBI0Vly0vnA4 NaSo2a191Hq+9RYBiCOqOyyV+TOX9THLFYpjxeYCdvAQzvgmrkAV1BSGtA349VcdKRUDNR YpF+yRR57+PqNVBujhm5pCyZflTOYhkPbHnHixesw3UkyADw6wpdI1Pdph+nFBazJoUJSj H6Ilj8wdMK/8C1fJx3AFH9X5h7Ohu4qnxlaFyZ8F/H/bjneV/5kGEfRDGd9YpqQ1mR3LGy ZuyryIgMMLPbsoHoOLVyzOlLUF3Ou/4QqQzEWd9mX2qbeKjkEP3ByF4hq2jXjw== Received: from hal.tijl.coosemans.org (unknown [IPv6:2a02:a03f:894b:4700:8583:8045:5320:f61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: tijl) by smtp.freebsd.org (Postfix) with ESMTPSA id 4R5lZK13pJz16bf; Wed, 19 Jul 2023 19:02:49 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Date: Wed, 19 Jul 2023 21:02:46 +0200 From: =?UTF-8?B?VMSzbA==?= Coosemans To: Dmitry Chagin Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: c84617e87a70 - main - i386: Switch to PIC kernel modules Message-ID: <20230719210246.30bf78b8@hal.tijl.coosemans.org> In-Reply-To: <202307191821.36JILaDo009337@gitrepo.freebsd.org> References: <202307191821.36JILaDo009337@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Wed, 19 Jul 2023 18:21:36 GMT Dmitry Chagin wrote: > The branch main has been updated by dchagin: > > URL: https://cgit.FreeBSD.org/src/commit/?id=c84617e87a70f4aea5df46fa521835aefa7d8163 > > commit c84617e87a70f4aea5df46fa521835aefa7d8163 > Author: Dmitry Chagin > AuthorDate: 2023-07-19 18:21:04 +0000 > Commit: Dmitry Chagin > CommitDate: 2023-07-19 18:21:04 +0000 > > i386: Switch to PIC kernel modules > > It seems since the last llvm project update, the lld linker has started > creating a PLT dependent kernel module object files. > > Reviewed by: kib, jhb, emaste > Differential Revision: https://reviews.freebsd.org/D41088 > --- > sys/conf/kmod.mk | 2 +- > sys/i386/i386/elf_machdep.c | 1 + > 2 files changed, 2 insertions(+), 1 deletion(-) > > diff --git a/sys/conf/kmod.mk b/sys/conf/kmod.mk > index 246af5ba1e81..a83d64eb8bf7 100644 > --- a/sys/conf/kmod.mk > +++ b/sys/conf/kmod.mk > @@ -166,7 +166,7 @@ CFLAGS+= -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer > .endif > > .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "riscv" || \ > - ${MACHINE_CPUARCH} == "powerpc" > + ${MACHINE_CPUARCH} == "powerpc" || ${MACHINE_CPUARCH} == "i386" > CFLAGS+= -fPIC > .endif > > diff --git a/sys/i386/i386/elf_machdep.c b/sys/i386/i386/elf_machdep.c > index d8b7ab9c586b..5d8b41a16672 100644 > --- a/sys/i386/i386/elf_machdep.c > +++ b/sys/i386/i386/elf_machdep.c > @@ -244,6 +244,7 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbase, const void *data, > break; > > case R_386_GLOB_DAT: /* S */ > + case R_386_JMP_SLOT: /* S */ > error = lookup(lf, symidx, 1, &addr); > if (error != 0) > return (-1); Is it this bug: https://bugs.llvm.org/show_bug.cgi?id=51736 ? From nobody Wed Jul 19 19:20:41 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5lz72Twxz4njGp; Wed, 19 Jul 2023 19:20:51 +0000 (UTC) (envelope-from dchagin@heemeyer.club) Received: from heemeyer.club (heemeyer.club [195.93.173.158]) (using TLSv1.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 mx1.freebsd.org (Postfix) with ESMTPS id 4R5lz636Gzz42sN; Wed, 19 Jul 2023 19:20:50 +0000 (UTC) (envelope-from dchagin@heemeyer.club) Authentication-Results: mx1.freebsd.org; none Received: from heemeyer.club (localhost [127.0.0.1]) by heemeyer.club (8.17.2/8.16.1) with ESMTP id 36JJKf7w003638; Wed, 19 Jul 2023 22:20:41 +0300 (MSK) (envelope-from dchagin@heemeyer.club) Received: (from dchagin@localhost) by heemeyer.club (8.17.2/8.16.1/Submit) id 36JJKfUD003637; Wed, 19 Jul 2023 22:20:41 +0300 (MSK) (envelope-from dchagin) Date: Wed, 19 Jul 2023 22:20:41 +0300 From: Dmitry Chagin To: =?utf-8?Q?T=C4=B3l?= Coosemans Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: c84617e87a70 - main - i386: Switch to PIC kernel modules Message-ID: References: <202307191821.36JILaDo009337@gitrepo.freebsd.org> <20230719210246.30bf78b8@hal.tijl.coosemans.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230719210246.30bf78b8@hal.tijl.coosemans.org> X-Rspamd-Queue-Id: 4R5lz636Gzz42sN X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:61400, ipnet:195.93.173.0/24, country:RU] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated On Wed, Jul 19, 2023 at 09:02:46PM +0200, Tijl Coosemans wrote: > On Wed, 19 Jul 2023 18:21:36 GMT Dmitry Chagin wrote: > > The branch main has been updated by dchagin: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=c84617e87a70f4aea5df46fa521835aefa7d8163 > > > > commit c84617e87a70f4aea5df46fa521835aefa7d8163 > > Author: Dmitry Chagin > > AuthorDate: 2023-07-19 18:21:04 +0000 > > Commit: Dmitry Chagin > > CommitDate: 2023-07-19 18:21:04 +0000 > > > > i386: Switch to PIC kernel modules > > > > It seems since the last llvm project update, the lld linker has started > > creating a PLT dependent kernel module object files. > > > > Reviewed by: kib, jhb, emaste > > Differential Revision: https://reviews.freebsd.org/D41088 > > --- > > sys/conf/kmod.mk | 2 +- > > sys/i386/i386/elf_machdep.c | 1 + > > 2 files changed, 2 insertions(+), 1 deletion(-) > > > > diff --git a/sys/conf/kmod.mk b/sys/conf/kmod.mk > > index 246af5ba1e81..a83d64eb8bf7 100644 > > --- a/sys/conf/kmod.mk > > +++ b/sys/conf/kmod.mk > > @@ -166,7 +166,7 @@ CFLAGS+= -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer > > .endif > > > > .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "riscv" || \ > > - ${MACHINE_CPUARCH} == "powerpc" > > + ${MACHINE_CPUARCH} == "powerpc" || ${MACHINE_CPUARCH} == "i386" > > CFLAGS+= -fPIC > > .endif > > > > diff --git a/sys/i386/i386/elf_machdep.c b/sys/i386/i386/elf_machdep.c > > index d8b7ab9c586b..5d8b41a16672 100644 > > --- a/sys/i386/i386/elf_machdep.c > > +++ b/sys/i386/i386/elf_machdep.c > > @@ -244,6 +244,7 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbase, const void *data, > > break; > > > > case R_386_GLOB_DAT: /* S */ > > + case R_386_JMP_SLOT: /* S */ > > error = lookup(lf, symidx, 1, &addr); > > if (error != 0) > > return (-1); > > Is it this bug: https://bugs.llvm.org/show_bug.cgi?id=51736 ? I think this is it From nobody Wed Jul 19 23:37:53 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5sgk1z2kz4nt0v; Wed, 19 Jul 2023 23:37: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 4R5sgk0LXqz4LwX; Wed, 19 Jul 2023 23:37:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689809874; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gZ86NUyN2zHvdNk8kCdkkXN5ngfOHOfsocdFHOtdzCQ=; b=IAdYqAegQzbkz7o21v4xrL57AcSHoLn+wkYINfdNSBd3dLvXE63kmNdpXfGAGN01uPxBtO B6gDn6vX2kQxACCTTtxO21H9niZyUZoIhcoottGU9r9urGL4jTyKkj/I18YOh9Yd/rviSt uBT0+0jDnVZeU+lynkvDtkcpyC5bKPpRacpKftrcUKE9iB3h2z752aG05553CVOIypcVgV 6lDrXN32EODjMlI5oawPJe/493S9gHTL4elQTOKm8nmmk/KkiN43sPyiWU8l1TDCTWwMVe O9hY9Tw1QSbr14dy27C7cekBdt0S6Kx5U2JzntaingFfeU+lxPc+pfEV+nXy9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689809874; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gZ86NUyN2zHvdNk8kCdkkXN5ngfOHOfsocdFHOtdzCQ=; b=gJwcUtY7IdPmcoZwOt28uuWAFq3cw/FHJnPCS6nwW0EOCS6Z0UQQNj916gGhYnQyH/pYhc PcKpBbQXhD38PgkMDXjcjlplbP/Q14XZ8X/iI/IWOUZ44xZZecyS/7ueHvV4WN3JHUvdxM 0U7vuw0dbUsdC/XfV17yr6QPF5eklAtU8Sg3za5aH7AYC//mKFzmKiZBs2/8X6UVNmobXJ yLIQs5WSprxyR8UMDvsqRkd969yL1RjhgUjfW9bF9qE5TFEsznRK8NhPXFiQIbk6UbdXJG QPv2nimUcKwakVQWVaQBcKNWH7Tavw1N2T7xZ6jptkmv6ARSTjbkmedq2DxQ/g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689809874; a=rsa-sha256; cv=none; b=WXUGv4k4B+igQGSqrNUjiSgMNZUyYQUI5cEbFT+0NnL/OHMc3znH2xhWPd4BbLhv20IIUT TLvmQULUH6WoXwEobFmvREylY3xIsdFFBiaGzd/cFDBX3DCOrZ6tYi4fElfrJb0gME6Rj8 JvhEmi7cCi5YsnU+L6ZaQT41Wd/fktaVZTVP+TDzKTG1XhzzU4x2cVQ3r71TxCsZtV++us R7shsO0cYfkj1m0Rpb1JDfPrXHR0vWhZ1qF1NCzE7MxsOyjJlMxT4XvKnVmDz0MZPVlDs0 OAWz6dUPn7xn7Sk8iSDfzvHDMfqujAHt6JPv3q6SbqLH+6I8EnhWfkpQnD681g== 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 4R5sgj6Xz3z17C3; Wed, 19 Jul 2023 23:37:53 +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 36JNbrx1031273; Wed, 19 Jul 2023 23:37:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36JNbrLi031272; Wed, 19 Jul 2023 23:37:53 GMT (envelope-from git) Date: Wed, 19 Jul 2023 23:37:53 GMT Message-Id: <202307192337.36JNbrLi031272@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Eric Joyner Subject: git: a52f23f4c49e - main - iflib: Unlock ctx lock around call to ether_ifattach() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: erj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a52f23f4c49e4766fb9eb0bf460cc83c5f63f17d Auto-Submitted: auto-generated The branch main has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=a52f23f4c49e4766fb9eb0bf460cc83c5f63f17d commit a52f23f4c49e4766fb9eb0bf460cc83c5f63f17d Author: Eric Joyner AuthorDate: 2023-07-19 22:40:46 +0000 Commit: Eric Joyner CommitDate: 2023-07-19 22:51:26 +0000 iflib: Unlock ctx lock around call to ether_ifattach() Panic occurs during loading driver using kldload. It exists since netlink is enabled. There is problem with double locking ctx. This fix allows to call ether_ifattach() without locked ctx. Signed-off-by: Eric Joyner PR: 271768 Reviewed by: erj@, jhb@ MFC after: 1 day Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D40557 --- sys/net/iflib.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/net/iflib.c b/sys/net/iflib.c index d056570d9a99..9f433481afda 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -5386,7 +5386,13 @@ iflib_device_register(device_t dev, void *sc, if_shared_ctx_t sctx, if_ctx_t *ct goto fail_queues; } + /* + * It prevents a double-locking panic with iflib_media_status when + * the driver loads. + */ + CTX_UNLOCK(ctx); ether_ifattach(ctx->ifc_ifp, ctx->ifc_mac.octet); + CTX_LOCK(ctx); if ((err = IFDI_ATTACH_POST(ctx)) != 0) { device_printf(dev, "IFDI_ATTACH_POST failed %d\n", err); From nobody Thu Jul 20 14:12:13 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6F4Y5Zkyz4nqjM; Thu, 20 Jul 2023 14:12: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 4R6F4Y3y0Xz3R2L; Thu, 20 Jul 2023 14:12:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689862333; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uU1BW/5atvujpVPuQQsFahOcwaLwgquIjeOvmw0r/G4=; b=YShh8c4cM6ppRfJGL7Q1kwMdimBhBE4cDYno/Ivua/9O+T/7kb/lIjDBay25md1KOv2vZV EgYTGN5uQ53PBx8CXZ6fXPsfeh/DsIhby8x6uFo0AJVVcReL/mdeq7SiBAdP1lNPYPRHHd N3DEN+r2ZJ10oWByPK6X9nOF4BCsTeo2VXvrYbnl/7wK0YVFlYo6gpE0SP4l647GOBZi7X JE57AHxS8uRAwvSFZb1Oaciqe5TOGum6jaAgRbO3Wz9xSDFdJRTbsloJclQT+jpuEMfPwK bDYI0yXozFq6TpfYvjaDbxDqHY0aBTgjt00CKwfaOuAbHYGWMy5bLwlRnbpZOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689862333; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uU1BW/5atvujpVPuQQsFahOcwaLwgquIjeOvmw0r/G4=; b=s1k52jTNAiE5etv2yW+UdoSSWZdQ90gaod6gYOpTDvCrp+dPKgOqhjg1jcvxaogfFFLAkH xcorvkOvnvXZF05WXlAnIMuy0PdP4OYbPJb4nyduLyqmXJkY/eRLswDlxaI8jlzLm/i1j1 edSl0wE2sDV7IkldfGOtq2dNJszAhLYZElq0WZRHGLhDIBQ2jVsjmP8Mvi8X51KNLeYlvy 67xDtij4ZnjAo8auZiVuUXmGK4afF1Pb8lKP4H5X8m5wH8sTagzht/d3rDN7J/9E2+B6zi p5d2h79lQm4swwcpdHDdfv2InE8hi/+YHwBgyotQoUOYicU//RilkCff26vfGQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689862333; a=rsa-sha256; cv=none; b=BpUnslLWcsuSEjlBSR6YlYkwnlOVk6HtR3PrJ9oQ8DrSaTHnsJJ8bbxIJA0elgw0sM/3XF taUYSiC/98TWeVM3quic0hpfAIgG0JB/WXoJw1Ztg4prWVHc1d5nG6msVe1t1ld/f26E9c 5lPGL9Tc8MZjUdPYyJBdtuMWB/JQjH4qg183ekyJK1mm8flWQ/KF7xlBpcCsHnzTuDqbDn FG/Wch7LgK9UymUAW7dAGTP32Yv0wR144ozNTv4eHm7C0bwkwtox85Jvn2Px9XaiM/JeF0 fmjHvXJZzOjeEbqMZwXfM90gZn5fwUy7lcaVOQ3H7lsYHJ2/OkWX2Z7YI6q+/g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R6F4Y31dLzYgl; Thu, 20 Jul 2023 14:12: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 36KECDko084919; Thu, 20 Jul 2023 14:12:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36KECDSU084918; Thu, 20 Jul 2023 14:12:13 GMT (envelope-from git) Date: Thu, 20 Jul 2023 14:12:13 GMT Message-Id: <202307201412.36KECDSU084918@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 21e45c30c35c - main - mmap(MAP_STACK): on stack grow, use original protection List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 21e45c30c35c9aa732073f725924caf581c93460 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=21e45c30c35c9aa732073f725924caf581c93460 commit 21e45c30c35c9aa732073f725924caf581c93460 Author: Konstantin Belousov AuthorDate: 2023-07-19 11:05:32 +0000 Commit: Konstantin Belousov CommitDate: 2023-07-20 14:11:42 +0000 mmap(MAP_STACK): on stack grow, use original protection If mprotect(2) changed protection in the bottom of the currently grown stack region, currently the changed protection would be used for the stack grow on next fault. This is arguably unexpected. Store the original protection for the entry at mmap(2) time in the offset member of the gap vm_map_entry, and use it for protection of the grown stack region. PR: 272585 Reported by: John F. Carr Reviewed by: alc, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D41089 --- sys/vm/vm_map.c | 24 ++++++++++++++++-------- sys/vm/vm_map.h | 4 ++++ 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c index a02107b5e64d..997a49111a59 100644 --- a/sys/vm/vm_map.c +++ b/sys/vm/vm_map.c @@ -4493,7 +4493,7 @@ static int vm_map_stack_locked(vm_map_t map, vm_offset_t addrbos, vm_size_t max_ssize, vm_size_t growsize, vm_prot_t prot, vm_prot_t max, int cow) { - vm_map_entry_t new_entry, prev_entry; + vm_map_entry_t gap_entry, new_entry, prev_entry; vm_offset_t bot, gap_bot, gap_top, top; vm_size_t init_ssize, sgp; int orient, rv; @@ -4575,11 +4575,14 @@ vm_map_stack_locked(vm_map_t map, vm_offset_t addrbos, vm_size_t max_ssize, * read-ahead logic is never used for it. Re-use * next_read of the gap entry to store * stack_guard_page for vm_map_growstack(). + * Similarly, since a gap cannot have a backing object, + * store the original stack protections in the + * object offset. */ - if (orient == MAP_STACK_GROWS_DOWN) - vm_map_entry_pred(new_entry)->next_read = sgp; - else - vm_map_entry_succ(new_entry)->next_read = sgp; + gap_entry = orient == MAP_STACK_GROWS_DOWN ? + vm_map_entry_pred(new_entry) : vm_map_entry_succ(new_entry); + gap_entry->next_read = sgp; + gap_entry->offset = prot; } else { (void)vm_map_delete(map, bot, top); } @@ -4599,6 +4602,7 @@ vm_map_growstack(vm_map_t map, vm_offset_t addr, vm_map_entry_t gap_entry) struct ucred *cred; vm_offset_t gap_end, gap_start, grow_start; vm_size_t grow_amount, guard, max_grow; + vm_prot_t prot; rlim_t lmemlim, stacklim, vmemlim; int rv, rv1 __diagused; bool gap_deleted, grow_down, is_procstack; @@ -4739,6 +4743,12 @@ retry: } if (grow_down) { + /* + * The gap_entry "offset" field is overloaded. See + * vm_map_stack_locked(). + */ + prot = gap_entry->offset; + grow_start = gap_entry->end - grow_amount; if (gap_entry->start + grow_amount == gap_entry->end) { gap_start = gap_entry->start; @@ -4751,9 +4761,7 @@ retry: gap_deleted = false; } rv = vm_map_insert(map, NULL, 0, grow_start, - grow_start + grow_amount, - stack_entry->protection, stack_entry->max_protection, - MAP_STACK_GROWS_DOWN); + grow_start + grow_amount, prot, prot, MAP_STACK_GROWS_DOWN); if (rv != KERN_SUCCESS) { if (gap_deleted) { rv1 = vm_map_insert(map, NULL, 0, gap_start, diff --git a/sys/vm/vm_map.h b/sys/vm/vm_map.h index fd8b606e8ddc..c4ed36ce57ba 100644 --- a/sys/vm/vm_map.h +++ b/sys/vm/vm_map.h @@ -97,6 +97,10 @@ union vm_map_object { * a VM object (or sharing map) and offset into that object, * and user-exported inheritance and protection information. * Also included is control information for virtual copy operations. + * + * For stack gap map entries (MAP_ENTRY_GUARD | MAP_ENTRY_GROWS_DOWN + * or UP), the next_read member is reused as the stack_guard_page + * storage, and offset is the stack protection. */ struct vm_map_entry { struct vm_map_entry *left; /* left child or previous entry */ From nobody Thu Jul 20 16:32:31 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6JBW0C1Cz4p2cS; Thu, 20 Jul 2023 16:32:35 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta002.cacentral1.a.cloudfilter.net (omta002.cacentral1.a.cloudfilter.net [3.97.99.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6JBV59qfz4Sjf; Thu, 20 Jul 2023 16:32:34 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; none Received: from shw-obgw-4003a.ext.cloudfilter.net ([10.228.9.183]) by cmsmtp with ESMTP id MSWbqYx0t6NwhMWZtqRVR6; Thu, 20 Jul 2023 16:32:33 +0000 Received: from spqr.komquats.com ([70.66.152.170]) by cmsmtp with ESMTPA id MWZsqoyTrcyvuMWZsqaCWh; Thu, 20 Jul 2023 16:32:33 +0000 X-Authority-Analysis: v=2.4 cv=VbHkgXl9 c=1 sm=1 tr=0 ts=64b961a1 a=y8EK/9tc/U6QY+pUhnbtgQ==:117 a=y8EK/9tc/U6QY+pUhnbtgQ==:17 a=kj9zAlcOel0A:10 a=ws7JD89P4LkA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=EkcXrb_YAAAA:8 a=AgNmJdvoGADqlrMAvFoA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id BD0831F4; Thu, 20 Jul 2023 09:32:31 -0700 (PDT) Received: by slippy.cwsent.com (Postfix, from userid 1000) id B1D4277; Thu, 20 Jul 2023 09:32:31 -0700 (PDT) X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.8+dev Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Konstantin Belousov cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 21e45c30c35c - main - mmap(MAP_STACK): on stack grow, use original protection In-reply-to: <202307201412.36KECDSU084918@gitrepo.freebsd.org> References: <202307201412.36KECDSU084918@gitrepo.freebsd.org> Comments: In-reply-to Konstantin Belousov message dated "Thu, 20 Jul 2023 14:12:13 +0000." List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 20 Jul 2023 09:32:31 -0700 Message-Id: <20230720163231.B1D4277@slippy.cwsent.com> X-CMAE-Envelope: MS4xfCyzJH2+ea3LaynOo/eHGeChIdKRBnjqQ/RuZnsNlgd8pHX0uUbtqrzXkBodnTB5ad6glSyq1ME4iPQNNataUzJxvowp2+t9dtzBhqEyGXG5juwAXjzy d859/2FX5Ibj/jmCKbqTC8i0eHClRWtS8z0Ji/vevcmxeK4dBrEj0k5FHu7MfI8iSMCUkU7+issw2bAOhRWF1fWYTBT9WRYMSz3jubysGB93yXse5vqD8mZ3 WU1jhf3gtCvHczqS/sOI2yIxTK9bFIxqgc9nL+QxvzfLdxKTupxNm/yqdGIlUIX9z/csCCHxRcOcQ3yq6zeaZzfMehxjEcSdkXUCE3dZkd4= X-Rspamd-Queue-Id: 4R6JBV59qfz4Sjf X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:16509, ipnet:3.96.0.0/15, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated In message <202307201412.36KECDSU084918@gitrepo.freebsd.org>, Konstantin Belous ov writes: > The branch main has been updated by kib: > > URL: https://cgit.FreeBSD.org/src/commit/?id=21e45c30c35c9aa732073f725924caf5 > 81c93460 > > commit 21e45c30c35c9aa732073f725924caf581c93460 > Author: Konstantin Belousov > AuthorDate: 2023-07-19 11:05:32 +0000 > Commit: Konstantin Belousov > CommitDate: 2023-07-20 14:11:42 +0000 > > mmap(MAP_STACK): on stack grow, use original protection > > If mprotect(2) changed protection in the bottom of the currently grown > stack region, currently the changed protection would be used for the > stack grow on next fault. This is arguably unexpected. > > Store the original protection for the entry at mmap(2) time in the > offset member of the gap vm_map_entry, and use it for protection of the > grown stack region. > > PR: 272585 > Reported by: John F. Carr > Reviewed by: alc, markj > Sponsored by: The FreeBSD Foundation > MFC after: 1 week > Differential revision: https://reviews.freebsd.org/D41089 > --- > sys/vm/vm_map.c | 24 ++++++++++++++++-------- > sys/vm/vm_map.h | 4 ++++ > 2 files changed, 20 insertions(+), 8 deletions(-) > > diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c > index a02107b5e64d..997a49111a59 100644 > --- a/sys/vm/vm_map.c > +++ b/sys/vm/vm_map.c > @@ -4493,7 +4493,7 @@ static int > vm_map_stack_locked(vm_map_t map, vm_offset_t addrbos, vm_size_t max_ssize, > vm_size_t growsize, vm_prot_t prot, vm_prot_t max, int cow) > { > - vm_map_entry_t new_entry, prev_entry; > + vm_map_entry_t gap_entry, new_entry, prev_entry; > vm_offset_t bot, gap_bot, gap_top, top; > vm_size_t init_ssize, sgp; > int orient, rv; > @@ -4575,11 +4575,14 @@ vm_map_stack_locked(vm_map_t map, vm_offset_t addrbos > , vm_size_t max_ssize, > * read-ahead logic is never used for it. Re-use > * next_read of the gap entry to store > * stack_guard_page for vm_map_growstack(). > + * Similarly, since a gap cannot have a backing object, > + * store the original stack protections in the > + * object offset. > */ > - if (orient == MAP_STACK_GROWS_DOWN) > - vm_map_entry_pred(new_entry)->next_read = sgp; > - else > - vm_map_entry_succ(new_entry)->next_read = sgp; > + gap_entry = orient == MAP_STACK_GROWS_DOWN ? > + vm_map_entry_pred(new_entry) : vm_map_entry_succ(new_entry) > ; > + gap_entry->next_read = sgp; > + gap_entry->offset = prot; > } else { > (void)vm_map_delete(map, bot, top); > } > @@ -4599,6 +4602,7 @@ vm_map_growstack(vm_map_t map, vm_offset_t addr, vm_map > _entry_t gap_entry) > struct ucred *cred; > vm_offset_t gap_end, gap_start, grow_start; > vm_size_t grow_amount, guard, max_grow; > + vm_prot_t prot; > rlim_t lmemlim, stacklim, vmemlim; > int rv, rv1 __diagused; > bool gap_deleted, grow_down, is_procstack; > @@ -4739,6 +4743,12 @@ retry: > } > > if (grow_down) { > + /* > + * The gap_entry "offset" field is overloaded. See > + * vm_map_stack_locked(). > + */ > + prot = gap_entry->offset; > + > grow_start = gap_entry->end - grow_amount; > if (gap_entry->start + grow_amount == gap_entry->end) { > gap_start = gap_entry->start; > @@ -4751,9 +4761,7 @@ retry: > gap_deleted = false; > } > rv = vm_map_insert(map, NULL, 0, grow_start, > - grow_start + grow_amount, > - stack_entry->protection, stack_entry->max_protection, > - MAP_STACK_GROWS_DOWN); > + grow_start + grow_amount, prot, prot, MAP_STACK_GROWS_DOWN) > ; > if (rv != KERN_SUCCESS) { > if (gap_deleted) { > rv1 = vm_map_insert(map, NULL, 0, gap_start, > diff --git a/sys/vm/vm_map.h b/sys/vm/vm_map.h > index fd8b606e8ddc..c4ed36ce57ba 100644 > --- a/sys/vm/vm_map.h > +++ b/sys/vm/vm_map.h > @@ -97,6 +97,10 @@ union vm_map_object { > * a VM object (or sharing map) and offset into that object, > * and user-exported inheritance and protection information. > * Also included is control information for virtual copy operations. > + * > + * For stack gap map entries (MAP_ENTRY_GUARD | MAP_ENTRY_GROWS_DOWN > + * or UP), the next_read member is reused as the stack_guard_page > + * storage, and offset is the stack protection. > */ > struct vm_map_entry { > struct vm_map_entry *left; /* left child or previous entry */ > This commit has caused screen (sysutils/screen) to display the following error when opening a new screen window (ctrl-A c): pid 28473 comm screen-4.9.0 has trashed its stack, killing -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e^(i*pi)+1=0 From nobody Thu Jul 20 16:41:44 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6JP85J9qz4p6WW; Thu, 20 Jul 2023 16:41:48 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta002.cacentral1.a.cloudfilter.net (omta002.cacentral1.a.cloudfilter.net [3.97.99.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6JP81d27z4W0v; Thu, 20 Jul 2023 16:41:48 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; dkim=none; spf=none (mx1.freebsd.org: domain of cy.schubert@cschubert.com has no SPF policy when checking 3.97.99.33) smtp.mailfrom=cy.schubert@cschubert.com; dmarc=none Received: from shw-obgw-4001a.ext.cloudfilter.net ([10.228.9.142]) by cmsmtp with ESMTP id MSWmqYx1s6NwhMWipqRXw9; Thu, 20 Jul 2023 16:41:47 +0000 Received: from spqr.komquats.com ([70.66.152.170]) by cmsmtp with ESMTPA id MWinquOqLHFsOMWioqzT1d; Thu, 20 Jul 2023 16:41:47 +0000 X-Authority-Analysis: v=2.4 cv=XZqaca15 c=1 sm=1 tr=0 ts=64b963cb a=y8EK/9tc/U6QY+pUhnbtgQ==:117 a=y8EK/9tc/U6QY+pUhnbtgQ==:17 a=kj9zAlcOel0A:10 a=ws7JD89P4LkA:10 a=VxmjJ2MpAAAA:8 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=EkcXrb_YAAAA:8 a=oCdtv4dIwIuyiO_v0G0A:9 a=CjuIK1q_8ugA:10 a=QHqjWXHE9tEA:10 a=UJ0tAi3fqDAA:10 a=7gXAzLPJhVmCkEl4_tsf:22 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id 378CB28A; Thu, 20 Jul 2023 09:41:45 -0700 (PDT) Received: by slippy.cwsent.com (Postfix, from userid 1000) id 0CF1311F; Thu, 20 Jul 2023 09:41:44 -0700 (PDT) X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.8+dev Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Konstantin Belousov , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 21e45c30c35c - main - mmap(MAP_STACK): on stack grow, use original protection In-reply-to: <20230720163231.B1D4277@slippy.cwsent.com> References: <202307201412.36KECDSU084918@gitrepo.freebsd.org> <20230720163231.B1D4277@slippy.cwsent.com> Comments: In-reply-to Cy Schubert message dated "Thu, 20 Jul 2023 09:32:31 -0700." List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 20 Jul 2023 09:41:44 -0700 Message-Id: <20230720164145.0CF1311F@slippy.cwsent.com> X-CMAE-Envelope: MS4xfA4WLVKtnj8DUxFtsNRozpGV97JXkXFE19dYRXM/h5rlj4WiasnMkQDu+7P7EYTiZo060CRSscQPRDRT5EqGcrhoEqQ1zbsxZxqp8EJ+Mb06yLLOHQdv +b8yBS/NyruwpUWHqQhis4Yq9bIlHL9jycFmOFiBAhEJtI6I6Bx27ZUqqTM1MNb1DiddEuPXWxK8EeFCoB4u6RTKbM46c+3ClT4LHTR4TEyiJxvJOUk5FUdd UK205CuM4O24tHBX/S1ymmPpKN80IKLNUevQ62V14o34pKankiwAuu9zyWbLmqx+cmde87z7LhsQ7KZoc8GI7N6z4vS/D5KJTVqy5hJGG2E= X-Spamd-Result: default: False [-1.70 / 15.00]; AUTH_NA(1.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.998]; MV_CASE(0.50)[]; RCVD_IN_DNSWL_LOW(-0.10)[3.97.99.33:from]; MIME_GOOD(-0.10)[text/plain]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org,dev-commits-src-all@freebsd.org]; ASN(0.00)[asn:16509, ipnet:3.96.0.0/15, country:US]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; FROM_EQ_ENVFROM(0.00)[]; R_SPF_NA(0.00)[no SPF record]; TO_DN_SOME(0.00)[]; ARC_NA(0.00)[]; REPLYTO_EQ_FROM(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_LAST(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; DMARC_NA(0.00)[cschubert.com]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com] X-Rspamd-Queue-Id: 4R6JP81d27z4W0v X-Spamd-Bar: - In message <20230720163231.B1D4277@slippy.cwsent.com>, Cy Schubert writes: > In message <202307201412.36KECDSU084918@gitrepo.freebsd.org>, Konstantin > Belous > ov writes: > > The branch main has been updated by kib: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=21e45c30c35c9aa732073f725924ca > f5 > > 81c93460 > > > > commit 21e45c30c35c9aa732073f725924caf581c93460 > > Author: Konstantin Belousov > > AuthorDate: 2023-07-19 11:05:32 +0000 > > Commit: Konstantin Belousov > > CommitDate: 2023-07-20 14:11:42 +0000 > > > > mmap(MAP_STACK): on stack grow, use original protection > > > > If mprotect(2) changed protection in the bottom of the currently grown > > stack region, currently the changed protection would be used for the > > stack grow on next fault. This is arguably unexpected. > > > > Store the original protection for the entry at mmap(2) time in the > > offset member of the gap vm_map_entry, and use it for protection of the > > grown stack region. > > > > PR: 272585 > > Reported by: John F. Carr > > Reviewed by: alc, markj > > Sponsored by: The FreeBSD Foundation > > MFC after: 1 week > > Differential revision: https://reviews.freebsd.org/D41089 > > --- > > sys/vm/vm_map.c | 24 ++++++++++++++++-------- > > sys/vm/vm_map.h | 4 ++++ > > 2 files changed, 20 insertions(+), 8 deletions(-) > > > > diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c > > index a02107b5e64d..997a49111a59 100644 > > --- a/sys/vm/vm_map.c > > +++ b/sys/vm/vm_map.c > > @@ -4493,7 +4493,7 @@ static int > > vm_map_stack_locked(vm_map_t map, vm_offset_t addrbos, vm_size_t max_ssize > , > > vm_size_t growsize, vm_prot_t prot, vm_prot_t max, int cow) > > { > > - vm_map_entry_t new_entry, prev_entry; > > + vm_map_entry_t gap_entry, new_entry, prev_entry; > > vm_offset_t bot, gap_bot, gap_top, top; > > vm_size_t init_ssize, sgp; > > int orient, rv; > > @@ -4575,11 +4575,14 @@ vm_map_stack_locked(vm_map_t map, vm_offset_t addrb > os > > , vm_size_t max_ssize, > > * read-ahead logic is never used for it. Re-use > > * next_read of the gap entry to store > > * stack_guard_page for vm_map_growstack(). > > + * Similarly, since a gap cannot have a backing object, > > + * store the original stack protections in the > > + * object offset. > > */ > > - if (orient == MAP_STACK_GROWS_DOWN) > > - vm_map_entry_pred(new_entry)->next_read = sgp; > > - else > > - vm_map_entry_succ(new_entry)->next_read = sgp; > > + gap_entry = orient == MAP_STACK_GROWS_DOWN ? > > + vm_map_entry_pred(new_entry) : vm_map_entry_succ(new_entry) > > ; > > + gap_entry->next_read = sgp; > > + gap_entry->offset = prot; > > } else { > > (void)vm_map_delete(map, bot, top); > > } > > @@ -4599,6 +4602,7 @@ vm_map_growstack(vm_map_t map, vm_offset_t addr, vm_m > ap > > _entry_t gap_entry) > > struct ucred *cred; > > vm_offset_t gap_end, gap_start, grow_start; > > vm_size_t grow_amount, guard, max_grow; > > + vm_prot_t prot; > > rlim_t lmemlim, stacklim, vmemlim; > > int rv, rv1 __diagused; > > bool gap_deleted, grow_down, is_procstack; > > @@ -4739,6 +4743,12 @@ retry: > > } > > > > if (grow_down) { > > + /* > > + * The gap_entry "offset" field is overloaded. See > > + * vm_map_stack_locked(). > > + */ > > + prot = gap_entry->offset; > > + > > grow_start = gap_entry->end - grow_amount; > > if (gap_entry->start + grow_amount == gap_entry->end) { > > gap_start = gap_entry->start; > > @@ -4751,9 +4761,7 @@ retry: > > gap_deleted = false; > > } > > rv = vm_map_insert(map, NULL, 0, grow_start, > > - grow_start + grow_amount, > > - stack_entry->protection, stack_entry->max_protection, > > - MAP_STACK_GROWS_DOWN); > > + grow_start + grow_amount, prot, prot, MAP_STACK_GROWS_DOWN) > > ; > > if (rv != KERN_SUCCESS) { > > if (gap_deleted) { > > rv1 = vm_map_insert(map, NULL, 0, gap_start, > > diff --git a/sys/vm/vm_map.h b/sys/vm/vm_map.h > > index fd8b606e8ddc..c4ed36ce57ba 100644 > > --- a/sys/vm/vm_map.h > > +++ b/sys/vm/vm_map.h > > @@ -97,6 +97,10 @@ union vm_map_object { > > * a VM object (or sharing map) and offset into that object, > > * and user-exported inheritance and protection information. > > * Also included is control information for virtual copy operations. > > + * > > + * For stack gap map entries (MAP_ENTRY_GUARD | MAP_ENTRY_GROWS_DOWN > > + * or UP), the next_read member is reused as the stack_guard_page > > + * storage, and offset is the stack protection. > > */ > > struct vm_map_entry { > > struct vm_map_entry *left; /* left child or previous entry */ > > > > This commit has caused screen (sysutils/screen) to display the following > error when opening a new screen window (ctrl-A c): > > pid 28473 comm screen-4.9.0 has trashed its stack, killing > > > -- > Cheers, > Cy Schubert > FreeBSD UNIX: Web: https://FreeBSD.org > NTP: Web: https://nwtime.org > > e^(i*pi)+1=0 > > I'm also seeing artifacts in emails by nmh (mail/nmh) in my sent directory and in the email cc'd to me. -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e^(i*pi)+1=0 From nobody Thu Jul 20 17:06:24 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6Jxc2Jsqz4dQL7; Thu, 20 Jul 2023 17:06:28 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta002.cacentral1.a.cloudfilter.net (omta002.cacentral1.a.cloudfilter.net [3.97.99.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6Jxb25K6z4dyS; Thu, 20 Jul 2023 17:06:27 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; dkim=none; spf=none (mx1.freebsd.org: domain of cy.schubert@cschubert.com has no SPF policy when checking 3.97.99.33) smtp.mailfrom=cy.schubert@cschubert.com; dmarc=none Received: from shw-obgw-4002a.ext.cloudfilter.net ([10.228.9.250]) by cmsmtp with ESMTP id MPsKqYs7c6NwhMX6gqRf19; Thu, 20 Jul 2023 17:06:26 +0000 Received: from spqr.komquats.com ([70.66.152.170]) by cmsmtp with ESMTPA id MX6fqGyBCyAOeMX6gq85aq; Thu, 20 Jul 2023 17:06:26 +0000 X-Authority-Analysis: v=2.4 cv=e5oV9Il/ c=1 sm=1 tr=0 ts=64b96992 a=y8EK/9tc/U6QY+pUhnbtgQ==:117 a=y8EK/9tc/U6QY+pUhnbtgQ==:17 a=kj9zAlcOel0A:10 a=ws7JD89P4LkA:10 a=VxmjJ2MpAAAA:8 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=EkcXrb_YAAAA:8 a=8ToWh4kbUNh_1jlTTwUA:9 a=CjuIK1q_8ugA:10 a=8k-k-Cn0ORkA:10 a=QHqjWXHE9tEA:10 a=UJ0tAi3fqDAA:10 a=7gXAzLPJhVmCkEl4_tsf:22 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id C809E2CB; Thu, 20 Jul 2023 10:06:24 -0700 (PDT) Received: by slippy.cwsent.com (Postfix, from userid 1000) id B8F28DB; Thu, 20 Jul 2023 10:06:24 -0700 (PDT) X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.8+dev Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Konstantin Belousov , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 21e45c30c35c - main - mmap(MAP_STACK): on stack grow, use original protection In-reply-to: <20230720164145.0CF1311F@slippy.cwsent.com> References: <202307201412.36KECDSU084918@gitrepo.freebsd.org> <20230720163231.B1D4277@slippy.cwsent.com> <20230720164145.0CF1311F@slippy.cwsent.com> Comments: In-reply-to Cy Schubert message dated "Thu, 20 Jul 2023 09:41:44 -0700." List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 20 Jul 2023 10:06:24 -0700 Message-Id: <20230720170624.B8F28DB@slippy.cwsent.com> X-CMAE-Envelope: MS4xfBzyki60zrg9DC8yLCVPdAvqggsm/4Nna7+sDZeZEXFgr+lba53MsAsOTFRuGEIN40ibsaR65CRjTU5eV3Kpk4VKPdmlxdnsXzgeNUV4c7N5iW0A9CQg Prr5JN5WKAFvE4X41IUolennSubfvfnOBBw6RCTqTbPq2gj72Sbnv0X3H4wZiN7w+Pdp5V14OkIZatKEpGdFsmvmUWDULITLDLNMkyQr/3M/AJe9gFkVTu58 iFW4sGJMncL1E3fQfs3vWE2kJr3sfIao9J4TcRd8iQhwTl1uTNWVRBd+A/OyCqr3UNSlRC2pp/IjPnCwITyEOjLFVzHTt4WFJ59TRGD8g4I= X-Spamd-Result: default: False [-1.67 / 15.00]; AUTH_NA(1.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.97)[-0.967]; MV_CASE(0.50)[]; RCVD_IN_DNSWL_LOW(-0.10)[3.97.99.33:from]; MIME_GOOD(-0.10)[text/plain]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org,dev-commits-src-all@freebsd.org]; ASN(0.00)[asn:16509, ipnet:3.96.0.0/15, country:US]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; FROM_EQ_ENVFROM(0.00)[]; R_SPF_NA(0.00)[no SPF record]; TO_DN_SOME(0.00)[]; ARC_NA(0.00)[]; REPLYTO_EQ_FROM(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_LAST(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; DMARC_NA(0.00)[cschubert.com]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com] X-Rspamd-Queue-Id: 4R6Jxb25K6z4dyS X-Spamd-Bar: - In message <20230720164145.0CF1311F@slippy.cwsent.com>, Cy Schubert writes: > In message <20230720163231.B1D4277@slippy.cwsent.com>, Cy Schubert writes: > > In message <202307201412.36KECDSU084918@gitrepo.freebsd.org>, Konstantin > > Belous > > ov writes: > > > The branch main has been updated by kib: > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=21e45c30c35c9aa732073f725924 > ca > > f5 > > > 81c93460 > > > > > > commit 21e45c30c35c9aa732073f725924caf581c93460 > > > Author: Konstantin Belousov > > > AuthorDate: 2023-07-19 11:05:32 +0000 > > > Commit: Konstantin Belousov > > > CommitDate: 2023-07-20 14:11:42 +0000 > > > > > > mmap(MAP_STACK): on stack grow, use original protection > > > > > > If mprotect(2) changed protection in the bottom of the currently grow > n > > > stack region, currently the changed protection would be used for the > > > stack grow on next fault. This is arguably unexpected. > > > > > > Store the original protection for the entry at mmap(2) time in the > > > offset member of the gap vm_map_entry, and use it for protection of t > he > > > grown stack region. > > > > > > PR: 272585 > > > Reported by: John F. Carr > > > Reviewed by: alc, markj > > > Sponsored by: The FreeBSD Foundation > > > MFC after: 1 week > > > Differential revision: https://reviews.freebsd.org/D41089 > > > --- > > > sys/vm/vm_map.c | 24 ++++++++++++++++-------- > > > sys/vm/vm_map.h | 4 ++++ > > > 2 files changed, 20 insertions(+), 8 deletions(-) > > > > > > diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c > > > index a02107b5e64d..997a49111a59 100644 > > > --- a/sys/vm/vm_map.c > > > +++ b/sys/vm/vm_map.c > > > @@ -4493,7 +4493,7 @@ static int > > > vm_map_stack_locked(vm_map_t map, vm_offset_t addrbos, vm_size_t max_ssi > ze > > , > > > vm_size_t growsize, vm_prot_t prot, vm_prot_t max, int cow) > > > { > > > - vm_map_entry_t new_entry, prev_entry; > > > + vm_map_entry_t gap_entry, new_entry, prev_entry; > > > vm_offset_t bot, gap_bot, gap_top, top; > > > vm_size_t init_ssize, sgp; > > > int orient, rv; > > > @@ -4575,11 +4575,14 @@ vm_map_stack_locked(vm_map_t map, vm_offset_t add > rb > > os > > > , vm_size_t max_ssize, > > > * read-ahead logic is never used for it. Re-use > > > * next_read of the gap entry to store > > > * stack_guard_page for vm_map_growstack(). > > > + * Similarly, since a gap cannot have a backing object, > > > + * store the original stack protections in the > > > + * object offset. > > > */ > > > - if (orient == MAP_STACK_GROWS_DOWN) > > > - vm_map_entry_pred(new_entry)->next_read = sgp; > > > - else > > > - vm_map_entry_succ(new_entry)->next_read = sgp; > > > + gap_entry = orient == MAP_STACK_GROWS_DOWN ? > > > + vm_map_entry_pred(new_entry) : vm_map_entry_succ(new_entry) > > > ; > > > + gap_entry->next_read = sgp; > > > + gap_entry->offset = prot; > > > } else { > > > (void)vm_map_delete(map, bot, top); > > > } > > > @@ -4599,6 +4602,7 @@ vm_map_growstack(vm_map_t map, vm_offset_t addr, vm > _m > > ap > > > _entry_t gap_entry) > > > struct ucred *cred; > > > vm_offset_t gap_end, gap_start, grow_start; > > > vm_size_t grow_amount, guard, max_grow; > > > + vm_prot_t prot; > > > rlim_t lmemlim, stacklim, vmemlim; > > > int rv, rv1 __diagused; > > > bool gap_deleted, grow_down, is_procstack; > > > @@ -4739,6 +4743,12 @@ retry: > > > } > > > > > > if (grow_down) { > > > + /* > > > + * The gap_entry "offset" field is overloaded. See > > > + * vm_map_stack_locked(). > > > + */ > > > + prot = gap_entry->offset; > > > + > > > grow_start = gap_entry->end - grow_amount; > > > if (gap_entry->start + grow_amount == gap_entry->end) { > > > gap_start = gap_entry->start; > > > @@ -4751,9 +4761,7 @@ retry: > > > gap_deleted = false; > > > } > > > rv = vm_map_insert(map, NULL, 0, grow_start, > > > - grow_start + grow_amount, > > > - stack_entry->protection, stack_entry->max_protection, > > > - MAP_STACK_GROWS_DOWN); > > > + grow_start + grow_amount, prot, prot, MAP_STACK_GROWS_DOWN) > > > ; > > > if (rv != KERN_SUCCESS) { > > > if (gap_deleted) { > > > rv1 = vm_map_insert(map, NULL, 0, gap_start, > > > diff --git a/sys/vm/vm_map.h b/sys/vm/vm_map.h > > > index fd8b606e8ddc..c4ed36ce57ba 100644 > > > --- a/sys/vm/vm_map.h > > > +++ b/sys/vm/vm_map.h > > > @@ -97,6 +97,10 @@ union vm_map_object { > > > * a VM object (or sharing map) and offset into that object, > > > * and user-exported inheritance and protection information. > > > * Also included is control information for virtual copy operation > s. > > > + * > > > + * For stack gap map entries (MAP_ENTRY_GUARD | MAP_ENTRY_GROWS_DO > WN > > > + * or UP), the next_read member is reused as the stack_guard_page > > > + * storage, and offset is the stack protection. > > > */ > > > struct vm_map_entry { > > > struct vm_map_entry *left; /* left child or previous entry */ > > > > > > > This commit has caused screen (sysutils/screen) to display the following > > error when opening a new screen window (ctrl-A c): > > > > pid 28473 comm screen-4.9.0 has trashed its stack, killing > > > > > > -- > > Cheers, > > Cy Schubert > > FreeBSD UNIX: Web: https://FreeBSD.org > > NTP: Web: https://nwtime.org > > > > e^(i*pi)+1=0 > > > > > > I'm also seeing artifacts in emails by nmh (mail/nmh) in my sent directory > and in the email cc'd to me. > > > -- > Cheers, > Cy Schubert > FreeBSD UNIX: Web: https://FreeBSD.org > NTP: Web: https://nwtime.org > > e^(i*pi)+1=0 > > Sometimes this occurs at screen start. Then it hangs. slippy$ screen pid 7275 comm screen-4.9.0 has trashed its stack, killing -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e^(i*pi)+1=0 From nobody Thu Jul 20 17:28:41 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6KRF6gnsz4nJD7; Thu, 20 Jul 2023 17:28: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 4R6KRF69Plz3GPq; Thu, 20 Jul 2023 17:28:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689874121; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zReqWmLwc+FfHcwGuMr2gLeDc2LZjLbOP/Oz7siNWg0=; b=KQY6v3M0kQD8a5xaCqKAQ6YBFpxY5BM7oswVXb9MxgXIK65vTHG6ty3Nq2m694eZvwMY// Axay4oKlV+ajwmZ8D7O73A/JkFN9oliO9oGGKMMMinpXGdlsRO+5oU0hu2TelsnjP1SitD wWsyQ52JyJj5xmZrHDMNPvwAto/Kqa3oFrkbx1UlQjmTT2ld8oExfg+2hShuaTM35u8cp4 2yzE32SAbeZTOepxFJbZLsHIKHnlEe4//46HcP+UiM6bQHMsC5aB9OOl0n1B43wHYiyijc vqPFgZvJpRNEi1jKavsaE/NuTaU9siOdZLh/FWLg26PKzc2qDbqkcUYvRDQtyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689874121; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zReqWmLwc+FfHcwGuMr2gLeDc2LZjLbOP/Oz7siNWg0=; b=GcDyKn3spQLhRo8gFmtPiklMLLWY0oQM12SrkBzTMcKKJfuGcXJ3szvBPvyshKdHTrbq0G iEdk+IrfIbNgoziBvPcWgZF61uLke+Rf4VtCSFq/Kt1Ln+lHQxBaa4D4NZyNqbws//vd+E 6Btq3UO9wNfsfVrk0o9k/WZo7Mhp9X7n6v4dkxnaQYP9W90C3/GqSsLXTQN8QxMWcfszkx A3Jh+jPg9n92d8CcrpoxgRsCoXiZ3jMu5PgjvRCcmkwEqvRKLPCAJUUNPIGEzPmjNzUwnL UlUtUkt2QOzaHsADzl6Ng4MlDEcoZAI/GjwdalC1rlrarzXTHAdv9yCuo8agmg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689874121; a=rsa-sha256; cv=none; b=eWKbSGmMuQiNbAIrJWWokP4n0rEIrrGAXM0Q28TucY0AzE2Ta5dAqu2rxVkQKk1jIc6kv6 km35vJsWs35Mfr7dEeszGSPo2+v1/i0kpnJKRWVvWhz7xhNrMakwplOdL/XZ+nUliW+Tdj yQonn59j3z0HDaZ8Juwnk9zJfPhJOLHoNdTz5HW9rY5MDXDC68w4jZQka/m3pdBxQsLsTO EoS7MD4jyFEJ4ZeslRwPQGNHZoVfJmX7ucVLwmYcqJE3gbPtajR/rtjP0v4X4M433kHR2q VG3orvv+21b5I4Y7Vn8FngsjT8CPVLCooKsnDn2S3qDvj5wS4HVx8S0rZADFAw== 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 4R6KRF5Cq6zfW0; Thu, 20 Jul 2023 17:28: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 36KHSfK0004577; Thu, 20 Jul 2023 17:28:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36KHSf65004576; Thu, 20 Jul 2023 17:28:41 GMT (envelope-from git) Date: Thu, 20 Jul 2023 17:28:41 GMT Message-Id: <202307201728.36KHSf65004576@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Navdeep Parhar Subject: git: 47b1fef6fb22 - main - ifconfig: Fix the display of capabilities in the netlink based code. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 47b1fef6fb2299e5d1d7878c412f1dbd3effbc3d Auto-Submitted: auto-generated The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=47b1fef6fb2299e5d1d7878c412f1dbd3effbc3d commit 47b1fef6fb2299e5d1d7878c412f1dbd3effbc3d Author: Navdeep Parhar AuthorDate: 2023-07-20 01:05:12 +0000 Commit: Navdeep Parhar CommitDate: 2023-07-20 17:26:18 +0000 ifconfig: Fix the display of capabilities in the netlink based code. The capabilities in if_capabilities2/if_capenable2 are reported in the second 32b and were not being displayed correctly. v does not need to be advanced because v[i / 32] is the correct 32b value already. Sponsored by: Chelsio Communications Reviewed by: kib@ Differential Revision: https://reviews.freebsd.org/D41107 --- sbin/ifconfig/ifconfig_netlink.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sbin/ifconfig/ifconfig_netlink.c b/sbin/ifconfig/ifconfig_netlink.c index f09023c1477c..0f449b7aae44 100644 --- a/sbin/ifconfig/ifconfig_netlink.c +++ b/sbin/ifconfig/ifconfig_netlink.c @@ -89,8 +89,6 @@ print_bits(const char *btype, uint32_t *v, const int v_count, for (int i = 0; i < v_count * 32; i++) { bool is_set = v[i / 32] & (1 << (i % 32)); - if (i == 31) - v++; if (is_set) { if (num++ == 0) printf("<"); From nobody Thu Jul 20 17:33:55 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6KYH3wNFz4nMBN; Thu, 20 Jul 2023 17:33: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 4R6KYH2PbNz3J2S; Thu, 20 Jul 2023 17:33:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689874435; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Rxyz8jqxSdCPoRQ6AcpNgaBIi7CuqVW/TnGk89w7FNk=; b=mQkMlQ9l/reIwi+6tSNfOivfkDxwAZCHZn+453q/VyywxDzq83iZcWrSbBVNjaDTcvEW4/ 74rEzLTE9V6vf1Z3D7As1VfQmVIwVgSwaCi+kLhXzlqf2C/JmoMv8Ralfd6bVtMgab88dE yakh/bB3OQ/taWcOFc/k8yamPY8hmVkZ1IEsff76lmeUArPYvTxjeB875dK6LsYtCjhi02 82Ads7JHeVnSpsnFw8uxuCOJr+HqtSPMzeORCUlzdeeVOQ+H2N3nKJVw4Jh1gKBMsGhPxR Df/zonzxzk+PLFZwREgqnX101GSEzPGNAHNAxoU+SJhTVrud8tCVCSRtY4TbQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689874435; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Rxyz8jqxSdCPoRQ6AcpNgaBIi7CuqVW/TnGk89w7FNk=; b=Uz4Jm0S2to+zNl0DdlL1ZB5ICAmWe4e+yTvzAWC6/BdX5DIREwOJtur5piIdOH22gyzt8+ n/qCcc03tbMKYk6JW7+EWxXKrvleY0f+G8wz5yJCfhpyHrnSFHch0W7iYaNRT8WErecOe8 zyvg2cc0vA350NKE9rkbYi0Obws5zC6UvPbCnladhM3H8nkWHBVWmAVQZscwdLKSE/bSgQ 44v+/SWRx+gdEDfzZ/bHU5KEewkILvK5xRdyPSgcKmgAhCCQLyP7pK615NFriLNgOACCUk xqYqfy5/RKWlrFsVLShkkmkuS65VIz9wG+W1hS4nxw+yuJ2CXqE/tRLIGT/V9w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689874435; a=rsa-sha256; cv=none; b=LQPZ7A3BnBCXWdXoOMFHPdV/ViZLwuw2aKppH3m6ea9hNocvkoJirSyceAr6ulrHo+x+tY I4FAg6oBjhviNZEqdWaKU7+oJZXDaCcsPxsV0nwLeEAHnXqliHErRimK6CS3W/iT1diyUR OzqNGzZN73+N0EmM0R8JL8TgXjOpupBi4SaRXLO9kfRuWyxNxYv77jD0Qp0noD9N8vyY8W eZiFFfFOEbW1pSZSB5q0mfeXc6SkARPy7ZDjOAlpm4/53WQR0uxLTFjQUQhZk3Nvt007vu Qtyn59Sr4tnhxFlSpY9d35xUAzFbOvT0ugF4VbvLGnlojNAJruMDz7REVz/o4g== 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 4R6KYH1TD2zfxg; Thu, 20 Jul 2023 17:33: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 36KHXtvl020086; Thu, 20 Jul 2023 17:33:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36KHXtvk020085; Thu, 20 Jul 2023 17:33:55 GMT (envelope-from git) Date: Thu, 20 Jul 2023 17:33:55 GMT Message-Id: <202307201733.36KHXtvk020085@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 0c3eaa06b3cb - main - Remove perforce tools and references List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 0c3eaa06b3cb6e310491f69620fd20a142c7b116 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=0c3eaa06b3cb6e310491f69620fd20a142c7b116 commit 0c3eaa06b3cb6e310491f69620fd20a142c7b116 Author: Minsoo Choo AuthorDate: 2023-07-20 17:28:18 +0000 Commit: Ed Maste CommitDate: 2023-07-20 17:33:39 +0000 Remove perforce tools and references Perforce has been retired since 2019 (commit feea78990c2f), so there is no need anymore to keep perforce tools. Plus, there is no need to mention perforce admin. Reviewed by: emaste, Olivier Certner Differential Revision: https://reviews.freebsd.org/D41106 --- share/misc/organization.dot | 2 -- tools/tools/perforce/awkdiff | 42 --------------------------------------- tools/tools/perforce/p4diffbranch | 19 ------------------ 3 files changed, 63 deletions(-) diff --git a/share/misc/organization.dot b/share/misc/organization.dot index d888ff420b1c..6658a7855d89 100644 --- a/share/misc/organization.dot +++ b/share/misc/organization.dot @@ -48,7 +48,6 @@ bugmeister [label="Bugmeister Team\nbugmeister@FreeBSD.org\neadler, gavin, gonzo clusteradm [label="Cluster Administrators\nclusteradm@FreeBSD.org\nallanjude, brd,\ndhw, gavin,\ngjb, peter,\nsbruno, simon,\nzi"] dnsadm [label="DNS Administrators\ndnsadm@FreeBSD.org\nclusteradm"] mirroradmin [label="FTP/WWW Mirror Site Coordinators\nmirror-admin@FreeBSD.org\nclusteradm,\nkuriyama"] -perforceadmin [label="Perforce Repository Administrators\nperforce-admin@FreeBSD.org\nscottl, kensmith, gordon,\nrwatson, peter, dhw"] postmaster [label="Postmaster Team\npostmaster@FreeBSD.org\ndhw, krion, ler, philip, pi, rea, remko, zi"] webmaster [label="Webmaster Team\nwebmaster@FreeBSD.org\ngjb, wblock, blackend,\ngabor, hrs, wosch"] @@ -68,7 +67,6 @@ _admin -> bugmeister _admin -> clusteradm _admin -> dnsadm _admin -> mirroradmin -_admin -> perforceadmin _admin -> postmaster _admin -> webmaster diff --git a/tools/tools/perforce/awkdiff b/tools/tools/perforce/awkdiff deleted file mode 100755 index 380d6fa26f93..000000000000 --- a/tools/tools/perforce/awkdiff +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/awk -f -# -# $FreeBSD$ -# - -BEGIN { - #parentpath = "//depot/vendor/freebsd/src/sys/" - #childpath = "//depot/projects/opencrypto/" -} -$1 == "====" { - last_line = $0 - last_filename = $2 - #gsub(parentpath, "", last_filename) - gsub(/#[0-9]*$/, "", last_filename) - did_sub = 0 -} -$1 == "====" && $2 == "" { - new_file = $4 - gsub(childpath, "", new_file) - gsub(/#[0-9]*$/, "", new_file) - cmd = "p4 print \"" $4 "\" | sed '/^\\/\\/depot/d' | diff -u /dev/null /dev/stdin | sed s@/dev/stdin@" new_file "@" - #print "x" cmd "x" - system(cmd) -} -$1 == "====" && $4 == "" { - del_file = $2 - gsub(parentpath, "", del_file) - gsub(/#[0-9]*$/, "", del_file) - cmd = "p4 print \"" $2 "\" | sed '/^\\/\\/depot/d' | diff -u /dev/stdin /dev/null | sed s@/dev/stdin@" del_file "@" - #print "x" cmd "x" - system(cmd) -} -$1 != "====" { - if (!did_sub && (($1 == "***************") || ($1 == "@@"))) { - print "--- ", last_filename ".orig" - print "+++ ", last_filename - print $0 - did_sub = 1 - } else { - print $0 - } -} diff --git a/tools/tools/perforce/p4diffbranch b/tools/tools/perforce/p4diffbranch deleted file mode 100755 index 9d29f23c5019..000000000000 --- a/tools/tools/perforce/p4diffbranch +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh - -# -# $FreeBSD$ -# - -if [ x"$#" != x"2" ]; then - echo "Usage: $0 " - exit 1 -fi - -basescript="$(realpath "$0")" -awkdiff="${basescript%/*}/awkdiff" - -branch="$1" -changenum="$2" - -p4 branch -o "$branch" | - awk ' /^View:/ { doview = 1; next; } /^[^ ]/ {doview = 0; next; } $1 && $2 && doview == 1 { system("p4 diff2 -du " $1 "@" changenum " " $2) }' changenum="$changenum" | - "$awkdiff" From nobody Thu Jul 20 17:34:35 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6KZH2bThz4nMpd; Thu, 20 Jul 2023 17:34:47 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.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 mx1.freebsd.org (Postfix) with ESMTPS id 4R6KZG6hyKz3JFq; Thu, 20 Jul 2023 17:34:46 +0000 (UTC) (envelope-from kostikbel@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.17.1/8.17.1) with ESMTPS id 36KHYZpg050630 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 20 Jul 2023 20:34:38 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 36KHYZpg050630 Received: (from kostik@localhost) by tom.home (8.17.1/8.17.1/Submit) id 36KHYZFX050629; Thu, 20 Jul 2023 20:34:35 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 20 Jul 2023 20:34:35 +0300 From: Konstantin Belousov To: Cy Schubert Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 21e45c30c35c - main - mmap(MAP_STACK): on stack grow, use original protection Message-ID: References: <202307201412.36KECDSU084918@gitrepo.freebsd.org> <20230720163231.B1D4277@slippy.cwsent.com> <20230720164145.0CF1311F@slippy.cwsent.com> <20230720170624.B8F28DB@slippy.cwsent.com> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230720170624.B8F28DB@slippy.cwsent.com> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.0 X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-14) on tom.home X-Rspamd-Queue-Id: 4R6KZG6hyKz3JFq X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated On Thu, Jul 20, 2023 at 10:06:24AM -0700, Cy Schubert wrote: > In message <20230720164145.0CF1311F@slippy.cwsent.com>, Cy Schubert writes: > > In message <20230720163231.B1D4277@slippy.cwsent.com>, Cy Schubert writes: > > > In message <202307201412.36KECDSU084918@gitrepo.freebsd.org>, Konstantin > > > Belous > > > ov writes: > > > > The branch main has been updated by kib: > > > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=21e45c30c35c9aa732073f725924 > > ca > > > f5 > > > > 81c93460 > > > > > > > > commit 21e45c30c35c9aa732073f725924caf581c93460 > > > > Author: Konstantin Belousov > > > > AuthorDate: 2023-07-19 11:05:32 +0000 > > > > Commit: Konstantin Belousov > > > > CommitDate: 2023-07-20 14:11:42 +0000 > > > > > > > > mmap(MAP_STACK): on stack grow, use original protection > > > > > > > > If mprotect(2) changed protection in the bottom of the currently grow > > n > > > > stack region, currently the changed protection would be used for the > > > > stack grow on next fault. This is arguably unexpected. > > > > > > > > Store the original protection for the entry at mmap(2) time in the > > > > offset member of the gap vm_map_entry, and use it for protection of t > > he > > > > grown stack region. > > > > > > > > PR: 272585 > > > > Reported by: John F. Carr > > > > Reviewed by: alc, markj > > > > Sponsored by: The FreeBSD Foundation > > > > MFC after: 1 week > > > > Differential revision: https://reviews.freebsd.org/D41089 > > > > --- > > > > sys/vm/vm_map.c | 24 ++++++++++++++++-------- > > > > sys/vm/vm_map.h | 4 ++++ > > > > 2 files changed, 20 insertions(+), 8 deletions(-) > > > > > > > > diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c > > > > index a02107b5e64d..997a49111a59 100644 > > > > --- a/sys/vm/vm_map.c > > > > +++ b/sys/vm/vm_map.c > > > > @@ -4493,7 +4493,7 @@ static int > > > > vm_map_stack_locked(vm_map_t map, vm_offset_t addrbos, vm_size_t max_ssi > > ze > > > , > > > > vm_size_t growsize, vm_prot_t prot, vm_prot_t max, int cow) > > > > { > > > > - vm_map_entry_t new_entry, prev_entry; > > > > + vm_map_entry_t gap_entry, new_entry, prev_entry; > > > > vm_offset_t bot, gap_bot, gap_top, top; > > > > vm_size_t init_ssize, sgp; > > > > int orient, rv; > > > > @@ -4575,11 +4575,14 @@ vm_map_stack_locked(vm_map_t map, vm_offset_t add > > rb > > > os > > > > , vm_size_t max_ssize, > > > > * read-ahead logic is never used for it. Re-use > > > > * next_read of the gap entry to store > > > > * stack_guard_page for vm_map_growstack(). > > > > + * Similarly, since a gap cannot have a backing object, > > > > + * store the original stack protections in the > > > > + * object offset. > > > > */ > > > > - if (orient == MAP_STACK_GROWS_DOWN) > > > > - vm_map_entry_pred(new_entry)->next_read = sgp; > > > > - else > > > > - vm_map_entry_succ(new_entry)->next_read = sgp; > > > > + gap_entry = orient == MAP_STACK_GROWS_DOWN ? > > > > + vm_map_entry_pred(new_entry) : vm_map_entry_succ(new_entry) > > > > ; > > > > + gap_entry->next_read = sgp; > > > > + gap_entry->offset = prot; > > > > } else { > > > > (void)vm_map_delete(map, bot, top); > > > > } > > > > @@ -4599,6 +4602,7 @@ vm_map_growstack(vm_map_t map, vm_offset_t addr, vm > > _m > > > ap > > > > _entry_t gap_entry) > > > > struct ucred *cred; > > > > vm_offset_t gap_end, gap_start, grow_start; > > > > vm_size_t grow_amount, guard, max_grow; > > > > + vm_prot_t prot; > > > > rlim_t lmemlim, stacklim, vmemlim; > > > > int rv, rv1 __diagused; > > > > bool gap_deleted, grow_down, is_procstack; > > > > @@ -4739,6 +4743,12 @@ retry: > > > > } > > > > > > > > if (grow_down) { > > > > + /* > > > > + * The gap_entry "offset" field is overloaded. See > > > > + * vm_map_stack_locked(). > > > > + */ > > > > + prot = gap_entry->offset; > > > > + > > > > grow_start = gap_entry->end - grow_amount; > > > > if (gap_entry->start + grow_amount == gap_entry->end) { > > > > gap_start = gap_entry->start; > > > > @@ -4751,9 +4761,7 @@ retry: > > > > gap_deleted = false; > > > > } > > > > rv = vm_map_insert(map, NULL, 0, grow_start, > > > > - grow_start + grow_amount, > > > > - stack_entry->protection, stack_entry->max_protection, > > > > - MAP_STACK_GROWS_DOWN); > > > > + grow_start + grow_amount, prot, prot, MAP_STACK_GROWS_DOWN) > > > > ; > > > > if (rv != KERN_SUCCESS) { > > > > if (gap_deleted) { > > > > rv1 = vm_map_insert(map, NULL, 0, gap_start, > > > > diff --git a/sys/vm/vm_map.h b/sys/vm/vm_map.h > > > > index fd8b606e8ddc..c4ed36ce57ba 100644 > > > > --- a/sys/vm/vm_map.h > > > > +++ b/sys/vm/vm_map.h > > > > @@ -97,6 +97,10 @@ union vm_map_object { > > > > * a VM object (or sharing map) and offset into that object, > > > > * and user-exported inheritance and protection information. > > > > * Also included is control information for virtual copy operation > > s. > > > > + * > > > > + * For stack gap map entries (MAP_ENTRY_GUARD | MAP_ENTRY_GROWS_DO > > WN > > > > + * or UP), the next_read member is reused as the stack_guard_page > > > > + * storage, and offset is the stack protection. > > > > */ > > > > struct vm_map_entry { > > > > struct vm_map_entry *left; /* left child or previous entry */ > > > > > > > > > > This commit has caused screen (sysutils/screen) to display the following > > > error when opening a new screen window (ctrl-A c): > > > > > > pid 28473 comm screen-4.9.0 has trashed its stack, killing > > > > > > > > > -- > > > Cheers, > > > Cy Schubert > > > FreeBSD UNIX: Web: https://FreeBSD.org > > > NTP: Web: https://nwtime.org > > > > > > e^(i*pi)+1=0 > > > > > > > > > > I'm also seeing artifacts in emails by nmh (mail/nmh) in my sent directory > > and in the email cc'd to me. > > > > > > -- > > Cheers, > > Cy Schubert > > FreeBSD UNIX: Web: https://FreeBSD.org > > NTP: Web: https://nwtime.org > > > > e^(i*pi)+1=0 > > > > > > Sometimes this occurs at screen start. Then it hangs. > > slippy$ screen > pid 7275 comm screen-4.9.0 has trashed its stack, killing Can you check this? diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c index 8c864c943f5d..4c5f1c08954d 100644 --- a/sys/vm/vm_map.c +++ b/sys/vm/vm_map.c @@ -4202,7 +4202,8 @@ vm_map_copy_entry( src_entry->start); } else { dst_entry->object.vm_object = NULL; - dst_entry->offset = 0; + if ((dst_entry->eflags & MAP_ENTRY_GUARD) == 0) + dst_entry->offset = 0; if (src_entry->cred != NULL) { dst_entry->cred = curthread->td_ucred; crhold(dst_entry->cred); From nobody Thu Jul 20 17:36:08 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6Kbv2qhcz4nNWj; Thu, 20 Jul 2023 17:36:11 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta002.cacentral1.a.cloudfilter.net (omta002.cacentral1.a.cloudfilter.net [3.97.99.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6Kbv168hz3Jtq; Thu, 20 Jul 2023 17:36:11 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; none Received: from shw-obgw-4002a.ext.cloudfilter.net ([10.228.9.250]) by cmsmtp with ESMTP id MRcgqYvD46NwhMXZSqRmfr; Thu, 20 Jul 2023 17:36:10 +0000 Received: from spqr.komquats.com ([70.66.152.170]) by cmsmtp with ESMTPA id MXZQqH7CuyAOeMXZRq8Aq5; Thu, 20 Jul 2023 17:36:10 +0000 X-Authority-Analysis: v=2.4 cv=e5oV9Il/ c=1 sm=1 tr=0 ts=64b9708a a=y8EK/9tc/U6QY+pUhnbtgQ==:117 a=y8EK/9tc/U6QY+pUhnbtgQ==:17 a=kj9zAlcOel0A:10 a=ws7JD89P4LkA:10 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=EkcXrb_YAAAA:8 a=VxmjJ2MpAAAA:8 a=1Rrndl_ikATqP_Wnm9AA:9 a=CjuIK1q_8ugA:10 a=btS-jjpKxVEA:10 a=8k-k-Cn0ORkA:10 a=QHqjWXHE9tEA:10 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 a=LK5xJRSDVpKd5WXXoEvA:22 a=7gXAzLPJhVmCkEl4_tsf:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id AB7EA7E; Thu, 20 Jul 2023 10:36:08 -0700 (PDT) Received: by slippy.cwsent.com (Postfix, from userid 1000) id 8EF0B185; Thu, 20 Jul 2023 10:36:08 -0700 (PDT) X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.8+dev Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Cy Schubert cc: Konstantin Belousov , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 21e45c30c35c - main - mmap(MAP_STACK): on stack grow, use original protection In-reply-to: <20230720170624.B8F28DB@slippy.cwsent.com> References: <202307201412.36KECDSU084918@gitrepo.freebsd.org> <20230720163231.B1D4277@slippy.cwsent.com> <20230720164145.0CF1311F@slippy.cwsent.com> <20230720170624.B8F28DB@slippy.cwsent.com> Comments: In-reply-to Cy Schubert message dated "Thu, 20 Jul 2023 10:06:24 -0700." List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 20 Jul 2023 10:36:08 -0700 Message-Id: <20230720173608.8EF0B185@slippy.cwsent.com> X-CMAE-Envelope: MS4xfKp3ITMuS7R84XZyTMP7ZtR1uipQBb3lVgxKEMFHd/PcEhfAbZcekkUl/goGkQJPTyCU34TUa5lYJRWUSbyKd27m0INYh/AYihBcUtCRVOIT8w92EBX2 TCCtpDKzNCcKerEBU3qN2cZ++3Lhgq4WwKR5VKabJA90JwhPUl+VulbdVj1qSFXXKjhoX6wlkOMk8sVuRT5bnDctfM08RxbwFyNclzE0kk2NNrieUeYiHqLo xLw2YdaDx1G8qTlPHBHeyATmJ2qEF0LsfMSnDpn+qm+4BBlq8TQ3dULMkR6vqy6f/yqeEwDg0742L9vtDzou1u3puqMPHIklIEuL63s/89A= X-Rspamd-Queue-Id: 4R6Kbv168hz3Jtq X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:16509, ipnet:3.96.0.0/15, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated Sorry for spamming everyone again. pkg fails on a segfault: slippy# pkg upg Updating prod repository catalogue... pkg: No SRV record found for the repo 'prod' Fetching meta.conf: 0% Fetching packagesite.pkg: 0% prod repository is up to date. All repositories are up to date. Checking for upgrades (6 candidates): 100% 6 B 0.0kB/s 00:01 Processing candidates (6 candidates): 0%Child process pid=8051 terminated abnormally: Segmentation fault slippy# Reverting this revision, locally, has restored functionality to pkg and screen. -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e^(i*pi)+1=0 In message <20230720170624.B8F28DB@slippy.cwsent.com>, Cy Schubert writes: > In message <20230720164145.0CF1311F@slippy.cwsent.com>, Cy Schubert writes: > > In message <20230720163231.B1D4277@slippy.cwsent.com>, Cy Schubert writes: > > > In message <202307201412.36KECDSU084918@gitrepo.freebsd.org>, Konstantin > > > Belous > > > ov writes: > > > > The branch main has been updated by kib: > > > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=21e45c30c35c9aa732073f7259 > 24 > > ca > > > f5 > > > > 81c93460 > > > > > > > > commit 21e45c30c35c9aa732073f725924caf581c93460 > > > > Author: Konstantin Belousov > > > > AuthorDate: 2023-07-19 11:05:32 +0000 > > > > Commit: Konstantin Belousov > > > > CommitDate: 2023-07-20 14:11:42 +0000 > > > > > > > > mmap(MAP_STACK): on stack grow, use original protection > > > > > > > > If mprotect(2) changed protection in the bottom of the currently gr > ow > > n > > > > stack region, currently the changed protection would be used for th > e > > > > stack grow on next fault. This is arguably unexpected. > > > > > > > > Store the original protection for the entry at mmap(2) time in the > > > > offset member of the gap vm_map_entry, and use it for protection of > t > > he > > > > grown stack region. > > > > > > > > PR: 272585 > > > > Reported by: John F. Carr > > > > Reviewed by: alc, markj > > > > Sponsored by: The FreeBSD Foundation > > > > MFC after: 1 week > > > > Differential revision: https://reviews.freebsd.org/D41089 > > > > --- > > > > sys/vm/vm_map.c | 24 ++++++++++++++++-------- > > > > sys/vm/vm_map.h | 4 ++++ > > > > 2 files changed, 20 insertions(+), 8 deletions(-) > > > > > > > > diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c > > > > index a02107b5e64d..997a49111a59 100644 > > > > --- a/sys/vm/vm_map.c > > > > +++ b/sys/vm/vm_map.c > > > > @@ -4493,7 +4493,7 @@ static int > > > > vm_map_stack_locked(vm_map_t map, vm_offset_t addrbos, vm_size_t max_s > si > > ze > > > , > > > > vm_size_t growsize, vm_prot_t prot, vm_prot_t max, int cow) > > > > { > > > > - vm_map_entry_t new_entry, prev_entry; > > > > + vm_map_entry_t gap_entry, new_entry, prev_entry; > > > > vm_offset_t bot, gap_bot, gap_top, top; > > > > vm_size_t init_ssize, sgp; > > > > int orient, rv; > > > > @@ -4575,11 +4575,14 @@ vm_map_stack_locked(vm_map_t map, vm_offset_t a > dd > > rb > > > os > > > > , vm_size_t max_ssize, > > > > * read-ahead logic is never used for it. Re-use > > > > * next_read of the gap entry to store > > > > * stack_guard_page for vm_map_growstack(). > > > > + * Similarly, since a gap cannot have a backing object, > > > > + * store the original stack protections in the > > > > + * object offset. > > > > */ > > > > - if (orient == MAP_STACK_GROWS_DOWN) > > > > - vm_map_entry_pred(new_entry)->next_read = sgp; > > > > - else > > > > - vm_map_entry_succ(new_entry)->next_read = sgp; > > > > + gap_entry = orient == MAP_STACK_GROWS_DOWN ? > > > > + vm_map_entry_pred(new_entry) : vm_map_entry_succ(ne > w_entry) > > > > ; > > > > + gap_entry->next_read = sgp; > > > > + gap_entry->offset = prot; > > > > } else { > > > > (void)vm_map_delete(map, bot, top); > > > > } > > > > @@ -4599,6 +4602,7 @@ vm_map_growstack(vm_map_t map, vm_offset_t addr, > vm > > _m > > > ap > > > > _entry_t gap_entry) > > > > struct ucred *cred; > > > > vm_offset_t gap_end, gap_start, grow_start; > > > > vm_size_t grow_amount, guard, max_grow; > > > > + vm_prot_t prot; > > > > rlim_t lmemlim, stacklim, vmemlim; > > > > int rv, rv1 __diagused; > > > > bool gap_deleted, grow_down, is_procstack; > > > > @@ -4739,6 +4743,12 @@ retry: > > > > } > > > > > > > > if (grow_down) { > > > > + /* > > > > + * The gap_entry "offset" field is overloaded. See > > > > + * vm_map_stack_locked(). > > > > + */ > > > > + prot = gap_entry->offset; > > > > + > > > > grow_start = gap_entry->end - grow_amount; > > > > if (gap_entry->start + grow_amount == gap_entry->end) { > > > > gap_start = gap_entry->start; > > > > @@ -4751,9 +4761,7 @@ retry: > > > > gap_deleted = false; > > > > } > > > > rv = vm_map_insert(map, NULL, 0, grow_start, > > > > - grow_start + grow_amount, > > > > - stack_entry->protection, stack_entry->max_protectio > n, > > > > - MAP_STACK_GROWS_DOWN); > > > > + grow_start + grow_amount, prot, prot, MAP_STACK_GRO > WS_DOWN) > > > > ; > > > > if (rv != KERN_SUCCESS) { > > > > if (gap_deleted) { > > > > rv1 = vm_map_insert(map, NULL, 0, gap_s > tart, > > > > diff --git a/sys/vm/vm_map.h b/sys/vm/vm_map.h > > > > index fd8b606e8ddc..c4ed36ce57ba 100644 > > > > --- a/sys/vm/vm_map.h > > > > +++ b/sys/vm/vm_map.h > > > > @@ -97,6 +97,10 @@ union vm_map_object { > > > > * a VM object (or sharing map) and offset into that object, > > > > * and user-exported inheritance and protection information. > > > > * Also included is control information for virtual copy operation > > s. > > > > + * > > > > + * For stack gap map entries (MAP_ENTRY_GUARD | MAP_ENTRY_GROWS_DO > > WN > > > > + * or UP), the next_read member is reused as the stack_guard_page > > > > + * storage, and offset is the stack protection. > > > > */ > > > > struct vm_map_entry { > > > > struct vm_map_entry *left; /* left child or previous entry > */ > > > > > > > > > > This commit has caused screen (sysutils/screen) to display the following > > > error when opening a new screen window (ctrl-A c): > > > > > > pid 28473 comm screen-4.9.0 has trashed its stack, killing > > > > > > > > > -- > > > Cheers, > > > Cy Schubert > > > FreeBSD UNIX: Web: https://FreeBSD.org > > > NTP: Web: https://nwtime.org > > > > > > e^(i*pi)+1=0 > > > > > > > > > > I'm also seeing artifacts in emails by nmh (mail/nmh) in my sent directory > > and in the email cc'd to me. > > > > > > -- > > Cheers, > > Cy Schubert > > FreeBSD UNIX: Web: https://FreeBSD.org > > NTP: Web: https://nwtime.org > > > > e^(i*pi)+1=0 > > > > > > Sometimes this occurs at screen start. Then it hangs. > > slippy$ screen > pid 7275 comm screen-4.9.0 has trashed its stack, killing > > > -- > Cheers, > Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org > NTP: Web: https://nwtime.org > > e^(i*pi)+1=0 > > From nobody Thu Jul 20 17:39:39 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6Kgw22Bnz4nQNR; Thu, 20 Jul 2023 17:39: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 4R6Kgw1cPjz3L3l; Thu, 20 Jul 2023 17:39:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689874780; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=O5e5FXu2MI8SLArLTSHfHeUvWLe1r65Ow0xRPF2Elzs=; b=QgAqrgrxT6uOZBwfuRTcLknh1nO3igtmyvqw18L4OaQAHC8PigolgrqxoQxa+SZzf4eczw PjfHipQtjGdpfvuFt53taz+2Sa2qh8/PoGlFfGxeiaph/71iUrQXS2PO0uY90jiwmk5YyI 67PT/TtW7Kcj2zcTt6DokZczi8Ye5JRBAKSAttL1ahdI3BSr6j05vL61slPxMGbLbOztMv tgjWeDCyGW57jaEm+eh1ZzViNCc27Bx6JxSFrJMOlWJys5LHr6GZbzmQGNR5AyF4H7rdnq 3+GfhBEz+HIUpJakYDBA5P6dDKCoY3R7kpB+4MMqOUb/Dc8FNYpJqZz/7jAETg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689874780; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=O5e5FXu2MI8SLArLTSHfHeUvWLe1r65Ow0xRPF2Elzs=; b=UrIuHkGNJ9KWwy+sMN5SIQzJLHA+tSyqYgajVJnVhJXH4PHM5MUXikb14Q1gxFe8n3VS0G 3G3/sg/7SbzUqlZTo0ro/Reg7LAZ5zfrRpndL2Lb7Y1PBI3vOFuq4zF9Bja6tO/1HDzoaq NcwwN66R0W+sNyGNE3tLpG83ZTUPDb7AAlI+N9nFwJCbwHOvlElRhJJPwRYDqgqW88PiTK R3ahVK/whNTiVM55S//o0is3PRjlH0LlyEvOHBeDjDEt5SjQI+3U6Pq4w01oOM+UIta70/ c0etnoAN69J1T21XFaTZLh6/Fo8nNEvEaZESewcF9mRD2h902OjwD5W9BLnYfw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689874780; a=rsa-sha256; cv=none; b=MZmJ/bYZowtUcFy0sbcmGcxUuf8eZ7KR2lo1YqujOqvVoOB7L7gCEY2kYPHbIHLZ79EtAI pLLOsFvlLk+g4buGiZ1FCgSp9vVedppYK4/u0q0OsjvePo5NLeMlBtg9fjpqqDzjapReED p2/llJMT+Y9hAFWjrUN+uKdldqNF+YjiytkAuvhYogtjbbui1kDrsUrgTSSmowfkEWo7U7 ARFF0nJddl9+lbuSaUSYY8wmmZ2pE0SYEpQg3TpLFjY0tJT9z1oNY92Ry3ksxKUmCW6uTY I5LMz2Ze0PZ7bSx4Augj7+el/JKKVn+H4SRbCKHdwixRk/Zoo1e+D/oD7r9bZQ== 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 4R6Kgw0ZNCzgD7; Thu, 20 Jul 2023 17:39: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 36KHddG3021047; Thu, 20 Jul 2023 17:39:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36KHddue021046; Thu, 20 Jul 2023 17:39:39 GMT (envelope-from git) Date: Thu, 20 Jul 2023 17:39:39 GMT Message-Id: <202307201739.36KHddue021046@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: e0a63d875eeb - main - pciconf: add PCIe 5.0 and PCIe 6.0 link speeds List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: e0a63d875eeb630092034808b0795a935d5c0934 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=e0a63d875eeb630092034808b0795a935d5c0934 commit e0a63d875eeb630092034808b0795a935d5c0934 Author: Ed Maste AuthorDate: 2023-06-21 20:23:18 +0000 Commit: Ed Maste CommitDate: 2023-07-20 17:39:17 +0000 pciconf: add PCIe 5.0 and PCIe 6.0 link speeds Reviewed by: jhb Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D40710 --- usr.sbin/pciconf/cap.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/usr.sbin/pciconf/cap.c b/usr.sbin/pciconf/cap.c index 3d28fe9bc331..9cae4bc49e03 100644 --- a/usr.sbin/pciconf/cap.c +++ b/usr.sbin/pciconf/cap.c @@ -396,6 +396,10 @@ link_speed_string(uint8_t speed) return ("8.0"); case 4: return ("16.0"); + case 5: + return ("32.0"); + case 6: + return ("64.0"); default: return ("undef"); } From nobody Thu Jul 20 17:56:08 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6L2x3Jyqz4nZK9; Thu, 20 Jul 2023 17:56:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6L2x0Q8dz3hXF; Thu, 20 Jul 2023 17:56:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689875769; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=y0plXdmvFmBPj/4TnyfXMh1vDLQRo9Db59qzCrUduXc=; b=UlGquRUEpVQLnTdVdx02YkTwMjTbQA4fyGOtul1xAHrdgQmdb8hPTna2PXEZZbyEKeczEC PeWzmud2tgXGmGPCY719f1KQ8zeQceGIxny6glz5jqdpY/YzV2/vt1tRR/W5nXye76wrE/ p6326aRK10XZ0vEaHSuBmZnoEmo0JEmbjwcP1/McfWopQzIDDfrnLIS2FUNFBonssBeI/q 53l3slyDHuauta8u24TZbOQwZ9gkMKy4jv9hub9A+o4jpoqTjmwL9bJm/7LfEQEHroRhG3 sQawKeeAsoQFzOa47GCAlKnUeb1/OrryScRK9AA/Myx+MyjToTFAFK8VqzEyFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689875769; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=y0plXdmvFmBPj/4TnyfXMh1vDLQRo9Db59qzCrUduXc=; b=E0KKDOF1OURvrakNO0bxjuM10pvwmJ1wtK/7xqpD8+DvBRDVcEAevclNBwnKSVnax3Q8kR 2lw3uI2OOLc8wYcubnOAen6PLBB4kIjOnIktjm8pvFSOV6Kz6zNubhCSNAL8gMXgI2BCa0 LH3Yh/cfgL7bZxsGYGnfUufhEfFf1hg23vP6XGW6VMt6tgfGE9JJpk7a3jq3qwroJJpqq/ wcErBLJ2FL67achSBYYF6wuIdyohbfyAW6l6RQh8ByjIEF9ki4xl1aXDQtyK64MwmIz60C ZvckzQVfA66CJdmPwep+nArMcTZnel8/x+Z8QQKiYXKm6nyJKbVh47JPQLRlSA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689875769; a=rsa-sha256; cv=none; b=dR0N4KBK4dPCqOgSejtyT23p8Aa41VgoYN+AyZhrdo9FaNdl2WUHqfUHWKd8ZeaaJ1q9aM mKYi0AArzL02dQC2Bo/U0Vgbd4EuU09ulb1qyHtrMZq14cr+XL7/hhoCUCR6tTt2nB7rR2 8fUiiywvHWqw3VPQTc59iEK28yPTSMXaAlNr/kIeQe75rgraR1HFjha5CY5MPrFkQ6uo1k xqE5zfqzsAfEfq/KobvDiAA03WANMSTCJ4imw3MTlDIktR6kgf3he9WsHCE1MZY0g0WGWE 2xCrNJm3MA97D+cYZkwtadcx7yYAohtzmpFvnN8ve4b2c2T8wONqiXn3aQ8eSg== 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 4R6L2w6ZVyzgCc; Thu, 20 Jul 2023 17:56:08 +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 36KHu834054298; Thu, 20 Jul 2023 17:56:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36KHu8Ge054297; Thu, 20 Jul 2023 17:56:08 GMT (envelope-from git) Date: Thu, 20 Jul 2023 17:56:08 GMT Message-Id: <202307201756.36KHu8Ge054297@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Navdeep Parhar Subject: git: 88284368fa6b - main - ifconfig: Shift unsigned value to avoid UB. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 88284368fa6b25b9f7b601876794a9f5304ae59f Auto-Submitted: auto-generated The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=88284368fa6b25b9f7b601876794a9f5304ae59f commit 88284368fa6b25b9f7b601876794a9f5304ae59f Author: Navdeep Parhar AuthorDate: 2023-07-20 17:42:15 +0000 Commit: Navdeep Parhar CommitDate: 2023-07-20 17:54:56 +0000 ifconfig: Shift unsigned value to avoid UB. Reported by: kib@ --- sbin/ifconfig/ifconfig_netlink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/ifconfig/ifconfig_netlink.c b/sbin/ifconfig/ifconfig_netlink.c index 0f449b7aae44..d2e3863079e7 100644 --- a/sbin/ifconfig/ifconfig_netlink.c +++ b/sbin/ifconfig/ifconfig_netlink.c @@ -88,7 +88,7 @@ print_bits(const char *btype, uint32_t *v, const int v_count, int num = 0; for (int i = 0; i < v_count * 32; i++) { - bool is_set = v[i / 32] & (1 << (i % 32)); + bool is_set = v[i / 32] & (1U << (i % 32)); if (is_set) { if (num++ == 0) printf("<"); From nobody Thu Jul 20 17:56:09 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6L2y2H4nz4nZX7; Thu, 20 Jul 2023 17:56:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6L2y1HnVz3hg5; Thu, 20 Jul 2023 17:56:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689875770; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=m8spWTE6YzgDsFEZtjrF32RlxunYE3lHLtos/kU77/s=; b=Pq2OVVdmQlOLNVafvZkQ/tE0PUAG7THcLl5XlDWBR8Zf1xqCw0fP12iPXOMgNdovR+rZK8 YepXqFtNwaZeUJ7eujnX5xIg3WBD6512/upAWKxcSc2tjyuH1rNmGDWEV1qDXv3H9Nbpts Zsz3c7/eXSyjpuUo3Hu2xA3dMk62yOScFwTgEtBzj0fFD6SE9D93WdqvpNrdoroGiT31Ou CmbZ86YLcm1cmvlc7NBfv6ZVgf55iY6qwC6mBWnS+k8yTQKpFd25bNdIiYsUhVP6hPGbb0 Kkm3mGpmCNIwKH3JgQyo1nFUPfJjYrstDfzrw8SNApfHoWGPbU7lTsDdBn1CpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689875770; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=m8spWTE6YzgDsFEZtjrF32RlxunYE3lHLtos/kU77/s=; b=mhsYN9NYt8vhgB8yIIe5w1jyZh/yz00pE00d5eOqSWp1WVVE8YdAePaJSmKA3mu4VmIQ3R Zb5YHN/GVlUpg/Dab+glQpx0g+Lw4oVEKFqVDtCRrlNamJi61BMiUZORrqeXEp9GKOP0VR L9FGdfMobMSC9Vkoy0wTIrZ4eDmMdrvtH47+MWDgh7q+PighfKBivXcmXYP5q302Rrtjf1 IhtOpcXXcOTcRLouqojgPudd9hNRqL9szVETvj3c460L106cbiMWgESp7Iq2Z4xq68jHOd BFOtvGeOvEnJ6cf432w6DSyp9Pcunp/qm2uQWIxgAsAd7SByFsr4w0rMp9jrLA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689875770; a=rsa-sha256; cv=none; b=qrdjoQdM4Vtlv6CB4qnoIyq/ybbElpyU23Vv111rGKMjj03IHX4uGxoNy4A7pXa8jrZ75I oGNjfE5YuYBg4+hU4aRNiGCi964eRelMMT+oItA3uMjicGIX8N53BdInGmUCqYWzi4utos zT8g7z0w54Oj5FHL3nCmVnFZV3eqbxxuEC+JR1TG96N4O2NUGXGTQJIL371SHKekGvH1H1 eUYVsHbJdd/Jj0JRg+LGlk9NSno/4Oe48wq7d+UpNgJoZUZDJR01mTtC2bKQo3+8O8CFUX +f9hEoutJjJVyT/bDCE6jHv6dnWpyWTac3LEMlQbvfSn9M6F8OWpqRxtgR5vFA== 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 4R6L2y0NR5zgHn; Thu, 20 Jul 2023 17:56: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 36KHu9Tv054324; Thu, 20 Jul 2023 17:56:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36KHu9Cf054323; Thu, 20 Jul 2023 17:56:09 GMT (envelope-from git) Date: Thu, 20 Jul 2023 17:56:09 GMT Message-Id: <202307201756.36KHu9Cf054323@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Navdeep Parhar Subject: git: a29916a6f8f5 - main - ifconfig_netlink.c: whitespace cleanup. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a29916a6f8f54e264279c990884b545b4048bb47 Auto-Submitted: auto-generated The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=a29916a6f8f54e264279c990884b545b4048bb47 commit a29916a6f8f54e264279c990884b545b4048bb47 Author: Navdeep Parhar AuthorDate: 2023-07-20 17:47:34 +0000 Commit: Navdeep Parhar CommitDate: 2023-07-20 17:54:56 +0000 ifconfig_netlink.c: whitespace cleanup. No functional change. --- sbin/ifconfig/ifconfig_netlink.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sbin/ifconfig/ifconfig_netlink.c b/sbin/ifconfig/ifconfig_netlink.c index d2e3863079e7..76dd99307f31 100644 --- a/sbin/ifconfig/ifconfig_netlink.c +++ b/sbin/ifconfig/ifconfig_netlink.c @@ -102,7 +102,7 @@ print_bits(const char *btype, uint32_t *v, const int v_count, } if (num > 0) printf(">"); -} +} static void nl_init_socket(struct snl_state *ss) @@ -287,7 +287,7 @@ match_iface(struct ifconfig_args *args, struct iface *iface) }; return (match_ether(&sdl)); } - + for (struct ifa *ifa = iface->ifa; ifa != NULL; ifa = ifa->next) { if (args->afp->af_af == ifa->addr.ifa_family) return (true); @@ -421,7 +421,7 @@ static int get_local_socket(void) { int s = socket(AF_LOCAL, SOCK_DGRAM, 0); - + if (s < 0) err(1, "socket(family %u,SOCK_DGRAM)", AF_LOCAL); return (s); From nobody Thu Jul 20 18:02:30 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6LBK06k8z4nf3p; Thu, 20 Jul 2023 18:02:33 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta001.cacentral1.a.cloudfilter.net (omta001.cacentral1.a.cloudfilter.net [3.97.99.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6LBJ6RTDz3kbG; Thu, 20 Jul 2023 18:02:32 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; none Received: from shw-obgw-4001a.ext.cloudfilter.net ([10.228.9.142]) by cmsmtp with ESMTP id MQSBqfqWaLAoIMXyyqcAoH; Thu, 20 Jul 2023 18:02:32 +0000 Received: from spqr.komquats.com ([70.66.152.170]) by cmsmtp with ESMTPA id MXywqunJRHFsOMXyxqzhIv; Thu, 20 Jul 2023 18:02:32 +0000 X-Authority-Analysis: v=2.4 cv=XZqaca15 c=1 sm=1 tr=0 ts=64b976b8 a=y8EK/9tc/U6QY+pUhnbtgQ==:117 a=y8EK/9tc/U6QY+pUhnbtgQ==:17 a=kj9zAlcOel0A:10 a=ws7JD89P4LkA:10 a=VxmjJ2MpAAAA:8 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=EkcXrb_YAAAA:8 a=1Rrndl_ikATqP_Wnm9AA:9 a=CjuIK1q_8ugA:10 a=8k-k-Cn0ORkA:10 a=QHqjWXHE9tEA:10 a=7gXAzLPJhVmCkEl4_tsf:22 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id 2229C1BC; Thu, 20 Jul 2023 11:02:30 -0700 (PDT) Received: by slippy.cwsent.com (Postfix, from userid 1000) id 18BDF11F; Thu, 20 Jul 2023 11:02:30 -0700 (PDT) X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.8+dev Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Konstantin Belousov cc: Cy Schubert , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 21e45c30c35c - main - mmap(MAP_STACK): on stack grow, use original protection In-reply-to: References: <202307201412.36KECDSU084918@gitrepo.freebsd.org> <20230720163231.B1D4277@slippy.cwsent.com> <20230720164145.0CF1311F@slippy.cwsent.com> <20230720170624.B8F28DB@slippy.cwsent.com> Comments: In-reply-to Konstantin Belousov message dated "Thu, 20 Jul 2023 20:34:35 +0300." List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 20 Jul 2023 11:02:30 -0700 Message-Id: <20230720180230.18BDF11F@slippy.cwsent.com> X-CMAE-Envelope: MS4xfNi5bUawf+GpY0IsDgDlGtrqTUMHsJzA0zYZ1o8JMCSlHEgN3fWUu7AnN2bLie7oJYV2ZAHi/yg8yIaxccbmno8YsnhkrVBcKlvlMWNeX4htK8nYHUEP QQ4mbfVbgMwLt5eHokHGsKOsN5q0X+TM2M3NDgD4y68K4cq1chDUYst3bZQ5eTTgPUGvyf32tmZguwEHRMFM+0wA5/sfSFYfjq2piQUYOwS6Wx9EOKO6oOwa CgsbJX/NHCHSS5xZOA5WhL1Dlo592mvTDa1uwTn/TH+eAOi/NFkeosycs/eHFwx9b9nNowGu9dCaadUm1wH71oXjuOPu7MbCxKniGGcFcKA= X-Rspamd-Queue-Id: 4R6LBJ6RTDz3kbG X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:16509, ipnet:3.96.0.0/15, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated In message , Konstantin Belousov writes: > On Thu, Jul 20, 2023 at 10:06:24AM -0700, Cy Schubert wrote: > > In message <20230720164145.0CF1311F@slippy.cwsent.com>, Cy Schubert writes: > > > In message <20230720163231.B1D4277@slippy.cwsent.com>, Cy Schubert writes > : > > > > In message <202307201412.36KECDSU084918@gitrepo.freebsd.org>, Konstanti > n > > > > Belous > > > > ov writes: > > > > > The branch main has been updated by kib: > > > > > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=21e45c30c35c9aa732073f72 > 5924 > > > ca > > > > f5 > > > > > 81c93460 > > > > > > > > > > commit 21e45c30c35c9aa732073f725924caf581c93460 > > > > > Author: Konstantin Belousov > > > > > AuthorDate: 2023-07-19 11:05:32 +0000 > > > > > Commit: Konstantin Belousov > > > > > CommitDate: 2023-07-20 14:11:42 +0000 > > > > > > > > > > mmap(MAP_STACK): on stack grow, use original protection > > > > > > > > > > If mprotect(2) changed protection in the bottom of the currently > grow > > > n > > > > > stack region, currently the changed protection would be used for > the > > > > > stack grow on next fault. This is arguably unexpected. > > > > > > > > > > Store the original protection for the entry at mmap(2) time in th > e > > > > > offset member of the gap vm_map_entry, and use it for protection > of t > > > he > > > > > grown stack region. > > > > > > > > > > PR: 272585 > > > > > Reported by: John F. Carr > > > > > Reviewed by: alc, markj > > > > > Sponsored by: The FreeBSD Foundation > > > > > MFC after: 1 week > > > > > Differential revision: https://reviews.freebsd.org/D41089 > > > > > --- > > > > > sys/vm/vm_map.c | 24 ++++++++++++++++-------- > > > > > sys/vm/vm_map.h | 4 ++++ > > > > > 2 files changed, 20 insertions(+), 8 deletions(-) > > > > > > > > > > diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c > > > > > index a02107b5e64d..997a49111a59 100644 > > > > > --- a/sys/vm/vm_map.c > > > > > +++ b/sys/vm/vm_map.c > > > > > @@ -4493,7 +4493,7 @@ static int > > > > > vm_map_stack_locked(vm_map_t map, vm_offset_t addrbos, vm_size_t max > _ssi > > > ze > > > > , > > > > > vm_size_t growsize, vm_prot_t prot, vm_prot_t max, int cow) > > > > > { > > > > > - vm_map_entry_t new_entry, prev_entry; > > > > > + vm_map_entry_t gap_entry, new_entry, prev_entry; > > > > > vm_offset_t bot, gap_bot, gap_top, top; > > > > > vm_size_t init_ssize, sgp; > > > > > int orient, rv; > > > > > @@ -4575,11 +4575,14 @@ vm_map_stack_locked(vm_map_t map, vm_offset_t > add > > > rb > > > > os > > > > > , vm_size_t max_ssize, > > > > > * read-ahead logic is never used for it. Re-use > > > > > * next_read of the gap entry to store > > > > > * stack_guard_page for vm_map_growstack(). > > > > > + * Similarly, since a gap cannot have a backing object, > > > > > + * store the original stack protections in the > > > > > + * object offset. > > > > > */ > > > > > - if (orient == MAP_STACK_GROWS_DOWN) > > > > > - vm_map_entry_pred(new_entry)->next_read = sgp; > > > > > - else > > > > > - vm_map_entry_succ(new_entry)->next_read = sgp; > > > > > + gap_entry = orient == MAP_STACK_GROWS_DOWN ? > > > > > + vm_map_entry_pred(new_entry) : vm_map_entry_succ(ne > w_entry) > > > > > ; > > > > > + gap_entry->next_read = sgp; > > > > > + gap_entry->offset = prot; > > > > > } else { > > > > > (void)vm_map_delete(map, bot, top); > > > > > } > > > > > @@ -4599,6 +4602,7 @@ vm_map_growstack(vm_map_t map, vm_offset_t addr > , vm > > > _m > > > > ap > > > > > _entry_t gap_entry) > > > > > struct ucred *cred; > > > > > vm_offset_t gap_end, gap_start, grow_start; > > > > > vm_size_t grow_amount, guard, max_grow; > > > > > + vm_prot_t prot; > > > > > rlim_t lmemlim, stacklim, vmemlim; > > > > > int rv, rv1 __diagused; > > > > > bool gap_deleted, grow_down, is_procstack; > > > > > @@ -4739,6 +4743,12 @@ retry: > > > > > } > > > > > > > > > > if (grow_down) { > > > > > + /* > > > > > + * The gap_entry "offset" field is overloaded. See > > > > > + * vm_map_stack_locked(). > > > > > + */ > > > > > + prot = gap_entry->offset; > > > > > + > > > > > grow_start = gap_entry->end - grow_amount; > > > > > if (gap_entry->start + grow_amount == gap_entry->end) { > > > > > gap_start = gap_entry->start; > > > > > @@ -4751,9 +4761,7 @@ retry: > > > > > gap_deleted = false; > > > > > } > > > > > rv = vm_map_insert(map, NULL, 0, grow_start, > > > > > - grow_start + grow_amount, > > > > > - stack_entry->protection, stack_entry->max_protectio > n, > > > > > - MAP_STACK_GROWS_DOWN); > > > > > + grow_start + grow_amount, prot, prot, MAP_STACK_GRO > WS_DOWN) > > > > > ; > > > > > if (rv != KERN_SUCCESS) { > > > > > if (gap_deleted) { > > > > > rv1 = vm_map_insert(map, NULL, 0, gap_s > tart, > > > > > diff --git a/sys/vm/vm_map.h b/sys/vm/vm_map.h > > > > > index fd8b606e8ddc..c4ed36ce57ba 100644 > > > > > --- a/sys/vm/vm_map.h > > > > > +++ b/sys/vm/vm_map.h > > > > > @@ -97,6 +97,10 @@ union vm_map_object { > > > > > * a VM object (or sharing map) and offset into that object, > > > > > * and user-exported inheritance and protection information. > > > > > * Also included is control information for virtual copy operation > > > s. > > > > > + * > > > > > + * For stack gap map entries (MAP_ENTRY_GUARD | MAP_ENTRY_GROWS_DO > > > WN > > > > > + * or UP), the next_read member is reused as the stack_guard_page > > > > > + * storage, and offset is the stack protection. > > > > > */ > > > > > struct vm_map_entry { > > > > > struct vm_map_entry *left; /* left child or previous entry > */ > > > > > > > > > > > > > This commit has caused screen (sysutils/screen) to display the followin > g > > > > error when opening a new screen window (ctrl-A c): > > > > > > > > pid 28473 comm screen-4.9.0 has trashed its stack, killing > > > > > > > > > > > > -- > > > > Cheers, > > > > Cy Schubert > > > > FreeBSD UNIX: Web: https://FreeBSD.org > > > > NTP: Web: https://nwtime.org > > > > > > > > e^(i*pi)+1=0 > > > > > > > > > > > > > > I'm also seeing artifacts in emails by nmh (mail/nmh) in my sent director > y > > > and in the email cc'd to me. > > > > > > > > > -- > > > Cheers, > > > Cy Schubert > > > FreeBSD UNIX: Web: https://FreeBSD.org > > > NTP: Web: https://nwtime.org > > > > > > e^(i*pi)+1=0 > > > > > > > > > > Sometimes this occurs at screen start. Then it hangs. > > > > slippy$ screen > > pid 7275 comm screen-4.9.0 has trashed its stack, killing > > Can you check this? > > diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c > index 8c864c943f5d..4c5f1c08954d 100644 > --- a/sys/vm/vm_map.c > +++ b/sys/vm/vm_map.c > @@ -4202,7 +4202,8 @@ vm_map_copy_entry( > src_entry->start); > } else { > dst_entry->object.vm_object = NULL; > - dst_entry->offset = 0; > + if ((dst_entry->eflags &> + dst_entry->offset = 0; > if (src_entry->cred != NULL) { > dst_entry->cred = curthread->td_ucred; > crhold(dst_entry->cred); Yes, this fixes the screen and pkg regressions. Thanks for the patch. -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e^(i*pi)+1=0 From nobody Thu Jul 20 18:09:26 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6LLK2DRLz4nhQ0; Thu, 20 Jul 2023 18:09:29 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta001.cacentral1.a.cloudfilter.net (omta001.cacentral1.a.cloudfilter.net [3.97.99.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6LLK1cXgz3mC4; Thu, 20 Jul 2023 18:09:29 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; none Received: from shw-obgw-4002a.ext.cloudfilter.net ([10.228.9.250]) by cmsmtp with ESMTP id MOdFqfnXuLAoIMY5gqcCod; Thu, 20 Jul 2023 18:09:28 +0000 Received: from spqr.komquats.com ([70.66.152.170]) by cmsmtp with ESMTPA id MY5eqHGq1yAOeMY5fq8GAY; Thu, 20 Jul 2023 18:09:28 +0000 X-Authority-Analysis: v=2.4 cv=e5oV9Il/ c=1 sm=1 tr=0 ts=64b97858 a=y8EK/9tc/U6QY+pUhnbtgQ==:117 a=y8EK/9tc/U6QY+pUhnbtgQ==:17 a=kj9zAlcOel0A:10 a=ws7JD89P4LkA:10 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=EkcXrb_YAAAA:8 a=VxmjJ2MpAAAA:8 a=NCkSDawCeJ8rtZbfAdsA:9 a=CjuIK1q_8ugA:10 a=MpzTSJa1xHYA:10 a=8k-k-Cn0ORkA:10 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 a=LK5xJRSDVpKd5WXXoEvA:22 a=7gXAzLPJhVmCkEl4_tsf:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id 476DF173; Thu, 20 Jul 2023 11:09:26 -0700 (PDT) Received: by slippy.cwsent.com (Postfix, from userid 1000) id 29987BC; Thu, 20 Jul 2023 11:09:26 -0700 (PDT) X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.8+dev Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Cy Schubert cc: Konstantin Belousov , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 21e45c30c35c - main - mmap(MAP_STACK): on stack grow, use original protection In-reply-to: <20230720180230.18BDF11F@slippy.cwsent.com> References: <202307201412.36KECDSU084918@gitrepo.freebsd.org> <20230720163231.B1D4277@slippy.cwsent.com> <20230720164145.0CF1311F@slippy.cwsent.com> <20230720170624.B8F28DB@slippy.cwsent.com> <20230720180230.18BDF11F@slippy.cwsent.com> Comments: In-reply-to Cy Schubert message dated "Thu, 20 Jul 2023 11:02:30 -0700." List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 20 Jul 2023 11:09:26 -0700 Message-Id: <20230720180926.29987BC@slippy.cwsent.com> X-CMAE-Envelope: MS4xfO4JWDjgG6K3S9M0e2kXt2B0vcbRCW/NXNiA0+nl9djz9zp3g6KypH0W5POqJG+SWkgUrUXMZRSX+9RNzvchjoBQZyyhRTP7Exi32GSQS1Unnv8B1rv2 qwQeVLaz48C04HKiO3fdSVSiy8usiScWm7UqdPaeXc2CeekznDb5ViR1Bk33Zh0wfvLrWxxMERyEYSGyjA6IRBS4LR24BCEFl3avu1yrkVdIH5H7U69+fXDh ADpV72wye5GHcocRaqYdrybLPE0Q5F14z4NyA6D/YHwdXJZ/gsv6G2XoCBZ5I2W29X7GgIgVXwS65LAS+B0SsBhpv9OsxSfO47p8JgzNz+0= X-Rspamd-Queue-Id: 4R6LLK1cXgz3mC4 X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:16509, ipnet:3.96.0.0/15, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated This email appears truncated. My original reply was, Yes, this fixes the screen and pkg regressions. Thanks for the patch. -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e^(i*pi)+1=0 In message <20230720180230.18BDF11F@slippy.cwsent.com>, Cy Schubert writes: > In message , Konstantin Belousov writes: > > On Thu, Jul 20, 2023 at 10:06:24AM -0700, Cy Schubert wrote: > > > In message <20230720164145.0CF1311F@slippy.cwsent.com>, Cy Schubert write > s: > > > > In message <20230720163231.B1D4277@slippy.cwsent.com>, Cy Schubert writ > es > > : > > > > > In message <202307201412.36KECDSU084918@gitrepo.freebsd.org>, Konstan > ti > > n > > > > > Belous > > > > > ov writes: > > > > > > The branch main has been updated by kib: > > > > > > > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=21e45c30c35c9aa732073f > 72 > > 5924 > > > > ca > > > > > f5 > > > > > > 81c93460 > > > > > > > > > > > > commit 21e45c30c35c9aa732073f725924caf581c93460 > > > > > > Author: Konstantin Belousov > > > > > > AuthorDate: 2023-07-19 11:05:32 +0000 > > > > > > Commit: Konstantin Belousov > > > > > > CommitDate: 2023-07-20 14:11:42 +0000 > > > > > > > > > > > > mmap(MAP_STACK): on stack grow, use original protection > > > > > > > > > > > > If mprotect(2) changed protection in the bottom of the currentl > y > > grow > > > > n > > > > > > stack region, currently the changed protection would be used fo > r > > the > > > > > > stack grow on next fault. This is arguably unexpected. > > > > > > > > > > > > Store the original protection for the entry at mmap(2) time in > th > > e > > > > > > offset member of the gap vm_map_entry, and use it for protectio > n > > of t > > > > he > > > > > > grown stack region. > > > > > > > > > > > > PR: 272585 > > > > > > Reported by: John F. Carr > > > > > > Reviewed by: alc, markj > > > > > > Sponsored by: The FreeBSD Foundation > > > > > > MFC after: 1 week > > > > > > Differential revision: https://reviews.freebsd.org/D41089 > > > > > > --- > > > > > > sys/vm/vm_map.c | 24 ++++++++++++++++-------- > > > > > > sys/vm/vm_map.h | 4 ++++ > > > > > > 2 files changed, 20 insertions(+), 8 deletions(-) > > > > > > > > > > > > diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c > > > > > > index a02107b5e64d..997a49111a59 100644 > > > > > > --- a/sys/vm/vm_map.c > > > > > > +++ b/sys/vm/vm_map.c > > > > > > @@ -4493,7 +4493,7 @@ static int > > > > > > vm_map_stack_locked(vm_map_t map, vm_offset_t addrbos, vm_size_t m > ax > > _ssi > > > > ze > > > > > , > > > > > > vm_size_t growsize, vm_prot_t prot, vm_prot_t max, int cow) > > > > > > { > > > > > > - vm_map_entry_t new_entry, prev_entry; > > > > > > + vm_map_entry_t gap_entry, new_entry, prev_entry; > > > > > > vm_offset_t bot, gap_bot, gap_top, top; > > > > > > vm_size_t init_ssize, sgp; > > > > > > int orient, rv; > > > > > > @@ -4575,11 +4575,14 @@ vm_map_stack_locked(vm_map_t map, vm_offset > _t > > add > > > > rb > > > > > os > > > > > > , vm_size_t max_ssize, > > > > > > * read-ahead logic is never used for it. Re-use > > > > > > * next_read of the gap entry to store > > > > > > * stack_guard_page for vm_map_growstack(). > > > > > > + * Similarly, since a gap cannot have a backing object, > > > > > > + * store the original stack protections in the > > > > > > + * object offset. > > > > > > */ > > > > > > - if (orient == MAP_STACK_GROWS_DOWN) > > > > > > - vm_map_entry_pred(new_entry)->next_read = sgp; > > > > > > - else > > > > > > - vm_map_entry_succ(new_entry)->next_read = sgp; > > > > > > + gap_entry = orient == MAP_STACK_GROWS_DOWN ? > > > > > > + vm_map_entry_pred(new_entry) : vm_map_entry_succ(ne > > w_entry) > > > > > > ; > > > > > > + gap_entry->next_read = sgp; > > > > > > + gap_entry->offset = prot; > > > > > > } else { > > > > > > (void)vm_map_delete(map, bot, top); > > > > > > } > > > > > > @@ -4599,6 +4602,7 @@ vm_map_growstack(vm_map_t map, vm_offset_t ad > dr > > , vm > > > > _m > > > > > ap > > > > > > _entry_t gap_entry) > > > > > > struct ucred *cred; > > > > > > vm_offset_t gap_end, gap_start, grow_start; > > > > > > vm_size_t grow_amount, guard, max_grow; > > > > > > + vm_prot_t prot; > > > > > > rlim_t lmemlim, stacklim, vmemlim; > > > > > > int rv, rv1 __diagused; > > > > > > bool gap_deleted, grow_down, is_procstack; > > > > > > @@ -4739,6 +4743,12 @@ retry: > > > > > > } > > > > > > > > > > > > if (grow_down) { > > > > > > + /* > > > > > > + * The gap_entry "offset" field is overloaded. See > > > > > > + * vm_map_stack_locked(). > > > > > > + */ > > > > > > + prot = gap_entry->offset; > > > > > > + > > > > > > grow_start = gap_entry->end - grow_amount; > > > > > > if (gap_entry->start + grow_amount == gap_entry->end) { > > > > > > gap_start = gap_entry->start; > > > > > > @@ -4751,9 +4761,7 @@ retry: > > > > > > gap_deleted = false; > > > > > > } > > > > > > rv = vm_map_insert(map, NULL, 0, grow_start, > > > > > > - grow_start + grow_amount, > > > > > > - stack_entry->protection, stack_entry->max_protectio > > n, > > > > > > - MAP_STACK_GROWS_DOWN); > > > > > > + grow_start + grow_amount, prot, prot, MAP_STACK_GRO > > WS_DOWN) > > > > > > ; > > > > > > if (rv != KERN_SUCCESS) { > > > > > > if (gap_deleted) { > > > > > > rv1 = vm_map_insert(map, NULL, 0, gap_s > > tart, > > > > > > diff --git a/sys/vm/vm_map.h b/sys/vm/vm_map.h > > > > > > index fd8b606e8ddc..c4ed36ce57ba 100644 > > > > > > --- a/sys/vm/vm_map.h > > > > > > +++ b/sys/vm/vm_map.h > > > > > > @@ -97,6 +97,10 @@ union vm_map_object { > > > > > > * a VM object (or sharing map) and offset into that object, > > > > > > * and user-exported inheritance and protection information. > > > > > > * Also included is control information for virtual copy operation > > > > s. > > > > > > + * > > > > > > + * For stack gap map entries (MAP_ENTRY_GUARD | MAP_ENTRY_GROWS_DO > > > > WN > > > > > > + * or UP), the next_read member is reused as the stack_guard_page > > > > > > + * storage, and offset is the stack protection. > > > > > > */ > > > > > > struct vm_map_entry { > > > > > > struct vm_map_entry *left; /* left child or previous entry > > */ > > > > > > > > > > > > > > > > This commit has caused screen (sysutils/screen) to display the follow > in > > g > > > > > error when opening a new screen window (ctrl-A c): > > > > > > > > > > pid 28473 comm screen-4.9.0 has trashed its stack, killing > > > > > > > > > > > > > > > -- > > > > > Cheers, > > > > > Cy Schubert > > > > > FreeBSD UNIX: Web: https://FreeBSD.org > > > > > NTP: Web: https://nwtime.org > > > > > > > > > > e^(i*pi)+1=0 > > > > > > > > > > > > > > > > > > I'm also seeing artifacts in emails by nmh> or > > y > > > > and in the email cc'd to me. > > > > > > > > > > > > -- > > > > Cheers, > > > > Cy Schubert > > > > FreeBSD UNIX: Web: https://FreeBSD.org > > > > NTP: Web: https://nwtime.org > > > > > > > > e^(i*pi)+1=0 > > > > > > > > > > > > > > Sometimes this occurs at screen start. Then it hangs. > > > > > > slippy$ screen > > > pid 7275 comm screen-4.9.0 has trashed its stack, killing > > > > Can you check this? > > > > diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c > > index 8c864c943f5d..4c5f1c08954d 100644 > > --- a/sys/vm/vm_map.c > > +++ b/sys/vm/vm_map.c > > @@ -4202,7 +4202,8 @@ vm_map_copy_entry( > > src_entry->start); > > } else { > > dst_entry->object.vm_object = NULL; > > - dst_entry->offset = 0; > > + if ((dst_entry->eflags & From nobody Thu Jul 20 18:35:39 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6LyB0FR6z4p0cb; Thu, 20 Jul 2023 18:37:06 +0000 (UTC) (envelope-from marck@rinet.ru) Received: from woozle.rinet.ru (woozle.rinet.ru [195.54.192.68]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6Ly94T47z3tjb; Thu, 20 Jul 2023 18:37:05 +0000 (UTC) (envelope-from marck@rinet.ru) Authentication-Results: mx1.freebsd.org; none Received: from localhost (woozle.rinet.ru [195.54.192.68]) by woozle.rinet.ru (8.14.5/8.14.5) with ESMTP id 36KIZdSR004096; Thu, 20 Jul 2023 21:35:41 +0300 (MSK) (envelope-from marck@rinet.ru) Date: Thu, 20 Jul 2023 21:35:39 +0300 (MSK) From: Dmitry Morozovsky To: Cy Schubert cc: Konstantin Belousov , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 21e45c30c35c - main - mmap(MAP_STACK): on stack grow, use original protection In-Reply-To: <20230720180926.29987BC@slippy.cwsent.com> Message-ID: References: <202307201412.36KECDSU084918@gitrepo.freebsd.org> <20230720163231.B1D4277@slippy.cwsent.com> <20230720164145.0CF1311F@slippy.cwsent.com> <20230720170624.B8F28DB@slippy.cwsent.com> <20230720180230.18BDF11F@slippy.cwsent.com> <20230720180926.29987BC@slippy.cwsent.com> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-OpenPGP-Key-ID: 6B691B03 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (woozle.rinet.ru [195.54.192.68]); Thu, 20 Jul 2023 21:35:41 +0300 (MSK) X-Rspamd-Queue-Id: 4R6Ly94T47z3tjb X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:8331, ipnet:195.54.192.0/19, country:RU] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated On Thu, 20 Jul 2023, Cy Schubert wrote: > This email appears truncated. My original reply was, > > Yes, this fixes the screen and pkg regressions. > > Thanks for the patch. FWIW, copy to the list was complete; maybe it's you local dellivery agent trouble -- Sincerely, D.Marck [MCK-RIPE] [ FreeBSD committer: marck@FreeBSD.org ] --------------------------------------------------------------------------- *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- woozle@woozle.net *** --------------------------------------------------------------------------- From nobody Thu Jul 20 18:38:03 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6LzQ1b1Cz4p1NC; Thu, 20 Jul 2023 18:38:10 +0000 (UTC) (envelope-from garyj@gmx.de) Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mout.gmx.net", Issuer "Telekom Security ServerID OV Class 2 CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6LzP5Cwgz3vS2; Thu, 20 Jul 2023 18:38:09 +0000 (UTC) (envelope-from garyj@gmx.de) Authentication-Results: mx1.freebsd.org; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1689878284; x=1690483084; i=garyj@gmx.de; bh=FZeElCvFs0bGg9K8gbIoOxxtK4fSUNX+tq59CqCpPus=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject:In-Reply-To:References:Reply- To; b=bBILZsew9+IDZeHKiU+WmR7IIZrH7AwosvZwGq3Zx267OLtwMPpYIemU6ZrIfKIZCtZytuZ nWCDc2DIqbUk5FZ2ZEDCqgwbRx8/AoxS5xUfncl6lFcH/13N+hA7y9A0yKdkCHga8ex1vBH9Z lHDssah7fWDamfN1YX40/pWkJG2hoTNpAYuu7EwpUwzLW9tQRfCvhyrl92uytOChT5a7D84xJ /tB5s14wtG+ZtAa+081XpvDNkFcx26la8kvAvwo0MhN5ihCgOxrcbejk5yo0dbQmFr+K1RQaX e/KRBKVlRhJjbFPW0hqtzJaik69LHglzO0VHYpmTPScRG7sf6VeA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from ernst.home ([91.2.50.110]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MuUj2-1q5ZgU0FMo-00rcIx; Thu, 20 Jul 2023 20:38:04 +0200 Date: Thu, 20 Jul 2023 20:38:03 +0200 From: Gary Jennejohn To: Konstantin Belousov Cc: Cy Schubert , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 21e45c30c35c - main - mmap(MAP_STACK): on stack grow, use original protection Message-ID: <20230720203803.5af13f1d@ernst.home> In-Reply-To: References: <202307201412.36KECDSU084918@gitrepo.freebsd.org> <20230720163231.B1D4277@slippy.cwsent.com> <20230720164145.0CF1311F@slippy.cwsent.com> <20230720170624.B8F28DB@slippy.cwsent.com> Reply-To: garyj@gmx.de X-Mailer: Claws Mail 3.19.0 (GTK+ 2.24.33; amd64-portbld-freebsd14.0) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:SUaDsaYvdHbEoKhSwzkl/zPbG9sDsJ0y3dw2KCmgj4AsYH6A/0/ 7OmEigb3dtA+V/l7nK6r8lJfa4vohKhL6CnxeOUz05t7dN0+S/1VrephA61Z94gcgV03yJS kJeUzOXMCJeUBCwQCTZuV0Gb7LVi8IjCqwlBtGYY6eKaF0RGVDHsT6zLmSha+dKbpy7Ybbu TFYEH1Cw/E4JcgGdZoj7w== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:E98sdG7LiG0=;2vDE57DyQ3HUMrTKJLvQc+BptzL 4jgxS6vZJFRStKzmPvPD3d6sx9LlXcyIiDBC5vQ/rTTDZGaoEuIB/W44Co4Fv1Auis+OZ7A/b MKDCqRjfvrV9c4yjct0Ta1yHp7Ko8SpKOC/o5KtKXuWPR4JzDJOAOOl2NZn/COwDmgp/mRc3t YaVpsl/fJwS0N3eyU6fL9fdJ6pAgJpe/pwLHouPVNAyjDdmT2JEFpRJjOhL7ngyAGpVItGUed Osuxv26SkakKbEFAz7aeQwY1mjYXv4ClVqhIXnxBNy6eWUK2FZp/MaKtIip/UoNRbe/zDts+y 6DREms6Opv8ApMGWcaiePmsSov1OMdxIG/KMbDG+3fhE1ae+CfoxPzu/v9FuZ99INcvAdNgBd p53HY0iIeX0NGGBaa2JNvbmeo+slOAKbGWWgo+4diGhugs/jC3jV8NImqqBbqM+rYYsFXWxGa niDfb+vCpIG1Hzk87R3vkpa08eRnhFzmHukBwSJfDmnQ8zilKNPQVZqhrhKE8k9Ze1Tuj9Iho TsI1CxvRVkpj7y62P8HzCRXM8rDXxKpc20zuVaakZhixHRcVBeNivTlgOuXbVqYlvKgxhMOr7 qIJkT5HwT23zx85iIjYhL3stUKVAQPzwX5UcLcH/Gc7ZzkQvg8w7SXzjfhJ2YK2lTiPahdC4L 4ORqveR0zT42lcXCkjiCjwpgTtluyNhrs+uP8Yu56vYc2DSfSa2wZSbFDhYFq4lVZgu2wC7/o dkV8pcBrTsS95Nr+UEvJMDGkPe42h/KIaw3P3pL4MvAPK1hFqT515OEfS7TvXpIDZv4NqlcN3 kcZJtPbBSBNczopuskAgr99SHuUq/PmiGM46Zh9d7SnR5gzAkZk09zwOmN/IQfPp8TCb+gF0a N4myr7W8KjLukzpdKc8LUYGm6ovbXcHtUjW9ngIENs4JiJMUf6C6g5pwU471RRlGqCuA+kS3V mbvxwzxQAHlyr4EA6N707md5Bc0= X-Rspamd-Queue-Id: 4R6LzP5Cwgz3vS2 X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:8560, ipnet:212.227.0.0/16, country:DE] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated On Thu, 20 Jul 2023 20:34:35 +0300 Konstantin Belousov wrote: > On Thu, Jul 20, 2023 at 10:06:24AM -0700, Cy Schubert wrote: > > In message <20230720164145.0CF1311F@slippy.cwsent.com>, Cy Schubert wr= ites: > > > In message <20230720163231.B1D4277@slippy.cwsent.com>, Cy Schubert w= rites: > > > > In message <202307201412.36KECDSU084918@gitrepo.freebsd.org>, Kons= tantin > > > > Belous > > > > ov writes: > > > > > The branch main has been updated by kib: > > > > > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D21e45c30c35c9aa73= 2073f725924 > > > ca > > > > f5 > > > > > 81c93460 > > > > > > > > > > commit 21e45c30c35c9aa732073f725924caf581c93460 > > > > > Author: Konstantin Belousov > > > > > AuthorDate: 2023-07-19 11:05:32 +0000 > > > > > Commit: Konstantin Belousov > > > > > CommitDate: 2023-07-20 14:11:42 +0000 > > > > > > > > > > mmap(MAP_STACK): on stack grow, use original protection > > > > > > > > > > If mprotect(2) changed protection in the bottom of the curre= ntly grow > > > n > > > > > stack region, currently the changed protection would be used= for the > > > > > stack grow on next fault. This is arguably unexpected. > > > > > > > > > > Store the original protection for the entry at mmap(2) time = in the > > > > > offset member of the gap vm_map_entry, and use it for protec= tion of t > > > he > > > > > grown stack region. > > > > > > > > > > PR: 272585 > > > > > Reported by: John F. Carr > > > > > Reviewed by: alc, markj > > > > > Sponsored by: The FreeBSD Foundation > > > > > MFC after: 1 week > > > > > Differential revision: https://reviews.freebsd.org/D41089 > > > > > --- > > > > > sys/vm/vm_map.c | 24 ++++++++++++++++-------- > > > > > sys/vm/vm_map.h | 4 ++++ > > > > > 2 files changed, 20 insertions(+), 8 deletions(-) > > > > > > > > > > diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c > > > > > index a02107b5e64d..997a49111a59 100644 > > > > > --- a/sys/vm/vm_map.c > > > > > +++ b/sys/vm/vm_map.c > > > > > @@ -4493,7 +4493,7 @@ static int > > > > > vm_map_stack_locked(vm_map_t map, vm_offset_t addrbos, vm_size_= t max_ssi > > > ze > > > > , > > > > > vm_size_t growsize, vm_prot_t prot, vm_prot_t max, int cow) > > > > > { > > > > > - vm_map_entry_t new_entry, prev_entry; > > > > > + vm_map_entry_t gap_entry, new_entry, prev_entry; > > > > > vm_offset_t bot, gap_bot, gap_top, top; > > > > > vm_size_t init_ssize, sgp; > > > > > int orient, rv; > > > > > @@ -4575,11 +4575,14 @@ vm_map_stack_locked(vm_map_t map, vm_off= set_t add > > > rb > > > > os > > > > > , vm_size_t max_ssize, > > > > > * read-ahead logic is never used for it. Re-use > > > > > * next_read of the gap entry to store > > > > > * stack_guard_page for vm_map_growstack(). > > > > > + * Similarly, since a gap cannot have a backing object, > > > > > + * store the original stack protections in the > > > > > + * object offset. > > > > > */ > > > > > - if (orient =3D=3D MAP_STACK_GROWS_DOWN) > > > > > - vm_map_entry_pred(new_entry)->next_read =3D sgp; > > > > > - else > > > > > - vm_map_entry_succ(new_entry)->next_read =3D sgp; > > > > > + gap_entry =3D orient =3D=3D MAP_STACK_GROWS_DOWN ? > > > > > + vm_map_entry_pred(new_entry) : vm_map_entry_succ(new_entr= y) > > > > > ; > > > > > + gap_entry->next_read =3D sgp; > > > > > + gap_entry->offset =3D prot; > > > > > } else { > > > > > (void)vm_map_delete(map, bot, top); > > > > > } > > > > > @@ -4599,6 +4602,7 @@ vm_map_growstack(vm_map_t map, vm_offset_t= addr, vm > > > _m > > > > ap > > > > > _entry_t gap_entry) > > > > > struct ucred *cred; > > > > > vm_offset_t gap_end, gap_start, grow_start; > > > > > vm_size_t grow_amount, guard, max_grow; > > > > > + vm_prot_t prot; > > > > > rlim_t lmemlim, stacklim, vmemlim; > > > > > int rv, rv1 __diagused; > > > > > bool gap_deleted, grow_down, is_procstack; > > > > > @@ -4739,6 +4743,12 @@ retry: > > > > > } > > > > > > > > > > if (grow_down) { > > > > > + /* > > > > > + * The gap_entry "offset" field is overloaded. See > > > > > + * vm_map_stack_locked(). > > > > > + */ > > > > > + prot =3D gap_entry->offset; > > > > > + > > > > > grow_start =3D gap_entry->end - grow_amount; > > > > > if (gap_entry->start + grow_amount =3D=3D gap_entry->end) { > > > > > gap_start =3D gap_entry->start; > > > > > @@ -4751,9 +4761,7 @@ retry: > > > > > gap_deleted =3D false; > > > > > } > > > > > rv =3D vm_map_insert(map, NULL, 0, grow_start, > > > > > - grow_start + grow_amount, > > > > > - stack_entry->protection, stack_entry->max_protection, > > > > > - MAP_STACK_GROWS_DOWN); > > > > > + grow_start + grow_amount, prot, prot, MAP_STACK_GROWS_DOW= N) > > > > > ; > > > > > if (rv !=3D KERN_SUCCESS) { > > > > > if (gap_deleted) { > > > > > rv1 =3D vm_map_insert(map, NULL, 0, gap_start, > > > > > diff --git a/sys/vm/vm_map.h b/sys/vm/vm_map.h > > > > > index fd8b606e8ddc..c4ed36ce57ba 100644 > > > > > --- a/sys/vm/vm_map.h > > > > > +++ b/sys/vm/vm_map.h > > > > > @@ -97,6 +97,10 @@ union vm_map_object { > > > > > * a VM object (or sharing map) and offset into that object, > > > > > * and user-exported inheritance and protection information. > > > > > * Also included is control information for virtual copy operat= ion > > > s. > > > > > + * > > > > > + * For stack gap map entries (MAP_ENTRY_GUARD | MAP_ENTRY_GROWS= _DO > > > WN > > > > > + * or UP), the next_read member is reused as the stack_guard_pa= ge > > > > > + * storage, and offset is the stack protection. > > > > > */ > > > > > struct vm_map_entry { > > > > > struct vm_map_entry *left; /* left child or previous entry */ > > > > > > > > > > > > > This commit has caused screen (sysutils/screen) to display the fol= lowing > > > > error when opening a new screen window (ctrl-A c): > > > > > > > > pid 28473 comm screen-4.9.0 has trashed its stack, killing > > > > > > > > > > > > -- > > > > Cheers, > > > > Cy Schubert > > > > FreeBSD UNIX: Web: https://FreeBSD.org > > > > NTP: Web: https://nwtime.org > > > > > > > > e^(i*pi)+1=3D0 > > > > > > > > > > > > > > I'm also seeing artifacts in emails by nmh (mail/nmh) in my sent dir= ectory > > > and in the email cc'd to me. > > > > > > > > > -- > > > Cheers, > > > Cy Schubert > > > FreeBSD UNIX: Web: https://FreeBSD.org > > > NTP: Web: https://nwtime.org > > > > > > e^(i*pi)+1=3D0 > > > > > > > > > > Sometimes this occurs at screen start. Then it hangs. > > > > slippy$ screen > > pid 7275 comm screen-4.9.0 has trashed its stack, killing > > Can you check this? > > diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c > index 8c864c943f5d..4c5f1c08954d 100644 > --- a/sys/vm/vm_map.c > +++ b/sys/vm/vm_map.c > @@ -4202,7 +4202,8 @@ vm_map_copy_entry( > src_entry->start); > } else { > dst_entry->object.vm_object =3D NULL; > - dst_entry->offset =3D 0; > + if ((dst_entry->eflags & MAP_ENTRY_GUARD) =3D=3D 0) > + dst_entry->offset =3D 0; > if (src_entry->cred !=3D NULL) { > dst_entry->cred =3D curthread->td_ucred; > crhold(dst_entry->cred); > > Works for me. I tested with both pkg and screen and saw no errors. =2D- Gary Jennejohn From nobody Thu Jul 20 19:01:37 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6MVX3qlRz4nJHk; Thu, 20 Jul 2023 19:01:40 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta002.cacentral1.a.cloudfilter.net (omta002.cacentral1.a.cloudfilter.net [3.97.99.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6MVX1wVCz44J0; Thu, 20 Jul 2023 19:01:40 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; none Received: from shw-obgw-4004a.ext.cloudfilter.net ([10.228.9.227]) by cmsmtp with ESMTP id MSWeqYx196NwhMYuBqS59Q; Thu, 20 Jul 2023 19:01:39 +0000 Received: from spqr.komquats.com ([70.66.152.170]) by cmsmtp with ESMTPA id MYu9qvqCb3fOSMYuAqANyW; Thu, 20 Jul 2023 19:01:39 +0000 X-Authority-Analysis: v=2.4 cv=J8G5USrS c=1 sm=1 tr=0 ts=64b98493 a=y8EK/9tc/U6QY+pUhnbtgQ==:117 a=y8EK/9tc/U6QY+pUhnbtgQ==:17 a=kj9zAlcOel0A:10 a=ws7JD89P4LkA:10 a=4-q2EoJHAAAA:8 a=6I5d2MoRAAAA:8 a=DWP2sRc5AAAA:8 a=YxBL1-UpAAAA:8 a=EkcXrb_YAAAA:8 a=F9ei1Uno-P_GoJFZxeQA:9 a=CjuIK1q_8ugA:10 a=fpfIJvRr2csibeS0vtzw:22 a=IjZwj45LgO3ly-622nXo:22 a=Tv02OOKAekTIK8191DnM:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id A4422DF; Thu, 20 Jul 2023 12:01:37 -0700 (PDT) Received: by slippy.cwsent.com (Postfix, from userid 1000) id A0421191; Thu, 20 Jul 2023 12:01:37 -0700 (PDT) X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.8+dev Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Dmitry Morozovsky cc: Cy Schubert , Konstantin Belousov , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 21e45c30c35c - main - mmap(MAP_STACK): on stack grow, use original protection In-reply-to: References: <202307201412.36KECDSU084918@gitrepo.freebsd.org> <20230720163231.B1D4277@slippy.cwsent.com> <20230720164145.0CF1311F@slippy.cwsent.com> <20230720170624.B8F28DB@slippy.cwsent.com> <20230720180230.18BDF11F@slippy.cwsent.com> <20230720180926.29987BC@slippy.cwsent.com> Comments: In-reply-to Dmitry Morozovsky message dated "Thu, 20 Jul 2023 21:35:39 +0300." List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 20 Jul 2023 12:01:37 -0700 Message-Id: <20230720190137.A0421191@slippy.cwsent.com> X-CMAE-Envelope: MS4xfEgtEggqXfFMkEZ99KxW2dQFr8c/ba+X2g7XMhgy1xK+EuFBdt2P3eYLOTqpzQG+CxbfeEs9V965dy/QK63q2ZTS0h3zjOpo68TXes83CVsfxpnCKCM2 IvKeHExsxAJC3yqJ7vGnmd6VVDdunPTFX5e40v8nrc/b8fGLo+EXsN21uqfQRdQYpa9ZlCjE4H/On0Jd+uprdqYTnQLBNxAOUjd1ROPwp2lQtkvB9s+KrY/2 qhlfi0g+0/fmrdmAW3I9qG5OHyKjoj7X5bx9QnWkdjYbWDqWI4SFUpm8giNQTvGt/5sTJkupQC0FJT/ygkinjkomEocb0skR8gXSn/qtTKbE2rnpmgXu1y8v B/vK9Sq6 X-Rspamd-Queue-Id: 4R6MVX1wVCz44J0 X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:16509, ipnet:3.96.0.0/15, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated In message , Dmitry Morozo vsky writes: > On Thu, 20 Jul 2023, Cy Schubert wrote: > > > This email appears truncated. My original reply was, > > > > Yes, this fixes the screen and pkg regressions. > > > > Thanks for the patch. > > FWIW, copy to the list was complete; maybe it's you local dellivery agent > trouble Not local delivery agent. The copy delivered to my laptop never went beyond the postfix on my laptop. The cc delivered to me on one of my servers downstairs shows the cc email hitting cloudflare (I have to use my ISP as a smarthost because they block port 25 egress), mx1.freebsd.org, and finally my mail gateway. Both copies which traversed separate paths had the same problem. The copy stored by nmh on local disk does have the full email. I think the first place to look would be the postfix on my laptop. A zpool scrub should be the first order of business. > > > -- > Sincerely, > D.Marck [MCK-RIPE] > [ FreeBSD committer: marck@FreeBSD.org ] > --------------------------------------------------------------------------- > *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- woozle@woozle.net *** > --------------------------------------------------------------------------- -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e^(i*pi)+1=0 From nobody Thu Jul 20 19:04:25 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6MYj61XYz4nLR9; Thu, 20 Jul 2023 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 4R6MYj5c28z45JL; Thu, 20 Jul 2023 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=1689879865; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Zo1IZ0/RiS+fJ6Jrr1WiP9B4l2mVnhN0q2iXZ5ndwC8=; b=F4rWiiO+RivHLeBnnwmbrbYbQvn3uAZ3lMrKDEGXX6jpAp11OhoJkYjdnBK6ElPPwpFTiK 57cMo8cg/TYXeYUDe8QwiDmVroQg9BLptr14NDQAT3ep1E6hv6CoNlPZNBz0Jcq0Sza5Bi Vqwt5sAo1bP7UMVPZyb5nuhSIIXYXeGYum1dqCpbT5CFgIxh5GwaUqS5RmBNOIydMKQ7e6 qazjXH90VJAuVOTi60R994SyWQgdMmCDwjaBMeVruQajxXXm4nR2L9c3u93pBAv/3umj+T sW8nHQ6v0e+Tjv+1FXEIRnp4IE6GzXLda+FQCbO40usErDA2T5HkZyKlaA2krA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689879865; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Zo1IZ0/RiS+fJ6Jrr1WiP9B4l2mVnhN0q2iXZ5ndwC8=; b=niCYn3z+nSNQF7WozQRm5WeBW5ce6YN+6P24qVjqf/0Pljc/HImNFUcmSWobxTuyVzbKi+ hNwzo7AL/ckAmDcPEEyJ3GURZGEBW7rxztFMA9mH7VDoluzzuQcO9zrgmNfcAyQjFnDZOp jY3/5fEcUW0Pk1YigOLMbBi5+UdWFsBvhe2989eoylyaVckYpABKG88IC6gk8TIeaaPzMG vVZJSYKiEVVDehAltvKf3PN81WzZ6KkhRW7oblS51qgoAeURSwpEUKCUaZYh8o5iP0kyhi 78vUj5ID7B2LwSjO15gxIHsSVPC5TRyHKH/FQzhVSp7VF3hnNvitPL91INM9Kw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689879865; a=rsa-sha256; cv=none; b=MvEaX1vNXQcBg05fBo1ZzIJ22bgQP28x6baGT+NyhLGZmqLsCpC8Vthw7EvsUJuk3HgLU0 e756G6itWEtnLbbLq3J97P6KnBSOA9NyX/j057hQMgJxN6pK9VVnjOxogmyeKz6D/Ch/rm qmkbSIYkKXH3x+bcW2fFNiM472JoYe9Zzxv1JH5NFs6lUH+W1a3vbIBOWiHYjyHTUn2sgq 6nWV5sAPztj6CrF3u3avp8c/FiKK67Hd700x8KjTATBJAm7jRGUZxtGeXcfT+CSmlDECnP mW2XPhn4St4tS2XFxhklLrUxmw5LiUpppKTBbLZDY3bzfcXJpibdPwVyMgzz5A== 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 4R6MYj4h1szjPd; Thu, 20 Jul 2023 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 36KJ4Plc070512; Thu, 20 Jul 2023 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 36KJ4PoX070511; Thu, 20 Jul 2023 19:04:25 GMT (envelope-from git) Date: Thu, 20 Jul 2023 19:04:25 GMT Message-Id: <202307201904.36KJ4PoX070511@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: db6c7c7f8d87 - main - vmspace_fork(): do not override offset for the guard entries List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: db6c7c7f8d870f377fcd1cc98e4832681bb5bdf0 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=db6c7c7f8d870f377fcd1cc98e4832681bb5bdf0 commit db6c7c7f8d870f377fcd1cc98e4832681bb5bdf0 Author: Konstantin Belousov AuthorDate: 2023-07-20 17:45:01 +0000 Commit: Konstantin Belousov CommitDate: 2023-07-20 19:04:03 +0000 vmspace_fork(): do not override offset for the guard entries The offset field contains protection for the stack guards. Reported by: cy Fixes: 21e45c30c35c9aa732073f725924caf581c93460 MFC after: 1 week --- sys/vm/vm_map.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c index 997a49111a59..444e09986d4e 100644 --- a/sys/vm/vm_map.c +++ b/sys/vm/vm_map.c @@ -4181,7 +4181,8 @@ vm_map_copy_entry( src_entry->start); } else { dst_entry->object.vm_object = NULL; - dst_entry->offset = 0; + if ((dst_entry->eflags & MAP_ENTRY_GUARD) == 0) + dst_entry->offset = 0; if (src_entry->cred != NULL) { dst_entry->cred = curthread->td_ucred; crhold(dst_entry->cred); From nobody Thu Jul 20 19:16:16 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6MqN4d1gz4nTXT; Thu, 20 Jul 2023 19:16: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 4R6MqN3mg2z489B; Thu, 20 Jul 2023 19:16:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689880576; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RF4+8X2E2hQkE90H+3segIRULTwyHbG3UmmNNEOKOn8=; b=nwrevky6458LIFK5y78IqasdTJNBW1kchsZkbAdYhr1roA7xXZFV+fAP71FMg3wTGMQFQn X+PatNUp+E2YUbS6DpMiOCpkmt8lWgcwulfoZy3ZlnV2+HRFKcdr8x9o18G5KtvoMD1LGe Q5fq5MUuVudAmUEyObor1x3OwUCNkTe1/JmAxnrqjzFYJURwVj8lWf20SWPaaS42+Lypow PmnBjKOydNWfAXEa/ZHKCOg6QzarN+3HWFkHI/dpfpvIPv/L5JMUZd6R1DLbsoee/ac/wE lGBR/RwOLkyswk3hGlEg+AUxjA9FO5FGiVpPqFTdMhxeaJxeLy0lpPolvw5ZGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689880576; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RF4+8X2E2hQkE90H+3segIRULTwyHbG3UmmNNEOKOn8=; b=wf3bIkkIZYPtVQ66VKbi7MQ6pkif2TZiae30pbB5LZe3jd0l2zvQ9/sEuX42IABkfK/wyz 9U+TgWLL5T0Mm7IcV1CHOPAH9/5LMy08oYZgGDH591hky55sGW9bDfZcCLzXY1RFeNsjWP upwmEmqkVBHJvQ+FVZB2OgAE1x+7WgcTPD9JpCRrb31w7sUomLBXl/hu8WtuGCOiX4HvgQ a/ZHwoKcZssDsjG9BB/iG4HFy9k66C6dL8TrgtLK3ATBtGFqEpFMHDXivzw8GEJ52kwGIT LQPR1WrpKaDsxdNXot072MDTfI20A/Vw6zdVXzJIMnMXZ/ymm+NeCvoLb7LdCg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689880576; a=rsa-sha256; cv=none; b=p1EVV+9wjjwRHA5KtmZI8E3Wsz3QhHLuryh5QZS+nSyx9Da3tc/PHwDcCTWNd9qN8N+sdQ g2Kz8Ed6xfo8Bq3azcXysVbR0Pvz16/KunOGHkS/hZUX81dt5fMo2CH03GprVBLWUQ37Bl pQcn01yTu+ftBrUdwE4m/3uQS1XtK2wevIOxXVqu6xrdo9JwmsJRYNGRcaL0clHJ0zfW4Y ylrv7fQj0fO18DkIO6fnNaAP3ZwBWBrzZC9kVdLrOXbuHOc9qZ8C3sgQRiBQJHTu++a3h4 O4m8CpjSEuUO3QVnniHjYCD7ejFx/7u46oVVHuMPhAZJPFh8urHsW3dTwprzpw== 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 4R6MqN2jLyzj9J; Thu, 20 Jul 2023 19:16: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 36KJGG7Y087159; Thu, 20 Jul 2023 19:16:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36KJGGWE087158; Thu, 20 Jul 2023 19:16:16 GMT (envelope-from git) Date: Thu, 20 Jul 2023 19:16:16 GMT Message-Id: <202307201916.36KJGGWE087158@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 1c42ed54bfe2 - main - libcrypto: add missing symbols to the FIPS provider List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 1c42ed54bfe2d3255ab4df4245de4b97c1064e40 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=1c42ed54bfe2d3255ab4df4245de4b97c1064e40 commit 1c42ed54bfe2d3255ab4df4245de4b97c1064e40 Author: Pierre Pronchery AuthorDate: 2023-07-20 18:16:14 +0000 Commit: Ed Maste CommitDate: 2023-07-20 19:05:12 +0000 libcrypto: add missing symbols to the FIPS provider The fips.so provider module exposing FIPS-validated algorithms was still missing a number of symbols. PR: 272454 Reviewed by: markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D41018 --- secure/lib/libcrypto/modules/fips/Makefile | 73 ++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/secure/lib/libcrypto/modules/fips/Makefile b/secure/lib/libcrypto/modules/fips/Makefile index c8b79e3badfd..d41e3bcfe294 100644 --- a/secure/lib/libcrypto/modules/fips/Makefile +++ b/secure/lib/libcrypto/modules/fips/Makefile @@ -32,6 +32,28 @@ SRCS+= ppccpuid.S ppccap.c SRCS+= mem_clr.c .endif +# crypto/aes +SRCS+= aes_cbc.c aes_cfb.c aes_ecb.c aes_ige.c aes_misc.c aes_ofb.c aes_wrap.c +.if defined(ASM_aarch64) +SRCS+= aes_core.c aesv8-armx.S vpaes-armv8.S +ACFLAGS.aesv8-armx.S= -march=armv8-a+crypto +.elif defined(ASM_amd64) +SRCS+= aes_core.c aesni-mb-x86_64.S aesni-sha1-x86_64.S aesni-sha256-x86_64.S +SRCS+= aesni-x86_64.S vpaes-x86_64.S +.elif defined(ASM_arm) +SRCS+= aes-armv4.S aesv8-armx.S bsaes-armv7.S +.elif defined(ASM_i386) +SRCS+= aes_core.c aesni-x86.S vpaes-x86.S +.elif defined(ASM_powerpc) +SRCS+= aes_core.c aes-ppc.S vpaes-ppc.S aesp8-ppc.S +.elif defined(ASM_powerpc64) +SRCS+= aes_core.c aes-ppc.S vpaes-ppc.S aesp8-ppc.S +.elif defined(ASM_powerpc64le) +SRCS+= aes_core.c aes-ppc.S vpaes-ppc.S aesp8-ppc.S +.else +SRCS+= aes_core.c +.endif + # crypto/bn SRCS+= bn_add.c bn_div.c bn_exp.c bn_lib.c bn_ctx.c bn_mul.c \ bn_mod.c bn_conv.c bn_rand.c bn_shift.c bn_word.c bn_blind.c \ @@ -57,6 +79,20 @@ SRCS+= bn_ppc.c bn-ppc.S ppc-mont.S SRCS+= bn_asm.c .endif +# crypto/buffer +SRCS+= buffer.c + +# crypto/cmac +SRCS+= cmac.c + +# crypto/des +SRCS+= set_key.c ecb3_enc.c +.if defined(ASM_i386) +SRCS+= crypt586.S des-586.S +.else +SRCS+= des_enc.c fcrypt_b.c +.endif + # crypto/dh SRCS+= dh_lib.c dh_key.c dh_group_params.c dh_check.c dh_backend.c dh_gen.c \ dh_kdf.c @@ -109,12 +145,38 @@ SRCS+= ffc_params.c ffc_params_generate.c ffc_key_generate.c \ ffc_params_validate.c ffc_key_validate.c ffc_backend.c \ ffc_dh.c +# crypto/hmac +SRCS+= hmac.c + # crypto/lhash SRCS+= lhash.c +# crypto/modes +SRCS+= cbc128.c ctr128.c cfb128.c ofb128.c gcm128.c ccm128.c xts128.c +SRCS+= wrap128.c +.if defined(ASM_aarch64) +SRCS+= ghashv8-armx.S aes-gcm-armv8_64.S +ACFLAGS.ghashv8-armx.S= -march=armv8-a+crypto +.elif defined(ASM_amd64) +SRCS+= aesni-gcm-x86_64.S ghash-x86_64.S +.elif defined(ASM_arm) +SRCS+= ghash-armv4.S ghashv8-armx.S +.elif defined(ASM_i386) +SRCS+= ghash-x86.S +.elif defined(ASM_powerpc) +SRCS+= ghashp8-ppc.S +.elif defined(ASM_powerpc64) +SRCS+= ghashp8-ppc.S +.elif defined(ASM_powerpc64le) +SRCS+= ghashp8-ppc.S +.endif + # crypto/property SRCS+= property_string.c property_parse.c property_query.c property.c defn_cache.c +# crypto/rand +SRCS+= rand_lib.c + # crypto/rsa SRCS+= rsa_ossl.c rsa_gen.c rsa_lib.c rsa_sign.c rsa_pk1.c \ rsa_none.c rsa_oaep.c rsa_chk.c rsa_pss.c rsa_x931.c rsa_crpt.c \ @@ -143,6 +205,9 @@ SRCS+= keccak1600-ppc64.S sha_ppc.c sha1-ppc.S sha256-ppc.S sha512-ppc.S sha256p SRCS+= keccak1600.c .endif +# crypto/stack +SRCS+= stack.c + # common SRCS+= capabilities.c bio_prov.c digest_to_nid.c \ securitycheck.c provider_seeding.c @@ -243,17 +308,25 @@ SRCS+= record/tls_pad.c s3_cbc.c .endif .PATH: ${LCRYPTO_SRC}/crypto \ + ${LCRYPTO_SRC}/crypto/aes \ ${LCRYPTO_SRC}/crypto/bio \ ${LCRYPTO_SRC}/crypto/bn \ + ${LCRYPTO_SRC}/crypto/buffer \ + ${LCRYPTO_SRC}/crypto/cmac \ + ${LCRYPTO_SRC}/crypto/des \ ${LCRYPTO_SRC}/crypto/dh \ ${LCRYPTO_SRC}/crypto/dsa \ ${LCRYPTO_SRC}/crypto/ec \ ${LCRYPTO_SRC}/crypto/evp \ ${LCRYPTO_SRC}/crypto/ffc \ + ${LCRYPTO_SRC}/crypto/hmac \ ${LCRYPTO_SRC}/crypto/lhash \ + ${LCRYPTO_SRC}/crypto/modes \ ${LCRYPTO_SRC}/crypto/property \ + ${LCRYPTO_SRC}/crypto/rand \ ${LCRYPTO_SRC}/crypto/rsa \ ${LCRYPTO_SRC}/crypto/sha \ + ${LCRYPTO_SRC}/crypto/stack \ ${LCRYPTO_SRC}/providers/fips \ ${LCRYPTO_SRC}/providers/common/der \ ${LCRYPTO_SRC}/providers/implementations/asymciphers \ From nobody Thu Jul 20 20:15:15 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6P7Z0nD6z4p5Nc; Thu, 20 Jul 2023 20:15:22 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.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 mx1.freebsd.org (Postfix) with ESMTPS id 4R6P7Y4n5Jz3GpJ; Thu, 20 Jul 2023 20:15:21 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Authentication-Results: mx1.freebsd.org; none Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 55EC13C0199; Thu, 20 Jul 2023 20:15:15 +0000 (UTC) Date: Thu, 20 Jul 2023 20:15:15 +0000 From: Brooks Davis To: Konstantin Belousov Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 21e45c30c35c - main - mmap(MAP_STACK): on stack grow, use original protection Message-ID: References: <202307201412.36KECDSU084918@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202307201412.36KECDSU084918@gitrepo.freebsd.org> X-Rspamd-Queue-Id: 4R6P7Y4n5Jz3GpJ X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:36236, ipnet:199.48.128.0/22, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated On Thu, Jul 20, 2023 at 02:12:13PM +0000, Konstantin Belousov wrote: > The branch main has been updated by kib: > > URL: https://cgit.FreeBSD.org/src/commit/?id=21e45c30c35c9aa732073f725924caf581c93460 > > commit 21e45c30c35c9aa732073f725924caf581c93460 > Author: Konstantin Belousov > AuthorDate: 2023-07-19 11:05:32 +0000 > Commit: Konstantin Belousov > CommitDate: 2023-07-20 14:11:42 +0000 > > mmap(MAP_STACK): on stack grow, use original protection > > If mprotect(2) changed protection in the bottom of the currently grown > stack region, currently the changed protection would be used for the > stack grow on next fault. This is arguably unexpected. > > Store the original protection for the entry at mmap(2) time in the > offset member of the gap vm_map_entry, and use it for protection of the > grown stack region. It occured to me to wonder how this interacts with __enable_execute_stack(). I think it's ok so long as the compiler always emits __enable_execute_stack() for each trampoline and doesn't depend on extentions to the stack being executable from the first trampoline creation, but I don't know where to look to verify that's the case. -- Brooks From nobody Thu Jul 20 20:23:39 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6PK75nYTz4p9nZ; Thu, 20 Jul 2023 20:23: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 4R6PK75KvNz3K0j; Thu, 20 Jul 2023 20:23:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689884619; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+gxQ8pOqqlhpI5mh9BvnzrTpZ6oQhMvFzlRFWeO9s+w=; b=MOBhpDab/svSArOgureNyF9TaLg54gGrz9P5i10SnXH+tMFHY2Ccv/IpQb0X8rAvKiV8+m PC5Kus5pxTYQ4TvqWGx/gVUWcvPTCMbf6uamWlsCnQ+4AKEfyP3pzTCPn10iMgaThyetOY h8ahbLQKYqrdQQ62e+mnQc6qUd8q4++jaKhvhvVYSAQazZavAM/op1e5Uo7cGhyUjsr3ZU 1FWFACoHx2nh9mjulwwG31NmJdDZEwnURVwvKVBTDaKdyn/I5Hf44QMIroXTsMO4u5ZCvj MDkjD8E5ctG1+qUdcMDK55IJFrUcz4HY1aclswYX0LiaWh0tE7na5ggPIOESPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689884619; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+gxQ8pOqqlhpI5mh9BvnzrTpZ6oQhMvFzlRFWeO9s+w=; b=om6egItIsU2HWadqm/5R7uCWHRPmRg5KMUE45pg39CxB4g6N/mX4FShcwIrhcoSkPk3P/j wgwFFuwY0qtD5SrYNA5Ne1D9u96J2rzs9tRiA1N8zUZwOC7eUVJ17o0RHuJIRHtwg2CE+l thDkIHuAxg1kH/7hWSXPdxZES+5yX9MU1G51jTaquWAIGQUM5zMybzUt48fFQRTSYfkFiE 8Syp9bxucAGVxPN3LJa2XbwCrYdflihnM/cbjLfACfZ/PowX/AqyuHncWeeA3IXM0dIiHM iTKaqxK1D+MYQhBn5Buuw/eC1KZJCNr69mwXeEWzDYlhU6JtvrGKTk5y9NQyWg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689884619; a=rsa-sha256; cv=none; b=JfdZSF7ZYcYQRTNplV3YcWZRkBoLOGB0u71g4vfvV36PZrsd+jxmWmlkCGhHvwiE59pFXJ Vbdu/3ekxjUQU3YlggdicyMeR5rFQZlxY+fErYXrvQteXzHazyxWjH0RxHJRAEcBUq8yUR hgLyJyE4m2UI+bvxHpLgm+jO6dnzt6zpY839/G+KDU+KDG6qPR1YP6o+1wcXWUaFQ4g6pY LmOLt26lbep5ARlYRIe8WlFCWuNwVHgT8M0NeMOnjUQgETL08IzgkQuL69gcqngtANNrb7 f5MQMJqp0ptnCJlvOUjWNWnXecDez2NqZMozaj+RkxGRyeUZeX0MhSH2kHmYVQ== 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 4R6PK74PMyzl32; Thu, 20 Jul 2023 20:23: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 36KKNdSf002722; Thu, 20 Jul 2023 20:23:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36KKNdNp002721; Thu, 20 Jul 2023 20:23:39 GMT (envelope-from git) Date: Thu, 20 Jul 2023 20:23:39 GMT Message-Id: <202307202023.36KKNdNp002721@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Eugene Grosbein Subject: git: 273a307d0b80 - main - tftpd: introduce new option -S List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 273a307d0b80743fb08e23237b3f74dc94a8fa2a Auto-Submitted: auto-generated The branch main has been updated by eugen: URL: https://cgit.FreeBSD.org/src/commit/?id=273a307d0b80743fb08e23237b3f74dc94a8fa2a commit 273a307d0b80743fb08e23237b3f74dc94a8fa2a Author: Eugene Grosbein AuthorDate: 2023-07-20 20:11:33 +0000 Commit: Eugene Grosbein CommitDate: 2023-07-20 20:23:35 +0000 tftpd: introduce new option -S Historically, tftpd disallowed write requests to existing files that are not publicly writable. Such requirement is questionable at least. Let us make it possible to run tftpd in chrooted environment keeping files non-world writable. New option -S enables write requests to existing files for chrooted run according to generic file permissions. It is ignored unless tftpd runs chrooted. MFC after: 1 month Requested by: marck Differential: https://reviews.freebsd.org/D41090 (based on) --- libexec/tftpd/tftpd.8 | 22 ++++++++++++++++++---- libexec/tftpd/tftpd.c | 14 +++++++++++--- 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/libexec/tftpd/tftpd.8 b/libexec/tftpd/tftpd.8 index e4f5ab94a2fe..a984cdc32c94 100644 --- a/libexec/tftpd/tftpd.8 +++ b/libexec/tftpd/tftpd.8 @@ -28,7 +28,7 @@ .\" @(#)tftpd.8 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd March 2, 2020 +.Dd July 20, 2023 .Dt TFTPD 8 .Os .Sh NAME @@ -72,7 +72,11 @@ Files containing the string or starting with .Dq Li "../" are not allowed. -Files may be written only if they already exist and are publicly writable. +Files may be written only if they already exist (unless the +.Fl w +option is used) and are publicly writable (unless chrooted and the +.Fl S +option is used). Note that this extends the concept of .Dq public to include @@ -191,6 +195,12 @@ to change its root directory to After doing that but before accepting commands, .Nm will switch credentials to an unprivileged user. +.It Fl S +If +.Nm +runs chrooted, the option allows write requests according to generic +file permissions, skipping requirement for files to be publicly writable. +The option is ignored for non-chrooted run. .It Fl u Ar user Switch credentials to .Ar user @@ -275,12 +285,16 @@ the .Fl c option was introduced in .Fx 4.3 , -and the +the .Fl F and .Fl W options were introduced in -.Fx 7.4 . +.Fx 7.4 , +and the +.Fl S +option was introduced in +.Fx 13.3 . .Pp Support for Timeout Interval and Transfer Size Options (RFC2349) was introduced in diff --git a/libexec/tftpd/tftpd.c b/libexec/tftpd/tftpd.c index b25e8b0c762f..9ae7575f3d23 100644 --- a/libexec/tftpd/tftpd.c +++ b/libexec/tftpd/tftpd.c @@ -100,6 +100,7 @@ static struct dirlist { static int suppress_naks; static int logging; static int ipchroot; +static int check_woth = 1; static int create_new = 0; static const char *newfile_format = "%Y%m%d"; static int increase_name = 0; @@ -141,7 +142,7 @@ main(int argc, char *argv[]) acting_as_client = 0; tftp_openlog("tftpd", LOG_PID | LOG_NDELAY, LOG_FTP); - while ((ch = getopt(argc, argv, "cCd::F:lnoOp:s:u:U:wW")) != -1) { + while ((ch = getopt(argc, argv, "cCd::F:lnoOp:sS:u:U:wW")) != -1) { switch (ch) { case 'c': ipchroot = 1; @@ -181,6 +182,9 @@ main(int argc, char *argv[]) case 's': chroot_dir = optarg; break; + case 'S': + check_woth = -1; + break; case 'u': chuser = optarg; break; @@ -361,7 +365,11 @@ main(int argc, char *argv[]) tftp_log(LOG_ERR, "setuid failed"); exit(1); } + if (check_woth == -1) + check_woth = 0; } + if (check_woth == -1) + check_woth = 1; len = sizeof(me_sock); if (getsockname(0, (struct sockaddr *)&me_sock, &len) == 0) { @@ -704,7 +712,7 @@ validate_access(int peer, char **filep, int mode) if ((stbuf.st_mode & S_IROTH) == 0) return (EACCESS); } else { - if ((stbuf.st_mode & S_IWOTH) == 0) + if (check_woth && ((stbuf.st_mode & S_IWOTH) == 0)) return (EACCESS); } } else { @@ -734,7 +742,7 @@ validate_access(int peer, char **filep, int mode) if ((stbuf.st_mode & S_IROTH) != 0) break; } else { - if ((stbuf.st_mode & S_IWOTH) != 0) + if (!check_woth || ((stbuf.st_mode & S_IWOTH) != 0)) break; } err = EACCESS; From nobody Thu Jul 20 20:28:27 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6PQg5MvLz4pCv9; Thu, 20 Jul 2023 20:28: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 4R6PQg4vn5z3LXM; Thu, 20 Jul 2023 20:28:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689884907; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wPkiumZVMnCLFyhK1k8G1KOI8jy58KfrlFv7YrkKUzk=; b=yE3WC9T+v74PokR+LKw1Hb7xT7ufWB8diJA52u0fJ0KQpRB09EVAMyrq2Bhw77Uu0Ilgg0 l1NSpVJB6tAprFI/841BYJgQ60tIGsaZNeyppxECyg0hS0fx203ZMi7dbfxQtPp0k3AXgO S7Wq9rr6cMdMhM+4F/OAXBH0y5LOZEAM2fQ1Tikluud31dMCBqQFBK24+dW594ulv0WH9+ xDQ5EjiKmxXjr8me1beL2lUcCdZLlM9amQmmdOtdPo/U6BYC0i9VsZWCf6pPwKhep/Hkl0 au5rxU4wSR90eKJePwHuIn80ulCVNBxo6i+5eaAHb9SJvsuEENittL69htMP5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689884907; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wPkiumZVMnCLFyhK1k8G1KOI8jy58KfrlFv7YrkKUzk=; b=VACupiksdTxQrxqYR3Ry9BalCMeVyuMk/3Su8JLOGO2BOy4mP/7S05F9AMuP/3dsm484Mv Ercz6iBATdK0K3P0v8YKCCCgGfQDwTIgoGjwhar0yGp3Yj5mYiTaoKJmTml9jk/XAXRoiz TW5uP+tRqO1STLgqn3GhTLduvRpANtWFCZhZMLXXORr71+i8/YYCVamD7ECEej1yPmcK7K YgjS/PCQiIitWzv2ZpHYJgLTmVZHa8BwR4Piapr8RtvKNjTR0HmVJiPGeEsIzGxzABj1B/ 6LGHQJjAxd+voACR5JLDxoDuTd5Kmj7ehr+UtXxVOVH3Ep/F8y+4gj+Nh7dpQQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689884907; a=rsa-sha256; cv=none; b=cG8mC/hMzr3NBAZOU3heR28dxeizgY7sP43SbRv08/Oh0vpSRfZetY5fWh7AySkNQm/EDD puGOclFdANf++7qQjHPodlVfJFchaVY1JzRnZIe30TB2yTBocv5Xf5+PK0TcfDhSEuI2p5 pPB5CR98ybak0OL0y3roMQU/2Ipdbv3Fh9T6B1iKvadlOYHiOFO6zmnER84vRigkRS81U/ P8XY44A96z8dy3gQAxEZNkcrJ8aDEGpyZROdcOzJgCchzgoVVEZbcRa9kqveAEEeONf7zt Tx6/F6EVo01zbP4L8+ab90EketLvL+/moOgUS4coqkUZuAghGBIdLIRjyDvh7g== 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 4R6PQg3zvWzkrN; Thu, 20 Jul 2023 20:28: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 36KKSRTE003447; Thu, 20 Jul 2023 20:28:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36KKSRww003446; Thu, 20 Jul 2023 20:28:27 GMT (envelope-from git) Date: Thu, 20 Jul 2023 20:28:27 GMT Message-Id: <202307202028.36KKSRww003446@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Eugene Grosbein Subject: git: 03c2616dc530 - main - tftpd: unbreak getopt() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 03c2616dc530e5b23f06f9aa421012154590e578 Auto-Submitted: auto-generated The branch main has been updated by eugen: URL: https://cgit.FreeBSD.org/src/commit/?id=03c2616dc530e5b23f06f9aa421012154590e578 commit 03c2616dc530e5b23f06f9aa421012154590e578 Author: Eugene Grosbein AuthorDate: 2023-07-20 20:26:32 +0000 Commit: Eugene Grosbein CommitDate: 2023-07-20 20:26:32 +0000 tftpd: unbreak getopt() Unbreak getopt() broken by recent commit. Fixes: 273a307d0b80743fb08e23237b3f74dc94a8fa2a MFC after: 1 month --- libexec/tftpd/tftpd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libexec/tftpd/tftpd.c b/libexec/tftpd/tftpd.c index 9ae7575f3d23..1c04cd113932 100644 --- a/libexec/tftpd/tftpd.c +++ b/libexec/tftpd/tftpd.c @@ -142,7 +142,7 @@ main(int argc, char *argv[]) acting_as_client = 0; tftp_openlog("tftpd", LOG_PID | LOG_NDELAY, LOG_FTP); - while ((ch = getopt(argc, argv, "cCd::F:lnoOp:sS:u:U:wW")) != -1) { + while ((ch = getopt(argc, argv, "cCd::F:lnoOp:s:Su:U:wW")) != -1) { switch (ch) { case 'c': ipchroot = 1; From nobody Thu Jul 20 20:49:21 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6Ptx23nvz4dWBp; Thu, 20 Jul 2023 20:49:29 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.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 mx1.freebsd.org (Postfix) with ESMTPS id 4R6Ptw5DcWz3h5H; Thu, 20 Jul 2023 20:49:28 +0000 (UTC) (envelope-from kostikbel@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.17.1/8.17.1) with ESMTPS id 36KKnLiY097890 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 20 Jul 2023 23:49:24 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 36KKnLiY097890 Received: (from kostik@localhost) by tom.home (8.17.1/8.17.1/Submit) id 36KKnL6x097889; Thu, 20 Jul 2023 23:49:21 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 20 Jul 2023 23:49:21 +0300 From: Konstantin Belousov To: Brooks Davis Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 21e45c30c35c - main - mmap(MAP_STACK): on stack grow, use original protection Message-ID: References: <202307201412.36KECDSU084918@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.0 X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-14) on tom.home X-Rspamd-Queue-Id: 4R6Ptw5DcWz3h5H X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated On Thu, Jul 20, 2023 at 08:15:15PM +0000, Brooks Davis wrote: > On Thu, Jul 20, 2023 at 02:12:13PM +0000, Konstantin Belousov wrote: > > The branch main has been updated by kib: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=21e45c30c35c9aa732073f725924caf581c93460 > > > > commit 21e45c30c35c9aa732073f725924caf581c93460 > > Author: Konstantin Belousov > > AuthorDate: 2023-07-19 11:05:32 +0000 > > Commit: Konstantin Belousov > > CommitDate: 2023-07-20 14:11:42 +0000 > > > > mmap(MAP_STACK): on stack grow, use original protection > > > > If mprotect(2) changed protection in the bottom of the currently grown > > stack region, currently the changed protection would be used for the > > stack grow on next fault. This is arguably unexpected. > > > > Store the original protection for the entry at mmap(2) time in the > > offset member of the gap vm_map_entry, and use it for protection of the > > grown stack region. > > It occured to me to wonder how this interacts with > __enable_execute_stack(). I think it's ok so long as the compiler > always emits __enable_execute_stack() for each trampoline and doesn't > depend on extentions to the stack being executable from the first > trampoline creation, but I don't know where to look to verify that's the > case. Even on first trampoline creation, compiler cannot know how much was the stack grown already. So the generated code cannot be sure that it changing the protection for the bottom stack page. Then, it cannot work even for more usual stack grow organization. From nobody Thu Jul 20 21:28:15 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6Qlg3F09z4nYFW; Thu, 20 Jul 2023 21:28: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 4R6Qlg2pXzz3smV; Thu, 20 Jul 2023 21:28:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689888495; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uXvfPsCb072rFw0Rxql81r3oMTE9PX3WpDBEGuqi5Qo=; b=Dm5atOOHdF1OdeEYgqlTYZX8S2CKCGuE8FDClODL2VB7D8qFwSVbS5i19xK6CW9fRkgpXe mWl6g4Sdj26IDDSVSgGWrE1p+BYGWN9KF/CO1i9mWzb6acAYSh0hL3Av1JmIJuPL4aABwc vrS9ffh2L2i84xJp7EpcEHanT9MoCKyCKdcHoHcaPGf5Yn773akviqRJoqhyW3jw/hHWuo A3EixLim9oW9maOfpoHvIOPcoxjDIiXURWFbjeJGyYE6Q1BM5r3FPd6BoU/DnFODxndiI9 aEj8eFy8IrmDLzKyrM24qSauiJnB+6TVoUxwAQ3G3SunSIFq2NUBJEfWgQcGuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689888495; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uXvfPsCb072rFw0Rxql81r3oMTE9PX3WpDBEGuqi5Qo=; b=AhX1VifBZVv9oStftXXA7kXvXkbTi3OWwFy13DDoY9q5Sb+JkSeemCuYfv7aszxCd4MWDJ BYxi957YWIw8FB7gX0FF3i7YRTc7C5AA2En2zKOgM1jFbGRewcGZbHfGGU6oi5z7Go1Q1S bSWwdfhAZZpql1a7+bvueaIrXuC3NaDnV9VladNP8ZOo2xA2Hj/LmrX1TJrEeFFBOHb3rv uoKpcnDfUmg7+GNcPLwl62J0kozSI9TruKPmjdJAl+rKeiAiLCflD0CYYM+dv5WHOYp1so CMEXr+tDmFftxdsK112B2w0uszEEUSiH/fgKve93YYrK6Av9NuovXsE7Dlf6HA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689888495; a=rsa-sha256; cv=none; b=CsFUNxRe3mpwuC/E1N9sv5Yx1Ltqy41CG/2Kc0KcS9aNZhRWfZx0WiUoHczgbYzM/lDjdO oTgw57E8WXZM8fLafoZSVIxKzo351yMWgoZTt+c2cDLWPdQxx+is8hVwNXC/oKHrcokleC yDn1GWpaH7YMHzmrw6BU9MfQ07JNZ2VnVljZCBcTmWjHKSSQ4kPvR2s+7OHPu/MVxgBAjv gBHol6HNbATUwubAfh6Z0SnaacvKd07SaY5HrlHeN9N7zWZtMfEpZRtZqKzcPEytRmPY6v 5tF35UZHK+3/L1S4UhCLUS9VOZL3+1+RD5Qhi+UJX3CEKbiLVrqECJpH7lqKSg== 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 4R6Qlg1thSzmDy; Thu, 20 Jul 2023 21:28: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 36KLSFrW002923; Thu, 20 Jul 2023 21:28:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36KLSFbX002922; Thu, 20 Jul 2023 21:28:15 GMT (envelope-from git) Date: Thu, 20 Jul 2023 21:28:15 GMT Message-Id: <202307202128.36KLSFbX002922@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Morozovsky Subject: git: 3cbc8e752b92 - main - tftpd: fix double-colon typo in option string List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: marck X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3cbc8e752b92442c784306731e94fd904de3373c Auto-Submitted: auto-generated The branch main has been updated by marck: URL: https://cgit.FreeBSD.org/src/commit/?id=3cbc8e752b92442c784306731e94fd904de3373c commit 3cbc8e752b92442c784306731e94fd904de3373c Author: Dmitry Morozovsky AuthorDate: 2023-07-20 21:24:28 +0000 Commit: Dmitry Morozovsky CommitDate: 2023-07-20 21:24:28 +0000 tftpd: fix double-colon typo in option string MFC after: 1 month X-MFC-With: 273a307d0b80743fb08e23237b3f74dc94a8fa2a X-MFC-With: 03c2616dc530e5b23f06f9aa421012154590e578 --- libexec/tftpd/tftpd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libexec/tftpd/tftpd.c b/libexec/tftpd/tftpd.c index 1c04cd113932..27bb7cb4cc67 100644 --- a/libexec/tftpd/tftpd.c +++ b/libexec/tftpd/tftpd.c @@ -142,7 +142,7 @@ main(int argc, char *argv[]) acting_as_client = 0; tftp_openlog("tftpd", LOG_PID | LOG_NDELAY, LOG_FTP); - while ((ch = getopt(argc, argv, "cCd::F:lnoOp:s:Su:U:wW")) != -1) { + while ((ch = getopt(argc, argv, "cCd:F:lnoOp:s:Su:U:wW")) != -1) { switch (ch) { case 'c': ipchroot = 1; From nobody Thu Jul 20 21:34:20 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6Qtk4hMCz4ncxh; Thu, 20 Jul 2023 21:34:22 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.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 "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6Qtk3HpNz3vY9; Thu, 20 Jul 2023 21:34:22 +0000 (UTC) (envelope-from kevans@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689888862; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oCmU1OHmg59tstFQXNvAlL4y0kvVxqE98RtcExdHJz8=; b=R+qh5cfAZUPgfEzFvkElXW+w/2KOAxqgM70Hs+dqVO5W1Gtk0UeGhCWwi435NOnBQK2qSE FPyqTESqXF1eTuvOVL+mbY8JCPR/8bY5QkKSMStdil8S0bcNz40JEBF2hk2slVATO/JQ8w /VTEbCVDruJjmmmASbSgn48w+jHLHtqHJJZm2I5tlw1huz44NgJ0kUzfgiyiQUESygiADD WoZuAMI8/pJ6sA1SiC6FKdBAaaw193TH4/UQxCtm8J2No6Ce1zQcfBWBkg7AVE+wnUl0US OAUkHgRIEYQp5Cii3VlyMiEo1epLC+7P64QVMHPwZoJ0MuWPmYTg2ziuEWRXIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689888862; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oCmU1OHmg59tstFQXNvAlL4y0kvVxqE98RtcExdHJz8=; b=VE8/++fgn60WoDAwdLkWU5AEUmJB+mH1L9AxmY/EdAz1E46Krj1/4IGMTtQSjJVeSwN61e vQZZW4wJJg8KMNhMGWjtd7Li362IFII9UFdAShGW89bYRzmeQ8evSuMJ9d0RuiIJ0CUUsb 9bkXpFuKf7y16I9XdxQXktyZnessuuQv8zuTCHIuZFIEMTMmKZBpwYiH6keKao4X+reGGK HIipPzJ5qOdWlT4tvCEMzTI8DVMmIn0wb+YzK/oFZTFd9kcNFtELqqNQX1b9H54Kag6deg bdYazMjghuwXikBDHA7/LGsJsGBKvEqkRgi0QzLJkBsq3HMORhTeDMeL5FQ4PA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689888862; a=rsa-sha256; cv=none; b=btD06MuQV7KuKD79K4St11ytuuF9IlJgT1lcVXBcU+DIMEIbZXiS9g07G0Uyl/kNYwiPnh X3SgeTtPIroY8jZzC1qzBV6v90NPuFNjLvW9qvqGgJFSI4M/RX+GM2nZCXDajU6sMr/pyh 0OaRGz/CvMAwR2Iq1mSw3qh/HmGobENJw+TmNqec4F4kK8tBuD0Z+MZNZhaDTQ/QsphTTk rQwBeD4e9DCnM9/rzAmQXjHn0pT8h4k6sl61uDOBc/GnbwFBx5YgNRKEzCMsSr4P55SoEq U+aNPwkjnOojK5/8Uz9eebnfd/RWW/06ePXQI8887THo1Z4tJg9CXZGCQ+uKQw== Received: from [10.9.4.95] (unknown [209.182.120.176]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: kevans/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4R6Qtk0ctxzf5M; Thu, 20 Jul 2023 21:34:22 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Message-ID: <9d273ea1-e225-ee4d-73a4-632e0ff1d59d@FreeBSD.org> Date: Thu, 20 Jul 2023 16:34:20 -0500 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: git: 3cbc8e752b92 - main - tftpd: fix double-colon typo in option string Content-Language: en-US To: Dmitry Morozovsky , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202307202128.36KLSFbX002922@gitrepo.freebsd.org> From: Kyle Evans In-Reply-To: <202307202128.36KLSFbX002922@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 7/20/23 16:28, Dmitry Morozovsky wrote: > The branch main has been updated by marck: > > URL: https://cgit.FreeBSD.org/src/commit/?id=3cbc8e752b92442c784306731e94fd904de3373c > > commit 3cbc8e752b92442c784306731e94fd904de3373c > Author: Dmitry Morozovsky > AuthorDate: 2023-07-20 21:24:28 +0000 > Commit: Dmitry Morozovsky > CommitDate: 2023-07-20 21:24:28 +0000 > > tftpd: fix double-colon typo in option string > > MFC after: 1 month > X-MFC-With: 273a307d0b80743fb08e23237b3f74dc94a8fa2a > X-MFC-With: 03c2616dc530e5b23f06f9aa421012154590e578 Er, this wasn't a bug. -d takes an optional argument, which is indicated with a double colon. Thanks, Kyle Evans > --- > libexec/tftpd/tftpd.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/libexec/tftpd/tftpd.c b/libexec/tftpd/tftpd.c > index 1c04cd113932..27bb7cb4cc67 100644 > --- a/libexec/tftpd/tftpd.c > +++ b/libexec/tftpd/tftpd.c > @@ -142,7 +142,7 @@ main(int argc, char *argv[]) > acting_as_client = 0; > > tftp_openlog("tftpd", LOG_PID | LOG_NDELAY, LOG_FTP); > - while ((ch = getopt(argc, argv, "cCd::F:lnoOp:s:Su:U:wW")) != -1) { > + while ((ch = getopt(argc, argv, "cCd:F:lnoOp:s:Su:U:wW")) != -1) { > switch (ch) { > case 'c': > ipchroot = 1; From nobody Thu Jul 20 21:39:01 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6R061wH0z4ngJp; Thu, 20 Jul 2023 21:39:02 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.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 mx1.freebsd.org (Postfix) with ESMTPS id 4R6R061XJkz3wgQ; Thu, 20 Jul 2023 21:39:02 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Authentication-Results: mx1.freebsd.org; none Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id ACC593C0199; Thu, 20 Jul 2023 21:39:01 +0000 (UTC) Date: Thu, 20 Jul 2023 21:39:01 +0000 From: Brooks Davis To: Konstantin Belousov Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 21e45c30c35c - main - mmap(MAP_STACK): on stack grow, use original protection Message-ID: References: <202307201412.36KECDSU084918@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4R6R061XJkz3wgQ X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:36236, ipnet:199.48.128.0/22, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated On Thu, Jul 20, 2023 at 11:49:21PM +0300, Konstantin Belousov wrote: > On Thu, Jul 20, 2023 at 08:15:15PM +0000, Brooks Davis wrote: > > On Thu, Jul 20, 2023 at 02:12:13PM +0000, Konstantin Belousov wrote: > > > The branch main has been updated by kib: > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=21e45c30c35c9aa732073f725924caf581c93460 > > > > > > commit 21e45c30c35c9aa732073f725924caf581c93460 > > > Author: Konstantin Belousov > > > AuthorDate: 2023-07-19 11:05:32 +0000 > > > Commit: Konstantin Belousov > > > CommitDate: 2023-07-20 14:11:42 +0000 > > > > > > mmap(MAP_STACK): on stack grow, use original protection > > > > > > If mprotect(2) changed protection in the bottom of the currently grown > > > stack region, currently the changed protection would be used for the > > > stack grow on next fault. This is arguably unexpected. > > > > > > Store the original protection for the entry at mmap(2) time in the > > > offset member of the gap vm_map_entry, and use it for protection of the > > > grown stack region. > > > > It occured to me to wonder how this interacts with > > __enable_execute_stack(). I think it's ok so long as the compiler > > always emits __enable_execute_stack() for each trampoline and doesn't > > depend on extentions to the stack being executable from the first > > trampoline creation, but I don't know where to look to verify that's the > > case. > Even on first trampoline creation, compiler cannot know how much was the > stack grown already. So the generated code cannot be sure that it changing > the protection for the bottom stack page. Then, it cannot work even for > more usual stack grow organization. That makes sense. Thanks for the clarification. -- Brooks From nobody Thu Jul 20 21:40:08 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6R1N3Sljz4ngmD; Thu, 20 Jul 2023 21:40:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6R1N336Nz3xNt; Thu, 20 Jul 2023 21:40:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689889208; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=evkFVQeJ0BcMfzSoMUAPFFX3kRr/Lx+gu924e28ptSI=; b=HCYyEiwGU2zwMgDZ+zzqndGUROjEWRjyrbpqY62mPiTbop+7UW6eG8hL5HaPnZXhgYZYg4 yMTOpK1y0snl87X/ZEIM1LacnVSPuUueyKJnKeU/nNi1Zwjo4JkdUeyHMMBJlKJZ9YAzHY I17KBoJzrItk3zBUqLLlxQjqjnQ6J7X1AnbOu0bQNNbQulBaawmdblUJftGtA4agJwT0KM pRHsUaii/Qe5G3vN58Slk6o0S4C3vaKI9Mp1sNlEgZAQuJ1HqauL6mPn4F0Yd3rJAVu02w kWqBJKn10ab4AejmeJsdl71lYDt1zGXeFQknQOENt3w3q0seTkAz8G7tmUw9Yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689889208; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=evkFVQeJ0BcMfzSoMUAPFFX3kRr/Lx+gu924e28ptSI=; b=N+K4tmKeIoxRrmI+rBNNR+Hjp1aeu9ntQ4rS6+/C6HeOGYpWcWGN6EJPgOz8JjJwNSc5XP iihbQhTYzcEY2tpTcGCVWZW+89w6lgADHLzp8lgMIC2jzS+PainavYLUSfUHOQEYCdm56u BAIUmVom/7rMUqmBEExfWDxh0Xj7Zx1P8WDvt59MYZ4y85Hk3XENqg1r0hJE36Us5IPOti Z/KAICQvAfUTwOPYO+/wycC9FMe3jHVeemp203RdVIM0/gCLfENUwDVQC1EaLUHzKTtVXG UBltkD8ZJwqJ2qY51AEuoygZ4F26IGHu1Niy7yEQeAHqbRYQ8PFEcgct8Sj+VQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689889208; a=rsa-sha256; cv=none; b=dMvOsk5IG07cYlD1UcP0XFVPMWQIMniCqrzgguCp6GQtdpBpWEqzaXt2oFvyfQKMcoUsar a9KkfWVo3Ve8o9QKpVIxEWj2LiTYH0zeClUilpDf0K2yI1B5nOIejb5Q2Bl0dHmEsUpQFr pRWgo9PT4VwoM8ENT7iB+O40ZYU9kkP6f0iVP6hfQZ4iw/IMCCbzyl5N08pMIdL+caXg9t h7v4PSw3vRtCQwCZQM5T5MT4kW9EaZOYCe+dYPdHam1pzGANA7ZtcJL65nc8MHZystNtEz 6wp1sAkCTO6DyDdpx2RcF/xFlGpQwUT8P6/QS+5j4su5V1kHZcG8eAaHTleI7g== 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 4R6R1N277vzmw9; Thu, 20 Jul 2023 21:40:08 +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 36KLe8uL022894; Thu, 20 Jul 2023 21:40:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36KLe81O022891; Thu, 20 Jul 2023 21:40:08 GMT (envelope-from git) Date: Thu, 20 Jul 2023 21:40:08 GMT Message-Id: <202307202140.36KLe81O022891@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Morozovsky Subject: git: 615d167cb88c - main - Revert "tftpd: fix double-colon typo in option string" List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: marck X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 615d167cb88ca895278a26b22052f663c5228407 Auto-Submitted: auto-generated The branch main has been updated by marck: URL: https://cgit.FreeBSD.org/src/commit/?id=615d167cb88ca895278a26b22052f663c5228407 commit 615d167cb88ca895278a26b22052f663c5228407 Author: Dmitry Morozovsky AuthorDate: 2023-07-20 21:38:30 +0000 Commit: Dmitry Morozovsky CommitDate: 2023-07-20 21:38:30 +0000 Revert "tftpd: fix double-colon typo in option string" It was not a typo: -d takes an optional argument, which is indicated with a double colon. This reverts commit 3cbc8e752b92442c784306731e94fd904de3373c. Spotted by: kevans --- libexec/tftpd/tftpd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libexec/tftpd/tftpd.c b/libexec/tftpd/tftpd.c index 27bb7cb4cc67..1c04cd113932 100644 --- a/libexec/tftpd/tftpd.c +++ b/libexec/tftpd/tftpd.c @@ -142,7 +142,7 @@ main(int argc, char *argv[]) acting_as_client = 0; tftp_openlog("tftpd", LOG_PID | LOG_NDELAY, LOG_FTP); - while ((ch = getopt(argc, argv, "cCd:F:lnoOp:s:Su:U:wW")) != -1) { + while ((ch = getopt(argc, argv, "cCd::F:lnoOp:s:Su:U:wW")) != -1) { switch (ch) { case 'c': ipchroot = 1; From nobody Thu Jul 20 21:40:17 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6R1f1pMXz4ngkK; Thu, 20 Jul 2023 21:40:22 +0000 (UTC) (envelope-from marck@FreeBSD.org) Received: from woozle.rinet.ru (woozle.rinet.ru [195.54.192.68]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6R1d5t54z3xbc; Thu, 20 Jul 2023 21:40:21 +0000 (UTC) (envelope-from marck@FreeBSD.org) Authentication-Results: mx1.freebsd.org; none Received: from localhost (woozle.rinet.ru [195.54.192.68]) by woozle.rinet.ru (8.14.5/8.14.5) with ESMTP id 36KLeHvn005851; Fri, 21 Jul 2023 00:40:19 +0300 (MSK) (envelope-from marck@FreeBSD.org) Date: Fri, 21 Jul 2023 00:40:17 +0300 (MSK) From: Dmitry Morozovsky X-X-Sender: marck@woozle.rinet.ru To: Kyle Evans cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 3cbc8e752b92 - main - tftpd: fix double-colon typo in option string In-Reply-To: <9d273ea1-e225-ee4d-73a4-632e0ff1d59d@FreeBSD.org> Message-ID: References: <202307202128.36KLSFbX002922@gitrepo.freebsd.org> <9d273ea1-e225-ee4d-73a4-632e0ff1d59d@FreeBSD.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-OpenPGP-Key-ID: 6B691B03 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (woozle.rinet.ru [195.54.192.68]); Fri, 21 Jul 2023 00:40:19 +0300 (MSK) X-Rspamd-Queue-Id: 4R6R1d5t54z3xbc X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:8331, ipnet:195.54.192.0/19, country:RU] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated On Thu, 20 Jul 2023, Kyle Evans wrote: > On 7/20/23 16:28, Dmitry Morozovsky wrote: > > The branch main has been updated by marck: > > > > URL: > > https://cgit.FreeBSD.org/src/commit/?id=3cbc8e752b92442c784306731e94fd904de3373c > > > > commit 3cbc8e752b92442c784306731e94fd904de3373c > > Author: Dmitry Morozovsky > > AuthorDate: 2023-07-20 21:24:28 +0000 > > Commit: Dmitry Morozovsky > > CommitDate: 2023-07-20 21:24:28 +0000 > > > > tftpd: fix double-colon typo in option string > > MFC after: 1 month > > X-MFC-With: 273a307d0b80743fb08e23237b3f74dc94a8fa2a > > X-MFC-With: 03c2616dc530e5b23f06f9aa421012154590e578 > > Er, this wasn't a bug. -d takes an optional argument, which is indicated with > a double colon. Ah I see now, overlooked somehow. Will revert, sorry for the noise -- Sincerely, D.Marck [DM5020, MCK-RIPE, DM3-RIPN] --------------------------------------------------------------------------- *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@FreeBSD.org *** --------------------------------------------------------------------------- From nobody Thu Jul 20 21:58:08 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6RQ84Mgcz4nqLM; Thu, 20 Jul 2023 21:58:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6RQ83szbz43H7; Thu, 20 Jul 2023 21:58:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689890288; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Y+I/wMKRknuxZWEWzReSG9BHJjeF4eMM3teT5wHKmP8=; b=osYo8EQ+ALOsTLFqVacbrg2VwQCw/gjhhJOCOpvysitsPLJNdEGaiepMW1cKvaC7mY+cIn eO+keszbskqMuOorKa6io2+ZMZcb83aY3y0+C9IDLbGJxBxeVZoD85MNQbtFg8XLywlF7g DEkP5jYAm4iMKfylFVZElYYtXuO1gfLXNVtGZoZKupALykr6bGMdfCeH4o3efid5Tj0i/+ 3VvR2s5dz7VMDddzSqlzgKzHiN/aoyF3cvTtGqLfdD9ve30rfEA93S6/mxgVNod+YJgTfo ZPPQp2NeNkxl61eSpAK6h/IAeLI7Pefne0to3saWKg3oyHiJLvsM7DvhJXdiQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689890288; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Y+I/wMKRknuxZWEWzReSG9BHJjeF4eMM3teT5wHKmP8=; b=U5bPd/3hak7hwvk3cBQwaUeU40Vc50r3ylgqQlUIoBsiBskDQTjKSwOQs9dLUOFlH2x8rr 5g6Jp3wLHIrlynBrx0WIDm91H2mYCJCndv94TYB3BeqCRR7NyMyh04G+m0zlPEGYTeQSiy EPZaLwmMhnSXMRJsvK5K6uDYHTLOJCEmeuVuxaJ9ymqhhRuHEY7OG3CdFC6L3IVGoTlGke mWvaf4pLHXn1814arCcrKmhI66+Khhs088qUqO2Zrh6QBAnWS6gq/PEeTVwzOs2RgtENSI u/NpNjEqlwbfoManlUcEFkYC1AqE4gcyVJ2ce4l+EFZJTFlMeGg2syzolNbrEQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689890288; a=rsa-sha256; cv=none; b=Nu2ZkyzsYM9lj7oIwdMSTARFRXhXJhkLU/QkG0U0IPwJKEouwRMepC6Imf2ZoWsLYyNSEy ipoJAuNKyoQHbki2pX4XytQnTDEUqYPrGETft41ZAS9ZD0SPWNMM8y3Qjm11AZiQQcqHfv peyIut35dCVfubtS0XCGzsGF6SeuQYr23OHrRMdO/R+c7OGj+jwR+0jAKOEVEkw3DjIljd GA4gg/eYYSap0xd1ius4UXyiXciWTmlqzpgOW3OyVNousKLheoRgosfSu118sAAaMmkkdc tzNgvPfymyek8+DYa9e/7IS9sEQdGs9qFiW6KmVbgyf8lgnPRFqKJ9V6HmeGWA== 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 4R6RQ82s9MznSt; Thu, 20 Jul 2023 21:58:08 +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 36KLw8nm052182; Thu, 20 Jul 2023 21:58:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36KLw8ba052181; Thu, 20 Jul 2023 21:58:08 GMT (envelope-from git) Date: Thu, 20 Jul 2023 21:58:08 GMT Message-Id: <202307202158.36KLw8ba052181@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 90f10db8a996 - main - sshd: remove unneeded initialization of libwrap logging severities List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 90f10db8a99659d1baea7b2609d9256c331f61ae Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=90f10db8a99659d1baea7b2609d9256c331f61ae commit 90f10db8a99659d1baea7b2609d9256c331f61ae Author: Gleb Smirnoff AuthorDate: 2023-07-20 21:56:20 +0000 Commit: Gleb Smirnoff CommitDate: 2023-07-20 21:56:20 +0000 sshd: remove unneeded initialization of libwrap logging severities This part of ca573c9a177 proved to be unnecessary. As the removed comment says, we set them merely for logging syntax errors, as we log refusals ourselves. However, inside the libwrap the parser logs any syntax errors with tcpd_warn() which has hardcoded LOG_WARNING inside. Reviewed by: philip, emaste Differential revision: https://reviews.freebsd.org/D40068 --- crypto/openssh/sshd.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/crypto/openssh/sshd.c b/crypto/openssh/sshd.c index 620a7efe7797..ce8db54a2b72 100644 --- a/crypto/openssh/sshd.c +++ b/crypto/openssh/sshd.c @@ -142,8 +142,6 @@ #ifdef LIBWRAP #include #include -extern int allow_severity; -extern int deny_severity; #endif /* LIBWRAP */ /* Re-exec fds */ @@ -1303,7 +1301,7 @@ server_accept_loop(int *sock_in, int *sock_out, int *newsock, int *config_s) * exactly. sshguard, and supposedly lots * of custom made scripts rely on it. */ - syslog(deny_severity, + syslog(LOG_WARNING, "refused connect from %s (%s)", eval_client(&req), eval_hostaddr(req.client)); @@ -2112,14 +2110,6 @@ main(int ac, char **av) /* Reinitialize the log (because of the fork above). */ log_init(__progname, options.log_level, options.log_facility, log_stderr); -#ifdef LIBWRAP - /* - * We log refusals ourselves. However, libwrap will report - * syntax errors in hosts.allow via syslog(3). - */ - allow_severity = options.log_facility|LOG_INFO; - deny_severity = options.log_facility|LOG_WARNING; -#endif /* Avoid killing the process in high-pressure swapping environments. */ if (!inetd_flag && madvise(NULL, 0, MADV_PROTECT) != 0) debug("madvise(): %.200s", strerror(errno)); From nobody Thu Jul 20 21:58:09 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6RQ95TN8z4nqTh; Thu, 20 Jul 2023 21:58:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6RQ94cTkz43Df; Thu, 20 Jul 2023 21:58:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689890289; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KNhqxRwkt40fsorc81XCK1qjV/RBado7dJpQPdXBERE=; b=wqvrRWpDuxFa7gZzpK1tJw9eooPbWf/a3GUbWEnKTb3rNAC0n2AXzgwK6tPlP53tHHmOTq eMcrQKtMpEruT6dJf8wGA8HBQzYXX0joLgbmYNVXSos4V4K+VyenDA5Kqe6VQtIkr4MtJY /r3/t2dJHwztU1ECfmQqMglx6UaXqeu5eCumit2EGCavV81l0iMrCWWlTfw6HiGjgbgQdw komM0sDRFefzrWSG94Y5or3lRzA3U56h3VD6Unm2g8wi0nVfQywW+SlOsOIuAmk4gDUu28 D70U93Bmcq8TdlDwOq1jzGmw2Zf6/MZpsNdziCF94xB2myCdz8wmJDSW7n3L7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689890289; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KNhqxRwkt40fsorc81XCK1qjV/RBado7dJpQPdXBERE=; b=JjW0tKrZm2mQpUogFASGvtjZPykPhT2qvu7nv7wxM22p8D2i8k6LmTc9J2HpQsi7nnbb0m 93icMgjLKPoGOWTcyl3ZUXuCIH0uvaJlJKgnpwqd0mYe8DSpqUhTHKzZGgrjE6c9xh7cf+ Hyj4BwUPUj7xEUOCmn4AvHwQFZ+i3ZLyAkn8dAvMiiyGq4OhGKG06B5aaGA90Vwj1cb1uH szgGCqXQ09glZkUkZTtyglEOvqQ/PLYPEoHFi++ctjKftFQnAhLpb3XGSZNbd1Hj63bqwI ojH7mwUaaFlrpH+lBwhDvEfLovrUVkTLpw21Wv1XDHgMTWV2Q5qSJIk3kn/G9Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689890289; a=rsa-sha256; cv=none; b=JbLThsPr/OWhH7830x3f0UsbUROWz0fGnHO/L9Cr6gINFn5zICWy4l0p7RmssWE5tIWBCz vA4pHa5fyVXm7WirlbAq/8CalCtJFgX96MBOwpPoeYy+ZicmPOxsOC1HDLyB1bnqCin9xt n4SyTodlP8mIygDCaO4DVvjYbxvbFWPFuQR/73o2dILmTXdyCE6XkaZUEuTZK6MuP+9nPv v+3GpxLTZrsdXx2VTzwidNs/JEQNLZllWWEYHuECkF0byPHkn2l6Tdx8Fx/5GE2AVrVYET IqJjzxYjYmGspl+RDzWCnYQiAncIHUxJ2zSVUUNmiNrT9CF3NYqhe8xRDkHZzA== 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 4R6RQ93XTFzmvt; Thu, 20 Jul 2023 21:58:09 +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 36KLw91D052201; Thu, 20 Jul 2023 21:58:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36KLw9PG052200; Thu, 20 Jul 2023 21:58:09 GMT (envelope-from git) Date: Thu, 20 Jul 2023 21:58:09 GMT Message-Id: <202307202158.36KLw9PG052200@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 9ff45b8ed847 - main - sshd: do not resolve refused client hostname List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9ff45b8ed847f9cb7e1cd401278c7f6b30fe8225 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=9ff45b8ed847f9cb7e1cd401278c7f6b30fe8225 commit 9ff45b8ed847f9cb7e1cd401278c7f6b30fe8225 Author: Gleb Smirnoff AuthorDate: 2023-07-20 21:56:20 +0000 Commit: Gleb Smirnoff CommitDate: 2023-07-20 21:56:20 +0000 sshd: do not resolve refused client hostname This is a compromise between POLA and practical reasoning. We don't want to block the main server loop in an attempt to resolve. But we need to keep the format of the logged message as is, for sake of sshguard and other scripts. So let's print just the IP address twice, this is what libwrap's refuse() would do if it failed to resolve. Reviewed by: philip PR: 269456 Differential revision: https://reviews.freebsd.org/D40069 --- crypto/openssh/sshd.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/crypto/openssh/sshd.c b/crypto/openssh/sshd.c index ce8db54a2b72..a82b82d08c14 100644 --- a/crypto/openssh/sshd.c +++ b/crypto/openssh/sshd.c @@ -1297,13 +1297,24 @@ server_accept_loop(int *sock_in, int *sock_out, int *newsock, int *config_s) SO_LINGER, &l, sizeof(l)); (void )close(*newsock); /* - * Mimic message from libwrap's refuse() - * exactly. sshguard, and supposedly lots - * of custom made scripts rely on it. + * Mimic message from libwrap's refuse() as + * precisely as we can afford. The authentic + * message prints the IP address and the + * hostname it resolves to in parentheses. If + * the IP address cannot be resolved to a + * hostname, the IP address will be repeated + * in parentheses. As name resolution in the + * main server loop could stall, and logging + * resolved names adds little or no value to + * incident investigation, this implementation + * only repeats the IP address in parentheses. + * This should resemble librwap's refuse() + * closely enough not to break auditing + * software like sshguard or custom scripts. */ syslog(LOG_WARNING, "refused connect from %s (%s)", - eval_client(&req), + eval_hostaddr(req.client), eval_hostaddr(req.client)); debug("Connection refused by tcp wrapper"); continue; From nobody Thu Jul 20 21:58:10 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6RQC3QDfz4nqNq; Thu, 20 Jul 2023 21:58:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6RQB5Ynlz43F7; Thu, 20 Jul 2023 21:58:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689890290; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VNlCfSb+A9fksd58p+rPXlwFHgFWWPpYhqOZ0KXEAOY=; b=o+XHWeAPoCkLVTk1Kwbc1jwyw7VUm0+dXnH2OR89D9GU+wNByuQIC3z72ckcgThsdI6K6n Q37T+/KdhAC8JftUww8Oywc+ky2Qgs7OE5MRLs/DEak0xsJlEfNOMV+0dWm8esbp8TFq4u KR9ejDyZbeS3tAMLx6oWp8ZpWp55XPeB5wZ+nH+3ecf9ycBwlNGbvRFGKDtOA2cfMGowZW +RTTu3nWvHzRgML8H/UUhmcr716y7moow8wiBrp+umUVXZzbIbl/GTSxb4QLG5MSyBPsap pPLqCTdJ30f43Rqm1erpJoEzGKckKM4jT/kr/YfOwI4CJHKC1zxN8HhTyTRzvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689890290; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VNlCfSb+A9fksd58p+rPXlwFHgFWWPpYhqOZ0KXEAOY=; b=azTukA3c/SrSJa7eBH1wPEIo8OkTGLTlEjU9rPT9vZ6pM14Pa3W+qLo8KjFmMRbwId0QIK dQg5uwhHaYnH4oj8ca0Ltzpzogs68BgGgBtJpydiDoM2QctWOc37YTEnaJmNUYV9/cZ0A/ 98BPq4mLLjM7O5hJCD9WUkkJRB9z15xpp0XD5LxnUeAcqVcwyV+ZdFOPITwRF8VokqS01U wmXcFsOPvNOiI/+Xql1QH1am3u0NsRTv+NMiUt1/l0qAqm49XzG+1KcyBcx/agutLwsyHi DrRY9Ijj5fJcFJht06z9zBSCFz5oRysrVVSGQVg4Z3rsojzqFLpg8JRs2cFh9Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689890290; a=rsa-sha256; cv=none; b=LwpCe6ySA2Q01hWQ3v9GdB/psK7qgBe28FggwOLoDtQpEg3nFnmKOMZT84WrF2O8aOIvZ9 5j2pziNAindtdS0cRL+7dNaRr2DYxgFPmxzyvfXrkGClipXSs9XhoBsVZgtmTeRfI2O9T0 ovKK8TMEV3m3b85FLxvfbKDw0bLq3OpNCqmDNHs/81z9eBqH/UFQXGEEHJ/sb7eq3sjmjb CylPBDOT61MX7VEio4Qz7KD/sur4a/8J7uax0OG2fu7uHHcSE8+bqqztIc89IRcSXBDhQD JxwvKpxX+6njVo/bfJblv2Jf5CMcgcthanZkwuoXfLGvfraIPgK7WbL2Xj3jbQ== 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 4R6RQB4QnCzmvv; Thu, 20 Jul 2023 21:58: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 36KLwAPY052220; Thu, 20 Jul 2023 21:58:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36KLwA4T052219; Thu, 20 Jul 2023 21:58:10 GMT (envelope-from git) Date: Thu, 20 Jul 2023 21:58:10 GMT Message-Id: <202307202158.36KLwA4T052219@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 1d9722de6f90 - main - tcp_wrappers: recognize IPv6 addresses/prefixes List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1d9722de6f90c3edf286b077938bfa696e728d6c Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=1d9722de6f90c3edf286b077938bfa696e728d6c commit 1d9722de6f90c3edf286b077938bfa696e728d6c Author: Gleb Smirnoff AuthorDate: 2023-07-20 21:56:20 +0000 Commit: Gleb Smirnoff CommitDate: 2023-07-20 21:56:20 +0000 tcp_wrappers: recognize IPv6 addresses/prefixes Intentionally or not, but the libwrap was written in such manner that if your /etc/hosts.allow doesn't have any domain names, neither smart keywords like LOCAL or KNOWN, then it will not try to resolve the client address during the hosts check. This was achieved with the NOT_INADDR() check that matched IPv4 addresses/prefixes. Extend this to also skip resolve if client list token looks like IPv6. Reviewed by: philip, emaste PR: 269456 Differential revision: https://reviews.freebsd.org/D40070 --- contrib/tcp_wrappers/hosts_access.c | 3 ++- contrib/tcp_wrappers/tcpd.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/contrib/tcp_wrappers/hosts_access.c b/contrib/tcp_wrappers/hosts_access.c index 05c62d194091..e55f3f34dd20 100644 --- a/contrib/tcp_wrappers/hosts_access.c +++ b/contrib/tcp_wrappers/hosts_access.c @@ -315,7 +315,8 @@ static int host_match(char *tok, struct host_info *host) return (masked_match(tok, mask, eval_hostaddr(host))); } else { /* anything else */ return (string_match(tok, eval_hostaddr(host)) - || (NOT_INADDR(tok) && string_match(tok, eval_hostname(host)))); + || (NOT_INADDR(tok) && NOT_INADDR6(tok) + && string_match(tok, eval_hostname(host)))); } } diff --git a/contrib/tcp_wrappers/tcpd.h b/contrib/tcp_wrappers/tcpd.h index 1078073c8e3a..194cde378c1c 100644 --- a/contrib/tcp_wrappers/tcpd.h +++ b/contrib/tcp_wrappers/tcpd.h @@ -70,6 +70,7 @@ extern char paranoid[]; #define HOSTNAME_KNOWN(s) (STR_NE((s),unknown) && STR_NE((s),paranoid)) #define NOT_INADDR(s) (s[strspn(s,"01234567890./")] != 0) +#define NOT_INADDR6(s) (strchr(s, ':') == NULL) /* Global functions. */ From nobody Thu Jul 20 22:01:21 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6RTt2dBJz4nrjP; Thu, 20 Jul 2023 22:01:22 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.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 "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6RTt1sLZz44qh; Thu, 20 Jul 2023 22:01:22 +0000 (UTC) (envelope-from kevans@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689890482; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dKuVVU4Qeq29RyntSfR1qnENW4+1cyVcFnLz475rd2U=; b=BzS3qhFwwmXpHpIGSsUx6rfztMVsTkoDzpp2m4oHsdwa5zTuGC/tjQE0aj11IOVUb9DKrD lmnn3USWAiqyXJnaiJxltG06OR5+UPGq6rea0o9IcjLEVZSlVBqrc46CTKblDBWDzGl2Ii SPEdtOVJxoalwjPdyeNrZbEdsqzVoYOVa+idMASC+1B2lxy8gKj06utdZrgiw4tLsSAS9D mQdC3cjdwCu0sdzvxLSISwXTtQs8STNGLs/m8iX6Pkl5BhOgaqg157sYgNQhVQcpdZrCtK +5UGg5ULowBS+Ou3Q8hRHtHrLRkQJaWLn9ZsC550fn1Jm0ld1fSk1McDfWmHNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689890482; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dKuVVU4Qeq29RyntSfR1qnENW4+1cyVcFnLz475rd2U=; b=i69TTxJzlRnVWHPMIgXj0kmE6nRhktcM5SaF/XIsahpp2oSklcS9dFSfad68DtiIbgec01 Jzb09UpQtLlzQD3Ed/juksQVglM22zFCoxm1+GpbsZHyz/g7b2dPjdr6UaA91f4VVTQ7uc uwF7tvS9z2E5XJCEPUUxU7iea3vZvj2NDkHTdYNpsovsTkuP7QvoPRY3zSC4zORVtRVVLv NYzdLKWK8d30ifb22lnSgWsGa+fv4bd6a35fRBjl93ixCJiMzjKjCq5zhvUb9Mn95Mulli XqOmcYQL5yITDmCL4lSDE2Z7zvxrO12CCvJq6u44iaNfLY92Vp810SDoSVIr6w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689890482; a=rsa-sha256; cv=none; b=xwhaTAM/I1lTeXki2CpC/qPEcLBDyWCuYK64TLNX0tAMtZmiexXJACkW+Qaggwr41NDTLt 8mF1JF2GWhmEWLiNtLeZjAdL+dvHpBc1JHMgBQn0dEueRSr8HY4jYaL2MuW2FAxWEXToSM awuN62NayVCJu7tpH3xaagSxJ4YERUxP5uW/Kg6YdMV6QpzzRGaawbciL50d7H4OkTyDAY NjhVnXNG7HffEbtG7yDlusgP+9hH6SMxLLO9xODgkppLEdKNtvtHPCDMOle8+F9OXbatuW 6Dvu4ULzgTcqgE/tpAiZu3B8NAFs8rDCUwylNzvFN93rhSdHGqGxHSKzduueyw== Received: from [10.9.4.95] (unknown [209.182.120.176]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) (Authenticated sender: kevans/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4R6RTs63qFzdcD; Thu, 20 Jul 2023 22:01:21 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Message-ID: <8a6a773d-d07d-2ddf-efae-31298954176a@FreeBSD.org> Date: Thu, 20 Jul 2023 17:01:21 -0500 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: git: 3cbc8e752b92 - main - tftpd: fix double-colon typo in option string Content-Language: en-US To: Dmitry Morozovsky Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202307202128.36KLSFbX002922@gitrepo.freebsd.org> <9d273ea1-e225-ee4d-73a4-632e0ff1d59d@FreeBSD.org> From: Kyle Evans In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 7/20/23 16:40, Dmitry Morozovsky wrote: > On Thu, 20 Jul 2023, Kyle Evans wrote: > >> On 7/20/23 16:28, Dmitry Morozovsky wrote: >>> The branch main has been updated by marck: >>> >>> URL: >>> https://cgit.FreeBSD.org/src/commit/?id=3cbc8e752b92442c784306731e94fd904de3373c >>> >>> commit 3cbc8e752b92442c784306731e94fd904de3373c >>> Author: Dmitry Morozovsky >>> AuthorDate: 2023-07-20 21:24:28 +0000 >>> Commit: Dmitry Morozovsky >>> CommitDate: 2023-07-20 21:24:28 +0000 >>> >>> tftpd: fix double-colon typo in option string >>> MFC after: 1 month >>> X-MFC-With: 273a307d0b80743fb08e23237b3f74dc94a8fa2a >>> X-MFC-With: 03c2616dc530e5b23f06f9aa421012154590e578 >> >> Er, this wasn't a bug. -d takes an optional argument, which is indicated with >> a double colon. > > Ah I see now, overlooked somehow. > > Will revert, sorry for the noise > > Thanks! From nobody Thu Jul 20 22:37:38 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6SHl0F6Pz4dZ1n; Thu, 20 Jul 2023 22:37: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 4R6SHk6mjVz4Fml; Thu, 20 Jul 2023 22:37:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689892659; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Wq4pEaSs314yab6KMoV9rbyX3xcH1nswkBaKozWKGeU=; b=eXOSr0p2X28TzdC2EHe6LAeWmd3omJPravJwgw8EvPGusnMRjeJw5U+W6EZqzagQpGOQ72 cNNnxnMRT3T8wFJnHKePfrVXYI1mT9sJOHXbxsNU5psogfBX4zPRxiAPMPRP+l39pQQdlG DqtWj3wSzBjumvO2R2dfo873zRVcNnTxQGOEv16Tw9u3uS2t70nwCLyDRQ4GCw40CSdt5p OHx4eVJEa+oqvHpzHkbukrhbfp10CIiHgK2gUu6UanYCzCfQosdVXjL51T0pt52NSf4t/P bHm1yxzgMEPI1IsJsjX81b5HNUYx57bhntPB+aDkAzholhS3AkHrgU4pajM75g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689892658; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Wq4pEaSs314yab6KMoV9rbyX3xcH1nswkBaKozWKGeU=; b=J6tc/fWSPnWpx7PURbwM+LpHjwbXBwBVQ2r9rtRjHggLvTs1yyg7MS0/qIpl4pae2IsbWu DRupVaUO6y9wMSMDfN4cE/QUtYot0ySc4/OXPY44XD5RL9lcoPJ87I27B5SEXmUpBZNrLH bcZybTzGzjxGaGpIA6BvOPxMG6jgboIJAzFooRDkNi7DqMeRPeae8zk17KlYuWzgmeFgpl B7rVv3Z2Q+LadcYAVXzdVfzOe1XnRO/BM2pLeJc9wAHGDNPf87G5qd3yPPOPDlrny4hPgB Pdm/UtlRe4thJqWe3FHz6jRTW6pqmDjtFyPsYPG7MNfZ1cwPQddjqirmbTlB8A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689892658; a=rsa-sha256; cv=none; b=NHP+6b6WHHqBPPLrs7aXB1BDBpYXptTuiU13sqhqLt3t/BiyElZ9xcNj+6nBM6gNPxBtL3 bKXCV3rr+oNik4+fVAGrwitmNtPqBeWEEoOlXCU8N4xTzgczkJCBG7NLWpO4zZpqyEUdh5 cCZKshFtQEPSC6Kf680hVD/Rh4Hl4YTSbzvGt5m3EmrRnIDeue/xnWOvTUEXxXNqsvd8cs X2AjHHFZvznkzJ8vrBUMfmFkQMJYJK/RlM+Q5TOLZQRUJVFiQxsyEdlHrl90sDtN6vw6Ya c5XRF0P3Pn3r62skaXosUgX8NBQUJOHMYR/x5D8NC2K3onZ2ogdXXl9BoZyArg== 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 4R6SHk5m0szpBL; Thu, 20 Jul 2023 22:37: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 36KMbcNg018310; Thu, 20 Jul 2023 22:37:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36KMbcVY018309; Thu, 20 Jul 2023 22:37:38 GMT (envelope-from git) Date: Thu, 20 Jul 2023 22:37:38 GMT Message-Id: <202307202237.36KMbcVY018309@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Eric Joyner Subject: git: ba2f531f816a - main - ixl(4): Add link state polling List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: erj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ba2f531f816a6bc1ef5f2cba4a329ff7bdbec0f3 Auto-Submitted: auto-generated The branch main has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=ba2f531f816a6bc1ef5f2cba4a329ff7bdbec0f3 commit ba2f531f816a6bc1ef5f2cba4a329ff7bdbec0f3 Author: Krzysztof Galazka AuthorDate: 2023-07-20 22:33:52 +0000 Commit: Eric Joyner CommitDate: 2023-07-20 22:33:52 +0000 ixl(4): Add link state polling In some cases driver may ask FW about link state before FW finishes configuration of a (Q)SFP+ transceiver. If first attempt of using Get Link Status AQC after loading driver or handling a reset fails, then re-try periodically for 5 seconds. Signed-off-by: Krzysztof Galazka Signed-off-by: Eric Joyner Tested by: jeffrey.e.pieper@intel.com Approved by: erj@ MFC after: 2 days Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D40899 --- sys/dev/ixl/i40e_adminq_cmd.h | 2 +- sys/dev/ixl/if_ixl.c | 50 ++++++++++++++++++++++++++++++++++++------- sys/dev/ixl/ixl.h | 2 ++ sys/dev/ixl/ixl_debug.h | 2 ++ sys/dev/ixl/ixl_pf.h | 4 ++++ sys/dev/ixl/ixl_pf_iflib.c | 4 +--- sys/dev/ixl/ixl_pf_main.c | 30 ++++++++++++++++++++------ 7 files changed, 75 insertions(+), 19 deletions(-) diff --git a/sys/dev/ixl/i40e_adminq_cmd.h b/sys/dev/ixl/i40e_adminq_cmd.h index 564a076761d0..679e191412cd 100644 --- a/sys/dev/ixl/i40e_adminq_cmd.h +++ b/sys/dev/ixl/i40e_adminq_cmd.h @@ -44,7 +44,7 @@ #define I40E_FW_API_VERSION_MAJOR 0x0001 #define I40E_FW_API_VERSION_MINOR_X722 0x000C -#define I40E_FW_API_VERSION_MINOR_X710 0x000E +#define I40E_FW_API_VERSION_MINOR_X710 0x000F #define I40E_FW_MINOR_VERSION(_h) ((_h)->mac.type == I40E_MAC_XL710 ? \ I40E_FW_API_VERSION_MINOR_X710 : \ diff --git a/sys/dev/ixl/if_ixl.c b/sys/dev/ixl/if_ixl.c index 7ebbed1f81c8..6e1a3e3e2229 100644 --- a/sys/dev/ixl/if_ixl.c +++ b/sys/dev/ixl/if_ixl.c @@ -444,6 +444,29 @@ ixl_admin_timer(void *arg) { struct ixl_pf *pf = (struct ixl_pf *)arg; + if (ixl_test_state(&pf->state, IXL_STATE_LINK_POLLING)) { + struct i40e_hw *hw = &pf->hw; + sbintime_t stime; + enum i40e_status_code status; + + hw->phy.get_link_info = TRUE; + status = i40e_get_link_status(hw, &pf->link_up); + if (status == I40E_SUCCESS) { + ixl_clear_state(&pf->state, IXL_STATE_LINK_POLLING); + /* OS link info is updated in the admin task */ + } else { + device_printf(pf->dev, + "%s: i40e_get_link_status status %s, aq error %s\n", + __func__, i40e_stat_str(hw, status), + i40e_aq_str(hw, hw->aq.asq_last_status)); + stime = getsbinuptime(); + if (stime - pf->link_poll_start > IXL_PF_MAX_LINK_POLL) { + device_printf(pf->dev, "Polling link status failed\n"); + ixl_clear_state(&pf->state, IXL_STATE_LINK_POLLING); + } + } + } + /* Fire off the admin task */ iflib_admin_intr_deferred(pf->vsi.ctx); @@ -706,12 +729,6 @@ ixl_if_attach_post(if_ctx_t ctx) return (0); } - /* Determine link state */ - if (ixl_attach_get_link_status(pf)) { - error = EINVAL; - goto err; - } - error = ixl_switch_config(pf); if (error) { device_printf(dev, "Initial ixl_switch_config() failed: %d\n", @@ -740,6 +757,11 @@ ixl_if_attach_post(if_ctx_t ctx) device_printf(dev, "Allocating %d queues for PF LAN VSI; %d queues active\n", pf->qtag.num_allocated, pf->qtag.num_active); + /* Determine link state */ + error = ixl_attach_get_link_status(pf); + if (error == EINVAL) + goto err; + /* Limit PHY interrupts to link, autoneg, and modules failure */ status = i40e_aq_set_phy_int_mask(hw, IXL_DEFAULT_PHY_INT_MASK, NULL); @@ -775,8 +797,20 @@ ixl_if_attach_post(if_ctx_t ctx) ixl_set_link(pf, ixl_test_state(&pf->state, IXL_STATE_LINK_ACTIVE_ON_DOWN)); hw->phy.get_link_info = true; - i40e_get_link_status(hw, &pf->link_up); - ixl_update_link_status(pf); + status = i40e_get_link_status(hw, &pf->link_up); + if (status != I40E_SUCCESS) { + device_printf(dev, + "%s get link status, status: %s aq_err=%s\n", + __func__, i40e_stat_str(hw, status), + i40e_aq_str(hw, hw->aq.asq_last_status)); + /* + * Most probably FW has not finished configuring PHY. + * Retry periodically in a timer callback. + */ + ixl_set_state(&pf->state, IXL_STATE_LINK_POLLING); + pf->link_poll_start = getsbinuptime(); + } else + ixl_update_link_status(pf); #ifdef PCI_IOV ixl_initialize_sriov(pf); diff --git a/sys/dev/ixl/ixl.h b/sys/dev/ixl/ixl.h index 30e8ce40126b..03a1fa46fa65 100644 --- a/sys/dev/ixl/ixl.h +++ b/sys/dev/ixl/ixl.h @@ -286,6 +286,8 @@ /* For stats sysctl naming */ #define IXL_QUEUE_NAME_LEN 32 +#define IXL_PF_MAX_LINK_POLL SBT_1S * 5 + MALLOC_DECLARE(M_IXL); #define IXL_DEV_ERR(_dev, _format, ...) \ diff --git a/sys/dev/ixl/ixl_debug.h b/sys/dev/ixl/ixl_debug.h index 0d8c624d2df9..818ba8a1df83 100644 --- a/sys/dev/ixl/ixl_debug.h +++ b/sys/dev/ixl/ixl_debug.h @@ -101,6 +101,8 @@ enum ixl_dbg_mask { IXL_DBG_SWITCH_INFO = 0x00010000, IXL_DBG_I2C = 0x00020000, + IXL_DBG_LINK = 0x00100000, + IXL_DBG_ALL = 0xFFFFFFFF }; diff --git a/sys/dev/ixl/ixl_pf.h b/sys/dev/ixl/ixl_pf.h index 80b35fcb6696..9a786845be13 100644 --- a/sys/dev/ixl/ixl_pf.h +++ b/sys/dev/ixl/ixl_pf.h @@ -89,6 +89,7 @@ enum ixl_state { IXL_STATE_FW_LLDP_DISABLED = 9, IXL_STATE_EEE_ENABLED = 10, IXL_STATE_LINK_ACTIVE_ON_DOWN = 11, + IXL_STATE_LINK_POLLING = 12, }; #define IXL_PF_IN_RECOVERY_MODE(pf) \ @@ -172,6 +173,8 @@ struct ixl_pf { int num_vfs; uint16_t veb_seid; int vc_debug_lvl; + + sbintime_t link_poll_start; }; /* @@ -282,6 +285,7 @@ struct ixl_pf { #define ixl_dbg_info(pf, s, ...) ixl_debug_core((pf)->dev, (pf)->dbg_mask, IXL_DBG_INFO, s, ##__VA_ARGS__) #define ixl_dbg_filter(pf, s, ...) ixl_debug_core((pf)->dev, (pf)->dbg_mask, IXL_DBG_FILTER, s, ##__VA_ARGS__) #define ixl_dbg_iov(pf, s, ...) ixl_debug_core((pf)->dev, (pf)->dbg_mask, IXL_DBG_IOV, s, ##__VA_ARGS__) +#define ixl_dbg_link(pf, s, ...) ixl_debug_core((pf)->dev, (pf)->dbg_mask, IXL_DBG_LINK, s, ##__VA_ARGS__) /* PF-only function declarations */ void ixl_set_state(volatile u32 *s, enum ixl_state bit); diff --git a/sys/dev/ixl/ixl_pf_iflib.c b/sys/dev/ixl/ixl_pf_iflib.c index e0452c7dc01e..a0b450dc038b 100644 --- a/sys/dev/ixl/ixl_pf_iflib.c +++ b/sys/dev/ixl/ixl_pf_iflib.c @@ -1028,9 +1028,7 @@ ixl_rebuild_hw_structs_after_reset(struct ixl_pf *pf, bool is_up) i40e_aq_set_vsi_broadcast(&pf->hw, vsi->seid, TRUE, NULL); /* Determine link state */ - if (ixl_attach_get_link_status(pf)) { - error = EINVAL; - } + ixl_attach_get_link_status(pf); i40e_aq_set_dcb_parameters(hw, TRUE, NULL); diff --git a/sys/dev/ixl/ixl_pf_main.c b/sys/dev/ixl/ixl_pf_main.c index 1ba59c0592a7..13ba4c5f5d17 100644 --- a/sys/dev/ixl/ixl_pf_main.c +++ b/sys/dev/ixl/ixl_pf_main.c @@ -4705,22 +4705,38 @@ ixl_attach_get_link_status(struct ixl_pf *pf) { struct i40e_hw *hw = &pf->hw; device_t dev = pf->dev; - int error = 0; + enum i40e_status_code status; if (((hw->aq.fw_maj_ver == 4) && (hw->aq.fw_min_ver < 33)) || (hw->aq.fw_maj_ver < 4)) { i40e_msec_delay(75); - error = i40e_aq_set_link_restart_an(hw, TRUE, NULL); - if (error) { - device_printf(dev, "link restart failed, aq_err=%d\n", - pf->hw.aq.asq_last_status); - return error; + status = i40e_aq_set_link_restart_an(hw, TRUE, NULL); + if (status != I40E_SUCCESS) { + device_printf(dev, + "%s link restart failed status: %s, aq_err=%s\n", + __func__, i40e_stat_str(hw, status), + i40e_aq_str(hw, hw->aq.asq_last_status)); + return (EINVAL); } } /* Determine link state */ hw->phy.get_link_info = TRUE; - i40e_get_link_status(hw, &pf->link_up); + status = i40e_get_link_status(hw, &pf->link_up); + if (status != I40E_SUCCESS) { + device_printf(dev, + "%s get link status, status: %s aq_err=%s\n", + __func__, i40e_stat_str(hw, status), + i40e_aq_str(hw, hw->aq.asq_last_status)); + /* + * Most probably FW has not finished configuring PHY. + * Retry periodically in a timer callback. + */ + ixl_set_state(&pf->state, IXL_STATE_LINK_POLLING); + pf->link_poll_start = getsbinuptime(); + return (EAGAIN); + } + ixl_dbg_link(pf, "%s link_up: %d\n", __func__, pf->link_up); /* Flow Control mode not set by user, read current FW settings */ if (pf->fc == -1) From nobody Thu Jul 20 23:19:53 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6TDV1dv0z4nkNX; Thu, 20 Jul 2023 23:19: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 4R6TDV1BLlz3FL4; Thu, 20 Jul 2023 23:19:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689895194; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0d9YbcgUbv4ARI2yKHuSfjMdGqDOcicYFNCnH7uacLk=; b=ftL5CApu9K0l9w43xY2IHNJQtX3X1aNSCjq7Ijq9HdPc02qjGl8TftGeQaB3M+5yPAIWEg F6GlJob43rsr3FKTotVjBmdHyWQEYat1SVZhAtTVrxeZC6pCZ5NF6Nt2ICv+RbV24L0MJO tM7VpEMoPNdko8PTC8XE4xrew9nU7x8Pvp2UGyRGrW1KEIGSnpyvz0ioQhW0fCVd+bPo6k Yc5OkEXbhJujt399eQ3ERCfiPO6Mbj3enKlOEiuiJIXsaCBXuidGWMPUeOQ3quW0uJEQ15 njz4E03o7mhZYS4qT+WHDetqdy6lLY6mJBIpQ59dbLq5ccVnRSFC8o7f/Kec8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689895194; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0d9YbcgUbv4ARI2yKHuSfjMdGqDOcicYFNCnH7uacLk=; b=ZebBr/LzAv+MSj+b5LrTlU6XVpF4ric02ocymVaLFNYCyW6kVg5e2Iahq/SPmWN3HzNeTM t4Y3CYn3Zz059AmiwHh48zY1g2A6tYSK0+cPtaGJJxAJzzHtomdTogM8Ss4XtXlt4kXYX2 QeRjGBjSVbei7LgV7Kg/Ur7ivrL1jxW9/YfMX5XyiPV8zrqV25tipLpfy3x+FxTEfDHZKn ociHXOkE7D8le90lQeBzydTc5SHYD58P1nyh59Xw7N3nxAdadDMrk+4fx1Qa/1OJoKdCSR csMmcbEA/VCyhliVER1ibBp6Qhhs8sx+G4GoGMAXhqVR25U84S+gYeKYH5P7vw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689895194; a=rsa-sha256; cv=none; b=DljvRvH12v8CuXGXy4KwcXJuAge4a7Meg/lnCgnv+WzuySzseeHrfzI1JmjLVc0cKWk0b0 xJX02C5Y6wRjQ44l4jJmr0DfPecLxb5YmHTFkTAODc1e/CabVS3yTQn8xzozuaye5UoNmB vsjIUwChY2diw1iBca9lOyqDr291o6QAoiHTS/kDVKrAJMT60sgAzIXdcwmogHLoT2PgLu DGlU2OciMLFGeIUrp9btM0APOC6NGzXnyz39ANPaMRgVaGKrHnAL6MpqXc8/3Ugxq7Uu+M ropdnboXMgeQQp2dZcimCYqL/1KvVDSJAVx7wfWs5Py7PFKNE2BrqXPYCysZ/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 4R6TDV0BNTzq4F; Thu, 20 Jul 2023 23:19: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 36KNJrSW085668; Thu, 20 Jul 2023 23:19:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36KNJriX085667; Thu, 20 Jul 2023 23:19:53 GMT (envelope-from git) Date: Thu, 20 Jul 2023 23:19:53 GMT Message-Id: <202307202319.36KNJriX085667@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 59dc489a7e03 - main - mpr: Fix minor 'typos' comment List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 59dc489a7e034674c3f52c56c95851bf31dc790b Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=59dc489a7e034674c3f52c56c95851bf31dc790b commit 59dc489a7e034674c3f52c56c95851bf31dc790b Author: Warner Losh AuthorDate: 2023-07-20 23:16:04 +0000 Commit: Warner Losh CommitDate: 2023-07-20 23:18:28 +0000 mpr: Fix minor 'typos' comment moving -> removing (we're removing the device) CAM_REQ_CMO_ERROR -> CAM_REQ_ERR (the former isn't a thing) Sponsored by: Netflix --- sys/dev/mpr/mpr_sas.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/mpr/mpr_sas.c b/sys/dev/mpr/mpr_sas.c index dd630d212b7f..06dbed57dbac 100644 --- a/sys/dev/mpr/mpr_sas.c +++ b/sys/dev/mpr/mpr_sas.c @@ -2767,13 +2767,13 @@ mprsas_scsiio_complete(struct mpr_softc *sc, struct mpr_command *cm) * count by returning CAM_REQUEUE_REQ. Unfortunately, if * we hit a persistent drive problem that returns one of * these error codes, we would retry indefinitely. So, - * return CAM_REQ_CMP_ERROR so that we decrement the retry + * return CAM_REQ_CMP_ERR so that we decrement the retry * count and avoid infinite retries. We're taking the * potential risk of flagging false failures in the event * of a topology-related error (e.g. a SAS expander problem * causes a command addressed to a drive to fail), but * avoiding getting into an infinite retry loop. However, - * if we get them while were moving a device, we should + * if we get them while were removing a device, we should * fail the request as 'not there' because the device * is effectively gone. */ From nobody Thu Jul 20 23:37:54 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6TdH0qsdz4nwcX; Thu, 20 Jul 2023 23:37: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 4R6TdH0PMcz3Ky3; Thu, 20 Jul 2023 23:37:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689896275; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PcpzZ30aTfZ/sI6yrCcrprm4fohInWRHCwNJym9I2bY=; b=BnN/3YZSy4+mqOnhGM0zOMOEe+0uF1M/TYVVlsG8q6wiCxMTg41AoK5l7R8y6bRFcdA0YD pxMvkivaFpb+taWErFqi8/PD95aYQZWxV5VxN4lHHWMXkVeP9VJW4hNIJY5VT46cCl3IcT gPqDoQWbGlPQ7cRpVvUsPkAzrhMelm+i3rGYsiG524FOJRE7e2Ob6cFiBq2OWEQ4+inyjM XNIvowUbbRAEUOId7kla5pJ0KRm9HgJo3jZQG4bHvMMhgH74T6029hxgQrakBAM3FJ+cwn xBX46POWve5ccjtvTzG8QuSfOdkfuxE9nKvbFf/Nj5jPZsF5hQ6rUHKn7Fv5NQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689896275; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PcpzZ30aTfZ/sI6yrCcrprm4fohInWRHCwNJym9I2bY=; b=TnE/Qh4sUc5CxLNh50zAzRgMQxpRdtKhKsCUhUmOWGcePxoXwHFdGIv/F4kND6X2WMP7FX r3+l8eipdgUp9cq8TGx1uDmWmSWzDGnFmYyqsws7W5FyI3VpN0nAyI/bszoMPWVoVHrPEq u737sXgRY8kHPTr1DUDJowvbQr73duV0Ml4JhHK9qE45IC+Ii00mA/A4AMF3Lh9jVkXdtv 9ll+CWTXqEfTHQsquew32+86LKtdlI0R3ppI/KoXDdmyoUpEKxxsZEJPVnq6rJOp2M9qCW NdtJmMiygY8YCXkUIfGfDgGkMYphz/ytfw1VJ8eozYQ3RE80XPXvAKyFFpP8Yw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689896275; a=rsa-sha256; cv=none; b=RI2665/n2fpWYM9aSFaVomerH/9xiNCh3LPZVFMAB8K0q+TxTNdEWljPbmt7Se1vQrB3ua JkntN6Z2NJBf+NdcjYrhP8heRsZES4KBH+r/Uv/jdJzahaZG+9gT7qyzPg/Li5VqjcwCLz WUovB0Y79Qs/PBWdNF48nhEeomT+EM3xvSeMoP909WzbaSD4ZrikdQCOs/prsvdP1KFKGB IWc2lc7UpdbOT+JhEkS50Zc1irRLWJrQeGebaPWSG4J26wIAr2WM7T+JkB2bkUsigdZ4ep ceLJ9Ne8CTYYEbAgqCvvMm+QS3LK1grMeTNqMs0gbyTeWzgyJQozhNTpDg7zLw== 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 4R6TdG69HMzqdZ; Thu, 20 Jul 2023 23:37: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 36KNbsvb017456; Thu, 20 Jul 2023 23:37:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36KNbspb017454; Thu, 20 Jul 2023 23:37:54 GMT (envelope-from git) Date: Thu, 20 Jul 2023 23:37:54 GMT Message-Id: <202307202337.36KNbspb017454@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 92053e4f8ae5 - main - share/mk: Pass -znoexecstack to ld.bfd when linking libraries and programs. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 92053e4f8ae5f6659db7a8fae016f46bb5447bf8 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=92053e4f8ae5f6659db7a8fae016f46bb5447bf8 commit 92053e4f8ae5f6659db7a8fae016f46bb5447bf8 Author: John Baldwin AuthorDate: 2023-07-20 23:36:35 +0000 Commit: John Baldwin CommitDate: 2023-07-20 23:37:46 +0000 share/mk: Pass -znoexecstack to ld.bfd when linking libraries and programs. lld assumes -znoexecstack by default whereas ld.bfd still defaults to -zexecstack in the absence of .note.GNU-stack annotations. Adding the flags centrally avoids having to patch various libraries in the tree as one-offs (e.g. OpenSSL 3 is the current thing generating new warnings with ld.bfd). Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D41120 --- share/mk/bsd.lib.mk | 2 ++ share/mk/bsd.prog.mk | 2 ++ 2 files changed, 4 insertions(+) diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk index dfaf554a3619..a58114af43c4 100644 --- a/share/mk/bsd.lib.mk +++ b/share/mk/bsd.lib.mk @@ -95,6 +95,8 @@ LDFLAGS+= -Wl,-zretpolineplt .warning Retpoline requested but not supported by compiler or linker .endif .endif +# LLD sensibly defaults to -znoexecstack, so do the same for BFD +LDFLAGS.bfd+= -Wl,-znoexecstack # Initialize stack variables on function entry .if ${MK_INIT_ALL_ZERO} == "yes" diff --git a/share/mk/bsd.prog.mk b/share/mk/bsd.prog.mk index 6f1079944914..f61331aeaa90 100644 --- a/share/mk/bsd.prog.mk +++ b/share/mk/bsd.prog.mk @@ -68,6 +68,8 @@ LDFLAGS+= -Wl,-zretpolineplt .warning Retpoline requested but not supported by compiler or linker .endif .endif +# LLD sensibly defaults to -znoexecstack, so do the same for BFD +LDFLAGS.bfd+= -Wl,-znoexecstack # Initialize stack variables on function entry .if ${MK_INIT_ALL_ZERO} == "yes" From nobody Thu Jul 20 23:38:05 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6Tdk68xlz4nwjq for ; Thu, 20 Jul 2023 23:38:18 +0000 (UTC) (envelope-from erj@erj.cc) Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6Tdk4YQzz3LRZ for ; Thu, 20 Jul 2023 23:38:18 +0000 (UTC) (envelope-from erj@erj.cc) Authentication-Results: mx1.freebsd.org; none Received: by mail-ed1-x530.google.com with SMTP id 4fb4d7f45d1cf-51ff0e3d8c1so1792197a12.0 for ; Thu, 20 Jul 2023 16:38:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=erj.cc; s=google; t=1689896296; x=1690501096; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=SI5Gwl0uVqt2IrClHTT/jG2mSMkpMwMaFmoHerpwO8M=; b=bjQIfcupUdJ3Yn7V2ZMetRe+MllgcKQwJrCoFQXwyh//mm7O4aERnCPeU0ke+CfT5o mmUeX8fVxG8bY3qrlCjjQBklCws3/Z6aYu9Grv3bQP7s4AwUCkmm05P24mfBUHJ7YrKg vbZk19ZO+c69sHh5tl0TbbP86ktpQ3b6S6Ce/f0PzCoQlp2hABYBgCVce8YSjws/NmUk pSJwvbwIjlqEREuJU+bB71STnYiVVC8heyk/qa1WV93mSS9R0AKigbxHI/wynBZX0qVW 65MbTrs9aDwpbNj+rDgLmfecjkWzL3N+n2reaR/zvwZf12hjgFZaueAZy0EUgpyU93zc rXZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689896296; x=1690501096; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=SI5Gwl0uVqt2IrClHTT/jG2mSMkpMwMaFmoHerpwO8M=; b=k48kLyDBl3HG0uxeBeB4GEy7H5gJxc1ZaoJWBClTySyvPig58AqktD3aQoLWTWjWMv fQ99u2J2qdED6hFaurgSmqATD1tMPHrRwN7dJ/iYwc8WENY9dSwPLnkFRmxOtEL8hBY3 SdCzJLSEXJWwqERuXHBjpbqEkeA+X2tDRkXFaB9oDAStArrf58LOmD/M/DGnGfxRgJHK 7n/mdHQZVWr2UsnTTb0BXXQYcMPerC/BZ0rseoQc/iz1pDFxhOF8bANqs/mNTy4vx67D Wo72tEe1G1kazZze4AKX0woqrc6XdCICd6QjLDOetTeV2csEkNb2qsiOg3kNVRBQNhE6 YQAw== X-Gm-Message-State: ABy/qLZMc16ev43O/AZpHs/YvykqJSgfNGTn6mMY4gDZIXjjVnv9H8as i5biC0TEw4QX/kOzFlyzbHGaiJmUPkQN1v2mTaFbaw== X-Google-Smtp-Source: APBJJlHznXG/nslUoNDTR60fMJD09npyRMVAsHJHfgaIFENJjrr43831HdoJHgHL6mTNF64uJTHcjsnQKuHlV3L8jh8= X-Received: by 2002:aa7:cd69:0:b0:51e:126a:403a with SMTP id ca9-20020aa7cd69000000b0051e126a403amr223316edb.13.1689896296090; Thu, 20 Jul 2023 16:38:16 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <202307201739.36KHddue021046@gitrepo.freebsd.org> In-Reply-To: <202307201739.36KHddue021046@gitrepo.freebsd.org> From: Eric Joyner Date: Thu, 20 Jul 2023 16:38:05 -0700 Message-ID: Subject: Re: git: e0a63d875eeb - main - pciconf: add PCIe 5.0 and PCIe 6.0 link speeds To: Ed Maste Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="0000000000006fa3600600f3a421" X-Rspamd-Queue-Id: 4R6Tdk4YQzz3LRZ X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated --0000000000006fa3600600f3a421 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sweet! I can't wait to see these speeds reported on devices. :p - Eric On Thu, Jul 20, 2023 at 10:39=E2=80=AFAM Ed Maste wrot= e: > The branch main has been updated by emaste: > > URL: > https://cgit.FreeBSD.org/src/commit/?id=3De0a63d875eeb630092034808b0795a9= 35d5c0934 > > commit e0a63d875eeb630092034808b0795a935d5c0934 > Author: Ed Maste > AuthorDate: 2023-06-21 20:23:18 +0000 > Commit: Ed Maste > CommitDate: 2023-07-20 17:39:17 +0000 > > pciconf: add PCIe 5.0 and PCIe 6.0 link speeds > > Reviewed by: jhb > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D40710 > --- > usr.sbin/pciconf/cap.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/usr.sbin/pciconf/cap.c b/usr.sbin/pciconf/cap.c > index 3d28fe9bc331..9cae4bc49e03 100644 > --- a/usr.sbin/pciconf/cap.c > +++ b/usr.sbin/pciconf/cap.c > @@ -396,6 +396,10 @@ link_speed_string(uint8_t speed) > return ("8.0"); > case 4: > return ("16.0"); > + case 5: > + return ("32.0"); > + case 6: > + return ("64.0"); > default: > return ("undef"); > } > --0000000000006fa3600600f3a421 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Sweet! I can't wait to see these spee= ds reported on devices. :p

- Eric

On Thu, Jul 20, 2= 023 at 10:39=E2=80=AFAM Ed Maste <= emaste@freebsd.org> wrote:
The branch main has been updated by emaste:

URL: https://cgit.= FreeBSD.org/src/commit/?id=3De0a63d875eeb630092034808b0795a935d5c0934
commit e0a63d875eeb630092034808b0795a935d5c0934
Author:=C2=A0 =C2=A0 =C2=A0Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2023-06-21 20:23:18 +0000
Commit:=C2=A0 =C2=A0 =C2=A0Ed Maste <emaste@FreeBSD.org>
CommitDate: 2023-07-20 17:39:17 +0000

=C2=A0 =C2=A0 pciconf: add PCIe 5.0 and PCIe 6.0 link speeds

=C2=A0 =C2=A0 Reviewed by:=C2=A0 =C2=A0 jhb
=C2=A0 =C2=A0 Sponsored by:=C2=A0 =C2=A0The FreeBSD Foundation
=C2=A0 =C2=A0 Differential Revision:=C2=A0 https://reviews.freebsd= .org/D40710
---
=C2=A0usr.sbin/pciconf/cap.c | 4 ++++
=C2=A01 file changed, 4 insertions(+)

diff --git a/usr.sbin/pciconf/cap.c b/usr.sbin/pciconf/cap.c
index 3d28fe9bc331..9cae4bc49e03 100644
--- a/usr.sbin/pciconf/cap.c
+++ b/usr.sbin/pciconf/cap.c
@@ -396,6 +396,10 @@ link_speed_string(uint8_t speed)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return ("8.0&q= uot;);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 case 4:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return ("16.0&= quot;);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0case 5:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return ("32.0&= quot;);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0case 6:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return ("64.0&= quot;);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 default:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return ("undef= ");
=C2=A0 =C2=A0 =C2=A0 =C2=A0 }
--0000000000006fa3600600f3a421-- From nobody Fri Jul 21 03:44:40 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6b603LKfz4dVkS; Fri, 21 Jul 2023 03:44: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 4R6b602pGxz3Jjf; Fri, 21 Jul 2023 03:44:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689911080; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=51EnNNOkUi4h0MTVVygw4S4m0muT8RKFgQ7+f3LfjVM=; b=PhmHAmayIo9AR2DKWeU+rQ3HsnlLtfQ7LKHO1RKFm6F/Qt8CTHpegHt9Nirw0fFtPjXUT8 buUbfPPupQRizoGyrK59OY9mJYXSoStzL8UCS8gchgVtO9toMEh7PNp7EY0o/Kf9DsEokl dN4Q5BElLxrRImdBzYfIthHeUWMIdhi69+zutwV7guXRa5RmxKOxLdOT2rtWJzvBojimC2 bBWcpeOgsGQOfQLxNk+nf7F3WEZh4d7rEfbVlCFxYX96MkNZ+fbEGybX/BN78lR20HgqxQ S2KyE7YmBtvkAydOIuEcIu0MgpMjcAJfZDqWpZ3lGN6/xv/2xWY5omH4BKaFnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689911080; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=51EnNNOkUi4h0MTVVygw4S4m0muT8RKFgQ7+f3LfjVM=; b=J2zBBD3vlA9H+YBE8/xlSQnsCpsyHf+w3U1E7I2BQyJmaAIhyMDzz0Js9Ncxc7uqdGxwVM yNUZPa7IofWIo2Uz894rgvNLeoxB7OWEXEp4+RkyrIzCY74QKky6xDR8aFxicM1JZja1zg 38XlnvqQQuVkNVtxd8hOWs+bCB7J1CNBXll0n/dF/FsC4++HCsrPgoNUYc6pEEYy9fxo1i 3nU8w2ZypBq7FP3iAexUk52UkobJ/gW4RBop7tnjQvIiHir07QNhuUkCS+OAPMxHPZjKQZ j4p8/qkY64SzgCR/02WzAt9I+iAIBo9XH2vTh02JXik/tdYJ2cAEjfXDs8DdLA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689911080; a=rsa-sha256; cv=none; b=Kc1b5/mCGYHFKoSvd9uZBeZrC6C8SO0c4s9LxYT/YqUzcaA/mMkA2z6gXCGuD6egA+Y9E2 Og6KV0bbrO5Kw05iTBqdtf5+mHTzIhIcGtBJRxPWST4CP8ArYNs2y/A9Ui/QTmPE8NX8IG bZ0gstFO0vAmo1fVaVH34Mvt8ljHyIhHt781wvQHuZBym+hz1j49dc2SBsxDw3Lfl2tcqA lDWiMXJw8sUO9uKwofRF1TMGlg73mYGEhmnlMxFFfPyt+f/beYziVxV22sdsrFhgCxamOH srgFhS0hvifnFjqyeSYCYEL+sJbComff4CQywzIYoDy1OlhPe/dQ3rUT1ufAJQ== 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 4R6b601tkxzxVm; Fri, 21 Jul 2023 03:44: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 36L3ieXm031611; Fri, 21 Jul 2023 03:44:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36L3ieEP031610; Fri, 21 Jul 2023 03:44:40 GMT (envelope-from git) Date: Fri, 21 Jul 2023 03:44:40 GMT Message-Id: <202307210344.36L3ieEP031610@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 201c4b7c29da - main - e1000: Some fixes for em(4) TSO setup List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 201c4b7c29da44500ccb9e47b854dc1207df8b0a Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=201c4b7c29da44500ccb9e47b854dc1207df8b0a commit 201c4b7c29da44500ccb9e47b854dc1207df8b0a Author: Kevin Bowling AuthorDate: 2023-07-21 01:51:02 +0000 Commit: Kevin Bowling CommitDate: 2023-07-21 01:52:53 +0000 e1000: Some fixes for em(4) TSO setup Always set TXD_CMD_IP for 82544 Otherwise set TXD_CMD_IP for IPv4, not IPv6 Reviewed by: markj (previous version) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D30072 --- sys/dev/e1000/em_txrx.c | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/sys/dev/e1000/em_txrx.c b/sys/dev/e1000/em_txrx.c index 255aea6347d2..47f9b187aa14 100644 --- a/sys/dev/e1000/em_txrx.c +++ b/sys/dev/e1000/em_txrx.c @@ -141,8 +141,10 @@ em_tso_setup(struct e1000_softc *sc, if_pkt_info_t pi, uint32_t *txd_upper, if_softc_ctx_t scctx = sc->shared; struct em_tx_queue *que = &sc->tx_queues[pi->ipi_qsidx]; struct tx_ring *txr = &que->txr; + struct e1000_hw *hw = &sc->hw; struct e1000_context_desc *TXD; int cur, hdr_len; + uint32_t cmd_type_len; hdr_len = pi->ipi_ehdrlen + pi->ipi_ip_hlen + pi->ipi_tcp_hlen; *txd_lower = (E1000_TXD_CMD_DEXT | /* Extended descr type */ @@ -183,12 +185,23 @@ em_tso_setup(struct e1000_softc *sc, if_pkt_info_t pi, uint32_t *txd_upper, TXD->tcp_seg_setup.fields.mss = htole16(pi->ipi_tso_segsz); TXD->tcp_seg_setup.fields.hdr_len = hdr_len; - TXD->cmd_and_length = htole32(sc->txd_cmd | - E1000_TXD_CMD_DEXT | /* Extended descr */ - E1000_TXD_CMD_TSE | /* TSE context */ - E1000_TXD_CMD_IP | /* Do IP csum */ - E1000_TXD_CMD_TCP | /* Do TCP checksum */ - (pi->ipi_len - hdr_len)); /* Total len */ + /* + * 8254x SDM4.0 page 45, and PCIe GbE SDM2.5 page 63 + * - Set up basic TUCMDs + * - Enable IP bit on 82544 + * - For others IP bit on indicates IPv4, while off indicates IPv6 + */ + cmd_type_len = sc->txd_cmd | + E1000_TXD_CMD_DEXT | /* Extended descr */ + E1000_TXD_CMD_TSE | /* TSE context */ + E1000_TXD_CMD_TCP; /* Do TCP checksum */ + if (hw->mac.type == e1000_82544) + cmd_type_len |= E1000_TXD_CMD_IP; + else if (pi->ipi_etype == ETHERTYPE_IP) + cmd_type_len |= E1000_TXD_CMD_IP; + TXD->cmd_and_length = htole32(cmd_type_len | + (pi->ipi_len - hdr_len)); /* Total len */ + txr->tx_tso = true; if (++cur == scctx->isc_ntxd[0]) { From nobody Fri Jul 21 03:44:41 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6b614l4Tz4dVRD; Fri, 21 Jul 2023 03:44: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 4R6b613pFXz3JmB; Fri, 21 Jul 2023 03:44:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689911081; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+xqHPlOee36iJAzJKS7fVXfw81YbNlGXjeM9wLfkF4E=; b=QzPWTemytShlZVfd7aE+sVSpl5S/FScv14RgmUvXJWEdNpEOYaLyAOopsXw6XK47teHFsE Nbpjs3dZSnUFe7XM9Xil0GNOUB2kv4/syJiYxIJqIjIqeE4QxvFWnQfHTy3nrm5XKUXGjN kQs7Jf2qlV2B13g3cH8NrWDQJkYl58WKXMAYeZbuQIJVIexRqzJw5v4A0zGQHas45nzmKa 6xjLEEE+EozeTL2kLTHSz55Znqp3PjyM0KYPjTjX7G2p7yRZdDoK0cd7PVp3q60ZX5hInS trZIT3Z1H+snO4Nac41D3Q6D1cUHXARIvGpesOV/jiyiLoKpPZYBixKIVBX7Vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689911081; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+xqHPlOee36iJAzJKS7fVXfw81YbNlGXjeM9wLfkF4E=; b=NX1ziHdZSMdsx2P7D546mC1Ef28gLdHAk8FFc+EXx34yl3vtGjPg88BFpwOXSZPRVvu+Gs dQEvClGp59W+JOvYL65M0UqkmAyUJbHhbcOHwGXhTIpAnnzo/srZGE2Bm62SkF1Lmjpi69 WJxkBwuajLbpvTmVKbWHFAAoJACzi8wePtiTiTFc55l+widK9v5uRZ+3gTTJmJcsRK6Bam 3bnZvhiSSgwR7vYQwRIgAdGPEp4RixRVrCy57WT68imkfqEBX0IUgq/erDRpBGE1WErBhp Z1lDRjsqSiqPw7UvafNuY89mRnIyvxDETuUcyiJGWGDat0rbixLFXhFSpOhe3g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689911081; a=rsa-sha256; cv=none; b=mKwWMYueN60cd2LFgVvhqB4UDAUuaQ/BUNjGYbgaXmN0SDyZ2jrJz4i0WAe80K4vREvxp6 HN3qpM8YsGQ/6eg6MKJvMwfNDfxvP2EuhCydLlwjB4oUE8u6ldRnb+9n1FiLtEjHlPclFO GKcoeoLuzmxKX423E6GK0WpOnp8CFrqhU1yIqGkW0r3lcJ5cK1Vyr4eTZcmbwHTqtNxiLp eZwHpGP2zXmkyrwTCuAELodh2VRl8q8G/ucQLbg4Oaw0fnbFmPyLYIGJBBUMKbVOxq9IR0 ZVUB/E/U+eRISL0C33Xu/0JuVZjZ3aYTE0W6Ii4yVnzu3SXZypxbQSzYqRgReg== 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 4R6b612lrwzxKD; Fri, 21 Jul 2023 03:44: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 36L3iff2031630; Fri, 21 Jul 2023 03:44:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36L3ifcX031629; Fri, 21 Jul 2023 03:44:41 GMT (envelope-from git) Date: Fri, 21 Jul 2023 03:44:41 GMT Message-Id: <202307210344.36L3ifcX031629@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 95f7b36e8fac - main - e1000: lem(4)/em(4) ifcaps, TSO and hwcsum fixes List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 95f7b36e8fac45092b9a4eea5e32732e979989f0 Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=95f7b36e8fac45092b9a4eea5e32732e979989f0 commit 95f7b36e8fac45092b9a4eea5e32732e979989f0 Author: Kevin Bowling AuthorDate: 2023-07-21 03:30:00 +0000 Commit: Kevin Bowling CommitDate: 2023-07-21 03:44:04 +0000 e1000: lem(4)/em(4) ifcaps, TSO and hwcsum fixes * em(4) obey administrative ifcaps for using hwcsum offload * em(4) obey administrative ifcaps for hw vlan receive tagging * em(4) add additional TSO6 ifcap, but disabled by default as is TSO4 * lem(4) obey administrative ifcaps for using hwcsum offload * lem(4) add support for hw vlan receive tagging * lem(4) Add ifcaps for TSO offload experimentation, but disabled by default due to errata and possibly missing txrx code. * lem(4) disable HWCSUM ifcaps by default on 82547 due to errata around full duplex links. It may still be administratively enabled. Reviewed by: markj (previous version) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D30072 --- sys/dev/e1000/em_txrx.c | 15 ++++++++------- sys/dev/e1000/if_em.c | 48 ++++++++++++++++++++++++++++++++---------------- 2 files changed, 40 insertions(+), 23 deletions(-) diff --git a/sys/dev/e1000/em_txrx.c b/sys/dev/e1000/em_txrx.c index 47f9b187aa14..069a1c00a4b2 100644 --- a/sys/dev/e1000/em_txrx.c +++ b/sys/dev/e1000/em_txrx.c @@ -674,12 +674,12 @@ lem_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri) i++; } while (!eop); - /* XXX add a faster way to look this up */ - if (sc->hw.mac.type >= e1000_82543) + if (scctx->isc_capenable & IFCAP_RXCSUM) em_receive_checksum(status, errors, ri); - if (status & E1000_RXD_STAT_VP) { - ri->iri_vtag = le16toh(rxd->special); + if (scctx->isc_capenable & IFCAP_VLAN_HWTAGGING && + status & E1000_RXD_STAT_VP) { + ri->iri_vtag = le16toh(rxd->special & E1000_RXD_SPC_VLAN_MASK); ri->iri_flags |= M_VLANTAG; } @@ -699,11 +699,11 @@ em_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri) uint16_t len; uint32_t pkt_info; - uint32_t staterr = 0; + uint32_t staterr; bool eop; int i, cidx; - i = 0; + staterr = i = 0; cidx = ri->iri_cidx; do { @@ -739,7 +739,8 @@ em_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri) if (scctx->isc_capenable & IFCAP_RXCSUM) em_receive_checksum(staterr, staterr >> 24, ri); - if (staterr & E1000_RXD_STAT_VP) { + if (scctx->isc_capenable & IFCAP_VLAN_HWTAGGING && + staterr & E1000_RXD_STAT_VP) { ri->iri_vtag = le16toh(rxd->wb.upper.vlan); ri->iri_flags |= M_VLANTAG; } diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index 0b664b155872..b5a6e7e777d3 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -781,19 +781,21 @@ em_set_num_queues(if_ctx_t ctx) return (maxqueues); } -#define LEM_CAPS \ - IFCAP_HWCSUM | IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING | \ - IFCAP_VLAN_HWCSUM | IFCAP_WOL | IFCAP_VLAN_HWFILTER - -#define EM_CAPS \ - IFCAP_HWCSUM | IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING | \ - IFCAP_VLAN_HWCSUM | IFCAP_WOL | IFCAP_VLAN_HWFILTER | IFCAP_TSO4 | \ - IFCAP_LRO | IFCAP_VLAN_HWTSO - -#define IGB_CAPS \ - IFCAP_HWCSUM | IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING | \ - IFCAP_VLAN_HWCSUM | IFCAP_WOL | IFCAP_VLAN_HWFILTER | IFCAP_TSO4 | \ - IFCAP_LRO | IFCAP_VLAN_HWTSO | IFCAP_JUMBO_MTU | IFCAP_HWCSUM_IPV6 |\ +#define LEM_CAPS \ + IFCAP_HWCSUM | IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING | \ + IFCAP_VLAN_HWCSUM | IFCAP_WOL | IFCAP_VLAN_HWFILTER | IFCAP_TSO4 | \ + IFCAP_LRO | IFCAP_JUMBO_MTU + +#define EM_CAPS \ + IFCAP_HWCSUM | IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING | \ + IFCAP_VLAN_HWCSUM | IFCAP_WOL | IFCAP_VLAN_HWFILTER | IFCAP_TSO4 | \ + IFCAP_LRO | IFCAP_VLAN_HWTSO | IFCAP_JUMBO_MTU | IFCAP_HWCSUM_IPV6 | \ + IFCAP_TSO6 + +#define IGB_CAPS \ + IFCAP_HWCSUM | IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING | \ + IFCAP_VLAN_HWCSUM | IFCAP_WOL | IFCAP_VLAN_HWFILTER | IFCAP_TSO4 | \ + IFCAP_LRO | IFCAP_VLAN_HWTSO | IFCAP_JUMBO_MTU | IFCAP_HWCSUM_IPV6 | \ IFCAP_TSO6 /********************************************************************* @@ -897,7 +899,7 @@ em_if_attach_pre(if_ctx_t ctx) scctx->isc_tx_tso_segsize_max = EM_TSO_SEG_SIZE; scctx->isc_capabilities = scctx->isc_capenable = EM_CAPS; /* - * For EM-class devices, don't enable IFCAP_{TSO4,VLAN_HWTSO} + * For EM-class devices, don't enable IFCAP_{TSO4,VLAN_HWTSO,TSO6} * by default as we don't have workarounds for all associated * silicon errata. E. g., with several MACs such as 82573E, * TSO only works at Gigabit speed and otherwise can cause the @@ -912,8 +914,9 @@ em_if_attach_pre(if_ctx_t ctx) * work for a few MACs of this class - at least when sticking * with Gigabit - in which case users may enable TSO manually. */ - scctx->isc_capenable &= ~(IFCAP_TSO4 | IFCAP_VLAN_HWTSO); - scctx->isc_tx_csum_flags = CSUM_TCP | CSUM_UDP | CSUM_IP_TSO; + scctx->isc_capenable &= ~(IFCAP_TSO4 | IFCAP_VLAN_HWTSO | IFCAP_TSO6); + scctx->isc_tx_csum_flags = CSUM_TCP | CSUM_UDP | CSUM_IP_TSO | + CSUM_IP6_TCP | CSUM_IP6_UDP; /* * We support MSI-X with 82574 only, but indicate to iflib(4) * that it shall give MSI at least a try with other devices. @@ -932,6 +935,19 @@ em_if_attach_pre(if_ctx_t ctx) scctx->isc_tx_csum_flags = CSUM_TCP | CSUM_UDP; scctx->isc_txrx = &lem_txrx; scctx->isc_capabilities = LEM_CAPS; + + /* + * For LEM-class devices, don't enable IFCAP {TSO4,VLAN_HWTSO} + * by default as we don't have workarounds for all associated + * silicon errata. TSO4 may work on > 82544 but its status + * is unknown by the authors. Please report any success or failures. + */ + scctx->isc_capenable &= ~(IFCAP_TSO4 | IFCAP_VLAN_HWTSO); + + /* 8254x SDM4.0 page 33 - FDX requirement on these chips */ + if (hw->mac.type == e1000_82547 || hw->mac.type == e1000_82547_rev_2) + scctx->isc_capenable &= ~(IFCAP_HWCSUM|IFCAP_VLAN_HWCSUM); + if (hw->mac.type < e1000_82543) scctx->isc_capabilities &= ~(IFCAP_HWCSUM|IFCAP_VLAN_HWCSUM); /* 82541ER doesn't do HW tagging */ From nobody Fri Jul 21 04:27:32 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6c3T14Mvz4nsnh; Fri, 21 Jul 2023 04:27: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 4R6c3T0fNrz3mkX; Fri, 21 Jul 2023 04:27:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689913653; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=D27hDhk/REjIfxRCzyAEW2v0ucU5Xt/68er8SV3gaUU=; b=Uc79A5xdELEJsHPAxKWeFVcfikEgZQPRRV78x8tCoQcfQygQvRNsV7L6+trWqVyMAxmMM1 wIWkpoPgIyExJlmHJrgERdLHXnAm+z6gQPtO6qvRmcoSZR02CmGuc0O8iDlNxskK/Wmu05 A/G86qKcugZZphJI+DkhvHOHZ1LrBWFbui+I2Mg40Mk4cYqUZi2hzGK2/k+efbqoFzX9cz 6VGiQ2mnUzCl07HxXOx7+cugspbO18Me1VJByBRQ12ON9vegmwXJMFLOeDaUYgNF93WZkF G8EqFouXItir207hFDc0bz3U3XM3RvdSgZ3wAQCpr7amKmwvhwdEhLmy19YYgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689913653; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=D27hDhk/REjIfxRCzyAEW2v0ucU5Xt/68er8SV3gaUU=; b=szVZbmBxJQRuQKPsCSlR4tV/jLw61jrFPTUQtWXGDlHkqR2wIZQCEEM91LMp7j4sEs44of bg9roSwKWChy5EKn1jwZNuse5OwGTfOpCjAMYi3fA2ujDIG68qs8/cx9Pcopbd6pmt+vAh 5JxuhF5tq9S0J5FAMjdtwCJ8pVAMGUeACjy3Yag2Ca645EOq0rz1VtBI6INXAXP93TkgqQ 63wK38rqfIF+vPQyuoT6TuBm4EpAGJr0skdMMqGzh3tDbHimKszVQ2kMo7Kohye9HF62DD 18u4ws9SPpZxa8Jy3w9Gr57uJDZV1I+s/WoCIv1d9XGJGoqPvYsihpe6XxUV3w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689913653; a=rsa-sha256; cv=none; b=OSvfYrZDwgYCQ/x+7e6RKNnjPaMpopaL+YChvnDcGxV2M7Rz0D+tUeyIIghvbddclCspnV NLh0XbfxGzKTrP8X0z2lo3pXcehTczH68LqyAjfLOtyr0JBJ+lRiCHiSCN9+g1rCjFQ1+B XU22nUjjU3ayK3BHslBMFsY+Qg1l+IYnBEVAXwrVI/c8znN2nThaiO0fPcHTtzEg68qh2V A9JNm+OuVdqX0lGEb7wbw9kEjt1UjMXfrC41iWx69liaXB9delwBhR6I5fK0piD+C4dfbp 1DKqHiNUpQUyRfAHcK1EHDH6shzAcDOkBjqxIHWgeoQCkx42fxxb7klQwHgqYw== 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 4R6c3S6q3HzyY6; Fri, 21 Jul 2023 04:27: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 36L4RWRj098782; Fri, 21 Jul 2023 04:27:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36L4RW6T098781; Fri, 21 Jul 2023 04:27:32 GMT (envelope-from git) Date: Fri, 21 Jul 2023 04:27:32 GMT Message-Id: <202307210427.36L4RW6T098781@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: b74486181832 - main - libc: locale: flesh out an incomplete comment List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b74486181832b664c749bf542c93e6e55bc2ac20 Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=b74486181832b664c749bf542c93e6e55bc2ac20 commit b74486181832b664c749bf542c93e6e55bc2ac20 Author: Kyle Evans AuthorDate: 2023-07-21 04:27:24 +0000 Commit: Kyle Evans CommitDate: 2023-07-21 04:27:24 +0000 libc: locale: flesh out an incomplete comment Extrapolate from the context what the intention for the rest of the comment probably was -- that the C/POSIX (and now C.UTF-8) locales may avoid an allocation and reuse a global table. Reviewed by: bapt Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D41087 --- lib/libc/locale/xlocale_private.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/libc/locale/xlocale_private.h b/lib/libc/locale/xlocale_private.h index 1d7b1a44d36f..149e019d6098 100644 --- a/lib/libc/locale/xlocale_private.h +++ b/lib/libc/locale/xlocale_private.h @@ -163,7 +163,10 @@ xlocale_release(void *val) /** * Load functions. Each takes the name of a locale and a pointer to the data - * to be initialised as arguments. Two special values are allowed for the + * to be initialised as arguments. Three special values are allowed for the + * name of the locale: C, POSIX, and C.UTF-8. When these are used, we may + * use some statically defined tables rather than allocating memory for the + * locales' use. */ extern void* __collate_load(const char*, locale_t); extern void* __ctype_load(const char*, locale_t); From nobody Fri Jul 21 04:32:29 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6c9B07VMz4nwTL; Fri, 21 Jul 2023 04:32: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 4R6c996pTxz3pPV; Fri, 21 Jul 2023 04:32:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689913950; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=49WMqTYT0EfvJavYXDkbz+p0KsqOvdqQmtfDPs3Pw/U=; b=Yb4Rxgx8V4v3DRHtlh2B+oMCIsf/mekd906KcxmIOto81WsbgK8fwvcsM78vEkSe4khNlT MBDr3Y0lqNFx0VKxKKgrLVkdjz0PKrzvuS0dHoedQ9nX46OSgxl0MFxKXCS6SNUBrHCwoG /r65Qx7rqvOUjNJjXGVYBhXGAFAUY5HHe04d1VpDMU165n3JQJv9X/t1Azf0f8001CNK/E qnneiWKrkxxqw60jxYfRHKPXCor/xcxKPs9BkV1RBuOJhTlHgDSrsyf1dtRauIaeu7lgLy ybDdThYMcQdDODS/GvzpLwye9VqTkLFybl9k54Fs2k5In2opVyY64DAwsOLQ5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689913950; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=49WMqTYT0EfvJavYXDkbz+p0KsqOvdqQmtfDPs3Pw/U=; b=aOY2ZKHH+qV1lOO3t4K1DJUPbuHcTPSMTkfJsSL/KejLhbh3e1kSoegHzY+XFXbWxCGjzt YuwZWiXXzekucAXBdKt4JBVCTRliTh0VbQmN28dV4mZPf38hSaxorjgETJnf+Heq6z+Vuc wUaBjSt6XuCLtGKGvayabZNXOqses+CUxoMYcvGrpzAD8qNdCuh5NhbcTKSRcWJlhgiJwQ /xVsAuZsiBgLv0VvINUXov+bR0jDkCZA+hxsWM9c8KNaecfII6VToqVYOTA0UpdeMK8CbV jtYnAlrfgg0S5ZpTFH9MGK2a1BsB50ajkjqeQZUPf7b8jjYNU3lnNGRh6DPKFQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689913950; a=rsa-sha256; cv=none; b=LvUKUdMysHeOdWFlEzCA1RxBr3L/zhSivZE6i/sbzyNN5tW8HreBCa/KUlyLVR+fGPIF5V 5/j4mkLXK50H4oLfQImiJCxZ1HhnmlwjAr3B7GGUkTczMl78B53shzVo+yg2btGrK7FCuW g2xa7i8iZjqGdFobvfUe1z79JcHSuKqoyAPGaRDpLGbGnDFt9B/tnYT4BKkmKA8dx8VpFf KjFgvcE7MaQJNBu4Df38RdVZ8/9fNEcJ820CYEpNjiF/vuMTy74/3yMqTPddSE5l1D4ouO x3vj2CjsTJDVgnGbu/rV4rPDhe4VKUiBm0/A8BoTPR65IXaPd5cLYsU8TpHuNw== 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 4R6c995sFvzyvj; Fri, 21 Jul 2023 04:32: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 36L4WT5v014716; Fri, 21 Jul 2023 04:32:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36L4WTQc014715; Fri, 21 Jul 2023 04:32:29 GMT (envelope-from git) Date: Fri, 21 Jul 2023 04:32:29 GMT Message-Id: <202307210432.36L4WTQc014715@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 38e831a8956e - main - cam: Add comment about recovery ccbs List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 38e831a8956e10809003e632a37f958e32578c9f Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=38e831a8956e10809003e632a37f958e32578c9f commit 38e831a8956e10809003e632a37f958e32578c9f Author: Warner Losh AuthorDate: 2023-07-21 04:21:57 +0000 Commit: Warner Losh CommitDate: 2023-07-21 04:32:30 +0000 cam: Add comment about recovery ccbs SS_START and higher actions (currently only SS_TUR) allocate a recovery CCB to send a command to the periph. Add a quick comment about that here. Sponsored by: Netflix Reviewed by: mav Differential Revision: https://reviews.freebsd.org/D41081 --- sys/cam/scsi/scsi_all.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/cam/scsi/scsi_all.h b/sys/cam/scsi/scsi_all.h index 4087c7b01778..37a58fda433e 100644 --- a/sys/cam/scsi/scsi_all.h +++ b/sys/cam/scsi/scsi_all.h @@ -72,6 +72,8 @@ typedef enum { SS_NOP = 0x000000, /* Do nothing */ SS_RETRY = 0x010000, /* Retry the command */ SS_FAIL = 0x020000, /* Bail out */ + + /* Actions larger than SS_START allocate a recovery CCB */ SS_START = 0x030000, /* Send a Start Unit command to the device, * then retry the original command. */ From nobody Fri Jul 21 04:32:30 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6c9C16P1z4nwcK; Fri, 21 Jul 2023 04:32: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 4R6c9C0YVDz3pCL; Fri, 21 Jul 2023 04:32:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689913951; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1wHJK3Yq/HXZvTPMQlULZalMzqyO2sK/9O/CWGtyNWo=; b=HdUAFffxAM727m0VynPe6mZfusaQZBxWCfaDsTgnbhri02O50bsc79Ywg9qQU9e+ouuyis co4rtaHIYGEvmk2QF2iBBiYq+8ebaXpOucrdkAzolyJr34pzkK/2YnvzlJDBPcnXksVFaz 70/1k979NobEOaH4VsZJWkDICSD4Kmh5zffsQuGrR2c6FO3yeivZPH+QQYfaseEeal047J KmFDPo8LPxlmNzPj3OGA+JedugZHCYIxlYZraEq1V57IytqaMeL01/NiKlD6KuXzU2fGQV +yXMVheZ5IpG/wNdHJ7qMRvy25jtPPdh6zV2ZGaTvO+MrUvNk/N6u3cqaVnH1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689913951; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1wHJK3Yq/HXZvTPMQlULZalMzqyO2sK/9O/CWGtyNWo=; b=EnWs+lw85+YrCkY4Xf05LWGnb2DUjrY6z4DmiqXpo/4HpvpIKvviSXSuqwqnSq0ocO3lAY wlm0mJxuFPmy70clZwHR+abkfXzWSVUHXxRm9fA4ack0H5vFOZUsWc2aVTufp25utNV6wZ XrQsArB4soxbXf4MkLuddRpWGx/R5Y1oIgeqHoC5/JN7C8fDVxXaFbYQmALazD4ni9942h zm88fRdrmtqCEX/oa7lFWYNNWXJ4mPPJL4RT/+28FKeAlpvOJop+nCyQG04IBbir9mUxuX xREm4kJvQkQLadExo6h/FTykcPPzUM2IGh2l6HU8/BTlotWls/rYfMw2L4mZAA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689913951; a=rsa-sha256; cv=none; b=GoJ0D1m/eTKGqtigypZMApKNTBQftafWUNS0HuB0CP54p8VjEyekV+Int1+C1j8ScEwrFh xw+T7TqvkbvnIgboIDthQlL4aGGf9KPJLpc6XIWxRfxFSTTwkFw7bdnlh5saaV+491wq14 dBgFr7xfjK66a424KMpIQkaHXgpTxpQcvfwQD+ibgcMWVuIaWGGiLlmXPbmF1ATjgWfenT XBclTJ4gLeigxKZ9+BAoa58teqrE6+KxINA9eCNRy67n2NNNBILM18TmnprE2nXjQJ/v/d vb5zEJo1DJ/7YiQqL4w9WZvLd0t+0JK1glXo0NiA2ebiJ3wEpt/T/UgLxyy3Fw== 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 4R6c9B6mJxzyvk; Fri, 21 Jul 2023 04:32: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 36L4WUCK014739; Fri, 21 Jul 2023 04:32:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36L4WUN4014738; Fri, 21 Jul 2023 04:32:30 GMT (envelope-from git) Date: Fri, 21 Jul 2023 04:32:30 GMT Message-Id: <202307210432.36L4WUN4014738@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 367699ca7ac7 - main - cam/scsi: Better action for ASC/ASCQ 0x18/0x08 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 367699ca7ac706cf8e454c77abd57a1a54e7a877 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=367699ca7ac706cf8e454c77abd57a1a54e7a877 commit 367699ca7ac706cf8e454c77abd57a1a54e7a877 Author: Warner Losh AuthorDate: 2023-07-21 04:22:07 +0000 Commit: Warner Losh CommitDate: 2023-07-21 04:32:30 +0000 cam/scsi: Better action for ASC/ASCQ 0x18/0x08 0x18/0x8 is another code to indicate that the data was recovered successfully, so complete the command w/o an error rather than retry the operation. Sponsored by: Netflix Reviewed by: mav, jhb Differential Revision: https://reviews.freebsd.org/D41082 --- sys/cam/scsi/scsi_all.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/cam/scsi/scsi_all.c b/sys/cam/scsi/scsi_all.c index c1b23438fb4a..9c408fd85b05 100644 --- a/sys/cam/scsi/scsi_all.c +++ b/sys/cam/scsi/scsi_all.c @@ -1592,7 +1592,7 @@ static struct asc_table_entry asc_table[] = { { SST(0x18, 0x07, SS_NOP | SSQ_PRINT_SENSE, "Recovered data with ECC - data rewritten") }, /* R */ - { SST(0x18, 0x08, SS_RDEF, /* XXX TBD */ + { SST(0x18, 0x08, SS_NOP | SSQ_PRINT_SENSE, "Recovered data with linking") }, /* D O K */ { SST(0x19, 0x00, SS_RDEF, From nobody Fri Jul 21 04:32:31 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6c9D2VNxz4nwYy; Fri, 21 Jul 2023 04:32: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 4R6c9D1T50z3pSk; Fri, 21 Jul 2023 04:32:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689913952; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ohyULctqZw6bKLR424uqqK9IfbLdzDZN17oQV06aoHU=; b=UUEcJsa30JOqGU64mGEh7w6/QsQeo/ksMYFp7eAaWhY/we1flkI1LuPvFUrHY86rBcjPUd 49JOtW0H824ZFgP+Ug4ttgejIzSJvx4TQ0fYhV2FzMn2Kes6eQAkdVarKUvOgG77e5e3Nf PXPR3LeGM4fQ3D4uWdENhOSG+VSDpJqKNxXo5oRLdMR8xi06UzA7Z0s/yWGb7jvnNrZZjJ aaVvNH+fLqp93u+B6Azs0bu7CIT9KHJ1OguBLzGik+bcVDN5uqpaodviy1uGwUoOC38Vnn XPphL5Zepj8jXek5i8a4Y0ejquglcbvXoO/wJ3Z+4PH55rQxdBZlP/Sf8GiIBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689913952; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ohyULctqZw6bKLR424uqqK9IfbLdzDZN17oQV06aoHU=; b=HKBigiELJt0jAjcJeUeB0ZY9q405QROZCB/QTNPNfrwVkJMkuZ2AEn1/xUu/sMhBJ2LjHh 4gQKJylLkfM2dtXA6iWcBOka2uRxK+Dr9l8TUk1lRuHQJNcYHj+FgHiRVzWLu0Fc3snOia rWo7cSUN48kIvCapQMzN9Jn/eyWcKwd6FUIZUDSLr3u3S9EK03lnVjXWlBvKFoLd3jbfw2 4/PoxcjsTV4seSX3zSo7NCmZG90Hnc36aWKvu/ymYmQlkXkf+G3akrFQZOg7bumzIkvByu aIwR8ATcBei6GtxLj0sabIo3AZ8M0xNIdsDXyHlL+KafInD2zETMcCrWRNSypA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689913952; a=rsa-sha256; cv=none; b=toC16Tc8hObFbAIjc7eBZHvhjW0cqlQbM2pAxJHeiMJhYp8fxjowI4fVSIay/piZfzGyTy rQtKXJK8ouLNLMg2pIllmzA4vWM+bif3elX7CnlJ2VwearE8qyPGCVHvt8lxpxEdaWG7+F 51ZH3v8emVzySUDC9D3D8+1W/r7D8ap03+snti6TGx0t8jBVwfmjE0/wVibxEghybpQvyO z7Z6XZT+VKs0/34KxFrj1X7mdby3qQ7CF7NsjKf7aPTo93Zw8zL+m+TUDfxwQOf6tYd/1L RKQGbjWRq18OOHFDAzJQH69ttGuQVcSaoX2QSFUYgqhvo0C0aMquMtdEcU/+5g== 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 4R6c9D0YlQzyMt; Fri, 21 Jul 2023 04:32: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 36L4WVL7014760; Fri, 21 Jul 2023 04:32:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36L4WVUc014759; Fri, 21 Jul 2023 04:32:31 GMT (envelope-from git) Date: Fri, 21 Jul 2023 04:32:31 GMT Message-Id: <202307210432.36L4WVUc014759@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 33734ddf2b18 - main - cam: Be explict about CAM_SMP_STATUS_ERROR List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 33734ddf2b184ef82fcef31ecb5c679f6d4b1eeb Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=33734ddf2b184ef82fcef31ecb5c679f6d4b1eeb commit 33734ddf2b184ef82fcef31ecb5c679f6d4b1eeb Author: Warner Losh AuthorDate: 2023-07-21 04:22:18 +0000 Commit: Warner Losh CommitDate: 2023-07-21 04:32:31 +0000 cam: Be explict about CAM_SMP_STATUS_ERROR This is normally caught by default:, but no harm in making it explicit that we'll retry valid periphs. Sponsored by: Netflix Reviewed by: mav Differential Revision: https://reviews.freebsd.org/D41083 --- sys/cam/cam_periph.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/cam/cam_periph.c b/sys/cam/cam_periph.c index 0e563343ee96..fe256e84cd2c 100644 --- a/sys/cam/cam_periph.c +++ b/sys/cam/cam_periph.c @@ -1996,6 +1996,7 @@ cam_periph_error(union ccb *ccb, cam_flags camflags, relsim_flags = RELSIM_RELEASE_AFTER_TIMEOUT; /* FALLTHROUGH */ case CAM_ATA_STATUS_ERROR: + case CAM_SMP_STATUS_ERROR: case CAM_REQ_CMP_ERR: case CAM_CMD_TIMEOUT: case CAM_UNEXP_BUSFREE: From nobody Fri Jul 21 04:32:33 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6c9F4DJBz4nwR8; Fri, 21 Jul 2023 04:32: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 4R6c9F2Fcbz3pXQ; Fri, 21 Jul 2023 04:32:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689913953; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RmhcnieqoXXTa6NCVpBWo0+LQyZv3+qkRNT0TR6TVVE=; b=D17HT98P19CAeEOcE/ShXbtDiUIbDS2QaWwRN+1keAhBFXeeg4rtIXGT6DdawtX9xqkHH5 ZVCcG7yZJsQJ6CQxZn1xADrxVAxKP+8Kdp33b9/X7xvB2seRHTEkmVbpf4aXO5yPb1qQ4n dATpNcS59SS+WXgb6uQYtXXVAbPy6okf22Yx+R6bkA/JSdzXHhm4FkvsY4T9DuOD0VcfpI SbGikzwmxJvY30tA6I5n+Fro7eaC11TvudOVFohwBTI6nPsy7RHcuDOTDqP8octd/SQFIQ XA0Um50dInttLkGRtKu6vczsHozk2RFXyLx1jQieOa8zzZuOyrvcAx82FavmkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689913953; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RmhcnieqoXXTa6NCVpBWo0+LQyZv3+qkRNT0TR6TVVE=; b=vFJzwYJkF8Y6DiuNagj2AzVPTk0l/2zMI1mnGz1P7FfebQARuDfWjRnFkl+hwWCvJgOe8L U1Pw53wlLlEQFGttLM1GDU9hy4LZmgiHbRTyJknfzOj/LQI8Cw9nx4G/HfPir0GIj9ABvc yBgudrvPw2YExR4q+puXa5sMMa3JvRZza4E1qkcVZ8Q5OkxPftwRoQGKG31aHBbCpSGUjZ lN5xHrOZH5bSkWIhC+l4rYn4s2zHss2wmAKplJvr/mE9r3eMEFMoFbVeZ/8UDpNnsavtjL XnWAaEvctyKxqioM1SLcC91EMp4M1HgbkVrK9ASgjCPdx5nWLFI9exYrmHh8/w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689913953; a=rsa-sha256; cv=none; b=pm6+RjXXYcI0+bZQiSzSj06kD1HARU87mZoheNEDyDmW894blCIkicVWiwQD2aJarhHzPh CyXYV8CT6ogy+9InC2iENGpTGN3oZg2WRSnAF1gWglXD8A4Kh43uIsKw/YeFVcsPPGKJ9X ZMhm2KymuWUtGE6bmrHjWLx5KupaTULrMSHfFwObmEmTs38o0PKekPLmynttkJ6jtGHWpx +x8YlKpqw713PSHvaB8bU6tD/1UzVOHqIZbUm1cIzbJ+8XROwvsR9G6MDkVCjsmIhQM/lb YZzQ9/Z1S9qDjg7bDATW66N3G7WgZ3Y832oma2rDcAgFP7OFYiPGU2JAE3B67w== 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 4R6c9F184lzykZ; Fri, 21 Jul 2023 04:32: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 36L4WXw4014779; Fri, 21 Jul 2023 04:32:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36L4WXEx014778; Fri, 21 Jul 2023 04:32:33 GMT (envelope-from git) Date: Fri, 21 Jul 2023 04:32:33 GMT Message-Id: <202307210432.36L4WXEx014778@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 0732617ec174 - main - cam/nda: Remove impossible CAM codes List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0732617ec174854c0875bb7171d850473c61569f Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=0732617ec174854c0875bb7171d850473c61569f commit 0732617ec174854c0875bb7171d850473c61569f Author: Warner Losh AuthorDate: 2023-07-21 04:22:27 +0000 Commit: Warner Losh CommitDate: 2023-07-21 04:32:31 +0000 cam/nda: Remove impossible CAM codes The NVME SIM does not generate these status values, so remove them. Sponsored by: Netflix Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D41084 --- sys/cam/nvme/nvme_da.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/sys/cam/nvme/nvme_da.c b/sys/cam/nvme/nvme_da.c index 94915ec6a726..f2fb1b79f452 100644 --- a/sys/cam/nvme/nvme_da.c +++ b/sys/cam/nvme/nvme_da.c @@ -1284,12 +1284,7 @@ ndaerror(union ccb *ccb, u_int32_t cam_flags, u_int32_t sense_flags) softc->timeouts++; #endif break; - case CAM_REQ_ABORTED: case CAM_REQ_CMP_ERR: - case CAM_REQ_TERMIO: - case CAM_UNREC_HBA_ERROR: - case CAM_DATA_RUN_ERR: - case CAM_ATA_STATUS_ERROR: #ifdef CAM_IO_STATS softc->errors++; #endif From nobody Fri Jul 21 04:32:34 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6c9G4S9qz4nwkc; Fri, 21 Jul 2023 04:32: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 4R6c9G2NMqz3php; Fri, 21 Jul 2023 04:32:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689913954; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zQvyYT+PnA5LGCJLd0v3+1ZryvBcUdiiRPb4lg0Uqhw=; b=L5Jza8yajZG4mMTl/Sb/2njj6uK+QrYWSVv33Y7IbEHGhspj59dnnzxLX6YyqoD8PVSPXN mudr0znvdp2UZz8l0UqZHaIn2oIHlESVDSBrf/Zj+DC0JpOM/KmqO6rAEl6Li/V/B6Khge n0ivpNVqoluUFkZwn620Q7RC4nkaLf+QDVdxM1ubcuJkMif3rOH02wvO6GgEdCTIvmK8oo HPIvZyClxDa7rFo3s3Pqde8/Ealj1RZan6yrD5cW08YfAd0MYoIYFJBBigsKS0C34HUs/w 8ENgMfo4OKHM4Ad2FD6plIuv21XrJ7Nw0hXPzoEQ4dars/9NpRDss2fV0A1jfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689913954; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zQvyYT+PnA5LGCJLd0v3+1ZryvBcUdiiRPb4lg0Uqhw=; b=Gnb5fjLyngeQdPQWp4GBOyK59rYXBjmuQz19f2nEUJ22mnVM2eRZgYTr+GAssLhXRIHxoG EW5IbStqRP9pbH7U2/+lQRLFB7bYU7RVY6yspigagj7j6iZO4+eH81z9g6asTsiOoNqDB3 Qd3muK1WtiEJpCA6VAIPP9Baft2Q74jwmhVtQJFeokf48pnNbQutw5bSPg8KdkxwysI6G3 lrgcf/jpIlHjq62+llx2LKZeljOGPgytnlPMiLdczT6TAo4s/lOdDYzCXI/3pyv0UWtQMK GgtYx9l9JxK5eYpk0UzW/red128PW9p4WdECgtz8/d+kE6kKcy9anri39vpKSQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689913954; a=rsa-sha256; cv=none; b=f6sdDoK+Lv0w/eYNXcxnuiO1GFTRx7mACZWJmKN2+sbWl5SzQYFBoQeOW5yHfX+qlpM4FJ GPp7VcDnyV92A/E/tUmgaQjF0YScm9Q8lsV7MYGbO1DbqtuI/GKjJgRc5VkePtxW6nqzQn q4zwLsqyHQ72PXOTKI1xcJZYtkOToq7zq9DcufSdnd8mxXWT7tulEFVP/vwdbXc3UGcxDN ZON8Zv5Mkv/obLTqbH1dIXEK+iT6xCQMa3EVCFbEZiLz6Y48phO6F1Q4fjNcaek64MW6UT UWNbVHkhnHPsMXU9vLuNJOl/CnmREGDVDUmJDcg+VpoWw0f+diHdUYpk0XfJIg== 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 4R6c9G1VNKzyMv; Fri, 21 Jul 2023 04:32: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 36L4WYeO014801; Fri, 21 Jul 2023 04:32:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36L4WYir014800; Fri, 21 Jul 2023 04:32:34 GMT (envelope-from git) Date: Fri, 21 Jul 2023 04:32:34 GMT Message-Id: <202307210432.36L4WYir014800@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 774ab87cf27b - main - cam: Add CAM_NVME_STATUS_ERROR error code List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 774ab87cf27beb3669693f14b9c89ebaf542eaf3 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=774ab87cf27beb3669693f14b9c89ebaf542eaf3 commit 774ab87cf27beb3669693f14b9c89ebaf542eaf3 Author: Warner Losh AuthorDate: 2023-07-21 04:22:37 +0000 Commit: Warner Losh CommitDate: 2023-07-21 04:32:31 +0000 cam: Add CAM_NVME_STATUS_ERROR error code Add CAM_NVME_STATUS_ERROR error code. Flag all NVME commands that completed with an error status as CAM_NVME_STATUS_ERROR (a new value) instaead of CAM_REQ_CMP_ERR. This indicates to the upper layers of CAM that the 'cpl' field for nvmeio CCBs is valid and can be examined for error recovery, if desired. No functional change. nda will still see these as errors, call ndaerror() to get the error recovery action, etc. cam_periph_error will select the same case as before (even w/o the change, though the change makes it explicit). Sponsored by: Netflix Reviewed by: chuck, mav, jhb Differential Revision: https://reviews.freebsd.org/D41085 --- sys/cam/cam.h | 7 ++++++- sys/cam/cam_periph.c | 1 + sys/cam/nvme/nvme_da.c | 1 + sys/dev/nvme/nvme_sim.c | 2 +- 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/sys/cam/cam.h b/sys/cam/cam.h index 99f7b6a7f5c2..eacf3a248ce9 100644 --- a/sys/cam/cam.h +++ b/sys/cam/cam.h @@ -240,7 +240,12 @@ typedef enum { CAM_REQ_SOFTTIMEOUT = 0x1f, /* - * 0x20 - 0x32 are unassigned + * NVME error, look at errro code in CCB + */ + CAM_NVME_STATUS_ERROR = 0x20, + + /* + * 0x21 - 0x32 are unassigned */ /* Initiator Detected Error */ diff --git a/sys/cam/cam_periph.c b/sys/cam/cam_periph.c index fe256e84cd2c..8defdc9ecbe6 100644 --- a/sys/cam/cam_periph.c +++ b/sys/cam/cam_periph.c @@ -1996,6 +1996,7 @@ cam_periph_error(union ccb *ccb, cam_flags camflags, relsim_flags = RELSIM_RELEASE_AFTER_TIMEOUT; /* FALLTHROUGH */ case CAM_ATA_STATUS_ERROR: + case CAM_NVME_STATUS_ERROR: case CAM_SMP_STATUS_ERROR: case CAM_REQ_CMP_ERR: case CAM_CMD_TIMEOUT: diff --git a/sys/cam/nvme/nvme_da.c b/sys/cam/nvme/nvme_da.c index f2fb1b79f452..9beef786f320 100644 --- a/sys/cam/nvme/nvme_da.c +++ b/sys/cam/nvme/nvme_da.c @@ -1285,6 +1285,7 @@ ndaerror(union ccb *ccb, u_int32_t cam_flags, u_int32_t sense_flags) #endif break; case CAM_REQ_CMP_ERR: + case CAM_NVME_STATUS_ERROR: #ifdef CAM_IO_STATS softc->errors++; #endif diff --git a/sys/dev/nvme/nvme_sim.c b/sys/dev/nvme/nvme_sim.c index ec8cc03cb774..ad6783adf181 100644 --- a/sys/dev/nvme/nvme_sim.c +++ b/sys/dev/nvme/nvme_sim.c @@ -74,7 +74,7 @@ nvme_sim_nvmeio_done(void *ccb_arg, const struct nvme_completion *cpl) memcpy(&ccb->nvmeio.cpl, cpl, sizeof(*cpl)); ccb->ccb_h.status &= ~CAM_SIM_QUEUED; if (nvme_completion_is_error(cpl)) { - ccb->ccb_h.status = CAM_REQ_CMP_ERR; + ccb->ccb_h.status = CAM_NVME_STATUS_ERROR; xpt_done(ccb); } else { ccb->ccb_h.status = CAM_REQ_CMP; From nobody Fri Jul 21 08:59:51 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6k5h16TSz4dQlP; Fri, 21 Jul 2023 08:59: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 4R6k5h0cF8z4KJ4; Fri, 21 Jul 2023 08:59:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689929992; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vKuYbjn8G4S++wn71jPuaQJh/WnobrGGEdVobPH2X/U=; b=fIt8GV3H8ScCpBHSG7pRdMIZwmjvjxZQGMx1gAMO4OW4Sk+cdZkVX6UamC9soClWdnf4rO VUx4/hzLkm6YjsuaVSl7dmIVs1noTrmlEOPczhswKmlcvMc4Ds4z8isEeJ3+tkzp1b5FlY qEdjrqxk7YoUcRIRBP3ND9wAz7+tS6Ql341pkthHTjjHTNqDsrPscLHqkXXqVrYpNkwrh+ Lu7GyU8ZXxBKZT1i2IXFBGG7tBC/SFF367HH28E+bAczQfytBPBAjX9Aodz6Vfmpkglou0 4YywLawyeih1plYeLgiLskEYM+kEL+R+T+dhycS6rs7PjSviNN0UTc06hkfWUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689929992; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vKuYbjn8G4S++wn71jPuaQJh/WnobrGGEdVobPH2X/U=; b=aj81+N2xHKt2XUG7Ng+ie/IFNGxFx2utdrEU9nJrvVOM4hMmEkPXCalaadKbMm3oCK36hJ EwU0AtHNyEk1MbbD00pGYGn5DZ0+MJyavbaP5O+q++stySujeuuu9qOk0Me3uTQQnbReB8 sUkFVF6bR0250xe7b+JvddQmThvrNP30oHYeqYVyJkvYCYkJkHm1HMB7AP3a/Nn5gHKONy A46wdnvpvQwpmGv7D7XSffenvrON/On8VbeXxaDiYFkz8Yf87iC46fh8GIm1Dcy2m9iEia I2WJDXJ1VSMSKmMd3ku5a7DTuUKPLUwtg5cKlt5QVPFSoMm2yimQoiDgtth0iw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689929992; a=rsa-sha256; cv=none; b=YJCJTYPmmHdghC6YrLo/bRDGpn6E7VSLetwChxnX0ok265pVQo0w4BxWnPcZzO29QbYEnZ Xd/Sei4w+z/ScNByhb2D2iNXel7a5xzIJtaBfjCkLUdfv8waKxQNX3moVoc3bUYU3JwTK7 Y6P55eMEV26bOc8E0QYKZJCHtEvcYG+rEB6w0yAl8+/wzlKyA75PYWK4rjnaITW3NkycXH OGBqQP00mpfYs7MRfDDo2fs0O4Gg6+2ddDy5U5Ci5vFQHorPB73HnQLVJjJ56+YkaWGnE+ OkgjAEY6hiap5aY+/sjlbYGMo2t+d0HSXapG/aUlYSUsbUXHr3ubFroqekwrTA== 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 4R6k5g6mT0z161X; Fri, 21 Jul 2023 08:59: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 36L8xpM6046379; Fri, 21 Jul 2023 08:59:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36L8xp7v046378; Fri, 21 Jul 2023 08:59:51 GMT (envelope-from git) Date: Fri, 21 Jul 2023 08:59:51 GMT Message-Id: <202307210859.36L8xp7v046378@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Roger=20Pau=20Monn=C3=A9?= Subject: git: 20fc5bf7df1d - main - xen: move vcpu_info to common, leave hook for setup List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: royger X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 20fc5bf7df1db698f2651eaa04a3bc71290e1636 Auto-Submitted: auto-generated The branch main has been updated by royger: URL: https://cgit.FreeBSD.org/src/commit/?id=20fc5bf7df1db698f2651eaa04a3bc71290e1636 commit 20fc5bf7df1db698f2651eaa04a3bc71290e1636 Author: Elliott Mitchell AuthorDate: 2023-06-08 21:13:17 +0000 Commit: Roger Pau Monné CommitDate: 2023-07-21 08:59:12 +0000 xen: move vcpu_info to common, leave hook for setup vcpu_info is crucial for the Xen event channel core. Since both the data and setup steps are identical between architectures, move them to the common file. Since there is no cross-architecture method to call a function on every processor during bring-up, simply leave the setup function. The number of vcpu_info structures available on the shared information page varies by architecture. Instead of hard-coding the count use nitems(). Add a warning message for this being used. Switch to XEN_VCPUID() and use Xen's typedefs. panic() on failure since >32 processors is no longer unusual. royger: Specify 64-byte alignment for vcpu_info to try to defend against vcpu_info crossing a page boundary. Add detection for this limit. Reviewed by: royger --- sys/x86/xen/hvm.c | 25 +++---------------------- sys/xen/xen-os.h | 5 +++++ sys/xen/xen_common.c | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 61 insertions(+), 22 deletions(-) diff --git a/sys/x86/xen/hvm.c b/sys/x86/xen/hvm.c index d59c3901d2d7..38c93bf25998 100644 --- a/sys/x86/xen/hvm.c +++ b/sys/x86/xen/hvm.c @@ -88,8 +88,7 @@ int xen_vector_callback_enabled; bool xen_evtchn_needs_ack; /*------------------------------- Per-CPU Data -------------------------------*/ -DPCPU_DEFINE(struct vcpu_info, vcpu_local_info); -DPCPU_DEFINE(struct vcpu_info *, vcpu_info); +DPCPU_DECLARE(struct vcpu_info *, vcpu_info); /*------------------------------ Sysctl tunables -----------------------------*/ int xen_disable_pv_disks = 0; @@ -416,10 +415,8 @@ SYSINIT(xen_hvm_init, SI_SUB_HYPERVISOR, SI_ORDER_FIRST, xen_hvm_sysinit, NULL); static void xen_hvm_cpu_init(void) { - struct vcpu_register_vcpu_info info; - struct vcpu_info *vcpu_info; uint32_t regs[4]; - int cpu, rc; + int rc; if (!xen_domain()) return; @@ -459,23 +456,7 @@ xen_hvm_cpu_init(void) rc); } - /* - * Set the vCPU info. - * - * NB: the vCPU info for vCPUs < 32 can be fetched from the shared info - * page, but in order to make sure the mapping code is correct always - * attempt to map the vCPU info at a custom place. - */ - vcpu_info = DPCPU_PTR(vcpu_local_info); - cpu = PCPU_GET(vcpu_id); - info.mfn = vtophys(vcpu_info) >> PAGE_SHIFT; - info.offset = vtophys(vcpu_info) - trunc_page(vtophys(vcpu_info)); - - rc = HYPERVISOR_vcpu_op(VCPUOP_register_vcpu_info, cpu, &info); - if (rc != 0) - DPCPU_SET(vcpu_info, &HYPERVISOR_shared_info->vcpu_info[cpu]); - else - DPCPU_SET(vcpu_info, vcpu_info); + xen_setup_vcpu_info(); } SYSINIT(xen_hvm_cpu_init, SI_SUB_INTR, SI_ORDER_FIRST, xen_hvm_cpu_init, NULL); diff --git a/sys/xen/xen-os.h b/sys/xen/xen-os.h index e1d03b7322bc..4919a9fc0702 100644 --- a/sys/xen/xen-os.h +++ b/sys/xen/xen-os.h @@ -44,6 +44,11 @@ #include #include +/* + * Setup function which needs to be called on each processor by architecture + */ +extern void xen_setup_vcpu_info(void); + static inline vm_paddr_t xen_get_xenstore_mfn(void) { diff --git a/sys/xen/xen_common.c b/sys/xen/xen_common.c index d0f0ecdeed59..95fe00b2ba98 100644 --- a/sys/xen/xen_common.c +++ b/sys/xen/xen_common.c @@ -33,11 +33,16 @@ __FBSDID("$FreeBSD$"); #include /* required by xen/xen-os.h */ +#include +#include + #include /* required by xen/xen-os.h */ #include #include +#include + /*-------------------------------- Global Data -------------------------------*/ enum xen_domain_type xen_domain_type = XEN_NATIVE; @@ -49,3 +54,51 @@ uint32_t hvm_start_flags; /*------------------ Hypervisor Access Shared Memory Regions -----------------*/ shared_info_t *HYPERVISOR_shared_info; + +/*------------------------------- Per-CPU Data -------------------------------*/ +DPCPU_DEFINE(struct vcpu_info *, vcpu_info); + +void +xen_setup_vcpu_info(void) +{ + /* This isn't directly accessed outside this function */ + DPCPU_DEFINE_STATIC(vcpu_info_t, vcpu_local_info) + __attribute__((aligned(64))); + + vcpu_info_t *vcpu_info = DPCPU_PTR(vcpu_local_info); + vcpu_register_vcpu_info_t info = { + .mfn = vtophys(vcpu_info) >> PAGE_SHIFT, + .offset = vtophys(vcpu_info) & PAGE_MASK, + }; + unsigned int cpu = XEN_VCPUID(); + int rc; + + KASSERT(xen_domain(), ("%s(): invoked when not on Xen?", __func__)); + + _Static_assert(sizeof(struct vcpu_info) <= 64, + "struct vcpu_info is larger than supported limit of 64 bytes"); + + /* + * Set the vCPU info. + * + * NB: the vCPU info for some vCPUs can be fetched from the shared info + * page, but in order to make sure the mapping code is correct always + * attempt to map the vCPU info at a custom place. + */ + rc = HYPERVISOR_vcpu_op(VCPUOP_register_vcpu_info, cpu, &info); + if (rc == 0) + DPCPU_SET(vcpu_info, vcpu_info); + else if (cpu < nitems(HYPERVISOR_shared_info->vcpu_info)) { + static bool warned = false; + + DPCPU_SET(vcpu_info, &HYPERVISOR_shared_info->vcpu_info[cpu]); + + if (bootverbose && !warned) { + warned = true; + printf( + "WARNING: Xen vCPU %u failed to setup vcpu_info rc = %d\n", + cpu, rc); + } + } else + panic("Unable to register vCPU %u, rc=%d\n", cpu, rc); +} From nobody Fri Jul 21 09:24:50 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6kfW1vV8z4nd26; Fri, 21 Jul 2023 09:24: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 4R6kfV6SDRz3FsB; Fri, 21 Jul 2023 09:24:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689931490; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SCcAfuEH+vjeMInuDVQrKJSi+XJo1rDvMK1/zDp3bvQ=; b=BbaEVDK0wW3mSXFFUAskW9X+rNvNhplhjHbuQ71zZ1Nd/m68qcFTYupWbWTvl+Zl46WL0k mFNSKJhJ+zrm4GhYqTUuZZmnTemZrN7yaiWYIyytCe0jC3nQbIaNtyhyzddxVXC5JOcdoa 2DNjbMLSzxCpOdINClADAD1I7pQS9Sbo/q6ibsIQavKZ9t0iWLVZ/ei05SZOAv0eqU0zFU 5SguFNyq2kUmpWt+ozdoYOTIoF3Sumt3gf9Z3vPC2dKBGj8nwbQIyoVYbjb/OtzBgaaAYp HkYkjzc9TO0T2LoLLRc5n+6Jr1ymdasOO7dK5XKRZ2pEr9IDuVtlYqPbagTYhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689931490; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SCcAfuEH+vjeMInuDVQrKJSi+XJo1rDvMK1/zDp3bvQ=; b=ADw9kz4tals0Z0qRQCMKAsUQY1bMoe5s8OhL2dJ/gy+VKSgPiymLpmPGBFevVGyzoYYvfT nAl6sjQIcC3RU8ru7FjZl8wj1hjevhW/uWO0CaJpWBsmvWmMEe78hnpBxo55B89Nu99w+5 eebjFd25NW4cvpgEtHhbVGKjZdgQvJEFRB8xmo4ARX2K/cxf3rsSUrvrAHkm+yamfyVXOI IoTwU9x+9TJp5ViIOTExji/d+w75ZFCWF7qIjevY1sga9mbGu5Doy3mE5gQisYN80BVm4E HVAXmWly4YbRa4gHrfvJ4mc7qe7KCv1XSqbgeRCwbgOZvu5dltLUmtei0mlsdQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689931490; a=rsa-sha256; cv=none; b=YA6XyN9nf6seS+xAu0OhGpAr3C1ivWGtaj6LBfggR+9lwoAe65ieu2lKagY91MczGhDO8Z IGsfGIys8BeUCxC7LT+lclkK36rgGvQU96ONPNbz720SoNzRWYmqrnrmI7s72fFV46RUnk wsVokA5O4xlDBBgVQrsoD3+PGAKYjeP9CxncTNR986ce86EjaiBM4uQEDlU6kkZG22RAEV aD7rSCUIPwnw5Uu4FzMKxTKM0Nxo1QQUpjQ/fuuLWQcOhqxxyxE3rroWSu6vt/iFhwNuoT xn98eOZ56weGQvGSv1ptz7dFLUYf7x4DiVBfnH7XCuOhrH+x4S3OiKT7ztPGjg== 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 4R6kfV58mkz16rn; Fri, 21 Jul 2023 09:24: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 36L9OoW3096179; Fri, 21 Jul 2023 09:24:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36L9OoBD096178; Fri, 21 Jul 2023 09:24:50 GMT (envelope-from git) Date: Fri, 21 Jul 2023 09:24:50 GMT Message-Id: <202307210924.36L9OoBD096178@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 9f23cbd6cae8 - main - atf_pytest_wrapper: fix use with pytest-7.4 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9f23cbd6cae82fd77edfad7173432fa8dccd0a95 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=9f23cbd6cae82fd77edfad7173432fa8dccd0a95 commit 9f23cbd6cae82fd77edfad7173432fa8dccd0a95 Author: Kristof Provost AuthorDate: 2023-07-18 14:20:47 +0000 Commit: Kristof Provost CommitDate: 2023-07-21 09:23:21 +0000 atf_pytest_wrapper: fix use with pytest-7.4 As of pytest 7.4 it no longer walks all the way to the root directory of the file system to find conftest files. As a result we don't find / usr/tests/conftest.py, and don't load atf_python. That in turn causes atf_python tests to fail. Explicitly set the confcutdir, as advised by the pytest changelog. See also: https://github.com/pytest-dev/pytest/pull/11043 MFC after: 3 weeks Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D41064 --- libexec/atf/atf-pytest-wrapper/atf_pytest_wrapper.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libexec/atf/atf-pytest-wrapper/atf_pytest_wrapper.cpp b/libexec/atf/atf-pytest-wrapper/atf_pytest_wrapper.cpp index 78b045b9775f..b0cc600bde21 100644 --- a/libexec/atf/atf-pytest-wrapper/atf_pytest_wrapper.cpp +++ b/libexec/atf/atf-pytest-wrapper/atf_pytest_wrapper.cpp @@ -141,6 +141,8 @@ class Handler { std::vector args = {"pytest", "-vv", "-p", "no:cacheprovider", "-s", "--atf"}; + args.push_back("--confcutdir=" + python_path); + if (flag_list) { args.push_back("--co"); args.push_back(script_path); From nobody Fri Jul 21 10:32:35 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6m8g6p4qz4pFxd; Fri, 21 Jul 2023 10:32: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 4R6m8g6MFMz3q5n; Fri, 21 Jul 2023 10:32:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689935555; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tKUVnNtxXcYDT5KvQGkJuS2uMtZcj6elxDI3RKO3E/0=; b=uEAx1DNWRsRnLcHxx7Bl/E38seT0tahrfW5dBVzYlLhFEfqlYE9r51wHFXmsSUpOuFeR63 KxZXjWYxH9OMZ7NyMS3VEd5JKKw9O3YiThYmFAD4Ohl+O8cnEHtmjue+fhWwIYLFKjGbCs B1d6JEF6GKJ16Ku1ESZKmZE1nfz+IIPFQH5hgpxEVO3oIryUl5UchD/B5EOXN2S26Xchil kD0prUFa/0adFmq2TxXTg/op8HpDdu7+XvHTuQ0YJ7vqLDedGBnOBGoczUZpF9QTUIsnBl GKe4WxuOOJTs+8hxrrUXHprx2AkHXnggPFRcTbIGorbP6AYKckXWmA1SvUaC1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689935555; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tKUVnNtxXcYDT5KvQGkJuS2uMtZcj6elxDI3RKO3E/0=; b=iPoIgiyE6YUXyiG3rcVfc8V4CWKvcVt+8AWH/ND5QDWvv8qqe0v7Ancyb6a43U9vUVursJ DH6U6SG+OnJ59SVA5dGXXu3lCNFvoHa58aHNf8F4CESHyAQKpvtdUTjJ9FofjpFduAxZjB Ac70ZOEyV6bk05ggKoocTwt3GHkM3i0LhSYqUqJ2RQnm4R+mBwa6OMW5cFCSzAmyiNzsO2 SbmrZ/mTLjFIsBUg+GpXw+CrDrU2NT4uqmbm3hDDIZip9JdT2zOlLwZE21vfxwv0dLqXTR kCX6VHJIE2rt3seLtvmPLub+LX+642KlD1L2NW3ejrcBy7qHMUbZ0fPtDWGLVA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689935555; a=rsa-sha256; cv=none; b=W/ijRDLF6G9/AfZumrhwgHkBen7ENi651kSt3E469xt6GkSt+sTyccd7saE8ZIvDblFLNi bw62jAYqskRA0tCCoOog3iH5xM7ESPMHkoD3aWN87i4V6qGFcQic/o8SWzpu4ltgd2Zrr5 SQthcdkkwajWbuD2G8nAAKgx66r3FvosfGEVxGb/i/POddul7DK/YcFt93Jy/lLxU4b+mJ IY4PRylDyuOCra3io9L8l0mEHQD7JwfLN0UkHEXw6RrE4cc+SweQihjxUKRYPVKP5u6BT1 wJvAj9gTONoabX0eeJXM3mZQ6MSuCHtmK8PkwcI0hIJtBRj8oO6aHUPEz5/FOA== 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 4R6m8g5RnZz18X1; Fri, 21 Jul 2023 10:32: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 36LAWZXf010470; Fri, 21 Jul 2023 10:32:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36LAWZ2l010469; Fri, 21 Jul 2023 10:32:35 GMT (envelope-from git) Date: Fri, 21 Jul 2023 10:32:35 GMT Message-Id: <202307211032.36LAWZ2l010469@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 61e22e9b2905 - main - pf: use sctp_calculate_cksum() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 61e22e9b2905f405170c249a2239f324229b60d1 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=61e22e9b2905f405170c249a2239f324229b60d1 commit 61e22e9b2905f405170c249a2239f324229b60d1 Author: Kristof Provost AuthorDate: 2023-07-07 08:04:51 +0000 Commit: Kristof Provost CommitDate: 2023-07-21 10:32:17 +0000 pf: use sctp_calculate_cksum() This function is always available, even if the SCTP or SCTP_SUPPORT options are not set. That lets us remove an ifdef, and also means we improve pf's SCTP handling when the options are not set. MFC after: 3 weeks Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D40911 --- sys/netpfil/pf/pf.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 2a1813d6aadd..490a4130f025 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -112,9 +112,8 @@ __FBSDID("$FreeBSD$"); #include #endif /* INET6 */ -#if defined(SCTP) || defined(SCTP_SUPPORT) +#include #include -#endif #include #include @@ -438,6 +437,21 @@ VNET_DEFINE(struct intr_event *, pf_swi_ie); VNET_DEFINE(uint32_t, pf_hashseed); #define V_pf_hashseed VNET(pf_hashseed) +static void +pf_sctp_checksum(struct mbuf *m, int off) +{ + uint32_t sum = 0; + + /* Zero out the checksum, to enable recalculation. */ + m_copyback(m, off + offsetof(struct sctphdr, checksum), + sizeof(sum), (caddr_t)&sum); + + sum = sctp_calculate_cksum(m, off); + + m_copyback(m, off + offsetof(struct sctphdr, checksum), + sizeof(sum), (caddr_t)&sum); +} + int pf_addr_cmp(struct pf_addr *a, struct pf_addr *b, sa_family_t af) { @@ -6569,12 +6583,10 @@ pf_route(struct mbuf **m, struct pf_krule *r, struct ifnet *oifp, in_delayed_cksum(m0); m0->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA; } -#if defined(SCTP) || defined(SCTP_SUPPORT) if (m0->m_pkthdr.csum_flags & CSUM_SCTP & ~ifp->if_hwassist) { - sctp_delayed_cksum(m0, (uint32_t)(ip->ip_hl << 2)); + pf_sctp_checksum(m0, (uint32_t)(ip->ip_hl << 2)); m0->m_pkthdr.csum_flags &= ~CSUM_SCTP; } -#endif /* * If small enough for interface, or the interface will take From nobody Fri Jul 21 10:32:36 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6m8j0ywGz4pG0S; Fri, 21 Jul 2023 10:32: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 4R6m8j06N9z3q47; Fri, 21 Jul 2023 10:32:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689935557; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oHvYGoC6cjb/ybPFl16ajsteO0z60Vv0okoLj3L6jJA=; b=myGXtpIgdexYUu4/Ak7mb3zipnKAzEXiyFyV2O2gVQFUWP3/PJxbV9YvuY2Z8aw2dpWx2N fgrsQxrAOjNWkjSEGgUD7w8fI07Qvp2QNYE4Sb1edQE/QTFZDMzqog/GF7T3bs4hb0MyOS aXhgppTorSCKoICbMXR0oLTwww51e0mz8Og43SsMEgoL6Fuff4qZCP+90/uru8Qh0Qh+AU vjYVo0iyIEA2fFPIfzXFldidLG/ZX0qWC0v91hPW+WRTpHn48+vP3G4qty2gEOBOOzvfMQ 8AxVYaw9hDGjRbuSy3873ZlEqXnH3sK650Xmou+e4VXF5Cw9DdyEqwuVX2y3LQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689935557; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oHvYGoC6cjb/ybPFl16ajsteO0z60Vv0okoLj3L6jJA=; b=sAeoA5rDSZJXeHxcNyxSS7H+Q2u06ZyECP9S2GwSG+I8ik1VfuOxnQq1CrY3WAxSktxSTy +axllk/9ARpdfCSU2IGCLFMLMkRTqDEfkWTA+rY+C+/BnHL6KzPzt6hQwG07TuYNk1IKuQ wHCNGMVZCTy9FnGOjnpAzlF1e3yfyoTfoLJvZK8stkCd4z4c9OENsY8sUkoydzkL18m09n IUX0JIUZgVw0dDSlq02Nd1Mb71TLxN0FYurJE/8wip5OKyJ+aOIfz7sP/Kx/f9lsI3ufw9 04QMp7zCuFQFlee/td1Li3sUDEX/Ro4FMKryEu27xcNC1uqD593xB4NIYLfAGw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689935557; a=rsa-sha256; cv=none; b=imnxcOnSmupgwcQnzXFmsAC5Kg6A7vYvOR9jfSXidMtrYiuFDWM5LiNM3ZkgPjgQPxpwFQ K7lDfg5iMwd+HOh8/zDw0nESZRurlmSdCojPaNsEApM8DWo15LzDFqU7H0iACGMFj4X+3t L3rB8FJ2zJaXJxG/iPrD0gCNqZouO1JouYaQSIEzI4zoRDteh+lJ/bfBvdkj7Hs9A240n2 S4XXZ15n6Br3FJ6DVWLBm7PNyVM2zqtaEJnS0tL4dH0mHaLEg6vKo33iVjwXBGMqM71v3f jJDxhRKaURfeXIH7qVcQRnHDJlNtFxOLlEk6vdRUCkXcHmkvgWKj87oGeZZtZw== 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 4R6m8h68K7z182d; Fri, 21 Jul 2023 10:32: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 36LAWagv010489; Fri, 21 Jul 2023 10:32:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36LAWaio010488; Fri, 21 Jul 2023 10:32:36 GMT (envelope-from git) Date: Fri, 21 Jul 2023 10:32:36 GMT Message-Id: <202307211032.36LAWaio010488@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 0bd4a6837c4b - main - pfctl: SCTP can have port numbers List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0bd4a6837c4bc3dd6168c5679c21c58d41a6910e Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=0bd4a6837c4bc3dd6168c5679c21c58d41a6910e commit 0bd4a6837c4bc3dd6168c5679c21c58d41a6910e Author: Kristof Provost AuthorDate: 2023-04-26 14:59:40 +0000 Commit: Kristof Provost CommitDate: 2023-07-21 10:32:18 +0000 pfctl: SCTP can have port numbers MFC after: 3 weeks Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D40861 --- sbin/pfctl/parse.y | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index 1a0935ce599b..390888526006 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -5274,8 +5274,9 @@ filter_consistent(struct pfctl_rule *r, int anchor_call) int problems = 0; if (r->proto != IPPROTO_TCP && r->proto != IPPROTO_UDP && + r->proto != IPPROTO_SCTP && (r->src.port_op || r->dst.port_op)) { - yyerror("port only applies to tcp/udp"); + yyerror("port only applies to tcp/udp/sctp"); problems++; } if (r->proto != IPPROTO_ICMP && r->proto != IPPROTO_ICMPV6 && @@ -5354,17 +5355,18 @@ rdr_consistent(struct pfctl_rule *r) { int problems = 0; - if (r->proto != IPPROTO_TCP && r->proto != IPPROTO_UDP) { + if (r->proto != IPPROTO_TCP && r->proto != IPPROTO_UDP && + r->proto != IPPROTO_SCTP) { if (r->src.port_op) { - yyerror("src port only applies to tcp/udp"); + yyerror("src port only applies to tcp/udp/sctp"); problems++; } if (r->dst.port_op) { - yyerror("dst port only applies to tcp/udp"); + yyerror("dst port only applies to tcp/udp/sctp"); problems++; } if (r->rpool.proxy_port[0]) { - yyerror("rpool port only applies to tcp/udp"); + yyerror("rpool port only applies to tcp/udp/sctp"); problems++; } } @@ -6936,6 +6938,8 @@ getservice(char *n) s = getservbyname(n, "tcp"); if (s == NULL) s = getservbyname(n, "udp"); + if (s == NULL) + s = getservbyname(n, "sctp"); if (s == NULL) { yyerror("unknown port %s", n); return (-1); From nobody Fri Jul 21 10:32:37 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6m8k0svwz4pFvJ; Fri, 21 Jul 2023 10:32: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 4R6m8k0kQSz3qLG; Fri, 21 Jul 2023 10:32:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689935558; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QqU4FTNx9OoIeXVbsfalR3bm7OuxHnyagmfqWgEI6SY=; b=BZvvDp08ihxroBoJyI6jQM4MyC1FW6Z4r8lkbmD0Uxhh0WrGPRsIHfwlAAdpeSdjlAIebB 8HI5T5r7mZJWrF+uTDEVX1y1vKZC2++tpkSm3oxMheoutdb/c7vsqEawgxe0g8tDl1W7sb S2KdRazcjrCP7jdIFhmrkO6Opdktm4M8uW6R1nuyCFmObj6ybqc3Ssg492+9WExbF/Hg2r hA3aJowKOS/SG4Jdwy9rnR66Kzn7qB41JLUDue95FYOmoXxcGXF+qasDAjZK4gVRrCtiTA YDzcPYJ2XKSrnX/BrZrEtPeN7AuAEjvFQck6clwdZwAKGLEGMllZmiMw2jr6UA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689935558; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QqU4FTNx9OoIeXVbsfalR3bm7OuxHnyagmfqWgEI6SY=; b=lU6HnV+tZOq4DLX9bjxycRGm9Rlc0+bYzF2BiirlmFP0ZE6+v/0gwIqfhU40MUG1+68tU+ IkGvn02yAlQXmOhy7y5gjfwrfYVqcypZYCx0/oR2Y9/nrBOGXt/gFvoLihscQWHvV72ioi jq46voyLcMrFTLvkWC/u6NMCIU0NxCrZwENVtIdfQoFE5ReqCqNyAaPLMxjQMeXbR4bV12 E2yTpbriLinxCNtoIU1MfZKbsl4bTB+4BPY5CMMUHqCWjSJSFGvCl7/DeL/dXsqpNXAfsz RbgKvpR8iMNREvpzNmwsG/bEdSB6CTVBLWhzlHXCSrF7ALfikAoqqZpHkL8z9g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689935558; a=rsa-sha256; cv=none; b=X1XYgFxPyvd/8ZSocyOZOirAKEESzw4mWHspewXhkNK0tfJOf65ilfcsHGxi08K2aHO9Z3 bj6Rfh4c7hJoilf2loYoCUGQjheFPf9GrpR8M9EBNMjibKw22eWh57d/1MrdnkHC/rabL0 tWsReWE5qX73hOm/NlO5paaQU5Gc5zutuch2TKWYdeNFEIzx+l194HxGDaWL36DKg5KwgK SSAwFbE69xtR3f5217sL42mEUQ2hLxlAByYUwHvhQZw7JDd+0AiGI/x4m+xVGotJuUe3V/ 73H0z2G4LPe0kitDMLo838HYaBuFn1gx/eZRa8Nqs9CzwKXMoMK+WA6/MYusJA== 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 4R6m8j6vfjz18J1; Fri, 21 Jul 2023 10:32: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 36LAWbiW010508; Fri, 21 Jul 2023 10:32:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36LAWbgB010507; Fri, 21 Jul 2023 10:32:37 GMT (envelope-from git) Date: Fri, 21 Jul 2023 10:32:37 GMT Message-Id: <202307211032.36LAWbgB010507@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 010ee43f5673 - main - pf: initial SCTP support List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 010ee43f5673eea4c86f846893eadc3c5529b2f8 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=010ee43f5673eea4c86f846893eadc3c5529b2f8 commit 010ee43f5673eea4c86f846893eadc3c5529b2f8 Author: Kristof Provost AuthorDate: 2023-04-27 08:58:02 +0000 Commit: Kristof Provost CommitDate: 2023-07-21 10:32:18 +0000 pf: initial SCTP support Basic state tracking for SCTP. This means we scan through the packet to identify the different chunks (so we can identify state changes). MFC after: 3 weeks Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D40862 --- sbin/pfctl/pf_print_state.c | 34 +++++++++ sys/net/pfvar.h | 13 ++++ sys/netpfil/pf/pf.c | 135 +++++++++++++++++++++++++++++++++ sys/netpfil/pf/pf_norm.c | 180 ++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 362 insertions(+) diff --git a/sbin/pfctl/pf_print_state.c b/sbin/pfctl/pf_print_state.c index f0ad9a427006..cabfc78de97a 100644 --- a/sbin/pfctl/pf_print_state.c +++ b/sbin/pfctl/pf_print_state.c @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #define TCPSTATES #include +#include #include #include #include @@ -206,6 +207,36 @@ print_seq(struct pfctl_state_peer *p) p->seqhi - p->seqlo); } + +static const char * +sctp_state_name(int state) +{ + switch (state) { + case SCTP_CLOSED: + return ("CLOSED"); + case SCTP_BOUND: + return ("BOUND"); + case SCTP_LISTEN: + return ("LISTEN"); + case SCTP_COOKIE_WAIT: + return ("COOKIE_WAIT"); + case SCTP_COOKIE_ECHOED: + return ("COOKIE_ECHOED"); + case SCTP_ESTABLISHED: + return ("ESTABLISHED"); + case SCTP_SHUTDOWN_SENT: + return ("SHUTDOWN_SENT"); + case SCTP_SHUTDOWN_RECEIVED: + return ("SHUTDOWN_RECEIVED"); + case SCTP_SHUTDOWN_ACK_SENT: + return ("SHUTDOWN_ACK_SENT"); + case SCTP_SHUTDOWN_PENDING: + return ("SHUTDOWN_PENDING"); + default: + return ("?"); + } +} + void print_state(struct pfctl_state *s, int opts) { @@ -300,6 +331,9 @@ print_state(struct pfctl_state *s, int opts) const char *states[] = PFUDPS_NAMES; printf(" %s:%s\n", states[src->state], states[dst->state]); + } else if (proto == IPPROTO_SCTP) { + printf(" %s:%s\n", sctp_state_name(src->state), + sctp_state_name(dst->state)); #ifndef INET6 } else if (proto != IPPROTO_ICMP && src->state < PFOTHERS_NSTATES && dst->state < PFOTHERS_NSTATES) { diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index e0c5fb5214a8..86e15f7c1709 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -60,6 +60,7 @@ #include #include #include +#include #include #include #endif @@ -1541,6 +1542,7 @@ struct pf_pdesc { union pf_headers { struct tcphdr tcp; struct udphdr udp; + struct sctphdr sctp; struct icmp icmp; #ifdef INET6 struct icmp6_hdr icmp6; @@ -1570,6 +1572,15 @@ struct pf_pdesc { u_int8_t dir; /* direction */ u_int8_t sidx; /* key index for source */ u_int8_t didx; /* key index for destination */ +#define PFDESC_SCTP_INIT 0x0001 +#define PFDESC_SCTP_INIT_ACK 0x0002 +#define PFDESC_SCTP_COOKIE 0x0004 +#define PFDESC_SCTP_ABORT 0x0008 +#define PFDESC_SCTP_SHUTDOWN 0x0010 +#define PFDESC_SCTP_SHUTDOWN_COMPLETE 0x0020 +#define PFDESC_SCTP_DATA 0x0040 +#define PFDESC_SCTP_OTHER 0x0080 + u_int16_t sctp_flags; }; #endif @@ -2270,6 +2281,8 @@ int pf_normalize_tcp_init(struct mbuf *, int, struct pf_pdesc *, int pf_normalize_tcp_stateful(struct mbuf *, int, struct pf_pdesc *, u_short *, struct tcphdr *, struct pf_kstate *, struct pf_state_peer *, struct pf_state_peer *, int *); +int pf_normalize_sctp(int, struct pfi_kkif *, struct mbuf *, int, + int, void *, struct pf_pdesc *); u_int32_t pf_state_expires(const struct pf_kstate *); void pf_purge_expired_fragments(void); diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 490a4130f025..a721385f761f 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -309,6 +309,9 @@ static int pf_test_state_udp(struct pf_kstate **, static int pf_test_state_icmp(struct pf_kstate **, struct pfi_kkif *, struct mbuf *, int, void *, struct pf_pdesc *, u_short *); +static int pf_test_state_sctp(struct pf_kstate **, + struct pfi_kkif *, struct mbuf *, int, + void *, struct pf_pdesc *, u_short *); static int pf_test_state_other(struct pf_kstate **, struct pfi_kkif *, struct mbuf *, struct pf_pdesc *); static u_int16_t pf_calc_mss(struct pf_addr *, sa_family_t, @@ -4244,6 +4247,11 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, struct pfi_kkif *kif, dport = pd->hdr.udp.uh_dport; hdrlen = sizeof(pd->hdr.udp); break; + case IPPROTO_SCTP: + sport = pd->hdr.sctp.src_port; + dport = pd->hdr.sctp.dest_port; + hdrlen = sizeof(pd->hdr.sctp); + break; #ifdef INET case IPPROTO_ICMP: if (pd->af != AF_INET) @@ -4702,6 +4710,11 @@ pf_create_state(struct pf_krule *r, struct pf_krule *nr, struct pf_krule *a, pf_set_protostate(s, PF_PEER_DST, PFUDPS_NO_TRAFFIC); s->timeout = PFTM_UDP_FIRST_PACKET; break; + case IPPROTO_SCTP: + pf_set_protostate(s, PF_PEER_SRC, SCTP_COOKIE_WAIT); + pf_set_protostate(s, PF_PEER_DST, SCTP_CLOSED); + s->timeout = PFTM_TCP_FIRST_PACKET; + break; case IPPROTO_ICMP: #ifdef INET6 case IPPROTO_ICMPV6: @@ -5669,6 +5682,66 @@ pf_test_state_udp(struct pf_kstate **state, struct pfi_kkif *kif, return (PF_PASS); } +static int +pf_test_state_sctp(struct pf_kstate **state, struct pfi_kkif *kif, + struct mbuf *m, int off, void *h, struct pf_pdesc *pd, u_short *reason) +{ + struct pf_state_key_cmp key; + struct pf_state_peer *src; //, *dst; + struct sctphdr *sh = &pd->hdr.sctp; + u_int8_t psrc; //, pdst; + + bzero(&key, sizeof(key)); + key.af = pd->af; + key.proto = IPPROTO_SCTP; + if (pd->dir == PF_IN) { /* wire side, straight */ + PF_ACPY(&key.addr[0], pd->src, key.af); + PF_ACPY(&key.addr[1], pd->dst, key.af); + key.port[0] = sh->src_port; + key.port[1] = sh->dest_port; + } else { /* stack side, reverse */ + PF_ACPY(&key.addr[1], pd->src, key.af); + PF_ACPY(&key.addr[0], pd->dst, key.af); + key.port[1] = sh->src_port; + key.port[0] = sh->dest_port; + } + + STATE_LOOKUP(kif, &key, *state, pd); + + if (pd->dir == (*state)->direction) { + src = &(*state)->src; + psrc = PF_PEER_SRC; + } else { + src = &(*state)->dst; + psrc = PF_PEER_DST; + } + + /* Track state. */ + if (pd->sctp_flags & PFDESC_SCTP_INIT) { + if (src->state < SCTP_COOKIE_WAIT) { + pf_set_protostate(*state, psrc, SCTP_COOKIE_WAIT); + (*state)->timeout = PFTM_TCP_OPENING; + } + } + if (pd->sctp_flags & PFDESC_SCTP_COOKIE) { + if (src->state < SCTP_ESTABLISHED) { + pf_set_protostate(*state, psrc, SCTP_ESTABLISHED); + (*state)->timeout = PFTM_TCP_ESTABLISHED; + } + } + if (pd->sctp_flags & (PFDESC_SCTP_SHUTDOWN | PFDESC_SCTP_ABORT | + PFDESC_SCTP_SHUTDOWN_COMPLETE)) { + if (src->state < SCTP_SHUTDOWN_PENDING) { + pf_set_protostate(*state, psrc, SCTP_SHUTDOWN_PENDING); + (*state)->timeout = PFTM_TCP_CLOSING; + } + } + + (*state)->expire = time_uptime; + + return (PF_PASS); +} + static int pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, struct mbuf *m, int off, void *h, struct pf_pdesc *pd, u_short *reason) @@ -7365,6 +7438,37 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, break; } + case IPPROTO_SCTP: { + if (!pf_pull_hdr(m, off, &pd.hdr.sctp, sizeof(pd.hdr.sctp), + &action, &reason, AF_INET)) { + if (action != PF_PASS) + pd.act.log |= PF_LOG_FORCE; + goto done; + } + pd.sport = &pd.hdr.sctp.src_port; + pd.dport = &pd.hdr.sctp.dest_port; + if (pd.hdr.sctp.src_port == 0 || pd.hdr.sctp.dest_port == 0) { + action = PF_DROP; + REASON_SET(&reason, PFRES_SHORT); + goto done; + } + action = pf_normalize_sctp(dir, kif, m, 0, off, h, &pd); + if (action == PF_DROP) + goto done; + action = pf_test_state_sctp(&s, kif, m, off, h, &pd, + &reason); + if (action == PF_PASS) { + if (V_pfsync_update_state_ptr != NULL) + V_pfsync_update_state_ptr(s); + r = s->rule.ptr; + a = s->anchor.ptr; + } else { + action = pf_test_rule(&r, &s, kif, m, off, + &pd, &a, &ruleset, inp); + } + break; + } + case IPPROTO_ICMP: { if (!pf_pull_hdr(m, off, &pd.hdr.icmp, ICMP_MINLEN, &action, &reason, AF_INET)) { @@ -7882,6 +7986,37 @@ pf_test6(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, struct inpcb break; } + case IPPROTO_SCTP: { + if (!pf_pull_hdr(m, off, &pd.hdr.sctp, sizeof(pd.hdr.sctp), + &action, &reason, AF_INET6)) { + if (action != PF_PASS) + pd.act.log |= PF_LOG_FORCE; + goto done; + } + pd.sport = &pd.hdr.sctp.src_port; + pd.dport = &pd.hdr.sctp.dest_port; + if (pd.hdr.sctp.src_port == 0 || pd.hdr.sctp.dest_port == 0) { + action = PF_DROP; + REASON_SET(&reason, PFRES_SHORT); + goto done; + } + action = pf_normalize_sctp(dir, kif, m, 0, off, h, &pd); + if (action == PF_DROP) + goto done; + action = pf_test_state_sctp(&s, kif, m, off, h, &pd, + &reason); + if (action == PF_PASS) { + if (V_pfsync_update_state_ptr != NULL) + V_pfsync_update_state_ptr(s); + r = s->rule.ptr; + a = s->anchor.ptr; + } else { + action = pf_test_rule(&r, &s, kif, m, off, + &pd, &a, &ruleset, inp); + } + break; + } + case IPPROTO_ICMP: { action = PF_DROP; DPFPRINTF(PF_DEBUG_MISC, diff --git a/sys/netpfil/pf/pf_norm.c b/sys/netpfil/pf/pf_norm.c index 5f6d9c1635cd..38312712a0ad 100644 --- a/sys/netpfil/pf/pf_norm.c +++ b/sys/netpfil/pf/pf_norm.c @@ -56,6 +56,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #ifdef INET6 #include @@ -2016,6 +2018,184 @@ pf_normalize_mss(struct mbuf *m, int off, struct pf_pdesc *pd) return (0); } +static int +pf_scan_sctp(struct mbuf *m, int ipoff, int off, struct pf_pdesc *pd) +{ + struct sctp_chunkhdr ch = { }; + int chunk_off = sizeof(struct sctphdr); + int chunk_start; + + while (off + chunk_off < pd->tot_len) { + if (!pf_pull_hdr(m, off + chunk_off, &ch, sizeof(ch), NULL, + NULL, pd->af)) + return (PF_DROP); + + /* Length includes the header, this must be at least 4. */ + if (ntohs(ch.chunk_length) < 4) + return (PF_DROP); + + chunk_start = chunk_off; + chunk_off += roundup(ntohs(ch.chunk_length), 4); + + switch (ch.chunk_type) { + case SCTP_INITIATION: { + struct sctp_init_chunk init; + + if (!pf_pull_hdr(m, off + chunk_start, &init, + sizeof(init), NULL, NULL, pd->af)) + return (PF_DROP); + + /* + * RFC 9620, Section 3.3.2, "The Initiate Tag is allowed to have + * any value except 0." + */ + if (init.init.initiate_tag == 0) + return (PF_DROP); + if (init.init.num_inbound_streams == 0) + return (PF_DROP); + if (init.init.num_outbound_streams == 0) + return (PF_DROP); + if (ntohl(init.init.a_rwnd) < SCTP_MIN_RWND) + return (PF_DROP); + + /* + * RFC 9260, Section 3.1, INIT chunks MUST have zero + * verification tag. + */ + if (pd->hdr.sctp.v_tag != 0) + return (PF_DROP); + + pd->sctp_flags |= PFDESC_SCTP_INIT; + break; + } + case SCTP_INITIATION_ACK: + pd->sctp_flags |= PFDESC_SCTP_INIT_ACK; + break; + case SCTP_ABORT_ASSOCIATION: + pd->sctp_flags |= PFDESC_SCTP_ABORT; + break; + case SCTP_SHUTDOWN: + case SCTP_SHUTDOWN_ACK: + pd->sctp_flags |= PFDESC_SCTP_SHUTDOWN; + break; + case SCTP_SHUTDOWN_COMPLETE: + pd->sctp_flags |= PFDESC_SCTP_SHUTDOWN_COMPLETE; + break; + case SCTP_COOKIE_ECHO: + case SCTP_COOKIE_ACK: + pd->sctp_flags |= PFDESC_SCTP_COOKIE; + break; + case SCTP_DATA: + pd->sctp_flags |= PFDESC_SCTP_DATA; + break; + default: + pd->sctp_flags |= PFDESC_SCTP_OTHER; + break; + } + } + + /* Validate chunk lengths vs. packet length. */ + if (off + chunk_off != pd->tot_len) + return (PF_DROP); + + /* + * INIT, INIT_ACK or SHUTDOWN_COMPLETE chunks must always be the only + * one in a packet. + */ + if ((pd->sctp_flags & PFDESC_SCTP_INIT) && + (pd->sctp_flags & ~PFDESC_SCTP_INIT)) + return (PF_DROP); + if ((pd->sctp_flags & PFDESC_SCTP_INIT_ACK) && + (pd->sctp_flags & ~PFDESC_SCTP_INIT_ACK)) + return (PF_DROP); + if ((pd->sctp_flags & PFDESC_SCTP_SHUTDOWN_COMPLETE) && + (pd->sctp_flags & ~PFDESC_SCTP_SHUTDOWN_COMPLETE)) + return (PF_DROP); + + return (PF_PASS); +} + +int +pf_normalize_sctp(int dir, struct pfi_kkif *kif, struct mbuf *m, int ipoff, + int off, void *h, struct pf_pdesc *pd) +{ + struct pf_krule *r, *rm = NULL; + struct sctphdr *sh = &pd->hdr.sctp; + u_short reason; + sa_family_t af = pd->af; + int srs; + + PF_RULES_RASSERT(); + + /* Unconditionally scan the SCTP packet, because we need to look for + * things like shutdown and asconf chunks. */ + if (pf_scan_sctp(m, ipoff, off, pd) != PF_PASS) + goto sctp_drop; + + r = TAILQ_FIRST(pf_main_ruleset.rules[PF_RULESET_SCRUB].active.ptr); + /* Check if there any scrub rules. Lack of scrub rules means enforced + * packet normalization operation just like in OpenBSD. */ + srs = (r != NULL); + while (r != NULL) { + pf_counter_u64_add(&r->evaluations, 1); + if (pfi_kkif_match(r->kif, kif) == r->ifnot) + r = r->skip[PF_SKIP_IFP].ptr; + else if (r->direction && r->direction != dir) + r = r->skip[PF_SKIP_DIR].ptr; + else if (r->af && r->af != af) + r = r->skip[PF_SKIP_AF].ptr; + else if (r->proto && r->proto != pd->proto) + r = r->skip[PF_SKIP_PROTO].ptr; + else if (PF_MISMATCHAW(&r->src.addr, pd->src, af, + r->src.neg, kif, M_GETFIB(m))) + r = r->skip[PF_SKIP_SRC_ADDR].ptr; + else if (r->src.port_op && !pf_match_port(r->src.port_op, + r->src.port[0], r->src.port[1], sh->src_port)) + r = r->skip[PF_SKIP_SRC_PORT].ptr; + else if (PF_MISMATCHAW(&r->dst.addr, pd->dst, af, + r->dst.neg, NULL, M_GETFIB(m))) + r = r->skip[PF_SKIP_DST_ADDR].ptr; + else if (r->dst.port_op && !pf_match_port(r->dst.port_op, + r->dst.port[0], r->dst.port[1], sh->dest_port)) + r = r->skip[PF_SKIP_DST_PORT].ptr; + else { + rm = r; + break; + } + } + + if (srs) { + /* With scrub rules present SCTP normalization happens only + * if one of rules has matched and it's not a "no scrub" rule */ + if (rm == NULL || rm->action == PF_NOSCRUB) + return (PF_PASS); + + pf_counter_u64_critical_enter(); + pf_counter_u64_add_protected(&r->packets[dir == PF_OUT], 1); + pf_counter_u64_add_protected(&r->bytes[dir == PF_OUT], pd->tot_len); + pf_counter_u64_critical_exit(); + } + + /* Verify we're a multiple of 4 bytes long */ + if ((pd->tot_len - off - sizeof(struct sctphdr)) % 4) + goto sctp_drop; + + /* INIT chunk needs to be the only chunk */ + if (pd->sctp_flags & PFDESC_SCTP_INIT) + if (pd->sctp_flags & ~PFDESC_SCTP_INIT) + goto sctp_drop; + + return (PF_PASS); + +sctp_drop: + REASON_SET(&reason, PFRES_NORM); + if (rm != NULL && r->log) + PFLOG_PACKET(kif, m, AF_INET, reason, r, NULL, NULL, pd, + 1); + + return (PF_DROP); +} + #ifdef INET void pf_scrub_ip(struct mbuf **m0, struct pf_pdesc *pd) From nobody Fri Jul 21 10:32:39 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6m8l2d5sz4pG4v; Fri, 21 Jul 2023 10:32: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 4R6m8l1pJ8z3q31; Fri, 21 Jul 2023 10:32:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689935559; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HHVI0Ze1OfcD3Z1PX87LIRRer+tFZWueKfEVXMEp5rI=; b=bx5QNAJGw0HsZ3+XUZfFTvUtOk38h3DYZ/2Z/GrZtvxN9fQfG8lr3rXIquWt8fJeAOp9PW uNvUZEMO/lPHh72dCIdfXKzPcOrNowkjKmYuN8KSbYOd8YH4HwVpx6vRnSZVAjEAzun/ZH lPK2LVKYDx2esC3jtI6CsWtv2q/4fgZ2mt+yNf2BhHq2C55Qzzc9xMP8xOyenH0ZN3UV0j s04cAJKySuE7kPwDXkdNoIBAgFx5KDv+C+iYJkPMq2Zwi8BP+z/NNUgBtLYN2gmPoVma+P XLrdj/SXgMSqDvA2drIh0SKOfCWWFrS+Y/2+M2B+OWxp35Id3q6LEE5bBac8Fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689935559; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HHVI0Ze1OfcD3Z1PX87LIRRer+tFZWueKfEVXMEp5rI=; b=Wyiwbi773bgt3SI/UNoVAd2Ml3roUICCKJYLDsJYXD5P2ihb2zD/SyGqfWB9+c85NLWF4O chHXZloK+5plvAo8Kp184BfXlmFdkcMjuyMC2q6ge6fkyNoe0GmgpAld6NMMeiRcdLe1Kr 4YLIAhhVn7RFC1piuWV5MUwlxJ5VLyxUixsMMpPaWzl21W39POMYLOPracLA0HLPu/mx77 NRnv/Hrle09ZHsjFj/opTlhk+YQ6KoIKP9LADKOI188DUqZG16PRfC9RzQTCSjWJrD5RuF H/nWoFY3yGSFGMrlxl+u7H/MfGHQqx3XnMWaY8o9OSxDsQlKxHmgko4OVYR02w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689935559; a=rsa-sha256; cv=none; b=mP6XjDjymsOd6qObOTvuSWgjeVUAUDIDiqAZzQZMyAa1vXofPMM+eujMdoq/a9eYhqg9Vs YX9JSpKWdM32M3mfflmkzBAEIbo1C/c/CvTKgf72Pdpq1OKwKg125sSbbiIgsmLhuenU5u ySrcWFyVdUnO6ca42yWOjvryYW+68PmPQRdPOjk1WR7Vdw3t4XjgzXPqZVY35dbV702Zba /jmV+NWClrSNuzxtyxsC4Dw4rlXIwc3kIHGOBlv+5RfkPmR7UanbLForrdujEHFoliLxLg /fh9yiq86oImra+oSuYd1fXrK+3bPQ/e9DX1j3V3mxQzwB4nFyHl4JRzWWJD+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 4R6m8l0vgqz183n; Fri, 21 Jul 2023 10:32: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 36LAWdHd010533; Fri, 21 Jul 2023 10:32:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36LAWd93010532; Fri, 21 Jul 2023 10:32:39 GMT (envelope-from git) Date: Fri, 21 Jul 2023 10:32:39 GMT Message-Id: <202307211032.36LAWd93010532@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 953634737939 - main - pf tests: basic SCTP connection test List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 95363473793986eeecf19f7ed78d05f25cfa7b87 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=95363473793986eeecf19f7ed78d05f25cfa7b87 commit 95363473793986eeecf19f7ed78d05f25cfa7b87 Author: Kristof Provost AuthorDate: 2023-04-27 09:13:40 +0000 Commit: Kristof Provost CommitDate: 2023-07-21 10:32:18 +0000 pf tests: basic SCTP connection test pf can now inspect SCTP. Check that we can set up a connection. IPv4 and IPv6 tests. MFC after: 3 weeks Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D40863 --- tests/sys/netpfil/pf/Makefile | 1 + tests/sys/netpfil/pf/sctp.sh | 190 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 191 insertions(+) diff --git a/tests/sys/netpfil/pf/Makefile b/tests/sys/netpfil/pf/Makefile index 8e923b6971b8..19c87486d8bb 100644 --- a/tests/sys/netpfil/pf/Makefile +++ b/tests/sys/netpfil/pf/Makefile @@ -31,6 +31,7 @@ ATF_TESTS_SH+= altq \ rules_counter \ scrub_compat \ scrub_pass \ + sctp \ set_skip \ set_tos \ src_track \ diff --git a/tests/sys/netpfil/pf/sctp.sh b/tests/sys/netpfil/pf/sctp.sh new file mode 100644 index 000000000000..5064fe316e5e --- /dev/null +++ b/tests/sys/netpfil/pf/sctp.sh @@ -0,0 +1,190 @@ +# $FreeBSD$ +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright © 2023 Orange Business Services +# +# 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. + +. $(atf_get_srcdir)/utils.subr + +sctp_init() +{ + pft_init + if ! kldstat -q -m sctp; then + atf_skip "This test requires SCTP" + fi +} + +atf_test_case "basic_v4" "cleanup" +basic_v4_head() +{ + atf_set descr 'Basic SCTP connection over IPv4 passthrough' + atf_set require.user root +} + +basic_v4_body() +{ + sctp_init + + j="sctp:basic_v4" + epair=$(vnet_mkepair) + + vnet_mkjail ${j}a ${epair}a + vnet_mkjail ${j}b ${epair}b + + jexec ${j}a ifconfig ${epair}a 192.0.2.1/24 up + jexec ${j}b ifconfig ${epair}b 192.0.2.2/24 up + # Sanity check + atf_check -s exit:0 -o ignore \ + jexec ${j}a ping -c 1 192.0.2.2 + + jexec ${j}a pfctl -e + pft_set_rules ${j}a \ + "block" \ + "pass in proto sctp to port 1234" + + echo "foo" | jexec ${j}a nc --sctp -N -l 1234 & + + # Wait for the server to start + sleep 1 + + out=$(jexec ${j}b nc --sctp -N -w 3 192.0.2.1 1234) + if [ "$out" != "foo" ]; then + atf_fail "SCTP connection failed" + fi + + # Now with scrub rules present, so normalization is done + pft_set_rules ${j}a \ + "scrub on ${j}a" \ + "block" \ + "pass in proto sctp to port 1234" + + echo "foo" | jexec ${j}a nc --sctp -N -l 1234 & + sleep 1 + + out=$(jexec ${j}b nc --sctp -N -w 3 192.0.2.1 1234) + if [ "$out" != "foo" ]; then + atf_fail "SCTP connection failed" + fi + + # Now fail with a blocked port + echo "foo" | jexec ${j}a nc --sctp -N -l 1235 & + sleep 1 + + out=$(jexec ${j}b nc --sctp -N -w 3 192.0.2.1 1235) + if [ "$out" == "foo" ]; then + atf_fail "SCTP port block failed" + fi + + # Now fail with a blocked port but passing source port + out=$(jexec ${j}b nc --sctp -N -w 3 -p 1234 192.0.2.1 1235) + if [ "$out" == "foo" ]; then + atf_fail "SCTP port block failed" + fi +} + +basic_v4_cleanup() +{ + pft_cleanup +} + +atf_test_case "basic_v6" "cleanup" +basic_v6_head() +{ + atf_set descr 'Basic SCTP connection over IPv6' + atf_set require.user root +} + +basic_v6_body() +{ + sctp_init + + j="sctp:basic_v6" + epair=$(vnet_mkepair) + + vnet_mkjail ${j}a ${epair}a + vnet_mkjail ${j}b ${epair}b + + jexec ${j}a ifconfig ${epair}a inet6 2001:db8::a/64 up no_dad + jexec ${j}b ifconfig ${epair}b inet6 2001:db8::b/64 up no_dad + + # Sanity check + atf_check -s exit:0 -o ignore \ + jexec ${j}a ping -6 -c 1 2001:db8::b + + jexec ${j}a pfctl -e + pft_set_rules ${j}a \ + "block proto sctp" \ + "pass in proto sctp to port 1234" + + echo "foo" | jexec ${j}a nc -6 --sctp -N -l 1234 & + + # Wait for the server to start + sleep 1 + + out=$(jexec ${j}b nc --sctp -N -w 3 2001:db8::a 1234) + if [ "$out" != "foo" ]; then + atf_fail "SCTP connection failed" + fi + + # Now with scrub rules present, so normalization is done + pft_set_rules ${j}a \ + "scrub on ${j}a" \ + "block proto sctp" \ + "pass in proto sctp to port 1234" + + echo "foo" | jexec ${j}a nc -6 --sctp -N -l 1234 & + sleep 1 + + out=$(jexec ${j}b nc --sctp -N -w 3 2001:db8::a 1234) + if [ "$out" != "foo" ]; then + atf_fail "SCTP connection failed" + fi + + # Now fail with a blocked port + echo "foo" | jexec ${j}a nc -6 --sctp -N -l 1235 & + sleep 1 + + out=$(jexec ${j}b nc --sctp -N -w 3 2001:db8::a 1235) + if [ "$out" == "foo" ]; then + atf_fail "SCTP port block failed" + fi + + # Now fail with a blocked port but passing source port + out=$(jexec ${j}b nc --sctp -N -w 3 -p 1234 2001:db8::a 1235) + if [ "$out" == "foo" ]; then + atf_fail "SCTP port block failed" + fi +} + +basic_v6_cleanup() +{ + pft_cleanup +} + + +atf_init_test_cases() +{ + atf_add_test_case "basic_v4" + atf_add_test_case "basic_v6" +} From nobody Fri Jul 21 10:32:43 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6m8v4cqDz4pG7M; Fri, 21 Jul 2023 10:32: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 4R6m8q5htTz3qSF; Fri, 21 Jul 2023 10:32:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689935563; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/1WVKJvcjQ7LdxavE/jnsi2LGXOZSW6GP9jR0fn+KUk=; b=DlTMjluUg/nfsZ8LCgjJiCZWuAtr6XpS33M5kZgV2iCKXscUxBCZflctcX+4ZcRkvLG+Ip 0HOfnxMAWCjW9BM6yufxsFE6O+8/z0FAVkKggEN7t/ghuR5yh+Tyr86Dnnu1cbEHQBewxY TF7vzLdYAMCiq7AJBYD9TWa868KXg8H+Kij3Z53nkpz3lH0fK+G58dRthycYv3A5+4EjOm 1VX0B3sBfWZUf9ni0vGcKRaUm7GbYk2fQwBqy8JacqaVJvECK8cFD2YgTYJOqwwtpEtD4w 1F9REOFZGKbXFpToSj++PPpfzFrTb0K1RNFZYoY3+xwOxPukKRfO4Kil/LBY0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689935563; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/1WVKJvcjQ7LdxavE/jnsi2LGXOZSW6GP9jR0fn+KUk=; b=eUszE6Le0LPrLHcSUbqMkmVAIIwSQJBH1TU/6ZExq/BNCEvTw4TYAKg7+O0jFwGol8QjWj icMeWZhC/g6UbQYmDJODQRBBc1x6atXf5LL1OedwgXnC6LQq60zk2Ngg116d48JAUJ9L2o 0rAn+ykkksCMS9cditvIkGxWH16qcuDnvu/bVv66mXAPyUXb81fVXL/bTY6RhHRJ8+Zrz4 ITAzTkX8XJX0RBM97/lBO0AyqUR9cur6F7jGkUROhvrrLU7rW8/YRDUuOUMvsT9O0eVxDh GGGxBby+E7qV5TKQkCWe1I0IC6ZADzrgPY/BWgfgrrE+fmu94rlfdBLfZQ0jdQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689935563; a=rsa-sha256; cv=none; b=iXUvPjqJwfA+tvk9ze2FqZqs6RTqP5AhBwVh2aYmvPN6vxiqbQw6JHeoi7ecx8FSMMsSxD SALbv4c2rtGQQS6FDk6IbnRICUjgFkFKJxA9oHc3yKYIbnPvBSK2mP+AExp/HDQBTeXhoO 5qi6HQgPFLfOs/e0nv9pyrid7eKMs4Gwglg1cKG21ypK7hoq+fpCvU9P8weHWZBBHpR46l E59EyB8oyYKnMUqphQm6l5oiSeXIVh7oPwkLsb0Sf9TqwIXhBQ8KVau3B4Ji6ZsxbRMrKB 3I/RGIaDAHtmz4Ggz1aH9i6PA1sI8g7Ht1fZxnkpSUHC+GYKl14H6NToQi2rYw== 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 4R6m8q4KCLz18Cv; Fri, 21 Jul 2023 10:32: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 36LAWhJh010615; Fri, 21 Jul 2023 10:32:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36LAWhbj010614; Fri, 21 Jul 2023 10:32:43 GMT (envelope-from git) Date: Fri, 21 Jul 2023 10:32:43 GMT Message-Id: <202307211032.36LAWhbj010614@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 1e02b7cb07ce - main - pf tests: test SCTP NAT List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1e02b7cb07ce31ad3c9e8c8be806d2825febb5ab Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=1e02b7cb07ce31ad3c9e8c8be806d2825febb5ab commit 1e02b7cb07ce31ad3c9e8c8be806d2825febb5ab Author: Kristof Provost AuthorDate: 2023-06-01 13:28:58 +0000 Commit: Kristof Provost CommitDate: 2023-07-21 10:32:19 +0000 pf tests: test SCTP NAT MFC after: 3 weeks Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D40867 --- tests/sys/netpfil/pf/sctp.sh | 106 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) diff --git a/tests/sys/netpfil/pf/sctp.sh b/tests/sys/netpfil/pf/sctp.sh index 59697ad37be2..659c11c62113 100644 --- a/tests/sys/netpfil/pf/sctp.sh +++ b/tests/sys/netpfil/pf/sctp.sh @@ -298,10 +298,116 @@ abort_v4_cleanup() pft_cleanup } +atf_test_case "nat_v4" "cleanup" +nat_v4_head() +{ + atf_set descr 'Test NAT-ing SCTP over IPv4' + atf_set require.user root +} + +nat_v4_body() +{ + sctp_init + + j="sctp:nat_v4" + epair_c=$(vnet_mkepair) + epair_srv=$(vnet_mkepair) + + vnet_mkjail ${j}srv ${epair_srv}a + vnet_mkjail ${j}gw ${epair_srv}b ${epair_c}a + vnet_mkjail ${j}c ${epair_c}b + + jexec ${j}srv ifconfig ${epair_srv}a 198.51.100.1/24 up + # No default route in srv jail, to ensure we're NAT-ing + jexec ${j}gw ifconfig ${epair_srv}b 198.51.100.2/24 up + jexec ${j}gw ifconfig ${epair_c}a 192.0.2.1/24 up + jexec ${j}gw sysctl net.inet.ip.forwarding=1 + jexec ${j}c ifconfig ${epair_c}b 192.0.2.2/24 up + jexec ${j}c route add default 192.0.2.1 + + jexec ${j}gw pfctl -e + pft_set_rules ${j}gw \ + "nat on ${epair_srv}b from 192.0.2.0/24 -> (${epair_srv}b)" \ + "pass" + + # Sanity check + atf_check -s exit:0 -o ignore \ + jexec ${j}c ping -c 1 198.51.100.1 + + echo "foo" | jexec ${j}srv nc --sctp -N -l 1234 & + + # Wait for the server to start + sleep 1 + + out=$(jexec ${j}c nc --sctp -N -w 3 198.51.100.1 1234) + if [ "$out" != "foo" ]; then + atf_fail "SCTP connection failed" + fi +} + +nat_v4_cleanup() +{ + pft_cleanup +} + +atf_test_case "nat_v6" "cleanup" +nat_v6_head() +{ + atf_set descr 'Test NAT-ing SCTP over IPv6' + atf_set require.user root +} + +nat_v6_body() +{ + sctp_init + + j="sctp:nat_v6" + epair_c=$(vnet_mkepair) + epair_srv=$(vnet_mkepair) + + vnet_mkjail ${j}srv ${epair_srv}a + vnet_mkjail ${j}gw ${epair_srv}b ${epair_c}a + vnet_mkjail ${j}c ${epair_c}b + + jexec ${j}srv ifconfig ${epair_srv}a inet6 2001:db8::1/64 up no_dad + # No default route in srv jail, to ensure we're NAT-ing + jexec ${j}gw ifconfig ${epair_srv}b inet6 2001:db8::2/64 up no_dad + jexec ${j}gw ifconfig ${epair_c}a inet6 2001:db8:1::1/64 up no_dad + jexec ${j}gw sysctl net.inet6.ip6.forwarding=1 + jexec ${j}c ifconfig ${epair_c}b inet6 2001:db8:1::2/64 up no_dad + jexec ${j}c route add -6 default 2001:db8:1::1 + + jexec ${j}gw pfctl -e + pft_set_rules ${j}gw \ + "nat on ${epair_srv}b from 2001:db8:1::/64 -> (${epair_srv}b)" \ + "pass" + + # Sanity check + atf_check -s exit:0 -o ignore \ + jexec ${j}c ping -6 -c 1 2001:db8::1 + + echo "foo" | jexec ${j}srv nc -6 --sctp -N -l 1234 & + + # Wait for the server to start + sleep 1 + + out=$(jexec ${j}c nc --sctp -N -w 3 2001:db8::1 1234) + if [ "$out" != "foo" ]; then + atf_fail "SCTP connection failed" + fi +} + +nat_v6_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "basic_v4" atf_add_test_case "basic_v6" atf_add_test_case "abort_v4" atf_add_test_case "abort_v6" + atf_add_test_case "nat_v4" + atf_add_test_case "nat_v6" } From nobody Fri Jul 21 10:32:40 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6m8n53lMz4pFp5; Fri, 21 Jul 2023 10:32: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 4R6m8m2cMPz3qMD; Fri, 21 Jul 2023 10:32:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689935560; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BgJAB0J5Tioq0JVGYZATG1mYPCn/Fcvf9g4AYupAqIk=; b=HKm7TaTa746kgGlu3i4ylmenCwvdB4mqxchgDFgbUSg7RgQI/oVqM4HbSSI/GyrB8E36Ux zhDLh+Nca08EiBN/l8JvD/Lhi3O24oAOt62/OeN8kQZwYWEGwJTEr2aLUwnT2oUXJ6omqK wDNLZA9A3yZofl+di4i8VXk5famMH61fGYUg7TGDxfKviZh3kFk2EGqwxK/IwstkZmFe6a kF1GfwrYsPmqswEJ+Vm82hqutIeC8C+VVjmlWKaganRZpzjZwQWRf4yp/RohlBl+ParZh6 mPW9Y0gPJJT2MFWfhhAiNXr90uwfVxhF2yuuM7ivRSV9gJicLrtSJa/cZGkAtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689935560; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BgJAB0J5Tioq0JVGYZATG1mYPCn/Fcvf9g4AYupAqIk=; b=WAA15pBl2WG87jowPJCJL2ZAmLscgaeR30Uh3cz7cZLiwh8nMy+mKtunh06th+xk4oP0wt WTXrsmH3NTJeQFIfB8KiFqipAgGYMe9IYqQUku3hJ4gMPVTLx84JEuke+uSgcoXdhIV++q 6TihJaKcbMqe2o8jgVUKynl3RFk2ddTRpj88GEv0tBlvdIWjZLmWycdi+k1YSr5q3e11K8 eTv8a0QbUYL6xUueIziB8K07veteQU2qOA+PtPE2egNJBNsScWLo6ovwKhkJOqQD0y8XdR qxK4pPjMPTcrq4QurzLglMUECxdz7f/LniHz8VIU07czpaFGARst0Vhxx3w4jg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689935560; a=rsa-sha256; cv=none; b=sCS6nekJ1kAr7RaTeOHTlx6OqCd7u0K9FI36x3EO42NQEacyNXC+CpyJMGTT78dYuBZBQG Mk31XN+zMS5zfY3niwXohOF+wfv8B1+wq/UZ7iYAAaLb5ZAt3/tEw9rieUATk3y4mAHLPx 1NDFQ0sGcXY2Z4ca4ctpnhDsE/+n44ShHz9Huit9Zy/w4gPok4opcB0i08OJGRYWQrUyxd D/AM8+jNwWSPh671cS58xu8pQJBlYB/y8uXBiDpRRQCWp3AIftEJQ8ppB3LnEs5EPKsbEr pTGFuXgaZYUJXJT6kYLNwcJhF0TiP3MvWxBXso8VcC1+mQsyqsp5nUWuav9IBQ== 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 4R6m8m1THCz18Ct; Fri, 21 Jul 2023 10:32: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 36LAWeXR010552; Fri, 21 Jul 2023 10:32:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36LAWeBL010551; Fri, 21 Jul 2023 10:32:40 GMT (envelope-from git) Date: Fri, 21 Jul 2023 10:32:40 GMT Message-Id: <202307211032.36LAWeBL010551@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: d1bc1e9e1ae0 - main - pf: support 'return' for SCTP List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d1bc1e9e1ae04016e16154884914d839566ebaec Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=d1bc1e9e1ae04016e16154884914d839566ebaec commit d1bc1e9e1ae04016e16154884914d839566ebaec Author: Kristof Provost AuthorDate: 2023-05-31 14:03:39 +0000 Commit: Kristof Provost CommitDate: 2023-07-21 10:32:18 +0000 pf: support 'return' for SCTP Send an SCTP Abort message if we're refusing a connection, just like we send a RST for TCP. MFC after: 3 weeks Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D40864 --- sys/net/pfvar.h | 1 + sys/netpfil/pf/pf.c | 117 +++++++++++++++++++++++++++++++++++++++++++++++ sys/netpfil/pf/pf_norm.c | 2 + 3 files changed, 120 insertions(+) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 86e15f7c1709..f0fe15a5e9ee 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -1581,6 +1581,7 @@ struct pf_pdesc { #define PFDESC_SCTP_DATA 0x0040 #define PFDESC_SCTP_OTHER 0x0080 u_int16_t sctp_flags; + u_int32_t sctp_initiate_tag; }; #endif diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index a721385f761f..70a00147ccf2 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -2960,6 +2960,120 @@ pf_build_tcp(const struct pf_krule *r, sa_family_t af, return (m); } +static void +pf_send_sctp_abort(sa_family_t af, struct pf_pdesc *pd, + uint8_t ttl, int rtableid) +{ + struct mbuf *m; +#ifdef INET + struct ip *h = NULL; +#endif /* INET */ +#ifdef INET6 + struct ip6_hdr *h6 = NULL; +#endif /* INET6 */ + struct sctphdr *hdr; + struct sctp_chunkhdr *chunk; + struct pf_send_entry *pfse; + int off = 0; + + MPASS(af == pd->af); + + m = m_gethdr(M_NOWAIT, MT_DATA); + if (m == NULL) + return; + + m->m_data += max_linkhdr; + m->m_flags |= M_SKIP_FIREWALL; + /* The rest of the stack assumes a rcvif, so provide one. + * This is a locally generated packet, so .. close enough. */ + m->m_pkthdr.rcvif = V_loif; + + /* IPv4|6 header */ + switch (af) { +#ifdef INET + case AF_INET: + bzero(m->m_data, sizeof(struct ip) + sizeof(*hdr) + sizeof(*chunk)); + + h = mtod(m, struct ip *); + + /* IP header fields included in the TCP checksum */ + + h->ip_p = IPPROTO_SCTP; + h->ip_len = htons(sizeof(*h) + sizeof(*hdr) + sizeof(*chunk)); + h->ip_ttl = ttl ? ttl : V_ip_defttl; + h->ip_src = pd->dst->v4; + h->ip_dst = pd->src->v4; + + off += sizeof(struct ip); + break; +#endif /* INET */ +#ifdef INET6 + case AF_INET6: + bzero(m->m_data, sizeof(struct ip6_hdr) + sizeof(*hdr) + sizeof(*chunk)); + + h6 = mtod(m, struct ip6_hdr *); + + /* IP header fields included in the TCP checksum */ + h6->ip6_vfc |= IPV6_VERSION; + h6->ip6_nxt = IPPROTO_SCTP; + h6->ip6_plen = htons(sizeof(*h6) + sizeof(*hdr) + sizeof(*chunk)); + h6->ip6_hlim = ttl ? ttl : V_ip6_defhlim; + memcpy(&h6->ip6_src, &pd->dst->v6, sizeof(struct in6_addr)); + memcpy(&h6->ip6_dst, &pd->src->v6, sizeof(struct in6_addr)); + + off += sizeof(struct ip6_hdr); + break; +#endif /* INET6 */ + } + + /* SCTP header */ + hdr = mtodo(m, off); + + hdr->src_port = pd->hdr.sctp.dest_port; + hdr->dest_port = pd->hdr.sctp.src_port; + hdr->v_tag = pd->sctp_initiate_tag; + hdr->checksum = 0; + + /* Abort chunk. */ + off += sizeof(struct sctphdr); + chunk = mtodo(m, off); + + chunk->chunk_type = SCTP_ABORT_ASSOCIATION; + chunk->chunk_length = htons(sizeof(*chunk)); + + /* SCTP checksum */ + off += sizeof(*chunk); + m->m_pkthdr.len = m->m_len = off; + + pf_sctp_checksum(m, off - sizeof(*hdr) - sizeof(*chunk));; + + if (rtableid >= 0) + M_SETFIB(m, rtableid); + + /* Allocate outgoing queue entry, mbuf and mbuf tag. */ + pfse = malloc(sizeof(*pfse), M_PFTEMP, M_NOWAIT); + if (pfse == NULL) { + m_freem(m); + return; + } + + switch (af) { +#ifdef INET + case AF_INET: + pfse->pfse_type = PFSE_IP; + break; +#endif /* INET */ +#ifdef INET6 + case AF_INET6: + pfse->pfse_type = PFSE_IP6; + break; +#endif /* INET6 */ + } + + pfse->pfse_m = m; + pf_send(pfse); +} + void pf_send_tcp(const struct pf_krule *r, sa_family_t af, const struct pf_addr *saddr, const struct pf_addr *daddr, @@ -3063,6 +3177,9 @@ pf_return(struct pf_krule *r, struct pf_krule *nr, struct pf_pdesc *pd, ntohl(th->th_ack), ack, TH_RST|TH_ACK, 0, 0, r->return_ttl, true, 0, 0, rtableid); } + } else if (pd->proto == IPPROTO_SCTP && + (r->rule_flag & PFRULE_RETURN)) { + pf_send_sctp_abort(af, pd, r->return_ttl, rtableid); } else if (pd->proto != IPPROTO_ICMP && af == AF_INET && r->return_icmp) pf_send_icmp(m, r->return_icmp >> 8, diff --git a/sys/netpfil/pf/pf_norm.c b/sys/netpfil/pf/pf_norm.c index 38312712a0ad..6dda410d8327 100644 --- a/sys/netpfil/pf/pf_norm.c +++ b/sys/netpfil/pf/pf_norm.c @@ -2065,6 +2065,8 @@ pf_scan_sctp(struct mbuf *m, int ipoff, int off, struct pf_pdesc *pd) if (pd->hdr.sctp.v_tag != 0) return (PF_DROP); + pd->sctp_initiate_tag = init.init.initiate_tag; + pd->sctp_flags |= PFDESC_SCTP_INIT; break; } From nobody Fri Jul 21 10:32:41 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6m8v4gh4z4pG7N; Fri, 21 Jul 2023 10:32: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 4R6m8n706jz3qSB; Fri, 21 Jul 2023 10:32:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689935562; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BByRj/jWOVSrRxNzc/OEiA2UzjTIAb7lCtVvyGqVTxs=; b=ffdtnAq7a9wAt+GYUILJYbMNpVMXS7gNXsPJrwDyTnwL6EQD7Qb3rOCVKvCo5q20o3cHJ4 UJ3sQ5a+4TUIwgfO3bC+cDNsMGh9cBa8uHjpdNNLXkJCPAa8ZK5n22a58VrOsE/PGSPVUN DY+LRs5vskiOxjaWYd4gnIlLn/JIDceelus+OZCDhP6yJhgH6R5CcXvJ5KnvVaZKiYGRqu OS/9myBPEB8984YI5Kb7YXlpsDHxz+9djgWtJ5hFWrc5mkEk63Kgo2EShW0QCVdvxkTKm6 r5LvwR1xzA9kcM9AxO9X09d3d2q4TPLp066GjJ2gmzybfNv79otkzLyCZ/qULA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689935562; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BByRj/jWOVSrRxNzc/OEiA2UzjTIAb7lCtVvyGqVTxs=; b=YrP+9yhbSDED2q8wIi6Wf62/btocXu4TAJug+2smNPLqFDJ2z6XeWfQgm02qvayr4rbhcb PaY3nLt31lPaGEXrLSyeLSXqmDEUKXskwbvisje9CLr4t4dKsW3ahBFPFvlAY640BJXrZP rkkN/UOvPoGq9+23TZi54Wa2+qzkV/MIcGoSiA9M6+vzQuW+/gLnvnduuSadI7Cyjy0o1D glU7K6Mys0V0mELecmeZtQzKYbRHrzF9oh4UAneQk1P/3QE0r+Rrg9r8rg2qQSJIx93mCQ EekBDtpcmV1IjTxEaTknnh5vlKrewj6PxI3DE//uM0+KhZyRiMlO4TA1rM1Egw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689935562; a=rsa-sha256; cv=none; b=gejsZ8wDG6+tVwQefSSYLfQ49mqe9IQSuL66sVi69MTM77PkgTV7I8U3crNZTOCOAR6QuG CAozMHzihEGcU3IQfp8B9j5ujkF1bPABjfU2EpeaZYFZcL72wRDFSDS8ngiV6Rz5WPuOXD vClsVykBmx631ZIVBC5MHcYV52rcMVz+IqNEs8DUPqUE/n6oxP0WnSNzZDkEIojM6ZjH8u rs1URgEEY1LISKtM5JnyBG+MvbntaMNgnteCghyJs9SGZQ80erM4+di6czqbRuJb0AvhAf k2dLDnstWurgOsRRVJqn74bzq+pCNY46dkXJ7pFM25eSQ96imeatqV40KBrQrA== 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 4R6m8n565xz18Tb; Fri, 21 Jul 2023 10:32: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 36LAWf5A010573; Fri, 21 Jul 2023 10:32:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36LAWfMC010572; Fri, 21 Jul 2023 10:32:41 GMT (envelope-from git) Date: Fri, 21 Jul 2023 10:32:41 GMT Message-Id: <202307211032.36LAWfMC010572@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 2d42aa9d7ba6 - main - pf tests: test SCTP 'return' List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2d42aa9d7ba64fe7166f76234a595637f0c212cf Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=2d42aa9d7ba64fe7166f76234a595637f0c212cf commit 2d42aa9d7ba64fe7166f76234a595637f0c212cf Author: Kristof Provost AuthorDate: 2023-05-31 19:45:29 +0000 Commit: Kristof Provost CommitDate: 2023-07-21 10:32:18 +0000 pf tests: test SCTP 'return' Ensure that we send a correct abort message for 'block return' rules. Test this by validating that nc doesn't sit around waiting for a connection. It should give up immediately when it receives the abort. MFC after: 3 weeks Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D40865 --- tests/sys/netpfil/pf/sctp.sh | 117 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 117 insertions(+) diff --git a/tests/sys/netpfil/pf/sctp.sh b/tests/sys/netpfil/pf/sctp.sh index 5064fe316e5e..59697ad37be2 100644 --- a/tests/sys/netpfil/pf/sctp.sh +++ b/tests/sys/netpfil/pf/sctp.sh @@ -182,9 +182,126 @@ basic_v6_cleanup() pft_cleanup } +atf_test_case "abort_v4" "cleanup" +abort_v4_head() +{ + atf_set descr 'Test sending ABORT messages' + atf_set require.user root +} + +abort_v4_body() +{ + sctp_init + + j="sctp:abort_v4" + epair=$(vnet_mkepair) + + vnet_mkjail ${j}a ${epair}a + vnet_mkjail ${j}b ${epair}b + + jexec ${j}a ifconfig ${epair}a 192.0.2.1/24 up + jexec ${j}b ifconfig ${epair}b 192.0.2.2/24 up + + # Sanity check + atf_check -s exit:0 -o ignore \ + jexec ${j}a ping -c 1 192.0.2.2 + + jexec ${j}a pfctl -e + pft_set_rules ${j}a \ + "block return in proto sctp to port 1234" + + echo "foo" | jexec ${j}a nc --sctp -N -l 1234 & + + # Wait for the server to start + sleep 1 + + # If we get the abort we'll exit immediately, if we don't timeout will + # stop nc. + out=$(jexec ${j}b timeout 3 nc --sctp -N 192.0.2.1 1234) + if [ $? -eq 124 ]; then + atf_fail 'Abort not received' + fi + if [ "$out" == "foo" ]; then + atf_fail "block failed entirely" + fi + + # Without 'return' we will time out. + pft_set_rules ${j}a \ + "block in proto sctp to port 1234" + + out=$(jexec ${j}b timeout 3 nc --sctp -N 192.0.2.1 1234) + if [ $? -ne 124 ]; then + atf_fail 'Abort sent anyway?' + fi +} + +abort_v4_cleanup() +{ + pft_cleanup +} + +atf_test_case "abort_v6" "cleanup" +abort_v4_head() +{ + atf_set descr 'Test sending ABORT messages over IPv6' + atf_set require.user root +} + +abort_v6_body() +{ + sctp_init + + j="sctp:abort_v6" + epair=$(vnet_mkepair) + + vnet_mkjail ${j}a ${epair}a + vnet_mkjail ${j}b ${epair}b + + jexec ${j}a ifconfig ${epair}a inet6 2001:db8::a/64 no_dad + jexec ${j}b ifconfig ${epair}b inet6 2001:db8::b/64 no_dad + + # Sanity check + atf_check -s exit:0 -o ignore \ + jexec ${j}a ping -6 -c 1 2001:db8::b + + jexec ${j}a pfctl -e + pft_set_rules ${j}a \ + "block return in proto sctp to port 1234" + + echo "foo" | jexec ${j}a nc -6 --sctp -N -l 1234 & + + # Wait for the server to start + sleep 1 + + # If we get the abort we'll exit immediately, if we don't timeout will + # stop nc. + out=$(jexec ${j}b timeout 3 nc --sctp -N 2001:db8::a 1234) + if [ $? -eq 124 ]; then + atf_fail 'Abort not received' + fi + if [ "$out" == "foo" ]; then + atf_fail "block failed entirely" + fi + + # Without 'return' we will time out. + pft_set_rules ${j}a \ + "block in proto sctp to port 1234" + + out=$(jexec ${j}b timeout 3 nc --sctp -N 2001:db8::a 1234) + if [ $? -ne 124 ]; then + atf_fail 'Abort sent anyway?' + fi +} + +abort_v4_cleanup() +{ + pft_cleanup +} atf_init_test_cases() { atf_add_test_case "basic_v4" atf_add_test_case "basic_v6" + atf_add_test_case "abort_v4" + atf_add_test_case "abort_v6" } From nobody Fri Jul 21 10:32:42 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6m8v4ggwz4pFvP; Fri, 21 Jul 2023 10:32: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 4R6m8p4NvTz3qSC; Fri, 21 Jul 2023 10:32:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689935562; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MT0gV93MqexUBEnfmWwSQLyNsGCLt0qa5x2lHMfKPT8=; b=gMTLElFmFQ/NbzN7NzXzDxaZ7P0fD7QbCXFiipKP0jd5Qs07RSsIL6lIZ8WxZD7/Mo6jQq txfYIrGY1PBHsEOqht2c7105sMZx0gTABVpefnaTIbuY1haaQpF2v6ygy+/TgTuwjx38V1 mpO6L8Dgw72R5b3RAS4lLWAkf9rzkhw9k9Uf9wd9HXLS3rPfJRr1cWHmN+PzPkuv4CKlyx 0MTzoBbZ+A7No6+uYmChLu8z0qimRJnuy5ncoGyy8hzlxaU0HRy9GqPccAhpkBzDHR9+p4 j7AUOlkKLU9mMaLUxwXLY+ec+0kYPTkoOWqMweMdsI2UPwR0rijAcdW4KlcbLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689935562; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MT0gV93MqexUBEnfmWwSQLyNsGCLt0qa5x2lHMfKPT8=; b=UQ0OssY7nsS1T8O5RCONlF+OEz2VC+tJu1Kr6Sl0iHb28O/xYCK000etsXFTphSspjgPEp SOjR0d4JM9bF1FZRjYWN6y0Av7QBxwFZ3X9Os0JMdMt+sjXwzobO2Eh201gb5BGFNkwKzp mb4nOJajuPxNdB8G5db93gTTGpVTqYAttOyEludRHHOt7vDssEDaZBb5NZq/cII9ufslfF ionbyMtjD+6XwImt/uEyCs5cz3WCBrc08PazJDnykxH6uxrUF0Z3xmJMCoaavf5l64gBU1 knT51+qIcpKR2dgjd/HmX0gjDBK9wARXZE5hShTLhZO1tDhJnWbn+kLILyM40w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689935562; a=rsa-sha256; cv=none; b=ne5FLqdFEey5YTAPfSSVOAgTcvHuzA6RBznbvPf4ue8+LMjORoyXweI2h1HpW4y46y2mCw QMjcR5AJut37vAQqY7Q8l/9VmYc/qafW4arVBiX5DzeZjWxakyJxIndFJHdVaJIPlQxbIG nKbZWTbAHukjYdh+0bjd0WzXlbqcEbuDdDuTHu5GO51WxQlcew+06Nk9LMKcCTfIyL4BV5 esndZChWBQagjw9rU3pWh8plYWYdID0S+ohqPu78H5TOaZTsxMEzisPXV3oDW9v7vk90Zs o2+jz6yfKn2CAUx20oYK1ahvGNPUK5g9Y3+6ZPYleoRdLwS5Sjk4VKTJSRtLCw== 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 4R6m8p36nqz18G7; Fri, 21 Jul 2023 10:32: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 36LAWgQa010596; Fri, 21 Jul 2023 10:32:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36LAWg4A010595; Fri, 21 Jul 2023 10:32:42 GMT (envelope-from git) Date: Fri, 21 Jul 2023 10:32:42 GMT Message-Id: <202307211032.36LAWg4A010595@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 6053adafaa54 - main - pf: add SCTP NAT support List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6053adafaa54204f91c43939fa334bde835403cb Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=6053adafaa54204f91c43939fa334bde835403cb commit 6053adafaa54204f91c43939fa334bde835403cb Author: Kristof Provost AuthorDate: 2023-06-01 13:04:48 +0000 Commit: Kristof Provost CommitDate: 2023-07-21 10:32:19 +0000 pf: add SCTP NAT support Support NAT-ing SCTP connections. This is mostly similar to UDP and TCP, but we refuse to change ports for SCTP, to avoid interfering with multihomed connections. As a result we also never copy the SCTP header back or recalculate checksums as we'd do for TCP or UDP (because we don't modify the header for SCTP). We do use the existing pf_change_ap() function to modify the packet, because we may still need to update the IPv4 header checksum. Reviewed by: tuexen MFC after: 3 weeks Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D40866 --- sys/netpfil/pf/pf.c | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++ sys/netpfil/pf/pf_lb.c | 14 ++++++++++++- 2 files changed, 69 insertions(+), 1 deletion(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 70a00147ccf2..9162f8cf949b 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -528,6 +528,23 @@ pf_packet_rework_nat(struct mbuf *m, struct pf_pdesc *pd, int off, m_copyback(m, off, sizeof(*uh), (caddr_t)uh); break; } + case IPPROTO_SCTP: { + struct sctphdr *sh = &pd->hdr.sctp; + uint16_t checksum = 0; + + if (PF_ANEQ(pd->src, &nk->addr[pd->sidx], pd->af)) { + pf_change_ap(m, pd->src, &sh->src_port, pd->ip_sum, + &checksum, &nk->addr[pd->sidx], + nk->port[pd->sidx], 1, pd->af); + } + if (PF_ANEQ(pd->dst, &nk->addr[pd->didx], pd->af)) { + pf_change_ap(m, pd->dst, &sh->dest_port, pd->ip_sum, + &checksum, &nk->addr[pd->didx], + nk->port[pd->didx], 1, pd->af); + } + + break; + } case IPPROTO_ICMP: { struct icmp *ih = &pd->hdr.icmp; @@ -4472,6 +4489,25 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, struct pfi_kkif *kif, } rewrite++; break; + case IPPROTO_SCTP: { + uint16_t checksum = 0; + + if (PF_ANEQ(saddr, &nk->addr[pd->sidx], af) || + nk->port[pd->sidx] != sport) { + pf_change_ap(m, saddr, &pd->hdr.sctp.src_port, + pd->ip_sum, &checksum, + &nk->addr[pd->sidx], + nk->port[pd->sidx], 1, af); + } + if (PF_ANEQ(daddr, &nk->addr[pd->didx], af) || + nk->port[pd->didx] != dport) { + pf_change_ap(m, daddr, &pd->hdr.sctp.dest_port, + pd->ip_sum, &checksum, + &nk->addr[pd->didx], + nk->port[pd->didx], 1, af); + } + break; + } #ifdef INET case IPPROTO_ICMP: nk->port[0] = nk->port[1]; @@ -5856,6 +5892,26 @@ pf_test_state_sctp(struct pf_kstate **state, struct pfi_kkif *kif, (*state)->expire = time_uptime; + /* translate source/destination address, if necessary */ + if ((*state)->key[PF_SK_WIRE] != (*state)->key[PF_SK_STACK]) { + uint16_t checksum = 0; + struct pf_state_key *nk = (*state)->key[pd->didx]; + + if (PF_ANEQ(pd->src, &nk->addr[pd->sidx], pd->af) || + nk->port[pd->sidx] != pd->hdr.sctp.src_port) { + pf_change_ap(m, pd->src, &pd->hdr.sctp.src_port, + pd->ip_sum, &checksum, &nk->addr[pd->sidx], + nk->port[pd->sidx], 1, pd->af); + } + + if (PF_ANEQ(pd->dst, &nk->addr[pd->didx], pd->af) || + nk->port[pd->didx] != pd->hdr.sctp.dest_port) { + pf_change_ap(m, pd->dst, &pd->hdr.sctp.dest_port, + pd->ip_sum, &checksum, &nk->addr[pd->didx], + nk->port[pd->didx], 1, pd->af); + } + } + return (PF_PASS); } diff --git a/sys/netpfil/pf/pf_lb.c b/sys/netpfil/pf/pf_lb.c index 98e1a2d32488..3055741f1fc0 100644 --- a/sys/netpfil/pf/pf_lb.c +++ b/sys/netpfil/pf/pf_lb.c @@ -240,7 +240,15 @@ pf_get_sport(sa_family_t af, u_int8_t proto, struct pf_krule *r, * port search; start random, step; * similar 2 portloop in in_pcbbind */ - if (!(proto == IPPROTO_TCP || proto == IPPROTO_UDP || + if (proto == IPPROTO_SCTP) { + key.port[1] = sport; + if (!pf_find_state_all_exists(&key, PF_IN)) { + *nport = sport; + return (0); + } else { + return (1); /* Fail mapping. */ + } + } else if (!(proto == IPPROTO_TCP || proto == IPPROTO_UDP || proto == IPPROTO_ICMP) || (low == 0 && high == 0)) { /* * XXX bug: icmp states don't use the id on both sides. @@ -711,6 +719,10 @@ pf_get_translation(struct pf_pdesc *pd, struct mbuf *m, int off, PF_POOLMASK(naddr, naddr, &r->rpool.cur->addr.v.a.mask, daddr, pd->af); + /* Do not change SCTP ports. */ + if (pd->proto == IPPROTO_SCTP) + break; + if (r->rpool.proxy_port[1]) { uint32_t tmp_nport; From nobody Fri Jul 21 10:32:44 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6m8x44wkz4pFxm; Fri, 21 Jul 2023 10:32: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 4R6m8r6JgHz3qGC; Fri, 21 Jul 2023 10:32:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689935564; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qz2gAS2Dd4BefHhpjvC2ORfIWZbakjKbFjsqe6W46ic=; b=u2SOannug5pzaA8d3mMSdSDTG/4vYUqOipygWwum6yPp+o7DX6DxKPPiBJ6eaGcfCjfI2z ixs7Q9dPOdSAOCvgBftqk+oc1g4NZlxfPPVU6E26TLWQs84FUoHAW4DP+2+iv3gS4ma8qQ z4S6vKIKGANZK2UA0DR8zYvBR/XTikjKqp5xV//RZ0X17Xzh65He4WdONJWX/5pj0baCAO bQYHtUXWEDyu1Z55SlIghWw8S3mIo+FF4bmedYqzlNWwGCPRfvjKLbAPxshJc8kWQQY2qg 50gyVjm2gNr/CMbLDxw1BeSfBRqFCKGyd7FeO35g0bIfVgd0vjXs2zXgQ5QZOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689935564; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qz2gAS2Dd4BefHhpjvC2ORfIWZbakjKbFjsqe6W46ic=; b=GYxPdny2+t5alB4O/UWgZ5zGXFelDyTb2QxWHUvqsVku10kP2zW5xpqVxdkVg7+Ml663KC Di8g9lCBLUbY4KwK/bHlTx5wuN93tquwyEkZOIYPEBiwCXPQ5WzGf+4vQAGbQNa8RFH5Us m6hKFlFHoBw+QlXCvvtjWWgYWYxdhQfv38J3/wN2qmEDdYbx94biwwT+mUJ1CocnZDwwOq WmMAIQCAvscs2Pr8fpNWVgM1QnUEFrsK5rtAjBOuBGW/znOAiXOgmDJapwhrDjz314yUgJ 7m74hpj+P4XVMKaQJZC1x7UyCipLnMlBCHkHOiA5M0WnyhzhVFfQ4h/0xqUhSw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689935564; a=rsa-sha256; cv=none; b=aNYwp3SHUibTezJucqsaqAp/+APRXW9Dzstsu5Rl1huevdFgHPl9/edQzcLaUX0G6eXWtu 1YDk8UMIQ11pGFbu/1wn71NpYr4VH8wKZnXhT/u3l4vyhrXQJXIXvHgOU1t75OlpaJd+/R x1MnekW8omjLcd0v/fppQqWS2uTKvdxEvek2EuRKtg24ZxLlaPOlZcRx2qHhH8UPuDxADi w1+/23sgrXB7S3JxBn5dvqmwfV50USIx2XvTC9hUF4eRuSGTA9+5pP+3nMzNfqL+XbyYOV Bk7ABcih/ZAwi1KEWtTEMFdIOZDRPcS3g4Vwhty0hsFOOC9h0xdhTtmoqRhFRw== 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 4R6m8r4ydBz18S0; Fri, 21 Jul 2023 10:32: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 36LAWi9E010635; Fri, 21 Jul 2023 10:32:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36LAWivD010634; Fri, 21 Jul 2023 10:32:44 GMT (envelope-from git) Date: Fri, 21 Jul 2023 10:32:44 GMT Message-Id: <202307211032.36LAWivD010634@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 4369a57514f2 - main - pf tests: test 'rdr' for SCTP List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4369a57514f227c989d4de87d1ce54470279ba41 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=4369a57514f227c989d4de87d1ce54470279ba41 commit 4369a57514f227c989d4de87d1ce54470279ba41 Author: Kristof Provost AuthorDate: 2023-06-01 16:03:07 +0000 Commit: Kristof Provost CommitDate: 2023-07-21 10:32:19 +0000 pf tests: test 'rdr' for SCTP Explicitly test that we cannot change the port number with rdr. That's not a desireable feature on SCTP, because it could break multihomed connections. MFC after: 3 weeks Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D40868 --- tests/sys/netpfil/pf/sctp.sh | 68 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/tests/sys/netpfil/pf/sctp.sh b/tests/sys/netpfil/pf/sctp.sh index 659c11c62113..2c736017f9fa 100644 --- a/tests/sys/netpfil/pf/sctp.sh +++ b/tests/sys/netpfil/pf/sctp.sh @@ -402,6 +402,73 @@ nat_v6_cleanup() pft_cleanup } +atf_test_case "rdr_v4" "cleanup" +rdr_v4_head() +{ + atf_set descr 'Test rdr SCTP over IPv4' + atf_set require.user root +} + +rdr_v4_body() +{ + sctp_init + + j="sctp:rdr_v4" + epair_c=$(vnet_mkepair) + epair_srv=$(vnet_mkepair) + + vnet_mkjail ${j}srv ${epair_srv}a + vnet_mkjail ${j}gw ${epair_srv}b ${epair_c}a + vnet_mkjail ${j}c ${epair_c}b + + jexec ${j}srv ifconfig ${epair_srv}a 198.51.100.1/24 up + # No default route in srv jail, to ensure we're NAT-ing + jexec ${j}gw ifconfig ${epair_srv}b 198.51.100.2/24 up + jexec ${j}gw ifconfig ${epair_c}a 192.0.2.1/24 up + jexec ${j}gw sysctl net.inet.ip.forwarding=1 + jexec ${j}c ifconfig ${epair_c}b 192.0.2.2/24 up + jexec ${j}c route add default 192.0.2.1 + + jexec ${j}gw pfctl -e + pft_set_rules ${j}gw \ + "rdr pass on ${epair_srv}b proto sctp from 198.51.100.0/24 to any port 1234 -> 192.0.2.2 port 1234" \ + "pass" + + echo "foo" | jexec ${j}c nc --sctp -N -l 1234 & + + # Wait for the server to start + sleep 1 + + out=$(jexec ${j}srv nc --sctp -N -w 3 198.51.100.2 1234) + if [ "$out" != "foo" ]; then + atf_fail "SCTP connection failed" + fi + + # Despite configuring port changes pf will not do so. + echo "bar" | jexec ${j}c nc --sctp -N -l 1234 & + + pft_set_rules ${j}gw \ + "rdr pass on ${epair_srv}b proto sctp from 198.51.100.0/24 to any port 1234 -> 192.0.2.2 port 4321" \ + "pass" + + # This will fail + out=$(jexec ${j}srv nc --sctp -N -w 3 198.51.100.2 4321) + if [ "$out" == "bar" ]; then + atf_fail "Port was unexpectedly changed." + fi + + # This succeeds + out=$(jexec ${j}srv nc --sctp -N -w 3 198.51.100.2 1234) + if [ "$out" != "bar" ]; then + atf_fail "Port was unexpectedly changed." + fi +} + +rdr_v4_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "basic_v4" @@ -410,4 +477,5 @@ atf_init_test_cases() atf_add_test_case "abort_v6" atf_add_test_case "nat_v4" atf_add_test_case "nat_v6" + atf_add_test_case "rdr_v4" } From nobody Fri Jul 21 10:32:45 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6m8x44xRz4pG2k; Fri, 21 Jul 2023 10:32: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 4R6m8t17K4z3qDH; Fri, 21 Jul 2023 10:32:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689935566; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ImG1X9YsZaUxI4VkH6ekOiF6MzW3Cko6OjAyHWRhuqU=; b=VBJAu36xZEsKZdpx6xotLv/hiedN342q0z8F+q4E7Wc7KBoKXk8mF4ezly9BBJI0DR6cOe B7OAkKO2mcLnZQ7hQmUSGZuOexaYbO5DBI4HyClqKWKfxLCWPsG+G4z9njUDvWtn9Wff+W xVKRIi+GquPX2OdcGUD5WgS6yjM01th4Dl3WGN9S7jE/6hXwdZhEpj3oBEl0fWqyNpcZuD kGMoShru+bWOdBRZusfBpfOJEMLHdyCdtDZUJe15rqw4h3N0FdadmxDzQ8wqvadRu/bxlF g5JIcvcSGm+xExGSq1hfhgF2+GMS7R0ik87mCWySSRgOA7iNF/6J4LwXQDNcEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689935566; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ImG1X9YsZaUxI4VkH6ekOiF6MzW3Cko6OjAyHWRhuqU=; b=rsTwICfEmEFz9atpiLdRTE2xUgPdec7CMFngmWXl9akXNdOvIhaFptoFHHf5QyGDOAXo+k whIJxOehO3d6aOnig+wOTly0rnHolCTrFKbxyvSmsLIHQcjr47PnKJYmjdw5NE9fKW7Kl1 9n1GgB1LMt/Eud89G1Fti+pbZcvPj/8W5P6ecwzJIqS/Rp4Mz8TWjDgH+Ud5lKjVAgRcL8 sPpqyfVBLCLhMJfBNGPg1iw7S6u6L1JxeuYbT2UJF/EOLJlVYhN51iu/oQsRCiDbmApvlw e8Y1DPBSeYrCXbJdVZ8ONkeZZeWbFfwmqLtR/i/0E8FJIf76Ck3JYyxVytKHGQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689935566; a=rsa-sha256; cv=none; b=V5Jc6j4fzRfgKKeRvYaqPkzPYiogaNvFzfsf2OtUu2Enf+VSUO9+mbbrI9PL0tOk9vVAIs eP4Q8qZ0rGe5OXX6lwKR5+T8MksPY2Mcv0tFUl3L9qlmKoml1WGztB2G2f2JUeiyOMr53x uUyJriA29JabMeGrKApLcjiLaHr81J1/8geKiq1D7GkANq6h/iWVtuF2bXGuUEt0gXXVVC 2gKMjRjLjAL7FCibIeG5k35G6z2WlFy+JyAiw7N1Ib1QltSdI/0Kqdf379+tK+nMZ83asB 0uCMeda8RbkDDlfVlLxtjQTusrg+xXv+pzAuK5wzD89R/kGa1pCmXkptE9Lazg== 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 4R6m8s5yKkz18G8; Fri, 21 Jul 2023 10:32: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 36LAWjQm010655; Fri, 21 Jul 2023 10:32:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36LAWjXh010654; Fri, 21 Jul 2023 10:32:45 GMT (envelope-from git) Date: Fri, 21 Jul 2023 10:32:45 GMT Message-Id: <202307211032.36LAWjXh010654@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: b7a9a5773a0f - main - pf tests: test SCTP pfsync List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b7a9a5773a0fdf9b9c7839d79d76dbc6b69a6c4b Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=b7a9a5773a0fdf9b9c7839d79d76dbc6b69a6c4b commit b7a9a5773a0fdf9b9c7839d79d76dbc6b69a6c4b Author: Kristof Provost AuthorDate: 2023-06-07 09:55:06 +0000 Commit: Kristof Provost CommitDate: 2023-07-21 10:32:19 +0000 pf tests: test SCTP pfsync Ensure that SCTP connections survive a failover to the backup pf instance. MFC after: 3 weeks Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D40869 --- tests/sys/netpfil/pf/sctp.sh | 188 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 188 insertions(+) diff --git a/tests/sys/netpfil/pf/sctp.sh b/tests/sys/netpfil/pf/sctp.sh index 2c736017f9fa..ec131a6384cc 100644 --- a/tests/sys/netpfil/pf/sctp.sh +++ b/tests/sys/netpfil/pf/sctp.sh @@ -469,6 +469,193 @@ rdr_v4_cleanup() pft_cleanup } +atf_test_case "pfsync" "cleanup" +pfsync_head() +{ + atf_set descr 'Test pfsync-ing SCTP connections' + atf_set require.user root +} + +pfsync_body() +{ + # + Builds bellow topology and initiate an SCTP connection + # from client to server. + # + Tests that the connection remains open when we fail over from + # router one to router two. + # + # ┌──────┐ + # │client│ + # └───┬──┘ + # │ + # ┌───┴───┐ + # │bridge0│ + # └┬─────┬┘ + # │ │ + # ┌────────────────┴─┐ ┌─┴────────────────┐ + # │ one ├─┤ two │ + # └────────────────┬─┘ └─┬────────────────┘ + # │ │ + # ┌┴─────┴┐ + # │bridge1│ + # └───┬───┘ + # │ + # ┌───┴──┐ + # │server│ + # └──────┘ + + sctp_init + pfsynct_init + if ! kldstat -q -m carp + then + atf_skip "This test requires carp" + fi + + j="sctp:pfsync" + + tmp=`pwd` + + bridge0=$(vnet_mkbridge) + bridge1=$(vnet_mkbridge) + + epair_c=$(vnet_mkepair) + epair_one0=$(vnet_mkepair) + epair_two0=$(vnet_mkepair) + epair_sync=$(vnet_mkepair) + epair_one1=$(vnet_mkepair) + epair_two1=$(vnet_mkepair) + epair_srv=$(vnet_mkepair) + + ifconfig ${bridge0} addm ${epair_c}a addm ${epair_one0}a addm ${epair_two0}a + ifconfig ${epair_one0}a up + ifconfig ${epair_two0}a up + ifconfig ${epair_c}a up + ifconfig ${bridge0} up + + ifconfig ${bridge1} addm ${epair_srv}a addm ${epair_one1}a addm ${epair_two1}a + ifconfig ${epair_one1}a up + ifconfig ${epair_two1}a up + ifconfig ${epair_srv}a up + ifconfig ${bridge1} up + + vnet_mkjail ${j}c ${epair_c}b + jexec ${j}c ifconfig ${epair_c}b 192.0.2.2/24 up + jexec ${j}c route add default 192.0.2.1 + + vnet_mkjail ${j}one ${epair_one0}b ${epair_one1}b ${epair_sync}a + jexec ${j}one ifconfig ${epair_one0}b 192.0.2.3/24 up + jexec ${j}one ifconfig ${epair_one0}b \ + alias 192.0.2.1/32 vhid 1 pass 1234 + jexec ${j}one ifconfig ${epair_one1}b 198.51.100.3/24 up + jexec ${j}one ifconfig ${epair_one1}b \ + alias 198.51.100.2/32 vhid 2 pass 4321 + jexec ${j}one ifconfig ${epair_sync}a 203.0.113.1/24 up + jexec ${j}one ifconfig pfsync0 \ + syncdev ${epair_sync}a \ + maxupd 1 \ + up + jexec ${j}one sysctl net.inet.ip.forwarding=1 + + vnet_mkjail ${j}two ${epair_two0}b ${epair_two1}b ${epair_sync}b + jexec ${j}two ifconfig ${epair_two0}b 192.0.2.4/24 up + jexec ${j}two ifconfig ${epair_two0}b \ + alias 192.0.2.1/32 vhid 1 pass 1234 + jexec ${j}two ifconfig ${epair_two1}b 198.51.100.4/24 up + jexec ${j}two ifconfig ${epair_two1}b \ + alias 198.51.100.2/32 vhid 2 pass 4321 + jexec ${j}two ifconfig ${epair_sync}b 203.0.113.2/24 up + jexec ${j}two ifconfig pfsync0 \ + syncdev ${epair_sync}b \ + maxupd 1 \ + up + jexec ${j}two sysctl net.inet.ip.forwarding=1 + + vnet_mkjail ${j}srv ${epair_srv}b + jexec ${j}srv ifconfig ${epair_srv}b 198.51.100.1/24 up + jexec ${j}srv route add default 198.51.100.2 + + # Demote two, to avoid dealing with asymmetric routing + jexec ${j}two sysctl net.inet.carp.demotion=50 + + jexec ${j}one pfctl -e + pft_set_rules ${j}one \ + "block all" \ + "pass proto { icmp, pfsync, carp }" \ + "pass proto sctp to port 1234" \ + "pass proto tcp to port 1234" + + jexec ${j}two pfctl -e + pft_set_rules ${j}two \ + "block all" \ + "pass proto { icmp, pfsync, carp }" \ + "pass proto sctp to port 1234" \ + "pass proto tcp to port 1234" + + # Give carp time to get set up + sleep 2 + + # Sanity check + atf_check -s exit:0 -o ignore \ + jexec ${j}c ping -c 1 198.51.100.1 + + # Now start up an SCTP connection + touch ${tmp}/input + tail -F ${tmp}/input | jexec ${j}srv nc --sctp -l 1234 & + sleep 1 + + jexec ${j}c nc --sctp 198.51.100.1 1234 > ${tmp}/output & + echo "1" >> ${tmp}/input + + # Give time for the traffic to arrive + sleep 1 + line=$(tail -n -1 ${tmp}/output) + if [ "${line}" != "1" ]; + then + echo "Found ${line}" + cat ${tmp}/output + atf_fail "Initial SCTP connection failed" + fi + + # Verify that two has the connection too + state=$(jexec ${j}two pfctl -ss | grep sctp) + if [ -z "${state}" ]; + then + jexec ${j}two pfctl -ss + atf_fail "Failed to find SCTP state on secondary pfsync host" + fi + + # Now fail over (both carp IPs should switch here) + jexec ${j}one sysctl net.inet.carp.demotion=100 + + while ! jexec ${j}one ifconfig ${epair_one0}b | grep MASTER; + do + sleep 1 + done + while ! jexec ${j}one ifconfig ${epair_one1}b | grep MASTER; + do + sleep 1 + done + + # Sanity check + atf_check -s exit:0 -o ignore \ + jexec ${j}c ping -c 1 198.51.100.1 + + # And check that the connection is still live + echo "2" >> ${tmp}/input + sleep 1 + line=$(tail -n -1 ${tmp}/output) + if [ "${line}" != "2" ]; + then + echo "Found ${line}" + cat ${tmp}/output + atf_fail "SCTP failover failed" + fi +} + +pfsync_cleanup() +{ + pfsynct_cleanup +} + atf_init_test_cases() { atf_add_test_case "basic_v4" @@ -478,4 +665,5 @@ atf_init_test_cases() atf_add_test_case "nat_v4" atf_add_test_case "nat_v6" atf_add_test_case "rdr_v4" + atf_add_test_case "pfsync" } From nobody Fri Jul 21 10:32:46 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6m8x44w4z4pG0h; Fri, 21 Jul 2023 10:32: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 4R6m8v1N3Tz3qGJ; Fri, 21 Jul 2023 10:32:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689935567; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sNzWU4RuZJId6u1PoCiw8aw28muCjzcUClgDucB7GPw=; b=XFLQS8nvx+g3fYK6uo2qdvEgFVDZDuGdF/D636/9sMfFjkJkGZ3ZGfoELR2jN3bkGfZGxi pUzj91yPycmLlMKgULfLYQuNYr3vMQBL3BOXsHazDrmZUbHurFZEIoTrZ6dDYUQYPjavxO uWC9OI67sPuAZ/XIxOlvKqM3z5DDnqi8BLzNvDXHGF5Ltxg775WAfOpWOmUgYhz9k6CeAu mouSdaoHGEwPoKS5dVhrQzLyIxpoaSjzehA5zQWkl9GziV03BUH86Mf9fZPEvsaMezT8Kt 5qdD2mF9cCQPJI91UNfPQDKR/Yme1K6D0PT7eNy4cG7DiJkmKs7enOsFY++xLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689935567; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sNzWU4RuZJId6u1PoCiw8aw28muCjzcUClgDucB7GPw=; b=g4Y3s9fLLhO+3G4wMjiIJSyBlHR5CKG6tmWGluzPIFadHzeuLwiLScLdAZ/61ZKCOqIAHu i3sosXluxAJaLJigDnsa8mMd69p6FoJ3MLEdRpL/mqv496BM8uNBTKxRW9vkAr6uRXGATd EMu/uow/OMhHopKX9cw7yZNPYbDoYetmjjmgY6zC5jY5lI9zvoIAumuAM6FByJVR4Mh/PB Li8J08hWrvIJptKgzxG38dbkdmwV37EJkcfx/Ap7h1cZyhE2Ozuq97RMAJ6RKuveZZ54NW JCjJQ77FpN7oF2HRZ72BP2Y6WXmBULm/1edhB7KxyJ7JnA5r+O7ELmAuUzTswQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689935567; a=rsa-sha256; cv=none; b=QRX0T7e+ewXib6R/rY5tds46S1qhNzvY33MYiNUBP4MWgs/fjzIz2rYQ2dqxXrrLBIo+os gW9j0wV+17QoisogGbvJ3Q7B+1tkYAsIsCSRiM2msOJk5uaPfS4Ohe8EWemgR933Kvm03r JhZmF6DrZOz9aAtVVDLXuafARVDBNvvvhJQl0DNLdbXBxTcJCNoM8SWWppCEE4aMpoUxRk d1QBY56JRnX9UwafMYM1gmEWxT+aYcZLloT8yG2DY05CVEls02740wXDbuNcGBWEYWqhvr vmLk4sxjv82dLErmorHmcI+Sd7rGKRP8RBuX8iHP9z8DkN7Mbshv1R/m82AVGQ== 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 4R6m8t6LT0z18J2; Fri, 21 Jul 2023 10:32: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 36LAWkK5010679; Fri, 21 Jul 2023 10:32:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36LAWkoW010678; Fri, 21 Jul 2023 10:32:46 GMT (envelope-from git) Date: Fri, 21 Jul 2023 10:32:46 GMT Message-Id: <202307211032.36LAWkoW010678@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 47d0c1fe7d32 - main - pf.conf.5: document SCTP support List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 47d0c1fe7d3279e9d38df75cf0c359b1fbc26d5e Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=47d0c1fe7d3279e9d38df75cf0c359b1fbc26d5e commit 47d0c1fe7d3279e9d38df75cf0c359b1fbc26d5e Author: Kristof Provost AuthorDate: 2023-06-21 08:04:07 +0000 Commit: Kristof Provost CommitDate: 2023-07-21 10:32:19 +0000 pf.conf.5: document SCTP support Mention SCTP in the pf.conf.5 Reviewed by: tuexen MFC after: 3 weeks Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D40870 --- share/man/man5/pf.conf.5 | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/share/man/man5/pf.conf.5 b/share/man/man5/pf.conf.5 index 8292812f7817..2f071d3d94e8 100644 --- a/share/man/man5/pf.conf.5 +++ b/share/man/man5/pf.conf.5 @@ -28,7 +28,7 @@ .\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd April 26, 2023 +.Dd June 21, 2023 .Dt PF.CONF 5 .Os .Sh NAME @@ -493,6 +493,7 @@ action: Packet is silently dropped. .It Ar return A TCP RST is returned for blocked TCP packets, +an SCTP ABORT chunk is returned for blocked SCTP packets, an ICMP UNREACHABLE is returned for blocked UDP packets, and all other packets are silently dropped. .El @@ -517,6 +518,7 @@ actions are possible: Incoming packet is silently dropped. .It Ar return Incoming packet is dropped and TCP RST is returned for TCP packets, +an SCTP ABORT chunk is returned for blocked SCTP packets, an ICMP UNREACHABLE is returned for UDP packets, and no response is sent for other packets. .El @@ -1267,8 +1269,8 @@ A stateful connection is automatically created to track packets matching such a rule as long as they are not blocked by the filtering section of .Nm pf.conf . The translation engine modifies the specified address and/or port in the -packet, recalculates IP, TCP and UDP checksums as necessary, and passes it to -the packet filter for evaluation. +packet, recalculates IP, TCP and UDP checksums as necessary, and passes +it to the packet filter for evaluation. .Pp Since translation occurs before filtering the filter engine will see packets as they look after any @@ -1404,6 +1406,7 @@ and layer 4 (see .Xr icmp 4 , .Xr icmp6 4 , .Xr tcp 4 , +.Xr sctp 4 , .Xr udp 4 ) headers. In addition, packets may also be @@ -1453,7 +1456,8 @@ can be overridden by specifying a message as a code or number. .It Ar return This causes a TCP RST to be returned for .Xr tcp 4 -packets and an ICMP UNREACHABLE for UDP and other packets. +packets, an SCTP ABORT for SCTP +and an ICMP UNREACHABLE for UDP and other packets. .El .Pp Options returning ICMP packets currently have no effect if @@ -1654,6 +1658,7 @@ Common protocols are .Xr icmp 4 , .Xr icmp6 4 , .Xr tcp 4 , +.Xr sctp 4 , and .Xr udp 4 . For a list of all the protocol name to number mappings used by @@ -2853,6 +2858,14 @@ reference to an anchor name containing characters will require double quote .Pq Sq \&" characters around the anchor name. +.Sh SCTP CONSIDERATIONS +.Xr pf 4 +supports +.Xr sctp 4 +connections. +It can match ports, track state and NAT SCTP traffic. +However, it will not alter port numbers during nat or rdr translations. +Doing so would break SCTP multihoming. .Sh TRANSLATION EXAMPLES This example maps incoming requests on port 80 to port 8080, on which a daemon is running (because, for example, it is not run as root, @@ -3319,6 +3332,7 @@ Service name database. .Xr pf 4 , .Xr pfsync 4 , .Xr tcp 4 , +.Xr sctp 4 , .Xr udp 4 , .Xr hosts 5 , .Xr pf.os 5 , From nobody Fri Jul 21 14:24:13 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6sHx636Mz4dRmv; Fri, 21 Jul 2023 14:24: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 4R6sHx4WHcz3xVZ; Fri, 21 Jul 2023 14:24:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689949453; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7O79qE+7xceASpgC0j2hYUdOmjwQhsWjKg4iywwcI0E=; b=WuAhWE+XrRHklOmWaLDsJAdv1VfqPhcPEtbyTG2bkUGLT2HCCBm7FOggQWariGdliTORt5 lskGri9slEEC4ZqlLdQfsA+X0/88uGWhAhcygBduO0s+uJz9dwvx4pD4svIunSgf39Zsfc IJR1TLP0ycrfdfl1KxrHwlxgcmVjqrsjt8TUjqc7ZSpvgIvOjdNhjUQL73sxMiH1tZiVb4 1ztnG72GbC0jN5hxggY2N62dwhlnbAysPnkDDyV3fbNPP502C0y5K0VlWYl1DY2WLf9NnY Ntl0JTTDLfM/zF1ScVx66iQrP//Y8QLtMg4LqXGJeb3DlshsB7Rgx9gdsi6h4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689949453; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7O79qE+7xceASpgC0j2hYUdOmjwQhsWjKg4iywwcI0E=; b=Lbg0eVRbls+vNpyWbdh2/FrJH43bpj0y67prMXF8Y5xTPnNzhmOzULz+42v7Py7GZlUrpo HMUWtHpWPydh/iDZWSQvzLuJgNwCa0X9fUFYkaYU02vhEViCbKwFC8NpQL6VKnqHavQrWn dP7Tz0ggdQ3oKc/rievx1YAkx6hhxRnu7+cTSDCm1ihEoFwDMK36hi6Ra6FN89Mnbd/CRC YiSAbPam/6MJ3WhULEIaRCsWSYlncoM1pgipG6dA+PudzMqbaxq8anmUMDXdcMhvz45JDf AH1IC9+5e5EMccuWgSEvoFpZrV/65B+rZBfIMsu9mutoLELKNUYgROSTIpuUvg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689949453; a=rsa-sha256; cv=none; b=G6SQ9y9q4Qa9bJw0hjDQgK/9M+QP04MLoUlM6kP+HTZlx8XRESjVsNOPLA769SWur5EtbE G1h7JWWpzOoplDOAc3TF02xsLB68cb9zdtSkmVZ7ljT3vWXMjEtlxp3pMKMXZKSh21+Auz RzsnasJ/7cBtUVHsmsN0MLf6hxO+9mc2YwBBimvHkzkm2LwGIzzEzxWd102jCSFssl79YW zxbtBJgfeFw+gyihhdzFiXBlydCE326B/SaXSX7pt+f0wq1QZy7qNf0jXPJmRHNgc/N3Qc OIBmd8YlyokYtp7uHdnKSNKGPocRqzsxSs1VBMJ/NOpdjoMYdVMvwmxjKskD+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 4R6sHx3bXNzGlH; Fri, 21 Jul 2023 14:24: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 36LEODoV091789; Fri, 21 Jul 2023 14:24:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36LEODBt091788; Fri, 21 Jul 2023 14:24:13 GMT (envelope-from git) Date: Fri, 21 Jul 2023 14:24:13 GMT Message-Id: <202307211424.36LEODBt091788@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 8f8da1bcc799 - main - seq: style(9) cleanup List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 8f8da1bcc799c3ffc306ae7cb37c6591c629d709 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=8f8da1bcc799c3ffc306ae7cb37c6591c629d709 commit 8f8da1bcc799c3ffc306ae7cb37c6591c629d709 Author: Ed Maste AuthorDate: 2023-06-25 23:33:49 +0000 Commit: Ed Maste CommitDate: 2023-07-21 14:17:24 +0000 seq: style(9) cleanup This is in part for diff reduction with OpenBSD. Sponsored by: The FreeBSD Foundation --- usr.bin/seq/seq.c | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/usr.bin/seq/seq.c b/usr.bin/seq/seq.c index d1d2cfbf17ed..d3d074985d85 100644 --- a/usr.bin/seq/seq.c +++ b/usr.bin/seq/seq.c @@ -57,8 +57,7 @@ __FBSDID("$FreeBSD$"); static const char *decimal_point = "."; /* default */ static char default_format[] = { "%g" }; /* default */ -static const struct option long_opts[] = -{ +static const struct option long_opts[] = { {"format", required_argument, NULL, 'f'}, {"separator", required_argument, NULL, 's'}, {"terminator", required_argument, NULL, 't'}, @@ -106,9 +105,9 @@ main(int argc, char *argv[]) decimal_point = locale->decimal_point; /* - * Process options, but handle negative numbers separately - * least they trip up getopt(3). - */ + * Process options, but handle negative numbers separately + * least they trip up getopt(3). + */ while ((optind < argc) && !numeric(argv[optind]) && (c = getopt_long(argc, argv, "+f:hs:t:w", long_opts, NULL)) != -1) { @@ -156,7 +155,7 @@ main(int argc, char *argv[]) incr = e_atof(argv[1]); /* Plan 9/GNU don't do zero */ if (incr == 0.0) - errx(1, "zero %screment", (first < last)? "in" : "de"); + errx(1, "zero %screment", (first < last) ? "in" : "de"); } /* default is one for Plan 9/GNU work alike */ @@ -176,7 +175,7 @@ main(int argc, char *argv[]) if (!valid_format(fmt)) errx(1, "invalid format string"); /* - * XXX to be bug for bug compatible with Plan 9 add a + * XXX to be bug for bug compatible with Plan 9 add a * newline if none found at the end of the format string. */ } else @@ -297,18 +296,18 @@ valid_format(const char *fmt) /* conversion */ switch (*fmt) { - case 'A': - case 'a': - case 'E': - case 'e': - case 'F': - case 'f': - case 'G': - case 'g': + case 'A': + case 'a': + case 'E': + case 'e': + case 'F': + case 'f': + case 'G': + case 'g': /* floating point formats are accepted */ conversions++; break; - default: + default: /* anything else is not */ return 0; } From nobody Fri Jul 21 16:08:20 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6vc42xl4z4pMVx; Fri, 21 Jul 2023 16:08:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6vc42TBZz4VcR; Fri, 21 Jul 2023 16:08:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689955700; h=from:from:reply-to:subject:subject: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/ICnGTpPul6XnJQak/h4M1oybyZ4ulLdHL1cZAPCuY=; b=jp7bQsAe7ZjSKS1+3IXHb9LpLQMbhck9NdlhMvCRnUnCA8KFZyeh1C0MVbOEqX16bZJC/n rZr53TlM2HvxSe8qA3gFSygGtCWEsgOsFWNhWJ0YGiSUMeZBom69gR/PtY+JuGIUIihud6 9i5VWBnujixiI1oQqgudUCE6AqSqMBcb+rHE3AJnO5+iW5X+VtVFo5fDUTz7kfLuhdUUVt OFLh7PNvOXA530/cqTkhUZtFpgx7h+oN4h1Ny07gUMkwo/9Wo0NlUbeAxpvRivh7sLc8KH R75SIGa2fI+3KMwJUf7AHcMWrYOqJ6XUBIEj0mJYtv24wLZ95OhGA2Qt0QGTdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689955700; h=from:from:reply-to:subject:subject: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/ICnGTpPul6XnJQak/h4M1oybyZ4ulLdHL1cZAPCuY=; b=ePQ11jiRCChrP/QnZjo9WtyyInB1CC4apRB/uhniccER2kYdVfHifNV6SWupHnAs3d+we6 m2WNZHYZ1QMiGjc5imOmQIhJuJlxf3CWNHIWN4tjieJwWOBMGxHN9ypHWEuWZ9irBzwGEt dBLi+0yOzTBNloauxIRpqF+gONFBw8MAn9RpJWPQkh4fX9gX6aPhlIWinlB456rEMpUpI2 JuiTereyDt/8FzToOqmj+R65SffRoRe5mRtEZ0Mu2z6ZEUSyZvmKz9CFxclZ2fhpxS5U7N xFXx4J+WOpvxbteimM+cnOqguLDF/pqJ18PMbh3E2mIskcG/QcjL9EHvQgjemA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689955700; a=rsa-sha256; cv=none; b=R4vWTtq0oY6Xi6CvS17nenmq8nqm46JyNICozWSUaO4b/KmmlJ9SOovQqsap/sF91kH6HT CUN0zYp2wFQqtBPnS28nWxVAuUYyBIJBTcp0gmHsJj39kA026tBWnhXl7mdWbIm23uqNwU xea3D/YIU8jHKd1RJMjw08CctY9t4zSdQY5TdkmnG/cO/6OmcoxWgncFFOLcqvYvaIi2PX cByfG5Z8hkNvri5jNqGn6usOiP/2iChPYCBvf3bDEEyHluvDEWcis2Wjv+pivicVhN7Caj suOVUMDbFc/sPvwTumXKY7voeii4ivRN0SGpYVEt2d4YGlSW29vh+Pb4SsM0kA== 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 4R6vc41YqJzK73; Fri, 21 Jul 2023 16:08: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 36LG8K3h059739; Fri, 21 Jul 2023 16:08:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36LG8KJi059738; Fri, 21 Jul 2023 16:08:20 GMT (envelope-from git) Date: Fri, 21 Jul 2023 16:08:20 GMT Message-Id: <202307211608.36LG8KJi059738@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: b4993704d6bb - main - cam_periph: Fix a comment List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b4993704d6bbc3d2e563a7f7f41619ca292ad5b4 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=b4993704d6bbc3d2e563a7f7f41619ca292ad5b4 commit b4993704d6bbc3d2e563a7f7f41619ca292ad5b4 Author: Warner Losh AuthorDate: 2023-07-21 16:06:03 +0000 Commit: Warner Losh CommitDate: 2023-07-21 16:07:13 +0000 cam_periph: Fix a comment Add a couple of words so that this sentence makes sense. Sponsored by: Netflix --- sys/cam/cam_periph.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/cam/cam_periph.c b/sys/cam/cam_periph.c index 8defdc9ecbe6..9ff3d156023d 100644 --- a/sys/cam/cam_periph.c +++ b/sys/cam/cam_periph.c @@ -1262,7 +1262,7 @@ cam_periph_runccb(union ccb *ccb, * shutdown_post_sync event will run with the scheduler stopped, but * before we're officially dumping. To avoid hanging in adashutdown * initiated commands (or other similar situations), we have to test for - * either SCHEDULER_STOPPED() here as well. + * either dumping or SCHEDULER_STOPPED() here. * * To avoid locking problems, dumping/polling callers must call * without a periph lock held. From nobody Fri Jul 21 16:14:09 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6vkn5f3vz4pPf0; Fri, 21 Jul 2023 16:14:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6vkn2ZCkz4XKj; Fri, 21 Jul 2023 16:14:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689956049; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yQJ8poOuSjcfHT5aCgJZnSq3qwhI7GBNt8bwSsUH14I=; b=rIPDDPwKyjIPlkYxdlycZw35to7UiJSyNHqb5UjrCiZXmcLwYY0qJoKrJnoNwhnBMN/k27 De6AOENtzvExZRYRuNehy3+oq6iR5jIoe/ebk/e2/6R+RFo43wR7HfniS8l91MWVleQegW XyO95D4GOTWrI3CGhoFfV1Fo5g7KswDR9+9+OH+2TNlQ6Tupc5hq0TroOQO3spDy48eyW1 y333td4ZwFIxM/06s+k1tMEA99EuBLtiAJwBlZ9rbsMwIKRIG7qu/RA4SSjBGdMouAUrqT IU+XTD6wLbuZM/0C7gaNh3Q0ujvt5LJujFDVgoLk99SQoW8zvauSkn3vRdc8+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689956049; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yQJ8poOuSjcfHT5aCgJZnSq3qwhI7GBNt8bwSsUH14I=; b=Tqxyr6TxY7QbH37XBvvUwTtrGpWR9cQS/6o5b/W/S7pn5D490tRsw5lY0KDCqMKzo3jCxp 8skgF3OnMFEE4G+/v9ASWNT7jxR5hUNsYRnO6Z9lw+Fj5yqlic4AEF6oisDHi7T4s6HjHa JTTIu//K/UG3JnmGCyR7z2aMEwJizrZfeF/b1ObtINTruRU52HoFEr/q9njzj3CMlBeRrg eqI10821mQdLV/9ar4jXI8X6OWvZa2jJ7MxOjKiMtDKWf8bH5/g/enrnA+goNCQelnq1Ba p95gkmgHn3WcKYe9iYOuFqDZPZbb60J+am7C1oh7QdWpdb1/mCZ/ud1lVlO1KA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689956049; a=rsa-sha256; cv=none; b=d+Me3hmkX1+b7skkVPppgMB+C1lWD1OHtrZWvl32+vlCgTWy/3ir/+hmusqvvRmsEW/FxG PzVSJHzb8GlwtEN976ow8nVnulwRk1mxavCeapFa2k2w9KAiLLDPZpDCtIMkLfjqI4o7tZ YFJHePJmTeVSzG8kWMvZx7dxkAsmrT7y9Z6uROslQ7XUVSvlehJUHrSMIW7YHG5VzBzkLk DvX9J0BGDx1b9hpAhXDhQ7CH4H3fj83AAqud+ZaoQcnyJiJ+eyKmhDoQqO5E7h4wZOdoAX 9KLzDKj+I9vikFiP0j6a40GxRKfk+3PKVkOpRHnh5NB+Rh8EhBaYklDHDVpW1g== 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 4R6vkn1QwYzKVL; Fri, 21 Jul 2023 16:14:09 +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 36LGE96K075332; Fri, 21 Jul 2023 16:14:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36LGE9E8075331; Fri, 21 Jul 2023 16:14:09 GMT (envelope-from git) Date: Fri, 21 Jul 2023 16:14:09 GMT Message-Id: <202307211614.36LGE9E8075331@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: ff4633d9f897 - main - cam_periph: Comment about why we need to reset cbfcnp List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ff4633d9f897c2247bc67930740509a1ba315c81 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=ff4633d9f897c2247bc67930740509a1ba315c81 commit ff4633d9f897c2247bc67930740509a1ba315c81 Author: Warner Losh AuthorDate: 2023-07-21 16:11:37 +0000 Commit: Warner Losh CommitDate: 2023-07-21 16:11:37 +0000 cam_periph: Comment about why we need to reset cbfcnp Just spent a few minutes puzzling out why we do this. Add a comment to remind my future self (and other intersted folk) why we do the reset here when we'd set it a few lines above. Sponsored by: Netflix --- sys/cam/cam_periph.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/cam/cam_periph.c b/sys/cam/cam_periph.c index 9ff3d156023d..0de73cffdc1f 100644 --- a/sys/cam/cam_periph.c +++ b/sys/cam/cam_periph.c @@ -1298,6 +1298,11 @@ cam_periph_runccb(union ccb *ccb, if ((ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) error = 0; else if (error_routine != NULL) { + /* + * cbfcnp is modified by cam_periph_ccbwait so + * reset it before we call the error routine + * which may call xpt_done. + */ ccb->ccb_h.cbfcnp = cam_periph_done; error = (*error_routine)(ccb, camflags, sense_flags); } else From nobody Fri Jul 21 19:01:30 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6zRv0rSbz4npTR; Fri, 21 Jul 2023 19:01: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 4R6zRv0Jwcz4Dht; Fri, 21 Jul 2023 19:01:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689966091; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zXQl72gRy2Hu3W0EUGiMP1Yec7JmQKPOldUHw6OggNw=; b=vycuH/BtnmvDol6G3C1FvYEkpWtb0Q4G0fuR4WZ2hocQC1PmEFFJ63P2eYu6nOJxuHs77y iRIcnT79epM1N04f+MInBaCagDTo4nt3lgUstF584YKzQfJ6itvTojX7qMLs+6j9ckps9J 7qYIwQdHGVH4XxEQ/j9liu2dY4THkOi1TQonX/FsW11qhRN24njGhCSvvNWphg2g66M2t0 +1W7vMKpKS1l7i26tzH5Iz48Wrlrovh3ZRvg3jX3sXTeCmwOyOxzMjmzs9AouQsXAdo4vK nnWSebeRBu//wpDD5j/wo+DOlReMpKo7fUoEomGmWgA+cdPh+/KTF4Ea34HW8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689966091; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zXQl72gRy2Hu3W0EUGiMP1Yec7JmQKPOldUHw6OggNw=; b=ZOLbduD/AqAU2sgRs5bv8gc+dip/NQZ3XD/cInQrerFjOS15zRqPRkW0Jfvi+4YWJro3b1 XkZFaDVeDQ1Jdk0MVjOBJF4tFrQSfz7oomTBIZgrmvgDYZ1LeADUaXqs431BpzaDI0tf4F HT+c1ScXKw+T1OuY5WrAwgGZrfYjE9zJChdGsmnqFwkCWJiWrYl6c8bFOUQVFVnI0fkL5r CyWIx3U8OBxpjY3bYEfUbSDtb3vX0lyeGwGAvb+JIT7EcAsParg268zDVPITW4tj7kdlUI F82PGuO5fKaiucnJlTDedd3qElDk2fu8FvWFZYGB1TIT9d5jxmhU0l5ATJMksA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689966091; a=rsa-sha256; cv=none; b=v18B4G36voE37L+bcNZzeSRLa8CULQshD2cmKrONqXSJzVvSP4fsetsOoIfCGdbtXIa1Ub 1tINsNUc4aSbG89tMGDSiDC14C8/A2vBQN9RsNMQP4dokdEr4aRIN8hYFFo98b6xvBUemg va/LWa8HBVtq/mM2LHx5myuGb1T0ht/CYhgqzDijJJ/Ig117buQto4Tv2ezWXDACIBujms u5OqhIF2lhBzOVl6zvmKYdeHlG6du9aAUtvsbDVLIKCo7QgfbMSSvTSCAHiBsz//9OYbNa hvYmyCtRCRT9ksUR2jfd+hb4BRSUSZTWS9jTFqfEKXWKqcu55lbQZC0uD7mryg== 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 4R6zRt6TRxzPS0; Fri, 21 Jul 2023 19:01: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 36LJ1UYh055399; Fri, 21 Jul 2023 19:01:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36LJ1UKr055398; Fri, 21 Jul 2023 19:01:30 GMT (envelope-from git) Date: Fri, 21 Jul 2023 19:01:30 GMT Message-Id: <202307211901.36LJ1UKr055398@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: bc310a95c58a - main - ip output: ensure that mbufs are mapped if ipsec is enabled List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: bc310a95c58a3c570ed7e5103371453881e36ba1 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=bc310a95c58a3c570ed7e5103371453881e36ba1 commit bc310a95c58a3c570ed7e5103371453881e36ba1 Author: Konstantin Belousov AuthorDate: 2023-07-20 12:08:24 +0000 Commit: Konstantin Belousov CommitDate: 2023-07-21 18:51:13 +0000 ip output: ensure that mbufs are mapped if ipsec is enabled Ipsec needs access to packet headers to determine if a policy is applicable. It seems that typically IP headers are mapped, but the code is arguably needs to check this before blindly accessing them. Then, operations like m_unshare() and m_makespace() are not yet ready for unmapped mbufs. Ensure that the packet is mapped before calling into IPSEC_OUTPUT(). PR: 272616 Reviewed by: jhb, markj Sponsored by: NVidia networking MFC after: 1 week Differential revision: https://reviews.freebsd.org/D41112 --- sys/netinet/ip_output.c | 6 ++++++ sys/netinet6/ip6_output.c | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c index 1976ab9803af..3f30c63cdc87 100644 --- a/sys/netinet/ip_output.c +++ b/sys/netinet/ip_output.c @@ -671,6 +671,12 @@ again: sendit: #if defined(IPSEC) || defined(IPSEC_SUPPORT) if (IPSEC_ENABLED(ipv4)) { + m = mb_unmapped_to_ext(m); + if (m == NULL) { + IPSTAT_INC(ips_odropped); + error = ENOBUFS; + goto bad; + } if ((error = IPSEC_OUTPUT(ipv4, m, inp)) != 0) { if (error == EINPROGRESS) error = 0; diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c index 59ac04842854..7e3c98270cc2 100644 --- a/sys/netinet6/ip6_output.c +++ b/sys/netinet6/ip6_output.c @@ -461,6 +461,12 @@ ip6_output(struct mbuf *m0, struct ip6_pktopts *opt, * XXX: need scope argument. */ if (IPSEC_ENABLED(ipv6)) { + m = mb_unmapped_to_ext(m); + if (m == NULL) { + IP6STAT_INC(ip6s_odropped); + error = ENOBUFS; + goto bad; + } if ((error = IPSEC_OUTPUT(ipv6, m, inp)) != 0) { if (error == EINPROGRESS) error = 0; From nobody Sat Jul 22 04:44:09 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R7DNB6X0Bz4nYgm; Sat, 22 Jul 2023 04:44:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R7DNB5Z8Kz3tCQ; Sat, 22 Jul 2023 04:44:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690001050; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+MbIKR0cQLMSrwwRpuqSJ0w34HJXyVNQNszfWsQqrZE=; b=q0lzXJ0rfC1OZ8JP4v2cH5/ODOv9neNyNWlJz7sflAoEMweIp+ruvZ8bsGJQoYUQKDgiXp AK8h+4gxbzRKimxBHvVxU2bKVTj/9ObRQiXnJWb+I3+MLbL37tEtLXzZJ8IO4nucQyphXo Jdo8IorK5v+1jpxgPaq18miWgWs1czlwdOK2zOWzY1CYB5TPs1oyAA+B8fer+lr1hjvU5S OhP/q/KS5/yJHVPSEQqwzNA337DAoA//l8XKpES9NOLg6P49JYWqHq4T43g2NZvDhCP1DZ YfS5VBBAhm6w6UWjVMen/sAPWe11btkAvehXr7TsvycyejwcDoPgDh9NoRPXOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690001050; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+MbIKR0cQLMSrwwRpuqSJ0w34HJXyVNQNszfWsQqrZE=; b=gWhfl+23UuoDpR32nH1kxY0fzMB2fGwzP+8ake9dmoIaRm3LF+Et+tJSnyCp59a7/48GV6 WE1Cado6kxjJ50uOxJqJasm8E5+KLxMOJ521OBTwNzi07dh1nMEp169PCcFBH6cdunv7Lj 1PmjTqDN6gl7fDwz0jcUEPYFKZ1qWX9983I2O+t2I+ZR8T0dtk8I3TG5VH8wkYGsdagBcR 2ABHYBupVAMQmUtZcjyiYMixlfH8qtWQInoIHd1dDnrQeZINC8YDsTBiYHmA+BngL6+Vy6 PeMDsrZn/x4v7/2+ND+5urIxjc50/yDLNxK1at+SZEGgIGeef7Bz93BcxiyEbg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1690001050; a=rsa-sha256; cv=none; b=weuujpv9deZb/ev7X0YvcqrLjAzHF6TG++kWLe/AboP5wtfjV0N6DceU6+27Wf9CyT7r/t 8gE1QPZmRlK73zEBglqOSTGbizf3D9FeKXD5kKFx9NpJpwNuN+f1V16Kr8GBeXsofGm6uV dV94qRLOo5pa8VJFkSqzbcIpFsRYDQXNjsMbMvbwKvG9Z+VPMuEkxO73yV5JqLQnyrYiaA F2kS2USe6dD+9dvn7lGgfS0n41/dpuyEAAQ2TGwjkYXE1Dpmy6wjlSMhxB32VGlCAqS906 a40CDBGoQ2vC0nP3yNGpQYjCdSpPEbX95eZpZTBPeqkmj8a5B1Q3HLmyg3GDeA== 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 4R7DNB46QVzh2Q; Sat, 22 Jul 2023 04:44: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 36M4i9ZA018662; Sat, 22 Jul 2023 04:44:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36M4i9CE018661; Sat, 22 Jul 2023 04:44:09 GMT (envelope-from git) Date: Sat, 22 Jul 2023 04:44:09 GMT Message-Id: <202307220444.36M4i9CE018661@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 5d3c98254927 - main - Revert "e1000: lem(4)/em(4) ifcaps, TSO and hwcsum fixes" List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5d3c982549278c72d59debae7227366453d3c4a8 Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=5d3c982549278c72d59debae7227366453d3c4a8 commit 5d3c982549278c72d59debae7227366453d3c4a8 Author: Kevin Bowling AuthorDate: 2023-07-22 04:42:23 +0000 Commit: Kevin Bowling CommitDate: 2023-07-22 04:42:23 +0000 Revert "e1000: lem(4)/em(4) ifcaps, TSO and hwcsum fixes" Seems to cause a panic when booting under VitrualBox. Reported by: yasu This reverts commit 95f7b36e8fac45092b9a4eea5e32732e979989f0. --- sys/dev/e1000/em_txrx.c | 15 +++++++-------- sys/dev/e1000/if_em.c | 48 ++++++++++++++++-------------------------------- 2 files changed, 23 insertions(+), 40 deletions(-) diff --git a/sys/dev/e1000/em_txrx.c b/sys/dev/e1000/em_txrx.c index 069a1c00a4b2..47f9b187aa14 100644 --- a/sys/dev/e1000/em_txrx.c +++ b/sys/dev/e1000/em_txrx.c @@ -674,12 +674,12 @@ lem_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri) i++; } while (!eop); - if (scctx->isc_capenable & IFCAP_RXCSUM) + /* XXX add a faster way to look this up */ + if (sc->hw.mac.type >= e1000_82543) em_receive_checksum(status, errors, ri); - if (scctx->isc_capenable & IFCAP_VLAN_HWTAGGING && - status & E1000_RXD_STAT_VP) { - ri->iri_vtag = le16toh(rxd->special & E1000_RXD_SPC_VLAN_MASK); + if (status & E1000_RXD_STAT_VP) { + ri->iri_vtag = le16toh(rxd->special); ri->iri_flags |= M_VLANTAG; } @@ -699,11 +699,11 @@ em_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri) uint16_t len; uint32_t pkt_info; - uint32_t staterr; + uint32_t staterr = 0; bool eop; int i, cidx; - staterr = i = 0; + i = 0; cidx = ri->iri_cidx; do { @@ -739,8 +739,7 @@ em_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri) if (scctx->isc_capenable & IFCAP_RXCSUM) em_receive_checksum(staterr, staterr >> 24, ri); - if (scctx->isc_capenable & IFCAP_VLAN_HWTAGGING && - staterr & E1000_RXD_STAT_VP) { + if (staterr & E1000_RXD_STAT_VP) { ri->iri_vtag = le16toh(rxd->wb.upper.vlan); ri->iri_flags |= M_VLANTAG; } diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index b5a6e7e777d3..0b664b155872 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -781,21 +781,19 @@ em_set_num_queues(if_ctx_t ctx) return (maxqueues); } -#define LEM_CAPS \ - IFCAP_HWCSUM | IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING | \ - IFCAP_VLAN_HWCSUM | IFCAP_WOL | IFCAP_VLAN_HWFILTER | IFCAP_TSO4 | \ - IFCAP_LRO | IFCAP_JUMBO_MTU - -#define EM_CAPS \ - IFCAP_HWCSUM | IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING | \ - IFCAP_VLAN_HWCSUM | IFCAP_WOL | IFCAP_VLAN_HWFILTER | IFCAP_TSO4 | \ - IFCAP_LRO | IFCAP_VLAN_HWTSO | IFCAP_JUMBO_MTU | IFCAP_HWCSUM_IPV6 | \ - IFCAP_TSO6 - -#define IGB_CAPS \ - IFCAP_HWCSUM | IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING | \ - IFCAP_VLAN_HWCSUM | IFCAP_WOL | IFCAP_VLAN_HWFILTER | IFCAP_TSO4 | \ - IFCAP_LRO | IFCAP_VLAN_HWTSO | IFCAP_JUMBO_MTU | IFCAP_HWCSUM_IPV6 | \ +#define LEM_CAPS \ + IFCAP_HWCSUM | IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING | \ + IFCAP_VLAN_HWCSUM | IFCAP_WOL | IFCAP_VLAN_HWFILTER + +#define EM_CAPS \ + IFCAP_HWCSUM | IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING | \ + IFCAP_VLAN_HWCSUM | IFCAP_WOL | IFCAP_VLAN_HWFILTER | IFCAP_TSO4 | \ + IFCAP_LRO | IFCAP_VLAN_HWTSO + +#define IGB_CAPS \ + IFCAP_HWCSUM | IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING | \ + IFCAP_VLAN_HWCSUM | IFCAP_WOL | IFCAP_VLAN_HWFILTER | IFCAP_TSO4 | \ + IFCAP_LRO | IFCAP_VLAN_HWTSO | IFCAP_JUMBO_MTU | IFCAP_HWCSUM_IPV6 |\ IFCAP_TSO6 /********************************************************************* @@ -899,7 +897,7 @@ em_if_attach_pre(if_ctx_t ctx) scctx->isc_tx_tso_segsize_max = EM_TSO_SEG_SIZE; scctx->isc_capabilities = scctx->isc_capenable = EM_CAPS; /* - * For EM-class devices, don't enable IFCAP_{TSO4,VLAN_HWTSO,TSO6} + * For EM-class devices, don't enable IFCAP_{TSO4,VLAN_HWTSO} * by default as we don't have workarounds for all associated * silicon errata. E. g., with several MACs such as 82573E, * TSO only works at Gigabit speed and otherwise can cause the @@ -914,9 +912,8 @@ em_if_attach_pre(if_ctx_t ctx) * work for a few MACs of this class - at least when sticking * with Gigabit - in which case users may enable TSO manually. */ - scctx->isc_capenable &= ~(IFCAP_TSO4 | IFCAP_VLAN_HWTSO | IFCAP_TSO6); - scctx->isc_tx_csum_flags = CSUM_TCP | CSUM_UDP | CSUM_IP_TSO | - CSUM_IP6_TCP | CSUM_IP6_UDP; + scctx->isc_capenable &= ~(IFCAP_TSO4 | IFCAP_VLAN_HWTSO); + scctx->isc_tx_csum_flags = CSUM_TCP | CSUM_UDP | CSUM_IP_TSO; /* * We support MSI-X with 82574 only, but indicate to iflib(4) * that it shall give MSI at least a try with other devices. @@ -935,19 +932,6 @@ em_if_attach_pre(if_ctx_t ctx) scctx->isc_tx_csum_flags = CSUM_TCP | CSUM_UDP; scctx->isc_txrx = &lem_txrx; scctx->isc_capabilities = LEM_CAPS; - - /* - * For LEM-class devices, don't enable IFCAP {TSO4,VLAN_HWTSO} - * by default as we don't have workarounds for all associated - * silicon errata. TSO4 may work on > 82544 but its status - * is unknown by the authors. Please report any success or failures. - */ - scctx->isc_capenable &= ~(IFCAP_TSO4 | IFCAP_VLAN_HWTSO); - - /* 8254x SDM4.0 page 33 - FDX requirement on these chips */ - if (hw->mac.type == e1000_82547 || hw->mac.type == e1000_82547_rev_2) - scctx->isc_capenable &= ~(IFCAP_HWCSUM|IFCAP_VLAN_HWCSUM); - if (hw->mac.type < e1000_82543) scctx->isc_capabilities &= ~(IFCAP_HWCSUM|IFCAP_VLAN_HWCSUM); /* 82541ER doesn't do HW tagging */ From nobody Sat Jul 22 04:58:44 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R7Dj03xb2z4njcg; Sat, 22 Jul 2023 04:58: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 4R7Dj03DRkz40mg; Sat, 22 Jul 2023 04:58:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690001924; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=E87ngSMog1Hy/SFESe+7racRLQL5V7wNlU2XgXpLWRI=; b=ZQsNiW6hPK6ePzUavL86e6W8s07Bo0PlkB4695VvLStL6FHcOdO/BPXUQlAfhqoOXIUdx1 jSNdV99XWv4eJ5H5ctbmJ4a0qgKM+8E4OwtYGDTabU5EvZdRWwMr6qvM8puag/ke2ifxR2 l4XG/U3sfPKkUxQ2hliOwY8+hkqcExY33wrnM7rtBxRV/86lvekjZpuGnfQwGeD6/HTcuh p88qb4Na8v0vtZx8PUp4mrGiIwSn8IgjsrYg3luGim5XvJxRLwFtqi4c+Z9RPkwFrkjkEv bW4frhnXNZ1aN3BMTAZ+074/5q8t7fjAjytQEvpeUf9bckdBR5fuiimYn2WroA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690001924; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=E87ngSMog1Hy/SFESe+7racRLQL5V7wNlU2XgXpLWRI=; b=FOPWFioVoa3SBOZq4sbWKf4X9/GKsWC6WrrE9FacqzKos8ujpUuJ3srCCeDlQu5vejvzfE qSufjdbvalyWWvFU9kznpPh5qGyt/TkusTW0fi0qZfnZKXxxTdEmHsSlkhoh85NdD89XmR NfbeYqSycnFmwOgXGHsSNuxyDlQAmHd/RS6XLHUuGV6FqhsJ4Z4boMCoxKaxLcPJn6F6Gk UQCvgWcxsv25kRdtPsAQCJXvu4Ws2650fGSMp/EeblgI1g2IyteZu4Ec5pruxGriOFWJUE Kz/zKOhMzeGmIACNLPYce4JEMRx6bnNfTbKjArBXrK/pdlQABs/GWYoghvzxXA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1690001924; a=rsa-sha256; cv=none; b=FNexTHN+gMvfL4Ptviv99zB+HpGjPAhgWRTn9pGan8Inodp39/X6AwfFOxMICgXftrm1p+ jgP7K/ogszjvRgl7frzM+InIXQebPiNVKSYJEnWuM6qnHl5Aa8CbD1ZZ4IA3Ttv5APgmu7 Y1P3ymbZJvySUOYv6G7ewKwYFESHy1qZA2ZLtcPwyP18vtJvZ+qx4iJKHMT1q31dIgtAdN 9SBUntg9peIWsKKGiq5i/trofpwKT7zpQuHc2FeNQZ+XVhyBgE2toik3mKiC+ncq+aonkd 15whi/WKQ7GPQpAoxesUO+nvtMEjfQJV+bzIolnAqerjJRf3nMVcgek95n2psQ== 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 4R7Dj02LF7zhNG; Sat, 22 Jul 2023 04:58: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 36M4wibq036226; Sat, 22 Jul 2023 04:58:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36M4wiWl036225; Sat, 22 Jul 2023 04:58:44 GMT (envelope-from git) Date: Sat, 22 Jul 2023 04:58:44 GMT Message-Id: <202307220458.36M4wiWl036225@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Cox Subject: git: 29edff0dea0f - main - arm64/riscv pmap: Initialize the pmap's pm_pvchunk field List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: alc X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 29edff0dea0f7a2df710dd649d0cbcd4a2da3692 Auto-Submitted: auto-generated The branch main has been updated by alc: URL: https://cgit.FreeBSD.org/src/commit/?id=29edff0dea0f7a2df710dd649d0cbcd4a2da3692 commit 29edff0dea0f7a2df710dd649d0cbcd4a2da3692 Author: Alan Cox AuthorDate: 2023-07-16 20:58:04 +0000 Commit: Alan Cox CommitDate: 2023-07-22 04:58:18 +0000 arm64/riscv pmap: Initialize the pmap's pm_pvchunk field I believe that there are two reasons that the missing TAILQ initialization operations haven't caused a problem. First, the TAILQ head's first field is being initialized to zeroes elsewhere. Second, the first access to the TAILQ head's last field is by TAILQ_INSERT_HEAD(), which assigns to the last field without reading it when the first field is NULL. Reviewed by: kib, markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D41118 --- sys/arm64/arm64/pmap.c | 3 +++ sys/riscv/riscv/pmap.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c index c2681104c961..b2591437b3b3 100644 --- a/sys/arm64/arm64/pmap.c +++ b/sys/arm64/arm64/pmap.c @@ -1291,6 +1291,7 @@ pmap_bootstrap(vm_paddr_t kernstart, vm_size_t kernlen) PMAP_LOCK_INIT(kernel_pmap); kernel_pmap->pm_l0_paddr = pmap_early_vtophys((vm_offset_t)kernel_pmap_store.pm_l0); + TAILQ_INIT(&kernel_pmap->pm_pvchunk); vm_radix_init(&kernel_pmap->pm_root); kernel_pmap->pm_cookie = COOKIE_FROM(-1, INT_MIN); kernel_pmap->pm_stage = PM_STAGE1; @@ -2270,6 +2271,7 @@ pmap_pinit0(pmap_t pmap) bzero(&pmap->pm_stats, sizeof(pmap->pm_stats)); pmap->pm_l0_paddr = READ_SPECIALREG(ttbr0_el1); pmap->pm_l0 = (pd_entry_t *)PHYS_TO_DMAP(pmap->pm_l0_paddr); + TAILQ_INIT(&pmap->pm_pvchunk); vm_radix_init(&pmap->pm_root); pmap->pm_cookie = COOKIE_FROM(ASID_RESERVED_FOR_PID_0, INT_MIN); pmap->pm_stage = PM_STAGE1; @@ -2293,6 +2295,7 @@ pmap_pinit_stage(pmap_t pmap, enum pmap_stage stage, int levels) pmap->pm_l0_paddr = VM_PAGE_TO_PHYS(m); pmap->pm_l0 = (pd_entry_t *)PHYS_TO_DMAP(pmap->pm_l0_paddr); + TAILQ_INIT(&pmap->pm_pvchunk); vm_radix_init(&pmap->pm_root); bzero(&pmap->pm_stats, sizeof(pmap->pm_stats)); pmap->pm_cookie = COOKIE_FROM(-1, INT_MAX); diff --git a/sys/riscv/riscv/pmap.c b/sys/riscv/riscv/pmap.c index 7580f091ad86..3732eea14f7d 100644 --- a/sys/riscv/riscv/pmap.c +++ b/sys/riscv/riscv/pmap.c @@ -646,6 +646,7 @@ pmap_bootstrap(vm_offset_t l1pt, vm_paddr_t kernstart, vm_size_t kernlen) /* Set this early so we can use the pagetable walking functions */ kernel_pmap_store.pm_top = (pd_entry_t *)l1pt; PMAP_LOCK_INIT(kernel_pmap); + TAILQ_INIT(&kernel_pmap->pm_pvchunk); vm_radix_init(&kernel_pmap->pm_root); rw_init(&pvh_global_lock, "pmap pv global"); @@ -1327,6 +1328,7 @@ pmap_pinit0(pmap_t pmap) pmap->pm_satp = pmap_satp_mode() | (vtophys(pmap->pm_top) >> PAGE_SHIFT); CPU_ZERO(&pmap->pm_active); + TAILQ_INIT(&pmap->pm_pvchunk); vm_radix_init(&pmap->pm_root); pmap_activate_boot(pmap); } @@ -1369,6 +1371,7 @@ pmap_pinit(pmap_t pmap) pmap->pm_top[i] = kernel_pmap->pm_top[i]; } + TAILQ_INIT(&pmap->pm_pvchunk); vm_radix_init(&pmap->pm_root); return (1); From nobody Sat Jul 22 08:56:19 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R7Kz76zF7z4ndp1; Sat, 22 Jul 2023 08:56: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 4R7Kz75n8Zz49MB; Sat, 22 Jul 2023 08:56:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690016179; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6drNqlqzVCzW4ZAgAFXYDZBUQnqAW72gR76EAGNEW8k=; b=wqr1Pro7TsxIwzwUBhKgofxyQdjukMnGuKgUWGA8cIZGKUHUxhPCBPuhpefBLsiQC/SCBN GvanQgmASlQtZ2AkUPoLFUzgBuu0ynzkmxDJUeAYhjoU3X53H6L7MbrQddcb8dYPXnAm2j fmvD7wgG30+E6eLmI+fsRtLv4CdNb5FFkBBnitzguL2WrwZG3or6veA9jNfBbWoYqmT8I0 ArdxQwGkZtOAA+I5yhH+bG24VxD7VrmzHNxCdrrwzJDuzmtI1WxRbCBaUQFEV0LUhPZXg4 0Vxwohf2lKBv0Lu8Wb3fkokThcy6zit3nIyDgmmBPARxxxDfq+DdYI4kMSw/Zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690016179; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6drNqlqzVCzW4ZAgAFXYDZBUQnqAW72gR76EAGNEW8k=; b=JaFZJl9ZVcJMWImtIIZ3/IKuUz5+Ky98ZqMHGGxdSZN+/N99MBeH2bAmserXvhp4Ruf3rV C/IxcxbHcGTalr5gAxROWL26A9zJIXLVTZ7jVKVA0rfbID41cKR185nk8PyRobtATlb8dx ZWJz1VjCPgUsDLj3ofPpoqzXeCvqg9SQ653KA6Sm0sOS/ugK54ViZG9XG8anKLNdmQVZS6 wtLDEdFG7EwJ8fpurj5iGwJZxe+pwm8e4MiS76D4J/cSbg7tv9uwSZGU3OCS7oCo83jWPq glfdbNi/Yabrnk5q6v8GUNOxZLd6hqLuWWsdgvlOy8XYiScWr8QHU1+QKUspyA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1690016179; a=rsa-sha256; cv=none; b=IA2KZ4Egc6O6pNxZ/PzRnvZFKhnBJ6jtBTW/M1BGwMFECCdxOXhnWUdctv/s6OL5MmFU/3 1z7niOlNzTZgGeAX+KE0uA4L8osTjHIdv8ZtZn3Hp0Rqs20i89TwgF84LoYuLLy/W/9O1E qrEOruZkuU8Bha1iwFSrMXhZWVvHCSrRIQBenckAPATauc59SIyI9MqaiL4g0DkwCIW7o8 9he0V57rMsyc//QOP8xxtGe8srAiQEMCZGYAC0yVcXfATPivddc2w/o38tr+Bt3HXxLLqY NaKXgvTVHqEaA7rYZCK0VkeonsTzAXli+cryVYHsQQ02GQPg8dD78IbSK+PuPA== 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 4R7Kz74sP2zpK9; Sat, 22 Jul 2023 08:56: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 36M8uJD5032982; Sat, 22 Jul 2023 08:56:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36M8uJQs032981; Sat, 22 Jul 2023 08:56:19 GMT (envelope-from git) Date: Sat, 22 Jul 2023 08:56:19 GMT Message-Id: <202307220856.36M8uJQs032981@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Chagin Subject: git: 241a55b4615e - main - libc/csu: Do not compile the finalizer() for PIC build List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 241a55b4615ef671583db13e6729b0028539c063 Auto-Submitted: auto-generated The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=241a55b4615ef671583db13e6729b0028539c063 commit 241a55b4615ef671583db13e6729b0028539c063 Author: Dmitry Chagin AuthorDate: 2023-07-22 08:56:06 +0000 Commit: Dmitry Chagin CommitDate: 2023-07-22 08:56:06 +0000 libc/csu: Do not compile the finalizer() for PIC build Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D41148 --- lib/libc/csu/libc_start1.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/libc/csu/libc_start1.c b/lib/libc/csu/libc_start1.c index d6a973bf0fe0..f0e708e405ce 100644 --- a/lib/libc/csu/libc_start1.c +++ b/lib/libc/csu/libc_start1.c @@ -76,6 +76,7 @@ process_irelocs(void) #error "Define platform reloc type" #endif +#ifndef PIC static void finalizer(void) { @@ -90,6 +91,7 @@ finalizer(void) } _fini(); } +#endif static void handle_static_init(int argc, char **argv, char **env) From nobody Sat Jul 22 11:09:15 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R7Nwc08gNz4nx06; Sat, 22 Jul 2023 11:09: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 4R7NwY3HwYz3sq9; Sat, 22 Jul 2023 11:09:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690024157; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9cReIH+zUw2wHQF1sJA3x7OugJMtZf53xINTW3iH3a0=; b=QAHO6iiTMf6jWVsUYspLJFY4CeMBs2vbPUwcYL5RJkFayvkFtzsbg4OdNwD6Oa5JCfGY7I H5PobGghD3A1MUMVHArxAvqUUPo9WvPrrqvxPocPk0idJvbvj/VaXFSjrNbjxClyNFKhpl 3T0aCTqvhfdCaeb3MSNqwNi+PB76mF4QSOWfZx6CytsecagN26Dnmgq0one3RcZyfuLRVg 6QWhGSlyuzcvgLVaDhGApqpoeFA3Z+FSolrMN603pHHZhsyiOjeuJH7eZcY1+Lzae1ywvN L2rwWHzYh6RW7SbCIOGoTtd5b3mmpu9Q+SIDN9cEuoEqkWHkfTyPjCsZjrXDGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690024157; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9cReIH+zUw2wHQF1sJA3x7OugJMtZf53xINTW3iH3a0=; b=mQjiBm3HWtgpB7iuTrhdNqxtOc1KqCpyqSDk7aP+NUfRmLcgE65AMqUnaZcCEOBZjtwxov cvZFfYtkayswPvYDbMcJdSnaWKAqO5/ju9fIthJH22WRxLf9aK2txHL22g7q7Y8KRQyHJr RfdbXVl+6kCficfIrixWNSs8zkXJnxIk4FY5h6qa8UZGMS8EFTPkOtoiTdonf49dZjF2S5 rxmct+z0gKrTDCcPo/Arfjr9wVwot5WnrLkPI2m18MFPPYHfn5CuR/OKglBctsIK1O4Fmt QAx04d5elW1Phyliap3AkhXTiEGLqDOAM0yUrf8L+n1P7yLTTpL/Sqg7mGSU8g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1690024157; a=rsa-sha256; cv=none; b=vLBH4WzdY/4V3aal0BQRQShIRZDmAV5z6D4hdmkTU/kLl2kwp9PmRJ8Xvr6TYa7iSpUjPf Sg59ZqK6fVcpIsgPA+QpGkqWpGweOi4ZMkmsR1gCk1ltka5QVxs2ZRVzVpOH2Vfjgy5//n eQHcZUhO4Xgq8jsLXwhJzyBgATGwMHlOfAydKtHTeweDWN3pJRn8KyqzfiMWn5IdIViV+D uOjKI2+yyQTDIicdbvSdlkupoegxLQetYcOJ0TkyWHwYkIbSe+1mWbxCWi0IqOPXmzUYt4 V9Gnxu+wQyTS1dNflB9dK+QMCHzfZusixejDcvyv9ftBaJH+cEUYU20FlqUsBA== 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 4R7NwX2pDzzsL6; Sat, 22 Jul 2023 11:09: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 36MB9Fs6049655; Sat, 22 Jul 2023 11:09:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36MB9FOq049654; Sat, 22 Jul 2023 11:09:15 GMT (envelope-from git) Date: Sat, 22 Jul 2023 11:09:15 GMT Message-Id: <202307221109.36MB9FOq049654@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Chagin Subject: git: 41f2c69ee389 - main - linux(4): Modify xattr syscalls to match Linux List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 41f2c69ee38933cd67916c77494ab1b26322ec0a Auto-Submitted: auto-generated The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=41f2c69ee38933cd67916c77494ab1b26322ec0a commit 41f2c69ee38933cd67916c77494ab1b26322ec0a Author: Dmitry Chagin AuthorDate: 2023-07-22 11:03:31 +0000 Commit: Dmitry Chagin CommitDate: 2023-07-22 11:03:31 +0000 linux(4): Modify xattr syscalls to match Linux MFC after: 1 month --- sys/amd64/linux/syscalls.master | 18 +++++++++--------- sys/amd64/linux32/syscalls.master | 18 +++++++++--------- sys/arm64/linux/syscalls.master | 18 +++++++++--------- sys/i386/linux/syscalls.master | 18 +++++++++--------- 4 files changed, 36 insertions(+), 36 deletions(-) diff --git a/sys/amd64/linux/syscalls.master b/sys/amd64/linux/syscalls.master index e4ac2ef99edf..6d8e4102d6fc 100644 --- a/sys/amd64/linux/syscalls.master +++ b/sys/amd64/linux/syscalls.master @@ -1117,7 +1117,7 @@ int linux_setxattr( const char *path, const char *name, - const char *value, + void *value, l_size_t size, l_int flags ); @@ -1126,7 +1126,7 @@ int linux_lsetxattr( const char *path, const char *name, - const char *value, + void *value, l_size_t size, l_int flags ); @@ -1135,7 +1135,7 @@ int linux_fsetxattr( l_int fd, const char *name, - const char *value, + void *value, l_size_t size, l_int flags ); @@ -1144,7 +1144,7 @@ int linux_getxattr( const char *path, const char *name, - char *value, + void *value, l_size_t size ); } @@ -1152,7 +1152,7 @@ int linux_lgetxattr( const char *path, const char *name, - char *value, + void *value, l_size_t size ); } @@ -1160,28 +1160,28 @@ int linux_fgetxattr( l_int fd, const char *name, - char *value, + void *value, l_size_t size ); } 194 AUE_NULL STD { int linux_listxattr( const char *path, - const char *list, + char *list, l_size_t size ); } 195 AUE_NULL STD { int linux_llistxattr( const char *path, - const char *list, + char *list, l_size_t size ); } 196 AUE_NULL STD { int linux_flistxattr( l_int fd, - const char *list, + char *list, l_size_t size ); } diff --git a/sys/amd64/linux32/syscalls.master b/sys/amd64/linux32/syscalls.master index 382b681fdde1..e871f6fdbfc8 100644 --- a/sys/amd64/linux32/syscalls.master +++ b/sys/amd64/linux32/syscalls.master @@ -1222,7 +1222,7 @@ int linux_setxattr( const char *path, const char *name, - const char *value, + void *value, l_size_t size, l_int flags ); @@ -1231,7 +1231,7 @@ int linux_lsetxattr( const char *path, const char *name, - const char *value, + void *value, l_size_t size, l_int flags ); @@ -1240,7 +1240,7 @@ int linux_fsetxattr( l_int fd, const char *name, - const char *value, + void *value, l_size_t size, l_int flags ); @@ -1249,7 +1249,7 @@ int linux_getxattr( const char *path, const char *name, - char *value, + void *value, l_size_t size ); } @@ -1257,7 +1257,7 @@ int linux_lgetxattr( const char *path, const char *name, - char *value, + void *value, l_size_t size ); } @@ -1265,28 +1265,28 @@ int linux_fgetxattr( l_int fd, const char *name, - char *value, + void *value, l_size_t size ); } 232 AUE_NULL STD { int linux_listxattr( const char *path, - const char *list, + char *list, l_size_t size ); } 233 AUE_NULL STD { int linux_llistxattr( const char *path, - const char *list, + char *list, l_size_t size ); } 234 AUE_NULL STD { int linux_flistxattr( l_int fd, - const char *list, + char *list, l_size_t size ); } diff --git a/sys/arm64/linux/syscalls.master b/sys/arm64/linux/syscalls.master index b9dda787389c..04748e30182c 100644 --- a/sys/arm64/linux/syscalls.master +++ b/sys/arm64/linux/syscalls.master @@ -26,7 +26,7 @@ int linux_setxattr( const char *path, const char *name, - const char *value, + void *value, l_size_t size, l_int flags ); @@ -35,7 +35,7 @@ int linux_lsetxattr( const char *path, const char *name, - const char *value, + void *value, l_size_t size, l_int flags ); @@ -44,7 +44,7 @@ int linux_fsetxattr( l_int fd, const char *name, - const char *value, + void *value, l_size_t size, l_int flags ); @@ -53,7 +53,7 @@ int linux_getxattr( const char *path, const char *name, - char *value, + void *value, l_size_t size ); } @@ -61,7 +61,7 @@ int linux_lgetxattr( const char *path, const char *name, - char *value, + void *value, l_size_t size ); } @@ -69,28 +69,28 @@ int linux_fgetxattr( l_int fd, const char *name, - char *value, + void *value, l_size_t size ); } 11 AUE_NULL STD { int linux_listxattr( const char *path, - const char *list, + char *list, l_size_t size ); } 12 AUE_NULL STD { int linux_llistxattr( const char *path, - const char *list, + char *list, l_size_t size ); } 13 AUE_NULL STD { int linux_flistxattr( l_int fd, - const char *list, + char *list, l_size_t size ); } diff --git a/sys/i386/linux/syscalls.master b/sys/i386/linux/syscalls.master index c7168f7da80e..614731ee2cfe 100644 --- a/sys/i386/linux/syscalls.master +++ b/sys/i386/linux/syscalls.master @@ -1238,7 +1238,7 @@ int linux_setxattr( const char *path, const char *name, - const char *value, + void *value, l_size_t size, l_int flags ); @@ -1247,7 +1247,7 @@ int linux_lsetxattr( const char *path, const char *name, - const char *value, + void *value, l_size_t size, l_int flags ); @@ -1256,7 +1256,7 @@ int linux_fsetxattr( l_int fd, const char *name, - const char *value, + void *value, l_size_t size, l_int flags ); @@ -1265,7 +1265,7 @@ int linux_getxattr( const char *path, const char *name, - char *value, + void *value, l_size_t size ); } @@ -1273,7 +1273,7 @@ int linux_lgetxattr( const char *path, const char *name, - char *value, + void *value, l_size_t size ); } @@ -1281,28 +1281,28 @@ int linux_fgetxattr( l_int fd, const char *name, - char *value, + void *value, l_size_t size ); } 232 AUE_NULL STD { int linux_listxattr( const char *path, - const char *list, + char *list, l_size_t size ); } 233 AUE_NULL STD { int linux_llistxattr( const char *path, - const char *list, + char *list, l_size_t size ); } 234 AUE_NULL STD { int linux_flistxattr( l_int fd, - const char *list, + char *list, l_size_t size ); } From nobody Sat Jul 22 11:09:16 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R7Nwb70Kbz4nwwh; Sat, 22 Jul 2023 11:09: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 4R7NwY3BmVz3skX; Sat, 22 Jul 2023 11:09:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690024157; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bsQM5o4r8TpUyLf+mS6k0HeE3YwiboIfoCavFsXkcpw=; b=EhBX33PZ2/NUtOoGQ2mSm+sOe3sQJOBJilujkpRNI24qwWQL0uHGxXzWZUDdKgwYDHv8DR RVh3436JPL2C4pK1vs/gWuq4hTZbWAf6F9Pco9AZ7jqCzY8RXahtypIkY0yOeoRarNA9Nv VSldZuLVYKpIP1iB38voAhszaDrp59GiALP/WgZWNlGzsTaf5YRmrqk+P9vUmdmZU+Ks4O zlIPn7R4Tz2qECRMCZIEfYrSMBJq/bcw4j9qwD8/Dtdqhab2nHBBxilGSGd7gB2UJ9L8HK HRzb+/jcSjYbzKXdan4rpsjAWnVccmP/GUBCsFV/7Jv8M7tnQoaOs1LDvcbTrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690024157; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bsQM5o4r8TpUyLf+mS6k0HeE3YwiboIfoCavFsXkcpw=; b=qbBimTuw+zaO0TTcnKtzc8eJ3l1QOfYG/qwSY46TEseZsHouBnACYyhjCYhnPl54ZA54UX umbj2jJnUl7t2/OBaXMOiLTMmYK8uV8yRTtzfTdaMccVNPeSberNWsQCkXsjCHJ/Nrb9ou 67Pe8v5IWtMYvT9YOcb8xnFr3rAG5F3oDst5h8F7uclyfZM0H3Sxerk60tjOqAzqHARP7P DwUjakvDe/9cmCgZzu2BYzpYDLGSgpVJjX9h67eceVp+0Rx8RDCZCfCPlXE3bn4U1jjvJk BkY9+mHUWkxXd8/Q+zZFOiHdtUWZTSR/ED9QZx/2d8qXy/2Sk6xIIgEr3Z1Jmg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1690024157; a=rsa-sha256; cv=none; b=q+rysOoK6WugtGGk7DzO701bm6XycwmWHchmQ98yp2rquYbVA95DHcgV9n3mnWfHl4YEPy UNuCv8O1hCtPOvWmemRjTOKmejQ+Y6XeUj9bk6cjKbfJFKorcaUHA/ATQNdK+AnpYzzEjb e8gWv7fkdadVBfFfEoR/NT7cg3envAqvUyZzlgIXNXOH7u5q56yY4RcYp2qlA0ek2fJaL5 Eu7/1367ho4ctsqUELBLiyrqZtMBlkqIe1pC5TxaSrRZu77capddQi/cCMaOPO+8cU85Iv z2gRYUzA2UtedlN4oSySOF5eg/BYu80TsL8u/gC3Wj/sZwC8ZkYtBb2QbyfftA== 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 4R7NwX6mlzzsPv; Sat, 22 Jul 2023 11:09: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 36MB9G7W049674; Sat, 22 Jul 2023 11:09:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36MB9GpP049673; Sat, 22 Jul 2023 11:09:16 GMT (envelope-from git) Date: Sat, 22 Jul 2023 11:09:16 GMT Message-Id: <202307221109.36MB9GpP049673@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Chagin Subject: git: d9c2dc6bf17b - main - linux(4): Regen for xattr syscalls List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d9c2dc6bf17b7710cbbac18bc0b913803b6c8a50 Auto-Submitted: auto-generated The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=d9c2dc6bf17b7710cbbac18bc0b913803b6c8a50 commit d9c2dc6bf17b7710cbbac18bc0b913803b6c8a50 Author: Dmitry Chagin AuthorDate: 2023-07-22 11:03:32 +0000 Commit: Dmitry Chagin CommitDate: 2023-07-22 11:03:32 +0000 linux(4): Regen for xattr syscalls MFC after: 1 month --- sys/amd64/linux/linux_proto.h | 18 ++++++++-------- sys/amd64/linux/linux_systrace_args.c | 36 +++++++++++++++---------------- sys/amd64/linux32/linux32_proto.h | 18 ++++++++-------- sys/amd64/linux32/linux32_systrace_args.c | 36 +++++++++++++++---------------- sys/arm64/linux/linux_proto.h | 18 ++++++++-------- sys/arm64/linux/linux_systrace_args.c | 36 +++++++++++++++---------------- sys/i386/linux/linux_proto.h | 18 ++++++++-------- sys/i386/linux/linux_systrace_args.c | 36 +++++++++++++++---------------- 8 files changed, 108 insertions(+), 108 deletions(-) diff --git a/sys/amd64/linux/linux_proto.h b/sys/amd64/linux/linux_proto.h index a767712d6dce..3bf8ea0fc7b1 100644 --- a/sys/amd64/linux/linux_proto.h +++ b/sys/amd64/linux/linux_proto.h @@ -634,55 +634,55 @@ struct linux_readahead_args { struct linux_setxattr_args { char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; char name_l_[PADL_(const char *)]; const char * name; char name_r_[PADR_(const char *)]; - char value_l_[PADL_(const char *)]; const char * value; char value_r_[PADR_(const char *)]; + char value_l_[PADL_(void *)]; void * value; char value_r_[PADR_(void *)]; char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; }; struct linux_lsetxattr_args { char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; char name_l_[PADL_(const char *)]; const char * name; char name_r_[PADR_(const char *)]; - char value_l_[PADL_(const char *)]; const char * value; char value_r_[PADR_(const char *)]; + char value_l_[PADL_(void *)]; void * value; char value_r_[PADR_(void *)]; char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; }; struct linux_fsetxattr_args { char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)]; char name_l_[PADL_(const char *)]; const char * name; char name_r_[PADR_(const char *)]; - char value_l_[PADL_(const char *)]; const char * value; char value_r_[PADR_(const char *)]; + char value_l_[PADL_(void *)]; void * value; char value_r_[PADR_(void *)]; char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; }; struct linux_getxattr_args { char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; char name_l_[PADL_(const char *)]; const char * name; char name_r_[PADR_(const char *)]; - char value_l_[PADL_(char *)]; char * value; char value_r_[PADR_(char *)]; + char value_l_[PADL_(void *)]; void * value; char value_r_[PADR_(void *)]; char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; }; struct linux_lgetxattr_args { char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; char name_l_[PADL_(const char *)]; const char * name; char name_r_[PADR_(const char *)]; - char value_l_[PADL_(char *)]; char * value; char value_r_[PADR_(char *)]; + char value_l_[PADL_(void *)]; void * value; char value_r_[PADR_(void *)]; char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; }; struct linux_fgetxattr_args { char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)]; char name_l_[PADL_(const char *)]; const char * name; char name_r_[PADR_(const char *)]; - char value_l_[PADL_(char *)]; char * value; char value_r_[PADR_(char *)]; + char value_l_[PADL_(void *)]; void * value; char value_r_[PADR_(void *)]; char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; }; struct linux_listxattr_args { char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; - char list_l_[PADL_(const char *)]; const char * list; char list_r_[PADR_(const char *)]; + char list_l_[PADL_(char *)]; char * list; char list_r_[PADR_(char *)]; char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; }; struct linux_llistxattr_args { char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; - char list_l_[PADL_(const char *)]; const char * list; char list_r_[PADR_(const char *)]; + char list_l_[PADL_(char *)]; char * list; char list_r_[PADR_(char *)]; char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; }; struct linux_flistxattr_args { char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)]; - char list_l_[PADL_(const char *)]; const char * list; char list_r_[PADR_(const char *)]; + char list_l_[PADL_(char *)]; char * list; char list_r_[PADR_(char *)]; char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; }; struct linux_removexattr_args { diff --git a/sys/amd64/linux/linux_systrace_args.c b/sys/amd64/linux/linux_systrace_args.c index 67571971d584..6ff1764b077c 100644 --- a/sys/amd64/linux/linux_systrace_args.c +++ b/sys/amd64/linux/linux_systrace_args.c @@ -1436,7 +1436,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct linux_setxattr_args *p = params; uarg[a++] = (intptr_t)p->path; /* const char * */ uarg[a++] = (intptr_t)p->name; /* const char * */ - uarg[a++] = (intptr_t)p->value; /* const char * */ + uarg[a++] = (intptr_t)p->value; /* void * */ iarg[a++] = p->size; /* l_size_t */ iarg[a++] = p->flags; /* l_int */ *n_args = 5; @@ -1447,7 +1447,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct linux_lsetxattr_args *p = params; uarg[a++] = (intptr_t)p->path; /* const char * */ uarg[a++] = (intptr_t)p->name; /* const char * */ - uarg[a++] = (intptr_t)p->value; /* const char * */ + uarg[a++] = (intptr_t)p->value; /* void * */ iarg[a++] = p->size; /* l_size_t */ iarg[a++] = p->flags; /* l_int */ *n_args = 5; @@ -1458,7 +1458,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct linux_fsetxattr_args *p = params; iarg[a++] = p->fd; /* l_int */ uarg[a++] = (intptr_t)p->name; /* const char * */ - uarg[a++] = (intptr_t)p->value; /* const char * */ + uarg[a++] = (intptr_t)p->value; /* void * */ iarg[a++] = p->size; /* l_size_t */ iarg[a++] = p->flags; /* l_int */ *n_args = 5; @@ -1469,7 +1469,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct linux_getxattr_args *p = params; uarg[a++] = (intptr_t)p->path; /* const char * */ uarg[a++] = (intptr_t)p->name; /* const char * */ - uarg[a++] = (intptr_t)p->value; /* char * */ + uarg[a++] = (intptr_t)p->value; /* void * */ iarg[a++] = p->size; /* l_size_t */ *n_args = 4; break; @@ -1479,7 +1479,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct linux_lgetxattr_args *p = params; uarg[a++] = (intptr_t)p->path; /* const char * */ uarg[a++] = (intptr_t)p->name; /* const char * */ - uarg[a++] = (intptr_t)p->value; /* char * */ + uarg[a++] = (intptr_t)p->value; /* void * */ iarg[a++] = p->size; /* l_size_t */ *n_args = 4; break; @@ -1489,7 +1489,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct linux_fgetxattr_args *p = params; iarg[a++] = p->fd; /* l_int */ uarg[a++] = (intptr_t)p->name; /* const char * */ - uarg[a++] = (intptr_t)p->value; /* char * */ + uarg[a++] = (intptr_t)p->value; /* void * */ iarg[a++] = p->size; /* l_size_t */ *n_args = 4; break; @@ -1498,7 +1498,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 194: { struct linux_listxattr_args *p = params; uarg[a++] = (intptr_t)p->path; /* const char * */ - uarg[a++] = (intptr_t)p->list; /* const char * */ + uarg[a++] = (intptr_t)p->list; /* char * */ iarg[a++] = p->size; /* l_size_t */ *n_args = 3; break; @@ -1507,7 +1507,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 195: { struct linux_llistxattr_args *p = params; uarg[a++] = (intptr_t)p->path; /* const char * */ - uarg[a++] = (intptr_t)p->list; /* const char * */ + uarg[a++] = (intptr_t)p->list; /* char * */ iarg[a++] = p->size; /* l_size_t */ *n_args = 3; break; @@ -1516,7 +1516,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 196: { struct linux_flistxattr_args *p = params; iarg[a++] = p->fd; /* l_int */ - uarg[a++] = (intptr_t)p->list; /* const char * */ + uarg[a++] = (intptr_t)p->list; /* char * */ iarg[a++] = p->size; /* l_size_t */ *n_args = 3; break; @@ -5039,7 +5039,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) p = "userland const char *"; break; case 2: - p = "userland const char *"; + p = "userland void *"; break; case 3: p = "l_size_t"; @@ -5061,7 +5061,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) p = "userland const char *"; break; case 2: - p = "userland const char *"; + p = "userland void *"; break; case 3: p = "l_size_t"; @@ -5083,7 +5083,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) p = "userland const char *"; break; case 2: - p = "userland const char *"; + p = "userland void *"; break; case 3: p = "l_size_t"; @@ -5105,7 +5105,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) p = "userland const char *"; break; case 2: - p = "userland char *"; + p = "userland void *"; break; case 3: p = "l_size_t"; @@ -5124,7 +5124,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) p = "userland const char *"; break; case 2: - p = "userland char *"; + p = "userland void *"; break; case 3: p = "l_size_t"; @@ -5143,7 +5143,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) p = "userland const char *"; break; case 2: - p = "userland char *"; + p = "userland void *"; break; case 3: p = "l_size_t"; @@ -5159,7 +5159,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) p = "userland const char *"; break; case 1: - p = "userland const char *"; + p = "userland char *"; break; case 2: p = "l_size_t"; @@ -5175,7 +5175,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) p = "userland const char *"; break; case 1: - p = "userland const char *"; + p = "userland char *"; break; case 2: p = "l_size_t"; @@ -5191,7 +5191,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) p = "l_int"; break; case 1: - p = "userland const char *"; + p = "userland char *"; break; case 2: p = "l_size_t"; diff --git a/sys/amd64/linux32/linux32_proto.h b/sys/amd64/linux32/linux32_proto.h index f9b3ee7e9452..1b4892124c7c 100644 --- a/sys/amd64/linux32/linux32_proto.h +++ b/sys/amd64/linux32/linux32_proto.h @@ -712,55 +712,55 @@ struct linux_gettid_args { struct linux_setxattr_args { char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; char name_l_[PADL_(const char *)]; const char * name; char name_r_[PADR_(const char *)]; - char value_l_[PADL_(const char *)]; const char * value; char value_r_[PADR_(const char *)]; + char value_l_[PADL_(void *)]; void * value; char value_r_[PADR_(void *)]; char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; }; struct linux_lsetxattr_args { char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; char name_l_[PADL_(const char *)]; const char * name; char name_r_[PADR_(const char *)]; - char value_l_[PADL_(const char *)]; const char * value; char value_r_[PADR_(const char *)]; + char value_l_[PADL_(void *)]; void * value; char value_r_[PADR_(void *)]; char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; }; struct linux_fsetxattr_args { char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)]; char name_l_[PADL_(const char *)]; const char * name; char name_r_[PADR_(const char *)]; - char value_l_[PADL_(const char *)]; const char * value; char value_r_[PADR_(const char *)]; + char value_l_[PADL_(void *)]; void * value; char value_r_[PADR_(void *)]; char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; }; struct linux_getxattr_args { char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; char name_l_[PADL_(const char *)]; const char * name; char name_r_[PADR_(const char *)]; - char value_l_[PADL_(char *)]; char * value; char value_r_[PADR_(char *)]; + char value_l_[PADL_(void *)]; void * value; char value_r_[PADR_(void *)]; char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; }; struct linux_lgetxattr_args { char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; char name_l_[PADL_(const char *)]; const char * name; char name_r_[PADR_(const char *)]; - char value_l_[PADL_(char *)]; char * value; char value_r_[PADR_(char *)]; + char value_l_[PADL_(void *)]; void * value; char value_r_[PADR_(void *)]; char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; }; struct linux_fgetxattr_args { char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)]; char name_l_[PADL_(const char *)]; const char * name; char name_r_[PADR_(const char *)]; - char value_l_[PADL_(char *)]; char * value; char value_r_[PADR_(char *)]; + char value_l_[PADL_(void *)]; void * value; char value_r_[PADR_(void *)]; char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; }; struct linux_listxattr_args { char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; - char list_l_[PADL_(const char *)]; const char * list; char list_r_[PADR_(const char *)]; + char list_l_[PADL_(char *)]; char * list; char list_r_[PADR_(char *)]; char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; }; struct linux_llistxattr_args { char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; - char list_l_[PADL_(const char *)]; const char * list; char list_r_[PADR_(const char *)]; + char list_l_[PADL_(char *)]; char * list; char list_r_[PADR_(char *)]; char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; }; struct linux_flistxattr_args { char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)]; - char list_l_[PADL_(const char *)]; const char * list; char list_r_[PADR_(const char *)]; + char list_l_[PADL_(char *)]; char * list; char list_r_[PADR_(char *)]; char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; }; struct linux_removexattr_args { diff --git a/sys/amd64/linux32/linux32_systrace_args.c b/sys/amd64/linux32/linux32_systrace_args.c index 72ca52bc84c8..c137bcb18fd6 100644 --- a/sys/amd64/linux32/linux32_systrace_args.c +++ b/sys/amd64/linux32/linux32_systrace_args.c @@ -1562,7 +1562,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct linux_setxattr_args *p = params; uarg[a++] = (intptr_t)p->path; /* const char * */ uarg[a++] = (intptr_t)p->name; /* const char * */ - uarg[a++] = (intptr_t)p->value; /* const char * */ + uarg[a++] = (intptr_t)p->value; /* void * */ iarg[a++] = p->size; /* l_size_t */ iarg[a++] = p->flags; /* l_int */ *n_args = 5; @@ -1573,7 +1573,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct linux_lsetxattr_args *p = params; uarg[a++] = (intptr_t)p->path; /* const char * */ uarg[a++] = (intptr_t)p->name; /* const char * */ - uarg[a++] = (intptr_t)p->value; /* const char * */ + uarg[a++] = (intptr_t)p->value; /* void * */ iarg[a++] = p->size; /* l_size_t */ iarg[a++] = p->flags; /* l_int */ *n_args = 5; @@ -1584,7 +1584,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct linux_fsetxattr_args *p = params; iarg[a++] = p->fd; /* l_int */ uarg[a++] = (intptr_t)p->name; /* const char * */ - uarg[a++] = (intptr_t)p->value; /* const char * */ + uarg[a++] = (intptr_t)p->value; /* void * */ iarg[a++] = p->size; /* l_size_t */ iarg[a++] = p->flags; /* l_int */ *n_args = 5; @@ -1595,7 +1595,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct linux_getxattr_args *p = params; uarg[a++] = (intptr_t)p->path; /* const char * */ uarg[a++] = (intptr_t)p->name; /* const char * */ - uarg[a++] = (intptr_t)p->value; /* char * */ + uarg[a++] = (intptr_t)p->value; /* void * */ iarg[a++] = p->size; /* l_size_t */ *n_args = 4; break; @@ -1605,7 +1605,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct linux_lgetxattr_args *p = params; uarg[a++] = (intptr_t)p->path; /* const char * */ uarg[a++] = (intptr_t)p->name; /* const char * */ - uarg[a++] = (intptr_t)p->value; /* char * */ + uarg[a++] = (intptr_t)p->value; /* void * */ iarg[a++] = p->size; /* l_size_t */ *n_args = 4; break; @@ -1615,7 +1615,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct linux_fgetxattr_args *p = params; iarg[a++] = p->fd; /* l_int */ uarg[a++] = (intptr_t)p->name; /* const char * */ - uarg[a++] = (intptr_t)p->value; /* char * */ + uarg[a++] = (intptr_t)p->value; /* void * */ iarg[a++] = p->size; /* l_size_t */ *n_args = 4; break; @@ -1624,7 +1624,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 232: { struct linux_listxattr_args *p = params; uarg[a++] = (intptr_t)p->path; /* const char * */ - uarg[a++] = (intptr_t)p->list; /* const char * */ + uarg[a++] = (intptr_t)p->list; /* char * */ iarg[a++] = p->size; /* l_size_t */ *n_args = 3; break; @@ -1633,7 +1633,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 233: { struct linux_llistxattr_args *p = params; uarg[a++] = (intptr_t)p->path; /* const char * */ - uarg[a++] = (intptr_t)p->list; /* const char * */ + uarg[a++] = (intptr_t)p->list; /* char * */ iarg[a++] = p->size; /* l_size_t */ *n_args = 3; break; @@ -1642,7 +1642,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 234: { struct linux_flistxattr_args *p = params; iarg[a++] = p->fd; /* l_int */ - uarg[a++] = (intptr_t)p->list; /* const char * */ + uarg[a++] = (intptr_t)p->list; /* char * */ iarg[a++] = p->size; /* l_size_t */ *n_args = 3; break; @@ -5694,7 +5694,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) p = "userland const char *"; break; case 2: - p = "userland const char *"; + p = "userland void *"; break; case 3: p = "l_size_t"; @@ -5716,7 +5716,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) p = "userland const char *"; break; case 2: - p = "userland const char *"; + p = "userland void *"; break; case 3: p = "l_size_t"; @@ -5738,7 +5738,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) p = "userland const char *"; break; case 2: - p = "userland const char *"; + p = "userland void *"; break; case 3: p = "l_size_t"; @@ -5760,7 +5760,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) p = "userland const char *"; break; case 2: - p = "userland char *"; + p = "userland void *"; break; case 3: p = "l_size_t"; @@ -5779,7 +5779,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) p = "userland const char *"; break; case 2: - p = "userland char *"; + p = "userland void *"; break; case 3: p = "l_size_t"; @@ -5798,7 +5798,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) p = "userland const char *"; break; case 2: - p = "userland char *"; + p = "userland void *"; break; case 3: p = "l_size_t"; @@ -5814,7 +5814,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) p = "userland const char *"; break; case 1: - p = "userland const char *"; + p = "userland char *"; break; case 2: p = "l_size_t"; @@ -5830,7 +5830,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) p = "userland const char *"; break; case 1: - p = "userland const char *"; + p = "userland char *"; break; case 2: p = "l_size_t"; @@ -5846,7 +5846,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) p = "l_int"; break; case 1: - p = "userland const char *"; + p = "userland char *"; break; case 2: p = "l_size_t"; diff --git a/sys/arm64/linux/linux_proto.h b/sys/arm64/linux/linux_proto.h index b02e284d8d5e..1c3dffcd6bb6 100644 --- a/sys/arm64/linux/linux_proto.h +++ b/sys/arm64/linux/linux_proto.h @@ -37,55 +37,55 @@ struct thread; struct linux_setxattr_args { char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; char name_l_[PADL_(const char *)]; const char * name; char name_r_[PADR_(const char *)]; - char value_l_[PADL_(const char *)]; const char * value; char value_r_[PADR_(const char *)]; + char value_l_[PADL_(void *)]; void * value; char value_r_[PADR_(void *)]; char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; }; struct linux_lsetxattr_args { char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; char name_l_[PADL_(const char *)]; const char * name; char name_r_[PADR_(const char *)]; - char value_l_[PADL_(const char *)]; const char * value; char value_r_[PADR_(const char *)]; + char value_l_[PADL_(void *)]; void * value; char value_r_[PADR_(void *)]; char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; }; struct linux_fsetxattr_args { char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)]; char name_l_[PADL_(const char *)]; const char * name; char name_r_[PADR_(const char *)]; - char value_l_[PADL_(const char *)]; const char * value; char value_r_[PADR_(const char *)]; + char value_l_[PADL_(void *)]; void * value; char value_r_[PADR_(void *)]; char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; }; struct linux_getxattr_args { char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; char name_l_[PADL_(const char *)]; const char * name; char name_r_[PADR_(const char *)]; - char value_l_[PADL_(char *)]; char * value; char value_r_[PADR_(char *)]; + char value_l_[PADL_(void *)]; void * value; char value_r_[PADR_(void *)]; char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; }; struct linux_lgetxattr_args { char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; char name_l_[PADL_(const char *)]; const char * name; char name_r_[PADR_(const char *)]; - char value_l_[PADL_(char *)]; char * value; char value_r_[PADR_(char *)]; + char value_l_[PADL_(void *)]; void * value; char value_r_[PADR_(void *)]; char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; }; struct linux_fgetxattr_args { char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)]; char name_l_[PADL_(const char *)]; const char * name; char name_r_[PADR_(const char *)]; - char value_l_[PADL_(char *)]; char * value; char value_r_[PADR_(char *)]; + char value_l_[PADL_(void *)]; void * value; char value_r_[PADR_(void *)]; char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; }; struct linux_listxattr_args { char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; - char list_l_[PADL_(const char *)]; const char * list; char list_r_[PADR_(const char *)]; + char list_l_[PADL_(char *)]; char * list; char list_r_[PADR_(char *)]; char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; }; struct linux_llistxattr_args { char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; - char list_l_[PADL_(const char *)]; const char * list; char list_r_[PADR_(const char *)]; + char list_l_[PADL_(char *)]; char * list; char list_r_[PADR_(char *)]; char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; }; struct linux_flistxattr_args { char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)]; - char list_l_[PADL_(const char *)]; const char * list; char list_r_[PADR_(const char *)]; + char list_l_[PADL_(char *)]; char * list; char list_r_[PADR_(char *)]; char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; }; struct linux_removexattr_args { diff --git a/sys/arm64/linux/linux_systrace_args.c b/sys/arm64/linux/linux_systrace_args.c index 123388136fd8..a2ef2d257037 100644 --- a/sys/arm64/linux/linux_systrace_args.c +++ b/sys/arm64/linux/linux_systrace_args.c @@ -17,7 +17,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct linux_setxattr_args *p = params; uarg[a++] = (intptr_t)p->path; /* const char * */ uarg[a++] = (intptr_t)p->name; /* const char * */ - uarg[a++] = (intptr_t)p->value; /* const char * */ + uarg[a++] = (intptr_t)p->value; /* void * */ iarg[a++] = p->size; /* l_size_t */ iarg[a++] = p->flags; /* l_int */ *n_args = 5; @@ -28,7 +28,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct linux_lsetxattr_args *p = params; uarg[a++] = (intptr_t)p->path; /* const char * */ uarg[a++] = (intptr_t)p->name; /* const char * */ - uarg[a++] = (intptr_t)p->value; /* const char * */ + uarg[a++] = (intptr_t)p->value; /* void * */ iarg[a++] = p->size; /* l_size_t */ iarg[a++] = p->flags; /* l_int */ *n_args = 5; @@ -39,7 +39,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct linux_fsetxattr_args *p = params; iarg[a++] = p->fd; /* l_int */ uarg[a++] = (intptr_t)p->name; /* const char * */ - uarg[a++] = (intptr_t)p->value; /* const char * */ + uarg[a++] = (intptr_t)p->value; /* void * */ iarg[a++] = p->size; /* l_size_t */ iarg[a++] = p->flags; /* l_int */ *n_args = 5; @@ -50,7 +50,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct linux_getxattr_args *p = params; uarg[a++] = (intptr_t)p->path; /* const char * */ uarg[a++] = (intptr_t)p->name; /* const char * */ - uarg[a++] = (intptr_t)p->value; /* char * */ + uarg[a++] = (intptr_t)p->value; /* void * */ iarg[a++] = p->size; /* l_size_t */ *n_args = 4; break; @@ -60,7 +60,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct linux_lgetxattr_args *p = params; uarg[a++] = (intptr_t)p->path; /* const char * */ uarg[a++] = (intptr_t)p->name; /* const char * */ - uarg[a++] = (intptr_t)p->value; /* char * */ + uarg[a++] = (intptr_t)p->value; /* void * */ iarg[a++] = p->size; /* l_size_t */ *n_args = 4; break; @@ -70,7 +70,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct linux_fgetxattr_args *p = params; iarg[a++] = p->fd; /* l_int */ uarg[a++] = (intptr_t)p->name; /* const char * */ - uarg[a++] = (intptr_t)p->value; /* char * */ + uarg[a++] = (intptr_t)p->value; /* void * */ iarg[a++] = p->size; /* l_size_t */ *n_args = 4; break; @@ -79,7 +79,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 11: { struct linux_listxattr_args *p = params; uarg[a++] = (intptr_t)p->path; /* const char * */ - uarg[a++] = (intptr_t)p->list; /* const char * */ + uarg[a++] = (intptr_t)p->list; /* char * */ iarg[a++] = p->size; /* l_size_t */ *n_args = 3; break; @@ -88,7 +88,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 12: { struct linux_llistxattr_args *p = params; uarg[a++] = (intptr_t)p->path; /* const char * */ - uarg[a++] = (intptr_t)p->list; /* const char * */ + uarg[a++] = (intptr_t)p->list; /* char * */ iarg[a++] = p->size; /* l_size_t */ *n_args = 3; break; @@ -97,7 +97,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 13: { struct linux_flistxattr_args *p = params; iarg[a++] = p->fd; /* l_int */ - uarg[a++] = (intptr_t)p->list; /* const char * */ + uarg[a++] = (intptr_t)p->list; /* char * */ iarg[a++] = p->size; /* l_size_t */ *n_args = 3; break; @@ -2387,7 +2387,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) p = "userland const char *"; break; case 2: - p = "userland const char *"; + p = "userland void *"; break; case 3: p = "l_size_t"; @@ -2409,7 +2409,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) p = "userland const char *"; break; case 2: - p = "userland const char *"; + p = "userland void *"; break; case 3: p = "l_size_t"; @@ -2431,7 +2431,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) p = "userland const char *"; break; case 2: - p = "userland const char *"; + p = "userland void *"; break; case 3: p = "l_size_t"; @@ -2453,7 +2453,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) p = "userland const char *"; break; case 2: - p = "userland char *"; + p = "userland void *"; break; case 3: p = "l_size_t"; @@ -2472,7 +2472,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) p = "userland const char *"; break; case 2: - p = "userland char *"; + p = "userland void *"; break; case 3: p = "l_size_t"; @@ -2491,7 +2491,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) p = "userland const char *"; break; case 2: - p = "userland char *"; + p = "userland void *"; break; case 3: p = "l_size_t"; @@ -2507,7 +2507,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) p = "userland const char *"; break; case 1: - p = "userland const char *"; + p = "userland char *"; break; case 2: p = "l_size_t"; @@ -2523,7 +2523,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) p = "userland const char *"; break; case 1: - p = "userland const char *"; + p = "userland char *"; break; case 2: p = "l_size_t"; @@ -2539,7 +2539,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) p = "l_int"; break; case 1: - p = "userland const char *"; + p = "userland char *"; break; case 2: p = "l_size_t"; diff --git a/sys/i386/linux/linux_proto.h b/sys/i386/linux/linux_proto.h index f1f1c6f6333e..22564f25f484 100644 --- a/sys/i386/linux/linux_proto.h +++ b/sys/i386/linux/linux_proto.h @@ -705,55 +705,55 @@ struct linux_gettid_args { struct linux_setxattr_args { char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; char name_l_[PADL_(const char *)]; const char * name; char name_r_[PADR_(const char *)]; - char value_l_[PADL_(const char *)]; const char * value; char value_r_[PADR_(const char *)]; + char value_l_[PADL_(void *)]; void * value; char value_r_[PADR_(void *)]; char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; }; struct linux_lsetxattr_args { char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; char name_l_[PADL_(const char *)]; const char * name; char name_r_[PADR_(const char *)]; - char value_l_[PADL_(const char *)]; const char * value; char value_r_[PADR_(const char *)]; + char value_l_[PADL_(void *)]; void * value; char value_r_[PADR_(void *)]; char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; }; struct linux_fsetxattr_args { char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)]; char name_l_[PADL_(const char *)]; const char * name; char name_r_[PADR_(const char *)]; - char value_l_[PADL_(const char *)]; const char * value; char value_r_[PADR_(const char *)]; + char value_l_[PADL_(void *)]; void * value; char value_r_[PADR_(void *)]; char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; }; struct linux_getxattr_args { char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; char name_l_[PADL_(const char *)]; const char * name; char name_r_[PADR_(const char *)]; - char value_l_[PADL_(char *)]; char * value; char value_r_[PADR_(char *)]; + char value_l_[PADL_(void *)]; void * value; char value_r_[PADR_(void *)]; char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; }; struct linux_lgetxattr_args { char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; char name_l_[PADL_(const char *)]; const char * name; char name_r_[PADR_(const char *)]; - char value_l_[PADL_(char *)]; char * value; char value_r_[PADR_(char *)]; + char value_l_[PADL_(void *)]; void * value; char value_r_[PADR_(void *)]; char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; }; struct linux_fgetxattr_args { char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)]; char name_l_[PADL_(const char *)]; const char * name; char name_r_[PADR_(const char *)]; - char value_l_[PADL_(char *)]; char * value; char value_r_[PADR_(char *)]; + char value_l_[PADL_(void *)]; void * value; char value_r_[PADR_(void *)]; char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; }; struct linux_listxattr_args { char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; - char list_l_[PADL_(const char *)]; const char * list; char list_r_[PADR_(const char *)]; + char list_l_[PADL_(char *)]; char * list; char list_r_[PADR_(char *)]; char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; }; struct linux_llistxattr_args { char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; - char list_l_[PADL_(const char *)]; const char * list; char list_r_[PADR_(const char *)]; + char list_l_[PADL_(char *)]; char * list; char list_r_[PADR_(char *)]; char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; }; struct linux_flistxattr_args { char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)]; - char list_l_[PADL_(const char *)]; const char * list; char list_r_[PADR_(const char *)]; + char list_l_[PADL_(char *)]; char * list; char list_r_[PADR_(char *)]; char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; }; struct linux_removexattr_args { diff --git a/sys/i386/linux/linux_systrace_args.c b/sys/i386/linux/linux_systrace_args.c index a50c6b2d77a9..e93d46556092 100644 --- a/sys/i386/linux/linux_systrace_args.c +++ b/sys/i386/linux/linux_systrace_args.c @@ -1593,7 +1593,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct linux_setxattr_args *p = params; uarg[a++] = (intptr_t)p->path; /* const char * */ uarg[a++] = (intptr_t)p->name; /* const char * */ - uarg[a++] = (intptr_t)p->value; /* const char * */ + uarg[a++] = (intptr_t)p->value; /* void * */ iarg[a++] = p->size; /* l_size_t */ iarg[a++] = p->flags; /* l_int */ *n_args = 5; @@ -1604,7 +1604,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct linux_lsetxattr_args *p = params; uarg[a++] = (intptr_t)p->path; /* const char * */ uarg[a++] = (intptr_t)p->name; /* const char * */ - uarg[a++] = (intptr_t)p->value; /* const char * */ + uarg[a++] = (intptr_t)p->value; /* void * */ iarg[a++] = p->size; /* l_size_t */ iarg[a++] = p->flags; /* l_int */ *n_args = 5; @@ -1615,7 +1615,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct linux_fsetxattr_args *p = params; iarg[a++] = p->fd; /* l_int */ uarg[a++] = (intptr_t)p->name; /* const char * */ - uarg[a++] = (intptr_t)p->value; /* const char * */ + uarg[a++] = (intptr_t)p->value; /* void * */ iarg[a++] = p->size; /* l_size_t */ iarg[a++] = p->flags; /* l_int */ *n_args = 5; @@ -1626,7 +1626,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct linux_getxattr_args *p = params; uarg[a++] = (intptr_t)p->path; /* const char * */ uarg[a++] = (intptr_t)p->name; /* const char * */ - uarg[a++] = (intptr_t)p->value; /* char * */ + uarg[a++] = (intptr_t)p->value; /* void * */ iarg[a++] = p->size; /* l_size_t */ *n_args = 4; break; @@ -1636,7 +1636,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct linux_lgetxattr_args *p = params; uarg[a++] = (intptr_t)p->path; /* const char * */ uarg[a++] = (intptr_t)p->name; /* const char * */ - uarg[a++] = (intptr_t)p->value; /* char * */ + uarg[a++] = (intptr_t)p->value; /* void * */ iarg[a++] = p->size; /* l_size_t */ *n_args = 4; break; @@ -1646,7 +1646,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct linux_fgetxattr_args *p = params; iarg[a++] = p->fd; /* l_int */ uarg[a++] = (intptr_t)p->name; /* const char * */ - uarg[a++] = (intptr_t)p->value; /* char * */ + uarg[a++] = (intptr_t)p->value; /* void * */ iarg[a++] = p->size; /* l_size_t */ *n_args = 4; break; @@ -1655,7 +1655,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 232: { struct linux_listxattr_args *p = params; uarg[a++] = (intptr_t)p->path; /* const char * */ - uarg[a++] = (intptr_t)p->list; /* const char * */ + uarg[a++] = (intptr_t)p->list; /* char * */ iarg[a++] = p->size; /* l_size_t */ *n_args = 3; break; @@ -1664,7 +1664,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 233: { struct linux_llistxattr_args *p = params; uarg[a++] = (intptr_t)p->path; /* const char * */ - uarg[a++] = (intptr_t)p->list; /* const char * */ + uarg[a++] = (intptr_t)p->list; /* char * */ iarg[a++] = p->size; /* l_size_t */ *n_args = 3; break; @@ -1673,7 +1673,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 234: { struct linux_flistxattr_args *p = params; iarg[a++] = p->fd; /* l_int */ - uarg[a++] = (intptr_t)p->list; /* const char * */ + uarg[a++] = (intptr_t)p->list; /* char * */ iarg[a++] = p->size; /* l_size_t */ *n_args = 3; break; @@ -5761,7 +5761,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) p = "userland const char *"; break; case 2: - p = "userland const char *"; + p = "userland void *"; break; case 3: p = "l_size_t"; @@ -5783,7 +5783,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) p = "userland const char *"; break; case 2: - p = "userland const char *"; + p = "userland void *"; break; case 3: p = "l_size_t"; @@ -5805,7 +5805,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) p = "userland const char *"; break; case 2: - p = "userland const char *"; + p = "userland void *"; break; case 3: p = "l_size_t"; @@ -5827,7 +5827,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) p = "userland const char *"; break; case 2: - p = "userland char *"; + p = "userland void *"; break; case 3: p = "l_size_t"; @@ -5846,7 +5846,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) p = "userland const char *"; break; case 2: - p = "userland char *"; + p = "userland void *"; break; case 3: p = "l_size_t"; @@ -5865,7 +5865,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) p = "userland const char *"; break; case 2: - p = "userland char *"; + p = "userland void *"; break; case 3: p = "l_size_t"; @@ -5881,7 +5881,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) p = "userland const char *"; break; case 1: - p = "userland const char *"; + p = "userland char *"; break; case 2: p = "l_size_t"; @@ -5897,7 +5897,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) p = "userland const char *"; break; case 1: - p = "userland const char *"; + p = "userland char *"; break; case 2: p = "l_size_t"; @@ -5913,7 +5913,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) p = "l_int"; break; case 1: - p = "userland const char *"; + p = "userland char *"; break; case 2: p = "l_size_t"; From nobody Sat Jul 22 11:09:19 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R7Nwb6tdHz4nx05; Sat, 22 Jul 2023 11:09: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 4R7Nwb3FRqz3svP; Sat, 22 Jul 2023 11:09:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690024159; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=56keMqqRkZgWNNeYBDTzcX9Aj25OhXtYcjiW7l6UyCY=; b=LtaC1XxMvNolJxTGWhCAwR4k1wMAA7aIXcdq2HzkXdbvFygIAV68gm6Q0157q5S8bFc+7x hHL0VSx0sfM3pMuqhBgj7DPRxxOXRagEi6NxU+VZj3uU7BvhNxJXYw3owPdZG9+XusQrHy LiLJ/Yti5QAAtWSoefAKybmCFbt1WKhrKDYlcJoFrDSxioZpKs3zgpRqz0W1E8+PiA47Tb ioIaxIBraZ7Tm1pD63D44Qr0ZeIk4FEs1UvG17/yUZc2z/DhO1ij7QcGWxFzxPL+BsXBdc VeYY995dywXwZk+MVR9FfmlDyDjWN6vNLk4n+djyxaTG/E8nkPoKXpwgqDznog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690024159; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=56keMqqRkZgWNNeYBDTzcX9Aj25OhXtYcjiW7l6UyCY=; b=O2JKWJK05pOXG13elcTa0CjUEhoYA7MvxaNSy2BN2WUyqoc+wPrQ39ET1tgfbKbp+35WFo v16hrfZ4ROaW8F7exFBWL5xNEah0hPObAP89f8owmvV6HChG2vhpYySri3C3K5MeKPdSiO cuR9FyHILHo2BQH23GO8mvpoeZooPTITJnnECpehaUb8lDIKZQmn4GkCvNC9PpamMRzHAa IENPIsnVGi6IogQHb15Jl+XeXhg/65U1UwSn8kLhqEKz5eJtxfksRJj+LUYbjP0lrmMLUr +W44u4Jdw50VBCmCFIT6RTbV8+8IVMhAEElBc90qUuFFuQ6GJphZhA4trtyBjA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1690024159; a=rsa-sha256; cv=none; b=Dl1nBOmEXnElw5zjygvQSUecTVcrBwEPjZm0M4ImSzfGFjhqCm/mql8DEK/BxDb8JCJhj7 KAtI19Iqdr+fFLqZJhy8c4PhtitpyiZm0WDk0Pk0pEC4p5IL64KNPug0emw2H6AXvd96BI J/hq3qAqZFqrcFqTY9utdl65MuIZpyci8Sk4M2wbxWTI59/YBaI4H6waBQYZ/kQGKyMzvP IHkGNtsFP3yK0RBYYsAOZ2Bhf7CkNf+7k8n7cer5NhbuqYIfMtimxAPxMoTTAloWRsReVI VzDotLP6JABW7lo97cnYhG0UGUoQObg3d8Yh04q0BwJNoEnz5VJ1XME0vpzHPw== 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 4R7Nwb1Rr7zsZF; Sat, 22 Jul 2023 11:09: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 36MB9JoY049734; Sat, 22 Jul 2023 11:09:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36MB9JVN049733; Sat, 22 Jul 2023 11:09:19 GMT (envelope-from git) Date: Sat, 22 Jul 2023 11:09:19 GMT Message-Id: <202307221109.36MB9JVN049733@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Chagin Subject: git: 22dca7acf775 - main - linux(4): Implement xattr syscalls List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 22dca7acf7756c07d3ccbfdc8dfd10fd9ad3f9cf Auto-Submitted: auto-generated The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=22dca7acf7756c07d3ccbfdc8dfd10fd9ad3f9cf commit 22dca7acf7756c07d3ccbfdc8dfd10fd9ad3f9cf Author: Dmitry Chagin AuthorDate: 2023-07-22 11:03:33 +0000 Commit: Dmitry Chagin CommitDate: 2023-07-22 11:03:33 +0000 linux(4): Implement xattr syscalls Reviewed by: Differential revision: https://reviews.freebsd.org/D35544 MFC after: 1 month --- sys/compat/linux/linux_dummy.c | 21 --- sys/compat/linux/linux_xattr.c | 399 +++++++++++++++++++++++++++++++++++++++++ sys/modules/linux/Makefile | 1 + sys/modules/linux64/Makefile | 1 + 4 files changed, 401 insertions(+), 21 deletions(-) diff --git a/sys/compat/linux/linux_dummy.c b/sys/compat/linux/linux_dummy.c index 46596aa4a92a..861482b67d8f 100644 --- a/sys/compat/linux/linux_dummy.c +++ b/sys/compat/linux/linux_dummy.c @@ -146,24 +146,3 @@ DUMMY(pidfd_send_signal); DUMMY(io_uring_setup); DUMMY(io_uring_enter); DUMMY(io_uring_register); - -#define DUMMY_XATTR(s) \ -int \ -linux_ ## s ## xattr( \ - struct thread *td, struct linux_ ## s ## xattr_args *arg) \ -{ \ - \ - return (EOPNOTSUPP); \ -} -DUMMY_XATTR(set); -DUMMY_XATTR(lset); -DUMMY_XATTR(fset); -DUMMY_XATTR(get); -DUMMY_XATTR(lget); -DUMMY_XATTR(fget); -DUMMY_XATTR(list); -DUMMY_XATTR(llist); -DUMMY_XATTR(flist); -DUMMY_XATTR(remove); -DUMMY_XATTR(lremove); -DUMMY_XATTR(fremove); diff --git a/sys/compat/linux/linux_xattr.c b/sys/compat/linux/linux_xattr.c new file mode 100644 index 000000000000..60c4c8ddf4c9 --- /dev/null +++ b/sys/compat/linux/linux_xattr.c @@ -0,0 +1,399 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2023 Dmitry Chagin + * + * 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 +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#ifdef COMPAT_LINUX32 +#include +#include +#else +#include +#include +#endif + +#include + +#define LINUX_XATTR_SIZE_MAX 65536 +#define LINUX_XATTR_LIST_MAX 65536 +#define LINUX_XATTR_NAME_MAX 255 + +#define LINUX_XATTR_CREATE 0x1 +#define LINUX_XATTR_REPLACE 0x2 +#define LINUX_XATTR_FLAGS LINUX_XATTR_CREATE|LINUX_XATTR_REPLACE + +struct listxattr_args { + int fd; + const char *path; + char *list; + l_size_t size; + int follow; +}; + +struct setxattr_args { + int fd; + const char *path; + const char *name; + void *value; + l_size_t size; + l_int flags; + int follow; +}; + +static char *extattr_namespace_names[] = EXTATTR_NAMESPACE_NAMES; + + +static int +xatrr_to_extattr(const char *uattrname, int *attrnamespace, char *attrname) +{ + char uname[LINUX_XATTR_NAME_MAX + 1], *dot; + size_t len, cplen; + int error; + + error = copyinstr(uattrname, uname, sizeof(uname), &cplen); + if (error != 0) + return (error); + if (cplen == sizeof(uname)) + return (ERANGE); + dot = strchr(uname, '.'); + if (dot == NULL) + return (ENOTSUP); + *dot = '\0'; + for (*attrnamespace = EXTATTR_NAMESPACE_USER; + *attrnamespace < nitems(extattr_namespace_names); + (*attrnamespace)++) { + if (bcmp(uname, extattr_namespace_names[*attrnamespace], + dot - uname + 1) == 0) { + dot++; + len = strlen(dot) + 1; + bcopy(dot, attrname, len); + return (0); + } + } + return (ENOTSUP); +} + +static int +listxattr(struct thread *td, struct listxattr_args *args) +{ + char attrname[LINUX_XATTR_NAME_MAX + 1]; + char *data, *prefix, *key; + struct uio auio; + struct iovec aiov; + unsigned char keylen; + size_t sz, cnt, rs, prefixlen, pairlen; + int attrnamespace, error; + + if (args->size != 0) + sz = min(LINUX_XATTR_LIST_MAX, args->size); + else + sz = LINUX_XATTR_LIST_MAX; + + data = malloc(sz, M_LINUX, M_WAITOK); + auio.uio_iov = &aiov; + auio.uio_iovcnt = 1; + auio.uio_rw = UIO_READ; + auio.uio_segflg = UIO_SYSSPACE; + auio.uio_td = td; + cnt = 0; + for (attrnamespace = EXTATTR_NAMESPACE_USER; + attrnamespace < nitems(extattr_namespace_names); + attrnamespace++) { + aiov.iov_base = data; + aiov.iov_len = sz; + auio.uio_resid = sz; + auio.uio_offset = 0; + + if (args->path != NULL) + error = kern_extattr_list_path(td, args->path, + attrnamespace, &auio, args->follow, UIO_USERSPACE); + else + error = kern_extattr_list_fd(td, args->fd, + attrnamespace, &auio); + rs = sz - auio.uio_resid; + if (error != 0 || rs == 0) + continue; + prefix = extattr_namespace_names[attrnamespace]; + prefixlen = strlen(prefix); + key = data; + while (rs > 0) { + keylen = (unsigned char)key[0]; + pairlen = prefixlen + 1 + keylen + 1; + if (cnt + pairlen > LINUX_XATTR_LIST_MAX) { + error = E2BIG; + break; + } + if ((args->list != NULL && cnt > args->size) || + pairlen >= sizeof(attrname)) { + error = ERANGE; + break; + } + ++key; + if (args->list != NULL) { + sprintf(attrname, "%s.%.*s", prefix, keylen, key); + error = copyout(attrname, args->list, pairlen); + if (error != 0) + break; + args->list += pairlen; + } + cnt += pairlen; + key += keylen; + rs -= (keylen + 1); + } + } + if (error == 0) + td->td_retval[0] = cnt; + free(data, M_LINUX); + return (error); +} + +int +linux_listxattr(struct thread *td, struct linux_listxattr_args *args) +{ + struct listxattr_args eargs = { + .fd = -1, + .path = args->path, + .list = args->list, + .size = args->size, + .follow = FOLLOW, + }; + + return (listxattr(td, &eargs)); +} + +int +linux_llistxattr(struct thread *td, struct linux_llistxattr_args *args) +{ + struct listxattr_args eargs = { + .fd = -1, + .path = args->path, + .list = args->list, + .size = args->size, + .follow = NOFOLLOW, + }; + + return (listxattr(td, &eargs)); +} + +int +linux_flistxattr(struct thread *td, struct linux_flistxattr_args *args) +{ + struct listxattr_args eargs = { + .fd = args->fd, + .path = NULL, + .list = args->list, + .size = args->size, + .follow = 0, + }; + + return (listxattr(td, &eargs)); +} + +static int +linux_path_removexattr(struct thread *td, const char *upath, const char *uname, + int follow) +{ + char attrname[LINUX_XATTR_NAME_MAX + 1]; + int attrnamespace, error; + + error = xatrr_to_extattr(uname, &attrnamespace, attrname); + if (error != 0) + return (error); + + return (kern_extattr_delete_path(td, upath, attrnamespace, + attrname, follow, UIO_USERSPACE)); +} + +int +linux_removexattr(struct thread *td, struct linux_removexattr_args *args) +{ + + return (linux_path_removexattr(td, args->path, args->name, + FOLLOW)); +} + +int +linux_lremovexattr(struct thread *td, struct linux_lremovexattr_args *args) +{ + + return (linux_path_removexattr(td, args->path, args->name, + NOFOLLOW)); +} + +int +linux_fremovexattr(struct thread *td, struct linux_fremovexattr_args *args) +{ + char attrname[LINUX_XATTR_NAME_MAX + 1]; + int attrnamespace, error; + + error = xatrr_to_extattr(args->name, &attrnamespace, attrname); + if (error != 0) + return (error); + return (kern_extattr_delete_fd(td, args->fd, attrnamespace, + attrname)); +} + +static int +linux_path_getxattr(struct thread *td, const char *upath, const char *uname, + void *value, l_size_t size, int follow) +{ + char attrname[LINUX_XATTR_NAME_MAX + 1]; + int attrnamespace, error; + + error = xatrr_to_extattr(uname, &attrnamespace, attrname); + if (error != 0) + return (error); + + return (kern_extattr_get_path(td, upath, attrnamespace, + attrname, value, size, follow, UIO_USERSPACE)); +} + +int +linux_getxattr(struct thread *td, struct linux_getxattr_args *args) +{ + + return (linux_path_getxattr(td, args->path, args->name, + args->value, args->size, FOLLOW)); +} + +int +linux_lgetxattr(struct thread *td, struct linux_lgetxattr_args *args) +{ + + return (linux_path_getxattr(td, args->path, args->name, + args->value, args->size, NOFOLLOW)); +} + +int +linux_fgetxattr(struct thread *td, struct linux_fgetxattr_args *args) +{ + char attrname[LINUX_XATTR_NAME_MAX + 1]; + int attrnamespace, error; + + error = xatrr_to_extattr(args->name, &attrnamespace, attrname); + if (error != 0) + return (error); + return (kern_extattr_get_fd(td, args->fd, attrnamespace, + attrname, args->value, args->size)); +} + +static int +setxattr(struct thread *td, struct setxattr_args *args) +{ + char attrname[LINUX_XATTR_NAME_MAX + 1]; + int attrnamespace, error; + + if ((args->flags & ~(LINUX_XATTR_FLAGS)) != 0 || + args->flags == (LINUX_XATTR_FLAGS)) + return (EINVAL); + error = xatrr_to_extattr(args->name, &attrnamespace, attrname); + if (error != 0) + return (error); + + if ((args->flags & (LINUX_XATTR_FLAGS)) != 0 ) { + if (args->path != NULL) + error = kern_extattr_get_path(td, args->path, + attrnamespace, attrname, NULL, args->size, + args->follow, UIO_USERSPACE); + else + error = kern_extattr_get_fd(td, args->fd, + attrnamespace, attrname, NULL, args->size); + if ((args->flags & LINUX_XATTR_CREATE) != 0) { + if (error == 0) + error = EEXIST; + else if (error == ENOATTR) + error = 0; + } + if (error != 0) + goto out; + } + if (args->path != NULL) + error = kern_extattr_set_path(td, args->path, attrnamespace, + attrname, args->value, args->size, args->follow, + UIO_USERSPACE); + else + error = kern_extattr_set_fd(td, args->fd, attrnamespace, + attrname, args->value, args->size); +out: + td->td_retval[0] = 0; + return (error); +} + +int +linux_setxattr(struct thread *td, struct linux_setxattr_args *args) +{ + struct setxattr_args eargs = { + .fd = -1, + .path = args->path, + .name = args->name, + .value = args->value, + .size = args->size, + .flags = args->flags, + .follow = FOLLOW, + }; + + return (setxattr(td, &eargs)); +} + +int +linux_lsetxattr(struct thread *td, struct linux_lsetxattr_args *args) +{ + struct setxattr_args eargs = { + .fd = -1, + .path = args->path, + .name = args->name, + .value = args->value, + .size = args->size, + .flags = args->flags, + .follow = NOFOLLOW, + }; + + return (setxattr(td, &eargs)); +} + +int +linux_fsetxattr(struct thread *td, struct linux_fsetxattr_args *args) +{ + struct setxattr_args eargs = { + .fd = args->fd, + .path = NULL, + .name = args->name, + .value = args->value, + .size = args->size, + .flags = args->flags, + .follow = 0, + }; + + return (setxattr(td, &eargs)); +} diff --git a/sys/modules/linux/Makefile b/sys/modules/linux/Makefile index 294a7d595cc6..42ce6607dfc2 100644 --- a/sys/modules/linux/Makefile +++ b/sys/modules/linux/Makefile @@ -34,6 +34,7 @@ SRCS= linux${SFX}_dummy_machdep.c \ linux_timer.c \ linux_uid16.c \ linux_vdso.c \ + linux_xattr.c \ opt_inet6.h \ opt_ktrace.h \ opt_posix.h \ diff --git a/sys/modules/linux64/Makefile b/sys/modules/linux64/Makefile index 4fe9ccd576c1..0a133e6e79b4 100644 --- a/sys/modules/linux64/Makefile +++ b/sys/modules/linux64/Makefile @@ -29,6 +29,7 @@ SRCS= linux_dummy_machdep.c \ linux_time.c \ linux_vdso.c \ linux_timer.c \ + linux_xattr.c \ opt_ktrace.h \ opt_inet6.h \ opt_posix.h \ From nobody Sat Jul 22 11:09:17 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R7Nwb6tfcz4nwq6; Sat, 22 Jul 2023 11:09: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 4R7NwZ2lQVz3skY; Sat, 22 Jul 2023 11:09:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690024158; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=asAjy+C6zZuHQcjHKG3Tf1smPObotd8MwaEB3vaA2ao=; b=tYMQ2NdoCQJ80WSRNY37xeSQNGfxxOoQitrQpUaAU37wm+6HLckbUlmB7EO3bK17bK0aLR xSMDFpadIwrM/Y9rDzBELy0mKyxbejw5EyRauZtcJDwEZ2CzbvVU0vUkT5OjGIwtoUfRTL o3nXioRgGb1LrSU7skrsdiKldZbTzOA9tDlleusH3dyBt/476xU39QFXifuAG0fgExWLIV h7pw5cJJ9u/wGdUKadk+pFFCJgrLbGY+JOwS8zzpyV26AWL3wlvKpccUT/RYxvxY0jn8/A UZJRc9+0i/CHduq4OE6gF68oPwMjYCxUkzEY8d9JBi4nUso1AkOeAL3j4yqFAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690024158; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=asAjy+C6zZuHQcjHKG3Tf1smPObotd8MwaEB3vaA2ao=; b=PYwPv40rKJJCQSyvE7WC3iKIXQdOwLkKs+mhFkyCBwnNwDRcoviXs0P3eH/kek2ULemDza l5LxF1lwhU+qGXU6K4S8FGfTbOitsfoqHB49ojlkEcC7e/RNtiqi1Zen7dAbc3g22Aacm1 2O3EkAwiEMEG8LcKsj0nZaGOIwZiqzcT49xJY+Ll1v+gj+gYO6Z9wqqjvS6dJMTcY4nm7y 2mT70KjrVkTQtsIegwLxPgZBf5hHNzNgm3bqHJr5rv0cnN3FaZCaazYNv/zXClJYuTPd7x XklIWc23kd8W2joN3jl/noEQk7TYb2piBNdE5YpEEaJ9+agnSrRvPvEAeHBR8g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1690024158; a=rsa-sha256; cv=none; b=tOSrG+QWeo9jX/z1t50dYodxuvQcpNxFtZoQxX7buXs2nTKcj2SWRjpQgAE7hkjbY5+4t4 pdejmnmk7Ursa0WMe//dXo8QQHEEFOH7DLXk0pK0JdU8YgoEj/EcQ/HZ70SoawS9hWzYrZ DBz2qX/UI5lhHQEdkJ4TvSnmJtJLZ1ETCcJUGWJeAhMQkVTgBO2JIkVMiBdJdEXLQq98Nl y44Oj2wyZdAbiDoAUHoc7Ua0P23gHSPNLJU8yTOLdfwVDHZIDCjslyHeQGhA0e8v5QktTt 7mlISqz/30By9Rfnln9g5SJK9dwkqXZM1Cegx9sbjnFQkViXBR0XxBF4MumXdA== 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 4R7NwZ1G6PzsBQ; Sat, 22 Jul 2023 11:09: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 36MB9HxW049694; Sat, 22 Jul 2023 11:09:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36MB9H9t049693; Sat, 22 Jul 2023 11:09:17 GMT (envelope-from git) Date: Sat, 22 Jul 2023 11:09:17 GMT Message-Id: <202307221109.36MB9H9t049693@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Chagin Subject: git: 6453d4240f6b - main - vfs: Export exattr methods to reuse by Linuxulator List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6453d4240f6b46c718efa59651239f8519e1523e Auto-Submitted: auto-generated The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=6453d4240f6b46c718efa59651239f8519e1523e commit 6453d4240f6b46c718efa59651239f8519e1523e Author: Dmitry Chagin AuthorDate: 2023-07-22 11:03:33 +0000 Commit: Dmitry Chagin CommitDate: 2023-07-22 11:03:33 +0000 vfs: Export exattr methods to reuse by Linuxulator Reviewed by: Differential revision: https://reviews.freebsd.org/D35543 MFC after: 1 month --- sys/kern/vfs_extattr.c | 245 ++++++++++++++++++++++++++++++++++--------------- sys/sys/extattr.h | 22 +++++ 2 files changed, 193 insertions(+), 74 deletions(-) diff --git a/sys/kern/vfs_extattr.c b/sys/kern/vfs_extattr.c index 4b2cd920f32b..d5f2101cf2d0 100644 --- a/sys/kern/vfs_extattr.c +++ b/sys/kern/vfs_extattr.c @@ -49,15 +49,15 @@ __FBSDID("$FreeBSD$"); #include #include -static int kern_extattr_set_path(struct thread *td, const char *path, +static int user_extattr_set_path(struct thread *td, const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes, int follow); -static int kern_extattr_get_path(struct thread *td, const char *path, +static int user_extattr_get_path(struct thread *td, const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes, int follow); -static int kern_extattr_delete_path(struct thread *td, const char *path, +static int user_extattr_delete_path(struct thread *td, const char *path, int attrnamespace, const char *attrname, int follow); -static int kern_extattr_list_path(struct thread *td, const char *path, +static int user_extattr_list_path(struct thread *td, const char *path, int attrnamespace, void *data, size_t nbytes, int follow); /* @@ -232,25 +232,35 @@ struct extattr_set_fd_args { int sys_extattr_set_fd(struct thread *td, struct extattr_set_fd_args *uap) { - struct file *fp; char attrname[EXTATTR_MAXNAMELEN + 1]; - cap_rights_t rights; int error; - AUDIT_ARG_FD(uap->fd); - AUDIT_ARG_VALUE(uap->attrnamespace); error = copyinstr(uap->attrname, attrname, sizeof(attrname), NULL); if (error) return (error); + return (kern_extattr_set_fd(td, uap->fd, uap->attrnamespace, + attrname, uap->data, uap->nbytes)); +} + +int +kern_extattr_set_fd(struct thread *td, int fd, int attrnamespace, + const char *attrname, void *data, size_t nbytes) +{ + struct file *fp; + cap_rights_t rights; + int error; + + AUDIT_ARG_FD(fd); + AUDIT_ARG_VALUE(attrnamespace); AUDIT_ARG_TEXT(attrname); - error = getvnode_path(td, uap->fd, + error = getvnode_path(td, fd, cap_rights_init_one(&rights, CAP_EXTATTR_SET), &fp); if (error) return (error); - error = extattr_set_vp(fp->f_vnode, uap->attrnamespace, - attrname, uap->data, uap->nbytes, td); + error = extattr_set_vp(fp->f_vnode, attrnamespace, + attrname, data, nbytes, td); fdrop(fp, td); return (error); @@ -269,7 +279,7 @@ int sys_extattr_set_file(struct thread *td, struct extattr_set_file_args *uap) { - return (kern_extattr_set_path(td, uap->path, uap->attrnamespace, + return (user_extattr_set_path(td, uap->path, uap->attrnamespace, uap->attrname, uap->data, uap->nbytes, FOLLOW)); } @@ -286,25 +296,36 @@ int sys_extattr_set_link(struct thread *td, struct extattr_set_link_args *uap) { - return (kern_extattr_set_path(td, uap->path, uap->attrnamespace, + return (user_extattr_set_path(td, uap->path, uap->attrnamespace, uap->attrname, uap->data, uap->nbytes, NOFOLLOW)); } static int -kern_extattr_set_path(struct thread *td, const char *path, int attrnamespace, +user_extattr_set_path(struct thread *td, const char *path, int attrnamespace, const char *uattrname, void *data, size_t nbytes, int follow) { - struct nameidata nd; char attrname[EXTATTR_MAXNAMELEN + 1]; int error; - AUDIT_ARG_VALUE(attrnamespace); error = copyinstr(uattrname, attrname, sizeof(attrname), NULL); if (error) return (error); + return (kern_extattr_set_path(td, path, attrnamespace, + attrname, data, nbytes, follow, UIO_USERSPACE)); +} + +int +kern_extattr_set_path(struct thread *td, const char *path, int attrnamespace, + const char *attrname, void *data, size_t nbytes, int follow, + enum uio_seg pathseg) +{ + struct nameidata nd; + int error; + + AUDIT_ARG_VALUE(attrnamespace); AUDIT_ARG_TEXT(attrname); - NDINIT(&nd, LOOKUP, follow | AUDITVNODE1, UIO_USERSPACE, path); + NDINIT(&nd, LOOKUP, follow | AUDITVNODE1, pathseg, path); error = namei(&nd); if (error) return (error); @@ -399,25 +420,35 @@ struct extattr_get_fd_args { int sys_extattr_get_fd(struct thread *td, struct extattr_get_fd_args *uap) { - struct file *fp; char attrname[EXTATTR_MAXNAMELEN + 1]; - cap_rights_t rights; int error; - AUDIT_ARG_FD(uap->fd); - AUDIT_ARG_VALUE(uap->attrnamespace); error = copyinstr(uap->attrname, attrname, sizeof(attrname), NULL); if (error) return (error); + return (kern_extattr_get_fd(td, uap->fd, uap->attrnamespace, + attrname, uap->data, uap->nbytes)); +} + +int +kern_extattr_get_fd(struct thread *td, int fd, int attrnamespace, + const char *attrname, void *data, size_t nbytes) +{ + struct file *fp; + cap_rights_t rights; + int error; + + AUDIT_ARG_FD(fd); + AUDIT_ARG_VALUE(attrnamespace); AUDIT_ARG_TEXT(attrname); - error = getvnode_path(td, uap->fd, + error = getvnode_path(td, fd, cap_rights_init_one(&rights, CAP_EXTATTR_GET), &fp); if (error) return (error); - error = extattr_get_vp(fp->f_vnode, uap->attrnamespace, - attrname, uap->data, uap->nbytes, td); + error = extattr_get_vp(fp->f_vnode, attrnamespace, + attrname, data, nbytes, td); fdrop(fp, td); return (error); @@ -435,7 +466,7 @@ struct extattr_get_file_args { int sys_extattr_get_file(struct thread *td, struct extattr_get_file_args *uap) { - return (kern_extattr_get_path(td, uap->path, uap->attrnamespace, + return (user_extattr_get_path(td, uap->path, uap->attrnamespace, uap->attrname, uap->data, uap->nbytes, FOLLOW)); } @@ -451,25 +482,36 @@ struct extattr_get_link_args { int sys_extattr_get_link(struct thread *td, struct extattr_get_link_args *uap) { - return (kern_extattr_get_path(td, uap->path, uap->attrnamespace, + return (user_extattr_get_path(td, uap->path, uap->attrnamespace, uap->attrname, uap->data, uap->nbytes, NOFOLLOW)); } static int -kern_extattr_get_path(struct thread *td, const char *path, int attrnamespace, +user_extattr_get_path(struct thread *td, const char *path, int attrnamespace, const char *uattrname, void *data, size_t nbytes, int follow) { - struct nameidata nd; char attrname[EXTATTR_MAXNAMELEN + 1]; int error; - AUDIT_ARG_VALUE(attrnamespace); error = copyinstr(uattrname, attrname, sizeof(attrname), NULL); if (error) return (error); + return (kern_extattr_get_path(td, path, attrnamespace, + attrname, data, nbytes, follow, UIO_USERSPACE)); +} + +int +kern_extattr_get_path(struct thread *td, const char *path, int attrnamespace, + const char *attrname, void *data, size_t nbytes, int follow, + enum uio_seg pathseg) +{ + struct nameidata nd; + int error; + + AUDIT_ARG_VALUE(attrnamespace); AUDIT_ARG_TEXT(attrname); - NDINIT(&nd, LOOKUP, follow | AUDITVNODE1, UIO_USERSPACE, path); + NDINIT(&nd, LOOKUP, follow | AUDITVNODE1, pathseg, path); error = namei(&nd); if (error) return (error); @@ -534,24 +576,34 @@ struct extattr_delete_fd_args { int sys_extattr_delete_fd(struct thread *td, struct extattr_delete_fd_args *uap) { - struct file *fp; char attrname[EXTATTR_MAXNAMELEN + 1]; - cap_rights_t rights; int error; - AUDIT_ARG_FD(uap->fd); - AUDIT_ARG_VALUE(uap->attrnamespace); error = copyinstr(uap->attrname, attrname, sizeof(attrname), NULL); if (error) return (error); + return (kern_extattr_delete_fd(td, uap->fd, uap->attrnamespace, + attrname)); +} + +int +kern_extattr_delete_fd(struct thread *td, int fd, int attrnamespace, + const char *attrname) +{ + struct file *fp; + cap_rights_t rights; + int error; + + AUDIT_ARG_FD(fd); + AUDIT_ARG_VALUE(attrnamespace); AUDIT_ARG_TEXT(attrname); - error = getvnode_path(td, uap->fd, + error = getvnode_path(td, fd, cap_rights_init_one(&rights, CAP_EXTATTR_DELETE), &fp); if (error) return (error); - error = extattr_delete_vp(fp->f_vnode, uap->attrnamespace, + error = extattr_delete_vp(fp->f_vnode, attrnamespace, attrname, td); fdrop(fp, td); return (error); @@ -568,7 +620,7 @@ int sys_extattr_delete_file(struct thread *td, struct extattr_delete_file_args *uap) { - return (kern_extattr_delete_path(td, uap->path, uap->attrnamespace, + return (user_extattr_delete_path(td, uap->path, uap->attrnamespace, uap->attrname, FOLLOW)); } @@ -583,25 +635,35 @@ int sys_extattr_delete_link(struct thread *td, struct extattr_delete_link_args *uap) { - return (kern_extattr_delete_path(td, uap->path, uap->attrnamespace, + return (user_extattr_delete_path(td, uap->path, uap->attrnamespace, uap->attrname, NOFOLLOW)); } -static int -kern_extattr_delete_path(struct thread *td, const char *path, int attrnamespace, +int +user_extattr_delete_path(struct thread *td, const char *path, int attrnamespace, const char *uattrname, int follow) { - struct nameidata nd; char attrname[EXTATTR_MAXNAMELEN + 1]; int error; - AUDIT_ARG_VALUE(attrnamespace); error = copyinstr(uattrname, attrname, sizeof(attrname), NULL); if (error) return(error); + return (kern_extattr_delete_path(td, path, attrnamespace, + attrname, follow, UIO_USERSPACE)); +} + +int +kern_extattr_delete_path(struct thread *td, const char *path, int attrnamespace, + const char *attrname, int follow, enum uio_seg pathseg) +{ + struct nameidata nd; + int error; + + AUDIT_ARG_VALUE(attrnamespace); AUDIT_ARG_TEXT(attrname); - NDINIT(&nd, LOOKUP, follow | AUDITVNODE1, UIO_USERSPACE, path); + NDINIT(&nd, LOOKUP, follow | AUDITVNODE1, pathseg, path); error = namei(&nd); if (error) return(error); @@ -623,33 +685,19 @@ kern_extattr_delete_path(struct thread *td, const char *path, int attrnamespace, * References: vp must be a valid reference for the duration of the call */ static int -extattr_list_vp(struct vnode *vp, int attrnamespace, void *data, - size_t nbytes, struct thread *td) +extattr_list_vp(struct vnode *vp, int attrnamespace, struct uio *auiop, + struct thread *td) { - struct uio auio, *auiop; size_t size, *sizep; - struct iovec aiov; ssize_t cnt; int error; - if (nbytes > IOSIZE_MAX) - return (EINVAL); - - auiop = NULL; sizep = NULL; cnt = 0; - if (data != NULL) { - aiov.iov_base = data; - aiov.iov_len = nbytes; - auio.uio_iov = &aiov; - auio.uio_iovcnt = 1; - auio.uio_offset = 0; - auio.uio_resid = nbytes; - auio.uio_rw = UIO_READ; - auio.uio_segflg = UIO_USERSPACE; - auio.uio_td = td; - auiop = &auio; - cnt = nbytes; + if (auiop != NULL) { + if (auiop->uio_resid > IOSIZE_MAX) + return (EINVAL); + cnt = auiop->uio_resid; } else sizep = &size; @@ -668,7 +716,7 @@ extattr_list_vp(struct vnode *vp, int attrnamespace, void *data, VOP_UNLOCK(vp); if (auiop != NULL) { - cnt -= auio.uio_resid; + cnt -= auiop->uio_resid; td->td_retval[0] = cnt; } else td->td_retval[0] = size; @@ -685,20 +733,44 @@ struct extattr_list_fd_args { #endif int sys_extattr_list_fd(struct thread *td, struct extattr_list_fd_args *uap) +{ + struct uio auio, *auiop; + struct iovec aiov; + + if (uap->data != NULL) { + aiov.iov_base = uap->data; + aiov.iov_len = uap->nbytes; + auio.uio_iov = &aiov; + auio.uio_iovcnt = 1; + auio.uio_offset = 0; + auio.uio_resid = uap->nbytes; + auio.uio_rw = UIO_READ; + auio.uio_segflg = UIO_USERSPACE; + auio.uio_td = td; + auiop = &auio; + } else + auiop = NULL; + + return (kern_extattr_list_fd(td, uap->fd, uap->attrnamespace, + auiop)); +} + +int +kern_extattr_list_fd(struct thread *td, int fd, int attrnamespace, + struct uio *auiop) { struct file *fp; cap_rights_t rights; int error; - AUDIT_ARG_FD(uap->fd); - AUDIT_ARG_VALUE(uap->attrnamespace); - error = getvnode_path(td, uap->fd, + AUDIT_ARG_FD(fd); + AUDIT_ARG_VALUE(attrnamespace); + error = getvnode_path(td, fd, cap_rights_init_one(&rights, CAP_EXTATTR_LIST), &fp); if (error) return (error); - error = extattr_list_vp(fp->f_vnode, uap->attrnamespace, uap->data, - uap->nbytes, td); + error = extattr_list_vp(fp->f_vnode, attrnamespace, auiop, td); fdrop(fp, td); return (error); @@ -716,7 +788,7 @@ int sys_extattr_list_file(struct thread *td, struct extattr_list_file_args *uap) { - return (kern_extattr_list_path(td, uap->path, uap->attrnamespace, + return (user_extattr_list_path(td, uap->path, uap->attrnamespace, uap->data, uap->nbytes, FOLLOW)); } @@ -732,25 +804,50 @@ int sys_extattr_list_link(struct thread *td, struct extattr_list_link_args *uap) { - return (kern_extattr_list_path(td, uap->path, uap->attrnamespace, + return (user_extattr_list_path(td, uap->path, uap->attrnamespace, uap->data, uap->nbytes, NOFOLLOW)); } static int -kern_extattr_list_path(struct thread *td, const char *path, int attrnamespace, +user_extattr_list_path(struct thread *td, const char *path, int attrnamespace, void *data, size_t nbytes, int follow) +{ + struct uio auio, *auiop; + struct iovec aiov; + + if (data != NULL) { + aiov.iov_base = data; + aiov.iov_len = nbytes; + auio.uio_iov = &aiov; + auio.uio_iovcnt = 1; + auio.uio_offset = 0; + auio.uio_resid = nbytes; + auio.uio_rw = UIO_READ; + auio.uio_segflg = UIO_USERSPACE; + auio.uio_td = td; + auiop = &auio; + } else + auiop = NULL; + + return (kern_extattr_list_path(td, path, attrnamespace, + auiop, follow, UIO_USERSPACE)); +} + +int +kern_extattr_list_path(struct thread *td, const char *path, int attrnamespace, + struct uio *auiop, int follow, enum uio_seg pathseg) { struct nameidata nd; int error; AUDIT_ARG_VALUE(attrnamespace); - NDINIT(&nd, LOOKUP, follow | AUDITVNODE1, UIO_USERSPACE, path); + NDINIT(&nd, LOOKUP, follow | AUDITVNODE1, pathseg, path); error = namei(&nd); if (error) return (error); NDFREE_PNBUF(&nd); - error = extattr_list_vp(nd.ni_vp, attrnamespace, data, nbytes, td); + error = extattr_list_vp(nd.ni_vp, attrnamespace, auiop, td); vrele(nd.ni_vp); return (error); diff --git a/sys/sys/extattr.h b/sys/sys/extattr.h index aa47f25985ce..f3ca2a8ea913 100644 --- a/sys/sys/extattr.h +++ b/sys/sys/extattr.h @@ -64,11 +64,33 @@ #ifdef _KERNEL #include +enum uio_seg; +struct uio; struct thread; struct ucred; struct vnode; int extattr_check_cred(struct vnode *vp, int attrnamespace, struct ucred *cred, struct thread *td, accmode_t accmode); +int kern_extattr_set_path(struct thread *td, const char *path, + int attrnamespace, const char *attrname, void *data, + size_t nbytes, int follow, enum uio_seg pathseg); +int kern_extattr_set_fd(struct thread *td, int fd, int attrnamespace, + const char *attrname, void *data, size_t nbytes); +int kern_extattr_get_path(struct thread *td, const char *path, + int attrnamespace, const char *attrname, void *data, + size_t nbytes, int follow, enum uio_seg pathseg); +int kern_extattr_get_fd(struct thread *td, int fd, int attrnamespace, + const char *attrname, void *data, size_t nbytes); +int kern_extattr_delete_path(struct thread *td, const char *path, + int attrnamespace, const char *attrname, int follow, + enum uio_seg pathseg); +int kern_extattr_delete_fd(struct thread *td, int fd, int attrnamespace, + const char *attrname); +int kern_extattr_list_path(struct thread *td, const char *path, + int attrnamespace, struct uio *auiop, int follow, + enum uio_seg pathseg); +int kern_extattr_list_fd(struct thread *td, int fd, int attrnamespace, + struct uio *auiop); #else #include From nobody Sat Jul 22 19:23:09 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R7btQ0zRhz4pVqW; Sat, 22 Jul 2023 19:23:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R7btQ0MX2z40Mj; Sat, 22 Jul 2023 19:23:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690053790; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yEAXcfDfHLIOXpzMVkZoocnVBy06X0xVvxt0M4KMcxI=; b=czVZI0xr+qKH2iNHSbXQYbwGynVkSWx78keV7rlcNDOC7CwwwRTT5Y2WmkX19I90Tc6Hb0 npfrQO47uyJwIPE6jRZWiW0YFV6lgHcBFjv/8h5ljLkwfuaHI/SGSg7T7qe6VJqhOQ7Vea EgW4h4+ZtJhCwk9CMsHq1wjN8BbgW3meJml0TZpHhENQie0vkDSpVKZP0TNSrPj3PfFHbb siTIC03aqqqx6B6lOl5oYAV3FjH+2TrVkywQDvBi409PwrapaGPP1o3BYfVxU/ZmDnw6fy s6IKlUeUcpPFhvpZbRib9zAFvo6f5UN9HavyP7ucDKkkLRBjfSrBmMjnog9alw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690053790; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yEAXcfDfHLIOXpzMVkZoocnVBy06X0xVvxt0M4KMcxI=; b=SD7M4l2DgRd0JIIQqK0dxdNJCylAKj32XVYEgtw4crn7MtBdiKF2mhdXtdjpvxB1J4fU2Z w9uD1/JLmcU3TMAyNecWI6038n6O5dT/EKMaD6BOY0pr/Cs3f8dvQQ2R4KAzIxCT0M+xGd imkKilDs6rZ710F5yn1PINfSZSMQwLHhrHV10bx1IRpDfLr8LuwQWQeHpiYBu2lR2Te6S1 QB0nIvHYjrWS2dGCQZru32L+AmZntmtod2qFgc4TQcmixUED15fdOXcros4n18Xgm6QlRB ON/zDlWVCqkEJpQSMro/xtTNH8RVsJVeUHZQ+DN8aNkGwbR7B2qDzhA5ORxsaQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1690053790; a=rsa-sha256; cv=none; b=ovq+lmhgjGhb803euSnQdVQZiGNHxj1jOOdeaHYFsTqd5Fpdjb24fK5vOrZDofnMD6hj3K 6RuLXKHwBaMpyO7pUNOz0N0U375Dq7ohcnS5Qy7cKAGeC2t/M9Q4SqM6CI634dhNZMpVxr 6C4qYekiGP/uMh32LvDs6MEG5LrUQQxQMU1AV+wWDiwWDCM6McVSlax/m5PvW/SqWavS8s OVl6wCw7vjwyN0LfqL3XUvC5K2AQtLiHcBwmkYWrzfzWgk153WslQVn6lyBtKRtc/clh38 pfP3F7tRFkPOFxMLeD0AlxFSjqrS613XRKCaLjPYi+eix3DS+/XXd6rGKrwKIg== 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 4R7btP6XSFz165L; Sat, 22 Jul 2023 19:23:09 +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 36MJN9mG075163; Sat, 22 Jul 2023 19:23:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36MJN97g075162; Sat, 22 Jul 2023 19:23:09 GMT (envelope-from git) Date: Sat, 22 Jul 2023 19:23:09 GMT Message-Id: <202307221923.36MJN97g075162@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 918c25677d88 - main - e1000: lem(4)/em(4) ifcaps, TSO and hwcsum fixes List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 918c25677d882a901696672bd4d39b62faa56dfa Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=918c25677d882a901696672bd4d39b62faa56dfa commit 918c25677d882a901696672bd4d39b62faa56dfa Author: Kevin Bowling AuthorDate: 2023-07-22 18:33:27 +0000 Commit: Kevin Bowling CommitDate: 2023-07-22 19:13:43 +0000 e1000: lem(4)/em(4) ifcaps, TSO and hwcsum fixes * em(4) obey administrative ifcaps for using hwcsum offload * em(4) obey administrative ifcaps for hw vlan receive tagging * em(4) add additional TSO6 ifcap, but disabled by default as is TSO4 * lem(4) obey administrative ifcaps for using hwcsum offload * lem(4) add support for hw vlan receive tagging * lem(4) Add ifcaps for TSO offload experimentation, but disabled by default due to errata and possibly missing txrx code. * lem(4) disable HWCSUM ifcaps by default on 82547 due to errata around full duplex links. It may still be administratively enabled. Reviewed by: markj (previous version) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D30072 --- sys/dev/e1000/em_txrx.c | 15 +++++++------ sys/dev/e1000/if_em.c | 57 ++++++++++++++++++++++++++++++++----------------- 2 files changed, 46 insertions(+), 26 deletions(-) diff --git a/sys/dev/e1000/em_txrx.c b/sys/dev/e1000/em_txrx.c index 47f9b187aa14..069a1c00a4b2 100644 --- a/sys/dev/e1000/em_txrx.c +++ b/sys/dev/e1000/em_txrx.c @@ -674,12 +674,12 @@ lem_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri) i++; } while (!eop); - /* XXX add a faster way to look this up */ - if (sc->hw.mac.type >= e1000_82543) + if (scctx->isc_capenable & IFCAP_RXCSUM) em_receive_checksum(status, errors, ri); - if (status & E1000_RXD_STAT_VP) { - ri->iri_vtag = le16toh(rxd->special); + if (scctx->isc_capenable & IFCAP_VLAN_HWTAGGING && + status & E1000_RXD_STAT_VP) { + ri->iri_vtag = le16toh(rxd->special & E1000_RXD_SPC_VLAN_MASK); ri->iri_flags |= M_VLANTAG; } @@ -699,11 +699,11 @@ em_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri) uint16_t len; uint32_t pkt_info; - uint32_t staterr = 0; + uint32_t staterr; bool eop; int i, cidx; - i = 0; + staterr = i = 0; cidx = ri->iri_cidx; do { @@ -739,7 +739,8 @@ em_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri) if (scctx->isc_capenable & IFCAP_RXCSUM) em_receive_checksum(staterr, staterr >> 24, ri); - if (staterr & E1000_RXD_STAT_VP) { + if (scctx->isc_capenable & IFCAP_VLAN_HWTAGGING && + staterr & E1000_RXD_STAT_VP) { ri->iri_vtag = le16toh(rxd->wb.upper.vlan); ri->iri_flags |= M_VLANTAG; } diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index 0b664b155872..0da1f0a2dc67 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -781,19 +781,22 @@ em_set_num_queues(if_ctx_t ctx) return (maxqueues); } -#define LEM_CAPS \ - IFCAP_HWCSUM | IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING | \ - IFCAP_VLAN_HWCSUM | IFCAP_WOL | IFCAP_VLAN_HWFILTER - -#define EM_CAPS \ - IFCAP_HWCSUM | IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING | \ - IFCAP_VLAN_HWCSUM | IFCAP_WOL | IFCAP_VLAN_HWFILTER | IFCAP_TSO4 | \ - IFCAP_LRO | IFCAP_VLAN_HWTSO - -#define IGB_CAPS \ - IFCAP_HWCSUM | IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING | \ - IFCAP_VLAN_HWCSUM | IFCAP_WOL | IFCAP_VLAN_HWFILTER | IFCAP_TSO4 | \ - IFCAP_LRO | IFCAP_VLAN_HWTSO | IFCAP_JUMBO_MTU | IFCAP_HWCSUM_IPV6 |\ +#define LEM_CAPS \ + IFCAP_HWCSUM | IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING | \ + IFCAP_VLAN_HWCSUM | IFCAP_WOL | IFCAP_VLAN_HWFILTER | IFCAP_TSO4 | \ + IFCAP_LRO | IFCAP_VLAN_HWTSO| IFCAP_JUMBO_MTU | IFCAP_HWCSUM_IPV6 | \ + IFCAP_TSO6 + +#define EM_CAPS \ + IFCAP_HWCSUM | IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING | \ + IFCAP_VLAN_HWCSUM | IFCAP_WOL | IFCAP_VLAN_HWFILTER | IFCAP_TSO4 | \ + IFCAP_LRO | IFCAP_VLAN_HWTSO | IFCAP_JUMBO_MTU | IFCAP_HWCSUM_IPV6 | \ + IFCAP_TSO6 + +#define IGB_CAPS \ + IFCAP_HWCSUM | IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING | \ + IFCAP_VLAN_HWCSUM | IFCAP_WOL | IFCAP_VLAN_HWFILTER | IFCAP_TSO4 | \ + IFCAP_LRO | IFCAP_VLAN_HWTSO | IFCAP_JUMBO_MTU | IFCAP_HWCSUM_IPV6 | \ IFCAP_TSO6 /********************************************************************* @@ -897,7 +900,7 @@ em_if_attach_pre(if_ctx_t ctx) scctx->isc_tx_tso_segsize_max = EM_TSO_SEG_SIZE; scctx->isc_capabilities = scctx->isc_capenable = EM_CAPS; /* - * For EM-class devices, don't enable IFCAP_{TSO4,VLAN_HWTSO} + * For EM-class devices, don't enable IFCAP_{TSO4,VLAN_HWTSO,TSO6} * by default as we don't have workarounds for all associated * silicon errata. E. g., with several MACs such as 82573E, * TSO only works at Gigabit speed and otherwise can cause the @@ -912,8 +915,9 @@ em_if_attach_pre(if_ctx_t ctx) * work for a few MACs of this class - at least when sticking * with Gigabit - in which case users may enable TSO manually. */ - scctx->isc_capenable &= ~(IFCAP_TSO4 | IFCAP_VLAN_HWTSO); - scctx->isc_tx_csum_flags = CSUM_TCP | CSUM_UDP | CSUM_IP_TSO; + scctx->isc_capenable &= ~(IFCAP_TSO4 | IFCAP_VLAN_HWTSO | IFCAP_TSO6); + scctx->isc_tx_csum_flags = CSUM_TCP | CSUM_UDP | CSUM_IP_TSO | + CSUM_IP6_TCP | CSUM_IP6_UDP; /* * We support MSI-X with 82574 only, but indicate to iflib(4) * that it shall give MSI at least a try with other devices. @@ -929,9 +933,25 @@ em_if_attach_pre(if_ctx_t ctx) scctx->isc_rxqsizes[0] = roundup2((scctx->isc_nrxd[0] + 1) * sizeof(struct e1000_rx_desc), EM_DBA_ALIGN); scctx->isc_txd_size[0] = sizeof(struct e1000_tx_desc); scctx->isc_rxd_size[0] = sizeof(struct e1000_rx_desc); - scctx->isc_tx_csum_flags = CSUM_TCP | CSUM_UDP; scctx->isc_txrx = &lem_txrx; - scctx->isc_capabilities = LEM_CAPS; + scctx->isc_tx_tso_segments_max = EM_MAX_SCATTER; + scctx->isc_tx_tso_size_max = EM_TSO_SIZE; + scctx->isc_tx_tso_segsize_max = EM_TSO_SEG_SIZE; + scctx->isc_capabilities = scctx->isc_capenable = EM_CAPS; + /* + * For LEM-class devices, don't enable IFCAP_{TSO4,VLAN_HWTSO,TSO6} + * by default as we don't have workarounds for all associated + * silicon errata. TSO4 may work on > 82544 but its status + * is unknown by the authors. Please report any success or failures. + */ + scctx->isc_capenable &= ~(IFCAP_TSO4 | IFCAP_VLAN_HWTSO | IFCAP_TSO6); + scctx->isc_tx_csum_flags = CSUM_TCP | CSUM_UDP | CSUM_IP_TSO | + CSUM_IP6_TCP | CSUM_IP6_UDP; + + /* 8254x SDM4.0 page 33 - FDX requirement on these chips */ + if (hw->mac.type == e1000_82547 || hw->mac.type == e1000_82547_rev_2) + scctx->isc_capenable &= ~(IFCAP_HWCSUM|IFCAP_VLAN_HWCSUM); + if (hw->mac.type < e1000_82543) scctx->isc_capabilities &= ~(IFCAP_HWCSUM|IFCAP_VLAN_HWCSUM); /* 82541ER doesn't do HW tagging */ @@ -939,7 +959,6 @@ em_if_attach_pre(if_ctx_t ctx) scctx->isc_capabilities &= ~IFCAP_VLAN_HWTAGGING; /* INTx only */ scctx->isc_msix_bar = 0; - scctx->isc_capenable = scctx->isc_capabilities; } /* Setup PCI resources */ From nobody Sat Jul 22 23:00:06 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R7hhk5NlSz4ngpj; Sat, 22 Jul 2023 23:00: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 4R7hhk4yVfz474Z; Sat, 22 Jul 2023 23:00:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690066806; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FS1jo0DWOFzNnvQJaGJ+GOI07Fqrlays8CDSuCrl1qk=; b=rHtqg6yEfXBqB7JN0HJL/dBgXROOo1uaXwoiDjt2hITNhlCWq4scR+/ELWG/MQj6Uah1A5 T8onFRQ4Ubl1ajJIyTIOjtpQJ46k3H+Fp9Qw8JYkbHuBcT7uKojr/bI/bWzSfC8Kh+9z57 pbXptuuFxoUGjvtExTjNIhOpZLE3TEe2qsa0pC0D85GhoNkl0EG9ZDDgNG11nnLaZIYRdD ZQGEQPRi8OEyRJfk0QDVgATUqZndY5iDy4SLZPfBXKAwSfL+LpJGDplp+DSlXujdnjw1S3 R45NFGC1WzBKGh6iBj16zpCltrtbKsUA6V/WvvhW5OLh1R0tysP6jE9XpYofSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690066806; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FS1jo0DWOFzNnvQJaGJ+GOI07Fqrlays8CDSuCrl1qk=; b=wQ6Z4LlqPJANAeVn3utdp+o/JMT/6N5EGDrLeCC38KIxaOScVwK/s9KolyM/C8DFDLTrK+ CfnX0EhGCNx3ADtgAqDMnjmJJjXNPjYUPzsI36u0c57IbQAo3g4qOIb2tadldb+4hPYpHm XHmm0YZjnmWy1LyjAe/eTDX22F/a4nKTW0H1IWPn/wtxreXKvfmqyAcbe7Ig/TtnH+hd4A ZeGIMpAXGMUFdl0V0vY19flRDUtuZLKp7/Vk4NJUD6tkSwzipaDIVy+fexoQ5scCsdcUF9 5hPAv4JFtPfhISdRGL0PSz0Ol/J18SuK7DFFzUnr9gy1ASk4XmZEgGT7P9eEfQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1690066806; a=rsa-sha256; cv=none; b=YXBwr1zF6XHNknHzzZO7RkvccwP5ZHYhJ8fGMpzD8ci/FlZJ7MvSOJ8vOtNFsW3flUni0c g2VgHkKHu5BInFTEsd+R/Qg6UIwVZli71P6FSwnpFffHiY4o0CRvKGIAhWU7c7chUZc9Nf qXPlJnX+U/yrOWnTdbFesTfmV9kXT6D+eoGPTerYqKJwpJ5QsjqbWkosUggP+TTQgpG9RW 5FkVvyFLlzWUmQpi9lF0PnwSr/zJ4C1Z8vlwRdZAIijy8UkdJeyop/MEoTF61KnWP19C3D iIVYNt6DUMrTpyVrUKEzoWlZvMwVSlHkFhdrBcyoFouvYwyLs+zUaYhoztii4w== 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 4R7hhk4166z1CQg; Sat, 22 Jul 2023 23:00:06 +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 36MN060E026475; Sat, 22 Jul 2023 23:00:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36MN06VB026472; Sat, 22 Jul 2023 23:00:06 GMT (envelope-from git) Date: Sat, 22 Jul 2023 23:00:06 GMT Message-Id: <202307222300.36MN06VB026472@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 4f9a44a215f8 - main - e1000: Fix/enable IPv6 transmit checksum offload List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4f9a44a215f873c6842a693f2e81e0abbe1531cf Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=4f9a44a215f873c6842a693f2e81e0abbe1531cf commit 4f9a44a215f873c6842a693f2e81e0abbe1531cf Author: Kevin Bowling AuthorDate: 2023-07-22 22:58:34 +0000 Commit: Kevin Bowling CommitDate: 2023-07-22 22:58:34 +0000 e1000: Fix/enable IPv6 transmit checksum offload Fixes and enables txcsum6 offload for lem(4) and em(4). MFC after: 2 weeks --- sys/dev/e1000/em_txrx.c | 4 ++-- sys/dev/e1000/if_em.h | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/sys/dev/e1000/em_txrx.c b/sys/dev/e1000/em_txrx.c index 069a1c00a4b2..1192286d1c9c 100644 --- a/sys/dev/e1000/em_txrx.c +++ b/sys/dev/e1000/em_txrx.c @@ -285,13 +285,13 @@ em_transmit_checksum_setup(struct e1000_softc *sc, if_pkt_info_t pi, cmd |= E1000_TXD_CMD_IP; } - if (csum_flags & (CSUM_TCP|CSUM_UDP)) { + if (csum_flags & (CSUM_TCP | CSUM_UDP | CSUM_IP6_TCP | CSUM_IP6_UDP)) { uint8_t tucso; *txd_upper |= E1000_TXD_POPTS_TXSM << 8; *txd_lower = E1000_TXD_CMD_DEXT | E1000_TXD_DTYP_D; - if (csum_flags & CSUM_TCP) { + if (csum_flags & CSUM_TCP | CSUM_IP6_TCP) { tucso = hdr_len + offsetof(struct tcphdr, th_sum); cmd |= E1000_TXD_CMD_TCP; } else diff --git a/sys/dev/e1000/if_em.h b/sys/dev/e1000/if_em.h index a46ce2fdb6ae..8c5abf5b48cb 100644 --- a/sys/dev/e1000/if_em.h +++ b/sys/dev/e1000/if_em.h @@ -333,10 +333,13 @@ #define EM_TSO_SIZE 65535 #define EM_TSO_SEG_SIZE 4096 /* Max dma segment size */ #define ETH_ZLEN 60 -#define EM_CSUM_OFFLOAD (CSUM_IP | CSUM_IP_UDP | CSUM_IP_TCP) /* Offload bits in mbuf flag */ + +/* Offload bits in mbuf flag */ +#define EM_CSUM_OFFLOAD (CSUM_IP | CSUM_IP_UDP | CSUM_IP_TCP | \ + CSUM_IP6_UDP | CSUM_IP6_TCP) #define IGB_CSUM_OFFLOAD (CSUM_IP | CSUM_IP_UDP | CSUM_IP_TCP | \ CSUM_IP_SCTP | CSUM_IP6_UDP | CSUM_IP6_TCP | \ - CSUM_IP6_SCTP) /* Offload bits in mbuf flag */ + CSUM_IP6_SCTP) #define IGB_PKTTYPE_MASK 0x0000FFF0 #define IGB_DMCTLX_DCFLUSH_DIS 0x80000000 /* Disable DMA Coalesce Flush */