From owner-svn-src-all@freebsd.org Sun Sep 27 01:38:10 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8413F3E702A; Sun, 27 Sep 2020 01:38:10 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BzSw21SPDz4L0Y; Sun, 27 Sep 2020 01:38:09 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 5558E5C00BA; Sat, 26 Sep 2020 21:38:09 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Sat, 26 Sep 2020 21:38:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsco.org; h= content-type:content-transfer-encoding:from:mime-version:subject :date:message-id:references:cc:in-reply-to:to; s=fm1; bh=RlvQFwj yrvwqu0bQiS7NJcGQ1KyrrFJL1ywfVSMxUoE=; b=MumjtNcj41/NBmjQtOtB532 TPe6mCZXEimF3MCsd7R1j1ngvX4DJ3hqnBVP6zsXzbdypGF54sBXUAPF0bfAdQS2 UfBJ+26exKGgIs4C6/llKJPAGVSjJfpJTUzvl3yaamaFz+nkuwVxIT3wdjj/1NQ6 +J1Fd2kxlysSe10KTzwxRFeGynDSYwWT9Y0c70S0z4q4HkUufJ4vaqpE86gsJX7M zSKO+Y0zGyUJ2PEyiSv7YQqV7csxBzvnLyltDCBul22Dl42fvMi95cde1+8PQ1zW usmu3oHEK4vk/kJCJBiaAoC/7qKsJY67dWIeVM/R6UFwTYOA1u3byOklnFYc4Rw= = DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=RlvQFwjyrvwqu0bQiS7NJcGQ1KyrrFJL1ywfVSMxU oE=; b=NmsMYKbhkV99HPJB70jOk9lqpTlTgyuSF1wpr/z6kl1izXcX8Qd/yArRu lx8vNRJSx0XihuIUBqC4aeW68/ytiSrXFgf06xOVUfP2h0VMM8e2NjvXzxQIT20D G52c+vPtPjT1QgJa1FyPnVyhoklIP9Xr6y7IBMtwS7UnA2c9mKBocpH79vxeqkE3 yVM+HQChpZ4XMGlPEK5ZblMOVDITVhSoerSJgnwdItGWROpPRE2T5IFeHJvx3OxL dOe4euOdWps8KCyQbXBDumttpJYCcJkvCQrgZ3WynbgKDfOIRn659cC5raMATFZY lY8PaPpkUw2oYJqJXpvIP+URxH4Yg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrvdefgdegfecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpegtgffhggfufffkfhgjvffosehtqhhmtdhhtdejnecuhfhrohhmpefutghothht ucfnohhnghcuoehstghothhtlhesshgrmhhstghordhorhhgqeenucggtffrrghtthgvrh hnpeeivdefhfeuvdeuveduleelledufffgkeeijeegtddvueekkeegteetleejudejleen ucffohhmrghinhepfhhrvggvsghsugdrohhrghdpfhhtphegrdhruhenucfkphepudejge drvdeghedrudelvddrieeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehm rghilhhfrhhomhepshgtohhtthhlsehsrghmshgtohdrohhrgh X-ME-Proxy: Received: from localhost.localdomain (68.sub-174-245-192.myvzw.com [174.245.192.68]) by mail.messagingengine.com (Postfix) with ESMTPA id C4470328005D; Sat, 26 Sep 2020 21:38:08 -0400 (EDT) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: Scott Long Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r366186 - in head/usr.sbin: bsdconfig/share/media bsdinstall/scripts Date: Sat, 26 Sep 2020 19:38:07 -0600 Message-Id: <58A46C41-07DE-41F4-A3F9-668035347D8B@samsco.org> References: <202009262324.08QNOjbQ056906@gndrsh.dnsmgr.net> Cc: Warner Losh , Niclas Zeising , src-committers , svn-src-all , svn-src-head In-Reply-To: <202009262324.08QNOjbQ056906@gndrsh.dnsmgr.net> To: rgrimes@freebsd.org X-Mailer: iPhone Mail (18A373) X-Rspamd-Queue-Id: 4BzSw21SPDz4L0Y X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:11403, ipnet:66.111.4.0/24, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Sep 2020 01:38:10 -0000 > On Sep 26, 2020, at 5:24 PM, Rodney W. Grimes w= rote: >=20 > =EF=BB=BF >>=20 >>=20 >>>> On Sep 26, 2020, at 1:22 PM, Warner Losh wrote: >>>=20 >>>=20 >>>=20 >>> I am the wrong person to answer that question. >>>=20 >>> In this case, things have not become lame. For instance, the names=20 >>> ervers for se.freebsd.org work fine, but ftp3.se and ftp6.se records are= =20 >>> removed. Same for ru.freebsd.org and ftp4.ru. >>> I'm merely pointing out that changing ftp.CC.freebsd.org usually=20 >>> requires contacting the person(s) maintaining the CC.freebsd.org zone,=20= >>> which is usually not the project. >>>=20 >>> It's usually people associated with the project in some way, but who mig= ht not be as responsive as cluster admin. These domains have been delegated,= so we have to get the delegated admin to make the changes, which can take a= bit of time to chase down and doesn't lend itself to easy / automated copin= g with this situation. >>>=20 >>=20 >> Just a spitball idea here, but maybe we should consider not embedding the= se lists of mirror URLs into the binaries. It seems pretty straight-forward= that the list evolves over time, and that evolution is not tightly coupled w= ith the updating of the binaries. It sounds like the pkg and freebsd-update= infrastructure use DNS TXT and/or SRV records to point to the metadata need= ed to construct a mirror URL list dynamically. Maybe something similar can b= e done for bsdconfig? If it?s not a crazy idea, is there anyone who would b= e interested in helping me write a proposal over at arch@? >=20 > 100% behind that idea! Especially since it seems the project has lost > (some) control over its DNS space, which IMHO, is still an issue, if > the people whom DNS zones have been deligated to are not responsive > that should also=20 Words of agreement don=E2=80=99t help at the moment, though i appreciate you= r enthusiasm. Would you he able to help write a proposal for the arch@ mail= ing list? Thanks, Scott= From owner-svn-src-all@freebsd.org Sun Sep 27 02:59:29 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 83D833EA626; Sun, 27 Sep 2020 02:59:29 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BzVjs2wN0z4QHf; Sun, 27 Sep 2020 02:59:29 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2D3F12DFDC; Sun, 27 Sep 2020 02:59:29 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08R2xTXZ022240; Sun, 27 Sep 2020 02:59:29 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08R2xSoj022239; Sun, 27 Sep 2020 02:59:28 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <202009270259.08R2xSoj022239@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sun, 27 Sep 2020 02:59:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366190 - in stable/12: sys/fs/fuse tests/sys/fs/fusefs X-SVN-Group: stable-12 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in stable/12: sys/fs/fuse tests/sys/fs/fusefs X-SVN-Commit-Revision: 366190 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Sep 2020 02:59:29 -0000 Author: asomers Date: Sun Sep 27 02:59:28 2020 New Revision: 366190 URL: https://svnweb.freebsd.org/changeset/base/366190 Log: MFC r366121: fusefs: fix mmap'd writes in direct_io mode If a FUSE server returns FOPEN_DIRECT_IO in response to FUSE_OPEN, that instructs the kernel to bypass the page cache for that file. This feature is also known by libfuse's name: "direct_io". However, when accessing a file via mmap, there is no possible way to bypass the cache completely. This change fixes a deadlock that would happen when an mmap'd write tried to invalidate a portion of the cache, wrongly assuming that a write couldn't possibly come from cache if direct_io were set. Arguably, we could instead disable mmap for files with FOPEN_DIRECT_IO set. But allowing it is less likely to cause user complaints, and is more in keeping with the spirit of open(2), where O_DIRECT instructs the kernel to "reduce", not "eliminate" cache effects. PR: 247276 Reported by: trapexit@spawn.link Reviewed by: cem Differential Revision: https://reviews.freebsd.org/D26485 Modified: stable/12/sys/fs/fuse/fuse_io.c stable/12/tests/sys/fs/fusefs/write.cc Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/fs/fuse/fuse_io.c ============================================================================== --- stable/12/sys/fs/fuse/fuse_io.c Sat Sep 26 23:05:38 2020 (r366189) +++ stable/12/sys/fs/fuse/fuse_io.c Sun Sep 27 02:59:28 2020 (r366190) @@ -291,6 +291,7 @@ fuse_io_dispatch(struct vnode *vp, struct uio *uio, in fuse_vnode_update(vp, FN_MTIMECHANGE | FN_CTIMECHANGE); if (directio) { off_t start, end, filesize; + bool pages = (ioflag & IO_VMIO) != 0; SDT_PROBE2(fusefs, , io, trace, 1, "direct write of vnode"); @@ -301,15 +302,14 @@ fuse_io_dispatch(struct vnode *vp, struct uio *uio, in start = uio->uio_offset; end = start + uio->uio_resid; - KASSERT((ioflag & (IO_VMIO | IO_DIRECT)) != - (IO_VMIO | IO_DIRECT), - ("IO_DIRECT used for a cache flush?")); - /* Invalidate the write cache when writing directly */ - err = fuse_inval_buf_range(vp, filesize, start, end); - if (err) - return (err); + if (!pages) { + err = fuse_inval_buf_range(vp, filesize, start, + end); + if (err) + return (err); + } err = fuse_write_directbackend(vp, uio, cred, fufh, - filesize, ioflag, false); + filesize, ioflag, pages); } else { SDT_PROBE2(fusefs, , io, trace, 1, "buffered write of vnode"); Modified: stable/12/tests/sys/fs/fusefs/write.cc ============================================================================== --- stable/12/tests/sys/fs/fusefs/write.cc Sat Sep 26 23:05:38 2020 (r366189) +++ stable/12/tests/sys/fs/fusefs/write.cc Sun Sep 27 02:59:28 2020 (r366190) @@ -923,6 +923,76 @@ TEST_F(WriteBack, o_direct) leak(fd); } +TEST_F(WriteBack, direct_io) +{ + const char FULLPATH[] = "mountpoint/some_file.txt"; + const char RELPATH[] = "some_file.txt"; + const char *CONTENTS = "abcdefgh"; + uint64_t ino = 42; + int fd; + ssize_t bufsize = strlen(CONTENTS); + uint8_t readbuf[bufsize]; + + expect_lookup(RELPATH, ino, 0); + expect_open(ino, FOPEN_DIRECT_IO, 1); + FuseTest::expect_write(ino, 0, bufsize, bufsize, 0, FUSE_WRITE_CACHE, + CONTENTS); + expect_read(ino, 0, bufsize, bufsize, CONTENTS); + + fd = open(FULLPATH, O_RDWR); + EXPECT_LE(0, fd) << strerror(errno); + + ASSERT_EQ(bufsize, write(fd, CONTENTS, bufsize)) << strerror(errno); + /* A subsequent read must query the daemon because cache is empty */ + ASSERT_EQ(0, lseek(fd, 0, SEEK_SET)) << strerror(errno); + ASSERT_EQ(0, fcntl(fd, F_SETFL, 0)) << strerror(errno); + ASSERT_EQ(bufsize, read(fd, readbuf, bufsize)) << strerror(errno); + leak(fd); +} + +/* + * mmap should still be possible even if the server used direct_io. Mmap will + * still use the cache, though. + * + * Regression test for bug 247276 + * https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=247276 + */ +TEST_F(WriteBack, mmap_direct_io) +{ + const char FULLPATH[] = "mountpoint/some_file.txt"; + const char RELPATH[] = "some_file.txt"; + const char *CONTENTS = "abcdefgh"; + uint64_t ino = 42; + int fd; + size_t len; + ssize_t bufsize = strlen(CONTENTS); + void *p, *zeros; + + len = getpagesize(); + zeros = calloc(1, len); + ASSERT_NE(nullptr, zeros); + + expect_lookup(RELPATH, ino, len); + expect_open(ino, FOPEN_DIRECT_IO, 1); + expect_read(ino, 0, len, len, zeros); + expect_flush(ino, 1, ReturnErrno(0)); + FuseTest::expect_write(ino, 0, len, len, FUSE_WRITE_CACHE, 0, zeros); + expect_release(ino, ReturnErrno(0)); + + fd = open(FULLPATH, O_RDWR); + EXPECT_LE(0, fd) << strerror(errno); + + p = mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); + ASSERT_NE(MAP_FAILED, p) << strerror(errno); + + memmove((uint8_t*)p, CONTENTS, bufsize); + + ASSERT_EQ(0, munmap(p, len)) << strerror(errno); + close(fd); // Write mmap'd data on close + + free(zeros); +} + /* * When mounted with -o async, the writeback cache mode should delay writes */ From owner-svn-src-all@freebsd.org Sun Sep 27 08:39:38 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E3C273F3560; Sun, 27 Sep 2020 08:39:38 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BzfGL5kNgz4jNM; Sun, 27 Sep 2020 08:39:38 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A7C36A07C; Sun, 27 Sep 2020 08:39:38 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08R8dcTh032314; Sun, 27 Sep 2020 08:39:38 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08R8dc7r032313; Sun, 27 Sep 2020 08:39:38 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202009270839.08R8dc7r032313@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Sun, 27 Sep 2020 08:39:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366191 - stable/12/share/man/man8 X-SVN-Group: stable-12 X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: stable/12/share/man/man8 X-SVN-Commit-Revision: 366191 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Sep 2020 08:39:39 -0000 Author: gbe (doc committer) Date: Sun Sep 27 08:39:38 2020 New Revision: 366191 URL: https://svnweb.freebsd.org/changeset/base/366191 Log: MFC r365905: diskless(8): Correct Sections out of conventional order error Event: September 2020 Bugathon Modified: stable/12/share/man/man8/diskless.8 Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man8/diskless.8 ============================================================================== --- stable/12/share/man/man8/diskless.8 Sun Sep 27 02:59:28 2020 (r366190) +++ stable/12/share/man/man8/diskless.8 Sun Sep 27 08:39:38 2020 (r366191) @@ -465,6 +465,11 @@ encryption keys. .Xr tftpd 8 .Pp .Pa ports/net/etherboot +.Sh HISTORY +The +.Nm +environment first appeared in +.Fx 2.2.5 . .Sh BUGS This manpage is probably incomplete. .Pp From owner-svn-src-all@freebsd.org Sun Sep 27 08:41:53 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EF8313F38A9; Sun, 27 Sep 2020 08:41:53 +0000 (UTC) (envelope-from zeising@freebsd.org) Received: from mail.daemonic.se (mail.daemonic.se [176.58.89.161]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BzfJx4WwQz4jZk; Sun, 27 Sep 2020 08:41:53 +0000 (UTC) (envelope-from zeising@freebsd.org) Received: from cid.daemonic.se (localhost [IPv6:::1]) by mail.daemonic.se (Postfix) with ESMTP id 4BzfJv6hKJz3nDX; Sun, 27 Sep 2020 08:41:51 +0000 (UTC) X-Virus-Scanned: amavisd-new at daemonic.se Received: from mail.daemonic.se ([IPv6:::1]) (using TLS with cipher ECDHE-RSA-AES128-GCM-SHA256) by cid.daemonic.se (mailscanner.daemonic.se [IPv6:::1]) (amavisd-new, port 10587) with ESMTPS id S6X8GMdjfU4X; Sun, 27 Sep 2020 08:41:51 +0000 (UTC) Received: from vivi.daemonic.se (vivi.daemonic.se [IPv6:2001:470:dca9:1200::4]) by mail.daemonic.se (Postfix) with ESMTPSA id 4BzfJt6BP9z3mQw; Sun, 27 Sep 2020 08:41:50 +0000 (UTC) Subject: Re: svn commit: r366186 - in head/usr.sbin: bsdconfig/share/media bsdinstall/scripts To: Scott Long , rgrimes@freebsd.org Cc: Warner Losh , src-committers , svn-src-all , svn-src-head References: <202009262324.08QNOjbQ056906@gndrsh.dnsmgr.net> <58A46C41-07DE-41F4-A3F9-668035347D8B@samsco.org> From: Niclas Zeising Message-ID: Date: Sun, 27 Sep 2020 10:41:48 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <58A46C41-07DE-41F4-A3F9-668035347D8B@samsco.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4BzfJx4WwQz4jZk X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [0.00 / 15.00]; ASN(0.00)[asn:36236, ipnet:176.58.89.0/24, country:US]; local_wl_from(0.00)[freebsd.org] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Sep 2020 08:41:54 -0000 On 2020-09-27 03:38, Scott Long wrote: >=20 >=20 >> On Sep 26, 2020, at 5:24 PM, Rodney W. Grimes wrote: >> >> =EF=BB=BF >>> >>> >>>>> On Sep 26, 2020, at 1:22 PM, Warner Losh wrote: >>>> >>>> >>>> >>>> I am the wrong person to answer that question. >>>> >>>> In this case, things have not become lame. For instance, the names >>>> ervers for se.freebsd.org work fine, but ftp3.se and ftp6.se records= are >>>> removed. Same for ru.freebsd.org and ftp4.ru. >>>> I'm merely pointing out that changing ftp.CC.freebsd.org usually >>>> requires contacting the person(s) maintaining the CC.freebsd.org zon= e, >>>> which is usually not the project. >>>> >>>> It's usually people associated with the project in some way, but who= might not be as responsive as cluster admin. These domains have been del= egated, so we have to get the delegated admin to make the changes, which = can take a bit of time to chase down and doesn't lend itself to easy / au= tomated coping with this situation. >>>> >>> >>> Just a spitball idea here, but maybe we should consider not embedding= these lists of mirror URLs into the binaries. It seems pretty straight-= forward that the list evolves over time, and that evolution is not tightl= y coupled with the updating of the binaries. It sounds like the pkg and = freebsd-update infrastructure use DNS TXT and/or SRV records to point to = the metadata needed to construct a mirror URL list dynamically. Maybe so= mething similar can be done for bsdconfig? If it?s not a crazy idea, is = there anyone who would be interested in helping me write a proposal over = at arch@? >> >> 100% behind that idea! Especially since it seems the project has lost >> (some) control over its DNS space, which IMHO, is still an issue, if >> the people whom DNS zones have been deligated to are not responsive >> that should also >=20 > Words of agreement don=E2=80=99t help at the moment, though i appreciat= e your enthusiasm. Would you he able to help write a proposal for the ar= ch@ mailing list? >=20 I think this is the wrong approach, and the better approach is to have=20 the official installer use download.freebsd.org (which already is=20 geo-located). I also feel like this is probably something that core and=20 possibly clusteradm should weigh in on, since it affects how we=20 distribute FreeBSD. My impression was that we were generally trying to move away from=20 mirrors hosted by various people and organizations all over the world,=20 where we have little control, to our own mirrors behind=20 download.freebsd.org. If this is the case, perhaps we should do so in=20 the installer as well. That said, I'm not opposed to the idea of using DNS SRV/TXT records to=20 construct mirror lists, especially if we want to keep on using those=20 mirrors. Regards --=20 Niclas Zeising From owner-svn-src-all@freebsd.org Sun Sep 27 09:12:37 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4A8063F4787; Sun, 27 Sep 2020 09:12:37 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bzg0P1HN3z4l1j; Sun, 27 Sep 2020 09:12:37 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0FA89AB1A; Sun, 27 Sep 2020 09:12:37 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08R9CaR6056423; Sun, 27 Sep 2020 09:12:36 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08R9Cao3056422; Sun, 27 Sep 2020 09:12:36 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <202009270912.08R9Cao3056422@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Sun, 27 Sep 2020 09:12:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366192 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 366192 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Sep 2020 09:12:37 -0000 Author: mmel Date: Sun Sep 27 09:12:36 2020 New Revision: 366192 URL: https://svnweb.freebsd.org/changeset/base/366192 Log: Don't try to print EFI memeory map if it doesn't exist. MFC after: 1 week Modified: head/sys/arm64/arm64/machdep.c Modified: head/sys/arm64/arm64/machdep.c ============================================================================== --- head/sys/arm64/arm64/machdep.c Sun Sep 27 08:39:38 2020 (r366191) +++ head/sys/arm64/arm64/machdep.c Sun Sep 27 09:12:36 2020 (r366192) @@ -1258,7 +1258,8 @@ initarm(struct arm64_bootparams *abp) strlcpy(kernelname, env, sizeof(kernelname)); if (boothowto & RB_VERBOSE) { - print_efi_map_entries(efihdr); + if (efihdr != NULL) + print_efi_map_entries(efihdr); physmem_print_tables(); } From owner-svn-src-all@freebsd.org Sun Sep 27 09:14:16 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B80353F43C9; Sun, 27 Sep 2020 09:14:16 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bzg2J446Tz4l4j; Sun, 27 Sep 2020 09:14:16 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6F1B7AC32; Sun, 27 Sep 2020 09:14:16 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08R9EGAZ056538; Sun, 27 Sep 2020 09:14:16 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08R9EGOc056537; Sun, 27 Sep 2020 09:14:16 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <202009270914.08R9EGOc056537@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Sun, 27 Sep 2020 09:14:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366193 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 366193 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Sep 2020 09:14:16 -0000 Author: mmel Date: Sun Sep 27 09:14:16 2020 New Revision: 366193 URL: https://svnweb.freebsd.org/changeset/base/366193 Log: Don't map same physical memory multiple times with different cache attributes. This is explicitly stated as architectural undefined behavior, leadint to coherencz issues sonner or later. Modified: head/sys/arm64/arm64/locore.S Modified: head/sys/arm64/arm64/locore.S ============================================================================== --- head/sys/arm64/arm64/locore.S Sun Sep 27 09:12:36 2020 (r366192) +++ head/sys/arm64/arm64/locore.S Sun Sep 27 09:14:16 2020 (r366193) @@ -498,7 +498,7 @@ common: cbz x19, 1f /* Create the identity mapping for FDT data (2 MiB max) */ - mov x7, #(ATTR_S1_nG | ATTR_S1_IDX(VM_MEMATTR_UNCACHEABLE)) + mov x7, #(ATTR_S1_nG | ATTR_S1_IDX(VM_MEMATTR_WRITE_BACK)) mov x9, x0 mov x8, x0 /* VA start (== PA start) */ mov x10, #1 @@ -508,7 +508,7 @@ common: #endif /* Create the VA = PA map */ - mov x7, #(ATTR_S1_nG | ATTR_S1_IDX(VM_MEMATTR_UNCACHEABLE)) + mov x7, #(ATTR_S1_nG | ATTR_S1_IDX(VM_MEMATTR_WRITE_BACK)) mov x9, x27 mov x8, x9 /* VA start (== PA start) */ mov x10, #1 From owner-svn-src-all@freebsd.org Sun Sep 27 09:24:31 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E3A073F4A0E; Sun, 27 Sep 2020 09:24:31 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BzgG75j3Wz4lQR; Sun, 27 Sep 2020 09:24:31 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A7326ACA9; Sun, 27 Sep 2020 09:24:31 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08R9OVCb062975; Sun, 27 Sep 2020 09:24:31 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08R9OVUE062974; Sun, 27 Sep 2020 09:24:31 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <202009270924.08R9OVUE062974@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Sun, 27 Sep 2020 09:24:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366194 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 366194 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Sep 2020 09:24:31 -0000 Author: mmel Date: Sun Sep 27 09:24:31 2020 New Revision: 366194 URL: https://svnweb.freebsd.org/changeset/base/366194 Log: Revert r366193, it was committed with unsaved commit log. Modified: head/sys/arm64/arm64/locore.S Modified: head/sys/arm64/arm64/locore.S ============================================================================== --- head/sys/arm64/arm64/locore.S Sun Sep 27 09:14:16 2020 (r366193) +++ head/sys/arm64/arm64/locore.S Sun Sep 27 09:24:31 2020 (r366194) @@ -498,7 +498,7 @@ common: cbz x19, 1f /* Create the identity mapping for FDT data (2 MiB max) */ - mov x7, #(ATTR_S1_nG | ATTR_S1_IDX(VM_MEMATTR_WRITE_BACK)) + mov x7, #(ATTR_S1_nG | ATTR_S1_IDX(VM_MEMATTR_UNCACHEABLE)) mov x9, x0 mov x8, x0 /* VA start (== PA start) */ mov x10, #1 @@ -508,7 +508,7 @@ common: #endif /* Create the VA = PA map */ - mov x7, #(ATTR_S1_nG | ATTR_S1_IDX(VM_MEMATTR_WRITE_BACK)) + mov x7, #(ATTR_S1_nG | ATTR_S1_IDX(VM_MEMATTR_UNCACHEABLE)) mov x9, x27 mov x8, x9 /* VA start (== PA start) */ mov x10, #1 From owner-svn-src-all@freebsd.org Sun Sep 27 09:27:40 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0767B3F4A24; Sun, 27 Sep 2020 09:27:40 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BzgKl6KMwz4lWq; Sun, 27 Sep 2020 09:27:39 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B8269AAC0; Sun, 27 Sep 2020 09:27:39 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08R9RdBm063162; Sun, 27 Sep 2020 09:27:39 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08R9RdaX063161; Sun, 27 Sep 2020 09:27:39 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <202009270927.08R9RdaX063161@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Sun, 27 Sep 2020 09:27:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366195 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 366195 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Sep 2020 09:27:40 -0000 Author: mmel Date: Sun Sep 27 09:27:39 2020 New Revision: 366195 URL: https://svnweb.freebsd.org/changeset/base/366195 Log: Reapply r366193 with proper commit log. Don't map same physical memory multiple times with different cache attributes. This is explicitly stated as architectural undefined behavior, leading to coherency issues sooner or later. Modified: head/sys/arm64/arm64/locore.S Modified: head/sys/arm64/arm64/locore.S ============================================================================== --- head/sys/arm64/arm64/locore.S Sun Sep 27 09:24:31 2020 (r366194) +++ head/sys/arm64/arm64/locore.S Sun Sep 27 09:27:39 2020 (r366195) @@ -498,7 +498,7 @@ common: cbz x19, 1f /* Create the identity mapping for FDT data (2 MiB max) */ - mov x7, #(ATTR_S1_nG | ATTR_S1_IDX(VM_MEMATTR_UNCACHEABLE)) + mov x7, #(ATTR_S1_nG | ATTR_S1_IDX(VM_MEMATTR_WRITE_BACK)) mov x9, x0 mov x8, x0 /* VA start (== PA start) */ mov x10, #1 @@ -508,7 +508,7 @@ common: #endif /* Create the VA = PA map */ - mov x7, #(ATTR_S1_nG | ATTR_S1_IDX(VM_MEMATTR_UNCACHEABLE)) + mov x7, #(ATTR_S1_nG | ATTR_S1_IDX(VM_MEMATTR_WRITE_BACK)) mov x9, x27 mov x8, x9 /* VA start (== PA start) */ mov x10, #1 From owner-svn-src-all@freebsd.org Sun Sep 27 10:15:04 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5A04D3F749B; Sun, 27 Sep 2020 10:15:04 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BzhNS1lf2z4qNK; Sun, 27 Sep 2020 10:15:04 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1C5FAB351; Sun, 27 Sep 2020 10:15:04 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08RAF3HA093139; Sun, 27 Sep 2020 10:15:03 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08RAF3q9093138; Sun, 27 Sep 2020 10:15:03 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <202009271015.08RAF3q9093138@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Sun, 27 Sep 2020 10:15:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366196 - head/sys/arm64/conf X-SVN-Group: head X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: head/sys/arm64/conf X-SVN-Commit-Revision: 366196 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Sep 2020 10:15:04 -0000 Author: mmel Date: Sun Sep 27 10:15:03 2020 New Revision: 366196 URL: https://svnweb.freebsd.org/changeset/base/366196 Log: Add LINUX_BOOT_ABI back to arm64 GENERIC kernel. It was removed in r355289 but forgot to return it back when new u-boot booti support was committed. Although booti is not the preferred method of booting the kernel, it is very useful for the initial phase of porting FreeBSD to a new platform or booting the kernel on various embedded boards in an industrial environment. Modified: head/sys/arm64/conf/GENERIC Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Sun Sep 27 09:27:39 2020 (r366195) +++ head/sys/arm64/conf/GENERIC Sun Sep 27 10:15:03 2020 (r366196) @@ -79,6 +79,7 @@ options RACCT_DEFAULT_TO_DISABLED # Set kern.racct.en options RCTL # Resource limits options SMP options INTRNG +options LINUX_BOOT_ABI # Boot using booti command from U-Boot # Debugging support. Always need this: options KDB # Enable kernel debugger support. From owner-svn-src-all@freebsd.org Sun Sep 27 11:37:18 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3023E3F8769; Sun, 27 Sep 2020 11:37:18 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BzkCK5QFzz4tpk; Sun, 27 Sep 2020 11:37:17 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9C7C1C2B1; Sun, 27 Sep 2020 11:37:17 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08RBbH3g043197; Sun, 27 Sep 2020 11:37:17 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08RBbHos043196; Sun, 27 Sep 2020 11:37:17 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <202009271137.08RBbHos043196@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Sun, 27 Sep 2020 11:37:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366197 - head/sys/arm/arm X-SVN-Group: head X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: head/sys/arm/arm X-SVN-Commit-Revision: 366197 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Sep 2020 11:37:18 -0000 Author: mmel Date: Sun Sep 27 11:37:17 2020 New Revision: 366197 URL: https://svnweb.freebsd.org/changeset/base/366197 Log: Don't send a signal with uninitialized 'sig' and 'code' fields. We have a few shortcuts in the arm trap code to speed up obvious "must fail" cases. In these situations, make sure that we fill in the "sig" and "code" fields of the generated signal. MFC after: 3 weeks Modified: head/sys/arm/arm/trap-v6.c Modified: head/sys/arm/arm/trap-v6.c ============================================================================== --- head/sys/arm/arm/trap-v6.c Sun Sep 27 10:15:03 2020 (r366196) +++ head/sys/arm/arm/trap-v6.c Sun Sep 27 11:37:17 2020 (r366197) @@ -464,8 +464,11 @@ abort_handler(struct trapframe *tf, int prefetch) /* * Don't allow user-mode faults in kernel address space. */ - if (usermode) + if (usermode) { + ksig.sig = SIGSEGV; + ksig.code = SEGV_ACCERR; goto nogo; + } map = kernel_map; } else { @@ -474,8 +477,11 @@ abort_handler(struct trapframe *tf, int prefetch) * is NULL or curproc->p_vmspace is NULL the fault is fatal. */ vm = (p != NULL) ? p->p_vmspace : NULL; - if (vm == NULL) + if (vm == NULL) { + ksig.sig = SIGSEGV; + ksig.code = 0; goto nogo; + } map = &vm->vm_map; if (!usermode && (td->td_intr_nesting_level != 0 || From owner-svn-src-all@freebsd.org Sun Sep 27 13:24:02 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 241333FBBE4; Sun, 27 Sep 2020 13:24:02 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BzmZV064Wz3WCg; Sun, 27 Sep 2020 13:24:02 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DAF17DA8A; Sun, 27 Sep 2020 13:24:01 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08RDO1u8010889; Sun, 27 Sep 2020 13:24:01 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08RDO1sc010888; Sun, 27 Sep 2020 13:24:01 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202009271324.08RDO1sc010888@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 27 Sep 2020 13:24:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366198 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 366198 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Sep 2020 13:24:02 -0000 Author: tuexen Date: Sun Sep 27 13:24:01 2020 New Revision: 366198 URL: https://svnweb.freebsd.org/changeset/base/366198 Log: Improve the handling of receiving unordered and unreliable user messages using DATA chunks. Don't use fsn_included when not being sure that it is set to an appropriate value. If the default is used, which is -1, this can result in SCTP associaitons not making any user visible progress. Thanks to Yutaka Takeda for reporting this issue for the the userland stack in https://github.com/pion/sctp/issues/138. MFC after: 3 days Modified: head/sys/netinet/sctp_indata.c Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Sun Sep 27 11:37:17 2020 (r366197) +++ head/sys/netinet/sctp_indata.c Sun Sep 27 13:24:01 2020 (r366198) @@ -5403,7 +5403,9 @@ sctp_flush_reassm_for_str_seq(struct sctp_tcb *stcb, * it can be delivered... But for now we just dump everything on the * queue. */ - if (!asoc->idata_supported && !ordered && SCTP_TSN_GT(control->fsn_included, cumtsn)) { + if (!asoc->idata_supported && !ordered && + control->first_frag_seen && + SCTP_TSN_GT(control->fsn_included, cumtsn)) { return; } TAILQ_FOREACH_SAFE(chk, &control->reasm, sctp_next, nchk) { From owner-svn-src-all@freebsd.org Sun Sep 27 13:32:03 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B50173FBA7A; Sun, 27 Sep 2020 13:32:03 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bzmll3QDNz3WHY; Sun, 27 Sep 2020 13:32:03 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 59874DA13; Sun, 27 Sep 2020 13:32:03 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08RDW3Jq015541; Sun, 27 Sep 2020 13:32:03 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08RDW3Ip015540; Sun, 27 Sep 2020 13:32:03 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202009271332.08RDW3Ip015540@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 27 Sep 2020 13:32:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366199 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 366199 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Sep 2020 13:32:03 -0000 Author: tuexen Date: Sun Sep 27 13:32:02 2020 New Revision: 366199 URL: https://svnweb.freebsd.org/changeset/base/366199 Log: Cleanup, no functional change intended. MFC after: 3 days Modified: head/sys/netinet/sctp_indata.c Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Sun Sep 27 13:24:01 2020 (r366198) +++ head/sys/netinet/sctp_indata.c Sun Sep 27 13:32:02 2020 (r366199) @@ -5393,7 +5393,6 @@ sctp_flush_reassm_for_str_seq(struct sctp_tcb *stcb, struct sctp_queued_to_read *control, int ordered, uint32_t cumtsn) { struct sctp_tmit_chunk *chk, *nchk; - int cnt_removed = 0; /* * For now large messages held on the stream reasm that are complete @@ -5410,12 +5409,11 @@ sctp_flush_reassm_for_str_seq(struct sctp_tcb *stcb, } TAILQ_FOREACH_SAFE(chk, &control->reasm, sctp_next, nchk) { /* Purge hanging chunks */ - if (!asoc->idata_supported && (ordered == 0)) { + if (!asoc->idata_supported && !ordered) { if (SCTP_TSN_GT(chk->rec.data.tsn, cumtsn)) { break; } } - cnt_removed++; TAILQ_REMOVE(&control->reasm, chk, sctp_next); if (asoc->size_on_reasm_queue >= chk->send_size) { asoc->size_on_reasm_queue -= chk->send_size; From owner-svn-src-all@freebsd.org Sun Sep 27 16:15:03 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B88BE3FFF13; Sun, 27 Sep 2020 16:15:03 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BzrMq4S7sz3gX5; Sun, 27 Sep 2020 16:15:03 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7C509F154; Sun, 27 Sep 2020 16:15:03 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08RGF3Ll016225; Sun, 27 Sep 2020 16:15:03 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08RGF3mE016224; Sun, 27 Sep 2020 16:15:03 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <202009271615.08RGF3mE016224@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Sun, 27 Sep 2020 16:15:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366200 - head/sys/arm64/qoriq/clk X-SVN-Group: head X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: head/sys/arm64/qoriq/clk X-SVN-Commit-Revision: 366200 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Sep 2020 16:15:03 -0000 Author: mmel Date: Sun Sep 27 16:15:03 2020 New Revision: 366200 URL: https://svnweb.freebsd.org/changeset/base/366200 Log: Check the result of the function, not the pointer to it. Modified: head/sys/arm64/qoriq/clk/qoriq_clkgen.c Modified: head/sys/arm64/qoriq/clk/qoriq_clkgen.c ============================================================================== --- head/sys/arm64/qoriq/clk/qoriq_clkgen.c Sun Sep 27 13:32:02 2020 (r366199) +++ head/sys/arm64/qoriq/clk/qoriq_clkgen.c Sun Sep 27 16:15:03 2020 (r366200) @@ -83,7 +83,7 @@ qoriq_clkgen_ofw_mapper(struct clkdom *clkdom, uint32_ *clk = clknode_find_by_id(clkdom, QORIQ_CLK_ID(cells[0], cells[1])); - if (clk == NULL) + if (*clk == NULL) return (EINVAL); return (0); From owner-svn-src-all@freebsd.org Sun Sep 27 17:51:47 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8481E422F1A; Sun, 27 Sep 2020 17:51:47 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx1.sbone.de (cross.sbone.de [195.201.62.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BztWR1HpDz42jW; Sun, 27 Sep 2020 17:51:46 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id E30328D4A157; Sun, 27 Sep 2020 17:51:38 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 5DB49E707C7; Sun, 27 Sep 2020 17:51:38 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id L3U10hDAvhkd; Sun, 27 Sep 2020 17:51:37 +0000 (UTC) Received: from [169.254.164.49] (unknown [IPv6:fde9:577b:c1a9:4902:e8fe:caa7:e262:9516]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id C5EC4E707C0; Sun, 27 Sep 2020 17:51:36 +0000 (UTC) From: "Bjoern A. Zeeb" To: "Michal Meloun" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r366196 - head/sys/arm64/conf Date: Sun, 27 Sep 2020 17:51:36 +0000 X-Mailer: MailMate (2.0BETAr6151) Message-ID: In-Reply-To: <202009271015.08RAF3q9093138@repo.freebsd.org> References: <202009271015.08RAF3q9093138@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; format=flowed X-Rspamd-Queue-Id: 4BztWR1HpDz42jW X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; ASN(0.00)[asn:24940, ipnet:195.201.0.0/16, country:DE]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Sep 2020 17:51:47 -0000 On 27 Sep 2020, at 10:15, Michal Meloun wrote: > Author: mmel > Date: Sun Sep 27 10:15:03 2020 > New Revision: 366196 > URL: https://svnweb.freebsd.org/changeset/base/366196 > > Log: > Add LINUX_BOOT_ABI back to arm64 GENERIC kernel. > > It was removed in r355289 but forgot to return it back when new > u-boot booti > support was committed. Although booti is not the preferred method > of > booting the kernel, it is very useful for the initial phase of > porting > FreeBSD to a new platform or booting the kernel on various embedded > boards > in an industrial environment. Seem this prevents (at least my) kernels to boot from loader. Removing the option and rebuilding and the kernel booted. /bz From owner-svn-src-all@freebsd.org Sun Sep 27 18:14:02 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C2D254236B8; Sun, 27 Sep 2020 18:14:02 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bzv164W23z43wY; Sun, 27 Sep 2020 18:14:02 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7E6A910BC2; Sun, 27 Sep 2020 18:14:02 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08RIE2E1090279; Sun, 27 Sep 2020 18:14:02 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08RIE272090278; Sun, 27 Sep 2020 18:14:02 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202009271814.08RIE272090278@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 27 Sep 2020 18:14:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366201 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 366201 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Sep 2020 18:14:02 -0000 Author: trasz Date: Sun Sep 27 18:14:01 2020 New Revision: 366201 URL: https://svnweb.freebsd.org/changeset/base/366201 Log: Shrink struct sysent from 48 to 32 bytes (on LP64; on ILP32 its probably from 32 to 28) by shrinking some entries and reordering them. Reviewed by: kib Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D26508 Modified: head/sys/sys/sysent.h Modified: head/sys/sys/sysent.h ============================================================================== --- head/sys/sys/sysent.h Sun Sep 27 16:15:03 2020 (r366200) +++ head/sys/sys/sysent.h Sun Sep 27 18:14:01 2020 (r366201) @@ -65,14 +65,14 @@ extern bool systrace_enabled; #endif /* _KERNEL */ struct sysent { /* system call table */ - int sy_narg; /* number of arguments */ sy_call_t *sy_call; /* implementing function */ - au_event_t sy_auevent; /* audit event associated with syscall */ systrace_args_func_t sy_systrace_args_func; /* optional argument conversion function. */ + u_int8_t sy_narg; /* number of arguments */ + u_int8_t sy_flags; /* General flags for system calls. */ + au_event_t sy_auevent; /* audit event associated with syscall */ u_int32_t sy_entry; /* DTrace entry ID for systrace. */ u_int32_t sy_return; /* DTrace return ID for systrace. */ - u_int32_t sy_flags; /* General flags for system calls. */ u_int32_t sy_thrcnt; }; From owner-svn-src-all@freebsd.org Sun Sep 27 18:39:10 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 36FD8423F57; Sun, 27 Sep 2020 18:39:10 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BzvZ60gVzz4502; Sun, 27 Sep 2020 18:39:10 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EE0111122C; Sun, 27 Sep 2020 18:39:09 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08RId9qV002617; Sun, 27 Sep 2020 18:39:09 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08RId970002616; Sun, 27 Sep 2020 18:39:09 GMT (envelope-from cy@FreeBSD.org) Message-Id: <202009271839.08RId970002616@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 27 Sep 2020 18:39:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366202 - head/contrib/ipfilter/ipsend X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/contrib/ipfilter/ipsend X-SVN-Commit-Revision: 366202 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Sep 2020 18:39:10 -0000 Author: cy Date: Sun Sep 27 18:39:09 2020 New Revision: 366202 URL: https://svnweb.freebsd.org/changeset/base/366202 Log: Continuing the effort started in r343701, #ifdef cleanup, remove never to be used again checks. MFC after: 1 week Modified: head/contrib/ipfilter/ipsend/iptests.c Modified: head/contrib/ipfilter/ipsend/iptests.c ============================================================================== --- head/contrib/ipfilter/ipsend/iptests.c Sun Sep 27 18:14:01 2020 (r366201) +++ head/contrib/ipfilter/ipsend/iptests.c Sun Sep 27 18:39:09 2020 (r366202) @@ -27,7 +27,7 @@ typedef int boolean_t; # endif # define _KERNEL # define KERNEL -# if !defined(solaris) && !defined(linux) && !defined(__sgi) && !defined(hpux) +# if !defined(solaris) # include # else # ifdef solaris From owner-svn-src-all@freebsd.org Sun Sep 27 18:39:13 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AD8934241B1; Sun, 27 Sep 2020 18:39:13 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BzvZ92Qjbz45Nm; Sun, 27 Sep 2020 18:39:12 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9B6841130C; Sun, 27 Sep 2020 18:39:12 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08RIdCcX002664; Sun, 27 Sep 2020 18:39:12 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08RIdCZF002663; Sun, 27 Sep 2020 18:39:12 GMT (envelope-from cy@FreeBSD.org) Message-Id: <202009271839.08RIdCZF002663@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 27 Sep 2020 18:39:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366203 - head/contrib/ipfilter/ipsend X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/contrib/ipfilter/ipsend X-SVN-Commit-Revision: 366203 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Sep 2020 18:39:13 -0000 Author: cy Date: Sun Sep 27 18:39:12 2020 New Revision: 366203 URL: https://svnweb.freebsd.org/changeset/base/366203 Log: Remove Linux and IRIX specific files. MFC after: 1 week Deleted: head/contrib/ipfilter/ipsend/larp.c head/contrib/ipfilter/ipsend/linux.h head/contrib/ipfilter/ipsend/lsock.c head/contrib/ipfilter/ipsend/sirix.c head/contrib/ipfilter/ipsend/slinux.c From owner-svn-src-all@freebsd.org Sun Sep 27 18:39:16 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C924A423F58; Sun, 27 Sep 2020 18:39:16 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BzvZC6F9wz45Ly; Sun, 27 Sep 2020 18:39:15 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 734CD10DDC; Sun, 27 Sep 2020 18:39:15 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08RIdFM0002709; Sun, 27 Sep 2020 18:39:15 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08RIdFX9002708; Sun, 27 Sep 2020 18:39:15 GMT (envelope-from cy@FreeBSD.org) Message-Id: <202009271839.08RIdFX9002708@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 27 Sep 2020 18:39:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366204 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 366204 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Sep 2020 18:39:17 -0000 Author: cy Date: Sun Sep 27 18:39:15 2020 New Revision: 366204 URL: https://svnweb.freebsd.org/changeset/base/366204 Log: Remove extraneous bracket. MFC after: 3 days Modified: head/sys/contrib/ipfilter/netinet/ip_proxy.h Modified: head/sys/contrib/ipfilter/netinet/ip_proxy.h ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_proxy.h Sun Sep 27 18:39:12 2020 (r366203) +++ head/sys/contrib/ipfilter/netinet/ip_proxy.h Sun Sep 27 18:39:15 2020 (r366204) @@ -13,7 +13,7 @@ #define __IP_PROXY_H__ #ifndef SOLARIS -# if defined(sun) && defined(__SVR4)) +# if defined(sun) && defined(__SVR4) # define SOLARIS 1 # else # define SOLARIS 0 From owner-svn-src-all@freebsd.org Sun Sep 27 18:47:13 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1342F42461F; Sun, 27 Sep 2020 18:47:13 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BzvlN6xK6z462C; Sun, 27 Sep 2020 18:47:12 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CE804114A8; Sun, 27 Sep 2020 18:47:12 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08RIlCxH009030; Sun, 27 Sep 2020 18:47:12 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08RIl6iY009001; Sun, 27 Sep 2020 18:47:06 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202009271847.08RIl6iY009001@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 27 Sep 2020 18:47:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366205 - in head/sys: amd64/amd64 amd64/cloudabi32 amd64/cloudabi64 amd64/ia32 amd64/include amd64/linux amd64/linux32 arm/arm arm/cloudabi32 arm/include arm64/arm64 arm64/cloudabi32 a... X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: in head/sys: amd64/amd64 amd64/cloudabi32 amd64/cloudabi64 amd64/ia32 amd64/include amd64/linux amd64/linux32 arm/arm arm/cloudabi32 arm/include arm64/arm64 arm64/cloudabi32 arm64/cloudabi64 arm64/inc... X-SVN-Commit-Revision: 366205 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Sep 2020 18:47:13 -0000 Author: trasz Date: Sun Sep 27 18:47:06 2020 New Revision: 366205 URL: https://svnweb.freebsd.org/changeset/base/366205 Log: Get rid of sa->narg. It serves no purpose; use sa->callp->sy_narg instead. Reviewed by: kib Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D26458 Modified: head/sys/amd64/amd64/trap.c head/sys/amd64/cloudabi32/cloudabi32_sysvec.c head/sys/amd64/cloudabi64/cloudabi64_sysvec.c head/sys/amd64/ia32/ia32_syscall.c head/sys/amd64/include/proc.h head/sys/amd64/linux/linux_sysvec.c head/sys/amd64/linux32/linux32_sysvec.c head/sys/arm/arm/syscall.c head/sys/arm/cloudabi32/cloudabi32_sysvec.c head/sys/arm/include/proc.h head/sys/arm64/arm64/elf32_machdep.c head/sys/arm64/arm64/trap.c head/sys/arm64/cloudabi32/cloudabi32_sysvec.c head/sys/arm64/cloudabi64/cloudabi64_sysvec.c head/sys/arm64/include/proc.h head/sys/arm64/linux/linux_sysvec.c head/sys/i386/cloudabi32/cloudabi32_sysvec.c head/sys/i386/i386/trap.c head/sys/i386/include/proc.h head/sys/i386/linux/linux_sysvec.c head/sys/kern/kern_thread.c head/sys/kern/subr_syscall.c head/sys/kern/sys_process.c head/sys/mips/include/proc.h head/sys/mips/mips/trap.c head/sys/powerpc/include/proc.h head/sys/powerpc/powerpc/trap.c head/sys/riscv/include/proc.h head/sys/riscv/riscv/trap.c Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Sun Sep 27 18:39:15 2020 (r366204) +++ head/sys/amd64/amd64/trap.c Sun Sep 27 18:47:06 2020 (r366205) @@ -999,15 +999,15 @@ cpu_fetch_syscall_args_fallback(struct thread *td, str else sa->callp = &p->p_sysent->sv_table[sa->code]; - sa->narg = sa->callp->sy_narg; - KASSERT(sa->narg <= nitems(sa->args), ("Too many syscall arguments!")); + KASSERT(sa->callp->sy_narg <= nitems(sa->args), + ("Too many syscall arguments!")); argp = &frame->tf_rdi; argp += reg; memcpy(sa->args, argp, sizeof(sa->args[0]) * NARGREGS); - if (sa->narg > regcnt) { + if (sa->callp->sy_narg > regcnt) { params = (caddr_t)frame->tf_rsp + sizeof(register_t); error = copyin(params, &sa->args[regcnt], - (sa->narg - regcnt) * sizeof(sa->args[0])); + (sa->callp->sy_narg - regcnt) * sizeof(sa->args[0])); if (__predict_false(error != 0)) return (error); } @@ -1037,10 +1037,10 @@ cpu_fetch_syscall_args(struct thread *td) return (cpu_fetch_syscall_args_fallback(td, sa)); sa->callp = &p->p_sysent->sv_table[sa->code]; - sa->narg = sa->callp->sy_narg; - KASSERT(sa->narg <= nitems(sa->args), ("Too many syscall arguments!")); + KASSERT(sa->callp->sy_narg <= nitems(sa->args), + ("Too many syscall arguments!")); - if (__predict_false(sa->narg > NARGREGS)) + if (__predict_false(sa->callp->sy_narg > NARGREGS)) return (cpu_fetch_syscall_args_fallback(td, sa)); memcpy(sa->args, &frame->tf_rdi, sizeof(sa->args[0]) * NARGREGS); Modified: head/sys/amd64/cloudabi32/cloudabi32_sysvec.c ============================================================================== --- head/sys/amd64/cloudabi32/cloudabi32_sysvec.c Sun Sep 27 18:39:15 2020 (r366204) +++ head/sys/amd64/cloudabi32/cloudabi32_sysvec.c Sun Sep 27 18:47:06 2020 (r366205) @@ -104,7 +104,6 @@ cloudabi32_fetch_syscall_args(struct thread *td) if (sa->code >= CLOUDABI32_SYS_MAXSYSCALL) return (ENOSYS); sa->callp = &cloudabi32_sysent[sa->code]; - sa->narg = sa->callp->sy_narg; /* * Fetch system call arguments. @@ -117,7 +116,7 @@ cloudabi32_fetch_syscall_args(struct thread *td) * implementation used by 64-bit processes. */ error = copyin((void *)frame->tf_rcx, sa->args, - sa->narg * sizeof(sa->args[0])); + sa->callp->sy_narg * sizeof(sa->args[0])); if (error != 0) return (error); Modified: head/sys/amd64/cloudabi64/cloudabi64_sysvec.c ============================================================================== --- head/sys/amd64/cloudabi64/cloudabi64_sysvec.c Sun Sep 27 18:39:15 2020 (r366204) +++ head/sys/amd64/cloudabi64/cloudabi64_sysvec.c Sun Sep 27 18:47:06 2020 (r366205) @@ -101,7 +101,6 @@ cloudabi64_fetch_syscall_args(struct thread *td) if (sa->code >= CLOUDABI64_SYS_MAXSYSCALL) return (ENOSYS); sa->callp = &cloudabi64_sysent[sa->code]; - sa->narg = sa->callp->sy_narg; /* Fetch system call arguments. */ sa->args[0] = frame->tf_rdi; Modified: head/sys/amd64/ia32/ia32_syscall.c ============================================================================== --- head/sys/amd64/ia32/ia32_syscall.c Sun Sep 27 18:39:15 2020 (r366204) +++ head/sys/amd64/ia32/ia32_syscall.c Sun Sep 27 18:47:06 2020 (r366205) @@ -180,15 +180,14 @@ ia32_fetch_syscall_args(struct thread *td) sa->callp = &p->p_sysent->sv_table[0]; else sa->callp = &p->p_sysent->sv_table[sa->code]; - sa->narg = sa->callp->sy_narg; - if (params != NULL && sa->narg != 0) + if (params != NULL && sa->callp->sy_narg != 0) error = copyin(params, (caddr_t)args, - (u_int)(sa->narg * sizeof(int))); + (u_int)(sa->callp->sy_narg * sizeof(int))); else error = 0; - for (i = 0; i < sa->narg; i++) + for (i = 0; i < sa->callp->sy_narg; i++) sa->args[i] = args[i]; if (error == 0) { Modified: head/sys/amd64/include/proc.h ============================================================================== --- head/sys/amd64/include/proc.h Sun Sep 27 18:39:15 2020 (r366204) +++ head/sys/amd64/include/proc.h Sun Sep 27 18:47:06 2020 (r366205) @@ -94,7 +94,6 @@ struct syscall_args { u_int code; struct sysent *callp; register_t args[8]; - int narg; }; #ifdef _KERNEL Modified: head/sys/amd64/linux/linux_sysvec.c ============================================================================== --- head/sys/amd64/linux/linux_sysvec.c Sun Sep 27 18:39:15 2020 (r366204) +++ head/sys/amd64/linux/linux_sysvec.c Sun Sep 27 18:47:06 2020 (r366205) @@ -198,7 +198,6 @@ linux_fetch_syscall_args(struct thread *td) sa->callp = &p->p_sysent->sv_table[p->p_sysent->sv_size - 1]; else sa->callp = &p->p_sysent->sv_table[sa->code]; - sa->narg = sa->callp->sy_narg; td->td_retval[0] = 0; return (0); Modified: head/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- head/sys/amd64/linux32/linux32_sysvec.c Sun Sep 27 18:39:15 2020 (r366204) +++ head/sys/amd64/linux32/linux32_sysvec.c Sun Sep 27 18:47:06 2020 (r366205) @@ -662,7 +662,6 @@ linux32_fetch_syscall_args(struct thread *td) sa->callp = &p->p_sysent->sv_table[p->p_sysent->sv_size - 1]; else sa->callp = &p->p_sysent->sv_table[sa->code]; - sa->narg = sa->callp->sy_narg; td->td_retval[0] = 0; td->td_retval[1] = frame->tf_rdx; Modified: head/sys/arm/arm/syscall.c ============================================================================== --- head/sys/arm/arm/syscall.c Sun Sep 27 18:39:15 2020 (r366204) +++ head/sys/arm/arm/syscall.c Sun Sep 27 18:47:06 2020 (r366205) @@ -120,12 +120,12 @@ cpu_fetch_syscall_args(struct thread *td) sa->callp = &p->p_sysent->sv_table[0]; else sa->callp = &p->p_sysent->sv_table[sa->code]; - sa->narg = sa->callp->sy_narg; error = 0; memcpy(sa->args, ap, sa->nap * sizeof(register_t)); - if (sa->narg > sa->nap) { + if (sa->callp->sy_narg > sa->nap) { error = copyin((void *)td->td_frame->tf_usr_sp, sa->args + - sa->nap, (sa->narg - sa->nap) * sizeof(register_t)); + sa->nap, (sa->callp->sy_narg - sa->nap) * + sizeof(register_t)); } if (error == 0) { td->td_retval[0] = 0; Modified: head/sys/arm/cloudabi32/cloudabi32_sysvec.c ============================================================================== --- head/sys/arm/cloudabi32/cloudabi32_sysvec.c Sun Sep 27 18:39:15 2020 (r366204) +++ head/sys/arm/cloudabi32/cloudabi32_sysvec.c Sun Sep 27 18:47:06 2020 (r366205) @@ -81,16 +81,15 @@ cloudabi32_fetch_syscall_args(struct thread *td) if (sa->code >= CLOUDABI32_SYS_MAXSYSCALL) return (ENOSYS); sa->callp = &cloudabi32_sysent[sa->code]; - sa->narg = sa->callp->sy_narg; /* Fetch system call arguments from registers and the stack. */ sa->args[0] = frame->tf_r0; sa->args[1] = frame->tf_r1; sa->args[2] = frame->tf_r2; sa->args[3] = frame->tf_r3; - if (sa->narg > 4) { + if (sa->callp->sy_narg > 4) { error = copyin((void *)td->td_frame->tf_usr_sp, &sa->args[4], - (sa->narg - 4) * sizeof(register_t)); + (sa->callp->sy_narg - 4) * sizeof(register_t)); if (error != 0) return (error); } Modified: head/sys/arm/include/proc.h ============================================================================== --- head/sys/arm/include/proc.h Sun Sep 27 18:39:15 2020 (r366204) +++ head/sys/arm/include/proc.h Sun Sep 27 18:47:06 2020 (r366205) @@ -82,7 +82,6 @@ struct syscall_args { u_int code; struct sysent *callp; register_t args[MAXARGS]; - int narg; u_int nap; } __aligned(8); Modified: head/sys/arm64/arm64/elf32_machdep.c ============================================================================== --- head/sys/arm64/arm64/elf32_machdep.c Sun Sep 27 18:39:15 2020 (r366204) +++ head/sys/arm64/arm64/elf32_machdep.c Sun Sep 27 18:47:06 2020 (r366205) @@ -156,7 +156,7 @@ freebsd32_fetch_syscall_args(struct thread *td) struct proc *p; register_t *ap; struct syscall_args *sa; - int error, i, nap; + int error, i, nap, narg; unsigned int args[4]; nap = 4; @@ -181,15 +181,15 @@ freebsd32_fetch_syscall_args(struct thread *td) else sa->callp = &p->p_sysent->sv_table[sa->code]; - sa->narg = sa->callp->sy_narg; + narg = sa->callp->sy_narg; for (i = 0; i < nap; i++) sa->args[i] = ap[i]; - if (sa->narg > nap) { - if ((sa->narg - nap) > nitems(args)) + if (narg > nap) { + if (narg - nap > nitems(args)) panic("Too many system call arguiments"); error = copyin((void *)td->td_frame->tf_x[13], args, - (sa->narg - nap) * sizeof(int)); - for (i = 0; i < (sa->narg - nap); i++) + (narg - nap) * sizeof(int)); + for (i = 0; i < (narg - nap); i++) sa->args[i + nap] = args[i]; } Modified: head/sys/arm64/arm64/trap.c ============================================================================== --- head/sys/arm64/arm64/trap.c Sun Sep 27 18:39:15 2020 (r366204) +++ head/sys/arm64/arm64/trap.c Sun Sep 27 18:47:06 2020 (r366205) @@ -127,7 +127,7 @@ cpu_fetch_syscall_args(struct thread *td) struct syscall_args *sa; int nap; - nap = 8; + nap = MAXARGS; p = td->td_proc; ap = td->td_frame->tf_x; sa = &td->td_sa; @@ -144,10 +144,9 @@ cpu_fetch_syscall_args(struct thread *td) else sa->callp = &p->p_sysent->sv_table[sa->code]; - sa->narg = sa->callp->sy_narg; memcpy(sa->args, ap, nap * sizeof(register_t)); - if (sa->narg > nap) - panic("ARM64TODO: Could we have more than 8 args?"); + if (sa->callp->sy_narg > nap) + panic("ARM64TODO: Could we have more than %d args?", MAXARGS); td->td_retval[0] = 0; td->td_retval[1] = 0; Modified: head/sys/arm64/cloudabi32/cloudabi32_sysvec.c ============================================================================== --- head/sys/arm64/cloudabi32/cloudabi32_sysvec.c Sun Sep 27 18:39:15 2020 (r366204) +++ head/sys/arm64/cloudabi32/cloudabi32_sysvec.c Sun Sep 27 18:47:06 2020 (r366205) @@ -78,7 +78,6 @@ cloudabi32_fetch_syscall_args(struct thread *td) if (sa->code >= CLOUDABI32_SYS_MAXSYSCALL) return (ENOSYS); sa->callp = &cloudabi32_sysent[sa->code]; - sa->narg = sa->callp->sy_narg; /* * Fetch system call arguments. @@ -91,7 +90,7 @@ cloudabi32_fetch_syscall_args(struct thread *td) * implementation used by 64-bit processes. */ error = copyin((void *)frame->tf_x[2], sa->args, - sa->narg * sizeof(sa->args[0])); + sa->callp->sy_narg * sizeof(sa->args[0])); if (error != 0) return (error); Modified: head/sys/arm64/cloudabi64/cloudabi64_sysvec.c ============================================================================== --- head/sys/arm64/cloudabi64/cloudabi64_sysvec.c Sun Sep 27 18:39:15 2020 (r366204) +++ head/sys/arm64/cloudabi64/cloudabi64_sysvec.c Sun Sep 27 18:47:06 2020 (r366205) @@ -81,7 +81,6 @@ cloudabi64_fetch_syscall_args(struct thread *td) if (sa->code >= CLOUDABI64_SYS_MAXSYSCALL) return (ENOSYS); sa->callp = &cloudabi64_sysent[sa->code]; - sa->narg = sa->callp->sy_narg; /* Fetch system call arguments. */ for (i = 0; i < MAXARGS; i++) Modified: head/sys/arm64/include/proc.h ============================================================================== --- head/sys/arm64/include/proc.h Sun Sep 27 18:39:15 2020 (r366204) +++ head/sys/arm64/include/proc.h Sun Sep 27 18:47:06 2020 (r366205) @@ -51,7 +51,6 @@ struct syscall_args { u_int code; struct sysent *callp; register_t args[MAXARGS]; - int narg; }; #ifdef _KERNEL Modified: head/sys/arm64/linux/linux_sysvec.c ============================================================================== --- head/sys/arm64/linux/linux_sysvec.c Sun Sep 27 18:39:15 2020 (r366204) +++ head/sys/arm64/linux/linux_sysvec.c Sun Sep 27 18:47:06 2020 (r366205) @@ -126,10 +126,9 @@ linux_fetch_syscall_args(struct thread *td) else sa->callp = &p->p_sysent->sv_table[sa->code]; - sa->narg = sa->callp->sy_narg; - if (sa->narg > 8) - panic("ARM64TODO: Could we have more than 8 args?"); - memcpy(sa->args, ap, 8 * sizeof(register_t)); + if (sa->callp->sy_narg > MAXARGS) + panic("ARM64TODO: Could we have more than %d args?", MAXARGS); + memcpy(sa->args, ap, MAXARGS * sizeof(register_t)); td->td_retval[0] = 0; return (0); Modified: head/sys/i386/cloudabi32/cloudabi32_sysvec.c ============================================================================== --- head/sys/i386/cloudabi32/cloudabi32_sysvec.c Sun Sep 27 18:39:15 2020 (r366204) +++ head/sys/i386/cloudabi32/cloudabi32_sysvec.c Sun Sep 27 18:47:06 2020 (r366205) @@ -99,11 +99,10 @@ cloudabi32_fetch_syscall_args(struct thread *td) if (sa->code >= CLOUDABI32_SYS_MAXSYSCALL) return (ENOSYS); sa->callp = &cloudabi32_sysent[sa->code]; - sa->narg = sa->callp->sy_narg; /* Fetch system call arguments from the stack. */ error = copyin((void *)(frame->tf_esp + 4), sa->args, - sa->narg * sizeof(sa->args[0])); + sa->callp->sy_narg * sizeof(sa->args[0])); if (error != 0) return (error); Modified: head/sys/i386/i386/trap.c ============================================================================== --- head/sys/i386/i386/trap.c Sun Sep 27 18:39:15 2020 (r366204) +++ head/sys/i386/i386/trap.c Sun Sep 27 18:47:06 2020 (r366205) @@ -1084,11 +1084,10 @@ cpu_fetch_syscall_args(struct thread *td) sa->callp = &p->p_sysent->sv_table[0]; else sa->callp = &p->p_sysent->sv_table[sa->code]; - sa->narg = sa->callp->sy_narg; - if (params != NULL && sa->narg != 0) + if (params != NULL && sa->callp->sy_narg != 0) error = copyin(params, (caddr_t)sa->args, - (u_int)(sa->narg * sizeof(uint32_t))); + (u_int)(sa->callp->sy_narg * sizeof(uint32_t))); else error = 0; Modified: head/sys/i386/include/proc.h ============================================================================== --- head/sys/i386/include/proc.h Sun Sep 27 18:39:15 2020 (r366204) +++ head/sys/i386/include/proc.h Sun Sep 27 18:47:06 2020 (r366205) @@ -66,7 +66,6 @@ struct syscall_args { u_int code; struct sysent *callp; register_t args[8]; - int narg; }; #ifdef _KERNEL Modified: head/sys/i386/linux/linux_sysvec.c ============================================================================== --- head/sys/i386/linux/linux_sysvec.c Sun Sep 27 18:39:15 2020 (r366204) +++ head/sys/i386/linux/linux_sysvec.c Sun Sep 27 18:47:06 2020 (r366205) @@ -784,7 +784,6 @@ linux_fetch_syscall_args(struct thread *td) sa->callp = &p->p_sysent->sv_table[p->p_sysent->sv_size - 1]; else sa->callp = &p->p_sysent->sv_table[sa->code]; - sa->narg = sa->callp->sy_narg; td->td_retval[0] = 0; td->td_retval[1] = frame->tf_edx; Modified: head/sys/kern/kern_thread.c ============================================================================== --- head/sys/kern/kern_thread.c Sun Sep 27 18:39:15 2020 (r366204) +++ head/sys/kern/kern_thread.c Sun Sep 27 18:47:06 2020 (r366205) @@ -82,7 +82,7 @@ _Static_assert(offsetof(struct thread, td_flags) == 0x "struct thread KBI td_flags"); _Static_assert(offsetof(struct thread, td_pflags) == 0x104, "struct thread KBI td_pflags"); -_Static_assert(offsetof(struct thread, td_frame) == 0x4a8, +_Static_assert(offsetof(struct thread, td_frame) == 0x4a0, "struct thread KBI td_frame"); _Static_assert(offsetof(struct thread, td_emuldata) == 0x6b0, "struct thread KBI td_emuldata"); @@ -102,9 +102,9 @@ _Static_assert(offsetof(struct thread, td_flags) == 0x "struct thread KBI td_flags"); _Static_assert(offsetof(struct thread, td_pflags) == 0xa0, "struct thread KBI td_pflags"); -_Static_assert(offsetof(struct thread, td_frame) == 0x304, +_Static_assert(offsetof(struct thread, td_frame) == 0x300, "struct thread KBI td_frame"); -_Static_assert(offsetof(struct thread, td_emuldata) == 0x348, +_Static_assert(offsetof(struct thread, td_emuldata) == 0x344, "struct thread KBI td_emuldata"); _Static_assert(offsetof(struct proc, p_flag) == 0x68, "struct proc KBI p_flag"); Modified: head/sys/kern/subr_syscall.c ============================================================================== --- head/sys/kern/subr_syscall.c Sun Sep 27 18:39:15 2020 (r366204) +++ head/sys/kern/subr_syscall.c Sun Sep 27 18:47:06 2020 (r366205) @@ -79,7 +79,7 @@ syscallenter(struct thread *td) error = (p->p_sysent->sv_fetch_syscall_args)(td); #ifdef KTRACE if (KTRPOINT(td, KTR_SYSCALL)) - ktrsyscall(sa->code, sa->narg, sa->args); + ktrsyscall(sa->code, sa->callp->sy_narg, sa->args); #endif KTR_START4(KTR_SYSC, "syscall", syscallname(p, sa->code), (uintptr_t)td, "pid:%d", td->td_proc->p_pid, "arg0:%p", sa->args[0], @@ -104,7 +104,7 @@ syscallenter(struct thread *td) error = (p->p_sysent->sv_fetch_syscall_args)(td); #ifdef KTRACE if (KTRPOINT(td, KTR_SYSCALL)) - ktrsyscall(sa->code, sa->narg, sa->args); + ktrsyscall(sa->code, sa->callp->sy_narg, sa->args); #endif if (error != 0) { td->td_errno = error; Modified: head/sys/kern/sys_process.c ============================================================================== --- head/sys/kern/sys_process.c Sun Sep 27 18:39:15 2020 (r366204) +++ head/sys/kern/sys_process.c Sun Sep 27 18:47:06 2020 (r366205) @@ -925,7 +925,7 @@ kern_ptrace(struct thread *td, int req, pid_t pid, voi break; } bzero(addr, sizeof(td2->td_sa.args)); - bcopy(td2->td_sa.args, addr, td2->td_sa.narg * + bcopy(td2->td_sa.args, addr, td2->td_sa.callp->sy_narg * sizeof(register_t)); break; @@ -1246,7 +1246,7 @@ kern_ptrace(struct thread *td, int req, pid_t pid, voi strcpy(pl->pl_tdname, td2->td_name); if ((td2->td_dbgflags & (TDB_SCE | TDB_SCX)) != 0) { pl->pl_syscall_code = td2->td_sa.code; - pl->pl_syscall_narg = td2->td_sa.narg; + pl->pl_syscall_narg = td2->td_sa.callp->sy_narg; } else { pl->pl_syscall_code = 0; pl->pl_syscall_narg = 0; Modified: head/sys/mips/include/proc.h ============================================================================== --- head/sys/mips/include/proc.h Sun Sep 27 18:39:15 2020 (r366204) +++ head/sys/mips/include/proc.h Sun Sep 27 18:47:06 2020 (r366205) @@ -85,7 +85,6 @@ struct syscall_args { u_int code; struct sysent *callp; register_t args[8]; - int narg; struct trapframe *trapframe; }; Modified: head/sys/mips/mips/trap.c ============================================================================== --- head/sys/mips/mips/trap.c Sun Sep 27 18:39:15 2020 (r366204) +++ head/sys/mips/mips/trap.c Sun Sep 27 18:47:06 2020 (r366205) @@ -448,9 +448,7 @@ cpu_fetch_syscall_args(struct thread *td) else sa->callp = &se->sv_table[sa->code]; - sa->narg = sa->callp->sy_narg; - - if (sa->narg > nsaved) { + if (sa->callp->sy_narg > nsaved) { #if defined(__mips_n32) || defined(__mips_n64) /* * XXX @@ -462,7 +460,7 @@ cpu_fetch_syscall_args(struct thread *td) if (!SV_PROC_FLAG(td->td_proc, SV_ILP32)) #endif printf("SYSCALL #%u pid:%u, narg (%u) > nsaved (%u).\n", - sa->code, td->td_proc->p_pid, sa->narg, nsaved); + sa->code, td->td_proc->p_pid, sa->callp->sy_narg, nsaved); #endif #if (defined(__mips_n32) || defined(__mips_n64)) && defined(COMPAT_FREEBSD32) if (SV_PROC_FLAG(td->td_proc, SV_ILP32)) { @@ -470,7 +468,7 @@ cpu_fetch_syscall_args(struct thread *td) int32_t arg; error = 0; /* XXX GCC is awful. */ - for (i = nsaved; i < sa->narg; i++) { + for (i = nsaved; i < sa->callp->sy_narg; i++) { error = copyin((caddr_t)(intptr_t)(locr0->sp + (4 + (i - nsaved)) * sizeof(int32_t)), (caddr_t)&arg, sizeof arg); @@ -482,7 +480,7 @@ cpu_fetch_syscall_args(struct thread *td) #endif error = copyin((caddr_t)(intptr_t)(locr0->sp + 4 * sizeof(register_t)), (caddr_t)&sa->args[nsaved], - (u_int)(sa->narg - nsaved) * sizeof(register_t)); + (u_int)(sa->callp->sy_narg - nsaved) * sizeof(register_t)); if (error != 0) { locr0->v0 = error; locr0->a3 = 1; Modified: head/sys/powerpc/include/proc.h ============================================================================== --- head/sys/powerpc/include/proc.h Sun Sep 27 18:39:15 2020 (r366204) +++ head/sys/powerpc/include/proc.h Sun Sep 27 18:47:06 2020 (r366205) @@ -63,7 +63,6 @@ struct syscall_args { u_int code; struct sysent *callp; register_t args[10]; - int narg; }; #ifdef _KERNEL Modified: head/sys/powerpc/powerpc/trap.c ============================================================================== --- head/sys/powerpc/powerpc/trap.c Sun Sep 27 18:39:15 2020 (r366204) +++ head/sys/powerpc/powerpc/trap.c Sun Sep 27 18:47:06 2020 (r366205) @@ -639,7 +639,7 @@ cpu_fetch_syscall_args(struct thread *td) struct syscall_args *sa; caddr_t params; size_t argsz; - int error, n, i; + int error, n, narg, i; p = td->td_proc; frame = td->td_frame; @@ -680,7 +680,7 @@ cpu_fetch_syscall_args(struct thread *td) else sa->callp = &p->p_sysent->sv_table[sa->code]; - sa->narg = sa->callp->sy_narg; + narg = sa->callp->sy_narg; if (SV_PROC_FLAG(p, SV_ILP32)) { argsz = sizeof(uint32_t); @@ -695,17 +695,17 @@ cpu_fetch_syscall_args(struct thread *td) sa->args[i] = ((u_register_t *)(params))[i]; } - if (sa->narg > n) + if (narg > n) error = copyin(MOREARGS(frame->fixreg[1]), sa->args + n, - (sa->narg - n) * argsz); + (narg - n) * argsz); else error = 0; #ifdef __powerpc64__ - if (SV_PROC_FLAG(p, SV_ILP32) && sa->narg > n) { + if (SV_PROC_FLAG(p, SV_ILP32) && narg > n) { /* Expand the size of arguments copied from the stack */ - for (i = sa->narg; i >= n; i--) + for (i = narg; i >= n; i--) sa->args[i] = ((uint32_t *)(&sa->args[n]))[i-n]; } #endif Modified: head/sys/riscv/include/proc.h ============================================================================== --- head/sys/riscv/include/proc.h Sun Sep 27 18:39:15 2020 (r366204) +++ head/sys/riscv/include/proc.h Sun Sep 27 18:47:06 2020 (r366205) @@ -50,7 +50,6 @@ struct syscall_args { u_int code; struct sysent *callp; register_t args[MAXARGS]; - int narg; }; #endif /* !_MACHINE_PROC_H_ */ Modified: head/sys/riscv/riscv/trap.c ============================================================================== --- head/sys/riscv/riscv/trap.c Sun Sep 27 18:39:15 2020 (r366204) +++ head/sys/riscv/riscv/trap.c Sun Sep 27 18:47:06 2020 (r366205) @@ -117,9 +117,8 @@ cpu_fetch_syscall_args(struct thread *td) else sa->callp = &p->p_sysent->sv_table[sa->code]; - sa->narg = sa->callp->sy_narg; memcpy(sa->args, ap, nap * sizeof(register_t)); - if (sa->narg > nap) + if (sa->callp->sy_narg > nap) panic("TODO: Could we have more then %d args?", NARGREG); td->td_retval[0] = 0; From owner-svn-src-all@freebsd.org Sun Sep 27 21:43:21 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2F164372B14; Sun, 27 Sep 2020 21:43:21 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bzzfd0TB8z4SDm; Sun, 27 Sep 2020 21:43:21 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E7C41136C0; Sun, 27 Sep 2020 21:43:20 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08RLhKVL028903; Sun, 27 Sep 2020 21:43:20 GMT (envelope-from rscheff@FreeBSD.org) Received: (from rscheff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08RLhJs4028898; Sun, 27 Sep 2020 21:43:19 GMT (envelope-from rscheff@FreeBSD.org) Message-Id: <202009272143.08RLhJs4028898@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rscheff set sender to rscheff@FreeBSD.org using -f From: Richard Scheffenegger Date: Sun, 27 Sep 2020 21:43:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366206 - head/usr.sbin/ctld X-SVN-Group: head X-SVN-Commit-Author: rscheff X-SVN-Commit-Paths: head/usr.sbin/ctld X-SVN-Commit-Revision: 366206 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Sep 2020 21:43:21 -0000 Author: rscheff Date: Sun Sep 27 21:43:19 2020 New Revision: 366206 URL: https://svnweb.freebsd.org/changeset/base/366206 Log: Add DSCP support for network QoS to iscsi target. In order to prioritize iSCSI traffic across a network, DSCP can be used. In order not to rely on "ipfw setdscp" or in-network reclassification, this adds the dscp value directly to the portal group (where TCP sessions are accepted). The incoming iSCSI session is first handled by ctld for any CHAP authentication and the socket is then handed off to the in-kernel iscsi driver without modification of the socket parameters. Simply setting up the socket in ctld is sufficient to keep sending outgoing iSCSI related traffic with the configured DSCP value. Reviewed by: mav, trasz MFC after: 2 weeks Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D26385 Modified: head/usr.sbin/ctld/ctl.conf.5 head/usr.sbin/ctld/ctld.c head/usr.sbin/ctld/ctld.h head/usr.sbin/ctld/parse.y head/usr.sbin/ctld/token.l head/usr.sbin/ctld/uclparse.c Modified: head/usr.sbin/ctld/ctl.conf.5 ============================================================================== --- head/usr.sbin/ctld/ctl.conf.5 Sun Sep 27 18:47:06 2020 (r366205) +++ head/usr.sbin/ctld/ctl.conf.5 Sun Sep 27 21:43:19 2020 (r366206) @@ -250,6 +250,14 @@ Specifies that this .Sy portal-group is listened by some other host. This host will announce it on discovery stage, but won't listen. +.It Ic dscp Ar value +The DiffServ Codepoint used for sending data. The DSCP can be +set to numeric, or hexadecimal values directly, as well as the +well-defined +.Qq Ar CSx +and +.Qq Ar AFxx +codepoints. .El .Ss target Context .Bl -tag -width indent Modified: head/usr.sbin/ctld/ctld.c ============================================================================== --- head/usr.sbin/ctld/ctld.c Sun Sep 27 18:47:06 2020 (r366205) +++ head/usr.sbin/ctld/ctld.c Sun Sep 27 21:43:19 2020 (r366206) @@ -625,6 +625,7 @@ portal_group_new(struct conf *conf, const char *name) TAILQ_INIT(&pg->pg_ports); pg->pg_conf = conf; pg->pg_tag = 0; /* Assigned later in conf_apply(). */ + pg->pg_dscp = -1; TAILQ_INSERT_TAIL(&conf->conf_portal_groups, pg, pg_next); return (pg); @@ -2180,6 +2181,32 @@ conf_apply(struct conf *oldconf, struct conf *newconf) newp->p_socket = 0; cumulated_error++; continue; + } + if (newpg->pg_dscp != -1) { + struct sockaddr sa; + int len = sizeof(sa); + getsockname(newp->p_socket, &sa, &len); + /* + * Only allow the 6-bit DSCP + * field to be modified + */ + int tos = newpg->pg_dscp << 2; + if (sa.sa_family == AF_INET) { + if (setsockopt(newp->p_socket, + IPPROTO_IP, IP_TOS, + &tos, sizeof(tos)) == -1) + log_warn("setsockopt(IP_TOS) " + "failed for %s", + newp->p_listen); + } else + if (sa.sa_family == AF_INET6) { + if (setsockopt(newp->p_socket, + IPPROTO_IPV6, IPV6_TCLASS, + &tos, sizeof(tos)) == -1) + log_warn("setsockopt(IPV6_TCLASS) " + "failed for %s", + newp->p_listen); + } } error = bind(newp->p_socket, newp->p_ai->ai_addr, newp->p_ai->ai_addrlen); Modified: head/usr.sbin/ctld/ctld.h ============================================================================== --- head/usr.sbin/ctld/ctld.h Sun Sep 27 18:47:06 2020 (r366205) +++ head/usr.sbin/ctld/ctld.h Sun Sep 27 21:43:19 2020 (r366206) @@ -127,6 +127,7 @@ struct portal_group { TAILQ_HEAD(, port) pg_ports; char *pg_offload; char *pg_redirection; + int pg_dscp; uint16_t pg_tag; }; Modified: head/usr.sbin/ctld/parse.y ============================================================================== --- head/usr.sbin/ctld/parse.y Sun Sep 27 18:47:06 2020 (r366205) +++ head/usr.sbin/ctld/parse.y Sun Sep 27 21:43:19 2020 (r366206) @@ -41,6 +41,8 @@ #include #include "ctld.h" +#include +#include extern FILE *yyin; extern char *yytext; @@ -60,11 +62,13 @@ extern void yyrestart(FILE *); %token ALIAS AUTH_GROUP AUTH_TYPE BACKEND BLOCKSIZE CHAP CHAP_MUTUAL %token CLOSING_BRACKET CTL_LUN DEBUG DEVICE_ID DEVICE_TYPE -%token DISCOVERY_AUTH_GROUP DISCOVERY_FILTER FOREIGN +%token DISCOVERY_AUTH_GROUP DISCOVERY_FILTER DSCP FOREIGN %token INITIATOR_NAME INITIATOR_PORTAL ISNS_SERVER ISNS_PERIOD ISNS_TIMEOUT %token LISTEN LISTEN_ISER LUN MAXPROC OFFLOAD OPENING_BRACKET OPTION %token PATH PIDFILE PORT PORTAL_GROUP REDIRECT SEMICOLON SERIAL SIZE STR %token TAG TARGET TIMEOUT +%token AF11 AF12 AF13 AF21 AF22 AF23 AF31 AF32 AF33 AF41 AF42 AF43 +%token BE EF CS0 CS1 CS2 CS3 CS4 CS5 CS6 CS7 %union { @@ -353,6 +357,8 @@ portal_group_entry: portal_group_redirect | portal_group_tag + | + portal_group_dscp ; portal_group_discovery_auth_group: DISCOVERY_AUTH_GROUP STR @@ -462,6 +468,50 @@ portal_group_tag: TAG STR portal_group->pg_tag = tmp; } ; + +portal_group_dscp +: DSCP STR + { + uint64_t tmp; + + if (strcmp($2, "0x") == 0) { + tmp = strtol($2 + 2, NULL, 16); + } else if (expand_number($2, &tmp) != 0) { + yyerror("invalid numeric value"); + free($2); + return(1); + } + if (tmp >= 0x40) { + yyerror("invalid dscp value"); + return(1); + } + + portal_group->pg_dscp = tmp; + } +| DSCP BE { portal_group->pg_dscp = IPTOS_DSCP_CS0 >> 2 ; } +| DSCP EF { portal_group->pg_dscp = IPTOS_DSCP_EF >> 2 ; } +| DSCP CS0 { portal_group->pg_dscp = IPTOS_DSCP_CS0 >> 2 ; } +| DSCP CS1 { portal_group->pg_dscp = IPTOS_DSCP_CS1 >> 2 ; } +| DSCP CS2 { portal_group->pg_dscp = IPTOS_DSCP_CS2 >> 2 ; } +| DSCP CS3 { portal_group->pg_dscp = IPTOS_DSCP_CS3 >> 2 ; } +| DSCP CS4 { portal_group->pg_dscp = IPTOS_DSCP_CS4 >> 2 ; } +| DSCP CS5 { portal_group->pg_dscp = IPTOS_DSCP_CS5 >> 2 ; } +| DSCP CS6 { portal_group->pg_dscp = IPTOS_DSCP_CS6 >> 2 ; } +| DSCP CS7 { portal_group->pg_dscp = IPTOS_DSCP_CS7 >> 2 ; } +| DSCP AF11 { portal_group->pg_dscp = IPTOS_DSCP_AF11 >> 2 ; } +| DSCP AF12 { portal_group->pg_dscp = IPTOS_DSCP_AF12 >> 2 ; } +| DSCP AF13 { portal_group->pg_dscp = IPTOS_DSCP_AF13 >> 2 ; } +| DSCP AF21 { portal_group->pg_dscp = IPTOS_DSCP_AF21 >> 2 ; } +| DSCP AF22 { portal_group->pg_dscp = IPTOS_DSCP_AF22 >> 2 ; } +| DSCP AF23 { portal_group->pg_dscp = IPTOS_DSCP_AF23 >> 2 ; } +| DSCP AF31 { portal_group->pg_dscp = IPTOS_DSCP_AF31 >> 2 ; } +| DSCP AF32 { portal_group->pg_dscp = IPTOS_DSCP_AF32 >> 2 ; } +| DSCP AF33 { portal_group->pg_dscp = IPTOS_DSCP_AF33 >> 2 ; } +| DSCP AF41 { portal_group->pg_dscp = IPTOS_DSCP_AF41 >> 2 ; } +| DSCP AF42 { portal_group->pg_dscp = IPTOS_DSCP_AF42 >> 2 ; } +| DSCP AF43 { portal_group->pg_dscp = IPTOS_DSCP_AF43 >> 2 ; } + ; + lun: LUN lun_name OPENING_BRACKET lun_entries CLOSING_BRACKET Modified: head/usr.sbin/ctld/token.l ============================================================================== --- head/usr.sbin/ctld/token.l Sun Sep 27 18:47:06 2020 (r366205) +++ head/usr.sbin/ctld/token.l Sun Sep 27 21:43:19 2020 (r366206) @@ -63,6 +63,7 @@ device-id { return DEVICE_ID; } device-type { return DEVICE_TYPE; } discovery-auth-group { return DISCOVERY_AUTH_GROUP; } discovery-filter { return DISCOVERY_FILTER; } +dscp { return DSCP; } foreign { return FOREIGN; } initiator-name { return INITIATOR_NAME; } initiator-portal { return INITIATOR_PORTAL; } @@ -85,6 +86,28 @@ size { return SIZE; } tag { return TAG; } target { return TARGET; } timeout { return TIMEOUT; } +af11 { return AF11; } +af12 { return AF12; } +af13 { return AF13; } +af21 { return AF21; } +af22 { return AF22; } +af23 { return AF23; } +af31 { return AF31; } +af32 { return AF32; } +af33 { return AF33; } +af41 { return AF41; } +af42 { return AF42; } +af43 { return AF43; } +be { return CS0; } +ef { return EF; } +cs0 { return CS0; } +cs1 { return CS1; } +cs2 { return CS2; } +cs3 { return CS3; } +cs4 { return CS4; } +cs5 { return CS5; } +cs6 { return CS6; } +cs7 { return CS7; } \"[^"]+\" { yylval.str = strndup(yytext + 1, strlen(yytext) - 2); return STR; } [a-zA-Z0-9\.\-@_/\:\[\]]+ { yylval.str = strdup(yytext); return STR; } Modified: head/usr.sbin/ctld/uclparse.c ============================================================================== --- head/usr.sbin/ctld/uclparse.c Sun Sep 27 18:47:06 2020 (r366205) +++ head/usr.sbin/ctld/uclparse.c Sun Sep 27 21:43:19 2020 (r366206) @@ -39,6 +39,8 @@ #include #include #include +#include +#include #include "ctld.h" @@ -607,7 +609,70 @@ uclparse_portal_group(const char *name, const ucl_obje ucl_object_tostring_forced(tmp)); } } - } + + if (!strcmp(key, "dscp")) { + if ((obj->type != UCL_STRING) && (obj->type != UCL_INT)) { + log_warnx("\"dscp\" property of portal group " + "\"%s\" is not a string or integer", portal_group->pg_name); + return(1); + } + if (obj->type == UCL_INT) + portal_group->pg_dscp = ucl_object_toint(obj); + else { + key = ucl_object_tostring(obj); + if (strcmp(key, "0x") == 0) + portal_group->pg_dscp = strtol(key + 2, NULL, 16); + else if (strcmp(key, "be") || strcmp(key, "cs0")) + portal_group->pg_dscp = IPTOS_DSCP_CS0 >> 2; + else if (strcmp(key, "ef")) + portal_group->pg_dscp = IPTOS_DSCP_EF >> 2; + else if (strcmp(key, "cs0")) + portal_group->pg_dscp = IPTOS_DSCP_CS0 >> 2; + else if (strcmp(key, "cs1")) + portal_group->pg_dscp = IPTOS_DSCP_CS1 >> 2; + else if (strcmp(key, "cs2")) + portal_group->pg_dscp = IPTOS_DSCP_CS2 >> 2; + else if (strcmp(key, "cs3")) + portal_group->pg_dscp = IPTOS_DSCP_CS3 >> 2; + else if (strcmp(key, "cs4")) + portal_group->pg_dscp = IPTOS_DSCP_CS4 >> 2; + else if (strcmp(key, "cs5")) + portal_group->pg_dscp = IPTOS_DSCP_CS5 >> 2; + else if (strcmp(key, "cs6")) + portal_group->pg_dscp = IPTOS_DSCP_CS6 >> 2; + else if (strcmp(key, "cs7")) + portal_group->pg_dscp = IPTOS_DSCP_CS7 >> 2; + else if (strcmp(key, "af11")) + portal_group->pg_dscp = IPTOS_DSCP_AF11 >> 2; + else if (strcmp(key, "af12")) + portal_group->pg_dscp = IPTOS_DSCP_AF12 >> 2; + else if (strcmp(key, "af13")) + portal_group->pg_dscp = IPTOS_DSCP_AF13 >> 2; + else if (strcmp(key, "af21")) + portal_group->pg_dscp = IPTOS_DSCP_AF21 >> 2; + else if (strcmp(key, "af22")) + portal_group->pg_dscp = IPTOS_DSCP_AF22 >> 2; + else if (strcmp(key, "af23")) + portal_group->pg_dscp = IPTOS_DSCP_AF23 >> 2; + else if (strcmp(key, "af31")) + portal_group->pg_dscp = IPTOS_DSCP_AF31 >> 2; + else if (strcmp(key, "af32")) + portal_group->pg_dscp = IPTOS_DSCP_AF32 >> 2; + else if (strcmp(key, "af33")) + portal_group->pg_dscp = IPTOS_DSCP_AF33 >> 2; + else if (strcmp(key, "af41")) + portal_group->pg_dscp = IPTOS_DSCP_AF41 >> 2; + else if (strcmp(key, "af42")) + portal_group->pg_dscp = IPTOS_DSCP_AF42 >> 2; + else if (strcmp(key, "af43")) + portal_group->pg_dscp = IPTOS_DSCP_AF43 >> 2; + else { + log_warnx("\"dscp\" property value is not a supported textual value"); + return (1); + } + } + } + } return (0); } From owner-svn-src-all@freebsd.org Sun Sep 27 22:26:43 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9A4573742AC; Sun, 27 Sep 2020 22:26:43 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C00cg3dhrz4VR1; Sun, 27 Sep 2020 22:26:43 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5FB5713F92; Sun, 27 Sep 2020 22:26:43 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08RMQhsW054057; Sun, 27 Sep 2020 22:26:43 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08RMQf1h054050; Sun, 27 Sep 2020 22:26:41 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <202009272226.08RMQf1h054050@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sun, 27 Sep 2020 22:26:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366207 - head/lib/libc/gen X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/lib/libc/gen X-SVN-Commit-Revision: 366207 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Sep 2020 22:26:43 -0000 Author: asomers Date: Sun Sep 27 22:26:41 2020 New Revision: 366207 URL: https://svnweb.freebsd.org/changeset/base/366207 Log: Misc compiler warning fixes in lib/libc Reviewed by: kevans, imp MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D26534 Modified: head/lib/libc/gen/auxv.c head/lib/libc/gen/basename_compat.c head/lib/libc/gen/crypt.c head/lib/libc/gen/dirname_compat.c head/lib/libc/gen/fts-compat.c head/lib/libc/gen/ftw-compat11.c head/lib/libc/gen/getentropy.c Modified: head/lib/libc/gen/auxv.c ============================================================================== --- head/lib/libc/gen/auxv.c Sun Sep 27 21:43:19 2020 (r366206) +++ head/lib/libc/gen/auxv.c Sun Sep 27 22:26:41 2020 (r366207) @@ -67,7 +67,8 @@ __init_elf_aux_vector(void) } static pthread_once_t aux_once = PTHREAD_ONCE_INIT; -static int pagesize, osreldate, canary_len, ncpus, pagesizes_len, bsdflags; +static int pagesize, osreldate, ncpus, bsdflags; +static size_t canary_len, pagesizes_len; static int hwcap_present, hwcap2_present; static char *canary, *pagesizes, *execpath; static void *ps_strings, *timekeep; @@ -245,16 +246,21 @@ int _elf_aux_info(int aux, void *buf, int buflen) { int res; + size_t buflen_; __init_elf_aux_vector(); if (__elf_aux_vector == NULL) return (ENOSYS); _once(&aux_once, init_aux); + if (buflen < 0) + return (EINVAL); + buflen_ = (size_t)buflen; + switch (aux) { case AT_CANARY: - if (canary != NULL && canary_len >= buflen) { - memcpy(buf, canary, buflen); + if (canary != NULL && canary_len >= buflen_) { + memcpy(buf, canary, buflen_); memset(canary, 0, canary_len); canary = NULL; res = 0; @@ -267,35 +273,35 @@ _elf_aux_info(int aux, void *buf, int buflen) else if (buf == NULL) res = EINVAL; else { - if (strlcpy(buf, execpath, buflen) >= buflen) + if (strlcpy(buf, execpath, buflen_) >= buflen_) res = EINVAL; else res = 0; } break; case AT_HWCAP: - if (hwcap_present && buflen == sizeof(u_long)) { + if (hwcap_present && buflen_ == sizeof(u_long)) { *(u_long *)buf = hwcap; res = 0; } else res = ENOENT; break; case AT_HWCAP2: - if (hwcap2_present && buflen == sizeof(u_long)) { + if (hwcap2_present && buflen_ == sizeof(u_long)) { *(u_long *)buf = hwcap2; res = 0; } else res = ENOENT; break; case AT_PAGESIZES: - if (pagesizes != NULL && pagesizes_len >= buflen) { - memcpy(buf, pagesizes, buflen); + if (pagesizes != NULL && pagesizes_len >= buflen_) { + memcpy(buf, pagesizes, buflen_); res = 0; } else res = ENOENT; break; case AT_PAGESZ: - if (buflen == sizeof(int)) { + if (buflen_ == sizeof(int)) { if (pagesize != 0) { *(int *)buf = pagesize; res = 0; @@ -305,7 +311,7 @@ _elf_aux_info(int aux, void *buf, int buflen) res = EINVAL; break; case AT_OSRELDATE: - if (buflen == sizeof(int)) { + if (buflen_ == sizeof(int)) { if (osreldate != 0) { *(int *)buf = osreldate; res = 0; @@ -315,7 +321,7 @@ _elf_aux_info(int aux, void *buf, int buflen) res = EINVAL; break; case AT_NCPUS: - if (buflen == sizeof(int)) { + if (buflen_ == sizeof(int)) { if (ncpus != 0) { *(int *)buf = ncpus; res = 0; @@ -325,7 +331,7 @@ _elf_aux_info(int aux, void *buf, int buflen) res = EINVAL; break; case AT_TIMEKEEP: - if (buflen == sizeof(void *)) { + if (buflen_ == sizeof(void *)) { if (timekeep != NULL) { *(void **)buf = timekeep; res = 0; @@ -335,14 +341,14 @@ _elf_aux_info(int aux, void *buf, int buflen) res = EINVAL; break; case AT_BSDFLAGS: - if (buflen == sizeof(int)) { + if (buflen_ == sizeof(int)) { *(int *)buf = bsdflags; res = 0; } else res = EINVAL; break; case AT_PS_STRINGS: - if (buflen == sizeof(void *)) { + if (buflen_ == sizeof(void *)) { if (ps_strings != NULL) { *(void **)buf = ps_strings; res = 0; Modified: head/lib/libc/gen/basename_compat.c ============================================================================== --- head/lib/libc/gen/basename_compat.c Sun Sep 27 21:43:19 2020 (r366206) +++ head/lib/libc/gen/basename_compat.c Sun Sep 27 22:26:41 2020 (r366207) @@ -25,6 +25,9 @@ __FBSDID("$FreeBSD$"); #include #include +char * __freebsd11_basename_r(const char *path, char *bname); +char * __freebsd11_basename(char *path); + char * __freebsd11_basename_r(const char *path, char *bname) { Modified: head/lib/libc/gen/crypt.c ============================================================================== --- head/lib/libc/gen/crypt.c Sun Sep 27 21:43:19 2020 (r366206) +++ head/lib/libc/gen/crypt.c Sun Sep 27 22:26:41 2020 (r366207) @@ -47,6 +47,11 @@ __FBSDID("$FreeBSD$"); * encryption, make sure you've got libcrypt.a around. */ +int __freebsd11_des_setkey(const char *key); +int __freebsd11_des_cipher(const char *in, char *out, long salt, int num_iter); +int __freebsd11_setkey(const char *key); +int __freebsd11_encrypt(char *block, int flag); + /* ARGSUSED */ int __freebsd11_des_setkey(const char *key __unused) Modified: head/lib/libc/gen/dirname_compat.c ============================================================================== --- head/lib/libc/gen/dirname_compat.c Sun Sep 27 21:43:19 2020 (r366206) +++ head/lib/libc/gen/dirname_compat.c Sun Sep 27 22:26:41 2020 (r366207) @@ -25,6 +25,8 @@ __FBSDID("$FreeBSD$"); #include #include +char * __freebsd11_dirname(char *path); + char * __freebsd11_dirname(char *path) { Modified: head/lib/libc/gen/fts-compat.c ============================================================================== --- head/lib/libc/gen/fts-compat.c Sun Sep 27 21:43:19 2020 (r366206) +++ head/lib/libc/gen/fts-compat.c Sun Sep 27 22:26:41 2020 (r366207) @@ -633,9 +633,8 @@ fts_build(FTS *sp, int type) FTSENT *cur, *tail; DIR *dirp; void *oldaddr; - size_t dnamlen; int cderrno, descend, len, level, maxlen, nlinks, oflag, saved_errno, - nostat, doadjust; + nostat, doadjust, dnamlen; char *cp; /* Set current node pointer. */ @@ -745,7 +744,7 @@ fts_build(FTS *sp, int type) if (!ISSET(FTS_SEEDOT) && ISDOT(dp->d_name)) continue; - if ((p = fts_alloc(sp, dp->d_name, (int)dnamlen)) == NULL) + if ((p = fts_alloc(sp, dp->d_name, dnamlen)) == NULL) goto mem1; if (dnamlen >= maxlen) { /* include space for NUL */ oldaddr = sp->fts_path; Modified: head/lib/libc/gen/ftw-compat11.c ============================================================================== --- head/lib/libc/gen/ftw-compat11.c Sun Sep 27 21:43:19 2020 (r366206) +++ head/lib/libc/gen/ftw-compat11.c Sun Sep 27 22:26:41 2020 (r366207) @@ -33,6 +33,9 @@ __FBSDID("$FreeBSD$"); #include "fts-compat11.h" +int freebsd11_ftw(const char *path, int (*fn)(const char *, + const struct freebsd11_stat *, int), int nfds); + int freebsd11_ftw(const char *path, int (*fn)(const char *, const struct freebsd11_stat *, int), int nfds) Modified: head/lib/libc/gen/getentropy.c ============================================================================== --- head/lib/libc/gen/getentropy.c Sun Sep 27 21:43:19 2020 (r366206) +++ head/lib/libc/gen/getentropy.c Sun Sep 27 22:26:41 2020 (r366207) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "libc_private.h" From owner-svn-src-all@freebsd.org Sun Sep 27 22:48:44 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A880B374561; Sun, 27 Sep 2020 22:48:44 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C01643Dldz4WR4; Sun, 27 Sep 2020 22:48:44 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5388C13F75; Sun, 27 Sep 2020 22:48:44 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08RMmijX066208; Sun, 27 Sep 2020 22:48:44 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08RMmiS3066207; Sun, 27 Sep 2020 22:48:44 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202009272248.08RMmiS3066207@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 27 Sep 2020 22:48:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366208 - stable/12/share/mk X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/12/share/mk X-SVN-Commit-Revision: 366208 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Sep 2020 22:48:44 -0000 Author: emaste Date: Sun Sep 27 22:48:43 2020 New Revision: 366208 URL: https://svnweb.freebsd.org/changeset/base/366208 Log: MFC r356615: src.opts.mk: force KERBEROS_SUPPORT off where KERBEROS forced off Explicitly setting WITHOUT_KERBEROS implies WITHOUT_KERBEROS_SUPPORT, but previously other cases that forced KERBEROS off (such as WITHOUT_CRYPT) did not also set KERBEROS_SUPPORT off. Because the _SUPPORT dependent options (KERBEROS/KERBEROS_SUPPORT) are processed before other dependencies (CRYPT/KERBEROS) it's not easy to make this happen automatically. Instead just explicitly set KERBEROS_SUPPORT off where we set KERBEROS off. Modified: stable/12/share/mk/src.opts.mk Directory Properties: stable/12/ (props changed) Modified: stable/12/share/mk/src.opts.mk ============================================================================== --- stable/12/share/mk/src.opts.mk Sun Sep 27 22:26:41 2020 (r366207) +++ stable/12/share/mk/src.opts.mk Sun Sep 27 22:48:43 2020 (r366208) @@ -477,6 +477,7 @@ MK_CTF:= no MK_OPENSSL:= no MK_OPENSSH:= no MK_KERBEROS:= no +MK_KERBEROS_SUPPORT:= no .endif .if ${MK_CXX} == "no" @@ -508,6 +509,7 @@ MK_NLS_CATALOGS:= no MK_DMAGENT:= no MK_OPENSSH:= no MK_KERBEROS:= no +MK_KERBEROS_SUPPORT:= no MK_LDNS:= no MK_PKGBOOTSTRAP:= no MK_SVN:= no From owner-svn-src-all@freebsd.org Sun Sep 27 22:50:02 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 30F1D374C05; Sun, 27 Sep 2020 22:50:02 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C017Z0XsGz4WPD; Sun, 27 Sep 2020 22:50:02 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EA1DB13F77; Sun, 27 Sep 2020 22:50:01 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08RMo1Ul066358; Sun, 27 Sep 2020 22:50:01 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08RMo1n9066357; Sun, 27 Sep 2020 22:50:01 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202009272250.08RMo1n9066357@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 27 Sep 2020 22:50:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366209 - stable/12/share/mk X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/12/share/mk X-SVN-Commit-Revision: 366209 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Sep 2020 22:50:02 -0000 Author: emaste Date: Sun Sep 27 22:50:01 2020 New Revision: 366209 URL: https://svnweb.freebsd.org/changeset/base/366209 Log: MFC r356323: src.opts.mk: SVNLITE requires FILE Modified: stable/12/share/mk/src.opts.mk Directory Properties: stable/12/ (props changed) Modified: stable/12/share/mk/src.opts.mk ============================================================================== --- stable/12/share/mk/src.opts.mk Sun Sep 27 22:48:43 2020 (r366208) +++ stable/12/share/mk/src.opts.mk Sun Sep 27 22:50:01 2020 (r366209) @@ -490,6 +490,10 @@ MK_TESTS:= no MK_BSDINSTALL:= no .endif +.if ${MK_FILE} == "no" +MK_SVNLITE:= no +.endif + .if ${MK_MAIL} == "no" MK_MAILWRAPPER:= no MK_SENDMAIL:= no From owner-svn-src-all@freebsd.org Sun Sep 27 23:01:57 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9ECD6374A62; Sun, 27 Sep 2020 23:01:57 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C01PK3l4pz4WwZ; Sun, 27 Sep 2020 23:01:57 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 64634145B0; Sun, 27 Sep 2020 23:01:57 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08RN1var074326; Sun, 27 Sep 2020 23:01:57 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08RN1spW074313; Sun, 27 Sep 2020 23:01:54 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009272301.08RN1spW074313@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 27 Sep 2020 23:01:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366210 - head/usr.bin/procstat X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/usr.bin/procstat X-SVN-Commit-Revision: 366210 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Sep 2020 23:01:57 -0000 Author: kib Date: Sun Sep 27 23:01:54 2020 New Revision: 366210 URL: https://svnweb.freebsd.org/changeset/base/366210 Log: Consistently use __FBSDID("FreeBSD") for ids in usr.bin/procstat. Submitted by: Juraj Lutter MFC after: 1 week Differential revision: https://reviews.freebsd.org/D26568 Modified: head/usr.bin/procstat/procstat.c head/usr.bin/procstat/procstat_args.c head/usr.bin/procstat/procstat_auxv.c head/usr.bin/procstat/procstat_basic.c head/usr.bin/procstat/procstat_bin.c head/usr.bin/procstat/procstat_cred.c head/usr.bin/procstat/procstat_cs.c head/usr.bin/procstat/procstat_files.c head/usr.bin/procstat/procstat_kstack.c head/usr.bin/procstat/procstat_ptlwpinfo.c head/usr.bin/procstat/procstat_rlimit.c head/usr.bin/procstat/procstat_sigs.c head/usr.bin/procstat/procstat_threads.c head/usr.bin/procstat/procstat_vm.c Modified: head/usr.bin/procstat/procstat.c ============================================================================== --- head/usr.bin/procstat/procstat.c Sun Sep 27 22:50:01 2020 (r366209) +++ head/usr.bin/procstat/procstat.c Sun Sep 27 23:01:54 2020 (r366210) @@ -26,9 +26,10 @@ * 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. - * - * $FreeBSD$ */ + +#include +__FBSDID("$FreeBSD$"); #include #include Modified: head/usr.bin/procstat/procstat_args.c ============================================================================== --- head/usr.bin/procstat/procstat_args.c Sun Sep 27 22:50:01 2020 (r366209) +++ head/usr.bin/procstat/procstat_args.c Sun Sep 27 23:01:54 2020 (r366210) @@ -25,9 +25,10 @@ * 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. - * - * $FreeBSD$ */ + +#include +__FBSDID("$FreeBSD$"); #include #include Modified: head/usr.bin/procstat/procstat_auxv.c ============================================================================== --- head/usr.bin/procstat/procstat_auxv.c Sun Sep 27 22:50:01 2020 (r366209) +++ head/usr.bin/procstat/procstat_auxv.c Sun Sep 27 23:01:54 2020 (r366210) @@ -25,9 +25,10 @@ * 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. - * - * $FreeBSD$ */ + +#include +__FBSDID("$FreeBSD$"); #include #include Modified: head/usr.bin/procstat/procstat_basic.c ============================================================================== --- head/usr.bin/procstat/procstat_basic.c Sun Sep 27 22:50:01 2020 (r366209) +++ head/usr.bin/procstat/procstat_basic.c Sun Sep 27 23:01:54 2020 (r366210) @@ -25,9 +25,10 @@ * 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. - * - * $FreeBSD$ */ + +#include +__FBSDID("$FreeBSD$"); #include #include Modified: head/usr.bin/procstat/procstat_bin.c ============================================================================== --- head/usr.bin/procstat/procstat_bin.c Sun Sep 27 22:50:01 2020 (r366209) +++ head/usr.bin/procstat/procstat_bin.c Sun Sep 27 23:01:54 2020 (r366210) @@ -25,9 +25,10 @@ * 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. - * - * $FreeBSD$ */ + +#include +__FBSDID("$FreeBSD$"); #include #include Modified: head/usr.bin/procstat/procstat_cred.c ============================================================================== --- head/usr.bin/procstat/procstat_cred.c Sun Sep 27 22:50:01 2020 (r366209) +++ head/usr.bin/procstat/procstat_cred.c Sun Sep 27 23:01:54 2020 (r366210) @@ -25,9 +25,10 @@ * 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. - * - * $FreeBSD$ */ + +#include +__FBSDID("$FreeBSD$"); #include #include Modified: head/usr.bin/procstat/procstat_cs.c ============================================================================== --- head/usr.bin/procstat/procstat_cs.c Sun Sep 27 22:50:01 2020 (r366209) +++ head/usr.bin/procstat/procstat_cs.c Sun Sep 27 23:01:54 2020 (r366210) @@ -23,9 +23,10 @@ * 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. - * - * $FreeBSD$ */ + +#include +__FBSDID("$FreeBSD$"); #include #include Modified: head/usr.bin/procstat/procstat_files.c ============================================================================== --- head/usr.bin/procstat/procstat_files.c Sun Sep 27 22:50:01 2020 (r366209) +++ head/usr.bin/procstat/procstat_files.c Sun Sep 27 23:01:54 2020 (r366210) @@ -25,9 +25,10 @@ * 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. - * - * $FreeBSD$ */ + +#include +__FBSDID("$FreeBSD$"); #include #include Modified: head/usr.bin/procstat/procstat_kstack.c ============================================================================== --- head/usr.bin/procstat/procstat_kstack.c Sun Sep 27 22:50:01 2020 (r366209) +++ head/usr.bin/procstat/procstat_kstack.c Sun Sep 27 23:01:54 2020 (r366210) @@ -25,9 +25,10 @@ * 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. - * - * $FreeBSD$ */ + +#include +__FBSDID("$FreeBSD$"); #include #include Modified: head/usr.bin/procstat/procstat_ptlwpinfo.c ============================================================================== --- head/usr.bin/procstat/procstat_ptlwpinfo.c Sun Sep 27 22:50:01 2020 (r366209) +++ head/usr.bin/procstat/procstat_ptlwpinfo.c Sun Sep 27 23:01:54 2020 (r366210) @@ -22,10 +22,10 @@ * 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 +__FBSDID("$FreeBSD$"); #include #include Modified: head/usr.bin/procstat/procstat_rlimit.c ============================================================================== --- head/usr.bin/procstat/procstat_rlimit.c Sun Sep 27 22:50:01 2020 (r366209) +++ head/usr.bin/procstat/procstat_rlimit.c Sun Sep 27 23:01:54 2020 (r366210) @@ -25,9 +25,10 @@ * 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. - * - * $FreeBSD$ */ + +#include +__FBSDID("$FreeBSD$"); #include #include Modified: head/usr.bin/procstat/procstat_sigs.c ============================================================================== --- head/usr.bin/procstat/procstat_sigs.c Sun Sep 27 22:50:01 2020 (r366209) +++ head/usr.bin/procstat/procstat_sigs.c Sun Sep 27 23:01:54 2020 (r366210) @@ -25,9 +25,10 @@ * 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. - * - * $FreeBSD$ */ + +#include +__FBSDID("$FreeBSD$"); #include #include Modified: head/usr.bin/procstat/procstat_threads.c ============================================================================== --- head/usr.bin/procstat/procstat_threads.c Sun Sep 27 22:50:01 2020 (r366209) +++ head/usr.bin/procstat/procstat_threads.c Sun Sep 27 23:01:54 2020 (r366210) @@ -25,9 +25,10 @@ * 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. - * - * $FreeBSD$ */ + +#include +__FBSDID("$FreeBSD$"); #include #include Modified: head/usr.bin/procstat/procstat_vm.c ============================================================================== --- head/usr.bin/procstat/procstat_vm.c Sun Sep 27 22:50:01 2020 (r366209) +++ head/usr.bin/procstat/procstat_vm.c Sun Sep 27 23:01:54 2020 (r366210) @@ -25,9 +25,10 @@ * 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. - * - * $FreeBSD$ */ + +#include +__FBSDID("$FreeBSD$"); #include #include From owner-svn-src-all@freebsd.org Sun Sep 27 23:15:28 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 016A23758F6; Sun, 27 Sep 2020 23:15:28 +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 4C01hv5L3Jz4XgP; Sun, 27 Sep 2020 23:15:27 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.16.1/8.16.1) with ESMTPS id 08RNFJ9r013434 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 28 Sep 2020 02:15:22 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 08RNFJ9r013434 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 08RNFJOb013432; Mon, 28 Sep 2020 02:15:19 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 28 Sep 2020 02:15:19 +0300 From: Konstantin Belousov To: Alan Somers Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r366207 - head/lib/libc/gen Message-ID: <20200927231519.GI2643@kib.kiev.ua> References: <202009272226.08RMQf1h054050@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202009272226.08RMQf1h054050@repo.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=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on tom.home X-Rspamd-Queue-Id: 4C01hv5L3Jz4XgP X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Sep 2020 23:15:28 -0000 On Sun, Sep 27, 2020 at 10:26:41PM +0000, Alan Somers wrote: > Author: asomers > Date: Sun Sep 27 22:26:41 2020 > New Revision: 366207 > URL: https://svnweb.freebsd.org/changeset/base/366207 > > Log: > Misc compiler warning fixes in lib/libc > > Reviewed by: kevans, imp > MFC after: 2 weeks > Differential Revision: https://reviews.freebsd.org/D26534 > > Modified: > head/lib/libc/gen/auxv.c > head/lib/libc/gen/basename_compat.c > head/lib/libc/gen/crypt.c > head/lib/libc/gen/dirname_compat.c > head/lib/libc/gen/fts-compat.c > head/lib/libc/gen/ftw-compat11.c > head/lib/libc/gen/getentropy.c > > Modified: head/lib/libc/gen/auxv.c > ============================================================================== > --- head/lib/libc/gen/auxv.c Sun Sep 27 21:43:19 2020 (r366206) > +++ head/lib/libc/gen/auxv.c Sun Sep 27 22:26:41 2020 (r366207) > @@ -67,7 +67,8 @@ __init_elf_aux_vector(void) > } > > static pthread_once_t aux_once = PTHREAD_ONCE_INIT; > -static int pagesize, osreldate, canary_len, ncpus, pagesizes_len, bsdflags; > +static int pagesize, osreldate, ncpus, bsdflags; > +static size_t canary_len, pagesizes_len; > static int hwcap_present, hwcap2_present; > static char *canary, *pagesizes, *execpath; > static void *ps_strings, *timekeep; > @@ -245,16 +246,21 @@ int > _elf_aux_info(int aux, void *buf, int buflen) > { > int res; > + size_t buflen_; > > __init_elf_aux_vector(); > if (__elf_aux_vector == NULL) > return (ENOSYS); > _once(&aux_once, init_aux); > > + if (buflen < 0) > + return (EINVAL); > + buflen_ = (size_t)buflen; > + > switch (aux) { > case AT_CANARY: > - if (canary != NULL && canary_len >= buflen) { > - memcpy(buf, canary, buflen); > + if (canary != NULL && canary_len >= buflen_) { > + memcpy(buf, canary, buflen_); > memset(canary, 0, canary_len); > canary = NULL; > res = 0; > @@ -267,35 +273,35 @@ _elf_aux_info(int aux, void *buf, int buflen) > else if (buf == NULL) > res = EINVAL; > else { > - if (strlcpy(buf, execpath, buflen) >= buflen) > + if (strlcpy(buf, execpath, buflen_) >= buflen_) > res = EINVAL; > else > res = 0; > } > break; > case AT_HWCAP: > - if (hwcap_present && buflen == sizeof(u_long)) { > + if (hwcap_present && buflen_ == sizeof(u_long)) { > *(u_long *)buf = hwcap; > res = 0; > } else > res = ENOENT; > break; > case AT_HWCAP2: > - if (hwcap2_present && buflen == sizeof(u_long)) { > + if (hwcap2_present && buflen_ == sizeof(u_long)) { > *(u_long *)buf = hwcap2; > res = 0; > } else > res = ENOENT; > break; > case AT_PAGESIZES: > - if (pagesizes != NULL && pagesizes_len >= buflen) { > - memcpy(buf, pagesizes, buflen); > + if (pagesizes != NULL && pagesizes_len >= buflen_) { > + memcpy(buf, pagesizes, buflen_); > res = 0; > } else > res = ENOENT; > break; > case AT_PAGESZ: > - if (buflen == sizeof(int)) { > + if (buflen_ == sizeof(int)) { > if (pagesize != 0) { > *(int *)buf = pagesize; > res = 0; > @@ -305,7 +311,7 @@ _elf_aux_info(int aux, void *buf, int buflen) > res = EINVAL; > break; > case AT_OSRELDATE: > - if (buflen == sizeof(int)) { > + if (buflen_ == sizeof(int)) { > if (osreldate != 0) { > *(int *)buf = osreldate; > res = 0; > @@ -315,7 +321,7 @@ _elf_aux_info(int aux, void *buf, int buflen) > res = EINVAL; > break; > case AT_NCPUS: > - if (buflen == sizeof(int)) { > + if (buflen_ == sizeof(int)) { > if (ncpus != 0) { > *(int *)buf = ncpus; > res = 0; > @@ -325,7 +331,7 @@ _elf_aux_info(int aux, void *buf, int buflen) > res = EINVAL; > break; > case AT_TIMEKEEP: > - if (buflen == sizeof(void *)) { > + if (buflen_ == sizeof(void *)) { > if (timekeep != NULL) { > *(void **)buf = timekeep; > res = 0; > @@ -335,14 +341,14 @@ _elf_aux_info(int aux, void *buf, int buflen) > res = EINVAL; > break; > case AT_BSDFLAGS: > - if (buflen == sizeof(int)) { > + if (buflen_ == sizeof(int)) { > *(int *)buf = bsdflags; > res = 0; > } else > res = EINVAL; > break; > case AT_PS_STRINGS: > - if (buflen == sizeof(void *)) { > + if (buflen_ == sizeof(void *)) { > if (ps_strings != NULL) { > *(void **)buf = ps_strings; > res = 0; This is significant uglification of the code in the name of fixing pointless warnings. I suspect that you tried to shut down warning about comparision of integers of different size, int vs. sizeof() which has size_t result. Is there anything else ? All these values should be small integers, which is quite vividly illustrated by comparision with sizeof() of built-in types. If compiler cannot deduce that itself the warning should be forcibly disabled by flag instead of doing 'buflen_'. And canary_len/pagesizes_len do not need to take 8 bytes, their values never become greater than one hundred. From owner-svn-src-all@freebsd.org Mon Sep 28 00:24:00 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E3AEA3776E1; Mon, 28 Sep 2020 00:24:00 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C03D05nnSz4bZ6; Mon, 28 Sep 2020 00:24:00 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9040A15455; Mon, 28 Sep 2020 00:24:00 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08S0O0CE027876; Mon, 28 Sep 2020 00:24:00 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08S0O0pe027874; Mon, 28 Sep 2020 00:24:00 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <202009280024.08S0O0pe027874@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 28 Sep 2020 00:24:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r366211 - in releng/12.2: sys/fs/fuse tests/sys/fs/fusefs X-SVN-Group: releng X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in releng/12.2: sys/fs/fuse tests/sys/fs/fusefs X-SVN-Commit-Revision: 366211 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Sep 2020 00:24:01 -0000 Author: asomers Date: Mon Sep 28 00:23:59 2020 New Revision: 366211 URL: https://svnweb.freebsd.org/changeset/base/366211 Log: MF stable/12 r366190: fusefs: fix mmap'd writes in direct_io mode If a FUSE server returns FOPEN_DIRECT_IO in response to FUSE_OPEN, that instructs the kernel to bypass the page cache for that file. This feature is also known by libfuse's name: "direct_io". However, when accessing a file via mmap, there is no possible way to bypass the cache completely. This change fixes a deadlock that would happen when an mmap'd write tried to invalidate a portion of the cache, wrongly assuming that a write couldn't possibly come from cache if direct_io were set. Arguably, we could instead disable mmap for files with FOPEN_DIRECT_IO set. But allowing it is less likely to cause user complaints, and is more in keeping with the spirit of open(2), where O_DIRECT instructs the kernel to "reduce", not "eliminate" cache effects. PR: 247276 Approved by: re (gjb) Reported by: trapexit@spawn.link Reviewed by: cem Differential Revision: https://reviews.freebsd.org/D26485 Modified: releng/12.2/sys/fs/fuse/fuse_io.c releng/12.2/tests/sys/fs/fusefs/write.cc Directory Properties: releng/12.2/ (props changed) Modified: releng/12.2/sys/fs/fuse/fuse_io.c ============================================================================== --- releng/12.2/sys/fs/fuse/fuse_io.c Sun Sep 27 23:01:54 2020 (r366210) +++ releng/12.2/sys/fs/fuse/fuse_io.c Mon Sep 28 00:23:59 2020 (r366211) @@ -291,6 +291,7 @@ fuse_io_dispatch(struct vnode *vp, struct uio *uio, in fuse_vnode_update(vp, FN_MTIMECHANGE | FN_CTIMECHANGE); if (directio) { off_t start, end, filesize; + bool pages = (ioflag & IO_VMIO) != 0; SDT_PROBE2(fusefs, , io, trace, 1, "direct write of vnode"); @@ -301,15 +302,14 @@ fuse_io_dispatch(struct vnode *vp, struct uio *uio, in start = uio->uio_offset; end = start + uio->uio_resid; - KASSERT((ioflag & (IO_VMIO | IO_DIRECT)) != - (IO_VMIO | IO_DIRECT), - ("IO_DIRECT used for a cache flush?")); - /* Invalidate the write cache when writing directly */ - err = fuse_inval_buf_range(vp, filesize, start, end); - if (err) - return (err); + if (!pages) { + err = fuse_inval_buf_range(vp, filesize, start, + end); + if (err) + return (err); + } err = fuse_write_directbackend(vp, uio, cred, fufh, - filesize, ioflag, false); + filesize, ioflag, pages); } else { SDT_PROBE2(fusefs, , io, trace, 1, "buffered write of vnode"); Modified: releng/12.2/tests/sys/fs/fusefs/write.cc ============================================================================== --- releng/12.2/tests/sys/fs/fusefs/write.cc Sun Sep 27 23:01:54 2020 (r366210) +++ releng/12.2/tests/sys/fs/fusefs/write.cc Mon Sep 28 00:23:59 2020 (r366211) @@ -923,6 +923,76 @@ TEST_F(WriteBack, o_direct) leak(fd); } +TEST_F(WriteBack, direct_io) +{ + const char FULLPATH[] = "mountpoint/some_file.txt"; + const char RELPATH[] = "some_file.txt"; + const char *CONTENTS = "abcdefgh"; + uint64_t ino = 42; + int fd; + ssize_t bufsize = strlen(CONTENTS); + uint8_t readbuf[bufsize]; + + expect_lookup(RELPATH, ino, 0); + expect_open(ino, FOPEN_DIRECT_IO, 1); + FuseTest::expect_write(ino, 0, bufsize, bufsize, 0, FUSE_WRITE_CACHE, + CONTENTS); + expect_read(ino, 0, bufsize, bufsize, CONTENTS); + + fd = open(FULLPATH, O_RDWR); + EXPECT_LE(0, fd) << strerror(errno); + + ASSERT_EQ(bufsize, write(fd, CONTENTS, bufsize)) << strerror(errno); + /* A subsequent read must query the daemon because cache is empty */ + ASSERT_EQ(0, lseek(fd, 0, SEEK_SET)) << strerror(errno); + ASSERT_EQ(0, fcntl(fd, F_SETFL, 0)) << strerror(errno); + ASSERT_EQ(bufsize, read(fd, readbuf, bufsize)) << strerror(errno); + leak(fd); +} + +/* + * mmap should still be possible even if the server used direct_io. Mmap will + * still use the cache, though. + * + * Regression test for bug 247276 + * https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=247276 + */ +TEST_F(WriteBack, mmap_direct_io) +{ + const char FULLPATH[] = "mountpoint/some_file.txt"; + const char RELPATH[] = "some_file.txt"; + const char *CONTENTS = "abcdefgh"; + uint64_t ino = 42; + int fd; + size_t len; + ssize_t bufsize = strlen(CONTENTS); + void *p, *zeros; + + len = getpagesize(); + zeros = calloc(1, len); + ASSERT_NE(nullptr, zeros); + + expect_lookup(RELPATH, ino, len); + expect_open(ino, FOPEN_DIRECT_IO, 1); + expect_read(ino, 0, len, len, zeros); + expect_flush(ino, 1, ReturnErrno(0)); + FuseTest::expect_write(ino, 0, len, len, FUSE_WRITE_CACHE, 0, zeros); + expect_release(ino, ReturnErrno(0)); + + fd = open(FULLPATH, O_RDWR); + EXPECT_LE(0, fd) << strerror(errno); + + p = mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); + ASSERT_NE(MAP_FAILED, p) << strerror(errno); + + memmove((uint8_t*)p, CONTENTS, bufsize); + + ASSERT_EQ(0, munmap(p, len)) << strerror(errno); + close(fd); // Write mmap'd data on close + + free(zeros); +} + /* * When mounted with -o async, the writeback cache mode should delay writes */ From owner-svn-src-all@freebsd.org Mon Sep 28 00:52:17 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 897513F0412; Mon, 28 Sep 2020 00:52:17 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C03rd34GKz4cFS; Mon, 28 Sep 2020 00:52:17 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4CFD31556B; Mon, 28 Sep 2020 00:52:17 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08S0qHBL046133; Mon, 28 Sep 2020 00:52:17 GMT (envelope-from cperciva@FreeBSD.org) Received: (from cperciva@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08S0qHbQ046132; Mon, 28 Sep 2020 00:52:17 GMT (envelope-from cperciva@FreeBSD.org) Message-Id: <202009280052.08S0qHbQ046132@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cperciva set sender to cperciva@FreeBSD.org using -f From: Colin Percival Date: Mon, 28 Sep 2020 00:52:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r366212 - releng/12.2/release/tools X-SVN-Group: releng X-SVN-Commit-Author: cperciva X-SVN-Commit-Paths: releng/12.2/release/tools X-SVN-Commit-Revision: 366212 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Sep 2020 00:52:17 -0000 Author: cperciva Date: Mon Sep 28 00:52:16 2020 New Revision: 366212 URL: https://svnweb.freebsd.org/changeset/base/366212 Log: MFS r366009: Include ebsnvme-id in arm64 AMIs. Approved by: re (delphij) Sponsored by: https://www.patreon.com/cperciva Modified: releng/12.2/release/tools/ec2.conf Directory Properties: releng/12.2/ (props changed) Modified: releng/12.2/release/tools/ec2.conf ============================================================================== --- releng/12.2/release/tools/ec2.conf Mon Sep 28 00:23:59 2020 (r366211) +++ releng/12.2/release/tools/ec2.conf Mon Sep 28 00:52:16 2020 (r366212) @@ -6,14 +6,7 @@ # Packages to install into the image we're creating. This is a deliberately # minimalist set, providing only the packages necessary to bootstrap further # package installation as specified via EC2 user-data. -export VM_EXTRA_PACKAGES="ec2-scripts firstboot-freebsd-update firstboot-pkgs dual-dhclient-daemon" - -# This package isn't currently (2020-05-29) available for aarch64 since it is -# not yet in the "quarterly" branch. Some time after 2020-07-01 this can be -# made unconditional. -if [ "${TARGET_ARCH}" = "amd64" ]; then - export VM_EXTRA_PACKAGES="${VM_EXTRA_PACKAGES} ebsnvme-id" -fi +export VM_EXTRA_PACKAGES="ec2-scripts firstboot-freebsd-update firstboot-pkgs dual-dhclient-daemon ebsnvme-id" # Include the amazon-ssm-agent package in amd64 images, since some users want # to be able to use it on systems which are not connected to the Internet. From owner-svn-src-all@freebsd.org Mon Sep 28 00:53:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8100D3F022F; Mon, 28 Sep 2020 00:53:46 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C03tL2rcXz4cm5; Mon, 28 Sep 2020 00:53:46 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4517415570; Mon, 28 Sep 2020 00:53:46 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08S0rk6T046246; Mon, 28 Sep 2020 00:53:46 GMT (envelope-from cperciva@FreeBSD.org) Received: (from cperciva@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08S0rjJw046243; Mon, 28 Sep 2020 00:53:45 GMT (envelope-from cperciva@FreeBSD.org) Message-Id: <202009280053.08S0rjJw046243@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cperciva set sender to cperciva@FreeBSD.org using -f From: Colin Percival Date: Mon, 28 Sep 2020 00:53:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r366213 - in releng/12.2/sys: cam cam/nvme dev/nvme X-SVN-Group: releng X-SVN-Commit-Author: cperciva X-SVN-Commit-Paths: in releng/12.2/sys: cam cam/nvme dev/nvme X-SVN-Commit-Revision: 366213 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Sep 2020 00:53:46 -0000 Author: cperciva Date: Mon Sep 28 00:53:45 2020 New Revision: 366213 URL: https://svnweb.freebsd.org/changeset/base/366213 Log: MFS r366179: Make nvmecontrol work with nda like it does with nvd, and associated bits. Approved by: re (delphij) Sponsored by: https://www.patreon.com/cperciva Modified: releng/12.2/sys/cam/cam_ccb.h releng/12.2/sys/cam/nvme/nvme_da.c releng/12.2/sys/dev/nvme/nvme_sim.c Directory Properties: releng/12.2/ (props changed) Modified: releng/12.2/sys/cam/cam_ccb.h ============================================================================== --- releng/12.2/sys/cam/cam_ccb.h Mon Sep 28 00:52:16 2020 (r366212) +++ releng/12.2/sys/cam/cam_ccb.h Mon Sep 28 00:53:45 2020 (r366213) @@ -630,6 +630,7 @@ struct ccb_pathinq_settings_sas { u_int32_t bitrate; /* Mbps */ }; +#define NVME_DEV_NAME_LEN 52 struct ccb_pathinq_settings_nvme { uint32_t nsid; /* Namespace ID for this path */ uint32_t domain; @@ -637,7 +638,10 @@ struct ccb_pathinq_settings_nvme { uint8_t slot; uint8_t function; uint8_t extra; + char dev_name[NVME_DEV_NAME_LEN]; /* nvme controller dev name for this device */ }; +_Static_assert(sizeof(struct ccb_pathinq_settings_nvme) == 64, + "ccb_pathinq_settings_nvme too big"); #define PATHINQ_SETTINGS_SIZE 128 @@ -1030,6 +1034,7 @@ struct ccb_trans_settings_nvme uint8_t speed; /* PCIe generation for each lane */ uint8_t max_lanes; /* Number of PCIe lanes */ uint8_t max_speed; /* PCIe generation for each lane */ + }; #include Modified: releng/12.2/sys/cam/nvme/nvme_da.c ============================================================================== --- releng/12.2/sys/cam/nvme/nvme_da.c Mon Sep 28 00:52:16 2020 (r366212) +++ releng/12.2/sys/cam/nvme/nvme_da.c Mon Sep 28 00:53:45 2020 (r366213) @@ -88,6 +88,7 @@ typedef enum { NDA_CCB_BUFFER_IO = 0x01, NDA_CCB_DUMP = 0x02, NDA_CCB_TRIM = 0x03, + NDA_CCB_PASS = 0x04, NDA_CCB_TYPE_MASK = 0x0F, } nda_ccb_state; @@ -136,6 +137,7 @@ struct nda_trim_request { /* Need quirk table */ +static disk_ioctl_t ndaioctl; static disk_strategy_t ndastrategy; static dumper_t ndadump; static periph_init_t ndainit; @@ -354,6 +356,91 @@ ndaschedule(struct cam_periph *periph) cam_iosched_schedule(softc->cam_iosched, periph); } +static int +ndaioctl(struct disk *dp, u_long cmd, void *data, int fflag, + struct thread *td) +{ + struct cam_periph *periph; + struct nda_softc *softc; + + periph = (struct cam_periph *)dp->d_drv1; + softc = (struct nda_softc *)periph->softc; + + switch (cmd) { + case NVME_IO_TEST: + case NVME_BIO_TEST: + /* + * These don't map well to the underlying CCBs, so + * they are usupported via CAM. + */ + return (ENOTTY); + case NVME_GET_NSID: + { + struct nvme_get_nsid *gnsid = (struct nvme_get_nsid *)data; + struct ccb_pathinq cpi; + + xpt_path_inq(&cpi, periph->path); + strncpy(gnsid->cdev, cpi.xport_specific.nvme.dev_name, + sizeof(gnsid->cdev)); + gnsid->nsid = cpi.xport_specific.nvme.nsid; + return (0); + } + case NVME_PASSTHROUGH_CMD: + { + struct nvme_pt_command *pt; + union ccb *ccb; + struct cam_periph_map_info mapinfo; + u_int maxmap = MAXPHYS; /* XXX is this right */ + int error; + + /* + * Create a NVME_IO CCB to do the passthrough command. + */ + pt = (struct nvme_pt_command *)data; + ccb = xpt_alloc_ccb(); + xpt_setup_ccb(&ccb->ccb_h, periph->path, CAM_PRIORITY_NORMAL); + ccb->ccb_state = NDA_CCB_PASS; + cam_fill_nvmeio(&ccb->nvmeio, + 0, /* Retries */ + ndadone, + (pt->is_read ? CAM_DIR_IN : CAM_DIR_OUT) | CAM_DATA_VADDR, + pt->buf, + pt->len, + nda_default_timeout * 1000); + memcpy(&ccb->nvmeio.cmd, &pt->cmd, sizeof(pt->cmd)); + + /* + * Wire the user memory in this request for the I/O + */ + memset(&mapinfo, 0, sizeof(mapinfo)); + error = cam_periph_mapmem(ccb, &mapinfo, maxmap); + if (error) + return (error); + + /* + * Lock the periph and run the command. XXX do we need + * to lock the periph? + */ + cam_periph_lock(periph); + cam_periph_runccb(ccb, NULL, CAM_RETRY_SELTO, SF_RETRY_UA | SF_NO_PRINT, + NULL); + cam_periph_unlock(periph); + + /* + * Tear down mapping and return status. + */ + cam_periph_unmapmem(ccb, &mapinfo); + cam_periph_lock(periph); + error = (ccb->ccb_h.status == CAM_REQ_CMP) ? 0 : EIO; + xpt_release_ccb(ccb); + return (error); + } + default: + break; + } + return (ENOTTY); +} + /* * Actually translate the requested transfer into one the physical driver * can understand. The transfer is described by a buf and will include @@ -735,11 +822,8 @@ ndaregister(struct cam_periph *periph, void *arg) /* ident_data parsing */ periph->softc = softc; - softc->quirks = NDA_Q_NONE; - xpt_path_inq(&cpi, periph->path); - TASK_INIT(&softc->sysctl_task, 0, ndasysctlinit, periph); /* @@ -763,6 +847,7 @@ ndaregister(struct cam_periph *periph, void *arg) disk->d_open = ndaopen; disk->d_close = ndaclose; disk->d_strategy = ndastrategy; + disk->d_ioctl = ndaioctl; disk->d_getattr = ndagetattr; disk->d_dump = ndadump; disk->d_gone = ndadiskgonecb; @@ -1108,6 +1193,8 @@ ndadone(struct cam_periph *periph, union ccb *done_ccb } case NDA_CCB_DUMP: /* No-op. We're polling */ + return; + case NDA_CCB_PASS: return; default: break; Modified: releng/12.2/sys/dev/nvme/nvme_sim.c ============================================================================== --- releng/12.2/sys/dev/nvme/nvme_sim.c Mon Sep 28 00:52:16 2020 (r366212) +++ releng/12.2/sys/dev/nvme/nvme_sim.c Mon Sep 28 00:53:45 2020 (r366213) @@ -197,6 +197,8 @@ nvme_sim_action(struct cam_sim *sim, union ccb *ccb) cpi->xport_specific.nvme.slot = pci_get_slot(dev); cpi->xport_specific.nvme.function = pci_get_function(dev); cpi->xport_specific.nvme.extra = 0; + strncpy(cpi->xport_specific.nvme.dev_name, device_get_nameunit(ctrlr->dev), + sizeof(cpi->xport_specific.nvme.dev_name)); cpi->ccb_h.status = CAM_REQ_CMP; break; } From owner-svn-src-all@freebsd.org Mon Sep 28 00:54:51 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 959283F03B2; Mon, 28 Sep 2020 00:54:51 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C03vb3QXPz4cyM; Mon, 28 Sep 2020 00:54:51 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3E99615571; Mon, 28 Sep 2020 00:54:51 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08S0spIr046351; Mon, 28 Sep 2020 00:54:51 GMT (envelope-from cperciva@FreeBSD.org) Received: (from cperciva@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08S0spWj046350; Mon, 28 Sep 2020 00:54:51 GMT (envelope-from cperciva@FreeBSD.org) Message-Id: <202009280054.08S0spWj046350@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cperciva set sender to cperciva@FreeBSD.org using -f From: Colin Percival Date: Mon, 28 Sep 2020 00:54:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r366214 - releng/12.2/usr.sbin/freebsd-update X-SVN-Group: releng X-SVN-Commit-Author: cperciva X-SVN-Commit-Paths: releng/12.2/usr.sbin/freebsd-update X-SVN-Commit-Revision: 366214 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Sep 2020 00:54:51 -0000 Author: cperciva Date: Mon Sep 28 00:54:50 2020 New Revision: 366214 URL: https://svnweb.freebsd.org/changeset/base/366214 Log: MFS r366178: Move finalize_components_config from get_params to cmd_*. This eliminates spurious emails from `freebsd-update cron` when the src component is listed in freebsd-update.conf but is not present. Approved by: re (delphij) Sponsored by: https://www.patreon.com/cperciva Modified: releng/12.2/usr.sbin/freebsd-update/freebsd-update.sh Directory Properties: releng/12.2/ (props changed) Modified: releng/12.2/usr.sbin/freebsd-update/freebsd-update.sh ============================================================================== --- releng/12.2/usr.sbin/freebsd-update/freebsd-update.sh Mon Sep 28 00:53:45 2020 (r366213) +++ releng/12.2/usr.sbin/freebsd-update/freebsd-update.sh Mon Sep 28 00:54:50 2020 (r366214) @@ -3300,12 +3300,12 @@ get_params () { parse_cmdline $@ parse_conffile default_params - finalize_components_config ${COMPONENTS} } # Fetch command. Make sure that we're being called # interactively, then run fetch_check_params and fetch_run cmd_fetch () { + finalize_components_config ${COMPONENTS} if [ ! -t 0 -a $NOTTYOK -eq 0 ]; then echo -n "`basename $0` fetch should not " echo "be run non-interactively." @@ -3326,6 +3326,7 @@ cmd_cron () { sleep `jot -r 1 0 3600` TMPFILE=`mktemp /tmp/freebsd-update.XXXXXX` || exit 1 + finalize_components_config ${COMPONENTS} >> ${TMPFILE} if ! fetch_run >> ${TMPFILE} || ! grep -q "No updates needed" ${TMPFILE} || [ ${VERBOSELEVEL} = "debug" ]; then @@ -3337,6 +3338,7 @@ cmd_cron () { # Fetch files for upgrading to a new release. cmd_upgrade () { + finalize_components_config ${COMPONENTS} upgrade_check_params upgrade_run || exit 1 } @@ -3344,6 +3346,7 @@ cmd_upgrade () { # Check if there are fetched updates ready to install. # Chdir into the working directory. cmd_updatesready () { + finalize_components_config ${COMPONENTS} # Check if working directory exists (if not, no updates pending) if ! [ -e "${WORKDIR}" ]; then echo "No updates are available to install." @@ -3368,24 +3371,28 @@ cmd_updatesready () { # Install downloaded updates. cmd_install () { + finalize_components_config ${COMPONENTS} install_check_params install_run || exit 1 } # Rollback most recently installed updates. cmd_rollback () { + finalize_components_config ${COMPONENTS} rollback_check_params rollback_run || exit 1 } # Compare system against a "known good" index. cmd_IDS () { + finalize_components_config ${COMPONENTS} IDS_check_params IDS_run || exit 1 } # Output configuration. cmd_showconfig () { + finalize_components_config ${COMPONENTS} for X in ${CONFIGOPTIONS}; do echo $X=$(eval echo \$${X}) done From owner-svn-src-all@freebsd.org Mon Sep 28 01:26:05 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6C5CA3F116D; Mon, 28 Sep 2020 01:26:05 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4C04bc2sbJz4fYj; Mon, 28 Sep 2020 01:26:04 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 3E6C77F9; Sun, 27 Sep 2020 21:26:02 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Sun, 27 Sep 2020 21:26:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsco.org; h= content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; s=fm1; bh=u zgGSd5paxhupt0q2ql7uTXQYEMSDb77VCh0zqsA2Go=; b=n30VHSntbAB0Owfen QwBVPAJ5UmDjoGNyLEYWg/Y8HZNOR94sB2NOROOuqNBlW8uwXKqBdXz3LFVZcPqV FL05Wf2+f5LpIo8HdVxUe6CQGrpR2k0mH91IBHss9q6gYNEUf6Qb+q12BEVR10s0 jR+RYupy47TDU8V+NTJwprnPaaH726vhZL9t0iJHBTcNbkcGdn/bfsYc35EqzsG8 XYlsYeZOipqdzPUulvd6RZ32xmzO3pXItEaUCbCP1CLGCBG4i5+lGwINctmuGJsV NQ7YwDFNxwFiv7yT1f+etpuPbZsuv1Hz4sA/0XZ2mCryZNnHZIDQt2HCS6uRl0y5 Dp9lQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=uzgGSd5paxhupt0q2ql7uTXQYEMSDb77VCh0zqsA2 Go=; b=dqAjuOveScBmiXZVLMMlCJaf7CLpcuyFofcJKTiUIKL/3XDi1rg5yxwlE 7kO7x+4xcng7LLSM6JIIyjhDBtb0f7kikFkWJ4SZWlBQe+JKGUalN7L0/53Ss2XZ +yu3HEmvWTdD6tD+pvF6yYXmCVxxsRZs9KpQWlnNd3iZ5zxfPRC36Z8DGfL1j4ol rxzAPrWPVJDjjMAM0FiAaltB4dLtU7cNfrkSwUHVovcwyDyLRXa2WIte8aYzYOD1 qo16nZ5/KST5+bj5nk2bTv8HUAfabVw/jA5FUz8s9lNm8rLkdly2cFgzlvNSl6gz J1Rci7i/FgfSEsXSt7Njr71M27yGg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrvdehgdegiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurheptggguffhjgffgffkfhfvofesthhqmh dthhdtjeenucfhrhhomhepufgtohhtthcunfhonhhguceoshgtohhtthhlsehsrghmshgt ohdrohhrgheqnecuggftrfgrthhtvghrnhepfeejgefgjefhgfdtjeevjeekgeevieelue ehjefgudetvefgtdetgffggefgvdegnecukfhppeekrdegiedrkeelrddvudefnecuvehl uhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepshgtohhtthhlse hsrghmshgtohdrohhrgh X-ME-Proxy: Received: from [192.168.0.114] (unknown [8.46.89.213]) by mail.messagingengine.com (Postfix) with ESMTPA id 186BB3280060; Sun, 27 Sep 2020 21:26:01 -0400 (EDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.1\)) Subject: Re: svn commit: r365643 - head/bin/cp From: Scott Long In-Reply-To: <202009262320.08QNKr09056871@gndrsh.dnsmgr.net> Date: Sun, 27 Sep 2020 19:26:00 -0600 Cc: Warner Losh , Benjamin Kaduk , Ian Lepore , src-committers , svn-src-all , svn-src-head Content-Transfer-Encoding: quoted-printable Message-Id: References: <202009262320.08QNKr09056871@gndrsh.dnsmgr.net> To: rgrimes@freebsd.org X-Mailer: Apple Mail (2.3608.120.23.2.1) X-Rspamd-Queue-Id: 4C04bc2sbJz4fYj X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=samsco.org header.s=fm1 header.b=n30VHSnt; dkim=pass header.d=messagingengine.com header.s=fm3 header.b=dqAjuOve; dmarc=none; spf=pass (mx1.freebsd.org: domain of scottl@samsco.org designates 64.147.123.19 as permitted sender) smtp.mailfrom=scottl@samsco.org X-Spamd-Result: default: False [-2.97 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ip4:64.147.123.19]; RWL_MAILSPIKE_GOOD(0.00)[64.147.123.19:from]; RCVD_COUNT_THREE(0.00)[4]; DKIM_TRACE(0.00)[samsco.org:+,messagingengine.com:+]; NEURAL_HAM_SHORT(-0.86)[-0.858]; RCPT_COUNT_SEVEN(0.00)[7]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:64.147.123.0/24, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[64.147.123.19:from]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.02)[-1.019]; R_DKIM_ALLOW(-0.20)[samsco.org:s=fm1,messagingengine.com:s=fm3]; FREEFALL_USER(0.00)[scottl]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-0.99)[-0.990]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[samsco.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FREEMAIL_CC(0.00)[bsdimp.com,gmail.com,freebsd.org]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Sep 2020 01:26:05 -0000 >> normal means before devfs can be mounted. However, several people = have >> looked and found no evidence on their system. This means there's = something >> special / unique to Rod's setup that's generating them (assuming it = isn't a >> simple chroot without devfs). What that is, and how they come to be, = hasn't >> been explained in enough detail to reproduce. That's what people are = asking >> Rod about: how do we get there? How did it happen? Once we know those >> answers, we can fix it. >=20 > Problem is these are being found in after the fact analysis, > so "getting there" is going to be hard. I'll try to collect > better data such as inode contents and dates and see if I=20 > can correlate that to system install time, or some time during > the systems life time. >=20 > Given what kib, and ian have said I am starting to suspect > that this may be occuring during the install process, the > dates on the null inode and a find of the oldest inode on > the disk should correlate that next time I see one of these. >=20 > If I could easily reroduce it we would not be having > this conversation, it would of been fixed. >=20 I just tested 11.2, 11.4, 12.0, 12.2 releases (or betas), and the most = recent 13.0 snapshot. I tested both UFS and ZFS installs to a local disk, used the = stock images, default bsdinstall options, stock everything. After each = install I mounted the disk onto another system and examined the contents of the root = filesystem. In no case did I find any files in the /dev directory. If there were = previous bugs with files being written to /dev during install, they=E2=80=99re long = gone. I=E2=80=99m going to consider this problem closed and/or unique to Rod and his usage = patterns. Any further extraordinary claims will need to be accompanied by = extraordinary proof. Thanks, Scott From owner-svn-src-all@freebsd.org Mon Sep 28 04:09:02 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BCDED3F4A88; Mon, 28 Sep 2020 04:09:02 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-ot1-f49.google.com (mail-ot1-f49.google.com [209.85.210.49]) (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 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C08Cd5gj1z3YC1; Mon, 28 Sep 2020 04:09:01 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-ot1-f49.google.com with SMTP id y5so8384071otg.5; Sun, 27 Sep 2020 21:09:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=cP6e29yfbtOc+Dm+GSQjDSpUjDJ6MA6JGG6/FpW8OQc=; b=SNPV236+LuBvntc1FJmkmSOtObWlDED4CQSin9EdgBfKfhjuwDbRpOzTNlVtKVHJAk OKhbFDByI5VGCyo2wcb3EU+4ew8z+juXwGBcgIsbkqYwhNx3JouQHcMh8geWCKKrETx2 W/Bugk/afKcU8ajk6SPnCROSRTh8vYVOcyhkw/X9x13NO2SMj0chU1jDRTbkppMjvW0C Q9QTMK3ZAZGPY6i//bXazcFDNgZGMdu4+7M8KPvhInXgIBBGCMKJ5LR8svrZgvwy0CrW e4E6q4MZ85hLM0th3U2U3Z9z9wH0rlfomYD4Dyv2zN2V6knlnts5YNK+rq8KDQeF0Eq5 Ws7Q== X-Gm-Message-State: AOAM532DvYs+9WO9KcRXjIDlcRjMSKu2OHz0hKkMeR/Wz4St0AzAd1yn NMGulp5xsXqe0Pt81iuLJdGIjorRDLkT5IOj3nU= X-Google-Smtp-Source: ABdhPJzEpmV9ugx0U/f15/EQFBCYYkxQDYlEOcj90tKb65Uvf+Dcc0gNT6/RLuZsm9qeXz34x4tY0S5/pRajB1YfqUU= X-Received: by 2002:a05:6830:1e30:: with SMTP id t16mr7771868otr.18.1601266140389; Sun, 27 Sep 2020 21:09:00 -0700 (PDT) MIME-Version: 1.0 References: <202009272226.08RMQf1h054050@repo.freebsd.org> <20200927231519.GI2643@kib.kiev.ua> In-Reply-To: <20200927231519.GI2643@kib.kiev.ua> From: Alan Somers Date: Sun, 27 Sep 2020 22:08:49 -0600 Message-ID: Subject: Re: svn commit: r366207 - head/lib/libc/gen To: Konstantin Belousov Cc: src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 4C08Cd5gj1z3YC1 X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of asomers@gmail.com designates 209.85.210.49 as permitted sender) smtp.mailfrom=asomers@gmail.com X-Spamd-Result: default: False [-1.83 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.001]; RCVD_COUNT_TWO(0.00)[2]; FREEFALL_USER(0.00)[asomers]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; RCVD_TLS_ALL(0.00)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; DMARC_NA(0.00)[freebsd.org]; NEURAL_HAM_LONG(-0.99)[-0.991]; RWL_MAILSPIKE_GOOD(0.00)[209.85.210.49:from]; NEURAL_SPAM_SHORT(0.07)[0.065]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; MIME_BASE64_TEXT(0.10)[]; RCVD_IN_DNSWL_NONE(0.00)[209.85.210.49:from]; FREEMAIL_TO(0.00)[gmail.com]; FORGED_SENDER(0.30)[asomers@freebsd.org,asomers@gmail.com]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FROM_NEQ_ENVFROM(0.00)[asomers@freebsd.org,asomers@gmail.com]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Sep 2020 04:09:02 -0000 On Sun, Sep 27, 2020 at 5:15 PM Konstantin Belousov wrote: > On Sun, Sep 27, 2020 at 10:26:41PM +0000, Alan Somers wrote: > > Author: asomers > > Date: Sun Sep 27 22:26:41 2020 > > New Revision: 366207 > > URL: https://svnweb.freebsd.org/changeset/base/366207 > > > > Log: > > Misc compiler warning fixes in lib/libc > > > > Reviewed by: kevans, imp > > MFC after: 2 weeks > > Differential Revision: https://reviews.freebsd.org/D26534 > > > > Modified: > > head/lib/libc/gen/auxv.c > > head/lib/libc/gen/basename_compat.c > > head/lib/libc/gen/crypt.c > > head/lib/libc/gen/dirname_compat.c > > head/lib/libc/gen/fts-compat.c > > head/lib/libc/gen/ftw-compat11.c > > head/lib/libc/gen/getentropy.c > > > > Modified: head/lib/libc/gen/auxv.c > > > ============================================================================== > > --- head/lib/libc/gen/auxv.c Sun Sep 27 21:43:19 2020 (r366206) > > +++ head/lib/libc/gen/auxv.c Sun Sep 27 22:26:41 2020 (r366207) > > @@ -67,7 +67,8 @@ __init_elf_aux_vector(void) > > } > > > > static pthread_once_t aux_once = PTHREAD_ONCE_INIT; > > -static int pagesize, osreldate, canary_len, ncpus, pagesizes_len, > bsdflags; > > +static int pagesize, osreldate, ncpus, bsdflags; > > +static size_t canary_len, pagesizes_len; > > static int hwcap_present, hwcap2_present; > > static char *canary, *pagesizes, *execpath; > > static void *ps_strings, *timekeep; > > @@ -245,16 +246,21 @@ int > > _elf_aux_info(int aux, void *buf, int buflen) > > { > > int res; > > + size_t buflen_; > > > > __init_elf_aux_vector(); > > if (__elf_aux_vector == NULL) > > return (ENOSYS); > > _once(&aux_once, init_aux); > > > > + if (buflen < 0) > > + return (EINVAL); > > + buflen_ = (size_t)buflen; > > + > > switch (aux) { > > case AT_CANARY: > > - if (canary != NULL && canary_len >= buflen) { > > - memcpy(buf, canary, buflen); > > + if (canary != NULL && canary_len >= buflen_) { > > + memcpy(buf, canary, buflen_); > > memset(canary, 0, canary_len); > > canary = NULL; > > res = 0; > > @@ -267,35 +273,35 @@ _elf_aux_info(int aux, void *buf, int buflen) > > else if (buf == NULL) > > res = EINVAL; > > else { > > - if (strlcpy(buf, execpath, buflen) >= buflen) > > + if (strlcpy(buf, execpath, buflen_) >= buflen_) > > res = EINVAL; > > else > > res = 0; > > } > > break; > > case AT_HWCAP: > > - if (hwcap_present && buflen == sizeof(u_long)) { > > + if (hwcap_present && buflen_ == sizeof(u_long)) { > > *(u_long *)buf = hwcap; > > res = 0; > > } else > > res = ENOENT; > > break; > > case AT_HWCAP2: > > - if (hwcap2_present && buflen == sizeof(u_long)) { > > + if (hwcap2_present && buflen_ == sizeof(u_long)) { > > *(u_long *)buf = hwcap2; > > res = 0; > > } else > > res = ENOENT; > > break; > > case AT_PAGESIZES: > > - if (pagesizes != NULL && pagesizes_len >= buflen) { > > - memcpy(buf, pagesizes, buflen); > > + if (pagesizes != NULL && pagesizes_len >= buflen_) { > > + memcpy(buf, pagesizes, buflen_); > > res = 0; > > } else > > res = ENOENT; > > break; > > case AT_PAGESZ: > > - if (buflen == sizeof(int)) { > > + if (buflen_ == sizeof(int)) { > > if (pagesize != 0) { > > *(int *)buf = pagesize; > > res = 0; > > @@ -305,7 +311,7 @@ _elf_aux_info(int aux, void *buf, int buflen) > > res = EINVAL; > > break; > > case AT_OSRELDATE: > > - if (buflen == sizeof(int)) { > > + if (buflen_ == sizeof(int)) { > > if (osreldate != 0) { > > *(int *)buf = osreldate; > > res = 0; > > @@ -315,7 +321,7 @@ _elf_aux_info(int aux, void *buf, int buflen) > > res = EINVAL; > > break; > > case AT_NCPUS: > > - if (buflen == sizeof(int)) { > > + if (buflen_ == sizeof(int)) { > > if (ncpus != 0) { > > *(int *)buf = ncpus; > > res = 0; > > @@ -325,7 +331,7 @@ _elf_aux_info(int aux, void *buf, int buflen) > > res = EINVAL; > > break; > > case AT_TIMEKEEP: > > - if (buflen == sizeof(void *)) { > > + if (buflen_ == sizeof(void *)) { > > if (timekeep != NULL) { > > *(void **)buf = timekeep; > > res = 0; > > @@ -335,14 +341,14 @@ _elf_aux_info(int aux, void *buf, int buflen) > > res = EINVAL; > > break; > > case AT_BSDFLAGS: > > - if (buflen == sizeof(int)) { > > + if (buflen_ == sizeof(int)) { > > *(int *)buf = bsdflags; > > res = 0; > > } else > > res = EINVAL; > > break; > > case AT_PS_STRINGS: > > - if (buflen == sizeof(void *)) { > > + if (buflen_ == sizeof(void *)) { > > if (ps_strings != NULL) { > > *(void **)buf = ps_strings; > > res = 0; > > This is significant uglification of the code in the name of fixing > pointless > warnings. > Warnings are NOT pointless. 99% of them are. But the only way to find the 1% that aren't is to quell the 99% that are. Last week I wrote a bug that fortunately got caught in code review. But it shouldn't have made it that far. It should've been caught by the compiler, but libc is only built with WARNS=2. This commit is one step towards raising libc's WARNs level to 3. Only 334 files left to go. > > I suspect that you tried to shut down warning about comparision of integers > of different size, int vs. sizeof() which has size_t result. Is there > anything else ? > Mostly the warnings were about comparisons of integers with different signedness. Also there were some warnings about missing prototypes. > > All these values should be small integers, which is quite vividly > illustrated by comparision with sizeof() of built-in types. If compiler > cannot deduce that itself the warning should be forcibly disabled by > flag instead of doing 'buflen_'. > > And canary_len/pagesizes_len do not need to take 8 bytes, their values > never become greater than one hundred. > Better to give it enough space that the compiler can check it statically, rather than require runtime checks. -Alan From owner-svn-src-all@freebsd.org Mon Sep 28 04:30:31 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E20373F5465; Mon, 28 Sep 2020 04:30:31 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C08hR5g3tz3ZZJ; Mon, 28 Sep 2020 04:30:31 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A68721831A; Mon, 28 Sep 2020 04:30:31 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08S4UVIE077565; Mon, 28 Sep 2020 04:30:31 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08S4UVo0077564; Mon, 28 Sep 2020 04:30:31 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <202009280430.08S4UVo0077564@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 28 Sep 2020 04:30:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366215 - head/sbin/fsck_msdosfs X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/sbin/fsck_msdosfs X-SVN-Commit-Revision: 366215 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Sep 2020 04:30:31 -0000 Author: delphij Date: Mon Sep 28 04:30:31 2020 New Revision: 366215 URL: https://svnweb.freebsd.org/changeset/base/366215 Log: Use %ju and cast to (uintmax_t) to avoid using PRI* macros. Suggested by: kevlo Modified: head/sbin/fsck_msdosfs/dir.c Modified: head/sbin/fsck_msdosfs/dir.c ============================================================================== --- head/sbin/fsck_msdosfs/dir.c Mon Sep 28 00:54:50 2020 (r366214) +++ head/sbin/fsck_msdosfs/dir.c Mon Sep 28 04:30:31 2020 (r366215) @@ -422,8 +422,8 @@ checksize(struct fat_descriptor *fat, u_char *p, struc physicalSize = (u_int64_t)chainsize * boot->ClusterSize; } if (physicalSize < dir->size) { - pwarn("size of %s is %u, should at most be %" PRIu64 "\n", - fullpath(dir), dir->size, physicalSize); + pwarn("size of %s is %u, should at most be %ju\n", + fullpath(dir), dir->size, (uintmax_t)physicalSize); if (ask(1, "Truncate")) { dir->size = physicalSize; p[28] = (u_char)physicalSize; From owner-svn-src-all@freebsd.org Mon Sep 28 06:00:39 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C281B3F781A; Mon, 28 Sep 2020 06:00:39 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C0BhR4rLHz3f6S; Mon, 28 Sep 2020 06:00:39 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 899801933E; Mon, 28 Sep 2020 06:00:39 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08S60dD5035892; Mon, 28 Sep 2020 06:00:39 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08S60dCT035891; Mon, 28 Sep 2020 06:00:39 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202009280600.08S60dCT035891@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 28 Sep 2020 06:00:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366216 - head/stand/efi/loader X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/efi/loader X-SVN-Commit-Revision: 366216 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Sep 2020 06:00:39 -0000 Author: imp Date: Mon Sep 28 06:00:39 2020 New Revision: 366216 URL: https://svnweb.freebsd.org/changeset/base/366216 Log: Fix video on PCI heuristic The video on PCI heuristic was broken. It was supposed to infer a video device when the last element of the path was a PCI DEVICE PATH node. However, the last node in the device path is an END node, so this heuristic never fired. This leads, among other things, to bhyve only producing output in the serial connection once we leave the boot loader. This restores the dual headed boot on bhyve + UEFI (as we did in 11.2), but will favor serial in the absence of other config which may be a change from 11.2. MFC After: 3 days Differential Revision: https://reviews.freebsd.org/D26572 Modified: head/stand/efi/loader/main.c Modified: head/stand/efi/loader/main.c ============================================================================== --- head/stand/efi/loader/main.c Mon Sep 28 04:30:31 2020 (r366215) +++ head/stand/efi/loader/main.c Mon Sep 28 06:00:39 2020 (r366216) @@ -739,6 +739,10 @@ parse_uefi_con_out(void) ep = buf + sz; node = (EFI_DEVICE_PATH *)buf; while ((char *)node < ep) { + if (IsDevicePathEndType(node)) { + if (pci_pending && vid_seen == 0) + vid_seen = ++seen; + } pci_pending = false; if (DevicePathType(node) == ACPI_DEVICE_PATH && (DevicePathSubType(node) == ACPI_DP || @@ -772,8 +776,6 @@ parse_uefi_con_out(void) } node = NextDevicePathNode(node); } - if (pci_pending && vid_seen == 0) - vid_seen = ++seen; /* * Truth table for RB_MULTIPLE | RB_SERIAL From owner-svn-src-all@freebsd.org Mon Sep 28 06:00:56 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C78B83F75E0; Mon, 28 Sep 2020 06:00:56 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C0Bhm4zFdz3f9h; Mon, 28 Sep 2020 06:00:56 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8F99B192B3; Mon, 28 Sep 2020 06:00:56 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08S60uxh035952; Mon, 28 Sep 2020 06:00:56 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08S60uSS035951; Mon, 28 Sep 2020 06:00:56 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202009280600.08S60uSS035951@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 28 Sep 2020 06:00:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366217 - head/tools/boot X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/tools/boot X-SVN-Commit-Revision: 366217 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Sep 2020 06:00:56 -0000 Author: imp Date: Mon Sep 28 06:00:56 2020 New Revision: 366217 URL: https://svnweb.freebsd.org/changeset/base/366217 Log: Speciy the dev in an easily changed variable Rather than hard coding ada0 everywhere, use ${dev}. Also, set dev=vtbd0 since both qemu and bhyve support this. More work should be done to use labels instead for fstab. qemu scripts likely need adjustment. And we should also likely generate byhve scripts too. Modified: head/tools/boot/rootgen.sh Modified: head/tools/boot/rootgen.sh ============================================================================== --- head/tools/boot/rootgen.sh Mon Sep 28 06:00:39 2020 (r366216) +++ head/tools/boot/rootgen.sh Mon Sep 28 06:00:56 2020 (r366217) @@ -7,6 +7,7 @@ iterations=50000 # The smallest FAT32 filesystem is 33292 KB espsize=33292 +dev=vtbd0 # # Builds all the bat-shit crazy combinations we support booting from, @@ -20,7 +21,7 @@ espsize=33292 # This assumes an external program install-boot.sh which will install # the appropriate boot files in the appropriate locations. # -# These images assume ada0 will be the root image. We should likely +# These images assume ${dev} will be the root image. We should likely # use labels, but we don't. # # Assumes you've already rebuilt... maybe bad? Also maybe bad: the env @@ -42,7 +43,7 @@ mk_nogeli_gpt_ufs_legacy() { img=$2 cat > ${src}/etc/fstab < ${src}/etc/fstab < ${src}/etc/fstab < ${src}/etc/fstab < ${src}/etc/fstab < ${src}/etc/fstab < ${mntpt}/etc/fstab < ${mntpt}/etc/fstab < ${mntpt}/etc/fstab < ${src}/etc/fstab < ${DESTDIR}/boot.config cat > ${DESTDIR}/boot/loader.conf < Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 41B883F784D; Mon, 28 Sep 2020 06:07:55 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4C0Brp65Jkz3fmn; Mon, 28 Sep 2020 06:07:54 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 6CAD6873; Mon, 28 Sep 2020 02:07:52 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Mon, 28 Sep 2020 02:07:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsco.org; h= content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; s=fm1; bh=O WqOaa4p8jIZQxdCS5VVPXqMFSzKHePBJ+BU8Mcce9k=; b=cW3trF3W59BLPaoRb 357ZMt4QsRUHL+zO06c/2kSimNJjTn1JfewaKgc8D2zLy68572YJoupiOyoSIWWa xmmnnFDOAKI+PM3+TZv/NyEYXLJHPAGxgNizrE5l94MpFfnfUyc08ilj2JJBsxdV xuvbKV3t/E1nO5jzKyYp91wWbqTp+b5EIOdPKkY6YzTo781QKNl0QSbS3p8HashT 9o6KbLskvzigzmZz5/meplTV2jVdvbWhcMz7RUoV9++iK7FWYLBjKk4TL4c7EBNR UamEbgrAiWwB7ceHyU8koyrL7ock1JD5gN8Uznu4078JYWGopIstgOlaC5sNqqQX K5rMw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=OWqOaa4p8jIZQxdCS5VVPXqMFSzKHePBJ+BU8Mcce 9k=; b=fEwOeJqve0x7S7DWPfFYuV4IlarDmsjSFXIic6v+Ef446UiUb9eAfNZKr x1bsKqdIHJsVy/rFyJD4kjQ772pfp36ZxDldL7Bx/zzjc64Bwop2vyV/FC50pO1H cAxgwiD2i4S5dbqPGPqDwyPdachgYtCllOmhNZ5HIIWLizoZCU3Azi4IMsIywKMK 4nOcS7w9bE+T6ZXXV+Nc43PJHPMFEY/eqF3NuuQET5wVy/WOqMeWEGF6mXN5FEHV BK3+bP7KdhKiBQnLHshTeP6PbSZZAoObz73m3Sg+aNwfqzGyczgnaGdFhouELo/M zJQ3oxoaPMJrbuDa3l82KPhSN7olw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrvdehgddutdehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurheptggguffhjgffgffkfhfvofesthhqmhdthhdtjeenucfhrhhomhepufgtohht thcunfhonhhguceoshgtohhtthhlsehsrghmshgtohdrohhrgheqnecuggftrfgrthhtvg hrnhepudduveekheehiedukeekleelvedufeevfeetudfgtdffteffleehheffueffgfeh necuffhomhgrihhnpehfrhgvvggsshgurdhorhhgnecukfhppeekrdegiedrkeelrddvud efnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepshgt ohhtthhlsehsrghmshgtohdrohhrgh X-ME-Proxy: Received: from [192.168.0.114] (unknown [8.46.89.213]) by mail.messagingengine.com (Postfix) with ESMTPA id 651D73280059; Mon, 28 Sep 2020 02:07:51 -0400 (EDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.1\)) Subject: Re: svn commit: r366207 - head/lib/libc/gen From: Scott Long In-Reply-To: Date: Mon, 28 Sep 2020 00:07:50 -0600 Cc: Konstantin Belousov , src-committers , svn-src-all , svn-src-head Content-Transfer-Encoding: quoted-printable Message-Id: References: <202009272226.08RMQf1h054050@repo.freebsd.org> <20200927231519.GI2643@kib.kiev.ua> To: Alan Somers X-Mailer: Apple Mail (2.3608.120.23.2.1) X-Rspamd-Queue-Id: 4C0Brp65Jkz3fmn X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:11403, ipnet:64.147.123.0/24, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Sep 2020 06:07:55 -0000 > On Sep 27, 2020, at 10:08 PM, Alan Somers wrote: >=20 > On Sun, Sep 27, 2020 at 5:15 PM Konstantin Belousov = wrote: > On Sun, Sep 27, 2020 at 10:26:41PM +0000, Alan Somers wrote: > > Author: asomers > > Date: Sun Sep 27 22:26:41 2020 > > New Revision: 366207 > > URL: https://svnweb.freebsd.org/changeset/base/366207 > >=20 > > Log: > > Misc compiler warning fixes in lib/libc > > =20 > > Reviewed by: kevans, imp > > MFC after: 2 weeks > > Differential Revision: https://reviews.freebsd.org/D26534 > >=20 > > Modified: > > head/lib/libc/gen/auxv.c > > head/lib/libc/gen/basename_compat.c > > head/lib/libc/gen/crypt.c > > head/lib/libc/gen/dirname_compat.c > > head/lib/libc/gen/fts-compat.c > > head/lib/libc/gen/ftw-compat11.c > > head/lib/libc/gen/getentropy.c > >=20 > > Modified: head/lib/libc/gen/auxv.c > > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > > --- head/lib/libc/gen/auxv.c Sun Sep 27 21:43:19 2020 = (r366206) > > +++ head/lib/libc/gen/auxv.c Sun Sep 27 22:26:41 2020 = (r366207) > > @@ -67,7 +67,8 @@ __init_elf_aux_vector(void) > > } > > =20 > > static pthread_once_t aux_once =3D PTHREAD_ONCE_INIT; > > -static int pagesize, osreldate, canary_len, ncpus, pagesizes_len, = bsdflags; > > +static int pagesize, osreldate, ncpus, bsdflags; > > +static size_t canary_len, pagesizes_len; > > static int hwcap_present, hwcap2_present; > > static char *canary, *pagesizes, *execpath; > > static void *ps_strings, *timekeep; > > @@ -245,16 +246,21 @@ int > > _elf_aux_info(int aux, void *buf, int buflen) > > { > > int res; > > + size_t buflen_; > > =20 > > __init_elf_aux_vector(); > > if (__elf_aux_vector =3D=3D NULL) > > return (ENOSYS); > > _once(&aux_once, init_aux); > > =20 > > + if (buflen < 0) > > + return (EINVAL); > > + buflen_ =3D (size_t)buflen; > > + > > switch (aux) { > > case AT_CANARY: > > - if (canary !=3D NULL && canary_len >=3D buflen) { > > - memcpy(buf, canary, buflen); > > + if (canary !=3D NULL && canary_len >=3D buflen_) { > > + memcpy(buf, canary, buflen_); > > memset(canary, 0, canary_len); > > canary =3D NULL; > > res =3D 0; > > @@ -267,35 +273,35 @@ _elf_aux_info(int aux, void *buf, int buflen) > > else if (buf =3D=3D NULL) > > res =3D EINVAL; > > else { > > - if (strlcpy(buf, execpath, buflen) >=3D = buflen) > > + if (strlcpy(buf, execpath, buflen_) >=3D = buflen_) > > res =3D EINVAL; > > else > > res =3D 0; > > } > > break; > > case AT_HWCAP: > > - if (hwcap_present && buflen =3D=3D sizeof(u_long)) { > > + if (hwcap_present && buflen_ =3D=3D sizeof(u_long)) { > > *(u_long *)buf =3D hwcap; > > res =3D 0; > > } else > > res =3D ENOENT; > > break; > > case AT_HWCAP2: > > - if (hwcap2_present && buflen =3D=3D sizeof(u_long)) { > > + if (hwcap2_present && buflen_ =3D=3D sizeof(u_long)) { > > *(u_long *)buf =3D hwcap2; > > res =3D 0; > > } else > > res =3D ENOENT; > > break; > > case AT_PAGESIZES: > > - if (pagesizes !=3D NULL && pagesizes_len >=3D buflen) = { > > - memcpy(buf, pagesizes, buflen); > > + if (pagesizes !=3D NULL && pagesizes_len >=3D buflen_) = { > > + memcpy(buf, pagesizes, buflen_); > > res =3D 0; > > } else > > res =3D ENOENT; > > break; > > case AT_PAGESZ: > > - if (buflen =3D=3D sizeof(int)) { > > + if (buflen_ =3D=3D sizeof(int)) { > > if (pagesize !=3D 0) { > > *(int *)buf =3D pagesize; > > res =3D 0; > > @@ -305,7 +311,7 @@ _elf_aux_info(int aux, void *buf, int buflen) > > res =3D EINVAL; > > break; > > case AT_OSRELDATE: > > - if (buflen =3D=3D sizeof(int)) { > > + if (buflen_ =3D=3D sizeof(int)) { > > if (osreldate !=3D 0) { > > *(int *)buf =3D osreldate; > > res =3D 0; > > @@ -315,7 +321,7 @@ _elf_aux_info(int aux, void *buf, int buflen) > > res =3D EINVAL; > > break; > > case AT_NCPUS: > > - if (buflen =3D=3D sizeof(int)) { > > + if (buflen_ =3D=3D sizeof(int)) { > > if (ncpus !=3D 0) { > > *(int *)buf =3D ncpus; > > res =3D 0; > > @@ -325,7 +331,7 @@ _elf_aux_info(int aux, void *buf, int buflen) > > res =3D EINVAL; > > break; > > case AT_TIMEKEEP: > > - if (buflen =3D=3D sizeof(void *)) { > > + if (buflen_ =3D=3D sizeof(void *)) { > > if (timekeep !=3D NULL) { > > *(void **)buf =3D timekeep; > > res =3D 0; > > @@ -335,14 +341,14 @@ _elf_aux_info(int aux, void *buf, int buflen) > > res =3D EINVAL; > > break; > > case AT_BSDFLAGS: > > - if (buflen =3D=3D sizeof(int)) { > > + if (buflen_ =3D=3D sizeof(int)) { > > *(int *)buf =3D bsdflags; > > res =3D 0; > > } else > > res =3D EINVAL; > > break; > > case AT_PS_STRINGS: > > - if (buflen =3D=3D sizeof(void *)) { > > + if (buflen_ =3D=3D sizeof(void *)) { > > if (ps_strings !=3D NULL) { > > *(void **)buf =3D ps_strings; > > res =3D 0; >=20 > This is significant uglification of the code in the name of fixing = pointless > warnings. >=20 > Warnings are NOT pointless. 99% of them are. But the only way to = find the 1% that aren't is to quell the 99% that are. Last week I wrote = a bug that fortunately got caught in code review. But it shouldn't have = made it that far. It should've been caught by the compiler, but libc is = only built with WARNS=3D2. This commit is one step towards raising = libc's WARNs level to 3. Only 334 files left to go. > =20 A suggestion that might make the diff of the first file a little smaller = and attractive is to rename the passed in variable from =E2=80=9Cbuflen=E2= =80=9D to =E2=80=9C_buflen=E2=80=9D and call the new local variable = =E2=80=9Cbuflen=E2=80=9D. You=E2=80=99d still need the test and = assignment at the top of the function, but a lot of the rest of the diff = would have evaporated away. Scott From owner-svn-src-all@freebsd.org Mon Sep 28 07:59:51 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E07F43FA1A3; Mon, 28 Sep 2020 07:59:51 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C0FKz5gNBz42gT; Mon, 28 Sep 2020 07:59:51 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A64951A5FA; Mon, 28 Sep 2020 07:59:51 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08S7xpaZ009893; Mon, 28 Sep 2020 07:59:51 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08S7xpwD009890; Mon, 28 Sep 2020 07:59:51 GMT (envelope-from se@FreeBSD.org) Message-Id: <202009280759.08S7xpwD009890@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: se set sender to se@FreeBSD.org using -f From: =?UTF-8?Q?Stefan_E=c3=9fer?= Date: Mon, 28 Sep 2020 07:59:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366218 - in stable/12: share/man/man5 tools/build/options X-SVN-Group: stable-12 X-SVN-Commit-Author: se X-SVN-Commit-Paths: in stable/12: share/man/man5 tools/build/options X-SVN-Commit-Revision: 366218 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Sep 2020 07:59:51 -0000 Author: se Date: Mon Sep 28 07:59:50 2020 New Revision: 366218 URL: https://svnweb.freebsd.org/changeset/base/366218 Log: MFC r366100: Add build options WITH/WITHOUT_GH_BC. The update to the man-page cannot be merged, since the default value of this option differs between -CURRENT and 12-STABLE. Added: stable/12/tools/build/options/WITHOUT_GH_BC - copied unchanged from r366200, head/tools/build/options/WITHOUT_GH_BC stable/12/tools/build/options/WITH_GH_BC - copied unchanged from r366200, head/tools/build/options/WITH_GH_BC Modified: stable/12/share/man/man5/src.conf.5 Modified: stable/12/share/man/man5/src.conf.5 ============================================================================== --- stable/12/share/man/man5/src.conf.5 Mon Sep 28 06:00:56 2020 (r366217) +++ stable/12/share/man/man5/src.conf.5 Mon Sep 28 07:59:50 2020 (r366218) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd September 12, 2020 +.Dd September 28, 2020 .Dt SRC.CONF 5 .Os .Sh NAME @@ -792,6 +792,12 @@ if a newer version is not installed. .Pp This is a default setting on amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and riscv/riscv64sf. +.It Va WITH_GH_BC +Set this option to install the enhanced +.Xr bc 1 +and +.Xr dc 1 +programs instead of the traditional FreeBSD versions. .It Va WITHOUT_GNUCXX Do not build the GNU C++ stack (g++, libstdc++). This is the default on platforms where clang is the system compiler. Copied: stable/12/tools/build/options/WITHOUT_GH_BC (from r366200, head/tools/build/options/WITHOUT_GH_BC) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/tools/build/options/WITHOUT_GH_BC Mon Sep 28 07:59:50 2020 (r366218, copy of r366200, head/tools/build/options/WITHOUT_GH_BC) @@ -0,0 +1,6 @@ +.\" $FreeBSD$ +Set to not build and install the enhanced +.Xr bc 1 +and +.Xr dc 1 +programs instead of the traditional FreeBSD versions. Copied: stable/12/tools/build/options/WITH_GH_BC (from r366200, head/tools/build/options/WITH_GH_BC) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/tools/build/options/WITH_GH_BC Mon Sep 28 07:59:50 2020 (r366218, copy of r366200, head/tools/build/options/WITH_GH_BC) @@ -0,0 +1,6 @@ +.\" $FreeBSD$ +Set this option to install the enhanced +.Xr bc 1 +and +.Xr dc 1 +programs instead of the traditional FreeBSD versions. From owner-svn-src-all@freebsd.org Mon Sep 28 09:16:28 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 091E43FC799; Mon, 28 Sep 2020 09:16:28 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C0H2M6XLZz46NB; Mon, 28 Sep 2020 09:16:27 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C39AB1B6DA; Mon, 28 Sep 2020 09:16:27 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08S9GRI5058569; Mon, 28 Sep 2020 09:16:27 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08S9GRWg058568; Mon, 28 Sep 2020 09:16:27 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <202009280916.08S9GRWg058568@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Mon, 28 Sep 2020 09:16:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366219 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 366219 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Sep 2020 09:16:28 -0000 Author: mmel Date: Mon Sep 28 09:16:27 2020 New Revision: 366219 URL: https://svnweb.freebsd.org/changeset/base/366219 Log: Fix booting arm64 EFI with LINUX_BOOT_ABI enabled. Use address of the pointer passed to kernel to determine whether the pointer is a FDT block (physical address) or a module pointer (virtual kernel address). This fragment was supposed to be committed before r366196, but I accidentally skipped it in a patch series. Reported by: bz Modified: head/sys/arm64/arm64/locore.S Modified: head/sys/arm64/arm64/locore.S ============================================================================== --- head/sys/arm64/arm64/locore.S Mon Sep 28 07:59:50 2020 (r366218) +++ head/sys/arm64/arm64/locore.S Mon Sep 28 09:16:27 2020 (r366219) @@ -46,8 +46,6 @@ /* U-Boot booti related constants. */ #if defined(LINUX_BOOT_ABI) -#define FDT_MAGIC 0xEDFE0DD0 /* FDT blob Magic */ - #ifndef UBOOT_IMAGE_OFFSET #define UBOOT_IMAGE_OFFSET 0 /* Image offset from start of */ #endif /* 2 MiB page */ @@ -408,11 +406,12 @@ create_pagetables: /* No modules or FDT pointer ? */ cbz x0, booti_no_fdt - /* Test if modulep points to modules descriptor or to FDT */ - ldr w8, [x0] - ldr w7, =FDT_MAGIC - cmp w7, w8 - b.eq booti_fdt + /* + * Test if x0 points to modules descriptor(virtual address) or + * to FDT (physical address) + */ + cmp x0, x6 /* x6 is #(KERNBASE) */ + b.lo booti_fdt #endif /* Booted with modules pointer */ From owner-svn-src-all@freebsd.org Mon Sep 28 09:18:49 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 49FE23FC546; Mon, 28 Sep 2020 09:18:49 +0000 (UTC) (envelope-from melounmichal@gmail.com) Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) (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 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C0H5428ngz46fW; Mon, 28 Sep 2020 09:18:47 +0000 (UTC) (envelope-from melounmichal@gmail.com) Received: by mail-wr1-x443.google.com with SMTP id e16so429191wrm.2; Mon, 28 Sep 2020 02:18:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:reply-to:subject:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=f+/eL1Un0wc1BNR58t6Ku9cm6q5m2GdEs8mPvEPS4a8=; b=Bw9a7Pxhmgq46ATmvNe5Veh2en+3e/keCLfUQHHNEv/5vQ26EMCeJzMeBCuFhRdvsi QZxCeJnGj6s+Gq/1kBBVLKLKadmdZP9ptkiaU82IdU3Rx/UXaIi5l/KkRGyLlXgEVx32 m/5G/Axyd2tlxtdfC04S6OdnzuhuSJcxeuNStQrjp8B1yfHPpr+HzkPpwWnuOsRIRzob p/ndWSsambcPWB5T7i4lqXdrFkTvuB0/J3wc9Ok++SJR2o+16c9zvlUjznpdumqfMW/W AtOMFrzrUwhCUQUk8cQz2pSKJhA7Bg5NscNWZONmOXTU8ZQ7tglEivs5Mp5eaS8FH2IW tmzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:reply-to:subject:to:cc:references :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=f+/eL1Un0wc1BNR58t6Ku9cm6q5m2GdEs8mPvEPS4a8=; b=MUNQO1O0mr+Cz/FvahPGMR1611/j9wU+/LgnuoUUYmQtUuagLfUNWaumgP92uVZDwa XzNYuY90wPnjwc+QwKgr1FskkWqWz95eg5d8SDBwQWJsKt+HltYaKzsgOLp37fdOPHAw gpf+KBeS2Qr8bQBSH4khp+wOydxbCN2Dn42IvJm1PXS1ZqtaldwCmL0ws6a2VBdYrcOo 2/8spUNh3SX/lSyzOxrgrfM5Dyz5kCXzIvIVIL4+DjewoAllHIV5qULBz+Z278ugXzQR jyvsp5mlESLnJei0cvPnqKylN9sCEgTWn96nzZTb2rA73c8AsQYgHRNlmVTtHYqwJNWa dsqg== X-Gm-Message-State: AOAM5302rpbVUaugykvwMsvIgi8HljkoJVL9jmxv2hj1yf+98xqMe7o9 V0BblePCxwwv84W4+hsaALsSrzhc56E= X-Google-Smtp-Source: ABdhPJzzue/7ryKdG8vN+2kWZdNd8/dJ9Iv8c33ueY7iYrXYXXN3cl57L6lpdyJkar+86NFlBfZqxA== X-Received: by 2002:a5d:4811:: with SMTP id l17mr633980wrq.252.1601284726475; Mon, 28 Sep 2020 02:18:46 -0700 (PDT) Received: from [88.208.79.100] (halouny.humusoft.cz. [88.208.79.100]) by smtp.gmail.com with ESMTPSA id n66sm395303wmb.35.2020.09.28.02.18.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 28 Sep 2020 02:18:45 -0700 (PDT) Sender: Michal Meloun From: Michal Meloun X-Google-Original-From: Michal Meloun Reply-To: mmel@freebsd.org Subject: Re: svn commit: r366196 - head/sys/arm64/conf To: "Bjoern A. Zeeb" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202009271015.08RAF3q9093138@repo.freebsd.org> Message-ID: <22a47a98-0cb3-7f52-53e8-bdfbfc23a51d@freebsd.org> Date: Mon, 28 Sep 2020 11:18:47 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.2.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4C0H5428ngz46fW X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=Bw9a7Pxh; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of melounmichal@gmail.com designates 2a00:1450:4864:20::443 as permitted sender) smtp.mailfrom=melounmichal@gmail.com X-Spamd-Result: default: False [-2.57 / 15.00]; HAS_REPLYTO(0.00)[mmel@freebsd.org]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; TAGGED_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.99)[-0.993]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; NEURAL_SPAM_SHORT(0.42)[0.423]; NEURAL_HAM_LONG(-1.00)[-0.998]; MIME_GOOD(-0.10)[text/plain]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::443:from]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[svn-src-head,svn-src-all] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Sep 2020 09:18:49 -0000 On 27.09.2020 19:51, Bjoern A. Zeeb wrote: > On 27 Sep 2020, at 10:15, Michal Meloun wrote: > >> Author: mmel >> Date: Sun Sep 27 10:15:03 2020 >> New Revision: 366196 >> URL: https://svnweb.freebsd.org/changeset/base/366196 >> >> Log: >>   Add LINUX_BOOT_ABI back to arm64 GENERIC kernel. >> >>   It was removed in r355289 but forgot to return it back when new >> u-boot booti >>   support was committed.  Although booti is not the preferred method of >>   booting the kernel, it is very useful for the initial phase of porting >>   FreeBSD to a new platform or booting the kernel on various embedded >> boards >>   in an industrial environment. > > Seem this prevents (at least my) kernels to boot from loader. > > Removing the option and rebuilding and the kernel booted. > It should be fixed in r366219. Sorry for troubles and thanks for report. Michal From owner-svn-src-all@freebsd.org Mon Sep 28 11:46:04 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5330F3FF34A; Mon, 28 Sep 2020 11:46:04 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C0LM01RJTz4Hdf; Mon, 28 Sep 2020 11:46:04 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 157E11CC74; Mon, 28 Sep 2020 11:46:04 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08SBk37Q051494; Mon, 28 Sep 2020 11:46:03 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08SBk3Q9051493; Mon, 28 Sep 2020 11:46:03 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202009281146.08SBk3Q9051493@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 28 Sep 2020 11:46:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366220 - stable/12/sys/netgraph X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/netgraph X-SVN-Commit-Revision: 366220 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Sep 2020 11:46:04 -0000 Author: markj Date: Mon Sep 28 11:46:03 2020 New Revision: 366220 URL: https://svnweb.freebsd.org/changeset/base/366220 Log: MFC r366167: ng_l2tp: Fix callout synchronization in the rexmit timeout handler PR: 241133 Modified: stable/12/sys/netgraph/ng_l2tp.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netgraph/ng_l2tp.c ============================================================================== --- stable/12/sys/netgraph/ng_l2tp.c Mon Sep 28 09:16:27 2020 (r366219) +++ stable/12/sys/netgraph/ng_l2tp.c Mon Sep 28 11:46:03 2020 (r366220) @@ -1454,15 +1454,17 @@ ng_l2tp_seq_rack_timeout(node_p node, hook_p hook, voi struct mbuf *m; u_int delay; - /* Make sure callout is still active before doing anything */ - if (callout_pending(&seq->rack_timer) || - (!callout_active(&seq->rack_timer))) - return; - /* Sanity check */ L2TP_SEQ_CHECK(seq); mtx_lock(&seq->mtx); + /* Make sure callout is still active before doing anything */ + if (callout_pending(&seq->rack_timer) || + !callout_active(&seq->rack_timer)) { + mtx_unlock(&seq->mtx); + return; + } + priv->stats.xmitRetransmits++; /* Have we reached the retransmit limit? If so, notify owner. */ From owner-svn-src-all@freebsd.org Mon Sep 28 11:48:20 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DAA863FF669; Mon, 28 Sep 2020 11:48:20 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C0LPc5VNQz4HSM; Mon, 28 Sep 2020 11:48:20 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A11AF1D1F1; Mon, 28 Sep 2020 11:48:20 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08SBmKx3051645; Mon, 28 Sep 2020 11:48:20 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08SBmKFv051644; Mon, 28 Sep 2020 11:48:20 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202009281148.08SBmKFv051644@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 28 Sep 2020 11:48:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r366221 - stable/11/sys/netgraph X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/11/sys/netgraph X-SVN-Commit-Revision: 366221 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Sep 2020 11:48:20 -0000 Author: markj Date: Mon Sep 28 11:48:20 2020 New Revision: 366221 URL: https://svnweb.freebsd.org/changeset/base/366221 Log: MFC r366167: ng_l2tp: Fix callout synchronization in the rexmit timeout handler PR: 241133 Modified: stable/11/sys/netgraph/ng_l2tp.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netgraph/ng_l2tp.c ============================================================================== --- stable/11/sys/netgraph/ng_l2tp.c Mon Sep 28 11:46:03 2020 (r366220) +++ stable/11/sys/netgraph/ng_l2tp.c Mon Sep 28 11:48:20 2020 (r366221) @@ -1454,15 +1454,17 @@ ng_l2tp_seq_rack_timeout(node_p node, hook_p hook, voi struct mbuf *m; u_int delay; - /* Make sure callout is still active before doing anything */ - if (callout_pending(&seq->rack_timer) || - (!callout_active(&seq->rack_timer))) - return; - /* Sanity check */ L2TP_SEQ_CHECK(seq); mtx_lock(&seq->mtx); + /* Make sure callout is still active before doing anything */ + if (callout_pending(&seq->rack_timer) || + !callout_active(&seq->rack_timer)) { + mtx_unlock(&seq->mtx); + return; + } + priv->stats.xmitRetransmits++; /* Have we reached the retransmit limit? If so, notify owner. */ From owner-svn-src-all@freebsd.org Mon Sep 28 11:52:17 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 74A803FFB09; Mon, 28 Sep 2020 11:52:17 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C0LV92jj9z4Hnc; Mon, 28 Sep 2020 11:52:17 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4119A1D665; Mon, 28 Sep 2020 11:52:17 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08SBqHZU055517; Mon, 28 Sep 2020 11:52:17 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08SBqArc055269; Mon, 28 Sep 2020 11:52:10 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202009281152.08SBqArc055269@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 28 Sep 2020 11:52:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366222 - in stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common: io java_api json pid proc profile-n raise sdt stop syscall uctf usdt ustack X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common: io java_api json pid proc profile-n raise sdt stop syscall uctf usdt ustack X-SVN-Commit-Revision: 366222 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Sep 2020 11:52:17 -0000 Author: markj Date: Mon Sep 28 11:52:09 2020 New Revision: 366222 URL: https://svnweb.freebsd.org/changeset/base/366222 Log: MFC r365907: Address compiler warnings in C code used by the DTrace test suite. Modified: stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/io/tst.fds.c stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.FunctionLookup.c stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.ProbeData.c stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/json/tst.usdt.c stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/json/usdt.d stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.args1.c stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.float.c stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.fork.c stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.gcc.c stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.ret1.c stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.ret2.c stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.vfork.c stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.weak1.c stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.weak2.c stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.exitcore.c stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.sigwait.c stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.ufuncsort.c stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise1.c stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise2.c stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise3.c stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sdt/tst.sdtargs.c stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/stop/tst.stop1.c stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/stop/tst.stop2.c stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/syscall/tst.args.c stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.aouttype.c stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.chasestrings.c stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.printtype.c stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.argmap.c stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.args.c stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.forker.c stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ustack/tst.bigstack.c stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ustack/tst.spin.c Directory Properties: stable/12/ (props changed) Modified: stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/io/tst.fds.c ============================================================================== --- stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/io/tst.fds.c Mon Sep 28 11:48:20 2020 (r366221) +++ stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/io/tst.fds.c Mon Sep 28 11:52:09 2020 (r366222) @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include #include @@ -48,7 +46,8 @@ int main(int argc, char *argv[]) { const char *file = "/dev/null"; - int i, n, fds[10]; + size_t i, n; + int fds[10]; struct sigaction act; if (argc > 1) { Modified: stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.FunctionLookup.c ============================================================================== --- stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.FunctionLookup.c Mon Sep 28 11:48:20 2020 (r366221) +++ stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.FunctionLookup.c Mon Sep 28 11:52:09 2020 (r366222) @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include typedef void f(int x); Modified: stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.ProbeData.c ============================================================================== --- stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.ProbeData.c Mon Sep 28 11:48:20 2020 (r366221) +++ stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.ProbeData.c Mon Sep 28 11:52:09 2020 (r366222) @@ -24,43 +24,43 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" +#include typedef void f(char *); static void -f_a(char *a) +f_a(char *a __unused) { } static void -f_b(char *a) +f_b(char *a __unused) { } static void -f_c(char *a) +f_c(char *a __unused) { } static void -f_d(char *a) +f_d(char *a __unused) { } static void -f_e(char *a) +f_e(char *a __unused) { } static void -fN(f func, char *a, int i) +fN(f func, char *a, int i __unused) { func(a); } static void -fN2(f func, char *a, int i) +fN2(f func, char *a, int i __unused) { func(a); } Modified: stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/json/tst.usdt.c ============================================================================== --- stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/json/tst.usdt.c Mon Sep 28 11:48:20 2020 (r366221) +++ stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/json/tst.usdt.c Mon Sep 28 11:52:09 2020 (r366222) @@ -28,6 +28,8 @@ " \"action\": \"%s\"" \ "}\n" +int waiting(volatile int *); + int waiting(volatile int *a) { @@ -35,7 +37,7 @@ waiting(volatile int *a) } int -main(int argc, char **argv) +main(void) { volatile int a = 0; int idx; @@ -45,7 +47,8 @@ main(int argc, char **argv) continue; for (idx = 0; idx < 10; idx++) { - char *odd, *even, *json, *action; + const char *odd, *even, *action; + char *json; size *= 1.78; odd = idx % 2 == 1 ? "true" : "false"; @@ -57,7 +60,7 @@ main(int argc, char **argv) free(json); } - BUNYAN_FAKE_LOG_DEBUG("{\"finished\": true}"); + BUNYAN_FAKE_LOG_DEBUG(__DECONST(char *, "{\"finished\": true}")); return (0); } Modified: stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/json/usdt.d ============================================================================== --- stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/json/usdt.d Mon Sep 28 11:48:20 2020 (r366221) +++ stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/json/usdt.d Mon Sep 28 11:52:09 2020 (r366222) @@ -18,10 +18,10 @@ */ provider bunyan_fake { - probe log__trace(char *msg); - probe log__debug(char *msg); - probe log__info(char *msg); - probe log__warn(char *msg); - probe log__error(char *msg); - probe log__fatal(char *msg); + probe log__trace(const char *msg); + probe log__debug(const char *msg); + probe log__info(const char *msg); + probe log__warn(const char *msg); + probe log__error(const char *msg); + probe log__fatal(const char *msg); }; Modified: stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.args1.c ============================================================================== --- stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.args1.c Mon Sep 28 11:48:20 2020 (r366221) +++ stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.args1.c Mon Sep 28 11:52:09 2020 (r366222) @@ -24,28 +24,30 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include #include #include +int go(long, long, long, long, long, long, long, long, long, long); + int -go(long arg0, long arg1, long arg2, long arg3, long arg4, long arg5, long arg6, - long arg7, long arg8, long arg9) +go(long arg0 __unused, long arg1 __unused, long arg2 __unused, + long arg3 __unused, long arg4 __unused, long arg5 __unused, + long arg6 __unused, long arg7 __unused, long arg8 __unused, + long arg9 __unused) { return (arg1); } static void -handle(int sig) +handle(int sig __unused) { go(0, 1, 2, 3, 4, 5, 6, 7, 8, 9); exit(0); } int -main(int argc, char **argv) +main(void) { (void) signal(SIGUSR1, handle); for (;;) Modified: stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.float.c ============================================================================== --- stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.float.c Mon Sep 28 11:48:20 2020 (r366221) +++ stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.float.c Mon Sep 28 11:52:09 2020 (r366222) @@ -24,14 +24,14 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include +extern volatile double c; + volatile double c = 1.2; int -main(int argc, char **argv) +main(int argc, char **argv __unused) { double a = 1.56; double b = (double)argc; Modified: stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.fork.c ============================================================================== --- stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.fork.c Mon Sep 28 11:48:20 2020 (r366221) +++ stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.fork.c Mon Sep 28 11:52:09 2020 (r366222) @@ -24,10 +24,11 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include +int waiting(volatile int *); +int go(void); + int waiting(volatile int *a) { @@ -49,7 +50,7 @@ go(void) } int -main(int argc, char **argv) +main(void) { volatile int a = 0; Modified: stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.gcc.c ============================================================================== --- stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.gcc.c Mon Sep 28 11:48:20 2020 (r366221) +++ stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.gcc.c Mon Sep 28 11:52:09 2020 (r366222) @@ -24,14 +24,15 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include #include #include #include #include +void go(void); +void intr(int); + void go(void) { @@ -43,12 +44,12 @@ go(void) } void -intr(int sig) +intr(int sig __unused) { } int -main(int argc, char **argv) +main(void) { struct sigaction sa; Modified: stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.ret1.c ============================================================================== --- stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.ret1.c Mon Sep 28 11:48:20 2020 (r366221) +++ stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.ret1.c Mon Sep 28 11:52:09 2020 (r366222) @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include #include #include @@ -35,6 +33,11 @@ * leading underscores. */ +extern int a; + +int help(void); +int go(void); + int a = 100; int @@ -50,14 +53,14 @@ go(void) } static void -handle(int sig) +handle(int sig __unused) { go(); exit(0); } int -main(int argc, char **argv) +main(void) { (void) signal(SIGUSR1, handle); for (;;) Modified: stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.ret2.c ============================================================================== --- stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.ret2.c Mon Sep 28 11:48:20 2020 (r366221) +++ stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.ret2.c Mon Sep 28 11:52:09 2020 (r366222) @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include #include #include @@ -35,6 +33,10 @@ * leading underscores. */ +extern int a; + +int go(void); + int a = 100; int @@ -44,14 +46,14 @@ go(void) } static void -handle(int sig) +handle(int sig __unused) { go(); exit(0); } int -main(int argc, char **argv) +main(void) { (void) signal(SIGUSR1, handle); for (;;) Modified: stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.vfork.c ============================================================================== --- stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.vfork.c Mon Sep 28 11:48:20 2020 (r366221) +++ stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.vfork.c Mon Sep 28 11:52:09 2020 (r366222) @@ -24,10 +24,11 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include +int waiting(volatile int *); +int go(void); + int waiting(volatile int *a) { @@ -49,7 +50,7 @@ go(void) } int -main(int argc, char **argv) +main(void) { volatile int a = 0; Modified: stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.weak1.c ============================================================================== --- stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.weak1.c Mon Sep 28 11:48:20 2020 (r366221) +++ stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.weak1.c Mon Sep 28 11:52:09 2020 (r366222) @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include #include #include @@ -37,6 +35,8 @@ #pragma weak _go = go +int go(int); + int go(int a) { @@ -44,14 +44,14 @@ go(int a) } static void -handle(int sig) +handle(int sig __unused) { _go(1); exit(0); } int -main(int argc, char **argv) +main(void) { (void) signal(SIGUSR1, handle); for (;;) Modified: stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.weak2.c ============================================================================== --- stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.weak2.c Mon Sep 28 11:48:20 2020 (r366221) +++ stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.weak2.c Mon Sep 28 11:52:09 2020 (r366222) @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include #include #include @@ -35,7 +33,7 @@ * leading underscores. */ -static int +static int __unused go(int a) { return (a + 1); @@ -44,14 +42,14 @@ go(int a) #pragma weak _go = go static void -handle(int sig) +handle(int sig __unused) { _go(1); exit(0); } int -main(int argc, char **argv) +main(void) { (void) signal(SIGUSR1, handle); for (;;) Modified: stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.exitcore.c ============================================================================== --- stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.exitcore.c Mon Sep 28 11:48:20 2020 (r366221) +++ stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.exitcore.c Mon Sep 28 11:52:09 2020 (r366222) @@ -26,7 +26,7 @@ #include int -main(int argc, char **argv) +main(void) { for (;;) Modified: stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.sigwait.c ============================================================================== --- stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.sigwait.c Mon Sep 28 11:48:20 2020 (r366221) +++ stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.sigwait.c Mon Sep 28 11:52:09 2020 (r366222) @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include #include #include @@ -36,7 +34,7 @@ #define NANOSEC 1000000000 int -main(int argc, char **argv) +main(int argc __unused, char **argv) { struct sigevent ev; struct itimerspec ts; Modified: stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.ufuncsort.c ============================================================================== --- stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.ufuncsort.c Mon Sep 28 11:48:20 2020 (r366221) +++ stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.ufuncsort.c Mon Sep 28 11:52:09 2020 (r366222) @@ -24,32 +24,32 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" +#include typedef void f(int x); static void -f_a(int i) +f_a(int i __unused) { } static void -f_b(int i) +f_b(int i __unused) { } static void -f_c(int i) +f_c(int i __unused) { } static void -f_d(int i) +f_d(int i __unused) { } static void -f_e(int i) +f_e(int i __unused) { } @@ -60,7 +60,7 @@ fN(f func, int i) } int -main() +main(void) { fN(f_a, 1); fN(f_b, 2); Modified: stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise1.c ============================================================================== --- stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise1.c Mon Sep 28 11:48:20 2020 (r366221) +++ stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise1.c Mon Sep 28 11:52:09 2020 (r366222) @@ -24,13 +24,11 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include #include int -main(int argc, char **argv) +main(void) { sigset_t ss; Modified: stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise2.c ============================================================================== --- stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise2.c Mon Sep 28 11:48:20 2020 (r366221) +++ stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise2.c Mon Sep 28 11:52:09 2020 (r366222) @@ -24,20 +24,18 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include #include #include static void -handle(int sig) +handle(int sig __unused) { exit(0); } int -main(int argc, char **argv) +main(void) { struct sigaction sa; Modified: stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise3.c ============================================================================== --- stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise3.c Mon Sep 28 11:48:20 2020 (r366221) +++ stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise3.c Mon Sep 28 11:52:09 2020 (r366222) @@ -24,20 +24,18 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include #include #include static void -handle(int sig) +handle(int sig __unused) { exit(0); } int -main(int argc, char **argv) +main(void) { struct sigaction sa; Modified: stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sdt/tst.sdtargs.c ============================================================================== --- stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sdt/tst.sdtargs.c Mon Sep 28 11:48:20 2020 (r366221) +++ stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sdt/tst.sdtargs.c Mon Sep 28 11:52:09 2020 (r366222) @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include #include @@ -33,7 +31,7 @@ #include int -main(int argc, char **argv) +main(void) { int val = 1; Modified: stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/stop/tst.stop1.c ============================================================================== --- stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/stop/tst.stop1.c Mon Sep 28 11:48:20 2020 (r366221) +++ stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/stop/tst.stop1.c Mon Sep 28 11:52:09 2020 (r366222) @@ -24,12 +24,10 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include int -main(int argc, char **argv) +main(void) { for (;;) { getpid(); Modified: stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/stop/tst.stop2.c ============================================================================== --- stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/stop/tst.stop2.c Mon Sep 28 11:48:20 2020 (r366221) +++ stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/stop/tst.stop2.c Mon Sep 28 11:52:09 2020 (r366222) @@ -24,12 +24,10 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include int -main(int argc, char **argv) +main(void) { for (;;) { getpid(); Modified: stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/syscall/tst.args.c ============================================================================== --- stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/syscall/tst.args.c Mon Sep 28 11:48:20 2020 (r366221) +++ stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/syscall/tst.args.c Mon Sep 28 11:52:09 2020 (r366222) @@ -24,15 +24,13 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include #include #include /*ARGSUSED*/ int -main(int argc, char **argv) +main(void) { for (;;) { (void) __syscall(SYS_mmap, NULL, (size_t)1, 2, 3, -1, Modified: stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.aouttype.c ============================================================================== --- stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.aouttype.c Mon Sep 28 11:48:20 2020 (r366221) +++ stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.aouttype.c Mon Sep 28 11:52:09 2020 (r366222) @@ -24,6 +24,8 @@ typedef struct season_7_lisa_the_vegetarian { int fr_salad; } season_7_lisa_the_vegetarian_t; +int sleeper(season_7_lisa_the_vegetarian_t *); + int sleeper(season_7_lisa_the_vegetarian_t *lp) { Modified: stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.chasestrings.c ============================================================================== --- stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.chasestrings.c Mon Sep 28 11:48:20 2020 (r366221) +++ stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.chasestrings.c Mon Sep 28 11:52:09 2020 (r366222) @@ -22,9 +22,9 @@ #include typedef struct zelda_info { - char *zi_gamename; + const char *zi_gamename; int zi_ndungeons; - char *zi_villain; + const char *zi_villain; int zi_haszelda; } zelda_info_t; Modified: stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.printtype.c ============================================================================== --- stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.printtype.c Mon Sep 28 11:48:20 2020 (r366221) +++ stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.printtype.c Mon Sep 28 11:52:09 2020 (r366222) @@ -27,19 +27,19 @@ typedef struct final_fantasy_info { } final_fantasy_info_t; static int -ff_getgameid(final_fantasy_info_t *f) +ff_getgameid(final_fantasy_info_t *f __unused) { return (0); } static int -ff_getpartysize(final_fantasy_info_t *f) +ff_getpartysize(final_fantasy_info_t *f __unused) { return (0); } static int -ff_getsummons(final_fantasy_info_t *f) +ff_getsummons(final_fantasy_info_t *f __unused) { return (0); } Modified: stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.argmap.c ============================================================================== --- stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.argmap.c Mon Sep 28 11:48:20 2020 (r366221) +++ stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.argmap.c Mon Sep 28 11:52:09 2020 (r366222) @@ -24,12 +24,10 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include int -main(int argc, char **argv) +main(void) { for (;;) { DTRACE_PROBE2(test_prov, place, 10, 4); Modified: stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.args.c ============================================================================== --- stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.args.c Mon Sep 28 11:48:20 2020 (r366221) +++ stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.args.c Mon Sep 28 11:52:09 2020 (r366222) @@ -24,12 +24,10 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include int -main(int argc, char **argv) +main(void) { for (;;) { DTRACE_PROBE2(test_prov, place, 10, 4); Modified: stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.forker.c ============================================================================== --- stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.forker.c Mon Sep 28 11:48:20 2020 (r366221) +++ stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.forker.c Mon Sep 28 11:52:09 2020 (r366222) @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include #include @@ -35,7 +33,7 @@ #include "forker.h" int -main(int argc, char **argv) +main(void) { int i; Modified: stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ustack/tst.bigstack.c ============================================================================== --- stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ustack/tst.bigstack.c Mon Sep 28 11:48:20 2020 (r366221) +++ stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ustack/tst.bigstack.c Mon Sep 28 11:52:09 2020 (r366222) @@ -24,12 +24,11 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include #include #include +void grow(int); void grow1(int); void @@ -53,7 +52,7 @@ grow1(int frame) } int -main(int argc, char *argv[]) +main(void) { grow(1); Modified: stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ustack/tst.spin.c ============================================================================== --- stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ustack/tst.spin.c Mon Sep 28 11:48:20 2020 (r366221) +++ stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ustack/tst.spin.c Mon Sep 28 11:52:09 2020 (r366222) @@ -24,12 +24,16 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include +extern volatile long long count; + volatile long long count = 0; +int baz(int); +int bar(int); +int foo(int, int); + int baz(int a) { @@ -57,5 +61,5 @@ foo(int a, int b) int main(int argc, char **argv) { - return (foo(argc, (int)argv) == 0); + return (foo(argc, (int)(uintptr_t)argv) == 0); } From owner-svn-src-all@freebsd.org Mon Sep 28 12:14:39 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1FA53421AB6; Mon, 28 Sep 2020 12:14:39 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C0Lzy6qDwz4Kyr; Mon, 28 Sep 2020 12:14:38 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CD6FC1DA0C; Mon, 28 Sep 2020 12:14:38 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08SCEcdx070072; Mon, 28 Sep 2020 12:14:38 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08SCEcRr070071; Mon, 28 Sep 2020 12:14:38 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202009281214.08SCEcRr070071@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 28 Sep 2020 12:14:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r366223 - releng/12.2/sys/netgraph X-SVN-Group: releng X-SVN-Commit-Author: markj X-SVN-Commit-Paths: releng/12.2/sys/netgraph X-SVN-Commit-Revision: 366223 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Sep 2020 12:14:39 -0000 Author: markj Date: Mon Sep 28 12:14:38 2020 New Revision: 366223 URL: https://svnweb.freebsd.org/changeset/base/366223 Log: MFS r366220: MFC r366167: ng_l2tp: Fix callout synchronization in the rexmit timeout handler PR: 241133 Approved by: re (gjb) Modified: releng/12.2/sys/netgraph/ng_l2tp.c Directory Properties: releng/12.2/ (props changed) Modified: releng/12.2/sys/netgraph/ng_l2tp.c ============================================================================== --- releng/12.2/sys/netgraph/ng_l2tp.c Mon Sep 28 11:52:09 2020 (r366222) +++ releng/12.2/sys/netgraph/ng_l2tp.c Mon Sep 28 12:14:38 2020 (r366223) @@ -1454,15 +1454,17 @@ ng_l2tp_seq_rack_timeout(node_p node, hook_p hook, voi struct mbuf *m; u_int delay; - /* Make sure callout is still active before doing anything */ - if (callout_pending(&seq->rack_timer) || - (!callout_active(&seq->rack_timer))) - return; - /* Sanity check */ L2TP_SEQ_CHECK(seq); mtx_lock(&seq->mtx); + /* Make sure callout is still active before doing anything */ + if (callout_pending(&seq->rack_timer) || + !callout_active(&seq->rack_timer)) { + mtx_unlock(&seq->mtx); + return; + } + priv->stats.xmitRetransmits++; /* Have we reached the retransmit limit? If so, notify owner. */ From owner-svn-src-all@freebsd.org Mon Sep 28 13:52:18 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EE07E423914; Mon, 28 Sep 2020 13:52:18 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C0P8f5vDHz4Q6j; Mon, 28 Sep 2020 13:52:18 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AD64D1EBD2; Mon, 28 Sep 2020 13:52:18 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08SDqIBT031464; Mon, 28 Sep 2020 13:52:18 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08SDqIj3031462; Mon, 28 Sep 2020 13:52:18 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <202009281352.08SDqIj3031462@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Mon, 28 Sep 2020 13:52:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366224 - in stable/12: share/man/man4 usr.sbin/spi X-SVN-Group: stable-12 X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: in stable/12: share/man/man4 usr.sbin/spi X-SVN-Commit-Revision: 366224 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Sep 2020 13:52:19 -0000 Author: 0mp (doc,ports committer) Date: Mon Sep 28 13:52:18 2020 New Revision: 366224 URL: https://svnweb.freebsd.org/changeset/base/366224 Log: MFC 364454, 364453: I. Reference spi(8) from spigen.4 II. Clean up spi.8 - Remove trailing whitespace - Address igor and mandoc warnings - Sort options - Use macros consistently (e.g., Fl for flags, Dq for quoting, Bd for code blocks) - Add a history section - Fix incorrect use of macros in various places Modified: stable/12/share/man/man4/spigen.4 stable/12/usr.sbin/spi/spi.8 Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/spigen.4 ============================================================================== --- stable/12/share/man/man4/spigen.4 Mon Sep 28 12:14:38 2020 (r366223) +++ stable/12/share/man/man4/spigen.4 Mon Sep 28 13:52:18 2020 (r366224) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 7, 2018 +.Dd August 21, 2020 .Dt SPIGEN 4 .Os .Sh NAME @@ -195,7 +195,8 @@ Empty property indicating the slave device requires ch .El .Sh SEE ALSO .Xr fdt 4 , -.Xr device.hints 5 +.Xr device.hints 5 , +.Xr spi 8 .Sh HISTORY The .Nm Modified: stable/12/usr.sbin/spi/spi.8 ============================================================================== --- stable/12/usr.sbin/spi/spi.8 Mon Sep 28 12:14:38 2020 (r366223) +++ stable/12/usr.sbin/spi/spi.8 Mon Sep 28 13:52:18 2020 (r366224) @@ -1,5 +1,5 @@ .\" Copyright (c) 2018 by S.F.T. Inc. -.\" +.\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: @@ -23,28 +23,28 @@ .\" .\" $FreeBSD$ .\" -.Dd "15 April 2018" -.Dt spi 8 +.Dd August 21, 2020 +.Dt SPI 8 .Os .Sh NAME .Nm spi .Nd communicate on SPI bus with slave devices .Sh SYNOPSIS .Nm -.Op Fl f Ar device -.Op Fl d Ar r|w|rw -.Op Fl m Ar mode -.Op Fl s Ar max-speed -.Op Fl c Ar count -.Op Fl C Ar cmd_bytes .Op Fl A .Op Fl b .Op Fl L .Op Fl v +.Op Fl C Ar command-bytes +.Op Fl c Ar count +.Op Fl d Cm r Ns | Ns Cm w Ns | Ns Cm rw +.Op Fl f Ar device +.Op Fl m Ar mode +.Op Fl s Ar max-speed .Nm .Op Fl i -.Op Fl f Ar device .Op Fl v +.Op Fl f Ar device .Nm .Op Fl h .Sh DESCRIPTION @@ -59,26 +59,26 @@ device. Each .Xr spigen 4 device is associated with a specific -.Sq chip select +.Dq chip select .Pq cs pin on the spibus, and therefore needs to be specified. If no device name is specified on the command line, .Nm assumes -.Sq spigen0.0 . +.Dq spigen0.0 . .Pp For more information on the spigen device, see .Xr spigen 4 . .Pp The options are as follows: -.Bl -tag -width ".Fl f Ar device" +.Bl -tag -width "-f device" .It Fl A Specifies ASCII mode. Both read and write data is input and output as 2-character hexadecimal values, optionally separated by white space, such as 00 01 02 etc. When combined with the -.Sq -b +.Fl b flag, the data on stdin remains a sequence of ASCII hexadecimal byte values, but the output reverts to binary mode. .It Fl b @@ -86,24 +86,23 @@ Binary .Pq output mode. Only has an effect when -.Sq -A +.Fl A has been specified. Reverts the output back to binary .Pq rather than ASCII , while leaving the input format as-is. Use in combination with -.Sq -A +.Fl A to allow using something like -.Sq echo +.Dq echo to pass hexadecimal values to the SPI device, but output the received data on stdout as binary. -.It Fl C Ar command bytes -Sends one or more -.Sq command -bytes, skipping any bytes read-in during the transfer. +.It Fl C Ar command-bytes +Sends one or more command bytes, +skipping any bytes read-in during the transfer. The byte values should be specified as a quoted parameter, similar to the format for data on stdin for -.Sq -A , +.Fl A , that is, 2 character hexadecimal values, optionally separated by white space. An SPI device will typically require that a command be sent, followed by bytes of data. @@ -114,22 +113,23 @@ The total number of bytes to transfer as a decimal int If a write or a read/write transaction is being performed, and fewer than this number of bytes are read in from stdin, the remaining bytes will be sent with a value of -.Sq 0 . +.Dq 0 . If the length can be determined from the input file size, you can use a -.Sq count +.Ar count value of -.Sq -1 +.Dq -1 to base the transfer on the input file's size. -.It Fl d Ar r|w|rw +.It Fl d Cm r Ns | Ns Cm w Ns | Ns Cm rw Transfer direction: Use -.Sq r +.Cm r for read, -.Sq w for write, and -.Sq rw +.Cm w +for write, and +.Cm rw for simultaneous read and write. .It Fl f Ar device SPI device to use -.Pq default is /dev/spigen0 . +.Pq default is Pa /dev/spigen0 . .It Fl h Print help text to stderr, explaining the command line options. .It Fl i @@ -140,8 +140,10 @@ and clock speed are not changed. LSB bit order. The default is MSB, i.e., the highest order bit is transmitted first. -Specifying -L caused the LSB to be transmitted and read first. -.It Fl m Ar 0 - 3 +Specifying +.Fl L +caused the LSB to be transmitted and read first. +.It Fl m Cm 0 Ns | Ns Cm 1 Ns | Ns Cm 2 Ns | Ns Cm 3 SPI mode, 0 through 3. This defines the clock phase and timing with respect to reading and writing data, as per the SPI specification. @@ -153,7 +155,7 @@ exceed this maximum. Specifies Verbose mode. Diagnostics and information are written to stderr. You can specify -.Sq -v +.Fl v more than once to increase verbosity. .El .Sh EXAMPLES @@ -161,43 +163,54 @@ Here are a few examples of using the spi utility: .Bl -bullet .It Get information about the default SPI device -.Pp +.Bd -literal spi -i +.Ed .It Set the maximum clock speed to 200Khz and the mode to 3 on spigen0.1, but do not transmit nor receive any data -.Pp +.Bd -literal spi -f spigen0.1 -s 200000 -m 3 +.Ed .It Send a command sequence consisting of 2 bytes, and read 2 additional bytes from the SPI device, using the current mode and speed on the default device -.Pp +.Bd -literal spi -d r -C "00 01" -c 2 +.Ed .It Transmit a byte value of 5, and receive 2 bytes, displaying their values as 2-byte ASCII hexadecimal, with mode 2, and a maximum clock speed of 500khz. -.Pp +.Bd -literal echo "05" | spi -A -d rw -m 2 -s 500000 -c 2 +.Ed .It Send a binary file, and output the SPI result through -.Sq od +.Xr od 1 as hexadecimal bytes, using the current maximum clock speed and SPI mode. -.Pp +.Bd -literal spi -d rw -c -1 Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E397F423C98; Mon, 28 Sep 2020 13:56:35 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C0PFb5h9lz4QDK; Mon, 28 Sep 2020 13:56:35 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A78011E94F; Mon, 28 Sep 2020 13:56:35 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08SDuZtO031715; Mon, 28 Sep 2020 13:56:35 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08SDuZ28031713; Mon, 28 Sep 2020 13:56:35 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <202009281356.08SDuZ28031713@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Mon, 28 Sep 2020 13:56:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r366225 - in stable/11: share/man/man4 usr.sbin/spi X-SVN-Group: stable-11 X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: in stable/11: share/man/man4 usr.sbin/spi X-SVN-Commit-Revision: 366225 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Sep 2020 13:56:36 -0000 Author: 0mp (doc,ports committer) Date: Mon Sep 28 13:56:35 2020 New Revision: 366225 URL: https://svnweb.freebsd.org/changeset/base/366225 Log: MFC 364454, 364453: 1. Reference spi(8) from spigen.4 2. Clean up spi.8 - Remove trailing whitespace - Address igor and mandoc warnings - Sort options - Use macros consistently (e.g., Fl for flags, Dq for quoting, Bd for code blocks) - Add a history section - Fix incorrect use of macros in various places Modified: stable/11/share/man/man4/spigen.4 stable/11/usr.sbin/spi/spi.8 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/spigen.4 ============================================================================== --- stable/11/share/man/man4/spigen.4 Mon Sep 28 13:52:18 2020 (r366224) +++ stable/11/share/man/man4/spigen.4 Mon Sep 28 13:56:35 2020 (r366225) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 7, 2018 +.Dd August 21, 2020 .Dt SPIGEN 4 .Os .Sh NAME @@ -195,7 +195,8 @@ Empty property indicating the slave device requires ch .El .Sh SEE ALSO .Xr fdt 4 , -.Xr device.hints 5 +.Xr device.hints 5 , +.Xr spi 8 .Sh HISTORY The .Nm Modified: stable/11/usr.sbin/spi/spi.8 ============================================================================== --- stable/11/usr.sbin/spi/spi.8 Mon Sep 28 13:52:18 2020 (r366224) +++ stable/11/usr.sbin/spi/spi.8 Mon Sep 28 13:56:35 2020 (r366225) @@ -1,5 +1,5 @@ .\" Copyright (c) 2018 by S.F.T. Inc. -.\" +.\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: @@ -23,28 +23,28 @@ .\" .\" $FreeBSD$ .\" -.Dd "15 April 2018" -.Dt spi 8 +.Dd August 21, 2020 +.Dt SPI 8 .Os .Sh NAME .Nm spi .Nd communicate on SPI bus with slave devices .Sh SYNOPSIS .Nm -.Op Fl f Ar device -.Op Fl d Ar r|w|rw -.Op Fl m Ar mode -.Op Fl s Ar max-speed -.Op Fl c Ar count -.Op Fl C Ar cmd_bytes .Op Fl A .Op Fl b .Op Fl L .Op Fl v +.Op Fl C Ar command-bytes +.Op Fl c Ar count +.Op Fl d Cm r Ns | Ns Cm w Ns | Ns Cm rw +.Op Fl f Ar device +.Op Fl m Ar mode +.Op Fl s Ar max-speed .Nm .Op Fl i -.Op Fl f Ar device .Op Fl v +.Op Fl f Ar device .Nm .Op Fl h .Sh DESCRIPTION @@ -59,26 +59,26 @@ device. Each .Xr spigen 4 device is associated with a specific -.Sq chip select +.Dq chip select .Pq cs pin on the spibus, and therefore needs to be specified. If no device name is specified on the command line, .Nm assumes -.Sq spigen0.0 . +.Dq spigen0.0 . .Pp For more information on the spigen device, see .Xr spigen 4 . .Pp The options are as follows: -.Bl -tag -width ".Fl f Ar device" +.Bl -tag -width "-f device" .It Fl A Specifies ASCII mode. Both read and write data is input and output as 2-character hexadecimal values, optionally separated by white space, such as 00 01 02 etc. When combined with the -.Sq -b +.Fl b flag, the data on stdin remains a sequence of ASCII hexadecimal byte values, but the output reverts to binary mode. .It Fl b @@ -86,24 +86,23 @@ Binary .Pq output mode. Only has an effect when -.Sq -A +.Fl A has been specified. Reverts the output back to binary .Pq rather than ASCII , while leaving the input format as-is. Use in combination with -.Sq -A +.Fl A to allow using something like -.Sq echo +.Dq echo to pass hexadecimal values to the SPI device, but output the received data on stdout as binary. -.It Fl C Ar command bytes -Sends one or more -.Sq command -bytes, skipping any bytes read-in during the transfer. +.It Fl C Ar command-bytes +Sends one or more command bytes, +skipping any bytes read-in during the transfer. The byte values should be specified as a quoted parameter, similar to the format for data on stdin for -.Sq -A , +.Fl A , that is, 2 character hexadecimal values, optionally separated by white space. An SPI device will typically require that a command be sent, followed by bytes of data. @@ -114,22 +113,23 @@ The total number of bytes to transfer as a decimal int If a write or a read/write transaction is being performed, and fewer than this number of bytes are read in from stdin, the remaining bytes will be sent with a value of -.Sq 0 . +.Dq 0 . If the length can be determined from the input file size, you can use a -.Sq count +.Ar count value of -.Sq -1 +.Dq -1 to base the transfer on the input file's size. -.It Fl d Ar r|w|rw +.It Fl d Cm r Ns | Ns Cm w Ns | Ns Cm rw Transfer direction: Use -.Sq r +.Cm r for read, -.Sq w for write, and -.Sq rw +.Cm w +for write, and +.Cm rw for simultaneous read and write. .It Fl f Ar device SPI device to use -.Pq default is /dev/spigen0 . +.Pq default is Pa /dev/spigen0 . .It Fl h Print help text to stderr, explaining the command line options. .It Fl i @@ -140,8 +140,10 @@ and clock speed are not changed. LSB bit order. The default is MSB, i.e., the highest order bit is transmitted first. -Specifying -L caused the LSB to be transmitted and read first. -.It Fl m Ar 0 - 3 +Specifying +.Fl L +caused the LSB to be transmitted and read first. +.It Fl m Cm 0 Ns | Ns Cm 1 Ns | Ns Cm 2 Ns | Ns Cm 3 SPI mode, 0 through 3. This defines the clock phase and timing with respect to reading and writing data, as per the SPI specification. @@ -153,7 +155,7 @@ exceed this maximum. Specifies Verbose mode. Diagnostics and information are written to stderr. You can specify -.Sq -v +.Fl v more than once to increase verbosity. .El .Sh EXAMPLES @@ -161,43 +163,54 @@ Here are a few examples of using the spi utility: .Bl -bullet .It Get information about the default SPI device -.Pp +.Bd -literal spi -i +.Ed .It Set the maximum clock speed to 200Khz and the mode to 3 on spigen0.1, but do not transmit nor receive any data -.Pp +.Bd -literal spi -f spigen0.1 -s 200000 -m 3 +.Ed .It Send a command sequence consisting of 2 bytes, and read 2 additional bytes from the SPI device, using the current mode and speed on the default device -.Pp +.Bd -literal spi -d r -C "00 01" -c 2 +.Ed .It Transmit a byte value of 5, and receive 2 bytes, displaying their values as 2-byte ASCII hexadecimal, with mode 2, and a maximum clock speed of 500khz. -.Pp +.Bd -literal echo "05" | spi -A -d rw -m 2 -s 500000 -c 2 +.Ed .It Send a binary file, and output the SPI result through -.Sq od +.Xr od 1 as hexadecimal bytes, using the current maximum clock speed and SPI mode. -.Pp +.Bd -literal spi -d rw -c -1 Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 89B75423F05; Mon, 28 Sep 2020 14:11:54 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C0PbG38fBz4Qh2; Mon, 28 Sep 2020 14:11:54 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4F82D1F181; Mon, 28 Sep 2020 14:11:54 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08SEBsi6041014; Mon, 28 Sep 2020 14:11:54 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08SEBs3V041013; Mon, 28 Sep 2020 14:11:54 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202009281411.08SEBs3V041013@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 28 Sep 2020 14:11:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366226 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 366226 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Sep 2020 14:11:54 -0000 Author: tuexen Date: Mon Sep 28 14:11:53 2020 New Revision: 366226 URL: https://svnweb.freebsd.org/changeset/base/366226 Log: Minor cleanup. MFC after: 3 days Modified: head/sys/netinet/sctp_pcb.c Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Mon Sep 28 13:56:35 2020 (r366225) +++ head/sys/netinet/sctp_pcb.c Mon Sep 28 14:11:53 2020 (r366226) @@ -6524,7 +6524,7 @@ sctp_load_addresses_from_init(struct sctp_tcb *stcb, s (ptype == SCTP_DEL_IP_ADDRESS) || (ptype == SCTP_ERROR_CAUSE_IND) || (ptype == SCTP_SUCCESS_REPORT)) { - /* don't care */ ; + /* don't care */ } else { if ((ptype & 0x8000) == 0x0000) { /* From owner-svn-src-all@freebsd.org Mon Sep 28 14:47:37 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 47D2C424B8A; Mon, 28 Sep 2020 14:47:37 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C0QNT11KZz4SK7; Mon, 28 Sep 2020 14:47:37 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 019231EFF9; Mon, 28 Sep 2020 14:47:37 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08SElapK062237; Mon, 28 Sep 2020 14:47:36 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08SElatI062233; Mon, 28 Sep 2020 14:47:36 GMT (envelope-from se@FreeBSD.org) Message-Id: <202009281447.08SElatI062233@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: se set sender to se@FreeBSD.org using -f From: =?UTF-8?Q?Stefan_E=c3=9fer?= Date: Mon, 28 Sep 2020 14:47:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r366227 - in releng/12.2: share/man/man5 tools/build/options X-SVN-Group: releng X-SVN-Commit-Author: se X-SVN-Commit-Paths: in releng/12.2: share/man/man5 tools/build/options X-SVN-Commit-Revision: 366227 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Sep 2020 14:47:37 -0000 Author: se Date: Mon Sep 28 14:47:36 2020 New Revision: 366227 URL: https://svnweb.freebsd.org/changeset/base/366227 Log: MF12 r366218: Add documentation of the build options WITH_GH_BC and WITHOUT_GH_BC to optionally replace the traditional implementation of bc(1) and dc(1) with the new implementation that has become the default version in -CURRENT. The man-page differs from the one in -CURRENT due to different default values of that build option. Approved by: re (gjb) Added: releng/12.2/tools/build/options/WITHOUT_GH_BC - copied unchanged from r366218, stable/12/tools/build/options/WITHOUT_GH_BC releng/12.2/tools/build/options/WITH_GH_BC - copied unchanged from r366218, stable/12/tools/build/options/WITH_GH_BC Modified: releng/12.2/share/man/man5/src.conf.5 Modified: releng/12.2/share/man/man5/src.conf.5 ============================================================================== --- releng/12.2/share/man/man5/src.conf.5 Mon Sep 28 14:11:53 2020 (r366226) +++ releng/12.2/share/man/man5/src.conf.5 Mon Sep 28 14:47:36 2020 (r366227) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd September 12, 2020 +.Dd September 28, 2020 .Dt SRC.CONF 5 .Os .Sh NAME @@ -775,6 +775,12 @@ if a newer version is not installed. .Pp This is a default setting on amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and riscv/riscv64. +.It Va WITH_GH_BC +Set this option to install the enhanced +.Xr bc 1 +and +.Xr dc 1 +programs instead of the traditional FreeBSD versions. .It Va WITHOUT_GNUCXX Do not build the GNU C++ stack (g++, libstdc++). This is the default on platforms where clang is the system compiler. Copied: releng/12.2/tools/build/options/WITHOUT_GH_BC (from r366218, stable/12/tools/build/options/WITHOUT_GH_BC) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ releng/12.2/tools/build/options/WITHOUT_GH_BC Mon Sep 28 14:47:36 2020 (r366227, copy of r366218, stable/12/tools/build/options/WITHOUT_GH_BC) @@ -0,0 +1,6 @@ +.\" $FreeBSD$ +Set to not build and install the enhanced +.Xr bc 1 +and +.Xr dc 1 +programs instead of the traditional FreeBSD versions. Copied: releng/12.2/tools/build/options/WITH_GH_BC (from r366218, stable/12/tools/build/options/WITH_GH_BC) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ releng/12.2/tools/build/options/WITH_GH_BC Mon Sep 28 14:47:36 2020 (r366227, copy of r366218, stable/12/tools/build/options/WITH_GH_BC) @@ -0,0 +1,6 @@ +.\" $FreeBSD$ +Set this option to install the enhanced +.Xr bc 1 +and +.Xr dc 1 +programs instead of the traditional FreeBSD versions. From owner-svn-src-all@freebsd.org Mon Sep 28 15:04:14 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AC0C9424BF8; Mon, 28 Sep 2020 15:04:14 +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 4C0Qlf0bX5z4TP5; Mon, 28 Sep 2020 15:04:13 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.16.1/8.16.1) with ESMTPS id 08SF45ZJ035507 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 28 Sep 2020 18:04:08 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 08SF45ZJ035507 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 08SF457G035506; Mon, 28 Sep 2020 18:04:05 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 28 Sep 2020 18:04:05 +0300 From: Konstantin Belousov To: Alan Somers Cc: src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r366207 - head/lib/libc/gen Message-ID: <20200928150405.GO2643@kib.kiev.ua> References: <202009272226.08RMQf1h054050@repo.freebsd.org> <20200927231519.GI2643@kib.kiev.ua> 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=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on tom.home X-Rspamd-Queue-Id: 4C0Qlf0bX5z4TP5 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Sep 2020 15:04:14 -0000 On Sun, Sep 27, 2020 at 10:08:49PM -0600, Alan Somers wrote: > On Sun, Sep 27, 2020 at 5:15 PM Konstantin Belousov > wrote: > > > On Sun, Sep 27, 2020 at 10:26:41PM +0000, Alan Somers wrote: > > > Author: asomers > > > Date: Sun Sep 27 22:26:41 2020 > > > New Revision: 366207 > > > URL: https://svnweb.freebsd.org/changeset/base/366207 > > > > > > Log: > > > Misc compiler warning fixes in lib/libc > > > > > > Reviewed by: kevans, imp > > > MFC after: 2 weeks > > > Differential Revision: https://reviews.freebsd.org/D26534 > > > > > > Modified: > > > head/lib/libc/gen/auxv.c > > > head/lib/libc/gen/basename_compat.c > > > head/lib/libc/gen/crypt.c > > > head/lib/libc/gen/dirname_compat.c > > > head/lib/libc/gen/fts-compat.c > > > head/lib/libc/gen/ftw-compat11.c > > > head/lib/libc/gen/getentropy.c > > > > > > Modified: head/lib/libc/gen/auxv.c > > > > > ============================================================================== > > > --- head/lib/libc/gen/auxv.c Sun Sep 27 21:43:19 2020 (r366206) > > > +++ head/lib/libc/gen/auxv.c Sun Sep 27 22:26:41 2020 (r366207) > > > @@ -67,7 +67,8 @@ __init_elf_aux_vector(void) > > > } > > > > > > static pthread_once_t aux_once = PTHREAD_ONCE_INIT; > > > -static int pagesize, osreldate, canary_len, ncpus, pagesizes_len, > > bsdflags; > > > +static int pagesize, osreldate, ncpus, bsdflags; > > > +static size_t canary_len, pagesizes_len; > > > static int hwcap_present, hwcap2_present; > > > static char *canary, *pagesizes, *execpath; > > > static void *ps_strings, *timekeep; > > > @@ -245,16 +246,21 @@ int > > > _elf_aux_info(int aux, void *buf, int buflen) > > > { > > > int res; > > > + size_t buflen_; > > > > > > __init_elf_aux_vector(); > > > if (__elf_aux_vector == NULL) > > > return (ENOSYS); > > > _once(&aux_once, init_aux); > > > > > > + if (buflen < 0) > > > + return (EINVAL); > > > + buflen_ = (size_t)buflen; > > > + > > > switch (aux) { > > > case AT_CANARY: > > > - if (canary != NULL && canary_len >= buflen) { > > > - memcpy(buf, canary, buflen); > > > + if (canary != NULL && canary_len >= buflen_) { > > > + memcpy(buf, canary, buflen_); > > > memset(canary, 0, canary_len); > > > canary = NULL; > > > res = 0; > > > @@ -267,35 +273,35 @@ _elf_aux_info(int aux, void *buf, int buflen) > > > else if (buf == NULL) > > > res = EINVAL; > > > else { > > > - if (strlcpy(buf, execpath, buflen) >= buflen) > > > + if (strlcpy(buf, execpath, buflen_) >= buflen_) > > > res = EINVAL; > > > else > > > res = 0; > > > } > > > break; > > > case AT_HWCAP: > > > - if (hwcap_present && buflen == sizeof(u_long)) { > > > + if (hwcap_present && buflen_ == sizeof(u_long)) { > > > *(u_long *)buf = hwcap; > > > res = 0; > > > } else > > > res = ENOENT; > > > break; > > > case AT_HWCAP2: > > > - if (hwcap2_present && buflen == sizeof(u_long)) { > > > + if (hwcap2_present && buflen_ == sizeof(u_long)) { > > > *(u_long *)buf = hwcap2; > > > res = 0; > > > } else > > > res = ENOENT; > > > break; > > > case AT_PAGESIZES: > > > - if (pagesizes != NULL && pagesizes_len >= buflen) { > > > - memcpy(buf, pagesizes, buflen); > > > + if (pagesizes != NULL && pagesizes_len >= buflen_) { > > > + memcpy(buf, pagesizes, buflen_); > > > res = 0; > > > } else > > > res = ENOENT; > > > break; > > > case AT_PAGESZ: > > > - if (buflen == sizeof(int)) { > > > + if (buflen_ == sizeof(int)) { > > > if (pagesize != 0) { > > > *(int *)buf = pagesize; > > > res = 0; > > > @@ -305,7 +311,7 @@ _elf_aux_info(int aux, void *buf, int buflen) > > > res = EINVAL; > > > break; > > > case AT_OSRELDATE: > > > - if (buflen == sizeof(int)) { > > > + if (buflen_ == sizeof(int)) { > > > if (osreldate != 0) { > > > *(int *)buf = osreldate; > > > res = 0; > > > @@ -315,7 +321,7 @@ _elf_aux_info(int aux, void *buf, int buflen) > > > res = EINVAL; > > > break; > > > case AT_NCPUS: > > > - if (buflen == sizeof(int)) { > > > + if (buflen_ == sizeof(int)) { > > > if (ncpus != 0) { > > > *(int *)buf = ncpus; > > > res = 0; > > > @@ -325,7 +331,7 @@ _elf_aux_info(int aux, void *buf, int buflen) > > > res = EINVAL; > > > break; > > > case AT_TIMEKEEP: > > > - if (buflen == sizeof(void *)) { > > > + if (buflen_ == sizeof(void *)) { > > > if (timekeep != NULL) { > > > *(void **)buf = timekeep; > > > res = 0; > > > @@ -335,14 +341,14 @@ _elf_aux_info(int aux, void *buf, int buflen) > > > res = EINVAL; > > > break; > > > case AT_BSDFLAGS: > > > - if (buflen == sizeof(int)) { > > > + if (buflen_ == sizeof(int)) { > > > *(int *)buf = bsdflags; > > > res = 0; > > > } else > > > res = EINVAL; > > > break; > > > case AT_PS_STRINGS: > > > - if (buflen == sizeof(void *)) { > > > + if (buflen_ == sizeof(void *)) { > > > if (ps_strings != NULL) { > > > *(void **)buf = ps_strings; > > > res = 0; > > > > This is significant uglification of the code in the name of fixing > > pointless > > warnings. > > > > Warnings are NOT pointless. 99% of them are. But the only way to find the > 1% that aren't is to quell the 99% that are. Last week I wrote a bug that > fortunately got caught in code review. But it shouldn't have made it that > far. It should've been caught by the compiler, but libc is only built with > WARNS=2. This commit is one step towards raising libc's WARNs level to 3. > Only 334 files left to go. I specifically replied to the part of the change that I quoted. I did not discussed generic arguments WRT handling some warnings. > > > > > > I suspect that you tried to shut down warning about comparision of integers > > of different size, int vs. sizeof() which has size_t result. Is there > > anything else ? > > > > Mostly the warnings were about comparisons of integers with different > signedness. Also there were some warnings about missing prototypes. In this fragment ? I think no, so only signess mismatch. > > > > > > All these values should be small integers, which is quite vividly > > illustrated by comparision with sizeof() of built-in types. If compiler > > cannot deduce that itself the warning should be forcibly disabled by > > flag instead of doing 'buflen_'. > > > > And canary_len/pagesizes_len do not need to take 8 bytes, their values > > never become greater than one hundred. > > > > Better to give it enough space that the compiler can check it statically, > rather than require runtime checks. Natural and proper type for small numerical values in C is int. Both external interface for the API, and internal implementation are built around this. Making internal details mismatch the external view on the interface make it much more risky then leaving warning that is mostly due to the compiler deficiency. Using size_t is not appropriate there. I prefer this warning to be shut down for the file with the compiler switch. If you are so inclined to shut it in the source code, please either change the type of unneeded variable to unsigned int (and also perhaps applying ScottL suggestion), or just do casts to int in comparisions. From owner-svn-src-all@freebsd.org Mon Sep 28 15:07:10 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B9691424EED; Mon, 28 Sep 2020 15:07:10 +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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C0Qq24Z6Mz4TVB; Mon, 28 Sep 2020 15:07:10 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qk1-f170.google.com (mail-qk1-f170.google.com [209.85.222.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 7AD761D546; Mon, 28 Sep 2020 15:07:10 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qk1-f170.google.com with SMTP id w12so1230275qki.6; Mon, 28 Sep 2020 08:07:10 -0700 (PDT) X-Gm-Message-State: AOAM530WfIpweSnmVViJjIjKR8rKxTi/kIM4r9X7zl2KhAz0Sn8kDWsA x1nhRdUh2IB0TWV2Du+LQuOINdnQDSKb0UraPzw= X-Google-Smtp-Source: ABdhPJwHNLiunL3uRHAbhhDt5V8xKng6rgxPiOw6jbjrpjRi9XscAZINthaM61kgWn1d5AN9soiKIostI7I5ax76IiY= X-Received: by 2002:a37:a189:: with SMTP id k131mr1138213qke.34.1601305630001; Mon, 28 Sep 2020 08:07:10 -0700 (PDT) MIME-Version: 1.0 References: <202009272226.08RMQf1h054050@repo.freebsd.org> <20200927231519.GI2643@kib.kiev.ua> <20200928150405.GO2643@kib.kiev.ua> In-Reply-To: <20200928150405.GO2643@kib.kiev.ua> From: Kyle Evans Date: Mon, 28 Sep 2020 10:06:55 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r366207 - head/lib/libc/gen To: Konstantin Belousov Cc: Alan Somers , src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Sep 2020 15:07:10 -0000 On Mon, Sep 28, 2020 at 10:04 AM Konstantin Belousov wrote: > > On Sun, Sep 27, 2020 at 10:08:49PM -0600, Alan Somers wrote: > > On Sun, Sep 27, 2020 at 5:15 PM Konstantin Belousov > > wrote: > > > > > On Sun, Sep 27, 2020 at 10:26:41PM +0000, Alan Somers wrote: > > > > Author: asomers > > > > Date: Sun Sep 27 22:26:41 2020 > > > > New Revision: 366207 > > > > URL: https://svnweb.freebsd.org/changeset/base/366207 > > > > > > > > Log: > > > > Misc compiler warning fixes in lib/libc > > > > > > > > Reviewed by: kevans, imp > > > > MFC after: 2 weeks > > > > Differential Revision: https://reviews.freebsd.org/D26534 > > > > > > > > Modified: > > > > head/lib/libc/gen/auxv.c > > > > head/lib/libc/gen/basename_compat.c > > > > head/lib/libc/gen/crypt.c > > > > head/lib/libc/gen/dirname_compat.c > > > > head/lib/libc/gen/fts-compat.c > > > > head/lib/libc/gen/ftw-compat11.c > > > > head/lib/libc/gen/getentropy.c > > > > > > > > Modified: head/lib/libc/gen/auxv.c > > > > > > > ============================================================================== > > > > --- head/lib/libc/gen/auxv.c Sun Sep 27 21:43:19 2020 (r366206) > > > > +++ head/lib/libc/gen/auxv.c Sun Sep 27 22:26:41 2020 (r366207) > > > > @@ -67,7 +67,8 @@ __init_elf_aux_vector(void) > > > > } > > > > > > > > static pthread_once_t aux_once = PTHREAD_ONCE_INIT; > > > > -static int pagesize, osreldate, canary_len, ncpus, pagesizes_len, > > > bsdflags; > > > > +static int pagesize, osreldate, ncpus, bsdflags; > > > > +static size_t canary_len, pagesizes_len; > > > > static int hwcap_present, hwcap2_present; > > > > static char *canary, *pagesizes, *execpath; > > > > static void *ps_strings, *timekeep; > > > > @@ -245,16 +246,21 @@ int > > > > _elf_aux_info(int aux, void *buf, int buflen) > > > > { > > > > int res; > > > > + size_t buflen_; > > > > > > > > __init_elf_aux_vector(); > > > > if (__elf_aux_vector == NULL) > > > > return (ENOSYS); > > > > _once(&aux_once, init_aux); > > > > > > > > + if (buflen < 0) > > > > + return (EINVAL); > > > > + buflen_ = (size_t)buflen; > > > > + > > > > switch (aux) { > > > > case AT_CANARY: > > > > - if (canary != NULL && canary_len >= buflen) { > > > > - memcpy(buf, canary, buflen); > > > > + if (canary != NULL && canary_len >= buflen_) { > > > > + memcpy(buf, canary, buflen_); > > > > memset(canary, 0, canary_len); > > > > canary = NULL; > > > > res = 0; > > > > @@ -267,35 +273,35 @@ _elf_aux_info(int aux, void *buf, int buflen) > > > > else if (buf == NULL) > > > > res = EINVAL; > > > > else { > > > > - if (strlcpy(buf, execpath, buflen) >= buflen) > > > > + if (strlcpy(buf, execpath, buflen_) >= buflen_) > > > > res = EINVAL; > > > > else > > > > res = 0; > > > > } > > > > break; > > > > case AT_HWCAP: > > > > - if (hwcap_present && buflen == sizeof(u_long)) { > > > > + if (hwcap_present && buflen_ == sizeof(u_long)) { > > > > *(u_long *)buf = hwcap; > > > > res = 0; > > > > } else > > > > res = ENOENT; > > > > break; > > > > case AT_HWCAP2: > > > > - if (hwcap2_present && buflen == sizeof(u_long)) { > > > > + if (hwcap2_present && buflen_ == sizeof(u_long)) { > > > > *(u_long *)buf = hwcap2; > > > > res = 0; > > > > } else > > > > res = ENOENT; > > > > break; > > > > case AT_PAGESIZES: > > > > - if (pagesizes != NULL && pagesizes_len >= buflen) { > > > > - memcpy(buf, pagesizes, buflen); > > > > + if (pagesizes != NULL && pagesizes_len >= buflen_) { > > > > + memcpy(buf, pagesizes, buflen_); > > > > res = 0; > > > > } else > > > > res = ENOENT; > > > > break; > > > > case AT_PAGESZ: > > > > - if (buflen == sizeof(int)) { > > > > + if (buflen_ == sizeof(int)) { > > > > if (pagesize != 0) { > > > > *(int *)buf = pagesize; > > > > res = 0; > > > > @@ -305,7 +311,7 @@ _elf_aux_info(int aux, void *buf, int buflen) > > > > res = EINVAL; > > > > break; > > > > case AT_OSRELDATE: > > > > - if (buflen == sizeof(int)) { > > > > + if (buflen_ == sizeof(int)) { > > > > if (osreldate != 0) { > > > > *(int *)buf = osreldate; > > > > res = 0; > > > > @@ -315,7 +321,7 @@ _elf_aux_info(int aux, void *buf, int buflen) > > > > res = EINVAL; > > > > break; > > > > case AT_NCPUS: > > > > - if (buflen == sizeof(int)) { > > > > + if (buflen_ == sizeof(int)) { > > > > if (ncpus != 0) { > > > > *(int *)buf = ncpus; > > > > res = 0; > > > > @@ -325,7 +331,7 @@ _elf_aux_info(int aux, void *buf, int buflen) > > > > res = EINVAL; > > > > break; > > > > case AT_TIMEKEEP: > > > > - if (buflen == sizeof(void *)) { > > > > + if (buflen_ == sizeof(void *)) { > > > > if (timekeep != NULL) { > > > > *(void **)buf = timekeep; > > > > res = 0; > > > > @@ -335,14 +341,14 @@ _elf_aux_info(int aux, void *buf, int buflen) > > > > res = EINVAL; > > > > break; > > > > case AT_BSDFLAGS: > > > > - if (buflen == sizeof(int)) { > > > > + if (buflen_ == sizeof(int)) { > > > > *(int *)buf = bsdflags; > > > > res = 0; > > > > } else > > > > res = EINVAL; > > > > break; > > > > case AT_PS_STRINGS: > > > > - if (buflen == sizeof(void *)) { > > > > + if (buflen_ == sizeof(void *)) { > > > > if (ps_strings != NULL) { > > > > *(void **)buf = ps_strings; > > > > res = 0; > > > > > > This is significant uglification of the code in the name of fixing > > > pointless > > > warnings. > > > > > > > Warnings are NOT pointless. 99% of them are. But the only way to find the > > 1% that aren't is to quell the 99% that are. Last week I wrote a bug that > > fortunately got caught in code review. But it shouldn't have made it that > > far. It should've been caught by the compiler, but libc is only built with > > WARNS=2. This commit is one step towards raising libc's WARNs level to 3. > > Only 334 files left to go. > I specifically replied to the part of the change that I quoted. I did not > discussed generic arguments WRT handling some warnings. > > > > > > > > > > > I suspect that you tried to shut down warning about comparision of integers > > > of different size, int vs. sizeof() which has size_t result. Is there > > > anything else ? > > > > > > > Mostly the warnings were about comparisons of integers with different > > signedness. Also there were some warnings about missing prototypes. > In this fragment ? I think no, so only signess mismatch. > > > > > > > > > > > All these values should be small integers, which is quite vividly > > > illustrated by comparision with sizeof() of built-in types. If compiler > > > cannot deduce that itself the warning should be forcibly disabled by > > > flag instead of doing 'buflen_'. > > > > > > And canary_len/pagesizes_len do not need to take 8 bytes, their values > > > never become greater than one hundred. > > > > > > > Better to give it enough space that the compiler can check it statically, > > rather than require runtime checks. > Natural and proper type for small numerical values in C is int. Both > external interface for the API, and internal implementation are built > around this. Making internal details mismatch the external view on the > interface make it much more risky then leaving warning that is mostly > due to the compiler deficiency. > > Using size_t is not appropriate there. I prefer this warning to be shut > down for the file with the compiler switch. If you are so inclined to > shut it in the source code, please either change the type of unneeded > variable to unsigned int (and also perhaps applying ScottL suggestion), > or just do casts to int in comparisions. I would be tempted to just revert the rest of the local modifications (sans negative check, maybe) and widen it in the one spot that the compiler complains about: - if (strlcpy(buf, execpath, buflen_) >= buflen_) + if (strlcpy(buf, execpath, buflen) >= (size_t)buflen) I had expressed this in the review, but with no particular conviction. Thanks, Kyle Evans From owner-svn-src-all@freebsd.org Mon Sep 28 16:01:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6F85B42604E; Mon, 28 Sep 2020 16:01:46 +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 4C0S220jHGz4X01; Mon, 28 Sep 2020 16:01:45 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.16.1/8.16.1) with ESMTPS id 08SG1cZE049443 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 28 Sep 2020 19:01:41 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 08SG1cZE049443 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 08SG1cYD049442; Mon, 28 Sep 2020 19:01:38 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 28 Sep 2020 19:01:38 +0300 From: Konstantin Belousov To: Kyle Evans Cc: Alan Somers , src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r366207 - head/lib/libc/gen Message-ID: <20200928160138.GP2643@kib.kiev.ua> References: <202009272226.08RMQf1h054050@repo.freebsd.org> <20200927231519.GI2643@kib.kiev.ua> <20200928150405.GO2643@kib.kiev.ua> 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=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on tom.home X-Rspamd-Queue-Id: 4C0S220jHGz4X01 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Sep 2020 16:01:46 -0000 On Mon, Sep 28, 2020 at 10:06:55AM -0500, Kyle Evans wrote: > I would be tempted to just revert the rest of the local modifications > (sans negative check, maybe) and widen it in the one spot that the > compiler complains about: > > - if (strlcpy(buf, execpath, buflen_) >= buflen_) > + if (strlcpy(buf, execpath, buflen) >= (size_t)buflen) > > I had expressed this in the review, but with no particular conviction. If this is the only place where the warning occurs, IMO it would be quite good to reduce the change. From owner-svn-src-all@freebsd.org Mon Sep 28 16:19:22 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4C250426680; Mon, 28 Sep 2020 16:19:22 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C0SQL1HSVz4XdN; Mon, 28 Sep 2020 16:19:22 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E842A2025E; Mon, 28 Sep 2020 16:19:21 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08SGJL0N017521; Mon, 28 Sep 2020 16:19:21 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08SGJLHh017519; Mon, 28 Sep 2020 16:19:21 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202009281619.08SGJLHh017519@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 28 Sep 2020 16:19:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366228 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 366228 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Sep 2020 16:19:22 -0000 Author: imp Date: Mon Sep 28 16:19:21 2020 New Revision: 366228 URL: https://svnweb.freebsd.org/changeset/base/366228 Log: Report the kernel console on the boot screen Report what console the boot loader is telling the kernel to use: o Dual (Serial Primary) o Dual (Video Primary) o Serial o Video This allows the user to interrupt the boot and tweak the cosnole, if needed, in a trivial way. Useful for installs where the default selected may not be quite what you want, or when you are running a dual setup and need to toggle over to the other console being primary. The 'c'/'C' keys will do the cycling through the consoles. Note: you'll still have to drop into the loader to set details about serial consoles. And this doesn't change the console the loader is using. Reviewed by: kevans@ MFC After: 3 days Differential Revision: https://reviews.freebsd.org/D26573 Modified: head/stand/lua/core.lua head/stand/lua/menu.lua Modified: head/stand/lua/core.lua ============================================================================== --- head/stand/lua/core.lua Mon Sep 28 14:47:36 2020 (r366227) +++ head/stand/lua/core.lua Mon Sep 28 16:19:21 2020 (r366228) @@ -451,6 +451,40 @@ function core.popFrontTable(tbl) return first_value, new_tbl end +function core.getConsoleName() + if loader.getenv("boot_multicons") ~= nil then + if loader.getenv("boot_serial") ~= nil then + return "Dual (Serial primary)" + else + return "Dual (Video primary)" + end + else + if loader.getenv("boot_serial") ~= nil then + return "Serial" + else + return "Video" + end + end +end + +function core.nextConsoleChoice() + if loader.getenv("boot_multicons") ~= nil then + if loader.getenv("boot_serial") ~= nil then + loader.unsetenv("boot_serial") + else + loader.unsetenv("boot_multicons") + loader.setenv("boot_serial", "YES") + end + else + if loader.getenv("boot_serial") ~= nil then + loader.unsetenv("boot_serial") + else + loader.setenv("boot_multicons", "YES") + loader.setenv("boot_serial", "YES") + end + end +end + recordDefaults() hook.register("config.reloaded", core.clearCachedKernels) return core Modified: head/stand/lua/menu.lua ============================================================================== --- head/stand/lua/menu.lua Mon Sep 28 14:47:36 2020 (r366227) +++ head/stand/lua/menu.lua Mon Sep 28 16:19:21 2020 (r366228) @@ -244,6 +244,7 @@ menu.welcome = { boot_entry_2, menu_entries.prompt, menu_entries.reboot, + menu_entries.console, { entry_type = core.MENU_SEPARATOR, }, @@ -283,6 +284,16 @@ menu.welcome = { core.boot() end, alias = {"s", "S"}, + }, + console = { + entry_type = core.MENU_ENTRY, + name = function() + return color.highlight("C") .. "ons: " .. core.getConsoleName() + end, + func = function() + core.nextConsoleChoice() + end, + alias = {"c", "C"}, }, prompt = { entry_type = core.MENU_RETURN, From owner-svn-src-all@freebsd.org Mon Sep 28 16:19:33 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 285BD426531; Mon, 28 Sep 2020 16:19:33 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C0SQX5V2rz4XbX; Mon, 28 Sep 2020 16:19:30 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EC846206A4; Mon, 28 Sep 2020 16:19:29 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08SGJTe9017575; Mon, 28 Sep 2020 16:19:29 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08SGJTdc017574; Mon, 28 Sep 2020 16:19:29 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202009281619.08SGJTdc017574@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 28 Sep 2020 16:19:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366229 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 366229 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Sep 2020 16:19:33 -0000 Author: imp Date: Mon Sep 28 16:19:29 2020 New Revision: 366229 URL: https://svnweb.freebsd.org/changeset/base/366229 Log: For mulitcons boot, report it and which console is primary Until we can do proper /etc/rc output on both consoles in multicons boot (or all of them if we ever generalize), report when we are booting multicons. Also report the primary console. This will be a big hint why output stops after this line (though some slow USB discovery still happens after mountroot / init starts). Reviewed by: scottl@, tsoome@ Differential Revision: https://reviews.freebsd.org/D26574 Modified: head/sys/kern/init_main.c Modified: head/sys/kern/init_main.c ============================================================================== --- head/sys/kern/init_main.c Mon Sep 28 16:19:21 2020 (r366228) +++ head/sys/kern/init_main.c Mon Sep 28 16:19:29 2020 (r366229) @@ -715,6 +715,14 @@ start_init(void *dummy) /* Wipe GELI passphrase from the environment. */ kern_unsetenv("kern.geom.eli.passphrase"); + /* For Multicons, report which console is primary to both */ + if (boothowto & RB_MULTIPLE) { + if (boothowto & RB_SERIAL) + printf("Dual Console: Serial Primary, Video Secondary\n"); + else + printf("Dual Console: Video Primary, Serial Secondary\n"); + } + if ((var = kern_getenv("init_path")) != NULL) { strlcpy(init_path, var, sizeof(init_path)); freeenv(var); @@ -724,7 +732,7 @@ start_init(void *dummy) while ((path = strsep(&tmp_init_path, ":")) != NULL) { if (bootverbose) printf("start_init: trying %s\n", path); - + memset(&args, 0, sizeof(args)); error = exec_alloc_args(&args); if (error != 0) From owner-svn-src-all@freebsd.org Mon Sep 28 16:54:40 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AB8CE426E29; Mon, 28 Sep 2020 16:54:40 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C0TC444cDz4ZC3; Mon, 28 Sep 2020 16:54:40 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 55E4A20ABB; Mon, 28 Sep 2020 16:54:40 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08SGseAj041553; Mon, 28 Sep 2020 16:54:40 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08SGsdce041551; Mon, 28 Sep 2020 16:54:39 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202009281654.08SGsdce041551@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 28 Sep 2020 16:54:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366230 - in head: share/man/man9 sys/net sys/sys X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head: share/man/man9 sys/net sys/sys X-SVN-Commit-Revision: 366230 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Sep 2020 16:54:40 -0000 Author: emaste Date: Mon Sep 28 16:54:39 2020 New Revision: 366230 URL: https://svnweb.freebsd.org/changeset/base/366230 Log: add SIOCGIFDATA ioctl For interfaces that do not support SIOCGIFMEDIA (for which there are quite a few) the only fallback is to query the interface for if_data->ifi_link_state. While it's possible to get at if_data for an interface via getifaddrs(3) or sysctl, both are heavy weight mechanisms. SIOCGIFDATA is a simple ioctl to retrieve this fast with very little resource use in comparison. This implementation mirrors that of other similar ioctls in FreeBSD. Submitted by: Roy Marples Reviewed by: markj MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D26538 Modified: head/share/man/man9/ifnet.9 head/sys/net/if.c head/sys/sys/sockio.h Modified: head/share/man/man9/ifnet.9 ============================================================================== --- head/share/man/man9/ifnet.9 Mon Sep 28 16:19:29 2020 (r366229) +++ head/share/man/man9/ifnet.9 Mon Sep 28 16:54:39 2020 (r366230) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 14, 2018 +.Dd September 28, 2020 .Dt IFNET 9 .Os .Sh NAME @@ -1310,12 +1310,13 @@ list. Caller must have appropriate privilege. (No call-down to driver.) .It Dv SIOCGIFCAP +.It Dv SIOCGIFDATA .It Dv SIOCGIFFIB .It Dv SIOCGIFFLAGS .It Dv SIOCGIFMETRIC .It Dv SIOCGIFMTU .It Dv SIOCGIFPHYS -Get interface capabilities, FIB, flags, metric, MTU, medium selection. +Get interface capabilities, data, FIB, flags, metric, MTU, medium selection. (No call-down to driver.) .Pp .It Dv SIOCSIFCAP Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Mon Sep 28 16:19:29 2020 (r366229) +++ head/sys/net/if.c Mon Sep 28 16:54:39 2020 (r366230) @@ -2518,6 +2518,18 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, caddr_t data, ifr->ifr_curcap = ifp->if_capenable; break; + case SIOCGIFDATA: + { + struct if_data ifd; + + /* Ensure uninitialised padding is not leaked. */ + memset(&ifd, 0, sizeof(ifd)); + + if_data_copy(ifp, &ifd); + error = copyout(&ifd, ifr_data_get_ptr(ifr), sizeof(ifd)); + break; + } + #ifdef MAC case SIOCGIFMAC: error = mac_ifnet_ioctl_get(td->td_ucred, ifr, ifp); Modified: head/sys/sys/sockio.h ============================================================================== --- head/sys/sys/sockio.h Mon Sep 28 16:19:29 2020 (r366229) +++ head/sys/sys/sockio.h Mon Sep 28 16:54:39 2020 (r366230) @@ -83,6 +83,7 @@ #define SIOCSIFDESCR _IOW('i', 41, struct ifreq) /* set ifnet descr */ #define SIOCGIFDESCR _IOWR('i', 42, struct ifreq) /* get ifnet descr */ #define SIOCAIFADDR _IOW('i', 43, struct ifaliasreq)/* add/chg IF alias */ +#define SIOCGIFDATA _IOW('i', 44, struct ifreq) /* get if_data */ #define SIOCADDMULTI _IOW('i', 49, struct ifreq) /* add m'cast addr */ #define SIOCDELMULTI _IOW('i', 50, struct ifreq) /* del m'cast addr */ From owner-svn-src-all@freebsd.org Mon Sep 28 17:19:58 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 211EB4276C9; Mon, 28 Sep 2020 17:19:58 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C0TmG035wz4bJ2; Mon, 28 Sep 2020 17:19:58 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D4F20212FB; Mon, 28 Sep 2020 17:19:57 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08SHJvtv054025; Mon, 28 Sep 2020 17:19:57 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08SHJvWD054024; Mon, 28 Sep 2020 17:19:57 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202009281719.08SHJvWD054024@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 28 Sep 2020 17:19:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366231 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 366231 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Sep 2020 17:19:58 -0000 Author: kevans Date: Mon Sep 28 17:19:57 2020 New Revision: 366231 URL: https://svnweb.freebsd.org/changeset/base/366231 Log: Address whitespace nits in subr_rtc.c These were separated out from a nearby patch from Andrew Gierth. MFC after: 3 days Modified: head/sys/kern/subr_rtc.c Modified: head/sys/kern/subr_rtc.c ============================================================================== --- head/sys/kern/subr_rtc.c Mon Sep 28 16:54:39 2020 (r366230) +++ head/sys/kern/subr_rtc.c Mon Sep 28 17:19:57 2020 (r366231) @@ -164,7 +164,7 @@ clock_dbgprint_hdr(device_t dev, int rw) getnanotime(&now); device_printf(dev, "%s at ", (rw & CLOCK_DBG_READ) ? "read " : "write"); clock_print_ts(&now, 9); - printf(": "); + printf(": "); } void @@ -241,7 +241,7 @@ clock_register_flags(device_t clockdev, long resolutio } sx_xunlock(&rtc_list_lock); - device_printf(clockdev, + device_printf(clockdev, "registered as a time-of-day clock, resolution %d.%6.6ds\n", newrtc->resolution / 1000000, newrtc->resolution % 1000000); } From owner-svn-src-all@freebsd.org Mon Sep 28 17:32:18 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ABB1C427C46; Mon, 28 Sep 2020 17:32:18 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C0V2V47Flz4cP7; Mon, 28 Sep 2020 17:32:18 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 71B2A215B9; Mon, 28 Sep 2020 17:32:18 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08SHWIwX065866; Mon, 28 Sep 2020 17:32:18 GMT (envelope-from cperciva@FreeBSD.org) Received: (from cperciva@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08SHWIf8065865; Mon, 28 Sep 2020 17:32:18 GMT (envelope-from cperciva@FreeBSD.org) Message-Id: <202009281732.08SHWIf8065865@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cperciva set sender to cperciva@FreeBSD.org using -f From: Colin Percival Date: Mon, 28 Sep 2020 17:32:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r366232 - releng/12.2/release/tools X-SVN-Group: releng X-SVN-Commit-Author: cperciva X-SVN-Commit-Paths: releng/12.2/release/tools X-SVN-Commit-Revision: 366232 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Sep 2020 17:32:18 -0000 Author: cperciva Date: Mon Sep 28 17:32:18 2020 New Revision: 366232 URL: https://svnweb.freebsd.org/changeset/base/366232 Log: MFS r366028: Spawn the DHCPv6 client in EC2 instances via rtsold. Approved by: re (gjb) Sponsored by: https://www.patreon.com/cperciva Modified: releng/12.2/release/tools/ec2.conf Directory Properties: releng/12.2/ (props changed) Modified: releng/12.2/release/tools/ec2.conf ============================================================================== --- releng/12.2/release/tools/ec2.conf Mon Sep 28 17:19:57 2020 (r366231) +++ releng/12.2/release/tools/ec2.conf Mon Sep 28 17:32:18 2020 (r366232) @@ -6,7 +6,7 @@ # Packages to install into the image we're creating. This is a deliberately # minimalist set, providing only the packages necessary to bootstrap further # package installation as specified via EC2 user-data. -export VM_EXTRA_PACKAGES="ec2-scripts firstboot-freebsd-update firstboot-pkgs dual-dhclient-daemon ebsnvme-id" +export VM_EXTRA_PACKAGES="ec2-scripts firstboot-freebsd-update firstboot-pkgs isc-dhcp44-client ebsnvme-id" # Include the amazon-ssm-agent package in amd64 images, since some users want # to be able to use it on systems which are not connected to the Internet. @@ -63,9 +63,19 @@ vm_extra_pre_umount() { # via EC2 user-data. echo 'firstboot_pkgs_list="awscli"' >> ${DESTDIR}/etc/rc.conf - # Enable IPv6 on all interfaces, and use DHCP on both IPv4 and IPv6. + # Enable IPv6 on all interfaces, and spawn DHCPv6 via rtsold echo 'ipv6_activate_all_interfaces="YES"' >> ${DESTDIR}/etc/rc.conf - echo 'dhclient_program="/usr/local/sbin/dual-dhclient"' >> ${DESTDIR}/etc/rc.conf + echo 'rtsold_enable="YES"' >> ${DESTDIR}/etc/rc.conf + echo 'rtsold_flags="-M /usr/local/libexec/rtsold-M -a"' >> ${DESTDIR}/etc/rc.conf + + # Provide a script which rtsold can use to launch DHCPv6 + mkdir -p ${DESTDIR}/usr/local/libexec + cat > ${DESTDIR}/usr/local/libexec/rtsold-M <<'EOF' +#!/bin/sh + +/usr/local/sbin/dhclient -6 -nw -N -cf /dev/null $1 +EOF + chmod 755 ${DESTDIR}/usr/local/libexec/rtsold-M # The EC2 console is output-only, so while printing a backtrace can # be useful, there's no point dropping into a debugger or waiting From owner-svn-src-all@freebsd.org Mon Sep 28 18:24:54 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 54992428C2A for ; Mon, 28 Sep 2020 18:24:54 +0000 (UTC) (envelope-from info@techism-uk.co.uk) Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.17.24]) (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.kundenserver.de", Issuer "TeleSec ServerPass Class 2 CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C0WC93cGxz4g6Y for ; Mon, 28 Sep 2020 18:24:53 +0000 (UTC) (envelope-from info@techism-uk.co.uk) Received: from DESKTOP-UCSLODP ([92.26.85.186]) by mrelayeu.kundenserver.de (mreue107 [213.165.67.115]) with ESMTPSA (Nemesis) id 1MSckp-1jz4DV0yMb-00SyML for ; Mon, 28 Sep 2020 20:24:52 +0200 From: "Techism IT" Subject: Upcoming Collections To: svn-src-all@freebsd.org MIME-Version: 1.0 Reply-To: info@techism-uk.co.uk Date: Mon, 28 Sep 2020 19:24:52 +0100 Message-ID: <1MLQgv-1k59pX1UJv-00IYDr@mrelayeu.kundenserver.de> X-Provags-ID: V03:K1:UKY5DHahqSUReAw2+M3G67e2LhFciyD0QtUt9aADRjrg1bK0XYs CESHq1sVfPgqqfGkWwFSdATd77UF8QQ5yrfs9M7/ZGEwDhAaz/ML25UVk5AYaa7kwAnoEpU Z+6zriF9wb+0sYtMKQbfUck2ffjWQxxbjkeE7pIPRLpY9GNQVN/WD+yK6wmvtWxeQ8zhVex hUFwJ/t/outZJHncePSrw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:O+q10QzhVhc=:H2+BKMOsaE6QVYpAJMQEZ8 ayZIeUfUFDscl/pZgUXk3FK0jYpL/YBPDrhHunytH2v4ZKzzyuIrn4VeAvh4iPvEIsUKOsnzn 0FlpEBXhHZH4kVMyS46ywBxViv1x1noOCXehG9aB84OvfwQWKYBRqKPpE5axeQIBus838ip/w 4hDq4GfxklZ7P83rwqR8C/HwcXc57e5bDpm5DdbUvjWp0aqhwy5sk10DMm8sR5t7w79Mh8anl B5jYQX+fUk5UQgJDrllKbgwrWaSF6iRgZ6xODJlQpX8KwhmE5A4+u1oM+FOA9r/oef363pPho VvEEwvsEueeGjj/+cHR615E5h6qXsXICpc/eSindLaTt5ZpdbPf8Y8ReYpQNwIY+9gftuERaf tQA3JTCMrmnZpm4E/fIrj+RESWMCS5nbyc7cFI48mGOLvFgAqZNJnJCZ0+MSitrhmkLSOXFkA 0cK9FxFP1QhtWxp2fr8qtEtY3SukQYdPFNYwoojfMKvhCCUwZTtcpS0DK1awPA786c0KdmgJc G9DLYlQoKh82fZcbyFCiHrC68fXxg65xjrA2M4DNlCf7boVqYxEkp5hKS7tZBGYt0QO1bTDhl UDaNfsB5WjHXQaOkggNIPq0aiy3fd3bvjAM+QCo7/2hFxTd7wSVMqEJPFlnw0UHA4eGIaBlLW q1WXchhUNpf2trz3nlNAoAz0LaLNw6O5S5aTwTPCvMRFOzOA8b167RVmdsBdTnnLt98LYMvfq y3Fg4IVTo4ahpPvZSXP7vIWpfeMaRp42rBhHVqhyc7R/cY8bWmM5uqcsde20lwoMNDG6JG2fT 4on72nuUBM1TK4Ywgdqu7Sw73qLl456Zv7uJr4lBJ4ZWYqS9H+L3OnomsNVFZI7z1Dtsh+b X-Rspamd-Queue-Id: 4C0WC93cGxz4g6Y X-Spamd-Bar: +++ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of info@techism-uk.co.uk has no SPF policy when checking 212.227.17.24) smtp.mailfrom=info@techism-uk.co.uk X-Spamd-Result: default: False [3.17 / 15.00]; HAS_REPLYTO(0.00)[info@techism-uk.co.uk]; RCVD_VIA_SMTP_AUTH(0.00)[]; REPLYTO_ADDR_EQ_FROM(0.00)[]; TO_DN_NONE(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:+,3:~,4:~]; ASN(0.00)[asn:8560, ipnet:212.227.0.0/16, country:DE]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_SPAM_SHORT(0.94)[0.945]; MIME_GOOD(-0.10)[multipart/related,multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; AUTH_NA(1.00)[]; HAS_LIST_UNSUB(-0.01)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_SPAM_MEDIUM(0.58)[0.583]; DMARC_NA(0.00)[techism-uk.co.uk]; NEURAL_SPAM_LONG(0.75)[0.748]; RCVD_IN_DNSWL_NONE(0.00)[212.227.17.24:from]; R_SPF_NA(0.00)[no SPF record]; RWL_MAILSPIKE_POSSIBLE(0.00)[212.227.17.24:from]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[svn-src-all] Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Sep 2020 18:24:54 -0000 Hello, For all our clients and potential new clients we will be providing a c= ontactless IT collection service over the course of the next couple of= weeks. In line with the Covid-19 safe working practices. We will have our collections drivers available and we can collect all = the usual items, mobile phones, tablets, laptops, PCs, printers, plott= ers, monitors, hard drives, data tapes etc. Contactless collection slots will be made available to clients when th= ey require them at times and dates they choose so please don=E2=80=99t= hesitate to contact=20 FREE REMOVAL & COLLECTION: All removals and collections are absolutel= y free to schools, colleges, and other educational institutes!!!=20 Request a Collection At Techism IT, we undertake the secure, GDPR = compliant and environmentally friendly destruction and recycling of re= dundant business IT equipment. We can recycle ANYTHING in your office including: Monitors | TVs | IT Equipment, Servers, Laptops / Tablets, Mobile Pho= nes / Hard Disks, UPS Back-up / Battery Units, Cabling & Networking Eq= uipment, Photocopiers / Scanners / Fax Machines, Toners | Telephone Sy= stems | Paper Documentation | CD's, Air Conditioning Units, Racking an= d more... For further details on our services and pricing and to request your co= llection, tell us what you wish to recycle here and a member of our team will be in touch to provide a= competitive quotation and collection date.=20 Contact us = now to arr= ange a collection or call on 01753355555 to speak to one of our team =20 =20 office mailshot signature.png E : office@techism-it.com | www.techism-it.com | P : +44 0 1753 355 555 =20 =20 No Longer Want to receive future email? Please UNSUBSCRIBE here if you do not wi= sh to be contacted by us in future mailings. If for any reason link is not working simply reply with the subject = UNSUBSCRIBE Do not make any enquiries in reply, this email address is = not monitored From owner-svn-src-all@freebsd.org Mon Sep 28 22:10:09 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1D5B542CDBB; Mon, 28 Sep 2020 22:10:09 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C0cC501p4z3dHL; Mon, 28 Sep 2020 22:10:09 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D981324816; Mon, 28 Sep 2020 22:10:08 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08SMA8sO036450; Mon, 28 Sep 2020 22:10:08 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08SMA8sP036449; Mon, 28 Sep 2020 22:10:08 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <202009282210.08SMA8sP036449@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Mon, 28 Sep 2020 22:10:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366233 - stable/12/share/man/man4 X-SVN-Group: stable-12 X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: stable/12/share/man/man4 X-SVN-Commit-Revision: 366233 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Sep 2020 22:10:09 -0000 Author: 0mp (doc,ports committer) Date: Mon Sep 28 22:10:08 2020 New Revision: 366233 URL: https://svnweb.freebsd.org/changeset/base/366233 Log: MFC r364342: Use complete OIDs to avoid confusion Submitted by: otis_sk.freebsd.org Differential Revision: https://reviews.freebsd.org/D26098 Modified: stable/12/share/man/man4/bnxt.4 Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/bnxt.4 ============================================================================== --- stable/12/share/man/man4/bnxt.4 Mon Sep 28 17:32:18 2020 (r366232) +++ stable/12/share/man/man4/bnxt.4 Mon Sep 28 22:10:08 2020 (r366233) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 30, 2019 +.Dd August 18, 2020 .Dt BNXT 4 .Os .Sh NAME @@ -130,15 +130,15 @@ completion ring, and the size of the transmit ring res The completion ring should be at least twice the size of the transmit ring. These numbers must be powers of two, and zero means to use the default. Defaults to 0,0. -.It Va override_qs_enable +.It Va dev.bnxt.X.iflib.override_qs_enable When set, allows the number of transmit and receive queues to be different. If not set, the lower of the number of TX or RX queues will be used for both. -.It Va override_nrxqs +.It Va dev.bnxt.X.iflib.override_nrxqs Set the number of RX queues. If zero, the number of RX queues is derived from the number of cores on the socket connected to the controller. Defaults to 0. -.It Va override_ntxqs +.It Va dev.bnxt.X.iflib.override_ntxqs Set the number of TX queues. If zero, the number of TX queues is derived from the number of cores on the socket connected to the controller. From owner-svn-src-all@freebsd.org Mon Sep 28 22:11:33 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3786042CB67; Mon, 28 Sep 2020 22:11:33 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C0cDj0KY0z3dl7; Mon, 28 Sep 2020 22:11:33 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E2BB4247BE; Mon, 28 Sep 2020 22:11:32 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08SMBWMT040495; Mon, 28 Sep 2020 22:11:32 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08SMBWLK040494; Mon, 28 Sep 2020 22:11:32 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <202009282211.08SMBWLK040494@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Mon, 28 Sep 2020 22:11:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r366234 - stable/11/share/man/man4 X-SVN-Group: stable-11 X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: stable/11/share/man/man4 X-SVN-Commit-Revision: 366234 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Sep 2020 22:11:33 -0000 Author: 0mp (doc,ports committer) Date: Mon Sep 28 22:11:32 2020 New Revision: 366234 URL: https://svnweb.freebsd.org/changeset/base/366234 Log: MFC r364342: Use complete OIDs to avoid confusion Submitted by: otis_sk.freebsd.org Differential Revision: https://reviews.freebsd.org/D26098 Modified: stable/11/share/man/man4/bnxt.4 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/bnxt.4 ============================================================================== --- stable/11/share/man/man4/bnxt.4 Mon Sep 28 22:10:08 2020 (r366233) +++ stable/11/share/man/man4/bnxt.4 Mon Sep 28 22:11:32 2020 (r366234) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 9, 2017 +.Dd August 18, 2020 .Dt BNXT 4 .Os .Sh NAME @@ -129,15 +129,15 @@ completion ring, and the size of the transmit ring res The completion ring should be at least twice the size of the transmit ring. These numbers must be powers of two, and zero means to use the default. Defaults to 0,0. -.It Va override_qs_enable +.It Va dev.bnxt.X.iflib.override_qs_enable When set, allows the number of transmit and receive queues to be different. If not set, the lower of the number of TX or RX queues will be used for both. -.It Va override_nrxqs +.It Va dev.bnxt.X.iflib.override_nrxqs Set the number of RX queues. If zero, the number of RX queues is derived from the number of cores on the socket connected to the controller. Defaults to 0. -.It Va override_ntxqs +.It Va dev.bnxt.X.iflib.override_ntxqs Set the number of TX queues. If zero, the number of TX queues is derived from the number of cores on the socket connected to the controller. From owner-svn-src-all@freebsd.org Mon Sep 28 22:13:08 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C871642D024; Mon, 28 Sep 2020 22:13:08 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C0cGX4x6sz3f0r; Mon, 28 Sep 2020 22:13:08 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8C95A24C44; Mon, 28 Sep 2020 22:13:08 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08SMD8Iw042030; Mon, 28 Sep 2020 22:13:08 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08SMD8CV042029; Mon, 28 Sep 2020 22:13:08 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <202009282213.08SMD8CV042029@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Mon, 28 Sep 2020 22:13:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366235 - stable/12/share/man/man7 X-SVN-Group: stable-12 X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: stable/12/share/man/man7 X-SVN-Commit-Revision: 366235 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Sep 2020 22:13:08 -0000 Author: 0mp (doc,ports committer) Date: Mon Sep 28 22:13:07 2020 New Revision: 366235 URL: https://svnweb.freebsd.org/changeset/base/366235 Log: MFC r364387: Cross-reference development.7 and tests.7 Modified: stable/12/share/man/man7/development.7 stable/12/share/man/man7/tests.7 Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man7/development.7 ============================================================================== --- stable/12/share/man/man7/development.7 Mon Sep 28 22:11:32 2020 (r366234) +++ stable/12/share/man/man7/development.7 Mon Sep 28 22:13:07 2020 (r366235) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 23, 2020 +.Dd August 19, 2020 .Dt DEVELOPMENT 7 .Os .Sh NAME @@ -133,6 +133,7 @@ reboot .Xr build 7 , .Xr hier 7 , .Xr release 7 , +.Xr tests 7 , .Xr locking 9 , .Xr style 9 .Sh HISTORY Modified: stable/12/share/man/man7/tests.7 ============================================================================== --- stable/12/share/man/man7/tests.7 Mon Sep 28 22:11:32 2020 (r366234) +++ stable/12/share/man/man7/tests.7 Mon Sep 28 22:13:07 2020 (r366235) @@ -26,7 +26,7 @@ .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd August 21, 2017 +.Dd August 19, 2020 .Dt TESTS 7 .Os .Sh NAME @@ -222,7 +222,8 @@ Top-level test suite definition file. .El .Sh SEE ALSO .Xr kyua 1 , -.Xr build 7 +.Xr build 7 , +.Xr development 7 .Sh HISTORY The .Fx From owner-svn-src-all@freebsd.org Mon Sep 28 22:16:30 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7426E42D10E; Mon, 28 Sep 2020 22:16:30 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C0cLQ2Rsjz3dyL; Mon, 28 Sep 2020 22:16:30 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 33D9A2499A; Mon, 28 Sep 2020 22:16:30 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08SMGUxi042216; Mon, 28 Sep 2020 22:16:30 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08SMGTiL042215; Mon, 28 Sep 2020 22:16:29 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <202009282216.08SMGTiL042215@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Mon, 28 Sep 2020 22:16:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r366236 - stable/11/share/man/man7 X-SVN-Group: stable-11 X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: stable/11/share/man/man7 X-SVN-Commit-Revision: 366236 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Sep 2020 22:16:30 -0000 Author: 0mp (doc,ports committer) Date: Mon Sep 28 22:16:29 2020 New Revision: 366236 URL: https://svnweb.freebsd.org/changeset/base/366236 Log: MFC r364387: Cross-reference development.7 and tests.7 Modified: stable/11/share/man/man7/development.7 stable/11/share/man/man7/tests.7 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man7/development.7 ============================================================================== --- stable/11/share/man/man7/development.7 Mon Sep 28 22:13:07 2020 (r366235) +++ stable/11/share/man/man7/development.7 Mon Sep 28 22:16:29 2020 (r366236) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 7, 2013 +.Dd August 19, 2020 .Dt DEVELOPMENT 7 .Os .Sh NAME @@ -462,6 +462,7 @@ operations you do will be done as .Xr firewall 7 , .Xr release 7 , .Xr tuning 7 , +.Xr tests 7 , .Xr diskless 8 .Sh HISTORY The Modified: stable/11/share/man/man7/tests.7 ============================================================================== --- stable/11/share/man/man7/tests.7 Mon Sep 28 22:13:07 2020 (r366235) +++ stable/11/share/man/man7/tests.7 Mon Sep 28 22:16:29 2020 (r366236) @@ -26,7 +26,7 @@ .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd August 21, 2017 +.Dd August 19, 2020 .Dt TESTS 7 .Os .Sh NAME @@ -222,7 +222,8 @@ Top-level test suite definition file. .El .Sh SEE ALSO .Xr kyua 1 , -.Xr build 7 +.Xr build 7 , +.Xr development 7 .Sh HISTORY The .Fx From owner-svn-src-all@freebsd.org Tue Sep 29 00:20:59 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3A33D42EDAD; Tue, 29 Sep 2020 00:20:59 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C0g630qplz42Cg; Tue, 29 Sep 2020 00:20:59 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0059325C73; Tue, 29 Sep 2020 00:20:59 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08T0Kw07017503; Tue, 29 Sep 2020 00:20:58 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08T0KwF2017502; Tue, 29 Sep 2020 00:20:58 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009290020.08T0KwF2017502@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 29 Sep 2020 00:20:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366237 - head/usr.bin/procstat X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/usr.bin/procstat X-SVN-Commit-Revision: 366237 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Sep 2020 00:20:59 -0000 Author: kib Date: Tue Sep 29 00:20:58 2020 New Revision: 366237 URL: https://svnweb.freebsd.org/changeset/base/366237 Log: procstat: Fix regression after 365880. Basically it reverts one chunk that reversed the parsing logic, making legacy variants of invocation, like `procstat -a -f', non-operational. Reported and tested by: Dewayne Geraghty Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/usr.bin/procstat/procstat.c Modified: head/usr.bin/procstat/procstat.c ============================================================================== --- head/usr.bin/procstat/procstat.c Mon Sep 28 22:16:29 2020 (r366236) +++ head/usr.bin/procstat/procstat.c Tue Sep 29 00:20:58 2020 (r366237) @@ -425,9 +425,7 @@ main(int argc, char *argv[]) argc -= optind; argv += optind; - if (cmd == NULL && argv[0] != NULL) - cmd = getcmd(argv[0]); - if (cmd != NULL) { + if (cmd == NULL && argv[0] != NULL && (cmd = getcmd(argv[0])) != NULL) { if ((procstat_opts & PS_SUBCOMMAND_OPTS) != 0) usage(cmd); if (cmd->opt != NULL) { @@ -443,12 +441,13 @@ main(int argc, char *argv[]) argv += 1; } } else { - cmd = getcmd("basic"); + if (cmd == NULL) + cmd = getcmd("basic"); + if (cmd->cmd != procstat_files && + (procstat_opts & PS_OPT_CAPABILITIES) != 0 && + (cmd->cmp & PS_MODE_COMPAT) == 0) + usage(cmd); } - if (cmd->cmd != procstat_files && - (procstat_opts & PS_OPT_CAPABILITIES) != 0 && - (cmd->cmp & PS_MODE_COMPAT) == 0) - usage(cmd); /* Must specify either the -a flag or a list of pids. */ if (!(aflag == 1 && argc == 0) && !(aflag == 0 && argc > 0)) From owner-svn-src-all@freebsd.org Tue Sep 29 01:52:54 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4BA4E3F1DA8; Tue, 29 Sep 2020 01:52:54 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C0j861N7Mz47YR; Tue, 29 Sep 2020 01:52:54 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 13D3B272A9; Tue, 29 Sep 2020 01:52:54 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08T1qrvt076972; Tue, 29 Sep 2020 01:52:53 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08T1qr16076971; Tue, 29 Sep 2020 01:52:53 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <202009290152.08T1qr16076971@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Tue, 29 Sep 2020 01:52:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366238 - stable/12/sys/fs/nfsserver X-SVN-Group: stable-12 X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: stable/12/sys/fs/nfsserver X-SVN-Commit-Revision: 366238 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Sep 2020 01:52:54 -0000 Author: rmacklem Date: Tue Sep 29 01:52:53 2020 New Revision: 366238 URL: https://svnweb.freebsd.org/changeset/base/366238 Log: MFC: r366189 Bjorn reported a problem where the Linux NFSv4.1 client is using an open_to_lock_owner4 when that lock_owner4 has already been created by a previous open_to_lock_owner4. This caused the NFS server to reply NFSERR_INVAL. For NFSv4.0, this is an error, although the updated NFSv4.0 RFC7530 notes that the correct error reply is NFSERR_BADSEQID (RFC3530 did not specify what error to return). For NFSv4.1, it is not obvious whether or not this is allowed by RFC5661, but the NFSv4.1 server can handle this case without error. This patch changes the NFSv4.1 (and NFSv4.2) server to handle multiple uses of the same lock_owner in open_to_lock_owner so that it now correctly interoperates with the Linux NFS client. It also changes the error returned for NFSv4.0 to be NFSERR_BADSEQID. Thanks go to Bjorn for diagnosing this and testing the patch. He also provided a program that I could use to reproduce the problem. PR: 249567 Reported by: bf@cebitec.uni-bielefeld.de Modified: stable/12/sys/fs/nfsserver/nfs_nfsdstate.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- stable/12/sys/fs/nfsserver/nfs_nfsdstate.c Tue Sep 29 00:20:58 2020 (r366237) +++ stable/12/sys/fs/nfsserver/nfs_nfsdstate.c Tue Sep 29 01:52:53 2020 (r366238) @@ -1871,14 +1871,20 @@ tryagain: } if (!error) nfsrv_getowner(&stp->ls_open, new_stp, &lckstp); - if (lckstp) + if (lckstp) { /* - * I believe this should be an error, but it - * isn't obvious what NFSERR_xxx would be - * appropriate, so I'll use NFSERR_INVAL for now. + * For NFSv4.1 and NFSv4.2 allow an + * open_to_lock_owner when the lock_owner already + * exists. Just clear NFSLCK_OPENTOLOCK so that + * a new lock_owner will not be created. + * RFC7530 states that the error for NFSv4.0 + * is NFS4ERR_BAD_SEQID. */ - error = NFSERR_INVAL; - else + if ((nd->nd_flag & ND_NFSV41) != 0) + new_stp->ls_flags &= ~NFSLCK_OPENTOLOCK; + else + error = NFSERR_BADSEQID; + } else lckstp = new_stp; } else if (new_stp->ls_flags&(NFSLCK_LOCK|NFSLCK_UNLOCK)) { /* From owner-svn-src-all@freebsd.org Tue Sep 29 01:54:05 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 73C483F2002; Tue, 29 Sep 2020 01:54:05 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C0j9T2YDTz47hN; Tue, 29 Sep 2020 01:54:05 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3C0162721E; Tue, 29 Sep 2020 01:54:05 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08T1s53X077088; Tue, 29 Sep 2020 01:54:05 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08T1s5Fu077087; Tue, 29 Sep 2020 01:54:05 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202009290154.08T1s5Fu077087@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 29 Sep 2020 01:54:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366239 - stable/12/libexec/tftpd X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/libexec/tftpd X-SVN-Commit-Revision: 366239 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Sep 2020 01:54:05 -0000 Author: markj Date: Tue Sep 29 01:54:04 2020 New Revision: 366239 URL: https://svnweb.freebsd.org/changeset/base/366239 Log: MFC r366002: tftpd: Check for errors from chdir() Modified: stable/12/libexec/tftpd/tftpd.c Directory Properties: stable/12/ (props changed) Modified: stable/12/libexec/tftpd/tftpd.c ============================================================================== --- stable/12/libexec/tftpd/tftpd.c Tue Sep 29 01:52:53 2020 (r366238) +++ stable/12/libexec/tftpd/tftpd.c Tue Sep 29 01:54:04 2020 (r366239) @@ -373,7 +373,10 @@ main(int argc, char *argv[]) chroot_dir, strerror(errno)); exit(1); } - chdir("/"); + if (chdir("/") != 0) { + tftp_log(LOG_ERR, "chdir: %s", strerror(errno)); + exit(1); + } if (setgroups(1, &nobody->pw_gid) != 0) { tftp_log(LOG_ERR, "setgroups failed"); exit(1); From owner-svn-src-all@freebsd.org Tue Sep 29 01:56:22 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8BAC73F1FF2; Tue, 29 Sep 2020 01:56:22 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C0jD639Qkz47p3; Tue, 29 Sep 2020 01:56:22 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5051C27505; Tue, 29 Sep 2020 01:56:22 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08T1uMTt077277; Tue, 29 Sep 2020 01:56:22 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08T1uMVe077276; Tue, 29 Sep 2020 01:56:22 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202009290156.08T1uMVe077276@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 29 Sep 2020 01:56:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366240 - stable/12/libexec/ftpd X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/libexec/ftpd X-SVN-Commit-Revision: 366240 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Sep 2020 01:56:22 -0000 Author: markj Date: Tue Sep 29 01:56:21 2020 New Revision: 366240 URL: https://svnweb.freebsd.org/changeset/base/366240 Log: MFC r366003: ftpd: Add missing braces around a statfd check Modified: stable/12/libexec/ftpd/ftpd.c Directory Properties: stable/12/ (props changed) Modified: stable/12/libexec/ftpd/ftpd.c ============================================================================== --- stable/12/libexec/ftpd/ftpd.c Tue Sep 29 01:54:04 2020 (r366239) +++ stable/12/libexec/ftpd/ftpd.c Tue Sep 29 01:56:21 2020 (r366240) @@ -1530,7 +1530,7 @@ skip: setusercontext(lc, pw, 0, LOGIN_SETRESOURCES); #endif - if (guest && stats && statfd < 0) + if (guest && stats && statfd < 0) { #ifdef VIRTUAL_HOSTING statfd = open(thishost->statfile, O_WRONLY|O_APPEND); #else @@ -1538,6 +1538,7 @@ skip: #endif if (statfd < 0) stats = 0; + } /* * For a chrooted local user, From owner-svn-src-all@freebsd.org Tue Sep 29 02:03:25 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 55AEF3F2350; Tue, 29 Sep 2020 02:03:25 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C0jNF1bnwz48tZ; Tue, 29 Sep 2020 02:03:25 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1B03D2751D; Tue, 29 Sep 2020 02:03:25 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08T23OTG083473; Tue, 29 Sep 2020 02:03:24 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08T23OrV083472; Tue, 29 Sep 2020 02:03:24 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <202009290203.08T23OrV083472@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Tue, 29 Sep 2020 02:03:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r366241 - stable/11/sys/fs/nfsserver X-SVN-Group: stable-11 X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: stable/11/sys/fs/nfsserver X-SVN-Commit-Revision: 366241 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Sep 2020 02:03:25 -0000 Author: rmacklem Date: Tue Sep 29 02:03:24 2020 New Revision: 366241 URL: https://svnweb.freebsd.org/changeset/base/366241 Log: MFC: r366189 Bjorn reported a problem where the Linux NFSv4.1 client is using an open_to_lock_owner4 when that lock_owner4 has already been created by a previous open_to_lock_owner4. This caused the NFS server to reply NFSERR_INVAL. For NFSv4.0, this is an error, although the updated NFSv4.0 RFC7530 notes that the correct error reply is NFSERR_BADSEQID (RFC3530 did not specify what error to return). For NFSv4.1, it is not obvious whether or not this is allowed by RFC5661, but the NFSv4.1 server can handle this case without error. This patch changes the NFSv4.1 (and NFSv4.2) server to handle multiple uses of the same lock_owner in open_to_lock_owner so that it now correctly interoperates with the Linux NFS client. It also changes the error returned for NFSv4.0 to be NFSERR_BADSEQID. Thanks go to Bjorn for diagnosing this and testing the patch. He also provided a program that I could use to reproduce the problem. PR: 249567 Reported by: bf@cebitec.uni-bielefeld.de Modified: stable/11/sys/fs/nfsserver/nfs_nfsdstate.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- stable/11/sys/fs/nfsserver/nfs_nfsdstate.c Tue Sep 29 01:56:21 2020 (r366240) +++ stable/11/sys/fs/nfsserver/nfs_nfsdstate.c Tue Sep 29 02:03:24 2020 (r366241) @@ -1799,14 +1799,20 @@ tryagain: } if (!error) nfsrv_getowner(&stp->ls_open, new_stp, &lckstp); - if (lckstp) + if (lckstp) { /* - * I believe this should be an error, but it - * isn't obvious what NFSERR_xxx would be - * appropriate, so I'll use NFSERR_INVAL for now. + * For NFSv4.1 and NFSv4.2 allow an + * open_to_lock_owner when the lock_owner already + * exists. Just clear NFSLCK_OPENTOLOCK so that + * a new lock_owner will not be created. + * RFC7530 states that the error for NFSv4.0 + * is NFS4ERR_BAD_SEQID. */ - error = NFSERR_INVAL; - else + if ((nd->nd_flag & ND_NFSV41) != 0) + new_stp->ls_flags &= ~NFSLCK_OPENTOLOCK; + else + error = NFSERR_BADSEQID; + } else lckstp = new_stp; } else if (new_stp->ls_flags&(NFSLCK_LOCK|NFSLCK_UNLOCK)) { /* From owner-svn-src-all@freebsd.org Tue Sep 29 05:08:45 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EC5263F5CBD; Tue, 29 Sep 2020 05:08:45 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C0nV55yXsz4JxV; Tue, 29 Sep 2020 05:08:45 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AFD87986C; Tue, 29 Sep 2020 05:08:45 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08T58j56095397; Tue, 29 Sep 2020 05:08:45 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08T58jN9095396; Tue, 29 Sep 2020 05:08:45 GMT (envelope-from np@FreeBSD.org) Message-Id: <202009290508.08T58jN9095396@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 29 Sep 2020 05:08:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366242 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 366242 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Sep 2020 05:08:46 -0000 Author: np Date: Tue Sep 29 05:08:45 2020 New Revision: 366242 URL: https://svnweb.freebsd.org/changeset/base/366242 Log: cxgbe(4): fixes for netmap operation with only some queues active. - Only active netmap receive queues should be in the RSS lookup table. - The RSS table should be restored for NIC operation when the last active netmap queue is switched off, not the first one. - Support repeated netmap ON/OFF on a subset of the queues. This works whether the the queues being enabled and disabled are the only ones active or not. Some kring indexes have to be reset in the driver for the second case. MFC after: 1 week Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_netmap.c Modified: head/sys/dev/cxgbe/t4_netmap.c ============================================================================== --- head/sys/dev/cxgbe/t4_netmap.c Tue Sep 29 02:03:24 2020 (r366241) +++ head/sys/dev/cxgbe/t4_netmap.c Tue Sep 29 05:08:45 2020 (r366242) @@ -347,6 +347,180 @@ free_nm_txq_hwq(struct vi_info *vi, struct sge_nm_txq } static int +cxgbe_netmap_simple_rss(struct adapter *sc, struct vi_info *vi, + struct ifnet *ifp, struct netmap_adapter *na) +{ + struct netmap_kring *kring; + struct sge_nm_rxq *nm_rxq; + int rc, i, j, nm_state, defq; + uint16_t *rss; + + /* + * Check if there's at least one active (or about to go active) netmap + * rx queue. + */ + defq = -1; + for_each_nm_rxq(vi, j, nm_rxq) { + nm_state = atomic_load_int(&nm_rxq->nm_state); + kring = na->rx_rings[nm_rxq->nid]; + if ((nm_state != NM_OFF && !nm_kring_pending_off(kring)) || + (nm_state == NM_OFF && nm_kring_pending_on(kring))) { + MPASS(nm_rxq->iq_cntxt_id != INVALID_NM_RXQ_CNTXT_ID); + if (defq == -1) { + defq = nm_rxq->iq_abs_id; + break; + } + } + } + + if (defq == -1) { + /* No active netmap queues. Switch back to NIC queues. */ + rss = vi->rss; + defq = vi->rss[0]; + } else { + for (i = 0; i < vi->rss_size;) { + for_each_nm_rxq(vi, j, nm_rxq) { + nm_state = atomic_load_int(&nm_rxq->nm_state); + kring = na->rx_rings[nm_rxq->nid]; + if ((nm_state != NM_OFF && + !nm_kring_pending_off(kring)) || + (nm_state == NM_OFF && + nm_kring_pending_on(kring))) { + MPASS(nm_rxq->iq_cntxt_id != + INVALID_NM_RXQ_CNTXT_ID); + vi->nm_rss[i++] = nm_rxq->iq_abs_id; + if (i == vi->rss_size) + break; + } + } + } + rss = vi->nm_rss; + } + + rc = -t4_config_rss_range(sc, sc->mbox, vi->viid, 0, vi->rss_size, rss, + vi->rss_size); + if (rc != 0) + if_printf(ifp, "netmap rss_config failed: %d\n", rc); + + rc = -t4_config_vi_rss(sc, sc->mbox, vi->viid, vi->hashen, defq, 0, 0); + if (rc != 0) { + if_printf(ifp, "netmap defaultq config failed: %d\n", rc); + } + + return (rc); +} + +/* + * Odd number of rx queues work best for split RSS mode as the first queue can + * be dedicated for non-RSS traffic and the rest divided into two equal halves. + */ +static int +cxgbe_netmap_split_rss(struct adapter *sc, struct vi_info *vi, + struct ifnet *ifp, struct netmap_adapter *na) +{ + struct netmap_kring *kring; + struct sge_nm_rxq *nm_rxq; + int rc, i, j, nm_state, defq; + int nactive[2] = {0, 0}; + int dq[2] = {-1, -1}; + bool dq_norss; /* default queue should not be in RSS table. */ + + MPASS(nm_split_rss != 0); + MPASS(vi->nnmrxq > 1); + + for_each_nm_rxq(vi, i, nm_rxq) { + j = i / ((vi->nnmrxq + 1) / 2); + nm_state = atomic_load_int(&nm_rxq->nm_state); + kring = na->rx_rings[nm_rxq->nid]; + if ((nm_state != NM_OFF && !nm_kring_pending_off(kring)) || + (nm_state == NM_OFF && nm_kring_pending_on(kring))) { + MPASS(nm_rxq->iq_cntxt_id != INVALID_NM_RXQ_CNTXT_ID); + nactive[j]++; + if (dq[j] == -1) { + dq[j] = nm_rxq->iq_abs_id; + break; + } + } + } + + if (nactive[0] == 0 || nactive[1] == 0) + return (cxgbe_netmap_simple_rss(sc, vi, ifp, na)); + + MPASS(dq[0] != -1 && dq[1] != -1); + if (nactive[0] > nactive[1]) { + defq = dq[0]; + dq_norss = true; + } else if (nactive[0] < nactive[1]) { + defq = dq[1]; + dq_norss = true; + } else { + defq = dq[0]; + dq_norss = false; + } + + i = 0; + nm_rxq = &sc->sge.nm_rxq[vi->first_nm_rxq]; + while (i < vi->rss_size / 2) { + for (j = 0; j < (vi->nnmrxq + 1) / 2; j++) { + nm_state = atomic_load_int(&nm_rxq[j].nm_state); + kring = na->rx_rings[nm_rxq[j].nid]; + if ((nm_state == NM_OFF && + !nm_kring_pending_on(kring)) || + (nm_state == NM_ON && + nm_kring_pending_off(kring))) { + continue; + } + MPASS(nm_rxq[j].iq_cntxt_id != INVALID_NM_RXQ_CNTXT_ID); + if (dq_norss && defq == nm_rxq[j].iq_abs_id) + continue; + vi->nm_rss[i++] = nm_rxq[j].iq_abs_id; + if (i == vi->rss_size / 2) + break; + } + } + while (i < vi->rss_size) { + for (j = (vi->nnmrxq + 1) / 2; j < vi->nnmrxq; j++) { + nm_state = atomic_load_int(&nm_rxq[j].nm_state); + kring = na->rx_rings[nm_rxq[j].nid]; + if ((nm_state == NM_OFF && + !nm_kring_pending_on(kring)) || + (nm_state == NM_ON && + nm_kring_pending_off(kring))) { + continue; + } + MPASS(nm_rxq[j].iq_cntxt_id != INVALID_NM_RXQ_CNTXT_ID); + if (dq_norss && defq == nm_rxq[j].iq_abs_id) + continue; + vi->nm_rss[i++] = nm_rxq[j].iq_abs_id; + if (i == vi->rss_size) + break; + } + } + + rc = -t4_config_rss_range(sc, sc->mbox, vi->viid, 0, vi->rss_size, + vi->nm_rss, vi->rss_size); + if (rc != 0) + if_printf(ifp, "netmap split_rss_config failed: %d\n", rc); + + rc = -t4_config_vi_rss(sc, sc->mbox, vi->viid, vi->hashen, defq, 0, 0); + if (rc != 0) + if_printf(ifp, "netmap defaultq config failed: %d\n", rc); + + return (rc); +} + +static inline int +cxgbe_netmap_rss(struct adapter *sc, struct vi_info *vi, struct ifnet *ifp, + struct netmap_adapter *na) +{ + + if (nm_split_rss == 0 || vi->nnmrxq == 1) + return (cxgbe_netmap_simple_rss(sc, vi, ifp, na)); + else + return (cxgbe_netmap_split_rss(sc, vi, ifp, na)); +} + +static int cxgbe_netmap_on(struct adapter *sc, struct vi_info *vi, struct ifnet *ifp, struct netmap_adapter *na) { @@ -354,10 +528,12 @@ cxgbe_netmap_on(struct adapter *sc, struct vi_info *vi struct netmap_kring *kring; struct sge_nm_rxq *nm_rxq; struct sge_nm_txq *nm_txq; - int rc, i, j, hwidx, defq, nrssq; + int i, j, hwidx; struct rx_buf_info *rxb; ASSERT_SYNCHRONIZED_OP(sc); + MPASS(vi->nnmrxq > 0); + MPASS(vi->nnmtxq > 0); if ((vi->flags & VI_INIT_DONE) == 0 || (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) @@ -430,72 +606,7 @@ cxgbe_netmap_on(struct adapter *sc, struct vi_info *vi M_ZERO | M_WAITOK); } - MPASS(vi->nnmrxq > 0); - if (nm_split_rss == 0 || vi->nnmrxq == 1) { - for (i = 0; i < vi->rss_size;) { - for_each_nm_rxq(vi, j, nm_rxq) { - vi->nm_rss[i++] = nm_rxq->iq_abs_id; - if (i == vi->rss_size) - break; - } - } - defq = vi->nm_rss[0]; - } else { - /* We have multiple queues and we want to split the table. */ - MPASS(nm_split_rss != 0); - MPASS(vi->nnmrxq > 1); - - nm_rxq = &sc->sge.nm_rxq[vi->first_nm_rxq]; - nrssq = vi->nnmrxq; - if (vi->nnmrxq & 1) { - /* - * Odd number of queues. The first rxq is designated the - * default queue, the rest are split evenly. - */ - defq = nm_rxq->iq_abs_id; - nm_rxq++; - nrssq--; - } else { - /* - * Even number of queues split into two halves. The - * first rxq in one of the halves is designated the - * default queue. - */ -#if 1 - /* First rxq in the first half. */ - defq = nm_rxq->iq_abs_id; -#else - /* First rxq in the second half. */ - defq = nm_rxq[vi->nnmrxq / 2].iq_abs_id; -#endif - } - - i = 0; - while (i < vi->rss_size / 2) { - for (j = 0; j < nrssq / 2; j++) { - vi->nm_rss[i++] = nm_rxq[j].iq_abs_id; - if (i == vi->rss_size / 2) - break; - } - } - while (i < vi->rss_size) { - for (j = nrssq / 2; j < nrssq; j++) { - vi->nm_rss[i++] = nm_rxq[j].iq_abs_id; - if (i == vi->rss_size) - break; - } - } - } - rc = -t4_config_rss_range(sc, sc->mbox, vi->viid, 0, vi->rss_size, - vi->nm_rss, vi->rss_size); - if (rc != 0) - if_printf(ifp, "netmap rss_config failed: %d\n", rc); - - rc = -t4_config_vi_rss(sc, sc->mbox, vi->viid, vi->hashen, defq, 0, 0); - if (rc != 0) - if_printf(ifp, "netmap rss hash/defaultq config failed: %d\n", rc); - - return (rc); + return (cxgbe_netmap_rss(sc, vi, ifp, na)); } static int @@ -503,11 +614,13 @@ cxgbe_netmap_off(struct adapter *sc, struct vi_info *v struct netmap_adapter *na) { struct netmap_kring *kring; - int rc, i; + int rc, i, nm_state, nactive; struct sge_nm_txq *nm_txq; struct sge_nm_rxq *nm_rxq; ASSERT_SYNCHRONIZED_OP(sc); + MPASS(vi->nnmrxq > 0); + MPASS(vi->nnmtxq > 0); if (!nm_netmap_on(na)) return (0); @@ -515,14 +628,10 @@ cxgbe_netmap_off(struct adapter *sc, struct vi_info *v if ((vi->flags & VI_INIT_DONE) == 0) return (0); - rc = -t4_config_rss_range(sc, sc->mbox, vi->viid, 0, vi->rss_size, - vi->rss, vi->rss_size); + /* First remove the queues that are stopping from the RSS table. */ + rc = cxgbe_netmap_rss(sc, vi, ifp, na); if (rc != 0) - if_printf(ifp, "failed to restore RSS config: %d\n", rc); - rc = -t4_config_vi_rss(sc, sc->mbox, vi->viid, vi->hashen, vi->rss[0], 0, 0); - if (rc != 0) - if_printf(ifp, "failed to restore RSS hash/defaultq: %d\n", rc); - nm_clear_native_flags(na); + return (rc); /* error message logged already. */ for_each_nm_txq(vi, i, nm_txq) { struct sge_qstat *spg = (void *)&nm_txq->desc[nm_txq->sidx]; @@ -541,18 +650,33 @@ cxgbe_netmap_off(struct adapter *sc, struct vi_info *v pause("nmcidx", 1); free_nm_txq_hwq(vi, nm_txq); + + /* XXX: netmap, not the driver, should do this. */ + kring->rhead = kring->rcur = kring->nr_hwcur = 0; + kring->rtail = kring->nr_hwtail = kring->nkr_num_slots - 1; } + nactive = 0; for_each_nm_rxq(vi, i, nm_rxq) { + nm_state = atomic_load_int(&nm_rxq->nm_state); kring = na->rx_rings[nm_rxq->nid]; - if (!nm_kring_pending_off(kring) || - nm_rxq->iq_cntxt_id == INVALID_NM_RXQ_CNTXT_ID) + if (nm_state != NM_OFF && !nm_kring_pending_off(kring)) + nactive++; + if (nm_state == NM_OFF || !nm_kring_pending_off(kring)) continue; + MPASS(nm_rxq->iq_cntxt_id != INVALID_NM_RXQ_CNTXT_ID); while (!atomic_cmpset_int(&nm_rxq->nm_state, NM_ON, NM_OFF)) pause("nmst", 1); free_nm_rxq_hwq(vi, nm_rxq); + + /* XXX: netmap, not the driver, should do this. */ + kring->rhead = kring->rcur = kring->nr_hwcur = 0; + kring->rtail = kring->nr_hwtail = 0; } + netmap_krings_mode_commit(na, 0); + if (nactive == 0) + nm_clear_native_flags(na); return (rc); } From owner-svn-src-all@freebsd.org Tue Sep 29 05:49:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4667A3F694E; Tue, 29 Sep 2020 05:49:46 +0000 (UTC) (envelope-from grog@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C0pPQ156Mz4LMv; Tue, 29 Sep 2020 05:49:46 +0000 (UTC) (envelope-from grog@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 09D30A0F1; Tue, 29 Sep 2020 05:49:46 +0000 (UTC) (envelope-from grog@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08T5njpk019806; Tue, 29 Sep 2020 05:49:45 GMT (envelope-from grog@FreeBSD.org) Received: (from grog@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08T5njSN019805; Tue, 29 Sep 2020 05:49:45 GMT (envelope-from grog@FreeBSD.org) Message-Id: <202009290549.08T5njSN019805@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: grog set sender to grog@FreeBSD.org using -f From: Greg Lehey Date: Tue, 29 Sep 2020 05:49:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366243 - head/usr.bin/calendar X-SVN-Group: head X-SVN-Commit-Author: grog X-SVN-Commit-Paths: head/usr.bin/calendar X-SVN-Commit-Revision: 366243 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Sep 2020 05:49:46 -0000 Author: grog Date: Tue Sep 29 05:49:45 2020 New Revision: 366243 URL: https://svnweb.freebsd.org/changeset/base/366243 Log: Document the fact (bug?) that the -a option will normally process root's calendar files three times, once each for root, toor and daemon. This relates to bug 246943, but does not solve it. See discussion in bug report for more details. PR: 246943 Reported by: wcarson.bugzilla@disillusion.net Modified: head/usr.bin/calendar/calendar.1 Modified: head/usr.bin/calendar/calendar.1 ============================================================================== --- head/usr.bin/calendar/calendar.1 Tue Sep 29 05:08:45 2020 (r366242) +++ head/usr.bin/calendar/calendar.1 Tue Sep 29 05:49:45 2020 (r366243) @@ -70,9 +70,24 @@ Print lines from today and the next .Ar num days (forward, future). .It Fl a -Process the ``calendar'' files of all users and mail the results +Process the ``calendar'' files for users found in +.Pa /etc/passwd +and mail the results to them. -This requires super-user privileges. +This can result in multiple messages for specific files, since +.Pa /etc/passwd +does not require home directories to be unique. +In particular, by default +.Ar root , +.Ar toor +and +.Ar daemon +share the same home directory. +If this directory contains calendar information, +.Nm +will process the file three times. +.Pp +This option requires super-user privileges. .It Fl B Ar num Print lines from today and the previous .Ar num From owner-svn-src-all@freebsd.org Tue Sep 29 07:36:21 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CC8403F87A3; Tue, 29 Sep 2020 07:36:21 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C0rmP4vH4z4PwQ; Tue, 29 Sep 2020 07:36:21 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8B5EFAE6C; Tue, 29 Sep 2020 07:36:21 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08T7aLxi086720; Tue, 29 Sep 2020 07:36:21 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08T7aLjh086719; Tue, 29 Sep 2020 07:36:21 GMT (envelope-from np@FreeBSD.org) Message-Id: <202009290736.08T7aLjh086719@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 29 Sep 2020 07:36:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366244 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 366244 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Sep 2020 07:36:21 -0000 Author: np Date: Tue Sep 29 07:36:21 2020 New Revision: 366244 URL: https://svnweb.freebsd.org/changeset/base/366244 Log: cxgbe(4): display an error message when netmap cannot be enabled because the interface is down. MFC after: 1 week Modified: head/sys/dev/cxgbe/t4_netmap.c Modified: head/sys/dev/cxgbe/t4_netmap.c ============================================================================== --- head/sys/dev/cxgbe/t4_netmap.c Tue Sep 29 05:49:45 2020 (r366243) +++ head/sys/dev/cxgbe/t4_netmap.c Tue Sep 29 07:36:21 2020 (r366244) @@ -536,8 +536,11 @@ cxgbe_netmap_on(struct adapter *sc, struct vi_info *vi MPASS(vi->nnmtxq > 0); if ((vi->flags & VI_INIT_DONE) == 0 || - (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { + if_printf(ifp, "cannot enable netmap operation because " + "interface is not UP.\n"); return (EAGAIN); + } rxb = &sc->sge.rx_buf_info[0]; for (i = 0; i < SW_ZONE_SIZES; i++, rxb++) { From owner-svn-src-all@freebsd.org Tue Sep 29 07:51:07 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8FAC63F89DD; Tue, 29 Sep 2020 07:51:07 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C0s5R3Jj8z4Qv8; Tue, 29 Sep 2020 07:51:07 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 556E9B43B; Tue, 29 Sep 2020 07:51:07 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08T7p7Se094880; Tue, 29 Sep 2020 07:51:07 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08T7p7gM094878; Tue, 29 Sep 2020 07:51:07 GMT (envelope-from np@FreeBSD.org) Message-Id: <202009290751.08T7p7gM094878@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 29 Sep 2020 07:51:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366245 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 366245 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Sep 2020 07:51:07 -0000 Author: np Date: Tue Sep 29 07:51:06 2020 New Revision: 366245 URL: https://svnweb.freebsd.org/changeset/base/366245 Log: cxgbe(4): adjust the doorbell threshold for netmap freelists to match the maximum burst size used when fetching descriptors from the list. MFC after: 1 week Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/t4_netmap.c Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Tue Sep 29 07:36:21 2020 (r366244) +++ head/sys/dev/cxgbe/adapter.h Tue Sep 29 07:51:06 2020 (r366245) @@ -730,6 +730,7 @@ struct sge_nm_rxq { uint32_t fl_sidx2; /* copy of fl_sidx */ uint32_t fl_db_val; u_int fl_db_saved; + u_int fl_db_threshold; /* in descriptors */ u_int fl_hwidx:4; /* Modified: head/sys/dev/cxgbe/t4_netmap.c ============================================================================== --- head/sys/dev/cxgbe/t4_netmap.c Tue Sep 29 07:36:21 2020 (r366244) +++ head/sys/dev/cxgbe/t4_netmap.c Tue Sep 29 07:51:06 2020 (r366245) @@ -196,6 +196,9 @@ alloc_nm_rxq_hwq(struct vi_info *vi, struct sge_nm_rxq nm_rxq->fl_cntxt_id = be16toh(c.fl0id); nm_rxq->fl_pidx = nm_rxq->fl_cidx = 0; + nm_rxq->fl_db_saved = 0; + /* matches the X_FETCHBURSTMAX_512B or X_FETCHBURSTMAX_256B above. */ + nm_rxq->fl_db_threshold = chip_id(sc) <= CHELSIO_T5 ? 8 : 4; MPASS(nm_rxq->fl_sidx == na->num_rx_desc); cntxt_id = nm_rxq->fl_cntxt_id - sc->sge.eq_start; if (cntxt_id >= sc->sge.neq) { @@ -1063,7 +1066,7 @@ cxgbe_netmap_rxsync(struct netmap_kring *kring, int fl fl_pidx = 0; slot = &ring->slot[0]; } - if (++dbinc == 8 && n >= 32) { + if (++dbinc == nm_rxq->fl_db_threshold) { wmb(); if (starve_fl) nm_rxq->fl_db_saved += dbinc; From owner-svn-src-all@freebsd.org Tue Sep 29 09:11:52 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0DE623FA7F9; Tue, 29 Sep 2020 09:11:52 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C0ttb6dsBz4VcB; Tue, 29 Sep 2020 09:11:51 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C75ADC454; Tue, 29 Sep 2020 09:11:51 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08T9BpuX048138; Tue, 29 Sep 2020 09:11:51 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08T9BpNC048137; Tue, 29 Sep 2020 09:11:51 GMT (envelope-from np@FreeBSD.org) Message-Id: <202009290911.08T9BpNC048137@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 29 Sep 2020 09:11:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366246 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 366246 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Sep 2020 09:11:52 -0000 Author: np Date: Tue Sep 29 09:11:51 2020 New Revision: 366246 URL: https://svnweb.freebsd.org/changeset/base/366246 Log: Remove duplicate line. Modified: head/sys/dev/cxgbe/t4_netmap.c Modified: head/sys/dev/cxgbe/t4_netmap.c ============================================================================== --- head/sys/dev/cxgbe/t4_netmap.c Tue Sep 29 07:51:06 2020 (r366245) +++ head/sys/dev/cxgbe/t4_netmap.c Tue Sep 29 09:11:51 2020 (r366246) @@ -216,9 +216,6 @@ alloc_nm_rxq_hwq(struct vi_info *vi, struct sge_nm_rxq param = V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_DMAQ) | V_FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DMAQ_CONM_CTXT) | V_FW_PARAMS_PARAM_YZ(nm_rxq->iq_cntxt_id); - param = V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_DMAQ) | - V_FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DMAQ_CONM_CTXT) | - V_FW_PARAMS_PARAM_YZ(nm_rxq->iq_cntxt_id); if (cong == 0) val = 1 << 19; else { From owner-svn-src-all@freebsd.org Tue Sep 29 09:25:52 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E32493FB065; Tue, 29 Sep 2020 09:25:52 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C0vBm5j5Hz4WGy; Tue, 29 Sep 2020 09:25:52 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A6B7FC4E6; Tue, 29 Sep 2020 09:25:52 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08T9PqqM055302; Tue, 29 Sep 2020 09:25:52 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08T9PqJP055301; Tue, 29 Sep 2020 09:25:52 GMT (envelope-from np@FreeBSD.org) Message-Id: <202009290925.08T9PqJP055301@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 29 Sep 2020 09:25:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366247 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 366247 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Sep 2020 09:25:53 -0000 Author: np Date: Tue Sep 29 09:25:52 2020 New Revision: 366247 URL: https://svnweb.freebsd.org/changeset/base/366247 Log: cxgbe(4): Avoid unnecessary work in the firmware during netmap tx. Bind the netmap tx queues to a special '0xff' scheduling class which makes the firmware skip some processing related to rate limiting on the outgoing traffic. Future firmwares will do this automatically. MFC after: 1 week Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_netmap.c Modified: head/sys/dev/cxgbe/t4_netmap.c ============================================================================== --- head/sys/dev/cxgbe/t4_netmap.c Tue Sep 29 09:11:51 2020 (r366246) +++ head/sys/dev/cxgbe/t4_netmap.c Tue Sep 29 09:25:52 2020 (r366247) @@ -329,6 +329,22 @@ alloc_nm_txq_hwq(struct vi_info *vi, struct sge_nm_txq nm_txq->udb = (volatile void *)udb; } + if (sc->params.fw_vers < FW_VERSION32(1, 25, 1, 0)) { + uint32_t param, val; + + param = V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_DMAQ) | + V_FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DMAQ_EQ_SCHEDCLASS_ETH) | + V_FW_PARAMS_PARAM_YZ(nm_txq->cntxt_id); + val = 0xff; + rc = -t4_set_params(sc, sc->mbox, sc->pf, 0, 1, ¶m, &val); + if (rc != 0) { + device_printf(vi->dev, + "failed to bind netmap txq %d to class 0xff: %d\n", + nm_txq->cntxt_id, rc); + rc = 0; + } + } + return (rc); } From owner-svn-src-all@freebsd.org Tue Sep 29 09:36:07 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A00003FB236; Tue, 29 Sep 2020 09:36:07 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C0vQb3nMjz4X35; Tue, 29 Sep 2020 09:36:07 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 657DDC9D3; Tue, 29 Sep 2020 09:36:07 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08T9a7bw062089; Tue, 29 Sep 2020 09:36:07 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08T9a7vv062087; Tue, 29 Sep 2020 09:36:07 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202009290936.08T9a7vv062087@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 29 Sep 2020 09:36:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366248 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 366248 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Sep 2020 09:36:07 -0000 Author: tuexen Date: Tue Sep 29 09:36:06 2020 New Revision: 366248 URL: https://svnweb.freebsd.org/changeset/base/366248 Log: Improve the input validation and processing of cookies. This avoids setting the association in an inconsistent state, which could result in a use-after-free situation. This can be triggered by a malicious peer, if the peer can modify the cookie without the local endpoint recognizing it. Thanks to Ned Williamson for reporting the issue. MFC after: 3 days Modified: head/sys/netinet/sctp_input.c head/sys/netinet/sctp_pcb.c Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Tue Sep 29 09:25:52 2020 (r366247) +++ head/sys/netinet/sctp_input.c Tue Sep 29 09:36:06 2020 (r366248) @@ -2032,10 +2032,6 @@ sctp_process_cookie_new(struct mbuf *m, int iphlen, in vrf_id, port); return (NULL); } - /* get the correct sctp_nets */ - if (netp) - *netp = sctp_findnet(stcb, init_src); - asoc = &stcb->asoc; /* get scope variables out of cookie */ asoc->scope.ipv4_local_scope = cookie->ipv4_scope; @@ -2074,10 +2070,7 @@ sctp_process_cookie_new(struct mbuf *m, int iphlen, in asoc->advanced_peer_ack_point = asoc->last_acked_seq; /* process the INIT info (peer's info) */ - if (netp) - retval = sctp_process_init(init_cp, stcb); - else - retval = 0; + retval = sctp_process_init(init_cp, stcb); if (retval < 0) { (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_19); @@ -2191,19 +2184,21 @@ sctp_process_cookie_new(struct mbuf *m, int iphlen, in */ ; } - /* since we did not send a HB make sure we don't double things */ - if ((netp) && (*netp)) - (*netp)->hb_responded = 1; - if (stcb->asoc.sctp_autoclose_ticks && sctp_is_feature_on(inp, SCTP_PCB_FLAGS_AUTOCLOSE)) { sctp_timer_start(SCTP_TIMER_TYPE_AUTOCLOSE, inp, stcb, NULL); } (void)SCTP_GETTIME_TIMEVAL(&stcb->asoc.time_entered); - if ((netp != NULL) && (*netp != NULL)) { + *netp = sctp_findnet(stcb, init_src); + if (*netp != NULL) { struct timeval old; - /* calculate the RTT and set the encaps port */ + /* + * Since we did not send a HB, make sure we don't double + * things. + */ + (*netp)->hb_responded = 1; + /* Calculate the RTT. */ old.tv_sec = cookie->time_entered.tv_sec; old.tv_usec = cookie->time_entered.tv_usec; sctp_calculate_rto(stcb, asoc, *netp, &old, SCTP_RTT_FROM_NON_DATA); Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Tue Sep 29 09:25:52 2020 (r366247) +++ head/sys/netinet/sctp_pcb.c Tue Sep 29 09:36:06 2020 (r366248) @@ -4242,7 +4242,9 @@ sctp_aloc_assoc(struct sctp_inpcb *inp, struct sockadd if ((ntohs(sin->sin_port) == 0) || (sin->sin_addr.s_addr == INADDR_ANY) || (sin->sin_addr.s_addr == INADDR_BROADCAST) || - IN_MULTICAST(ntohl(sin->sin_addr.s_addr))) { + IN_MULTICAST(ntohl(sin->sin_addr.s_addr)) || + (((inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) != 0) && + (SCTP_IPV6_V6ONLY(inp) != 0))) { /* Invalid address */ SCTP_INP_RUNLOCK(inp); SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PCB, EINVAL); @@ -4261,7 +4263,8 @@ sctp_aloc_assoc(struct sctp_inpcb *inp, struct sockadd sin6 = (struct sockaddr_in6 *)firstaddr; if ((ntohs(sin6->sin6_port) == 0) || IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr) || - IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr)) { + IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr) || + ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) == 0)) { /* Invalid address */ SCTP_INP_RUNLOCK(inp); SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PCB, EINVAL); From owner-svn-src-all@freebsd.org Tue Sep 29 10:07:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DC2303FC9FA; Tue, 29 Sep 2020 10:07:46 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C0w765WwPz4Yys; Tue, 29 Sep 2020 10:07:46 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A0F02CF18; Tue, 29 Sep 2020 10:07:46 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08TA7kDL080646; Tue, 29 Sep 2020 10:07:46 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08TA7kil080645; Tue, 29 Sep 2020 10:07:46 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <202009291007.08TA7kil080645@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Tue, 29 Sep 2020 10:07:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366249 - head/usr.bin/calendar X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: head/usr.bin/calendar X-SVN-Commit-Revision: 366249 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Sep 2020 10:07:46 -0000 Author: 0mp (doc,ports committer) Date: Tue Sep 29 10:07:46 2020 New Revision: 366249 URL: https://svnweb.freebsd.org/changeset/base/366249 Log: Bump manual page date after 366243 While here, address mandoc warnings. Modified: head/usr.bin/calendar/calendar.1 Modified: head/usr.bin/calendar/calendar.1 ============================================================================== --- head/usr.bin/calendar/calendar.1 Tue Sep 29 09:36:06 2020 (r366248) +++ head/usr.bin/calendar/calendar.1 Tue Sep 29 10:07:46 2020 (r366249) @@ -28,7 +28,7 @@ .\" @(#)calendar.1 8.1 (Berkeley) 6/29/93 .\" $FreeBSD$ .\" -.Dd July 24, 2016 +.Dd September 29, 2020 .Dt CALENDAR 1 .Os .Sh NAME @@ -200,7 +200,7 @@ internally, allowing the inclusion of shared files suc lists of company holidays or meetings. This limited subset consists of \fB#include #ifndef #endif\fR and \fB#define\fR. If the shared file is not referenced by a full pathname, -.Xr calendar 1 +.Nm searches in the current (or home) directory first, and then in the directory .Pa /usr/share/calendar . @@ -248,7 +248,7 @@ do not send mail if this file exists. .El .Pp The following default calendar files are provided in -.Pa /usr/share/calendar: +.Pa /usr/share/calendar : .Pp .Bl -tag -width calendar.southafrica -compact .It Pa calendar.all From owner-svn-src-all@freebsd.org Tue Sep 29 11:18:49 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4AD5C3FED5F; Tue, 29 Sep 2020 11:18:49 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C0xj51H4cz4drf; Tue, 29 Sep 2020 11:18:49 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0F10ADD21; Tue, 29 Sep 2020 11:18:49 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08TBImZN023896; Tue, 29 Sep 2020 11:18:48 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08TBImn8023895; Tue, 29 Sep 2020 11:18:48 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202009291118.08TBImn8023895@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 29 Sep 2020 11:18:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366250 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 366250 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Sep 2020 11:18:49 -0000 Author: trasz Date: Tue Sep 29 11:18:48 2020 New Revision: 366250 URL: https://svnweb.freebsd.org/changeset/base/366250 Log: Use the 'traced' variable instead of comparing p->p_flag again. Reviewed by: kib Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D26577 Modified: head/sys/kern/subr_syscall.c Modified: head/sys/kern/subr_syscall.c ============================================================================== --- head/sys/kern/subr_syscall.c Tue Sep 29 10:07:46 2020 (r366249) +++ head/sys/kern/subr_syscall.c Tue Sep 29 11:18:48 2020 (r366250) @@ -90,7 +90,7 @@ syscallenter(struct thread *td) goto retval; } - if (__predict_false((p->p_flag & P_TRACED) != 0)) { + if (__predict_false(traced)) { PROC_LOCK(p); if (p->p_ptevents & PTRACE_SCE) ptracestop((td), SIGTRAP, NULL); From owner-svn-src-all@freebsd.org Tue Sep 29 11:48:22 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B62083FF4CE; Tue, 29 Sep 2020 11:48:22 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C0yMB4MLYz4gC2; Tue, 29 Sep 2020 11:48:22 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 78FABDEDD; Tue, 29 Sep 2020 11:48:22 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08TBmMX0041880; Tue, 29 Sep 2020 11:48:22 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08TBmM0d041879; Tue, 29 Sep 2020 11:48:22 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202009291148.08TBmM0d041879@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 29 Sep 2020 11:48:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366251 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 366251 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Sep 2020 11:48:22 -0000 Author: trasz Date: Tue Sep 29 11:48:22 2020 New Revision: 366251 URL: https://svnweb.freebsd.org/changeset/base/366251 Log: Build debug kernels with -O2. LLVM 11 changed the meaning of '-O' from '-O2' to '-O1', which resulted in debug kernels (with 'makeoptions DEBUG=-g') being built with inlining disabled, causing severe performance hit. The -O2 was already being used for building amd64, powerpc, and powerpcspe. Discussed with: jrtc27, arichardson, bdragon, jhibbits Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D26471 Modified: head/sys/conf/kern.pre.mk Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Tue Sep 29 11:18:48 2020 (r366250) +++ head/sys/conf/kern.pre.mk Tue Sep 29 11:48:22 2020 (r366251) @@ -51,25 +51,14 @@ OBJCOPY?= objcopy SIZE?= size .if defined(DEBUG) -.if ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "powerpcspe" -# Work around clang 11 miscompile on 32 bit powerpc. -_MINUS_O= -O2 -.else -_MINUS_O= -O -.endif CTFFLAGS+= -g -.else -_MINUS_O= -O2 .endif -.if ${MACHINE_CPUARCH} == "amd64" -.if ${COMPILER_TYPE} == "clang" -COPTFLAGS?=-O2 -pipe +.if ${MACHINE_CPUARCH} == "amd64" && ${COMPILER_TYPE} != "clang" +_COPTFLAGS_EXTRA=-frename-registers .else -COPTFLAGS?=-O2 -frename-registers -pipe +_COPTFLAGS_EXTRA= .endif -.else -COPTFLAGS?=${_MINUS_O} -pipe -.endif +COPTFLAGS?=-O2 -pipe ${_COPTFLAGS_EXTRA} .if !empty(COPTFLAGS:M-O[23s]) && empty(COPTFLAGS:M-fno-strict-aliasing) COPTFLAGS+= -fno-strict-aliasing .endif From owner-svn-src-all@freebsd.org Tue Sep 29 13:41:48 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4AAB24239F2; Tue, 29 Sep 2020 13:41:48 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C10t41Kzyz4nqF; Tue, 29 Sep 2020 13:41:48 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 114D6FA81; Tue, 29 Sep 2020 13:41:48 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08TDfl5N016427; Tue, 29 Sep 2020 13:41:47 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08TDflV3016426; Tue, 29 Sep 2020 13:41:47 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202009291341.08TDflV3016426@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 29 Sep 2020 13:41:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366252 - head/sys/contrib/openzfs/module/os/freebsd/zfs X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/contrib/openzfs/module/os/freebsd/zfs X-SVN-Commit-Revision: 366252 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Sep 2020 13:41:48 -0000 Author: markj Date: Tue Sep 29 13:41:47 2020 New Revision: 366252 URL: https://svnweb.freebsd.org/changeset/base/366252 Log: ZFS: Fix a logic bug in the FreeBSD getpages VOP This was introduced when I merged r361287 to OpenZFS and has been fixed there already, commit 3f6bb6e43fd68e. Reported by: swills Reviewed by: allanjude, freqlabs, mmacy Modified: head/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops.c Modified: head/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops.c ============================================================================== --- head/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops.c Tue Sep 29 11:48:22 2020 (r366251) +++ head/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops.c Tue Sep 29 13:41:47 2020 (r366252) @@ -4859,7 +4859,8 @@ zfs_getpages(struct vnode *vp, vm_page_t *ma, int coun obj_size = object->un_pager.vnp.vnp_size; zfs_vmobject_wunlock(object); if (IDX_TO_OFF(ma[count - 1]->pindex) >= obj_size) { - zfs_rangelock_exit(lr); + if (lr != NULL) + zfs_rangelock_exit(lr); ZFS_EXIT(zfsvfs); return (zfs_vm_pagerret_bad); } @@ -4887,7 +4888,8 @@ zfs_getpages(struct vnode *vp, vm_page_t *ma, int coun error = dmu_read_pages(os, zp->z_id, ma, count, &pgsin_b, &pgsin_a, MIN(end, obj_size) - (end - PAGE_SIZE)); - zfs_rangelock_exit(lr); + if (lr != NULL) + zfs_rangelock_exit(lr); ZFS_ACCESSTIME_STAMP(zfsvfs, zp); ZFS_EXIT(zfsvfs); From owner-svn-src-all@freebsd.org Tue Sep 29 13:47:53 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 35699424326; Tue, 29 Sep 2020 13:47:53 +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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C11150dl6z4pMs; Tue, 29 Sep 2020 13:47:53 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qk1-f182.google.com (mail-qk1-f182.google.com [209.85.222.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id E93292733B; Tue, 29 Sep 2020 13:47:52 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qk1-f182.google.com with SMTP id o5so4295839qke.12; Tue, 29 Sep 2020 06:47:52 -0700 (PDT) X-Gm-Message-State: AOAM533oVM33/NIGhTRPaPIX9U9+jTtyUfKDGOs9HirJqz/c71duaNas ruxpeD9+0fiLi3DFXQTrve+zkDkom8gzXjo8N8U= X-Google-Smtp-Source: ABdhPJwx4IoHlZrZ4SAweGemJ6X2meJMWofeEWtTBLoHFsug+ewLtVOHx5drywHZULYrAPKol3e9gUzxk3TJHAvo8BI= X-Received: by 2002:a05:620a:ce3:: with SMTP id c3mr4522447qkj.103.1601387272419; Tue, 29 Sep 2020 06:47:52 -0700 (PDT) MIME-Version: 1.0 References: <202009291341.08TDflV3016426@repo.freebsd.org> In-Reply-To: <202009291341.08TDflV3016426@repo.freebsd.org> From: Kyle Evans Date: Tue, 29 Sep 2020 08:47:37 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r366252 - head/sys/contrib/openzfs/module/os/freebsd/zfs To: Mark Johnston Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Sep 2020 13:47:53 -0000 On Tue, Sep 29, 2020 at 8:42 AM Mark Johnston wrote: > > Author: markj > Date: Tue Sep 29 13:41:47 2020 > New Revision: 366252 > URL: https://svnweb.freebsd.org/changeset/base/366252 > > Log: > ZFS: Fix a logic bug in the FreeBSD getpages VOP > > This was introduced when I merged r361287 to OpenZFS and has been fixed > there already, commit 3f6bb6e43fd68e. > > Reported by: swills > Reviewed by: allanjude, freqlabs, mmacy > I think this should have been a commit to vendor-sys/zfs/dist with an svn merge into sys/contrib/openzfs to make 100% sure that there's no merge conflict (even trivial) upon mmacy's next import, though it's perhaps not likely for the code to change anymore upstream and svn might be smart enough to realize if the diff matches. You might consider going ahead and committing the diff to vendor-sys and doing a record-only MFC of that commit into sys/contrib/openzfs. Thanks, Kyle Evans From owner-svn-src-all@freebsd.org Tue Sep 29 13:49:49 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 06B4D424431; Tue, 29 Sep 2020 13:49:49 +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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C113J5mzCz4plT; Tue, 29 Sep 2020 13:49:48 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qk1-f180.google.com (mail-qk1-f180.google.com [209.85.222.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id A650F275C7; Tue, 29 Sep 2020 13:49:48 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qk1-f180.google.com with SMTP id w12so4316993qki.6; Tue, 29 Sep 2020 06:49:48 -0700 (PDT) X-Gm-Message-State: AOAM532uks3D0/YO8HFuaOMndrE7XKkouRr5ib+/A0MbKZHM/mA7kF4q ueTf+j7ipmYlSibIhzivjH7ewvDemm67xNc+j5c= X-Google-Smtp-Source: ABdhPJwofBmQ444BUhU+Q+DZj/XsoQRpNTd6vDFSTGSML1OTUgD2E72zzfwftUFgBbL+8xHIua5++njpbOPqRhDlo+U= X-Received: by 2002:a05:620a:136e:: with SMTP id d14mr4426544qkl.430.1601387388330; Tue, 29 Sep 2020 06:49:48 -0700 (PDT) MIME-Version: 1.0 References: <202009291341.08TDflV3016426@repo.freebsd.org> In-Reply-To: From: Kyle Evans Date: Tue, 29 Sep 2020 08:49:35 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r366252 - head/sys/contrib/openzfs/module/os/freebsd/zfs To: Mark Johnston Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Sep 2020 13:49:49 -0000 On Tue, Sep 29, 2020 at 8:47 AM Kyle Evans wrote: > > On Tue, Sep 29, 2020 at 8:42 AM Mark Johnston wrote: > > > > Author: markj > > Date: Tue Sep 29 13:41:47 2020 > > New Revision: 366252 > > URL: https://svnweb.freebsd.org/changeset/base/366252 > > > > Log: > > ZFS: Fix a logic bug in the FreeBSD getpages VOP > > > > This was introduced when I merged r361287 to OpenZFS and has been fixed > > there already, commit 3f6bb6e43fd68e. > > > > Reported by: swills > > Reviewed by: allanjude, freqlabs, mmacy > > > > I think this should have been a commit to vendor-sys/zfs/dist with an > svn merge into sys/contrib/openzfs to make 100% sure that there's no > merge conflict (even trivial) upon mmacy's next import, though it's > perhaps not likely for the code to change anymore upstream and svn > might be smart enough to realize if the diff matches. You might > consider going ahead and committing the diff to vendor-sys and doing a > record-only MFC of that commit into sys/contrib/openzfs. > Bah, sorry: "record-only MFC" -> "record-only MFV" From owner-svn-src-all@freebsd.org Tue Sep 29 13:56:10 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 39CE9424851; Tue, 29 Sep 2020 13:56:10 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C11Bf0th9z4q5x; Tue, 29 Sep 2020 13:56:10 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F2DD1F77D; Tue, 29 Sep 2020 13:56:09 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08TDu9Xo024920; Tue, 29 Sep 2020 13:56:09 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08TDu9Jv024919; Tue, 29 Sep 2020 13:56:09 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202009291356.08TDu9Jv024919@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 29 Sep 2020 13:56:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r366253 - vendor-sys/openzfs/dist/module/os/freebsd/zfs X-SVN-Group: vendor-sys X-SVN-Commit-Author: markj X-SVN-Commit-Paths: vendor-sys/openzfs/dist/module/os/freebsd/zfs X-SVN-Commit-Revision: 366253 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Sep 2020 13:56:10 -0000 Author: markj Date: Tue Sep 29 13:56:09 2020 New Revision: 366253 URL: https://svnweb.freebsd.org/changeset/base/366253 Log: Apply 0daa0320e994 ("Fix a logic bug in the FreeBSD getpages VOP") Modified: vendor-sys/openzfs/dist/module/os/freebsd/zfs/zfs_vnops.c Modified: vendor-sys/openzfs/dist/module/os/freebsd/zfs/zfs_vnops.c ============================================================================== --- vendor-sys/openzfs/dist/module/os/freebsd/zfs/zfs_vnops.c Tue Sep 29 13:41:47 2020 (r366252) +++ vendor-sys/openzfs/dist/module/os/freebsd/zfs/zfs_vnops.c Tue Sep 29 13:56:09 2020 (r366253) @@ -4859,7 +4859,8 @@ zfs_getpages(struct vnode *vp, vm_page_t *ma, int coun obj_size = object->un_pager.vnp.vnp_size; zfs_vmobject_wunlock(object); if (IDX_TO_OFF(ma[count - 1]->pindex) >= obj_size) { - zfs_rangelock_exit(lr); + if (lr != NULL) + zfs_rangelock_exit(lr); ZFS_EXIT(zfsvfs); return (zfs_vm_pagerret_bad); } @@ -4887,7 +4888,8 @@ zfs_getpages(struct vnode *vp, vm_page_t *ma, int coun error = dmu_read_pages(os, zp->z_id, ma, count, &pgsin_b, &pgsin_a, MIN(end, obj_size) - (end - PAGE_SIZE)); - zfs_rangelock_exit(lr); + if (lr != NULL) + zfs_rangelock_exit(lr); ZFS_ACCESSTIME_STAMP(zfsvfs, zp); ZFS_EXIT(zfsvfs); From owner-svn-src-all@freebsd.org Tue Sep 29 14:02:43 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4B75B4248BD; Tue, 29 Sep 2020 14:02:43 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C11LC0xNXz4qMK; Tue, 29 Sep 2020 14:02:43 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DD427FBAC; Tue, 29 Sep 2020 14:02:42 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08TE2gHH030881; Tue, 29 Sep 2020 14:02:42 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08TE2g7G030880; Tue, 29 Sep 2020 14:02:42 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202009291402.08TE2g7G030880@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 29 Sep 2020 14:02:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366254 - head/sys/contrib/openzfs X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/contrib/openzfs X-SVN-Commit-Revision: 366254 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Sep 2020 14:02:43 -0000 Author: markj Date: Tue Sep 29 14:02:42 2020 New Revision: 366254 URL: https://svnweb.freebsd.org/changeset/base/366254 Log: MFV r366253 This modifies only the openzfs svn:mergeinfo property, since r366253 has already been committed to head. Modified: Directory Properties: head/sys/contrib/openzfs/ (props changed) From owner-svn-src-all@freebsd.org Tue Sep 29 14:04:44 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E6CE1424744; Tue, 29 Sep 2020 14:04:44 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qk1-x741.google.com (mail-qk1-x741.google.com [IPv6:2607:f8b0:4864:20::741]) (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 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C11NX4BG9z4qYR; Tue, 29 Sep 2020 14:04:44 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qk1-x741.google.com with SMTP id w16so4382913qkj.7; Tue, 29 Sep 2020 07:04:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=OFMPVGbTphtJsBZwhL7TVGx/Xmn1SX37RSrI/HERAKY=; b=blo5d6rDB4tTy0Z+XitDA/YoWtYjC0lmGQw07BWygBgGlZpqmzDFXs4kF3YzO3vCMk UqTtF8jB2geeHLtKQB7cw9VRzbAUWggd8Lw7oW0Mw4hG3KNkluYDZdj3HG6nd0o6r57V EDMKyC5EHDgxVbKk8PHmdTNOto7iOBy6jOvgT3CQZ8ondV3fSxKzdADIbszlCoFQ9xIb z9+VYHqykyEzug9IqMy3LwgxPx/jCS0R+aUyZzwCHZlMAliZ78WoK5gF1YJQb1rK1SlK rQQ2/D3wSSXWQcXdEZN2Dpq01H03Gyq8V7iMFfY/4YXb55YsCNglGhUnzHq8q4kkacH7 5VWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=OFMPVGbTphtJsBZwhL7TVGx/Xmn1SX37RSrI/HERAKY=; b=Rbiu9fGRK6HLmkEIFnRtHivewfsgWzN26O325yaCDlIxrsTJP/O97DeL5opOseypLm 1jTHpRjh1YMSC50qBKPxQC2/4jhh4bxVR5/XQ7XcdSC+DHUcp3EmPrQld2xv7hHBhWVW qQAyWZLrd/6teNlnokM9V6kyX1noEo8y0Aq5fSUroHBQhRK/Nwaw1vLYPKc7zwfcA4zN p26PC5PjlR4EoYJVQ89K5LgN3absArSCSbBzsUjD5T0LILPvFhVYO62Cp4yKTnswOu9t 1wn/eL+5baTgf6rPeUIsDVOPRuzzMzlv4hoxG99RM8AnJGQaHR+IC1ZfHL+tYFt78lz9 /2wA== X-Gm-Message-State: AOAM530uXsrhEzhw4FZ/fiyZPTg0x42185SLCjwMfCcx2ILxtS0WtSUa no72YnCAvaCEzmlCrVhwlM/eYYw4Kf4xsA== X-Google-Smtp-Source: ABdhPJykij0CJg3IsE3Jl5mE23xEmOIlHGLKmkvtxICuR5S9sQMTdZYw9l1iysrNqB8WNUPgHE43JA== X-Received: by 2002:a05:620a:13d0:: with SMTP id g16mr4256047qkl.489.1601388283239; Tue, 29 Sep 2020 07:04:43 -0700 (PDT) Received: from raichu (toroon0560w-lp130-01-174-88-77-103.dsl.bell.ca. [174.88.77.103]) by smtp.gmail.com with ESMTPSA id t11sm5346198qtp.32.2020.09.29.07.04.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Sep 2020 07:04:42 -0700 (PDT) Sender: Mark Johnston Date: Tue, 29 Sep 2020 10:04:40 -0400 From: Mark Johnston To: Kyle Evans Cc: src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r366252 - head/sys/contrib/openzfs/module/os/freebsd/zfs Message-ID: <20200929140440.GC26914@raichu> References: <202009291341.08TDflV3016426@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4C11NX4BG9z4qYR X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Sep 2020 14:04:45 -0000 On Tue, Sep 29, 2020 at 08:47:37AM -0500, Kyle Evans wrote: > On Tue, Sep 29, 2020 at 8:42 AM Mark Johnston wrote: > > > > Author: markj > > Date: Tue Sep 29 13:41:47 2020 > > New Revision: 366252 > > URL: https://svnweb.freebsd.org/changeset/base/366252 > > > > Log: > > ZFS: Fix a logic bug in the FreeBSD getpages VOP > > > > This was introduced when I merged r361287 to OpenZFS and has been fixed > > there already, commit 3f6bb6e43fd68e. > > > > Reported by: swills > > Reviewed by: allanjude, freqlabs, mmacy > > > > I think this should have been a commit to vendor-sys/zfs/dist with an > svn merge into sys/contrib/openzfs to make 100% sure that there's no > merge conflict (even trivial) upon mmacy's next import, though it's > perhaps not likely for the code to change anymore upstream and svn > might be smart enough to realize if the diff matches. You might > consider going ahead and committing the diff to vendor-sys and doing a > record-only MFC of that commit into sys/contrib/openzfs. Done in r366254. From owner-svn-src-all@freebsd.org Tue Sep 29 14:06:49 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1DFA342465A; Tue, 29 Sep 2020 14:06:49 +0000 (UTC) (envelope-from kevans@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C11Qw742xz4qnZ; Tue, 29 Sep 2020 14:06:48 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qk1-f182.google.com (mail-qk1-f182.google.com [209.85.222.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id D054027347; Tue, 29 Sep 2020 14:06:48 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qk1-f182.google.com with SMTP id f142so4369970qke.13; Tue, 29 Sep 2020 07:06:48 -0700 (PDT) X-Gm-Message-State: AOAM531z8C5BaR/v8EsnBuiJvN0UiyJF457Ro8AyASpNuN0b3d8A4D+G SVTTRBqcgXBf9fc0h8v+Du3JEv6TC7854A3Nvnc= X-Google-Smtp-Source: ABdhPJyMTIPq+iyCy5+MvFTD02XVHtzNGp9TKWQgqzoaP04ze7PnL9pjFwFVsjyyGkj+MX2XO6O9Pg0NWrDGjkUQSp0= X-Received: by 2002:a37:a189:: with SMTP id k131mr4411666qke.34.1601388408452; Tue, 29 Sep 2020 07:06:48 -0700 (PDT) MIME-Version: 1.0 References: <202009291341.08TDflV3016426@repo.freebsd.org> <20200929140440.GC26914@raichu> In-Reply-To: <20200929140440.GC26914@raichu> From: Kyle Evans Date: Tue, 29 Sep 2020 09:06:33 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r366252 - head/sys/contrib/openzfs/module/os/freebsd/zfs To: Mark Johnston Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Sep 2020 14:06:49 -0000 On Tue, Sep 29, 2020 at 9:04 AM Mark Johnston wrote: > > On Tue, Sep 29, 2020 at 08:47:37AM -0500, Kyle Evans wrote: > > On Tue, Sep 29, 2020 at 8:42 AM Mark Johnston wrote: > > > > > > Author: markj > > > Date: Tue Sep 29 13:41:47 2020 > > > New Revision: 366252 > > > URL: https://svnweb.freebsd.org/changeset/base/366252 > > > > > > Log: > > > ZFS: Fix a logic bug in the FreeBSD getpages VOP > > > > > > This was introduced when I merged r361287 to OpenZFS and has been fixed > > > there already, commit 3f6bb6e43fd68e. > > > > > > Reported by: swills > > > Reviewed by: allanjude, freqlabs, mmacy > > > > > > > I think this should have been a commit to vendor-sys/zfs/dist with an > > svn merge into sys/contrib/openzfs to make 100% sure that there's no > > merge conflict (even trivial) upon mmacy's next import, though it's > > perhaps not likely for the code to change anymore upstream and svn > > might be smart enough to realize if the diff matches. You might > > consider going ahead and committing the diff to vendor-sys and doing a > > record-only MFC of that commit into sys/contrib/openzfs. > > Done in r366254. Excellent, thanks! From owner-svn-src-all@freebsd.org Tue Sep 29 14:59:42 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8AA304258FC; Tue, 29 Sep 2020 14:59:42 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C12by35l5z4tk8; Tue, 29 Sep 2020 14:59:42 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4D90910537; Tue, 29 Sep 2020 14:59:42 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08TExg4U062584; Tue, 29 Sep 2020 14:59:42 GMT (envelope-from dab@FreeBSD.org) Received: (from dab@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08TExfEs062582; Tue, 29 Sep 2020 14:59:41 GMT (envelope-from dab@FreeBSD.org) Message-Id: <202009291459.08TExfEs062582@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dab set sender to dab@FreeBSD.org using -f From: David Bright Date: Tue, 29 Sep 2020 14:59:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366255 - stable/12/sys/dev/nvme X-SVN-Group: stable-12 X-SVN-Commit-Author: dab X-SVN-Commit-Paths: stable/12/sys/dev/nvme X-SVN-Commit-Revision: 366255 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Sep 2020 14:59:42 -0000 Author: dab Date: Tue Sep 29 14:59:41 2020 New Revision: 366255 URL: https://svnweb.freebsd.org/changeset/base/366255 Log: MFC r365946: Add an ioctl to get an NVMe device's maximum transfer size Sponsored by: Dell EMC Isilon Modified: stable/12/sys/dev/nvme/nvme.h stable/12/sys/dev/nvme/nvme_ctrlr.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/nvme/nvme.h ============================================================================== --- stable/12/sys/dev/nvme/nvme.h Tue Sep 29 14:02:42 2020 (r366254) +++ stable/12/sys/dev/nvme/nvme.h Tue Sep 29 14:59:41 2020 (r366255) @@ -41,6 +41,7 @@ #define NVME_PASSTHROUGH_CMD _IOWR('n', 0, struct nvme_pt_command) #define NVME_RESET_CONTROLLER _IO('n', 1) #define NVME_GET_NSID _IOR('n', 2, struct nvme_get_nsid) +#define NVME_GET_MAX_XFER_SIZE _IOR('n', 3, uint64_t) #define NVME_IO_TEST _IOWR('n', 100, struct nvme_io_test) #define NVME_BIO_TEST _IOWR('n', 101, struct nvme_io_test) Modified: stable/12/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- stable/12/sys/dev/nvme/nvme_ctrlr.c Tue Sep 29 14:02:42 2020 (r366254) +++ stable/12/sys/dev/nvme/nvme_ctrlr.c Tue Sep 29 14:59:41 2020 (r366255) @@ -1309,6 +1309,9 @@ nvme_ctrlr_ioctl(struct cdev *cdev, u_long cmd, caddr_ gnsid->nsid = 0; break; } + case NVME_GET_MAX_XFER_SIZE: + *(uint64_t *)arg = ctrlr->max_xfer_size; + break; default: return (ENOTTY); } From owner-svn-src-all@freebsd.org Tue Sep 29 15:09:38 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ED9E9425D41; Tue, 29 Sep 2020 15:09:38 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C12qQ63Yyz4v6K; Tue, 29 Sep 2020 15:09:38 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B074210856; Tue, 29 Sep 2020 15:09:38 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08TF9crw069430; Tue, 29 Sep 2020 15:09:38 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08TF9ckh069429; Tue, 29 Sep 2020 15:09:38 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <202009291509.08TF9ckh069429@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Tue, 29 Sep 2020 15:09:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r366256 - releng/12.2/sys/fs/nfsserver X-SVN-Group: releng X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: releng/12.2/sys/fs/nfsserver X-SVN-Commit-Revision: 366256 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Sep 2020 15:09:39 -0000 Author: rmacklem Date: Tue Sep 29 15:09:38 2020 New Revision: 366256 URL: https://svnweb.freebsd.org/changeset/base/366256 Log: MFS: r366238 Bjorn reported a problem where the Linux NFSv4.1 client is using an open_to_lock_owner4 when that lock_owner4 has already been created by a previous open_to_lock_owner4. This caused the NFS server to reply NFSERR_INVAL. For NFSv4.0, this is an error, although the updated NFSv4.0 RFC7530 notes that the correct error reply is NFSERR_BADSEQID (RFC3530 did not specify what error to return). For NFSv4.1, it is not obvious whether or not this is allowed by RFC5661, but the NFSv4.1 server can handle this case without error. This patch changes the NFSv4.1 (and NFSv4.2) server to handle multiple uses of the same lock_owner in open_to_lock_owner so that it now correctly interoperates with the Linux NFS client. It also changes the error returned for NFSv4.0 to be NFSERR_BADSEQID. Thanks go to Bjorn for diagnosing this and testing the patch. He also provided a program that I could use to reproduce the problem. PR: 249567 Approved by: re (gjb) Modified: releng/12.2/sys/fs/nfsserver/nfs_nfsdstate.c Directory Properties: releng/12.2/ (props changed) Modified: releng/12.2/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- releng/12.2/sys/fs/nfsserver/nfs_nfsdstate.c Tue Sep 29 14:59:41 2020 (r366255) +++ releng/12.2/sys/fs/nfsserver/nfs_nfsdstate.c Tue Sep 29 15:09:38 2020 (r366256) @@ -1871,14 +1871,20 @@ tryagain: } if (!error) nfsrv_getowner(&stp->ls_open, new_stp, &lckstp); - if (lckstp) + if (lckstp) { /* - * I believe this should be an error, but it - * isn't obvious what NFSERR_xxx would be - * appropriate, so I'll use NFSERR_INVAL for now. + * For NFSv4.1 and NFSv4.2 allow an + * open_to_lock_owner when the lock_owner already + * exists. Just clear NFSLCK_OPENTOLOCK so that + * a new lock_owner will not be created. + * RFC7530 states that the error for NFSv4.0 + * is NFS4ERR_BAD_SEQID. */ - error = NFSERR_INVAL; - else + if ((nd->nd_flag & ND_NFSV41) != 0) + new_stp->ls_flags &= ~NFSLCK_OPENTOLOCK; + else + error = NFSERR_BADSEQID; + } else lckstp = new_stp; } else if (new_stp->ls_flags&(NFSLCK_LOCK|NFSLCK_UNLOCK)) { /* From owner-svn-src-all@freebsd.org Tue Sep 29 15:10:57 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C8DAA4260E7; Tue, 29 Sep 2020 15:10:57 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C12rx4W00z4vfR; Tue, 29 Sep 2020 15:10:57 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7DE9C10989; Tue, 29 Sep 2020 15:10:57 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08TFAvoC069583; Tue, 29 Sep 2020 15:10:57 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08TFAuhN069579; Tue, 29 Sep 2020 15:10:56 GMT (envelope-from br@FreeBSD.org) Message-Id: <202009291510.08TFAuhN069579@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 29 Sep 2020 15:10:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366257 - in head/sys/dev: acpica iommu pci X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: in head/sys/dev: acpica iommu pci X-SVN-Commit-Revision: 366257 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Sep 2020 15:10:57 -0000 Author: br Date: Tue Sep 29 15:10:56 2020 New Revision: 366257 URL: https://svnweb.freebsd.org/changeset/base/366257 Log: o Rename acpi_iommu_get_dma_tag() -> iommu_get_dma_tag(). This function isn't ACPI dependent and we may use it on FDT systems as well. o Don't repeat the function declaration, include iommu.h instead. Reviewed by: andrew, kib Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D26584 Modified: head/sys/dev/acpica/acpi_pci.c head/sys/dev/iommu/busdma_iommu.c head/sys/dev/iommu/busdma_iommu.h head/sys/dev/iommu/iommu.h head/sys/dev/pci/pci.c Modified: head/sys/dev/acpica/acpi_pci.c ============================================================================== --- head/sys/dev/acpica/acpi_pci.c Tue Sep 29 15:09:38 2020 (r366256) +++ head/sys/dev/acpica/acpi_pci.c Tue Sep 29 15:10:56 2020 (r366257) @@ -37,6 +37,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include @@ -49,6 +51,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include "pcib_if.h" #include "pci_if.h" @@ -456,7 +460,6 @@ acpi_pci_detach(device_t dev) } #ifdef ACPI_DMAR -bus_dma_tag_t acpi_iommu_get_dma_tag(device_t dev, device_t child); static bus_dma_tag_t acpi_pci_get_dma_tag(device_t bus, device_t child) { @@ -464,7 +467,7 @@ acpi_pci_get_dma_tag(device_t bus, device_t child) if (device_get_parent(child) == bus) { /* try iommu and return if it works */ - tag = acpi_iommu_get_dma_tag(bus, child); + tag = iommu_get_dma_tag(bus, child); } else tag = NULL; if (tag == NULL) Modified: head/sys/dev/iommu/busdma_iommu.c ============================================================================== --- head/sys/dev/iommu/busdma_iommu.c Tue Sep 29 15:09:38 2020 (r366256) +++ head/sys/dev/iommu/busdma_iommu.c Tue Sep 29 15:10:56 2020 (r366257) @@ -270,7 +270,7 @@ iommu_instantiate_ctx(struct iommu_unit *unit, device_ } bus_dma_tag_t -acpi_iommu_get_dma_tag(device_t dev, device_t child) +iommu_get_dma_tag(device_t dev, device_t child) { struct iommu_unit *unit; struct iommu_ctx *ctx; Modified: head/sys/dev/iommu/busdma_iommu.h ============================================================================== --- head/sys/dev/iommu/busdma_iommu.h Tue Sep 29 15:09:38 2020 (r366256) +++ head/sys/dev/iommu/busdma_iommu.h Tue Sep 29 15:10:56 2020 (r366257) @@ -61,6 +61,4 @@ struct bus_dmamap_iommu { extern struct bus_dma_impl bus_dma_iommu_impl; -bus_dma_tag_t acpi_iommu_get_dma_tag(device_t dev, device_t child); - #endif Modified: head/sys/dev/iommu/iommu.h ============================================================================== --- head/sys/dev/iommu/iommu.h Tue Sep 29 15:09:38 2020 (r366256) +++ head/sys/dev/iommu/iommu.h Tue Sep 29 15:10:56 2020 (r366257) @@ -232,6 +232,8 @@ bool bus_dma_iommu_set_buswide(device_t dev); int bus_dma_iommu_load_ident(bus_dma_tag_t dmat, bus_dmamap_t map, vm_paddr_t start, vm_size_t length, int flags); +bus_dma_tag_t iommu_get_dma_tag(device_t dev, device_t child); + SYSCTL_DECL(_hw_iommu); #endif /* !_SYS_IOMMU_H_ */ Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Tue Sep 29 15:09:38 2020 (r366256) +++ head/sys/dev/pci/pci.c Tue Sep 29 15:10:56 2020 (r366257) @@ -47,6 +47,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include @@ -77,6 +79,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include "pcib_if.h" #include "pci_if.h" @@ -5680,7 +5684,6 @@ pci_get_resource_list (device_t dev, device_t child) } #ifdef ACPI_DMAR -bus_dma_tag_t acpi_iommu_get_dma_tag(device_t dev, device_t child); bus_dma_tag_t pci_get_dma_tag(device_t bus, device_t dev) { @@ -5689,7 +5692,7 @@ pci_get_dma_tag(device_t bus, device_t dev) if (device_get_parent(dev) == bus) { /* try iommu and return if it works */ - tag = acpi_iommu_get_dma_tag(bus, dev); + tag = iommu_get_dma_tag(bus, dev); } else tag = NULL; if (tag == NULL) { From owner-svn-src-all@freebsd.org Tue Sep 29 15:26:08 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6D69242636A; Tue, 29 Sep 2020 15:26:08 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4C13BR3Hhdz3S6l; Tue, 29 Sep 2020 15:26:07 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id B16D45C0159; Tue, 29 Sep 2020 11:26:01 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Tue, 29 Sep 2020 11:26:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsco.org; h= content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; s=fm1; bh=d oKrdJLCxyS/22PvXs04MItq0JfIwylnZ/+r2Gz8MLM=; b=gILWvDnHujTqVk1hb pOUCHkQjcOU1vbjewjwvKC6OVZvsJU6lvidOYqXoJQTiwkKx9R5Q01pJY8W4Nz0j Z9/9kwUmOEF/odrSX94N4ctkWgat20dGvJZ2GPcgJw8QEKDSjV4dg9PRherIoaru CMbNWAl8PWewiDoc6YdnAPr1TVAwROhHJLKpnFwIMXaooqBkfjIxOuh3CuWnXoD4 G4sqG2RyyN3njKXqBdzAeA+oH7MuNelR/uxnqZqw5MnIkAmbWW2PvdcL0nYXlMVm UUmHUW4RZiNSUCzV1er/Fsrxk2x/41VxH+6YIL/Psv5YkzEGPnKAgtNR3Vm4VJLJ EcBqg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=doKrdJLCxyS/22PvXs04MItq0JfIwylnZ/+r2Gz8M LM=; b=T+dozDuMNcwK9vR9ujBAaFZVD/xVQDsRBbE7vIzUAPD80HyXqB70w40f4 ZwD+C6oM5sT7AEiIntw1qYYUk3//2UbScJxlVle5R+0HV2blOayrkj9maW+qLmv9 AlCOhYqkaZbNvlXOOrNjKOSuQX8NeGmnokF9mZp9DXmje4rveL2oVgrc5CpVhH51 lPf8rC2GcYOKg1m59YmGpgxhXQtT3jcSNXuJ+Ky5zpYbU2ctnZmoLQbMlc/8y3Di 8zqWwul6vcUH8VN3JC9YYQL/pg84P0vGrvo0Ri3Wg6mfppelvyKe49iQbJ3JGRA4 gAMFwoCv9M9DDjTqhiEQFPzAJg9Pw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrvdekgdekjecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpegtggfuhfgjfffgkfhfvffosehtqhhmtdhhtdejnecuhfhrohhmpefutghothht ucfnohhnghcuoehstghothhtlhesshgrmhhstghordhorhhgqeenucggtffrrghtthgvrh hnpefgiedtjeefvdetffegfeegjeehhfehveeuheekuedtgeelffejfeetieejtdfhveen ucffohhmrghinhepfhhrvggvsghsugdrohhrghdpfhhtphegrdhruhenucfkphepkedrge eirdekledrvddufeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhl fhhrohhmpehstghothhtlhesshgrmhhstghordhorhhg X-ME-Proxy: Received: from [192.168.0.114] (unknown [8.46.89.213]) by mail.messagingengine.com (Postfix) with ESMTPA id 06BC23064682; Tue, 29 Sep 2020 11:26:00 -0400 (EDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.1\)) Subject: Re: svn commit: r366186 - in head/usr.sbin: bsdconfig/share/media bsdinstall/scripts From: Scott Long In-Reply-To: Date: Tue, 29 Sep 2020 09:26:00 -0600 Cc: "Rodney W. Grimes" , Warner Losh , src-committers , svn-src-all , svn-src-head Content-Transfer-Encoding: quoted-printable Message-Id: <1969D75C-6533-4FD1-B93B-6FFAE593323E@samsco.org> References: <202009262324.08QNOjbQ056906@gndrsh.dnsmgr.net> <58A46C41-07DE-41F4-A3F9-668035347D8B@samsco.org> To: Niclas Zeising X-Mailer: Apple Mail (2.3608.120.23.2.1) X-Rspamd-Queue-Id: 4C13BR3Hhdz3S6l X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=samsco.org header.s=fm1 header.b=gILWvDnH; dkim=pass header.d=messagingengine.com header.s=fm3 header.b=T+dozDuM; dmarc=none; spf=pass (mx1.freebsd.org: domain of scottl@samsco.org designates 66.111.4.26 as permitted sender) smtp.mailfrom=scottl@samsco.org X-Spamd-Result: default: False [-3.03 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[samsco.org:s=fm1,messagingengine.com:s=fm3]; FREEFALL_USER(0.00)[scottl]; FROM_HAS_DN(0.00)[]; RWL_MAILSPIKE_GOOD(0.00)[66.111.4.26:from]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ip4:66.111.4.26]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[samsco.org]; NEURAL_HAM_LONG(-1.01)[-1.007]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[samsco.org:+,messagingengine.com:+]; NEURAL_HAM_SHORT(-0.91)[-0.910]; NEURAL_HAM_MEDIUM(-1.01)[-1.009]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:66.111.4.0/24, country:US]; MID_RHS_MATCH_FROM(0.00)[]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head]; RCVD_IN_DNSWL_LOW(-0.10)[66.111.4.26:from] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Sep 2020 15:26:08 -0000 > On Sep 27, 2020, at 2:41 AM, Niclas Zeising = wrote: >=20 > On 2020-09-27 03:38, Scott Long wrote: >>> On Sep 26, 2020, at 5:24 PM, Rodney W. Grimes = wrote: >>>=20 >>> =EF=BB=BF >>>>=20 >>>>=20 >>>>>> On Sep 26, 2020, at 1:22 PM, Warner Losh wrote: >>>>>=20 >>>>>=20 >>>>>=20 >>>>> I am the wrong person to answer that question. >>>>>=20 >>>>> In this case, things have not become lame. For instance, the = names >>>>> ervers for se.freebsd.org work fine, but ftp3.se and ftp6.se = records are >>>>> removed. Same for ru.freebsd.org and ftp4.ru. >>>>> I'm merely pointing out that changing ftp.CC.freebsd.org usually >>>>> requires contacting the person(s) maintaining the CC.freebsd.org = zone, >>>>> which is usually not the project. >>>>>=20 >>>>> It's usually people associated with the project in some way, but = who might not be as responsive as cluster admin. These domains have been = delegated, so we have to get the delegated admin to make the changes, = which can take a bit of time to chase down and doesn't lend itself to = easy / automated coping with this situation. >>>>>=20 >>>>=20 >>>> Just a spitball idea here, but maybe we should consider not = embedding these lists of mirror URLs into the binaries. It seems pretty = straight-forward that the list evolves over time, and that evolution is = not tightly coupled with the updating of the binaries. It sounds like = the pkg and freebsd-update infrastructure use DNS TXT and/or SRV records = to point to the metadata needed to construct a mirror URL list = dynamically. Maybe something similar can be done for bsdconfig? If = it?s not a crazy idea, is there anyone who would be interested in = helping me write a proposal over at arch@? >>>=20 >>> 100% behind that idea! Especially since it seems the project has = lost >>> (some) control over its DNS space, which IMHO, is still an issue, if >>> the people whom DNS zones have been deligated to are not responsive >>> that should also >> Words of agreement don=E2=80=99t help at the moment, though i = appreciate your enthusiasm. Would you he able to help write a proposal = for the arch@ mailing list? >=20 > I think this is the wrong approach, and the better approach is to have = the official installer use download.freebsd.org (which already is = geo-located). I also feel like this is probably something that core and = possibly clusteradm should weigh in on, since it affects how we = distribute FreeBSD. >=20 > My impression was that we were generally trying to move away from = mirrors hosted by various people and organizations all over the world, = where we have little control, to our own mirrors behind = download.freebsd.org. If this is the case, perhaps we should do so in = the installer as well. >=20 I=E2=80=99m totally fine with this. Also, I don=E2=80=99t speak for = core on my own, but I am part of core. We=E2=80=99re trying to = encourage public discussion and participation on these kinds of issues, = so that=E2=80=99s why I=E2=80=99m suggesting that this conversation = should move to an appropriate mailing list. > That said, I'm not opposed to the idea of using DNS SRV/TXT records to = construct mirror lists, especially if we want to keep on using those = mirrors. Scott From owner-svn-src-all@freebsd.org Tue Sep 29 15:34:53 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5641E426830; Tue, 29 Sep 2020 15:34:53 +0000 (UTC) (envelope-from zeising@freebsd.org) Received: from mail.daemonic.se (mail.daemonic.se [IPv6:2607:f740:d:20::25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4C13NX74Zdz3SjK; Tue, 29 Sep 2020 15:34:52 +0000 (UTC) (envelope-from zeising@freebsd.org) Received: from cid.daemonic.se (localhost [IPv6:::1]) by mail.daemonic.se (Postfix) with ESMTP id 4C13NN6Tzwz3nFM; Tue, 29 Sep 2020 15:34:44 +0000 (UTC) X-Virus-Scanned: amavisd-new at daemonic.se Received: from mail.daemonic.se ([127.0.0.1]) (using TLS with cipher ECDHE-RSA-AES128-GCM-SHA256) by cid.daemonic.se (mailscanner.daemonic.se [127.0.0.1]) (amavisd-new, port 10587) with ESMTPS id wjOscpKQMyEG; Tue, 29 Sep 2020 15:34:01 +0000 (UTC) Received: from garnet.daemonic.se (host-95-194-15-241.mobileonline.telia.com [95.194.15.241]) by mail.daemonic.se (Postfix) with ESMTPSA id 4C13MY0VrTz3mQw; Tue, 29 Sep 2020 15:34:00 +0000 (UTC) Subject: Re: svn commit: r366186 - in head/usr.sbin: bsdconfig/share/media bsdinstall/scripts To: Scott Long Cc: "Rodney W. Grimes" , Warner Losh , src-committers , svn-src-all , svn-src-head References: <202009262324.08QNOjbQ056906@gndrsh.dnsmgr.net> <58A46C41-07DE-41F4-A3F9-668035347D8B@samsco.org> <1969D75C-6533-4FD1-B93B-6FFAE593323E@samsco.org> From: Niclas Zeising Message-ID: <1230b1eb-97de-03ba-7b6f-0ded3a94074c@freebsd.org> Date: Tue, 29 Sep 2020 17:34:00 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <1969D75C-6533-4FD1-B93B-6FFAE593323E@samsco.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4C13NX74Zdz3SjK X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [0.00 / 15.00]; local_wl_from(0.00)[freebsd.org]; ASN(0.00)[asn:36236, ipnet:2607:f740:d::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Sep 2020 15:34:53 -0000 On 2020-09-29 17:26, Scott Long wrote: >=20 >> On Sep 27, 2020, at 2:41 AM, Niclas Zeising wrot= e: >> >> On 2020-09-27 03:38, Scott Long wrote: >>>> On Sep 26, 2020, at 5:24 PM, Rodney W. Grimes wrote: >>>> >>>> =EF=BB=BF >>>>> >>>>> >>>>>>> On Sep 26, 2020, at 1:22 PM, Warner Losh wrote: >>>>>> >>>>>> >>>>>> >>>>>> I am the wrong person to answer that question. >>>>>> >>>>>> In this case, things have not become lame. For instance, the name= s >>>>>> ervers for se.freebsd.org work fine, but ftp3.se and ftp6.se recor= ds are >>>>>> removed. Same for ru.freebsd.org and ftp4.ru. >>>>>> I'm merely pointing out that changing ftp.CC.freebsd.org usually >>>>>> requires contacting the person(s) maintaining the CC.freebsd.org z= one, >>>>>> which is usually not the project. >>>>>> >>>>>> It's usually people associated with the project in some way, but w= ho might not be as responsive as cluster admin. These domains have been d= elegated, so we have to get the delegated admin to make the changes, whic= h can take a bit of time to chase down and doesn't lend itself to easy / = automated coping with this situation. >>>>>> >>>>> >>>>> Just a spitball idea here, but maybe we should consider not embeddi= ng these lists of mirror URLs into the binaries. It seems pretty straigh= t-forward that the list evolves over time, and that evolution is not tigh= tly coupled with the updating of the binaries. It sounds like the pkg an= d freebsd-update infrastructure use DNS TXT and/or SRV records to point t= o the metadata needed to construct a mirror URL list dynamically. Maybe = something similar can be done for bsdconfig? If it?s not a crazy idea, i= s there anyone who would be interested in helping me write a proposal ove= r at arch@? >>>> >>>> 100% behind that idea! Especially since it seems the project has lo= st >>>> (some) control over its DNS space, which IMHO, is still an issue, if >>>> the people whom DNS zones have been deligated to are not responsive >>>> that should also >>> Words of agreement don=E2=80=99t help at the moment, though i appreci= ate your enthusiasm. Would you he able to help write a proposal for the = arch@ mailing list? >> >> I think this is the wrong approach, and the better approach is to have= the official installer use download.freebsd.org (which already is geo-lo= cated). I also feel like this is probably something that core and possib= ly clusteradm should weigh in on, since it affects how we distribute Free= BSD. >> >> My impression was that we were generally trying to move away from mirr= ors hosted by various people and organizations all over the world, where = we have little control, to our own mirrors behind download.freebsd.org. = If this is the case, perhaps we should do so in the installer as well. >> >=20 > I=E2=80=99m totally fine with this. Also, I don=E2=80=99t speak for co= re on my own, but I am part of core. We=E2=80=99re trying to encourage p= ublic discussion and participation on these kinds of issues, so that=E2=80= =99s why I=E2=80=99m suggesting that this conversation should move to an = appropriate mailing list. I'll try to come up with something that uses download.freebsd.org, and=20 send it out for discussion. I'm not sure I can make it in time for 12.2=20 though, so in the meantime I'll MFC this commit and ask re@ about=20 getting it into 12.2. That way users won't stumble over the obviously=20 dead mirrors while we discuss a better approach for the future. Regards --=20 Niclas Zeising From owner-svn-src-all@freebsd.org Tue Sep 29 15:37:34 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6A337426B82; Tue, 29 Sep 2020 15:37:34 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C13Rf2CSpz3Sm4; Tue, 29 Sep 2020 15:37:34 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2F0E3109FA; Tue, 29 Sep 2020 15:37:34 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08TFbYOB087846; Tue, 29 Sep 2020 15:37:34 GMT (envelope-from zeising@FreeBSD.org) Received: (from zeising@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08TFbX5P087844; Tue, 29 Sep 2020 15:37:33 GMT (envelope-from zeising@FreeBSD.org) Message-Id: <202009291537.08TFbX5P087844@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zeising set sender to zeising@FreeBSD.org using -f From: Niclas Zeising Date: Tue, 29 Sep 2020 15:37:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366258 - in stable/12/usr.sbin: bsdconfig/share/media bsdinstall/scripts X-SVN-Group: stable-12 X-SVN-Commit-Author: zeising X-SVN-Commit-Paths: in stable/12/usr.sbin: bsdconfig/share/media bsdinstall/scripts X-SVN-Commit-Revision: 366258 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Sep 2020 15:37:34 -0000 Author: zeising (doc,ports committer) Date: Tue Sep 29 15:37:33 2020 New Revision: 366258 URL: https://svnweb.freebsd.org/changeset/base/366258 Log: MFC r366186: bsdconfig, bsdinstall: Prune dead mirrors Prune dead mirrors from the list of mirrors in bsdconfig and bsdinstall. All these return NXDOMAIN when trying to resolve them. Approved by: emaste Modified: stable/12/usr.sbin/bsdconfig/share/media/ftp.subr stable/12/usr.sbin/bsdinstall/scripts/mirrorselect Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bsdconfig/share/media/ftp.subr ============================================================================== --- stable/12/usr.sbin/bsdconfig/share/media/ftp.subr Tue Sep 29 15:10:56 2020 (r366257) +++ stable/12/usr.sbin/bsdconfig/share/media/ftp.subr Tue Sep 29 15:37:33 2020 (r366258) @@ -82,7 +82,6 @@ f_dialog_menu_media_ftp() ' IPv6 $msg_japan' 'ftp2.jp.freebsd.org' ' IPv6 $msg_sweden' 'ftp4.se.freebsd.org' ' IPv6 $msg_usa' 'ftp4.us.freebsd.org' - ' IPv6 $msg_turkey' 'ftp2.tr.freebsd.org' '$msg_primary' 'ftp1.freebsd.org' ' $msg_primary #2' 'ftp2.freebsd.org' ' $msg_primary #3' 'ftp3.freebsd.org' @@ -95,7 +94,6 @@ f_dialog_menu_media_ftp() ' $msg_primary #12' 'ftp12.freebsd.org' ' $msg_primary #13' 'ftp13.freebsd.org' ' $msg_primary #14' 'ftp14.freebsd.org' - '$msg_armenia' 'ftp1.am.freebsd.org' '$msg_australia' 'ftp.au.freebsd.org' ' $msg_australia #2' 'ftp2.au.freebsd.org' ' $msg_australia #3' 'ftp3.au.freebsd.org' @@ -103,11 +101,9 @@ f_dialog_menu_media_ftp() '$msg_brazil' 'ftp2.br.freebsd.org' ' $msg_brazil #3' 'ftp3.br.freebsd.org' ' $msg_brazil #4' 'ftp4.br.freebsd.org' - '$msg_canada' 'ftp.ca.freebsd.org' '$msg_china' 'ftp.cn.freebsd.org' '$msg_czech_republic' 'ftp.cz.freebsd.org' '$msg_denmark' 'ftp.dk.freebsd.org' - '$msg_estonia' 'ftp.ee.freebsd.org' '$msg_finland' 'ftp.fi.freebsd.org' '$msg_france' 'ftp.fr.freebsd.org' ' $msg_france #3' 'ftp3.fr.freebsd.org' @@ -120,13 +116,11 @@ f_dialog_menu_media_ftp() ' $msg_germany #2' 'ftp2.de.freebsd.org' ' $msg_germany #4' 'ftp4.de.freebsd.org' ' $msg_germany #5' 'ftp5.de.freebsd.org' - ' $msg_germany #6' 'ftp6.de.freebsd.org' ' $msg_germany #7' 'ftp7.de.freebsd.org' ' $msg_germany #8' 'ftp8.de.freebsd.org' '$msg_greece' 'ftp.gr.freebsd.org' ' $msg_greece #2' 'ftp2.gr.freebsd.org' '$msg_ireland' 'ftp3.ie.freebsd.org' - '$msg_israel' 'ftp.il.freebsd.org' '$msg_japan' 'ftp.jp.freebsd.org' ' $msg_japan #2' 'ftp2.jp.freebsd.org' ' $msg_japan #3' 'ftp3.jp.freebsd.org' @@ -139,16 +133,13 @@ f_dialog_menu_media_ftp() '$msg_korea' 'ftp.kr.freebsd.org' ' $msg_korea #2' 'ftp2.kr.freebsd.org' '$msg_latvia' 'ftp.lv.freebsd.org' - '$msg_lithuania' 'ftp.lt.freebsd.org' '$msg_netherlands' 'ftp.nl.freebsd.org' ' $msg_netherlands #2' 'ftp2.nl.freebsd.org' '$msg_new_zealand' 'ftp.nz.freebsd.org' '$msg_norway' 'ftp.no.freebsd.org' '$msg_poland' 'ftp.pl.freebsd.org' - ' $msg_poland #2' 'ftp2.pl.freebsd.org' '$msg_russia' 'ftp.ru.freebsd.org' ' $msg_russia #2' 'ftp2.ru.freebsd.org' - ' $msg_russia #4' 'ftp4.ru.freebsd.org' ' $msg_russia #5' 'ftp5.ru.freebsd.org' ' $msg_russia #6' 'ftp6.ru.freebsd.org' '$msg_slovak_republic' 'ftp.sk.freebsd.org' @@ -157,13 +148,9 @@ f_dialog_menu_media_ftp() '$msg_south_africa' 'ftp.za.freebsd.org' ' $msg_south_africa #2' 'ftp2.za.freebsd.org' ' $msg_south_africa #4' 'ftp4.za.freebsd.org' - '$msg_spain' 'ftp.es.freebsd.org' - ' $msg_spain #3' 'ftp3.es.freebsd.org' '$msg_sweden' 'ftp.se.freebsd.org' ' $msg_sweden #2' 'ftp2.se.freebsd.org' - ' $msg_sweden #3' 'ftp3.se.freebsd.org' ' $msg_sweden #4' 'ftp4.se.freebsd.org' - ' $msg_sweden #6' 'ftp6.se.freebsd.org' '$msg_switzerland' 'ftp.ch.freebsd.org' '$msg_taiwan' 'ftp.tw.freebsd.org' ' $msg_taiwan #2' 'ftp2.tw.freebsd.org' Modified: stable/12/usr.sbin/bsdinstall/scripts/mirrorselect ============================================================================== --- stable/12/usr.sbin/bsdinstall/scripts/mirrorselect Tue Sep 29 15:10:56 2020 (r366257) +++ stable/12/usr.sbin/bsdinstall/scripts/mirrorselect Tue Sep 29 15:37:33 2020 (r366258) @@ -44,7 +44,6 @@ MIRROR=`dialog --backtitle "FreeBSD Installer" \ ftp://ftp2.jp.freebsd.org "IPv6 Japan"\ ftp://ftp4.se.freebsd.org "IPv6 Sweden"\ ftp://ftp4.us.freebsd.org "IPv6 USA"\ - ftp://ftp2.tr.freebsd.org "IPv6 Turkey"\ ftp://ftp1.freebsd.org "Primary"\ ftp://ftp2.freebsd.org "Primary #2"\ ftp://ftp3.freebsd.org "Primary #3"\ @@ -57,7 +56,6 @@ MIRROR=`dialog --backtitle "FreeBSD Installer" \ ftp://ftp12.freebsd.org "Primary #12"\ ftp://ftp13.freebsd.org "Primary #13"\ ftp://ftp14.freebsd.org "Primary #14"\ - ftp://ftp1.am.freebsd.org "Armenia"\ ftp://ftp.au.freebsd.org "Australia"\ ftp://ftp2.au.freebsd.org "Australia #2"\ ftp://ftp3.au.freebsd.org "Australia #3"\ @@ -65,11 +63,9 @@ MIRROR=`dialog --backtitle "FreeBSD Installer" \ ftp://ftp2.br.freebsd.org "Brazil #2"\ ftp://ftp3.br.freebsd.org "Brazil #3"\ ftp://ftp4.br.freebsd.org "Brazil #4"\ - ftp://ftp.ca.freebsd.org "Canada"\ ftp://ftp.cn.freebsd.org "China"\ ftp://ftp.cz.freebsd.org "Czech Republic"\ ftp://ftp.dk.freebsd.org "Denmark"\ - ftp://ftp.ee.freebsd.org "Estonia"\ ftp://ftp.fi.freebsd.org "Finland"\ ftp://ftp.fr.freebsd.org "France"\ ftp://ftp3.fr.freebsd.org "France #3"\ @@ -82,13 +78,11 @@ MIRROR=`dialog --backtitle "FreeBSD Installer" \ ftp://ftp2.de.freebsd.org "Germany #2"\ ftp://ftp4.de.freebsd.org "Germany #4"\ ftp://ftp5.de.freebsd.org "Germany #5"\ - ftp://ftp6.de.freebsd.org "Germany #6"\ ftp://ftp7.de.freebsd.org "Germany #7"\ ftp://ftp8.de.freebsd.org "Germany #8"\ ftp://ftp.gr.freebsd.org "Greece"\ ftp://ftp2.gr.freebsd.org "Greece #2"\ ftp://ftp3.ie.freebsd.org "Ireland #3"\ - ftp://ftp.il.freebsd.org "Israel"\ ftp://ftp.jp.freebsd.org "Japan"\ ftp://ftp2.jp.freebsd.org "Japan #2"\ ftp://ftp3.jp.freebsd.org "Japan #3"\ @@ -101,16 +95,13 @@ MIRROR=`dialog --backtitle "FreeBSD Installer" \ ftp://ftp.kr.freebsd.org "Korea"\ ftp://ftp2.kr.freebsd.org "Korea #2"\ ftp://ftp.lv.freebsd.org "Latvia"\ - ftp://ftp.lt.freebsd.org "Lithuania"\ ftp://ftp.nl.freebsd.org "Netherlands"\ ftp://ftp2.nl.freebsd.org "Netherlands #2"\ ftp://ftp.nz.freebsd.org "New Zealand"\ ftp://ftp.no.freebsd.org "Norway"\ ftp://ftp.pl.freebsd.org "Poland"\ - ftp://ftp2.pl.freebsd.org "Poland #2"\ ftp://ftp.ru.freebsd.org "Russia"\ ftp://ftp2.ru.freebsd.org "Russia #2"\ - ftp://ftp4.ru.freebsd.org "Russia #4"\ ftp://ftp5.ru.freebsd.org "Russia #5"\ ftp://ftp6.ru.freebsd.org "Russia #6"\ ftp://ftp.sk.freebsd.org "Slovak Republic"\ @@ -119,13 +110,8 @@ MIRROR=`dialog --backtitle "FreeBSD Installer" \ ftp://ftp.za.freebsd.org "South Africa"\ ftp://ftp2.za.freebsd.org "South Africa #2"\ ftp://ftp4.za.freebsd.org "South Africa #4"\ - ftp://ftp.es.freebsd.org "Spain"\ - ftp://ftp3.es.freebsd.org "Spain #3"\ ftp://ftp.se.freebsd.org "Sweden"\ - ftp://ftp2.se.freebsd.org "Sweden #2"\ - ftp://ftp3.se.freebsd.org "Sweden #3"\ ftp://ftp4.se.freebsd.org "Sweden #4"\ - ftp://ftp6.se.freebsd.org "Sweden #6"\ ftp://ftp.ch.freebsd.org "Switzerland"\ ftp://ftp.tw.freebsd.org "Taiwan"\ ftp://ftp2.tw.freebsd.org "Taiwan #2"\ From owner-svn-src-all@freebsd.org Tue Sep 29 15:37:58 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E7D294269EB; Tue, 29 Sep 2020 15:37:58 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C13S65jrQz3T7b; Tue, 29 Sep 2020 15:37:58 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A7718109FB; Tue, 29 Sep 2020 15:37:58 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08TFbwLu088010; Tue, 29 Sep 2020 15:37:58 GMT (envelope-from zeising@FreeBSD.org) Received: (from zeising@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08TFbwMk087990; Tue, 29 Sep 2020 15:37:58 GMT (envelope-from zeising@FreeBSD.org) Message-Id: <202009291537.08TFbwMk087990@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zeising set sender to zeising@FreeBSD.org using -f From: Niclas Zeising Date: Tue, 29 Sep 2020 15:37:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r366259 - in stable/11/usr.sbin: bsdconfig/share/media bsdinstall/scripts X-SVN-Group: stable-11 X-SVN-Commit-Author: zeising X-SVN-Commit-Paths: in stable/11/usr.sbin: bsdconfig/share/media bsdinstall/scripts X-SVN-Commit-Revision: 366259 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Sep 2020 15:37:59 -0000 Author: zeising (doc,ports committer) Date: Tue Sep 29 15:37:57 2020 New Revision: 366259 URL: https://svnweb.freebsd.org/changeset/base/366259 Log: MFC r366186: bsdconfig, bsdinstall: Prune dead mirrors Prune dead mirrors from the list of mirrors in bsdconfig and bsdinstall. All these return NXDOMAIN when trying to resolve them. Approved by: emaste Modified: stable/11/usr.sbin/bsdconfig/share/media/ftp.subr stable/11/usr.sbin/bsdinstall/scripts/mirrorselect Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bsdconfig/share/media/ftp.subr ============================================================================== --- stable/11/usr.sbin/bsdconfig/share/media/ftp.subr Tue Sep 29 15:37:33 2020 (r366258) +++ stable/11/usr.sbin/bsdconfig/share/media/ftp.subr Tue Sep 29 15:37:57 2020 (r366259) @@ -82,7 +82,6 @@ f_dialog_menu_media_ftp() ' IPv6 $msg_japan' 'ftp2.jp.freebsd.org' ' IPv6 $msg_sweden' 'ftp4.se.freebsd.org' ' IPv6 $msg_usa' 'ftp4.us.freebsd.org' - ' IPv6 $msg_turkey' 'ftp2.tr.freebsd.org' '$msg_primary' 'ftp1.freebsd.org' ' $msg_primary #2' 'ftp2.freebsd.org' ' $msg_primary #3' 'ftp3.freebsd.org' @@ -95,7 +94,6 @@ f_dialog_menu_media_ftp() ' $msg_primary #12' 'ftp12.freebsd.org' ' $msg_primary #13' 'ftp13.freebsd.org' ' $msg_primary #14' 'ftp14.freebsd.org' - '$msg_armenia' 'ftp1.am.freebsd.org' '$msg_australia' 'ftp.au.freebsd.org' ' $msg_australia #2' 'ftp2.au.freebsd.org' ' $msg_australia #3' 'ftp3.au.freebsd.org' @@ -103,11 +101,9 @@ f_dialog_menu_media_ftp() '$msg_brazil' 'ftp2.br.freebsd.org' ' $msg_brazil #3' 'ftp3.br.freebsd.org' ' $msg_brazil #4' 'ftp4.br.freebsd.org' - '$msg_canada' 'ftp.ca.freebsd.org' '$msg_china' 'ftp.cn.freebsd.org' '$msg_czech_republic' 'ftp.cz.freebsd.org' '$msg_denmark' 'ftp.dk.freebsd.org' - '$msg_estonia' 'ftp.ee.freebsd.org' '$msg_finland' 'ftp.fi.freebsd.org' '$msg_france' 'ftp.fr.freebsd.org' ' $msg_france #3' 'ftp3.fr.freebsd.org' @@ -120,13 +116,11 @@ f_dialog_menu_media_ftp() ' $msg_germany #2' 'ftp2.de.freebsd.org' ' $msg_germany #4' 'ftp4.de.freebsd.org' ' $msg_germany #5' 'ftp5.de.freebsd.org' - ' $msg_germany #6' 'ftp6.de.freebsd.org' ' $msg_germany #7' 'ftp7.de.freebsd.org' ' $msg_germany #8' 'ftp8.de.freebsd.org' '$msg_greece' 'ftp.gr.freebsd.org' ' $msg_greece #2' 'ftp2.gr.freebsd.org' '$msg_ireland' 'ftp3.ie.freebsd.org' - '$msg_israel' 'ftp.il.freebsd.org' '$msg_japan' 'ftp.jp.freebsd.org' ' $msg_japan #2' 'ftp2.jp.freebsd.org' ' $msg_japan #3' 'ftp3.jp.freebsd.org' @@ -139,16 +133,13 @@ f_dialog_menu_media_ftp() '$msg_korea' 'ftp.kr.freebsd.org' ' $msg_korea #2' 'ftp2.kr.freebsd.org' '$msg_latvia' 'ftp.lv.freebsd.org' - '$msg_lithuania' 'ftp.lt.freebsd.org' '$msg_netherlands' 'ftp.nl.freebsd.org' ' $msg_netherlands #2' 'ftp2.nl.freebsd.org' '$msg_new_zealand' 'ftp.nz.freebsd.org' '$msg_norway' 'ftp.no.freebsd.org' '$msg_poland' 'ftp.pl.freebsd.org' - ' $msg_poland #2' 'ftp2.pl.freebsd.org' '$msg_russia' 'ftp.ru.freebsd.org' ' $msg_russia #2' 'ftp2.ru.freebsd.org' - ' $msg_russia #4' 'ftp4.ru.freebsd.org' ' $msg_russia #5' 'ftp5.ru.freebsd.org' ' $msg_russia #6' 'ftp6.ru.freebsd.org' '$msg_slovak_republic' 'ftp.sk.freebsd.org' @@ -157,13 +148,9 @@ f_dialog_menu_media_ftp() '$msg_south_africa' 'ftp.za.freebsd.org' ' $msg_south_africa #2' 'ftp2.za.freebsd.org' ' $msg_south_africa #4' 'ftp4.za.freebsd.org' - '$msg_spain' 'ftp.es.freebsd.org' - ' $msg_spain #3' 'ftp3.es.freebsd.org' '$msg_sweden' 'ftp.se.freebsd.org' ' $msg_sweden #2' 'ftp2.se.freebsd.org' - ' $msg_sweden #3' 'ftp3.se.freebsd.org' ' $msg_sweden #4' 'ftp4.se.freebsd.org' - ' $msg_sweden #6' 'ftp6.se.freebsd.org' '$msg_switzerland' 'ftp.ch.freebsd.org' '$msg_taiwan' 'ftp.tw.freebsd.org' ' $msg_taiwan #2' 'ftp2.tw.freebsd.org' Modified: stable/11/usr.sbin/bsdinstall/scripts/mirrorselect ============================================================================== --- stable/11/usr.sbin/bsdinstall/scripts/mirrorselect Tue Sep 29 15:37:33 2020 (r366258) +++ stable/11/usr.sbin/bsdinstall/scripts/mirrorselect Tue Sep 29 15:37:57 2020 (r366259) @@ -44,7 +44,6 @@ MIRROR=`dialog --backtitle "FreeBSD Installer" \ ftp://ftp2.jp.freebsd.org "IPv6 Japan"\ ftp://ftp4.se.freebsd.org "IPv6 Sweden"\ ftp://ftp4.us.freebsd.org "IPv6 USA"\ - ftp://ftp2.tr.freebsd.org "IPv6 Turkey"\ ftp://ftp1.freebsd.org "Primary"\ ftp://ftp2.freebsd.org "Primary #2"\ ftp://ftp3.freebsd.org "Primary #3"\ @@ -57,7 +56,6 @@ MIRROR=`dialog --backtitle "FreeBSD Installer" \ ftp://ftp12.freebsd.org "Primary #12"\ ftp://ftp13.freebsd.org "Primary #13"\ ftp://ftp14.freebsd.org "Primary #14"\ - ftp://ftp1.am.freebsd.org "Armenia"\ ftp://ftp.au.freebsd.org "Australia"\ ftp://ftp2.au.freebsd.org "Australia #2"\ ftp://ftp3.au.freebsd.org "Australia #3"\ @@ -65,11 +63,9 @@ MIRROR=`dialog --backtitle "FreeBSD Installer" \ ftp://ftp2.br.freebsd.org "Brazil #2"\ ftp://ftp3.br.freebsd.org "Brazil #3"\ ftp://ftp4.br.freebsd.org "Brazil #4"\ - ftp://ftp.ca.freebsd.org "Canada"\ ftp://ftp.cn.freebsd.org "China"\ ftp://ftp.cz.freebsd.org "Czech Republic"\ ftp://ftp.dk.freebsd.org "Denmark"\ - ftp://ftp.ee.freebsd.org "Estonia"\ ftp://ftp.fi.freebsd.org "Finland"\ ftp://ftp.fr.freebsd.org "France"\ ftp://ftp3.fr.freebsd.org "France #3"\ @@ -82,13 +78,11 @@ MIRROR=`dialog --backtitle "FreeBSD Installer" \ ftp://ftp2.de.freebsd.org "Germany #2"\ ftp://ftp4.de.freebsd.org "Germany #4"\ ftp://ftp5.de.freebsd.org "Germany #5"\ - ftp://ftp6.de.freebsd.org "Germany #6"\ ftp://ftp7.de.freebsd.org "Germany #7"\ ftp://ftp8.de.freebsd.org "Germany #8"\ ftp://ftp.gr.freebsd.org "Greece"\ ftp://ftp2.gr.freebsd.org "Greece #2"\ ftp://ftp3.ie.freebsd.org "Ireland #3"\ - ftp://ftp.il.freebsd.org "Israel"\ ftp://ftp.jp.freebsd.org "Japan"\ ftp://ftp2.jp.freebsd.org "Japan #2"\ ftp://ftp3.jp.freebsd.org "Japan #3"\ @@ -101,16 +95,13 @@ MIRROR=`dialog --backtitle "FreeBSD Installer" \ ftp://ftp.kr.freebsd.org "Korea"\ ftp://ftp2.kr.freebsd.org "Korea #2"\ ftp://ftp.lv.freebsd.org "Latvia"\ - ftp://ftp.lt.freebsd.org "Lithuania"\ ftp://ftp.nl.freebsd.org "Netherlands"\ ftp://ftp2.nl.freebsd.org "Netherlands #2"\ ftp://ftp.nz.freebsd.org "New Zealand"\ ftp://ftp.no.freebsd.org "Norway"\ ftp://ftp.pl.freebsd.org "Poland"\ - ftp://ftp2.pl.freebsd.org "Poland #2"\ ftp://ftp.ru.freebsd.org "Russia"\ ftp://ftp2.ru.freebsd.org "Russia #2"\ - ftp://ftp4.ru.freebsd.org "Russia #4"\ ftp://ftp5.ru.freebsd.org "Russia #5"\ ftp://ftp6.ru.freebsd.org "Russia #6"\ ftp://ftp.sk.freebsd.org "Slovak Republic"\ @@ -119,13 +110,8 @@ MIRROR=`dialog --backtitle "FreeBSD Installer" \ ftp://ftp.za.freebsd.org "South Africa"\ ftp://ftp2.za.freebsd.org "South Africa #2"\ ftp://ftp4.za.freebsd.org "South Africa #4"\ - ftp://ftp.es.freebsd.org "Spain"\ - ftp://ftp3.es.freebsd.org "Spain #3"\ ftp://ftp.se.freebsd.org "Sweden"\ - ftp://ftp2.se.freebsd.org "Sweden #2"\ - ftp://ftp3.se.freebsd.org "Sweden #3"\ ftp://ftp4.se.freebsd.org "Sweden #4"\ - ftp://ftp6.se.freebsd.org "Sweden #6"\ ftp://ftp.ch.freebsd.org "Switzerland"\ ftp://ftp.tw.freebsd.org "Taiwan"\ ftp://ftp2.tw.freebsd.org "Taiwan #2"\ From owner-svn-src-all@freebsd.org Tue Sep 29 16:29:51 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 04226427856; Tue, 29 Sep 2020 16:29:51 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C14by6LVrz3XNc; Tue, 29 Sep 2020 16:29:50 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BCE2D11788; Tue, 29 Sep 2020 16:29:50 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08TGTovt020449; Tue, 29 Sep 2020 16:29:50 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08TGTox3020447; Tue, 29 Sep 2020 16:29:50 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202009291629.08TGTox3020447@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 29 Sep 2020 16:29:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366260 - head/stand/libsa X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/libsa X-SVN-Commit-Revision: 366260 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Sep 2020 16:29:51 -0000 Author: imp Date: Tue Sep 29 16:29:50 2020 New Revision: 366260 URL: https://svnweb.freebsd.org/changeset/base/366260 Log: Implement some time variables from kernel OpenZFS will start using some of the kernel timekeeping bits shortly. This implements the bare minimum of that which currently is just the time_seconds variable. Added: head/stand/libsa/time.c (contents, props changed) Modified: head/stand/libsa/Makefile Modified: head/stand/libsa/Makefile ============================================================================== --- head/stand/libsa/Makefile Tue Sep 29 15:37:57 2020 (r366259) +++ head/stand/libsa/Makefile Tue Sep 29 16:29:50 2020 (r366260) @@ -160,6 +160,9 @@ SRCS+= dosfs.c ext2fs.c SRCS+= splitfs.c SRCS+= pkgfs.c +# Time support +SRCS+= time.c + # kernel ufs support .PATH: ${SRCTOP}/sys/ufs/ffs SRCS+=ffs_subr.c ffs_tables.c Added: head/stand/libsa/time.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/libsa/time.c Tue Sep 29 16:29:50 2020 (r366260) @@ -0,0 +1,35 @@ +/*- + * Copyright (c) 2020 M. Warner Losh + * + * 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. + */ + +/* + * The parts of kern_tc.c and other timekeeping bits of the kernel. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +volatile time_t time_second = 1; From owner-svn-src-all@freebsd.org Tue Sep 29 16:38:57 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6BB70427B70; Tue, 29 Sep 2020 16:38:57 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C14pT2911z3Xv7; Tue, 29 Sep 2020 16:38:57 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 29853114D4; Tue, 29 Sep 2020 16:38:57 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08TGcvDY026619; Tue, 29 Sep 2020 16:38:57 GMT (envelope-from dab@FreeBSD.org) Received: (from dab@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08TGcuY7026617; Tue, 29 Sep 2020 16:38:56 GMT (envelope-from dab@FreeBSD.org) Message-Id: <202009291638.08TGcuY7026617@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dab set sender to dab@FreeBSD.org using -f From: David Bright Date: Tue, 29 Sep 2020 16:38:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366261 - stable/12/sbin/nvmecontrol X-SVN-Group: stable-12 X-SVN-Commit-Author: dab X-SVN-Commit-Paths: stable/12/sbin/nvmecontrol X-SVN-Commit-Revision: 366261 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Sep 2020 16:38:57 -0000 Author: dab Date: Tue Sep 29 16:38:56 2020 New Revision: 366261 URL: https://svnweb.freebsd.org/changeset/base/366261 Log: MFC r365948: Honor the FWUG value of some drives in nvmecontrol nvmecontrol tries to upload firmware in chunks as large as it thinks the device permits. It fails to take into account the FWUG value used by some drives to advertise the size and alignment limits for firmware chunks. - Use the firwmare update granularity value from the identify-controller response to set the max transfer size. - If the granularity is not reported or not restricted, fall back to the previously existing logic that calculates the max transfer size based on MDTS. - Add firmware update granularity to the identify-controller output. Sponsored by: Dell EMC Isilon Modified: stable/12/sbin/nvmecontrol/firmware.c stable/12/sbin/nvmecontrol/identify_ext.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/nvmecontrol/firmware.c ============================================================================== --- stable/12/sbin/nvmecontrol/firmware.c Tue Sep 29 16:29:50 2020 (r366260) +++ stable/12/sbin/nvmecontrol/firmware.c Tue Sep 29 16:38:56 2020 (r366261) @@ -155,21 +155,29 @@ read_image_file(const char *path, void **buf, int32_t } static void -update_firmware(int fd, uint8_t *payload, int32_t payload_size) +update_firmware(int fd, uint8_t *payload, int32_t payload_size, uint8_t fwug) { struct nvme_pt_command pt; + uint64_t max_xfer_size; int32_t off, resid, size; void *chunk; off = 0; resid = payload_size; - if ((chunk = aligned_alloc(PAGE_SIZE, NVME_MAX_XFER_SIZE)) == NULL) - errx(1, "unable to malloc %d bytes", NVME_MAX_XFER_SIZE); + if (fwug != 0 && fwug != 0xFF) + max_xfer_size = ((uint64_t)fwug << 12); + else if (ioctl(fd, NVME_GET_MAX_XFER_SIZE, &max_xfer_size) < 0) + err(1, "query max transfer size failed"); + if (max_xfer_size > NVME_MAX_XFER_SIZE) + max_xfer_size = NVME_MAX_XFER_SIZE; + if ((chunk = aligned_alloc(PAGE_SIZE, max_xfer_size)) == NULL) + errx(1, "unable to malloc %zd bytes", (size_t)max_xfer_size); + while (resid > 0) { - size = (resid >= NVME_MAX_XFER_SIZE) ? - NVME_MAX_XFER_SIZE : resid; + size = (resid >= (int32_t)max_xfer_size) ? + max_xfer_size : resid; memcpy(chunk, payload + off, size); memset(&pt, 0, sizeof(pt)); @@ -333,7 +341,7 @@ firmware(const struct cmd *f, int argc, char *argv[]) } if (opt.fw_img != NULL) { - update_firmware(fd, buf, size); + update_firmware(fd, buf, size, cdata.fwug); if (opt.activate) activate_action = NVME_AA_REPLACE_ACTIVATE; else Modified: stable/12/sbin/nvmecontrol/identify_ext.c ============================================================================== --- stable/12/sbin/nvmecontrol/identify_ext.c Tue Sep 29 16:29:50 2020 (r366260) +++ stable/12/sbin/nvmecontrol/identify_ext.c Tue Sep 29 16:38:56 2020 (r366261) @@ -56,6 +56,7 @@ nvme_print_controller(struct nvme_controller_data *cda uint8_t ns_smart; uint8_t sqes_max, sqes_min; uint8_t cqes_max, cqes_min; + uint8_t fwug; oncs = cdata->oncs; compare = (oncs >> NVME_CTRLR_DATA_ONCS_COMPARE_SHIFT) & @@ -79,6 +80,7 @@ nvme_print_controller(struct nvme_controller_data *cda NVME_CTRLR_DATA_FRMW_NUM_SLOTS_MASK; fw_slot1_ro = (cdata->frmw >> NVME_CTRLR_DATA_FRMW_SLOT1_RO_SHIFT) & NVME_CTRLR_DATA_FRMW_SLOT1_RO_MASK; + fwug = cdata->fwug; ns_smart = (cdata->lpa >> NVME_CTRLR_DATA_LPA_NS_SMART_SHIFT) & NVME_CTRLR_DATA_LPA_NS_SMART_MASK; @@ -192,6 +194,13 @@ nvme_print_controller(struct nvme_controller_data *cda uint128_to_str(to128(cdata->untncap.unvmcap), cbuf, sizeof(cbuf))); } + printf("Firmware Update Granularity: %02x ", fwug); + if (fwug == 0) + printf("(Not Reported)\n"); + else if (fwug == 0xFF) + printf("(No Granularity)\n"); + else + printf("(%d bytes)\n", ((uint32_t)fwug << 12)); printf("Host Buffer Preferred Size: %llu bytes\n", (long long unsigned)cdata->hmpre * 4096); printf("Host Buffer Minimum Size: %llu bytes\n", From owner-svn-src-all@freebsd.org Tue Sep 29 17:09:43 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C53CF42A502; Tue, 29 Sep 2020 17:09:43 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C15Tz4tbsz3c6X; Tue, 29 Sep 2020 17:09:43 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8AF6211A7E; Tue, 29 Sep 2020 17:09:43 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08TH9hhu046210; Tue, 29 Sep 2020 17:09:43 GMT (envelope-from dab@FreeBSD.org) Received: (from dab@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08TH9hAr046209; Tue, 29 Sep 2020 17:09:43 GMT (envelope-from dab@FreeBSD.org) Message-Id: <202009291709.08TH9hAr046209@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dab set sender to dab@FreeBSD.org using -f From: David Bright Date: Tue, 29 Sep 2020 17:09:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366262 - stable/12/sbin/nvmecontrol X-SVN-Group: stable-12 X-SVN-Commit-Author: dab X-SVN-Commit-Paths: stable/12/sbin/nvmecontrol X-SVN-Commit-Revision: 366262 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Sep 2020 17:09:43 -0000 Author: dab Date: Tue Sep 29 17:09:43 2020 New Revision: 366262 URL: https://svnweb.freebsd.org/changeset/base/366262 Log: MFC r365967: Whitespace fix after r365948 Sponsored by: Dell EMC Isilon Modified: stable/12/sbin/nvmecontrol/firmware.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/nvmecontrol/firmware.c ============================================================================== --- stable/12/sbin/nvmecontrol/firmware.c Tue Sep 29 16:38:56 2020 (r366261) +++ stable/12/sbin/nvmecontrol/firmware.c Tue Sep 29 17:09:43 2020 (r366262) @@ -168,9 +168,9 @@ update_firmware(int fd, uint8_t *payload, int32_t payl if (fwug != 0 && fwug != 0xFF) max_xfer_size = ((uint64_t)fwug << 12); else if (ioctl(fd, NVME_GET_MAX_XFER_SIZE, &max_xfer_size) < 0) - err(1, "query max transfer size failed"); - if (max_xfer_size > NVME_MAX_XFER_SIZE) - max_xfer_size = NVME_MAX_XFER_SIZE; + err(1, "query max transfer size failed"); + if (max_xfer_size > NVME_MAX_XFER_SIZE) + max_xfer_size = NVME_MAX_XFER_SIZE; if ((chunk = aligned_alloc(PAGE_SIZE, max_xfer_size)) == NULL) errx(1, "unable to malloc %zd bytes", (size_t)max_xfer_size); From owner-svn-src-all@freebsd.org Tue Sep 29 17:22:15 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3EDFA42AECB; Tue, 29 Sep 2020 17:22:15 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C15mR0z9qz3dMf; Tue, 29 Sep 2020 17:22:15 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 04C8712175; Tue, 29 Sep 2020 17:22:15 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08THMEBC057232; Tue, 29 Sep 2020 17:22:14 GMT (envelope-from zeising@FreeBSD.org) Received: (from zeising@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08THMEsd057231; Tue, 29 Sep 2020 17:22:14 GMT (envelope-from zeising@FreeBSD.org) Message-Id: <202009291722.08THMEsd057231@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zeising set sender to zeising@FreeBSD.org using -f From: Niclas Zeising Date: Tue, 29 Sep 2020 17:22:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r366263 - in releng/12.2/usr.sbin: bsdconfig/share/media bsdinstall/scripts X-SVN-Group: releng X-SVN-Commit-Author: zeising X-SVN-Commit-Paths: in releng/12.2/usr.sbin: bsdconfig/share/media bsdinstall/scripts X-SVN-Commit-Revision: 366263 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Sep 2020 17:22:15 -0000 Author: zeising (doc,ports committer) Date: Tue Sep 29 17:22:14 2020 New Revision: 366263 URL: https://svnweb.freebsd.org/changeset/base/366263 Log: MF stable/12 r366258: bsdconfig, bsdinstall: Prune dead mirrors Prune dead mirrors from the list of mirrors in bsdconfig and bsdinstall. All these return NXDOMAIN when trying to resolve them. Approved by: re (gjb), emaste Modified: releng/12.2/usr.sbin/bsdconfig/share/media/ftp.subr releng/12.2/usr.sbin/bsdinstall/scripts/mirrorselect Directory Properties: releng/12.2/ (props changed) Modified: releng/12.2/usr.sbin/bsdconfig/share/media/ftp.subr ============================================================================== --- releng/12.2/usr.sbin/bsdconfig/share/media/ftp.subr Tue Sep 29 17:09:43 2020 (r366262) +++ releng/12.2/usr.sbin/bsdconfig/share/media/ftp.subr Tue Sep 29 17:22:14 2020 (r366263) @@ -82,7 +82,6 @@ f_dialog_menu_media_ftp() ' IPv6 $msg_japan' 'ftp2.jp.freebsd.org' ' IPv6 $msg_sweden' 'ftp4.se.freebsd.org' ' IPv6 $msg_usa' 'ftp4.us.freebsd.org' - ' IPv6 $msg_turkey' 'ftp2.tr.freebsd.org' '$msg_primary' 'ftp1.freebsd.org' ' $msg_primary #2' 'ftp2.freebsd.org' ' $msg_primary #3' 'ftp3.freebsd.org' @@ -95,7 +94,6 @@ f_dialog_menu_media_ftp() ' $msg_primary #12' 'ftp12.freebsd.org' ' $msg_primary #13' 'ftp13.freebsd.org' ' $msg_primary #14' 'ftp14.freebsd.org' - '$msg_armenia' 'ftp1.am.freebsd.org' '$msg_australia' 'ftp.au.freebsd.org' ' $msg_australia #2' 'ftp2.au.freebsd.org' ' $msg_australia #3' 'ftp3.au.freebsd.org' @@ -103,11 +101,9 @@ f_dialog_menu_media_ftp() '$msg_brazil' 'ftp2.br.freebsd.org' ' $msg_brazil #3' 'ftp3.br.freebsd.org' ' $msg_brazil #4' 'ftp4.br.freebsd.org' - '$msg_canada' 'ftp.ca.freebsd.org' '$msg_china' 'ftp.cn.freebsd.org' '$msg_czech_republic' 'ftp.cz.freebsd.org' '$msg_denmark' 'ftp.dk.freebsd.org' - '$msg_estonia' 'ftp.ee.freebsd.org' '$msg_finland' 'ftp.fi.freebsd.org' '$msg_france' 'ftp.fr.freebsd.org' ' $msg_france #3' 'ftp3.fr.freebsd.org' @@ -120,13 +116,11 @@ f_dialog_menu_media_ftp() ' $msg_germany #2' 'ftp2.de.freebsd.org' ' $msg_germany #4' 'ftp4.de.freebsd.org' ' $msg_germany #5' 'ftp5.de.freebsd.org' - ' $msg_germany #6' 'ftp6.de.freebsd.org' ' $msg_germany #7' 'ftp7.de.freebsd.org' ' $msg_germany #8' 'ftp8.de.freebsd.org' '$msg_greece' 'ftp.gr.freebsd.org' ' $msg_greece #2' 'ftp2.gr.freebsd.org' '$msg_ireland' 'ftp3.ie.freebsd.org' - '$msg_israel' 'ftp.il.freebsd.org' '$msg_japan' 'ftp.jp.freebsd.org' ' $msg_japan #2' 'ftp2.jp.freebsd.org' ' $msg_japan #3' 'ftp3.jp.freebsd.org' @@ -139,16 +133,13 @@ f_dialog_menu_media_ftp() '$msg_korea' 'ftp.kr.freebsd.org' ' $msg_korea #2' 'ftp2.kr.freebsd.org' '$msg_latvia' 'ftp.lv.freebsd.org' - '$msg_lithuania' 'ftp.lt.freebsd.org' '$msg_netherlands' 'ftp.nl.freebsd.org' ' $msg_netherlands #2' 'ftp2.nl.freebsd.org' '$msg_new_zealand' 'ftp.nz.freebsd.org' '$msg_norway' 'ftp.no.freebsd.org' '$msg_poland' 'ftp.pl.freebsd.org' - ' $msg_poland #2' 'ftp2.pl.freebsd.org' '$msg_russia' 'ftp.ru.freebsd.org' ' $msg_russia #2' 'ftp2.ru.freebsd.org' - ' $msg_russia #4' 'ftp4.ru.freebsd.org' ' $msg_russia #5' 'ftp5.ru.freebsd.org' ' $msg_russia #6' 'ftp6.ru.freebsd.org' '$msg_slovak_republic' 'ftp.sk.freebsd.org' @@ -157,13 +148,9 @@ f_dialog_menu_media_ftp() '$msg_south_africa' 'ftp.za.freebsd.org' ' $msg_south_africa #2' 'ftp2.za.freebsd.org' ' $msg_south_africa #4' 'ftp4.za.freebsd.org' - '$msg_spain' 'ftp.es.freebsd.org' - ' $msg_spain #3' 'ftp3.es.freebsd.org' '$msg_sweden' 'ftp.se.freebsd.org' ' $msg_sweden #2' 'ftp2.se.freebsd.org' - ' $msg_sweden #3' 'ftp3.se.freebsd.org' ' $msg_sweden #4' 'ftp4.se.freebsd.org' - ' $msg_sweden #6' 'ftp6.se.freebsd.org' '$msg_switzerland' 'ftp.ch.freebsd.org' '$msg_taiwan' 'ftp.tw.freebsd.org' ' $msg_taiwan #2' 'ftp2.tw.freebsd.org' Modified: releng/12.2/usr.sbin/bsdinstall/scripts/mirrorselect ============================================================================== --- releng/12.2/usr.sbin/bsdinstall/scripts/mirrorselect Tue Sep 29 17:09:43 2020 (r366262) +++ releng/12.2/usr.sbin/bsdinstall/scripts/mirrorselect Tue Sep 29 17:22:14 2020 (r366263) @@ -44,7 +44,6 @@ MIRROR=`dialog --backtitle "FreeBSD Installer" \ ftp://ftp2.jp.freebsd.org "IPv6 Japan"\ ftp://ftp4.se.freebsd.org "IPv6 Sweden"\ ftp://ftp4.us.freebsd.org "IPv6 USA"\ - ftp://ftp2.tr.freebsd.org "IPv6 Turkey"\ ftp://ftp1.freebsd.org "Primary"\ ftp://ftp2.freebsd.org "Primary #2"\ ftp://ftp3.freebsd.org "Primary #3"\ @@ -57,7 +56,6 @@ MIRROR=`dialog --backtitle "FreeBSD Installer" \ ftp://ftp12.freebsd.org "Primary #12"\ ftp://ftp13.freebsd.org "Primary #13"\ ftp://ftp14.freebsd.org "Primary #14"\ - ftp://ftp1.am.freebsd.org "Armenia"\ ftp://ftp.au.freebsd.org "Australia"\ ftp://ftp2.au.freebsd.org "Australia #2"\ ftp://ftp3.au.freebsd.org "Australia #3"\ @@ -65,11 +63,9 @@ MIRROR=`dialog --backtitle "FreeBSD Installer" \ ftp://ftp2.br.freebsd.org "Brazil #2"\ ftp://ftp3.br.freebsd.org "Brazil #3"\ ftp://ftp4.br.freebsd.org "Brazil #4"\ - ftp://ftp.ca.freebsd.org "Canada"\ ftp://ftp.cn.freebsd.org "China"\ ftp://ftp.cz.freebsd.org "Czech Republic"\ ftp://ftp.dk.freebsd.org "Denmark"\ - ftp://ftp.ee.freebsd.org "Estonia"\ ftp://ftp.fi.freebsd.org "Finland"\ ftp://ftp.fr.freebsd.org "France"\ ftp://ftp3.fr.freebsd.org "France #3"\ @@ -82,13 +78,11 @@ MIRROR=`dialog --backtitle "FreeBSD Installer" \ ftp://ftp2.de.freebsd.org "Germany #2"\ ftp://ftp4.de.freebsd.org "Germany #4"\ ftp://ftp5.de.freebsd.org "Germany #5"\ - ftp://ftp6.de.freebsd.org "Germany #6"\ ftp://ftp7.de.freebsd.org "Germany #7"\ ftp://ftp8.de.freebsd.org "Germany #8"\ ftp://ftp.gr.freebsd.org "Greece"\ ftp://ftp2.gr.freebsd.org "Greece #2"\ ftp://ftp3.ie.freebsd.org "Ireland #3"\ - ftp://ftp.il.freebsd.org "Israel"\ ftp://ftp.jp.freebsd.org "Japan"\ ftp://ftp2.jp.freebsd.org "Japan #2"\ ftp://ftp3.jp.freebsd.org "Japan #3"\ @@ -101,16 +95,13 @@ MIRROR=`dialog --backtitle "FreeBSD Installer" \ ftp://ftp.kr.freebsd.org "Korea"\ ftp://ftp2.kr.freebsd.org "Korea #2"\ ftp://ftp.lv.freebsd.org "Latvia"\ - ftp://ftp.lt.freebsd.org "Lithuania"\ ftp://ftp.nl.freebsd.org "Netherlands"\ ftp://ftp2.nl.freebsd.org "Netherlands #2"\ ftp://ftp.nz.freebsd.org "New Zealand"\ ftp://ftp.no.freebsd.org "Norway"\ ftp://ftp.pl.freebsd.org "Poland"\ - ftp://ftp2.pl.freebsd.org "Poland #2"\ ftp://ftp.ru.freebsd.org "Russia"\ ftp://ftp2.ru.freebsd.org "Russia #2"\ - ftp://ftp4.ru.freebsd.org "Russia #4"\ ftp://ftp5.ru.freebsd.org "Russia #5"\ ftp://ftp6.ru.freebsd.org "Russia #6"\ ftp://ftp.sk.freebsd.org "Slovak Republic"\ @@ -119,13 +110,8 @@ MIRROR=`dialog --backtitle "FreeBSD Installer" \ ftp://ftp.za.freebsd.org "South Africa"\ ftp://ftp2.za.freebsd.org "South Africa #2"\ ftp://ftp4.za.freebsd.org "South Africa #4"\ - ftp://ftp.es.freebsd.org "Spain"\ - ftp://ftp3.es.freebsd.org "Spain #3"\ ftp://ftp.se.freebsd.org "Sweden"\ - ftp://ftp2.se.freebsd.org "Sweden #2"\ - ftp://ftp3.se.freebsd.org "Sweden #3"\ ftp://ftp4.se.freebsd.org "Sweden #4"\ - ftp://ftp6.se.freebsd.org "Sweden #6"\ ftp://ftp.ch.freebsd.org "Switzerland"\ ftp://ftp.tw.freebsd.org "Taiwan"\ ftp://ftp2.tw.freebsd.org "Taiwan #2"\ From owner-svn-src-all@freebsd.org Tue Sep 29 17:52:16 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3C4A842B7B2; Tue, 29 Sep 2020 17:52:16 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C16R40wB6z3fmY; Tue, 29 Sep 2020 17:52:16 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 02F8F12692; Tue, 29 Sep 2020 17:52:16 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08THqFW8076106; Tue, 29 Sep 2020 17:52:15 GMT (envelope-from fernape@FreeBSD.org) Received: (from fernape@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08THqFNT076105; Tue, 29 Sep 2020 17:52:15 GMT (envelope-from fernape@FreeBSD.org) Message-Id: <202009291752.08THqFNT076105@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fernape set sender to fernape@FreeBSD.org using -f From: =?UTF-8?Q?Fernando_Apestegu=c3=ada?= Date: Tue, 29 Sep 2020 17:52:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366264 - head/sbin/kldconfig X-SVN-Group: head X-SVN-Commit-Author: fernape X-SVN-Commit-Paths: head/sbin/kldconfig X-SVN-Commit-Revision: 366264 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Sep 2020 17:52:16 -0000 Author: fernape (ports committer) Date: Tue Sep 29 17:52:15 2020 New Revision: 366264 URL: https://svnweb.freebsd.org/changeset/base/366264 Log: kldconfig(8): Add EXAMPLES to the man page Add EXAMPLES section to the man page showing the use of all flags except for -S. While here, clarify -f description. It not only suppresses diagnostic messages but it also affects the exit status of the command itself. This is shown in two of the examples. Approved by: bcr@ Differential Revision: https://reviews.freebsd.org/D26588 Modified: head/sbin/kldconfig/kldconfig.8 Modified: head/sbin/kldconfig/kldconfig.8 ============================================================================== --- head/sbin/kldconfig/kldconfig.8 Tue Sep 29 17:22:14 2020 (r366263) +++ head/sbin/kldconfig/kldconfig.8 Tue Sep 29 17:52:15 2020 (r366264) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 27, 2017 +.Dd September 29, 2020 .Dt KLDCONFIG 8 .Os .Sh NAME @@ -54,9 +54,8 @@ The following options are available: .It Fl d Remove the specified paths from the module search path. .It Fl f -Do not display a diagnostic message if a path specified for adding is -already present in the search path, or if a path specified for removing -is not present in the search path. +Do not fail if a path specified for adding is already present in the search +path, or if a path specified for removing is not present in the search path. This may be useful in startup/shutdown scripts for adding a path to a file system which is still not mounted, or in shutdown scripts for unconditionally removing a path that may have been added during startup. @@ -95,6 +94,69 @@ The default module search path used by the kernel. .El .Sh EXIT STATUS .Ex -std +.Sh EXAMPLES +Show the module search path +.Bd -literal -offset indent +$ kldconfig -r +/boot/kernel;/boot/modules;/boot/dtb;/boot/dtb/overlays +.Ed +.Pp +Try to delete the +.Pa /boot +directory from the search path. +The command will fail: +.Bd -literal -offset indent +$ kldconfig -d /boot +kldconfig: not in module search path: /boot +$ echo $? +1 +.Ed +.Pp +Same as above but forcing the operation. +This time the command will succeed: +.Bd -literal -offset indent +$ kldconfig -d -f /boot +$ echo $? +0 +.Ed +.Pp +Add the +.Pa /boot +directory to the beginning of the search path and display extra verbose output: +.Bd -literal -offset indent +$ kldconfig -i -m -vv /boot +/boot/kernel;/boot/modules -> /boot;/boot/kernel;/boot/modules +.Ed +.Pp +Without +.Fl m +the +.Fl i +flag will overwrite the contents of the search path list: +.Bd -literal -offset indent +$ kldconfig -i -vv /boot +/boot;/boot/kernel;/boot/modules;/boot/dtb;/boot/dtb/overlays -> /boot +.Ed +.Pp +Same as above but using +.Fl n +to simulate the operation without actually doing it: +.Bd -literal -offset indent +$ kldconfig -i -n -vv /boot +/boot;/boot/kernel;/boot/modules;/boot/dtb;/boot/dtb/overlays -> /boot +.Ed +.Pp +Add directories to the search path removing duplicates. +Note the need of +.Fl f +to force the operation in case any of the directories is already in the +search path. +The +.Pa /boot/kernel +directory will be added once: +.Bd -literal -offset indent +$ kldconfig -f -U /boot/kernel /boot/kernel /boot/modules /boot/dtb /boot/dtb/overlays +.Ed .Sh SEE ALSO .Xr kldload 2 , .Xr kldload 8 , From owner-svn-src-all@freebsd.org Tue Sep 29 18:06:03 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0951542B66E; Tue, 29 Sep 2020 18:06:03 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C16ky6WGyz3gQF; Tue, 29 Sep 2020 18:06:02 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C2E1512764; Tue, 29 Sep 2020 18:06:02 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08TI62FB083161; Tue, 29 Sep 2020 18:06:02 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08TI62eE083160; Tue, 29 Sep 2020 18:06:02 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202009291806.08TI62eE083160@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 29 Sep 2020 18:06:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366265 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 366265 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Sep 2020 18:06:03 -0000 Author: imp Date: Tue Sep 29 18:06:02 2020 New Revision: 366265 URL: https://svnweb.freebsd.org/changeset/base/366265 Log: Standalone SX shims Create a do-nothing version of SX locks. OpenZFS needs them. However, since the boot loader is single threaded, they can be nops. Modified: head/sys/sys/sx.h Modified: head/sys/sys/sx.h ============================================================================== --- head/sys/sys/sx.h Tue Sep 29 17:52:15 2020 (r366264) +++ head/sys/sys/sx.h Tue Sep 29 18:06:02 2020 (r366265) @@ -300,4 +300,26 @@ __sx_xunlock(struct sx *sx, struct thread *td, const c #endif /* _KERNEL */ +#ifdef _STANDALONE +/* since we have no threads in the boot loader, trivially implement no-op version */ +#define sx_xlock(s) (1) +#define sx_try_xlock(s) (1) +#define sx_xunlock(s) (1) +#define SX_DUPOK 0 +#define SX_NEW 0 +#define SX_NOWITNESS 0 + +static __inline void +sx_init_flags(struct sx *sx, const char *description, int opts) +{ + +} + +static __inline void +sx_destroy(struct sx *sx) +{ + +} +#endif /* _STANDALONE */ + #endif /* !_SYS_SX_H_ */ From owner-svn-src-all@freebsd.org Tue Sep 29 18:13:54 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DE43142BD3A; Tue, 29 Sep 2020 18:13:54 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C16w25c3Gz3gmw; Tue, 29 Sep 2020 18:13:54 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A517C129BF; Tue, 29 Sep 2020 18:13:54 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08TIDsDr089155; Tue, 29 Sep 2020 18:13:54 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08TIDsbP089154; Tue, 29 Sep 2020 18:13:54 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202009291813.08TIDsbP089154@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 29 Sep 2020 18:13:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366266 - head/lib/libc/sys X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/lib/libc/sys X-SVN-Commit-Revision: 366266 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Sep 2020 18:13:54 -0000 Author: imp Date: Tue Sep 29 18:13:54 2020 New Revision: 366266 URL: https://svnweb.freebsd.org/changeset/base/366266 Log: Updates to chroot(2) docs 1. Note what settings give historic behavior 2. Recommend jail under security considerations. Modified: head/lib/libc/sys/chroot.2 Modified: head/lib/libc/sys/chroot.2 ============================================================================== --- head/lib/libc/sys/chroot.2 Tue Sep 29 18:06:02 2020 (r366265) +++ head/lib/libc/sys/chroot.2 Tue Sep 29 18:13:54 2020 (r366266) @@ -28,7 +28,7 @@ .\" @(#)chroot.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 26, 2020 +.Dd September 29, 2020 .Dt CHROOT 2 .Os .Sh NAME @@ -91,7 +91,10 @@ system call. .Pp Any other value for .Ql kern.chroot_allow_open_directories -will bypass the check for open directories +will bypass the check for open directories, +mimicking the historic insecure behavior of +.Fn chroot +still present on other systems. .Sh RETURN VALUES .Rv -std .Sh ERRORS @@ -156,3 +159,7 @@ root, for instance, setup the sandbox so that the sandboxed user will have no write access to any well-known system directories. +.Pp +For complete isolation from the rest of the system, use +.Xr jail 2 +instead. From owner-svn-src-all@freebsd.org Tue Sep 29 19:00:22 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3429A42D52D; Tue, 29 Sep 2020 19:00:22 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.3 with cipher TLS_AES_256_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 4C17xd53f0z463n; Tue, 29 Sep 2020 19:00:21 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2020.home.selasky.org (unknown [178.17.145.105]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id A994426001C; Tue, 29 Sep 2020 21:00:17 +0200 (CEST) Subject: Re: svn commit: r366265 - head/sys/sys To: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202009291806.08TI62eE083160@repo.freebsd.org> From: Hans Petter Selasky Message-ID: Date: Tue, 29 Sep 2020 20:59:42 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <202009291806.08TI62eE083160@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4C17xd53f0z463n X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:24940, ipnet:88.99.0.0/16, country:DE] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Sep 2020 19:00:22 -0000 On 2020-09-29 20:06, Warner Losh wrote: > Author: imp > Date: Tue Sep 29 18:06:02 2020 > New Revision: 366265 > URL: https://svnweb.freebsd.org/changeset/base/366265 > > Log: > Standalone SX shims > > Create a do-nothing version of SX locks. OpenZFS needs them. However, > since the boot loader is single threaded, they can be nops. > > Modified: > head/sys/sys/sx.h > > Modified: head/sys/sys/sx.h > ============================================================================== > --- head/sys/sys/sx.h Tue Sep 29 17:52:15 2020 (r366264) > +++ head/sys/sys/sx.h Tue Sep 29 18:06:02 2020 (r366265) > @@ -300,4 +300,26 @@ __sx_xunlock(struct sx *sx, struct thread *td, const c > > #endif /* _KERNEL */ > > +#ifdef _STANDALONE > +/* since we have no threads in the boot loader, trivially implement no-op version */ > +#define sx_xlock(s) (1) > +#define sx_try_xlock(s) (1) > +#define sx_xunlock(s) (1) > +#define SX_DUPOK 0 > +#define SX_NEW 0 > +#define SX_NOWITNESS 0 > + > +static __inline void > +sx_init_flags(struct sx *sx, const char *description, int opts) > +{ > + > +} > + > +static __inline void > +sx_destroy(struct sx *sx) > +{ > + > +} > +#endif /* _STANDALONE */ > + > #endif /* !_SYS_SX_H_ */ > You may want to use: bsd_kernel.c:sx_init_flags(struct sx *sx, const char *name, int flags) bsd_kernel.c: sx->owned = 0; bsd_kernel.c:sx_destroy(struct sx *sx) bsd_kernel.c:sx_xlock(struct sx *sx) bsd_kernel.c: sx->owned++; bsd_kernel.c:sx_xunlock(struct sx *sx) bsd_kernel.c: sx->owned--; bsd_kernel.c:sx_xlocked(struct sx *sx) bsd_kernel.c: return (sx->owned != 0); bsd_kernel.h:struct sx { bsd_kernel.h:#define sx_assert(...) do { } while (0) bsd_kernel.h:#define sx_init(...) sx_init_flags(__VA_ARGS__, 0) bsd_kernel.h:void sx_init_flags(struct sx *, const char *, int); bsd_kernel.h:void sx_destroy(struct sx *); bsd_kernel.h:void sx_xlock(struct sx *); bsd_kernel.h:void sx_xunlock(struct sx *); bsd_kernel.h:int sx_xlocked(struct sx *); from "src/stand/kshim" --HPS From owner-svn-src-all@freebsd.org Tue Sep 29 20:29:10 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2556142F073; Tue, 29 Sep 2020 20:29:10 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C19w60DTBz4DSc; Tue, 29 Sep 2020 20:29:10 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DF4AB142F9; Tue, 29 Sep 2020 20:29:09 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08TKT97q077714; Tue, 29 Sep 2020 20:29:09 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08TKT7E4077702; Tue, 29 Sep 2020 20:29:07 GMT (envelope-from br@FreeBSD.org) Message-Id: <202009292029.08TKT7E4077702@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 29 Sep 2020 20:29:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366267 - in head/sys: amd64/conf conf dev/acpica dev/pci i386/conf x86/x86 X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: in head/sys: amd64/conf conf dev/acpica dev/pci i386/conf x86/x86 X-SVN-Commit-Revision: 366267 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Sep 2020 20:29:10 -0000 Author: br Date: Tue Sep 29 20:29:07 2020 New Revision: 366267 URL: https://svnweb.freebsd.org/changeset/base/366267 Log: Rename kernel option ACPI_DMAR to IOMMU. This is mostly needed for a common arm64/amd64 iommu code. Reviewed by: kib Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D26587 Modified: head/sys/amd64/conf/GENERIC head/sys/amd64/conf/MINIMAL head/sys/conf/files.x86 head/sys/conf/options head/sys/dev/acpica/acpi_pci.c head/sys/dev/pci/pci.c head/sys/i386/conf/MINIMAL head/sys/i386/conf/NOTES head/sys/x86/x86/busdma_machdep.c head/sys/x86/x86/io_apic.c head/sys/x86/x86/msi.c Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Tue Sep 29 18:13:54 2020 (r366266) +++ head/sys/amd64/conf/GENERIC Tue Sep 29 20:29:07 2020 (r366267) @@ -102,6 +102,7 @@ options WITNESS # Enable checks to detect deadlocks options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones options VERBOSE_SYSINIT=0 # Support debug.verbose_sysinit, off by default +options IOMMU # Kernel Sanitizers #options COVERAGE # Generic kernel coverage. Used by KCOV @@ -127,7 +128,6 @@ device cpufreq # Bus support. device acpi -options ACPI_DMAR device pci options PCI_HP # PCI-Express native HotPlug options PCI_IOV # PCI SR-IOV support Modified: head/sys/amd64/conf/MINIMAL ============================================================================== --- head/sys/amd64/conf/MINIMAL Tue Sep 29 18:13:54 2020 (r366266) +++ head/sys/amd64/conf/MINIMAL Tue Sep 29 20:29:07 2020 (r366267) @@ -93,6 +93,7 @@ options WITNESS # Enable checks to detect deadlocks options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones options VERBOSE_SYSINIT=0 # Support debug.verbose_sysinit, off by default +options IOMMU # Make an SMP-capable kernel by default options SMP # Symmetric MultiProcessor Kernel @@ -103,7 +104,6 @@ device cpufreq # Bus support. device acpi -options ACPI_DMAR device pci # atkbdc0 controls both the keyboard and the PS/2 mouse Modified: head/sys/conf/files.x86 ============================================================================== --- head/sys/conf/files.x86 Tue Sep 29 18:13:54 2020 (r366266) +++ head/sys/conf/files.x86 Tue Sep 29 20:29:07 2020 (r366267) @@ -165,8 +165,8 @@ dev/imcsmb/imcsmb.c optional imcsmb dev/imcsmb/imcsmb_pci.c optional imcsmb pci dev/intel/spi.c optional intelspi dev/io/iodev.c optional io -dev/iommu/busdma_iommu.c optional acpi acpi_dmar pci -dev/iommu/iommu_gas.c optional acpi acpi_dmar pci +dev/iommu/busdma_iommu.c optional acpi iommu pci +dev/iommu/iommu_gas.c optional acpi iommu pci dev/ipmi/ipmi.c optional ipmi dev/ipmi/ipmi_acpi.c optional ipmi acpi dev/ipmi/ipmi_isa.c optional ipmi isa @@ -302,14 +302,14 @@ x86/cpufreq/hwpstate_amd.c optional cpufreq x86/cpufreq/hwpstate_intel.c optional cpufreq x86/cpufreq/p4tcc.c optional cpufreq x86/cpufreq/powernow.c optional cpufreq -x86/iommu/intel_ctx.c optional acpi acpi_dmar pci -x86/iommu/intel_drv.c optional acpi acpi_dmar pci -x86/iommu/intel_fault.c optional acpi acpi_dmar pci -x86/iommu/intel_idpgtbl.c optional acpi acpi_dmar pci -x86/iommu/intel_intrmap.c optional acpi acpi_dmar pci -x86/iommu/intel_qi.c optional acpi acpi_dmar pci -x86/iommu/intel_quirks.c optional acpi acpi_dmar pci -x86/iommu/intel_utils.c optional acpi acpi_dmar pci +x86/iommu/intel_ctx.c optional acpi iommu pci +x86/iommu/intel_drv.c optional acpi iommu pci +x86/iommu/intel_fault.c optional acpi iommu pci +x86/iommu/intel_idpgtbl.c optional acpi iommu pci +x86/iommu/intel_intrmap.c optional acpi iommu pci +x86/iommu/intel_qi.c optional acpi iommu pci +x86/iommu/intel_quirks.c optional acpi iommu pci +x86/iommu/intel_utils.c optional acpi iommu pci x86/isa/atrtc.c standard x86/isa/clock.c standard x86/isa/isa.c optional isa Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Tue Sep 29 18:13:54 2020 (r366266) +++ head/sys/conf/options Tue Sep 29 20:29:07 2020 (r366267) @@ -704,8 +704,10 @@ EPOCH_TRACE opt_global.h ACPI_DEBUG opt_acpi.h ACPI_MAX_TASKS opt_acpi.h ACPI_MAX_THREADS opt_acpi.h -ACPI_DMAR opt_acpi.h DEV_ACPI opt_acpi.h + +# options for IOMMU support +IOMMU opt_iommu.h # ISA support DEV_ISA opt_isa.h Modified: head/sys/dev/acpica/acpi_pci.c ============================================================================== --- head/sys/dev/acpica/acpi_pci.c Tue Sep 29 18:13:54 2020 (r366266) +++ head/sys/dev/acpica/acpi_pci.c Tue Sep 29 20:29:07 2020 (r366267) @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); #include "opt_acpi.h" +#include "opt_iommu.h" #include #include @@ -459,7 +460,7 @@ acpi_pci_detach(device_t dev) return (pci_detach(dev)); } -#ifdef ACPI_DMAR +#ifdef IOMMU static bus_dma_tag_t acpi_pci_get_dma_tag(device_t bus, device_t child) { Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Tue Sep 29 18:13:54 2020 (r366266) +++ head/sys/dev/pci/pci.c Tue Sep 29 20:29:07 2020 (r366267) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include "opt_acpi.h" +#include "opt_iommu.h" #include "opt_bus.h" #include @@ -5683,7 +5684,7 @@ pci_get_resource_list (device_t dev, device_t child) return (&dinfo->resources); } -#ifdef ACPI_DMAR +#ifdef IOMMU bus_dma_tag_t pci_get_dma_tag(device_t bus, device_t dev) { Modified: head/sys/i386/conf/MINIMAL ============================================================================== --- head/sys/i386/conf/MINIMAL Tue Sep 29 18:13:54 2020 (r366266) +++ head/sys/i386/conf/MINIMAL Tue Sep 29 20:29:07 2020 (r366267) @@ -93,6 +93,7 @@ options WITNESS # Enable checks to detect deadlocks options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones options VERBOSE_SYSINIT=0 # Support debug.verbose_sysinit, off by default +options IOMMU # Make an SMP-capable kernel by default options SMP # Symmetric MultiProcessor Kernel @@ -104,7 +105,6 @@ device cpufreq # Bus support. device acpi -options ACPI_DMAR device pci # atkbdc0 controls both the keyboard and the PS/2 mouse Modified: head/sys/i386/conf/NOTES ============================================================================== --- head/sys/i386/conf/NOTES Tue Sep 29 18:13:54 2020 (r366266) +++ head/sys/i386/conf/NOTES Tue Sep 29 20:29:07 2020 (r366267) @@ -439,6 +439,8 @@ device s3pci device tdfx # Enable 3Dfx Voodoo support device tdfx_linux # Enable Linuxulator support +options IOMMU # Enable IOMMU support + # # ACPI support using the Intel ACPI Component Architecture reference # implementation. @@ -450,7 +452,6 @@ device tdfx_linux # Enable Linuxulator support device acpi options ACPI_DEBUG -options ACPI_DMAR # ACPI WMI Mapping driver device acpi_wmi Modified: head/sys/x86/x86/busdma_machdep.c ============================================================================== --- head/sys/x86/x86/busdma_machdep.c Tue Sep 29 18:13:54 2020 (r366266) +++ head/sys/x86/x86/busdma_machdep.c Tue Sep 29 20:29:07 2020 (r366267) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include "opt_acpi.h" +#include "opt_iommu.h" #include #include @@ -268,7 +269,7 @@ bus_dma_tag_destroy(bus_dma_tag_t dmat) return (tc->impl->tag_destroy(dmat)); } -#ifndef ACPI_DMAR +#ifndef IOMMU bool bus_dma_iommu_set_buswide(device_t dev); int bus_dma_iommu_load_ident(bus_dma_tag_t dmat, bus_dmamap_t map, vm_paddr_t start, vm_size_t length, int flags); Modified: head/sys/x86/x86/io_apic.c ============================================================================== --- head/sys/x86/x86/io_apic.c Tue Sep 29 18:13:54 2020 (r366266) +++ head/sys/x86/x86/io_apic.c Tue Sep 29 20:29:07 2020 (r366267) @@ -29,6 +29,7 @@ __FBSDID("$FreeBSD$"); #include "opt_acpi.h" +#include "opt_iommu.h" #include "opt_isa.h" #include @@ -314,7 +315,7 @@ ioapic_program_intpin(struct ioapic_intsrc *intpin) { struct ioapic *io = (struct ioapic *)intpin->io_intsrc.is_pic; uint32_t low, high; -#ifdef ACPI_DMAR +#ifdef IOMMU int error; #endif @@ -331,7 +332,7 @@ ioapic_program_intpin(struct ioapic_intsrc *intpin) ioapic_write(io->io_addr, IOAPIC_REDTBL_LO(intpin->io_intpin), low | IOART_INTMSET); -#ifdef ACPI_DMAR +#ifdef IOMMU mtx_unlock_spin(&icu_lock); iommu_unmap_ioapic_intr(io->io_apic_id, &intpin->io_remap_cookie); @@ -340,7 +341,7 @@ ioapic_program_intpin(struct ioapic_intsrc *intpin) return; } -#ifdef ACPI_DMAR +#ifdef IOMMU mtx_unlock_spin(&icu_lock); error = iommu_map_ioapic_intr(io->io_apic_id, intpin->io_cpu, intpin->io_vector, intpin->io_edgetrigger, @@ -712,7 +713,7 @@ ioapic_create(vm_paddr_t addr, int32_t apic_id, int in intpin->io_cpu = PCPU_GET(apic_id); value = ioapic_read(apic, IOAPIC_REDTBL_LO(i)); ioapic_write(apic, IOAPIC_REDTBL_LO(i), value | IOART_INTMSET); -#ifdef ACPI_DMAR +#ifdef IOMMU /* dummy, but sets cookie */ mtx_unlock_spin(&icu_lock); iommu_map_ioapic_intr(io->io_apic_id, Modified: head/sys/x86/x86/msi.c ============================================================================== --- head/sys/x86/x86/msi.c Tue Sep 29 18:13:54 2020 (r366266) +++ head/sys/x86/x86/msi.c Tue Sep 29 20:29:07 2020 (r366267) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include "opt_acpi.h" +#include "opt_iommu.h" #include #include @@ -383,7 +384,7 @@ msi_alloc(device_t dev, int count, int maxcount, int * struct msi_intsrc *msi, *fsrc; u_int cpu, domain, *mirqs; int cnt, i, vector; -#ifdef ACPI_DMAR +#ifdef IOMMU u_int cookies[count]; int error; #endif @@ -449,7 +450,7 @@ again: return (ENOSPC); } -#ifdef ACPI_DMAR +#ifdef IOMMU mtx_unlock(&msi_lock); error = iommu_alloc_msi_intr(dev, cookies, count); mtx_lock(&msi_lock); @@ -531,7 +532,7 @@ msi_release(int *irqs, int count) msi = (struct msi_intsrc *)intr_lookup_source(irqs[i]); KASSERT(msi->msi_first == first, ("message not in group")); KASSERT(msi->msi_dev == first->msi_dev, ("owner mismatch")); -#ifdef ACPI_DMAR +#ifdef IOMMU iommu_unmap_msi_intr(first->msi_dev, msi->msi_remap_cookie); #endif msi->msi_first = NULL; @@ -541,7 +542,7 @@ msi_release(int *irqs, int count) } /* Clear out the first message. */ -#ifdef ACPI_DMAR +#ifdef IOMMU mtx_unlock(&msi_lock); iommu_unmap_msi_intr(first->msi_dev, first->msi_remap_cookie); mtx_lock(&msi_lock); @@ -564,7 +565,7 @@ msi_map(int irq, uint64_t *addr, uint32_t *data) { struct msi_intsrc *msi; int error; -#ifdef ACPI_DMAR +#ifdef IOMMU struct msi_intsrc *msi1; int i, k; #endif @@ -595,7 +596,7 @@ msi_map(int irq, uint64_t *addr, uint32_t *data) msi = msi->msi_first; } -#ifdef ACPI_DMAR +#ifdef IOMMU if (!msi->msi_msix) { for (k = msi->msi_count - 1, i = first_msi_irq; k > 0 && i < first_msi_irq + num_msi_irqs; i++) { @@ -633,7 +634,7 @@ msix_alloc(device_t dev, int *irq) struct msi_intsrc *msi; u_int cpu, domain; int i, vector; -#ifdef ACPI_DMAR +#ifdef IOMMU u_int cookie; int error; #endif @@ -684,7 +685,7 @@ again: } msi->msi_dev = dev; -#ifdef ACPI_DMAR +#ifdef IOMMU mtx_unlock(&msi_lock); error = iommu_alloc_msi_intr(dev, &cookie, 1); mtx_lock(&msi_lock); @@ -739,7 +740,7 @@ msix_release(int irq) KASSERT(msi->msi_dev != NULL, ("unowned message")); /* Clear out the message. */ -#ifdef ACPI_DMAR +#ifdef IOMMU mtx_unlock(&msi_lock); iommu_unmap_msi_intr(msi->msi_dev, msi->msi_remap_cookie); mtx_lock(&msi_lock); From owner-svn-src-all@freebsd.org Tue Sep 29 20:46:25 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CF9A942FEB4; Tue, 29 Sep 2020 20:46:25 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C1BJ156V3z4Fcb; Tue, 29 Sep 2020 20:46:25 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 93800149D6; Tue, 29 Sep 2020 20:46:25 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08TKkPaX090234; Tue, 29 Sep 2020 20:46:25 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08TKkPMm090233; Tue, 29 Sep 2020 20:46:25 GMT (envelope-from bz@FreeBSD.org) Message-Id: <202009292046.08TKkPMm090233@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Tue, 29 Sep 2020 20:46:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366268 - head/sys/dev/rtwn/usb X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/sys/dev/rtwn/usb X-SVN-Commit-Revision: 366268 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Sep 2020 20:46:25 -0000 Author: bz Date: Tue Sep 29 20:46:25 2020 New Revision: 366268 URL: https://svnweb.freebsd.org/changeset/base/366268 Log: rtwn: narrow the epoch area Rather than placing the epoch around the entire receive loop which might call into rtwn_rx_frame() and USB and sleep, split the loop into two[1] and leave us with one unlock/lock cycle as well. PR: 249925 Reported by: thj, (rkoberman gmail.com) Tested by: thj Suggested by: adrian [1] Reviewed by: adrian MFC after: 3 days Sponsored by: The FreeBSD Foundation (initially, paniced my iwl lab host) Differential Revision: https://reviews.freebsd.org/D26554 Modified: head/sys/dev/rtwn/usb/rtwn_usb_rx.c Modified: head/sys/dev/rtwn/usb/rtwn_usb_rx.c ============================================================================== --- head/sys/dev/rtwn/usb/rtwn_usb_rx.c Tue Sep 29 20:29:07 2020 (r366267) +++ head/sys/dev/rtwn/usb/rtwn_usb_rx.c Tue Sep 29 20:46:25 2020 (r366268) @@ -368,7 +368,7 @@ rtwn_bulk_rx_callback(struct usb_xfer *xfer, usb_error struct rtwn_softc *sc = &uc->uc_sc; struct ieee80211com *ic = &sc->sc_ic; struct ieee80211_node *ni; - struct mbuf *m = NULL, *next; + struct mbuf *m0, *m = NULL, *next; struct rtwn_data *data; RTWN_ASSERT_LOCKED(sc); @@ -400,24 +400,30 @@ tr_setup: * ieee80211_input() because here is at the end of a USB * callback and safe to unlock. */ + m0 = m; + while (m != NULL) { + M_ASSERTPKTHDR(m); + m->m_pkthdr.PH_loc.ptr = rtwn_rx_frame(sc, m); + m = m->m_nextpkt; + } NET_EPOCH_ENTER(et); + RTWN_UNLOCK(sc); + m = m0; while (m != NULL) { next = m->m_nextpkt; m->m_nextpkt = NULL; - ni = rtwn_rx_frame(sc, m); - - RTWN_UNLOCK(sc); - + ni = m->m_pkthdr.PH_loc.ptr; + m->m_pkthdr.PH_loc.ptr = NULL; if (ni != NULL) { (void)ieee80211_input_mimo(ni, m); ieee80211_free_node(ni); } else { (void)ieee80211_input_mimo_all(ic, m); } - RTWN_LOCK(sc); m = next; } + RTWN_LOCK(sc); NET_EPOCH_EXIT(et); break; default: From owner-svn-src-all@freebsd.org Tue Sep 29 21:51:33 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 44E223F1BFF; Tue, 29 Sep 2020 21:51:33 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C1Cl914K7z4Kh6; Tue, 29 Sep 2020 21:51:33 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 07FB115613; Tue, 29 Sep 2020 21:51:33 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08TLpWpv029120; Tue, 29 Sep 2020 21:51:32 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08TLpWhg029119; Tue, 29 Sep 2020 21:51:32 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202009292151.08TLpWhg029119@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 29 Sep 2020 21:51:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366269 - head/sys/dev/cxgbe/crypto X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/dev/cxgbe/crypto X-SVN-Commit-Revision: 366269 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Sep 2020 21:51:33 -0000 Author: jhb Date: Tue Sep 29 21:51:32 2020 New Revision: 366269 URL: https://svnweb.freebsd.org/changeset/base/366269 Log: Fallback to software for more GCM and CCM requests. ccr(4) uses software to handle GCM and CCM requests not supported by the crypto engine (e.g. with only AAD and no payload). This change adds a fallback for a few more requests such as those with more SGL entries than can fit in a work request (this can happen for GCM when decrypting a TLS record split across 15 or more packets). Reported by: Chelsio QA Reviewed by: np Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D26582 Modified: head/sys/dev/cxgbe/crypto/t4_crypto.c Modified: head/sys/dev/cxgbe/crypto/t4_crypto.c ============================================================================== --- head/sys/dev/cxgbe/crypto/t4_crypto.c Tue Sep 29 20:46:25 2020 (r366268) +++ head/sys/dev/cxgbe/crypto/t4_crypto.c Tue Sep 29 21:51:32 2020 (r366269) @@ -2777,7 +2777,7 @@ ccr_process(device_t dev, struct cryptop *crp, int hin return (0); } error = ccr_gcm(sc, s, crp); - if (error == EMSGSIZE) { + if (error == EMSGSIZE || error == EFBIG) { counter_u64_add(sc->stats_sw_fallback, 1); mtx_unlock(&s->lock); ccr_gcm_soft(s, crp); @@ -2796,7 +2796,7 @@ ccr_process(device_t dev, struct cryptop *crp, int hin csp->csp_cipher_klen); } error = ccr_ccm(sc, s, crp); - if (error == EMSGSIZE) { + if (error == EMSGSIZE || error == EFBIG) { counter_u64_add(sc->stats_sw_fallback, 1); mtx_unlock(&s->lock); ccr_ccm_soft(s, crp); From owner-svn-src-all@freebsd.org Tue Sep 29 22:30:15 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EB2B43F28B0; Tue, 29 Sep 2020 22:30:15 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C1Dbq5wXbz4M61; Tue, 29 Sep 2020 22:30:15 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AE7A515E64; Tue, 29 Sep 2020 22:30:15 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08TMUFcx053592; Tue, 29 Sep 2020 22:30:15 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08TMUFq5053591; Tue, 29 Sep 2020 22:30:15 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <202009292230.08TMUFq5053591@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Tue, 29 Sep 2020 22:30:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366270 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 366270 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Sep 2020 22:30:16 -0000 Author: brooks Date: Tue Sep 29 22:30:15 2020 New Revision: 366270 URL: https://svnweb.freebsd.org/changeset/base/366270 Log: Prefer --ld-path=/path/to/ld on clang >= 12 Clang 12 warns about passing a path to -fuse-ld and -Werror makes that an error preventing building world without this change. Reviewed by: arichardson, emaste Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D26591 Modified: head/share/mk/bsd.sys.mk Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Tue Sep 29 21:51:32 2020 (r366269) +++ head/share/mk/bsd.sys.mk Tue Sep 29 22:30:15 2020 (r366270) @@ -296,10 +296,13 @@ CFLAGS+= ERROR-tried-to-rebuild-during-make-install # Please keep this if in sync with kern.mk .if ${LD} != "ld" && (${CC:[1]:H} != ${LD:[1]:H} || ${LD:[1]:T} != "ld") # Add -fuse-ld=${LD} if $LD is in a different directory or not called "ld". -# Note: Clang 12+ will prefer --ld-path= over -fuse-ld=. .if ${COMPILER_TYPE} == "clang" +.if ${COMPILER_VERSION} >= 120000 +LDFLAGS+= --ld-path=${LD:[1]:S/^ld.//1W} +.else # Note: Clang does not like relative paths in -fuse-ld so we map ld.lld -> lld. LDFLAGS+= -fuse-ld=${LD:[1]:S/^ld.//1W} +.endif .else # GCC does not support an absolute path for -fuse-ld so we just print this # warning instead and let the user add the required symlinks. From owner-svn-src-all@freebsd.org Tue Sep 29 23:21:57 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 01A103F438F; Tue, 29 Sep 2020 23:21:57 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C1FlS5brPz4PSk; Tue, 29 Sep 2020 23:21:56 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A350F16915; Tue, 29 Sep 2020 23:21:56 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08TNLucL087202; Tue, 29 Sep 2020 23:21:56 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08TNLuNu087201; Tue, 29 Sep 2020 23:21:56 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <202009292321.08TNLuNu087201@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Tue, 29 Sep 2020 23:21:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366271 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 366271 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Sep 2020 23:21:57 -0000 Author: mhorne Date: Tue Sep 29 23:21:56 2020 New Revision: 366271 URL: https://svnweb.freebsd.org/changeset/base/366271 Log: arm64: set the correct HWCAP This appears to be a typo. The AdvSIMD field encodes support for half-precision floating point SIMD instructions, which corresponds to HWCAP_ASIMDHP, not HWCAP_ASIMDDP. MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/identcpu.c Modified: head/sys/arm64/arm64/identcpu.c ============================================================================== --- head/sys/arm64/arm64/identcpu.c Tue Sep 29 22:30:15 2020 (r366270) +++ head/sys/arm64/arm64/identcpu.c Tue Sep 29 23:21:56 2020 (r366271) @@ -1295,7 +1295,7 @@ parse_cpu_features_hwcap(void) hwcap |= HWCAP_ASIMD; break; case ID_AA64PFR0_AdvSIMD_HP: - hwcap |= HWCAP_ASIMD | HWCAP_ASIMDDP; + hwcap |= HWCAP_ASIMD | HWCAP_ASIMDHP; break; default: break; From owner-svn-src-all@freebsd.org Tue Sep 29 23:35:47 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 538793F469B; Tue, 29 Sep 2020 23:35:47 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C1G3R1YK5z4QYM; Tue, 29 Sep 2020 23:35:47 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 19C2716B0D; Tue, 29 Sep 2020 23:35:47 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08TNZkFk096209; Tue, 29 Sep 2020 23:35:46 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08TNZkD0096205; Tue, 29 Sep 2020 23:35:46 GMT (envelope-from np@FreeBSD.org) Message-Id: <202009292335.08TNZkD0096205@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 29 Sep 2020 23:35:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366272 - in stable/12/sys/dev/cxgbe: . tom X-SVN-Group: stable-12 X-SVN-Commit-Author: np X-SVN-Commit-Paths: in stable/12/sys/dev/cxgbe: . tom X-SVN-Commit-Revision: 366272 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Sep 2020 23:35:47 -0000 Author: np Date: Tue Sep 29 23:35:46 2020 New Revision: 366272 URL: https://svnweb.freebsd.org/changeset/base/366272 Log: MFC r349533 (by jhb@). Note that this does not add any functionality as IFCAP_NOMAP doesn't exist on 12. This is mainly an attempt to get t4_sge.c closer to what's in head (to help with other MFCs). r349533: Add support for IFCAP_NOMAP to cxgbe(4). Since cxgbe(4) uses sglist instead of bus_dma, this required updates to the code that generates scatter/gather lists for packets. Also, unmapped mbufs are always sent via DMA and never as immediate data in the payload of a work request. Modified: stable/12/sys/dev/cxgbe/adapter.h stable/12/sys/dev/cxgbe/t4_main.c stable/12/sys/dev/cxgbe/t4_sge.c stable/12/sys/dev/cxgbe/tom/t4_cpl_io.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/cxgbe/adapter.h ============================================================================== --- stable/12/sys/dev/cxgbe/adapter.h Tue Sep 29 23:21:56 2020 (r366271) +++ stable/12/sys/dev/cxgbe/adapter.h Tue Sep 29 23:35:46 2020 (r366272) @@ -82,6 +82,10 @@ prefetch(void *x) #define CTLTYPE_U64 CTLTYPE_QUAD #endif +#ifndef IFCAP_NOMAP +#define IFCAP_NOMAP (0) +#endif + SYSCTL_DECL(_hw_cxgbe); struct adapter; Modified: stable/12/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/12/sys/dev/cxgbe/t4_main.c Tue Sep 29 23:21:56 2020 (r366271) +++ stable/12/sys/dev/cxgbe/t4_main.c Tue Sep 29 23:35:46 2020 (r366272) @@ -1653,7 +1653,7 @@ cxgbe_probe(device_t dev) #define T4_CAP (IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU | IFCAP_HWCSUM | \ IFCAP_VLAN_HWCSUM | IFCAP_TSO | IFCAP_JUMBO_MTU | IFCAP_LRO | \ IFCAP_VLAN_HWTSO | IFCAP_LINKSTATE | IFCAP_HWCSUM_IPV6 | IFCAP_HWSTATS | \ - IFCAP_HWRXTSTMP) + IFCAP_HWRXTSTMP | IFCAP_NOMAP) #define T4_CAP_ENABLE (T4_CAP) static int @@ -2018,6 +2018,8 @@ cxgbe_ioctl(struct ifnet *ifp, unsigned long cmd, cadd rxq->iq.flags &= ~IQ_RX_TIMESTAMP; } } + if (mask & IFCAP_NOMAP) + ifp->if_capenable ^= IFCAP_NOMAP; #ifdef VLAN_CAPABILITIES VLAN_CAPABILITIES(ifp); Modified: stable/12/sys/dev/cxgbe/t4_sge.c ============================================================================== --- stable/12/sys/dev/cxgbe/t4_sge.c Tue Sep 29 23:21:56 2020 (r366271) +++ stable/12/sys/dev/cxgbe/t4_sge.c Tue Sep 29 23:35:46 2020 (r366272) @@ -83,6 +83,7 @@ __FBSDID("$FreeBSD$"); #endif /* Internal mbuf flags stored in PH_loc.eight[1]. */ +#define MC_NOMAP 0x01 #define MC_RAW_WR 0x02 /* @@ -2311,15 +2312,80 @@ m_advance(struct mbuf **pm, int *poffset, int len) return ((void *)p); } +#if IFCAP_NOMAP != 0 +static inline int +count_mbuf_ext_pgs(struct mbuf *m, int skip, vm_paddr_t *nextaddr) +{ + struct mbuf_ext_pgs *ext_pgs; + vm_paddr_t paddr; + int i, len, off, pglen, pgoff, seglen, segoff; + int nsegs = 0; + + MBUF_EXT_PGS_ASSERT(m); + ext_pgs = m->m_ext.ext_pgs; + off = mtod(m, vm_offset_t); + len = m->m_len; + off += skip; + len -= skip; + + if (ext_pgs->hdr_len != 0) { + if (off >= ext_pgs->hdr_len) { + off -= ext_pgs->hdr_len; + } else { + seglen = ext_pgs->hdr_len - off; + segoff = off; + seglen = min(seglen, len); + off = 0; + len -= seglen; + paddr = pmap_kextract( + (vm_offset_t)&ext_pgs->hdr[segoff]); + if (*nextaddr != paddr) + nsegs++; + *nextaddr = paddr + seglen; + } + } + pgoff = ext_pgs->first_pg_off; + for (i = 0; i < ext_pgs->npgs && len > 0; i++) { + pglen = mbuf_ext_pg_len(ext_pgs, i, pgoff); + if (off >= pglen) { + off -= pglen; + pgoff = 0; + continue; + } + seglen = pglen - off; + segoff = pgoff + off; + off = 0; + seglen = min(seglen, len); + len -= seglen; + paddr = ext_pgs->pa[i] + segoff; + if (*nextaddr != paddr) + nsegs++; + *nextaddr = paddr + seglen; + pgoff = 0; + }; + if (len != 0) { + seglen = min(len, ext_pgs->trail_len - off); + len -= seglen; + paddr = pmap_kextract((vm_offset_t)&ext_pgs->trail[off]); + if (*nextaddr != paddr) + nsegs++; + *nextaddr = paddr + seglen; + } + + return (nsegs); +} +#endif + + /* * Can deal with empty mbufs in the chain that have m_len = 0, but the chain * must have at least one mbuf that's not empty. It is possible for this * routine to return 0 if skip accounts for all the contents of the mbuf chain. */ static inline int -count_mbuf_nsegs(struct mbuf *m, int skip) +count_mbuf_nsegs(struct mbuf *m, int skip, uint8_t *cflags) { - vm_paddr_t lastb, next; + vm_paddr_t nextaddr, paddr; vm_offset_t va; int len, nsegs; @@ -2328,9 +2394,8 @@ count_mbuf_nsegs(struct mbuf *m, int skip) MPASS(m->m_pkthdr.len >= skip); nsegs = 0; - lastb = 0; + nextaddr = 0; for (; m; m = m->m_next) { - len = m->m_len; if (__predict_false(len == 0)) continue; @@ -2338,14 +2403,22 @@ count_mbuf_nsegs(struct mbuf *m, int skip) skip -= len; continue; } +#if IFCAP_NOMAP != 0 + if ((m->m_flags & M_NOMAP) != 0) { + *cflags |= MC_NOMAP; + nsegs += count_mbuf_ext_pgs(m, skip, &nextaddr); + skip = 0; + continue; + } +#endif va = mtod(m, vm_offset_t) + skip; len -= skip; skip = 0; - next = pmap_kextract(va); + paddr = pmap_kextract(va); nsegs += sglist_count((void *)(uintptr_t)va, len); - if (lastb + 1 == next) + if (paddr == nextaddr) nsegs--; - lastb = pmap_kextract(va + len - 1); + nextaddr = pmap_kextract(va + len - 1) + 1; } return (nsegs); @@ -2367,7 +2440,9 @@ parse_pkt(struct adapter *sc, struct mbuf **mp) struct tcphdr *tcp; #endif uint16_t eh_type; + uint8_t cflags; + cflags = 0; M_ASSERTPKTHDR(m0); if (__predict_false(m0->m_pkthdr.len < ETHER_HDR_LEN)) { rc = EINVAL; @@ -2383,7 +2458,7 @@ restart: */ M_ASSERTPKTHDR(m0); MPASS(m0->m_pkthdr.len > 0); - nsegs = count_mbuf_nsegs(m0, 0); + nsegs = count_mbuf_nsegs(m0, 0, &cflags); if (nsegs > (needs_tso(m0) ? TX_SGL_SEGS_TSO : TX_SGL_SEGS)) { if (defragged++ > 0 || (m = m_defrag(m0, M_NOWAIT)) == NULL) { rc = EFBIG; @@ -2393,7 +2468,8 @@ restart: goto restart; } - if (__predict_false(nsegs > 2 && m0->m_pkthdr.len <= MHLEN)) { + if (__predict_false(nsegs > 2 && m0->m_pkthdr.len <= MHLEN && + !(cflags & MC_NOMAP))) { m0 = m_pullup(m0, m0->m_pkthdr.len); if (m0 == NULL) { /* Should have left well enough alone. */ @@ -2404,7 +2480,7 @@ restart: goto restart; } set_mbuf_nsegs(m0, nsegs); - set_mbuf_cflags(m0, 0); + set_mbuf_cflags(m0, cflags); if (sc->flags & IS_VF) set_mbuf_len16(m0, txpkt_vm_len16(nsegs, needs_tso(m0))); else @@ -2490,7 +2566,9 @@ restart: /* EO WRs have the headers in the WR and not the GL. */ immhdrs = m0->m_pkthdr.l2hlen + m0->m_pkthdr.l3hlen + m0->m_pkthdr.l4hlen; - nsegs = count_mbuf_nsegs(m0, immhdrs); + cflags = 0; + nsegs = count_mbuf_nsegs(m0, immhdrs, &cflags); + MPASS(cflags == mbuf_cflags(m0)); set_mbuf_eo_nsegs(m0, nsegs); set_mbuf_eo_len16(m0, txpkt_eo_len16(nsegs, immhdrs, needs_tso(m0))); @@ -4652,7 +4730,8 @@ write_txpkt_wr(struct adapter *sc, struct sge_txq *txq ctrl = sizeof(struct cpl_tx_pkt_core); if (needs_tso(m0)) ctrl += sizeof(struct cpl_tx_pkt_lso_core); - else if (pktlen <= imm_payload(2) && available >= 2) { + else if (!(mbuf_cflags(m0) & MC_NOMAP) && pktlen <= imm_payload(2) && + available >= 2) { /* Immediate data. Recalculate len16 and set nsegs to 0. */ ctrl += pktlen; len16 = howmany(sizeof(struct fw_eth_tx_pkt_wr) + Modified: stable/12/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- stable/12/sys/dev/cxgbe/tom/t4_cpl_io.c Tue Sep 29 23:21:56 2020 (r366271) +++ stable/12/sys/dev/cxgbe/tom/t4_cpl_io.c Tue Sep 29 23:35:46 2020 (r366272) @@ -634,6 +634,10 @@ write_tx_sgl(void *dst, struct mbuf *start, struct mbu if (IS_AIOTX_MBUF(m)) rc = sglist_append_vmpages(&sg, aiotx_mbuf_pages(m), aiotx_mbuf_pgoff(m), m->m_len); +#if IFCAP_NOMAP != 0 + else if (m->m_flags & M_NOMAP) + rc = sglist_append_mb_ext_pgs(&sg, m); +#endif else rc = sglist_append(&sg, mtod(m, void *), m->m_len); if (__predict_false(rc != 0)) @@ -755,6 +759,10 @@ t4_push_frames(struct adapter *sc, struct toepcb *toep if (IS_AIOTX_MBUF(m)) n = sglist_count_vmpages(aiotx_mbuf_pages(m), aiotx_mbuf_pgoff(m), m->m_len); +#if IFCAP_NOMAP != 0 + else if (m->m_flags & M_NOMAP) + n = sglist_count_mb_ext_pgs(m); +#endif else n = sglist_count(mtod(m, void *), m->m_len); From owner-svn-src-all@freebsd.org Tue Sep 29 23:48:05 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CA1E13F4465; Tue, 29 Sep 2020 23:48:05 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C1GKd52TYz4R0s; Tue, 29 Sep 2020 23:48:05 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9061916CAB; Tue, 29 Sep 2020 23:48:05 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08TNm5w8002540; Tue, 29 Sep 2020 23:48:05 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08TNm5eF002539; Tue, 29 Sep 2020 23:48:05 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <202009292348.08TNm5eF002539@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Tue, 29 Sep 2020 23:48:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366273 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 366273 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Sep 2020 23:48:05 -0000 Author: brooks Date: Tue Sep 29 23:48:05 2020 New Revision: 366273 URL: https://svnweb.freebsd.org/changeset/base/366273 Log: Hoist comment on fixup of ld path Reported by: jrtc27 Differential Revision: https://reviews.freebsd.org/D26591 Modified: head/share/mk/bsd.sys.mk Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Tue Sep 29 23:35:46 2020 (r366272) +++ head/share/mk/bsd.sys.mk Tue Sep 29 23:48:05 2020 (r366273) @@ -297,10 +297,10 @@ CFLAGS+= ERROR-tried-to-rebuild-during-make-install .if ${LD} != "ld" && (${CC:[1]:H} != ${LD:[1]:H} || ${LD:[1]:T} != "ld") # Add -fuse-ld=${LD} if $LD is in a different directory or not called "ld". .if ${COMPILER_TYPE} == "clang" +# Note: Clang does not like relative paths for ld so we map ld.lld -> lld. .if ${COMPILER_VERSION} >= 120000 LDFLAGS+= --ld-path=${LD:[1]:S/^ld.//1W} .else -# Note: Clang does not like relative paths in -fuse-ld so we map ld.lld -> lld. LDFLAGS+= -fuse-ld=${LD:[1]:S/^ld.//1W} .endif .else From owner-svn-src-all@freebsd.org Wed Sep 30 00:13:20 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7D29B3F58FE; Wed, 30 Sep 2020 00:13:20 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C1Gtm2Mg5z4SNY; Wed, 30 Sep 2020 00:13:20 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0973516FF3; Wed, 30 Sep 2020 00:13:20 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08U0DJV1020624; Wed, 30 Sep 2020 00:13:19 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08U0DJsm020623; Wed, 30 Sep 2020 00:13:19 GMT (envelope-from np@FreeBSD.org) Message-Id: <202009300013.08U0DJsm020623@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Wed, 30 Sep 2020 00:13:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366274 - stable/12/sys/dev/cxgbe X-SVN-Group: stable-12 X-SVN-Commit-Author: np X-SVN-Commit-Paths: stable/12/sys/dev/cxgbe X-SVN-Commit-Revision: 366274 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Sep 2020 00:13:20 -0000 Author: np Date: Wed Sep 30 00:13:19 2020 New Revision: 366274 URL: https://svnweb.freebsd.org/changeset/base/366274 Log: MFC r365991: cxgbe(4): add counters for mbuf pullups and defrags. Modified: stable/12/sys/dev/cxgbe/t4_sge.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/cxgbe/t4_sge.c ============================================================================== --- stable/12/sys/dev/cxgbe/t4_sge.c Tue Sep 29 23:48:05 2020 (r366273) +++ stable/12/sys/dev/cxgbe/t4_sge.c Wed Sep 30 00:13:19 2020 (r366274) @@ -199,6 +199,15 @@ static int lro_mbufs = 0; SYSCTL_INT(_hw_cxgbe, OID_AUTO, lro_mbufs, CTLFLAG_RDTUN, &lro_mbufs, 0, "Enable presorting of LRO frames"); +static counter_u64_t pullups; +SYSCTL_COUNTER_U64(_hw_cxgbe, OID_AUTO, pullups, CTLFLAG_RD, &pullups, + "Number of mbuf pullups performed"); + +static counter_u64_t defrags; +SYSCTL_COUNTER_U64(_hw_cxgbe, OID_AUTO, defrags, CTLFLAG_RD, &defrags, + "Number of mbuf defrags performed"); + + static int service_iq(struct sge_iq *, int); static int service_iq_fl(struct sge_iq *, int); static struct mbuf *get_fl_payload(struct adapter *, struct sge_fl *, uint32_t); @@ -529,8 +538,12 @@ t4_sge_modload(void) extfree_refs = counter_u64_alloc(M_WAITOK); extfree_rels = counter_u64_alloc(M_WAITOK); + pullups = counter_u64_alloc(M_WAITOK); + defrags = counter_u64_alloc(M_WAITOK); counter_u64_zero(extfree_refs); counter_u64_zero(extfree_rels); + counter_u64_zero(pullups); + counter_u64_zero(defrags); t4_init_shared_cpl_handlers(); t4_register_cpl_handler(CPL_FW4_MSG, handle_fw_msg); @@ -550,6 +563,8 @@ t4_sge_modunload(void) counter_u64_free(extfree_refs); counter_u64_free(extfree_rels); + counter_u64_free(pullups); + counter_u64_free(defrags); } uint64_t @@ -2460,16 +2475,22 @@ restart: MPASS(m0->m_pkthdr.len > 0); nsegs = count_mbuf_nsegs(m0, 0, &cflags); if (nsegs > (needs_tso(m0) ? TX_SGL_SEGS_TSO : TX_SGL_SEGS)) { - if (defragged++ > 0 || (m = m_defrag(m0, M_NOWAIT)) == NULL) { + if (defragged++ > 0) { rc = EFBIG; goto fail; } + counter_u64_add(defrags, 1); + if ((m = m_defrag(m0, M_NOWAIT)) == NULL) { + rc = ENOMEM; + goto fail; + } *mp = m0 = m; /* update caller's copy after defrag */ goto restart; } if (__predict_false(nsegs > 2 && m0->m_pkthdr.len <= MHLEN && !(cflags & MC_NOMAP))) { + counter_u64_add(pullups, 1); m0 = m_pullup(m0, m0->m_pkthdr.len); if (m0 == NULL) { /* Should have left well enough alone. */ From owner-svn-src-all@freebsd.org Wed Sep 30 00:47:57 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D19A33F64F7; Wed, 30 Sep 2020 00:47:57 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C1Hfj5CzZz4TPS; Wed, 30 Sep 2020 00:47:57 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 966A5176D9; Wed, 30 Sep 2020 00:47:57 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08U0lvFh039146; Wed, 30 Sep 2020 00:47:57 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08U0lvbK039145; Wed, 30 Sep 2020 00:47:57 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202009300047.08U0lvbK039145@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 30 Sep 2020 00:47:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366275 - head X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 366275 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Sep 2020 00:47:57 -0000 Author: kevans Date: Wed Sep 30 00:47:57 2020 New Revision: 366275 URL: https://svnweb.freebsd.org/changeset/base/366275 Log: Makefile.inc1: sysent: allow subordinate sysent targets to run in parallel makesyscalls.lua (and indeed makesyscalls.sh) are both safe to be run in parallel, so let's do it. This is a trivial difference because runtime per-target is pretty small, but I like seeing it run in parallel when my muscle memory types `make -sj4`. Reviewed by: brooks, emaste MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D26594 Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed Sep 30 00:13:19 2020 (r366274) +++ head/Makefile.inc1 Wed Sep 30 00:47:57 2020 (r366275) @@ -1503,10 +1503,14 @@ _sysent_dirs+= sys/amd64/linux \ sys/arm/linux \ sys/arm64/linux \ sys/i386/linux + sysent: .PHONY .for _dir in ${_sysent_dirs} +sysent-${_dir}: .PHONY @echo "${MAKE} -C ${.CURDIR}/${_dir} sysent" ${_+_}@env PATH=${_sysent_PATH} ${MAKE} -C ${.CURDIR}/${_dir} sysent + +sysent: sysent-${_dir} .endfor # From owner-svn-src-all@freebsd.org Wed Sep 30 00:53:56 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C87B03F6641; Wed, 30 Sep 2020 00:53:56 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C1Hnc4sWbz4V96; Wed, 30 Sep 2020 00:53:56 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8AD6B176F0; Wed, 30 Sep 2020 00:53:56 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08U0ru8i045213; Wed, 30 Sep 2020 00:53:56 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08U0ruja045211; Wed, 30 Sep 2020 00:53:56 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202009300053.08U0ruja045211@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 30 Sep 2020 00:53:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366276 - stable/12/usr.bin/xargs X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/12/usr.bin/xargs X-SVN-Commit-Revision: 366276 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Sep 2020 00:53:56 -0000 Author: kevans Date: Wed Sep 30 00:53:55 2020 New Revision: 366276 URL: https://svnweb.freebsd.org/changeset/base/366276 Log: MFC r365954: xargs: add some long options for GNU compatibility These are low-effort to add, so let's just do it. Modified: stable/12/usr.bin/xargs/xargs.1 stable/12/usr.bin/xargs/xargs.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.bin/xargs/xargs.1 ============================================================================== --- stable/12/usr.bin/xargs/xargs.1 Wed Sep 30 00:47:57 2020 (r366275) +++ stable/12/usr.bin/xargs/xargs.1 Wed Sep 30 00:53:55 2020 (r366276) @@ -33,7 +33,7 @@ .\" $FreeBSD$ .\" $xMach: xargs.1,v 1.2 2002/02/23 05:23:37 tim Exp $ .\" -.Dd August 4, 2015 +.Dd September 29, 2020 .Dt XARGS 1 .Os .Sh NAME @@ -84,7 +84,7 @@ Any single character, including newlines, may be escap .Pp The options are as follows: .Bl -tag -width indent -.It Fl 0 +.It Fl 0 , Fl -null Change .Nm to expect NUL @@ -175,7 +175,7 @@ If EOF is reached and fewer lines have been read than then .Ar utility will be called with the available lines. -.It Fl n Ar number +.It Fl n Ar number , Fl -max-args= Ns Ar number Set the maximum number of arguments taken from standard input for each invocation of .Ar utility . @@ -201,7 +201,7 @@ in the child process before executing the command. This is useful if you want .Nm to run an interactive application. -.It Fl P Ar maxprocs +.It Fl P Ar maxprocs , Fl -max-procs= Ns Ar maxprocs Parallel mode: run at most .Ar maxprocs invocations of @@ -212,7 +212,7 @@ If is set to 0, .Nm will run as many processes as possible. -.It Fl p +.It Fl p , Fl -interactive Echo each command to be executed and ask the user whether it should be executed. An affirmative response, @@ -221,7 +221,7 @@ in the POSIX locale, causes the command to be executed, any other response causes it to be skipped. No commands are executed if the process is not attached to a terminal. -.It Fl r +.It Fl r , Fl -no-run-if-empty Compatibility with GNU .Nm . The GNU version of @@ -263,7 +263,7 @@ can use for replacements. The default for .Ar replsize is 255. -.It Fl s Ar size +.It Fl s Ar size , Fl -max-chars= Ns Ar size Set the maximum number of bytes for the command line length provided to .Ar utility . The sum of the length of the utility name, the arguments passed to @@ -277,10 +277,10 @@ The current default value for is .Dv ARG_MAX - 4096. -.It Fl t +.It Fl t , Fl -verbose Echo the command to be executed to standard error immediately before it is executed. -.It Fl x +.It Fl x , Fl -exit Force .Nm to terminate immediately if a command line containing Modified: stable/12/usr.bin/xargs/xargs.c ============================================================================== --- stable/12/usr.bin/xargs/xargs.c Wed Sep 30 00:47:57 2020 (r366275) +++ stable/12/usr.bin/xargs/xargs.c Wed Sep 30 00:53:55 2020 (r366276) @@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -98,6 +99,22 @@ static volatile int childerr; extern char **environ; +static const char *optstr = "+0E:I:J:L:n:oP:pR:S:s:rtx"; + +static const struct option long_options[] = +{ + {"exit", no_argument, NULL, 'x'}, + {"interactive", no_argument, NULL, 'p'}, + {"max-args", required_argument, NULL, 'n'}, + {"max-chars", required_argument, NULL, 's'}, + {"max-procs", required_argument, NULL, 'P'}, + {"no-run-if-empty", no_argument, NULL, 'r'}, + {"null", no_argument, NULL, '0'}, + {"verbose", no_argument, NULL, 't'}, + + {NULL, no_argument, NULL, 0}, +}; + int main(int argc, char *argv[]) { @@ -137,7 +154,7 @@ main(int argc, char *argv[]) nline -= strlen(*ep++) + 1 + sizeof(*ep); } maxprocs = 1; - while ((ch = getopt(argc, argv, "0E:I:J:L:n:oP:pR:S:s:rtx")) != -1) + while ((ch = getopt_long(argc, argv, optstr, long_options, NULL)) != -1) switch (ch) { case 'E': eofstr = optarg; From owner-svn-src-all@freebsd.org Wed Sep 30 00:56:09 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8AB633F67DD; Wed, 30 Sep 2020 00:56:09 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C1Hr93BMzz4Tx6; Wed, 30 Sep 2020 00:56:09 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 52109172FB; Wed, 30 Sep 2020 00:56:09 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08U0u92Q045410; Wed, 30 Sep 2020 00:56:09 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08U0u8AH045409; Wed, 30 Sep 2020 00:56:08 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202009300056.08U0u8AH045409@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 30 Sep 2020 00:56:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366277 - in stable/12: bin/cp bin/cp/tests etc/mtree X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/12: bin/cp bin/cp/tests etc/mtree X-SVN-Commit-Revision: 366277 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Sep 2020 00:56:09 -0000 Author: kevans Date: Wed Sep 30 00:56:08 2020 New Revision: 366277 URL: https://svnweb.freebsd.org/changeset/base/366277 Log: MFC r366059-r366060: cp(1): tests r366059: cp: add some basic tests There are some tests available in the NetBSD test suite, but we don't currently pass all of those; further investigation will go into that. For now, just add a basic test as well as a test that copies from /dev/null to a file. The /dev/null test confirms that the file gets created if it's empty, then that it truncates the file if it's non-empty. This matches some usage that was previously employed in the build and was replaced in r366042 by a simpler shell construct. I will also plan on coming back to expand these in due time. r366060: cp: tests: fix weird 20 insertion This slipped in at the last moment. =( Added: stable/12/bin/cp/tests/ - copied from r366060, head/bin/cp/tests/ Modified: stable/12/bin/cp/Makefile stable/12/etc/mtree/BSD.tests.dist Directory Properties: stable/12/ (props changed) Modified: stable/12/bin/cp/Makefile ============================================================================== --- stable/12/bin/cp/Makefile Wed Sep 30 00:53:55 2020 (r366276) +++ stable/12/bin/cp/Makefile Wed Sep 30 00:56:08 2020 (r366277) @@ -1,9 +1,14 @@ # @(#)Makefile 8.1 (Berkeley) 5/31/93 # $FreeBSD$ +.include + PACKAGE=runtime PROG= cp SRCS= cp.c utils.c CFLAGS+= -DVM_AND_BUFFER_CACHE_SYNCHRONIZED -D_ACL_PRIVATE + +HAS_TESTS= +SUBDIR.${MK_TESTS}= tests .include Modified: stable/12/etc/mtree/BSD.tests.dist ============================================================================== --- stable/12/etc/mtree/BSD.tests.dist Wed Sep 30 00:53:55 2020 (r366276) +++ stable/12/etc/mtree/BSD.tests.dist Wed Sep 30 00:56:08 2020 (r366277) @@ -12,6 +12,8 @@ .. chmod .. + cp + .. date .. dd From owner-svn-src-all@freebsd.org Wed Sep 30 02:05:29 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 61CC73F7ED8 for ; Wed, 30 Sep 2020 02:05:29 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x831.google.com (mail-qt1-x831.google.com [IPv6:2607:f8b0:4864:20::831]) (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 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C1KN82YRLz4XkW for ; Wed, 30 Sep 2020 02:05:28 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x831.google.com with SMTP id o21so79245qtp.2 for ; Tue, 29 Sep 2020 19:05:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=5db4OSbCUKytfVmr+H73CBWZDM58aKNoOSv7WN+XHHI=; b=M1rcxbA7M4q7WLAM+Wlh5rP6zusaQlUvRV6v4QQh2HaLuIWCvDYJ6j4IHeIHNJFAY0 +9mv8xQOQTKBr0GBue4910w+Xv5RzMCsXoZN8Y35X40ZyZvgrILkh9vZ9SqEnEsIfpFU dHgRfGLAOiI9ErmEF8K9STa9NT4fC3pL0v0GoCVRUK6yInGnA0GP0nvJRIRp49m5JOwT GZszakVTmROriWrUFJid+ZqEFnD+Gf6JTGZ1toWxLbcLe8yUP8gxPlleIjIQeAzi7wdc 7cbhS3suQYJVanYzTwRRdkd/4TIu8AbIbET/+0hQNXmGm/BHvQUY9QiCaaoE/iDh+b2z ONTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=5db4OSbCUKytfVmr+H73CBWZDM58aKNoOSv7WN+XHHI=; b=JnWnc4oA3tmlvQWeoZE4W02H2ZcQc62q8lJCPWcoe+FAtcFcH5HYBz0kLs+74xpQQ7 Zrq7LGadGV/oDLoozW1nPkCGzQcu7E/6BVTJfOEN7lSk6bfGc+Tf/KugSS0gjHbZ1Q/d xD6VZGyLihH3tQNjjXqynV9/DAwYexEyOdn1eb++n4JP+fjq4HoyBvAxPKzoLxCWuROE uB7/4vw6aMXfeFD5zKhvnYIQ9f3OH1cMHmOlTpoqsq2bsRo70tugKaPTNAjlLgLATj0f iEM+roPnHE+mm3zgimhSVB4Oqy7RiI+RAhfoaSYsIwT3SDakF9bOYeVJ9AsCOwAS7NuN r5gA== X-Gm-Message-State: AOAM531gfBtn5JxekuRkrbV/9xjx/8VOpktwbPZyoXq6vxkHqUwnH5WU 4pfP/TyWCut+fz6YpEb7bqxGTrOqC4DBDZsmdeHNdg== X-Google-Smtp-Source: ABdhPJwZatgymdl0lrUKittp2t63uyl8pYwpgAkw7qknjHRWti/hN8FwWO5qJrOmUOVEhKmkQ8pacDvnCuC0x6VaVfE= X-Received: by 2002:ac8:2f42:: with SMTP id k2mr129737qta.32.1601431527229; Tue, 29 Sep 2020 19:05:27 -0700 (PDT) MIME-Version: 1.0 References: <202009291806.08TI62eE083160@repo.freebsd.org> In-Reply-To: From: Warner Losh Date: Tue, 29 Sep 2020 20:05:15 -0600 Message-ID: Subject: Re: svn commit: r366265 - head/sys/sys To: Hans Petter Selasky Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 4C1KN82YRLz4XkW X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=M1rcxbA7; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::831) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-1.94 / 15.00]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; NEURAL_HAM_MEDIUM(-0.90)[-0.903]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-0.94)[-0.943]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; NEURAL_HAM_SHORT(-0.09)[-0.094]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::831:from]; R_SPF_NA(0.00)[no SPF record]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; MAILMAN_DEST(0.00)[svn-src-all]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Sep 2020 02:05:29 -0000 On Tue, Sep 29, 2020, 1:00 PM Hans Petter Selasky wrote: > On 2020-09-29 20:06, Warner Losh wrote: > > Author: imp > > Date: Tue Sep 29 18:06:02 2020 > > New Revision: 366265 > > URL: https://svnweb.freebsd.org/changeset/base/366265 > > > > Log: > > Standalone SX shims > > > > Create a do-nothing version of SX locks. OpenZFS needs them. However, > > since the boot loader is single threaded, they can be nops. > > > > Modified: > > head/sys/sys/sx.h > > > > Modified: head/sys/sys/sx.h > > > ============================================================================== > > --- head/sys/sys/sx.h Tue Sep 29 17:52:15 2020 (r366264) > > +++ head/sys/sys/sx.h Tue Sep 29 18:06:02 2020 (r366265) > > @@ -300,4 +300,26 @@ __sx_xunlock(struct sx *sx, struct thread *td, > const c > > > > #endif /* _KERNEL */ > > > > +#ifdef _STANDALONE > > +/* since we have no threads in the boot loader, trivially implement > no-op version */ > > +#define sx_xlock(s) (1) > > +#define sx_try_xlock(s) (1) > > +#define sx_xunlock(s) (1) > > +#define SX_DUPOK 0 > > +#define SX_NEW 0 > > +#define SX_NOWITNESS 0 > > + > > +static __inline void > > +sx_init_flags(struct sx *sx, const char *description, int opts) > > +{ > > + > > +} > > + > > +static __inline void > > +sx_destroy(struct sx *sx) > > +{ > > + > > +} > > +#endif /* _STANDALONE */ > > + > > #endif /* !_SYS_SX_H_ */ > > > > You may want to use: > > bsd_kernel.c:sx_init_flags(struct sx *sx, const char *name, int flags) > bsd_kernel.c: sx->owned = 0; > bsd_kernel.c:sx_destroy(struct sx *sx) > bsd_kernel.c:sx_xlock(struct sx *sx) > bsd_kernel.c: sx->owned++; > bsd_kernel.c:sx_xunlock(struct sx *sx) > bsd_kernel.c: sx->owned--; > bsd_kernel.c:sx_xlocked(struct sx *sx) > bsd_kernel.c: return (sx->owned != 0); > bsd_kernel.h:struct sx { > bsd_kernel.h:#define sx_assert(...) do { } while (0) > bsd_kernel.h:#define sx_init(...) sx_init_flags(__VA_ARGS__, 0) > bsd_kernel.h:void sx_init_flags(struct sx *, const char *, int); > bsd_kernel.h:void sx_destroy(struct sx *); > bsd_kernel.h:void sx_xlock(struct sx *); > bsd_kernel.h:void sx_xunlock(struct sx *); > bsd_kernel.h:int sx_xlocked(struct sx *); > > from "src/stand/kshim" > Yea. This, and other parts of the shims, need to be integrated into stand... Warner > From owner-svn-src-all@freebsd.org Wed Sep 30 02:18:09 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B2D653F83A5; Wed, 30 Sep 2020 02:18:09 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C1Kfn4GjYz4YSN; Wed, 30 Sep 2020 02:18:09 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 75EA7186BC; Wed, 30 Sep 2020 02:18:09 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08U2I9hx094696; Wed, 30 Sep 2020 02:18:09 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08U2I90g094695; Wed, 30 Sep 2020 02:18:09 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <202009300218.08U2I90g094695@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Wed, 30 Sep 2020 02:18:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366278 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 366278 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Sep 2020 02:18:09 -0000 Author: rmacklem Date: Wed Sep 30 02:18:09 2020 New Revision: 366278 URL: https://svnweb.freebsd.org/changeset/base/366278 Log: Make copy_file_range(2) Linux compatible for overflow of offset + len. Without this patch, if a call to copy_file_range(2) specifies an input file offset + len that would wrap around, EINVAL is returned. I thought that was the Linux behaviour, but recent testing showed that Linux accepts this case and does the copy_file_range() to EOF. This patch changes the FreeBSD code to exhibit the same behaviour as Linux for this case. Reviewed by: asomers, kib Differential Revision: https://reviews.freebsd.org/D26569 Modified: head/sys/kern/vfs_vnops.c Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Wed Sep 30 00:56:08 2020 (r366277) +++ head/sys/kern/vfs_vnops.c Wed Sep 30 02:18:09 2020 (r366278) @@ -2790,25 +2790,31 @@ vn_copy_file_range(struct vnode *invp, off_t *inoffp, { int error; size_t len; - uint64_t uvalin, uvalout; + uint64_t uval; len = *lenp; *lenp = 0; /* For error returns. */ error = 0; /* Do some sanity checks on the arguments. */ - uvalin = *inoffp; - uvalin += len; - uvalout = *outoffp; - uvalout += len; if (invp->v_type == VDIR || outvp->v_type == VDIR) error = EISDIR; - else if (*inoffp < 0 || uvalin > INT64_MAX || uvalin < - (uint64_t)*inoffp || *outoffp < 0 || uvalout > INT64_MAX || - uvalout < (uint64_t)*outoffp || invp->v_type != VREG || - outvp->v_type != VREG) + else if (*inoffp < 0 || *outoffp < 0 || + invp->v_type != VREG || outvp->v_type != VREG) error = EINVAL; if (error != 0) + goto out; + + /* Ensure offset + len does not wrap around. */ + uval = *inoffp; + uval += len; + if (uval > INT64_MAX) + len = INT64_MAX - *inoffp; + uval = *outoffp; + uval += len; + if (uval > INT64_MAX) + len = INT64_MAX - *outoffp; + if (len == 0) goto out; /* From owner-svn-src-all@freebsd.org Wed Sep 30 02:21:38 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E87AE3F83D2; Wed, 30 Sep 2020 02:21:38 +0000 (UTC) (envelope-from jrtc27@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C1Kkp5nGhz4YTR; Wed, 30 Sep 2020 02:21:38 +0000 (UTC) (envelope-from jrtc27@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A9F57186C3; Wed, 30 Sep 2020 02:21:38 +0000 (UTC) (envelope-from jrtc27@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08U2LcHE098071; Wed, 30 Sep 2020 02:21:38 GMT (envelope-from jrtc27@FreeBSD.org) Received: (from jrtc27@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08U2Lc5s098070; Wed, 30 Sep 2020 02:21:38 GMT (envelope-from jrtc27@FreeBSD.org) Message-Id: <202009300221.08U2Lc5s098070@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jrtc27 set sender to jrtc27@FreeBSD.org using -f From: Jessica Clarke Date: Wed, 30 Sep 2020 02:21:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366279 - head/sys/riscv/include X-SVN-Group: head X-SVN-Commit-Author: jrtc27 X-SVN-Commit-Paths: head/sys/riscv/include X-SVN-Commit-Revision: 366279 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Sep 2020 02:21:39 -0000 Author: jrtc27 Date: Wed Sep 30 02:21:38 2020 New Revision: 366279 URL: https://svnweb.freebsd.org/changeset/base/366279 Log: riscv: Define __PCI_REROUTE_INTERRUPT Every other architecture defines this and this is required for interrupts to work when using QEMU's PCI VirtIO devices (which all report an interrupt line of 0) for two reasons. Firstly, interrupt line 0 is wrong; they use one of 0x20-0x23 with the lines being cycled across devices like normal. Moreover, RISC-V uses INTRNG, whose IRQs are virtual as indices into its irq_map, so even if we have the right interrupt line we still need to try and route the interrupt in order to ultimately call into intr_map_irq and get back a unique index into the map for the given line, otherwise we will use whatever happens to be in irq_map[line] (which for QEMU where the line is initialised to 0 results in using the first allocated interrupt, namely the RTC on IRQ 11 at time of commit). Note that pci_assign_interrupt will still do the wrong thing for INTRNG when using a tunable, as it will bypass INTRNG entirely and use the tunable's value as the index into irq_map, when it should instead (indirectly) call intr_map_irq to allocate a new entry for the given IRQ and treat the tunable as stating the physical line in use, which is what one would expect. This, however, is a problem shared by all INTRNG architectures, and not exclusive to RISC-V. Reviewed by: kib Approved by: kib Differential Revision: https://reviews.freebsd.org/D26564 Modified: head/sys/riscv/include/param.h Modified: head/sys/riscv/include/param.h ============================================================================== --- head/sys/riscv/include/param.h Wed Sep 30 02:18:09 2020 (r366278) +++ head/sys/riscv/include/param.h Wed Sep 30 02:21:38 2020 (r366279) @@ -42,6 +42,8 @@ #define STACKALIGNBYTES (16 - 1) #define STACKALIGN(p) ((uint64_t)(p) & ~STACKALIGNBYTES) +#define __PCI_REROUTE_INTERRUPT + #ifndef MACHINE #define MACHINE "riscv" #endif From owner-svn-src-all@freebsd.org Wed Sep 30 02:25:07 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6FDFF3F8645; Wed, 30 Sep 2020 02:25:07 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C1Kpq2C1hz4YkK; Wed, 30 Sep 2020 02:25:07 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2BF7B18554; Wed, 30 Sep 2020 02:25:07 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08U2P7BN000955; Wed, 30 Sep 2020 02:25:07 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08U2P543000949; Wed, 30 Sep 2020 02:25:05 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009300225.08U2P543000949@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 30 Sep 2020 02:25:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366280 - in stable/12/sys: compat/cloudabi compat/freebsd32 compat/linux kern sys X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/12/sys: compat/cloudabi compat/freebsd32 compat/linux kern sys X-SVN-Commit-Revision: 366280 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Sep 2020 02:25:07 -0000 Author: kib Date: Wed Sep 30 02:25:05 2020 New Revision: 366280 URL: https://svnweb.freebsd.org/changeset/base/366280 Log: MFC r366085, r366113: Do not leak oldvmspace if image activation failed Modified: stable/12/sys/compat/cloudabi/cloudabi_proc.c stable/12/sys/compat/freebsd32/freebsd32_misc.c stable/12/sys/compat/linux/linux_emul.c stable/12/sys/kern/kern_exec.c stable/12/sys/sys/imgact.h stable/12/sys/sys/syscallsubr.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/cloudabi/cloudabi_proc.c ============================================================================== --- stable/12/sys/compat/cloudabi/cloudabi_proc.c Wed Sep 30 02:21:38 2020 (r366279) +++ stable/12/sys/compat/cloudabi/cloudabi_proc.c Wed Sep 30 02:25:05 2020 (r366280) @@ -57,7 +57,7 @@ cloudabi_sys_proc_exec(struct thread *td, uap->fds, uap->fds_len); if (error == 0) { args.fd = uap->fd; - error = kern_execve(td, &args, NULL); + error = kern_execve(td, &args, NULL, oldvmspace); } post_execve(td, error, oldvmspace); return (error); Modified: stable/12/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- stable/12/sys/compat/freebsd32/freebsd32_misc.c Wed Sep 30 02:21:38 2020 (r366279) +++ stable/12/sys/compat/freebsd32/freebsd32_misc.c Wed Sep 30 02:25:05 2020 (r366280) @@ -438,7 +438,7 @@ freebsd32_execve(struct thread *td, struct freebsd32_e error = freebsd32_exec_copyin_args(&eargs, uap->fname, UIO_USERSPACE, uap->argv, uap->envv); if (error == 0) - error = kern_execve(td, &eargs, NULL); + error = kern_execve(td, &eargs, NULL, oldvmspace); post_execve(td, error, oldvmspace); return (error); } @@ -457,7 +457,7 @@ freebsd32_fexecve(struct thread *td, struct freebsd32_ uap->argv, uap->envv); if (error == 0) { eargs.fd = uap->fd; - error = kern_execve(td, &eargs, NULL); + error = kern_execve(td, &eargs, NULL, oldvmspace); } post_execve(td, error, oldvmspace); return (error); Modified: stable/12/sys/compat/linux/linux_emul.c ============================================================================== --- stable/12/sys/compat/linux/linux_emul.c Wed Sep 30 02:21:38 2020 (r366279) +++ stable/12/sys/compat/linux/linux_emul.c Wed Sep 30 02:25:05 2020 (r366280) @@ -256,7 +256,7 @@ linux_common_execve(struct thread *td, struct image_ar if (error != 0) return (error); - error = kern_execve(td, eargs, NULL); + error = kern_execve(td, eargs, NULL, oldvmspace); post_execve(td, error, oldvmspace); if (error != EJUSTRETURN) return (error); Modified: stable/12/sys/kern/kern_exec.c ============================================================================== --- stable/12/sys/kern/kern_exec.c Wed Sep 30 02:21:38 2020 (r366279) +++ stable/12/sys/kern/kern_exec.c Wed Sep 30 02:25:05 2020 (r366280) @@ -119,7 +119,7 @@ static int sysctl_kern_ps_strings(SYSCTL_HANDLER_ARGS) static int sysctl_kern_usrstack(SYSCTL_HANDLER_ARGS); static int sysctl_kern_stackprot(SYSCTL_HANDLER_ARGS); static int do_execve(struct thread *td, struct image_args *args, - struct mac *mac_p); + struct mac *mac_p, struct vmspace *oldvmspace); /* XXX This should be vm_size_t. */ SYSCTL_PROC(_kern, KERN_PS_STRINGS, ps_strings, CTLTYPE_ULONG|CTLFLAG_RD| @@ -222,7 +222,7 @@ sys_execve(struct thread *td, struct execve_args *uap) error = exec_copyin_args(&args, uap->fname, UIO_USERSPACE, uap->argv, uap->envv); if (error == 0) - error = kern_execve(td, &args, NULL); + error = kern_execve(td, &args, NULL, oldvmspace); post_execve(td, error, oldvmspace); return (error); } @@ -248,7 +248,7 @@ sys_fexecve(struct thread *td, struct fexecve_args *ua uap->argv, uap->envv); if (error == 0) { args.fd = uap->fd; - error = kern_execve(td, &args, NULL); + error = kern_execve(td, &args, NULL, oldvmspace); } post_execve(td, error, oldvmspace); return (error); @@ -277,7 +277,7 @@ sys___mac_execve(struct thread *td, struct __mac_execv error = exec_copyin_args(&args, uap->fname, UIO_USERSPACE, uap->argv, uap->envv); if (error == 0) - error = kern_execve(td, &args, uap->mac_p); + error = kern_execve(td, &args, uap->mac_p, oldvmspace); post_execve(td, error, oldvmspace); return (error); #else @@ -325,30 +325,26 @@ post_execve(struct thread *td, int error, struct vmspa thread_single_end(p, SINGLE_BOUNDARY); PROC_UNLOCK(p); } - if ((td->td_pflags & TDP_EXECVMSPC) != 0) { - KASSERT(p->p_vmspace != oldvmspace, - ("oldvmspace still used")); - vmspace_free(oldvmspace); - td->td_pflags &= ~TDP_EXECVMSPC; - } + exec_cleanup(td, oldvmspace); } /* - * XXX: kern_execve has the astonishing property of not always returning to + * kern_execve() has the astonishing property of not always returning to * the caller. If sufficiently bad things happen during the call to * do_execve(), it can end up calling exit1(); as a result, callers must * avoid doing anything which they might need to undo (e.g., allocating * memory). */ int -kern_execve(struct thread *td, struct image_args *args, struct mac *mac_p) +kern_execve(struct thread *td, struct image_args *args, struct mac *mac_p, + struct vmspace *oldvmspace) { AUDIT_ARG_ARGV(args->begin_argv, args->argc, args->begin_envv - args->begin_argv); AUDIT_ARG_ENVV(args->begin_envv, args->envc, args->endp - args->begin_envv); - return (do_execve(td, args, mac_p)); + return (do_execve(td, args, mac_p, oldvmspace)); } /* @@ -356,7 +352,8 @@ kern_execve(struct thread *td, struct image_args *args * userspace pointers from the passed thread. */ static int -do_execve(struct thread *td, struct image_args *args, struct mac *mac_p) +do_execve(struct thread *td, struct image_args *args, struct mac *mac_p, + struct vmspace *oldvmspace) { struct proc *p = td->td_proc; struct nameidata nd; @@ -964,6 +961,7 @@ exec_fail: if (error && imgp->vmspace_destroyed) { /* sorry, no more process anymore. exit gracefully */ + exec_cleanup(td, oldvmspace); exit1(td, 0, SIGABRT); /* NOT REACHED */ } @@ -980,6 +978,17 @@ exec_fail: * registers unmodified when returning EJUSTRETURN. */ return (error == 0 ? EJUSTRETURN : error); +} + +void +exec_cleanup(struct thread *td, struct vmspace *oldvmspace) +{ + if ((td->td_pflags & TDP_EXECVMSPC) != 0) { + KASSERT(td->td_proc->p_vmspace != oldvmspace, + ("oldvmspace still used")); + vmspace_free(oldvmspace); + td->td_pflags &= ~TDP_EXECVMSPC; + } } int Modified: stable/12/sys/sys/imgact.h ============================================================================== --- stable/12/sys/sys/imgact.h Wed Sep 30 02:21:38 2020 (r366279) +++ stable/12/sys/sys/imgact.h Wed Sep 30 02:25:05 2020 (r366280) @@ -100,6 +100,7 @@ struct vmspace; int exec_alloc_args(struct image_args *); int exec_check_permissions(struct image_params *); +void exec_cleanup(struct thread *td, struct vmspace *); register_t *exec_copyout_strings(struct image_params *); void exec_free_args(struct image_args *); int exec_new_vmspace(struct image_params *, struct sysentvec *); Modified: stable/12/sys/sys/syscallsubr.h ============================================================================== --- stable/12/sys/sys/syscallsubr.h Wed Sep 30 02:21:38 2020 (r366279) +++ stable/12/sys/sys/syscallsubr.h Wed Sep 30 02:25:05 2020 (r366280) @@ -63,6 +63,7 @@ struct stat; struct thr_param; struct uio; struct vm_map; +struct vmspace; typedef int (*mmap_check_fp_fn)(struct file *, int, int, int); @@ -117,7 +118,7 @@ int kern_cpuset_setid(struct thread *td, cpuwhich_t wh id_t id, cpusetid_t setid); int kern_dup(struct thread *td, u_int mode, int flags, int old, int new); int kern_execve(struct thread *td, struct image_args *args, - struct mac *mac_p); + struct mac *mac_p, struct vmspace *oldvmspace); int kern_fchmodat(struct thread *td, int fd, char *path, enum uio_seg pathseg, mode_t mode, int flag); int kern_fchownat(struct thread *td, int fd, char *path, From owner-svn-src-all@freebsd.org Wed Sep 30 02:28:48 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2B04D3F89AE; Wed, 30 Sep 2020 02:28:48 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C1Kv40L9Tz4Yvy; Wed, 30 Sep 2020 02:28:48 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E2EEE18556; Wed, 30 Sep 2020 02:28:47 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08U2SlFN001208; Wed, 30 Sep 2020 02:28:47 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08U2Sk8w001202; Wed, 30 Sep 2020 02:28:46 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009300228.08U2Sk8w001202@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 30 Sep 2020 02:28:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r366281 - in stable/11/sys: compat/cloudabi compat/freebsd32 compat/linux kern sys X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/11/sys: compat/cloudabi compat/freebsd32 compat/linux kern sys X-SVN-Commit-Revision: 366281 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Sep 2020 02:28:48 -0000 Author: kib Date: Wed Sep 30 02:28:46 2020 New Revision: 366281 URL: https://svnweb.freebsd.org/changeset/base/366281 Log: MFC r366085, r366113: Do not leak oldvmspace if image activation failed Modified: stable/11/sys/compat/cloudabi/cloudabi_proc.c stable/11/sys/compat/freebsd32/freebsd32_misc.c stable/11/sys/compat/linux/linux_emul.c stable/11/sys/kern/kern_exec.c stable/11/sys/sys/imgact.h stable/11/sys/sys/syscallsubr.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/cloudabi/cloudabi_proc.c ============================================================================== --- stable/11/sys/compat/cloudabi/cloudabi_proc.c Wed Sep 30 02:25:05 2020 (r366280) +++ stable/11/sys/compat/cloudabi/cloudabi_proc.c Wed Sep 30 02:28:46 2020 (r366281) @@ -57,7 +57,7 @@ cloudabi_sys_proc_exec(struct thread *td, uap->fds, uap->fds_len); if (error == 0) { args.fd = uap->fd; - error = kern_execve(td, &args, NULL); + error = kern_execve(td, &args, NULL, oldvmspace); } post_execve(td, error, oldvmspace); return (error); Modified: stable/11/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- stable/11/sys/compat/freebsd32/freebsd32_misc.c Wed Sep 30 02:25:05 2020 (r366280) +++ stable/11/sys/compat/freebsd32/freebsd32_misc.c Wed Sep 30 02:28:46 2020 (r366281) @@ -428,7 +428,7 @@ freebsd32_execve(struct thread *td, struct freebsd32_e error = freebsd32_exec_copyin_args(&eargs, uap->fname, UIO_USERSPACE, uap->argv, uap->envv); if (error == 0) - error = kern_execve(td, &eargs, NULL); + error = kern_execve(td, &eargs, NULL, oldvmspace); post_execve(td, error, oldvmspace); return (error); } @@ -447,7 +447,7 @@ freebsd32_fexecve(struct thread *td, struct freebsd32_ uap->argv, uap->envv); if (error == 0) { eargs.fd = uap->fd; - error = kern_execve(td, &eargs, NULL); + error = kern_execve(td, &eargs, NULL, oldvmspace); } post_execve(td, error, oldvmspace); return (error); Modified: stable/11/sys/compat/linux/linux_emul.c ============================================================================== --- stable/11/sys/compat/linux/linux_emul.c Wed Sep 30 02:25:05 2020 (r366280) +++ stable/11/sys/compat/linux/linux_emul.c Wed Sep 30 02:28:46 2020 (r366281) @@ -226,7 +226,7 @@ linux_common_execve(struct thread *td, struct image_ar if (error != 0) return (error); - error = kern_execve(td, eargs, NULL); + error = kern_execve(td, eargs, NULL, oldvmspace); post_execve(td, error, oldvmspace); if (error != 0) return (error); Modified: stable/11/sys/kern/kern_exec.c ============================================================================== --- stable/11/sys/kern/kern_exec.c Wed Sep 30 02:25:05 2020 (r366280) +++ stable/11/sys/kern/kern_exec.c Wed Sep 30 02:28:46 2020 (r366281) @@ -117,7 +117,7 @@ static int sysctl_kern_ps_strings(SYSCTL_HANDLER_ARGS) static int sysctl_kern_usrstack(SYSCTL_HANDLER_ARGS); static int sysctl_kern_stackprot(SYSCTL_HANDLER_ARGS); static int do_execve(struct thread *td, struct image_args *args, - struct mac *mac_p); + struct mac *mac_p, struct vmspace *oldvmspace); /* XXX This should be vm_size_t. */ SYSCTL_PROC(_kern, KERN_PS_STRINGS, ps_strings, CTLTYPE_ULONG|CTLFLAG_RD| @@ -220,7 +220,7 @@ sys_execve(struct thread *td, struct execve_args *uap) error = exec_copyin_args(&args, uap->fname, UIO_USERSPACE, uap->argv, uap->envv); if (error == 0) - error = kern_execve(td, &args, NULL); + error = kern_execve(td, &args, NULL, oldvmspace); post_execve(td, error, oldvmspace); return (error); } @@ -246,7 +246,7 @@ sys_fexecve(struct thread *td, struct fexecve_args *ua uap->argv, uap->envv); if (error == 0) { args.fd = uap->fd; - error = kern_execve(td, &args, NULL); + error = kern_execve(td, &args, NULL, oldvmspace); } post_execve(td, error, oldvmspace); return (error); @@ -275,7 +275,7 @@ sys___mac_execve(struct thread *td, struct __mac_execv error = exec_copyin_args(&args, uap->fname, UIO_USERSPACE, uap->argv, uap->envv); if (error == 0) - error = kern_execve(td, &args, uap->mac_p); + error = kern_execve(td, &args, uap->mac_p, oldvmspace); post_execve(td, error, oldvmspace); return (error); #else @@ -323,30 +323,26 @@ post_execve(struct thread *td, int error, struct vmspa thread_single_end(p, SINGLE_BOUNDARY); PROC_UNLOCK(p); } - if ((td->td_pflags & TDP_EXECVMSPC) != 0) { - KASSERT(p->p_vmspace != oldvmspace, - ("oldvmspace still used")); - vmspace_free(oldvmspace); - td->td_pflags &= ~TDP_EXECVMSPC; - } + exec_cleanup(td, oldvmspace); } /* - * XXX: kern_execve has the astonishing property of not always returning to + * kern_execve() has the astonishing property of not always returning to * the caller. If sufficiently bad things happen during the call to * do_execve(), it can end up calling exit1(); as a result, callers must * avoid doing anything which they might need to undo (e.g., allocating * memory). */ int -kern_execve(struct thread *td, struct image_args *args, struct mac *mac_p) +kern_execve(struct thread *td, struct image_args *args, struct mac *mac_p, + struct vmspace *oldvmspace) { AUDIT_ARG_ARGV(args->begin_argv, args->argc, args->begin_envv - args->begin_argv); AUDIT_ARG_ENVV(args->begin_envv, args->envc, args->endp - args->begin_envv); - return (do_execve(td, args, mac_p)); + return (do_execve(td, args, mac_p, oldvmspace)); } /* @@ -354,7 +350,8 @@ kern_execve(struct thread *td, struct image_args *args * userspace pointers from the passed thread. */ static int -do_execve(struct thread *td, struct image_args *args, struct mac *mac_p) +do_execve(struct thread *td, struct image_args *args, struct mac *mac_p, + struct vmspace *oldvmspace) { struct proc *p = td->td_proc; struct nameidata nd; @@ -966,6 +963,7 @@ exec_fail: if (error && imgp->vmspace_destroyed) { /* sorry, no more process anymore. exit gracefully */ + exec_cleanup(td, oldvmspace); exit1(td, 0, SIGABRT); /* NOT REACHED */ } @@ -976,6 +974,17 @@ exec_fail: #endif return (error); +} + +void +exec_cleanup(struct thread *td, struct vmspace *oldvmspace) +{ + if ((td->td_pflags & TDP_EXECVMSPC) != 0) { + KASSERT(td->td_proc->p_vmspace != oldvmspace, + ("oldvmspace still used")); + vmspace_free(oldvmspace); + td->td_pflags &= ~TDP_EXECVMSPC; + } } int Modified: stable/11/sys/sys/imgact.h ============================================================================== --- stable/11/sys/sys/imgact.h Wed Sep 30 02:25:05 2020 (r366280) +++ stable/11/sys/sys/imgact.h Wed Sep 30 02:28:46 2020 (r366281) @@ -97,6 +97,7 @@ struct vmspace; int exec_alloc_args(struct image_args *); int exec_check_permissions(struct image_params *); +void exec_cleanup(struct thread *td, struct vmspace *); register_t *exec_copyout_strings(struct image_params *); void exec_free_args(struct image_args *); int exec_new_vmspace(struct image_params *, struct sysentvec *); Modified: stable/11/sys/sys/syscallsubr.h ============================================================================== --- stable/11/sys/sys/syscallsubr.h Wed Sep 30 02:25:05 2020 (r366280) +++ stable/11/sys/sys/syscallsubr.h Wed Sep 30 02:28:46 2020 (r366281) @@ -59,6 +59,7 @@ struct stat; struct thr_param; struct sched_param; struct __wrusage; +struct vmspace; typedef int (*mmap_check_fp_fn)(struct file *, int, int, int); @@ -103,7 +104,7 @@ int kern_cpuset_setid(struct thread *td, cpuwhich_t wh id_t id, cpusetid_t setid); int kern_dup(struct thread *td, u_int mode, int flags, int old, int new); int kern_execve(struct thread *td, struct image_args *args, - struct mac *mac_p); + struct mac *mac_p, struct vmspace *oldvmspace); int kern_fchmodat(struct thread *td, int fd, char *path, enum uio_seg pathseg, mode_t mode, int flag); int kern_fchownat(struct thread *td, int fd, char *path, From owner-svn-src-all@freebsd.org Wed Sep 30 03:38:14 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 31B423F9BBF; Wed, 30 Sep 2020 03:38:14 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C1MR96NtSz4dFr; Wed, 30 Sep 2020 03:38:13 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BFBD91973A; Wed, 30 Sep 2020 03:38:13 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08U3cDnX045735; Wed, 30 Sep 2020 03:38:13 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08U3cD9v045734; Wed, 30 Sep 2020 03:38:13 GMT (envelope-from cy@FreeBSD.org) Message-Id: <202009300338.08U3cD9v045734@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 30 Sep 2020 03:38:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r366282 - in stable: 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 366282 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Sep 2020 03:38:14 -0000 Author: cy Date: Wed Sep 30 03:38:13 2020 New Revision: 366282 URL: https://svnweb.freebsd.org/changeset/base/366282 Log: MFC r366204: Remove extraneous bracket. Modified: stable/11/sys/contrib/ipfilter/netinet/ip_proxy.h Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/sys/contrib/ipfilter/netinet/ip_proxy.h Directory Properties: stable/12/ (props changed) Modified: stable/11/sys/contrib/ipfilter/netinet/ip_proxy.h ============================================================================== --- stable/11/sys/contrib/ipfilter/netinet/ip_proxy.h Wed Sep 30 02:28:46 2020 (r366281) +++ stable/11/sys/contrib/ipfilter/netinet/ip_proxy.h Wed Sep 30 03:38:13 2020 (r366282) @@ -13,7 +13,7 @@ #define __IP_PROXY_H__ #ifndef SOLARIS -# if defined(sun) && defined(__SVR4)) +# if defined(sun) && defined(__SVR4) # define SOLARIS 1 # else # define SOLARIS 0 From owner-svn-src-all@freebsd.org Wed Sep 30 03:38:14 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5EEFB3F98F4; Wed, 30 Sep 2020 03:38:14 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C1MRB1dxdz4dR1; Wed, 30 Sep 2020 03:38:14 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 17F0C1957B; Wed, 30 Sep 2020 03:38:14 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08U3cDHD045741; Wed, 30 Sep 2020 03:38:13 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08U3cDr1045740; Wed, 30 Sep 2020 03:38:13 GMT (envelope-from cy@FreeBSD.org) Message-Id: <202009300338.08U3cDr1045740@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 30 Sep 2020 03:38:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366282 - in stable: 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 366282 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Sep 2020 03:38:14 -0000 Author: cy Date: Wed Sep 30 03:38:13 2020 New Revision: 366282 URL: https://svnweb.freebsd.org/changeset/base/366282 Log: MFC r366204: Remove extraneous bracket. Modified: stable/12/sys/contrib/ipfilter/netinet/ip_proxy.h Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/contrib/ipfilter/netinet/ip_proxy.h Directory Properties: stable/11/ (props changed) Modified: stable/12/sys/contrib/ipfilter/netinet/ip_proxy.h ============================================================================== --- stable/12/sys/contrib/ipfilter/netinet/ip_proxy.h Wed Sep 30 02:28:46 2020 (r366281) +++ stable/12/sys/contrib/ipfilter/netinet/ip_proxy.h Wed Sep 30 03:38:13 2020 (r366282) @@ -13,7 +13,7 @@ #define __IP_PROXY_H__ #ifndef SOLARIS -# if defined(sun) && defined(__SVR4)) +# if defined(sun) && defined(__SVR4) # define SOLARIS 1 # else # define SOLARIS 0 From owner-svn-src-all@freebsd.org Wed Sep 30 04:27:38 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D61733FA1C3; Wed, 30 Sep 2020 04:27:38 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C1NXB50lWz4gLC; Wed, 30 Sep 2020 04:27:38 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8ABCF19C43; Wed, 30 Sep 2020 04:27:38 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08U4RcIs076409; Wed, 30 Sep 2020 04:27:38 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08U4RcXA076408; Wed, 30 Sep 2020 04:27:38 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202009300427.08U4RcXA076408@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 30 Sep 2020 04:27:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366283 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 366283 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Sep 2020 04:27:38 -0000 Author: mjg Date: Wed Sep 30 04:27:38 2020 New Revision: 366283 URL: https://svnweb.freebsd.org/changeset/base/366283 Log: cache: use cache_has_entries where appropriate instead of opencoding it Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Wed Sep 30 03:38:13 2020 (r366282) +++ head/sys/kern/vfs_cache.c Wed Sep 30 04:27:38 2020 (r366283) @@ -2240,8 +2240,7 @@ cache_purge_vgone(struct vnode *vp) VNPASS(VN_IS_DOOMED(vp), vp); vlp = VP2VNODELOCK(vp); - if (!(LIST_EMPTY(&vp->v_cache_src) && TAILQ_EMPTY(&vp->v_cache_dst) && - vp->v_cache_dd == NULL)) { + if (cache_has_entries(vp)) { mtx_lock(vlp); cache_purge_impl(vp); mtx_assert(vlp, MA_NOTOWNED); @@ -2249,12 +2248,10 @@ cache_purge_vgone(struct vnode *vp) } /* - * All the NULL pointer state we found above may be transient. - * Serialize against a possible thread doing cache_purge. + * Serialize against a potential thread doing cache_purge. */ mtx_wait_unlocked(vlp); - if (!(LIST_EMPTY(&vp->v_cache_src) && TAILQ_EMPTY(&vp->v_cache_dst) && - vp->v_cache_dd == NULL)) { + if (cache_has_entries(vp)) { mtx_lock(vlp); cache_purge_impl(vp); mtx_assert(vlp, MA_NOTOWNED); From owner-svn-src-all@freebsd.org Wed Sep 30 08:23:43 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F274342118D; Wed, 30 Sep 2020 08:23:43 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C1Tmb6BPQz3fVh; Wed, 30 Sep 2020 08:23:43 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B8EA41CE42; Wed, 30 Sep 2020 08:23:43 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08U8NhqO024242; Wed, 30 Sep 2020 08:23:43 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08U8NhFR024241; Wed, 30 Sep 2020 08:23:43 GMT (envelope-from kp@FreeBSD.org) Message-Id: <202009300823.08U8NhFR024241@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Wed, 30 Sep 2020 08:23:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366284 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 366284 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Sep 2020 08:23:44 -0000 Author: kp Date: Wed Sep 30 08:23:43 2020 New Revision: 366284 URL: https://svnweb.freebsd.org/changeset/base/366284 Log: riscv: Panic on PMP errors Load/store/fetch access exceptions always indicate a violation of a PMP rule. We can't treat those as page faults, because updating the page table and trying again will only result in exactly the same access exception recurring. This leaves us in an endless exception loop. We cannot recover from these exceptions, so panic instead. Reviewed by: jhb Sponsored by: Axiado Differential Revision: https://reviews.freebsd.org/D26544 Modified: head/sys/riscv/riscv/trap.c Modified: head/sys/riscv/riscv/trap.c ============================================================================== --- head/sys/riscv/riscv/trap.c Wed Sep 30 04:27:38 2020 (r366283) +++ head/sys/riscv/riscv/trap.c Wed Sep 30 08:23:43 2020 (r366284) @@ -282,6 +282,9 @@ do_trap_supervisor(struct trapframe *frame) case EXCP_FAULT_LOAD: case EXCP_FAULT_STORE: case EXCP_FAULT_FETCH: + dump_regs(frame); + panic("Memory access exception at 0x%016lx\n", frame->tf_sepc); + break; case EXCP_STORE_PAGE_FAULT: case EXCP_LOAD_PAGE_FAULT: data_abort(frame, 0); From owner-svn-src-all@freebsd.org Wed Sep 30 08:26:00 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C4C6A42115A; Wed, 30 Sep 2020 08:26:00 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C1TqD4sYnz3fnH; Wed, 30 Sep 2020 08:26:00 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8B00F1CD20; Wed, 30 Sep 2020 08:26:00 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08U8Q0mU024409; Wed, 30 Sep 2020 08:26:00 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08U8Q0I7024408; Wed, 30 Sep 2020 08:26:00 GMT (envelope-from cy@FreeBSD.org) Message-Id: <202009300826.08U8Q0I7024408@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 30 Sep 2020 08:26:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366285 - head/contrib/ipfilter/lib X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/contrib/ipfilter/lib X-SVN-Commit-Revision: 366285 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Sep 2020 08:26:00 -0000 Author: cy Date: Wed Sep 30 08:26:00 2020 New Revision: 366285 URL: https://svnweb.freebsd.org/changeset/base/366285 Log: Resurrect ipfilter's getifname, replacing the stub with the real function. MFC after: 2 months Modified: head/contrib/ipfilter/lib/getifname.c Modified: head/contrib/ipfilter/lib/getifname.c ============================================================================== --- head/contrib/ipfilter/lib/getifname.c Wed Sep 30 08:23:43 2020 (r366284) +++ head/contrib/ipfilter/lib/getifname.c Wed Sep 30 08:26:00 2020 (r366285) @@ -16,7 +16,6 @@ * Given a pointer to an interface in the kernel, return a pointer to a * string which is the interface name. */ -#if 0 char *getifname(ptr) struct ifnet *ptr; { @@ -80,13 +79,3 @@ char *getifname(ptr) # endif #endif } -#else -char *getifname(ptr) - struct ifnet *ptr; -{ -#if 0 - ptr = ptr; -#endif - return "X"; -} -#endif From owner-svn-src-all@freebsd.org Wed Sep 30 08:26:23 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7919A421234; Wed, 30 Sep 2020 08:26:23 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C1Tqg2ffHz3g0M; Wed, 30 Sep 2020 08:26:23 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3F26E1CF07; Wed, 30 Sep 2020 08:26:23 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08U8QN07024469; Wed, 30 Sep 2020 08:26:23 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08U8QNaD024468; Wed, 30 Sep 2020 08:26:23 GMT (envelope-from cy@FreeBSD.org) Message-Id: <202009300826.08U8QNaD024468@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 30 Sep 2020 08:26:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366286 - head/contrib/ipfilter/lib X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/contrib/ipfilter/lib X-SVN-Commit-Revision: 366286 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Sep 2020 08:26:23 -0000 Author: cy Date: Wed Sep 30 08:26:22 2020 New Revision: 366286 URL: https://svnweb.freebsd.org/changeset/base/366286 Log: ipfilter getifname ifdef cleanup. MFC after: 2 months Modified: head/contrib/ipfilter/lib/getifname.c Modified: head/contrib/ipfilter/lib/getifname.c ============================================================================== --- head/contrib/ipfilter/lib/getifname.c Wed Sep 30 08:26:00 2020 (r366285) +++ head/contrib/ipfilter/lib/getifname.c Wed Sep 30 08:26:22 2020 (r366286) @@ -19,11 +19,9 @@ char *getifname(ptr) struct ifnet *ptr; { -#if SOLARIS || defined(__hpux) -# if SOLARIS +#if SOLARIS # include # include -# endif # include "../pfil/qif.h" char *ifname; qif_t qif; @@ -42,13 +40,6 @@ char *getifname(ptr) } return ifname; #else -# if defined(NetBSD) && (NetBSD >= 199905) && (NetBSD < 1991011) || \ - defined(__OpenBSD__) || \ - (defined(__FreeBSD__) && (__FreeBSD_version >= 501113)) -#else - char buf[LIFNAMSIZ]; - int len; -# endif struct ifnet netif; if ((void *)ptr == (void *)-1) @@ -58,24 +49,6 @@ char *getifname(ptr) if (kmemcpy((char *)&netif, (u_long)ptr, sizeof(netif)) == -1) return "X"; -# if defined(NetBSD) && (NetBSD >= 199905) && (NetBSD < 1991011) || \ - defined(__OpenBSD__) || defined(linux) || \ - (defined(__FreeBSD__) && (__FreeBSD_version >= 501113)) return strdup(netif.if_xname); -# else - if (kstrncpy(buf, (u_long)netif.if_name, sizeof(buf)) == -1) - return "X"; - if (netif.if_unit < 10) - len = 2; - else if (netif.if_unit < 1000) - len = 3; - else if (netif.if_unit < 10000) - len = 4; - else - len = 5; - buf[sizeof(buf) - len] = '\0'; - sprintf(buf + strlen(buf), "%d", netif.if_unit % 10000); - return strdup(buf); -# endif #endif } From owner-svn-src-all@freebsd.org Wed Sep 30 08:26:26 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9A1844211B3; Wed, 30 Sep 2020 08:26:26 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C1Tqk3cjvz3fjV; Wed, 30 Sep 2020 08:26:26 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 50E491CF81; Wed, 30 Sep 2020 08:26:26 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08U8QQNx024515; Wed, 30 Sep 2020 08:26:26 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08U8QPJl024513; Wed, 30 Sep 2020 08:26:25 GMT (envelope-from cy@FreeBSD.org) Message-Id: <202009300826.08U8QPJl024513@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 30 Sep 2020 08:26:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366287 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 366287 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Sep 2020 08:26:26 -0000 Author: cy Date: Wed Sep 30 08:26:25 2020 New Revision: 366287 URL: https://svnweb.freebsd.org/changeset/base/366287 Log: Continued ipfilter #ifdef cleanup. The r343701 log entry contains a complete description. MFC after: 1 week Modified: head/sys/contrib/ipfilter/netinet/ip_nat.c Modified: head/sys/contrib/ipfilter/netinet/ip_nat.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_nat.c Wed Sep 30 08:26:22 2020 (r366286) +++ head/sys/contrib/ipfilter/netinet/ip_nat.c Wed Sep 30 08:26:25 2020 (r366287) @@ -5116,8 +5116,8 @@ ipf_nat_out(fin, nat, natadd, nflags) ipf_fix_outcksum(0, &fin->fin_ip->ip_sum, msumd, 0); } -#if !defined(_KERNEL) || defined(MENTAT) || defined(__sgi) || \ - defined(linux) || defined(BRIDGE_IPF) || defined(__FreeBSD__) +#if !defined(_KERNEL) || defined(MENTAT) || \ + defined(BRIDGE_IPF) || defined(__FreeBSD__) else { /* * Strictly speaking, this isn't necessary on BSD @@ -5631,8 +5631,7 @@ ipf_nat_in(fin, nat, natadd, nflags) } fin->fin_ip->ip_dst = nat->nat_ndstip; fin->fin_daddr = nat->nat_ndstaddr; -#if !defined(_KERNEL) || defined(MENTAT) || defined(__sgi) || \ - defined(__osf__) || defined(linux) +#if !defined(_KERNEL) || defined(MENTAT) ipf_fix_outcksum(0, &fin->fin_ip->ip_sum, ipsumd, 0); #endif break; From owner-svn-src-all@freebsd.org Wed Sep 30 12:16:36 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DB1E5426DFD; Wed, 30 Sep 2020 12:16:36 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C1ZxJ5Qqzz4DT1; Wed, 30 Sep 2020 12:16:36 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 996901F82A; Wed, 30 Sep 2020 12:16:36 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08UCGaw8068766; Wed, 30 Sep 2020 12:16:36 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08UCGa6m068765; Wed, 30 Sep 2020 12:16:36 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009301216.08UCGa6m068765@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 30 Sep 2020 12:16:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r366288 - stable/11/sys/compat/svr4 X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/compat/svr4 X-SVN-Commit-Revision: 366288 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Sep 2020 12:16:36 -0000 Author: kib Date: Wed Sep 30 12:16:36 2020 New Revision: 366288 URL: https://svnweb.freebsd.org/changeset/base/366288 Log: Try to fix build on i386 Modified: stable/11/sys/compat/svr4/svr4_misc.c Modified: stable/11/sys/compat/svr4/svr4_misc.c ============================================================================== --- stable/11/sys/compat/svr4/svr4_misc.c Wed Sep 30 08:26:25 2020 (r366287) +++ stable/11/sys/compat/svr4/svr4_misc.c Wed Sep 30 12:16:36 2020 (r366288) @@ -180,7 +180,7 @@ svr4_sys_execv(td, uap) error = exec_copyin_args(&eargs, path, UIO_SYSSPACE, uap->argp, NULL); free(path, M_TEMP); if (error == 0) - error = kern_execve(td, &eargs, NULL); + error = kern_execve(td, &eargs, NULL, oldvmspace); post_execve(td, error, oldvmspace); return (error); } @@ -206,7 +206,7 @@ svr4_sys_execve(td, uap) uap->envp); free(path, M_TEMP); if (error == 0) - error = kern_execve(td, &eargs, NULL); + error = kern_execve(td, &eargs, NULL, oldvmspace); post_execve(td, error, oldvmspace); return (error); } From owner-svn-src-all@freebsd.org Wed Sep 30 13:21:18 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9FD054283E6; Wed, 30 Sep 2020 13:21:18 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C1cMy3gLwz4HfG; Wed, 30 Sep 2020 13:21:18 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6142520705; Wed, 30 Sep 2020 13:21:18 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08UDLIPD008135; Wed, 30 Sep 2020 13:21:18 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08UDLI5G008134; Wed, 30 Sep 2020 13:21:18 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009301321.08UDLI5G008134@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 30 Sep 2020 13:21:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366289 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 366289 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Sep 2020 13:21:18 -0000 Author: kib Date: Wed Sep 30 13:21:17 2020 New Revision: 366289 URL: https://svnweb.freebsd.org/changeset/base/366289 Log: MFC r357530: Remove unneeded assert for curproc. Simplify. Modified: stable/12/sys/kern/kern_time.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/kern_time.c ============================================================================== --- stable/12/sys/kern/kern_time.c Wed Sep 30 12:16:36 2020 (r366288) +++ stable/12/sys/kern/kern_time.c Wed Sep 30 13:21:17 2020 (r366289) @@ -255,11 +255,8 @@ void kern_thread_cputime(struct thread *targettd, struct timespec *ats) { uint64_t runtime, curtime, switchtime; - struct proc *p; if (targettd == NULL) { /* current thread */ - p = curthread->td_proc; - PROC_LOCK_ASSERT(p, MA_OWNED); critical_enter(); switchtime = PCPU_GET(switchtime); curtime = cpu_ticks(); @@ -267,8 +264,7 @@ kern_thread_cputime(struct thread *targettd, struct ti critical_exit(); runtime += curtime - switchtime; } else { - p = targettd->td_proc; - PROC_LOCK_ASSERT(p, MA_OWNED); + PROC_LOCK_ASSERT(targettd->td_proc, MA_OWNED); thread_lock(targettd); runtime = targettd->td_runtime; thread_unlock(targettd); From owner-svn-src-all@freebsd.org Wed Sep 30 13:33:29 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 456D5428C85; Wed, 30 Sep 2020 13:33:29 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C1cf06qxJz4JHN; Wed, 30 Sep 2020 13:33:28 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CDF73207A5; Wed, 30 Sep 2020 13:33:28 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08UDXS2Z019429; Wed, 30 Sep 2020 13:33:28 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08UDXS7H019427; Wed, 30 Sep 2020 13:33:28 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202009301333.08UDXS7H019427@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 30 Sep 2020 13:33:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366290 - stable/12/sys/vm X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/vm X-SVN-Commit-Revision: 366290 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Sep 2020 13:33:29 -0000 Author: markj Date: Wed Sep 30 13:33:28 2020 New Revision: 366290 URL: https://svnweb.freebsd.org/changeset/base/366290 Log: MFC r366091: Flag vm_reserv and vm_phys sysctls as MPSAFE. Modified: stable/12/sys/vm/vm_phys.c stable/12/sys/vm/vm_reserv.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/vm/vm_phys.c ============================================================================== --- stable/12/sys/vm/vm_phys.c Wed Sep 30 13:21:17 2020 (r366289) +++ stable/12/sys/vm/vm_phys.c Wed Sep 30 13:33:28 2020 (r366290) @@ -131,17 +131,23 @@ CTASSERT(VM_LOWMEM_BOUNDARY < VM_DMA32_BOUNDARY); #endif static int sysctl_vm_phys_free(SYSCTL_HANDLER_ARGS); -SYSCTL_OID(_vm, OID_AUTO, phys_free, CTLTYPE_STRING | CTLFLAG_RD, - NULL, 0, sysctl_vm_phys_free, "A", "Phys Free Info"); +SYSCTL_OID(_vm, OID_AUTO, phys_free, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0, + sysctl_vm_phys_free, "A", + "Phys Free Info"); static int sysctl_vm_phys_segs(SYSCTL_HANDLER_ARGS); -SYSCTL_OID(_vm, OID_AUTO, phys_segs, CTLTYPE_STRING | CTLFLAG_RD, - NULL, 0, sysctl_vm_phys_segs, "A", "Phys Seg Info"); +SYSCTL_OID(_vm, OID_AUTO, phys_segs, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0, + sysctl_vm_phys_segs, "A", + "Phys Seg Info"); #ifdef NUMA static int sysctl_vm_phys_locality(SYSCTL_HANDLER_ARGS); -SYSCTL_OID(_vm, OID_AUTO, phys_locality, CTLTYPE_STRING | CTLFLAG_RD, - NULL, 0, sysctl_vm_phys_locality, "A", "Phys Locality Info"); +SYSCTL_OID(_vm, OID_AUTO, phys_locality, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0, + sysctl_vm_phys_locality, "A", + "Phys Locality Info"); #endif SYSCTL_INT(_vm, OID_AUTO, ndomains, CTLFLAG_RD, Modified: stable/12/sys/vm/vm_reserv.c ============================================================================== --- stable/12/sys/vm/vm_reserv.c Wed Sep 30 13:21:17 2020 (r366289) +++ stable/12/sys/vm/vm_reserv.c Wed Sep 30 13:33:28 2020 (r366290) @@ -278,8 +278,10 @@ SYSCTL_PROC(_vm_reserv, OID_AUTO, fullpop, CTLTYPE_INT static int sysctl_vm_reserv_partpopq(SYSCTL_HANDLER_ARGS); -SYSCTL_OID(_vm_reserv, OID_AUTO, partpopq, CTLTYPE_STRING | CTLFLAG_RD, NULL, 0, - sysctl_vm_reserv_partpopq, "A", "Partially populated reservation queues"); +SYSCTL_OID(_vm_reserv, OID_AUTO, partpopq, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0, + sysctl_vm_reserv_partpopq, "A", + "Partially populated reservation queues"); static counter_u64_t vm_reserv_reclaimed = EARLY_COUNTER; SYSCTL_COUNTER_U64(_vm_reserv, OID_AUTO, reclaimed, CTLFLAG_RD, From owner-svn-src-all@freebsd.org Wed Sep 30 14:55:55 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 32D90429D96; Wed, 30 Sep 2020 14:55:55 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C1fT70YKXz4NRD; Wed, 30 Sep 2020 14:55:55 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EA674211F0; Wed, 30 Sep 2020 14:55:54 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08UEtsLn069718; Wed, 30 Sep 2020 14:55:54 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08UEtshS069717; Wed, 30 Sep 2020 14:55:54 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202009301455.08UEtshS069717@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 30 Sep 2020 14:55:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366291 - head/sys/gdb X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/gdb X-SVN-Commit-Revision: 366291 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Sep 2020 14:55:55 -0000 Author: cem Date: Wed Sep 30 14:55:54 2020 New Revision: 366291 URL: https://svnweb.freebsd.org/changeset/base/366291 Log: gdb(4): Don't escape GDB special characters at application layer In r351368, we introduced this XML- and GDB-encoded data. The protocol 'offset' should reflex the logical XML data offset, but unfortunately we counted the GDB escapes as well. In fact, we cannot safely do GDB character escaping at this layer at all, because we don't know what will be flushed in a packet. It is bogus to send only the first character of a two-character escape sequence. This patch "corrects" the problem by squashing these characters in the transmitted XML document. It would be nice to transmit the characters faithfully, but that is a more complicated change. Thread names are a nice convenience feature for the GDB client, but one can always inspect td_name or p_comm directly to find the true name. Reported by: Ka Ho Ng Tested by: Ka Ho Ng Reviewed by: emaste, markj, rlibby Differential Revision: https://reviews.freebsd.org/D26599 Modified: head/sys/gdb/gdb_main.c Modified: head/sys/gdb/gdb_main.c ============================================================================== --- head/sys/gdb/gdb_main.c Wed Sep 30 13:33:28 2020 (r366290) +++ head/sys/gdb/gdb_main.c Wed Sep 30 14:55:54 2020 (r366291) @@ -361,9 +361,7 @@ init_qXfer_ctx(struct qXfer_context *qx, uintmax_t len } /* - * dst must be 2x strlen(max_src) + 1. - * - * Squashes invalid XML characters down to _. Sorry. Then escapes for GDB. + * Squashes special XML and GDB characters down to _. Sorry. */ static void qXfer_escape_xmlattr_str(char *dst, size_t dstlen, const char *src) @@ -384,8 +382,18 @@ qXfer_escape_xmlattr_str(char *dst, size_t dstlen, con /* GDB escape. */ if (strchr(forbidden, c) != NULL) { + /* + * It would be nice to escape these properly, but to do + * it correctly we need to escape them in the transmit + * layer, potentially doubling our buffer requirements. + * For now, avoid breaking the protocol by squashing + * them to underscore. + */ +#if 0 *dst++ = '}'; c ^= 0x20; +#endif + c = '_'; } *dst++ = c; } From owner-svn-src-all@freebsd.org Wed Sep 30 15:02:13 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5072342A006; Wed, 30 Sep 2020 15:02:13 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-oi1-f175.google.com (mail-oi1-f175.google.com [209.85.167.175]) (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 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C1fcN2SYHz4Nmw; Wed, 30 Sep 2020 15:02:12 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-oi1-f175.google.com with SMTP id 185so1988748oie.11; Wed, 30 Sep 2020 08:02:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=7PBL7LAxrRcicDuTrtBwXThN5ejgeD3g+HmH5tcLvl0=; b=uEipwjAHWaGTiHlvIfqZJoKYeNq0jilqr4jZdt1vcaCLSReghKBBGcmzhiLcI5Ad54 sm1LpmFqeMFLa6PYseOX+ZO/rivhOpsUCFm+JHGLxeXKepYmsTGppC0BWTkDvu0VIuXf NAixiGa3pkEBhY1KJCPHFgOGQhiaFIC6aplV1L+Cmu2bAJc3LzwKiuV5WxazPzpHkuwl 7uI0xNwcUtJKryhbLu40FmYhcnd4NKsB9+4EKvKjAaiO+ICY1B9D9TXAjds9TPFlQgAQ nGCLZdLxl53IulXNnlkpAFWAUmv0Tu5nx6XegxYxzRJoH6BpwSVM2r+C/JMBZ8ehBtWs TaNg== X-Gm-Message-State: AOAM533gmIS7CNck8j0M+AGFwY8fT1IEmF+PpquPP3h77YPRkhp2eUja YtHSnRiQzU2uOV2rn9etYpF/8IfmUzw= X-Google-Smtp-Source: ABdhPJyNb/UrXPZCjP6v6ZVczF0p3cgbSRMG+SMW2Ls9jwecGWwu/zzw0IOxycyv/1ezqcBkcBfa4A== X-Received: by 2002:aca:f5cc:: with SMTP id t195mr1690249oih.10.1601478129859; Wed, 30 Sep 2020 08:02:09 -0700 (PDT) Received: from mail-ot1-f43.google.com (mail-ot1-f43.google.com. [209.85.210.43]) by smtp.gmail.com with ESMTPSA id f29sm445318ook.44.2020.09.30.08.02.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 30 Sep 2020 08:02:09 -0700 (PDT) Received: by mail-ot1-f43.google.com with SMTP id q21so2108016ota.8; Wed, 30 Sep 2020 08:02:09 -0700 (PDT) X-Received: by 2002:a9d:4d19:: with SMTP id n25mr1860969otf.216.1601478126425; Wed, 30 Sep 2020 08:02:06 -0700 (PDT) MIME-Version: 1.0 References: <202009301455.08UEtshS069717@repo.freebsd.org> In-Reply-To: <202009301455.08UEtshS069717@repo.freebsd.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Wed, 30 Sep 2020 08:01:55 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r366291 - head/sys/gdb To: svn-src-all Cc: src-committers , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4C1fcN2SYHz4Nmw X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of csecem@gmail.com designates 209.85.167.175 as permitted sender) smtp.mailfrom=csecem@gmail.com X-Spamd-Result: default: False [-1.79 / 15.00]; HAS_REPLYTO(0.00)[cem@freebsd.org]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; REPLYTO_ADDR_EQ_FROM(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; TO_DN_ALL(0.00)[]; FORGED_SENDER(0.30)[cem@freebsd.org,csecem@gmail.com]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; R_DKIM_NA(0.00)[]; TAGGED_FROM(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.87)[-0.871]; FROM_NEQ_ENVFROM(0.00)[cem@freebsd.org,csecem@gmail.com]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-0.98)[-0.977]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; NEURAL_SPAM_SHORT(0.06)[0.058]; RCVD_IN_DNSWL_NONE(0.00)[209.85.167.175:from]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.167.175:from]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Sep 2020 15:02:13 -0000 On Wed, Sep 30, 2020 at 7:56 AM Conrad Meyer wrote: > Author: cem > Date: Wed Sep 30 14:55:54 2020 > New Revision: 366291 > URL: https://svnweb.freebsd.org/changeset/base/366291 > > Log: > gdb(4): Don't escape GDB special characters at application layer > > In r351368, we introduced this XML- and GDB-encoded data. The protocol > 'offset' should reflex the logical XML data offset, but unfortunately we typo: should _reflect_ > counted the GDB escapes as well. From owner-svn-src-all@freebsd.org Wed Sep 30 16:11:37 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EBB4942B49B; Wed, 30 Sep 2020 16:11:37 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C1h8T5vjPz4SKL; Wed, 30 Sep 2020 16:11:37 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AF46E223CD; Wed, 30 Sep 2020 16:11:37 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08UGBbaV014693; Wed, 30 Sep 2020 16:11:37 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08UGBbN9014692; Wed, 30 Sep 2020 16:11:37 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009301611.08UGBbN9014692@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 30 Sep 2020 16:11:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r366292 - releng/12.2/sys/kern X-SVN-Group: releng X-SVN-Commit-Author: kib X-SVN-Commit-Paths: releng/12.2/sys/kern X-SVN-Commit-Revision: 366292 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Sep 2020 16:11:38 -0000 Author: kib Date: Wed Sep 30 16:11:37 2020 New Revision: 366292 URL: https://svnweb.freebsd.org/changeset/base/366292 Log: MFC r357530/MFS r357530: Remove unneeded assert for curproc. Simplify. Approved by: re (gjb) Modified: releng/12.2/sys/kern/kern_time.c Directory Properties: releng/12.2/ (props changed) Modified: releng/12.2/sys/kern/kern_time.c ============================================================================== --- releng/12.2/sys/kern/kern_time.c Wed Sep 30 14:55:54 2020 (r366291) +++ releng/12.2/sys/kern/kern_time.c Wed Sep 30 16:11:37 2020 (r366292) @@ -255,11 +255,8 @@ void kern_thread_cputime(struct thread *targettd, struct timespec *ats) { uint64_t runtime, curtime, switchtime; - struct proc *p; if (targettd == NULL) { /* current thread */ - p = curthread->td_proc; - PROC_LOCK_ASSERT(p, MA_OWNED); critical_enter(); switchtime = PCPU_GET(switchtime); curtime = cpu_ticks(); @@ -267,8 +264,7 @@ kern_thread_cputime(struct thread *targettd, struct ti critical_exit(); runtime += curtime - switchtime; } else { - p = targettd->td_proc; - PROC_LOCK_ASSERT(p, MA_OWNED); + PROC_LOCK_ASSERT(targettd->td_proc, MA_OWNED); thread_lock(targettd); runtime = targettd->td_runtime; thread_unlock(targettd); From owner-svn-src-all@freebsd.org Wed Sep 30 16:33:37 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5505642B8E8; Wed, 30 Sep 2020 16:33:37 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io1-f47.google.com (mail-io1-f47.google.com [209.85.166.47]) (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 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C1hdr2BQxz4V0r; Wed, 30 Sep 2020 16:33:36 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io1-f47.google.com with SMTP id u6so2467003iow.9; Wed, 30 Sep 2020 09:33:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=SBaxfkmOx4ENZhcoFd2Sl2B95n0arFE5Bg7iq6uW/kw=; b=hdVKFk1DvD9lvMI+2vNFVV6s0y8AphjXUZjyhUpfLLdI8qu0Ya8quVjmJ5ZHSMhVcO d+XkjBiIYOlBhp/mBel0kn/4ZL47JAA+iSmyOVb+nzlEDAiJy2CbE2N53sWFNC7mjwP8 SKyKfWHl7k7NUnn+krPG7H1Hb5uq7MpgtqmPAs01MO+JB1Se6R3e8CqCN/h+Kd1xIpTE yT61PK3o55ozZJTy7wBV4P+1OBu9XZnug6SsPVPhMLaT38aUf3Q1MrPZM1iTI6wtU51K IZK8ZVqlv4I3YDi+BP1rvpNfVbOsHDiTnA3y9N8Nl5s7RQI8B9HtHzkXoyWXGlKJO/sp WzAQ== X-Gm-Message-State: AOAM532BdLgbcgev4nFcyQZPHAnLUhxhiWxhjciVAmu+R2kANfS5zqYa hjGKgBILYKQi56N+boLIxjeNHro7Q+1D1Vi1YtUeZz7epRc= X-Google-Smtp-Source: ABdhPJzjv1BSzMCbpuzOXKIXv16k1x70HDZhZDQkPuLCmn6IxzSg1UiT9U3bYdIeVU9USPtnpWRJo+Qn35xpnrwhRQk= X-Received: by 2002:a6b:ec04:: with SMTP id c4mr2348808ioh.179.1601483613790; Wed, 30 Sep 2020 09:33:33 -0700 (PDT) MIME-Version: 1.0 References: <202009251644.08PGi2Qg041379@repo.freebsd.org> In-Reply-To: <202009251644.08PGi2Qg041379@repo.freebsd.org> From: Ed Maste Date: Wed, 30 Sep 2020 12:33:22 -0400 Message-ID: Subject: Re: svn commit: r366161 - head/sys/dev/extres/syscon To: Michal Meloun Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4C1hdr2BQxz4V0r X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of carpeddiem@gmail.com designates 209.85.166.47 as permitted sender) smtp.mailfrom=carpeddiem@gmail.com X-Spamd-Result: default: False [-1.47 / 15.00]; RCVD_TLS_ALL(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; FREEFALL_USER(0.00)[carpeddiem]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; ARC_NA(0.00)[]; NEURAL_SPAM_SHORT(0.30)[0.305]; NEURAL_HAM_LONG(-0.97)[-0.968]; NEURAL_HAM_MEDIUM(-0.81)[-0.808]; TO_DN_ALL(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[209.85.166.47:from]; FORGED_SENDER(0.30)[emaste@freebsd.org,carpeddiem@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.166.47:from]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[emaste@freebsd.org,carpeddiem@gmail.com]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Sep 2020 16:33:37 -0000 On Fri, 25 Sep 2020 at 12:44, Michal Meloun wrote: > > Author: mmel > Date: Fri Sep 25 16:44:01 2020 > New Revision: 366161 > URL: https://svnweb.freebsd.org/changeset/base/366161 The pine64 in CI is currently broken, panicking at boot with: panic: mutex aw_syscon0 owned at /usr/src/sys/dev/extres/syscon/syscon_generic.c:98 Log: https://ci.freebsd.org/hwlab/job/FreeBSD-device-head-pinea64-test/6480/artifact/device_tests/pinea64.boot.log It's possible there's an outdated dtb involved here, as there was with the BBB. Hopefully manu's change to report/check the dtb version makes it in and can be used to help track these issues down. Unfortunately the USB-serial interface connected to the pine64 was broken until yesterday so I'm not sure for how long this has been broken in this way. The last successful run was at r364130 almost 2 months ago; the first failure after that was because of an apparent hang at shutdown. From owner-svn-src-all@freebsd.org Wed Sep 30 17:08:34 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DFC9A42BE68; Wed, 30 Sep 2020 17:08:34 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C1jQB5hTDz4Wjj; Wed, 30 Sep 2020 17:08:34 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A6E2523068; Wed, 30 Sep 2020 17:08:34 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08UH8Ys2050810; Wed, 30 Sep 2020 17:08:34 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08UH8YRG050809; Wed, 30 Sep 2020 17:08:34 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202009301708.08UH8YRG050809@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 30 Sep 2020 17:08:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366293 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 366293 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Sep 2020 17:08:34 -0000 Author: mjg Date: Wed Sep 30 17:08:34 2020 New Revision: 366293 URL: https://svnweb.freebsd.org/changeset/base/366293 Log: cache: push the lock into cache_purge_impl Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Wed Sep 30 16:11:37 2020 (r366292) +++ head/sys/kern/vfs_cache.c Wed Sep 30 17:08:34 2020 (r366293) @@ -2173,7 +2173,7 @@ cache_purge_impl(struct vnode *vp) TAILQ_INIT(&ncps); vlp = VP2VNODELOCK(vp); vlp2 = NULL; - mtx_assert(vlp, MA_OWNED); + mtx_lock(vlp); retry: while (!LIST_EMPTY(&vp->v_cache_src)) { ncp = LIST_FIRST(&vp->v_cache_src); @@ -2220,13 +2220,10 @@ cache_has_entries(struct vnode *vp) void cache_purge(struct vnode *vp) { - struct mtx *vlp; SDT_PROBE1(vfs, namecache, purge, done, vp); if (!cache_has_entries(vp)) return; - vlp = VP2VNODELOCK(vp); - mtx_lock(vlp); cache_purge_impl(vp); } @@ -2239,22 +2236,18 @@ cache_purge_vgone(struct vnode *vp) struct mtx *vlp; VNPASS(VN_IS_DOOMED(vp), vp); - vlp = VP2VNODELOCK(vp); if (cache_has_entries(vp)) { - mtx_lock(vlp); cache_purge_impl(vp); - mtx_assert(vlp, MA_NOTOWNED); return; } /* * Serialize against a potential thread doing cache_purge. */ + vlp = VP2VNODELOCK(vp); mtx_wait_unlocked(vlp); if (cache_has_entries(vp)) { - mtx_lock(vlp); cache_purge_impl(vp); - mtx_assert(vlp, MA_NOTOWNED); return; } return; From owner-svn-src-all@freebsd.org Wed Sep 30 17:09:18 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7257F42C70F; Wed, 30 Sep 2020 17:09:18 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C1jR22S9Bz4WwR; Wed, 30 Sep 2020 17:09:18 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 378D823096; Wed, 30 Sep 2020 17:09:18 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08UH9ISl051009; Wed, 30 Sep 2020 17:09:18 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08UH9Im6051008; Wed, 30 Sep 2020 17:09:18 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202009301709.08UH9Im6051008@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 30 Sep 2020 17:09:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366294 - head/sys/dev/acpica X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/dev/acpica X-SVN-Commit-Revision: 366294 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Sep 2020 17:09:18 -0000 Author: manu Date: Wed Sep 30 17:09:17 2020 New Revision: 366294 URL: https://svnweb.freebsd.org/changeset/base/366294 Log: acpi_resource: support multiple IRQs Some DSDT entries have multiple interrupts for one device. Add support for it. This fixes ahci on NXP LS2160 and genet on RPi4 Submitted by: Greg V Reviewed by: jhb MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D25145 Modified: head/sys/dev/acpica/acpi_resource.c Modified: head/sys/dev/acpica/acpi_resource.c ============================================================================== --- head/sys/dev/acpica/acpi_resource.c Wed Sep 30 17:08:34 2020 (r366293) +++ head/sys/dev/acpica/acpi_resource.c Wed Sep 30 17:09:17 2020 (r366294) @@ -643,17 +643,13 @@ acpi_res_set_irq(device_t dev, void *context, uint8_t int trig, int pol) { struct acpi_res_context *cp = (struct acpi_res_context *)context; - rman_res_t intr; + int i; if (cp == NULL || irq == NULL) return; - /* This implements no resource relocation. */ - if (count != 1) - return; - - intr = *irq; - bus_set_resource(dev, SYS_RES_IRQ, cp->ar_nirq++, intr, 1); + for (i = 0; i < count; i++) + bus_set_resource(dev, SYS_RES_IRQ, cp->ar_nirq++, irq[i], 1); } static void @@ -661,17 +657,13 @@ acpi_res_set_ext_irq(device_t dev, void *context, uint int trig, int pol) { struct acpi_res_context *cp = (struct acpi_res_context *)context; - rman_res_t intr; + int i; if (cp == NULL || irq == NULL) return; - /* This implements no resource relocation. */ - if (count != 1) - return; - - intr = *irq; - bus_set_resource(dev, SYS_RES_IRQ, cp->ar_nirq++, intr, 1); + for (i = 0; i < count; i++) + bus_set_resource(dev, SYS_RES_IRQ, cp->ar_nirq++, irq[i], 1); } static void From owner-svn-src-all@freebsd.org Wed Sep 30 17:10:50 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0675942C466; Wed, 30 Sep 2020 17:10:50 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C1jSn6Ng7z4Wlr; Wed, 30 Sep 2020 17:10:49 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BFDF322AF8; Wed, 30 Sep 2020 17:10:49 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08UHAnCM051168; Wed, 30 Sep 2020 17:10:49 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08UHAnat051167; Wed, 30 Sep 2020 17:10:49 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202009301710.08UHAnat051167@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 30 Sep 2020 17:10:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366295 - head/sys/dev/ahci X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/dev/ahci X-SVN-Commit-Revision: 366295 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Sep 2020 17:10:50 -0000 Author: manu Date: Wed Sep 30 17:10:49 2020 New Revision: 366295 URL: https://svnweb.freebsd.org/changeset/base/366295 Log: ahci_generic: add quirk for NXP0004 (NXP Layerscape LX2160A) This fixes this error : (aprobe3:ahcich3:0:15:0): NOP FLUSHQUEUE. ACB: 00 00 00 00 00 00 00 00 00 00 00 00 (aprobe3:ahcich3:0:15:0): CAM status: Command timeout (aprobe3:ahcich3:0:15:0): Error 5, Retries exhausted Submitted by: Greg V Reviewed by: imp, mav MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D25157 Modified: head/sys/dev/ahci/ahci_generic.c Modified: head/sys/dev/ahci/ahci_generic.c ============================================================================== --- head/sys/dev/ahci/ahci_generic.c Wed Sep 30 17:09:17 2020 (r366294) +++ head/sys/dev/ahci/ahci_generic.c Wed Sep 30 17:10:49 2020 (r366295) @@ -86,11 +86,22 @@ ahci_fdt_probe(device_t dev) #endif #ifdef DEV_ACPI + +static const struct ahci_acpi_quirk { + const char* hid; + u_int quirks; +} ahci_acpi_quirks[] = { + { "NXP0004", AHCI_Q_NOPMP }, + { NULL, 0 } +}; + + static int ahci_acpi_probe(device_t dev) { struct ahci_controller *ctlr = device_get_softc(dev); ACPI_HANDLE h; + int i; if ((h = acpi_get_handle(dev)) == NULL) return (ENXIO); @@ -105,6 +116,12 @@ ahci_acpi_probe(device_t dev) if (bootverbose) device_printf(dev, "Bus is%s cache-coherent\n", ctlr->dma_coherent ? "" : " not"); + for (i = 0; ahci_acpi_quirks[i].hid != NULL; i++) { + if (acpi_MatchHid(h, ahci_acpi_quirks[i].hid) != ACPI_MATCHHID_NOMATCH) { + ctlr->quirks = ahci_acpi_quirks[i].quirks; + break; + } + } return (BUS_PROBE_DEFAULT); } From owner-svn-src-all@freebsd.org Wed Sep 30 17:49:07 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 14AF242D124; Wed, 30 Sep 2020 17:49:07 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C1kJy6t6Bz4ZdK; Wed, 30 Sep 2020 17:49:06 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CF801235FA; Wed, 30 Sep 2020 17:49:06 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08UHn6wF075916; Wed, 30 Sep 2020 17:49:06 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08UHn6qI075915; Wed, 30 Sep 2020 17:49:06 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202009301749.08UHn6qI075915@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 30 Sep 2020 17:49:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366296 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 366296 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Sep 2020 17:49:07 -0000 Author: jhb Date: Wed Sep 30 17:49:06 2020 New Revision: 366296 URL: https://svnweb.freebsd.org/changeset/base/366296 Log: Avoid a dubious assignment to bio_data in aio_qbio(). A user pointer is not a suitable value for bio_data and the next block of code always overwrites bio_data anyway. Just use cb->aio_buf directly in the call to vm_fault_quick_hold_pages(). Reviewed by: kib Obtained from: CheriBSD MFC after: 1 month Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D26595 Modified: head/sys/kern/vfs_aio.c Modified: head/sys/kern/vfs_aio.c ============================================================================== --- head/sys/kern/vfs_aio.c Wed Sep 30 17:10:49 2020 (r366295) +++ head/sys/kern/vfs_aio.c Wed Sep 30 17:49:06 2020 (r366296) @@ -1278,7 +1278,6 @@ aio_qbio(struct proc *p, struct kaiocb *job) bp->bio_length = cb->aio_nbytes; bp->bio_bcount = cb->aio_nbytes; bp->bio_done = aio_biowakeup; - bp->bio_data = (void *)(uintptr_t)cb->aio_buf; bp->bio_offset = cb->aio_offset; bp->bio_cmd = cb->aio_lio_opcode == LIO_WRITE ? BIO_WRITE : BIO_READ; bp->bio_dev = dev; @@ -1288,7 +1287,7 @@ aio_qbio(struct proc *p, struct kaiocb *job) if (cb->aio_lio_opcode == LIO_READ) prot |= VM_PROT_WRITE; /* Less backwards than it looks */ job->npages = vm_fault_quick_hold_pages(&curproc->p_vmspace->vm_map, - (vm_offset_t)bp->bio_data, bp->bio_length, prot, job->pages, + (vm_offset_t)cb->aio_buf, bp->bio_length, prot, job->pages, nitems(job->pages)); if (job->npages < 0) { error = EFAULT; From owner-svn-src-all@freebsd.org Wed Sep 30 18:09:51 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F243D42D6DE; Wed, 30 Sep 2020 18:09:51 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C1kmv5Bw9z4bFR; Wed, 30 Sep 2020 18:09:51 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 77A452364C; Wed, 30 Sep 2020 18:09:51 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08UI9pR2088307; Wed, 30 Sep 2020 18:09:51 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08UI9pR8088306; Wed, 30 Sep 2020 18:09:51 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202009301809.08UI9pR8088306@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 30 Sep 2020 18:09:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366297 - in stable: 11/sys/cam/scsi 12/sys/cam/scsi X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/sys/cam/scsi 12/sys/cam/scsi X-SVN-Commit-Revision: 366297 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Sep 2020 18:09:52 -0000 Author: jhb Date: Wed Sep 30 18:09:50 2020 New Revision: 366297 URL: https://svnweb.freebsd.org/changeset/base/366297 Log: MFC 366175: Revert most of r360179. I had failed to notice that sgsendccb() was using cam_periph_mapmem() and thus was not passing down user pointers directly to drivers. In practice this broke requests submitted from userland. PR: 249395 Modified: stable/12/sys/cam/scsi/scsi_sg.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/cam/scsi/scsi_sg.c Directory Properties: stable/11/ (props changed) Modified: stable/12/sys/cam/scsi/scsi_sg.c ============================================================================== --- stable/12/sys/cam/scsi/scsi_sg.c Wed Sep 30 17:49:06 2020 (r366296) +++ stable/12/sys/cam/scsi/scsi_sg.c Wed Sep 30 18:09:50 2020 (r366297) @@ -508,7 +508,6 @@ sgioctl(struct cdev *dev, u_long cmd, caddr_t arg, int struct cam_periph *periph; struct sg_softc *softc; struct sg_io_hdr *req; - void *data_ptr; int dir, error; periph = (struct cam_periph *)dev->si_drv1; @@ -553,20 +552,12 @@ sgioctl(struct cdev *dev, u_long cmd, caddr_t arg, int break; } - if (req->dxfer_len > MAXPHYS) { - error = EINVAL; - break; - } - - data_ptr = malloc(req->dxfer_len, M_DEVBUF, M_WAITOK); - ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL); csio = &ccb->csio; error = copyin(req->cmdp, &csio->cdb_io.cdb_bytes, req->cmd_len); if (error) { - free(data_ptr, M_DEVBUF); xpt_release_ccb(ccb); break; } @@ -587,21 +578,12 @@ sgioctl(struct cdev *dev, u_long cmd, caddr_t arg, int break; } - if (dir == CAM_DIR_IN || dir == CAM_DIR_BOTH) { - error = copyin(req->dxferp, data_ptr, req->dxfer_len); - if (error) { - free(data_ptr, M_DEVBUF); - xpt_release_ccb(ccb); - break; - } - } - cam_fill_csio(csio, /*retries*/1, /*cbfcnp*/NULL, dir|CAM_DEV_QFRZDIS, MSG_SIMPLE_Q_TAG, - data_ptr, + req->dxferp, req->dxfer_len, req->mx_sb_len, req->cmd_len, @@ -611,7 +593,6 @@ sgioctl(struct cdev *dev, u_long cmd, caddr_t arg, int if (error) { req->host_status = DID_ERROR; req->driver_status = DRIVER_INVALID; - free(data_ptr, M_DEVBUF); xpt_release_ccb(ccb); break; } @@ -630,10 +611,6 @@ sgioctl(struct cdev *dev, u_long cmd, caddr_t arg, int req->sb_len_wr); } - if ((dir == CAM_DIR_OUT || dir == CAM_DIR_BOTH) && error == 0) - error = copyout(data_ptr, req->dxferp, req->dxfer_len); - - free(data_ptr, M_DEVBUF); xpt_release_ccb(ccb); break; From owner-svn-src-all@freebsd.org Wed Sep 30 18:09:52 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0DC8B42D54B; Wed, 30 Sep 2020 18:09:52 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C1kmv6XPnz4bMx; Wed, 30 Sep 2020 18:09:51 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BF53823922; Wed, 30 Sep 2020 18:09:51 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08UI9p9Z088313; Wed, 30 Sep 2020 18:09:51 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08UI9p9r088312; Wed, 30 Sep 2020 18:09:51 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202009301809.08UI9p9r088312@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 30 Sep 2020 18:09:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r366297 - in stable: 11/sys/cam/scsi 12/sys/cam/scsi X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/sys/cam/scsi 12/sys/cam/scsi X-SVN-Commit-Revision: 366297 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Sep 2020 18:09:52 -0000 Author: jhb Date: Wed Sep 30 18:09:50 2020 New Revision: 366297 URL: https://svnweb.freebsd.org/changeset/base/366297 Log: MFC 366175: Revert most of r360179. I had failed to notice that sgsendccb() was using cam_periph_mapmem() and thus was not passing down user pointers directly to drivers. In practice this broke requests submitted from userland. PR: 249395 Modified: stable/11/sys/cam/scsi/scsi_sg.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/sys/cam/scsi/scsi_sg.c Directory Properties: stable/12/ (props changed) Modified: stable/11/sys/cam/scsi/scsi_sg.c ============================================================================== --- stable/11/sys/cam/scsi/scsi_sg.c Wed Sep 30 17:49:06 2020 (r366296) +++ stable/11/sys/cam/scsi/scsi_sg.c Wed Sep 30 18:09:50 2020 (r366297) @@ -506,7 +506,6 @@ sgioctl(struct cdev *dev, u_long cmd, caddr_t arg, int struct cam_periph *periph; struct sg_softc *softc; struct sg_io_hdr *req; - void *data_ptr; int dir, error; periph = (struct cam_periph *)dev->si_drv1; @@ -551,20 +550,12 @@ sgioctl(struct cdev *dev, u_long cmd, caddr_t arg, int break; } - if (req->dxfer_len > MAXPHYS) { - error = EINVAL; - break; - } - - data_ptr = malloc(req->dxfer_len, M_DEVBUF, M_WAITOK); - ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL); csio = &ccb->csio; error = copyin(req->cmdp, &csio->cdb_io.cdb_bytes, req->cmd_len); if (error) { - free(data_ptr, M_DEVBUF); xpt_release_ccb(ccb); break; } @@ -585,21 +576,12 @@ sgioctl(struct cdev *dev, u_long cmd, caddr_t arg, int break; } - if (dir == CAM_DIR_IN || dir == CAM_DIR_BOTH) { - error = copyin(req->dxferp, data_ptr, req->dxfer_len); - if (error) { - free(data_ptr, M_DEVBUF); - xpt_release_ccb(ccb); - break; - } - } - cam_fill_csio(csio, /*retries*/1, sgdone, dir|CAM_DEV_QFRZDIS, MSG_SIMPLE_Q_TAG, - data_ptr, + req->dxferp, req->dxfer_len, req->mx_sb_len, req->cmd_len, @@ -609,7 +591,6 @@ sgioctl(struct cdev *dev, u_long cmd, caddr_t arg, int if (error) { req->host_status = DID_ERROR; req->driver_status = DRIVER_INVALID; - free(data_ptr, M_DEVBUF); xpt_release_ccb(ccb); break; } @@ -628,10 +609,6 @@ sgioctl(struct cdev *dev, u_long cmd, caddr_t arg, int req->sb_len_wr); } - if ((dir == CAM_DIR_OUT || dir == CAM_DIR_BOTH) && error == 0) - error = copyout(data_ptr, req->dxferp, req->dxfer_len); - - free(data_ptr, M_DEVBUF); xpt_release_ccb(ccb); break; From owner-svn-src-all@freebsd.org Wed Sep 30 19:23:25 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D359F42F404; Wed, 30 Sep 2020 19:23:25 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C1mPn5Gnhz3S63; Wed, 30 Sep 2020 19:23:25 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 987D124179; Wed, 30 Sep 2020 19:23:25 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08UJNPOY037959; Wed, 30 Sep 2020 19:23:25 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08UJNP4r037958; Wed, 30 Sep 2020 19:23:25 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202009301923.08UJNP4r037958@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 30 Sep 2020 19:23:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366298 - stable/12/bin/chio X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/12/bin/chio X-SVN-Commit-Revision: 366298 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Sep 2020 19:23:25 -0000 Author: emaste Date: Wed Sep 30 19:23:25 2020 New Revision: 366298 URL: https://svnweb.freebsd.org/changeset/base/366298 Log: MFC r363563: chio: avoid out of bounds read ch_ces is alloacated with space for total_elem entries. CID: 1418536 Reported by: Coverity Scan Sponsored by: The FreeBSD Foundation Modified: stable/12/bin/chio/chio.c Directory Properties: stable/12/ (props changed) Modified: stable/12/bin/chio/chio.c ============================================================================== --- stable/12/bin/chio/chio.c Wed Sep 30 18:09:50 2020 (r366297) +++ stable/12/bin/chio/chio.c Wed Sep 30 19:23:25 2020 (r366298) @@ -1144,7 +1144,7 @@ find_element(char *voltag, uint16_t *et, uint16_t *eu) /* * Now search the list the specified */ - for (elem = 0; elem <= total_elem; ++elem) { + for (elem = 0; elem < total_elem; ++elem) { ces = &ch_ces[elem]; From owner-svn-src-all@freebsd.org Wed Sep 30 20:57:02 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 373E4430B46; Wed, 30 Sep 2020 20:57:02 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C1pTp0j7Wz3XSh; Wed, 30 Sep 2020 20:57:02 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EC95B259A3; Wed, 30 Sep 2020 20:57:01 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08UKv13r094687; Wed, 30 Sep 2020 20:57:01 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08UKv1UW094686; Wed, 30 Sep 2020 20:57:01 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202009302057.08UKv1UW094686@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 30 Sep 2020 20:57:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366299 - stable/12/share/examples/ipfw X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/12/share/examples/ipfw X-SVN-Commit-Revision: 366299 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Sep 2020 20:57:02 -0000 Author: emaste Date: Wed Sep 30 20:57:01 2020 New Revision: 366299 URL: https://svnweb.freebsd.org/changeset/base/366299 Log: MFC r359067: -F is GNU diff specific, not implemented in BSD diff. PR: 239519 Reported by: kouya@ryuhoku.jp [in -CURRENT] MFC after: 3 days Modified: stable/12/share/examples/ipfw/change_rules.sh Directory Properties: stable/12/ (props changed) Modified: stable/12/share/examples/ipfw/change_rules.sh ============================================================================== --- stable/12/share/examples/ipfw/change_rules.sh Wed Sep 30 19:23:25 2020 (r366298) +++ stable/12/share/examples/ipfw/change_rules.sh Wed Sep 30 20:57:01 2020 (r366299) @@ -149,7 +149,7 @@ cat < Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A0DF44316C9; Wed, 30 Sep 2020 21:12:15 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C1pqM3s07z3YvB; Wed, 30 Sep 2020 21:12:15 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 679B625D26; Wed, 30 Sep 2020 21:12:15 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08ULCFII006160; Wed, 30 Sep 2020 21:12:15 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08ULCF9Z006159; Wed, 30 Sep 2020 21:12:15 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009302112.08ULCF9Z006159@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 30 Sep 2020 21:12:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366300 - head/usr.sbin/pciconf X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/usr.sbin/pciconf X-SVN-Commit-Revision: 366300 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Sep 2020 21:12:15 -0000 Author: kib Date: Wed Sep 30 21:12:14 2020 New Revision: 366300 URL: https://svnweb.freebsd.org/changeset/base/366300 Log: pciconf: print PCIe CTL max read request. To not complicate existing parsers, the value is printed on a new output line. Sponsored by: Mellanox Technologies/NVIDIA Networking MFC after: 1 week Modified: head/usr.sbin/pciconf/cap.c Modified: head/usr.sbin/pciconf/cap.c ============================================================================== --- head/usr.sbin/pciconf/cap.c Wed Sep 30 20:57:01 2020 (r366299) +++ head/usr.sbin/pciconf/cap.c Wed Sep 30 21:12:14 2020 (r366300) @@ -402,6 +402,28 @@ link_speed_string(uint8_t speed) } static const char * +max_read_string(u_int max_read) +{ + + switch (max_read) { + case 0x0: + return ("128"); + case 0x1: + return ("256"); + case 0x2: + return ("512"); + case 0x3: + return ("1024"); + case 0x4: + return ("2048"); + case 0x5: + return ("4096"); + default: + return ("undef"); + } +} + +static const char * aspm_string(uint8_t aspm) { @@ -503,6 +525,8 @@ cap_express(int fd, struct pci_conf *p, uint8_t ptr) (ctl & PCIEM_CTL2_ARI) ? "enabled" : "disabled"); } } + printf("\n max read %s", max_read_string((ctl & + PCIEM_CTL_MAX_READ_REQUEST) >> 12)); cap = read_config(fd, &p->pc_sel, ptr + PCIER_LINK_CAP, 4); sta = read_config(fd, &p->pc_sel, ptr + PCIER_LINK_STA, 2); if (cap == 0 && sta == 0) From owner-svn-src-all@freebsd.org Wed Sep 30 22:41:25 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0B193432AEA; Wed, 30 Sep 2020 22:41:25 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C1rpD6WXcz3dPh; Wed, 30 Sep 2020 22:41:24 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C327B2686A; Wed, 30 Sep 2020 22:41:24 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08UMfOMm058697; Wed, 30 Sep 2020 22:41:24 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08UMfOtQ058696; Wed, 30 Sep 2020 22:41:24 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <202009302241.08UMfOtQ058696@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Wed, 30 Sep 2020 22:41:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r366301 - releng/12.2/sys/arm64/include X-SVN-Group: releng X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: releng/12.2/sys/arm64/include X-SVN-Commit-Revision: 366301 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Sep 2020 22:41:25 -0000 Author: mhorne Date: Wed Sep 30 22:41:24 2020 New Revision: 366301 URL: https://svnweb.freebsd.org/changeset/base/366301 Log: MFS r365996: MFC r365304: arm64: update the set of HWCAP definitions MFC r365459: arm64: fix incorrect HWCAP definitions Approved by: re (gjb) Modified: releng/12.2/sys/arm64/include/elf.h Directory Properties: releng/12.2/ (props changed) Modified: releng/12.2/sys/arm64/include/elf.h ============================================================================== --- releng/12.2/sys/arm64/include/elf.h Wed Sep 30 21:12:14 2020 (r366300) +++ releng/12.2/sys/arm64/include/elf.h Wed Sep 30 22:41:24 2020 (r366301) @@ -115,33 +115,62 @@ __ElfType(Auxinfo); #define ET_DYN_LOAD_ADDR 0x100000 /* HWCAP */ +#define HWCAP_FP 0x00000001 +#define HWCAP_ASIMD 0x00000002 +#define HWCAP_EVTSTRM 0x00000004 +#define HWCAP_AES 0x00000008 +#define HWCAP_PMULL 0x00000010 +#define HWCAP_SHA1 0x00000020 +#define HWCAP_SHA2 0x00000040 +#define HWCAP_CRC32 0x00000080 +#define HWCAP_ATOMICS 0x00000100 +#define HWCAP_FPHP 0x00000200 +#define HWCAP_ASIMDHP 0x00000400 +/* + * XXX: The following bits (from CPUID to FLAGM) were originally incorrect, + * but later changed to match the Linux definitions. No compatibility code is + * provided, as the fix was expected to result in near-zero fallout. + */ +#define HWCAP_CPUID 0x00000800 +#define HWCAP_ASIMDRDM 0x00001000 +#define HWCAP_JSCVT 0x00002000 +#define HWCAP_FCMA 0x00004000 +#define HWCAP_LRCPC 0x00008000 +#define HWCAP_DCPOP 0x00010000 +#define HWCAP_SHA3 0x00020000 +#define HWCAP_SM3 0x00040000 +#define HWCAP_SM4 0x00080000 +#define HWCAP_ASIMDDP 0x00100000 +#define HWCAP_SHA512 0x00200000 +#define HWCAP_SVE 0x00400000 +#define HWCAP_ASIMDFHM 0x00800000 +#define HWCAP_DIT 0x01000000 +#define HWCAP_USCAT 0x02000000 +#define HWCAP_ILRCPC 0x04000000 +#define HWCAP_FLAGM 0x08000000 +#define HWCAP_SSBS 0x10000000 +#define HWCAP_SB 0x20000000 +#define HWCAP_PACA 0x40000000 +#define HWCAP_PACG 0x80000000 -#define HWCAP_FP 0x00000001 -#define HWCAP_ASIMD 0x00000002 -#define HWCAP_EVTSTRM 0x00000004 -#define HWCAP_AES 0x00000008 -#define HWCAP_PMULL 0x00000010 -#define HWCAP_SHA1 0x00000020 -#define HWCAP_SHA2 0x00000040 -#define HWCAP_CRC32 0x00000080 -#define HWCAP_ATOMICS 0x00000100 -#define HWCAP_FPHP 0x00000200 -#define HWCAP_CPUID 0x00000400 -#define HWCAP_ASIMDRDM 0x00000800 -#define HWCAP_JSCVT 0x00001000 -#define HWCAP_FCMA 0x00002000 -#define HWCAP_LRCPC 0x00004000 -#define HWCAP_DCPOP 0x00008000 -#define HWCAP_SHA3 0x00010000 -#define HWCAP_SM3 0x00020000 -#define HWCAP_SM4 0x00040000 -#define HWCAP_ASIMDDP 0x00080000 -#define HWCAP_SHA512 0x00100000 -#define HWCAP_SVE 0x00200000 -#define HWCAP_ASIMDFHM 0x00400000 -#define HWCAP_DIT 0x00800000 -#define HWCAP_USCAT 0x01000000 -#define HWCAP_ILRCPC 0x02000000 -#define HWCAP_FLAGM 0x04000000 +/* HWCAP2 */ +#define HWCAP2_DCPODP 0x00000001 +#define HWCAP2_SVE2 0x00000002 +#define HWCAP2_SVEAES 0x00000004 +#define HWCAP2_SVEPMULL 0x00000008 +#define HWCAP2_SVEBITPERM 0x00000010 +#define HWCAP2_SVESHA3 0x00000020 +#define HWCAP2_SVESM4 0x00000040 +#define HWCAP2_FLAGM2 0x00000080 +#define HWCAP2_FRINT 0x00000100 +#define HWCAP2_SVEI8MM 0x00000200 +#define HWCAP2_SVEF32MM 0x00000400 +#define HWCAP2_SVEF64MM 0x00000800 +#define HWCAP2_SVEBF16 0x00001000 +#define HWCAP2_I8MM 0x00002000 +#define HWCAP2_BF16 0x00004000 +#define HWCAP2_DGH 0x00008000 +#define HWCAP2_RNG 0x00010000 +#define HWCAP2_BTI 0x00020000 #endif /* !_MACHINE_ELF_H_ */ From owner-svn-src-all@freebsd.org Thu Oct 1 00:33:44 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D01684334EF; Thu, 1 Oct 2020 00:33:44 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C1vHr4xDlz3yS3; Thu, 1 Oct 2020 00:33:44 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8CA8227E57; Thu, 1 Oct 2020 00:33:44 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0910Xivv029203; Thu, 1 Oct 2020 00:33:44 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0910Xiv8029202; Thu, 1 Oct 2020 00:33:44 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <202010010033.0910Xiv8029202@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Thu, 1 Oct 2020 00:33:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366302 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 366302 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Oct 2020 00:33:44 -0000 Author: rmacklem Date: Thu Oct 1 00:33:44 2020 New Revision: 366302 URL: https://svnweb.freebsd.org/changeset/base/366302 Log: Clip the "len" argument to vn_generic_copy_file_range() at a hole size boundary. By clipping the len argument of vn_generic_copy_file_range() to end at an exact multiple of hole size, holes are more likely to be maintained during the copy. A hole can still straddle the boundary at the end of the copy range, resulting in a block being allocated in the output file as it is being grown in size, but this will reduce the likelyhood of this happening. While here, also modify setting of blksize to better handle the case where _PC_MIN_HOLE_SIZE is returned as 1. Reviewed by: asomers Differential Revision: https://reviews.freebsd.org/D26570 Modified: head/sys/kern/vfs_vnops.c Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Wed Sep 30 22:41:24 2020 (r366301) +++ head/sys/kern/vfs_vnops.c Thu Oct 1 00:33:44 2020 (r366302) @@ -3020,7 +3020,7 @@ vn_generic_copy_file_range(struct vnode *invp, off_t * int error; bool cantseek, readzeros, eof, lastblock; ssize_t aresid; - size_t copylen, len, savlen; + size_t copylen, len, rem, savlen; char *dat; long holein, holeout; @@ -3089,7 +3089,17 @@ vn_generic_copy_file_range(struct vnode *invp, off_t * * This value is clipped at 4Kbytes and 1Mbyte. */ blksize = MAX(holein, holeout); - if (blksize == 0) + + /* Clip len to end at an exact multiple of hole size. */ + if (blksize > 1) { + rem = *inoffp % blksize; + if (rem > 0) + rem = blksize - rem; + if (len - rem > blksize) + len = savlen = rounddown(len - rem, blksize) + rem; + } + + if (blksize <= 1) blksize = MAX(invp->v_mount->mnt_stat.f_iosize, outvp->v_mount->mnt_stat.f_iosize); if (blksize < 4096) From owner-svn-src-all@freebsd.org Thu Oct 1 00:47:36 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A359943441D; Thu, 1 Oct 2020 00:47:36 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C1vbr3tD6z40t2; Thu, 1 Oct 2020 00:47:36 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 684678461; Thu, 1 Oct 2020 00:47:36 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0910lau4035812; Thu, 1 Oct 2020 00:47:36 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0910la56035811; Thu, 1 Oct 2020 00:47:36 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <202010010047.0910la56035811@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Thu, 1 Oct 2020 00:47:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366303 - head/sys/fs/nfsclient X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/fs/nfsclient X-SVN-Commit-Revision: 366303 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Oct 2020 00:47:36 -0000 Author: rmacklem Date: Thu Oct 1 00:47:35 2020 New Revision: 366303 URL: https://svnweb.freebsd.org/changeset/base/366303 Log: Modify the NFSv4.2 VOP_COPY_FILE_RANGE() client call to return after one successful RPC. Without this patch, the NFSv4.2 VOP_COPY_FILE_RANGE() client call would loop until the copy "len" was completed. The problem with doing this is that it might take a considerable time to complete for a large "len". By returning after a single successful Copy RPC that copied some of the data, the application that did the copy_file_range(2) syscall will be more responsive to signal delivery for large "len" copies. Modified: head/sys/fs/nfsclient/nfs_clvnops.c Modified: head/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvnops.c Thu Oct 1 00:33:44 2020 (r366302) +++ head/sys/fs/nfsclient/nfs_clvnops.c Thu Oct 1 00:47:35 2020 (r366303) @@ -3638,7 +3638,7 @@ nfs_copy_file_range(struct vop_copy_file_range_args *a struct vattr *vap; struct uio io; struct nfsmount *nmp; - size_t len, len2, copiedlen; + size_t len, len2; int error, inattrflag, outattrflag, ret, ret2; off_t inoff, outoff; bool consecutive, must_commit, tryoutcred; @@ -3731,7 +3731,11 @@ nfs_copy_file_range(struct vop_copy_file_range_args *a } else error = 0; } - copiedlen = 0; + + /* + * len will be set to 0 upon a successful Copy RPC. + * As such, this only loops when the Copy RPC needs to be retried. + */ while (len > 0 && error == 0) { inattrflag = outattrflag = 0; len2 = len; @@ -3761,18 +3765,9 @@ nfs_copy_file_range(struct vop_copy_file_range_args *a } else error = NFSERR_OFFLOADNOREQS; } - /* - * If the Copy returns a length == 0, it hit the - * EOF on the input file. - */ - if (len2 == 0) { - *ap->a_lenp = copiedlen; - len = 0; - } else { - len -= len2; - copiedlen += len2; - } - if (len == 0 && must_commit && error == 0) + *ap->a_lenp = len2; + len = 0; + if (len2 > 0 && must_commit && error == 0) error = ncl_commit(outvp, outoff, *ap->a_lenp, ap->a_outcred, curthread); if (error == 0 && ret != 0) @@ -3783,6 +3778,9 @@ nfs_copy_file_range(struct vop_copy_file_range_args *a /* * Try consecutive == false, which is ok only if all * bytes are copied. + * If only some bytes were copied when consecutive + * is false, there is no way to know which bytes + * still need to be written. */ consecutive = false; error = 0; From owner-svn-src-all@freebsd.org Thu Oct 1 01:11:13 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6A86E4346E5; Thu, 1 Oct 2020 01:11:13 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C1w752XrSz41tb; Thu, 1 Oct 2020 01:11:13 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 201C98C84; Thu, 1 Oct 2020 01:11:13 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0911BDEM049520; Thu, 1 Oct 2020 01:11:13 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0911AqNq049386; Thu, 1 Oct 2020 01:10:52 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202010010110.0911AqNq049386@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 1 Oct 2020 01:10:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366304 - in head: cddl gnu/usr.bin/dialog lib/googletest lib/libcam/tests lib/libcrypt/tests lib/libiconv_modules lib/libkvm lib/libkvm/tests lib/libpathconv/tests lib/libproc/tests li... X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: cddl gnu/usr.bin/dialog lib/googletest lib/libcam/tests lib/libcrypt/tests lib/libiconv_modules lib/libkvm lib/libkvm/tests lib/libpathconv/tests lib/libproc/tests lib/libsbuf/tests libexec l... X-SVN-Commit-Revision: 366304 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Oct 2020 01:11:13 -0000 Author: kevans Date: Thu Oct 1 01:10:51 2020 New Revision: 366304 URL: https://svnweb.freebsd.org/changeset/base/366304 Log: Do a sweep and remove most WARNS=6 settings Repeating the default WARNS here makes it slightly more difficult to experiment with default WARNS changes, e.g. if we did something absolutely bananas and introduced a WARNS=7 and wanted to try lifting the default to that. Drop most of them; there is one in the blake2 kernel module, but I suspect it should be dropped -- the default WARNS in the rest of the build doesn't currently apply to kernel modules, and I haven't put too much thought into whether it makes sense to make it so. Modified: head/cddl/Makefile.inc head/gnu/usr.bin/dialog/Makefile head/lib/googletest/Makefile.inc head/lib/libcam/tests/Makefile head/lib/libcrypt/tests/Makefile head/lib/libiconv_modules/Makefile.inc head/lib/libkvm/Makefile head/lib/libkvm/tests/Makefile head/lib/libpathconv/tests/Makefile head/lib/libproc/tests/Makefile head/lib/libsbuf/tests/Makefile head/libexec/Makefile.inc head/libexec/getty/Makefile head/libexec/rtld-elf/Makefile head/libexec/rtld-elf/tests/libpythagoras/Makefile head/libexec/tftpd/tests/Makefile head/sbin/decryptcore/Makefile head/sbin/pfilctl/Makefile head/sbin/ping/tests/Makefile head/sbin/recoverdisk/Makefile head/sys/teken/demo/Makefile head/sys/teken/libteken/Makefile head/sys/teken/stress/Makefile head/tests/sys/Makefile.inc head/tests/sys/aio/Makefile head/tests/sys/audit/Makefile head/tests/sys/auditpipe/Makefile head/tests/sys/capsicum/Makefile head/tests/sys/devrandom/Makefile head/tests/sys/fs/fusefs/Makefile head/tests/sys/kern/pipe/Makefile head/tests/sys/mqueue/Makefile head/tests/sys/net/Makefile head/tests/sys/netinet/Makefile head/tests/sys/netmap/Makefile head/tests/sys/opencrypto/Makefile head/tests/sys/pjdfstest/pjdfstest/Makefile head/tools/regression/aio/aiop/Makefile head/tools/regression/bpf/bpf_filter/Makefile head/tools/regression/doat/Makefile head/tools/regression/geom_gpt/Makefile head/tools/regression/include/stdatomic/Makefile head/tools/regression/netinet/ipbroadcast/Makefile head/tools/regression/rpcsec_gss/Makefile head/tools/regression/sockets/accept_fd_leak/Makefile head/tools/regression/sockets/accf_data_attach/Makefile head/tools/regression/sockets/fstat/Makefile head/tools/regression/sockets/kqueue/Makefile head/tools/regression/sockets/listen_backlog/Makefile head/tools/regression/sockets/listen_kqueue/Makefile head/tools/regression/sockets/listenclose/Makefile head/tools/regression/sockets/pr_atomic/Makefile head/tools/regression/sockets/reconnect/Makefile head/tools/regression/sockets/rtsocket/Makefile head/tools/regression/sockets/sblock/Makefile head/tools/regression/sockets/sendfile/Makefile head/tools/regression/sockets/shutdown/Makefile head/tools/regression/sockets/sigpipe/Makefile head/tools/regression/sockets/so_setfib/Makefile head/tools/regression/sockets/udp_pingpong/Makefile head/tools/regression/sockets/unix_bindconnect/Makefile head/tools/regression/sockets/unix_close_race/Makefile head/tools/regression/sockets/unix_gc/Makefile head/tools/regression/sockets/unix_sendtorace/Makefile head/tools/regression/sockets/unix_socket/Makefile head/tools/regression/sockets/unix_sorflush/Makefile head/tools/regression/sockets/zerosend/Makefile head/tools/test/auxinfo/Makefile head/tools/test/iconv/posix/Makefile head/tools/test/malloc/Makefile head/tools/test/net/Makefile head/tools/test/netfibs/Makefile head/tools/test/ptrace/Makefile head/tools/tools/aac/Makefile head/tools/tools/cfi/Makefile head/tools/tools/find-sb/Makefile head/tools/tools/fixwhite/Makefile head/tools/tools/gensnmpdef/Makefile head/tools/tools/ifpifa/Makefile head/tools/tools/ioat/Makefile head/tools/tools/iwi/Makefile head/tools/tools/ncpus/Makefile head/tools/tools/pciroms/Makefile head/tools/tools/syscall_timing/Makefile head/tools/tools/tscdrift/Makefile head/tools/tools/vt/mkkfont/Makefile head/usr.bin/dpv/Makefile head/usr.bin/getconf/tests/Makefile head/usr.bin/mkimg/Makefile head/usr.bin/posixshmcontrol/Makefile head/usr.bin/proccontrol/Makefile head/usr.bin/protect/Makefile head/usr.sbin/bsdinstall/distextract/Makefile head/usr.sbin/bsdinstall/distfetch/Makefile head/usr.sbin/bsnmpd/tools/Makefile.inc head/usr.sbin/ctld/Makefile head/usr.sbin/iovctl/Makefile head/usr.sbin/mlx5tool/Makefile head/usr.sbin/pw/tests/Makefile Modified: head/cddl/Makefile.inc ============================================================================== --- head/cddl/Makefile.inc Thu Oct 1 00:47:35 2020 (r366303) +++ head/cddl/Makefile.inc Thu Oct 1 01:10:51 2020 (r366304) @@ -7,8 +7,6 @@ IGNORE_PRAGMA= YES CFLAGS+= -DNEED_SOLARIS_BOOLEAN -WARNS?= 6 - # Do not lint the CDDL stuff. It is all externally maintained and # lint output is wasteful noise here. Modified: head/gnu/usr.bin/dialog/Makefile ============================================================================== --- head/gnu/usr.bin/dialog/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/gnu/usr.bin/dialog/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -7,6 +7,4 @@ LIBADD= dialog ncursesw m CFLAGS+= -I${.CURDIR} -I${DIALOG} .PATH: ${DIALOG} -WARNS?= 6 - .include Modified: head/lib/googletest/Makefile.inc ============================================================================== --- head/lib/googletest/Makefile.inc Thu Oct 1 00:47:35 2020 (r366303) +++ head/lib/googletest/Makefile.inc Thu Oct 1 01:10:51 2020 (r366304) @@ -10,5 +10,3 @@ CXXFLAGS+= ${GTESTS_FLAGS} # Silence warnings about usage of deprecated std::auto_ptr CXXWARNFLAGS+= -Wno-deprecated-declarations - -WARNS?= 6 Modified: head/lib/libcam/tests/Makefile ============================================================================== --- head/lib/libcam/tests/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/lib/libcam/tests/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -5,6 +5,4 @@ ATF_TESTS_C+= cam_test LIBADD+= cam -WARNS?= 6 - .include Modified: head/lib/libcrypt/tests/Makefile ============================================================================== --- head/lib/libcrypt/tests/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/lib/libcrypt/tests/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -4,7 +4,6 @@ ATF_TESTS_C+= crypt_tests NETBSD_ATF_TESTS_C+= crypt_test -WARNS?= 6 CFLAGS+= -I${.CURDIR:H} LIBADD= crypt Modified: head/lib/libiconv_modules/Makefile.inc ============================================================================== --- head/lib/libiconv_modules/Makefile.inc Thu Oct 1 00:47:35 2020 (r366303) +++ head/lib/libiconv_modules/Makefile.inc Thu Oct 1 01:10:51 2020 (r366304) @@ -3,7 +3,6 @@ .PATH: ${SRCTOP}/lib/libc/iconv SHLIB_MAJOR= 4 -WARNS?= 6 CFLAGS+= -I${SRCTOP}/lib/libc/iconv CFLAGS+= -Dbool=_Bool Modified: head/lib/libkvm/Makefile ============================================================================== --- head/lib/libkvm/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/lib/libkvm/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -8,8 +8,6 @@ SHLIBDIR?= /lib SHLIB_MAJOR= 7 CFLAGS+=-DNO__SCCSID -I${.CURDIR} -WARNS?= 6 - SRCS= kvm.c kvm_cptime.c kvm_getloadavg.c \ kvm_getswapinfo.c kvm_pcpu.c kvm_private.c kvm_proc.c kvm_vnet.c \ kvm_minidump_aarch64.c \ Modified: head/lib/libkvm/tests/Makefile ============================================================================== --- head/lib/libkvm/tests/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/lib/libkvm/tests/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -13,8 +13,6 @@ CFLAGS.kvm_read_test+= -I${.CURDIR:H} LIBADD+= kvm -WARNS?= 6 - BINDIR= ${TESTSDIR} .for t in kvm_geterr_test kvm_open_test kvm_open2_test kvm_read_test Modified: head/lib/libpathconv/tests/Makefile ============================================================================== --- head/lib/libpathconv/tests/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/lib/libpathconv/tests/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -3,7 +3,6 @@ TAP_TESTS_C+= abs2rel TAP_TESTS_C+= rel2abs -WARNS?= 6 #LIBADD+= pathconv #LDADD+= -L .. -lpathconv LDADD+= ../libpathconv.a Modified: head/lib/libproc/tests/Makefile ============================================================================== --- head/lib/libproc/tests/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/lib/libproc/tests/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -6,7 +6,6 @@ PROGS= target_prog SRCS_target_prog= target_prog.c BINDIR_target_prog= ${TESTSDIR} -WARNS?= 6 LIBADD= elf proc rtld_db util # Ensure that symbols aren't stripped from the test program, as they're needed Modified: head/lib/libsbuf/tests/Makefile ============================================================================== --- head/lib/libsbuf/tests/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/lib/libsbuf/tests/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -6,6 +6,4 @@ ATF_TESTS_C+= sbuf_string_test LIBADD+= sbuf util -WARNS?= 6 - .include Modified: head/libexec/Makefile.inc ============================================================================== --- head/libexec/Makefile.inc Thu Oct 1 00:47:35 2020 (r366303) +++ head/libexec/Makefile.inc Thu Oct 1 01:10:51 2020 (r366304) @@ -3,5 +3,4 @@ BINDIR?= /usr/libexec -WARNS?= 6 WFORMAT?= 1 Modified: head/libexec/getty/Makefile ============================================================================== --- head/libexec/getty/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/libexec/getty/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -7,7 +7,6 @@ SRCS= main.c init.c subr.c chat.c LIBADD= util MAN= gettytab.5 ttys.5 getty.8 -WARNS?= 6 WFORMAT=0 .include Modified: head/libexec/rtld-elf/Makefile ============================================================================== --- head/libexec/rtld-elf/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/libexec/rtld-elf/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -40,7 +40,6 @@ RTLD_ARCH= ${MACHINE_CPUARCH} CFLAGS+= -I${RTLD_ELF_DIR}/${RTLD_ARCH} -I${RTLD_ELF_DIR} NO_WCAST_ALIGN= yes -WARNS?= 6 INSTALLFLAGS= -C -b PRECIOUSPROG= BINDIR= /libexec Modified: head/libexec/rtld-elf/tests/libpythagoras/Makefile ============================================================================== --- head/libexec/rtld-elf/tests/libpythagoras/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/libexec/rtld-elf/tests/libpythagoras/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -10,7 +10,6 @@ SHLIBDIR= ${TESTSBASE}/libexec/rtld-elf SRCS= pythagoras.c -WARNS?= 6 LIBADD= m .include Modified: head/libexec/tftpd/tests/Makefile ============================================================================== --- head/libexec/tftpd/tests/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/libexec/tftpd/tests/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -6,7 +6,6 @@ ATF_TESTS_C= functional TEST_METADATA.functional+= timeout=15 LIBADD= util -WARNS?= 6 CSTD= c11 .include Modified: head/sbin/decryptcore/Makefile ============================================================================== --- head/sbin/decryptcore/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/sbin/decryptcore/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -8,6 +8,4 @@ MAN= decryptcore.8 CFLAGS+=-I${SRCTOP}/lib/libpjdlog -WARNS?= 6 - .include Modified: head/sbin/pfilctl/Makefile ============================================================================== --- head/sbin/pfilctl/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/sbin/pfilctl/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -2,7 +2,6 @@ PROG= pfilctl SRCS= pfilctl.c -WARNS?= 6 MAN= pfilctl.8 Modified: head/sbin/ping/tests/Makefile ============================================================================== --- head/sbin/ping/tests/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/sbin/ping/tests/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -1,7 +1,5 @@ # $FreeBSD$ -WARNS?= 6 - ATF_TESTS_C+= in_cksum_test SRCS.in_cksum_test= in_cksum_test.c ../utils.c Modified: head/sbin/recoverdisk/Makefile ============================================================================== --- head/sbin/recoverdisk/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/sbin/recoverdisk/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -5,8 +5,6 @@ PROG= recoverdisk LDFLAGS += -lm -WARNS?= 6 - .include test: ${PROG} Modified: head/sys/teken/demo/Makefile ============================================================================== --- head/sys/teken/demo/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/sys/teken/demo/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -4,6 +4,4 @@ PROG= teken_demo LDADD= -lncursesw -lteken -lutil MAN= -WARNS?= 6 - .include Modified: head/sys/teken/libteken/Makefile ============================================================================== --- head/sys/teken/libteken/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/sys/teken/libteken/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -4,7 +4,6 @@ LIB= teken SHLIB_MAJOR= 0 CFLAGS+=-I. -WARNS?= 6 SRCDIR= ${.CURDIR}/.. .PATH: ${SRCDIR} Modified: head/sys/teken/stress/Makefile ============================================================================== --- head/sys/teken/stress/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/sys/teken/stress/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -4,6 +4,4 @@ PROG= teken_stress LDADD= -lteken MAN= -WARNS?= 6 - .include Modified: head/tests/sys/Makefile.inc ============================================================================== --- head/tests/sys/Makefile.inc Thu Oct 1 00:47:35 2020 (r366303) +++ head/tests/sys/Makefile.inc Thu Oct 1 01:10:51 2020 (r366304) @@ -1,5 +1,3 @@ # $FreeBSD$ -WARNS?= 6 - .include "${SRCTOP}/tests/Makefile.inc0" Modified: head/tests/sys/aio/Makefile ============================================================================== --- head/tests/sys/aio/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/tests/sys/aio/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -17,6 +17,4 @@ LIBADD.lio_test+= rt CFLAGS+= -I${.CURDIR:H:H} -WARNS?= 6 - .include Modified: head/tests/sys/audit/Makefile ============================================================================== --- head/tests/sys/audit/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/tests/sys/audit/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -51,8 +51,6 @@ TEST_METADATA+= required_user="root" TEST_METADATA+= is_exclusive="true" TEST_METADATA+= required_files="/etc/rc.d/auditd /dev/auditpipe" -WARNS?= 6 - LDFLAGS+= -lbsm -lutil CFLAGS.process-control.c+= -I${SRCTOP}/tests Modified: head/tests/sys/auditpipe/Makefile ============================================================================== --- head/tests/sys/auditpipe/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/tests/sys/auditpipe/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -6,6 +6,5 @@ ATF_TESTS_C= auditpipe_test TEST_METADATA+= required_user="root" TEST_METADATA+= required_files="/dev/auditpipe" -WARNS?= 6 .include Modified: head/tests/sys/capsicum/Makefile ============================================================================== --- head/tests/sys/capsicum/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/tests/sys/capsicum/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -52,6 +52,4 @@ WARNS.capsicum-test= 3 .endif -WARNS?= 6 - .include Modified: head/tests/sys/devrandom/Makefile ============================================================================== --- head/tests/sys/devrandom/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/tests/sys/devrandom/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -6,7 +6,6 @@ SDEVRANDOM= ${SRCTOP}/sys/dev/random .PATH: ${SDEVRANDOM} TESTSDIR= ${TESTSBASE}/sys/devrandom -WARNS?= 6 CFLAGS+= -I${SRCTOP}/sys Modified: head/tests/sys/fs/fusefs/Makefile ============================================================================== --- head/tests/sys/fs/fusefs/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/tests/sys/fs/fusefs/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -82,6 +82,4 @@ LIBADD+= pthread LIBADD+= gmock gtest LIBADD+= util -WARNS?= 6 - .include Modified: head/tests/sys/kern/pipe/Makefile ============================================================================== --- head/tests/sys/kern/pipe/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/tests/sys/kern/pipe/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -12,6 +12,4 @@ PLAIN_TESTS_C+= pipe_reverse2_test PLAIN_TESTS_C+= pipe_reverse_test PLAIN_TESTS_C+= pipe_wraparound_test -WARNS?= 6 - .include Modified: head/tests/sys/mqueue/Makefile ============================================================================== --- head/tests/sys/mqueue/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/tests/sys/mqueue/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -16,6 +16,4 @@ PROGS+= mqtest5 LIBADD+= rt -WARNS?= 6 - .include Modified: head/tests/sys/net/Makefile ============================================================================== --- head/tests/sys/net/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/tests/sys/net/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -25,6 +25,4 @@ PROGS+= randsleep CFLAGS+= -I${.CURDIR:H:H} -WARNS?= 6 - .include Modified: head/tests/sys/netinet/Makefile ============================================================================== --- head/tests/sys/netinet/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/tests/sys/netinet/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -20,6 +20,4 @@ ${PACKAGE}FILESMODE_redirect.py=0555 MAN= -WARNS?= 6 - .include Modified: head/tests/sys/netmap/Makefile ============================================================================== --- head/tests/sys/netmap/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/tests/sys/netmap/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -11,6 +11,4 @@ PLAIN_TESTS_C+= ctrl-api-test CFLAGS+= -I${SRCTOP}/tests LIBADD+= pthread -WARNS?= 6 - .include Modified: head/tests/sys/opencrypto/Makefile ============================================================================== --- head/tests/sys/opencrypto/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/tests/sys/opencrypto/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -21,6 +21,4 @@ PYMODULES= cryptodev.py cryptodevh.py cryptotest.py ${PACKAGE}FILES+= ${PYMODULES} -WARNS?= 6 - .include Modified: head/tests/sys/pjdfstest/pjdfstest/Makefile ============================================================================== --- head/tests/sys/pjdfstest/pjdfstest/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/tests/sys/pjdfstest/pjdfstest/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -10,6 +10,4 @@ MAN= CFLAGS+= -I${.CURDIR:H} -WARNS?= 6 - .include Modified: head/tools/regression/aio/aiop/Makefile ============================================================================== --- head/tools/regression/aio/aiop/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/tools/regression/aio/aiop/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -3,6 +3,4 @@ PROG= aiop MAN= -WARNS= 6 - .include Modified: head/tools/regression/bpf/bpf_filter/Makefile ============================================================================== --- head/tools/regression/bpf/bpf_filter/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/tools/regression/bpf/bpf_filter/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -46,7 +46,6 @@ SRCS+= ${SYSDIR}/net/bpf_jitter.c \ ${SYSDIR}/${MACHINE_ARCH}/${MACHINE_ARCH}/bpf_jit_machdep.c CFLAGS+= -DBPF_JIT_COMPILER LIBS+= -lutil -WARNS?= 6 .else SRCS+= ${SYSDIR}/net/bpf_filter.c WARNS?= 2 Modified: head/tools/regression/doat/Makefile ============================================================================== --- head/tools/regression/doat/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/tools/regression/doat/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -3,6 +3,5 @@ PROG= doat MAN= -WARNS?=6 .include Modified: head/tools/regression/geom_gpt/Makefile ============================================================================== --- head/tools/regression/geom_gpt/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/tools/regression/geom_gpt/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -5,6 +5,4 @@ MAN= LIBADD+= geom -WARNS?= 6 - .include Modified: head/tools/regression/include/stdatomic/Makefile ============================================================================== --- head/tools/regression/include/stdatomic/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/tools/regression/include/stdatomic/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -1,7 +1,6 @@ # $FreeBSD$ PROG= logic -WARNS=6 MAN= .include Modified: head/tools/regression/netinet/ipbroadcast/Makefile ============================================================================== --- head/tools/regression/netinet/ipbroadcast/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/tools/regression/netinet/ipbroadcast/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -5,6 +5,4 @@ PROG= ipbroadcast MAN= -WARNS?= 6 - .include Modified: head/tools/regression/rpcsec_gss/Makefile ============================================================================== --- head/tools/regression/rpcsec_gss/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/tools/regression/rpcsec_gss/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -2,7 +2,6 @@ PROG= rpctest MAN= -WARNS?= 6 LIBADD= rpcsec_gss DEBUG_FLAGS= -g -O0 Modified: head/tools/regression/sockets/accept_fd_leak/Makefile ============================================================================== --- head/tools/regression/sockets/accept_fd_leak/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/tools/regression/sockets/accept_fd_leak/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -4,6 +4,5 @@ PROG= accept_fd_leak MAN= -WARNS?= 6 .include Modified: head/tools/regression/sockets/accf_data_attach/Makefile ============================================================================== --- head/tools/regression/sockets/accf_data_attach/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/tools/regression/sockets/accf_data_attach/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -4,6 +4,5 @@ PROG= accf_data_attach MAN= -WARNS?= 6 .include Modified: head/tools/regression/sockets/fstat/Makefile ============================================================================== --- head/tools/regression/sockets/fstat/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/tools/regression/sockets/fstat/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -4,6 +4,5 @@ PROG= fstat MAN= -WARNS?= 6 .include Modified: head/tools/regression/sockets/kqueue/Makefile ============================================================================== --- head/tools/regression/sockets/kqueue/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/tools/regression/sockets/kqueue/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -4,6 +4,5 @@ PROG= kqueue MAN= -WARNS?= 6 .include Modified: head/tools/regression/sockets/listen_backlog/Makefile ============================================================================== --- head/tools/regression/sockets/listen_backlog/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/tools/regression/sockets/listen_backlog/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -2,6 +2,5 @@ PROG= listen_backlog MAN= -WARNS?= 6 .include Modified: head/tools/regression/sockets/listen_kqueue/Makefile ============================================================================== --- head/tools/regression/sockets/listen_kqueue/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/tools/regression/sockets/listen_kqueue/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -2,6 +2,5 @@ PROG= listen_kqueue MAN= -WARNS?= 6 .include Modified: head/tools/regression/sockets/listenclose/Makefile ============================================================================== --- head/tools/regression/sockets/listenclose/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/tools/regression/sockets/listenclose/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -4,6 +4,5 @@ PROG= listenclose MAN= -WARNS?= 6 .include Modified: head/tools/regression/sockets/pr_atomic/Makefile ============================================================================== --- head/tools/regression/sockets/pr_atomic/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/tools/regression/sockets/pr_atomic/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -2,6 +2,5 @@ PROG= pr_atomic MAN= -WARNS?= 6 .include Modified: head/tools/regression/sockets/reconnect/Makefile ============================================================================== --- head/tools/regression/sockets/reconnect/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/tools/regression/sockets/reconnect/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -4,6 +4,5 @@ PROG= reconnect MAN= -WARNS?= 6 .include Modified: head/tools/regression/sockets/rtsocket/Makefile ============================================================================== --- head/tools/regression/sockets/rtsocket/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/tools/regression/sockets/rtsocket/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -2,6 +2,5 @@ PROG= rtsocket MAN= -WARNS?= 6 .include Modified: head/tools/regression/sockets/sblock/Makefile ============================================================================== --- head/tools/regression/sockets/sblock/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/tools/regression/sockets/sblock/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -4,6 +4,5 @@ PROG= sblock MAN= -WARNS?= 6 .include Modified: head/tools/regression/sockets/sendfile/Makefile ============================================================================== --- head/tools/regression/sockets/sendfile/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/tools/regression/sockets/sendfile/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -4,7 +4,6 @@ PROG= sendfile MAN= -WARNS?= 6 LIBADD= md .include Modified: head/tools/regression/sockets/shutdown/Makefile ============================================================================== --- head/tools/regression/sockets/shutdown/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/tools/regression/sockets/shutdown/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -4,6 +4,5 @@ PROG= shutdown MAN= -WARNS?= 6 .include Modified: head/tools/regression/sockets/sigpipe/Makefile ============================================================================== --- head/tools/regression/sockets/sigpipe/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/tools/regression/sockets/sigpipe/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -4,6 +4,5 @@ PROG= sigpipe MAN= -WARNS?= 6 .include Modified: head/tools/regression/sockets/so_setfib/Makefile ============================================================================== --- head/tools/regression/sockets/so_setfib/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/tools/regression/sockets/so_setfib/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -4,7 +4,6 @@ PROG= so_setfib MAN= -WARNS?= 6 .if ${MK_INET} != "no" CFLAGS+= -DINET Modified: head/tools/regression/sockets/udp_pingpong/Makefile ============================================================================== --- head/tools/regression/sockets/udp_pingpong/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/tools/regression/sockets/udp_pingpong/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -2,6 +2,5 @@ PROG= udp_pingpong MAN= -WARNS?= 6 .include Modified: head/tools/regression/sockets/unix_bindconnect/Makefile ============================================================================== --- head/tools/regression/sockets/unix_bindconnect/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/tools/regression/sockets/unix_bindconnect/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -2,6 +2,5 @@ PROG= unix_bindconnect MAN= -WARNS?= 6 .include Modified: head/tools/regression/sockets/unix_close_race/Makefile ============================================================================== --- head/tools/regression/sockets/unix_close_race/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/tools/regression/sockets/unix_close_race/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -2,6 +2,5 @@ PROG= unix_close_race MAN= -WARNS?= 6 .include Modified: head/tools/regression/sockets/unix_gc/Makefile ============================================================================== --- head/tools/regression/sockets/unix_gc/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/tools/regression/sockets/unix_gc/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -2,6 +2,5 @@ PROG= unix_gc MAN= -WARNS?= 6 .include Modified: head/tools/regression/sockets/unix_sendtorace/Makefile ============================================================================== --- head/tools/regression/sockets/unix_sendtorace/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/tools/regression/sockets/unix_sendtorace/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -2,6 +2,5 @@ PROG= unix_sendtorace MAN= -WARNS?= 6 .include Modified: head/tools/regression/sockets/unix_socket/Makefile ============================================================================== --- head/tools/regression/sockets/unix_socket/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/tools/regression/sockets/unix_socket/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -2,6 +2,5 @@ PROG= unix_socket MAN= -WARNS?= 6 .include Modified: head/tools/regression/sockets/unix_sorflush/Makefile ============================================================================== --- head/tools/regression/sockets/unix_sorflush/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/tools/regression/sockets/unix_sorflush/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -2,6 +2,5 @@ PROG= unix_sorflush MAN= -WARNS?= 6 .include Modified: head/tools/regression/sockets/zerosend/Makefile ============================================================================== --- head/tools/regression/sockets/zerosend/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/tools/regression/sockets/zerosend/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -2,6 +2,5 @@ PROG= zerosend MAN= -WARNS?= 6 .include Modified: head/tools/test/auxinfo/Makefile ============================================================================== --- head/tools/test/auxinfo/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/tools/test/auxinfo/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -2,6 +2,5 @@ PROG= auxinfo MAN= -WARNS?= 6 .include Modified: head/tools/test/iconv/posix/Makefile ============================================================================== --- head/tools/test/iconv/posix/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/tools/test/iconv/posix/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -3,6 +3,4 @@ PROG= posix MAN= -WARNS?= 6 - .include Modified: head/tools/test/malloc/Makefile ============================================================================== --- head/tools/test/malloc/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/tools/test/malloc/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -4,7 +4,6 @@ SRCS= main.c .PATH: ${.CURDIR}/../../../lib/libc/stdlib MAN= -WARNS?=6 test: malloc @echo Modified: head/tools/test/net/Makefile ============================================================================== --- head/tools/test/net/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/tools/test/net/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -2,7 +2,6 @@ PROGS= listen connect MAN= -WARNS?= 6 test: ${PROGS} Modified: head/tools/test/netfibs/Makefile ============================================================================== --- head/tools/test/netfibs/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/tools/test/netfibs/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -2,6 +2,5 @@ PROG= reflect MAN= -WARNS?= 6 .include Modified: head/tools/test/ptrace/Makefile ============================================================================== --- head/tools/test/ptrace/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/tools/test/ptrace/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -2,6 +2,5 @@ PROG= scescx MAN= -WARNS?= 6 .include Modified: head/tools/tools/aac/Makefile ============================================================================== --- head/tools/tools/aac/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/tools/tools/aac/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -2,7 +2,6 @@ PROG= aac_checkq MAN= -WARNS?=6 BINDIR?=/usr/local/bin .include Modified: head/tools/tools/cfi/Makefile ============================================================================== --- head/tools/tools/cfi/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/tools/tools/cfi/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -3,6 +3,5 @@ PROG= cfi BINDIR= /usr/local/bin MAN= -WARNS?=6 .include Modified: head/tools/tools/find-sb/Makefile ============================================================================== --- head/tools/tools/find-sb/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/tools/tools/find-sb/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -2,6 +2,5 @@ PROG= find-sb MAN= -WARNS?= 6 .include Modified: head/tools/tools/fixwhite/Makefile ============================================================================== --- head/tools/tools/fixwhite/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/tools/tools/fixwhite/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -2,6 +2,5 @@ PROG= fixwhite BINDIR= /usr/bin -WARNS= 6 .include Modified: head/tools/tools/gensnmpdef/Makefile ============================================================================== --- head/tools/tools/gensnmpdef/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/tools/tools/gensnmpdef/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -21,6 +21,4 @@ LDFLAGS+= -L${LOCALBASE}/lib LDADD+= -lsmi -WARNS?= 6 - .include Modified: head/tools/tools/ifpifa/Makefile ============================================================================== --- head/tools/tools/ifpifa/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/tools/tools/ifpifa/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -2,7 +2,6 @@ PROG= ifpifa MAN= -WARNS?=6 BINDIR?=/usr/local/bin LIBADD=kvm Modified: head/tools/tools/ioat/Makefile ============================================================================== --- head/tools/tools/ioat/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/tools/tools/ioat/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -8,6 +8,4 @@ CFLAGS+= -I${SRCTOP}/sys/dev/ioat LIBADD= util -WARNS?= 6 - .include Modified: head/tools/tools/iwi/Makefile ============================================================================== --- head/tools/tools/iwi/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/tools/tools/iwi/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -2,6 +2,5 @@ PROG= iwistats MAN= -WARNS?=6 .include Modified: head/tools/tools/ncpus/Makefile ============================================================================== --- head/tools/tools/ncpus/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/tools/tools/ncpus/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -7,7 +7,6 @@ SRCS= ncpus.c acpi.c SRCS+= biosmptable.c .endif BINDIR= /usr/local/bin -WARNS?= 6 LIBADD= devinfo Modified: head/tools/tools/pciroms/Makefile ============================================================================== --- head/tools/tools/pciroms/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/tools/tools/pciroms/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -5,6 +5,4 @@ PROG= pciroms MAN= -WARNS?= 6 - .include Modified: head/tools/tools/syscall_timing/Makefile ============================================================================== --- head/tools/tools/syscall_timing/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/tools/tools/syscall_timing/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -8,6 +8,4 @@ MAN= #LIBADD= pthread -WARNS= 6 - .include Modified: head/tools/tools/tscdrift/Makefile ============================================================================== --- head/tools/tools/tscdrift/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/tools/tools/tscdrift/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -2,7 +2,6 @@ PROG= tscdrift MAN= -WARNS?= 6 LIBADD= pthread m Modified: head/tools/tools/vt/mkkfont/Makefile ============================================================================== --- head/tools/tools/vt/mkkfont/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/tools/tools/vt/mkkfont/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -1,6 +1,6 @@ +# $FreeBSD$ + PROG= mkkfont MAN1= - -WARNS?= 6 .include Modified: head/usr.bin/dpv/Makefile ============================================================================== --- head/usr.bin/dpv/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/usr.bin/dpv/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -8,6 +8,4 @@ CFLAGS+= -I${.CURDIR} LIBADD= dpv dialog -WARNS?= 6 - .include Modified: head/usr.bin/getconf/tests/Makefile ============================================================================== --- head/usr.bin/getconf/tests/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/usr.bin/getconf/tests/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -6,6 +6,4 @@ PROGS+= arch_type BINDIR= ${TESTSDIR} -WARNS?= 6 - .include Modified: head/usr.bin/mkimg/Makefile ============================================================================== --- head/usr.bin/mkimg/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/usr.bin/mkimg/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -34,8 +34,6 @@ BINDIR?=/usr/bin LIBADD= util -WARNS?= 6 - HAS_TESTS= SUBDIR.${MK_TESTS}+= tests Modified: head/usr.bin/posixshmcontrol/Makefile ============================================================================== --- head/usr.bin/posixshmcontrol/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/usr.bin/posixshmcontrol/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -2,6 +2,5 @@ PROG= posixshmcontrol LIBADD= util -WARNS?= 6 .include Modified: head/usr.bin/proccontrol/Makefile ============================================================================== --- head/usr.bin/proccontrol/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/usr.bin/proccontrol/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -1,6 +1,5 @@ # $FreeBSD$ PROG= proccontrol -WARNS?= 6 .include Modified: head/usr.bin/protect/Makefile ============================================================================== --- head/usr.bin/protect/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/usr.bin/protect/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -1,6 +1,5 @@ # $FreeBSD$ PROG= protect -WARNS?= 6 .include Modified: head/usr.sbin/bsdinstall/distextract/Makefile ============================================================================== --- head/usr.sbin/bsdinstall/distextract/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/usr.sbin/bsdinstall/distextract/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -4,7 +4,6 @@ BINDIR= ${LIBEXECDIR}/bsdinstall PROG= distextract LIBADD= archive dpv figpar ncursesw dialog m -WARNS?= 6 MAN= .include Modified: head/usr.sbin/bsdinstall/distfetch/Makefile ============================================================================== --- head/usr.sbin/bsdinstall/distfetch/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/usr.sbin/bsdinstall/distfetch/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -4,7 +4,6 @@ BINDIR= ${LIBEXECDIR}/bsdinstall PROG= distfetch LIBADD= fetch ncursesw dialog m -WARNS?= 6 MAN= .include Modified: head/usr.sbin/bsnmpd/tools/Makefile.inc ============================================================================== --- head/usr.sbin/bsnmpd/tools/Makefile.inc Thu Oct 1 00:47:35 2020 (r366303) +++ head/usr.sbin/bsnmpd/tools/Makefile.inc Thu Oct 1 01:10:51 2020 (r366304) @@ -5,5 +5,3 @@ BINDIR?= /usr/bin PACKAGE= bsnmp CFLAGS+= -I. -I${.CURDIR} - -WARNS?= 6 Modified: head/usr.sbin/ctld/Makefile ============================================================================== --- head/usr.sbin/ctld/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/usr.sbin/ctld/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -20,7 +20,6 @@ LIBADD= bsdxml md sbuf util ucl m nv YFLAGS+= -v CLEANFILES= y.tab.c y.tab.h y.output -WARNS?= 6 NO_WMISSING_VARIABLE_DECLARATIONS= .if ${MK_ISCSI} != "no" Modified: head/usr.sbin/iovctl/Makefile ============================================================================== --- head/usr.sbin/iovctl/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/usr.sbin/iovctl/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -6,8 +6,6 @@ LIBADD= nv ucl m CFLAGS+=-I${SRCTOP}/contrib/libucl/include -WARNS?=6 - MAN= \ iovctl.8 \ iovctl.conf.5 \ Modified: head/usr.sbin/mlx5tool/Makefile ============================================================================== --- head/usr.sbin/mlx5tool/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/usr.sbin/mlx5tool/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -2,6 +2,5 @@ PROG= mlx5tool MAN= mlx5tool.8 -WARNS?= 6 .include Modified: head/usr.sbin/pw/tests/Makefile ============================================================================== --- head/usr.sbin/pw/tests/Makefile Thu Oct 1 00:47:35 2020 (r366303) +++ head/usr.sbin/pw/tests/Makefile Thu Oct 1 01:10:51 2020 (r366304) @@ -5,7 +5,6 @@ PACKAGE= tests BINDIR= ${TESTSDIR} PROGS+= crypt -WARNS?= 6 LIBADD+= crypt ATF_TESTS_SH= pw_etcdir_test \ From owner-svn-src-all@freebsd.org Thu Oct 1 03:08:24 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9AF853F024C; Thu, 1 Oct 2020 03:08:24 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C1ykJ3Yhwz47gn; Thu, 1 Oct 2020 03:08:24 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5B3C29EE1; Thu, 1 Oct 2020 03:08:24 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09138OiP022262; Thu, 1 Oct 2020 03:08:24 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09138OZ6022261; Thu, 1 Oct 2020 03:08:24 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <202010010308.09138OZ6022261@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 1 Oct 2020 03:08:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366305 - stable/12/sbin/fsck_msdosfs X-SVN-Group: stable-12 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: stable/12/sbin/fsck_msdosfs X-SVN-Commit-Revision: 366305 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Oct 2020 03:08:24 -0000 Author: delphij Date: Thu Oct 1 03:08:23 2020 New Revision: 366305 URL: https://svnweb.freebsd.org/changeset/base/366305 Log: MFC r366064, r366065, r366215: sbin/fsck_msdosfs: Fix an integer overflow on 32-bit platforms Modified: stable/12/sbin/fsck_msdosfs/dir.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/fsck_msdosfs/dir.c ============================================================================== --- stable/12/sbin/fsck_msdosfs/dir.c Thu Oct 1 01:10:51 2020 (r366304) +++ stable/12/sbin/fsck_msdosfs/dir.c Thu Oct 1 03:08:23 2020 (r366305) @@ -388,7 +388,8 @@ static int checksize(struct fat_descriptor *fat, u_char *p, struct dosDirEntry *dir) { int ret = FSOK; - size_t physicalSize; + size_t chainsize; + u_int64_t physicalSize; struct bootblock *boot; boot = fat_get_boot(fat); @@ -401,9 +402,9 @@ checksize(struct fat_descriptor *fat, u_char *p, struc } else { if (!fat_is_valid_cl(fat, dir->head)) return FSERROR; - ret = checkchain(fat, dir->head, &physicalSize); + ret = checkchain(fat, dir->head, &chainsize); /* - * Upon return, physicalSize would hold the chain length + * Upon return, chainsize would hold the chain length * that checkchain() was able to validate, but if the user * refused the proposed repair, it would be unsafe to * proceed with directory entry fix, so bail out in that @@ -412,11 +413,17 @@ checksize(struct fat_descriptor *fat, u_char *p, struc if (ret == FSERROR) { return (FSERROR); } - physicalSize *= boot->ClusterSize; + /* + * The maximum file size on FAT32 is 4GiB - 1, which + * will occupy a cluster chain of exactly 4GiB in + * size. On 32-bit platforms, since size_t is 32-bit, + * it would wrap back to 0. + */ + physicalSize = (u_int64_t)chainsize * boot->ClusterSize; } if (physicalSize < dir->size) { - pwarn("size of %s is %u, should at most be %zu\n", - fullpath(dir), dir->size, physicalSize); + pwarn("size of %s is %u, should at most be %ju\n", + fullpath(dir), dir->size, (uintmax_t)physicalSize); if (ask(1, "Truncate")) { dir->size = physicalSize; p[28] = (u_char)physicalSize; From owner-svn-src-all@freebsd.org Thu Oct 1 03:10:43 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 91AF33F068B; Thu, 1 Oct 2020 03:10:43 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C1ymz3PDMz47kR; Thu, 1 Oct 2020 03:10:43 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5825CA346; Thu, 1 Oct 2020 03:10:43 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0913Ahbc025944; Thu, 1 Oct 2020 03:10:43 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0913AhUh025943; Thu, 1 Oct 2020 03:10:43 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <202010010310.0913AhUh025943@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 1 Oct 2020 03:10:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r366306 - stable/11/sbin/fsck_msdosfs X-SVN-Group: stable-11 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: stable/11/sbin/fsck_msdosfs X-SVN-Commit-Revision: 366306 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Oct 2020 03:10:43 -0000 Author: delphij Date: Thu Oct 1 03:10:42 2020 New Revision: 366306 URL: https://svnweb.freebsd.org/changeset/base/366306 Log: MFC r366064, r366065, r366215: sbin/fsck_msdosfs: Fix an integer overflow on 32-bit platforms Modified: stable/11/sbin/fsck_msdosfs/dir.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/fsck_msdosfs/dir.c ============================================================================== --- stable/11/sbin/fsck_msdosfs/dir.c Thu Oct 1 03:08:23 2020 (r366305) +++ stable/11/sbin/fsck_msdosfs/dir.c Thu Oct 1 03:10:42 2020 (r366306) @@ -388,7 +388,8 @@ static int checksize(struct fat_descriptor *fat, u_char *p, struct dosDirEntry *dir) { int ret = FSOK; - size_t physicalSize; + size_t chainsize; + u_int64_t physicalSize; struct bootblock *boot; boot = fat_get_boot(fat); @@ -401,9 +402,9 @@ checksize(struct fat_descriptor *fat, u_char *p, struc } else { if (!fat_is_valid_cl(fat, dir->head)) return FSERROR; - ret = checkchain(fat, dir->head, &physicalSize); + ret = checkchain(fat, dir->head, &chainsize); /* - * Upon return, physicalSize would hold the chain length + * Upon return, chainsize would hold the chain length * that checkchain() was able to validate, but if the user * refused the proposed repair, it would be unsafe to * proceed with directory entry fix, so bail out in that @@ -412,11 +413,17 @@ checksize(struct fat_descriptor *fat, u_char *p, struc if (ret == FSERROR) { return (FSERROR); } - physicalSize *= boot->ClusterSize; + /* + * The maximum file size on FAT32 is 4GiB - 1, which + * will occupy a cluster chain of exactly 4GiB in + * size. On 32-bit platforms, since size_t is 32-bit, + * it would wrap back to 0. + */ + physicalSize = (u_int64_t)chainsize * boot->ClusterSize; } if (physicalSize < dir->size) { - pwarn("size of %s is %u, should at most be %zu\n", - fullpath(dir), dir->size, physicalSize); + pwarn("size of %s is %u, should at most be %ju\n", + fullpath(dir), dir->size, (uintmax_t)physicalSize); if (ask(1, "Truncate")) { dir->size = physicalSize; p[28] = (u_char)physicalSize; From owner-svn-src-all@freebsd.org Thu Oct 1 04:26:00 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B7DA23F1F08; Thu, 1 Oct 2020 04:26:00 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C20Rr4q2Dz4Dpf; Thu, 1 Oct 2020 04:26:00 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8834FA976; Thu, 1 Oct 2020 04:26:00 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0914Q0NS071185; Thu, 1 Oct 2020 04:26:00 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0914PsX9071149; Thu, 1 Oct 2020 04:25:54 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <202010010425.0914PsX9071149@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Thu, 1 Oct 2020 04:25:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r366307 - in vendor/nvi/dist: . catalog cl common ex files man regex vi X-SVN-Group: vendor X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: in vendor/nvi/dist: . catalog cl common ex files man regex vi X-SVN-Commit-Revision: 366307 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Oct 2020 04:26:00 -0000 Author: bapt Date: Thu Oct 1 04:25:54 2020 New Revision: 366307 URL: https://svnweb.freebsd.org/changeset/base/366307 Log: Import nvi 2.2.0-05ed8b9 This snapshot just brings a bunch of fixes in particular a fix for vi -w PR: 241985 Reported by: fernape Modified: vendor/nvi/dist/CMakeLists.txt vendor/nvi/dist/catalog/dump.c vendor/nvi/dist/cl/cl.h vendor/nvi/dist/cl/cl_read.c vendor/nvi/dist/cl/cl_term.c vendor/nvi/dist/common/common.h vendor/nvi/dist/common/cut.h vendor/nvi/dist/common/exf.c vendor/nvi/dist/common/key.c vendor/nvi/dist/common/log.c vendor/nvi/dist/common/main.c vendor/nvi/dist/common/mark.c vendor/nvi/dist/common/mem.h vendor/nvi/dist/common/msg.c vendor/nvi/dist/common/options.c vendor/nvi/dist/common/put.c vendor/nvi/dist/common/recover.c vendor/nvi/dist/common/util.c vendor/nvi/dist/ex/ex.c vendor/nvi/dist/ex/ex.h vendor/nvi/dist/ex/ex_argv.c vendor/nvi/dist/ex/ex_bang.c vendor/nvi/dist/ex/ex_cscope.c vendor/nvi/dist/ex/ex_filter.c vendor/nvi/dist/ex/ex_global.c vendor/nvi/dist/ex/ex_script.c vendor/nvi/dist/ex/ex_shell.c vendor/nvi/dist/ex/ex_subst.c vendor/nvi/dist/files/config.h.in vendor/nvi/dist/files/pathnames.h.in vendor/nvi/dist/man/vi.1 vendor/nvi/dist/regex/engine.c vendor/nvi/dist/regex/regexec.c vendor/nvi/dist/vi/v_itxt.c vendor/nvi/dist/vi/v_paragraph.c vendor/nvi/dist/vi/v_section.c vendor/nvi/dist/vi/v_sentence.c vendor/nvi/dist/vi/v_txt.c vendor/nvi/dist/vi/vi.c vendor/nvi/dist/vi/vs_line.c vendor/nvi/dist/vi/vs_msg.c vendor/nvi/dist/vi/vs_refresh.c vendor/nvi/dist/vi/vs_relative.c vendor/nvi/dist/vi/vs_smap.c Modified: vendor/nvi/dist/CMakeLists.txt ============================================================================== --- vendor/nvi/dist/CMakeLists.txt Thu Oct 1 03:10:42 2020 (r366306) +++ vendor/nvi/dist/CMakeLists.txt Thu Oct 1 04:25:54 2020 (r366307) @@ -13,6 +13,7 @@ project(nvi2 C) include(CheckIncludeFiles) include(CheckFunctionExists) +include(CheckStructHasMember) include(CheckCSourceCompiles) mark_as_advanced(CMAKE_INSTALL_PREFIX) @@ -127,6 +128,7 @@ endif() if(USE_WIDECHAR) find_library(CURSES_LIBRARY NAMES ncursesw cursesw curses HINTS /usr/lib) + find_library(TERMINFO_LIBRARY NAMES tinfow terminfo HINTS /usr/lib) # link to the wchar_t awared BSD libregex.a add_library(regex STATIC) @@ -136,13 +138,14 @@ if(USE_WIDECHAR) target_link_libraries(nvi PRIVATE regex) else() find_library(CURSES_LIBRARY NAMES ncurses curses HINTS /usr/lib) + find_library(TERMINFO_LIBRARY NAMES tinfo terminfo HINTS /usr/lib) target_compile_options(nvi PRIVATE -Wno-pointer-sign) endif() -target_link_libraries(nvi PRIVATE ${CURSES_LIBRARY}) +target_link_libraries(nvi PRIVATE ${CURSES_LIBRARY} ${TERMINFO_LIBRARY}) if(USE_ICONV) - check_function_exists(__iconv ICONV_IN_LIBC) + check_function_exists(iconv ICONV_IN_LIBC) if(NOT ICONV_IN_LIBC) find_path(ICONV_INCLUDE_DIR iconv.h) find_library(ICONV_LIBRARY iconv) @@ -173,9 +176,26 @@ if(USE_ICONV) target_link_libraries(nvi PRIVATE ${ICONV_LIBRARY}) endif() +check_function_exists(getprogname GETPROGNAME_IN_LIBC) +check_function_exists(strlcpy STRLCPY_IN_LIBC) +if(NOT GETPROGNAME_IN_LIBC OR NOT STRLCPY_IN_LIBC) + find_package(PkgConfig REQUIRED) + pkg_check_modules(LIBBSD libbsd-overlay) + add_definitions(${LIBBSD_CFLAGS}) + target_link_libraries(nvi PRIVATE ${LIBBSD_LIBRARIES}) +endif() + +check_function_exists(dbopen DBOPEN_IN_LIBC) +if(NOT DBOPEN_IN_LIBC) + target_link_libraries(nvi PRIVATE db1) +endif() + check_include_files(libutil.h HAVE_LIBUTIL_H) check_include_files(ncurses.h HAVE_NCURSES_H) +check_include_files(ncursesw/ncurses.h HAVE_NCURSESW_NCURSES_H) +check_include_files(pty.h HAVE_PTY_H) check_include_files(term.h HAVE_TERM_H) +check_struct_has_member("struct dirent" d_namlen dirent.h HAVE_DIRENT_D_NAMLEN LANGUAGE C) configure_file(files/config.h.in config.h) Modified: vendor/nvi/dist/catalog/dump.c ============================================================================== --- vendor/nvi/dist/catalog/dump.c Thu Oct 1 03:10:42 2020 (r366306) +++ vendor/nvi/dist/catalog/dump.c Thu Oct 1 04:25:54 2020 (r366307) @@ -35,24 +35,24 @@ parse(FILE *fp) { int ch, s1, s2, s3; -#define TESTD(s) { \ +#define TESTD(s) do { \ if ((s = getc(fp)) == EOF) \ return; \ if (!isdigit(s)) \ continue; \ -} -#define TESTP { \ +} while (0) +#define TESTP do { \ if ((ch = getc(fp)) == EOF) \ return; \ if (ch != '|') \ continue; \ -} -#define MOVEC(t) { \ +} while (0) +#define MOVEC(t) do { \ do { \ if ((ch = getc(fp)) == EOF) \ return; \ } while (ch != (t)); \ -} +} while (0) for (;;) { MOVEC('"'); TESTD(s1); Modified: vendor/nvi/dist/cl/cl.h ============================================================================== --- vendor/nvi/dist/cl/cl.h Thu Oct 1 03:10:42 2020 (r366306) +++ vendor/nvi/dist/cl/cl.h Thu Oct 1 04:25:54 2020 (r366307) @@ -10,7 +10,9 @@ #ifdef USE_WIDECHAR #define _XOPEN_SOURCE_EXTENDED #endif -#ifdef HAVE_NCURSES_H +#ifdef HAVE_NCURSESW_NCURSES_H +#include +#elif defined HAVE_NCURSES_H #include #else #include Modified: vendor/nvi/dist/cl/cl_read.c ============================================================================== --- vendor/nvi/dist/cl/cl_read.c Thu Oct 1 03:10:42 2020 (r366306) +++ vendor/nvi/dist/cl/cl_read.c Thu Oct 1 04:25:54 2020 (r366307) @@ -20,6 +20,7 @@ #include #include #include +#include #include #include Modified: vendor/nvi/dist/cl/cl_term.c ============================================================================== --- vendor/nvi/dist/cl/cl_term.c Thu Oct 1 03:10:42 2020 (r366306) +++ vendor/nvi/dist/cl/cl_term.c Thu Oct 1 04:25:54 2020 (r366307) @@ -424,16 +424,18 @@ cl_ssize(SCR *sp, int sigwinch, size_t *rowp, size_t * if (row == 0 || col == 0) { if ((p = getenv("TERM")) == NULL) goto noterm; - if (row == 0) + if (row == 0) { if ((rval = tigetnum("lines")) < 0) msgq(sp, M_SYSERR, "tigetnum: lines"); else row = rval; - if (col == 0) + } + if (col == 0) { if ((rval = tigetnum("cols")) < 0) msgq(sp, M_SYSERR, "tigetnum: cols"); else col = rval; + } } /* If nothing else, well, it's probably a VT100. */ Modified: vendor/nvi/dist/common/common.h ============================================================================== --- vendor/nvi/dist/common/common.h Thu Oct 1 03:10:42 2020 (r366306) +++ vendor/nvi/dist/common/common.h Thu Oct 1 04:25:54 2020 (r366307) @@ -7,7 +7,15 @@ * See the LICENSE file for redistribution information. */ +#ifndef TCSASOFT +#define TCSASOFT 0 +#endif + +#ifdef __linux__ +#include "/usr/include/db1/db.h" /* Only include db1. */ +#else #include "/usr/include/db.h" /* Only include db1. */ +#endif #include /* May refer to the bundled regex. */ /* Modified: vendor/nvi/dist/common/cut.h ============================================================================== --- vendor/nvi/dist/common/cut.h Thu Oct 1 03:10:42 2020 (r366306) +++ vendor/nvi/dist/common/cut.h Thu Oct 1 04:25:54 2020 (r366307) @@ -63,13 +63,13 @@ struct _text { /* Text: a linked list of lines. */ * Get named buffer 'name'. * Translate upper-case buffer names to lower-case buffer names. */ -#define CBNAME(sp, cbp, nch) { \ +#define CBNAME(sp, cbp, nch) do { \ CHAR_T L__name; \ L__name = isupper(nch) ? tolower(nch) : (nch); \ SLIST_FOREACH(cbp, sp->gp->cutq, q) \ if (cbp->name == L__name) \ break; \ -} +} while (0) /* Flags to the cut() routine. */ #define CUT_LINEMODE 0x01 /* Cut in line mode. */ Modified: vendor/nvi/dist/common/exf.c ============================================================================== --- vendor/nvi/dist/common/exf.c Thu Oct 1 03:10:42 2020 (r366306) +++ vendor/nvi/dist/common/exf.c Thu Oct 1 04:25:54 2020 (r366307) @@ -199,7 +199,7 @@ file_init(SCR *sp, FREF *frp, char *rcv_name, int flag if (!LF_ISSET(FS_OPENERR)) F_SET(frp, FR_NEWFILE); - ep->mtim = sb.st_mtimespec; + ep->mtim = sb.st_mtim; } else { /* * XXX @@ -218,7 +218,7 @@ file_init(SCR *sp, FREF *frp, char *rcv_name, int flag ep->mdev = sb.st_dev; ep->minode = sb.st_ino; - ep->mtim = sb.st_mtimespec; + ep->mtim = sb.st_mtim; if (!S_ISREG(sb.st_mode)) msgq_str(sp, M_ERR, oname, @@ -796,7 +796,7 @@ file_write(SCR *sp, MARK *fm, MARK *tm, char *name, in if (noname && !LF_ISSET(FS_FORCE | FS_APPEND) && ((F_ISSET(ep, F_DEVSET) && (sb.st_dev != ep->mdev || sb.st_ino != ep->minode)) || - timespeccmp(&sb.st_mtimespec, &ep->mtim, !=))) { + timespeccmp(&sb.st_mtim, &ep->mtim, !=))) { msgq_str(sp, M_ERR, name, LF_ISSET(FS_POSSIBLE) ? "250|%s: file modified more recently than this copy; use ! to override" : "251|%s: file modified more recently than this copy"); @@ -887,7 +887,7 @@ success_open: * we re-init the time. That way the user can clean up the disk * and rewrite without having to force it. */ - if (noname) + if (noname) { if (stat(name, &sb)) timepoint_system(&ep->mtim); else { @@ -895,8 +895,9 @@ success_open: ep->mdev = sb.st_dev; ep->minode = sb.st_ino; - ep->mtim = sb.st_mtimespec; + ep->mtim = sb.st_mtim; } + } /* * If the write failed, complain loudly. ex_writefp() has already @@ -925,11 +926,12 @@ success_open: */ if (LF_ISSET(FS_ALL) && !LF_ISSET(FS_APPEND)) { F_CLR(ep, F_MODIFIED); - if (F_ISSET(frp, FR_TMPFILE)) + if (F_ISSET(frp, FR_TMPFILE)) { if (noname) F_SET(frp, FR_TMPEXIT); else F_CLR(frp, FR_TMPEXIT); + } } p = msg_print(sp, name, &nf); @@ -1290,7 +1292,7 @@ file_m1(SCR *sp, int force, int flags) * unless force is also set. Otherwise, we fail unless forced or * there's another open screen on this file. */ - if (F_ISSET(ep, F_MODIFIED)) + if (F_ISSET(ep, F_MODIFIED)) { if (O_ISSET(sp, O_AUTOWRITE)) { if (!force && file_aw(sp, flags)) return (1); @@ -1300,6 +1302,7 @@ file_m1(SCR *sp, int force, int flags) "263|File modified since last complete write; write or use :edit! to override"); return (1); } + } return (file_m3(sp, force)); } Modified: vendor/nvi/dist/common/key.c ============================================================================== --- vendor/nvi/dist/common/key.c Thu Oct 1 03:10:42 2020 (r366306) +++ vendor/nvi/dist/common/key.c Thu Oct 1 04:25:54 2020 (r366307) @@ -424,12 +424,12 @@ v_event_append(SCR *sp, EVENT *argp) } /* Remove events from the queue. */ -#define QREM(len) { \ +#define QREM(len) do { \ if ((gp->i_cnt -= len) == 0) \ gp->i_next = 0; \ else \ gp->i_next += len; \ -} +} while (0) /* * v_event_get -- Modified: vendor/nvi/dist/common/log.c ============================================================================== --- vendor/nvi/dist/common/log.c Thu Oct 1 03:10:42 2020 (r366306) +++ vendor/nvi/dist/common/log.c Thu Oct 1 04:25:54 2020 (r366307) @@ -69,10 +69,10 @@ static int apply_with(int (*)(SCR *, recno_t, CHAR_T * SCR *, recno_t, u_char *, size_t); /* Try and restart the log on failure, i.e. if we run out of memory. */ -#define LOG_ERR { \ +#define LOG_ERR do { \ log_err(sp, __FILE__, __LINE__); \ return (1); \ -} +} while (0) /* offset of CHAR_T string in log needs to be aligned on some systems * because it is passed to db_set as a string Modified: vendor/nvi/dist/common/main.c ============================================================================== --- vendor/nvi/dist/common/main.c Thu Oct 1 03:10:42 2020 (r366306) +++ vendor/nvi/dist/common/main.c Thu Oct 1 04:25:54 2020 (r366307) @@ -48,8 +48,8 @@ editor(GS *gp, int argc, char *argv[]) size_t len; u_int flags; int ch, flagchk, lflag, secure, startup, readonly, rval, silent; - char *tag_f, *wsizearg, path[256]; - CHAR_T *w; + char *tag_f, *wsizearg; + CHAR_T *w, path[256]; size_t wlen; /* Initialize the busy routine, if not defined by the screen. */ @@ -242,9 +242,9 @@ editor(GS *gp, int argc, char *argv[]) } if (wsizearg != NULL) { ARGS *av[2], a, b; - (void)snprintf(path, sizeof(path), "window=%s", wsizearg); + (void)SPRINTF(path, SIZE(path), L("window=%s"), wsizearg); a.bp = (CHAR_T *)path; - a.len = strlen(path); + a.len = SIZE(path); b.bp = NULL; b.len = 0; av[0] = &a; @@ -533,7 +533,7 @@ v_obsolete(char *argv[]) argv[0][1] = 'c'; (void)strlcpy(argv[0] + 2, p + 1, len); } - } else if (argv[0][0] == '-') + } else if (argv[0][0] == '-') { if (argv[0][1] == '\0') { argv[0] = strdup("-s"); if (argv[0] == NULL) { @@ -545,6 +545,7 @@ nomem: warn(NULL); argv[0][1] == 't' || argv[0][1] == 'w') && argv[0][2] == '\0') ++argv; + } return (0); } Modified: vendor/nvi/dist/common/mark.c ============================================================================== --- vendor/nvi/dist/common/mark.c Thu Oct 1 03:10:42 2020 (r366306) +++ vendor/nvi/dist/common/mark.c Thu Oct 1 04:25:54 2020 (r366307) @@ -216,12 +216,13 @@ mark_insdel(SCR *sp, lnop_t op, recno_t lno) abort(); case LINE_DELETE: SLIST_FOREACH(lmp, sp->ep->marks, q) - if (lmp->lno >= lno) + if (lmp->lno >= lno) { if (lmp->lno == lno) { F_SET(lmp, MARK_DELETED); (void)log_mark(sp, lmp); } else --lmp->lno; + } break; case LINE_INSERT: /* Modified: vendor/nvi/dist/common/mem.h ============================================================================== --- vendor/nvi/dist/common/mem.h Thu Oct 1 03:10:42 2020 (r366306) +++ vendor/nvi/dist/common/mem.h Thu Oct 1 04:25:54 2020 (r366307) @@ -17,7 +17,7 @@ /* Increase the size of a malloc'd buffer. Two versions, one that * returns, one that jumps to an error label. */ -#define BINC_GOTO(sp, type, lp, llen, nlen) { \ +#define BINC_GOTO(sp, type, lp, llen, nlen) do { \ CHECK_TYPE(type *, lp) \ void *L__bincp; \ if ((nlen) > llen) { \ @@ -29,12 +29,12 @@ */ \ lp = L__bincp; \ } \ -} +} while (0) #define BINC_GOTOC(sp, lp, llen, nlen) \ BINC_GOTO(sp, char, lp, llen, nlen) #define BINC_GOTOW(sp, lp, llen, nlen) \ BINC_GOTO(sp, CHAR_T, lp, llen, (nlen) * sizeof(CHAR_T)) -#define BINC_RET(sp, type, lp, llen, nlen) { \ +#define BINC_RET(sp, type, lp, llen, nlen) do { \ CHECK_TYPE(type *, lp) \ void *L__bincp; \ if ((nlen) > llen) { \ @@ -46,7 +46,7 @@ */ \ lp = L__bincp; \ } \ -} +} while (0) #define BINC_RETC(sp, lp, llen, nlen) \ BINC_RET(sp, char, lp, llen, nlen) #define BINC_RETW(sp, lp, llen, nlen) \ @@ -57,7 +57,7 @@ * from a malloc'd buffer otherwise. Two versions, one that returns, one * that jumps to an error label. */ -#define GET_SPACE_GOTO(sp, type, bp, blen, nlen) { \ +#define GET_SPACE_GOTO(sp, type, bp, blen, nlen) do { \ CHECK_TYPE(type *, bp) \ GS *L__gp = (sp) == NULL ? NULL : (sp)->gp; \ if (L__gp == NULL || F_ISSET(L__gp, G_TMP_INUSE)) { \ @@ -70,12 +70,12 @@ blen = L__gp->tmp_blen; \ F_SET(L__gp, G_TMP_INUSE); \ } \ -} +} while (0) #define GET_SPACE_GOTOC(sp, bp, blen, nlen) \ GET_SPACE_GOTO(sp, char, bp, blen, nlen) #define GET_SPACE_GOTOW(sp, bp, blen, nlen) \ GET_SPACE_GOTO(sp, CHAR_T, bp, blen, (nlen) * sizeof(CHAR_T)) -#define GET_SPACE_RET(sp, type, bp, blen, nlen) { \ +#define GET_SPACE_RET(sp, type, bp, blen, nlen) do { \ CHECK_TYPE(type *, bp) \ GS *L__gp = (sp) == NULL ? NULL : (sp)->gp; \ if (L__gp == NULL || F_ISSET(L__gp, G_TMP_INUSE)) { \ @@ -88,7 +88,7 @@ blen = L__gp->tmp_blen; \ F_SET(L__gp, G_TMP_INUSE); \ } \ -} +} while (0) #define GET_SPACE_RETC(sp, bp, blen, nlen) \ GET_SPACE_RET(sp, char, bp, blen, nlen) #define GET_SPACE_RETW(sp, bp, blen, nlen) \ @@ -98,7 +98,7 @@ * Add space to a GET_SPACE returned buffer. Two versions, one that * returns, one that jumps to an error label. */ -#define ADD_SPACE_GOTO(sp, type, bp, blen, nlen) { \ +#define ADD_SPACE_GOTO(sp, type, bp, blen, nlen) do { \ CHECK_TYPE(type *, bp) \ GS *L__gp = (sp) == NULL ? NULL : (sp)->gp; \ if (L__gp == NULL || bp == (type *)L__gp->tmp_bp) { \ @@ -109,12 +109,12 @@ F_SET(L__gp, G_TMP_INUSE); \ } else \ BINC_GOTO(sp, type, bp, blen, nlen); \ -} +} while (0) #define ADD_SPACE_GOTOC(sp, bp, blen, nlen) \ ADD_SPACE_GOTO(sp, char, bp, blen, nlen) #define ADD_SPACE_GOTOW(sp, bp, blen, nlen) \ ADD_SPACE_GOTO(sp, CHAR_T, bp, blen, (nlen) * sizeof(CHAR_T)) -#define ADD_SPACE_RET(sp, type, bp, blen, nlen) { \ +#define ADD_SPACE_RET(sp, type, bp, blen, nlen) do { \ CHECK_TYPE(type *, bp) \ GS *L__gp = (sp) == NULL ? NULL : (sp)->gp; \ if (L__gp == NULL || bp == (type *)L__gp->tmp_bp) { \ @@ -125,70 +125,70 @@ F_SET(L__gp, G_TMP_INUSE); \ } else \ BINC_RET(sp, type, bp, blen, nlen); \ -} +} while (0) #define ADD_SPACE_RETC(sp, bp, blen, nlen) \ ADD_SPACE_RET(sp, char, bp, blen, nlen) #define ADD_SPACE_RETW(sp, bp, blen, nlen) \ ADD_SPACE_RET(sp, CHAR_T, bp, blen, (nlen) * sizeof(CHAR_T)) /* Free a GET_SPACE returned buffer. */ -#define FREE_SPACE(sp, bp, blen) { \ +#define FREE_SPACE(sp, bp, blen) do { \ GS *L__gp = (sp) == NULL ? NULL : (sp)->gp; \ if (L__gp != NULL && bp == L__gp->tmp_bp) \ F_CLR(L__gp, G_TMP_INUSE); \ else \ free(bp); \ -} -#define FREE_SPACEW(sp, bp, blen) { \ +} while (0) +#define FREE_SPACEW(sp, bp, blen) do { \ CHECK_TYPE(CHAR_T *, bp) \ FREE_SPACE(sp, (char *)bp, blen); \ -} +} while (0) /* * Malloc a buffer, casting the return pointer. Various versions. */ -#define CALLOC(sp, p, nmemb, size) { \ +#define CALLOC(sp, p, nmemb, size) do { \ if ((p = calloc(nmemb, size)) == NULL) \ msgq(sp, M_SYSERR, NULL); \ -} -#define CALLOC_GOTO(sp, p, nmemb, size) { \ +} while (0) +#define CALLOC_GOTO(sp, p, nmemb, size) do { \ if ((p = calloc(nmemb, size)) == NULL) \ goto alloc_err; \ -} -#define CALLOC_RET(sp, p, nmemb, size) { \ +} while (0) +#define CALLOC_RET(sp, p, nmemb, size) do { \ if ((p = calloc(nmemb, size)) == NULL) { \ msgq(sp, M_SYSERR, NULL); \ return (1); \ } \ -} +} while (0) -#define MALLOC(sp, p, size) { \ +#define MALLOC(sp, p, size) do { \ if ((p = malloc(size)) == NULL) \ msgq(sp, M_SYSERR, NULL); \ -} -#define MALLOC_GOTO(sp, p, size) { \ +} while (0) +#define MALLOC_GOTO(sp, p, size) do { \ if ((p = malloc(size)) == NULL) \ goto alloc_err; \ -} -#define MALLOC_RET(sp, p, size) { \ +} while (0) +#define MALLOC_RET(sp, p, size) do { \ if ((p = malloc(size)) == NULL) { \ msgq(sp, M_SYSERR, NULL); \ return (1); \ } \ -} +} while (0) /* * Resize a buffer, free any already held memory if we can't get more. * FreeBSD's reallocf(3) does the same thing, but it's not portable yet. */ -#define REALLOC(sp, p, cast, size) { \ +#define REALLOC(sp, p, cast, size) do { \ cast newp; \ if ((newp = realloc(p, size)) == NULL) { \ free(p); \ msgq(sp, M_SYSERR, NULL); \ } \ p = newp; \ -} +} while (0) /* * p2roundup -- Modified: vendor/nvi/dist/common/msg.c ============================================================================== --- vendor/nvi/dist/common/msg.c Thu Oct 1 03:10:42 2020 (r366306) +++ vendor/nvi/dist/common/msg.c Thu Oct 1 04:25:54 2020 (r366307) @@ -731,7 +731,11 @@ msg_open(SCR *sp, char *file) * corrupt catalog file. Errno == 0 is not rare; add * EFTYPE, which is seen on FreeBSD, for a good measure. */ +#ifdef EFTYPE if (errno == 0 || errno == EFTYPE) +#else + if (errno == 0) +#endif msgq_str(sp, M_ERR, p, "030|The file %s is not a message catalog"); else Modified: vendor/nvi/dist/common/options.c ============================================================================== --- vendor/nvi/dist/common/options.c Thu Oct 1 03:10:42 2020 (r366306) +++ vendor/nvi/dist/common/options.c Thu Oct 1 04:25:54 2020 (r366307) @@ -20,6 +20,7 @@ #include #include #include +#include #include #include "common.h" @@ -312,7 +313,7 @@ opts_init(SCR *sp, int *oargs) argv[1] = &b; /* Set numeric and string default values. */ -#define OI(indx, str) { \ +#define OI(indx, str) do { \ a.len = STRLEN(str); \ if ((CHAR_T*)str != b2) /* GCC puts strings in text-space. */ \ (void)MEMCPY(b2, str, a.len+1); \ @@ -320,7 +321,7 @@ opts_init(SCR *sp, int *oargs) optindx = indx; \ goto err; \ } \ -} +} while (0) /* * Indirect global options to global space. Specifically, set up * terminal, lines, columns first, they're used by other options. @@ -366,7 +367,7 @@ opts_init(SCR *sp, int *oargs) OI(O_PARAGRAPHS, L("paragraphs=IPLPPPQPP LIpplpipbp")); (void)SPRINTF(b2, SIZE(b2), L("path=%s"), ""); OI(O_PATH, b2); - (void)SPRINTF(b2, SIZE(b2), L("recdir=%s"), _PATH_PRESERVE); + (void)SPRINTF(b2, SIZE(b2), L("recdir=%s"), NVI_PATH_PRESERVE); OI(O_RECDIR, b2); OI(O_SECTIONS, L("sections=NHSHH HUnhsh")); (void)SPRINTF(b2, SIZE(b2), @@ -573,13 +574,14 @@ opts_set(SCR *sp, ARGS *argv[], char *usage) * functions can be expensive. */ isset = !turnoff; - if (!F_ISSET(op, OPT_ALWAYS)) + if (!F_ISSET(op, OPT_ALWAYS)) { if (isset) { if (O_ISSET(sp, offset)) break; } else if (!O_ISSET(sp, offset)) break; + } /* Report to subsystems. */ if ((op->func != NULL && @@ -945,6 +947,7 @@ static int opts_print(SCR *sp, OPTLIST const *op) { int curlen, offset; + const char *p; curlen = 0; offset = op - optlist; @@ -958,8 +961,13 @@ opts_print(SCR *sp, OPTLIST const *op) curlen += ex_printf(sp, WS"=%ld", op->name, O_VAL(sp, offset)); break; case OPT_STR: - curlen += ex_printf(sp, WS"=\"%s\"", op->name, - O_STR(sp, offset) == NULL ? "" : O_STR(sp, offset)); + curlen += ex_printf(sp, WS"=\"", op->name); + p = O_STR(sp, offset); + /* Keep correct count for unprintable character sequences */ + if (p != NULL) + for (; *p != '\0'; ++p) + curlen += ex_puts(sp, unctrl(*p)); + curlen += ex_puts(sp, "\""); break; } return (curlen); Modified: vendor/nvi/dist/common/put.c ============================================================================== --- vendor/nvi/dist/common/put.c Thu Oct 1 03:10:42 2020 (r366306) +++ vendor/nvi/dist/common/put.c Thu Oct 1 04:25:54 2020 (r366307) @@ -39,7 +39,7 @@ put(SCR *sp, CB *cbp, CHAR_T *namep, MARK *cp, MARK *r CHAR_T *bp, *t; CHAR_T *p; - if (cbp == NULL) + if (cbp == NULL) { if (namep == NULL) { cbp = sp->gp->dcbp; if (cbp == NULL) { @@ -56,6 +56,7 @@ put(SCR *sp, CB *cbp, CHAR_T *namep, MARK *cp, MARK *r return (1); } } + } tp = TAILQ_FIRST(cbp->textq); /* Modified: vendor/nvi/dist/common/recover.c ============================================================================== --- vendor/nvi/dist/common/recover.c Thu Oct 1 03:10:42 2020 (r366306) +++ vendor/nvi/dist/common/recover.c Thu Oct 1 04:25:54 2020 (r366307) @@ -421,7 +421,7 @@ rcv_mailfile(SCR *sp, int issync, char *cp_path) getprogname(), " -r ", qt); free(qt); free(host); - if (buf == NULL) { + if (len == -1) { msgq(sp, M_SYSERR, NULL); goto err; } @@ -701,7 +701,7 @@ rcv_read(SCR *sp, FREF *frp) /* If we've found more than one, take the most recent. */ (void)fstat(fileno(fp), &sb); if (recp == NULL || - timespeccmp(&rec_mtim, &sb.st_mtimespec, <)) { + timespeccmp(&rec_mtim, &sb.st_mtim, <)) { p = recp; t = pathp; recp = recpath; @@ -710,7 +710,7 @@ rcv_read(SCR *sp, FREF *frp) free(p); free(t); } - rec_mtim = sb.st_mtimespec; + rec_mtim = sb.st_mtim; if (sv_fd != -1) (void)close(sv_fd); sv_fd = dup(fileno(fp)); @@ -813,8 +813,7 @@ rcv_email(SCR *sp, char *fname) { char *buf; - (void)asprintf(&buf, _PATH_SENDMAIL " -odb -t < %s", fname); - if (buf == NULL) { + if (asprintf(&buf, _PATH_SENDMAIL " -odb -t < %s", fname) == -1) { msgq_str(sp, M_ERR, strerror(errno), "071|not sending email: %s"); return; Modified: vendor/nvi/dist/common/util.c ============================================================================== --- vendor/nvi/dist/common/util.c Thu Oct 1 03:10:42 2020 (r366306) +++ vendor/nvi/dist/common/util.c Thu Oct 1 04:25:54 2020 (r366307) @@ -111,8 +111,9 @@ join(char *path1, char *path2) if (path1[0] == '\0' || path2[0] == '/') return strdup(path2); - (void)asprintf(&p, path1[strlen(path1)-1] == '/' ? - "%s%s" : "%s/%s", path1, path2); + if (asprintf(&p, path1[strlen(path1)-1] == '/' ? + "%s%s" : "%s/%s", path1, path2) == -1) + return NULL; return p; } @@ -140,8 +141,13 @@ expanduser(char *str) continue; if (t == p) { /* ~ */ +#ifdef __GLIBC__ + extern char *secure_getenv(const char *); + if ((h = secure_getenv("HOME")) == NULL) { +#else if (issetugid() != 0 || (h = getenv("HOME")) == NULL) { +#endif if (((h = getlogin()) != NULL && (pwd = getpwnam(h)) != NULL) || (pwd = getpwuid(getuid())) != NULL) Modified: vendor/nvi/dist/ex/ex.c ============================================================================== --- vendor/nvi/dist/ex/ex.c Thu Oct 1 03:10:42 2020 (r366306) +++ vendor/nvi/dist/ex/ex.c Thu Oct 1 04:25:54 2020 (r366307) @@ -811,13 +811,14 @@ skip_srch: if (ecp->cmd == &cmds[C_VISUAL_EX] && F_ISS * this isn't a particularly complex trap, and if backslashes were * legal in set commands, this would have to be much more complicated. */ - if (ecp->cmd == &cmds[C_SET]) + if (ecp->cmd == &cmds[C_SET]) { for (p = ecp->cp, len = ecp->clen; len > 0; --len, ++p) if (IS_ESCAPE(sp, ecp, *p) && len > 1) { --len; ++p; } else if (*p == '\\') *p = CH_LITERAL; + } /* * Set the default addresses. It's an error to specify an address for @@ -1254,7 +1255,7 @@ addr_verify: ex_badaddr(sp, ecp->cmd, A_ZERO, NUM_OK); goto err; } - } else if (!db_exist(sp, ecp->addr2.lno)) + } else if (!db_exist(sp, ecp->addr2.lno)) { if (FL_ISSET(ecp->iflags, E_C_COUNT)) { if (db_last(sp, &lno)) goto err; @@ -1263,6 +1264,7 @@ addr_verify: ex_badaddr(sp, NULL, A_EOF, NUM_OK); goto err; } + } /* FALLTHROUGH */ case 1: if (ecp->addr1.lno == 0) { @@ -2117,7 +2119,7 @@ ex_load(SCR *sp) /* If it's a global/v command, fix up the last line. */ if (FL_ISSET(ecp->agv_flags, - AGV_GLOBAL | AGV_V) && ecp->range_lno != OOBLNO) + AGV_GLOBAL | AGV_V) && ecp->range_lno != OOBLNO) { if (db_exist(sp, ecp->range_lno)) sp->lno = ecp->range_lno; else { @@ -2126,6 +2128,7 @@ ex_load(SCR *sp) if (sp->lno == 0) sp->lno = 1; } + } free(ecp->o_cp); } Modified: vendor/nvi/dist/ex/ex.h ============================================================================== --- vendor/nvi/dist/ex/ex.h Thu Oct 1 03:10:42 2020 (r366306) +++ vendor/nvi/dist/ex/ex.h Thu Oct 1 04:25:54 2020 (r366307) @@ -55,12 +55,12 @@ extern EXCMDLIST const cmds[]; /* Table of ex command * at any time, and most of them won't work well if a file hasn't yet been read * in. Historic vi generally took the easy way out and dropped core. */ -#define NEEDFILE(sp, cmdp) { \ +#define NEEDFILE(sp, cmdp) do { \ if ((sp)->ep == NULL) { \ ex_wemsg(sp, (cmdp)->cmd->name, EXM_NOFILEYET); \ return (1); \ } \ -} +} while (0) /* Range structures for global and @ commands. */ typedef struct _range RANGE; @@ -102,12 +102,12 @@ struct _excmd { u_int8_t agv_flags; /* Clear the structure before each ex command. */ -#define CLEAR_EX_CMD(cmdp) { \ +#define CLEAR_EX_CMD(cmdp) do { \ u_int32_t L__f = F_ISSET(cmdp, E_PRESERVE); \ memset(&((cmdp)->buffer), 0, ((char *)&(cmdp)->flags - \ (char *)&((cmdp)->buffer)) + sizeof((cmdp)->flags)); \ F_SET(cmdp, L__f); \ -} +} while (0) CHAR_T buffer; /* Command: named buffer. */ recno_t lineno; /* Command: line number. */ Modified: vendor/nvi/dist/ex/ex_argv.c ============================================================================== --- vendor/nvi/dist/ex/ex_argv.c Thu Oct 1 03:10:42 2020 (r366306) +++ vendor/nvi/dist/ex/ex_argv.c Thu Oct 1 04:25:54 2020 (r366307) @@ -611,9 +611,17 @@ argv_flt_path(SCR *sp, EXCMD *excp, CHAR_T *path, size if (nlen == 0) { if (dp->d_name[0] == '.') continue; +#ifdef HAVE_DIRENT_D_NAMLEN len = dp->d_namlen; +#else + len = strlen(dp->d_name); +#endif } else { +#ifdef HAVE_DIRENT_D_NAMLEN len = dp->d_namlen; +#else + len = strlen(dp->d_name); +#endif if (len < nlen || memcmp(dp->d_name, name, nlen)) continue; } Modified: vendor/nvi/dist/ex/ex_bang.c ============================================================================== --- vendor/nvi/dist/ex/ex_bang.c Thu Oct 1 03:10:42 2020 (r366306) +++ vendor/nvi/dist/ex/ex_bang.c Thu Oct 1 04:25:54 2020 (r366307) @@ -96,7 +96,7 @@ ex_bang(SCR *sp, EXCMD *cmdp) */ if (cmdp->addrcnt == 0) { msg = NULL; - if (sp->ep != NULL && F_ISSET(sp->ep, F_MODIFIED)) + if (sp->ep != NULL && F_ISSET(sp->ep, F_MODIFIED)) { if (O_ISSET(sp, O_AUTOWRITE)) { if (file_aw(sp, FS_ALL)) return (0); @@ -105,6 +105,7 @@ ex_bang(SCR *sp, EXCMD *cmdp) msg = msg_cat(sp, "303|File modified since last write.", NULL); + } /* If we're still in a vi screen, move out explicitly. */ INT2CHAR(sp, ap->bp, ap->len+1, np, nlen); Modified: vendor/nvi/dist/ex/ex_cscope.c ============================================================================== --- vendor/nvi/dist/ex/ex_cscope.c Thu Oct 1 03:10:42 2020 (r366306) +++ vendor/nvi/dist/ex/ex_cscope.c Thu Oct 1 04:25:54 2020 (r366307) @@ -261,7 +261,7 @@ cscope_add(SCR *sp, EXCMD *cmdp, CHAR_T *dname) csc->dname = csc->buf; csc->dlen = len; memcpy(csc->dname, np, len); - csc->mtim = sb.st_mtimespec; + csc->mtim = sb.st_mtim; /* Get the search paths for the cscope. */ if (get_paths(sp, csc)) @@ -411,7 +411,8 @@ err: if (to_cs[0] != -1) free(dn); goto nomem; } - (void)asprintf(&cmd, CSCOPE_CMD_FMT, dn, dbn); + if (asprintf(&cmd, CSCOPE_CMD_FMT, dn, dbn) == -1) + cmd = NULL; free(dbn); free(dn); if (cmd == NULL) { @@ -812,7 +813,7 @@ csc_file(SCR *sp, CSC *csc, char *name, char **dirp, s *dirp = *pp; *dlenp = strlen(*pp); *isolderp = timespeccmp( - &sb.st_mtimespec, &csc->mtim, <); + &sb.st_mtim, &csc->mtim, <); return; } free(buf); @@ -843,7 +844,7 @@ csc_help(SCR *sp, char *cmd) { CC const *ccp; - if (cmd != NULL && *cmd != '\0') + if (cmd != NULL && *cmd != '\0') { if ((ccp = lookup_ccmd(cmd)) == NULL) { ex_printf(sp, "%s doesn't match any cscope command\n", cmd); @@ -854,6 +855,7 @@ csc_help(SCR *sp, char *cmd) ex_printf(sp, " Usage: %s\n", ccp->usage_msg); return (0); } + } ex_printf(sp, "cscope commands:\n"); for (ccp = cscope_cmds; ccp->name != NULL; ++ccp) Modified: vendor/nvi/dist/ex/ex_filter.c ============================================================================== --- vendor/nvi/dist/ex/ex_filter.c Thu Oct 1 03:10:42 2020 (r366306) +++ vendor/nvi/dist/ex/ex_filter.c Thu Oct 1 04:25:54 2020 (r366307) @@ -174,11 +174,12 @@ err: if (input[0] != -1) if (ex_readfp(sp, "filter", ofp, fm, &nread, 1)) rval = 1; sp->rptlines[L_ADDED] += nread; - if (ftype == FILTER_READ) + if (ftype == FILTER_READ) { if (fm->lno == 0) rp->lno = nread; else rp->lno += nread; + } goto uwait; } Modified: vendor/nvi/dist/ex/ex_global.c ============================================================================== --- vendor/nvi/dist/ex/ex_global.c Thu Oct 1 03:10:42 2020 (r366306) +++ vendor/nvi/dist/ex/ex_global.c Thu Oct 1 04:25:54 2020 (r366307) @@ -112,11 +112,12 @@ usage: ex_emsg(sp, cmdp->cmd->usage, EXM_USAGE); *t = '\0'; break; } - if (p[0] == '\\') + if (p[0] == '\\') { if (p[1] == delim) ++p; else if (p[1] == '\\') *t++ = *p++; + } *t++ = *p++; } Modified: vendor/nvi/dist/ex/ex_script.c ============================================================================== --- vendor/nvi/dist/ex/ex_script.c Thu Oct 1 03:10:42 2020 (r366306) +++ vendor/nvi/dist/ex/ex_script.c Thu Oct 1 04:25:54 2020 (r366307) @@ -32,6 +32,8 @@ #include #ifdef HAVE_LIBUTIL_H #include +#elif defined HAVE_PTY_H +#include #else #include #endif Modified: vendor/nvi/dist/ex/ex_shell.c ============================================================================== --- vendor/nvi/dist/ex/ex_shell.c Thu Oct 1 03:10:42 2020 (r366306) +++ vendor/nvi/dist/ex/ex_shell.c Thu Oct 1 04:25:54 2020 (r366307) @@ -48,8 +48,7 @@ ex_shell(SCR *sp, EXCMD *cmdp) * XXX * Assumes all shells use -i. */ - (void)asprintf(&buf, "%s -i", O_STR(sp, O_SHELL)); - if (buf == NULL) { + if (asprintf(&buf, "%s -i", O_STR(sp, O_SHELL)) == -1) { msgq(sp, M_SYSERR, NULL); return (1); } Modified: vendor/nvi/dist/ex/ex_subst.c ============================================================================== --- vendor/nvi/dist/ex/ex_subst.c Thu Oct 1 03:10:42 2020 (r366306) +++ vendor/nvi/dist/ex/ex_subst.c Thu Oct 1 04:25:54 2020 (r366307) @@ -115,11 +115,12 @@ subagain: return (ex_subagain(sp, cmdp)); *t = '\0'; break; } - if (p[0] == '\\') + if (p[0] == '\\') { if (p[1] == delim) ++p; else if (p[1] == '\\') *t++ = *p++; + } *t++ = *p++; } @@ -296,7 +297,7 @@ ex_subtilde(SCR *sp, EXCMD *cmdp) * when the replacement is done. Don't change it unless you're *damned* * confident. */ -#define NEEDNEWLINE(sp) { \ +#define NEEDNEWLINE(sp) do { \ if (sp->newl_len == sp->newl_cnt) { \ sp->newl_len += 25; \ REALLOC(sp, sp->newl, size_t *, \ @@ -306,9 +307,9 @@ ex_subtilde(SCR *sp, EXCMD *cmdp) return (1); \ } \ } \ -} +} while (0) -#define BUILD(sp, l, len) { \ +#define BUILD(sp, l, len) do { \ if (lbclen + (len) > lblen) { \ lblen = p2roundup(MAX(lbclen + (len), 256)); \ REALLOC(sp, lb, CHAR_T *, lblen * sizeof(CHAR_T)); \ @@ -319,9 +320,9 @@ ex_subtilde(SCR *sp, EXCMD *cmdp) } \ MEMCPY(lb + lbclen, l, len); \ lbclen += len; \ -} +} while (0) -#define NEEDSP(sp, len, pnt) { \ +#define NEEDSP(sp, len, pnt) do { \ if (lbclen + (len) > lblen) { \ lblen = p2roundup(MAX(lbclen + (len), 256)); \ REALLOC(sp, lb, CHAR_T *, lblen * sizeof(CHAR_T)); \ @@ -331,7 +332,7 @@ ex_subtilde(SCR *sp, EXCMD *cmdp) } \ pnt = lb + lbclen; \ } \ -} +} while (0) static int s(SCR *sp, EXCMD *cmdp, CHAR_T *s, regex_t *re, u_int flags) @@ -584,7 +585,7 @@ nextmatch: match[0].rm_so = 0; empty_ok = 1; if (len == 0) goto endmatch; - BUILD(sp, s + offset, 1) + BUILD(sp, s + offset, 1); ++offset; --len; goto nextmatch; @@ -710,7 +711,7 @@ skip: offset += match[0].rm_eo; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Oct 1 04:26:47 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E9DCD3F2018; Thu, 1 Oct 2020 04:26:47 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C20Sl5xSRz4Dwc; Thu, 1 Oct 2020 04:26:47 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AEBC9A978; Thu, 1 Oct 2020 04:26:47 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0914QlCi071286; Thu, 1 Oct 2020 04:26:47 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0914QktE071278; Thu, 1 Oct 2020 04:26:46 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <202010010426.0914QktE071278@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Thu, 1 Oct 2020 04:26:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r366308 - in vendor/nvi/2.2.0-05ed8b9: . catalog cl common ex files man regex vi X-SVN-Group: vendor X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: in vendor/nvi/2.2.0-05ed8b9: . catalog cl common ex files man regex vi X-SVN-Commit-Revision: 366308 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Oct 2020 04:26:48 -0000 Author: bapt Date: Thu Oct 1 04:26:46 2020 New Revision: 366308 URL: https://svnweb.freebsd.org/changeset/base/366308 Log: Tag import of nvi 2.2.0-05ed8b9 Added: vendor/nvi/2.2.0-05ed8b9/ - copied from r366306, vendor/nvi/dist/ Replaced: vendor/nvi/2.2.0-05ed8b9/CMakeLists.txt - copied unchanged from r366307, vendor/nvi/dist/CMakeLists.txt vendor/nvi/2.2.0-05ed8b9/catalog/dump.c - copied unchanged from r366307, vendor/nvi/dist/catalog/dump.c vendor/nvi/2.2.0-05ed8b9/cl/cl.h - copied unchanged from r366307, vendor/nvi/dist/cl/cl.h vendor/nvi/2.2.0-05ed8b9/cl/cl_read.c - copied unchanged from r366307, vendor/nvi/dist/cl/cl_read.c vendor/nvi/2.2.0-05ed8b9/cl/cl_term.c - copied unchanged from r366307, vendor/nvi/dist/cl/cl_term.c vendor/nvi/2.2.0-05ed8b9/common/common.h - copied unchanged from r366307, vendor/nvi/dist/common/common.h vendor/nvi/2.2.0-05ed8b9/common/cut.h - copied unchanged from r366307, vendor/nvi/dist/common/cut.h vendor/nvi/2.2.0-05ed8b9/common/exf.c - copied unchanged from r366307, vendor/nvi/dist/common/exf.c vendor/nvi/2.2.0-05ed8b9/common/key.c - copied unchanged from r366307, vendor/nvi/dist/common/key.c vendor/nvi/2.2.0-05ed8b9/common/log.c - copied unchanged from r366307, vendor/nvi/dist/common/log.c vendor/nvi/2.2.0-05ed8b9/common/main.c - copied unchanged from r366307, vendor/nvi/dist/common/main.c vendor/nvi/2.2.0-05ed8b9/common/mark.c - copied unchanged from r366307, vendor/nvi/dist/common/mark.c vendor/nvi/2.2.0-05ed8b9/common/mem.h - copied unchanged from r366307, vendor/nvi/dist/common/mem.h vendor/nvi/2.2.0-05ed8b9/common/msg.c - copied unchanged from r366307, vendor/nvi/dist/common/msg.c vendor/nvi/2.2.0-05ed8b9/common/options.c - copied unchanged from r366307, vendor/nvi/dist/common/options.c vendor/nvi/2.2.0-05ed8b9/common/put.c - copied unchanged from r366307, vendor/nvi/dist/common/put.c vendor/nvi/2.2.0-05ed8b9/common/recover.c - copied unchanged from r366307, vendor/nvi/dist/common/recover.c vendor/nvi/2.2.0-05ed8b9/common/util.c - copied unchanged from r366307, vendor/nvi/dist/common/util.c vendor/nvi/2.2.0-05ed8b9/ex/ex.c - copied unchanged from r366307, vendor/nvi/dist/ex/ex.c vendor/nvi/2.2.0-05ed8b9/ex/ex.h - copied unchanged from r366307, vendor/nvi/dist/ex/ex.h vendor/nvi/2.2.0-05ed8b9/ex/ex_argv.c - copied unchanged from r366307, vendor/nvi/dist/ex/ex_argv.c vendor/nvi/2.2.0-05ed8b9/ex/ex_bang.c - copied unchanged from r366307, vendor/nvi/dist/ex/ex_bang.c vendor/nvi/2.2.0-05ed8b9/ex/ex_cscope.c - copied unchanged from r366307, vendor/nvi/dist/ex/ex_cscope.c vendor/nvi/2.2.0-05ed8b9/ex/ex_filter.c - copied unchanged from r366307, vendor/nvi/dist/ex/ex_filter.c vendor/nvi/2.2.0-05ed8b9/ex/ex_global.c - copied unchanged from r366307, vendor/nvi/dist/ex/ex_global.c vendor/nvi/2.2.0-05ed8b9/ex/ex_script.c - copied unchanged from r366307, vendor/nvi/dist/ex/ex_script.c vendor/nvi/2.2.0-05ed8b9/ex/ex_shell.c - copied unchanged from r366307, vendor/nvi/dist/ex/ex_shell.c vendor/nvi/2.2.0-05ed8b9/ex/ex_subst.c - copied unchanged from r366307, vendor/nvi/dist/ex/ex_subst.c vendor/nvi/2.2.0-05ed8b9/files/config.h.in - copied unchanged from r366307, vendor/nvi/dist/files/config.h.in vendor/nvi/2.2.0-05ed8b9/files/pathnames.h.in - copied unchanged from r366307, vendor/nvi/dist/files/pathnames.h.in vendor/nvi/2.2.0-05ed8b9/man/vi.1 - copied unchanged from r366307, vendor/nvi/dist/man/vi.1 vendor/nvi/2.2.0-05ed8b9/regex/engine.c - copied unchanged from r366307, vendor/nvi/dist/regex/engine.c vendor/nvi/2.2.0-05ed8b9/regex/regexec.c - copied unchanged from r366307, vendor/nvi/dist/regex/regexec.c vendor/nvi/2.2.0-05ed8b9/vi/v_itxt.c - copied unchanged from r366307, vendor/nvi/dist/vi/v_itxt.c vendor/nvi/2.2.0-05ed8b9/vi/v_paragraph.c - copied unchanged from r366307, vendor/nvi/dist/vi/v_paragraph.c vendor/nvi/2.2.0-05ed8b9/vi/v_section.c - copied unchanged from r366307, vendor/nvi/dist/vi/v_section.c vendor/nvi/2.2.0-05ed8b9/vi/v_sentence.c - copied unchanged from r366307, vendor/nvi/dist/vi/v_sentence.c vendor/nvi/2.2.0-05ed8b9/vi/v_txt.c - copied unchanged from r366307, vendor/nvi/dist/vi/v_txt.c vendor/nvi/2.2.0-05ed8b9/vi/vi.c - copied unchanged from r366307, vendor/nvi/dist/vi/vi.c vendor/nvi/2.2.0-05ed8b9/vi/vs_line.c - copied unchanged from r366307, vendor/nvi/dist/vi/vs_line.c vendor/nvi/2.2.0-05ed8b9/vi/vs_msg.c - copied unchanged from r366307, vendor/nvi/dist/vi/vs_msg.c vendor/nvi/2.2.0-05ed8b9/vi/vs_refresh.c - copied unchanged from r366307, vendor/nvi/dist/vi/vs_refresh.c vendor/nvi/2.2.0-05ed8b9/vi/vs_relative.c - copied unchanged from r366307, vendor/nvi/dist/vi/vs_relative.c vendor/nvi/2.2.0-05ed8b9/vi/vs_smap.c - copied unchanged from r366307, vendor/nvi/dist/vi/vs_smap.c Copied: vendor/nvi/2.2.0-05ed8b9/CMakeLists.txt (from r366307, vendor/nvi/dist/CMakeLists.txt) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/nvi/2.2.0-05ed8b9/CMakeLists.txt Thu Oct 1 04:26:46 2020 (r366308, copy of r366307, vendor/nvi/dist/CMakeLists.txt) @@ -0,0 +1,210 @@ +cmake_minimum_required(VERSION 3.9) + +get_property(is_multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) +if(is_multi_config) + set(CMAKE_CONFIGURATION_TYPES Debug Release CACHE STRING + "Semicolon separated list of supported configuration types") + mark_as_advanced(CMAKE_CONFIGURATION_TYPES) +elseif(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_C_FLAGS) + message(WARNING "No CMAKE_BUILD_TYPE is selected") +endif() + +project(nvi2 C) + +include(CheckIncludeFiles) +include(CheckFunctionExists) +include(CheckStructHasMember) +include(CheckCSourceCompiles) + +mark_as_advanced(CMAKE_INSTALL_PREFIX) + +option(USE_WIDECHAR "Enable wide character support" ON) +option(USE_ICONV "Enable iconv support" ON) + +add_compile_options(-fcolor-diagnostics) +add_compile_options($<$:-Wall>) +add_compile_options($<$:-Wno-parentheses>) +add_compile_options($<$:-Wno-uninitialized>) +add_compile_options($<$:-Wmissing-prototypes>) +add_compile_options($<$:-Wsystem-headers>) +add_compile_options($<$:-Wuninitialized>) +add_compile_options($<$:-Wno-dangling-else>) +add_compile_options(-Wstack-protector -fstack-protector) +add_compile_options(-Wstrict-aliasing -fstrict-aliasing) + +include_directories(${CMAKE_CURRENT_BINARY_DIR}) + +set(MAIN_PROTOS + cl/extern.h common/extern.h ex/extern.h vi/extern.h + common/options_def.h ex/ex_def.h ex/version.h) + +set(CL_SRCS + cl/cl_funcs.c cl/cl_main.c cl/cl_read.c cl/cl_screen.c cl/cl_term.c) + +set(COMMON_SRCS + common/conv.c common/cut.c common/delete.c common/encoding.c common/exf.c + common/key.c common/line.c common/log.c common/main.c common/mark.c + common/msg.c common/options.c common/options_f.c common/put.c + common/recover.c common/screen.c common/search.c common/seq.c + common/util.c) + +set(EX_SRCS + ex/ex.c ex/ex_abbrev.c ex/ex_append.c ex/ex_args.c ex/ex_argv.c ex/ex_at.c + ex/ex_bang.c ex/ex_cd.c ex/ex_cmd.c ex/ex_cscope.c ex/ex_delete.c + ex/ex_display.c ex/ex_edit.c ex/ex_equal.c ex/ex_file.c ex/ex_filter.c + ex/ex_global.c ex/ex_init.c ex/ex_join.c ex/ex_map.c ex/ex_mark.c + ex/ex_mkexrc.c ex/ex_move.c ex/ex_open.c ex/ex_preserve.c ex/ex_print.c + ex/ex_put.c ex/ex_quit.c ex/ex_read.c ex/ex_screen.c ex/ex_script.c + ex/ex_set.c ex/ex_shell.c ex/ex_shift.c ex/ex_source.c ex/ex_stop.c + ex/ex_subst.c ex/ex_tag.c ex/ex_txt.c ex/ex_undo.c ex/ex_usage.c + ex/ex_util.c ex/ex_version.c ex/ex_visual.c ex/ex_write.c ex/ex_yank.c + ex/ex_z.c) + +set(VI_SRCS + vi/getc.c vi/v_at.c vi/v_ch.c vi/v_cmd.c vi/v_delete.c vi/v_ex.c + vi/v_increment.c vi/v_init.c vi/v_itxt.c vi/v_left.c vi/v_mark.c + vi/v_match.c vi/v_paragraph.c vi/v_put.c vi/v_redraw.c vi/v_replace.c + vi/v_right.c vi/v_screen.c vi/v_scroll.c vi/v_search.c vi/v_section.c + vi/v_sentence.c vi/v_status.c vi/v_txt.c vi/v_ulcase.c vi/v_undo.c + vi/v_util.c vi/v_word.c vi/v_xchar.c vi/v_yank.c vi/v_z.c vi/v_zexit.c + vi/vi.c vi/vs_line.c vi/vs_msg.c vi/vs_refresh.c vi/vs_relative.c + vi/vs_smap.c vi/vs_split.c) + +set(REGEX_SRCS + regex/regcomp.c regex/regerror.c regex/regexec.c regex/regfree.c) + +# commands to generate the public headers +set(extract_protos sed -n 's/^ \\* PUBLIC: \\\(.*\\\)/\\1/p') +set(extract_version sed -n + 's/^.*version \\\([^\)]*\)\\\).*/\#define VI_VERSION \\\"\\1\\\"/p') + +add_custom_command(OUTPUT cl/extern.h + COMMAND ${extract_protos} ${CL_SRCS} > cl/extern.h + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + DEPENDS ${CL_SRCS}) +add_custom_command(OUTPUT common/extern.h + COMMAND ${extract_protos} ${COMMON_SRCS} > common/extern.h + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + DEPENDS ${COMMON_SRCS}) +add_custom_command(OUTPUT ex/extern.h + COMMAND ${extract_protos} ${EX_SRCS} > ex/extern.h + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + DEPENDS ${EX_SRCS}) +add_custom_command(OUTPUT vi/extern.h + COMMAND ${extract_protos} ${VI_SRCS} > vi/extern.h + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + DEPENDS ${VI_SRCS}) +add_custom_command(OUTPUT common/options_def.h + COMMAND awk -f common/options.awk + common/options.c > common/options_def.h + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + DEPENDS common/options.c) +add_custom_command(OUTPUT ex/ex_def.h + COMMAND awk -f ex/ex.awk ex/ex_cmd.c > ex/ex_def.h + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + DEPENDS ex/ex_cmd.c) +add_custom_command(OUTPUT ex/version.h + COMMAND ${extract_version} README > ex/version.h + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + DEPENDS README) + +add_executable(nvi) +target_sources(nvi PRIVATE ${MAIN_PROTOS} ${CL_SRCS} ${COMMON_SRCS} + ${EX_SRCS} ${VI_SRCS}) +target_compile_definitions(nvi PRIVATE $<$:DEBUG> + $<$:COMLOG>) + +check_function_exists(openpty UTIL_IN_LIBC) +if(NOT UTIL_IN_LIBC) + find_library(UTIL_LIBRARY util) + target_link_libraries(nvi PRIVATE ${UTIL_LIBRARY}) +endif() + +check_function_exists(__b64_ntop RESOLV_IN_LIBC) +if(NOT RESOLV_IN_LIBC) + find_library(RESOLV_LIBRARY resolv) + target_link_libraries(nvi PRIVATE ${RESOLV_LIBRARY}) +endif() + +if(USE_WIDECHAR) + find_library(CURSES_LIBRARY NAMES ncursesw cursesw curses HINTS /usr/lib) + find_library(TERMINFO_LIBRARY NAMES tinfow terminfo HINTS /usr/lib) + + # link to the wchar_t awared BSD libregex.a + add_library(regex STATIC) + target_sources(regex PRIVATE ${REGEX_SRCS}) + target_include_directories(regex PUBLIC regex) + target_compile_definitions(regex PUBLIC __REGEX_PRIVATE) + target_link_libraries(nvi PRIVATE regex) +else() + find_library(CURSES_LIBRARY NAMES ncurses curses HINTS /usr/lib) + find_library(TERMINFO_LIBRARY NAMES tinfo terminfo HINTS /usr/lib) + target_compile_options(nvi PRIVATE -Wno-pointer-sign) +endif() + +target_link_libraries(nvi PRIVATE ${CURSES_LIBRARY} ${TERMINFO_LIBRARY}) + +if(USE_ICONV) + check_function_exists(iconv ICONV_IN_LIBC) + if(NOT ICONV_IN_LIBC) + find_path(ICONV_INCLUDE_DIR iconv.h) + find_library(ICONV_LIBRARY iconv) + endif() + + # detect the prototype of iconv(3) + set(CMAKE_C_FLAGS_BACKUP "${CMAKE_C_FLAGS}") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror") + set(CMAKE_REQUIRED_INCLUDES "${ICONV_INCLUDE_DIR}") + set(CMAKE_REQUIRED_LIBRARIES "${ICONV_LIBRARY}") + check_c_source_compiles(" + #include + int main() { + iconv_t conv = 0; + char* in = 0; + size_t ilen = 0; + char* out = 0; + size_t olen = 0; + iconv(conv, &in, &ilen, &out, &olen); + return 0; + } + " ICONV_TRADITIONAL) + set(CMAKE_REQUIRED_INCLUDES) + set(CMAKE_REQUIRED_LIBRARIES) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS_BACKUP}") + + target_include_directories(nvi PRIVATE ${ICONV_INCLUDE_DIR}) + target_link_libraries(nvi PRIVATE ${ICONV_LIBRARY}) +endif() + +check_function_exists(getprogname GETPROGNAME_IN_LIBC) +check_function_exists(strlcpy STRLCPY_IN_LIBC) +if(NOT GETPROGNAME_IN_LIBC OR NOT STRLCPY_IN_LIBC) + find_package(PkgConfig REQUIRED) + pkg_check_modules(LIBBSD libbsd-overlay) + add_definitions(${LIBBSD_CFLAGS}) + target_link_libraries(nvi PRIVATE ${LIBBSD_LIBRARIES}) +endif() + +check_function_exists(dbopen DBOPEN_IN_LIBC) +if(NOT DBOPEN_IN_LIBC) + target_link_libraries(nvi PRIVATE db1) +endif() + +check_include_files(libutil.h HAVE_LIBUTIL_H) +check_include_files(ncurses.h HAVE_NCURSES_H) +check_include_files(ncursesw/ncurses.h HAVE_NCURSESW_NCURSES_H) +check_include_files(pty.h HAVE_PTY_H) +check_include_files(term.h HAVE_TERM_H) +check_struct_has_member("struct dirent" d_namlen dirent.h HAVE_DIRENT_D_NAMLEN LANGUAGE C) + +configure_file(files/config.h.in config.h) + +set(vi_cv_path_preserve /var/tmp/vi.recover/) +if(APPLE) + set(vi_cv_path_msgcat /usr/local/share/vi/catalog/) +else() + set(vi_cv_path_msgcat /usr/share/vi/catalog/) +endif() + +configure_file(files/pathnames.h.in pathnames.h) +configure_file(files/recover.in recover @ONLY) Copied: vendor/nvi/2.2.0-05ed8b9/catalog/dump.c (from r366307, vendor/nvi/dist/catalog/dump.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/nvi/2.2.0-05ed8b9/catalog/dump.c Thu Oct 1 04:26:46 2020 (r366308, copy of r366307, vendor/nvi/dist/catalog/dump.c) @@ -0,0 +1,97 @@ +/*- + * Copyright (c) 1992, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include + +static void +parse(FILE *fp) +{ + int ch, s1, s2, s3; + +#define TESTD(s) do { \ + if ((s = getc(fp)) == EOF) \ + return; \ + if (!isdigit(s)) \ + continue; \ +} while (0) +#define TESTP do { \ + if ((ch = getc(fp)) == EOF) \ + return; \ + if (ch != '|') \ + continue; \ +} while (0) +#define MOVEC(t) do { \ + do { \ + if ((ch = getc(fp)) == EOF) \ + return; \ + } while (ch != (t)); \ +} while (0) + for (;;) { + MOVEC('"'); + TESTD(s1); + TESTD(s2); + TESTD(s3); + TESTP; + putchar('"'); + putchar(s1); + putchar(s2); + putchar(s3); + putchar('|'); + for (;;) { /* dump to end quote. */ + if ((ch = getc(fp)) == EOF) + return; + putchar(ch); + if (ch == '"') + break; + if (ch == '\\') { + if ((ch = getc(fp)) == EOF) + return; + putchar(ch); + } + } + putchar('\n'); + } +} + +int +main(int argc, char *argv[]) +{ + FILE *fp; + + for (; *argv != NULL; ++argv) { + if ((fp = fopen(*argv, "r")) == NULL) { + perror(*argv); + return (1); + } + parse(fp); + (void)fclose(fp); + } + return (0); +} Copied: vendor/nvi/2.2.0-05ed8b9/cl/cl.h (from r366307, vendor/nvi/dist/cl/cl.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/nvi/2.2.0-05ed8b9/cl/cl.h Thu Oct 1 04:26:46 2020 (r366308, copy of r366307, vendor/nvi/dist/cl/cl.h) @@ -0,0 +1,83 @@ +/*- + * Copyright (c) 1993, 1994 + * The Regents of the University of California. All rights reserved. + * Copyright (c) 1993, 1994, 1995, 1996 + * Keith Bostic. All rights reserved. + * + * See the LICENSE file for redistribution information. + */ + +#ifdef USE_WIDECHAR +#define _XOPEN_SOURCE_EXTENDED +#endif +#ifdef HAVE_NCURSESW_NCURSES_H +#include +#elif defined HAVE_NCURSES_H +#include +#else +#include +#endif + +typedef struct _cl_private { + char ibuf[256]; /* Input keys. */ + + size_t skip; /* Remaining keys. */ + + CONVWIN cw; /* Conversion buffer. */ + + int eof_count; /* EOF count. */ + + struct termios orig; /* Original terminal values. */ + struct termios ex_enter;/* Terminal values to enter ex. */ + struct termios vi_enter;/* Terminal values to enter vi. */ + + char *el; /* Clear to EOL terminal string. */ + char *cup; /* Cursor movement terminal string. */ + char *cuu1; /* Cursor up terminal string. */ + char *rmso, *smso; /* Inverse video terminal strings. */ + char *smcup, *rmcup; /* Terminal start/stop strings. */ + + char *oname; /* Original screen window name. */ + + SCR *focus; /* Screen that has the "focus". */ + + int killersig; /* Killer signal. */ +#define INDX_HUP 0 +#define INDX_INT 1 +#define INDX_TERM 2 +#define INDX_WINCH 3 +#define INDX_MAX 4 /* Original signal information. */ + struct sigaction oact[INDX_MAX]; + + enum { /* Tty group write mode. */ + TGW_UNKNOWN=0, TGW_SET, TGW_UNSET } tgw; + + enum { /* Terminal initialization strings. */ + TE_SENT=0, TI_SENT } ti_te; + +#define CL_IN_EX 0x0001 /* Currently running ex. */ +#define CL_LAYOUT 0x0002 /* Screen layout changed. */ +#define CL_RENAME 0x0004 /* X11 xterm icon/window renamed. */ +#define CL_RENAME_OK 0x0008 /* User wants the windows renamed. */ +#define CL_SCR_EX_INIT 0x0010 /* Ex screen initialized. */ +#define CL_SCR_VI_INIT 0x0020 /* Vi screen initialized. */ +#define CL_SIGHUP 0x0040 /* SIGHUP arrived. */ +#define CL_SIGINT 0x0080 /* SIGINT arrived. */ +#define CL_SIGTERM 0x0100 /* SIGTERM arrived. */ +#define CL_SIGWINCH 0x0200 /* SIGWINCH arrived. */ +#define CL_STDIN_TTY 0x0400 /* Talking to a terminal. */ + u_int32_t flags; +} CL_PRIVATE; + +#define CLP(sp) ((CL_PRIVATE *)((sp)->gp->cl_private)) +#define GCLP(gp) ((CL_PRIVATE *)gp->cl_private) +#define CLSP(sp) ((WINDOW *)((sp)->cl_private)) + +/* Return possibilities from the keyboard read routine. */ +typedef enum { INP_OK=0, INP_EOF, INP_ERR, INP_INTR, INP_TIMEOUT } input_t; + +/* The screen position relative to a specific window. */ +#define RCNO(sp, cno) (cno) +#define RLNO(sp, lno) (lno) + +#include "extern.h" Copied: vendor/nvi/2.2.0-05ed8b9/cl/cl_read.c (from r366307, vendor/nvi/dist/cl/cl_read.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/nvi/2.2.0-05ed8b9/cl/cl_read.c Thu Oct 1 04:26:46 2020 (r366308, copy of r366307, vendor/nvi/dist/cl/cl_read.c) @@ -0,0 +1,327 @@ +/*- + * Copyright (c) 1993, 1994 + * The Regents of the University of California. All rights reserved. + * Copyright (c) 1993, 1994, 1995, 1996 + * Keith Bostic. All rights reserved. + * + * See the LICENSE file for redistribution information. + */ + +#include "config.h" + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "../common/common.h" +#include "../ex/script.h" +#include "cl.h" + +/* Pollution by Solaris curses. */ +#undef columns +#undef lines + +static input_t cl_read(SCR *, + u_int32_t, char *, size_t, int *, struct timeval *); +static int cl_resize(SCR *, size_t, size_t); + +/* + * cl_event -- + * Return a single event. + * + * PUBLIC: int cl_event(SCR *, EVENT *, u_int32_t, int); + */ +int +cl_event(SCR *sp, EVENT *evp, u_int32_t flags, int ms) +{ + struct timeval t, *tp; + CL_PRIVATE *clp; + size_t lines, columns; + int changed, nr = 0; + CHAR_T *wp; + size_t wlen; + int rc; + + /* + * Queue signal based events. We never clear SIGHUP or SIGTERM events, + * so that we just keep returning them until the editor dies. + */ + clp = CLP(sp); +retest: if (LF_ISSET(EC_INTERRUPT) || F_ISSET(clp, CL_SIGINT)) { + if (F_ISSET(clp, CL_SIGINT)) { + F_CLR(clp, CL_SIGINT); + evp->e_event = E_INTERRUPT; + } else + evp->e_event = E_TIMEOUT; + return (0); + } + if (F_ISSET(clp, CL_SIGHUP | CL_SIGTERM | CL_SIGWINCH)) { + if (F_ISSET(clp, CL_SIGHUP)) { + evp->e_event = E_SIGHUP; + return (0); + } + if (F_ISSET(clp, CL_SIGTERM)) { + evp->e_event = E_SIGTERM; + return (0); + } + if (F_ISSET(clp, CL_SIGWINCH)) { + F_CLR(clp, CL_SIGWINCH); + if (cl_ssize(sp, 1, &lines, &columns, &changed)) + return (1); + if (changed) { + (void)cl_resize(sp, lines, columns); + evp->e_event = E_WRESIZE; + return (0); + } + /* No real change, ignore the signal. */ + } + } + + /* Set timer. */ + if (ms == 0) + tp = NULL; + else { + t.tv_sec = ms / 1000; + t.tv_usec = (ms % 1000) * 1000; + tp = &t; + } + + /* Read input characters. */ +read: + switch (cl_read(sp, LF_ISSET(EC_QUOTED | EC_RAW), + clp->ibuf + clp->skip, SIZE(clp->ibuf) - clp->skip, &nr, tp)) { + case INP_OK: + rc = INPUT2INT5(sp, clp->cw, clp->ibuf, nr + clp->skip, + wp, wlen); + evp->e_csp = wp; + evp->e_len = wlen; + evp->e_event = E_STRING; + if (rc < 0) { + int n = -rc; + memmove(clp->ibuf, clp->ibuf + nr + clp->skip - n, n); + clp->skip = n; + if (wlen == 0) + goto read; + } else if (rc == 0) + clp->skip = 0; + else + msgq(sp, M_ERR, "323|Invalid input. Truncated."); + break; + case INP_EOF: + evp->e_event = E_EOF; + break; + case INP_ERR: + evp->e_event = E_ERR; + break; + case INP_INTR: + goto retest; + case INP_TIMEOUT: + evp->e_event = E_TIMEOUT; + break; + default: + abort(); + } + return (0); +} + +/* + * cl_read -- + * Read characters from the input. + */ +static input_t +cl_read(SCR *sp, u_int32_t flags, char *bp, size_t blen, int *nrp, + struct timeval *tp) +{ + struct termios term1, term2; + CL_PRIVATE *clp; + GS *gp; + fd_set rdfd; + input_t rval; + int maxfd, nr, term_reset; + + gp = sp->gp; + clp = CLP(sp); + term_reset = 0; + + /* + * 1: A read from a file or a pipe. In this case, the reads + * never timeout regardless. This means that we can hang + * when trying to complete a map, but we're going to hang + * on the next read anyway. + */ + if (!F_ISSET(clp, CL_STDIN_TTY)) { + switch (nr = read(STDIN_FILENO, bp, blen)) { + case 0: + return (INP_EOF); + case -1: + goto err; + default: + *nrp = nr; + return (INP_OK); + } + /* NOTREACHED */ + } + + /* + * 2: A read with an associated timeout, e.g., trying to complete + * a map sequence. If input exists, we fall into #3. + */ + if (tp != NULL) { + FD_ZERO(&rdfd); + FD_SET(STDIN_FILENO, &rdfd); + switch (select(STDIN_FILENO + 1, &rdfd, NULL, NULL, tp)) { + case 0: + return (INP_TIMEOUT); + case -1: + goto err; + default: + break; + } + } + + /* + * The user can enter a key in the editor to quote a character. If we + * get here and the next key is supposed to be quoted, do what we can. + * Reset the tty so that the user can enter a ^C, ^Q, ^S. There's an + * obvious race here, when the key has already been entered, but there's + * nothing that we can do to fix that problem. + * + * The editor can ask for the next literal character even thought it's + * generally running in line-at-a-time mode. Do what we can. + */ + if (LF_ISSET(EC_QUOTED | EC_RAW) && !tcgetattr(STDIN_FILENO, &term1)) { + term_reset = 1; + if (LF_ISSET(EC_QUOTED)) { + term2 = term1; + term2.c_lflag &= ~ISIG; + term2.c_iflag &= ~(IXON | IXOFF); + (void)tcsetattr(STDIN_FILENO, + TCSASOFT | TCSADRAIN, &term2); + } else + (void)tcsetattr(STDIN_FILENO, + TCSASOFT | TCSADRAIN, &clp->vi_enter); + } + + /* + * 3: Wait for input. + * + * Select on the command input and scripting window file descriptors. + * It's ugly that we wait on scripting file descriptors here, but it's + * the only way to keep from locking out scripting windows. + */ + if (F_ISSET(gp, G_SCRWIN)) { +loop: FD_ZERO(&rdfd); + FD_SET(STDIN_FILENO, &rdfd); + maxfd = STDIN_FILENO; + if (F_ISSET(sp, SC_SCRIPT)) { + FD_SET(sp->script->sh_master, &rdfd); + if (sp->script->sh_master > maxfd) + maxfd = sp->script->sh_master; + } + switch (select(maxfd + 1, &rdfd, NULL, NULL, NULL)) { + case 0: + abort(); + case -1: + goto err; + default: + break; + } + if (!FD_ISSET(STDIN_FILENO, &rdfd)) { + if (sscr_input(sp)) + return (INP_ERR); + goto loop; + } + } + + /* + * 4: Read the input. + * + * !!! + * What's going on here is some scary stuff. Ex runs the terminal in + * canonical mode. So, the character terminating a line of + * input is returned in the buffer, but a trailing character is + * not similarly included. As ex uses 0 and ^ as autoindent + * commands, it has to see the trailing characters to determine + * the difference between the user entering "0ab" and "0ab". We + * leave an extra slot in the buffer, so that we can add a trailing + * character if the buffer isn't terminated by a . We + * lose if the buffer is too small for the line and exactly N characters + * are entered followed by an character. + */ +#define ONE_FOR_EOF 1 + switch (nr = read(STDIN_FILENO, bp, blen - ONE_FOR_EOF)) { + case 0: /* EOF. */ + /* + * ^D in canonical mode returns a read of 0, i.e. EOF. EOF is + * a valid command, but we don't want to loop forever because + * the terminal driver is returning EOF because the user has + * disconnected. The editor will almost certainly try to write + * something before this fires, which should kill us, but You + * Never Know. + */ + if (++clp->eof_count < 50) { + bp[0] = clp->orig.c_cc[VEOF]; + *nrp = 1; + rval = INP_OK; + + } else + rval = INP_EOF; + break; + case -1: /* Error or interrupt. */ +err: if (errno == EINTR) + rval = INP_INTR; + else { + rval = INP_ERR; + msgq(sp, M_SYSERR, "input"); + } + break; + default: /* Input characters. */ + if (F_ISSET(sp, SC_EX) && bp[nr - 1] != '\n') + bp[nr++] = clp->orig.c_cc[VEOF]; + *nrp = nr; + clp->eof_count = 0; + rval = INP_OK; + break; + } + + /* Restore the terminal state if it was modified. */ + if (term_reset) + (void)tcsetattr(STDIN_FILENO, TCSASOFT | TCSADRAIN, &term1); + return (rval); +} + +/* + * cl_resize -- + * Reset the options for a resize event. + */ +static int +cl_resize(SCR *sp, size_t lines, size_t columns) +{ + ARGS *argv[2], a, b; + CHAR_T b1[1024]; + + a.bp = b1; + b.bp = NULL; + a.len = b.len = 0; + argv[0] = &a; + argv[1] = &b; + + a.len = SPRINTF(b1, sizeof(b1), L("lines=%lu"), (u_long)lines); + if (opts_set(sp, argv, NULL)) + return (1); + a.len = SPRINTF(b1, sizeof(b1), L("columns=%lu"), (u_long)columns); + if (opts_set(sp, argv, NULL)) + return (1); + return (0); +} Copied: vendor/nvi/2.2.0-05ed8b9/cl/cl_term.c (from r366307, vendor/nvi/dist/cl/cl_term.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/nvi/2.2.0-05ed8b9/cl/cl_term.c Thu Oct 1 04:26:46 2020 (r366308, copy of r366307, vendor/nvi/dist/cl/cl_term.c) @@ -0,0 +1,492 @@ +/*- + * Copyright (c) 1993, 1994 + * The Regents of the University of California. All rights reserved. + * Copyright (c) 1993, 1994, 1995, 1996 + * Keith Bostic. All rights reserved. + * + * See the LICENSE file for redistribution information. + */ + +#include "config.h" + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#ifdef HAVE_TERM_H +#include +#endif +#include +#include + +#include "../common/common.h" +#include "cl.h" + +static int cl_pfmap(SCR *, seq_t, CHAR_T *, size_t, CHAR_T *, size_t); +static size_t atoz_or(const char *, size_t); + +/* + * XXX + * THIS REQUIRES THAT ALL SCREENS SHARE A TERMINAL TYPE. + */ +typedef struct _tklist { + char *ts; /* Key's termcap string. */ + char *output; /* Corresponding vi command. */ + char *name; /* Name. */ + u_char value; /* Special value (for lookup). */ +} TKLIST; +static TKLIST const c_tklist[] = { /* Command mappings. */ + {"kil1", "O", "insert line"}, + {"kdch1", "x", "delete character"}, + {"kcud1", "j", "cursor down"}, + {"kel", "D", "delete to eol"}, + {"kind", "\004", "scroll down"}, /* ^D */ + {"kll", "$", "go to eol"}, + {"kend", "$", "go to eol"}, + {"khome", "^", "go to sol"}, + {"kich1", "i", "insert at cursor"}, + {"kdl1", "dd", "delete line"}, + {"kcub1", "h", "cursor left"}, + {"knp", "\006", "page down"}, /* ^F */ + {"kpp", "\002", "page up"}, /* ^B */ + {"kri", "\025", "scroll up"}, /* ^U */ + {"ked", "dG", "delete to end of screen"}, + {"kcuf1", "l", "cursor right"}, + {"kcuu1", "k", "cursor up"}, + {NULL}, +}; +static TKLIST const m1_tklist[] = { /* Input mappings (lookup). */ + {NULL}, +}; +static TKLIST const m2_tklist[] = { /* Input mappings (set or delete). */ + {"kcud1", "\033ja", "cursor down"}, /* ^[ja */ + {"kcub1", "\033ha", "cursor left"}, /* ^[ha */ + {"kcuu1", "\033ka", "cursor up"}, /* ^[ka */ + {"kcuf1", "\033la", "cursor right"}, /* ^[la */ + {NULL}, +}; + +/* + * cl_term_init -- + * Initialize the special keys defined by the termcap/terminfo entry. + * + * PUBLIC: int cl_term_init(SCR *); + */ +int +cl_term_init(SCR *sp) +{ + KEYLIST *kp; + SEQ *qp; + TKLIST const *tkp; + char *t; + CHAR_T name[60]; + CHAR_T output[5]; + CHAR_T ts[20]; + CHAR_T *wp; + size_t wlen; + + /* Command mappings. */ + for (tkp = c_tklist; tkp->name != NULL; ++tkp) { + if ((t = tigetstr(tkp->ts)) == NULL || t == (char *)-1) + continue; + CHAR2INT(sp, tkp->name, strlen(tkp->name), wp, wlen); + MEMCPY(name, wp, wlen); + CHAR2INT(sp, t, strlen(t), wp, wlen); + MEMCPY(ts, wp, wlen); + CHAR2INT(sp, tkp->output, strlen(tkp->output), wp, wlen); + MEMCPY(output, wp, wlen); + if (seq_set(sp, name, strlen(tkp->name), ts, strlen(t), + output, strlen(tkp->output), SEQ_COMMAND, + SEQ_NOOVERWRITE | SEQ_SCREEN)) + return (1); + } + + /* Input mappings needing to be looked up. */ + for (tkp = m1_tklist; tkp->name != NULL; ++tkp) { + if ((t = tigetstr(tkp->ts)) == NULL || t == (char *)-1) + continue; + for (kp = keylist;; ++kp) + if (kp->value == tkp->value) + break; + if (kp == NULL) + continue; + CHAR2INT(sp, tkp->name, strlen(tkp->name), wp, wlen); + MEMCPY(name, wp, wlen); + CHAR2INT(sp, t, strlen(t), wp, wlen); + MEMCPY(ts, wp, wlen); + output[0] = (UCHAR_T)kp->ch; + if (seq_set(sp, name, strlen(tkp->name), ts, strlen(t), + output, 1, SEQ_INPUT, SEQ_NOOVERWRITE | SEQ_SCREEN)) + return (1); + } + + /* Input mappings that are already set or are text deletions. */ + for (tkp = m2_tklist; tkp->name != NULL; ++tkp) { + if ((t = tigetstr(tkp->ts)) == NULL || t == (char *)-1) + continue; + /* + * !!! + * Some terminals' keys send single + * characters. This is okay in command mapping, but not okay + * in input mapping. That combination is the only one we'll + * ever see, hopefully, so kluge it here for now. + */ + if (!strcmp(t, "\b")) + continue; + if (tkp->output == NULL) { + CHAR2INT(sp, tkp->name, strlen(tkp->name), wp, wlen); + MEMCPY(name, wp, wlen); + CHAR2INT(sp, t, strlen(t), wp, wlen); + MEMCPY(ts, wp, wlen); + if (seq_set(sp, name, strlen(tkp->name), + ts, strlen(t), NULL, 0, + SEQ_INPUT, SEQ_NOOVERWRITE | SEQ_SCREEN)) + return (1); + } else { + CHAR2INT(sp, tkp->name, strlen(tkp->name), wp, wlen); + MEMCPY(name, wp, wlen); + CHAR2INT(sp, t, strlen(t), wp, wlen); + MEMCPY(ts, wp, wlen); + CHAR2INT(sp, tkp->output, strlen(tkp->output), wp, wlen); + MEMCPY(output, wp, wlen); + if (seq_set(sp, name, strlen(tkp->name), + ts, strlen(t), output, strlen(tkp->output), + SEQ_INPUT, SEQ_NOOVERWRITE | SEQ_SCREEN)) + return (1); + } + } + + /* + * Rework any function key mappings that were set before the + * screen was initialized. + */ + SLIST_FOREACH(qp, sp->gp->seqq, q) + if (F_ISSET(qp, SEQ_FUNCMAP)) + (void)cl_pfmap(sp, qp->stype, + qp->input, qp->ilen, qp->output, qp->olen); + return (0); +} + +/* + * cl_term_end -- + * End the special keys defined by the termcap/terminfo entry. + * + * PUBLIC: int cl_term_end(GS *); + */ +int +cl_term_end(GS *gp) +{ + SEQ *qp, *nqp, *pre_qp = NULL; + + /* Delete screen specific mappings. */ + SLIST_FOREACH_SAFE(qp, gp->seqq, q, nqp) + if (F_ISSET(qp, SEQ_SCREEN)) { + if (qp == SLIST_FIRST(gp->seqq)) + SLIST_REMOVE_HEAD(gp->seqq, q); + else + SLIST_REMOVE_AFTER(pre_qp, q); + (void)seq_free(qp); + } else + pre_qp = qp; + return (0); +} + +/* + * cl_fmap -- + * Map a function key. + * + * PUBLIC: int cl_fmap(SCR *, seq_t, CHAR_T *, size_t, CHAR_T *, size_t); + */ +int +cl_fmap(SCR *sp, seq_t stype, CHAR_T *from, size_t flen, CHAR_T *to, size_t tlen) +{ + /* Ignore until the screen is running, do the real work then. */ + if (F_ISSET(sp, SC_VI) && !F_ISSET(sp, SC_SCR_VI)) + return (0); + if (F_ISSET(sp, SC_EX) && !F_ISSET(sp, SC_SCR_EX)) + return (0); + + return (cl_pfmap(sp, stype, from, flen, to, tlen)); +} + +/* + * cl_pfmap -- + * Map a function key (private version). + */ +static int +cl_pfmap(SCR *sp, seq_t stype, CHAR_T *from, size_t flen, CHAR_T *to, size_t tlen) +{ + size_t nlen; + char *p; + char name[64]; + CHAR_T keyname[64]; + CHAR_T ts[20]; + CHAR_T *wp; + size_t wlen; + + (void)snprintf(name, sizeof(name), "kf%d", + (int)STRTOL(from+1,NULL,10)); + if ((p = tigetstr(name)) == NULL || + p == (char *)-1 || strlen(p) == 0) + p = NULL; + if (p == NULL) { + msgq_wstr(sp, M_ERR, from, "233|This terminal has no %s key"); + return (1); + } + + nlen = SPRINTF(keyname, + SIZE(keyname), L("function key %d"), + (int)STRTOL(from+1,NULL,10)); + CHAR2INT(sp, p, strlen(p), wp, wlen); + MEMCPY(ts, wp, wlen); + return (seq_set(sp, keyname, nlen, + ts, strlen(p), to, tlen, stype, SEQ_NOOVERWRITE | SEQ_SCREEN)); +} + +/* + * cl_optchange -- + * Curses screen specific "option changed" routine. + * + * PUBLIC: int cl_optchange(SCR *, int, char *, u_long *); + */ +int +cl_optchange(SCR *sp, int opt, char *str, u_long *valp) +{ + CL_PRIVATE *clp; + + clp = CLP(sp); + + switch (opt) { + case O_TERM: *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Oct 1 04:46:29 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D6DC93F215F; Thu, 1 Oct 2020 04:46:29 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C20vT5gbzz4FJC; Thu, 1 Oct 2020 04:46:29 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 87C2FB421; Thu, 1 Oct 2020 04:46:29 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0914kTTH083457; Thu, 1 Oct 2020 04:46:29 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0914kNHY083428; Thu, 1 Oct 2020 04:46:23 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <202010010446.0914kNHY083428@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Thu, 1 Oct 2020 04:46:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366309 - in head: contrib/nvi contrib/nvi/catalog contrib/nvi/cl contrib/nvi/common contrib/nvi/ex contrib/nvi/files contrib/nvi/regex contrib/nvi/vi usr.bin/vi usr.bin/vi/catalog X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: in head: contrib/nvi contrib/nvi/catalog contrib/nvi/cl contrib/nvi/common contrib/nvi/ex contrib/nvi/files contrib/nvi/regex contrib/nvi/vi usr.bin/vi usr.bin/vi/catalog X-SVN-Commit-Revision: 366309 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Oct 2020 04:46:29 -0000 Author: bapt Date: Thu Oct 1 04:46:23 2020 New Revision: 366309 URL: https://svnweb.freebsd.org/changeset/base/366309 Log: Update nvi to 2.2.0-05ed8b9 This version incorporates many fixes in particular a fix for vi -w Another approach was proposed to merge those fixes (see review), I find it easier to track changes if we keep importing snapshot on regular basis PR: 241985 Reported by: fernape Differential Revision: https://reviews.freebsd.org/D26158 Modified: head/contrib/nvi/CMakeLists.txt head/contrib/nvi/catalog/dump.c head/contrib/nvi/cl/cl.h head/contrib/nvi/cl/cl_read.c head/contrib/nvi/cl/cl_term.c head/contrib/nvi/common/common.h head/contrib/nvi/common/cut.h head/contrib/nvi/common/exf.c head/contrib/nvi/common/key.c head/contrib/nvi/common/log.c head/contrib/nvi/common/main.c head/contrib/nvi/common/mark.c head/contrib/nvi/common/mem.h head/contrib/nvi/common/msg.c head/contrib/nvi/common/options.c head/contrib/nvi/common/put.c head/contrib/nvi/common/recover.c head/contrib/nvi/common/util.c head/contrib/nvi/ex/ex.c head/contrib/nvi/ex/ex.h head/contrib/nvi/ex/ex_argv.c head/contrib/nvi/ex/ex_bang.c head/contrib/nvi/ex/ex_cscope.c head/contrib/nvi/ex/ex_filter.c head/contrib/nvi/ex/ex_global.c head/contrib/nvi/ex/ex_script.c head/contrib/nvi/ex/ex_shell.c head/contrib/nvi/ex/ex_subst.c head/contrib/nvi/files/config.h.in head/contrib/nvi/files/pathnames.h.in head/contrib/nvi/regex/engine.c head/contrib/nvi/regex/regexec.c head/contrib/nvi/vi/v_itxt.c head/contrib/nvi/vi/v_paragraph.c head/contrib/nvi/vi/v_section.c head/contrib/nvi/vi/v_sentence.c head/contrib/nvi/vi/v_txt.c head/contrib/nvi/vi/vi.c head/contrib/nvi/vi/vs_line.c head/contrib/nvi/vi/vs_msg.c head/contrib/nvi/vi/vs_refresh.c head/contrib/nvi/vi/vs_relative.c head/contrib/nvi/vi/vs_smap.c head/usr.bin/vi/catalog/Makefile head/usr.bin/vi/pathnames.h Directory Properties: head/contrib/nvi/ (props changed) Modified: head/contrib/nvi/CMakeLists.txt ============================================================================== --- head/contrib/nvi/CMakeLists.txt Thu Oct 1 04:26:46 2020 (r366308) +++ head/contrib/nvi/CMakeLists.txt Thu Oct 1 04:46:23 2020 (r366309) @@ -13,6 +13,7 @@ project(nvi2 C) include(CheckIncludeFiles) include(CheckFunctionExists) +include(CheckStructHasMember) include(CheckCSourceCompiles) mark_as_advanced(CMAKE_INSTALL_PREFIX) @@ -127,6 +128,7 @@ endif() if(USE_WIDECHAR) find_library(CURSES_LIBRARY NAMES ncursesw cursesw curses HINTS /usr/lib) + find_library(TERMINFO_LIBRARY NAMES tinfow terminfo HINTS /usr/lib) # link to the wchar_t awared BSD libregex.a add_library(regex STATIC) @@ -136,13 +138,14 @@ if(USE_WIDECHAR) target_link_libraries(nvi PRIVATE regex) else() find_library(CURSES_LIBRARY NAMES ncurses curses HINTS /usr/lib) + find_library(TERMINFO_LIBRARY NAMES tinfo terminfo HINTS /usr/lib) target_compile_options(nvi PRIVATE -Wno-pointer-sign) endif() -target_link_libraries(nvi PRIVATE ${CURSES_LIBRARY}) +target_link_libraries(nvi PRIVATE ${CURSES_LIBRARY} ${TERMINFO_LIBRARY}) if(USE_ICONV) - check_function_exists(__iconv ICONV_IN_LIBC) + check_function_exists(iconv ICONV_IN_LIBC) if(NOT ICONV_IN_LIBC) find_path(ICONV_INCLUDE_DIR iconv.h) find_library(ICONV_LIBRARY iconv) @@ -173,9 +176,26 @@ if(USE_ICONV) target_link_libraries(nvi PRIVATE ${ICONV_LIBRARY}) endif() +check_function_exists(getprogname GETPROGNAME_IN_LIBC) +check_function_exists(strlcpy STRLCPY_IN_LIBC) +if(NOT GETPROGNAME_IN_LIBC OR NOT STRLCPY_IN_LIBC) + find_package(PkgConfig REQUIRED) + pkg_check_modules(LIBBSD libbsd-overlay) + add_definitions(${LIBBSD_CFLAGS}) + target_link_libraries(nvi PRIVATE ${LIBBSD_LIBRARIES}) +endif() + +check_function_exists(dbopen DBOPEN_IN_LIBC) +if(NOT DBOPEN_IN_LIBC) + target_link_libraries(nvi PRIVATE db1) +endif() + check_include_files(libutil.h HAVE_LIBUTIL_H) check_include_files(ncurses.h HAVE_NCURSES_H) +check_include_files(ncursesw/ncurses.h HAVE_NCURSESW_NCURSES_H) +check_include_files(pty.h HAVE_PTY_H) check_include_files(term.h HAVE_TERM_H) +check_struct_has_member("struct dirent" d_namlen dirent.h HAVE_DIRENT_D_NAMLEN LANGUAGE C) configure_file(files/config.h.in config.h) Modified: head/contrib/nvi/catalog/dump.c ============================================================================== --- head/contrib/nvi/catalog/dump.c Thu Oct 1 04:26:46 2020 (r366308) +++ head/contrib/nvi/catalog/dump.c Thu Oct 1 04:46:23 2020 (r366309) @@ -36,24 +36,24 @@ parse(FILE *fp) { int ch, s1, s2, s3; -#define TESTD(s) { \ +#define TESTD(s) do { \ if ((s = getc(fp)) == EOF) \ return; \ if (!isdigit(s)) \ continue; \ -} -#define TESTP { \ +} while (0) +#define TESTP do { \ if ((ch = getc(fp)) == EOF) \ return; \ if (ch != '|') \ continue; \ -} -#define MOVEC(t) { \ +} while (0) +#define MOVEC(t) do { \ do { \ if ((ch = getc(fp)) == EOF) \ return; \ } while (ch != (t)); \ -} +} while (0) for (;;) { MOVEC('"'); TESTD(s1); Modified: head/contrib/nvi/cl/cl.h ============================================================================== --- head/contrib/nvi/cl/cl.h Thu Oct 1 04:26:46 2020 (r366308) +++ head/contrib/nvi/cl/cl.h Thu Oct 1 04:46:23 2020 (r366309) @@ -10,7 +10,9 @@ #ifdef USE_WIDECHAR #define _XOPEN_SOURCE_EXTENDED #endif -#ifdef HAVE_NCURSES_H +#ifdef HAVE_NCURSESW_NCURSES_H +#include +#elif defined HAVE_NCURSES_H #include #else #include Modified: head/contrib/nvi/cl/cl_read.c ============================================================================== --- head/contrib/nvi/cl/cl_read.c Thu Oct 1 04:26:46 2020 (r366308) +++ head/contrib/nvi/cl/cl_read.c Thu Oct 1 04:46:23 2020 (r366309) @@ -20,6 +20,7 @@ #include #include #include +#include #include #include Modified: head/contrib/nvi/cl/cl_term.c ============================================================================== --- head/contrib/nvi/cl/cl_term.c Thu Oct 1 04:26:46 2020 (r366308) +++ head/contrib/nvi/cl/cl_term.c Thu Oct 1 04:46:23 2020 (r366309) @@ -424,16 +424,18 @@ cl_ssize(SCR *sp, int sigwinch, size_t *rowp, size_t * if (row == 0 || col == 0) { if ((p = getenv("TERM")) == NULL) goto noterm; - if (row == 0) + if (row == 0) { if ((rval = tigetnum("lines")) < 0) msgq(sp, M_SYSERR, "tigetnum: lines"); else row = rval; - if (col == 0) + } + if (col == 0) { if ((rval = tigetnum("cols")) < 0) msgq(sp, M_SYSERR, "tigetnum: cols"); else col = rval; + } } /* If nothing else, well, it's probably a VT100. */ Modified: head/contrib/nvi/common/common.h ============================================================================== --- head/contrib/nvi/common/common.h Thu Oct 1 04:26:46 2020 (r366308) +++ head/contrib/nvi/common/common.h Thu Oct 1 04:46:23 2020 (r366309) @@ -7,7 +7,15 @@ * See the LICENSE file for redistribution information. */ -#include /* Only include db1. */ +#ifndef TCSASOFT +#define TCSASOFT 0 +#endif + +#ifdef __linux__ +#include "/usr/include/db1/db.h" /* Only include db1. */ +#else +#include "/usr/include/db.h" /* Only include db1. */ +#endif #include /* May refer to the bundled regex. */ /* Modified: head/contrib/nvi/common/cut.h ============================================================================== --- head/contrib/nvi/common/cut.h Thu Oct 1 04:26:46 2020 (r366308) +++ head/contrib/nvi/common/cut.h Thu Oct 1 04:46:23 2020 (r366309) @@ -63,13 +63,13 @@ struct _text { /* Text: a linked list of lines. */ * Get named buffer 'name'. * Translate upper-case buffer names to lower-case buffer names. */ -#define CBNAME(sp, cbp, nch) { \ +#define CBNAME(sp, cbp, nch) do { \ CHAR_T L__name; \ L__name = isupper(nch) ? tolower(nch) : (nch); \ SLIST_FOREACH(cbp, sp->gp->cutq, q) \ if (cbp->name == L__name) \ break; \ -} +} while (0) /* Flags to the cut() routine. */ #define CUT_LINEMODE 0x01 /* Cut in line mode. */ Modified: head/contrib/nvi/common/exf.c ============================================================================== --- head/contrib/nvi/common/exf.c Thu Oct 1 04:26:46 2020 (r366308) +++ head/contrib/nvi/common/exf.c Thu Oct 1 04:46:23 2020 (r366309) @@ -199,7 +199,7 @@ file_init(SCR *sp, FREF *frp, char *rcv_name, int flag if (!LF_ISSET(FS_OPENERR)) F_SET(frp, FR_NEWFILE); - ep->mtim = sb.st_mtimespec; + ep->mtim = sb.st_mtim; } else { /* * XXX @@ -218,7 +218,7 @@ file_init(SCR *sp, FREF *frp, char *rcv_name, int flag ep->mdev = sb.st_dev; ep->minode = sb.st_ino; - ep->mtim = sb.st_mtimespec; + ep->mtim = sb.st_mtim; if (!S_ISREG(sb.st_mode)) msgq_str(sp, M_ERR, oname, @@ -796,7 +796,7 @@ file_write(SCR *sp, MARK *fm, MARK *tm, char *name, in if (noname && !LF_ISSET(FS_FORCE | FS_APPEND) && ((F_ISSET(ep, F_DEVSET) && (sb.st_dev != ep->mdev || sb.st_ino != ep->minode)) || - timespeccmp(&sb.st_mtimespec, &ep->mtim, !=))) { + timespeccmp(&sb.st_mtim, &ep->mtim, !=))) { msgq_str(sp, M_ERR, name, LF_ISSET(FS_POSSIBLE) ? "250|%s: file modified more recently than this copy; use ! to override" : "251|%s: file modified more recently than this copy"); @@ -887,7 +887,7 @@ success_open: * we re-init the time. That way the user can clean up the disk * and rewrite without having to force it. */ - if (noname) + if (noname) { if (stat(name, &sb)) timepoint_system(&ep->mtim); else { @@ -895,8 +895,9 @@ success_open: ep->mdev = sb.st_dev; ep->minode = sb.st_ino; - ep->mtim = sb.st_mtimespec; + ep->mtim = sb.st_mtim; } + } /* * If the write failed, complain loudly. ex_writefp() has already @@ -925,11 +926,12 @@ success_open: */ if (LF_ISSET(FS_ALL) && !LF_ISSET(FS_APPEND)) { F_CLR(ep, F_MODIFIED); - if (F_ISSET(frp, FR_TMPFILE)) + if (F_ISSET(frp, FR_TMPFILE)) { if (noname) F_SET(frp, FR_TMPEXIT); else F_CLR(frp, FR_TMPEXIT); + } } p = msg_print(sp, name, &nf); @@ -1290,7 +1292,7 @@ file_m1(SCR *sp, int force, int flags) * unless force is also set. Otherwise, we fail unless forced or * there's another open screen on this file. */ - if (F_ISSET(ep, F_MODIFIED)) + if (F_ISSET(ep, F_MODIFIED)) { if (O_ISSET(sp, O_AUTOWRITE)) { if (!force && file_aw(sp, flags)) return (1); @@ -1300,6 +1302,7 @@ file_m1(SCR *sp, int force, int flags) "263|File modified since last complete write; write or use :edit! to override"); return (1); } + } return (file_m3(sp, force)); } Modified: head/contrib/nvi/common/key.c ============================================================================== --- head/contrib/nvi/common/key.c Thu Oct 1 04:26:46 2020 (r366308) +++ head/contrib/nvi/common/key.c Thu Oct 1 04:46:23 2020 (r366309) @@ -424,12 +424,12 @@ v_event_append(SCR *sp, EVENT *argp) } /* Remove events from the queue. */ -#define QREM(len) { \ +#define QREM(len) do { \ if ((gp->i_cnt -= len) == 0) \ gp->i_next = 0; \ else \ gp->i_next += len; \ -} +} while (0) /* * v_event_get -- Modified: head/contrib/nvi/common/log.c ============================================================================== --- head/contrib/nvi/common/log.c Thu Oct 1 04:26:46 2020 (r366308) +++ head/contrib/nvi/common/log.c Thu Oct 1 04:46:23 2020 (r366309) @@ -69,10 +69,10 @@ static int apply_with(int (*)(SCR *, recno_t, CHAR_T * SCR *, recno_t, u_char *, size_t); /* Try and restart the log on failure, i.e. if we run out of memory. */ -#define LOG_ERR { \ +#define LOG_ERR do { \ log_err(sp, __FILE__, __LINE__); \ return (1); \ -} +} while (0) /* offset of CHAR_T string in log needs to be aligned on some systems * because it is passed to db_set as a string Modified: head/contrib/nvi/common/main.c ============================================================================== --- head/contrib/nvi/common/main.c Thu Oct 1 04:26:46 2020 (r366308) +++ head/contrib/nvi/common/main.c Thu Oct 1 04:46:23 2020 (r366309) @@ -48,8 +48,8 @@ editor(GS *gp, int argc, char *argv[]) size_t len; u_int flags; int ch, flagchk, lflag, secure, startup, readonly, rval, silent; - char *tag_f, *wsizearg, path[256]; - CHAR_T *w; + char *tag_f, *wsizearg; + CHAR_T *w, path[256]; size_t wlen; /* Initialize the busy routine, if not defined by the screen. */ @@ -242,9 +242,9 @@ editor(GS *gp, int argc, char *argv[]) } if (wsizearg != NULL) { ARGS *av[2], a, b; - (void)snprintf(path, sizeof(path), "window=%s", wsizearg); + (void)SPRINTF(path, SIZE(path), L("window=%s"), wsizearg); a.bp = (CHAR_T *)path; - a.len = strlen(path); + a.len = SIZE(path); b.bp = NULL; b.len = 0; av[0] = &a; @@ -533,7 +533,7 @@ v_obsolete(char *argv[]) argv[0][1] = 'c'; (void)strlcpy(argv[0] + 2, p + 1, len); } - } else if (argv[0][0] == '-') + } else if (argv[0][0] == '-') { if (argv[0][1] == '\0') { argv[0] = strdup("-s"); if (argv[0] == NULL) { @@ -545,6 +545,7 @@ nomem: warn(NULL); argv[0][1] == 't' || argv[0][1] == 'w') && argv[0][2] == '\0') ++argv; + } return (0); } Modified: head/contrib/nvi/common/mark.c ============================================================================== --- head/contrib/nvi/common/mark.c Thu Oct 1 04:26:46 2020 (r366308) +++ head/contrib/nvi/common/mark.c Thu Oct 1 04:46:23 2020 (r366309) @@ -216,12 +216,13 @@ mark_insdel(SCR *sp, lnop_t op, recno_t lno) abort(); case LINE_DELETE: SLIST_FOREACH(lmp, sp->ep->marks, q) - if (lmp->lno >= lno) + if (lmp->lno >= lno) { if (lmp->lno == lno) { F_SET(lmp, MARK_DELETED); (void)log_mark(sp, lmp); } else --lmp->lno; + } break; case LINE_INSERT: /* Modified: head/contrib/nvi/common/mem.h ============================================================================== --- head/contrib/nvi/common/mem.h Thu Oct 1 04:26:46 2020 (r366308) +++ head/contrib/nvi/common/mem.h Thu Oct 1 04:46:23 2020 (r366309) @@ -17,7 +17,7 @@ /* Increase the size of a malloc'd buffer. Two versions, one that * returns, one that jumps to an error label. */ -#define BINC_GOTO(sp, type, lp, llen, nlen) { \ +#define BINC_GOTO(sp, type, lp, llen, nlen) do { \ CHECK_TYPE(type *, lp) \ void *L__bincp; \ if ((nlen) > llen) { \ @@ -29,12 +29,12 @@ */ \ lp = L__bincp; \ } \ -} +} while (0) #define BINC_GOTOC(sp, lp, llen, nlen) \ BINC_GOTO(sp, char, lp, llen, nlen) #define BINC_GOTOW(sp, lp, llen, nlen) \ BINC_GOTO(sp, CHAR_T, lp, llen, (nlen) * sizeof(CHAR_T)) -#define BINC_RET(sp, type, lp, llen, nlen) { \ +#define BINC_RET(sp, type, lp, llen, nlen) do { \ CHECK_TYPE(type *, lp) \ void *L__bincp; \ if ((nlen) > llen) { \ @@ -46,7 +46,7 @@ */ \ lp = L__bincp; \ } \ -} +} while (0) #define BINC_RETC(sp, lp, llen, nlen) \ BINC_RET(sp, char, lp, llen, nlen) #define BINC_RETW(sp, lp, llen, nlen) \ @@ -57,7 +57,7 @@ * from a malloc'd buffer otherwise. Two versions, one that returns, one * that jumps to an error label. */ -#define GET_SPACE_GOTO(sp, type, bp, blen, nlen) { \ +#define GET_SPACE_GOTO(sp, type, bp, blen, nlen) do { \ CHECK_TYPE(type *, bp) \ GS *L__gp = (sp) == NULL ? NULL : (sp)->gp; \ if (L__gp == NULL || F_ISSET(L__gp, G_TMP_INUSE)) { \ @@ -70,12 +70,12 @@ blen = L__gp->tmp_blen; \ F_SET(L__gp, G_TMP_INUSE); \ } \ -} +} while (0) #define GET_SPACE_GOTOC(sp, bp, blen, nlen) \ GET_SPACE_GOTO(sp, char, bp, blen, nlen) #define GET_SPACE_GOTOW(sp, bp, blen, nlen) \ GET_SPACE_GOTO(sp, CHAR_T, bp, blen, (nlen) * sizeof(CHAR_T)) -#define GET_SPACE_RET(sp, type, bp, blen, nlen) { \ +#define GET_SPACE_RET(sp, type, bp, blen, nlen) do { \ CHECK_TYPE(type *, bp) \ GS *L__gp = (sp) == NULL ? NULL : (sp)->gp; \ if (L__gp == NULL || F_ISSET(L__gp, G_TMP_INUSE)) { \ @@ -88,7 +88,7 @@ blen = L__gp->tmp_blen; \ F_SET(L__gp, G_TMP_INUSE); \ } \ -} +} while (0) #define GET_SPACE_RETC(sp, bp, blen, nlen) \ GET_SPACE_RET(sp, char, bp, blen, nlen) #define GET_SPACE_RETW(sp, bp, blen, nlen) \ @@ -98,7 +98,7 @@ * Add space to a GET_SPACE returned buffer. Two versions, one that * returns, one that jumps to an error label. */ -#define ADD_SPACE_GOTO(sp, type, bp, blen, nlen) { \ +#define ADD_SPACE_GOTO(sp, type, bp, blen, nlen) do { \ CHECK_TYPE(type *, bp) \ GS *L__gp = (sp) == NULL ? NULL : (sp)->gp; \ if (L__gp == NULL || bp == (type *)L__gp->tmp_bp) { \ @@ -109,12 +109,12 @@ F_SET(L__gp, G_TMP_INUSE); \ } else \ BINC_GOTO(sp, type, bp, blen, nlen); \ -} +} while (0) #define ADD_SPACE_GOTOC(sp, bp, blen, nlen) \ ADD_SPACE_GOTO(sp, char, bp, blen, nlen) #define ADD_SPACE_GOTOW(sp, bp, blen, nlen) \ ADD_SPACE_GOTO(sp, CHAR_T, bp, blen, (nlen) * sizeof(CHAR_T)) -#define ADD_SPACE_RET(sp, type, bp, blen, nlen) { \ +#define ADD_SPACE_RET(sp, type, bp, blen, nlen) do { \ CHECK_TYPE(type *, bp) \ GS *L__gp = (sp) == NULL ? NULL : (sp)->gp; \ if (L__gp == NULL || bp == (type *)L__gp->tmp_bp) { \ @@ -125,70 +125,70 @@ F_SET(L__gp, G_TMP_INUSE); \ } else \ BINC_RET(sp, type, bp, blen, nlen); \ -} +} while (0) #define ADD_SPACE_RETC(sp, bp, blen, nlen) \ ADD_SPACE_RET(sp, char, bp, blen, nlen) #define ADD_SPACE_RETW(sp, bp, blen, nlen) \ ADD_SPACE_RET(sp, CHAR_T, bp, blen, (nlen) * sizeof(CHAR_T)) /* Free a GET_SPACE returned buffer. */ -#define FREE_SPACE(sp, bp, blen) { \ +#define FREE_SPACE(sp, bp, blen) do { \ GS *L__gp = (sp) == NULL ? NULL : (sp)->gp; \ if (L__gp != NULL && bp == L__gp->tmp_bp) \ F_CLR(L__gp, G_TMP_INUSE); \ else \ free(bp); \ -} -#define FREE_SPACEW(sp, bp, blen) { \ +} while (0) +#define FREE_SPACEW(sp, bp, blen) do { \ CHECK_TYPE(CHAR_T *, bp) \ FREE_SPACE(sp, (char *)bp, blen); \ -} +} while (0) /* * Malloc a buffer, casting the return pointer. Various versions. */ -#define CALLOC(sp, p, nmemb, size) { \ +#define CALLOC(sp, p, nmemb, size) do { \ if ((p = calloc(nmemb, size)) == NULL) \ msgq(sp, M_SYSERR, NULL); \ -} -#define CALLOC_GOTO(sp, p, nmemb, size) { \ +} while (0) +#define CALLOC_GOTO(sp, p, nmemb, size) do { \ if ((p = calloc(nmemb, size)) == NULL) \ goto alloc_err; \ -} -#define CALLOC_RET(sp, p, nmemb, size) { \ +} while (0) +#define CALLOC_RET(sp, p, nmemb, size) do { \ if ((p = calloc(nmemb, size)) == NULL) { \ msgq(sp, M_SYSERR, NULL); \ return (1); \ } \ -} +} while (0) -#define MALLOC(sp, p, size) { \ +#define MALLOC(sp, p, size) do { \ if ((p = malloc(size)) == NULL) \ msgq(sp, M_SYSERR, NULL); \ -} -#define MALLOC_GOTO(sp, p, size) { \ +} while (0) +#define MALLOC_GOTO(sp, p, size) do { \ if ((p = malloc(size)) == NULL) \ goto alloc_err; \ -} -#define MALLOC_RET(sp, p, size) { \ +} while (0) +#define MALLOC_RET(sp, p, size) do { \ if ((p = malloc(size)) == NULL) { \ msgq(sp, M_SYSERR, NULL); \ return (1); \ } \ -} +} while (0) /* * Resize a buffer, free any already held memory if we can't get more. * FreeBSD's reallocf(3) does the same thing, but it's not portable yet. */ -#define REALLOC(sp, p, cast, size) { \ +#define REALLOC(sp, p, cast, size) do { \ cast newp; \ if ((newp = realloc(p, size)) == NULL) { \ free(p); \ msgq(sp, M_SYSERR, NULL); \ } \ p = newp; \ -} +} while (0) /* * p2roundup -- Modified: head/contrib/nvi/common/msg.c ============================================================================== --- head/contrib/nvi/common/msg.c Thu Oct 1 04:26:46 2020 (r366308) +++ head/contrib/nvi/common/msg.c Thu Oct 1 04:46:23 2020 (r366309) @@ -731,7 +731,11 @@ msg_open(SCR *sp, char *file) * corrupt catalog file. Errno == 0 is not rare; add * EFTYPE, which is seen on FreeBSD, for a good measure. */ +#ifdef EFTYPE if (errno == 0 || errno == EFTYPE) +#else + if (errno == 0) +#endif msgq_str(sp, M_ERR, p, "030|The file %s is not a message catalog"); else Modified: head/contrib/nvi/common/options.c ============================================================================== --- head/contrib/nvi/common/options.c Thu Oct 1 04:26:46 2020 (r366308) +++ head/contrib/nvi/common/options.c Thu Oct 1 04:46:23 2020 (r366309) @@ -20,6 +20,7 @@ #include #include #include +#include #include #include "common.h" @@ -312,7 +313,7 @@ opts_init(SCR *sp, int *oargs) argv[1] = &b; /* Set numeric and string default values. */ -#define OI(indx, str) { \ +#define OI(indx, str) do { \ a.len = STRLEN(str); \ if ((CHAR_T*)str != b2) /* GCC puts strings in text-space. */ \ (void)MEMCPY(b2, str, a.len+1); \ @@ -320,7 +321,7 @@ opts_init(SCR *sp, int *oargs) optindx = indx; \ goto err; \ } \ -} +} while (0) /* * Indirect global options to global space. Specifically, set up * terminal, lines, columns first, they're used by other options. @@ -366,7 +367,7 @@ opts_init(SCR *sp, int *oargs) OI(O_PARAGRAPHS, L("paragraphs=IPLPPPQPP LIpplpipbp")); (void)SPRINTF(b2, SIZE(b2), L("path=%s"), ""); OI(O_PATH, b2); - (void)SPRINTF(b2, SIZE(b2), L("recdir=%s"), _PATH_PRESERVE); + (void)SPRINTF(b2, SIZE(b2), L("recdir=%s"), NVI_PATH_PRESERVE); OI(O_RECDIR, b2); OI(O_SECTIONS, L("sections=NHSHH HUnhsh")); (void)SPRINTF(b2, SIZE(b2), @@ -573,13 +574,14 @@ opts_set(SCR *sp, ARGS *argv[], char *usage) * functions can be expensive. */ isset = !turnoff; - if (!F_ISSET(op, OPT_ALWAYS)) + if (!F_ISSET(op, OPT_ALWAYS)) { if (isset) { if (O_ISSET(sp, offset)) break; } else if (!O_ISSET(sp, offset)) break; + } /* Report to subsystems. */ if ((op->func != NULL && @@ -945,6 +947,7 @@ static int opts_print(SCR *sp, OPTLIST const *op) { int curlen, offset; + const char *p; curlen = 0; offset = op - optlist; @@ -958,8 +961,13 @@ opts_print(SCR *sp, OPTLIST const *op) curlen += ex_printf(sp, WS"=%ld", op->name, O_VAL(sp, offset)); break; case OPT_STR: - curlen += ex_printf(sp, WS"=\"%s\"", op->name, - O_STR(sp, offset) == NULL ? "" : O_STR(sp, offset)); + curlen += ex_printf(sp, WS"=\"", op->name); + p = O_STR(sp, offset); + /* Keep correct count for unprintable character sequences */ + if (p != NULL) + for (; *p != '\0'; ++p) + curlen += ex_puts(sp, unctrl(*p)); + curlen += ex_puts(sp, "\""); break; } return (curlen); Modified: head/contrib/nvi/common/put.c ============================================================================== --- head/contrib/nvi/common/put.c Thu Oct 1 04:26:46 2020 (r366308) +++ head/contrib/nvi/common/put.c Thu Oct 1 04:46:23 2020 (r366309) @@ -39,7 +39,7 @@ put(SCR *sp, CB *cbp, CHAR_T *namep, MARK *cp, MARK *r CHAR_T *bp, *t; CHAR_T *p; - if (cbp == NULL) + if (cbp == NULL) { if (namep == NULL) { cbp = sp->gp->dcbp; if (cbp == NULL) { @@ -56,6 +56,7 @@ put(SCR *sp, CB *cbp, CHAR_T *namep, MARK *cp, MARK *r return (1); } } + } tp = TAILQ_FIRST(cbp->textq); /* Modified: head/contrib/nvi/common/recover.c ============================================================================== --- head/contrib/nvi/common/recover.c Thu Oct 1 04:26:46 2020 (r366308) +++ head/contrib/nvi/common/recover.c Thu Oct 1 04:46:23 2020 (r366309) @@ -421,7 +421,7 @@ rcv_mailfile(SCR *sp, int issync, char *cp_path) getprogname(), " -r ", qt); free(qt); free(host); - if (buf == NULL) { + if (len == -1) { msgq(sp, M_SYSERR, NULL); goto err; } @@ -701,7 +701,7 @@ rcv_read(SCR *sp, FREF *frp) /* If we've found more than one, take the most recent. */ (void)fstat(fileno(fp), &sb); if (recp == NULL || - timespeccmp(&rec_mtim, &sb.st_mtimespec, <)) { + timespeccmp(&rec_mtim, &sb.st_mtim, <)) { p = recp; t = pathp; recp = recpath; @@ -710,7 +710,7 @@ rcv_read(SCR *sp, FREF *frp) free(p); free(t); } - rec_mtim = sb.st_mtimespec; + rec_mtim = sb.st_mtim; if (sv_fd != -1) (void)close(sv_fd); sv_fd = dup(fileno(fp)); @@ -813,8 +813,7 @@ rcv_email(SCR *sp, char *fname) { char *buf; - (void)asprintf(&buf, _PATH_SENDMAIL " -odb -t < %s", fname); - if (buf == NULL) { + if (asprintf(&buf, _PATH_SENDMAIL " -odb -t < %s", fname) == -1) { msgq_str(sp, M_ERR, strerror(errno), "071|not sending email: %s"); return; Modified: head/contrib/nvi/common/util.c ============================================================================== --- head/contrib/nvi/common/util.c Thu Oct 1 04:26:46 2020 (r366308) +++ head/contrib/nvi/common/util.c Thu Oct 1 04:46:23 2020 (r366309) @@ -111,8 +111,9 @@ join(char *path1, char *path2) if (path1[0] == '\0' || path2[0] == '/') return strdup(path2); - (void)asprintf(&p, path1[strlen(path1)-1] == '/' ? - "%s%s" : "%s/%s", path1, path2); + if (asprintf(&p, path1[strlen(path1)-1] == '/' ? + "%s%s" : "%s/%s", path1, path2) == -1) + return NULL; return p; } @@ -140,8 +141,13 @@ expanduser(char *str) continue; if (t == p) { /* ~ */ +#ifdef __GLIBC__ + extern char *secure_getenv(const char *); + if ((h = secure_getenv("HOME")) == NULL) { +#else if (issetugid() != 0 || (h = getenv("HOME")) == NULL) { +#endif if (((h = getlogin()) != NULL && (pwd = getpwnam(h)) != NULL) || (pwd = getpwuid(getuid())) != NULL) Modified: head/contrib/nvi/ex/ex.c ============================================================================== --- head/contrib/nvi/ex/ex.c Thu Oct 1 04:26:46 2020 (r366308) +++ head/contrib/nvi/ex/ex.c Thu Oct 1 04:46:23 2020 (r366309) @@ -811,13 +811,14 @@ skip_srch: if (ecp->cmd == &cmds[C_VISUAL_EX] && F_ISS * this isn't a particularly complex trap, and if backslashes were * legal in set commands, this would have to be much more complicated. */ - if (ecp->cmd == &cmds[C_SET]) + if (ecp->cmd == &cmds[C_SET]) { for (p = ecp->cp, len = ecp->clen; len > 0; --len, ++p) if (IS_ESCAPE(sp, ecp, *p) && len > 1) { --len; ++p; } else if (*p == '\\') *p = CH_LITERAL; + } /* * Set the default addresses. It's an error to specify an address for @@ -1254,7 +1255,7 @@ addr_verify: ex_badaddr(sp, ecp->cmd, A_ZERO, NUM_OK); goto err; } - } else if (!db_exist(sp, ecp->addr2.lno)) + } else if (!db_exist(sp, ecp->addr2.lno)) { if (FL_ISSET(ecp->iflags, E_C_COUNT)) { if (db_last(sp, &lno)) goto err; @@ -1263,6 +1264,7 @@ addr_verify: ex_badaddr(sp, NULL, A_EOF, NUM_OK); goto err; } + } /* FALLTHROUGH */ case 1: if (ecp->addr1.lno == 0) { @@ -2117,7 +2119,7 @@ ex_load(SCR *sp) /* If it's a global/v command, fix up the last line. */ if (FL_ISSET(ecp->agv_flags, - AGV_GLOBAL | AGV_V) && ecp->range_lno != OOBLNO) + AGV_GLOBAL | AGV_V) && ecp->range_lno != OOBLNO) { if (db_exist(sp, ecp->range_lno)) sp->lno = ecp->range_lno; else { @@ -2126,6 +2128,7 @@ ex_load(SCR *sp) if (sp->lno == 0) sp->lno = 1; } + } free(ecp->o_cp); } Modified: head/contrib/nvi/ex/ex.h ============================================================================== --- head/contrib/nvi/ex/ex.h Thu Oct 1 04:26:46 2020 (r366308) +++ head/contrib/nvi/ex/ex.h Thu Oct 1 04:46:23 2020 (r366309) @@ -55,12 +55,12 @@ extern EXCMDLIST const cmds[]; /* Table of ex command * at any time, and most of them won't work well if a file hasn't yet been read * in. Historic vi generally took the easy way out and dropped core. */ -#define NEEDFILE(sp, cmdp) { \ +#define NEEDFILE(sp, cmdp) do { \ if ((sp)->ep == NULL) { \ ex_wemsg(sp, (cmdp)->cmd->name, EXM_NOFILEYET); \ return (1); \ } \ -} +} while (0) /* Range structures for global and @ commands. */ typedef struct _range RANGE; @@ -102,12 +102,12 @@ struct _excmd { u_int8_t agv_flags; /* Clear the structure before each ex command. */ -#define CLEAR_EX_CMD(cmdp) { \ +#define CLEAR_EX_CMD(cmdp) do { \ u_int32_t L__f = F_ISSET(cmdp, E_PRESERVE); \ memset(&((cmdp)->buffer), 0, ((char *)&(cmdp)->flags - \ (char *)&((cmdp)->buffer)) + sizeof((cmdp)->flags)); \ F_SET(cmdp, L__f); \ -} +} while (0) CHAR_T buffer; /* Command: named buffer. */ recno_t lineno; /* Command: line number. */ Modified: head/contrib/nvi/ex/ex_argv.c ============================================================================== --- head/contrib/nvi/ex/ex_argv.c Thu Oct 1 04:26:46 2020 (r366308) +++ head/contrib/nvi/ex/ex_argv.c Thu Oct 1 04:46:23 2020 (r366309) @@ -611,9 +611,17 @@ argv_flt_path(SCR *sp, EXCMD *excp, CHAR_T *path, size if (nlen == 0) { if (dp->d_name[0] == '.') continue; +#ifdef HAVE_DIRENT_D_NAMLEN len = dp->d_namlen; +#else + len = strlen(dp->d_name); +#endif } else { +#ifdef HAVE_DIRENT_D_NAMLEN len = dp->d_namlen; +#else + len = strlen(dp->d_name); +#endif if (len < nlen || memcmp(dp->d_name, name, nlen)) continue; } Modified: head/contrib/nvi/ex/ex_bang.c ============================================================================== --- head/contrib/nvi/ex/ex_bang.c Thu Oct 1 04:26:46 2020 (r366308) +++ head/contrib/nvi/ex/ex_bang.c Thu Oct 1 04:46:23 2020 (r366309) @@ -96,7 +96,7 @@ ex_bang(SCR *sp, EXCMD *cmdp) */ if (cmdp->addrcnt == 0) { msg = NULL; - if (sp->ep != NULL && F_ISSET(sp->ep, F_MODIFIED)) + if (sp->ep != NULL && F_ISSET(sp->ep, F_MODIFIED)) { if (O_ISSET(sp, O_AUTOWRITE)) { if (file_aw(sp, FS_ALL)) return (0); @@ -105,6 +105,7 @@ ex_bang(SCR *sp, EXCMD *cmdp) msg = msg_cat(sp, "303|File modified since last write.", NULL); + } /* If we're still in a vi screen, move out explicitly. */ INT2CHAR(sp, ap->bp, ap->len+1, np, nlen); Modified: head/contrib/nvi/ex/ex_cscope.c ============================================================================== --- head/contrib/nvi/ex/ex_cscope.c Thu Oct 1 04:26:46 2020 (r366308) +++ head/contrib/nvi/ex/ex_cscope.c Thu Oct 1 04:46:23 2020 (r366309) @@ -261,7 +261,7 @@ cscope_add(SCR *sp, EXCMD *cmdp, CHAR_T *dname) csc->dname = csc->buf; csc->dlen = len; memcpy(csc->dname, np, len); - csc->mtim = sb.st_mtimespec; + csc->mtim = sb.st_mtim; /* Get the search paths for the cscope. */ if (get_paths(sp, csc)) @@ -411,7 +411,8 @@ err: if (to_cs[0] != -1) free(dn); goto nomem; } - (void)asprintf(&cmd, CSCOPE_CMD_FMT, dn, dbn); + if (asprintf(&cmd, CSCOPE_CMD_FMT, dn, dbn) == -1) + cmd = NULL; free(dbn); free(dn); if (cmd == NULL) { @@ -812,7 +813,7 @@ csc_file(SCR *sp, CSC *csc, char *name, char **dirp, s *dirp = *pp; *dlenp = strlen(*pp); *isolderp = timespeccmp( - &sb.st_mtimespec, &csc->mtim, <); + &sb.st_mtim, &csc->mtim, <); return; } free(buf); @@ -843,7 +844,7 @@ csc_help(SCR *sp, char *cmd) { CC const *ccp; - if (cmd != NULL && *cmd != '\0') + if (cmd != NULL && *cmd != '\0') { if ((ccp = lookup_ccmd(cmd)) == NULL) { ex_printf(sp, "%s doesn't match any cscope command\n", cmd); @@ -854,6 +855,7 @@ csc_help(SCR *sp, char *cmd) ex_printf(sp, " Usage: %s\n", ccp->usage_msg); return (0); } + } ex_printf(sp, "cscope commands:\n"); for (ccp = cscope_cmds; ccp->name != NULL; ++ccp) Modified: head/contrib/nvi/ex/ex_filter.c ============================================================================== --- head/contrib/nvi/ex/ex_filter.c Thu Oct 1 04:26:46 2020 (r366308) +++ head/contrib/nvi/ex/ex_filter.c Thu Oct 1 04:46:23 2020 (r366309) @@ -174,11 +174,12 @@ err: if (input[0] != -1) if (ex_readfp(sp, "filter", ofp, fm, &nread, 1)) rval = 1; sp->rptlines[L_ADDED] += nread; - if (ftype == FILTER_READ) + if (ftype == FILTER_READ) { if (fm->lno == 0) rp->lno = nread; else rp->lno += nread; + } goto uwait; } Modified: head/contrib/nvi/ex/ex_global.c ============================================================================== --- head/contrib/nvi/ex/ex_global.c Thu Oct 1 04:26:46 2020 (r366308) +++ head/contrib/nvi/ex/ex_global.c Thu Oct 1 04:46:23 2020 (r366309) @@ -112,11 +112,12 @@ usage: ex_emsg(sp, cmdp->cmd->usage, EXM_USAGE); *t = '\0'; break; } - if (p[0] == '\\') + if (p[0] == '\\') { if (p[1] == delim) ++p; else if (p[1] == '\\') *t++ = *p++; + } *t++ = *p++; } Modified: head/contrib/nvi/ex/ex_script.c ============================================================================== --- head/contrib/nvi/ex/ex_script.c Thu Oct 1 04:26:46 2020 (r366308) +++ head/contrib/nvi/ex/ex_script.c Thu Oct 1 04:46:23 2020 (r366309) @@ -32,6 +32,8 @@ #include #ifdef HAVE_LIBUTIL_H #include +#elif defined HAVE_PTY_H +#include #else #include #endif Modified: head/contrib/nvi/ex/ex_shell.c ============================================================================== --- head/contrib/nvi/ex/ex_shell.c Thu Oct 1 04:26:46 2020 (r366308) +++ head/contrib/nvi/ex/ex_shell.c Thu Oct 1 04:46:23 2020 (r366309) @@ -48,8 +48,7 @@ ex_shell(SCR *sp, EXCMD *cmdp) * XXX * Assumes all shells use -i. */ - (void)asprintf(&buf, "%s -i", O_STR(sp, O_SHELL)); - if (buf == NULL) { + if (asprintf(&buf, "%s -i", O_STR(sp, O_SHELL)) == -1) { msgq(sp, M_SYSERR, NULL); return (1); } Modified: head/contrib/nvi/ex/ex_subst.c ============================================================================== --- head/contrib/nvi/ex/ex_subst.c Thu Oct 1 04:26:46 2020 (r366308) +++ head/contrib/nvi/ex/ex_subst.c Thu Oct 1 04:46:23 2020 (r366309) @@ -115,11 +115,12 @@ subagain: return (ex_subagain(sp, cmdp)); *t = '\0'; break; } - if (p[0] == '\\') + if (p[0] == '\\') { if (p[1] == delim) ++p; else if (p[1] == '\\') *t++ = *p++; + } *t++ = *p++; } @@ -296,7 +297,7 @@ ex_subtilde(SCR *sp, EXCMD *cmdp) * when the replacement is done. Don't change it unless you're *damned* * confident. */ -#define NEEDNEWLINE(sp) { \ +#define NEEDNEWLINE(sp) do { \ if (sp->newl_len == sp->newl_cnt) { \ sp->newl_len += 25; \ REALLOC(sp, sp->newl, size_t *, \ @@ -306,9 +307,9 @@ ex_subtilde(SCR *sp, EXCMD *cmdp) return (1); \ } \ } \ -} +} while (0) -#define BUILD(sp, l, len) { \ +#define BUILD(sp, l, len) do { \ if (lbclen + (len) > lblen) { \ lblen = p2roundup(MAX(lbclen + (len), 256)); \ REALLOC(sp, lb, CHAR_T *, lblen * sizeof(CHAR_T)); \ @@ -319,9 +320,9 @@ ex_subtilde(SCR *sp, EXCMD *cmdp) } \ MEMCPY(lb + lbclen, l, len); \ lbclen += len; \ -} +} while (0) -#define NEEDSP(sp, len, pnt) { \ +#define NEEDSP(sp, len, pnt) do { \ if (lbclen + (len) > lblen) { \ lblen = p2roundup(MAX(lbclen + (len), 256)); \ REALLOC(sp, lb, CHAR_T *, lblen * sizeof(CHAR_T)); \ @@ -331,7 +332,7 @@ ex_subtilde(SCR *sp, EXCMD *cmdp) } \ pnt = lb + lbclen; \ } \ -} +} while (0) static int s(SCR *sp, EXCMD *cmdp, CHAR_T *s, regex_t *re, u_int flags) @@ -584,7 +585,7 @@ nextmatch: match[0].rm_so = 0; empty_ok = 1; if (len == 0) goto endmatch; - BUILD(sp, s + offset, 1) + BUILD(sp, s + offset, 1); ++offset; --len; goto nextmatch; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Oct 1 08:46:22 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 322E14217E5; Thu, 1 Oct 2020 08:46:22 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C26DG0Xvkz3ZTW; Thu, 1 Oct 2020 08:46:22 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EA07EE169; Thu, 1 Oct 2020 08:46:21 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0918kLMG037401; Thu, 1 Oct 2020 08:46:21 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0918kLgE037400; Thu, 1 Oct 2020 08:46:21 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202010010846.0918kLgE037400@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 1 Oct 2020 08:46:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366310 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 366310 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Oct 2020 08:46:22 -0000 Author: mjg Date: Thu Oct 1 08:46:21 2020 New Revision: 366310 URL: https://svnweb.freebsd.org/changeset/base/366310 Log: cache: properly report ENOTDIR on foo/bar lookups where foo is a file Reported by: fernape Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Thu Oct 1 04:46:23 2020 (r366309) +++ head/sys/kern/vfs_cache.c Thu Oct 1 08:46:21 2020 (r366310) @@ -4045,6 +4045,15 @@ static int __noinline cache_fplookup_failed_vexec(struct cache_fpl *fpl, int error) { + /* + * Hack: they may be looking up foo/bar, where foo is a + * regular file. In such a case we need to turn ENOTDIR, + * but we may happen to get here with a different error. + */ + if (fpl->dvp->v_type != VDIR) { + error = ENOTDIR; + } + switch (error) { case EAGAIN: /* From owner-svn-src-all@freebsd.org Thu Oct 1 08:57:36 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D093642231E; Thu, 1 Oct 2020 08:57:36 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C26TD5D6rz3bgf; Thu, 1 Oct 2020 08:57:36 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9665EE23A; Thu, 1 Oct 2020 08:57:36 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0918vaHt046174; Thu, 1 Oct 2020 08:57:36 GMT (envelope-from netchild@FreeBSD.org) Received: (from netchild@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0918vaob046173; Thu, 1 Oct 2020 08:57:36 GMT (envelope-from netchild@FreeBSD.org) Message-Id: <202010010857.0918vaob046173@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: netchild set sender to netchild@FreeBSD.org using -f From: Alexander Leidinger Date: Thu, 1 Oct 2020 08:57:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366311 - head/usr.sbin/crashinfo X-SVN-Group: head X-SVN-Commit-Author: netchild X-SVN-Commit-Paths: head/usr.sbin/crashinfo X-SVN-Commit-Revision: 366311 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Oct 2020 08:57:36 -0000 Author: netchild Date: Thu Oct 1 08:57:36 2020 New Revision: 366311 URL: https://svnweb.freebsd.org/changeset/base/366311 Log: Remove nfsstat. Running nfsstat in crashinfo will give the stats of the running kernel instead of the stats of the crashed kernel. The current version uses sysctls to query the stats and does not work at all (anymore) on crash dumps. Modified: head/usr.sbin/crashinfo/crashinfo.sh Modified: head/usr.sbin/crashinfo/crashinfo.sh ============================================================================== --- head/usr.sbin/crashinfo/crashinfo.sh Thu Oct 1 08:46:21 2020 (r366310) +++ head/usr.sbin/crashinfo/crashinfo.sh Thu Oct 1 08:57:36 2020 (r366311) @@ -314,12 +314,6 @@ echo fi echo "------------------------------------------------------------------------" -echo "nfsstat" -echo -nfsstat -M $VMCORE -N $KERNEL -echo - -echo "------------------------------------------------------------------------" echo "netstat -s" echo netstat -M $VMCORE -N $KERNEL -s From owner-svn-src-all@freebsd.org Thu Oct 1 09:50:09 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A177E422BFE; Thu, 1 Oct 2020 09:50:09 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C27ds3lqbz3dcB; Thu, 1 Oct 2020 09:50:09 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 64201EF09; Thu, 1 Oct 2020 09:50:09 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0919o9u0076886; Thu, 1 Oct 2020 09:50:09 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0919o9kU076885; Thu, 1 Oct 2020 09:50:09 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <202010010950.0919o9kU076885@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Thu, 1 Oct 2020 09:50:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366312 - head/sys/dev/extres/syscon X-SVN-Group: head X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: head/sys/dev/extres/syscon X-SVN-Commit-Revision: 366312 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Oct 2020 09:50:09 -0000 Author: mmel Date: Thu Oct 1 09:50:08 2020 New Revision: 366312 URL: https://svnweb.freebsd.org/changeset/base/366312 Log: Fix the inverted condition in mtx_asserts. Mutex should be owned in affected functions. Reborted by: emaste MFC after: 4 weeks MFC with: r366161 Modified: head/sys/dev/extres/syscon/syscon_generic.c Modified: head/sys/dev/extres/syscon/syscon_generic.c ============================================================================== --- head/sys/dev/extres/syscon/syscon_generic.c Thu Oct 1 08:57:36 2020 (r366311) +++ head/sys/dev/extres/syscon/syscon_generic.c Thu Oct 1 09:50:08 2020 (r366312) @@ -95,7 +95,7 @@ syscon_generic_unlocked_read_4(struct syscon *syscon, uint32_t val; sc = device_get_softc(syscon->pdev); - SYSCON_ASSERT_UNLOCKED(sc); + SYSCON_ASSERT_LOCKED(sc); val = bus_read_4(sc->mem_res, offset); return (val); } @@ -106,7 +106,7 @@ syscon_generic_unlocked_write_4(struct syscon *syscon, struct syscon_generic_softc *sc; sc = device_get_softc(syscon->pdev); - SYSCON_ASSERT_UNLOCKED(sc); + SYSCON_ASSERT_LOCKED(sc); bus_write_4(sc->mem_res, offset, val); return (0); } @@ -119,7 +119,7 @@ syscon_generic_unlocked_modify_4(struct syscon *syscon uint32_t val; sc = device_get_softc(syscon->pdev); - SYSCON_ASSERT_UNLOCKED(sc); + SYSCON_ASSERT_LOCKED(sc); val = bus_read_4(sc->mem_res, offset); val &= ~clear_bits; val |= set_bits; From owner-svn-src-all@freebsd.org Thu Oct 1 10:01:28 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 984B44236D5; Thu, 1 Oct 2020 10:01:28 +0000 (UTC) (envelope-from melounmichal@gmail.com) Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) (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 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C27tv4hwJz3fNp; Thu, 1 Oct 2020 10:01:27 +0000 (UTC) (envelope-from melounmichal@gmail.com) Received: by mail-wm1-x343.google.com with SMTP id e2so2373040wme.1; Thu, 01 Oct 2020 03:01:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:reply-to:subject:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=4/VClVdHXCkb8TDlzy15Xh41FDbhFIXgtVIJ7QR6HGs=; b=JDGhPmtGcmV6RMgJFj7dzj6gYVw/x0RN2HzzPpXLX9HvgjH9vhiIZbbcfanSTpJ4Oz dT3pwxdogOJEPFhzh/NLIKnzecqHYljiNEIHIUmGqr139IC1B0VCpJyQYOMTD/0hXKOt YXzjpnN50qUk3fprPdje8J/SByWNSkGonPNnZzkL1EQfqqmAdiehlPIPkWJJIMQFgids tIlclw36+CHL6tr1eJpPYflTQiqOL/Gsjh+KdxpKgzv8qDF8UwpGxLJWz8KmG5Yl8jQP rxyELYVB14AI8KM+jsLin0u1T3gl7YitWCO2DTFS+ohVGdKzxRarZONjgknbG3I7jwqc kxtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:reply-to:subject:to:cc:references :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=4/VClVdHXCkb8TDlzy15Xh41FDbhFIXgtVIJ7QR6HGs=; b=l7RYRrmGDhzdatsiGH+bSE56Lh6iYc9L/tpmMVsgxgvCxdH1WMH0cT/vRRWyRmyQt8 CE8r20cvE9Y3bCbT83nKXx6zKmvZRcO5X1un6IhB6tgAK64Ijwhe7q202pkFinzbXQ+Q ABA2MQ7XM8qgxz4Ies68Oeds3OaXNGDWLI3zbGVEo2HgkqTIy97rjRx3enh8VuzVYIKU wXr9YB99mo4MKHyVttSwhPb3rUPrZwj6uZItRNgrPXdu7cXESmZRzAsNFTluu3iGMCxp P+3BceAOcw7sEIiA2GOLW5GFBaeQbrDCGqw8/A68uBJDTAvl95R0iDQQqLANTnaQvaoH hSeg== X-Gm-Message-State: AOAM533yuWJysfiIeesmNxiYYXx7D/tQXX7Tgn6KH3gAcSQA0yokBjGz sEYFMSYDHOLZIbKvx9MjU9pcHHNmC7I= X-Google-Smtp-Source: ABdhPJzd0tlsPvxmgYdg9OcgI9MeRuZl/7OThhb7MA54lq8xv2jkTU9DnsIbLbMWo/NH6xf2yQAzEg== X-Received: by 2002:a1c:750d:: with SMTP id o13mr8044705wmc.54.1601546485896; Thu, 01 Oct 2020 03:01:25 -0700 (PDT) Received: from [88.208.79.100] (halouny.humusoft.cz. [88.208.79.100]) by smtp.gmail.com with ESMTPSA id g8sm7499169wmd.12.2020.10.01.03.01.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 01 Oct 2020 03:01:24 -0700 (PDT) Sender: Michal Meloun From: Michal Meloun X-Google-Original-From: Michal Meloun Reply-To: mmel@freebsd.org Subject: Re: svn commit: r366161 - head/sys/dev/extres/syscon To: Ed Maste Cc: src-committers , svn-src-all , svn-src-head References: <202009251644.08PGi2Qg041379@repo.freebsd.org> Message-ID: <964e3ef8-9ee8-bfae-f638-a6c38a60fe02@freebsd.org> Date: Thu, 1 Oct 2020 12:01:26 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.2.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4C27tv4hwJz3fNp X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=JDGhPmtG; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of melounmichal@gmail.com designates 2a00:1450:4864:20::343 as permitted sender) smtp.mailfrom=melounmichal@gmail.com X-Spamd-Result: default: False [-1.88 / 15.00]; HAS_REPLYTO(0.00)[mmel@freebsd.org]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; TAGGED_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.03)[-1.030]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.001]; MIME_GOOD(-0.10)[text/plain]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; NEURAL_SPAM_SHORT(0.15)[0.150]; MID_RHS_MATCH_TO(1.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::343:from]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[svn-src-head,svn-src-all] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Oct 2020 10:01:28 -0000 On 30.09.2020 18:33, Ed Maste wrote: > On Fri, 25 Sep 2020 at 12:44, Michal Meloun wrote: >> >> Author: mmel >> Date: Fri Sep 25 16:44:01 2020 >> New Revision: 366161 >> URL: https://svnweb.freebsd.org/changeset/base/366161 > > The pine64 in CI is currently broken, panicking at boot with: > panic: mutex aw_syscon0 owned at > /usr/src/sys/dev/extres/syscon/syscon_generic.c:98 > > Log: > https://ci.freebsd.org/hwlab/job/FreeBSD-device-head-pinea64-test/6480/artifact/device_tests/pinea64.boot.log > > It's possible there's an outdated dtb involved here, as there was with > the BBB. Hopefully manu's change to report/check the dtb version makes > it in and can be used to help track these issues down. > > Unfortunately the USB-serial interface connected to the pine64 was > broken until yesterday so I'm not sure for how long this has been > broken in this way. The last successful run was at r364130 almost 2 > months ago; the first failure after that was because of an apparent > hang at shutdown. Fixed in r66312. I never realized that the syscon_generic methods are not called on any of my boards even though their DTs have syscon_generic node. Michal From owner-svn-src-all@freebsd.org Thu Oct 1 13:29:30 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 50DF9428D9C; Thu, 1 Oct 2020 13:29:30 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2DVy1RGzz46n9; Thu, 1 Oct 2020 13:29:30 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 150D71182D; Thu, 1 Oct 2020 13:29:30 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 091DTTKN012393; Thu, 1 Oct 2020 13:29:29 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 091DTTn9012392; Thu, 1 Oct 2020 13:29:29 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202010011329.091DTTn9012392@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 1 Oct 2020 13:29:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366313 - head/sys/arm64/conf X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/arm64/conf X-SVN-Commit-Revision: 366313 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Oct 2020 13:29:30 -0000 Author: emaste Date: Thu Oct 1 13:29:29 2020 New Revision: 366313 URL: https://svnweb.freebsd.org/changeset/base/366313 Log: Add cd device to arm64 GENERIC Big-iron arm64 machines might have a CD, possibly provided by some IPMI emulation. Reported by: scottph Modified: head/sys/arm64/conf/GENERIC Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Thu Oct 1 09:50:08 2020 (r366312) +++ head/sys/arm64/conf/GENERIC Thu Oct 1 13:29:29 2020 (r366313) @@ -189,6 +189,7 @@ device scbus device da # ATA/SCSI peripherals +device cd # CD device pass # Passthrough device (direct ATA/SCSI access) # NVM Express (NVMe) support From owner-svn-src-all@freebsd.org Thu Oct 1 14:20:38 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 00CF3429C4C; Thu, 1 Oct 2020 14:20:38 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2Fdx6BDnz4CB7; Thu, 1 Oct 2020 14:20:37 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B792411FC3; Thu, 1 Oct 2020 14:20:37 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 091EKb9O043513; Thu, 1 Oct 2020 14:20:37 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 091EKb1x043510; Thu, 1 Oct 2020 14:20:37 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202010011420.091EKb1x043510@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 1 Oct 2020 14:20:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366314 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 366314 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Oct 2020 14:20:38 -0000 Author: kevans Date: Thu Oct 1 14:20:36 2020 New Revision: 366314 URL: https://svnweb.freebsd.org/changeset/base/366314 Log: lualoader: clear up some luacheck warnings - One (1) unused argument - One (1) trailing whitespace - Two (2) "non-standard global" (curenv, rewind) tools/boot/lua-lint.sh is once again happy. Modified: head/stand/lua/cli.lua head/stand/lua/core.lua head/stand/lua/menu.lua Modified: head/stand/lua/cli.lua ============================================================================== --- head/stand/lua/cli.lua Thu Oct 1 13:29:29 2020 (r366313) +++ head/stand/lua/cli.lua Thu Oct 1 14:20:36 2020 (r366314) @@ -130,7 +130,7 @@ cli['read-conf'] = function(...) config.readConf(assert(core.popFrontTable(argv))) end -cli['reload-conf'] = function(...) +cli['reload-conf'] = function() config.reload() end Modified: head/stand/lua/core.lua ============================================================================== --- head/stand/lua/core.lua Thu Oct 1 13:29:29 2020 (r366313) +++ head/stand/lua/core.lua Thu Oct 1 14:20:36 2020 (r366314) @@ -319,7 +319,7 @@ function core.bootenvDefaultRewinded() end for curenv_idx = 0, bootenv_count - 1 do - curenv = loader.getenv("bootenvs_check[" .. curenv_idx .. "]") + local curenv = loader.getenv("bootenvs_check[" .. curenv_idx .. "]") if curenv == defname then return defname end Modified: head/stand/lua/menu.lua ============================================================================== --- head/stand/lua/menu.lua Thu Oct 1 13:29:29 2020 (r366313) +++ head/stand/lua/menu.lua Thu Oct 1 14:20:36 2020 (r366314) @@ -232,7 +232,7 @@ menu.welcome = { multi_user = multi_user, } else - single_user = alts.single_user + single_user = alts.single_user multi_user = alts.multi_user end boot_entry_1, boot_entry_2 = single_user, multi_user @@ -352,7 +352,7 @@ menu.welcome = { zpool_checkpoints = { entry_type = core.MENU_ENTRY, name = function() - rewind = "No" + local rewind = "No" if core.isRewinded() then rewind = "Yes" end From owner-svn-src-all@freebsd.org Thu Oct 1 14:31:09 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 89F8142A04B; Thu, 1 Oct 2020 14:31:09 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io1-f45.google.com (mail-io1-f45.google.com [209.85.166.45]) (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 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2Ft51njmz4D7X; Thu, 1 Oct 2020 14:31:09 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io1-f45.google.com with SMTP id u19so6872098ion.3; Thu, 01 Oct 2020 07:31:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=7ZgsCNHljB3KcgJTKE1tMk+3k6Uq/en+CnnlT1xXR2k=; b=pXQgcRjvbb7IH1Oe/kSMcZGncAal43BtSsXc8iAacLEUtF5R9Qz62akWnbJ97ntPlw Nl5KiAGMIKRRADCwYbE29SqFayYAjDRvy1MxoibIkh8n1ALiHXWlxVNg7StgxviEu4Hk p4gw7sHDMK70348gPCKay6fcCHgQPh4ibNqBSZ2606AqCJJB5Hgz8Cqh/gXNzViYfvXC pivvf7RyCCo3cVqqGpjapNe2BjH++dcL3mvKGqqnwWIhiYuW7NwADHjpI/GJTYQ7rdIl +GpSM4i37PLwX+csunggySRKjo7GyIVsuBIhS3tb0iUB/Y5fIGUTZwBm/+MD93YXYDI3 DroA== X-Gm-Message-State: AOAM5309bP+pl2VMj8NYXPnjYf7ke+UaF3a4x1lwRCOtZ/jZrllThqgr 2UJePm4SodEn1eh8S9c58qcLeKmIzEFaZ2mPVYCMwR/vRg0= X-Google-Smtp-Source: ABdhPJzN1qH2H3KzysvlBCqhcyRyWHRZ8rdhTxfyKG+TeSIlofb4WIzkTOhHVdecZ8HkSK6YM0yQSnsgFjMPKKg9F4A= X-Received: by 2002:a6b:ec04:: with SMTP id c4mr5720461ioh.179.1601562667330; Thu, 01 Oct 2020 07:31:07 -0700 (PDT) MIME-Version: 1.0 References: <202010010950.0919o9kU076885@repo.freebsd.org> In-Reply-To: <202010010950.0919o9kU076885@repo.freebsd.org> From: Ed Maste Date: Thu, 1 Oct 2020 10:30:55 -0400 Message-ID: Subject: Re: svn commit: r366312 - head/sys/dev/extres/syscon To: Michal Meloun Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4C2Ft51njmz4D7X X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Oct 2020 14:31:09 -0000 On Thu, 1 Oct 2020 at 05:50, Michal Meloun wrote: > > Author: mmel > Date: Thu Oct 1 09:50:08 2020 > New Revision: 366312 > URL: https://svnweb.freebsd.org/changeset/base/366312 > > Log: > Fix the inverted condition in mtx_asserts. > Mutex should be owned in affected functions. Thanks! The board now boots to the login prompt in the CI hwlab. CI is still reporting failure but I believe it is a hardware issue. The smoke test tries to log in on the console then run a few commands and shutdown, and it looks like the USB-serial dongle has working rx but not tx. From owner-svn-src-all@freebsd.org Thu Oct 1 15:04:56 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 92FA742ABF3; Thu, 1 Oct 2020 15:04:56 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2Gd42xWZz4FjV; Thu, 1 Oct 2020 15:04:56 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 48574127BE; Thu, 1 Oct 2020 15:04:56 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 091F4uhJ073830; Thu, 1 Oct 2020 15:04:56 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 091F4tRU073829; Thu, 1 Oct 2020 15:04:55 GMT (envelope-from kp@FreeBSD.org) Message-Id: <202010011504.091F4tRU073829@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Thu, 1 Oct 2020 15:04:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366315 - in head/sys/riscv: include riscv X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: in head/sys/riscv: include riscv X-SVN-Commit-Revision: 366315 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Oct 2020 15:04:56 -0000 Author: kp Date: Thu Oct 1 15:04:55 2020 New Revision: 366315 URL: https://svnweb.freebsd.org/changeset/base/366315 Log: riscv: Add memmmap so we can mmap /dev/mem Reviewed by: mhorne Sponsored by: Axiado Differential Revision: https://reviews.freebsd.org/D26622 Modified: head/sys/riscv/include/memdev.h head/sys/riscv/riscv/mem.c Modified: head/sys/riscv/include/memdev.h ============================================================================== --- head/sys/riscv/include/memdev.h Thu Oct 1 14:20:36 2020 (r366314) +++ head/sys/riscv/include/memdev.h Thu Oct 1 15:04:55 2020 (r366315) @@ -35,6 +35,6 @@ d_open_t memopen; d_read_t memrw; d_ioctl_t memioctl_md; -#define memmmap (d_mmap_t *)NULL +d_mmap_t memmmap; #endif /* _MACHINE_MEMDEV_H_ */ Modified: head/sys/riscv/riscv/mem.c ============================================================================== --- head/sys/riscv/riscv/mem.c Thu Oct 1 14:20:36 2020 (r366314) +++ head/sys/riscv/riscv/mem.c Thu Oct 1 15:04:55 2020 (r366315) @@ -122,6 +122,21 @@ memrw(struct cdev *dev, struct uio *uio, int flags) return (error); } +/* + * Allow user processes to MMAP some memory sections + * instead of going through read/write. + */ +int +memmmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr, + int prot __unused, vm_memattr_t *memattr __unused) +{ + if (dev2unit(dev) == CDEV_MINOR_MEM) { + *paddr = offset; + return (0); + } + return (-1); +} + int memioctl_md(struct cdev *dev __unused, u_long cmd __unused, caddr_t data __unused, int flags __unused, struct thread *td __unused) From owner-svn-src-all@freebsd.org Thu Oct 1 15:40:26 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6DE7C42BA0B; Thu, 1 Oct 2020 15:40:26 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2HQ22F0lz4HP9; Thu, 1 Oct 2020 15:40:26 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3088B12BF4; Thu, 1 Oct 2020 15:40:26 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 091FeQ4V093088; Thu, 1 Oct 2020 15:40:26 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 091FePrQ093083; Thu, 1 Oct 2020 15:40:25 GMT (envelope-from se@FreeBSD.org) Message-Id: <202010011540.091FePrQ093083@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: se set sender to se@FreeBSD.org using -f From: =?UTF-8?Q?Stefan_E=c3=9fer?= Date: Thu, 1 Oct 2020 15:40:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r366316 - in vendor/bc/dist: . include src X-SVN-Group: vendor X-SVN-Commit-Author: se X-SVN-Commit-Paths: in vendor/bc/dist: . include src X-SVN-Commit-Revision: 366316 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Oct 2020 15:40:26 -0000 Author: se Date: Thu Oct 1 15:40:24 2020 New Revision: 366316 URL: https://svnweb.freebsd.org/changeset/base/366316 Log: Update to version 3.1.6 Modified: vendor/bc/dist/Makefile.in vendor/bc/dist/NEWS.md vendor/bc/dist/include/bc.h vendor/bc/dist/release.sh vendor/bc/dist/src/data.c vendor/bc/dist/src/num.c Modified: vendor/bc/dist/Makefile.in ============================================================================== --- vendor/bc/dist/Makefile.in Thu Oct 1 15:04:55 2020 (r366315) +++ vendor/bc/dist/Makefile.in Thu Oct 1 15:40:24 2020 (r366316) @@ -29,7 +29,7 @@ # .POSIX: -VERSION = 3.1.5 +VERSION = 3.1.6 SRC = %%SRC%% OBJ = %%OBJ%% Modified: vendor/bc/dist/NEWS.md ============================================================================== --- vendor/bc/dist/NEWS.md Thu Oct 1 15:04:55 2020 (r366315) +++ vendor/bc/dist/NEWS.md Thu Oct 1 15:40:24 2020 (r366316) @@ -1,5 +1,13 @@ # News +## 3.1.6 + +This is a production release that fixes a new warning from Clang 12 for FreeBSD +and also removes some possible undefined behavior found by UBSan that compilers +did not seem to take advantage of. + +Users do ***NOT*** need to upgrade, if they do not want to. + ## 3.1.5 This is a production release that fixes the Chinese locales (which caused `bc` Modified: vendor/bc/dist/include/bc.h ============================================================================== --- vendor/bc/dist/include/bc.h Thu Oct 1 15:04:55 2020 (r366315) +++ vendor/bc/dist/include/bc.h Thu Oct 1 15:40:24 2020 (r366316) @@ -173,6 +173,10 @@ extern const BcParseNext bc_parse_next_elem; extern const BcParseNext bc_parse_next_for; extern const BcParseNext bc_parse_next_read; +#else // BC_ENABLED + +#define BC_PARSE_NO_EXEC(p) (0) + #endif // BC_ENABLED #endif // BC_BC_H Modified: vendor/bc/dist/release.sh ============================================================================== --- vendor/bc/dist/release.sh Thu Oct 1 15:04:55 2020 (r366315) +++ vendor/bc/dist/release.sh Thu Oct 1 15:40:24 2020 (r366316) @@ -383,6 +383,7 @@ build_set() { clang_flags="-Weverything -Wno-padded -Wno-switch-enum -Wno-format-nonliteral" clang_flags="$clang_flags -Wno-cast-align -Wno-missing-noreturn -Wno-disabled-macro-expansion" clang_flags="$clang_flags -Wno-unreachable-code -Wno-unreachable-code-return" +clang_flags="$clang_flags -Wno-implicit-fallthrough" gcc_flags="-Wno-maybe-uninitialized -Wno-clobbered" cflags="-Wall -Wextra -Werror -pedantic -Wno-conditional-uninitialized" Modified: vendor/bc/dist/src/data.c ============================================================================== --- vendor/bc/dist/src/data.c Thu Oct 1 15:04:55 2020 (r366315) +++ vendor/bc/dist/src/data.c Thu Oct 1 15:40:24 2020 (r366316) @@ -141,8 +141,8 @@ const char* const bc_err_msgs[] = { "empty expression", "bad print statement", "bad function definition", - "bad assignment: left side must be scale, ibase, " - "obase, seed, last, var, or array element", + ("bad assignment: left side must be scale, ibase, " + "obase, seed, last, var, or array element"), "no auto variable found", "function parameter or auto \"%s%s\" already exists", "block end cannot be found", Modified: vendor/bc/dist/src/num.c ============================================================================== --- vendor/bc/dist/src/num.c Thu Oct 1 15:04:55 2020 (r366315) +++ vendor/bc/dist/src/num.c Thu Oct 1 15:40:24 2020 (r366316) @@ -1457,7 +1457,8 @@ static void bc_num_parseDecimal(BcNum *restrict n, con for (i = 0; i < len && (zero = (val[i] == '0' || val[i] == '.')); ++i); - n->scale = (size_t) (rdx * ((val + len) - (ptr + 1))); + n->scale = (size_t) (rdx * (((uintptr_t) (val + len)) - + (((uintptr_t) ptr) + 1))); n->rdx = BC_NUM_RDX(n->scale); i = len - (ptr == val ? 0 : i) - rdx; @@ -1656,7 +1657,7 @@ static void bc_num_printDecimal(const BcNum *restrict memset(buffer, 0, BC_BASE_DIGS * sizeof(size_t)); for (j = 0; n9 && j < BC_BASE_DIGS; ++j) { - buffer[j] = n9 % BC_BASE; + buffer[j] = ((size_t) n9) % BC_BASE; n9 /= BC_BASE; } From owner-svn-src-all@freebsd.org Thu Oct 1 15:41:33 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6839B42BD05; Thu, 1 Oct 2020 15:41:33 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2HRK2CkZz4Hb0; Thu, 1 Oct 2020 15:41:33 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 163DA12FBF; Thu, 1 Oct 2020 15:41:33 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 091FfW1p097092; Thu, 1 Oct 2020 15:41:32 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 091FfWVt097091; Thu, 1 Oct 2020 15:41:32 GMT (envelope-from se@FreeBSD.org) Message-Id: <202010011541.091FfWVt097091@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: se set sender to se@FreeBSD.org using -f From: =?UTF-8?Q?Stefan_E=c3=9fer?= Date: Thu, 1 Oct 2020 15:41:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r366317 - vendor/bc/3.1.6 X-SVN-Group: vendor X-SVN-Commit-Author: se X-SVN-Commit-Paths: vendor/bc/3.1.6 X-SVN-Commit-Revision: 366317 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Oct 2020 15:41:33 -0000 Author: se Date: Thu Oct 1 15:41:32 2020 New Revision: 366317 URL: https://svnweb.freebsd.org/changeset/base/366317 Log: Tag version 3.1.6 Added: vendor/bc/3.1.6/ - copied from r366316, vendor/bc/dist/ From owner-svn-src-all@freebsd.org Thu Oct 1 15:45:00 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7CC3942BC38; Thu, 1 Oct 2020 15:45:00 +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 4C2HWH32mZz4J6x; Thu, 1 Oct 2020 15:44:58 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.16.1/8.16.1) with ESMTPS id 091FijTx077472 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 1 Oct 2020 18:44:48 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 091FijTx077472 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 091FijwR077470; Thu, 1 Oct 2020 18:44:45 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 1 Oct 2020 18:44:45 +0300 From: Konstantin Belousov To: Kyle Evans Cc: Alan Somers , src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r366207 - head/lib/libc/gen Message-ID: <20201001154445.GA2643@kib.kiev.ua> References: <202009272226.08RMQf1h054050@repo.freebsd.org> <20200927231519.GI2643@kib.kiev.ua> <20200928150405.GO2643@kib.kiev.ua> <20200928160138.GP2643@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200928160138.GP2643@kib.kiev.ua> 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=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on tom.home X-Rspamd-Queue-Id: 4C2HWH32mZz4J6x X-Spamd-Bar: ++ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=gmail.com (policy=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 X-Spamd-Result: default: False [2.14 / 15.00]; RCVD_TLS_ALL(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; RCPT_COUNT_FIVE(0.00)[5]; NEURAL_SPAM_MEDIUM(0.95)[0.949]; TO_DN_ALL(0.00)[]; NEURAL_SPAM_LONG(0.84)[0.837]; NEURAL_SPAM_SHORT(0.36)[0.356]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : No valid SPF, No valid DKIM,none] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Oct 2020 15:45:00 -0000 On Mon, Sep 28, 2020 at 07:01:38PM +0300, Konstantin Belousov wrote: > On Mon, Sep 28, 2020 at 10:06:55AM -0500, Kyle Evans wrote: > > I would be tempted to just revert the rest of the local modifications > > (sans negative check, maybe) and widen it in the one spot that the > > compiler complains about: > > > > - if (strlcpy(buf, execpath, buflen_) >= buflen_) > > + if (strlcpy(buf, execpath, buflen) >= (size_t)buflen) > > > > I had expressed this in the review, but with no particular conviction. > If this is the only place where the warning occurs, IMO it would be quite > good to reduce the change. So would you propose your change for review ? From owner-svn-src-all@freebsd.org Thu Oct 1 15:45:13 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6265B42B959; Thu, 1 Oct 2020 15:45:13 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2HWX0s16z4J7Z; Thu, 1 Oct 2020 15:45:11 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8B1FE13128; Thu, 1 Oct 2020 15:45:09 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 091Fj9WW099048; Thu, 1 Oct 2020 15:45:09 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 091Fj8rX099041; Thu, 1 Oct 2020 15:45:08 GMT (envelope-from se@FreeBSD.org) Message-Id: <202010011545.091Fj8rX099041@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: se set sender to se@FreeBSD.org using -f From: =?UTF-8?Q?Stefan_E=c3=9fer?= Date: Thu, 1 Oct 2020 15:45:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366318 - in head/contrib/bc: . include src X-SVN-Group: head X-SVN-Commit-Author: se X-SVN-Commit-Paths: in head/contrib/bc: . include src X-SVN-Commit-Revision: 366318 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Oct 2020 15:45:13 -0000 Author: se Date: Thu Oct 1 15:45:07 2020 New Revision: 366318 URL: https://svnweb.freebsd.org/changeset/base/366318 Log: Upgrade to version 3.1.6 This upgrade addresses one (benign) compiler warning when building with LLVM-12. Modified: head/contrib/bc/Makefile.in head/contrib/bc/NEWS.md head/contrib/bc/include/bc.h head/contrib/bc/release.sh head/contrib/bc/src/data.c head/contrib/bc/src/num.c head/contrib/bc/src/program.c Directory Properties: head/contrib/bc/ (props changed) Modified: head/contrib/bc/Makefile.in ============================================================================== --- head/contrib/bc/Makefile.in Thu Oct 1 15:41:32 2020 (r366317) +++ head/contrib/bc/Makefile.in Thu Oct 1 15:45:07 2020 (r366318) @@ -29,7 +29,7 @@ # .POSIX: -VERSION = 3.1.5 +VERSION = 3.1.6 SRC = %%SRC%% OBJ = %%OBJ%% Modified: head/contrib/bc/NEWS.md ============================================================================== --- head/contrib/bc/NEWS.md Thu Oct 1 15:41:32 2020 (r366317) +++ head/contrib/bc/NEWS.md Thu Oct 1 15:45:07 2020 (r366318) @@ -1,5 +1,13 @@ # News +## 3.1.6 + +This is a production release that fixes a new warning from Clang 12 for FreeBSD +and also removes some possible undefined behavior found by UBSan that compilers +did not seem to take advantage of. + +Users do ***NOT*** need to upgrade, if they do not want to. + ## 3.1.5 This is a production release that fixes the Chinese locales (which caused `bc` Modified: head/contrib/bc/include/bc.h ============================================================================== --- head/contrib/bc/include/bc.h Thu Oct 1 15:41:32 2020 (r366317) +++ head/contrib/bc/include/bc.h Thu Oct 1 15:45:07 2020 (r366318) @@ -173,6 +173,10 @@ extern const BcParseNext bc_parse_next_elem; extern const BcParseNext bc_parse_next_for; extern const BcParseNext bc_parse_next_read; +#else // BC_ENABLED + +#define BC_PARSE_NO_EXEC(p) (0) + #endif // BC_ENABLED #endif // BC_BC_H Modified: head/contrib/bc/release.sh ============================================================================== --- head/contrib/bc/release.sh Thu Oct 1 15:41:32 2020 (r366317) +++ head/contrib/bc/release.sh Thu Oct 1 15:45:07 2020 (r366318) @@ -383,6 +383,7 @@ build_set() { clang_flags="-Weverything -Wno-padded -Wno-switch-enum -Wno-format-nonliteral" clang_flags="$clang_flags -Wno-cast-align -Wno-missing-noreturn -Wno-disabled-macro-expansion" clang_flags="$clang_flags -Wno-unreachable-code -Wno-unreachable-code-return" +clang_flags="$clang_flags -Wno-implicit-fallthrough" gcc_flags="-Wno-maybe-uninitialized -Wno-clobbered" cflags="-Wall -Wextra -Werror -pedantic -Wno-conditional-uninitialized" Modified: head/contrib/bc/src/data.c ============================================================================== --- head/contrib/bc/src/data.c Thu Oct 1 15:41:32 2020 (r366317) +++ head/contrib/bc/src/data.c Thu Oct 1 15:45:07 2020 (r366318) @@ -141,8 +141,8 @@ const char* const bc_err_msgs[] = { "empty expression", "bad print statement", "bad function definition", - "bad assignment: left side must be scale, ibase, " - "obase, seed, last, var, or array element", + ("bad assignment: left side must be scale, ibase, " + "obase, seed, last, var, or array element"), "no auto variable found", "function parameter or auto \"%s%s\" already exists", "block end cannot be found", Modified: head/contrib/bc/src/num.c ============================================================================== --- head/contrib/bc/src/num.c Thu Oct 1 15:41:32 2020 (r366317) +++ head/contrib/bc/src/num.c Thu Oct 1 15:45:07 2020 (r366318) @@ -1457,7 +1457,8 @@ static void bc_num_parseDecimal(BcNum *restrict n, con for (i = 0; i < len && (zero = (val[i] == '0' || val[i] == '.')); ++i); - n->scale = (size_t) (rdx * ((val + len) - (ptr + 1))); + n->scale = (size_t) (rdx * (((uintptr_t) (val + len)) - + (((uintptr_t) ptr) + 1))); n->rdx = BC_NUM_RDX(n->scale); i = len - (ptr == val ? 0 : i) - rdx; @@ -1656,7 +1657,7 @@ static void bc_num_printDecimal(const BcNum *restrict memset(buffer, 0, BC_BASE_DIGS * sizeof(size_t)); for (j = 0; n9 && j < BC_BASE_DIGS; ++j) { - buffer[j] = n9 % BC_BASE; + buffer[j] = ((size_t) n9) % BC_BASE; n9 /= BC_BASE; } Modified: head/contrib/bc/src/program.c ============================================================================== --- head/contrib/bc/src/program.c Thu Oct 1 15:41:32 2020 (r366317) +++ head/contrib/bc/src/program.c Thu Oct 1 15:45:07 2020 (r366318) @@ -180,7 +180,7 @@ static inline BcVec* bc_program_vec(const BcProgram *p static BcNum* bc_program_num(BcProgram *p, BcResult *r) { - BcNum *n = NULL; + BcNum *n; switch (r->t) { From owner-svn-src-all@freebsd.org Thu Oct 1 15:46:49 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 984DD42BC5A; Thu, 1 Oct 2020 15:46:49 +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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2HYP3Wk3z4JC1; Thu, 1 Oct 2020 15:46:49 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qt1-f171.google.com (mail-qt1-f171.google.com [209.85.160.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 5602E16132; Thu, 1 Oct 2020 15:46:49 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qt1-f171.google.com with SMTP id y11so4806962qtn.9; Thu, 01 Oct 2020 08:46:49 -0700 (PDT) X-Gm-Message-State: AOAM531Oh3d2+f5tgzy/88YXPJho83vRLcsjy8maLPQRnKuLVtv4P4eA RnWpjvLDzGJqDeydfMpWTrL/fDxaXSDNlirTzgM= X-Google-Smtp-Source: ABdhPJyLYGTc6kUDeGUzDNwdtqk/vXBY9lUqw47Y6WQKdbCnyWClbUY3qcTzLNV5hh/znBi+l7fbeHI158DDf78a+bk= X-Received: by 2002:ac8:3261:: with SMTP id y30mr8367484qta.242.1601567208897; Thu, 01 Oct 2020 08:46:48 -0700 (PDT) MIME-Version: 1.0 References: <202009272226.08RMQf1h054050@repo.freebsd.org> <20200927231519.GI2643@kib.kiev.ua> <20200928150405.GO2643@kib.kiev.ua> <20200928160138.GP2643@kib.kiev.ua> <20201001154445.GA2643@kib.kiev.ua> In-Reply-To: <20201001154445.GA2643@kib.kiev.ua> From: Kyle Evans Date: Thu, 1 Oct 2020 10:46:36 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r366207 - head/lib/libc/gen To: Konstantin Belousov Cc: Kyle Evans , Alan Somers , src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Oct 2020 15:46:49 -0000 On Thu, Oct 1, 2020 at 10:45 AM Konstantin Belousov wrote: > > On Mon, Sep 28, 2020 at 07:01:38PM +0300, Konstantin Belousov wrote: > > On Mon, Sep 28, 2020 at 10:06:55AM -0500, Kyle Evans wrote: > > > I would be tempted to just revert the rest of the local modifications > > > (sans negative check, maybe) and widen it in the one spot that the > > > compiler complains about: > > > > > > - if (strlcpy(buf, execpath, buflen_) >= buflen_) > > > + if (strlcpy(buf, execpath, buflen) >= (size_t)buflen) > > > > > > I had expressed this in the review, but with no particular conviction. > > If this is the only place where the warning occurs, IMO it would be quite > > good to reduce the change. > > So would you propose your change for review ? Sure, I'll throw it up here in a little bit. From owner-svn-src-all@freebsd.org Thu Oct 1 16:09:24 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 47EF442C712; Thu, 1 Oct 2020 16:09:24 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2J3S17BWz4Kt3; Thu, 1 Oct 2020 16:09:24 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 09C291333F; Thu, 1 Oct 2020 16:09:24 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 091G9Npd012004; Thu, 1 Oct 2020 16:09:23 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 091G9Nkj012002; Thu, 1 Oct 2020 16:09:23 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202010011609.091G9Nkj012002@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 1 Oct 2020 16:09:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366319 - stable/12/usr.sbin/traceroute6 X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/usr.sbin/traceroute6 X-SVN-Commit-Revision: 366319 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Oct 2020 16:09:24 -0000 Author: tuexen Date: Thu Oct 1 16:09:23 2020 New Revision: 366319 URL: https://svnweb.freebsd.org/changeset/base/366319 Log: MFC r365685: Add a -t option to traceroute6 to control the traffic class used when sending probe packets. Modified: stable/12/usr.sbin/traceroute6/traceroute6.8 stable/12/usr.sbin/traceroute6/traceroute6.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/traceroute6/traceroute6.8 ============================================================================== --- stable/12/usr.sbin/traceroute6/traceroute6.8 Thu Oct 1 15:45:07 2020 (r366318) +++ stable/12/usr.sbin/traceroute6/traceroute6.8 Thu Oct 1 16:09:23 2020 (r366319) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 16, 2019 +.Dd September 13, 2020 .Dt TRACEROUTE6 8 .Os .\" @@ -61,6 +61,9 @@ .Op Fl s Ar src .Ek .Bk -words +.Op Fl t Ar tclass +.Ek +.Bk -words .Op Fl w Ar waittime .Ek .Bk -words @@ -148,6 +151,13 @@ If .Ar datalen is up to 28, probe packets consist of a SHUTDOWN-ACK chunk possibly bundled with a PAD chunk. For larger probe packets, an INIT chunk is used. +.It Fl t Ar tclass +.Ar tclass +specifies the +.Em traffic class +used when sending probe packets. +The value must be a decimal integer in the range 0 to 255. +The default is 0. .It Fl T Use TCP segments for the probes. .It Fl U Modified: stable/12/usr.sbin/traceroute6/traceroute6.c ============================================================================== --- stable/12/usr.sbin/traceroute6/traceroute6.c Thu Oct 1 15:45:07 2020 (r366318) +++ stable/12/usr.sbin/traceroute6/traceroute6.c Thu Oct 1 16:09:23 2020 (r366319) @@ -341,6 +341,7 @@ static u_long max_hops = 30; static u_int16_t srcport; static u_int16_t port = 32768+666; /* start udp dest port # for probe packets */ static u_int16_t ident; +static int tclass = -1; static int options; /* socket options */ static int verbose; static int waittime = 5; /* time to wait for response (in seconds) */ @@ -359,7 +360,7 @@ main(int argc, char *argv[]) int ch, i, on = 1, seq, rcvcmsglen, error; struct addrinfo hints, *res; static u_char *rcvcmsgbuf; - u_long probe, hops, lport; + u_long probe, hops, lport, ltclass; struct hostent *hp; size_t size, minlen; uid_t uid; @@ -406,7 +407,7 @@ main(int argc, char *argv[]) seq = 0; ident = htons(getpid() & 0xffff); /* same as ping6 */ - while ((ch = getopt(argc, argv, "aA:df:g:Ilm:nNp:q:rs:STUvw:")) != -1) + while ((ch = getopt(argc, argv, "aA:df:g:Ilm:nNp:q:rs:St:TUvw:")) != -1) switch (ch) { case 'a': as_path = 1; @@ -522,6 +523,17 @@ main(int argc, char *argv[]) case 'S': useproto = IPPROTO_SCTP; break; + case 't': + ep = NULL; + errno = 0; + ltclass = strtoul(optarg, &ep, 0); + if (errno || !*optarg || *ep || ltclass > 255) { + fprintf(stderr, + "traceroute6: invalid traffic class.\n"); + exit(1); + } + tclass = (int)ltclass; + break; case 'T': useproto = IPPROTO_TCP; break; @@ -591,6 +603,13 @@ main(int argc, char *argv[]) exit(1); } + if (tclass != -1) { + if (setsockopt(sndsock, IPPROTO_IPV6, IPV6_TCLASS, &tclass, + sizeof(int)) == -1) { + perror("setsockopt(IPV6_TCLASS)"); + exit(7); + } + } if (argc < 1 || argc > 2) usage(); From owner-svn-src-all@freebsd.org Thu Oct 1 16:11:09 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2D42C42C792; Thu, 1 Oct 2020 16:11:09 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2J5T0B6lz4L4w; Thu, 1 Oct 2020 16:11:09 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DDC48136E4; Thu, 1 Oct 2020 16:11:08 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 091GB8EF013697; Thu, 1 Oct 2020 16:11:08 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 091GB88x013695; Thu, 1 Oct 2020 16:11:08 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202010011611.091GB88x013695@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 1 Oct 2020 16:11:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366320 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 366320 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Oct 2020 16:11:09 -0000 Author: tuexen Date: Thu Oct 1 16:11:08 2020 New Revision: 366320 URL: https://svnweb.freebsd.org/changeset/base/366320 Log: MFC r365686: Export the name of the congestion control. This will be used by sockstat and netstat. Modified: stable/12/sys/netinet/tcp_subr.c stable/12/sys/netinet/tcp_var.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/tcp_subr.c ============================================================================== --- stable/12/sys/netinet/tcp_subr.c Thu Oct 1 16:09:23 2020 (r366319) +++ stable/12/sys/netinet/tcp_subr.c Thu Oct 1 16:11:08 2020 (r366320) @@ -3268,6 +3268,8 @@ tcp_inptoxtp(const struct inpcb *inp, struct xtcpcb *x bcopy(tp->t_fb->tfb_tcp_block_name, xt->xt_stack, TCP_FUNCTION_NAME_LEN_MAX); + bcopy(CC_ALGO(tp)->name, xt->xt_cc, + TCP_CA_NAME_MAX); #ifdef TCP_BLACKBOX (void)tcp_log_get_id(tp, xt->xt_logid); #endif Modified: stable/12/sys/netinet/tcp_var.h ============================================================================== --- stable/12/sys/netinet/tcp_var.h Thu Oct 1 16:09:23 2020 (r366319) +++ stable/12/sys/netinet/tcp_var.h Thu Oct 1 16:11:08 2020 (r366320) @@ -696,7 +696,8 @@ struct xtcpcb { struct xinpcb xt_inp; char xt_stack[TCP_FUNCTION_NAME_LEN_MAX]; /* (s) */ char xt_logid[TCP_LOG_ID_LEN]; /* (s) */ - int64_t spare64[8]; + char xt_cc[TCP_CA_NAME_MAX]; /* (s) */ + int64_t spare64[6]; int32_t t_state; /* (s,p) */ uint32_t t_flags; /* (s,p) */ int32_t t_sndzerowin; /* (s) */ From owner-svn-src-all@freebsd.org Thu Oct 1 16:14:01 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3365C42CB0D; Thu, 1 Oct 2020 16:14:01 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2J8n0Y7vz4LRf; Thu, 1 Oct 2020 16:14:01 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E2A4913836; Thu, 1 Oct 2020 16:14:00 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 091GE0Nd018146; Thu, 1 Oct 2020 16:14:00 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 091GE06J018144; Thu, 1 Oct 2020 16:14:00 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202010011614.091GE06J018144@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 1 Oct 2020 16:14:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366321 - stable/12/usr.bin/sockstat X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/usr.bin/sockstat X-SVN-Commit-Revision: 366321 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Oct 2020 16:14:01 -0000 Author: tuexen Date: Thu Oct 1 16:14:00 2020 New Revision: 366321 URL: https://svnweb.freebsd.org/changeset/base/366321 Log: MFC r365687: Add a -C option to sockstat to display the congestion control for TCP connections. Modified: stable/12/usr.bin/sockstat/sockstat.1 stable/12/usr.bin/sockstat/sockstat.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.bin/sockstat/sockstat.1 ============================================================================== --- stable/12/usr.bin/sockstat/sockstat.1 Thu Oct 1 16:11:08 2020 (r366320) +++ stable/12/usr.bin/sockstat/sockstat.1 Thu Oct 1 16:14:00 2020 (r366321) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 3, 2018 +.Dd September 13, 2020 .Dt SOCKSTAT 1 .Os .Sh NAME @@ -35,7 +35,7 @@ .Nd list open sockets .Sh SYNOPSIS .Nm -.Op Fl 46cLlSsUuvw +.Op Fl 46CcLlSsUuvw .Op Fl j Ar jid .Op Fl p Ar ports .Op Fl P Ar protocols @@ -56,6 +56,9 @@ Show Show .Dv AF_INET6 (IPv6) sockets. +.It Fl C +Display the congestion control module, if applicable. +This is currently only implemented for TCP. .It Fl c Show connected sockets. .It Fl j Ar jail @@ -170,6 +173,10 @@ is specified (only for SCTP or TCP). .It Li STACK The protocol stack if .Fl S +is specified (only for TCP). +.It Li CC +The congestion control if +.Fl C is specified (only for TCP). .El .Pp Modified: stable/12/usr.bin/sockstat/sockstat.c ============================================================================== --- stable/12/usr.bin/sockstat/sockstat.c Thu Oct 1 16:11:08 2020 (r366320) +++ stable/12/usr.bin/sockstat/sockstat.c Thu Oct 1 16:14:00 2020 (r366321) @@ -74,6 +74,7 @@ __FBSDID("$FreeBSD$"); static int opt_4; /* Show IPv4 sockets */ static int opt_6; /* Show IPv6 sockets */ +static int opt_C; /* Show congestion control */ static int opt_c; /* Show connected sockets */ static int opt_j; /* Show specified jail */ static int opt_L; /* Don't show IPv4 or IPv6 loopback sockets */ @@ -118,6 +119,7 @@ struct sock { int state; const char *protoname; char stack[TCP_FUNCTION_NAME_LEN_MAX]; + char cc[TCP_CA_NAME_MAX]; struct addr *laddr; struct addr *faddr; struct sock *next; @@ -716,6 +718,7 @@ gather_inet(int proto) sock->state = xtp->t_state; memcpy(sock->stack, xtp->xt_stack, TCP_FUNCTION_NAME_LEN_MAX); + memcpy(sock->cc, xtp->xt_cc, TCP_CA_NAME_MAX); } sock->protoname = protoname; hash = (int)((uintptr_t)sock->socket % HASHSIZE); @@ -1130,12 +1133,24 @@ displaysock(struct sock *s, int pos) } offset += 13; } - if (opt_S && s->proto == IPPROTO_TCP) { - while (pos < offset) - pos += xprintf(" "); - xprintf("%.*s", TCP_FUNCTION_NAME_LEN_MAX, - s->stack); + if (opt_S) { + if (s->proto == IPPROTO_TCP) { + while (pos < offset) + pos += xprintf(" "); + pos += xprintf("%.*s", + TCP_FUNCTION_NAME_LEN_MAX, + s->stack); + } + offset += TCP_FUNCTION_NAME_LEN_MAX + 1; } + if (opt_C) { + if (s->proto == IPPROTO_TCP) { + while (pos < offset) + pos += xprintf(" "); + xprintf("%.*s", TCP_CA_NAME_MAX, s->cc); + } + offset += TCP_CA_NAME_MAX + 1; + } } if (laddr != NULL) laddr = laddr->next; @@ -1170,7 +1185,10 @@ display(void) printf(" %-12s", "CONN STATE"); } if (opt_S) - printf(" %.*s", TCP_FUNCTION_NAME_LEN_MAX, "STACK"); + printf(" %-*.*s", TCP_FUNCTION_NAME_LEN_MAX, + TCP_FUNCTION_NAME_LEN_MAX, "STACK"); + if (opt_C) + printf(" %-.*s", TCP_CA_NAME_MAX, "CC"); printf("\n"); } setpassent(1); @@ -1286,13 +1304,16 @@ main(int argc, char *argv[]) int o, i; opt_j = -1; - while ((o = getopt(argc, argv, "46cj:Llp:P:qSsUuvw")) != -1) + while ((o = getopt(argc, argv, "46Ccj:Llp:P:qSsUuvw")) != -1) switch (o) { case '4': opt_4 = 1; break; case '6': opt_6 = 1; + break; + case 'C': + opt_C = 1; break; case 'c': opt_c = 1; From owner-svn-src-all@freebsd.org Thu Oct 1 16:18:50 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8997442CB80; Thu, 1 Oct 2020 16:18:50 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2JGL389Vz4LVL; Thu, 1 Oct 2020 16:18:50 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5009313A85; Thu, 1 Oct 2020 16:18:50 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 091GIoNn018449; Thu, 1 Oct 2020 16:18:50 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 091GInN3018444; Thu, 1 Oct 2020 16:18:49 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202010011618.091GInN3018444@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 1 Oct 2020 16:18:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366322 - stable/12/usr.bin/netstat X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/usr.bin/netstat X-SVN-Commit-Revision: 366322 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Oct 2020 16:18:50 -0000 Author: tuexen Date: Thu Oct 1 16:18:49 2020 New Revision: 366322 URL: https://svnweb.freebsd.org/changeset/base/366322 Log: MFC r365688: Add a -C option to netstat to display the congestion control for TCP connections. Modified: stable/12/usr.bin/netstat/inet.c stable/12/usr.bin/netstat/main.c stable/12/usr.bin/netstat/netstat.1 stable/12/usr.bin/netstat/netstat.h Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.bin/netstat/inet.c ============================================================================== --- stable/12/usr.bin/netstat/inet.c Thu Oct 1 16:14:00 2020 (r366321) +++ stable/12/usr.bin/netstat/inet.c Thu Oct 1 16:18:49 2020 (r366322) @@ -341,6 +341,9 @@ protopr(u_long off, const char *name, int af1, int pro xo_emit(" {T:/%8.8s} {T:/%5.5s}", "flowid", "ftype"); } + if (Cflag) + xo_emit(" {T:/%-*.*s}", TCP_CA_NAME_MAX, + TCP_CA_NAME_MAX, "CC"); if (Pflag) xo_emit(" {T:/%s}", "Log ID"); xo_emit("\n"); @@ -514,9 +517,15 @@ protopr(u_long off, const char *name, int af1, int pro inp->inp_flowid, inp->inp_flowtype); } - if (istcp && Pflag) - xo_emit(" {:log-id/%s}", tp->xt_logid[0] == '\0' ? - "-" : tp->xt_logid); + if (istcp) { + if (Cflag) + xo_emit(" {:cc/%-*.*s}", TCP_CA_NAME_MAX, + TCP_CA_NAME_MAX, tp->xt_cc); + if (Pflag) + xo_emit(" {:log-id/%s}", + tp->xt_logid[0] == '\0' ? + "-" : tp->xt_logid); + } xo_emit("\n"); xo_close_instance("socket"); } Modified: stable/12/usr.bin/netstat/main.c ============================================================================== --- stable/12/usr.bin/netstat/main.c Thu Oct 1 16:14:00 2020 (r366321) +++ stable/12/usr.bin/netstat/main.c Thu Oct 1 16:18:49 2020 (r366322) @@ -205,6 +205,7 @@ int Aflag; /* show addresses of protocol control bloc int aflag; /* show all sockets (including servers) */ static int Bflag; /* show information about bpf consumers */ int bflag; /* show i/f total bytes in/out */ +int Cflag; /* show congestion control */ int dflag; /* show i/f dropped packets */ int gflag; /* show group (multicast) routing or stats */ int hflag; /* show counters in human readable format */ @@ -248,7 +249,7 @@ main(int argc, char *argv[]) if (argc < 0) exit(EXIT_FAILURE); - while ((ch = getopt(argc, argv, "46AaBbdF:f:ghI:iLlM:mN:nPp:Qq:RrSTsuWw:xz")) + while ((ch = getopt(argc, argv, "46AaBbCdF:f:ghI:iLlM:mN:nPp:Qq:RrSTsuWw:xz")) != -1) switch(ch) { case '4': @@ -277,6 +278,9 @@ main(int argc, char *argv[]) case 'b': bflag = 1; break; + case 'C': + Cflag = 1; + break; case 'd': dflag = 1; break; @@ -721,7 +725,7 @@ kset_dpcpu(u_int cpuid) if (kvm_dpcpu_setcpu(kvmd, cpuid) < 0) xo_errx(-1, "%s: kvm_dpcpu_setcpu(%u): %s", __func__, - cpuid, kvm_geterr(kvmd)); + cpuid, kvm_geterr(kvmd)); return; } Modified: stable/12/usr.bin/netstat/netstat.1 ============================================================================== --- stable/12/usr.bin/netstat/netstat.1 Thu Oct 1 16:14:00 2020 (r366321) +++ stable/12/usr.bin/netstat/netstat.1 Thu Oct 1 16:18:49 2020 (r366322) @@ -28,7 +28,7 @@ .\" @(#)netstat.1 8.8 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd March 22, 2018 +.Dd September 13, 2020 .Dt NETSTAT 1 .Os .Sh NAME @@ -39,7 +39,7 @@ .Bl -tag -width "netstat" .It Nm .Op Fl -libxo -.Op Fl 46AaLnPRSTWx +.Op Fl 46AaCLnPRSTWx .Op Fl f Ar protocol_family | Fl p Ar protocol .Op Fl M Ar core .Op Fl N Ar system @@ -111,7 +111,7 @@ depending on the options for the information presented .It Xo .Bk -words .Nm -.Op Fl 46AaLnRSTWx +.Op Fl 46AaCLnRSTWx .Op Fl f Ar protocol_family | Fl p Ar protocol .Op Fl M Ar core .Op Fl N Ar system @@ -172,6 +172,8 @@ associated with a socket; used for debugging. .It Fl a Show the state of all sockets; normally sockets used by server processes are not shown. +.It Fl C +Show the congestion control of TCP sockets. .It Fl L Show the size of the various listen queues. The first count shows the number of unaccepted connections, Modified: stable/12/usr.bin/netstat/netstat.h ============================================================================== --- stable/12/usr.bin/netstat/netstat.h Thu Oct 1 16:14:00 2020 (r366321) +++ stable/12/usr.bin/netstat/netstat.h Thu Oct 1 16:18:49 2020 (r366322) @@ -41,6 +41,7 @@ extern int Aflag; /* show addresses of protocol control block */ extern int aflag; /* show all sockets (including servers) */ extern int bflag; /* show i/f total bytes in/out */ +extern int Cflag; /* show congestion control */ extern int dflag; /* show i/f dropped packets */ extern int gflag; /* show group (multicast) routing or stats */ extern int hflag; /* show counters in human readable format */ From owner-svn-src-all@freebsd.org Thu Oct 1 16:22:37 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1FB7342CD35; Thu, 1 Oct 2020 16:22:37 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2JLj00J0z4M4V; Thu, 1 Oct 2020 16:22:37 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D71A613773; Thu, 1 Oct 2020 16:22:36 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 091GMajZ024075; Thu, 1 Oct 2020 16:22:36 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 091GMZhv024067; Thu, 1 Oct 2020 16:22:35 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202010011622.091GMZhv024067@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 1 Oct 2020 16:22:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366323 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 366323 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Oct 2020 16:22:37 -0000 Author: tuexen Date: Thu Oct 1 16:22:34 2020 New Revision: 366323 URL: https://svnweb.freebsd.org/changeset/base/366323 Log: MFC r366114: Whitespace changes. Modified: stable/12/sys/netinet/sctp_cc_functions.c stable/12/sys/netinet/sctp_header.h stable/12/sys/netinet/sctp_indata.c stable/12/sys/netinet/sctp_lock_bsd.h stable/12/sys/netinet/sctp_output.c stable/12/sys/netinet/sctp_output.h stable/12/sys/netinet/sctp_pcb.c stable/12/sys/netinet/sctp_usrreq.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/sctp_cc_functions.c ============================================================================== --- stable/12/sys/netinet/sctp_cc_functions.c Thu Oct 1 16:18:49 2020 (r366322) +++ stable/12/sys/netinet/sctp_cc_functions.c Thu Oct 1 16:22:34 2020 (r366323) @@ -1318,9 +1318,7 @@ sctp_cwnd_update_rtcc_after_ecn_echo(struct sctp_tcb * sctp_cwnd_update_after_ecn_echo_common(stcb, net, in_window, num_pkt_lost, 1); } - -static -void +static void sctp_cwnd_update_rtcc_tsn_acknowledged(struct sctp_nets *net, struct sctp_tmit_chunk *tp1) { @@ -1438,7 +1436,6 @@ sctp_set_rtcc_initial_cc_param(struct sctp_tcb *stcb, net->cc_mod.rtcc.step_cnt = 0; net->cc_mod.rtcc.last_step_state = 0; - } static int @@ -2051,7 +2048,7 @@ htcp_cong_avoid(struct sctp_tcb *stcb, struct sctp_net { /*- * How to handle these functions? - * if (!tcp_is_cwnd_limited(sk, in_flight)) RRS - good question. + * if (!tcp_is_cwnd_limited(sk, in_flight)) RRS - good question. * return; */ if (net->cwnd <= net->ssthresh) { Modified: stable/12/sys/netinet/sctp_header.h ============================================================================== --- stable/12/sys/netinet/sctp_header.h Thu Oct 1 16:18:49 2020 (r366322) +++ stable/12/sys/netinet/sctp_header.h Thu Oct 1 16:22:34 2020 (r366323) @@ -544,43 +544,43 @@ struct sctp_auth_chunk { #ifndef SCTP_MAX_OVERHEAD #ifdef INET6 #define SCTP_MAX_OVERHEAD (sizeof(struct sctp_data_chunk) + \ - sizeof(struct sctphdr) + \ - sizeof(struct sctp_ecne_chunk) + \ - sizeof(struct sctp_sack_chunk) + \ - sizeof(struct ip6_hdr)) + sizeof(struct sctphdr) + \ + sizeof(struct sctp_ecne_chunk) + \ + sizeof(struct sctp_sack_chunk) + \ + sizeof(struct ip6_hdr)) #define SCTP_MED_OVERHEAD (sizeof(struct sctp_data_chunk) + \ - sizeof(struct sctphdr) + \ - sizeof(struct ip6_hdr)) + sizeof(struct sctphdr) + \ + sizeof(struct ip6_hdr)) #define SCTP_MIN_OVERHEAD (sizeof(struct ip6_hdr) + \ - sizeof(struct sctphdr)) + sizeof(struct sctphdr)) #else #define SCTP_MAX_OVERHEAD (sizeof(struct sctp_data_chunk) + \ - sizeof(struct sctphdr) + \ - sizeof(struct sctp_ecne_chunk) + \ - sizeof(struct sctp_sack_chunk) + \ - sizeof(struct ip)) + sizeof(struct sctphdr) + \ + sizeof(struct sctp_ecne_chunk) + \ + sizeof(struct sctp_sack_chunk) + \ + sizeof(struct ip)) #define SCTP_MED_OVERHEAD (sizeof(struct sctp_data_chunk) + \ - sizeof(struct sctphdr) + \ - sizeof(struct ip)) + sizeof(struct sctphdr) + \ + sizeof(struct ip)) #define SCTP_MIN_OVERHEAD (sizeof(struct ip) + \ - sizeof(struct sctphdr)) + sizeof(struct sctphdr)) #endif /* INET6 */ #endif /* !SCTP_MAX_OVERHEAD */ #define SCTP_MED_V4_OVERHEAD (sizeof(struct sctp_data_chunk) + \ - sizeof(struct sctphdr) + \ - sizeof(struct ip)) + sizeof(struct sctphdr) + \ + sizeof(struct ip)) #define SCTP_MIN_V4_OVERHEAD (sizeof(struct ip) + \ - sizeof(struct sctphdr)) + sizeof(struct sctphdr)) #undef SCTP_PACKED #endif /* !__sctp_header_h__ */ Modified: stable/12/sys/netinet/sctp_indata.c ============================================================================== --- stable/12/sys/netinet/sctp_indata.c Thu Oct 1 16:18:49 2020 (r366322) +++ stable/12/sys/netinet/sctp_indata.c Thu Oct 1 16:22:34 2020 (r366323) @@ -2542,7 +2542,6 @@ sctp_slide_mapping_arrays(struct sctp_tcb *stcb) * we will be able to slide it forward. Really I * don't think this should happen :-0 */ - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_MAP_LOGGING_ENABLE) { sctp_log_map((uint32_t)distance, (uint32_t)slide_from, (uint32_t)asoc->mapping_array_size, @@ -2627,8 +2626,7 @@ sctp_sack_check(struct sctp_tcb *stcb, int was_a_gap) (stcb->asoc.numduptsns) || /* we have dup's */ (is_a_gap) || /* is still a gap */ (stcb->asoc.delayed_ack == 0) || /* Delayed sack disabled */ - (stcb->asoc.data_pkts_seen >= stcb->asoc.sack_freq) /* hit limit of pkts */ - ) { + (stcb->asoc.data_pkts_seen >= stcb->asoc.sack_freq)) { /* hit limit of pkts */ if ((stcb->asoc.sctp_cmt_on_off > 0) && (SCTP_BASE_SYSCTL(sctp_cmt_use_dac)) && @@ -2639,14 +2637,13 @@ sctp_sack_check(struct sctp_tcb *stcb, int was_a_gap) /* * CMT DAC algorithm: With CMT, delay acks - * even in the face of - * - * reordering. Therefore, if acks that do - * not have to be sent because of the above - * reasons, will be delayed. That is, acks - * that would have been sent due to gap - * reports will be delayed with DAC. Start - * the delayed ack timer. + * even in the face of reordering. + * Therefore, if acks that do not have to be + * sent because of the above reasons, will + * be delayed. That is, acks that would have + * been sent due to gap reports will be + * delayed with DAC. Start the delayed ack + * timer. */ sctp_timer_start(SCTP_TIMER_TYPE_RECV, stcb->sctp_ep, stcb, NULL); @@ -3707,9 +3704,7 @@ sctp_strike_gap_ack_chunks(struct sctp_tcb *stcb, stru tp1->whoTo->find_pseudo_cumack = 1; tp1->whoTo->find_rtx_pseudo_cumack = 1; } - } else { /* CMT is OFF */ - #ifdef SCTP_FR_TO_ALTERNATE /* Can we find an alternate? */ alt = sctp_find_alternate_net(stcb, tp1->whoTo, 0); @@ -4116,7 +4111,6 @@ sctp_express_handle_sack(struct sctp_tcb *stcb, uint32 tp1->whoTo->new_pseudo_cumack = 1; tp1->whoTo->find_pseudo_cumack = 1; tp1->whoTo->find_rtx_pseudo_cumack = 1; - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_LOGGING_ENABLE) { /* sa_ignore NO_NULL_CHK */ sctp_log_cwnd(stcb, tp1->whoTo, tp1->rec.data.tsn, SCTP_CWND_LOG_FROM_SACK); @@ -4716,7 +4710,6 @@ hopeless_peer: tp1->whoTo->new_pseudo_cumack = 1; tp1->whoTo->find_pseudo_cumack = 1; tp1->whoTo->find_rtx_pseudo_cumack = 1; - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_SACK_LOGGING_ENABLE) { sctp_log_sack(asoc->last_acked_seq, Modified: stable/12/sys/netinet/sctp_lock_bsd.h ============================================================================== --- stable/12/sys/netinet/sctp_lock_bsd.h Thu Oct 1 16:18:49 2020 (r366322) +++ stable/12/sys/netinet/sctp_lock_bsd.h Thu Oct 1 16:22:34 2020 (r366323) @@ -159,7 +159,7 @@ __FBSDID("$FreeBSD$"); rw_wunlock(&SCTP_BASE_INFO(ipi_addr_mtx)); \ } \ rw_destroy(&SCTP_BASE_INFO(ipi_addr_mtx)); \ -} while (0) +} while (0) #define SCTP_IPI_ADDR_RLOCK() do { \ rw_rlock(&SCTP_BASE_INFO(ipi_addr_mtx)); \ Modified: stable/12/sys/netinet/sctp_output.c ============================================================================== --- stable/12/sys/netinet/sctp_output.c Thu Oct 1 16:18:49 2020 (r366322) +++ stable/12/sys/netinet/sctp_output.c Thu Oct 1 16:22:34 2020 (r366323) @@ -9845,7 +9845,6 @@ one_chunk_around: atomic_add_int(&((asoc)->total_output_queue_size), data_list[i]->book_size); data_list[i]->book_size *= 2; - } else { if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LOG_RWND_ENABLE) { sctp_log_rwnd(SCTP_DECREASE_PEER_RWND, Modified: stable/12/sys/netinet/sctp_output.h ============================================================================== --- stable/12/sys/netinet/sctp_output.h Thu Oct 1 16:18:49 2020 (r366322) +++ stable/12/sys/netinet/sctp_output.h Thu Oct 1 16:22:34 2020 (r366323) @@ -69,11 +69,10 @@ sctp_source_address_selection(struct sctp_inpcb *inp, sctp_route_t *ro, struct sctp_nets *net, int non_asoc_addr_ok, uint32_t vrf_id); -int - sctp_v6src_match_nexthop(struct sockaddr_in6 *src6, sctp_route_t *ro); -int - sctp_v4src_match_nexthop(struct sctp_ifa *sifa, sctp_route_t *ro); +int sctp_v6src_match_nexthop(struct sockaddr_in6 *src6, sctp_route_t *ro); +int sctp_v4src_match_nexthop(struct sctp_ifa *sifa, sctp_route_t *ro); + void sctp_send_initiate(struct sctp_inpcb *, struct sctp_tcb *, int); void @@ -134,8 +133,8 @@ void sctp_move_chunks_from_net(struct sctp_tcb *stcb, #define SCTP_DATA_CHUNK_OVERHEAD(stcb) ((stcb)->asoc.idata_supported ? \ - sizeof(struct sctp_idata_chunk) : \ - sizeof(struct sctp_data_chunk)) + sizeof(struct sctp_idata_chunk) : \ + sizeof(struct sctp_data_chunk)) int sctp_output(struct sctp_inpcb *, struct mbuf *, struct sockaddr *, Modified: stable/12/sys/netinet/sctp_pcb.c ============================================================================== --- stable/12/sys/netinet/sctp_pcb.c Thu Oct 1 16:18:49 2020 (r366322) +++ stable/12/sys/netinet/sctp_pcb.c Thu Oct 1 16:22:34 2020 (r366323) @@ -3625,7 +3625,6 @@ sctp_inpcb_free(struct sctp_inpcb *inp, int immediate, sctp_log_closing(inp, NULL, 5); #endif - if ((inp->sctp_asocidhash) != NULL) { SCTP_HASH_FREE(inp->sctp_asocidhash, inp->hashasocidmark); inp->sctp_asocidhash = NULL; @@ -3661,7 +3660,6 @@ sctp_inpcb_free(struct sctp_inpcb *inp, int immediate, ip_pcb->inp_options = 0; } - #ifdef INET6 if (ip_pcb->inp_vflag & INP_IPV6) { ip6_freepcbopts(ip_pcb->in6p_outputopts); @@ -5791,7 +5789,6 @@ sctp_pcb_init(void) SCTP_BASE_INFO(sctp_tcpephash) = SCTP_HASH_INIT(SCTP_BASE_SYSCTL(sctp_hashtblsize), &SCTP_BASE_INFO(hashtcpmark)); SCTP_BASE_INFO(hashtblsize) = SCTP_BASE_SYSCTL(sctp_hashtblsize); - SCTP_BASE_INFO(sctp_vrfhash) = SCTP_HASH_INIT(SCTP_SIZE_OF_VRF_HASH, &SCTP_BASE_INFO(hashvrfmark)); Modified: stable/12/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/12/sys/netinet/sctp_usrreq.c Thu Oct 1 16:18:49 2020 (r366322) +++ stable/12/sys/netinet/sctp_usrreq.c Thu Oct 1 16:22:34 2020 (r366323) @@ -2610,7 +2610,6 @@ flags_out: sstat->sstat_penddata = (stcb->asoc.cnt_on_reasm_queue + stcb->asoc.cnt_on_all_streams); - sstat->sstat_instrms = stcb->asoc.streamincnt; sstat->sstat_outstrms = stcb->asoc.streamoutcnt; sstat->sstat_fragmentation_point = sctp_get_frag_point(stcb, &stcb->asoc); From owner-svn-src-all@freebsd.org Thu Oct 1 16:23:35 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C5BC442CEA7; Thu, 1 Oct 2020 16:23:35 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2JMq4vdMz4M3C; Thu, 1 Oct 2020 16:23:35 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8B6D31386C; Thu, 1 Oct 2020 16:23:35 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 091GNZSQ024175; Thu, 1 Oct 2020 16:23:35 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 091GNZYk024174; Thu, 1 Oct 2020 16:23:35 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202010011623.091GNZYk024174@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 1 Oct 2020 16:23:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366324 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 366324 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Oct 2020 16:23:35 -0000 Author: tuexen Date: Thu Oct 1 16:23:35 2020 New Revision: 366324 URL: https://svnweb.freebsd.org/changeset/base/366324 Log: MFC r366198: Improve the handling of receiving unordered and unreliable user messages using DATA chunks. Don't use fsn_included when not being sure that it is set to an appropriate value. If the default is used, which is -1, this can result in SCTP associaitons not making any user visible progress. Thanks to Yutaka Takeda for reporting this issue for the the userland stack in https://github.com/pion/sctp/issues/138. Modified: stable/12/sys/netinet/sctp_indata.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/sctp_indata.c ============================================================================== --- stable/12/sys/netinet/sctp_indata.c Thu Oct 1 16:22:34 2020 (r366323) +++ stable/12/sys/netinet/sctp_indata.c Thu Oct 1 16:23:35 2020 (r366324) @@ -5430,7 +5430,9 @@ sctp_flush_reassm_for_str_seq(struct sctp_tcb *stcb, * it can be delivered... But for now we just dump everything on the * queue. */ - if (!asoc->idata_supported && !ordered && SCTP_TSN_GT(control->fsn_included, cumtsn)) { + if (!asoc->idata_supported && !ordered && + control->first_frag_seen && + SCTP_TSN_GT(control->fsn_included, cumtsn)) { return; } TAILQ_FOREACH_SAFE(chk, &control->reasm, sctp_next, nchk) { From owner-svn-src-all@freebsd.org Thu Oct 1 16:24:29 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6A78142CD47; Thu, 1 Oct 2020 16:24:29 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2JNs1w2Xz4MKW; Thu, 1 Oct 2020 16:24:29 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 25B8213A23; Thu, 1 Oct 2020 16:24:29 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 091GOTWH024273; Thu, 1 Oct 2020 16:24:29 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 091GOTM8024272; Thu, 1 Oct 2020 16:24:29 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202010011624.091GOTM8024272@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 1 Oct 2020 16:24:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366325 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 366325 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Oct 2020 16:24:29 -0000 Author: tuexen Date: Thu Oct 1 16:24:28 2020 New Revision: 366325 URL: https://svnweb.freebsd.org/changeset/base/366325 Log: MFC r366199: Cleanup, no functional change intended. Modified: stable/12/sys/netinet/sctp_indata.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/sctp_indata.c ============================================================================== --- stable/12/sys/netinet/sctp_indata.c Thu Oct 1 16:23:35 2020 (r366324) +++ stable/12/sys/netinet/sctp_indata.c Thu Oct 1 16:24:28 2020 (r366325) @@ -5420,7 +5420,6 @@ sctp_flush_reassm_for_str_seq(struct sctp_tcb *stcb, struct sctp_queued_to_read *control, int ordered, uint32_t cumtsn) { struct sctp_tmit_chunk *chk, *nchk; - int cnt_removed = 0; /* * For now large messages held on the stream reasm that are complete @@ -5437,12 +5436,11 @@ sctp_flush_reassm_for_str_seq(struct sctp_tcb *stcb, } TAILQ_FOREACH_SAFE(chk, &control->reasm, sctp_next, nchk) { /* Purge hanging chunks */ - if (!asoc->idata_supported && (ordered == 0)) { + if (!asoc->idata_supported && !ordered) { if (SCTP_TSN_GT(chk->rec.data.tsn, cumtsn)) { break; } } - cnt_removed++; TAILQ_REMOVE(&control->reasm, chk, sctp_next); if (asoc->size_on_reasm_queue >= chk->send_size) { asoc->size_on_reasm_queue -= chk->send_size; From owner-svn-src-all@freebsd.org Thu Oct 1 16:25:36 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3F5DD42D0A6; Thu, 1 Oct 2020 16:25:36 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2JQ80xJFz4MNL; Thu, 1 Oct 2020 16:25:36 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0305113931; Thu, 1 Oct 2020 16:25:36 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 091GPZDF024390; Thu, 1 Oct 2020 16:25:35 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 091GPZNT024389; Thu, 1 Oct 2020 16:25:35 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202010011625.091GPZNT024389@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 1 Oct 2020 16:25:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366326 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 366326 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Oct 2020 16:25:36 -0000 Author: tuexen Date: Thu Oct 1 16:25:35 2020 New Revision: 366326 URL: https://svnweb.freebsd.org/changeset/base/366326 Log: MFC r366226: Minor cleanup. Modified: stable/12/sys/netinet/sctp_pcb.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/sctp_pcb.c ============================================================================== --- stable/12/sys/netinet/sctp_pcb.c Thu Oct 1 16:24:28 2020 (r366325) +++ stable/12/sys/netinet/sctp_pcb.c Thu Oct 1 16:25:35 2020 (r366326) @@ -6592,7 +6592,7 @@ sctp_load_addresses_from_init(struct sctp_tcb *stcb, s (ptype == SCTP_DEL_IP_ADDRESS) || (ptype == SCTP_ERROR_CAUSE_IND) || (ptype == SCTP_SUCCESS_REPORT)) { - /* don't care */ ; + /* don't care */ } else { if ((ptype & 0x8000) == 0x0000) { /* From owner-svn-src-all@freebsd.org Thu Oct 1 16:37:50 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9B9A642D53D; Thu, 1 Oct 2020 16:37:50 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2JhG3Wtpz4Mvv; Thu, 1 Oct 2020 16:37:50 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5C8B813C2E; Thu, 1 Oct 2020 16:37:50 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 091Gbows030741; Thu, 1 Oct 2020 16:37:50 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 091GboQM030739; Thu, 1 Oct 2020 16:37:50 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <202010011637.091GboQM030739@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Thu, 1 Oct 2020 16:37:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366327 - in head/lib/libc: gen net X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in head/lib/libc: gen net X-SVN-Commit-Revision: 366327 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Oct 2020 16:37:50 -0000 Author: ngie Date: Thu Oct 1 16:37:49 2020 New Revision: 366327 URL: https://svnweb.freebsd.org/changeset/base/366327 Log: Eliminate duplicate `afterinstallconfigs` target Define separate dependent targets which `afterinstallconfigs` relies on, in order to modify `${DESTDIR}/etc/master.passwd` and `${DESTDIR}/etc/nsswitch.conf`. Mark these targets .PHONY, since they manipulate configurations on the fly and the generation logic isn't 100% defined in terms of the source files/logic, and is variable, based on MK_foo flags. MFC after: 2 weeks Reviewed by: bapt, brd Differential Revision: https://reviews.freebsd.org/D20330 Modified: head/lib/libc/gen/Makefile.inc head/lib/libc/net/Makefile.inc Modified: head/lib/libc/gen/Makefile.inc ============================================================================== --- head/lib/libc/gen/Makefile.inc Thu Oct 1 16:25:35 2020 (r366326) +++ head/lib/libc/gen/Makefile.inc Thu Oct 1 16:37:49 2020 (r366327) @@ -552,7 +552,8 @@ MLINKS+=wordexp.3 wordfree.3 .include -afterinstallconfig: +afterinstallconfig: install-passwd +install-passwd: .PHONY .if ${MK_TCSH} == "no" sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd .endif Modified: head/lib/libc/net/Makefile.inc ============================================================================== --- head/lib/libc/net/Makefile.inc Thu Oct 1 16:25:35 2020 (r366326) +++ head/lib/libc/net/Makefile.inc Thu Oct 1 16:37:49 2020 (r366327) @@ -124,8 +124,9 @@ SRCS+= hesiod.c MAN+= hesiod.3 .endif +afterinstallconfig: modify-nsswitch-conf +modify-nsswitch-conf: .PHONY .if ${MK_NIS} == "no" -afterinstallconfig: sed -i "" -e 's/.*_compat:/# &/' -e 's/compat$$/files/' \ ${DESTDIR}/etc/nsswitch.conf .endif From owner-svn-src-all@freebsd.org Thu Oct 1 16:45:13 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 11E1242D56A; Thu, 1 Oct 2020 16:45:13 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2Jrm6jk8z4NSb; Thu, 1 Oct 2020 16:45:12 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C9BE913FBD; Thu, 1 Oct 2020 16:45:12 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 091GjCvW036910; Thu, 1 Oct 2020 16:45:12 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 091GjCuW036906; Thu, 1 Oct 2020 16:45:12 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202010011645.091GjCuW036906@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 1 Oct 2020 16:45:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366328 - in head/sys/amd64/vmm: . amd intel X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/sys/amd64/vmm: . amd intel X-SVN-Commit-Revision: 366328 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Oct 2020 16:45:13 -0000 Author: jhb Date: Thu Oct 1 16:45:11 2020 New Revision: 366328 URL: https://svnweb.freebsd.org/changeset/base/366328 Log: Clear the upper 32-bits of registers in x86_emulate_cpuid(). Per the Intel manuals, CPUID is supposed to unconditionally zero the upper 32 bits of the involved (rax/rbx/rcx/rdx) registers. Previously, the emulation would cast pointers to the 64-bit register values down to `uint32_t`, which while properly manipulating the lower bits, would leave any garbage in the upper bits uncleared. While no existing guest OSes seem to stumble over this in practice, the bhyve emulation should match x86 expectations. This was discovered through alignment warnings emitted by gcc9, while testing it against SmartOS/bhyve. SmartOS bug: https://smartos.org/bugview/OS-8168 Submitted by: Patrick Mooney Reviewed by: rgrimes Differential Revision: https://reviews.freebsd.org/D24727 Modified: head/sys/amd64/vmm/amd/svm.c head/sys/amd64/vmm/intel/vmx.c head/sys/amd64/vmm/x86.c head/sys/amd64/vmm/x86.h Modified: head/sys/amd64/vmm/amd/svm.c ============================================================================== --- head/sys/amd64/vmm/amd/svm.c Thu Oct 1 16:37:49 2020 (r366327) +++ head/sys/amd64/vmm/amd/svm.c Thu Oct 1 16:45:11 2020 (r366328) @@ -1496,11 +1496,8 @@ svm_vmexit(struct svm_softc *svm_sc, int vcpu, struct break; case VMCB_EXIT_CPUID: vmm_stat_incr(svm_sc->vm, vcpu, VMEXIT_CPUID, 1); - handled = x86_emulate_cpuid(svm_sc->vm, vcpu, - (uint32_t *)&state->rax, - (uint32_t *)&ctx->sctx_rbx, - (uint32_t *)&ctx->sctx_rcx, - (uint32_t *)&ctx->sctx_rdx); + handled = x86_emulate_cpuid(svm_sc->vm, vcpu, &state->rax, + &ctx->sctx_rbx, &ctx->sctx_rcx, &ctx->sctx_rdx); break; case VMCB_EXIT_HLT: vmm_stat_incr(svm_sc->vm, vcpu, VMEXIT_HLT, 1); Modified: head/sys/amd64/vmm/intel/vmx.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx.c Thu Oct 1 16:37:49 2020 (r366327) +++ head/sys/amd64/vmm/intel/vmx.c Thu Oct 1 16:45:11 2020 (r366328) @@ -1193,15 +1193,11 @@ vmx_vminit(struct vm *vm, pmap_t pmap) static int vmx_handle_cpuid(struct vm *vm, int vcpu, struct vmxctx *vmxctx) { - int handled, func; + int handled; - func = vmxctx->guest_rax; - - handled = x86_emulate_cpuid(vm, vcpu, - (uint32_t*)(&vmxctx->guest_rax), - (uint32_t*)(&vmxctx->guest_rbx), - (uint32_t*)(&vmxctx->guest_rcx), - (uint32_t*)(&vmxctx->guest_rdx)); + handled = x86_emulate_cpuid(vm, vcpu, (uint64_t *)&vmxctx->guest_rax, + (uint64_t *)&vmxctx->guest_rbx, (uint64_t *)&vmxctx->guest_rcx, + (uint64_t *)&vmxctx->guest_rdx); return (handled); } Modified: head/sys/amd64/vmm/x86.c ============================================================================== --- head/sys/amd64/vmm/x86.c Thu Oct 1 16:37:49 2020 (r366327) +++ head/sys/amd64/vmm/x86.c Thu Oct 1 16:45:11 2020 (r366328) @@ -87,35 +87,40 @@ log2(u_int x) } int -x86_emulate_cpuid(struct vm *vm, int vcpu_id, - uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx) +x86_emulate_cpuid(struct vm *vm, int vcpu_id, uint64_t *rax, uint64_t *rbx, + uint64_t *rcx, uint64_t *rdx) { const struct xsave_limits *limits; uint64_t cr4; int error, enable_invpcid, enable_rdpid, enable_rdtscp, level, width, x2apic_id; - unsigned int func, regs[4], logical_cpus; + unsigned int func, regs[4], logical_cpus, param; enum x2apic_state x2apic_state; uint16_t cores, maxcpus, sockets, threads; - VCPU_CTR2(vm, vcpu_id, "cpuid %#x,%#x", *eax, *ecx); + /* + * The function of CPUID is controlled through the provided value of + * %eax (and secondarily %ecx, for certain leaf data). + */ + func = (uint32_t)*rax; + param = (uint32_t)*rcx; + VCPU_CTR2(vm, vcpu_id, "cpuid %#x,%#x", func, param); + /* * Requests for invalid CPUID levels should map to the highest * available level instead. */ - if (cpu_exthigh != 0 && *eax >= 0x80000000) { - if (*eax > cpu_exthigh) - *eax = cpu_exthigh; - } else if (*eax >= 0x40000000) { - if (*eax > CPUID_VM_HIGH) - *eax = CPUID_VM_HIGH; - } else if (*eax > cpu_high) { - *eax = cpu_high; + if (cpu_exthigh != 0 && func >= 0x80000000) { + if (func > cpu_exthigh) + func = cpu_exthigh; + } else if (func >= 0x40000000) { + if (func > CPUID_VM_HIGH) + func = CPUID_VM_HIGH; + } else if (func > cpu_high) { + func = cpu_high; } - func = *eax; - /* * In general the approach used for CPU topology is to * advertise a flat topology where all CPUs are packages with @@ -133,10 +138,10 @@ x86_emulate_cpuid(struct vm *vm, int vcpu_id, case CPUID_8000_0003: case CPUID_8000_0004: case CPUID_8000_0006: - cpuid_count(*eax, *ecx, regs); + cpuid_count(func, param, regs); break; case CPUID_8000_0008: - cpuid_count(*eax, *ecx, regs); + cpuid_count(func, param, regs); if (vmm_is_svm()) { /* * As on Intel (0000_0007:0, EDX), mask out @@ -167,7 +172,7 @@ x86_emulate_cpuid(struct vm *vm, int vcpu_id, break; case CPUID_8000_0001: - cpuid_count(*eax, *ecx, regs); + cpuid_count(func, param, regs); /* * Hide SVM from guest. @@ -248,7 +253,7 @@ x86_emulate_cpuid(struct vm *vm, int vcpu_id, */ vm_get_topology(vm, &sockets, &cores, &threads, &maxcpus); - switch (*ecx) { + switch (param) { case 0: logical_cpus = threads; level = 1; @@ -396,7 +401,7 @@ x86_emulate_cpuid(struct vm *vm, int vcpu_id, break; case CPUID_0000_0004: - cpuid_count(*eax, *ecx, regs); + cpuid_count(func, param, regs); if (regs[0] || regs[1] || regs[2] || regs[3]) { vm_get_topology(vm, &sockets, &cores, &threads, @@ -425,8 +430,8 @@ x86_emulate_cpuid(struct vm *vm, int vcpu_id, regs[3] = 0; /* leaf 0 */ - if (*ecx == 0) { - cpuid_count(*eax, *ecx, regs); + if (param == 0) { + cpuid_count(func, param, regs); /* Only leaf 0 is supported */ regs[0] = 0; @@ -485,21 +490,21 @@ x86_emulate_cpuid(struct vm *vm, int vcpu_id, if (vmm_is_intel()) { vm_get_topology(vm, &sockets, &cores, &threads, &maxcpus); - if (*ecx == 0) { + if (param == 0) { logical_cpus = threads; width = log2(logical_cpus); level = CPUID_TYPE_SMT; x2apic_id = vcpu_id; } - if (*ecx == 1) { + if (param == 1) { logical_cpus = threads * cores; width = log2(logical_cpus); level = CPUID_TYPE_CORE; x2apic_id = vcpu_id; } - if (!cpuid_leaf_b || *ecx >= 2) { + if (!cpuid_leaf_b || param >= 2) { width = 0; logical_cpus = 0; level = 0; @@ -508,7 +513,7 @@ x86_emulate_cpuid(struct vm *vm, int vcpu_id, regs[0] = width & 0x1f; regs[1] = logical_cpus & 0xffff; - regs[2] = (level << 8) | (*ecx & 0xff); + regs[2] = (level << 8) | (param & 0xff); regs[3] = x2apic_id; } else { regs[0] = 0; @@ -528,8 +533,8 @@ x86_emulate_cpuid(struct vm *vm, int vcpu_id, break; } - cpuid_count(*eax, *ecx, regs); - switch (*ecx) { + cpuid_count(func, param, regs); + switch (param) { case 0: /* * Only permit the guest to use bits @@ -559,7 +564,7 @@ x86_emulate_cpuid(struct vm *vm, int vcpu_id, * pass through as-is, otherwise return * all zeroes. */ - if (!(limits->xcr0_allowed & (1ul << *ecx))) { + if (!(limits->xcr0_allowed & (1ul << param))) { regs[0] = 0; regs[1] = 0; regs[2] = 0; @@ -596,14 +601,17 @@ default_leaf: * how many unhandled leaf values have been seen. */ atomic_add_long(&bhyve_xcpuids, 1); - cpuid_count(*eax, *ecx, regs); + cpuid_count(func, param, regs); break; } - *eax = regs[0]; - *ebx = regs[1]; - *ecx = regs[2]; - *edx = regs[3]; + /* + * CPUID clears the upper 32-bits of the long-mode registers. + */ + *rax = regs[0]; + *rbx = regs[1]; + *rcx = regs[2]; + *rdx = regs[3]; return (1); } Modified: head/sys/amd64/vmm/x86.h ============================================================================== --- head/sys/amd64/vmm/x86.h Thu Oct 1 16:37:49 2020 (r366327) +++ head/sys/amd64/vmm/x86.h Thu Oct 1 16:45:11 2020 (r366328) @@ -64,8 +64,8 @@ */ #define CPUID_0000_0001_FEAT0_VMX (1<<5) -int x86_emulate_cpuid(struct vm *vm, int vcpu_id, uint32_t *eax, uint32_t *ebx, - uint32_t *ecx, uint32_t *edx); +int x86_emulate_cpuid(struct vm *vm, int vcpu_id, uint64_t *rax, uint64_t *rbx, + uint64_t *rcx, uint64_t *rdx); enum vm_cpuid_capability { VCC_NONE, From owner-svn-src-all@freebsd.org Thu Oct 1 16:53:17 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0A29F42D6EE; Thu, 1 Oct 2020 16:53:17 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2K246bgwz4NsW; Thu, 1 Oct 2020 16:53:16 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C5D4A13CEB; Thu, 1 Oct 2020 16:53:16 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 091GrG06043019; Thu, 1 Oct 2020 16:53:16 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 091GrGjS043017; Thu, 1 Oct 2020 16:53:16 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202010011653.091GrGjS043017@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 1 Oct 2020 16:53:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366329 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 366329 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Oct 2020 16:53:17 -0000 Author: tuexen Date: Thu Oct 1 16:53:16 2020 New Revision: 366329 URL: https://svnweb.freebsd.org/changeset/base/366329 Log: MFC r366248: Improve the input validation and processing of cookies. This avoids setting the association in an inconsistent state, which could result in a use-after-free situation. This can be triggered by a malicious peer, if the peer can modify the cookie without the local endpoint recognizing it. Thanks to Ned Williamson for reporting the issue. Modified: stable/12/sys/netinet/sctp_input.c stable/12/sys/netinet/sctp_pcb.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/sctp_input.c ============================================================================== --- stable/12/sys/netinet/sctp_input.c Thu Oct 1 16:45:11 2020 (r366328) +++ stable/12/sys/netinet/sctp_input.c Thu Oct 1 16:53:16 2020 (r366329) @@ -2040,10 +2040,6 @@ sctp_process_cookie_new(struct mbuf *m, int iphlen, in vrf_id, port); return (NULL); } - /* get the correct sctp_nets */ - if (netp) - *netp = sctp_findnet(stcb, init_src); - asoc = &stcb->asoc; /* get scope variables out of cookie */ asoc->scope.ipv4_local_scope = cookie->ipv4_scope; @@ -2082,10 +2078,7 @@ sctp_process_cookie_new(struct mbuf *m, int iphlen, in asoc->advanced_peer_ack_point = asoc->last_acked_seq; /* process the INIT info (peer's info) */ - if (netp) - retval = sctp_process_init(init_cp, stcb); - else - retval = 0; + retval = sctp_process_init(init_cp, stcb); if (retval < 0) { (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_19); @@ -2199,19 +2192,21 @@ sctp_process_cookie_new(struct mbuf *m, int iphlen, in */ ; } - /* since we did not send a HB make sure we don't double things */ - if ((netp) && (*netp)) - (*netp)->hb_responded = 1; - if (stcb->asoc.sctp_autoclose_ticks && sctp_is_feature_on(inp, SCTP_PCB_FLAGS_AUTOCLOSE)) { sctp_timer_start(SCTP_TIMER_TYPE_AUTOCLOSE, inp, stcb, NULL); } (void)SCTP_GETTIME_TIMEVAL(&stcb->asoc.time_entered); - if ((netp != NULL) && (*netp != NULL)) { + *netp = sctp_findnet(stcb, init_src); + if (*netp != NULL) { struct timeval old; - /* calculate the RTT and set the encaps port */ + /* + * Since we did not send a HB, make sure we don't double + * things. + */ + (*netp)->hb_responded = 1; + /* Calculate the RTT. */ old.tv_sec = cookie->time_entered.tv_sec; old.tv_usec = cookie->time_entered.tv_usec; sctp_calculate_rto(stcb, asoc, *netp, &old, SCTP_RTT_FROM_NON_DATA); Modified: stable/12/sys/netinet/sctp_pcb.c ============================================================================== --- stable/12/sys/netinet/sctp_pcb.c Thu Oct 1 16:45:11 2020 (r366328) +++ stable/12/sys/netinet/sctp_pcb.c Thu Oct 1 16:53:16 2020 (r366329) @@ -4291,7 +4291,9 @@ sctp_aloc_assoc(struct sctp_inpcb *inp, struct sockadd if ((ntohs(sin->sin_port) == 0) || (sin->sin_addr.s_addr == INADDR_ANY) || (sin->sin_addr.s_addr == INADDR_BROADCAST) || - IN_MULTICAST(ntohl(sin->sin_addr.s_addr))) { + IN_MULTICAST(ntohl(sin->sin_addr.s_addr)) || + (((inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) != 0) && + (SCTP_IPV6_V6ONLY(inp) != 0))) { /* Invalid address */ SCTP_INP_RUNLOCK(inp); SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PCB, EINVAL); @@ -4310,7 +4312,8 @@ sctp_aloc_assoc(struct sctp_inpcb *inp, struct sockadd sin6 = (struct sockaddr_in6 *)firstaddr; if ((ntohs(sin6->sin6_port) == 0) || IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr) || - IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr)) { + IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr) || + ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) == 0)) { /* Invalid address */ SCTP_INP_RUNLOCK(inp); SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PCB, EINVAL); From owner-svn-src-all@freebsd.org Thu Oct 1 16:55:01 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E657542D8DB; Thu, 1 Oct 2020 16:55:01 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2K455phyz4PRV; Thu, 1 Oct 2020 16:55:01 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AC16913D74; Thu, 1 Oct 2020 16:55:01 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 091Gt1he043295; Thu, 1 Oct 2020 16:55:01 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 091Gt1cR043294; Thu, 1 Oct 2020 16:55:01 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202010011655.091Gt1cR043294@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 1 Oct 2020 16:55:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366330 - head/sys/dev/ichsmb X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/dev/ichsmb X-SVN-Commit-Revision: 366330 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Oct 2020 16:55:02 -0000 Author: manu Date: Thu Oct 1 16:55:01 2020 New Revision: 366330 URL: https://svnweb.freebsd.org/changeset/base/366330 Log: ichsmb_pci: convert to pci_device_table / add PCI_PNP_INFO Submitted by: Greg V Reviewed by: mav Differential Revision: https://reviews.freebsd.org/D25260 Modified: head/sys/dev/ichsmb/ichsmb_pci.c Modified: head/sys/dev/ichsmb/ichsmb_pci.c ============================================================================== --- head/sys/dev/ichsmb/ichsmb_pci.c Thu Oct 1 16:53:16 2020 (r366329) +++ head/sys/dev/ichsmb/ichsmb_pci.c Thu Oct 1 16:55:01 2020 (r366330) @@ -106,51 +106,87 @@ __FBSDID("$FreeBSD$"); #define ID_KABYLAKE 0xa2a3 #define ID_CANNONLAKE 0xa323 -static const struct ichsmb_device { - uint16_t id; - const char *name; -} ichsmb_devices[] = { - { ID_82801AA, "Intel 82801AA (ICH) SMBus controller" }, - { ID_82801AB, "Intel 82801AB (ICH0) SMBus controller" }, - { ID_82801BA, "Intel 82801BA (ICH2) SMBus controller" }, - { ID_82801CA, "Intel 82801CA (ICH3) SMBus controller" }, - { ID_82801DC, "Intel 82801DC (ICH4) SMBus controller" }, - { ID_82801EB, "Intel 82801EB (ICH5) SMBus controller" }, - { ID_82801FB, "Intel 82801FB (ICH6) SMBus controller" }, - { ID_82801GB, "Intel 82801GB (ICH7) SMBus controller" }, - { ID_82801H, "Intel 82801H (ICH8) SMBus controller" }, - { ID_82801I, "Intel 82801I (ICH9) SMBus controller" }, - { ID_82801GB, "Intel 82801GB (ICH7) SMBus controller" }, - { ID_82801H, "Intel 82801H (ICH8) SMBus controller" }, - { ID_82801I, "Intel 82801I (ICH9) SMBus controller" }, - { ID_EP80579, "Intel EP80579 SMBus controller" }, - { ID_82801JI, "Intel 82801JI (ICH10) SMBus controller" }, - { ID_82801JD, "Intel 82801JD (ICH10) SMBus controller" }, - { ID_PCH, "Intel PCH SMBus controller" }, - { ID_6300ESB, "Intel 6300ESB (ICH) SMBus controller" }, - { ID_631xESB, "Intel 631xESB/6321ESB (ESB2) SMBus controller" }, - { ID_DH89XXCC, "Intel DH89xxCC SMBus controller" }, - { ID_PATSBURG, "Intel Patsburg SMBus controller" }, - { ID_CPT, "Intel Cougar Point SMBus controller" }, - { ID_PPT, "Intel Panther Point SMBus controller" }, - { ID_AVOTON, "Intel Avoton SMBus controller" }, - { ID_LPT, "Intel Lynx Point SMBus controller" }, - { ID_LPTLP, "Intel Lynx Point-LP SMBus controller" }, - { ID_WCPT, "Intel Wildcat Point SMBus controller" }, - { ID_WCPTLP, "Intel Wildcat Point-LP SMBus controller" }, - { ID_BAYTRAIL, "Intel Baytrail SMBus controller" }, - { ID_BRASWELL, "Intel Braswell SMBus controller" }, - { ID_COLETOCRK, "Intel Coleto Creek SMBus controller" }, - { ID_WELLSBURG, "Intel Wellsburg SMBus controller" }, - { ID_SRPT, "Intel Sunrise Point-H SMBus controller" }, - { ID_SRPTLP, "Intel Sunrise Point-LP SMBus controller" }, - { ID_DENVERTON, "Intel Denverton SMBus controller" }, - { ID_BROXTON, "Intel Broxton SMBus controller" }, - { ID_LEWISBURG, "Intel Lewisburg SMBus controller" }, - { ID_LEWISBURG2,"Intel Lewisburg SMBus controller" }, - { ID_KABYLAKE, "Intel Kaby Lake SMBus controller" }, - { ID_CANNONLAKE,"Intel Cannon Lake SMBus controller" }, - { 0, NULL }, +static const struct pci_device_table ichsmb_devices[] = { + { PCI_DEV(PCI_VENDOR_INTEL, ID_82801AA), + PCI_DESCR("Intel 82801AA (ICH) SMBus controller") }, + { PCI_DEV(PCI_VENDOR_INTEL, ID_82801AB), + PCI_DESCR("Intel 82801AB (ICH0) SMBus controller") }, + { PCI_DEV(PCI_VENDOR_INTEL, ID_82801BA), + PCI_DESCR("Intel 82801BA (ICH2) SMBus controller") }, + { PCI_DEV(PCI_VENDOR_INTEL, ID_82801CA), + PCI_DESCR("Intel 82801CA (ICH3) SMBus controller") }, + { PCI_DEV(PCI_VENDOR_INTEL, ID_82801DC), + PCI_DESCR("Intel 82801DC (ICH4) SMBus controller") }, + { PCI_DEV(PCI_VENDOR_INTEL, ID_82801EB), + PCI_DESCR("Intel 82801EB (ICH5) SMBus controller") }, + { PCI_DEV(PCI_VENDOR_INTEL, ID_82801FB), + PCI_DESCR("Intel 82801FB (ICH6) SMBus controller") }, + { PCI_DEV(PCI_VENDOR_INTEL, ID_82801GB), + PCI_DESCR("Intel 82801GB (ICH7) SMBus controller") }, + { PCI_DEV(PCI_VENDOR_INTEL, ID_82801H), + PCI_DESCR("Intel 82801H (ICH8) SMBus controller") }, + { PCI_DEV(PCI_VENDOR_INTEL, ID_82801I), + PCI_DESCR("Intel 82801I (ICH9) SMBus controller") }, + { PCI_DEV(PCI_VENDOR_INTEL, ID_82801GB), + PCI_DESCR("Intel 82801GB (ICH7) SMBus controller") }, + { PCI_DEV(PCI_VENDOR_INTEL, ID_82801H), + PCI_DESCR("Intel 82801H (ICH8) SMBus controller") }, + { PCI_DEV(PCI_VENDOR_INTEL, ID_82801I), + PCI_DESCR("Intel 82801I (ICH9) SMBus controller") }, + { PCI_DEV(PCI_VENDOR_INTEL, ID_EP80579), + PCI_DESCR("Intel EP80579 SMBus controller") }, + { PCI_DEV(PCI_VENDOR_INTEL, ID_82801JI), + PCI_DESCR("Intel 82801JI (ICH10) SMBus controller") }, + { PCI_DEV(PCI_VENDOR_INTEL, ID_82801JD), + PCI_DESCR("Intel 82801JD (ICH10) SMBus controller") }, + { PCI_DEV(PCI_VENDOR_INTEL, ID_PCH), + PCI_DESCR("Intel PCH SMBus controller") }, + { PCI_DEV(PCI_VENDOR_INTEL, ID_6300ESB), + PCI_DESCR("Intel 6300ESB (ICH) SMBus controller") }, + { PCI_DEV(PCI_VENDOR_INTEL, ID_631xESB), + PCI_DESCR("Intel 631xESB/6321ESB (ESB2) SMBus controller") }, + { PCI_DEV(PCI_VENDOR_INTEL, ID_DH89XXCC), + PCI_DESCR("Intel DH89xxCC SMBus controller") }, + { PCI_DEV(PCI_VENDOR_INTEL, ID_PATSBURG), + PCI_DESCR("Intel Patsburg SMBus controller") }, + { PCI_DEV(PCI_VENDOR_INTEL, ID_CPT), + PCI_DESCR("Intel Cougar Point SMBus controller") }, + { PCI_DEV(PCI_VENDOR_INTEL, ID_PPT), + PCI_DESCR("Intel Panther Point SMBus controller") }, + { PCI_DEV(PCI_VENDOR_INTEL, ID_AVOTON), + PCI_DESCR("Intel Avoton SMBus controller") }, + { PCI_DEV(PCI_VENDOR_INTEL, ID_LPT), + PCI_DESCR("Intel Lynx Point SMBus controller") }, + { PCI_DEV(PCI_VENDOR_INTEL, ID_LPTLP), + PCI_DESCR("Intel Lynx Point-LP SMBus controller") }, + { PCI_DEV(PCI_VENDOR_INTEL, ID_WCPT), + PCI_DESCR("Intel Wildcat Point SMBus controller") }, + { PCI_DEV(PCI_VENDOR_INTEL, ID_WCPTLP), + PCI_DESCR("Intel Wildcat Point-LP SMBus controller") }, + { PCI_DEV(PCI_VENDOR_INTEL, ID_BAYTRAIL), + PCI_DESCR("Intel Baytrail SMBus controller") }, + { PCI_DEV(PCI_VENDOR_INTEL, ID_BRASWELL), + PCI_DESCR("Intel Braswell SMBus controller") }, + { PCI_DEV(PCI_VENDOR_INTEL, ID_COLETOCRK), + PCI_DESCR("Intel Coleto Creek SMBus controller") }, + { PCI_DEV(PCI_VENDOR_INTEL, ID_WELLSBURG), + PCI_DESCR("Intel Wellsburg SMBus controller") }, + { PCI_DEV(PCI_VENDOR_INTEL, ID_SRPT), + PCI_DESCR("Intel Sunrise Point-H SMBus controller") }, + { PCI_DEV(PCI_VENDOR_INTEL, ID_SRPTLP), + PCI_DESCR("Intel Sunrise Point-LP SMBus controller") }, + { PCI_DEV(PCI_VENDOR_INTEL, ID_DENVERTON), + PCI_DESCR("Intel Denverton SMBus controller") }, + { PCI_DEV(PCI_VENDOR_INTEL, ID_BROXTON), + PCI_DESCR("Intel Broxton SMBus controller") }, + { PCI_DEV(PCI_VENDOR_INTEL, ID_LEWISBURG), + PCI_DESCR("Intel Lewisburg SMBus controller") }, + { PCI_DEV(PCI_VENDOR_INTEL, ID_LEWISBURG2), + PCI_DESCR("Intel Lewisburg SMBus controller") }, + { PCI_DEV(PCI_VENDOR_INTEL, ID_KABYLAKE), + PCI_DESCR("Intel Kaby Lake SMBus controller") }, + { PCI_DEV(PCI_VENDOR_INTEL, ID_CANNONLAKE), + PCI_DESCR("Intel Cannon Lake SMBus controller") }, }; /* Internal functions */ @@ -197,19 +233,14 @@ DRIVER_MODULE(ichsmb, pci, ichsmb_pci_driver, ichsmb_p static int ichsmb_pci_probe(device_t dev) { - const struct ichsmb_device *device; + const struct pci_device_table *tbl; - if (pci_get_vendor(dev) != PCI_VENDOR_INTEL) + tbl = PCI_MATCH(dev, ichsmb_devices); + if (tbl == NULL) return (ENXIO); - for (device = ichsmb_devices; device->name != NULL; device++) { - if (pci_get_device(dev) == device->id) { - device_set_desc(dev, device->name); - return (ichsmb_probe(dev)); - } - } - - return (ENXIO); + device_set_desc(dev, tbl->descr); + return (ichsmb_probe(dev)); } static int @@ -265,3 +296,4 @@ fail: MODULE_DEPEND(ichsmb, pci, 1, 1, 1); MODULE_DEPEND(ichsmb, smbus, SMBUS_MINVER, SMBUS_PREFVER, SMBUS_MAXVER); MODULE_VERSION(ichsmb, 1); +PCI_PNP_INFO(ichsmb_devices); From owner-svn-src-all@freebsd.org Thu Oct 1 17:16:06 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 651CC42E58D; Thu, 1 Oct 2020 17:16:06 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2KXQ22N5z4Qfv; Thu, 1 Oct 2020 17:16:06 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2A83014368; Thu, 1 Oct 2020 17:16:06 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 091HG6VN055736; Thu, 1 Oct 2020 17:16:06 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 091HG6RR055735; Thu, 1 Oct 2020 17:16:06 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202010011716.091HG6RR055735@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 1 Oct 2020 17:16:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366331 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 366331 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Oct 2020 17:16:06 -0000 Author: jhb Date: Thu Oct 1 17:16:05 2020 New Revision: 366331 URL: https://svnweb.freebsd.org/changeset/base/366331 Log: bhyve: Fix build with option BHYVE_SNAPSHOT 'ident' was replaced with 'ata_ident' in revision r363596. Submitted by: Vitaliy Gusev Reviewed by: Darius Mihai Differential Revision: https://reviews.freebsd.org/D26263 Modified: head/usr.sbin/bhyve/pci_ahci.c Modified: head/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- head/usr.sbin/bhyve/pci_ahci.c Thu Oct 1 16:55:01 2020 (r366330) +++ head/usr.sbin/bhyve/pci_ahci.c Thu Oct 1 17:16:05 2020 (r366331) @@ -2684,7 +2684,7 @@ pci_ahci_snapshot(struct vm_snapshot_meta *meta) SNAPSHOT_GUEST2HOST_ADDR_OR_LEAVE(port->rfis, 256, false, meta, ret, done); - SNAPSHOT_VAR_OR_LEAVE(port->ident, meta, ret, done); + SNAPSHOT_VAR_OR_LEAVE(port->ata_ident, meta, ret, done); SNAPSHOT_VAR_OR_LEAVE(port->atapi, meta, ret, done); SNAPSHOT_VAR_OR_LEAVE(port->reset, meta, ret, done); SNAPSHOT_VAR_OR_LEAVE(port->waitforclear, meta, ret, done); From owner-svn-src-all@freebsd.org Thu Oct 1 17:30:39 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 53E2942EB11; Thu, 1 Oct 2020 17:30:39 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2KsC1cCqz4RH9; Thu, 1 Oct 2020 17:30:39 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1A560148A5; Thu, 1 Oct 2020 17:30:39 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 091HUcPM062191; Thu, 1 Oct 2020 17:30:38 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 091HUcft062190; Thu, 1 Oct 2020 17:30:38 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202010011730.091HUcft062190@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 1 Oct 2020 17:30:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r366332 - releng/12.2/sys/cam/scsi X-SVN-Group: releng X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: releng/12.2/sys/cam/scsi X-SVN-Commit-Revision: 366332 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Oct 2020 17:30:39 -0000 Author: jhb Date: Thu Oct 1 17:30:38 2020 New Revision: 366332 URL: https://svnweb.freebsd.org/changeset/base/366332 Log: MFS 366297: Revert most of r360179. I had failed to notice that sgsendccb() was using cam_periph_mapmem() and thus was not passing down user pointers directly to drivers. In practice this broke requests submitted from userland. PR: 249395 Approved by: re (gjb) Modified: releng/12.2/sys/cam/scsi/scsi_sg.c Directory Properties: releng/12.2/ (props changed) Modified: releng/12.2/sys/cam/scsi/scsi_sg.c ============================================================================== --- releng/12.2/sys/cam/scsi/scsi_sg.c Thu Oct 1 17:16:05 2020 (r366331) +++ releng/12.2/sys/cam/scsi/scsi_sg.c Thu Oct 1 17:30:38 2020 (r366332) @@ -508,7 +508,6 @@ sgioctl(struct cdev *dev, u_long cmd, caddr_t arg, int struct cam_periph *periph; struct sg_softc *softc; struct sg_io_hdr *req; - void *data_ptr; int dir, error; periph = (struct cam_periph *)dev->si_drv1; @@ -553,20 +552,12 @@ sgioctl(struct cdev *dev, u_long cmd, caddr_t arg, int break; } - if (req->dxfer_len > MAXPHYS) { - error = EINVAL; - break; - } - - data_ptr = malloc(req->dxfer_len, M_DEVBUF, M_WAITOK); - ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL); csio = &ccb->csio; error = copyin(req->cmdp, &csio->cdb_io.cdb_bytes, req->cmd_len); if (error) { - free(data_ptr, M_DEVBUF); xpt_release_ccb(ccb); break; } @@ -587,21 +578,12 @@ sgioctl(struct cdev *dev, u_long cmd, caddr_t arg, int break; } - if (dir == CAM_DIR_IN || dir == CAM_DIR_BOTH) { - error = copyin(req->dxferp, data_ptr, req->dxfer_len); - if (error) { - free(data_ptr, M_DEVBUF); - xpt_release_ccb(ccb); - break; - } - } - cam_fill_csio(csio, /*retries*/1, /*cbfcnp*/NULL, dir|CAM_DEV_QFRZDIS, MSG_SIMPLE_Q_TAG, - data_ptr, + req->dxferp, req->dxfer_len, req->mx_sb_len, req->cmd_len, @@ -611,7 +593,6 @@ sgioctl(struct cdev *dev, u_long cmd, caddr_t arg, int if (error) { req->host_status = DID_ERROR; req->driver_status = DRIVER_INVALID; - free(data_ptr, M_DEVBUF); xpt_release_ccb(ccb); break; } @@ -630,10 +611,6 @@ sgioctl(struct cdev *dev, u_long cmd, caddr_t arg, int req->sb_len_wr); } - if ((dir == CAM_DIR_OUT || dir == CAM_DIR_BOTH) && error == 0) - error = copyout(data_ptr, req->dxferp, req->dxfer_len); - - free(data_ptr, M_DEVBUF); xpt_release_ccb(ccb); break; From owner-svn-src-all@freebsd.org Thu Oct 1 17:48:18 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EF26042EF33; Thu, 1 Oct 2020 17:48:18 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2LFZ6MFMz4S4d; Thu, 1 Oct 2020 17:48:18 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BD4371494E; Thu, 1 Oct 2020 17:48:18 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 091HmI5H074025; Thu, 1 Oct 2020 17:48:18 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 091HmFdE074010; Thu, 1 Oct 2020 17:48:15 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202010011748.091HmFdE074010@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 1 Oct 2020 17:48:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r366333 - in vendor/llvm-project/release-11.x: lld/docs llvm/include/llvm-c llvm/include/llvm/ADT llvm/lib/CodeGen llvm/lib/CodeGen/AsmPrinter llvm/lib/CodeGen/GlobalISel llvm/lib/CodeG... X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in vendor/llvm-project/release-11.x: lld/docs llvm/include/llvm-c llvm/include/llvm/ADT llvm/lib/CodeGen llvm/lib/CodeGen/AsmPrinter llvm/lib/CodeGen/GlobalISel llvm/lib/CodeGen/SelectionDAG llvm/lib/... X-SVN-Commit-Revision: 366333 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Oct 2020 17:48:19 -0000 Author: dim Date: Thu Oct 1 17:48:15 2020 New Revision: 366333 URL: https://svnweb.freebsd.org/changeset/base/366333 Log: Vendor import of llvm-project branch release/11.x llvmorg-11.0.0-rc5-0-g60a25202a7d. Modified: vendor/llvm-project/release-11.x/lld/docs/ReleaseNotes.rst vendor/llvm-project/release-11.x/llvm/include/llvm-c/Core.h vendor/llvm-project/release-11.x/llvm/include/llvm/ADT/SmallPtrSet.h vendor/llvm-project/release-11.x/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp vendor/llvm-project/release-11.x/llvm/lib/CodeGen/GlobalISel/CallLowering.cpp vendor/llvm-project/release-11.x/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp vendor/llvm-project/release-11.x/llvm/lib/CodeGen/PHIEliminationUtils.cpp vendor/llvm-project/release-11.x/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp vendor/llvm-project/release-11.x/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp vendor/llvm-project/release-11.x/llvm/lib/IR/Core.cpp vendor/llvm-project/release-11.x/llvm/lib/IR/Globals.cpp vendor/llvm-project/release-11.x/llvm/lib/Support/APFloat.cpp vendor/llvm-project/release-11.x/llvm/lib/Target/AArch64/GISel/AArch64CallLowering.cpp vendor/llvm-project/release-11.x/llvm/lib/Target/AMDGPU/AMDGPUCallLowering.cpp Modified: vendor/llvm-project/release-11.x/lld/docs/ReleaseNotes.rst ============================================================================== --- vendor/llvm-project/release-11.x/lld/docs/ReleaseNotes.rst Thu Oct 1 17:30:38 2020 (r366332) +++ vendor/llvm-project/release-11.x/lld/docs/ReleaseNotes.rst Thu Oct 1 17:48:15 2020 (r366333) @@ -5,11 +5,6 @@ lld 11.0.0 Release Notes .. contents:: :local: -.. warning:: - These are in-progress notes for the upcoming LLVM 11.0.0 release. - Release notes for previous releases can be found on - `the Download Page `_. - Introduction ============ @@ -176,12 +171,3 @@ MinGW Improvements ``--disable-runtime-pseudo-reloc``), the ``--no-seh`` flag and options for selecting file and section alignment (``--file-alignment`` and ``--section-alignment``). - -MachO Improvements ------------------- - -* Item 1. - -WebAssembly Improvements ------------------------- - Modified: vendor/llvm-project/release-11.x/llvm/include/llvm-c/Core.h ============================================================================== --- vendor/llvm-project/release-11.x/llvm/include/llvm-c/Core.h Thu Oct 1 17:30:38 2020 (r366332) +++ vendor/llvm-project/release-11.x/llvm/include/llvm-c/Core.h Thu Oct 1 17:48:15 2020 (r366333) @@ -3636,7 +3636,7 @@ void LLVMAddDestination(LLVMValueRef IndirectBr, LLVMB /* Get the number of clauses on the landingpad instruction */ unsigned LLVMGetNumClauses(LLVMValueRef LandingPad); -/* Get the value of the clause at idnex Idx on the landingpad instruction */ +/* Get the value of the clause at index Idx on the landingpad instruction */ LLVMValueRef LLVMGetClause(LLVMValueRef LandingPad, unsigned Idx); /* Add a catch or filter clause to the landingpad instruction */ @@ -3936,6 +3936,26 @@ LLVMValueRef LLVMBuildAtomicCmpXchg(LLVMBuilderRef B, LLVMAtomicOrdering SuccessOrdering, LLVMAtomicOrdering FailureOrdering, LLVMBool SingleThread); + +/** + * Get the number of elements in the mask of a ShuffleVector instruction. + */ +unsigned LLVMGetNumMaskElements(LLVMValueRef ShuffleVectorInst); + +/** + * \returns a constant that specifies that the result of a \c ShuffleVectorInst + * is undefined. + */ +int LLVMGetUndefMaskElem(void); + +/** + * Get the mask value at position Elt in the mask of a ShuffleVector + * instruction. + * + * \Returns the result of \c LLVMGetUndefMaskElem() if the mask value is undef + * at that position. + */ +int LLVMGetMaskValue(LLVMValueRef ShuffleVectorInst, unsigned Elt); LLVMBool LLVMIsAtomicSingleThread(LLVMValueRef AtomicInst); void LLVMSetAtomicSingleThread(LLVMValueRef AtomicInst, LLVMBool SingleThread); Modified: vendor/llvm-project/release-11.x/llvm/include/llvm/ADT/SmallPtrSet.h ============================================================================== --- vendor/llvm-project/release-11.x/llvm/include/llvm/ADT/SmallPtrSet.h Thu Oct 1 17:30:38 2020 (r366332) +++ vendor/llvm-project/release-11.x/llvm/include/llvm/ADT/SmallPtrSet.h Thu Oct 1 17:48:15 2020 (r366333) @@ -378,6 +378,9 @@ class SmallPtrSetImpl : public SmallPtrSetImplBase { ( iterator find(ConstPtrType Ptr) const { return makeIterator(find_imp(ConstPtrTraits::getAsVoidPointer(Ptr))); } + bool contains(ConstPtrType Ptr) const { + return find_imp(ConstPtrTraits::getAsVoidPointer(Ptr)) != EndPointer(); + } template void insert(IterT I, IterT E) { Modified: vendor/llvm-project/release-11.x/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp ============================================================================== --- vendor/llvm-project/release-11.x/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Thu Oct 1 17:30:38 2020 (r366332) +++ vendor/llvm-project/release-11.x/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Thu Oct 1 17:48:15 2020 (r366333) @@ -2779,7 +2779,7 @@ static void emitGlobalConstantImpl(const DataLayout &D if (const ConstantInt *CI = dyn_cast(CV)) { const uint64_t StoreSize = DL.getTypeStoreSize(CV->getType()); - if (StoreSize < 8) { + if (StoreSize <= 8) { if (AP.isVerbose()) AP.OutStreamer->GetCommentOS() << format("0x%" PRIx64 "\n", CI->getZExtValue()); Modified: vendor/llvm-project/release-11.x/llvm/lib/CodeGen/GlobalISel/CallLowering.cpp ============================================================================== --- vendor/llvm-project/release-11.x/llvm/lib/CodeGen/GlobalISel/CallLowering.cpp Thu Oct 1 17:30:38 2020 (r366332) +++ vendor/llvm-project/release-11.x/llvm/lib/CodeGen/GlobalISel/CallLowering.cpp Thu Oct 1 17:48:15 2020 (r366333) @@ -375,13 +375,15 @@ bool CallLowering::handleAssignments(CCState &CCInfo, << "Load/store a split arg to/from the stack not implemented yet"); return false; } - MVT VT = MVT::getVT(Args[i].Ty); - unsigned Size = VT == MVT::iPTR ? DL.getPointerSize() - : alignTo(VT.getSizeInBits(), 8) / 8; + + EVT LocVT = VA.getValVT(); + unsigned MemSize = LocVT == MVT::iPTR ? DL.getPointerSize() + : LocVT.getStoreSize(); + unsigned Offset = VA.getLocMemOffset(); MachinePointerInfo MPO; - Register StackAddr = Handler.getStackAddress(Size, Offset, MPO); - Handler.assignValueToAddress(Args[i], StackAddr, Size, MPO, VA); + Register StackAddr = Handler.getStackAddress(MemSize, Offset, MPO); + Handler.assignValueToAddress(Args[i], StackAddr, MemSize, MPO, VA); } else { // FIXME: Support byvals and other weirdness return false; Modified: vendor/llvm-project/release-11.x/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp ============================================================================== --- vendor/llvm-project/release-11.x/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp Thu Oct 1 17:30:38 2020 (r366332) +++ vendor/llvm-project/release-11.x/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp Thu Oct 1 17:48:15 2020 (r366333) @@ -2368,10 +2368,11 @@ LegalizerHelper::lower(MachineInstr &MI, unsigned Type MI.RemoveOperand(1); Observer.changedInstr(MI); - MIRBuilder.setInsertPt(MIRBuilder.getMBB(), ++MIRBuilder.getInsertPt()); - auto HiPart = MIRBuilder.buildInstr(Opcode, {Ty}, {LHS, RHS}); auto Zero = MIRBuilder.buildConstant(Ty, 0); + + // Move insert point forward so we can use the Res register if needed. + MIRBuilder.setInsertPt(MIRBuilder.getMBB(), ++MIRBuilder.getInsertPt()); // For *signed* multiply, overflow is detected by checking: // (hi != (lo >> bitwidth-1)) Modified: vendor/llvm-project/release-11.x/llvm/lib/CodeGen/PHIEliminationUtils.cpp ============================================================================== --- vendor/llvm-project/release-11.x/llvm/lib/CodeGen/PHIEliminationUtils.cpp Thu Oct 1 17:30:38 2020 (r366332) +++ vendor/llvm-project/release-11.x/llvm/lib/CodeGen/PHIEliminationUtils.cpp Thu Oct 1 17:48:15 2020 (r366333) @@ -27,31 +27,35 @@ llvm::findPHICopyInsertPoint(MachineBasicBlock* MBB, M // Usually, we just want to insert the copy before the first terminator // instruction. However, for the edge going to a landing pad, we must insert // the copy before the call/invoke instruction. Similarly for an INLINEASM_BR - // going to an indirect target. - if (!SuccMBB->isEHPad() && !SuccMBB->isInlineAsmBrIndirectTarget()) + // going to an indirect target. This is similar to SplitKit.cpp's + // computeLastInsertPoint, and similarly assumes that there cannot be multiple + // instructions that are Calls with EHPad successors or INLINEASM_BR in a + // block. + bool EHPadSuccessor = SuccMBB->isEHPad(); + if (!EHPadSuccessor && !SuccMBB->isInlineAsmBrIndirectTarget()) return MBB->getFirstTerminator(); - // Discover any defs/uses in this basic block. - SmallPtrSet DefUsesInMBB; + // Discover any defs in this basic block. + SmallPtrSet DefsInMBB; MachineRegisterInfo& MRI = MBB->getParent()->getRegInfo(); - for (MachineInstr &RI : MRI.reg_instructions(SrcReg)) { + for (MachineInstr &RI : MRI.def_instructions(SrcReg)) if (RI.getParent() == MBB) - DefUsesInMBB.insert(&RI); - } + DefsInMBB.insert(&RI); - MachineBasicBlock::iterator InsertPoint; - if (DefUsesInMBB.empty()) { - // No defs. Insert the copy at the start of the basic block. - InsertPoint = MBB->begin(); - } else if (DefUsesInMBB.size() == 1) { - // Insert the copy immediately after the def/use. - InsertPoint = *DefUsesInMBB.begin(); - ++InsertPoint; - } else { - // Insert the copy immediately after the last def/use. - InsertPoint = MBB->end(); - while (!DefUsesInMBB.count(&*--InsertPoint)) {} - ++InsertPoint; + MachineBasicBlock::iterator InsertPoint = MBB->begin(); + // Insert the copy at the _latest_ point of: + // 1. Immediately AFTER the last def + // 2. Immediately BEFORE a call/inlineasm_br. + for (auto I = MBB->rbegin(), E = MBB->rend(); I != E; ++I) { + if (DefsInMBB.contains(&*I)) { + InsertPoint = std::next(I.getReverse()); + break; + } + if ((EHPadSuccessor && I->isCall()) || + I->getOpcode() == TargetOpcode::INLINEASM_BR) { + InsertPoint = I.getReverse(); + break; + } } // Make sure the copy goes after any phi nodes but before Modified: vendor/llvm-project/release-11.x/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp ============================================================================== --- vendor/llvm-project/release-11.x/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp Thu Oct 1 17:30:38 2020 (r366332) +++ vendor/llvm-project/release-11.x/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp Thu Oct 1 17:48:15 2020 (r366333) @@ -169,32 +169,6 @@ static cl::opt SwitchPeelThreshold( // store [4096 x i8] %data, [4096 x i8]* %buffer static const unsigned MaxParallelChains = 64; -// Return the calling convention if the Value passed requires ABI mangling as it -// is a parameter to a function or a return value from a function which is not -// an intrinsic. -static Optional getABIRegCopyCC(const Value *V) { - if (auto *R = dyn_cast(V)) - return R->getParent()->getParent()->getCallingConv(); - - if (auto *CI = dyn_cast(V)) { - const bool IsInlineAsm = CI->isInlineAsm(); - const bool IsIndirectFunctionCall = - !IsInlineAsm && !CI->getCalledFunction(); - - // It is possible that the call instruction is an inline asm statement or an - // indirect function call in which case the return value of - // getCalledFunction() would be nullptr. - const bool IsInstrinsicCall = - !IsInlineAsm && !IsIndirectFunctionCall && - CI->getCalledFunction()->getIntrinsicID() != Intrinsic::not_intrinsic; - - if (!IsInlineAsm && !IsInstrinsicCall) - return CI->getCallingConv(); - } - - return None; -} - static SDValue getCopyFromPartsVector(SelectionDAG &DAG, const SDLoc &DL, const SDValue *Parts, unsigned NumParts, MVT PartVT, EVT ValueVT, const Value *V, @@ -1624,7 +1598,7 @@ SDValue SelectionDAGBuilder::getValueImpl(const Value unsigned InReg = FuncInfo.InitializeRegForValue(Inst); RegsForValue RFV(*DAG.getContext(), TLI, DAG.getDataLayout(), InReg, - Inst->getType(), getABIRegCopyCC(V)); + Inst->getType(), None); SDValue Chain = DAG.getEntryNode(); return RFV.getCopyFromRegs(DAG, FuncInfo, getCurSDLoc(), Chain, nullptr, V); } @@ -5555,7 +5529,7 @@ bool SelectionDAGBuilder::EmitFuncArgumentDbgValue( if (VMI != FuncInfo.ValueMap.end()) { const auto &TLI = DAG.getTargetLoweringInfo(); RegsForValue RFV(V->getContext(), TLI, DAG.getDataLayout(), VMI->second, - V->getType(), getABIRegCopyCC(V)); + V->getType(), None); if (RFV.occupiesMultipleRegs()) { splitMultiRegDbgValue(RFV.getRegsAndSizes()); return true; Modified: vendor/llvm-project/release-11.x/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp ============================================================================== --- vendor/llvm-project/release-11.x/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp Thu Oct 1 17:30:38 2020 (r366332) +++ vendor/llvm-project/release-11.x/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp Thu Oct 1 17:48:15 2020 (r366333) @@ -5751,8 +5751,10 @@ SDValue TargetLowering::getNegatedExpression(SDValue O // If we already have the use of the negated floating constant, it is free // to negate it even it has multiple uses. - if (!Op.hasOneUse() && CFP.use_empty()) + if (!Op.hasOneUse() && CFP.use_empty()) { + RemoveDeadNode(CFP); break; + } Cost = NegatibleCost::Neutral; return CFP; } @@ -5810,7 +5812,8 @@ SDValue TargetLowering::getNegatedExpression(SDValue O if (NegX && (CostX <= CostY)) { Cost = CostX; SDValue N = DAG.getNode(ISD::FSUB, DL, VT, NegX, Y, Flags); - RemoveDeadNode(NegY); + if (NegY != N) + RemoveDeadNode(NegY); return N; } @@ -5818,7 +5821,8 @@ SDValue TargetLowering::getNegatedExpression(SDValue O if (NegY) { Cost = CostY; SDValue N = DAG.getNode(ISD::FSUB, DL, VT, NegY, X, Flags); - RemoveDeadNode(NegX); + if (NegX != N) + RemoveDeadNode(NegX); return N; } break; @@ -5857,7 +5861,8 @@ SDValue TargetLowering::getNegatedExpression(SDValue O if (NegX && (CostX <= CostY)) { Cost = CostX; SDValue N = DAG.getNode(Opcode, DL, VT, NegX, Y, Flags); - RemoveDeadNode(NegY); + if (NegY != N) + RemoveDeadNode(NegY); return N; } @@ -5870,7 +5875,8 @@ SDValue TargetLowering::getNegatedExpression(SDValue O if (NegY) { Cost = CostY; SDValue N = DAG.getNode(Opcode, DL, VT, X, NegY, Flags); - RemoveDeadNode(NegX); + if (NegX != N) + RemoveDeadNode(NegX); return N; } break; @@ -5901,7 +5907,8 @@ SDValue TargetLowering::getNegatedExpression(SDValue O if (NegX && (CostX <= CostY)) { Cost = std::min(CostX, CostZ); SDValue N = DAG.getNode(Opcode, DL, VT, NegX, Y, NegZ, Flags); - RemoveDeadNode(NegY); + if (NegY != N) + RemoveDeadNode(NegY); return N; } @@ -5909,7 +5916,8 @@ SDValue TargetLowering::getNegatedExpression(SDValue O if (NegY) { Cost = std::min(CostY, CostZ); SDValue N = DAG.getNode(Opcode, DL, VT, X, NegY, NegZ, Flags); - RemoveDeadNode(NegX); + if (NegX != N) + RemoveDeadNode(NegX); return N; } break; Modified: vendor/llvm-project/release-11.x/llvm/lib/IR/Core.cpp ============================================================================== --- vendor/llvm-project/release-11.x/llvm/lib/IR/Core.cpp Thu Oct 1 17:30:38 2020 (r366332) +++ vendor/llvm-project/release-11.x/llvm/lib/IR/Core.cpp Thu Oct 1 17:48:15 2020 (r366333) @@ -3952,6 +3952,19 @@ LLVMValueRef LLVMBuildAtomicCmpXchg(LLVMBuilderRef B, singleThread ? SyncScope::SingleThread : SyncScope::System)); } +unsigned LLVMGetNumMaskElements(LLVMValueRef SVInst) { + Value *P = unwrap(SVInst); + ShuffleVectorInst *I = cast(P); + return I->getShuffleMask().size(); +} + +int LLVMGetMaskValue(LLVMValueRef SVInst, unsigned Elt) { + Value *P = unwrap(SVInst); + ShuffleVectorInst *I = cast(P); + return I->getMaskValue(Elt); +} + +int LLVMGetUndefMaskElem(void) { return UndefMaskElem; } LLVMBool LLVMIsAtomicSingleThread(LLVMValueRef AtomicInst) { Value *P = unwrap(AtomicInst); Modified: vendor/llvm-project/release-11.x/llvm/lib/IR/Globals.cpp ============================================================================== --- vendor/llvm-project/release-11.x/llvm/lib/IR/Globals.cpp Thu Oct 1 17:30:38 2020 (r366332) +++ vendor/llvm-project/release-11.x/llvm/lib/IR/Globals.cpp Thu Oct 1 17:48:15 2020 (r366333) @@ -104,7 +104,8 @@ bool GlobalValue::isInterposable() const { bool GlobalValue::canBenefitFromLocalAlias() const { // See AsmPrinter::getSymbolPreferLocal(). - return GlobalObject::isExternalLinkage(getLinkage()) && !isDeclaration() && + return hasDefaultVisibility() && + GlobalObject::isExternalLinkage(getLinkage()) && !isDeclaration() && !isa(this) && !hasComdat(); } Modified: vendor/llvm-project/release-11.x/llvm/lib/Support/APFloat.cpp ============================================================================== --- vendor/llvm-project/release-11.x/llvm/lib/Support/APFloat.cpp Thu Oct 1 17:30:38 2020 (r366332) +++ vendor/llvm-project/release-11.x/llvm/lib/Support/APFloat.cpp Thu Oct 1 17:48:15 2020 (r366333) @@ -2242,6 +2242,21 @@ IEEEFloat::opStatus IEEEFloat::convert(const fltSemant if (!X86SpecialNan && semantics == &semX87DoubleExtended) APInt::tcSetBit(significandParts(), semantics->precision - 1); + // If we are truncating NaN, it is possible that we shifted out all of the + // set bits in a signalling NaN payload. But NaN must remain NaN, so some + // bit in the significand must be set (otherwise it is Inf). + // This can only happen with sNaN. Set the 1st bit after the quiet bit, + // so that we still have an sNaN. + // FIXME: Set quiet and return opInvalidOp (on convert of any sNaN). + // But this requires fixing LLVM to parse 32-bit hex FP or ignoring + // conversions while parsing IR. + if (APInt::tcIsZero(significandParts(), newPartCount)) { + assert(shift < 0 && "Should not lose NaN payload on extend"); + assert(semantics->precision >= 3 && "Unexpectedly narrow significand"); + assert(*losesInfo && "Missing payload should have set lost info"); + APInt::tcSetBit(significandParts(), semantics->precision - 3); + } + // gcc forces the Quiet bit on, which means (float)(double)(float_sNan) // does not give you back the same bits. This is dubious, and we // don't currently do it. You're really supposed to get Modified: vendor/llvm-project/release-11.x/llvm/lib/Target/AArch64/GISel/AArch64CallLowering.cpp ============================================================================== --- vendor/llvm-project/release-11.x/llvm/lib/Target/AArch64/GISel/AArch64CallLowering.cpp Thu Oct 1 17:30:38 2020 (r366332) +++ vendor/llvm-project/release-11.x/llvm/lib/Target/AArch64/GISel/AArch64CallLowering.cpp Thu Oct 1 17:48:15 2020 (r366333) @@ -84,11 +84,16 @@ struct IncomingArgHandler : public CallLowering::Value } } - void assignValueToAddress(Register ValVReg, Register Addr, uint64_t Size, + void assignValueToAddress(Register ValVReg, Register Addr, uint64_t MemSize, MachinePointerInfo &MPO, CCValAssign &VA) override { MachineFunction &MF = MIRBuilder.getMF(); + + // The reported memory location may be wider than the value. + const LLT RegTy = MRI.getType(ValVReg); + MemSize = std::min(static_cast(RegTy.getSizeInBytes()), MemSize); + auto MMO = MF.getMachineMemOperand( - MPO, MachineMemOperand::MOLoad | MachineMemOperand::MOInvariant, Size, + MPO, MachineMemOperand::MOLoad | MachineMemOperand::MOInvariant, MemSize, inferAlignFromPtrInfo(MF, MPO)); MIRBuilder.buildLoad(ValVReg, Addr, *MMO); } Modified: vendor/llvm-project/release-11.x/llvm/lib/Target/AMDGPU/AMDGPUCallLowering.cpp ============================================================================== --- vendor/llvm-project/release-11.x/llvm/lib/Target/AMDGPU/AMDGPUCallLowering.cpp Thu Oct 1 17:30:38 2020 (r366332) +++ vendor/llvm-project/release-11.x/llvm/lib/Target/AMDGPU/AMDGPUCallLowering.cpp Thu Oct 1 17:48:15 2020 (r366333) @@ -129,13 +129,17 @@ struct IncomingArgHandler : public CallLowering::Value } } - void assignValueToAddress(Register ValVReg, Register Addr, uint64_t Size, + void assignValueToAddress(Register ValVReg, Register Addr, uint64_t MemSize, MachinePointerInfo &MPO, CCValAssign &VA) override { MachineFunction &MF = MIRBuilder.getMF(); + // The reported memory location may be wider than the value. + const LLT RegTy = MRI.getType(ValVReg); + MemSize = std::min(static_cast(RegTy.getSizeInBytes()), MemSize); + // FIXME: Get alignment auto MMO = MF.getMachineMemOperand( - MPO, MachineMemOperand::MOLoad | MachineMemOperand::MOInvariant, Size, + MPO, MachineMemOperand::MOLoad | MachineMemOperand::MOInvariant, MemSize, inferAlignFromPtrInfo(MF, MPO)); MIRBuilder.buildLoad(ValVReg, Addr, *MMO); } From owner-svn-src-all@freebsd.org Thu Oct 1 17:49:11 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B96DD42F21C; Thu, 1 Oct 2020 17:49:11 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2LGb4YcKz4SNk; Thu, 1 Oct 2020 17:49:11 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6643314D86; Thu, 1 Oct 2020 17:49:11 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 091HnBVG074115; Thu, 1 Oct 2020 17:49:11 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 091HnBoi074114; Thu, 1 Oct 2020 17:49:11 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202010011749.091HnBoi074114@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 1 Oct 2020 17:49:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r366334 - vendor/llvm-project/llvmorg-11.0.0-rc5-0-g60a25202a7d X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/llvm-project/llvmorg-11.0.0-rc5-0-g60a25202a7d X-SVN-Commit-Revision: 366334 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Oct 2020 17:49:11 -0000 Author: dim Date: Thu Oct 1 17:49:10 2020 New Revision: 366334 URL: https://svnweb.freebsd.org/changeset/base/366334 Log: Tag llvm-project branch release/11.x llvmorg-11.0.0-rc5-0-g60a25202a7d. Added: vendor/llvm-project/llvmorg-11.0.0-rc5-0-g60a25202a7d/ - copied from r366333, vendor/llvm-project/release-11.x/ From owner-svn-src-all@freebsd.org Thu Oct 1 18:17:58 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1E2B7430113; Thu, 1 Oct 2020 18:17:58 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2Lvn73KRz4VbC; Thu, 1 Oct 2020 18:17:57 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D5B361521E; Thu, 1 Oct 2020 18:17:57 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 091IHv6W093093; Thu, 1 Oct 2020 18:17:57 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 091IHvWe093090; Thu, 1 Oct 2020 18:17:57 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202010011817.091IHvWe093090@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 1 Oct 2020 18:17:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r366335 - releng/12.2/sys/netinet X-SVN-Group: releng X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: releng/12.2/sys/netinet X-SVN-Commit-Revision: 366335 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Oct 2020 18:17:58 -0000 Author: tuexen Date: Thu Oct 1 18:17:56 2020 New Revision: 366335 URL: https://svnweb.freebsd.org/changeset/base/366335 Log: MFS r366324: Improve the handling of receiving unordered and unreliable user messages using DATA chunks. Don't use fsn_included when not being sure that it is set to an appropriate value. If the default is used, which is -1, this can result in SCTP associaitons not making any user visible progress. Thanks to Yutaka Takeda for reporting this issue for the the userland stack in https://github.com/pion/sctp/issues/138. MFS r366329: Improve the input validation and processing of cookies. This avoids setting the association in an inconsistent state, which could result in a use-after-free situation. This can be triggered by a malicious peer, if the peer can modify the cookie without the local endpoint recognizing it. Thanks to Ned Williamson for reporting the issue. Approved by: re (gjb) Modified: releng/12.2/sys/netinet/sctp_indata.c releng/12.2/sys/netinet/sctp_input.c releng/12.2/sys/netinet/sctp_pcb.c Directory Properties: releng/12.2/ (props changed) Modified: releng/12.2/sys/netinet/sctp_indata.c ============================================================================== --- releng/12.2/sys/netinet/sctp_indata.c Thu Oct 1 17:49:10 2020 (r366334) +++ releng/12.2/sys/netinet/sctp_indata.c Thu Oct 1 18:17:56 2020 (r366335) @@ -5437,7 +5437,9 @@ sctp_flush_reassm_for_str_seq(struct sctp_tcb *stcb, * it can be delivered... But for now we just dump everything on the * queue. */ - if (!asoc->idata_supported && !ordered && SCTP_TSN_GT(control->fsn_included, cumtsn)) { + if (!asoc->idata_supported && !ordered && + control->first_frag_seen && + SCTP_TSN_GT(control->fsn_included, cumtsn)) { return; } TAILQ_FOREACH_SAFE(chk, &control->reasm, sctp_next, nchk) { Modified: releng/12.2/sys/netinet/sctp_input.c ============================================================================== --- releng/12.2/sys/netinet/sctp_input.c Thu Oct 1 17:49:10 2020 (r366334) +++ releng/12.2/sys/netinet/sctp_input.c Thu Oct 1 18:17:56 2020 (r366335) @@ -2040,10 +2040,6 @@ sctp_process_cookie_new(struct mbuf *m, int iphlen, in vrf_id, port); return (NULL); } - /* get the correct sctp_nets */ - if (netp) - *netp = sctp_findnet(stcb, init_src); - asoc = &stcb->asoc; /* get scope variables out of cookie */ asoc->scope.ipv4_local_scope = cookie->ipv4_scope; @@ -2082,10 +2078,7 @@ sctp_process_cookie_new(struct mbuf *m, int iphlen, in asoc->advanced_peer_ack_point = asoc->last_acked_seq; /* process the INIT info (peer's info) */ - if (netp) - retval = sctp_process_init(init_cp, stcb); - else - retval = 0; + retval = sctp_process_init(init_cp, stcb); if (retval < 0) { (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_19); @@ -2199,19 +2192,21 @@ sctp_process_cookie_new(struct mbuf *m, int iphlen, in */ ; } - /* since we did not send a HB make sure we don't double things */ - if ((netp) && (*netp)) - (*netp)->hb_responded = 1; - if (stcb->asoc.sctp_autoclose_ticks && sctp_is_feature_on(inp, SCTP_PCB_FLAGS_AUTOCLOSE)) { sctp_timer_start(SCTP_TIMER_TYPE_AUTOCLOSE, inp, stcb, NULL); } (void)SCTP_GETTIME_TIMEVAL(&stcb->asoc.time_entered); - if ((netp != NULL) && (*netp != NULL)) { + *netp = sctp_findnet(stcb, init_src); + if (*netp != NULL) { struct timeval old; - /* calculate the RTT and set the encaps port */ + /* + * Since we did not send a HB, make sure we don't double + * things. + */ + (*netp)->hb_responded = 1; + /* Calculate the RTT. */ old.tv_sec = cookie->time_entered.tv_sec; old.tv_usec = cookie->time_entered.tv_usec; sctp_calculate_rto(stcb, asoc, *netp, &old, SCTP_RTT_FROM_NON_DATA); Modified: releng/12.2/sys/netinet/sctp_pcb.c ============================================================================== --- releng/12.2/sys/netinet/sctp_pcb.c Thu Oct 1 17:49:10 2020 (r366334) +++ releng/12.2/sys/netinet/sctp_pcb.c Thu Oct 1 18:17:56 2020 (r366335) @@ -4293,7 +4293,9 @@ sctp_aloc_assoc(struct sctp_inpcb *inp, struct sockadd if ((ntohs(sin->sin_port) == 0) || (sin->sin_addr.s_addr == INADDR_ANY) || (sin->sin_addr.s_addr == INADDR_BROADCAST) || - IN_MULTICAST(ntohl(sin->sin_addr.s_addr))) { + IN_MULTICAST(ntohl(sin->sin_addr.s_addr)) || + (((inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) != 0) && + (SCTP_IPV6_V6ONLY(inp) != 0))) { /* Invalid address */ SCTP_INP_RUNLOCK(inp); SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PCB, EINVAL); @@ -4312,7 +4314,8 @@ sctp_aloc_assoc(struct sctp_inpcb *inp, struct sockadd sin6 = (struct sockaddr_in6 *)firstaddr; if ((ntohs(sin6->sin6_port) == 0) || IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr) || - IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr)) { + IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr) || + ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) == 0)) { /* Invalid address */ SCTP_INP_RUNLOCK(inp); SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PCB, EINVAL); From owner-svn-src-all@freebsd.org Thu Oct 1 18:45:31 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AE889430761; Thu, 1 Oct 2020 18:45:31 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2MWb492Sz4Wrp; Thu, 1 Oct 2020 18:45:31 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 72E001553E; Thu, 1 Oct 2020 18:45:31 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 091IjV46012352; Thu, 1 Oct 2020 18:45:31 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 091IjV4W012351; Thu, 1 Oct 2020 18:45:31 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202010011845.091IjV4W012351@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 1 Oct 2020 18:45:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366336 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 366336 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Oct 2020 18:45:31 -0000 Author: trasz Date: Thu Oct 1 18:45:31 2020 New Revision: 366336 URL: https://svnweb.freebsd.org/changeset/base/366336 Log: Only clear TDP_NERRNO when needed, ie when it's previously been set. Reviewed by: kib Tested by: pho Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D26612 Modified: head/sys/kern/subr_syscall.c Modified: head/sys/kern/subr_syscall.c ============================================================================== --- head/sys/kern/subr_syscall.c Thu Oct 1 18:17:56 2020 (r366335) +++ head/sys/kern/subr_syscall.c Thu Oct 1 18:45:31 2020 (r366336) @@ -138,7 +138,8 @@ syscallenter(struct thread *td) (void)sigfastblock_fetch(td); /* Let system calls set td_errno directly. */ - td->td_pflags &= ~TDP_NERRNO; + KASSERT((td->td_pflags & TDP_NERRNO) == 0, + ("%s: TDP_NERRNO set", __func__)); if (__predict_false(SYSTRACE_ENABLED() || AUDIT_SYSCALL_ENTER(sa->code, td))) { @@ -149,7 +150,9 @@ syscallenter(struct thread *td) #endif error = (sa->callp->sy_call)(td, sa->args); /* Save the latest error return value. */ - if (__predict_false((td->td_pflags & TDP_NERRNO) == 0)) + if (__predict_false((td->td_pflags & TDP_NERRNO) != 0)) + td->td_pflags &= ~TDP_NERRNO; + else td->td_errno = error; AUDIT_SYSCALL_EXIT(error, td); #ifdef KDTRACE_HOOKS @@ -161,7 +164,9 @@ syscallenter(struct thread *td) } else { error = (sa->callp->sy_call)(td, sa->args); /* Save the latest error return value. */ - if (__predict_false((td->td_pflags & TDP_NERRNO) == 0)) + if (__predict_false((td->td_pflags & TDP_NERRNO) != 0)) + td->td_pflags &= ~TDP_NERRNO; + else td->td_errno = error; } syscall_thread_exit(td, sa->callp); From owner-svn-src-all@freebsd.org Thu Oct 1 18:56:44 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EA9B4430D99; Thu, 1 Oct 2020 18:56:44 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2MmX5wTRz4Xdl; Thu, 1 Oct 2020 18:56:44 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AE8F015A84; Thu, 1 Oct 2020 18:56:44 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 091Iui5P018640; Thu, 1 Oct 2020 18:56:44 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 091IuitP018639; Thu, 1 Oct 2020 18:56:44 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202010011856.091IuitP018639@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 1 Oct 2020 18:56:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366337 - head/usr.sbin/ctld X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/usr.sbin/ctld X-SVN-Commit-Revision: 366337 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Oct 2020 18:56:45 -0000 Author: trasz Date: Thu Oct 1 18:56:44 2020 New Revision: 366337 URL: https://svnweb.freebsd.org/changeset/base/366337 Log: Don't ignore the return value from gethostname(3). It probably cannot happen, but it silences Coverity. Reviewed by: mav MFC after: 2 weeks Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D26606 Modified: head/usr.sbin/ctld/ctld.c Modified: head/usr.sbin/ctld/ctld.c ============================================================================== --- head/usr.sbin/ctld/ctld.c Thu Oct 1 18:45:31 2020 (r366336) +++ head/usr.sbin/ctld/ctld.c Thu Oct 1 18:56:44 2020 (r366337) @@ -931,7 +931,7 @@ void isns_register(struct isns *isns, struct isns *oldisns) { struct conf *conf = isns->i_conf; - int s; + int error, s; char hostname[256]; if (TAILQ_EMPTY(&conf->conf_targets) || @@ -943,8 +943,10 @@ isns_register(struct isns *isns, struct isns *oldisns) set_timeout(0, false); return; } - gethostname(hostname, sizeof(hostname)); - + error = gethostname(hostname, sizeof(hostname)); + if (error != 0) + log_err(1, "gethostname"); + if (oldisns == NULL || TAILQ_EMPTY(&oldisns->i_conf->conf_targets)) oldisns = isns; isns_do_deregister(oldisns, s, hostname); @@ -957,7 +959,7 @@ void isns_check(struct isns *isns) { struct conf *conf = isns->i_conf; - int s, res; + int error, s, res; char hostname[256]; if (TAILQ_EMPTY(&conf->conf_targets) || @@ -969,8 +971,10 @@ isns_check(struct isns *isns) set_timeout(0, false); return; } - gethostname(hostname, sizeof(hostname)); - + error = gethostname(hostname, sizeof(hostname)); + if (error != 0) + log_err(1, "gethostname"); + res = isns_do_check(isns, s, hostname); if (res < 0) { isns_do_deregister(isns, s, hostname); @@ -984,7 +988,7 @@ void isns_deregister(struct isns *isns) { struct conf *conf = isns->i_conf; - int s; + int error, s; char hostname[256]; if (TAILQ_EMPTY(&conf->conf_targets) || @@ -994,8 +998,10 @@ isns_deregister(struct isns *isns) s = isns_do_connect(isns); if (s < 0) return; - gethostname(hostname, sizeof(hostname)); - + error = gethostname(hostname, sizeof(hostname)); + if (error != 0) + log_err(1, "gethostname"); + isns_do_deregister(isns, s, hostname); close(s); set_timeout(0, false); From owner-svn-src-all@freebsd.org Thu Oct 1 18:58:06 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CBAAE430E1F; Thu, 1 Oct 2020 18:58:06 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2Mp6545Zz4XrM; Thu, 1 Oct 2020 18:58:06 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9147F15360; Thu, 1 Oct 2020 18:58:06 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 091Iw6ej018892; Thu, 1 Oct 2020 18:58:06 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 091Iw6qv018891; Thu, 1 Oct 2020 18:58:06 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <202010011858.091Iw6qv018891@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 1 Oct 2020 18:58:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r366338 - releng/12.2/sbin/fsck_msdosfs X-SVN-Group: releng X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: releng/12.2/sbin/fsck_msdosfs X-SVN-Commit-Revision: 366338 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Oct 2020 18:58:06 -0000 Author: delphij Date: Thu Oct 1 18:58:06 2020 New Revision: 366338 URL: https://svnweb.freebsd.org/changeset/base/366338 Log: MFS r366305: MFC r366064, r366065, r366215 sbin/fsck_msdosfs: Fix an integer overflow on 32-bit platforms Approved by: re (gjb) Modified: releng/12.2/sbin/fsck_msdosfs/dir.c Directory Properties: releng/12.2/ (props changed) Modified: releng/12.2/sbin/fsck_msdosfs/dir.c ============================================================================== --- releng/12.2/sbin/fsck_msdosfs/dir.c Thu Oct 1 18:56:44 2020 (r366337) +++ releng/12.2/sbin/fsck_msdosfs/dir.c Thu Oct 1 18:58:06 2020 (r366338) @@ -388,7 +388,8 @@ static int checksize(struct fat_descriptor *fat, u_char *p, struct dosDirEntry *dir) { int ret = FSOK; - size_t physicalSize; + size_t chainsize; + u_int64_t physicalSize; struct bootblock *boot; boot = fat_get_boot(fat); @@ -401,9 +402,9 @@ checksize(struct fat_descriptor *fat, u_char *p, struc } else { if (!fat_is_valid_cl(fat, dir->head)) return FSERROR; - ret = checkchain(fat, dir->head, &physicalSize); + ret = checkchain(fat, dir->head, &chainsize); /* - * Upon return, physicalSize would hold the chain length + * Upon return, chainsize would hold the chain length * that checkchain() was able to validate, but if the user * refused the proposed repair, it would be unsafe to * proceed with directory entry fix, so bail out in that @@ -412,11 +413,17 @@ checksize(struct fat_descriptor *fat, u_char *p, struc if (ret == FSERROR) { return (FSERROR); } - physicalSize *= boot->ClusterSize; + /* + * The maximum file size on FAT32 is 4GiB - 1, which + * will occupy a cluster chain of exactly 4GiB in + * size. On 32-bit platforms, since size_t is 32-bit, + * it would wrap back to 0. + */ + physicalSize = (u_int64_t)chainsize * boot->ClusterSize; } if (physicalSize < dir->size) { - pwarn("size of %s is %u, should at most be %zu\n", - fullpath(dir), dir->size, physicalSize); + pwarn("size of %s is %u, should at most be %ju\n", + fullpath(dir), dir->size, (uintmax_t)physicalSize); if (ask(1, "Truncate")) { dir->size = physicalSize; p[28] = (u_char)physicalSize; From owner-svn-src-all@freebsd.org Thu Oct 1 19:06:11 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 46FFA43117A; Thu, 1 Oct 2020 19:06:11 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2MzR1T6Fz4YWx; Thu, 1 Oct 2020 19:06:11 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 16DA815770; Thu, 1 Oct 2020 19:06:11 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 091J6Bk2025038; Thu, 1 Oct 2020 19:06:11 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 091J67Oe025022; Thu, 1 Oct 2020 19:06:07 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202010011906.091J67Oe025022@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 1 Oct 2020 19:06:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366339 - in head: contrib/llvm-project/lld/docs contrib/llvm-project/llvm/include/llvm-c contrib/llvm-project/llvm/include/llvm/ADT contrib/llvm-project/llvm/lib/CodeGen contrib/llvm-p... X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in head: contrib/llvm-project/lld/docs contrib/llvm-project/llvm/include/llvm-c contrib/llvm-project/llvm/include/llvm/ADT contrib/llvm-project/llvm/lib/CodeGen contrib/llvm-project/llvm/lib/CodeGen/A... X-SVN-Commit-Revision: 366339 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Oct 2020 19:06:11 -0000 Author: dim Date: Thu Oct 1 19:06:07 2020 New Revision: 366339 URL: https://svnweb.freebsd.org/changeset/base/366339 Log: Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp release/11.x llvmorg-11.0.0-rc5-0-g60a25202a7d. MFC after: 4 weeks X-MFC-With: r364284 Modified: head/contrib/llvm-project/lld/docs/ReleaseNotes.rst head/contrib/llvm-project/llvm/include/llvm-c/Core.h head/contrib/llvm-project/llvm/include/llvm/ADT/SmallPtrSet.h head/contrib/llvm-project/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp head/contrib/llvm-project/llvm/lib/CodeGen/GlobalISel/CallLowering.cpp head/contrib/llvm-project/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp head/contrib/llvm-project/llvm/lib/CodeGen/PHIEliminationUtils.cpp head/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp head/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp head/contrib/llvm-project/llvm/lib/IR/Core.cpp head/contrib/llvm-project/llvm/lib/IR/Globals.cpp head/contrib/llvm-project/llvm/lib/Support/APFloat.cpp head/contrib/llvm-project/llvm/lib/Target/AArch64/GISel/AArch64CallLowering.cpp head/contrib/llvm-project/llvm/lib/Target/AMDGPU/AMDGPUCallLowering.cpp head/lib/clang/include/VCSVersion.inc head/lib/clang/include/llvm/Support/VCSRevision.h Directory Properties: head/contrib/llvm-project/ (props changed) head/contrib/llvm-project/lld/ (props changed) head/contrib/llvm-project/llvm/ (props changed) Modified: head/contrib/llvm-project/lld/docs/ReleaseNotes.rst ============================================================================== --- head/contrib/llvm-project/lld/docs/ReleaseNotes.rst Thu Oct 1 18:58:06 2020 (r366338) +++ head/contrib/llvm-project/lld/docs/ReleaseNotes.rst Thu Oct 1 19:06:07 2020 (r366339) @@ -5,11 +5,6 @@ lld 11.0.0 Release Notes .. contents:: :local: -.. warning:: - These are in-progress notes for the upcoming LLVM 11.0.0 release. - Release notes for previous releases can be found on - `the Download Page `_. - Introduction ============ @@ -176,12 +171,3 @@ MinGW Improvements ``--disable-runtime-pseudo-reloc``), the ``--no-seh`` flag and options for selecting file and section alignment (``--file-alignment`` and ``--section-alignment``). - -MachO Improvements ------------------- - -* Item 1. - -WebAssembly Improvements ------------------------- - Modified: head/contrib/llvm-project/llvm/include/llvm-c/Core.h ============================================================================== --- head/contrib/llvm-project/llvm/include/llvm-c/Core.h Thu Oct 1 18:58:06 2020 (r366338) +++ head/contrib/llvm-project/llvm/include/llvm-c/Core.h Thu Oct 1 19:06:07 2020 (r366339) @@ -3636,7 +3636,7 @@ void LLVMAddDestination(LLVMValueRef IndirectBr, LLVMB /* Get the number of clauses on the landingpad instruction */ unsigned LLVMGetNumClauses(LLVMValueRef LandingPad); -/* Get the value of the clause at idnex Idx on the landingpad instruction */ +/* Get the value of the clause at index Idx on the landingpad instruction */ LLVMValueRef LLVMGetClause(LLVMValueRef LandingPad, unsigned Idx); /* Add a catch or filter clause to the landingpad instruction */ @@ -3936,6 +3936,26 @@ LLVMValueRef LLVMBuildAtomicCmpXchg(LLVMBuilderRef B, LLVMAtomicOrdering SuccessOrdering, LLVMAtomicOrdering FailureOrdering, LLVMBool SingleThread); + +/** + * Get the number of elements in the mask of a ShuffleVector instruction. + */ +unsigned LLVMGetNumMaskElements(LLVMValueRef ShuffleVectorInst); + +/** + * \returns a constant that specifies that the result of a \c ShuffleVectorInst + * is undefined. + */ +int LLVMGetUndefMaskElem(void); + +/** + * Get the mask value at position Elt in the mask of a ShuffleVector + * instruction. + * + * \Returns the result of \c LLVMGetUndefMaskElem() if the mask value is undef + * at that position. + */ +int LLVMGetMaskValue(LLVMValueRef ShuffleVectorInst, unsigned Elt); LLVMBool LLVMIsAtomicSingleThread(LLVMValueRef AtomicInst); void LLVMSetAtomicSingleThread(LLVMValueRef AtomicInst, LLVMBool SingleThread); Modified: head/contrib/llvm-project/llvm/include/llvm/ADT/SmallPtrSet.h ============================================================================== --- head/contrib/llvm-project/llvm/include/llvm/ADT/SmallPtrSet.h Thu Oct 1 18:58:06 2020 (r366338) +++ head/contrib/llvm-project/llvm/include/llvm/ADT/SmallPtrSet.h Thu Oct 1 19:06:07 2020 (r366339) @@ -378,6 +378,9 @@ class SmallPtrSetImpl : public SmallPtrSetImplBase { ( iterator find(ConstPtrType Ptr) const { return makeIterator(find_imp(ConstPtrTraits::getAsVoidPointer(Ptr))); } + bool contains(ConstPtrType Ptr) const { + return find_imp(ConstPtrTraits::getAsVoidPointer(Ptr)) != EndPointer(); + } template void insert(IterT I, IterT E) { Modified: head/contrib/llvm-project/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp ============================================================================== --- head/contrib/llvm-project/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Thu Oct 1 18:58:06 2020 (r366338) +++ head/contrib/llvm-project/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Thu Oct 1 19:06:07 2020 (r366339) @@ -2779,7 +2779,7 @@ static void emitGlobalConstantImpl(const DataLayout &D if (const ConstantInt *CI = dyn_cast(CV)) { const uint64_t StoreSize = DL.getTypeStoreSize(CV->getType()); - if (StoreSize < 8) { + if (StoreSize <= 8) { if (AP.isVerbose()) AP.OutStreamer->GetCommentOS() << format("0x%" PRIx64 "\n", CI->getZExtValue()); Modified: head/contrib/llvm-project/llvm/lib/CodeGen/GlobalISel/CallLowering.cpp ============================================================================== --- head/contrib/llvm-project/llvm/lib/CodeGen/GlobalISel/CallLowering.cpp Thu Oct 1 18:58:06 2020 (r366338) +++ head/contrib/llvm-project/llvm/lib/CodeGen/GlobalISel/CallLowering.cpp Thu Oct 1 19:06:07 2020 (r366339) @@ -375,13 +375,15 @@ bool CallLowering::handleAssignments(CCState &CCInfo, << "Load/store a split arg to/from the stack not implemented yet"); return false; } - MVT VT = MVT::getVT(Args[i].Ty); - unsigned Size = VT == MVT::iPTR ? DL.getPointerSize() - : alignTo(VT.getSizeInBits(), 8) / 8; + + EVT LocVT = VA.getValVT(); + unsigned MemSize = LocVT == MVT::iPTR ? DL.getPointerSize() + : LocVT.getStoreSize(); + unsigned Offset = VA.getLocMemOffset(); MachinePointerInfo MPO; - Register StackAddr = Handler.getStackAddress(Size, Offset, MPO); - Handler.assignValueToAddress(Args[i], StackAddr, Size, MPO, VA); + Register StackAddr = Handler.getStackAddress(MemSize, Offset, MPO); + Handler.assignValueToAddress(Args[i], StackAddr, MemSize, MPO, VA); } else { // FIXME: Support byvals and other weirdness return false; Modified: head/contrib/llvm-project/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp ============================================================================== --- head/contrib/llvm-project/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp Thu Oct 1 18:58:06 2020 (r366338) +++ head/contrib/llvm-project/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp Thu Oct 1 19:06:07 2020 (r366339) @@ -2368,10 +2368,11 @@ LegalizerHelper::lower(MachineInstr &MI, unsigned Type MI.RemoveOperand(1); Observer.changedInstr(MI); - MIRBuilder.setInsertPt(MIRBuilder.getMBB(), ++MIRBuilder.getInsertPt()); - auto HiPart = MIRBuilder.buildInstr(Opcode, {Ty}, {LHS, RHS}); auto Zero = MIRBuilder.buildConstant(Ty, 0); + + // Move insert point forward so we can use the Res register if needed. + MIRBuilder.setInsertPt(MIRBuilder.getMBB(), ++MIRBuilder.getInsertPt()); // For *signed* multiply, overflow is detected by checking: // (hi != (lo >> bitwidth-1)) Modified: head/contrib/llvm-project/llvm/lib/CodeGen/PHIEliminationUtils.cpp ============================================================================== --- head/contrib/llvm-project/llvm/lib/CodeGen/PHIEliminationUtils.cpp Thu Oct 1 18:58:06 2020 (r366338) +++ head/contrib/llvm-project/llvm/lib/CodeGen/PHIEliminationUtils.cpp Thu Oct 1 19:06:07 2020 (r366339) @@ -27,31 +27,35 @@ llvm::findPHICopyInsertPoint(MachineBasicBlock* MBB, M // Usually, we just want to insert the copy before the first terminator // instruction. However, for the edge going to a landing pad, we must insert // the copy before the call/invoke instruction. Similarly for an INLINEASM_BR - // going to an indirect target. - if (!SuccMBB->isEHPad() && !SuccMBB->isInlineAsmBrIndirectTarget()) + // going to an indirect target. This is similar to SplitKit.cpp's + // computeLastInsertPoint, and similarly assumes that there cannot be multiple + // instructions that are Calls with EHPad successors or INLINEASM_BR in a + // block. + bool EHPadSuccessor = SuccMBB->isEHPad(); + if (!EHPadSuccessor && !SuccMBB->isInlineAsmBrIndirectTarget()) return MBB->getFirstTerminator(); - // Discover any defs/uses in this basic block. - SmallPtrSet DefUsesInMBB; + // Discover any defs in this basic block. + SmallPtrSet DefsInMBB; MachineRegisterInfo& MRI = MBB->getParent()->getRegInfo(); - for (MachineInstr &RI : MRI.reg_instructions(SrcReg)) { + for (MachineInstr &RI : MRI.def_instructions(SrcReg)) if (RI.getParent() == MBB) - DefUsesInMBB.insert(&RI); - } + DefsInMBB.insert(&RI); - MachineBasicBlock::iterator InsertPoint; - if (DefUsesInMBB.empty()) { - // No defs. Insert the copy at the start of the basic block. - InsertPoint = MBB->begin(); - } else if (DefUsesInMBB.size() == 1) { - // Insert the copy immediately after the def/use. - InsertPoint = *DefUsesInMBB.begin(); - ++InsertPoint; - } else { - // Insert the copy immediately after the last def/use. - InsertPoint = MBB->end(); - while (!DefUsesInMBB.count(&*--InsertPoint)) {} - ++InsertPoint; + MachineBasicBlock::iterator InsertPoint = MBB->begin(); + // Insert the copy at the _latest_ point of: + // 1. Immediately AFTER the last def + // 2. Immediately BEFORE a call/inlineasm_br. + for (auto I = MBB->rbegin(), E = MBB->rend(); I != E; ++I) { + if (DefsInMBB.contains(&*I)) { + InsertPoint = std::next(I.getReverse()); + break; + } + if ((EHPadSuccessor && I->isCall()) || + I->getOpcode() == TargetOpcode::INLINEASM_BR) { + InsertPoint = I.getReverse(); + break; + } } // Make sure the copy goes after any phi nodes but before Modified: head/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp ============================================================================== --- head/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp Thu Oct 1 18:58:06 2020 (r366338) +++ head/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp Thu Oct 1 19:06:07 2020 (r366339) @@ -169,32 +169,6 @@ static cl::opt SwitchPeelThreshold( // store [4096 x i8] %data, [4096 x i8]* %buffer static const unsigned MaxParallelChains = 64; -// Return the calling convention if the Value passed requires ABI mangling as it -// is a parameter to a function or a return value from a function which is not -// an intrinsic. -static Optional getABIRegCopyCC(const Value *V) { - if (auto *R = dyn_cast(V)) - return R->getParent()->getParent()->getCallingConv(); - - if (auto *CI = dyn_cast(V)) { - const bool IsInlineAsm = CI->isInlineAsm(); - const bool IsIndirectFunctionCall = - !IsInlineAsm && !CI->getCalledFunction(); - - // It is possible that the call instruction is an inline asm statement or an - // indirect function call in which case the return value of - // getCalledFunction() would be nullptr. - const bool IsInstrinsicCall = - !IsInlineAsm && !IsIndirectFunctionCall && - CI->getCalledFunction()->getIntrinsicID() != Intrinsic::not_intrinsic; - - if (!IsInlineAsm && !IsInstrinsicCall) - return CI->getCallingConv(); - } - - return None; -} - static SDValue getCopyFromPartsVector(SelectionDAG &DAG, const SDLoc &DL, const SDValue *Parts, unsigned NumParts, MVT PartVT, EVT ValueVT, const Value *V, @@ -1624,7 +1598,7 @@ SDValue SelectionDAGBuilder::getValueImpl(const Value unsigned InReg = FuncInfo.InitializeRegForValue(Inst); RegsForValue RFV(*DAG.getContext(), TLI, DAG.getDataLayout(), InReg, - Inst->getType(), getABIRegCopyCC(V)); + Inst->getType(), None); SDValue Chain = DAG.getEntryNode(); return RFV.getCopyFromRegs(DAG, FuncInfo, getCurSDLoc(), Chain, nullptr, V); } @@ -5555,7 +5529,7 @@ bool SelectionDAGBuilder::EmitFuncArgumentDbgValue( if (VMI != FuncInfo.ValueMap.end()) { const auto &TLI = DAG.getTargetLoweringInfo(); RegsForValue RFV(V->getContext(), TLI, DAG.getDataLayout(), VMI->second, - V->getType(), getABIRegCopyCC(V)); + V->getType(), None); if (RFV.occupiesMultipleRegs()) { splitMultiRegDbgValue(RFV.getRegsAndSizes()); return true; Modified: head/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp ============================================================================== --- head/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp Thu Oct 1 18:58:06 2020 (r366338) +++ head/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp Thu Oct 1 19:06:07 2020 (r366339) @@ -5751,8 +5751,10 @@ SDValue TargetLowering::getNegatedExpression(SDValue O // If we already have the use of the negated floating constant, it is free // to negate it even it has multiple uses. - if (!Op.hasOneUse() && CFP.use_empty()) + if (!Op.hasOneUse() && CFP.use_empty()) { + RemoveDeadNode(CFP); break; + } Cost = NegatibleCost::Neutral; return CFP; } @@ -5810,7 +5812,8 @@ SDValue TargetLowering::getNegatedExpression(SDValue O if (NegX && (CostX <= CostY)) { Cost = CostX; SDValue N = DAG.getNode(ISD::FSUB, DL, VT, NegX, Y, Flags); - RemoveDeadNode(NegY); + if (NegY != N) + RemoveDeadNode(NegY); return N; } @@ -5818,7 +5821,8 @@ SDValue TargetLowering::getNegatedExpression(SDValue O if (NegY) { Cost = CostY; SDValue N = DAG.getNode(ISD::FSUB, DL, VT, NegY, X, Flags); - RemoveDeadNode(NegX); + if (NegX != N) + RemoveDeadNode(NegX); return N; } break; @@ -5857,7 +5861,8 @@ SDValue TargetLowering::getNegatedExpression(SDValue O if (NegX && (CostX <= CostY)) { Cost = CostX; SDValue N = DAG.getNode(Opcode, DL, VT, NegX, Y, Flags); - RemoveDeadNode(NegY); + if (NegY != N) + RemoveDeadNode(NegY); return N; } @@ -5870,7 +5875,8 @@ SDValue TargetLowering::getNegatedExpression(SDValue O if (NegY) { Cost = CostY; SDValue N = DAG.getNode(Opcode, DL, VT, X, NegY, Flags); - RemoveDeadNode(NegX); + if (NegX != N) + RemoveDeadNode(NegX); return N; } break; @@ -5901,7 +5907,8 @@ SDValue TargetLowering::getNegatedExpression(SDValue O if (NegX && (CostX <= CostY)) { Cost = std::min(CostX, CostZ); SDValue N = DAG.getNode(Opcode, DL, VT, NegX, Y, NegZ, Flags); - RemoveDeadNode(NegY); + if (NegY != N) + RemoveDeadNode(NegY); return N; } @@ -5909,7 +5916,8 @@ SDValue TargetLowering::getNegatedExpression(SDValue O if (NegY) { Cost = std::min(CostY, CostZ); SDValue N = DAG.getNode(Opcode, DL, VT, X, NegY, NegZ, Flags); - RemoveDeadNode(NegX); + if (NegX != N) + RemoveDeadNode(NegX); return N; } break; Modified: head/contrib/llvm-project/llvm/lib/IR/Core.cpp ============================================================================== --- head/contrib/llvm-project/llvm/lib/IR/Core.cpp Thu Oct 1 18:58:06 2020 (r366338) +++ head/contrib/llvm-project/llvm/lib/IR/Core.cpp Thu Oct 1 19:06:07 2020 (r366339) @@ -3952,6 +3952,19 @@ LLVMValueRef LLVMBuildAtomicCmpXchg(LLVMBuilderRef B, singleThread ? SyncScope::SingleThread : SyncScope::System)); } +unsigned LLVMGetNumMaskElements(LLVMValueRef SVInst) { + Value *P = unwrap(SVInst); + ShuffleVectorInst *I = cast(P); + return I->getShuffleMask().size(); +} + +int LLVMGetMaskValue(LLVMValueRef SVInst, unsigned Elt) { + Value *P = unwrap(SVInst); + ShuffleVectorInst *I = cast(P); + return I->getMaskValue(Elt); +} + +int LLVMGetUndefMaskElem(void) { return UndefMaskElem; } LLVMBool LLVMIsAtomicSingleThread(LLVMValueRef AtomicInst) { Value *P = unwrap(AtomicInst); Modified: head/contrib/llvm-project/llvm/lib/IR/Globals.cpp ============================================================================== --- head/contrib/llvm-project/llvm/lib/IR/Globals.cpp Thu Oct 1 18:58:06 2020 (r366338) +++ head/contrib/llvm-project/llvm/lib/IR/Globals.cpp Thu Oct 1 19:06:07 2020 (r366339) @@ -104,7 +104,8 @@ bool GlobalValue::isInterposable() const { bool GlobalValue::canBenefitFromLocalAlias() const { // See AsmPrinter::getSymbolPreferLocal(). - return GlobalObject::isExternalLinkage(getLinkage()) && !isDeclaration() && + return hasDefaultVisibility() && + GlobalObject::isExternalLinkage(getLinkage()) && !isDeclaration() && !isa(this) && !hasComdat(); } Modified: head/contrib/llvm-project/llvm/lib/Support/APFloat.cpp ============================================================================== --- head/contrib/llvm-project/llvm/lib/Support/APFloat.cpp Thu Oct 1 18:58:06 2020 (r366338) +++ head/contrib/llvm-project/llvm/lib/Support/APFloat.cpp Thu Oct 1 19:06:07 2020 (r366339) @@ -2242,6 +2242,21 @@ IEEEFloat::opStatus IEEEFloat::convert(const fltSemant if (!X86SpecialNan && semantics == &semX87DoubleExtended) APInt::tcSetBit(significandParts(), semantics->precision - 1); + // If we are truncating NaN, it is possible that we shifted out all of the + // set bits in a signalling NaN payload. But NaN must remain NaN, so some + // bit in the significand must be set (otherwise it is Inf). + // This can only happen with sNaN. Set the 1st bit after the quiet bit, + // so that we still have an sNaN. + // FIXME: Set quiet and return opInvalidOp (on convert of any sNaN). + // But this requires fixing LLVM to parse 32-bit hex FP or ignoring + // conversions while parsing IR. + if (APInt::tcIsZero(significandParts(), newPartCount)) { + assert(shift < 0 && "Should not lose NaN payload on extend"); + assert(semantics->precision >= 3 && "Unexpectedly narrow significand"); + assert(*losesInfo && "Missing payload should have set lost info"); + APInt::tcSetBit(significandParts(), semantics->precision - 3); + } + // gcc forces the Quiet bit on, which means (float)(double)(float_sNan) // does not give you back the same bits. This is dubious, and we // don't currently do it. You're really supposed to get Modified: head/contrib/llvm-project/llvm/lib/Target/AArch64/GISel/AArch64CallLowering.cpp ============================================================================== --- head/contrib/llvm-project/llvm/lib/Target/AArch64/GISel/AArch64CallLowering.cpp Thu Oct 1 18:58:06 2020 (r366338) +++ head/contrib/llvm-project/llvm/lib/Target/AArch64/GISel/AArch64CallLowering.cpp Thu Oct 1 19:06:07 2020 (r366339) @@ -84,11 +84,16 @@ struct IncomingArgHandler : public CallLowering::Value } } - void assignValueToAddress(Register ValVReg, Register Addr, uint64_t Size, + void assignValueToAddress(Register ValVReg, Register Addr, uint64_t MemSize, MachinePointerInfo &MPO, CCValAssign &VA) override { MachineFunction &MF = MIRBuilder.getMF(); + + // The reported memory location may be wider than the value. + const LLT RegTy = MRI.getType(ValVReg); + MemSize = std::min(static_cast(RegTy.getSizeInBytes()), MemSize); + auto MMO = MF.getMachineMemOperand( - MPO, MachineMemOperand::MOLoad | MachineMemOperand::MOInvariant, Size, + MPO, MachineMemOperand::MOLoad | MachineMemOperand::MOInvariant, MemSize, inferAlignFromPtrInfo(MF, MPO)); MIRBuilder.buildLoad(ValVReg, Addr, *MMO); } Modified: head/contrib/llvm-project/llvm/lib/Target/AMDGPU/AMDGPUCallLowering.cpp ============================================================================== --- head/contrib/llvm-project/llvm/lib/Target/AMDGPU/AMDGPUCallLowering.cpp Thu Oct 1 18:58:06 2020 (r366338) +++ head/contrib/llvm-project/llvm/lib/Target/AMDGPU/AMDGPUCallLowering.cpp Thu Oct 1 19:06:07 2020 (r366339) @@ -129,13 +129,17 @@ struct IncomingArgHandler : public CallLowering::Value } } - void assignValueToAddress(Register ValVReg, Register Addr, uint64_t Size, + void assignValueToAddress(Register ValVReg, Register Addr, uint64_t MemSize, MachinePointerInfo &MPO, CCValAssign &VA) override { MachineFunction &MF = MIRBuilder.getMF(); + // The reported memory location may be wider than the value. + const LLT RegTy = MRI.getType(ValVReg); + MemSize = std::min(static_cast(RegTy.getSizeInBytes()), MemSize); + // FIXME: Get alignment auto MMO = MF.getMachineMemOperand( - MPO, MachineMemOperand::MOLoad | MachineMemOperand::MOInvariant, Size, + MPO, MachineMemOperand::MOLoad | MachineMemOperand::MOInvariant, MemSize, inferAlignFromPtrInfo(MF, MPO)); MIRBuilder.buildLoad(ValVReg, Addr, *MMO); } Modified: head/lib/clang/include/VCSVersion.inc ============================================================================== --- head/lib/clang/include/VCSVersion.inc Thu Oct 1 18:58:06 2020 (r366338) +++ head/lib/clang/include/VCSVersion.inc Thu Oct 1 19:06:07 2020 (r366339) @@ -1,14 +1,14 @@ // $FreeBSD$ -#define LLVM_REVISION "llvmorg-11.0.0-rc2-91-g6e042866c30" +#define LLVM_REVISION "llvmorg-11.0.0-rc5-0-g60a25202a7d" #define LLVM_REPOSITORY "git@github.com:llvm/llvm-project.git" -#define CLANG_REVISION "llvmorg-11.0.0-rc2-91-g6e042866c30" +#define CLANG_REVISION "llvmorg-11.0.0-rc5-0-g60a25202a7d" #define CLANG_REPOSITORY "git@github.com:llvm/llvm-project.git" // - -#define LLD_REVISION "llvmorg-11.0.0-rc2-91-g6e042866c30-1300007" +#define LLD_REVISION "llvmorg-11.0.0-rc5-0-g60a25202a7d-1300007" #define LLD_REPOSITORY "FreeBSD" -#define LLDB_REVISION "llvmorg-11.0.0-rc2-91-g6e042866c30" +#define LLDB_REVISION "llvmorg-11.0.0-rc5-0-g60a25202a7d" #define LLDB_REPOSITORY "git@github.com:llvm/llvm-project.git" Modified: head/lib/clang/include/llvm/Support/VCSRevision.h ============================================================================== --- head/lib/clang/include/llvm/Support/VCSRevision.h Thu Oct 1 18:58:06 2020 (r366338) +++ head/lib/clang/include/llvm/Support/VCSRevision.h Thu Oct 1 19:06:07 2020 (r366339) @@ -1,3 +1,3 @@ /* $FreeBSD$ */ -#define LLVM_REVISION "llvmorg-11.0.0-rc2-91-g6e042866c30" +#define LLVM_REVISION "llvmorg-11.0.0-rc5-0-g60a25202a7d" #define LLVM_REPOSITORY "git@github.com:llvm/llvm-project.git" From owner-svn-src-all@freebsd.org Thu Oct 1 19:17:03 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F357D4313CB; Thu, 1 Oct 2020 19:17:03 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2NCz694Qz4Z1G; Thu, 1 Oct 2020 19:17:03 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9E1DB15F05; Thu, 1 Oct 2020 19:17:03 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 091JH3rF031246; Thu, 1 Oct 2020 19:17:03 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 091JH3jX031245; Thu, 1 Oct 2020 19:17:03 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <202010011917.091JH3jX031245@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 1 Oct 2020 19:17:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366340 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 366340 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Oct 2020 19:17:04 -0000 Author: bdrewery Date: Thu Oct 1 19:17:03 2020 New Revision: 366340 URL: https://svnweb.freebsd.org/changeset/base/366340 Log: Use unlocked page lookup for inmem() to avoid object lock contention Reviewed By: kib, markj Sponsored by: Dell EMC Isilon Submitted by: mlaier Differential Revision: https://reviews.freebsd.org/D26597 Modified: head/sys/kern/vfs_bio.c Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Thu Oct 1 19:06:07 2020 (r366339) +++ head/sys/kern/vfs_bio.c Thu Oct 1 19:17:03 2020 (r366340) @@ -154,7 +154,7 @@ caddr_t __read_mostly unmapped_buf; /* Used below and for softdep flushing threads in ufs/ffs/ffs_softdep.c */ struct proc *bufdaemonproc; -static int inmem(struct vnode *vp, daddr_t blkno); +static bool inmem(struct vnode *vp, daddr_t blkno); static void vm_hold_free_pages(struct buf *bp, int newbsize); static void vm_hold_load_pages(struct buf *bp, vm_offset_t from, vm_offset_t to); @@ -3586,20 +3586,21 @@ incore(struct bufobj *bo, daddr_t blkno) * it also hunts around in the VM system for the data. */ -static int +static bool inmem(struct vnode * vp, daddr_t blkno) { vm_object_t obj; vm_offset_t toff, tinc, size; - vm_page_t m; + vm_page_t m, n; vm_ooffset_t off; + int valid; ASSERT_VOP_LOCKED(vp, "inmem"); if (incore(&vp->v_bufobj, blkno)) - return 1; + return (1); if (vp->v_mount == NULL) - return 0; + return (0); obj = vp->v_object; if (obj == NULL) return (0); @@ -3609,24 +3610,30 @@ inmem(struct vnode * vp, daddr_t blkno) size = vp->v_mount->mnt_stat.f_iosize; off = (vm_ooffset_t)blkno * (vm_ooffset_t)vp->v_mount->mnt_stat.f_iosize; - VM_OBJECT_RLOCK(obj); for (toff = 0; toff < vp->v_mount->mnt_stat.f_iosize; toff += tinc) { - m = vm_page_lookup(obj, OFF_TO_IDX(off + toff)); - if (!m) - goto notinmem; + m = vm_page_lookup_unlocked(obj, OFF_TO_IDX(off + toff)); +recheck: + if (m == NULL) + return (0); + /* + * Consider page validity only if page mapping didn't change + * during the check. + */ + valid = vm_page_is_valid(m, + (vm_offset_t)((toff + off) & PAGE_MASK), tinc); + n = vm_page_lookup_unlocked(obj, OFF_TO_IDX(off + toff)); + if (m != n) { + m = n; + goto recheck; + } + if (!valid) + return (0); + tinc = size; if (tinc > PAGE_SIZE - ((toff + off) & PAGE_MASK)) tinc = PAGE_SIZE - ((toff + off) & PAGE_MASK); - if (vm_page_is_valid(m, - (vm_offset_t) ((toff + off) & PAGE_MASK), tinc) == 0) - goto notinmem; } - VM_OBJECT_RUNLOCK(obj); - return 1; - -notinmem: - VM_OBJECT_RUNLOCK(obj); - return (0); + return (1); } /* From owner-svn-src-all@freebsd.org Thu Oct 1 19:22:30 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 58D0D431670; Thu, 1 Oct 2020 19:22:30 +0000 (UTC) (envelope-from rpokala@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2NLG1hf7z4ZT6; Thu, 1 Oct 2020 19:22:30 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from [192.168.1.10] (c-98-207-126-143.hsd1.ca.comcast.net [98.207.126.143]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: rpokala) by smtp.freebsd.org (Postfix) with ESMTPSA id 8B20817BED; Thu, 1 Oct 2020 19:22:29 +0000 (UTC) (envelope-from rpokala@freebsd.org) User-Agent: Microsoft-MacOutlook/16.41.20091302 Date: Thu, 01 Oct 2020 12:22:25 -0700 Subject: Re: svn commit: r366340 - head/sys/kern From: Ravi Pokala To: Bryan Drewery , , , Message-ID: <722E6718-7A24-4D15-84A8-C769C220EDCB@panasas.com> Thread-Topic: svn commit: r366340 - head/sys/kern References: <202010011917.091JH3jX031245@repo.freebsd.org> In-Reply-To: <202010011917.091JH3jX031245@repo.freebsd.org> Mime-version: 1.0 Content-type: text/plain; charset="UTF-8" Content-transfer-encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Oct 2020 19:22:30 -0000 If you changed it to bool, shouldn't you be using "true" and "false"? Thanks, Ravi (rpokala@) =EF=BB=BF-----Original Message----- From: on behalf of Bryan Drewery Date: 2020-10-01, Thursday at 12:17 To: , , Subject: svn commit: r366340 - head/sys/kern Author: bdrewery Date: Thu Oct 1 19:17:03 2020 New Revision: 366340 URL: https://svnweb.freebsd.org/changeset/base/366340 Log: Use unlocked page lookup for inmem() to avoid object lock contention Reviewed By: kib, markj Sponsored by: Dell EMC Isilon Submitted by: mlaier Differential Revision: https://reviews.freebsd.org/D26597 Modified: head/sys/kern/vfs_bio.c Modified: head/sys/kern/vfs_bio.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D --- head/sys/kern/vfs_bio.c Thu Oct 1 19:06:07 2020 (r366339) +++ head/sys/kern/vfs_bio.c Thu Oct 1 19:17:03 2020 (r366340) @@ -154,7 +154,7 @@ caddr_t __read_mostly unmapped_buf; /* Used below and for softdep flushing threads in ufs/ffs/ffs_softdep.= c */ struct proc *bufdaemonproc; -static int inmem(struct vnode *vp, daddr_t blkno); +static bool inmem(struct vnode *vp, daddr_t blkno); static void vm_hold_free_pages(struct buf *bp, int newbsize); static void vm_hold_load_pages(struct buf *bp, vm_offset_t from, vm_offset_t to); @@ -3586,20 +3586,21 @@ incore(struct bufobj *bo, daddr_t blkno) * it also hunts around in the VM system for the data. */ -static int +static bool inmem(struct vnode * vp, daddr_t blkno) { vm_object_t obj; vm_offset_t toff, tinc, size; - vm_page_t m; + vm_page_t m, n; vm_ooffset_t off; + int valid; ASSERT_VOP_LOCKED(vp, "inmem"); if (incore(&vp->v_bufobj, blkno)) - return 1; + return (1); if (vp->v_mount =3D=3D NULL) - return 0; + return (0); obj =3D vp->v_object; if (obj =3D=3D NULL) return (0); @@ -3609,24 +3610,30 @@ inmem(struct vnode * vp, daddr_t blkno) size =3D vp->v_mount->mnt_stat.f_iosize; off =3D (vm_ooffset_t)blkno * (vm_ooffset_t)vp->v_mount->mnt_stat.f_ios= ize; - VM_OBJECT_RLOCK(obj); for (toff =3D 0; toff < vp->v_mount->mnt_stat.f_iosize; toff +=3D tinc) { - m =3D vm_page_lookup(obj, OFF_TO_IDX(off + toff)); - if (!m) - goto notinmem; + m =3D vm_page_lookup_unlocked(obj, OFF_TO_IDX(off + toff)); +recheck: + if (m =3D=3D NULL) + return (0); + /* + * Consider page validity only if page mapping didn't change + * during the check. + */ + valid =3D vm_page_is_valid(m, + (vm_offset_t)((toff + off) & PAGE_MASK), tinc); + n =3D vm_page_lookup_unlocked(obj, OFF_TO_IDX(off + toff)); + if (m !=3D n) { + m =3D n; + goto recheck; + } + if (!valid) + return (0); + tinc =3D size; if (tinc > PAGE_SIZE - ((toff + off) & PAGE_MASK)) tinc =3D PAGE_SIZE - ((toff + off) & PAGE_MASK); - if (vm_page_is_valid(m, - (vm_offset_t) ((toff + off) & PAGE_MASK), tinc) =3D=3D 0) - goto notinmem; } - VM_OBJECT_RUNLOCK(obj); - return 1; - -notinmem: - VM_OBJECT_RUNLOCK(obj); - return (0); + return (1); } /* From owner-svn-src-all@freebsd.org Thu Oct 1 19:55:52 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E5F9F4325DC; Thu, 1 Oct 2020 19:55:52 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2P4m5scLz4chq; Thu, 1 Oct 2020 19:55:52 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AD332160C7; Thu, 1 Oct 2020 19:55:52 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 091Jtqrv056227; Thu, 1 Oct 2020 19:55:52 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 091Jtq78056226; Thu, 1 Oct 2020 19:55:52 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <202010011955.091Jtq78056226@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 1 Oct 2020 19:55:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366341 - stable/12/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Group: stable-12 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: stable/12/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Commit-Revision: 366341 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Oct 2020 19:55:53 -0000 Author: asomers Date: Thu Oct 1 19:55:52 2020 New Revision: 366341 URL: https://svnweb.freebsd.org/changeset/base/366341 Log: zfs: fix "zfs receive" of interrupted stream without "-F" after r366180 The OpenZFS test suite revealed a regression with the changes made by r366180 and r364974: "zfs recv" resuming and interrupted stream without -F would refuse to run, complaining that "dataset exists". Direct commit to stable/12 because head has moved to the OpenZFS code base. Upstream issue: https://github.com/openzfs/zfs/issues/10995 Reviewed by: mmacy MFC after: 3 days MFC-with: 366180 Sponsored by: Axcient Modified: stable/12/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Modified: stable/12/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c ============================================================================== --- stable/12/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Thu Oct 1 19:17:03 2020 (r366340) +++ stable/12/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Thu Oct 1 19:55:52 2020 (r366341) @@ -3138,7 +3138,7 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const char prop_errbuf[1024]; const char *chopprefix; boolean_t newfs = B_FALSE; - boolean_t stream_wantsnewfs; + boolean_t stream_wantsnewfs, stream_resumingnewfs; uint64_t parent_snapguid = 0; prop_changelist_t *clp = NULL; nvlist_t *snapprops_nvlist = NULL; @@ -3301,7 +3301,9 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const boolean_t resuming = DMU_GET_FEATUREFLAGS(drrb->drr_versioninfo) & DMU_BACKUP_FEATURE_RESUMING; stream_wantsnewfs = (drrb->drr_fromguid == 0 || - (drrb->drr_flags & DRR_FLAG_CLONE) || originsnap); + (drrb->drr_flags & DRR_FLAG_CLONE) || originsnap) && !resuming; + stream_resumingnewfs = (drrb->drr_fromguid == 0 || + (drrb->drr_flags & DRR_FLAG_CLONE) || originsnap) && resuming; if (stream_wantsnewfs) { /* @@ -3433,7 +3435,7 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const } if (!flags->dryrun && zhp->zfs_type == ZFS_TYPE_FILESYSTEM && - stream_wantsnewfs) { + (stream_wantsnewfs || stream_resumingnewfs)) { /* We can't do online recv in this case */ clp = changelist_gather(zhp, ZFS_PROP_NAME, 0, 0); if (clp == NULL) { From owner-svn-src-all@freebsd.org Thu Oct 1 19:56:39 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5F5CE4326C2; Thu, 1 Oct 2020 19:56:39 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2P5g1srSz4ctQ; Thu, 1 Oct 2020 19:56:39 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 23A59165BA; Thu, 1 Oct 2020 19:56:39 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 091JudjA056307; Thu, 1 Oct 2020 19:56:39 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 091Jud8f056306; Thu, 1 Oct 2020 19:56:39 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202010011956.091Jud8f056306@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 1 Oct 2020 19:56:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366342 - head/lib/libc/gen X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/lib/libc/gen X-SVN-Commit-Revision: 366342 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Oct 2020 19:56:39 -0000 Author: kevans Date: Thu Oct 1 19:56:38 2020 New Revision: 366342 URL: https://svnweb.freebsd.org/changeset/base/366342 Log: auxv: partially revert r366207, cast buflen to unsigned int as needed The warning generated pre-r366207 is actually a sign comparison warning: error: comparison of integers of different signs: 'unsigned long' and 'int' if (strlcpy(buf, execpath, buflen) >= buflen) Revert parts that affected other lines and just cast this to unsigned int. The buflen < 0 -> EINVAL has been kept despite no longer serving any purposes w.r.t. sign-extension because I do believe it's the right thing to do: "The provided buffer was not the right size for the requested item." The original warning is confirmed to still be gone with an: env WARNS=6 make WITHOUT_TESTS=yes. Reviewed by: asomers, kib X-MFC-With: r366207 Differential Revision: https://reviews.freebsd.org/D26631 Modified: head/lib/libc/gen/auxv.c Modified: head/lib/libc/gen/auxv.c ============================================================================== --- head/lib/libc/gen/auxv.c Thu Oct 1 19:55:52 2020 (r366341) +++ head/lib/libc/gen/auxv.c Thu Oct 1 19:56:38 2020 (r366342) @@ -67,8 +67,7 @@ __init_elf_aux_vector(void) } static pthread_once_t aux_once = PTHREAD_ONCE_INIT; -static int pagesize, osreldate, ncpus, bsdflags; -static size_t canary_len, pagesizes_len; +static int pagesize, osreldate, canary_len, ncpus, pagesizes_len, bsdflags; static int hwcap_present, hwcap2_present; static char *canary, *pagesizes, *execpath; static void *ps_strings, *timekeep; @@ -246,7 +245,6 @@ int _elf_aux_info(int aux, void *buf, int buflen) { int res; - size_t buflen_; __init_elf_aux_vector(); if (__elf_aux_vector == NULL) @@ -255,12 +253,11 @@ _elf_aux_info(int aux, void *buf, int buflen) if (buflen < 0) return (EINVAL); - buflen_ = (size_t)buflen; switch (aux) { case AT_CANARY: - if (canary != NULL && canary_len >= buflen_) { - memcpy(buf, canary, buflen_); + if (canary != NULL && canary_len >= buflen) { + memcpy(buf, canary, buflen); memset(canary, 0, canary_len); canary = NULL; res = 0; @@ -273,35 +270,36 @@ _elf_aux_info(int aux, void *buf, int buflen) else if (buf == NULL) res = EINVAL; else { - if (strlcpy(buf, execpath, buflen_) >= buflen_) + if (strlcpy(buf, execpath, buflen) >= + (unsigned int)buflen) res = EINVAL; else res = 0; } break; case AT_HWCAP: - if (hwcap_present && buflen_ == sizeof(u_long)) { + if (hwcap_present && buflen == sizeof(u_long)) { *(u_long *)buf = hwcap; res = 0; } else res = ENOENT; break; case AT_HWCAP2: - if (hwcap2_present && buflen_ == sizeof(u_long)) { + if (hwcap2_present && buflen == sizeof(u_long)) { *(u_long *)buf = hwcap2; res = 0; } else res = ENOENT; break; case AT_PAGESIZES: - if (pagesizes != NULL && pagesizes_len >= buflen_) { - memcpy(buf, pagesizes, buflen_); + if (pagesizes != NULL && pagesizes_len >= buflen) { + memcpy(buf, pagesizes, buflen); res = 0; } else res = ENOENT; break; case AT_PAGESZ: - if (buflen_ == sizeof(int)) { + if (buflen == sizeof(int)) { if (pagesize != 0) { *(int *)buf = pagesize; res = 0; @@ -311,7 +309,7 @@ _elf_aux_info(int aux, void *buf, int buflen) res = EINVAL; break; case AT_OSRELDATE: - if (buflen_ == sizeof(int)) { + if (buflen == sizeof(int)) { if (osreldate != 0) { *(int *)buf = osreldate; res = 0; @@ -321,7 +319,7 @@ _elf_aux_info(int aux, void *buf, int buflen) res = EINVAL; break; case AT_NCPUS: - if (buflen_ == sizeof(int)) { + if (buflen == sizeof(int)) { if (ncpus != 0) { *(int *)buf = ncpus; res = 0; @@ -331,7 +329,7 @@ _elf_aux_info(int aux, void *buf, int buflen) res = EINVAL; break; case AT_TIMEKEEP: - if (buflen_ == sizeof(void *)) { + if (buflen == sizeof(void *)) { if (timekeep != NULL) { *(void **)buf = timekeep; res = 0; @@ -341,14 +339,14 @@ _elf_aux_info(int aux, void *buf, int buflen) res = EINVAL; break; case AT_BSDFLAGS: - if (buflen_ == sizeof(int)) { + if (buflen == sizeof(int)) { *(int *)buf = bsdflags; res = 0; } else res = EINVAL; break; case AT_PS_STRINGS: - if (buflen_ == sizeof(void *)) { + if (buflen == sizeof(void *)) { if (ps_strings != NULL) { *(void **)buf = ps_strings; res = 0; From owner-svn-src-all@freebsd.org Thu Oct 1 20:05:03 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 875634328D8; Thu, 1 Oct 2020 20:05:03 +0000 (UTC) (envelope-from tuexen@fh-muenster.de) 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 4C2PHM0s06z4d72; Thu, 1 Oct 2020 20:05:02 +0000 (UTC) (envelope-from tuexen@fh-muenster.de) Received: from [IPv6:2a02:8109:1140:c3d:9473:4b0c:b512:9f37] (unknown [IPv6:2a02:8109:1140:c3d:9473:4b0c:b512:9f37]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTPSA id 25236778E0F12; Thu, 1 Oct 2020 22:04:59 +0200 (CEST) From: Michael Tuexen Message-Id: Content-Type: multipart/signed; boundary="Apple-Mail=_9E66BACC-3B77-49A3-B24E-47F94BE9C35B"; protocol="application/pkcs7-signature"; micalg=sha-256 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Subject: Re: svn commit: r366340 - head/sys/kern Date: Thu, 1 Oct 2020 22:04:58 +0200 In-Reply-To: <202010011917.091JH3jX031245@repo.freebsd.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org To: Bryan Drewery References: <202010011917.091JH3jX031245@repo.freebsd.org> X-Mailer: Apple Mail (2.3608.120.23.2.4) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 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: 4C2PHM0s06z4d72 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none 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-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Oct 2020 20:05:03 -0000 --Apple-Mail=_9E66BACC-3B77-49A3-B24E-47F94BE9C35B Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On 1. Oct 2020, at 21:17, Bryan Drewery wrote: >=20 > Author: bdrewery > Date: Thu Oct 1 19:17:03 2020 > New Revision: 366340 > URL: https://svnweb.freebsd.org/changeset/base/366340 >=20 > Log: > Use unlocked page lookup for inmem() to avoid object lock contention >=20 > Reviewed By: kib, markj > Sponsored by: Dell EMC Isilon > Submitted by: mlaier > Differential Revision: https://reviews.freebsd.org/D26597 >=20 > Modified: > head/sys/kern/vfs_bio.c >=20 > Modified: head/sys/kern/vfs_bio.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/kern/vfs_bio.c Thu Oct 1 19:06:07 2020 = (r366339) > +++ head/sys/kern/vfs_bio.c Thu Oct 1 19:17:03 2020 = (r366340) > @@ -154,7 +154,7 @@ caddr_t __read_mostly unmapped_buf; > /* Used below and for softdep flushing threads in = ufs/ffs/ffs_softdep.c */ > struct proc *bufdaemonproc; >=20 > -static int inmem(struct vnode *vp, daddr_t blkno); > +static bool inmem(struct vnode *vp, daddr_t blkno); > static void vm_hold_free_pages(struct buf *bp, int newbsize); > static void vm_hold_load_pages(struct buf *bp, vm_offset_t from, > vm_offset_t to); > @@ -3586,20 +3586,21 @@ incore(struct bufobj *bo, daddr_t blkno) > * it also hunts around in the VM system for the data. > */ >=20 > -static int > +static bool > inmem(struct vnode * vp, daddr_t blkno) > { > vm_object_t obj; > vm_offset_t toff, tinc, size; > - vm_page_t m; > + vm_page_t m, n; > vm_ooffset_t off; > + int valid; >=20 > ASSERT_VOP_LOCKED(vp, "inmem"); >=20 > if (incore(&vp->v_bufobj, blkno)) > - return 1; > + return (1); > if (vp->v_mount =3D=3D NULL) > - return 0; > + return (0); > obj =3D vp->v_object; > if (obj =3D=3D NULL) > return (0); > @@ -3609,24 +3610,30 @@ inmem(struct vnode * vp, daddr_t blkno) > size =3D vp->v_mount->mnt_stat.f_iosize; > off =3D (vm_ooffset_t)blkno * = (vm_ooffset_t)vp->v_mount->mnt_stat.f_iosize; >=20 > - VM_OBJECT_RLOCK(obj); > for (toff =3D 0; toff < vp->v_mount->mnt_stat.f_iosize; toff +=3D = tinc) { > - m =3D vm_page_lookup(obj, OFF_TO_IDX(off + toff)); > - if (!m) > - goto notinmem; > + m =3D vm_page_lookup_unlocked(obj, OFF_TO_IDX(off + = toff)); > +recheck: > + if (m =3D=3D NULL) > + return (0); > + /* > + * Consider page validity only if page mapping didn't = change > + * during the check. > + */ > + valid =3D vm_page_is_valid(m, > + (vm_offset_t)((toff + off) & PAGE_MASK), tinc); > + n =3D vm_page_lookup_unlocked(obj, OFF_TO_IDX(off + = toff)); Where is vm_page_lookup_unlocked() defined? For me, this breaks kernel = compilation... Best regards Michael > + if (m !=3D n) { > + m =3D n; > + goto recheck; > + } > + if (!valid) > + return (0); > + > tinc =3D size; > if (tinc > PAGE_SIZE - ((toff + off) & PAGE_MASK)) > tinc =3D PAGE_SIZE - ((toff + off) & PAGE_MASK); > - if (vm_page_is_valid(m, > - (vm_offset_t) ((toff + off) & PAGE_MASK), tinc) =3D=3D= 0) > - goto notinmem; > } > - VM_OBJECT_RUNLOCK(obj); > - return 1; > - > -notinmem: > - VM_OBJECT_RUNLOCK(obj); > - return (0); > + return (1); > } >=20 > /* --Apple-Mail=_9E66BACC-3B77-49A3-B24E-47F94BE9C35B Content-Disposition: attachment; filename=smime.p7s Content-Type: application/pkcs7-signature; name=smime.p7s Content-Transfer-Encoding: base64 MIAGCSqGSIb3DQEHAqCAMIACAQExDzANBglghkgBZQMEAgEFADCABgkqhkiG9w0BBwEAAKCCEKow 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 EUkp2KgtdRXYShjqFu9VNCIaE40GMIIF4DCCBMigAwIBAgIMIRX9tDE2QqO3mVLXMA0GCSqGSIb3 DQEBCwUAMIGNMQswCQYDVQQGEwJERTFFMEMGA1UECgw8VmVyZWluIHp1ciBGb2VyZGVydW5nIGVp bmVzIERldXRzY2hlbiBGb3JzY2h1bmdzbmV0emVzIGUuIFYuMRAwDgYDVQQLDAdERk4tUEtJMSUw IwYDVQQDDBxERk4tVmVyZWluIEdsb2JhbCBJc3N1aW5nIENBMB4XDTE5MDYwNDE0MjkxMFoXDTIy MDYwMzE0MjkxMFowfDELMAkGA1UEBhMCREUxIDAeBgNVBAoMF0ZhY2hob2Noc2NodWxlIE11ZW5z dGVyMTIwMAYDVQQLDClGYWNoYmVyZWljaCBFbGVrdHJvdGVjaG5payB1bmQgSW5mb3JtYXRpazEX MBUGA1UEAwwOTWljaGFlbCBUdWV4ZW4wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDM r8qQcPxLFCxzPtXvRyM9KeQaxyMA8gwUNc7IIiATs6mRQFe5ib/mvwT9nc0bAa+94go6HJDiD3FJ NkTo4u8aBsIcTt5pJtdBQLm88PLakbe3+fp/00//n7xxbTh7mAtFVCf25LxDCKkrdGk/+jglRq/R VdwhZZ3VpYCrx8YfI/hIzdRL3+4I4z/mnQ8K0X8d2MVVPG+9nBEngdnYGez5f/8wIVOgEYYBc21k yvMnVXLu2Ing+LwBd0gDG9Vasv87MNHCOZfJTNBlLhI2UDei/uNg9Zd4ynlMpPWZ7v0oiDWvmv8E OuD4oric8heyD0OYK2FL4qcVC4dn4pnyulfHAgMBAAGjggJOMIICSjA+BgNVHSAENzA1MA8GDSsG AQQBga0hgiwBAQQwEAYOKwYBBAGBrSGCLAEBBAQwEAYOKwYBBAGBrSGCLAIBBAQwCQYDVR0TBAIw ADAOBgNVHQ8BAf8EBAMCBeAwHQYDVR0lBBYwFAYIKwYBBQUHAwIGCCsGAQUFBwMEMB0GA1UdDgQW BBTxiodBVL/lA4p5iNesIsJRhhgd6zAfBgNVHSMEGDAWgBRrOpiL+fJTidrgrbIyHgkf6Ko7dDAg BgNVHREEGTAXgRV0dWV4ZW5AZmgtbXVlbnN0ZXIuZGUwgY0GA1UdHwSBhTCBgjA/oD2gO4Y5aHR0 cDovL2NkcDEucGNhLmRmbi5kZS9kZm4tY2EtZ2xvYmFsLWcyL3B1Yi9jcmwvY2FjcmwuY3JsMD+g PaA7hjlodHRwOi8vY2RwMi5wY2EuZGZuLmRlL2Rmbi1jYS1nbG9iYWwtZzIvcHViL2NybC9jYWNy bC5jcmwwgdsGCCsGAQUFBwEBBIHOMIHLMDMGCCsGAQUFBzABhidodHRwOi8vb2NzcC5wY2EuZGZu LmRlL09DU1AtU2VydmVyL09DU1AwSQYIKwYBBQUHMAKGPWh0dHA6Ly9jZHAxLnBjYS5kZm4uZGUv ZGZuLWNhLWdsb2JhbC1nMi9wdWIvY2FjZXJ0L2NhY2VydC5jcnQwSQYIKwYBBQUHMAKGPWh0dHA6 Ly9jZHAyLnBjYS5kZm4uZGUvZGZuLWNhLWdsb2JhbC1nMi9wdWIvY2FjZXJ0L2NhY2VydC5jcnQw DQYJKoZIhvcNAQELBQADggEBABs3VlmIZ1VF3HkaQdjInZYmamRabbdgJ7cz6m6o/agKL7+Vhwx7 1BaaYs2gMa5Nu/GJ3YfdqIsUlYtKdl58Yhp/89E6xBfJkItS+rE8RFdf2XgklGlx7GmsvdA3tId5 b6K6r9a5wpVN0epxY6K8wwpzEib6fJLcHylybQXZ7JSOaLRLp6WU3QPoyTT7FpvAe/0b2MSCbPX4 fc53PCn2aGgXuRFVQeCn1SP1BF3QW1ppkFhcF6G+0JcUxYFAXE6r/71WZBvUHqoG/th2hAwQnS+Y KhUYh4SZQH3/ursXXJYXQ5vyIhkN1FZlmtWA8+ofdCnoqSTbiSX2Aa/kKbTapwgxggOdMIIDmQIB ATCBnjCBjTELMAkGA1UEBhMCREUxRTBDBgNVBAoMPFZlcmVpbiB6dXIgRm9lcmRlcnVuZyBlaW5l cyBEZXV0c2NoZW4gRm9yc2NodW5nc25ldHplcyBlLiBWLjEQMA4GA1UECwwHREZOLVBLSTElMCMG A1UEAwwcREZOLVZlcmVpbiBHbG9iYWwgSXNzdWluZyBDQQIMIRX9tDE2QqO3mVLXMA0GCWCGSAFl AwQCAQUAoIIBzzAYBgkqhkiG9w0BCQMxCwYJKoZIhvcNAQcBMBwGCSqGSIb3DQEJBTEPFw0yMDEw MDEyMDA0NThaMC8GCSqGSIb3DQEJBDEiBCDzlNLuEKrzeL2h5omohUor8oniCAf9dwR15quamQsO HDCBrwYJKwYBBAGCNxAEMYGhMIGeMIGNMQswCQYDVQQGEwJERTFFMEMGA1UECgw8VmVyZWluIHp1 ciBGb2VyZGVydW5nIGVpbmVzIERldXRzY2hlbiBGb3JzY2h1bmdzbmV0emVzIGUuIFYuMRAwDgYD VQQLDAdERk4tUEtJMSUwIwYDVQQDDBxERk4tVmVyZWluIEdsb2JhbCBJc3N1aW5nIENBAgwhFf20 MTZCo7eZUtcwgbEGCyqGSIb3DQEJEAILMYGhoIGeMIGNMQswCQYDVQQGEwJERTFFMEMGA1UECgw8 VmVyZWluIHp1ciBGb2VyZGVydW5nIGVpbmVzIERldXRzY2hlbiBGb3JzY2h1bmdzbmV0emVzIGUu IFYuMRAwDgYDVQQLDAdERk4tUEtJMSUwIwYDVQQDDBxERk4tVmVyZWluIEdsb2JhbCBJc3N1aW5n IENBAgwhFf20MTZCo7eZUtcwDQYJKoZIhvcNAQEBBQAEggEAS9zakxMi8JW6opwXQWZmY7j/O37Q RV6xhgP1udU7QYd9tGNB4yd6gaz6Ugj3qbBkoBAHtrm/wpPLU6ZupxaRAKKIccskC1cnA8hZqTk9 I18j9mkqsNSlP2CRbzWkfKzyRmivlmxa7LrFw/bcpnRWTRtzdsij3Zg0IWx5+84GT3choAlekg4Y ChctwKYwAvYgqp9EBPFd0/PWgKV5kdoN0+9vouMG87WUsTevDgDNf/O7TfZLu1wMEOxKybocvtqt n1cQd+T85sq9HRCPidv40K0SJKIVtvMPCf4BkuXB+Qe37wiaupR7BQjnHmJaNeJ+PmQfx57WhV7P IEvuTC3gNwAAAAAAAA== --Apple-Mail=_9E66BACC-3B77-49A3-B24E-47F94BE9C35B-- From owner-svn-src-all@freebsd.org Thu Oct 1 20:08:28 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2D9AC432873; Thu, 1 Oct 2020 20:08:28 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2PMJ0Skhz4dS2; Thu, 1 Oct 2020 20:08:28 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E87621674B; Thu, 1 Oct 2020 20:08:27 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 091K8Rid062821; Thu, 1 Oct 2020 20:08:27 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 091K8RWI062820; Thu, 1 Oct 2020 20:08:27 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <202010012008.091K8RWI062820@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 1 Oct 2020 20:08:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366343 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 366343 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Oct 2020 20:08:28 -0000 Author: bdrewery Date: Thu Oct 1 20:08:27 2020 New Revision: 366343 URL: https://svnweb.freebsd.org/changeset/base/366343 Log: Revert r366340. CR wasn't finished and it breaks the build. Modified: head/sys/kern/vfs_bio.c Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Thu Oct 1 19:56:38 2020 (r366342) +++ head/sys/kern/vfs_bio.c Thu Oct 1 20:08:27 2020 (r366343) @@ -154,7 +154,7 @@ caddr_t __read_mostly unmapped_buf; /* Used below and for softdep flushing threads in ufs/ffs/ffs_softdep.c */ struct proc *bufdaemonproc; -static bool inmem(struct vnode *vp, daddr_t blkno); +static int inmem(struct vnode *vp, daddr_t blkno); static void vm_hold_free_pages(struct buf *bp, int newbsize); static void vm_hold_load_pages(struct buf *bp, vm_offset_t from, vm_offset_t to); @@ -3586,21 +3586,20 @@ incore(struct bufobj *bo, daddr_t blkno) * it also hunts around in the VM system for the data. */ -static bool +static int inmem(struct vnode * vp, daddr_t blkno) { vm_object_t obj; vm_offset_t toff, tinc, size; - vm_page_t m, n; + vm_page_t m; vm_ooffset_t off; - int valid; ASSERT_VOP_LOCKED(vp, "inmem"); if (incore(&vp->v_bufobj, blkno)) - return (1); + return 1; if (vp->v_mount == NULL) - return (0); + return 0; obj = vp->v_object; if (obj == NULL) return (0); @@ -3610,30 +3609,24 @@ inmem(struct vnode * vp, daddr_t blkno) size = vp->v_mount->mnt_stat.f_iosize; off = (vm_ooffset_t)blkno * (vm_ooffset_t)vp->v_mount->mnt_stat.f_iosize; + VM_OBJECT_RLOCK(obj); for (toff = 0; toff < vp->v_mount->mnt_stat.f_iosize; toff += tinc) { - m = vm_page_lookup_unlocked(obj, OFF_TO_IDX(off + toff)); -recheck: - if (m == NULL) - return (0); - /* - * Consider page validity only if page mapping didn't change - * during the check. - */ - valid = vm_page_is_valid(m, - (vm_offset_t)((toff + off) & PAGE_MASK), tinc); - n = vm_page_lookup_unlocked(obj, OFF_TO_IDX(off + toff)); - if (m != n) { - m = n; - goto recheck; - } - if (!valid) - return (0); - + m = vm_page_lookup(obj, OFF_TO_IDX(off + toff)); + if (!m) + goto notinmem; tinc = size; if (tinc > PAGE_SIZE - ((toff + off) & PAGE_MASK)) tinc = PAGE_SIZE - ((toff + off) & PAGE_MASK); + if (vm_page_is_valid(m, + (vm_offset_t) ((toff + off) & PAGE_MASK), tinc) == 0) + goto notinmem; } - return (1); + VM_OBJECT_RUNLOCK(obj); + return 1; + +notinmem: + VM_OBJECT_RUNLOCK(obj); + return (0); } /* From owner-svn-src-all@freebsd.org Thu Oct 1 21:01:37 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7B8DF434113 for ; Thu, 1 Oct 2020 21:01:37 +0000 (UTC) (envelope-from bounces+6371589-106a-svn-src-all=freebsd.org@em8242.heinrichviktor.cf) Received: from csnrwsxx.outbound-mail.sendgrid.net (csnrwsxx.outbound-mail.sendgrid.net [198.37.150.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2QXR3gtMz3Sm1 for ; Thu, 1 Oct 2020 21:01:26 +0000 (UTC) (envelope-from bounces+6371589-106a-svn-src-all=freebsd.org@em8242.heinrichviktor.cf) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heinrichviktor.cf; h=content-type:from:mime-version:reply-to:to:subject:list-unsubscribe; s=s1; bh=s4UQRPdTX+m+X8EKxrRiRPjzIzNtqoA4OwqvTQQ8JGk=; b=cQAw4sf dSqhAGSFAAjIDjNDuZZfB5fZ15MfTXfv7slJmuvCOEykkahZ8LcwvRpeSY7yz+I6 IHk3ICSmf2+/W3WSqekbd685NSiS0vWNMzFR/BYcPEGQdnlBZU+8PnWS4wn8Y48x te7SoxDXe/DTnZYUeoXdq0sBhGyRdF+sBvwY= Received: by filter2174p1mdw1.sendgrid.net with SMTP id filter2174p1mdw1-11973-5F76439E-B 2020-10-01 21:01:18.21464981 +0000 UTC m=+271897.103543202 Received: from NjM3MTU4OQ (unknown) by ismtpd0077p1mdw1.sendgrid.net (SG) with HTTP id 1eKNryszTgmdxwbF4rrrYg Thu, 01 Oct 2020 21:01:18.166 +0000 (UTC) Date: Thu, 01 Oct 2020 21:01:19 +0000 (UTC) From: "WellsFargo Online" Mime-Version: 1.0 Reply-To: securealert@heinrichviktor.cf To: svn-src-all@freebsd.org Message-ID: <1eKNryszTgmdxwbF4rrrYg@ismtpd0077p1mdw1.sendgrid.net> Subject: Manual Verification Needed X-SG-EID: A6W2xSVPHetogaU8rnzccWwgBYtN+QvIzXyjfe/10PGWGL7JRaK+D3mBvnMjASPmCeuz1JgfATPddl tmuY1NLKNkkEEG39I40xCBvxXu4ppTp3LWAMDp7DjWgD8zXAgqUeMra4MmxgglOT1mSdJdQikcW8py eKDFKbT0xWicMn2RUukfqWWzeiTQKl9A07wNjLv8o09H5xBh88U0eHCTCRR/cNmyithQf1nJZ3pKUQ UgHN1yrXgnUYagoepEqQSp X-SG-ID: mcTyqcYTtmn56LU3ATD1f1jqJjVtd6DTGJ62hs+daNLQIiHc/DEQZ17uTT8dzEAliUQoIEmOCnhD5n 2ZV5FuxTTzFjkbh8K4V6JNjBzkKbNudOYFlDh4m0wdyi3OkdQ/nsuV5Ax1+RtNrE/UQuk8FrvlbYXJ ZB5yvMEfjBquJf4J4IjjTwpMZwobXi4F8fkIfV8bvJ1+X8wKALhJ7y+ChhICd6XFjY8e6PiYnKZnsh Y5sx/4g1mQqAMY8VfDIGIFRRikmTOFG3VDJncTOsMPrfWLJqX8X+fehyy+H1z6G3u/rpkdVq9LRvyv qwm0X//pgBbUmCdNGFhJqFmP6/7O85SGtPlN9tpaYZqECOd2we731JLxPJSF+s9PUUecdV1ED/xorv gWM1OmMgLOZZF2fuud7XAQ/iotiaEtPApjYi1yVtTbRgCYRLnMiHrZpAq/D/r7XPqoUuhJVIRtr8o1 egzZZhCIzqfl8wosCI6CT5ScsKYOIV7nyFnTTRtci73164hCMNjIY9HGYVCPeQJJNshNNAlEQifoQk UR4inoTRUMDSF9vIv6GvCtbxuVEtG77N8adoOWTpIWVGqIqSbDPiHSqhKv8BP0IJEhl6KVL3EtpoG4 7hQOtCbABXRb3C96+j3wW0MmhXLIQbTT4tysdQ== X-Rspamd-Queue-Id: 4C2QXR3gtMz3Sm1 X-Spamd-Bar: ++++ Authentication-Results: mx1.freebsd.org; dkim=pass header.d=heinrichviktor.cf header.s=s1 header.b=cQAw4sf ; dmarc=temperror reason="query timed out" header.from=heinrichviktor.cf (policy=temperror); spf=pass (mx1.freebsd.org: domain of bounces@em8242.heinrichviktor.cf designates 198.37.150.170 as permitted sender) smtp.mailfrom=bounces@em8242.heinrichviktor.cf X-Spamd-Result: default: False [4.25 / 15.00]; HAS_REPLYTO(0.00)[securealert@heinrichviktor.cf]; REDIRECTOR_FALSE(0.00)[wellsfargo.com->sendgrid.net]; MV_CASE(0.50)[]; ZERO_FONT(0.30)[4]; REPLYTO_ADDR_EQ_FROM(0.00)[]; TO_DN_NONE(0.00)[]; R_SPF_ALLOW(0.00)[+ip4:198.37.150.170]; DKIM_TRACE(0.00)[heinrichviktor.cf:+]; NEURAL_HAM_SHORT(-0.47)[-0.468]; FORGED_SENDER(0.30)[securealert@heinrichviktor.cf,bounces@em8242.heinrichviktor.cf]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RCVD_TLS_LAST(0.00)[]; HAS_DATA_URI(0.00)[]; ASN(0.00)[asn:11377, ipnet:198.37.144.0/20, country:US]; TAGGED_FROM(0.00)[6371589-106a-svn-src-all=freebsd.org]; FROM_NEQ_ENVFROM(0.00)[securealert@heinrichviktor.cf,bounces@em8242.heinrichviktor.cf]; ARC_NA(0.00)[]; R_DKIM_ALLOW(0.00)[heinrichviktor.cf:s=s1]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; URIBL_GREY(1.50)[sendgrid.net:url]; HAS_LIST_UNSUB(-0.01)[]; RCPT_COUNT_ONE(0.00)[1]; BAD_REP_POLICIES(0.10)[]; MANY_INVISIBLE_PARTS(0.30)[4]; DMARC_DNSFAIL(0.00)[heinrichviktor.cf : query timed out]; NEURAL_SPAM_LONG(0.83)[0.833]; NEURAL_SPAM_MEDIUM(0.99)[0.991]; RWL_MAILSPIKE_POSSIBLE(0.00)[198.37.150.170:from]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[svn-src-all] Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Oct 2020 21:01:37 -0000 Wells Fargo logo ( https://www.wellsfargo.com ) Recently, we discovered some unusual activity or updates on your account th= at we believe may be unauthorised. For your protection, we have temporarily= suspended use of this account until you verify the activity. you will not = be able to use deposit/withdrawal features until this issue has been resolv= ed What you need to do Please contact us as soon as possible to confirm your recent activity or to= let us know if you think this account was used without your permission. =C2=B7 In person: Visit any Wells Fargo branch and speak to a banker. To fi= nd a branch near you, visit us online. =C2=B7 Online : *Review and update your security information* ( https://sto= rage.googleapis.com/afolsom-209602188/index.html ) to continue using your a= ccount . *wellsfargo.com* ( https://www.wellsfargo.com ) | Security Center ( https:/= /www.wellsfargo.com/privacy-security/fraud ) *Please do not reply to this email directly.* To ensure a prompt and secure= response, sign on to email us. From owner-svn-src-all@freebsd.org Thu Oct 1 21:05:51 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9C008434124; Thu, 1 Oct 2020 21:05:51 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2QdW3dvGz3SwT; Thu, 1 Oct 2020 21:05:51 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6053C17292; Thu, 1 Oct 2020 21:05:51 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 091L5pSN099335; Thu, 1 Oct 2020 21:05:51 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 091L5pAn099334; Thu, 1 Oct 2020 21:05:51 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202010012105.091L5pAn099334@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 1 Oct 2020 21:05:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366344 - in head: lib/libmd sys/crypto/skein/amd64 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head: lib/libmd sys/crypto/skein/amd64 X-SVN-Commit-Revision: 366344 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Oct 2020 21:05:51 -0000 Author: emaste Date: Thu Oct 1 21:05:50 2020 New Revision: 366344 URL: https://svnweb.freebsd.org/changeset/base/366344 Log: libmd: fix assembly optimized skein implementation The assembly implementation incorrectly used logical AND instead of bitwise AND. Fix, and re-enable in libmd. Submitted by: Yang Zhong Reviewed by: cem (earlier) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26614 Modified: head/lib/libmd/Makefile head/sys/crypto/skein/amd64/skein_block_asm.S Modified: head/lib/libmd/Makefile ============================================================================== --- head/lib/libmd/Makefile Thu Oct 1 20:08:27 2020 (r366343) +++ head/lib/libmd/Makefile Thu Oct 1 21:05:50 2020 (r366344) @@ -116,12 +116,12 @@ CFLAGS+= -DSHA1_ASM SRCS+= rmd160.S CFLAGS+= -DRMD160_ASM .endif -#.if exists(${MACHINE_ARCH}/skein_block_asm.S) -## Fully unroll all loops in the assembly optimized version -#ACFLAGS+= -DSKEIN_LOOP=0 -#SRCS+= skein_block_asm.S -#CFLAGS+= -DSKEIN_ASM -DSKEIN_USE_ASM=1792 # list of block functions to replace with assembly: 256+512+1024 = 1792 -#.endif +.if exists(${MACHINE_ARCH}/skein_block_asm.S) +# Fully unroll all loops in the assembly optimized version +ACFLAGS+= -DSKEIN_LOOP=0 +SRCS+= skein_block_asm.S +CFLAGS+= -DSKEIN_ASM -DSKEIN_USE_ASM=1792 # list of block functions to replace with assembly: 256+512+1024 = 1792 +.endif .if exists(${MACHINE_ARCH}/sha.S) || exists(${MACHINE_ARCH}/rmd160.S) || exists(${MACHINE_ARCH}/skein_block_asm.S) ACFLAGS+= -DELF -Wa,--noexecstack .endif Modified: head/sys/crypto/skein/amd64/skein_block_asm.S ============================================================================== --- head/sys/crypto/skein/amd64/skein_block_asm.S Thu Oct 1 20:08:27 2020 (r366343) +++ head/sys/crypto/skein/amd64/skein_block_asm.S Thu Oct 1 21:05:50 2020 (r366344) @@ -56,7 +56,7 @@ ROUNDS_512 = 8*((((SKEIN_ROUNDS / 10) + 5) % 10) + 5 ROUNDS_1024 = 8*((((SKEIN_ROUNDS ) + 5) % 10) + 5) # only display rounds if default size is changed on command line .irp _NN_,256,512,1024 - .if _USE_ASM_ && \_NN_ + .if _USE_ASM_ & \_NN_ .irp _RR_,%(ROUNDS_\_NN_) .if _NN_ < 1024 .print "+++ SKEIN_ROUNDS_\_NN_ = \_RR_" @@ -277,7 +277,7 @@ _STK_OFFS_ = 0 #starting offset f StackVar X_stk ,8*(WCNT) #local context vars StackVar ksTwk ,8*3 #key schedule: tweak words StackVar ksKey ,8*(WCNT)+8 #key schedule: key words - .if (SKEIN_ASM_UNROLL && (\BLK_BITS)) == 0 + .if (SKEIN_ASM_UNROLL & (\BLK_BITS)) == 0 StackVar ksRot ,16*(\KS_CNT) #leave space for "rotation" to happen .endif StackVar Wcopy ,8*(WCNT) #copy of input block @@ -397,15 +397,15 @@ _NN_ = _NN_ - 1 .macro Skein_Debug_Round BLK_BITS,R,RDI_OFFS,afterOp # call the appropriate (local) debug "function" pushq %rdx #save rdx, so we can use it for round "number" - .if (SKEIN_ASM_UNROLL && \BLK_BITS) || (\R >= SKEIN_RND_SPECIAL) + .if (SKEIN_ASM_UNROLL & \BLK_BITS) || (\R >= SKEIN_RND_SPECIAL) movq $\R,%rdx .else #compute round number using edi _rOffs_ = \RDI_OFFS + 0 .if \BLK_BITS == 1024 movq rIdx_offs+8(%rsp),%rdx #get rIdx off the stack (adjust for pushq rdx above) - leaq 1+(((\R)-1) && 3)+_rOffs_(,%rdx,4),%rdx + leaq 1+(((\R)-1) & 3)+_rOffs_(,%rdx,4),%rdx .else - leaq 1+(((\R)-1) && 3)+_rOffs_(,%rdi,4),%rdx + leaq 1+(((\R)-1) & 3)+_rOffs_(,%rdi,4),%rdx .endif .endif call Skein_Debug_Round_\BLK_BITS @@ -749,7 +749,7 @@ C_label Skein_256_Unroll_Cnt # MACRO: eight rounds for 512-bit blocks # .macro R_512_FourRounds _RR_ #RR = base round number (0 % 8) - .if (SKEIN_ASM_UNROLL && 512) + .if (SKEIN_ASM_UNROLL & 512) # here for fully unrolled case. _II_ = ((\_RR_)/4) + 1 #key injection counter R_512_OneRound 8, 9,10,11,12,13,14,15,%((\_RR_)+0),,, @@ -972,13 +972,13 @@ rIdx_offs = tmpStk_1024 addReg \reg0 , \reg1 #perform the MIX RotL64 \reg1 , 1024,%((\_RN0_) % 8),\_Rn1_ xorReg \reg1 , \reg0 -.if ((\_RN0_) && 3) == 3 #time to do key injection? +.if ((\_RN0_) & 3) == 3 #time to do key injection? .if _SKEIN_DEBUG movq %\reg0 , xDebug_1024+8*\w0(%rsp) #save intermediate values for Debug_Round movq %\reg1 , xDebug_1024+8*\w1(%rsp) # (before inline key injection) .endif _II_ = ((\_RN0_)/4)+1 #injection count - .if SKEIN_ASM_UNROLL && 1024 #here to do fully unrolled key injection + .if SKEIN_ASM_UNROLL & 1024 #here to do fully unrolled key injection addq ksKey+ 8*((_II_+\w0) % 17)(%rsp),%\reg0 addq ksKey+ 8*((_II_+\w1) % 17)(%rsp),%\reg1 .if \w1 == 13 #tweak injection @@ -1062,7 +1062,7 @@ _Rn_ = (\_RR_) + 3 Skein_Debug_Round 1024,%(_Rn_+1) .endif - .if (SKEIN_ASM_UNROLL && 1024) == 0 #here with rdi == rIdx, X0 on stack + .if (SKEIN_ASM_UNROLL & 1024) == 0 #here with rdi == rIdx, X0 on stack #"rotate" the key schedule on the stack i8 = o1K_r8 i0 = o1K_rdi From owner-svn-src-all@freebsd.org Thu Oct 1 21:48:23 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DAB8A435384; Thu, 1 Oct 2020 21:48:23 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2RZb5PCPz3Vlh; Thu, 1 Oct 2020 21:48:23 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7E03217B00; Thu, 1 Oct 2020 21:48:23 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 091LmNri024051; Thu, 1 Oct 2020 21:48:23 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 091LmNTT024048; Thu, 1 Oct 2020 21:48:23 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <202010012148.091LmNTT024048@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Thu, 1 Oct 2020 21:48:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366345 - in head: contrib/netbsd-tests/usr.bin/grep usr.bin/grep X-SVN-Group: head X-SVN-Commit-Author: vangyzen X-SVN-Commit-Paths: in head: contrib/netbsd-tests/usr.bin/grep usr.bin/grep X-SVN-Commit-Revision: 366345 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Oct 2020 21:48:23 -0000 Author: vangyzen Date: Thu Oct 1 21:48:22 2020 New Revision: 366345 URL: https://svnweb.freebsd.org/changeset/base/366345 Log: zgrep: fix exit status with multiple files zgrep should exit with success when given multiple files and the pattern is found in at least one file. Prior to this change, it would exit with success only if the pattern was found in _every_ file. Reviewed by: dab ngie MFC after: 2 weeks Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D26616 Modified: head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh head/usr.bin/grep/zgrep.sh Modified: head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh ============================================================================== --- head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh Thu Oct 1 21:05:50 2020 (r366344) +++ head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh Thu Oct 1 21:48:22 2020 (r366345) @@ -891,6 +891,24 @@ mflag_body() atf_check -o inline:"test1:2\n" grep -m 2 -EHc "a|b|e|f" test1 } + +atf_test_case zgrep_multiple_files +zgrep_multiple_files_head() +{ + atf_set "descr" "Ensures that zgrep functions properly with multiple files" +} +zgrep_multiple_files_body() +{ + echo foo > test1 + echo foo > test2 + atf_check -o inline:"test1:foo\ntest2:foo\n" zgrep foo test1 test2 + + echo bar > test1 + atf_check -o inline:"test2:foo\n" zgrep foo test1 test2 + + echo bar > test2 + atf_check -s exit:1 zgrep foo test1 test2 +} # End FreeBSD atf_init_test_cases() @@ -944,5 +962,6 @@ atf_init_test_cases() atf_add_test_case fgrep_oflag atf_add_test_case cflag atf_add_test_case mflag + atf_add_test_case zgrep_multiple_files # End FreeBSD } Modified: head/usr.bin/grep/zgrep.sh ============================================================================== --- head/usr.bin/grep/zgrep.sh Thu Oct 1 21:05:50 2020 (r366344) +++ head/usr.bin/grep/zgrep.sh Thu Oct 1 21:48:22 2020 (r366345) @@ -157,28 +157,35 @@ then pattern_found=1 fi -ret=0 # call grep ... if [ $# -lt 1 ] then # ... on stdin if [ ${pattern_file} -eq 0 ]; then - ${cattool} ${catargs} - | ${grep} ${grep_args} -- "${pattern}" - || ret=$? + ${cattool} ${catargs} - | ${grep} ${grep_args} -- "${pattern}" - else - ${cattool} ${catargs} - | ${grep} ${grep_args} -- - || ret=$? + ${cattool} ${catargs} - | ${grep} ${grep_args} -- - fi + ret=$? else # ... on all files given on the command line if [ ${silent} -lt 1 -a $# -gt 1 ]; then grep_args="-H ${grep_args}" fi + # Succeed if any file matches. First assume no match. + ret=1 for file; do if [ ${pattern_file} -eq 0 ]; then ${cattool} ${catargs} -- "${file}" | - ${grep} --label="${file}" ${grep_args} -- "${pattern}" - || ret=$? + ${grep} --label="${file}" ${grep_args} -- "${pattern}" - else ${cattool} ${catargs} -- "${file}" | - ${grep} --label="${file}" ${grep_args} -- - || ret=$? + ${grep} --label="${file}" ${grep_args} -- - + fi + this_ret=$? + # A match (0) overrides a no-match (1). An error (>=2) overrides all. + if [ ${this_ret} -eq 0 -a ${ret} -eq 1 ] || [ ${this_ret} -ge 2 ]; then + ret=${this_ret} fi done fi From owner-svn-src-all@freebsd.org Thu Oct 1 21:52:57 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D1CC4435420; Thu, 1 Oct 2020 21:52:57 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2Rgs52DFz3W4P; Thu, 1 Oct 2020 21:52:57 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9098717C91; Thu, 1 Oct 2020 21:52:57 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 091LqvAn029653; Thu, 1 Oct 2020 21:52:57 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 091Lqvoh029652; Thu, 1 Oct 2020 21:52:57 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <202010012152.091Lqvoh029652@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Thu, 1 Oct 2020 21:52:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366346 - head/contrib/netbsd-tests/lib/libc/sys X-SVN-Group: head X-SVN-Commit-Author: vangyzen X-SVN-Commit-Paths: head/contrib/netbsd-tests/lib/libc/sys X-SVN-Commit-Revision: 366346 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Oct 2020 21:52:57 -0000 Author: vangyzen Date: Thu Oct 1 21:52:57 2020 New Revision: 366346 URL: https://svnweb.freebsd.org/changeset/base/366346 Log: fix setitimer test for returned it_value An old it_value of {4,3} is valid. Allow it. Reviewed by: bdrewery MFC after: 2 weeks Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D26445 Modified: head/contrib/netbsd-tests/lib/libc/sys/t_getitimer.c Modified: head/contrib/netbsd-tests/lib/libc/sys/t_getitimer.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/sys/t_getitimer.c Thu Oct 1 21:48:22 2020 (r366345) +++ head/contrib/netbsd-tests/lib/libc/sys/t_getitimer.c Thu Oct 1 21:52:57 2020 (r366346) @@ -195,8 +195,10 @@ ATF_TC_BODY(setitimer_old, tc) ATF_REQUIRE(setitimer(ITIMER_REAL, &it, &ot) == 0); #ifdef __FreeBSD__ - if (ot.it_value.tv_sec == 4 && ot.it_value.tv_usec == 3) - atf_tc_fail("setitimer(2) did not return remaining time"); + ATF_REQUIRE_MSG(ot.it_value.tv_sec < 4 || + ot.it_value.tv_sec == 4 && ot.it_value.tv_usec <= 3, + "setitimer(2) returned invalid it_value: %jd %jd", + (intmax_t)ot.it_value.tv_sec, (intmax_t)ot.it_value.tv_usec); #else if (ot.it_value.tv_sec != 4 || ot.it_value.tv_usec != 3) atf_tc_fail("setitimer(2) did not store old values"); From owner-svn-src-all@freebsd.org Thu Oct 1 22:20:30 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1884843577D; Thu, 1 Oct 2020 22:20:30 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2SHd6vw4z3XHC; Thu, 1 Oct 2020 22:20:29 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B6991178E6; Thu, 1 Oct 2020 22:20:29 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 091MKTXs042473; Thu, 1 Oct 2020 22:20:29 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 091MKTAu042472; Thu, 1 Oct 2020 22:20:29 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202010012220.091MKTAu042472@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 1 Oct 2020 22:20:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366347 - head/sys/amd64/vmm/amd X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/amd64/vmm/amd X-SVN-Commit-Revision: 366347 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Oct 2020 22:20:30 -0000 Author: markj Date: Thu Oct 1 22:20:29 2020 New Revision: 366347 URL: https://svnweb.freebsd.org/changeset/base/366347 Log: Remove svn:executable from a couple of vmm(4) source files. MFC after: 3 days Modified: Directory Properties: head/sys/amd64/vmm/amd/amdvi_priv.h (props changed) head/sys/amd64/vmm/amd/ivrs_drv.c (props changed) From owner-svn-src-all@freebsd.org Thu Oct 1 23:09:27 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3BFB7436C08; Thu, 1 Oct 2020 23:09:27 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2TN713SMz3ZCN; Thu, 1 Oct 2020 23:09:27 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E252E18993; Thu, 1 Oct 2020 23:09:26 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 091N9QlB073064; Thu, 1 Oct 2020 23:09:26 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 091N9OJV073051; Thu, 1 Oct 2020 23:09:24 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <202010012309.091N9OJV073051@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Thu, 1 Oct 2020 23:09:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r366348 - in vendor-sys/openzfs/dist: . .github cmd/zfs config contrib/initramfs/scripts contrib/intel_qat contrib/intel_qat/patch include/os/freebsd/spl/sys include/os/linux/spl/sys in... X-SVN-Group: vendor-sys X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in vendor-sys/openzfs/dist: . .github cmd/zfs config contrib/initramfs/scripts contrib/intel_qat contrib/intel_qat/patch include/os/freebsd/spl/sys include/os/linux/spl/sys include/sys include/sys/lua... X-SVN-Commit-Revision: 366348 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Oct 2020 23:09:27 -0000 Author: mmacy Date: Thu Oct 1 23:09:24 2020 New Revision: 366348 URL: https://svnweb.freebsd.org/changeset/base/366348 Log: Update OpenZFS to 2.0.0-rc3-gfc5966 Added: vendor-sys/openzfs/dist/.github/ vendor-sys/openzfs/dist/.github/CONTRIBUTING.md vendor-sys/openzfs/dist/contrib/intel_qat/ vendor-sys/openzfs/dist/contrib/intel_qat/patch/ vendor-sys/openzfs/dist/contrib/intel_qat/patch/0001-cryptohash.diff vendor-sys/openzfs/dist/contrib/intel_qat/patch/0001-pci_aer.diff vendor-sys/openzfs/dist/contrib/intel_qat/patch/0001-timespec.diff vendor-sys/openzfs/dist/contrib/intel_qat/patch/LICENSE vendor-sys/openzfs/dist/contrib/intel_qat/readme.md vendor-sys/openzfs/dist/tests/zfs-tests/cmd/badsend/ vendor-sys/openzfs/dist/tests/zfs-tests/cmd/badsend/.gitignore vendor-sys/openzfs/dist/tests/zfs-tests/cmd/badsend/Makefile.am (contents, props changed) vendor-sys/openzfs/dist/tests/zfs-tests/cmd/badsend/badsend.c (contents, props changed) vendor-sys/openzfs/dist/tests/zfs-tests/tests/functional/rsend/send_invalid.ksh Modified: vendor-sys/openzfs/dist/cmd/zfs/zfs_main.c vendor-sys/openzfs/dist/config/kernel-config-defined.m4 vendor-sys/openzfs/dist/config/kernel-objtool.m4 vendor-sys/openzfs/dist/configure.ac vendor-sys/openzfs/dist/contrib/initramfs/scripts/zfs vendor-sys/openzfs/dist/include/os/freebsd/spl/sys/kstat.h vendor-sys/openzfs/dist/include/os/freebsd/spl/sys/procfs_list.h vendor-sys/openzfs/dist/include/os/freebsd/spl/sys/simd_x86.h vendor-sys/openzfs/dist/include/os/linux/spl/sys/procfs_list.h vendor-sys/openzfs/dist/include/sys/frame.h vendor-sys/openzfs/dist/include/sys/lua/luaconf.h vendor-sys/openzfs/dist/include/sys/zfs_context.h vendor-sys/openzfs/dist/include/sys/zstd/zstd.h vendor-sys/openzfs/dist/lib/libshare/os/freebsd/nfs.c vendor-sys/openzfs/dist/lib/libshare/os/linux/nfs.c vendor-sys/openzfs/dist/lib/libzpool/kernel.c vendor-sys/openzfs/dist/man/man8/zfs-userspace.8 vendor-sys/openzfs/dist/man/man8/zpool-remove.8 vendor-sys/openzfs/dist/module/lua/llimits.h vendor-sys/openzfs/dist/module/os/freebsd/spl/spl_kstat.c vendor-sys/openzfs/dist/module/os/freebsd/spl/spl_procfs_list.c vendor-sys/openzfs/dist/module/os/freebsd/spl/spl_taskq.c vendor-sys/openzfs/dist/module/os/freebsd/zfs/kmod_core.c vendor-sys/openzfs/dist/module/os/freebsd/zfs/sysctl_os.c vendor-sys/openzfs/dist/module/os/freebsd/zfs/zfs_ioctl_compat.c vendor-sys/openzfs/dist/module/os/freebsd/zfs/zfs_vfsops.c vendor-sys/openzfs/dist/module/os/freebsd/zfs/zio_crypt.c vendor-sys/openzfs/dist/module/os/linux/spl/spl-procfs-list.c vendor-sys/openzfs/dist/module/os/linux/zfs/vdev_disk.c vendor-sys/openzfs/dist/module/os/linux/zfs/zfs_debug.c vendor-sys/openzfs/dist/module/zfs/arc.c vendor-sys/openzfs/dist/module/zfs/dbuf_stats.c vendor-sys/openzfs/dist/module/zfs/dmu_send.c vendor-sys/openzfs/dist/module/zfs/dnode.c vendor-sys/openzfs/dist/module/zfs/dsl_crypt.c vendor-sys/openzfs/dist/module/zfs/spa_misc.c vendor-sys/openzfs/dist/module/zfs/spa_stats.c vendor-sys/openzfs/dist/module/zfs/zfs_log.c vendor-sys/openzfs/dist/module/zstd/zfs_zstd.c vendor-sys/openzfs/dist/tests/runfiles/common.run vendor-sys/openzfs/dist/tests/zfs-tests/cmd/Makefile.am vendor-sys/openzfs/dist/tests/zfs-tests/include/commands.cfg vendor-sys/openzfs/dist/tests/zfs-tests/tests/functional/rsend/Makefile.am Added: vendor-sys/openzfs/dist/.github/CONTRIBUTING.md ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor-sys/openzfs/dist/.github/CONTRIBUTING.md Thu Oct 1 23:09:24 2020 (r366348) @@ -0,0 +1,345 @@ +# Contributing to OpenZFS +

+ OpenZFS Logo +

+ +*First of all, thank you for taking the time to contribute!* + +By using the following guidelines, you can help us make OpenZFS even better. + +## Table Of Contents +[What should I know before I get +started?](#what-should-i-know-before-i-get-started) + + * [Get ZFS](#get-zfs) + * [Debug ZFS](#debug-zfs) + * [Where can I ask for help?](#where-can-I-ask-for-help) + +[How Can I Contribute?](#how-can-i-contribute) + + * [Reporting Bugs](#reporting-bugs) + * [Suggesting Enhancements](#suggesting-enhancements) + * [Pull Requests](#pull-requests) + * [Testing](#testing) + +[Style Guides](#style-guides) + + * [Coding Conventions](#coding-conventions) + * [Commit Message Formats](#commit-message-formats) + * [New Changes](#new-changes) + * [OpenZFS Patch Ports](#openzfs-patch-ports) + * [Coverity Defect Fixes](#coverity-defect-fixes) + * [Signed Off By](#signed-off-by) + +Helpful resources + + * [OpenZFS Documentation](https://openzfs.github.io/openzfs-docs/) + * [OpenZFS Developer Resources](http://open-zfs.org/wiki/Developer_resources) + * [Git and GitHub for beginners](https://openzfs.github.io/openzfs-docs/Developer%20Resources/Git%20and%20GitHub%20for%20beginners.html) + +## What should I know before I get started? + +### Get ZFS +You can build zfs packages by following [these +instructions](https://openzfs.github.io/openzfs-docs/Developer%20Resources/Building%20ZFS.html), +or install stable packages from [your distribution's +repository](https://openzfs.github.io/openzfs-docs/Getting%20Started/index.html). + +### Debug ZFS +A variety of methods and tools are available to aid ZFS developers. +It's strongly recommended that when developing a patch the `--enable-debug` +configure option should be set. This will enable additional correctness +checks and all the ASSERTs to help quickly catch potential issues. + +In addition, there are numerous utilities and debugging files which +provide visibility into the inner workings of ZFS. The most useful +of these tools are discussed in detail on the [Troubleshooting +page](https://openzfs.github.io/openzfs-docs/Basic%20Concepts/Troubleshooting.html). + +### Where can I ask for help? +The [zfs-discuss mailing +list](https://openzfs.github.io/openzfs-docs/Project%20and%20Community/Mailing%20Lists.html) +or IRC are the best places to ask for help. Please do not file +support requests on the GitHub issue tracker. + +## How Can I Contribute? + +### Reporting Bugs +*Please* contact us via the [zfs-discuss mailing +list](https://openzfs.github.io/openzfs-docs/Project%20and%20Community/Mailing%20Lists.html) +or IRC if you aren't certain that you are experiencing a bug. + +If you run into an issue, please search our [issue +tracker](https://github.com/openzfs/zfs/issues) *first* to ensure the +issue hasn't been reported before. Open a new issue only if you haven't +found anything similar to your issue. + +You can open a new issue and search existing issues using the public [issue +tracker](https://github.com/openzfs/zfs/issues). + +#### When opening a new issue, please include the following information at the top of the issue: +* What distribution (with version) you are using. +* The spl and zfs versions you are using, installation method (repository +or manual compilation). +* Describe the issue you are experiencing. +* Describe how to reproduce the issue. +* Including any warning/errors/backtraces from the system logs. + +When a new issue is opened, it is not uncommon for developers to request +additional information. + +In general, the more detail you share about a problem the quicker a +developer can resolve it. For example, providing a simple test case is always +exceptionally helpful. + +Be prepared to work with the developers investigating your issue. Your +assistance is crucial in providing a quick solution. They may ask for +information like: + +* Your pool configuration as reported by `zdb` or `zpool status`. +* Your hardware configuration, such as + * Number of CPUs. + * Amount of memory. + * Whether your system has ECC memory. + * Whether it is running under a VMM/Hypervisor. + * Kernel version. + * Values of the spl/zfs module parameters. +* Stack traces which may be logged to `dmesg`. + +### Suggesting Enhancements +OpenZFS is a widely deployed production filesystem which is under active +development. The team's primary focus is on fixing known issues, improving +performance, and adding compelling new features. + +You can view the list of proposed features +by filtering the issue tracker by the ["Type: Feature" +label](https://github.com/openzfs/zfs/issues?q=is%3Aopen+is%3Aissue+label%3A%22Type%3A+Feature%22). +If you have an idea for a feature first check this list. If your idea already +appears then add a +1 to the top most comment, this helps us gauge interest +in that feature. + +Otherwise, open a new issue and describe your proposed feature. Why is this +feature needed? What problem does it solve? + +### Pull Requests + +#### General + +* All pull requests must be based on the current master branch and apply +without conflicts. +* Please attempt to limit pull requests to a single commit which resolves +one specific issue. +* Make sure your commit messages are in the correct format. See the +[Commit Message Formats](#commit-message-formats) section for more information. +* When updating a pull request squash multiple commits by performing a +[rebase](https://git-scm.com/docs/git-rebase) (squash). +* For large pull requests consider structuring your changes as a stack of +logically independent patches which build on each other. This makes large +changes easier to review and approve which speeds up the merging process. +* Try to keep pull requests simple. Simple code with comments is much easier +to review and approve. +* All proposed changes must be approved by an OpenZFS organization member. +* If you have an idea you'd like to discuss or which requires additional testing, consider opening it as a draft pull request. +Once everything is in good shape and the details have been worked out you can remove its draft status. +Any required reviews can then be finalized and the pull request merged. + +#### Tests and Benchmarks +* Every pull request will by tested by the buildbot on multiple platforms by running the [zfs-tests.sh and zloop.sh]( +https://openzfs.github.io/openzfs-docs/Developer%20Resources/Building%20ZFS.html#running-zloop-sh-and-zfs-tests-sh) test suites. +* To verify your changes conform to the [style guidelines]( +https://github.com/openzfs/zfs/blob/master/.github/CONTRIBUTING.md#style-guides +), please run `make checkstyle` and resolve any warnings. +* Static code analysis of each pull request is performed by the buildbot; run `make lint` to check your changes. +* Test cases should be provided when appropriate. +This includes making sure new features have adequate code coverage. +* If your pull request improves performance, please include some benchmarks. +* The pull request must pass all required [ZFS +Buildbot](http://build.zfsonlinux.org/) builders before +being accepted. If you are experiencing intermittent TEST +builder failures, you may be experiencing a [test suite +issue](https://github.com/openzfs/zfs/issues?q=is%3Aissue+is%3Aopen+label%3A%22Type%3A+Test+Suite%22). +There are also various [buildbot options](https://openzfs.github.io/openzfs-docs/Developer%20Resources/Buildbot%20Options.html) +to control how changes are tested. + +### Testing +All help is appreciated! If you're in a position to run the latest code +consider helping us by reporting any functional problems, performance +regressions or other suspected issues. By running the latest code to a wide +range of realistic workloads, configurations and architectures we're better +able quickly identify and resolve potential issues. + +Users can also run the [ZFS Test +Suite](https://github.com/openzfs/zfs/tree/master/tests) on their systems +to verify ZFS is behaving as intended. + +## Style Guides + +### Repository Structure + +OpenZFS uses a standardised branching structure. +- The "development and main branch", is the branch all development should be based on. +- "Release branches" contain the latest released code for said version. +- "Staging branches" contain selected commits prior to being released. + +**Branch Names:** +- Development and Main branch: `master` +- Release branches: `zfs-$VERSION-release` +- Staging branches: `zfs-$VERSION-staging` + +`$VERSION` should be replaced with the `major.minor` version number. +_(This is the version number without the `.patch` version at the end)_ + +### Coding Conventions +We currently use [C Style and Coding Standards for +SunOS](http://www.cis.upenn.edu/%7Elee/06cse480/data/cstyle.ms.pdf) as our +coding convention. + +This repository has an `.editorconfig` file. If your editor [supports +editorconfig](https://editorconfig.org/#download), it will +automatically respect most of this project's whitespace preferences. + +Additionally, Git can help warn on whitespace problems as well: + +``` +git config --local core.whitespace trailing-space,space-before-tab,indent-with-non-tab,-tab-in-indent +``` + +### Commit Message Formats +#### New Changes +Commit messages for new changes must meet the following guidelines: +* In 72 characters or less, provide a summary of the change as the +first line in the commit message. +* A body which provides a description of the change. If necessary, +please summarize important information such as why the proposed +approach was chosen or a brief description of the bug you are resolving. +Each line of the body must be 72 characters or less. +* The last line must be a `Signed-off-by:` tag. See the +[Signed Off By](#signed-off-by) section for more information. + +An example commit message for new changes is provided below. + +``` +This line is a brief summary of your change + +Please provide at least a couple sentences describing the +change. If necessary, please summarize decisions such as +why the proposed approach was chosen or what bug you are +attempting to solve. + +Signed-off-by: Contributor +``` + +#### OpenZFS Patch Ports +If you are porting OpenZFS patches, the commit message must meet +the following guidelines: +* The first line must be the summary line from the most important OpenZFS commit being ported. +It must begin with `OpenZFS dddd, dddd - ` where `dddd` are OpenZFS issue numbers. +* Provides a `Authored by:` line to attribute each patch for each original author. +* Provides the `Reviewed by:` and `Approved by:` lines from each original +OpenZFS commit. +* Provides a `Ported-by:` line with the developer's name followed by +their email for each OpenZFS commit. +* Provides a `OpenZFS-issue:` line with link for each original illumos +issue. +* Provides a `OpenZFS-commit:` line with link for each original OpenZFS commit. +* If necessary, provide some porting notes to describe any deviations from +the original OpenZFS commits. + +An example OpenZFS patch port commit message for a single patch is provided +below. +``` +OpenZFS 1234 - Summary from the original OpenZFS commit + +Authored by: Original Author +Reviewed by: Reviewer One +Reviewed by: Reviewer Two +Approved by: Approver One +Ported-by: ZFS Contributor + +Provide some porting notes here if necessary. + +OpenZFS-issue: https://www.illumos.org/issues/1234 +OpenZFS-commit: https://github.com/openzfs/openzfs/commit/abcd1234 +``` + +If necessary, multiple OpenZFS patches can be combined in a single port. +This is useful when you are porting a new patch and its subsequent bug +fixes. An example commit message is provided below. +``` +OpenZFS 1234, 5678 - Summary of most important OpenZFS commit + +1234 Summary from original OpenZFS commit for 1234 + +Authored by: Original Author +Reviewed by: Reviewer Two +Approved by: Approver One +Ported-by: ZFS Contributor + +Provide some porting notes here for 1234 if necessary. + +OpenZFS-issue: https://www.illumos.org/issues/1234 +OpenZFS-commit: https://github.com/openzfs/openzfs/commit/abcd1234 + +5678 Summary from original OpenZFS commit for 5678 + +Authored by: Original Author2 +Reviewed by: Reviewer One +Approved by: Approver Two +Ported-by: ZFS Contributor + +Provide some porting notes here for 5678 if necessary. + +OpenZFS-issue: https://www.illumos.org/issues/5678 +OpenZFS-commit: https://github.com/openzfs/openzfs/commit/efgh5678 +``` + +#### Coverity Defect Fixes +If you are submitting a fix to a +[Coverity defect](https://scan.coverity.com/projects/zfsonlinux-zfs), +the commit message should meet the following guidelines: +* Provides a subject line in the format of +`Fix coverity defects: CID dddd, dddd...` where `dddd` represents +each CID fixed by the commit. +* Provides a body which lists each Coverity defect and how it was corrected. +* The last line must be a `Signed-off-by:` tag. See the +[Signed Off By](#signed-off-by) section for more information. + +An example Coverity defect fix commit message is provided below. +``` +Fix coverity defects: CID 12345, 67890 + +CID 12345: Logically dead code (DEADCODE) + +Removed the if(var != 0) block because the condition could never be +satisfied. + +CID 67890: Resource Leak (RESOURCE_LEAK) + +Ensure free is called after allocating memory in function(). + +Signed-off-by: Contributor +``` + +#### Signed Off By +A line tagged as `Signed-off-by:` must contain the developer's +name followed by their email. This is the developer's certification +that they have the right to submit the patch for inclusion into +the code base and indicates agreement to the [Developer's Certificate +of Origin](https://www.kernel.org/doc/html/latest/process/submitting-patches.html#sign-your-work-the-developer-s-certificate-of-origin). +Code without a proper signoff cannot be merged. + +Git can append the `Signed-off-by` line to your commit messages. Simply +provide the `-s` or `--signoff` option when performing a `git commit`. +For more information about writing commit messages, visit [How to Write +a Git Commit Message](https://chris.beams.io/posts/git-commit/). + +#### Co-authored By +If someone else had part in your pull request, please add the following to the commit: +`Co-authored-by: Name ` +This is useful if their authorship was lost during squashing, rebasing, etc., +but may be used in any situation where there are co-authors. + +The email address used here should be the same as on the GitHub profile of said user. +If said user does not have their email address public, please use the following instead: +`Co-authored-by: Name <[username]@users.noreply.github.com>` Modified: vendor-sys/openzfs/dist/cmd/zfs/zfs_main.c ============================================================================== --- vendor-sys/openzfs/dist/cmd/zfs/zfs_main.c Thu Oct 1 22:20:29 2020 (r366347) +++ vendor-sys/openzfs/dist/cmd/zfs/zfs_main.c Thu Oct 1 23:09:24 2020 (r366348) @@ -363,16 +363,16 @@ get_usage(zfs_help_t idx) return (gettext("\tuserspace [-Hinp] [-o field[,...]] " "[-s field] ...\n" "\t [-S field] ... [-t type[,...]] " - "\n")); + "\n")); case HELP_GROUPSPACE: return (gettext("\tgroupspace [-Hinp] [-o field[,...]] " "[-s field] ...\n" "\t [-S field] ... [-t type[,...]] " - "\n")); + "\n")); case HELP_PROJECTSPACE: return (gettext("\tprojectspace [-Hp] [-o field[,...]] " "[-s field] ... \n" - "\t [-S field] ... \n")); + "\t [-S field] ... \n")); case HELP_PROJECT: return (gettext("\tproject [-d|-r] \n" "\tproject -c [-0] [-d|-r] [-p id] \n" @@ -2481,11 +2481,13 @@ zfs_do_upgrade(int argc, char **argv) /* * zfs userspace [-Hinp] [-o field[,...]] [-s field [-s field]...] - * [-S field [-S field]...] [-t type[,...]] filesystem | snapshot + * [-S field [-S field]...] [-t type[,...]] + * filesystem | snapshot | path * zfs groupspace [-Hinp] [-o field[,...]] [-s field [-s field]...] - * [-S field [-S field]...] [-t type[,...]] filesystem | snapshot + * [-S field [-S field]...] [-t type[,...]] + * filesystem | snapshot | path * zfs projectspace [-Hp] [-o field[,...]] [-s field [-s field]...] - * [-S field [-S field]...] filesystem | snapshot + * [-S field [-S field]...] filesystem | snapshot | path * * -H Scripted mode; elide headers and separate columns by tabs. * -i Translate SID to POSIX ID. @@ -3191,7 +3193,7 @@ zfs_do_userspace(int argc, char **argv) } while (delim != NULL); } - if ((zhp = zfs_open(g_zfs, argv[0], ZFS_TYPE_FILESYSTEM | + if ((zhp = zfs_path_to_zhandle(g_zfs, argv[0], ZFS_TYPE_FILESYSTEM | ZFS_TYPE_SNAPSHOT)) == NULL) return (1); if (zhp->zfs_head_type != ZFS_TYPE_FILESYSTEM) { Modified: vendor-sys/openzfs/dist/config/kernel-config-defined.m4 ============================================================================== --- vendor-sys/openzfs/dist/config/kernel-config-defined.m4 Thu Oct 1 22:20:29 2020 (r366347) +++ vendor-sys/openzfs/dist/config/kernel-config-defined.m4 Thu Oct 1 23:09:24 2020 (r366348) @@ -91,7 +91,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_CONFIG_DEBUG_LOCK_ALLOC], AC_DEFUN([ZFS_AC_KERNEL_CONFIG_DEBUG_LOCK_ALLOC], [ AC_MSG_CHECKING([whether mutex_lock() is GPL-only]) - ZFS_LINUX_TEST_RESULT([config_debug_lock_alloc], [ + ZFS_LINUX_TEST_RESULT([config_debug_lock_alloc_license], [ AC_MSG_RESULT(no) ],[ AC_MSG_RESULT(yes) Modified: vendor-sys/openzfs/dist/config/kernel-objtool.m4 ============================================================================== --- vendor-sys/openzfs/dist/config/kernel-objtool.m4 Thu Oct 1 22:20:29 2020 (r366347) +++ vendor-sys/openzfs/dist/config/kernel-objtool.m4 Thu Oct 1 23:09:24 2020 (r366348) @@ -6,10 +6,11 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_OBJTOOL], [ dnl # 4.6 API for compile-time stack validation ZFS_LINUX_TEST_SRC([objtool], [ #undef __ASSEMBLY__ + #include #include ],[ #if !defined(FRAME_BEGIN) - CTASSERT(1); + #error "FRAME_BEGIN is not defined" #endif ]) @@ -18,7 +19,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_OBJTOOL], [ #include ],[ #if !defined(STACK_FRAME_NON_STANDARD) - CTASSERT(1); + #error "STACK_FRAME_NON_STANDARD is not defined." #endif ]) ]) Modified: vendor-sys/openzfs/dist/configure.ac ============================================================================== --- vendor-sys/openzfs/dist/configure.ac Thu Oct 1 22:20:29 2020 (r366347) +++ vendor-sys/openzfs/dist/configure.ac Thu Oct 1 23:09:24 2020 (r366348) @@ -204,6 +204,7 @@ AC_CONFIG_FILES([ tests/zfs-tests/Makefile tests/zfs-tests/callbacks/Makefile tests/zfs-tests/cmd/Makefile + tests/zfs-tests/cmd/badsend/Makefile tests/zfs-tests/cmd/btree_test/Makefile tests/zfs-tests/cmd/chg_usr_exec/Makefile tests/zfs-tests/cmd/devname2devid/Makefile Modified: vendor-sys/openzfs/dist/contrib/initramfs/scripts/zfs ============================================================================== --- vendor-sys/openzfs/dist/contrib/initramfs/scripts/zfs Thu Oct 1 22:20:29 2020 (r366347) +++ vendor-sys/openzfs/dist/contrib/initramfs/scripts/zfs Thu Oct 1 23:09:24 2020 (r366348) @@ -15,8 +15,8 @@ # See "4.5 Disable root prompt on the initramfs" of Securing Debian Manual: # https://www.debian.org/doc/manuals/securing-debian-howto/ch4.en.html shell() { - if type panic > /dev/null 2>&1; then - panic $@ + if command -v panic > /dev/null 2>&1; then + panic else /bin/sh fi @@ -26,22 +26,23 @@ shell() { # pools and mounting any filesystems. pre_mountroot() { - if type run_scripts > /dev/null 2>&1 && \ - [ -f "/scripts/local-top" -o -d "/scripts/local-top" ] + if command -v run_scripts > /dev/null 2>&1 then - [ "$quiet" != "y" ] && \ - zfs_log_begin_msg "Running /scripts/local-top" - run_scripts /scripts/local-top - [ "$quiet" != "y" ] && zfs_log_end_msg - fi + if [ -f "/scripts/local-top" ] || [ -d "/scripts/local-top" ] + then + [ "$quiet" != "y" ] && \ + zfs_log_begin_msg "Running /scripts/local-top" + run_scripts /scripts/local-top + [ "$quiet" != "y" ] && zfs_log_end_msg + fi - if type run_scripts > /dev/null 2>&1 && \ - [ -f "/scripts/local-premount" -o -d "/scripts/local-premount" ] - then - [ "$quiet" != "y" ] && \ - zfs_log_begin_msg "Running /scripts/local-premount" - run_scripts /scripts/local-premount - [ "$quiet" != "y" ] && zfs_log_end_msg + if [ -f "/scripts/local-premount" ] || [ -d "/scripts/local-premount" ] + then + [ "$quiet" != "y" ] && \ + zfs_log_begin_msg "Running /scripts/local-premount" + run_scripts /scripts/local-premount + [ "$quiet" != "y" ] && zfs_log_end_msg + fi fi } @@ -57,10 +58,10 @@ disable_plymouth() # Get a ZFS filesystem property value. get_fs_value() { - local fs="$1" - local value=$2 + fs="$1" + value=$2 - "${ZFS}" get -H -ovalue $value "$fs" 2> /dev/null + "${ZFS}" get -H -ovalue "$value" "$fs" 2> /dev/null } # Find the 'bootfs' property on pool $1. @@ -68,7 +69,7 @@ get_fs_value() # pool by exporting it again. find_rootfs() { - local pool="$1" + pool="$1" # If 'POOL_IMPORTED' isn't set, no pool imported and therefore # we won't be able to find a root fs. @@ -84,7 +85,7 @@ find_rootfs() # Make sure it's not '-' and that it starts with /. if [ "${ZFS_BOOTFS}" != "-" ] && \ - $(get_fs_value "${ZFS_BOOTFS}" mountpoint | grep -q '^/$') + get_fs_value "${ZFS_BOOTFS}" mountpoint | grep -q '^/$' then # Keep it mounted POOL_IMPORTED=1 @@ -101,14 +102,13 @@ find_rootfs() # Support function to get a list of all pools, separated with ';' find_pools() { - local CMD="$*" - local pools pool + CMD="$*" pools=$($CMD 2> /dev/null | \ grep -E "pool:|^[a-zA-Z0-9]" | \ sed 's@.*: @@' | \ - while read pool; do \ - echo -n "$pool;" + while read -r pool; do \ + printf "%s" "$pool;" done) echo "${pools%%;}" # Return without the last ';'. @@ -117,8 +117,6 @@ find_pools() # Get a list of all available pools get_pools() { - local available_pools npools - if [ -n "${ZFS_POOL_IMPORT}" ]; then echo "$ZFS_POOL_IMPORT" return 0 @@ -159,9 +157,8 @@ get_pools() # Filter out any exceptions... if [ -n "$ZFS_POOL_EXCEPTIONS" ] then - local found="" - local apools="" - local pool exception + found="" + apools="" OLD_IFS="$IFS" ; IFS=";" for pool in $available_pools @@ -194,8 +191,7 @@ get_pools() # Import given pool $1 import_pool() { - local pool="$1" - local dirs dir + pool="$1" # Verify that the pool isn't already imported # Make as sure as we can to not require '-f' to import. @@ -205,7 +201,7 @@ import_pool() # to something we can use later with the real import(s). We want to # make sure we find all by* dirs, BUT by-vdev should be first (if it # exists). - if [ -n "$USE_DISK_BY_ID" -a -z "$ZPOOL_IMPORT_PATH" ] + if [ -n "$USE_DISK_BY_ID" ] && [ -z "$ZPOOL_IMPORT_PATH" ] then dirs="$(for dir in $(echo /dev/disk/by-*) do @@ -213,7 +209,7 @@ import_pool() echo "$dir" | grep -q /by-vdev && continue [ ! -d "$dir" ] && continue - echo -n "$dir:" + printf "%s" "$dir:" done | sed 's,:$,,g')" if [ -d "/dev/disk/by-vdev" ] @@ -277,7 +273,7 @@ import_pool() # with more logging etc. load_module_initrd() { - if [ "$ZFS_INITRD_PRE_MOUNTROOT_SLEEP" > 0 ] + if [ "$ZFS_INITRD_PRE_MOUNTROOT_SLEEP" -gt 0 ] 2>/dev/null then if [ "$quiet" != "y" ]; then zfs_log_begin_msg "Sleeping for" \ @@ -288,9 +284,9 @@ load_module_initrd() fi # Wait for all of the /dev/{hd,sd}[a-z] device nodes to appear. - if type wait_for_udev > /dev/null 2>&1 ; then + if command -v wait_for_udev > /dev/null 2>&1 ; then wait_for_udev 10 - elif type wait_for_dev > /dev/null 2>&1 ; then + elif command -v wait_for_dev > /dev/null 2>&1 ; then wait_for_dev fi @@ -300,7 +296,7 @@ load_module_initrd() # Load the module load_module "zfs" || return 1 - if [ "$ZFS_INITRD_POST_MODPROBE_SLEEP" > 0 ] + if [ "$ZFS_INITRD_POST_MODPROBE_SLEEP" -gt 0 ] 2>/dev/null then if [ "$quiet" != "y" ]; then zfs_log_begin_msg "Sleeping for" \ @@ -316,12 +312,10 @@ load_module_initrd() # Mount a given filesystem mount_fs() { - local fs="$1" - local mountpoint + fs="$1" # Check that the filesystem exists - "${ZFS}" list -oname -tfilesystem -H "${fs}" > /dev/null 2>&1 - [ "$?" -ne 0 ] && return 1 + "${ZFS}" list -oname -tfilesystem -H "${fs}" > /dev/null 2>&1 || return 1 # Skip filesystems with canmount=off. The root fs should not have # canmount=off, but ignore it for backwards compatibility just in case. @@ -333,14 +327,14 @@ mount_fs() # Need the _original_ datasets mountpoint! mountpoint=$(get_fs_value "$fs" mountpoint) - if [ "$mountpoint" = "legacy" -o "$mountpoint" = "none" ]; then + if [ "$mountpoint" = "legacy" ] || [ "$mountpoint" = "none" ]; then # Can't use the mountpoint property. Might be one of our # clones. Check the 'org.zol:mountpoint' property set in # clone_snap() if that's usable. mountpoint=$(get_fs_value "$fs" org.zol:mountpoint) - if [ "$mountpoint" = "legacy" -o \ - "$mountpoint" = "none" -o \ - "$mountpoint" = "-" ] + if [ "$mountpoint" = "legacy" ] || + [ "$mountpoint" = "none" ] || + [ "$mountpoint" = "-" ] then if [ "$fs" != "${ZFS_BOOTFS}" ]; then # We don't have a proper mountpoint and this @@ -396,10 +390,10 @@ mount_fs() # Unlock a ZFS native encrypted filesystem. decrypt_fs() { - local fs="$1" - + fs="$1" + # If pool encryption is active and the zfs command understands '-o encryption' - if [ "$(zpool list -H -o feature@encryption $(echo "${fs}" | awk -F\/ '{print $1}'))" = 'active' ]; then + if [ "$(zpool list -H -o feature@encryption "$(echo "${fs}" | awk -F/ '{print $1}')")" = 'active' ]; then # Determine dataset that holds key for root dataset ENCRYPTIONROOT="$(get_fs_value "${fs}" encryptionroot)" @@ -427,7 +421,7 @@ decrypt_fs() TRY_COUNT=$((TRY_COUNT - 1)) done - # Prompt with systemd, if active + # Prompt with systemd, if active elif [ -e /run/systemd/system ]; then echo "systemd-ask-password" > /run/zfs_console_askpwd_cmd while [ $TRY_COUNT -gt 0 ]; do @@ -454,7 +448,7 @@ decrypt_fs() # Destroy a given filesystem. destroy_fs() { - local fs="$1" + fs="$1" [ "$quiet" != "y" ] && \ zfs_log_begin_msg "Destroying '$fs'" @@ -489,9 +483,9 @@ destroy_fs() # mounted with a 'zfs mount -a' in the init/systemd scripts). clone_snap() { - local snap="$1" - local destfs="$2" - local mountpoint="$3" + snap="$1" + destfs="$2" + mountpoint="$3" [ "$quiet" != "y" ] && zfs_log_begin_msg "Cloning '$snap' to '$destfs'" @@ -529,7 +523,7 @@ clone_snap() # Rollback a given snapshot. rollback_snap() { - local snap="$1" + snap="$1" [ "$quiet" != "y" ] && zfs_log_begin_msg "Rollback $snap" @@ -559,9 +553,8 @@ rollback_snap() # to the user to choose from. ask_user_snap() { - local fs="$1" - local i=1 - local SNAP snapnr snap debug + fs="$1" + i=1 # We need to temporarily disable debugging. Set 'debug' so we # remember to enabled it again. @@ -574,16 +567,16 @@ ask_user_snap() # Because we need the resulting snapshot, which is sent on # stdout to the caller, we use stderr for our questions. echo "What snapshot do you want to boot from?" > /dev/stderr - while read snap; do + while read -r snap; do echo " $i: ${snap}" > /dev/stderr - eval `echo SNAP_$i=$snap` + eval "$(echo SNAP_$i=$snap)" i=$((i + 1)) done < /dev/stderr - read snapnr + echo "%s" " Snap nr [1-$((i-1))]? " > /dev/stderr + read -r snapnr # Re-enable debugging. if [ -n "${debug}" ]; then @@ -591,16 +584,16 @@ EOT set -x fi - echo "$(eval echo "$"SNAP_$snapnr)" + echo "$(eval echo '$SNAP_'$snapnr)" } setup_snapshot_booting() { - local snap="$1" - local s destfs subfs mountpoint retval=0 filesystems fs + snap="$1" + retval=0 - # Make sure that the snapshot specified actually exist. - if [ ! $(get_fs_value "${snap}" type) ] + # Make sure that the snapshot specified actually exists. + if [ ! "$(get_fs_value "${snap}" type)" ] then # Snapshot does not exist (...@ ?) # ask the user for a snapshot to use. @@ -617,7 +610,7 @@ setup_snapshot_booting() then # If the destination dataset for the clone # already exists, destroy it. Recursively - if [ $(get_fs_value "${rootfs}_${snapname}" type) ]; then + if [ "$(get_fs_value "${rootfs}_${snapname}" type)" ]; then filesystems=$("${ZFS}" list -oname -tfilesystem -H \ -r -Sname "${ZFS_BOOTFS}") for fs in $filesystems; do @@ -652,8 +645,8 @@ setup_snapshot_booting() # with clone_snap(). If legacy or none, then use # the sub fs value. mountpoint=$(get_fs_value "${s%%@*}" mountpoint) - if [ "$mountpoint" = "legacy" -o \ - "$mountpoint" = "none" ] + if [ "$mountpoint" = "legacy" ] || \ + [ "$mountpoint" = "none" ] then if [ -n "${subfs}" ]; then mountpoint="${subfs}" @@ -678,8 +671,6 @@ setup_snapshot_booting() # This is the main function. mountroot() { - local snaporig snapsub destfs pool POOLS - # ---------------------------------------------------------------- # I N I T I A L S E T U P @@ -742,7 +733,7 @@ mountroot() # No longer set in the defaults file, but it could have been set in # get_pools() in some circumstances. If it's something, but not 'yes', # it's no good to us. - [ -n "$USE_DISK_BY_ID" -a "$USE_DISK_BY_ID" != 'yes' ] && \ + [ -n "$USE_DISK_BY_ID" ] && [ "$USE_DISK_BY_ID" != 'yes' ] && \ unset USE_DISK_BY_ID # ---------------------------------------------------------------- @@ -788,12 +779,12 @@ mountroot() # ------------ # If we have 'ROOT' (see above), but not 'ZFS_BOOTFS', then use # 'ROOT' - [ -n "$ROOT" -a -z "${ZFS_BOOTFS}" ] && ZFS_BOOTFS="$ROOT" + [ -n "$ROOT" ] && [ -z "${ZFS_BOOTFS}" ] && ZFS_BOOTFS="$ROOT" # ------------ # Check for the `-B zfs-bootfs=%s/%u,...` kind of parameter. # NOTE: Only use the pool name and dataset. The rest is not - # supported by ZoL (whatever it's for). + # supported by OpenZFS (whatever it's for). if [ -z "$ZFS_RPOOL" ] then # The ${zfs-bootfs} variable is set at the kernel command @@ -809,11 +800,11 @@ mountroot() # ------------ # No root fs or pool specified - do auto detect. - if [ -z "$ZFS_RPOOL" -a -z "${ZFS_BOOTFS}" ] + if [ -z "$ZFS_RPOOL" ] && [ -z "${ZFS_BOOTFS}" ] then # Do auto detect. Do this by 'cheating' - set 'root=zfs:AUTO' # which will be caught later - ROOT=zfs:AUTO + ROOT='zfs:AUTO' fi # ---------------------------------------------------------------- @@ -858,7 +849,7 @@ mountroot() fi # Import the pool (if not already done so in the AUTO check above). - if [ -n "$ZFS_RPOOL" -a -z "${POOL_IMPORTED}" ] + if [ -n "$ZFS_RPOOL" ] && [ -z "${POOL_IMPORTED}" ] then [ "$quiet" != "y" ] && \ zfs_log_begin_msg "Importing ZFS root pool '$ZFS_RPOOL'" @@ -971,7 +962,7 @@ mountroot() touch /run/zfs_unlock_complete if [ -e /run/zfs_unlock_complete_notify ]; then - read zfs_unlock_complete_notify < /run/zfs_unlock_complete_notify + read -r zfs_unlock_complete_notify < /run/zfs_unlock_complete_notify fi # ------------ @@ -989,8 +980,8 @@ mountroot() echo echo "=> waiting for ENTER before continuing because of 'zfsdebug=1'. " - echo -n " 'c' for shell, 'r' for reboot, 'ENTER' to continue. " - read b + printf "%s" " 'c' for shell, 'r' for reboot, 'ENTER' to continue. " + read -r b [ "$b" = "c" ] && /bin/sh [ "$b" = "r" ] && reboot -f @@ -1000,12 +991,14 @@ mountroot() # ------------ # Run local bottom script - if type run_scripts > /dev/null 2>&1 && \ - [ -f "/scripts/local-bottom" -o -d "/scripts/local-bottom" ] + if command -v run_scripts > /dev/null 2>&1 then - [ "$quiet" != "y" ] && \ - zfs_log_begin_msg "Running /scripts/local-bottom" - run_scripts /scripts/local-bottom - [ "$quiet" != "y" ] && zfs_log_end_msg + if [ -f "/scripts/local-bottom" ] || [ -d "/scripts/local-bottom" ] + then + [ "$quiet" != "y" ] && \ + zfs_log_begin_msg "Running /scripts/local-bottom" + run_scripts /scripts/local-bottom + [ "$quiet" != "y" ] && zfs_log_end_msg + fi fi } Added: vendor-sys/openzfs/dist/contrib/intel_qat/patch/0001-cryptohash.diff ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor-sys/openzfs/dist/contrib/intel_qat/patch/0001-cryptohash.diff Thu Oct 1 23:09:24 2020 (r366348) @@ -0,0 +1,17 @@ +cryptohash.h was dropped and merged with crypto/sha.sh in 5.8 kernel. Details in: +https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=228c4f265c6eb60eaa4ed0edb3bf7c113173576c + +--- +diff --git a/quickassist/utilities/osal/src/linux/kernel_space/OsalCryptoInterface.c b/quickassist/utilities/osal/src/linux/kernel_space/OsalCryptoInterface.c +index 4c389da..e602377 100644 +--- a/quickassist/utilities/osal/src/linux/kernel_space/OsalCryptoInterface.c ++++ b/quickassist/utilities/osal/src/linux/kernel_space/OsalCryptoInterface.c +@@ -66,7 +66,7 @@ + + #include "Osal.h" + #include +-#include ++#include + #include + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)) + #include Added: vendor-sys/openzfs/dist/contrib/intel_qat/patch/0001-pci_aer.diff ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor-sys/openzfs/dist/contrib/intel_qat/patch/0001-pci_aer.diff Thu Oct 1 23:09:24 2020 (r366348) @@ -0,0 +1,20 @@ +In kernel 5.7 the pci_cleanup_aer_uncorrect_error_status() function was +renamed with the following commit: + +git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=894020fdd88c1e9a74c60b67c0f19f1c7696ba2f + +This simply updates the function call with the proper name (pci_aer_clear_nonfatal_status()). + +--- +diff --git a/quickassist/qat/drivers/crypto/qat/qat_common/adf_aer.c b/quickassist/qat/drivers/crypto/qat/qat_common/adf_aer.c +index a6ce6df..545bb79 100644 +--- a/quickassist/qat/drivers/crypto/qat/qat_common/adf_aer.c ++++ b/quickassist/qat/drivers/crypto/qat/qat_common/adf_aer.c +@@ -304,7 +304,7 @@ static pci_ers_result_t adf_slot_reset(struct pci_dev *pdev) + pr_err("QAT: Can't find acceleration device\n"); + return PCI_ERS_RESULT_DISCONNECT; + } +- pci_cleanup_aer_uncorrect_error_status(pdev); ++ pci_aer_clear_nonfatal_status(pdev); + if (adf_dev_aer_schedule_reset(accel_dev, ADF_DEV_RESET_SYNC)) + return PCI_ERS_RESULT_DISCONNECT; Added: vendor-sys/openzfs/dist/contrib/intel_qat/patch/0001-timespec.diff ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor-sys/openzfs/dist/contrib/intel_qat/patch/0001-timespec.diff Thu Oct 1 23:09:24 2020 (r366348) @@ -0,0 +1,35 @@ +This patch attempts to expose timespec and getnstimeofday which were +explicitly hidden in the 5.6 kernel with the introduction of the +following commits: + +git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c766d1472c70d25ad475cf56042af1652e792b23 +git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=412c53a680a97cb1ae2c0ab60230e193bee86387 + +Code received from users@dpdk.org, issue tracked under QATE-59888. + +--- +diff --git a/quickassist/lookaside/access_layer/src/sample_code/performance/framework/linux/kernel_space/cpa_sample_code_utils.c b/quickassist/lookaside/access_layer/src/sample_code/performance/framework/linux/kernel_space/cpa_sample_code_utils.c +index 4639834..523e376 100644 +--- a/quickassist/lookaside/access_layer/src/sample_code/performance/framework/linux/kernel_space/cpa_sample_code_utils.c ++++ b/quickassist/lookaside/access_layer/src/sample_code/performance/framework/linux/kernel_space/cpa_sample_code_utils.c +@@ -107,6 +107,8 @@ atomic_t arrived; + extern struct device perf_device; + #endif + ++#define timespec timespec64 ++#define getnstimeofday ktime_get_real_ts64 + + /* Define a number for timeout */ + #define SAMPLE_CODE_MAX_LONG (0x7FFFFFFF) +diff --git a/quickassist/qat/compat/qat_compat.h b/quickassist/qat/compat/qat_compat.h +index 2a02eaf..3515092 100644 +--- a/quickassist/qat/compat/qat_compat.h ++++ b/quickassist/qat/compat/qat_compat.h +@@ -466,4 +466,7 @@ static inline void pci_ignore_hotplug(struct pci_dev *dev) + #if (RHEL_RELEASE_CODE && RHEL_RELEASE_VERSION(7, 3) <= RHEL_RELEASE_CODE) + #define QAT_KPT_CAP_DISCOVERY + #endif ++ ++#define timespec timespec64 ++#define getnstimeofday ktime_get_real_ts64 + #endif /* _QAT_COMPAT_H_ */ Added: vendor-sys/openzfs/dist/contrib/intel_qat/patch/LICENSE ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor-sys/openzfs/dist/contrib/intel_qat/patch/LICENSE Thu Oct 1 23:09:24 2020 (r366348) @@ -0,0 +1,30 @@ +BSD LICENSE + +Copyright (c) Intel Corporation. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * 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. + * Neither the name of Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT +OWNER 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. Added: vendor-sys/openzfs/dist/contrib/intel_qat/readme.md ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor-sys/openzfs/dist/contrib/intel_qat/readme.md Thu Oct 1 23:09:24 2020 (r366348) @@ -0,0 +1,27 @@ +# Intel_QAT easy install script + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Oct 1 23:11:59 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2F784436DA2; Thu, 1 Oct 2020 23:11:59 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2TR30S0Cz3ZBZ; Thu, 1 Oct 2020 23:11:59 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CDD4918A19; Thu, 1 Oct 2020 23:11:58 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 091NBwH4077410; Thu, 1 Oct 2020 23:11:58 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 091NBwWj077409; Thu, 1 Oct 2020 23:11:58 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <202010012311.091NBwWj077409@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Thu, 1 Oct 2020 23:11:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r366349 - vendor-sys/openzfs/2.0-rc3-gfc5966 X-SVN-Group: vendor-sys X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: vendor-sys/openzfs/2.0-rc3-gfc5966 X-SVN-Commit-Revision: 366349 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Oct 2020 23:11:59 -0000 Author: mmacy Date: Thu Oct 1 23:11:58 2020 New Revision: 366349 URL: https://svnweb.freebsd.org/changeset/base/366349 Log: checkpoint OpenZFS 2.0-rc3-gfc5966 Added: vendor-sys/openzfs/2.0-rc3-gfc5966/ - copied from r366348, vendor-sys/openzfs/dist/ From owner-svn-src-all@freebsd.org Thu Oct 1 23:28:26 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 251A84370BD; Thu, 1 Oct 2020 23:28:26 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2Tp20Q8rz3bC8; Thu, 1 Oct 2020 23:28:26 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E5534185FB; Thu, 1 Oct 2020 23:28:25 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 091NSPQK085785; Thu, 1 Oct 2020 23:28:25 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 091NSLq2085612; Thu, 1 Oct 2020 23:28:21 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <202010012328.091NSLq2085612@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Thu, 1 Oct 2020 23:28:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366350 - in head/sys/contrib/openzfs: . .github cmd/zfs config contrib/initramfs/scripts contrib/intel_qat include/os/freebsd/spl/sys include/os/linux/spl/sys include/sys include/sys/l... X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in head/sys/contrib/openzfs: . .github cmd/zfs config contrib/initramfs/scripts contrib/intel_qat include/os/freebsd/spl/sys include/os/linux/spl/sys include/sys include/sys/lua include/sys/zstd lib/l... X-SVN-Commit-Revision: 366350 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Oct 2020 23:28:26 -0000 Author: mmacy Date: Thu Oct 1 23:28:21 2020 New Revision: 366350 URL: https://svnweb.freebsd.org/changeset/base/366350 Log: OpenZFS: MFV 2.0-rc3-gfc5966 - Annotate FreeBSD sysctls with CTLFLAG_MPSAFE - Reduce stack usage of Lua - Don't save user FPU context in kernel threads - Add support for procfs_list - Code cleanup in zio_crypt - Add DB_RF_NOPREFETCH to dbuf_read()s in dnode.c - Drop references when skipping dmu_send due to EXDEV - Eliminate gratuitous bzeroing in dbuf_stats_hash_table_data - Fix legacy compat for platform IOCs Added: head/sys/contrib/openzfs/.github/ - copied from r366349, vendor-sys/openzfs/dist/.github/ head/sys/contrib/openzfs/contrib/intel_qat/ - copied from r366349, vendor-sys/openzfs/dist/contrib/intel_qat/ head/sys/contrib/openzfs/tests/zfs-tests/cmd/badsend/ - copied from r366349, vendor-sys/openzfs/dist/tests/zfs-tests/cmd/badsend/ head/sys/contrib/openzfs/tests/zfs-tests/tests/functional/rsend/send_invalid.ksh - copied unchanged from r366349, vendor-sys/openzfs/dist/tests/zfs-tests/tests/functional/rsend/send_invalid.ksh Modified: head/sys/contrib/openzfs/cmd/zfs/zfs_main.c head/sys/contrib/openzfs/config/kernel-config-defined.m4 head/sys/contrib/openzfs/config/kernel-objtool.m4 head/sys/contrib/openzfs/configure.ac head/sys/contrib/openzfs/contrib/initramfs/scripts/zfs head/sys/contrib/openzfs/include/os/freebsd/spl/sys/kstat.h head/sys/contrib/openzfs/include/os/freebsd/spl/sys/procfs_list.h head/sys/contrib/openzfs/include/os/freebsd/spl/sys/simd_x86.h head/sys/contrib/openzfs/include/os/linux/spl/sys/procfs_list.h head/sys/contrib/openzfs/include/sys/frame.h head/sys/contrib/openzfs/include/sys/lua/luaconf.h head/sys/contrib/openzfs/include/sys/zfs_context.h head/sys/contrib/openzfs/include/sys/zstd/zstd.h head/sys/contrib/openzfs/lib/libshare/os/freebsd/nfs.c head/sys/contrib/openzfs/lib/libshare/os/linux/nfs.c head/sys/contrib/openzfs/lib/libzpool/kernel.c head/sys/contrib/openzfs/man/man8/zfs-userspace.8 head/sys/contrib/openzfs/man/man8/zpool-remove.8 head/sys/contrib/openzfs/module/lua/llimits.h head/sys/contrib/openzfs/module/os/freebsd/spl/spl_kstat.c head/sys/contrib/openzfs/module/os/freebsd/spl/spl_procfs_list.c head/sys/contrib/openzfs/module/os/freebsd/spl/spl_taskq.c head/sys/contrib/openzfs/module/os/freebsd/zfs/kmod_core.c head/sys/contrib/openzfs/module/os/freebsd/zfs/sysctl_os.c head/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_ioctl_compat.c head/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c head/sys/contrib/openzfs/module/os/freebsd/zfs/zio_crypt.c head/sys/contrib/openzfs/module/os/linux/spl/spl-procfs-list.c head/sys/contrib/openzfs/module/os/linux/zfs/vdev_disk.c head/sys/contrib/openzfs/module/os/linux/zfs/zfs_debug.c head/sys/contrib/openzfs/module/zfs/arc.c head/sys/contrib/openzfs/module/zfs/dbuf_stats.c head/sys/contrib/openzfs/module/zfs/dmu_send.c head/sys/contrib/openzfs/module/zfs/dnode.c head/sys/contrib/openzfs/module/zfs/dsl_crypt.c head/sys/contrib/openzfs/module/zfs/spa_misc.c head/sys/contrib/openzfs/module/zfs/spa_stats.c head/sys/contrib/openzfs/module/zfs/zfs_log.c head/sys/contrib/openzfs/module/zstd/zfs_zstd.c head/sys/contrib/openzfs/tests/runfiles/common.run head/sys/contrib/openzfs/tests/zfs-tests/cmd/Makefile.am head/sys/contrib/openzfs/tests/zfs-tests/include/commands.cfg head/sys/contrib/openzfs/tests/zfs-tests/tests/functional/rsend/Makefile.am Directory Properties: head/sys/contrib/openzfs/ (props changed) Modified: head/sys/contrib/openzfs/cmd/zfs/zfs_main.c ============================================================================== --- head/sys/contrib/openzfs/cmd/zfs/zfs_main.c Thu Oct 1 23:11:58 2020 (r366349) +++ head/sys/contrib/openzfs/cmd/zfs/zfs_main.c Thu Oct 1 23:28:21 2020 (r366350) @@ -363,16 +363,16 @@ get_usage(zfs_help_t idx) return (gettext("\tuserspace [-Hinp] [-o field[,...]] " "[-s field] ...\n" "\t [-S field] ... [-t type[,...]] " - "\n")); + "\n")); case HELP_GROUPSPACE: return (gettext("\tgroupspace [-Hinp] [-o field[,...]] " "[-s field] ...\n" "\t [-S field] ... [-t type[,...]] " - "\n")); + "\n")); case HELP_PROJECTSPACE: return (gettext("\tprojectspace [-Hp] [-o field[,...]] " "[-s field] ... \n" - "\t [-S field] ... \n")); + "\t [-S field] ... \n")); case HELP_PROJECT: return (gettext("\tproject [-d|-r] \n" "\tproject -c [-0] [-d|-r] [-p id] \n" @@ -2481,11 +2481,13 @@ zfs_do_upgrade(int argc, char **argv) /* * zfs userspace [-Hinp] [-o field[,...]] [-s field [-s field]...] - * [-S field [-S field]...] [-t type[,...]] filesystem | snapshot + * [-S field [-S field]...] [-t type[,...]] + * filesystem | snapshot | path * zfs groupspace [-Hinp] [-o field[,...]] [-s field [-s field]...] - * [-S field [-S field]...] [-t type[,...]] filesystem | snapshot + * [-S field [-S field]...] [-t type[,...]] + * filesystem | snapshot | path * zfs projectspace [-Hp] [-o field[,...]] [-s field [-s field]...] - * [-S field [-S field]...] filesystem | snapshot + * [-S field [-S field]...] filesystem | snapshot | path * * -H Scripted mode; elide headers and separate columns by tabs. * -i Translate SID to POSIX ID. @@ -3191,7 +3193,7 @@ zfs_do_userspace(int argc, char **argv) } while (delim != NULL); } - if ((zhp = zfs_open(g_zfs, argv[0], ZFS_TYPE_FILESYSTEM | + if ((zhp = zfs_path_to_zhandle(g_zfs, argv[0], ZFS_TYPE_FILESYSTEM | ZFS_TYPE_SNAPSHOT)) == NULL) return (1); if (zhp->zfs_head_type != ZFS_TYPE_FILESYSTEM) { Modified: head/sys/contrib/openzfs/config/kernel-config-defined.m4 ============================================================================== --- head/sys/contrib/openzfs/config/kernel-config-defined.m4 Thu Oct 1 23:11:58 2020 (r366349) +++ head/sys/contrib/openzfs/config/kernel-config-defined.m4 Thu Oct 1 23:28:21 2020 (r366350) @@ -91,7 +91,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_CONFIG_DEBUG_LOCK_ALLOC], AC_DEFUN([ZFS_AC_KERNEL_CONFIG_DEBUG_LOCK_ALLOC], [ AC_MSG_CHECKING([whether mutex_lock() is GPL-only]) - ZFS_LINUX_TEST_RESULT([config_debug_lock_alloc], [ + ZFS_LINUX_TEST_RESULT([config_debug_lock_alloc_license], [ AC_MSG_RESULT(no) ],[ AC_MSG_RESULT(yes) Modified: head/sys/contrib/openzfs/config/kernel-objtool.m4 ============================================================================== --- head/sys/contrib/openzfs/config/kernel-objtool.m4 Thu Oct 1 23:11:58 2020 (r366349) +++ head/sys/contrib/openzfs/config/kernel-objtool.m4 Thu Oct 1 23:28:21 2020 (r366350) @@ -6,10 +6,11 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_OBJTOOL], [ dnl # 4.6 API for compile-time stack validation ZFS_LINUX_TEST_SRC([objtool], [ #undef __ASSEMBLY__ + #include #include ],[ #if !defined(FRAME_BEGIN) - CTASSERT(1); + #error "FRAME_BEGIN is not defined" #endif ]) @@ -18,7 +19,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_OBJTOOL], [ #include ],[ #if !defined(STACK_FRAME_NON_STANDARD) - CTASSERT(1); + #error "STACK_FRAME_NON_STANDARD is not defined." #endif ]) ]) Modified: head/sys/contrib/openzfs/configure.ac ============================================================================== --- head/sys/contrib/openzfs/configure.ac Thu Oct 1 23:11:58 2020 (r366349) +++ head/sys/contrib/openzfs/configure.ac Thu Oct 1 23:28:21 2020 (r366350) @@ -204,6 +204,7 @@ AC_CONFIG_FILES([ tests/zfs-tests/Makefile tests/zfs-tests/callbacks/Makefile tests/zfs-tests/cmd/Makefile + tests/zfs-tests/cmd/badsend/Makefile tests/zfs-tests/cmd/btree_test/Makefile tests/zfs-tests/cmd/chg_usr_exec/Makefile tests/zfs-tests/cmd/devname2devid/Makefile Modified: head/sys/contrib/openzfs/contrib/initramfs/scripts/zfs ============================================================================== --- head/sys/contrib/openzfs/contrib/initramfs/scripts/zfs Thu Oct 1 23:11:58 2020 (r366349) +++ head/sys/contrib/openzfs/contrib/initramfs/scripts/zfs Thu Oct 1 23:28:21 2020 (r366350) @@ -15,8 +15,8 @@ # See "4.5 Disable root prompt on the initramfs" of Securing Debian Manual: # https://www.debian.org/doc/manuals/securing-debian-howto/ch4.en.html shell() { - if type panic > /dev/null 2>&1; then - panic $@ + if command -v panic > /dev/null 2>&1; then + panic else /bin/sh fi @@ -26,22 +26,23 @@ shell() { # pools and mounting any filesystems. pre_mountroot() { - if type run_scripts > /dev/null 2>&1 && \ - [ -f "/scripts/local-top" -o -d "/scripts/local-top" ] + if command -v run_scripts > /dev/null 2>&1 then - [ "$quiet" != "y" ] && \ - zfs_log_begin_msg "Running /scripts/local-top" - run_scripts /scripts/local-top - [ "$quiet" != "y" ] && zfs_log_end_msg - fi + if [ -f "/scripts/local-top" ] || [ -d "/scripts/local-top" ] + then + [ "$quiet" != "y" ] && \ + zfs_log_begin_msg "Running /scripts/local-top" + run_scripts /scripts/local-top + [ "$quiet" != "y" ] && zfs_log_end_msg + fi - if type run_scripts > /dev/null 2>&1 && \ - [ -f "/scripts/local-premount" -o -d "/scripts/local-premount" ] - then - [ "$quiet" != "y" ] && \ - zfs_log_begin_msg "Running /scripts/local-premount" - run_scripts /scripts/local-premount - [ "$quiet" != "y" ] && zfs_log_end_msg + if [ -f "/scripts/local-premount" ] || [ -d "/scripts/local-premount" ] + then + [ "$quiet" != "y" ] && \ + zfs_log_begin_msg "Running /scripts/local-premount" + run_scripts /scripts/local-premount + [ "$quiet" != "y" ] && zfs_log_end_msg + fi fi } @@ -57,10 +58,10 @@ disable_plymouth() # Get a ZFS filesystem property value. get_fs_value() { - local fs="$1" - local value=$2 + fs="$1" + value=$2 - "${ZFS}" get -H -ovalue $value "$fs" 2> /dev/null + "${ZFS}" get -H -ovalue "$value" "$fs" 2> /dev/null } # Find the 'bootfs' property on pool $1. @@ -68,7 +69,7 @@ get_fs_value() # pool by exporting it again. find_rootfs() { - local pool="$1" + pool="$1" # If 'POOL_IMPORTED' isn't set, no pool imported and therefore # we won't be able to find a root fs. @@ -84,7 +85,7 @@ find_rootfs() # Make sure it's not '-' and that it starts with /. if [ "${ZFS_BOOTFS}" != "-" ] && \ - $(get_fs_value "${ZFS_BOOTFS}" mountpoint | grep -q '^/$') + get_fs_value "${ZFS_BOOTFS}" mountpoint | grep -q '^/$' then # Keep it mounted POOL_IMPORTED=1 @@ -101,14 +102,13 @@ find_rootfs() # Support function to get a list of all pools, separated with ';' find_pools() { - local CMD="$*" - local pools pool + CMD="$*" pools=$($CMD 2> /dev/null | \ grep -E "pool:|^[a-zA-Z0-9]" | \ sed 's@.*: @@' | \ - while read pool; do \ - echo -n "$pool;" + while read -r pool; do \ + printf "%s" "$pool;" done) echo "${pools%%;}" # Return without the last ';'. @@ -117,8 +117,6 @@ find_pools() # Get a list of all available pools get_pools() { - local available_pools npools - if [ -n "${ZFS_POOL_IMPORT}" ]; then echo "$ZFS_POOL_IMPORT" return 0 @@ -159,9 +157,8 @@ get_pools() # Filter out any exceptions... if [ -n "$ZFS_POOL_EXCEPTIONS" ] then - local found="" - local apools="" - local pool exception + found="" + apools="" OLD_IFS="$IFS" ; IFS=";" for pool in $available_pools @@ -194,8 +191,7 @@ get_pools() # Import given pool $1 import_pool() { - local pool="$1" - local dirs dir + pool="$1" # Verify that the pool isn't already imported # Make as sure as we can to not require '-f' to import. @@ -205,7 +201,7 @@ import_pool() # to something we can use later with the real import(s). We want to # make sure we find all by* dirs, BUT by-vdev should be first (if it # exists). - if [ -n "$USE_DISK_BY_ID" -a -z "$ZPOOL_IMPORT_PATH" ] + if [ -n "$USE_DISK_BY_ID" ] && [ -z "$ZPOOL_IMPORT_PATH" ] then dirs="$(for dir in $(echo /dev/disk/by-*) do @@ -213,7 +209,7 @@ import_pool() echo "$dir" | grep -q /by-vdev && continue [ ! -d "$dir" ] && continue - echo -n "$dir:" + printf "%s" "$dir:" done | sed 's,:$,,g')" if [ -d "/dev/disk/by-vdev" ] @@ -277,7 +273,7 @@ import_pool() # with more logging etc. load_module_initrd() { - if [ "$ZFS_INITRD_PRE_MOUNTROOT_SLEEP" > 0 ] + if [ "$ZFS_INITRD_PRE_MOUNTROOT_SLEEP" -gt 0 ] 2>/dev/null then if [ "$quiet" != "y" ]; then zfs_log_begin_msg "Sleeping for" \ @@ -288,9 +284,9 @@ load_module_initrd() fi # Wait for all of the /dev/{hd,sd}[a-z] device nodes to appear. - if type wait_for_udev > /dev/null 2>&1 ; then + if command -v wait_for_udev > /dev/null 2>&1 ; then wait_for_udev 10 - elif type wait_for_dev > /dev/null 2>&1 ; then + elif command -v wait_for_dev > /dev/null 2>&1 ; then wait_for_dev fi @@ -300,7 +296,7 @@ load_module_initrd() # Load the module load_module "zfs" || return 1 - if [ "$ZFS_INITRD_POST_MODPROBE_SLEEP" > 0 ] + if [ "$ZFS_INITRD_POST_MODPROBE_SLEEP" -gt 0 ] 2>/dev/null then if [ "$quiet" != "y" ]; then zfs_log_begin_msg "Sleeping for" \ @@ -316,12 +312,10 @@ load_module_initrd() # Mount a given filesystem mount_fs() { - local fs="$1" - local mountpoint + fs="$1" # Check that the filesystem exists - "${ZFS}" list -oname -tfilesystem -H "${fs}" > /dev/null 2>&1 - [ "$?" -ne 0 ] && return 1 + "${ZFS}" list -oname -tfilesystem -H "${fs}" > /dev/null 2>&1 || return 1 # Skip filesystems with canmount=off. The root fs should not have # canmount=off, but ignore it for backwards compatibility just in case. @@ -333,14 +327,14 @@ mount_fs() # Need the _original_ datasets mountpoint! mountpoint=$(get_fs_value "$fs" mountpoint) - if [ "$mountpoint" = "legacy" -o "$mountpoint" = "none" ]; then + if [ "$mountpoint" = "legacy" ] || [ "$mountpoint" = "none" ]; then # Can't use the mountpoint property. Might be one of our # clones. Check the 'org.zol:mountpoint' property set in # clone_snap() if that's usable. mountpoint=$(get_fs_value "$fs" org.zol:mountpoint) - if [ "$mountpoint" = "legacy" -o \ - "$mountpoint" = "none" -o \ - "$mountpoint" = "-" ] + if [ "$mountpoint" = "legacy" ] || + [ "$mountpoint" = "none" ] || + [ "$mountpoint" = "-" ] then if [ "$fs" != "${ZFS_BOOTFS}" ]; then # We don't have a proper mountpoint and this @@ -396,10 +390,10 @@ mount_fs() # Unlock a ZFS native encrypted filesystem. decrypt_fs() { - local fs="$1" - + fs="$1" + # If pool encryption is active and the zfs command understands '-o encryption' - if [ "$(zpool list -H -o feature@encryption $(echo "${fs}" | awk -F\/ '{print $1}'))" = 'active' ]; then + if [ "$(zpool list -H -o feature@encryption "$(echo "${fs}" | awk -F/ '{print $1}')")" = 'active' ]; then # Determine dataset that holds key for root dataset ENCRYPTIONROOT="$(get_fs_value "${fs}" encryptionroot)" @@ -427,7 +421,7 @@ decrypt_fs() TRY_COUNT=$((TRY_COUNT - 1)) done - # Prompt with systemd, if active + # Prompt with systemd, if active elif [ -e /run/systemd/system ]; then echo "systemd-ask-password" > /run/zfs_console_askpwd_cmd while [ $TRY_COUNT -gt 0 ]; do @@ -454,7 +448,7 @@ decrypt_fs() # Destroy a given filesystem. destroy_fs() { - local fs="$1" + fs="$1" [ "$quiet" != "y" ] && \ zfs_log_begin_msg "Destroying '$fs'" @@ -489,9 +483,9 @@ destroy_fs() # mounted with a 'zfs mount -a' in the init/systemd scripts). clone_snap() { - local snap="$1" - local destfs="$2" - local mountpoint="$3" + snap="$1" + destfs="$2" + mountpoint="$3" [ "$quiet" != "y" ] && zfs_log_begin_msg "Cloning '$snap' to '$destfs'" @@ -529,7 +523,7 @@ clone_snap() # Rollback a given snapshot. rollback_snap() { - local snap="$1" + snap="$1" [ "$quiet" != "y" ] && zfs_log_begin_msg "Rollback $snap" @@ -559,9 +553,8 @@ rollback_snap() # to the user to choose from. ask_user_snap() { - local fs="$1" - local i=1 - local SNAP snapnr snap debug + fs="$1" + i=1 # We need to temporarily disable debugging. Set 'debug' so we # remember to enabled it again. @@ -574,16 +567,16 @@ ask_user_snap() # Because we need the resulting snapshot, which is sent on # stdout to the caller, we use stderr for our questions. echo "What snapshot do you want to boot from?" > /dev/stderr - while read snap; do + while read -r snap; do echo " $i: ${snap}" > /dev/stderr - eval `echo SNAP_$i=$snap` + eval "$(echo SNAP_$i=$snap)" i=$((i + 1)) done < /dev/stderr - read snapnr + echo "%s" " Snap nr [1-$((i-1))]? " > /dev/stderr + read -r snapnr # Re-enable debugging. if [ -n "${debug}" ]; then @@ -591,16 +584,16 @@ EOT set -x fi - echo "$(eval echo "$"SNAP_$snapnr)" + echo "$(eval echo '$SNAP_'$snapnr)" } setup_snapshot_booting() { - local snap="$1" - local s destfs subfs mountpoint retval=0 filesystems fs + snap="$1" + retval=0 - # Make sure that the snapshot specified actually exist. - if [ ! $(get_fs_value "${snap}" type) ] + # Make sure that the snapshot specified actually exists. + if [ ! "$(get_fs_value "${snap}" type)" ] then # Snapshot does not exist (...@ ?) # ask the user for a snapshot to use. @@ -617,7 +610,7 @@ setup_snapshot_booting() then # If the destination dataset for the clone # already exists, destroy it. Recursively - if [ $(get_fs_value "${rootfs}_${snapname}" type) ]; then + if [ "$(get_fs_value "${rootfs}_${snapname}" type)" ]; then filesystems=$("${ZFS}" list -oname -tfilesystem -H \ -r -Sname "${ZFS_BOOTFS}") for fs in $filesystems; do @@ -652,8 +645,8 @@ setup_snapshot_booting() # with clone_snap(). If legacy or none, then use # the sub fs value. mountpoint=$(get_fs_value "${s%%@*}" mountpoint) - if [ "$mountpoint" = "legacy" -o \ - "$mountpoint" = "none" ] + if [ "$mountpoint" = "legacy" ] || \ + [ "$mountpoint" = "none" ] then if [ -n "${subfs}" ]; then mountpoint="${subfs}" @@ -678,8 +671,6 @@ setup_snapshot_booting() # This is the main function. mountroot() { - local snaporig snapsub destfs pool POOLS - # ---------------------------------------------------------------- # I N I T I A L S E T U P @@ -742,7 +733,7 @@ mountroot() # No longer set in the defaults file, but it could have been set in # get_pools() in some circumstances. If it's something, but not 'yes', # it's no good to us. - [ -n "$USE_DISK_BY_ID" -a "$USE_DISK_BY_ID" != 'yes' ] && \ + [ -n "$USE_DISK_BY_ID" ] && [ "$USE_DISK_BY_ID" != 'yes' ] && \ unset USE_DISK_BY_ID # ---------------------------------------------------------------- @@ -788,12 +779,12 @@ mountroot() # ------------ # If we have 'ROOT' (see above), but not 'ZFS_BOOTFS', then use # 'ROOT' - [ -n "$ROOT" -a -z "${ZFS_BOOTFS}" ] && ZFS_BOOTFS="$ROOT" + [ -n "$ROOT" ] && [ -z "${ZFS_BOOTFS}" ] && ZFS_BOOTFS="$ROOT" # ------------ # Check for the `-B zfs-bootfs=%s/%u,...` kind of parameter. # NOTE: Only use the pool name and dataset. The rest is not - # supported by ZoL (whatever it's for). + # supported by OpenZFS (whatever it's for). if [ -z "$ZFS_RPOOL" ] then # The ${zfs-bootfs} variable is set at the kernel command @@ -809,11 +800,11 @@ mountroot() # ------------ # No root fs or pool specified - do auto detect. - if [ -z "$ZFS_RPOOL" -a -z "${ZFS_BOOTFS}" ] + if [ -z "$ZFS_RPOOL" ] && [ -z "${ZFS_BOOTFS}" ] then # Do auto detect. Do this by 'cheating' - set 'root=zfs:AUTO' # which will be caught later - ROOT=zfs:AUTO + ROOT='zfs:AUTO' fi # ---------------------------------------------------------------- @@ -858,7 +849,7 @@ mountroot() fi # Import the pool (if not already done so in the AUTO check above). - if [ -n "$ZFS_RPOOL" -a -z "${POOL_IMPORTED}" ] + if [ -n "$ZFS_RPOOL" ] && [ -z "${POOL_IMPORTED}" ] then [ "$quiet" != "y" ] && \ zfs_log_begin_msg "Importing ZFS root pool '$ZFS_RPOOL'" @@ -971,7 +962,7 @@ mountroot() touch /run/zfs_unlock_complete if [ -e /run/zfs_unlock_complete_notify ]; then - read zfs_unlock_complete_notify < /run/zfs_unlock_complete_notify + read -r zfs_unlock_complete_notify < /run/zfs_unlock_complete_notify fi # ------------ @@ -989,8 +980,8 @@ mountroot() echo echo "=> waiting for ENTER before continuing because of 'zfsdebug=1'. " - echo -n " 'c' for shell, 'r' for reboot, 'ENTER' to continue. " - read b + printf "%s" " 'c' for shell, 'r' for reboot, 'ENTER' to continue. " + read -r b [ "$b" = "c" ] && /bin/sh [ "$b" = "r" ] && reboot -f @@ -1000,12 +991,14 @@ mountroot() # ------------ # Run local bottom script - if type run_scripts > /dev/null 2>&1 && \ - [ -f "/scripts/local-bottom" -o -d "/scripts/local-bottom" ] + if command -v run_scripts > /dev/null 2>&1 then - [ "$quiet" != "y" ] && \ - zfs_log_begin_msg "Running /scripts/local-bottom" - run_scripts /scripts/local-bottom - [ "$quiet" != "y" ] && zfs_log_end_msg + if [ -f "/scripts/local-bottom" ] || [ -d "/scripts/local-bottom" ] + then + [ "$quiet" != "y" ] && \ + zfs_log_begin_msg "Running /scripts/local-bottom" + run_scripts /scripts/local-bottom + [ "$quiet" != "y" ] && zfs_log_end_msg + fi fi } Modified: head/sys/contrib/openzfs/include/os/freebsd/spl/sys/kstat.h ============================================================================== --- head/sys/contrib/openzfs/include/os/freebsd/spl/sys/kstat.h Thu Oct 1 23:11:58 2020 (r366349) +++ head/sys/contrib/openzfs/include/os/freebsd/spl/sys/kstat.h Thu Oct 1 23:28:21 2020 (r366350) @@ -83,6 +83,14 @@ typedef struct kstat_s kstat_t; typedef int kid_t; /* unique kstat id */ typedef int kstat_update_t(struct kstat_s *, int); /* dynamic update cb */ +struct seq_file { + char *sf_buf; + size_t sf_size; +}; + +void seq_printf(struct seq_file *m, const char *fmt, ...); + + typedef struct kstat_module { char ksm_name[KSTAT_STRLEN+1]; /* module name */ struct list_head ksm_module_list; /* module linkage */ @@ -92,6 +100,7 @@ typedef struct kstat_module { typedef struct kstat_raw_ops { int (*headers)(char *buf, size_t size); + int (*seq_headers)(struct seq_file *); int (*data)(char *buf, size_t size, void *data); void *(*addr)(kstat_t *ksp, loff_t index); } kstat_raw_ops_t; @@ -112,6 +121,7 @@ struct kstat_s { size_t ks_data_size; /* size of kstat data section */ kstat_update_t *ks_update; /* dynamic updates */ void *ks_private; /* private data */ + void *ks_private1; /* private data */ kmutex_t ks_private_lock; /* kstat private data lock */ kmutex_t *ks_lock; /* kstat data lock */ struct list_head ks_list; /* kstat linkage */ @@ -185,6 +195,12 @@ extern void __kstat_set_raw_ops(kstat_t *ksp, int (*data)(char *buf, size_t size, void *data), void* (*addr)(kstat_t *ksp, loff_t index)); +extern void __kstat_set_seq_raw_ops(kstat_t *ksp, + int (*headers)(struct seq_file *), + int (*data)(char *buf, size_t size, void *data), + void* (*addr)(kstat_t *ksp, loff_t index)); + + extern kstat_t *__kstat_create(const char *ks_module, int ks_instance, const char *ks_name, const char *ks_class, uchar_t ks_type, uint_t ks_ndata, uchar_t ks_flags); @@ -196,6 +212,8 @@ extern void kstat_waitq_exit(kstat_io_t *); extern void kstat_runq_enter(kstat_io_t *); extern void kstat_runq_exit(kstat_io_t *); +#define kstat_set_seq_raw_ops(k, h, d, a) \ + __kstat_set_seq_raw_ops(k, h, d, a) #define kstat_set_raw_ops(k, h, d, a) \ __kstat_set_raw_ops(k, h, d, a) #define kstat_create(m, i, n, c, t, s, f) \ Modified: head/sys/contrib/openzfs/include/os/freebsd/spl/sys/procfs_list.h ============================================================================== --- head/sys/contrib/openzfs/include/os/freebsd/spl/sys/procfs_list.h Thu Oct 1 23:11:58 2020 (r366349) +++ head/sys/contrib/openzfs/include/os/freebsd/spl/sys/procfs_list.h Thu Oct 1 23:28:21 2020 (r366350) @@ -33,16 +33,18 @@ * procfs list manipulation */ -struct seq_file { }; -void seq_printf(struct seq_file *m, const char *fmt, ...); - -typedef struct procfs_list { +typedef struct procfs_list procfs_list_t; +struct procfs_list { void *pl_private; + void *pl_next_data; kmutex_t pl_lock; list_t pl_list; uint64_t pl_next_id; + int (*pl_show)(struct seq_file *f, void *p); + int (*pl_show_header)(struct seq_file *f); + int (*pl_clear)(procfs_list_t *procfs_list); size_t pl_node_offset; -} procfs_list_t; +}; typedef struct procfs_list_node { list_node_t pln_link; @@ -50,6 +52,7 @@ typedef struct procfs_list_node { } procfs_list_node_t; void procfs_list_install(const char *module, + const char *submodule, const char *name, mode_t mode, procfs_list_t *procfs_list, Modified: head/sys/contrib/openzfs/include/os/freebsd/spl/sys/simd_x86.h ============================================================================== --- head/sys/contrib/openzfs/include/os/freebsd/spl/sys/simd_x86.h Thu Oct 1 23:11:58 2020 (r366349) +++ head/sys/contrib/openzfs/include/os/freebsd/spl/sys/simd_x86.h Thu Oct 1 23:28:21 2020 (r366350) @@ -29,6 +29,7 @@ #include #include #include +#include #ifdef __i386__ #include #else @@ -42,16 +43,15 @@ #define kfpu_allowed() 1 #define kfpu_initialize(tsk) do {} while (0) -#define kfpu_begin() { \ - critical_enter(); \ - fpu_kern_enter(curthread, NULL, FPU_KERN_NOCTX); \ +#define kfpu_begin() { \ + if (__predict_false(!is_fpu_kern_thread(0))) \ + fpu_kern_enter(curthread, NULL, FPU_KERN_NOCTX);\ } -#define kfpu_end() \ - { \ - fpu_kern_leave(curthread, NULL); \ - critical_exit(); \ - } +#define kfpu_end() { \ + if (__predict_false(curpcb->pcb_flags & PCB_FPUNOSAVE)) \ + fpu_kern_leave(curthread, NULL); \ +} /* * Check if OS supports AVX and AVX2 by checking XCR0 Modified: head/sys/contrib/openzfs/include/os/linux/spl/sys/procfs_list.h ============================================================================== --- head/sys/contrib/openzfs/include/os/linux/spl/sys/procfs_list.h Thu Oct 1 23:11:58 2020 (r366349) +++ head/sys/contrib/openzfs/include/os/linux/spl/sys/procfs_list.h Thu Oct 1 23:28:21 2020 (r366350) @@ -57,6 +57,7 @@ typedef struct procfs_list_node { } procfs_list_node_t; void procfs_list_install(const char *module, + const char *submodule, const char *name, mode_t mode, procfs_list_t *procfs_list, Modified: head/sys/contrib/openzfs/include/sys/frame.h ============================================================================== --- head/sys/contrib/openzfs/include/sys/frame.h Thu Oct 1 23:11:58 2020 (r366349) +++ head/sys/contrib/openzfs/include/sys/frame.h Thu Oct 1 23:28:21 2020 (r366350) @@ -23,7 +23,8 @@ extern "C" { #endif -#if defined(__KERNEL__) && defined(HAVE_STACK_FRAME_NON_STANDARD) +#if defined(__KERNEL__) && defined(HAVE_KERNEL_OBJTOOL) && \ + defined(HAVE_STACK_FRAME_NON_STANDARD) #include #else #define STACK_FRAME_NON_STANDARD(func) Modified: head/sys/contrib/openzfs/include/sys/lua/luaconf.h ============================================================================== --- head/sys/contrib/openzfs/include/sys/lua/luaconf.h Thu Oct 1 23:11:58 2020 (r366349) +++ head/sys/contrib/openzfs/include/sys/lua/luaconf.h Thu Oct 1 23:28:21 2020 (r366350) @@ -368,11 +368,7 @@ extern int lcompat_hashnum(int64_t); @@ LUAL_BUFFERSIZE is the buffer size used by the lauxlib buffer system. ** CHANGE it if it uses too much C-stack space. */ -#ifdef __linux__ #define LUAL_BUFFERSIZE 512 -#else -#define LUAL_BUFFERSIZE 1024 -#endif /* Modified: head/sys/contrib/openzfs/include/sys/zfs_context.h ============================================================================== --- head/sys/contrib/openzfs/include/sys/zfs_context.h Thu Oct 1 23:11:58 2020 (r366349) +++ head/sys/contrib/openzfs/include/sys/zfs_context.h Thu Oct 1 23:28:21 2020 (r366350) @@ -386,6 +386,7 @@ typedef struct procfs_list_node { } procfs_list_node_t; void procfs_list_install(const char *module, + const char *submodule, const char *name, mode_t mode, procfs_list_t *procfs_list, Modified: head/sys/contrib/openzfs/include/sys/zstd/zstd.h ============================================================================== --- head/sys/contrib/openzfs/include/sys/zstd/zstd.h Thu Oct 1 23:11:58 2020 (r366349) +++ head/sys/contrib/openzfs/include/sys/zstd/zstd.h Thu Oct 1 23:28:21 2020 (r366350) @@ -90,6 +90,7 @@ int zfs_zstd_decompress_level(void *s_start, void *d_s size_t d_len, uint8_t *level); int zfs_zstd_decompress(void *s_start, void *d_start, size_t s_len, size_t d_len, int n); +void zfs_zstd_cache_reap_now(void); #ifdef __cplusplus } Modified: head/sys/contrib/openzfs/lib/libshare/os/freebsd/nfs.c ============================================================================== --- head/sys/contrib/openzfs/lib/libshare/os/freebsd/nfs.c Thu Oct 1 23:11:58 2020 (r366349) +++ head/sys/contrib/openzfs/lib/libshare/os/freebsd/nfs.c Thu Oct 1 23:28:21 2020 (r366350) @@ -228,21 +228,33 @@ nfs_copy_entries(char *filename, const char *mountpoin int error = SA_OK; char *line; - /* - * If the file doesn't exist then there is nothing more - * we need to do. - */ FILE *oldfp = fopen(ZFS_EXPORTS_FILE, "r"); - if (oldfp == NULL) - return (SA_OK); - FILE *newfp = fopen(filename, "w+"); + if (newfp == NULL) { + fprintf(stderr, "failed to open %s file: %s", filename, + strerror(errno)); + fclose(oldfp); + return (SA_SYSTEM_ERR); + } fputs(FILE_HEADER, newfp); - while ((line = zgetline(oldfp, mountpoint)) != NULL) - fprintf(newfp, "%s\n", line); - if (ferror(oldfp) != 0) { - error = ferror(oldfp); + + /* + * The ZFS_EXPORTS_FILE may not exist yet. If that's the + * case then just write out the new file. + */ + if (oldfp != NULL) { + while ((line = zgetline(oldfp, mountpoint)) != NULL) + fprintf(newfp, "%s\n", line); + if (ferror(oldfp) != 0) { + error = ferror(oldfp); + } + if (fclose(oldfp) != 0) { + fprintf(stderr, "Unable to close file %s: %s\n", + filename, strerror(errno)); + error = error != 0 ? error : SA_SYSTEM_ERR; + } } + if (error == 0 && ferror(newfp) != 0) { error = ferror(newfp); } @@ -252,8 +264,6 @@ nfs_copy_entries(char *filename, const char *mountpoin filename, strerror(errno)); error = error != 0 ? error : SA_SYSTEM_ERR; } - fclose(oldfp); - return (error); } Modified: head/sys/contrib/openzfs/lib/libshare/os/linux/nfs.c ============================================================================== --- head/sys/contrib/openzfs/lib/libshare/os/linux/nfs.c Thu Oct 1 23:11:58 2020 (r366349) +++ head/sys/contrib/openzfs/lib/libshare/os/linux/nfs.c Thu Oct 1 23:28:21 2020 (r366350) @@ -393,7 +393,15 @@ static char * nfs_init_tmpfile(void) { char *tmpfile = NULL; + struct stat sb; + if (stat(ZFS_EXPORTS_DIR, &sb) < 0 && + mkdir(ZFS_EXPORTS_DIR, 0755) < 0) { + fprintf(stderr, "failed to create %s: %s\n", + ZFS_EXPORTS_DIR, strerror(errno)); + return (NULL); + } + if (asprintf(&tmpfile, "%s%s", ZFS_EXPORTS_FILE, ".XXXXXXXX") == -1) { fprintf(stderr, "Unable to allocate temporary file\n"); return (NULL); @@ -481,36 +489,49 @@ nfs_copy_entries(char *filename, const char *mountpoin size_t buflen = 0; int error = SA_OK; - /* - * If the file doesn't exist then there is nothing more - * we need to do. - */ FILE *oldfp = fopen(ZFS_EXPORTS_FILE, "r"); - if (oldfp == NULL) - return (SA_OK); - FILE *newfp = fopen(filename, "w+"); + if (newfp == NULL) { + fprintf(stderr, "failed to open %s file: %s", filename, + strerror(errno)); + fclose(oldfp); + return (SA_SYSTEM_ERR); + } fputs(FILE_HEADER, newfp); - while ((getline(&buf, &buflen, oldfp)) != -1) { - char *space = NULL; - if (buf[0] == '\n' || buf[0] == '#') - continue; + /* + * The ZFS_EXPORTS_FILE may not exist yet. If that's the + * case then just write out the new file. + */ + if (oldfp != NULL) { + while (getline(&buf, &buflen, oldfp) != -1) { + char *space = NULL; - if ((space = strchr(buf, ' ')) != NULL) { - int mountpoint_len = strlen(mountpoint); - - if (space - buf == mountpoint_len && - strncmp(mountpoint, buf, mountpoint_len) == 0) { + if (buf[0] == '\n' || buf[0] == '#') continue; + + if ((space = strchr(buf, ' ')) != NULL) { + int mountpoint_len = strlen(mountpoint); + + if (space - buf == mountpoint_len && + strncmp(mountpoint, buf, + mountpoint_len) == 0) { + continue; + } } + fputs(buf, newfp); } - fputs(buf, newfp); - } - if (oldfp != NULL && ferror(oldfp) != 0) { - error = ferror(oldfp); + if (ferror(oldfp) != 0) { + error = ferror(oldfp); + } + if (fclose(oldfp) != 0) { + fprintf(stderr, "Unable to close file %s: %s\n", + filename, strerror(errno)); + error = error != 0 ? error : SA_SYSTEM_ERR; + } } + if (error == 0 && ferror(newfp) != 0) { error = ferror(newfp); } @@ -521,8 +542,6 @@ nfs_copy_entries(char *filename, const char *mountpoin filename, strerror(errno)); error = error != 0 ? error : SA_SYSTEM_ERR; } - fclose(oldfp); - return (error); } @@ -701,13 +720,5 @@ static const sa_share_ops_t nfs_shareops = { void libshare_nfs_init(void) { - struct stat sb; - nfs_fstype = register_fstype("nfs", &nfs_shareops); - - if (stat(ZFS_EXPORTS_DIR, &sb) < 0 && - mkdir(ZFS_EXPORTS_DIR, 0755) < 0) { - fprintf(stderr, "failed to create %s: %s\n", - ZFS_EXPORTS_DIR, strerror(errno)); - } } Modified: head/sys/contrib/openzfs/lib/libzpool/kernel.c ============================================================================== --- head/sys/contrib/openzfs/lib/libzpool/kernel.c Thu Oct 1 23:11:58 2020 (r366349) +++ head/sys/contrib/openzfs/lib/libzpool/kernel.c Thu Oct 1 23:28:21 2020 (r366350) @@ -444,6 +444,7 @@ seq_printf(struct seq_file *m, const char *fmt, ...) void procfs_list_install(const char *module, + const char *submodule, const char *name, mode_t mode, procfs_list_t *procfs_list, Modified: head/sys/contrib/openzfs/man/man8/zfs-userspace.8 ============================================================================== --- head/sys/contrib/openzfs/man/man8/zfs-userspace.8 Thu Oct 1 23:11:58 2020 (r366349) +++ head/sys/contrib/openzfs/man/man8/zfs-userspace.8 Thu Oct 1 23:28:21 2020 (r366350) @@ -44,7 +44,7 @@ .Oo Fl s Ar field Oc Ns ... .Oo Fl S Ar field Oc Ns ... .Oo Fl t Ar type Ns Oo , Ns Ar type Oc Ns ... Oc -.Ar filesystem Ns | Ns Ar snapshot +.Ar filesystem Ns | Ns Ar snapshot Ns | Ns Ar path .Nm .Cm groupspace .Op Fl Hinp @@ -52,14 +52,14 @@ .Oo Fl s Ar field Oc Ns ... .Oo Fl S Ar field Oc Ns ... .Oo Fl t Ar type Ns Oo , Ns Ar type Oc Ns ... Oc -.Ar filesystem Ns | Ns Ar snapshot +.Ar filesystem Ns | Ns Ar snapshot Ns | Ns Ar path .Nm .Cm projectspace .Op Fl Hp .Oo Fl o Ar field Ns Oo , Ns Ar field Oc Ns ... Oc .Oo Fl s Ar field Oc Ns ... .Oo Fl S Ar field Oc Ns ... -.Ar filesystem Ns | Ns Ar snapshot +.Ar filesystem Ns | Ns Ar snapshot Ns | Ns Ar path .Sh DESCRIPTION .Bl -tag -width "" .It Xo @@ -70,10 +70,11 @@ .Oo Fl s Ar field Oc Ns ... .Oo Fl S Ar field Oc Ns ... .Oo Fl t Ar type Ns Oo , Ns Ar type Oc Ns ... Oc -.Ar filesystem Ns | Ns Ar snapshot +.Ar filesystem Ns | Ns Ar snapshot Ns | Ns Ar path .Xc -Displays space consumed by, and quotas on, each user in the specified filesystem -or snapshot. +Displays space consumed by, and quotas on, each user in the specified filesystem, +snapshot, or path. +If a path is given, the filesystem that contains that path will be used. This corresponds to the .Sy userused@ Ns Em user , .Sy userobjused@ Ns Em user , @@ -167,7 +168,7 @@ except that the default types to display are .Oo Fl o Ar field Ns Oo , Ns Ar field Oc Ns ... Oc .Oo Fl s Ar field Oc Ns ... .Oo Fl S Ar field Oc Ns ... -.Ar filesystem Ns | Ns Ar snapshot +.Ar filesystem Ns | Ns Ar snapshot Ns | Ns Ar path .Xc Displays space consumed by, and quotas on, each project in the specified filesystem or snapshot. This subcommand is identical to Modified: head/sys/contrib/openzfs/man/man8/zpool-remove.8 ============================================================================== --- head/sys/contrib/openzfs/man/man8/zpool-remove.8 Thu Oct 1 23:11:58 2020 (r366349) +++ head/sys/contrib/openzfs/man/man8/zpool-remove.8 Thu Oct 1 23:28:21 2020 (r366350) @@ -55,6 +55,8 @@ This command supports removing hot spare, cache, log, non-redundant primary top-level vdevs, including dedup and special vdevs. When the primary pool storage includes a top-level raidz vdev only hot spare, cache, and log devices can be removed. +Note that keys for all encrypted datasets must be loaded for top-level vdevs +to be removed. .sp Removing a top-level vdev reduces the total amount of space in the storage pool. The specified device will be evacuated by copying all allocated space from it to Modified: head/sys/contrib/openzfs/module/lua/llimits.h ============================================================================== --- head/sys/contrib/openzfs/module/lua/llimits.h Thu Oct 1 23:11:58 2020 (r366349) +++ head/sys/contrib/openzfs/module/lua/llimits.h Thu Oct 1 23:28:21 2020 (r366350) @@ -126,16 +126,7 @@ typedef LUAI_UACNUMBER l_uacNumber; * Minimum amount of available stack space (in bytes) to make a C call. With * gsub() recursion, the stack space between each luaD_call() is 1256 bytes. */ -#if defined(__FreeBSD__) -/* - * FreeBSD needs a few extra bytes in unoptimized debug builds to avoid a - * double-fault handling the error when the max call depth is exceeded just - * before the C stack runs out. 64 bytes seems to do the trick. - */ -#define LUAI_MINCSTACK 4160 -#else #define LUAI_MINCSTACK 4096 -#endif /* ** maximum number of upvalues in a closure (both C and Lua). (Value Modified: head/sys/contrib/openzfs/module/os/freebsd/spl/spl_kstat.c ============================================================================== --- head/sys/contrib/openzfs/module/os/freebsd/spl/spl_kstat.c Thu Oct 1 23:11:58 2020 (r366349) +++ head/sys/contrib/openzfs/module/os/freebsd/spl/spl_kstat.c Thu Oct 1 23:28:21 2020 (r366350) @@ -55,6 +55,17 @@ __kstat_set_raw_ops(kstat_t *ksp, ksp->ks_raw_ops.addr = addr; } +void +__kstat_set_seq_raw_ops(kstat_t *ksp, + int (*headers)(struct seq_file *f), + int (*data)(char *buf, size_t size, void *data), + void *(*addr)(kstat_t *ksp, loff_t index)) +{ + ksp->ks_raw_ops.seq_headers = headers; + ksp->ks_raw_ops.data = data; + ksp->ks_raw_ops.addr = addr; +} + static int kstat_default_update(kstat_t *ksp, int rw) { @@ -160,7 +171,7 @@ kstat_sysctl_raw(SYSCTL_HANDLER_ARGS) void *data; kstat_t *ksp = arg1; void *(*addr_op)(kstat_t *ksp, loff_t index); - int n, rc = 0; + int n, has_header, rc = 0; sb = sbuf_new_auto(); if (sb == NULL) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Oct 2 00:04:00 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F0DC0437B6C; Fri, 2 Oct 2020 00:04:00 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.12]) (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 4C2Vb41jgkz3ckc; Fri, 2 Oct 2020 00:03:59 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id O8YFk9HWSs3D6O8YHkHnKg; Thu, 01 Oct 2020 18:03:58 -0600 X-Authority-Analysis: v=2.4 cv=bZHV7MDB c=1 sm=1 tr=0 ts=5f766e6e a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=xqWC_Br6kY4A:10 a=kj9zAlcOel0A:10 a=afefHYAZSVUA:10 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=EkcXrb_YAAAA:8 a=xNf9USuDAAAA:8 a=-thiqJL0Yk6kjFFnvVEA:9 a=brklk3DbOFoEJEYg:21 a=p41HoBhZ9IDMi7NH:21 a=OREZwpRKEbqmW-i2:21 a=CjuIK1q_8ugA:10 a=dDtS1yo4QMUA:10 a=C7gheeXg_rAA:10 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 a=LK5xJRSDVpKd5WXXoEvA:22 a=SEwjQc04WA-l_NiBhQ7s:22 Received: from slippy.cwsent.com (slippy [IPv6:fc00:1:1:1::5b]) by spqr.komquats.com (Postfix) with ESMTPS id A19BA14D; Thu, 1 Oct 2020 17:03:54 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.16.1/8.16.1) with ESMTP id 09203sL7028789; Thu, 1 Oct 2020 17:03:54 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <202010020003.09203sL7028789@slippy.cwsent.com> X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Matt Macy cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r366350 - in head/sys/contrib/openzfs: . .github cmd/zfs config contrib/initramfs/scripts contrib/intel_qat include/os/freebsd/spl/sys include/os/linux/spl/sys include/sys include/sys/l... In-reply-to: <202010012328.091NSLq2085612@repo.freebsd.org> References: <202010012328.091NSLq2085612@repo.freebsd.org> Comments: In-reply-to Matt Macy message dated "Thu, 01 Oct 2020 23:28:21 -0000." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 01 Oct 2020 17:03:54 -0700 X-CMAE-Envelope: MS4xfLkfEzCpK1QHb/d/Gqd0TCV7L9MIB30FVi7XOvWPAKHZocIK4hboTu6f9uHwy3wNd7K8wGMOogzOTbLETkr5Bxo0pXQXxlfxp9Bl5jXvAxfaTT9554GG FBhsOmuihp09Ifa5iarwbsOR7G3+1IP38neAAKieMxdtZUxxROxNt5qeL9xg04GyuvH3VFTr5Lii+FwfPomUTblrwC8Sv1j8Ebi34XJnJ4CJoZNybwcOG2qM gRLI3n/WGzGjO+5eB0GvRoHuDdKsl/7JQR3rFi3EdNafvXgjovElcqhFFidbFFx5l+Ys1Ll/2+oj89i5KIZgUA== X-Rspamd-Queue-Id: 4C2Vb41jgkz3ckc X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Oct 2020 00:04:01 -0000 Time to deorbit i386 once and for all. What a pain. --- spl_taskq.o --- /opt/src/svn-current/sys/contrib/openzfs/module/os/freebsd/spl/spl_taskq.c:1 74:3: error: implicit declaration of function 'fpu_kern_thread' is invalid in C99 [-Werror,-Wimplicit-function-declaration] fpu_kern_thread(FPU_KERN_NORMAL); ^ /opt/src/svn-current/sys/contrib/openzfs/module/os/freebsd/spl/spl_taskq.c:1 74:19: error: use of undeclared identifier 'FPU_KERN_NORMAL' fpu_kern_thread(FPU_KERN_NORMAL); ^ 2 errors generated. -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org The need of the many outweighs the greed of the few. In message <202010012328.091NSLq2085612@repo.freebsd.org>, Matt Macy writes: > Author: mmacy > Date: Thu Oct 1 23:28:21 2020 > New Revision: 366350 > URL: https://svnweb.freebsd.org/changeset/base/366350 > > Log: > OpenZFS: MFV 2.0-rc3-gfc5966 > > - Annotate FreeBSD sysctls with CTLFLAG_MPSAFE > - Reduce stack usage of Lua > - Don't save user FPU context in kernel threads > - Add support for procfs_list > - Code cleanup in zio_crypt > - Add DB_RF_NOPREFETCH to dbuf_read()s in dnode.c > - Drop references when skipping dmu_send due to EXDEV > - Eliminate gratuitous bzeroing in dbuf_stats_hash_table_data > - Fix legacy compat for platform IOCs > > Added: > head/sys/contrib/openzfs/.github/ > - copied from r366349, vendor-sys/openzfs/dist/.github/ > head/sys/contrib/openzfs/contrib/intel_qat/ > - copied from r366349, vendor-sys/openzfs/dist/contrib/intel_qat/ > head/sys/contrib/openzfs/tests/zfs-tests/cmd/badsend/ > - copied from r366349, vendor-sys/openzfs/dist/tests/zfs-tests/cmd/badse > nd/ > head/sys/contrib/openzfs/tests/zfs-tests/tests/functional/rsend/send_invali > d.ksh > - copied unchanged from r366349, vendor-sys/openzfs/dist/tests/zfs-tests > /tests/functional/rsend/send_invalid.ksh > Modified: > head/sys/contrib/openzfs/cmd/zfs/zfs_main.c > head/sys/contrib/openzfs/config/kernel-config-defined.m4 > head/sys/contrib/openzfs/config/kernel-objtool.m4 > head/sys/contrib/openzfs/configure.ac > head/sys/contrib/openzfs/contrib/initramfs/scripts/zfs > head/sys/contrib/openzfs/include/os/freebsd/spl/sys/kstat.h > head/sys/contrib/openzfs/include/os/freebsd/spl/sys/procfs_list.h > head/sys/contrib/openzfs/include/os/freebsd/spl/sys/simd_x86.h > head/sys/contrib/openzfs/include/os/linux/spl/sys/procfs_list.h > head/sys/contrib/openzfs/include/sys/frame.h > head/sys/contrib/openzfs/include/sys/lua/luaconf.h > head/sys/contrib/openzfs/include/sys/zfs_context.h > head/sys/contrib/openzfs/include/sys/zstd/zstd.h > head/sys/contrib/openzfs/lib/libshare/os/freebsd/nfs.c > head/sys/contrib/openzfs/lib/libshare/os/linux/nfs.c > head/sys/contrib/openzfs/lib/libzpool/kernel.c > head/sys/contrib/openzfs/man/man8/zfs-userspace.8 > head/sys/contrib/openzfs/man/man8/zpool-remove.8 > head/sys/contrib/openzfs/module/lua/llimits.h > head/sys/contrib/openzfs/module/os/freebsd/spl/spl_kstat.c > head/sys/contrib/openzfs/module/os/freebsd/spl/spl_procfs_list.c > head/sys/contrib/openzfs/module/os/freebsd/spl/spl_taskq.c > head/sys/contrib/openzfs/module/os/freebsd/zfs/kmod_core.c > head/sys/contrib/openzfs/module/os/freebsd/zfs/sysctl_os.c > head/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_ioctl_compat.c > head/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c > head/sys/contrib/openzfs/module/os/freebsd/zfs/zio_crypt.c > head/sys/contrib/openzfs/module/os/linux/spl/spl-procfs-list.c > head/sys/contrib/openzfs/module/os/linux/zfs/vdev_disk.c > head/sys/contrib/openzfs/module/os/linux/zfs/zfs_debug.c > head/sys/contrib/openzfs/module/zfs/arc.c > head/sys/contrib/openzfs/module/zfs/dbuf_stats.c > head/sys/contrib/openzfs/module/zfs/dmu_send.c > head/sys/contrib/openzfs/module/zfs/dnode.c > head/sys/contrib/openzfs/module/zfs/dsl_crypt.c > head/sys/contrib/openzfs/module/zfs/spa_misc.c > head/sys/contrib/openzfs/module/zfs/spa_stats.c > head/sys/contrib/openzfs/module/zfs/zfs_log.c > head/sys/contrib/openzfs/module/zstd/zfs_zstd.c > head/sys/contrib/openzfs/tests/runfiles/common.run > head/sys/contrib/openzfs/tests/zfs-tests/cmd/Makefile.am > head/sys/contrib/openzfs/tests/zfs-tests/include/commands.cfg > head/sys/contrib/openzfs/tests/zfs-tests/tests/functional/rsend/Makefile.am > Directory Properties: > head/sys/contrib/openzfs/ (props changed) > > Modified: head/sys/contrib/openzfs/cmd/zfs/zfs_main.c > ============================================================================= > = > --- head/sys/contrib/openzfs/cmd/zfs/zfs_main.c Thu Oct 1 23:11:58 202 > 0 (r366349) > +++ head/sys/contrib/openzfs/cmd/zfs/zfs_main.c Thu Oct 1 23:28:21 202 > 0 (r366350) > @@ -363,16 +363,16 @@ get_usage(zfs_help_t idx) > return (gettext("\tuserspace [-Hinp] [-o field[,...]] " > "[-s field] ...\n" > "\t [-S field] ... [-t type[,...]] " > - "\n")); > + "\n")); > case HELP_GROUPSPACE: > return (gettext("\tgroupspace [-Hinp] [-o field[,...]] " > "[-s field] ...\n" > "\t [-S field] ... [-t type[,...]] " > - "\n")); > + "\n")); > case HELP_PROJECTSPACE: > return (gettext("\tprojectspace [-Hp] [-o field[,...]] " > "[-s field] ... \n" > - "\t [-S field] ... \n")); > + "\t [-S field] ... \n")); > case HELP_PROJECT: > return (gettext("\tproject [-d|-r] \n" > "\tproject -c [-0] [-d|-r] [-p id] \n" > @@ -2481,11 +2481,13 @@ zfs_do_upgrade(int argc, char **argv) > > /* > * zfs userspace [-Hinp] [-o field[,...]] [-s field [-s field]...] > - * [-S field [-S field]...] [-t type[,...]] filesystem | snaps > hot > + * [-S field [-S field]...] [-t type[,...]] > + * filesystem | snapshot | path > * zfs groupspace [-Hinp] [-o field[,...]] [-s field [-s field]...] > - * [-S field [-S field]...] [-t type[,...]] filesystem | snap > shot > + * [-S field [-S field]...] [-t type[,...]] > + * filesystem | snapshot | path > * zfs projectspace [-Hp] [-o field[,...]] [-s field [-s field]...] > - * [-S field [-S field]...] filesystem | snapshot > + * [-S field [-S field]...] filesystem | snapshot | path > * > * -H Scripted mode; elide headers and separate columns by tabs. > * -i Translate SID to POSIX ID. > @@ -3191,7 +3193,7 @@ zfs_do_userspace(int argc, char **argv) > } while (delim != NULL); > } > > - if ((zhp = zfs_open(g_zfs, argv[0], ZFS_TYPE_FILESYSTEM | > + if ((zhp = zfs_path_to_zhandle(g_zfs, argv[0], ZFS_TYPE_FILESYSTEM | > ZFS_TYPE_SNAPSHOT)) == NULL) > return (1); > if (zhp->zfs_head_type != ZFS_TYPE_FILESYSTEM) { > > Modified: head/sys/contrib/openzfs/config/kernel-config-defined.m4 > ============================================================================= > = > --- head/sys/contrib/openzfs/config/kernel-config-defined.m4 Thu Oct 1 23:1 > 1:58 2020 (r366349) > +++ head/sys/contrib/openzfs/config/kernel-config-defined.m4 Thu Oct 1 23:2 > 8:21 2020 (r366350) > @@ -91,7 +91,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_CONFIG_DEBUG_LOCK_ALLOC], > > AC_DEFUN([ZFS_AC_KERNEL_CONFIG_DEBUG_LOCK_ALLOC], [ > AC_MSG_CHECKING([whether mutex_lock() is GPL-only]) > - ZFS_LINUX_TEST_RESULT([config_debug_lock_alloc], [ > + ZFS_LINUX_TEST_RESULT([config_debug_lock_alloc_license], [ > AC_MSG_RESULT(no) > ],[ > AC_MSG_RESULT(yes) > > Modified: head/sys/contrib/openzfs/config/kernel-objtool.m4 > ============================================================================= > = > --- head/sys/contrib/openzfs/config/kernel-objtool.m4 Thu Oct 1 23:11:58 202 > 0 (r366349) > +++ head/sys/contrib/openzfs/config/kernel-objtool.m4 Thu Oct 1 23:28:21 202 > 0 (r366350) > @@ -6,10 +6,11 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_OBJTOOL], [ > dnl # 4.6 API for compile-time stack validation > ZFS_LINUX_TEST_SRC([objtool], [ > #undef __ASSEMBLY__ > + #include > #include > ],[ > #if !defined(FRAME_BEGIN) > - CTASSERT(1); > + #error "FRAME_BEGIN is not defined" > #endif > ]) > > @@ -18,7 +19,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_OBJTOOL], [ > #include > ],[ > #if !defined(STACK_FRAME_NON_STANDARD) > - CTASSERT(1); > + #error "STACK_FRAME_NON_STANDARD is not defined." > #endif > ]) > ]) > > Modified: head/sys/contrib/openzfs/configure.ac > ============================================================================= > = > --- head/sys/contrib/openzfs/configure.ac Thu Oct 1 23:11:58 2020 > (r366349) > +++ head/sys/contrib/openzfs/configure.ac Thu Oct 1 23:28:21 2020 > (r366350) > @@ -204,6 +204,7 @@ AC_CONFIG_FILES([ > tests/zfs-tests/Makefile > tests/zfs-tests/callbacks/Makefile > tests/zfs-tests/cmd/Makefile > + tests/zfs-tests/cmd/badsend/Makefile > tests/zfs-tests/cmd/btree_test/Makefile > tests/zfs-tests/cmd/chg_usr_exec/Makefile > tests/zfs-tests/cmd/devname2devid/Makefile > > Modified: head/sys/contrib/openzfs/contrib/initramfs/scripts/zfs > ============================================================================= > = > --- head/sys/contrib/openzfs/contrib/initramfs/scripts/zfs Thu Oct 1 23:1 > 1:58 2020 (r366349) > +++ head/sys/contrib/openzfs/contrib/initramfs/scripts/zfs Thu Oct 1 23:2 > 8:21 2020 (r366350) > @@ -15,8 +15,8 @@ > # See "4.5 Disable root prompt on the initramfs" of Securing Debian Manual: > # https://www.debian.org/doc/manuals/securing-debian-howto/ch4.en.html > shell() { > - if type panic > /dev/null 2>&1; then > - panic $@ > + if command -v panic > /dev/null 2>&1; then > + panic > else > /bin/sh > fi > @@ -26,22 +26,23 @@ shell() { > # pools and mounting any filesystems. > pre_mountroot() > { > - if type run_scripts > /dev/null 2>&1 && \ > - [ -f "/scripts/local-top" -o -d "/scripts/local-top" ] > + if command -v run_scripts > /dev/null 2>&1 > then > - [ "$quiet" != "y" ] && \ > - zfs_log_begin_msg "Running /scripts/local-top" > - run_scripts /scripts/local-top > - [ "$quiet" != "y" ] && zfs_log_end_msg > - fi > + if [ -f "/scripts/local-top" ] || [ -d "/scripts/local-top" ] > + then > + [ "$quiet" != "y" ] && \ > + zfs_log_begin_msg "Running /scripts/local-top" > + run_scripts /scripts/local-top > + [ "$quiet" != "y" ] && zfs_log_end_msg > + fi > > - if type run_scripts > /dev/null 2>&1 && \ > - [ -f "/scripts/local-premount" -o -d "/scripts/local-premount" ] > - then > - [ "$quiet" != "y" ] && \ > - zfs_log_begin_msg "Running /scripts/local-premount" > - run_scripts /scripts/local-premount > - [ "$quiet" != "y" ] && zfs_log_end_msg > + if [ -f "/scripts/local-premount" ] || [ -d "/scripts/local-premount" > ] > + then > + [ "$quiet" != "y" ] && \ > + zfs_log_begin_msg "Running /scripts/local-premount" > + run_scripts /scripts/local-premount > + [ "$quiet" != "y" ] && zfs_log_end_msg > + fi > fi > } > > @@ -57,10 +58,10 @@ disable_plymouth() > # Get a ZFS filesystem property value. > get_fs_value() > { > - local fs="$1" > - local value=$2 > + fs="$1" > + value=$2 > > - "${ZFS}" get -H -ovalue $value "$fs" 2> /dev/null > + "${ZFS}" get -H -ovalue "$value" "$fs" 2> /dev/null > } > > # Find the 'bootfs' property on pool $1. > @@ -68,7 +69,7 @@ get_fs_value() > # pool by exporting it again. > find_rootfs() > { > - local pool="$1" > + pool="$1" > > # If 'POOL_IMPORTED' isn't set, no pool imported and therefore > # we won't be able to find a root fs. > @@ -84,7 +85,7 @@ find_rootfs() > > # Make sure it's not '-' and that it starts with /. > if [ "${ZFS_BOOTFS}" != "-" ] && \ > - $(get_fs_value "${ZFS_BOOTFS}" mountpoint | grep -q '^/$') > + get_fs_value "${ZFS_BOOTFS}" mountpoint | grep -q '^/$' > then > # Keep it mounted > POOL_IMPORTED=1 > @@ -101,14 +102,13 @@ find_rootfs() > # Support function to get a list of all pools, separated with ';' > find_pools() > { > - local CMD="$*" > - local pools pool > + CMD="$*" > > pools=$($CMD 2> /dev/null | \ > grep -E "pool:|^[a-zA-Z0-9]" | \ > sed 's@.*: @@' | \ > - while read pool; do \ > - echo -n "$pool;" > + while read -r pool; do \ > + printf "%s" "$pool;" > done) > > echo "${pools%%;}" # Return without the last ';'. > @@ -117,8 +117,6 @@ find_pools() > # Get a list of all available pools > get_pools() > { > - local available_pools npools > - > if [ -n "${ZFS_POOL_IMPORT}" ]; then > echo "$ZFS_POOL_IMPORT" > return 0 > @@ -159,9 +157,8 @@ get_pools() > # Filter out any exceptions... > if [ -n "$ZFS_POOL_EXCEPTIONS" ] > then > - local found="" > - local apools="" > - local pool exception > + found="" > + apools="" > OLD_IFS="$IFS" ; IFS=";" > > for pool in $available_pools > @@ -194,8 +191,7 @@ get_pools() > # Import given pool $1 > import_pool() > { > - local pool="$1" > - local dirs dir > + pool="$1" > > # Verify that the pool isn't already imported > # Make as sure as we can to not require '-f' to import. > @@ -205,7 +201,7 @@ import_pool() > # to something we can use later with the real import(s). We want to > # make sure we find all by* dirs, BUT by-vdev should be first (if it > # exists). > - if [ -n "$USE_DISK_BY_ID" -a -z "$ZPOOL_IMPORT_PATH" ] > + if [ -n "$USE_DISK_BY_ID" ] && [ -z "$ZPOOL_IMPORT_PATH" ] > then > dirs="$(for dir in $(echo /dev/disk/by-*) > do > @@ -213,7 +209,7 @@ import_pool() > echo "$dir" | grep -q /by-vdev && continue > [ ! -d "$dir" ] && continue > > - echo -n "$dir:" > + printf "%s" "$dir:" > done | sed 's,:$,,g')" > > if [ -d "/dev/disk/by-vdev" ] > @@ -277,7 +273,7 @@ import_pool() > # with more logging etc. > load_module_initrd() > { > - if [ "$ZFS_INITRD_PRE_MOUNTROOT_SLEEP" > 0 ] > + if [ "$ZFS_INITRD_PRE_MOUNTROOT_SLEEP" -gt 0 ] 2>/dev/null > then > if [ "$quiet" != "y" ]; then > zfs_log_begin_msg "Sleeping for" \ > @@ -288,9 +284,9 @@ load_module_initrd() > fi > > # Wait for all of the /dev/{hd,sd}[a-z] device nodes to appear. > - if type wait_for_udev > /dev/null 2>&1 ; then > + if command -v wait_for_udev > /dev/null 2>&1 ; then > wait_for_udev 10 > - elif type wait_for_dev > /dev/null 2>&1 ; then > + elif command -v wait_for_dev > /dev/null 2>&1 ; then > wait_for_dev > fi > > @@ -300,7 +296,7 @@ load_module_initrd() > # Load the module > load_module "zfs" || return 1 > > - if [ "$ZFS_INITRD_POST_MODPROBE_SLEEP" > 0 ] > + if [ "$ZFS_INITRD_POST_MODPROBE_SLEEP" -gt 0 ] 2>/dev/null > then > if [ "$quiet" != "y" ]; then > zfs_log_begin_msg "Sleeping for" \ > @@ -316,12 +312,10 @@ load_module_initrd() > # Mount a given filesystem > mount_fs() > { > - local fs="$1" > - local mountpoint > + fs="$1" > > # Check that the filesystem exists > - "${ZFS}" list -oname -tfilesystem -H "${fs}" > /dev/null 2>&1 > - [ "$?" -ne 0 ] && return 1 > + "${ZFS}" list -oname -tfilesystem -H "${fs}" > /dev/null 2>&1 || retur > n 1 > > # Skip filesystems with canmount=off. The root fs should not have > # canmount=off, but ignore it for backwards compatibility just in case. > @@ -333,14 +327,14 @@ mount_fs() > > # Need the _original_ datasets mountpoint! > mountpoint=$(get_fs_value "$fs" mountpoint) > - if [ "$mountpoint" = "legacy" -o "$mountpoint" = "none" ]; then > + if [ "$mountpoint" = "legacy" ] || [ "$mountpoint" = "none" ]; then > # Can't use the mountpoint property. Might be one of our > # clones. Check the 'org.zol:mountpoint' property set in > # clone_snap() if that's usable. > mountpoint=$(get_fs_value "$fs" org.zol:mountpoint) > - if [ "$mountpoint" = "legacy" -o \ > - "$mountpoint" = "none" -o \ > - "$mountpoint" = "-" ] > + if [ "$mountpoint" = "legacy" ] || > + [ "$mountpoint" = "none" ] || > + [ "$mountpoint" = "-" ] > then > if [ "$fs" != "${ZFS_BOOTFS}" ]; then > # We don't have a proper mountpoint and this > @@ -396,10 +390,10 @@ mount_fs() > # Unlock a ZFS native encrypted filesystem. > decrypt_fs() > { > - local fs="$1" > - > + fs="$1" > + > # If pool encryption is active and the zfs command understands '-o encr > yption' > - if [ "$(zpool list -H -o feature@encryption $(echo "${fs}" | awk -F\/ ' > {print $1}'))" = 'active' ]; then > + if [ "$(zpool list -H -o feature@encryption "$(echo "${fs}" | awk -F/ ' > {print $1}')")" = 'active' ]; then > > # Determine dataset that holds key for root dataset > ENCRYPTIONROOT="$(get_fs_value "${fs}" encryptionroot)" > @@ -427,7 +421,7 @@ decrypt_fs() > TRY_COUNT=$((TRY_COUNT - 1)) > done > > - # Prompt with systemd, if active > + # Prompt with systemd, if active > elif [ -e /run/systemd/system ]; then > echo "systemd-ask-password" > /run/zfs_console_ > askpwd_cmd > while [ $TRY_COUNT -gt 0 ]; do > @@ -454,7 +448,7 @@ decrypt_fs() > # Destroy a given filesystem. > destroy_fs() > { > - local fs="$1" > + fs="$1" > > [ "$quiet" != "y" ] && \ > zfs_log_begin_msg "Destroying '$fs'" > @@ -489,9 +483,9 @@ destroy_fs() > # mounted with a 'zfs mount -a' in the init/systemd scripts). > clone_snap() > { > - local snap="$1" > - local destfs="$2" > - local mountpoint="$3" > + snap="$1" > + destfs="$2" > + mountpoint="$3" > > [ "$quiet" != "y" ] && zfs_log_begin_msg "Cloning '$snap' to '$destfs'" > > @@ -529,7 +523,7 @@ clone_snap() > # Rollback a given snapshot. > rollback_snap() > { > - local snap="$1" > + snap="$1" > > [ "$quiet" != "y" ] && zfs_log_begin_msg "Rollback $snap" > > @@ -559,9 +553,8 @@ rollback_snap() > # to the user to choose from. > ask_user_snap() > { > - local fs="$1" > - local i=1 > - local SNAP snapnr snap debug > + fs="$1" > + i=1 > > # We need to temporarily disable debugging. Set 'debug' so we > # remember to enabled it again. > @@ -574,16 +567,16 @@ ask_user_snap() > # Because we need the resulting snapshot, which is sent on > # stdout to the caller, we use stderr for our questions. > echo "What snapshot do you want to boot from?" > /dev/stderr > - while read snap; do > + while read -r snap; do > echo " $i: ${snap}" > /dev/stderr > - eval `echo SNAP_$i=$snap` > + eval "$(echo SNAP_$i=$snap)" > i=$((i + 1)) > done < $("${ZFS}" list -H -oname -tsnapshot -r "${fs}") > EOT > > - echo -n " Snap nr [1-$((i-1))]? " > /dev/stderr > - read snapnr > + echo "%s" " Snap nr [1-$((i-1))]? " > /dev/stderr > + read -r snapnr > > # Re-enable debugging. > if [ -n "${debug}" ]; then > @@ -591,16 +584,16 @@ EOT > set -x > fi > > - echo "$(eval echo "$"SNAP_$snapnr)" > + echo "$(eval echo '$SNAP_'$snapnr)" > } > > setup_snapshot_booting() > { > - local snap="$1" > - local s destfs subfs mountpoint retval=0 filesystems fs > + snap="$1" > + retval=0 > > - # Make sure that the snapshot specified actually exist. > - if [ ! $(get_fs_value "${snap}" type) ] > + # Make sure that the snapshot specified actually exists. > + if [ ! "$(get_fs_value "${snap}" type)" ] > then > # Snapshot does not exist (...@ ?) > # ask the user for a snapshot to use. > @@ -617,7 +610,7 @@ setup_snapshot_booting() > then > # If the destination dataset for the clone > # already exists, destroy it. Recursively > - if [ $(get_fs_value "${rootfs}_${snapname}" type) ]; then > + if [ "$(get_fs_value "${rootfs}_${snapname}" type)" ]; then > filesystems=$("${ZFS}" list -oname -tfilesystem -H \ > -r -Sname "${ZFS_BOOTFS}") > for fs in $filesystems; do > @@ -652,8 +645,8 @@ setup_snapshot_booting() > # with clone_snap(). If legacy or none, then use > # the sub fs value. > mountpoint=$(get_fs_value "${s%%@*}" mountpoint) > - if [ "$mountpoint" = "legacy" -o \ > - "$mountpoint" = "none" ] > + if [ "$mountpoint" = "legacy" ] || \ > + [ "$mountpoint" = "none" ] > then > if [ -n "${subfs}" ]; then > mountpoint="${subfs}" > @@ -678,8 +671,6 @@ setup_snapshot_booting() > # This is the main function. > mountroot() > { > - local snaporig snapsub destfs pool POOLS > - > # ---------------------------------------------------------------- > # I N I T I A L S E T U P > > @@ -742,7 +733,7 @@ mountroot() > # No longer set in the defaults file, but it could have been set in > # get_pools() in some circumstances. If it's something, but not 'yes', > # it's no good to us. > - [ -n "$USE_DISK_BY_ID" -a "$USE_DISK_BY_ID" != 'yes' ] && \ > + [ -n "$USE_DISK_BY_ID" ] && [ "$USE_DISK_BY_ID" != 'yes' ] && \ > unset USE_DISK_BY_ID > > # ---------------------------------------------------------------- > @@ -788,12 +779,12 @@ mountroot() > # ------------ > # If we have 'ROOT' (see above), but not 'ZFS_BOOTFS', then use > # 'ROOT' > - [ -n "$ROOT" -a -z "${ZFS_BOOTFS}" ] && ZFS_BOOTFS="$ROOT" > + [ -n "$ROOT" ] && [ -z "${ZFS_BOOTFS}" ] && ZFS_BOOTFS="$ROOT" > > # ------------ > # Check for the `-B zfs-bootfs=%s/%u,...` kind of parameter. > # NOTE: Only use the pool name and dataset. The rest is not > - # supported by ZoL (whatever it's for). > + # supported by OpenZFS (whatever it's for). > if [ -z "$ZFS_RPOOL" ] > then > # The ${zfs-bootfs} variable is set at the kernel command > @@ -809,11 +800,11 @@ mountroot() > > # ------------ > # No root fs or pool specified - do auto detect. > - if [ -z "$ZFS_RPOOL" -a -z "${ZFS_BOOTFS}" ] > + if [ -z "$ZFS_RPOOL" ] && [ -z "${ZFS_BOOTFS}" ] > then > # Do auto detect. Do this by 'cheating' - set 'root=zfs:AUTO' > # which will be caught later > - ROOT=zfs:AUTO > + ROOT='zfs:AUTO' > fi > > # ---------------------------------------------------------------- > @@ -858,7 +849,7 @@ mountroot() > fi > > # Import the pool (if not already done so in the AUTO check above). > - if [ -n "$ZFS_RPOOL" -a -z "${POOL_IMPORTED}" ] > + if [ -n "$ZFS_RPOOL" ] && [ -z "${POOL_IMPORTED}" ] > then > [ "$quiet" != "y" ] && \ > zfs_log_begin_msg "Importing ZFS root pool '$ZFS_RPOOL'" > @@ -971,7 +962,7 @@ mountroot() > > touch /run/zfs_unlock_complete > if [ -e /run/zfs_unlock_complete_notify ]; then > - read zfs_unlock_complete_notify < /run/zfs_unlock_complete_noti > fy > + read -r zfs_unlock_complete_notify < /run/zfs_unlock_complete_n > otify > fi > > # ------------ > @@ -989,8 +980,8 @@ mountroot() > echo > > echo "=> waiting for ENTER before continuing because of 'zfsdeb > ug=1'. " > - echo -n " 'c' for shell, 'r' for reboot, 'ENTER' to continue. > " > - read b > + printf "%s" " 'c' for shell, 'r' for reboot, 'ENTER' to conti > nue. " > + read -r b > > [ "$b" = "c" ] && /bin/sh > [ "$b" = "r" ] && reboot -f > @@ -1000,12 +991,14 @@ mountroot() > > # ------------ > # Run local bottom script > - if type run_scripts > /dev/null 2>&1 && \ > - [ -f "/scripts/local-bottom" -o -d "/scripts/local-bottom" ] > + if command -v run_scripts > /dev/null 2>&1 > then > - [ "$quiet" != "y" ] && \ > - zfs_log_begin_msg "Running /scripts/local-bottom" > - run_scripts /scripts/local-bottom > - [ "$quiet" != "y" ] && zfs_log_end_msg > + if [ -f "/scripts/local-bottom" ] || [ -d "/scripts/local-botto > m" ] > + then > + [ "$quiet" != "y" ] && \ > + zfs_log_begin_msg "Running /scripts/local-bottom" > + run_scripts /scripts/local-bottom > + [ "$quiet" != "y" ] && zfs_log_end_msg > + fi > fi > } > > Modified: head/sys/contrib/openzfs/include/os/freebsd/spl/sys/kstat.h > ============================================================================= > = > --- head/sys/contrib/openzfs/include/os/freebsd/spl/sys/kstat.h Thu Oct > 1 23:11:58 2020 (r366349) > +++ head/sys/contrib/openzfs/include/os/freebsd/spl/sys/kstat.h Thu Oct > 1 23:28:21 2020 (r366350) > @@ -83,6 +83,14 @@ typedef struct kstat_s kstat_t; > typedef int kid_t; /* unique kstat id */ > typedef int kstat_update_t(struct kstat_s *, int); /* dynamic update cb */ > > +struct seq_file { > + char *sf_buf; > + size_t sf_size; > +}; > + > +void seq_printf(struct seq_file *m, const char *fmt, ...); > + > + > typedef struct kstat_module { > char ksm_name[KSTAT_STRLEN+1]; /* module name */ > struct list_head ksm_module_list; /* module linkage */ > @@ -92,6 +100,7 @@ typedef struct kstat_module { > > typedef struct kstat_raw_ops { > int (*headers)(char *buf, size_t size); > + int (*seq_headers)(struct seq_file *); > int (*data)(char *buf, size_t size, void *data); > void *(*addr)(kstat_t *ksp, loff_t index); > } kstat_raw_ops_t; > @@ -112,6 +121,7 @@ struct kstat_s { > size_t ks_data_size; /* size of kstat data section * > / > kstat_update_t *ks_update; /* dynamic updates */ > void *ks_private; /* private data */ > + void *ks_private1; /* private data */ > kmutex_t ks_private_lock; /* kstat private data lock */ > kmutex_t *ks_lock; /* kstat data lock */ > struct list_head ks_list; /* kstat linkage */ > @@ -185,6 +195,12 @@ extern void __kstat_set_raw_ops(kstat_t *ksp, > int (*data)(char *buf, size_t size, void *data), > void* (*addr)(kstat_t *ksp, loff_t index)); > > +extern void __kstat_set_seq_raw_ops(kstat_t *ksp, > + int (*headers)(struct seq_file *), > + int (*data)(char *buf, size_t size, void *data), > + void* (*addr)(kstat_t *ksp, loff_t index)); > + > + > extern kstat_t *__kstat_create(const char *ks_module, int ks_instance, > const char *ks_name, const char *ks_class, uchar_t ks_type, > uint_t ks_ndata, uchar_t ks_flags); > @@ -196,6 +212,8 @@ extern void kstat_waitq_exit(kstat_io_t *); > extern void kstat_runq_enter(kstat_io_t *); > extern void kstat_runq_exit(kstat_io_t *); > > +#define kstat_set_seq_raw_ops(k, h, d, a) \ > + __kstat_set_seq_raw_ops(k, h, d, a) > #define kstat_set_raw_ops(k, h, d, a) \ > __kstat_set_raw_ops(k, h, d, a) > #define kstat_create(m, i, n, c, t, s, f) \ > > Modified: head/sys/contrib/openzfs/include/os/freebsd/spl/sys/procfs_list.h > ============================================================================= > = > --- head/sys/contrib/openzfs/include/os/freebsd/spl/sys/procfs_list.h Thu Oct > 1 23:11:58 2020 (r366349) > +++ head/sys/contrib/openzfs/include/os/freebsd/spl/sys/procfs_list.h Thu Oct > 1 23:28:21 2020 (r366350) > @@ -33,16 +33,18 @@ > * procfs list manipulation > */ > > -struct seq_file { }; > -void seq_printf(struct seq_file *m, const char *fmt, ...); > - > -typedef struct procfs_list { > +typedef struct procfs_list procfs_list_t; > +struct procfs_list { > void *pl_private; > + void *pl_next_data; > kmutex_t pl_lock; > list_t pl_list; > uint64_t pl_next_id; > + int (*pl_show)(struct seq_file *f, void *p); > + int (*pl_show_header)(struct seq_file *f); > + int (*pl_clear)(procfs_list_t *procfs_list); > size_t pl_node_offset; > -} procfs_list_t; > +}; > > typedef struct procfs_list_node { > list_node_t pln_link; > @@ -50,6 +52,7 @@ typedef struct procfs_list_node { > } procfs_list_node_t; > > void procfs_list_install(const char *module, > + const char *submodule, > const char *name, > mode_t mode, > procfs_list_t *procfs_list, > > Modified: head/sys/contrib/openzfs/include/os/freebsd/spl/sys/simd_x86.h > ============================================================================= > = > --- head/sys/contrib/openzfs/include/os/freebsd/spl/sys/simd_x86.h Thu Oct > 1 23:11:58 2020 (r366349) > +++ head/sys/contrib/openzfs/include/os/freebsd/spl/sys/simd_x86.h Thu Oct > 1 23:28:21 2020 (r366350) > @@ -29,6 +29,7 @@ > #include > #include > #include > +#include > #ifdef __i386__ > #include > #else > @@ -42,16 +43,15 @@ > #define kfpu_allowed() 1 > #define kfpu_initialize(tsk) do {} while (0) > > -#define kfpu_begin() { > \ > - critical_enter(); \ > - fpu_kern_enter(curthread, NULL, FPU_KERN_NOCTX); \ > +#define kfpu_begin() { \ > + if (__predict_false(!is_fpu_kern_thread(0))) \ > + fpu_kern_enter(curthread, NULL, FPU_KERN_NOCTX);\ > } > > -#define kfpu_end() \ > - { \ > - fpu_kern_leave(curthread, NULL); \ > - critical_exit(); \ > - } > +#define kfpu_end() { \ > + if (__predict_false(curpcb->pcb_flags & PCB_FPUNOSAVE)) \ > + fpu_kern_leave(curthread, NULL); \ > +} > > /* > * Check if OS supports AVX and AVX2 by checking XCR0 > > Modified: head/sys/contrib/openzfs/include/os/linux/spl/sys/procfs_list.h > ============================================================================= > = > --- head/sys/contrib/openzfs/include/os/linux/spl/sys/procfs_list.h Thu Oct > 1 23:11:58 2020 (r366349) > +++ head/sys/contrib/openzfs/include/os/linux/spl/sys/procfs_list.h Thu Oct > 1 23:28:21 2020 (r366350) > @@ -57,6 +57,7 @@ typedef struct procfs_list_node { > } procfs_list_node_t; > > void procfs_list_install(const char *module, > + const char *submodule, > const char *name, > mode_t mode, > procfs_list_t *procfs_list, > > Modified: head/sys/contrib/openzfs/include/sys/frame.h > ============================================================================= > = > --- head/sys/contrib/openzfs/include/sys/frame.h Thu Oct 1 23:11:58 202 > 0 (r366349) > +++ head/sys/contrib/openzfs/include/sys/frame.h Thu Oct 1 23:28:21 202 > 0 (r366350) > @@ -23,7 +23,8 @@ > extern "C" { > #endif > > -#if defined(__KERNEL__) && defined(HAVE_STACK_FRAME_NON_STANDARD) > +#if defined(__KERNEL__) && defined(HAVE_KERNEL_OBJTOOL) && \ > + defined(HAVE_STACK_FRAME_NON_STANDARD) > #include > #else > #define STACK_FRAME_NON_STANDARD(func) > > Modified: head/sys/contrib/openzfs/include/sys/lua/luaconf.h > ============================================================================= > = > --- head/sys/contrib/openzfs/include/sys/lua/luaconf.h Thu Oct 1 23:1 > 1:58 2020 (r366349) > +++ head/sys/contrib/openzfs/include/sys/lua/luaconf.h Thu Oct 1 23:2 > 8:21 2020 (r366350) > @@ -368,11 +368,7 @@ extern int lcompat_hashnum(int64_t); > @@ LUAL_BUFFERSIZE is the buffer size used by the lauxlib buffer system. > ** CHANGE it if it uses too much C-stack space. > */ > -#ifdef __linux__ > #define LUAL_BUFFERSIZE 512 > -#else > -#define LUAL_BUFFERSIZE 1024 > -#endif > > > /* > > Modified: head/sys/contrib/openzfs/include/sys/zfs_context.h > ============================================================================= > = > --- head/sys/contrib/openzfs/include/sys/zfs_context.h Thu Oct 1 23:1 > 1:58 2020 (r366349) > +++ head/sys/contrib/openzfs/include/sys/zfs_context.h Thu Oct 1 23:2 > 8:21 2020 (r366350) > @@ -386,6 +386,7 @@ typedef struct procfs_list_node { > } procfs_list_node_t; > > void procfs_list_install(const char *module, > + const char *submodule, > const char *name, > mode_t mode, > procfs_list_t *procfs_list, > > Modified: head/sys/contrib/openzfs/include/sys/zstd/zstd.h > ============================================================================= > = > --- head/sys/contrib/openzfs/include/sys/zstd/zstd.h Thu Oct 1 23:11:58 202 > 0 (r366349) > +++ head/sys/contrib/openzfs/include/sys/zstd/zstd.h Thu Oct 1 23:28:21 202 > 0 (r366350) > @@ -90,6 +90,7 @@ int zfs_zstd_decompress_level(void *s_start, void *d_s > size_t d_len, uint8_t *level); > int zfs_zstd_decompress(void *s_start, void *d_start, size_t s_len, > size_t d_len, int n); > +void zfs_zstd_cache_reap_now(void); > > #ifdef __cplusplus > } > > Modified: head/sys/contrib/openzfs/lib/libshare/os/freebsd/nfs.c > ============================================================================= > = > --- head/sys/contrib/openzfs/lib/libshare/os/freebsd/nfs.c Thu Oct 1 23:1 > 1:58 2020 (r366349) > +++ head/sys/contrib/openzfs/lib/libshare/os/freebsd/nfs.c Thu Oct 1 23:2 > 8:21 2020 (r366350) > @@ -228,21 +228,33 @@ nfs_copy_entries(char *filename, const char *mountpoin > int error = SA_OK; > char *line; > > - /* > - * If the file doesn't exist then there is nothing more > - * we need to do. > - */ > FILE *oldfp = fopen(ZFS_EXPORTS_FILE, "r"); > - if (oldfp == NULL) > - return (SA_OK); > - > FILE *newfp = fopen(filename, "w+"); > + if (newfp == NULL) { > + fprintf(stderr, "failed to open %s file: %s", filename, > + strerror(errno)); > + fclose(oldfp); > + return (SA_SYSTEM_ERR); > + } > fputs(FILE_HEADER, newfp); > - while ((line = zgetline(oldfp, mountpoint)) != NULL) > - fprintf(newfp, "%s\n", line); > - if (ferror(oldfp) != 0) { > - error = ferror(oldfp); > + > + /* > + * The ZFS_EXPORTS_FILE may not exist yet. If that's the > + * case then just write out the new file. > + */ > + if (oldfp != NULL) { > + while ((line = zgetline(oldfp, mountpoint)) != NULL) > + fprintf(newfp, "%s\n", line); > + if (ferror(oldfp) != 0) { > + error = ferror(oldfp); > + } > + if (fclose(oldfp) != 0) { > + fprintf(stderr, "Unable to close file %s: %s\n", > + filename, strerror(errno)); > + error = error != 0 ? error : SA_SYSTEM_ERR; > + } > } > + > if (error == 0 && ferror(newfp) != 0) { > error = ferror(newfp); > } > @@ -252,8 +264,6 @@ nfs_copy_entries(char *filename, const char *mountpoin > filename, strerror(errno)); > error = error != 0 ? error : SA_SYSTEM_ERR; > } > - fclose(oldfp); > - > return (error); > } > > > Modified: head/sys/contrib/openzfs/lib/libshare/os/linux/nfs.c > ============================================================================= > = > --- head/sys/contrib/openzfs/lib/libshare/os/linux/nfs.c Thu Oct 1 23:1 > 1:58 2020 (r366349) > +++ head/sys/contrib/openzfs/lib/libshare/os/linux/nfs.c Thu Oct 1 23:2 > 8:21 2020 (r366350) > @@ -393,7 +393,15 @@ static char * > nfs_init_tmpfile(void) > { > char *tmpfile = NULL; > + struct stat sb; > > + if (stat(ZFS_EXPORTS_DIR, &sb) < 0 && > + mkdir(ZFS_EXPORTS_DIR, 0755) < 0) { > + fprintf(stderr, "failed to create %s: %s\n", > + ZFS_EXPORTS_DIR, strerror(errno)); > + return (NULL); > + } > + > if (asprintf(&tmpfile, "%s%s", ZFS_EXPORTS_FILE, ".XXXXXXXX") == -1) { > fprintf(stderr, "Unable to allocate temporary file\n"); > return (NULL); > @@ -481,36 +489,49 @@ nfs_copy_entries(char *filename, const char *mountpoin > size_t buflen = 0; > int error = SA_OK; > > - /* > - * If the file doesn't exist then there is nothing more > - * we need to do. > - */ > FILE *oldfp = fopen(ZFS_EXPORTS_FILE, "r"); > - if (oldfp == NULL) > - return (SA_OK); > - > FILE *newfp = fopen(filename, "w+"); > + if (newfp == NULL) { > + fprintf(stderr, "failed to open %s file: %s", filename, > + strerror(errno)); > + fclose(oldfp); > + return (SA_SYSTEM_ERR); > + } > fputs(FILE_HEADER, newfp); > - while ((getline(&buf, &buflen, oldfp)) != -1) { > - char *space = NULL; > > - if (buf[0] == '\n' || buf[0] == '#') > - continue; > + /* > + * The ZFS_EXPORTS_FILE may not exist yet. If that's the > + * case then just write out the new file. > + */ > + if (oldfp != NULL) { > + while (getline(&buf, &buflen, oldfp) != -1) { > + char *space = NULL; > > - if ((space = strchr(buf, ' ')) != NULL) { > - int mountpoint_len = strlen(mountpoint); > - > - if (space - buf == mountpoint_len && > - strncmp(mountpoint, buf, mountpoint_len) == 0) { > + if (buf[0] == '\n' || buf[0] == '#') > continue; > + > + if ((space = strchr(buf, ' ')) != NULL) { > + int mountpoint_len = strlen(mountpoint); > + > + if (space - buf == mountpoint_len && > + strncmp(mountpoint, buf, > + mountpoint_len) == 0) { > + continue; > + } > } > + fputs(buf, newfp); > } > - fputs(buf, newfp); > - } > > - if (oldfp != NULL && ferror(oldfp) != 0) { > - error = ferror(oldfp); > + if (ferror(oldfp) != 0) { > + error = ferror(oldfp); > + } > + if (fclose(oldfp) != 0) { > + fprintf(stderr, "Unable to close file %s: %s\n", > + filename, strerror(errno)); > + error = error != 0 ? error : SA_SYSTEM_ERR; > + } > } > + > if (error == 0 && ferror(newfp) != 0) { > error = ferror(newfp); > } > @@ -521,8 +542,6 @@ nfs_copy_entries(char *filename, const char *mountpoin > filename, strerror(errno)); > error = error != 0 ? error : SA_SYSTEM_ERR; > } > - fclose(oldfp); > - > return (error); > } > > @@ -701,13 +720,5 @@ static const sa_share_ops_t nfs_shareops = { > void > libshare_nfs_init(void) > { > - struct stat sb; > - > nfs_fstype = register_fstype("nfs", &nfs_shareops); > - > - if (stat(ZFS_EXPORTS_DIR, &sb) < 0 && > - mkdir(ZFS_EXPORTS_DIR, 0755) < 0) { > - fprintf(stderr, "failed to create %s: %s\n", > - ZFS_EXPORTS_DIR, strerror(errno)); > - } > } > > Modified: head/sys/contrib/openzfs/lib/libzpool/kernel.c > ============================================================================= > = > --- head/sys/contrib/openzfs/lib/libzpool/kernel.c Thu Oct 1 23:11:58 202 > 0 (r366349) > +++ head/sys/contrib/openzfs/lib/libzpool/kernel.c Thu Oct 1 23:28:21 202 > 0 (r366350) > @@ -444,6 +444,7 @@ seq_printf(struct seq_file *m, const char *fmt, ...) > > void > procfs_list_install(const char *module, > + const char *submodule, > const char *name, > mode_t mode, > procfs_list_t *procfs_list, > > Modified: head/sys/contrib/openzfs/man/man8/zfs-userspace.8 > ============================================================================= > = > --- head/sys/contrib/openzfs/man/man8/zfs-userspace.8 Thu Oct 1 23:11:58 202 > 0 (r366349) > +++ head/sys/contrib/openzfs/man/man8/zfs-userspace.8 Thu Oct 1 23:28:21 202 > 0 (r366350) > @@ -44,7 +44,7 @@ > .Oo Fl s Ar field Oc Ns ... > .Oo Fl S Ar field Oc Ns ... > .Oo Fl t Ar type Ns Oo , Ns Ar type Oc Ns ... Oc > -.Ar filesystem Ns | Ns Ar snapshot > +.Ar filesystem Ns | Ns Ar snapshot Ns | Ns Ar path > .Nm > .Cm groupspace > .Op Fl Hinp > @@ -52,14 +52,14 @@ > .Oo Fl s Ar field Oc Ns ... > .Oo Fl S Ar field Oc Ns ... > .Oo Fl t Ar type Ns Oo , Ns Ar type Oc Ns ... Oc > -.Ar filesystem Ns | Ns Ar snapshot > +.Ar filesystem Ns | Ns Ar snapshot Ns | Ns Ar path > .Nm > .Cm projectspace > .Op Fl Hp > .Oo Fl o Ar field Ns Oo , Ns Ar field Oc Ns ... Oc > .Oo Fl s Ar field Oc Ns ... > .Oo Fl S Ar field Oc Ns ... > -.Ar filesystem Ns | Ns Ar snapshot > +.Ar filesystem Ns | Ns Ar snapshot Ns | Ns Ar path > .Sh DESCRIPTION > .Bl -tag -width "" > .It Xo > @@ -70,10 +70,11 @@ > .Oo Fl s Ar field Oc Ns ... > .Oo Fl S Ar field Oc Ns ... > .Oo Fl t Ar type Ns Oo , Ns Ar type Oc Ns ... Oc > -.Ar filesystem Ns | Ns Ar snapshot > +.Ar filesystem Ns | Ns Ar snapshot Ns | Ns Ar path > .Xc > -Displays space consumed by, and quotas on, each user in the specified filesy > stem > -or snapshot. > +Displays space consumed by, and quotas on, each user in the specified filesy > stem, > +snapshot, or path. > +If a path is given, the filesystem that contains that path will be used. > This corresponds to the > .Sy userused@ Ns Em user , > .Sy userobjused@ Ns Em user , > @@ -167,7 +168,7 @@ except that the default types to display are > .Oo Fl o Ar field Ns Oo , Ns Ar field Oc Ns ... Oc > .Oo Fl s Ar field Oc Ns ... > .Oo Fl S Ar field Oc Ns ... > -.Ar filesystem Ns | Ns Ar snapshot > +.Ar filesystem Ns | Ns Ar snapshot Ns | Ns Ar path > .Xc > Displays space consumed by, and quotas on, each project in the specified > filesystem or snapshot. This subcommand is identical to > > Modified: head/sys/contrib/openzfs/man/man8/zpool-remove.8 > ============================================================================= > = > --- head/sys/contrib/openzfs/man/man8/zpool-remove.8 Thu Oct 1 23:11:58 202 > 0 (r366349) > +++ head/sys/contrib/openzfs/man/man8/zpool-remove.8 Thu Oct 1 23:28:21 202 > 0 (r366350) > @@ -55,6 +55,8 @@ This command supports removing hot spare, cache, log, > non-redundant primary top-level vdevs, including dedup and special vdevs. > When the primary pool storage includes a top-level raidz vdev only hot spare > , > cache, and log devices can be removed. > +Note that keys for all encrypted datasets must be loaded for top-level vdevs > +to be removed. > .sp > Removing a top-level vdev reduces the total amount of space in the storage p > ool. > The specified device will be evacuated by copying all allocated space from i > t to > > Modified: head/sys/contrib/openzfs/module/lua/llimits.h > ============================================================================= > = > --- head/sys/contrib/openzfs/module/lua/llimits.h Thu Oct 1 23:11:58 202 > 0 (r366349) > +++ head/sys/contrib/openzfs/module/lua/llimits.h Thu Oct 1 23:28:21 202 > 0 (r366350) > @@ -126,16 +126,7 @@ typedef LUAI_UACNUMBER l_uacNumber; > * Minimum amount of available stack space (in bytes) to make a C call. Wit > h > * gsub() recursion, the stack space between each luaD_call() is 1256 bytes. > */ > -#if defined(__FreeBSD__) > -/* > - * FreeBSD needs a few extra bytes in unoptimized debug builds to avoid a > - * double-fault handling the error when the max call depth is exceeded just > - * before the C stack runs out. 64 bytes seems to do the trick. > - */ > -#define LUAI_MINCSTACK 4160 > -#else > #define LUAI_MINCSTACK 4096 > -#endif > > /* > ** maximum number of upvalues in a closure (both C and Lua). (Value > > Modified: head/sys/contrib/openzfs/module/os/freebsd/spl/spl_kstat.c > ============================================================================= > = > --- head/sys/contrib/openzfs/module/os/freebsd/spl/spl_kstat.c Thu Oct > 1 23:11:58 2020 (r366349) > +++ head/sys/contrib/openzfs/module/os/freebsd/spl/spl_kstat.c Thu Oct > 1 23:28:21 2020 (r366350) > @@ -55,6 +55,17 @@ __kstat_set_raw_ops(kstat_t *ksp, > ksp->ks_raw_ops.addr = addr; > } > > +void > +__kstat_set_seq_raw_ops(kstat_t *ksp, > + int (*headers)(struct seq_file *f), > + int (*data)(char *buf, size_t size, void *data), > + void *(*addr)(kstat_t *ksp, loff_t index)) > +{ > + ksp->ks_raw_ops.seq_headers = headers; > + ksp->ks_raw_ops.data = data; > + ksp->ks_raw_ops.addr = addr; > +} > + > static int > kstat_default_update(kstat_t *ksp, int rw) > { > @@ -160,7 +171,7 @@ kstat_sysctl_raw(SYSCTL_HANDLER_ARGS) > void *data; > kstat_t *ksp = arg1; > void *(*addr_op)(kstat_t *ksp, loff_t index); > - int n, rc = 0; > + int n, has_header, rc = 0; > > sb = sbuf_new_auto(); > if (sb == NULL) > > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** > From owner-svn-src-all@freebsd.org Fri Oct 2 00:52:31 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C160B3F0CBF; Fri, 2 Oct 2020 00:52:31 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2Wg34mjDz3g4s; Fri, 2 Oct 2020 00:52:31 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8713F19DCA; Fri, 2 Oct 2020 00:52:31 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0920qV41041662; Fri, 2 Oct 2020 00:52:31 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0920qVGP041661; Fri, 2 Oct 2020 00:52:31 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <202010020052.0920qVGP041661@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Fri, 2 Oct 2020 00:52:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366351 - head/contrib/netbsd-tests/fs X-SVN-Group: head X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: head/contrib/netbsd-tests/fs X-SVN-Commit-Revision: 366351 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Oct 2020 00:52:31 -0000 Author: mhorne Date: Fri Oct 2 00:52:31 2020 New Revision: 366351 URL: https://svnweb.freebsd.org/changeset/base/366351 Log: tmpfs tests: check for built-in tmpfs module As of r363471, tmpfs is included in all GENERIC kernel configs. This results in a warning being emitted for each call to kldload(8): module_register: cannot register tmpfs from tmpfs.ko; already loaded from kernel Check for the presence of the module via kldstat first to quiet this warning. Reviewed by: asomers, arichardson Differential Revision: https://reviews.freebsd.org/D26632 Modified: head/contrib/netbsd-tests/fs/h_funcs.subr Modified: head/contrib/netbsd-tests/fs/h_funcs.subr ============================================================================== --- head/contrib/netbsd-tests/fs/h_funcs.subr Thu Oct 1 23:28:21 2020 (r366350) +++ head/contrib/netbsd-tests/fs/h_funcs.subr Fri Oct 2 00:52:31 2020 (r366351) @@ -45,7 +45,7 @@ require_fs() { # Begin FreeBSD if true; then - if kldload -n ${name}; then + if kldstat -qm ${name} || kldload -n ${name}; then found=yes else found=no From owner-svn-src-all@freebsd.org Fri Oct 2 01:08:11 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BE4243F101D; Fri, 2 Oct 2020 01:08:11 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2X174gZwz3gT2; Fri, 2 Oct 2020 01:08:11 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 83D5D199CE; Fri, 2 Oct 2020 01:08:11 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09218B3Z047844; Fri, 2 Oct 2020 01:08:11 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09218BuG047843; Fri, 2 Oct 2020 01:08:11 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <202010020108.09218BuG047843@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 2 Oct 2020 01:08:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r366352 - releng/12.2/sys/conf X-SVN-Group: releng X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: releng/12.2/sys/conf X-SVN-Commit-Revision: 366352 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Oct 2020 01:08:11 -0000 Author: gjb Date: Fri Oct 2 01:08:11 2020 New Revision: 366352 URL: https://svnweb.freebsd.org/changeset/base/366352 Log: Rename releng/12.2 to RC1 as part of the 12.2-RELEASE cycle. Approved by: re (implicit) Sponsored by: Rubicon Communications, LLC (netgate.com) Modified: releng/12.2/sys/conf/newvers.sh Modified: releng/12.2/sys/conf/newvers.sh ============================================================================== --- releng/12.2/sys/conf/newvers.sh Fri Oct 2 00:52:31 2020 (r366351) +++ releng/12.2/sys/conf/newvers.sh Fri Oct 2 01:08:11 2020 (r366352) @@ -49,7 +49,7 @@ TYPE="FreeBSD" REVISION="12.2" -BRANCH="BETA3" +BRANCH="RC1" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-all@freebsd.org Fri Oct 2 01:18:24 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6E5293F1429; Fri, 2 Oct 2020 01:18:24 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: from mail-qv1-f47.google.com (mail-qv1-f47.google.com [209.85.219.47]) (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 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2XDw057Jz3xwF; Fri, 2 Oct 2020 01:18:23 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: by mail-qv1-f47.google.com with SMTP id h1so574041qvo.9; Thu, 01 Oct 2020 18:18:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=cE6iu62sJxzfEwMjKi66gsfH/tjsLUY/LrvKpIBoLOw=; b=BArDW+wqThduFuHGG4c+XcfHSYKed6r4Y9EoRdTSOT7G7RmjRkQJZSg3OVuNl0ttvD DnLW8kAT1Hq/+4tuD1Hds/nSHb0oAl+BOU8tAFAP6YIQE2qnGwXIqyF6kR1q/q01yKiM wxT0b9fLPWTNEmneZqocwD3DKcI038jZclFIdbRpTtzU2dHoZvengOyvhH+0WXOBCim9 4tRPz3sg3R1+eXoBVfi/TWFN1jmhyi9Fha1jIUelTe4CqWagQPuthbIwxyRnRiKczBap 9jm51k14jLopueTidph+DfTnjZiCufufXVz2ym1hnqXHR56678rl+b9U6uw+SpnbEido JKKw== X-Gm-Message-State: AOAM5317Irm6l7eTOqBCmzSHafeMgAQtTBnc6N/Pc3LyYG0nAhfSNxDd OiHHeVmS/UYqFnzboRWCSfS5l37vsSM= X-Google-Smtp-Source: ABdhPJwyKeqNoaCRLz4p2KKcKI9+pJhTvGN2vXb66FlqwO8H7LSmofxMsRKfJUbVXd7Z1OhWC7oRqg== X-Received: by 2002:a0c:a162:: with SMTP id d89mr10874128qva.28.1601601502724; Thu, 01 Oct 2020 18:18:22 -0700 (PDT) Received: from mail-qt1-f179.google.com (mail-qt1-f179.google.com. [209.85.160.179]) by smtp.gmail.com with ESMTPSA id 7sm46638qkh.60.2020.10.01.18.18.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 01 Oct 2020 18:18:22 -0700 (PDT) Received: by mail-qt1-f179.google.com with SMTP id d1so1104461qtr.6; Thu, 01 Oct 2020 18:18:22 -0700 (PDT) X-Received: by 2002:ac8:3f3d:: with SMTP id c58mr101107qtk.53.1601601502031; Thu, 01 Oct 2020 18:18:22 -0700 (PDT) MIME-Version: 1.0 References: <202010012105.091L5pAn099334@repo.freebsd.org> In-Reply-To: <202010012105.091L5pAn099334@repo.freebsd.org> From: Kyle Evans Date: Thu, 1 Oct 2020 20:18:11 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r366344 - in head: lib/libmd sys/crypto/skein/amd64 To: Ed Maste Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4C2XDw057Jz3xwF X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; TAGGED_FROM(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Oct 2020 01:18:24 -0000 On Thu, Oct 1, 2020 at 4:06 PM Ed Maste wrote: > > Author: emaste > Date: Thu Oct 1 21:05:50 2020 > New Revision: 366344 > URL: https://svnweb.freebsd.org/changeset/base/366344 > > Log: > libmd: fix assembly optimized skein implementation > > The assembly implementation incorrectly used logical AND instead of > bitwise AND. Fix, and re-enable in libmd. > > Submitted by: Yang Zhong > Reviewed by: cem (earlier) > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D26614 > > Modified: > head/lib/libmd/Makefile > head/sys/crypto/skein/amd64/skein_block_asm.S > > Modified: head/lib/libmd/Makefile > ============================================================================== > --- head/lib/libmd/Makefile Thu Oct 1 20:08:27 2020 (r366343) > +++ head/lib/libmd/Makefile Thu Oct 1 21:05:50 2020 (r366344) > @@ -116,12 +116,12 @@ CFLAGS+= -DSHA1_ASM > SRCS+= rmd160.S > CFLAGS+= -DRMD160_ASM > .endif > -#.if exists(${MACHINE_ARCH}/skein_block_asm.S) > -## Fully unroll all loops in the assembly optimized version > -#ACFLAGS+= -DSKEIN_LOOP=0 > -#SRCS+= skein_block_asm.S > -#CFLAGS+= -DSKEIN_ASM -DSKEIN_USE_ASM=1792 # list of block functions to replace with assembly: 256+512+1024 = 1792 > -#.endif > +.if exists(${MACHINE_ARCH}/skein_block_asm.S) > +# Fully unroll all loops in the assembly optimized version > +ACFLAGS+= -DSKEIN_LOOP=0 > +SRCS+= skein_block_asm.S > +CFLAGS+= -DSKEIN_ASM -DSKEIN_USE_ASM=1792 # list of block functions to replace with assembly: 256+512+1024 = 1792 > +.endif > .if exists(${MACHINE_ARCH}/sha.S) || exists(${MACHINE_ARCH}/rmd160.S) || exists(${MACHINE_ARCH}/skein_block_asm.S) > ACFLAGS+= -DELF -Wa,--noexecstack > .endif > We need some kind of magic to walk across this for -DNO_CLEAN builds -- skein_block.c has no reason to get rebuilt, but we need it to because we're now defining SKEIN_USE_ASM=1792, which will strip out some symbols. I haven't had time to look into what kind of magic we can apply here, kind of needed to skip ahead to get this build finished for some other testing. Thanks, Kyle Evans From owner-svn-src-all@freebsd.org Fri Oct 2 01:23:55 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 379243F18A1; Fri, 2 Oct 2020 01:23:55 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.139]) (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 4C2XMF6jBLz3y0p; Fri, 2 Oct 2020 01:23:53 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id O9nak5eGoHxtDO9nbkOUjV; Thu, 01 Oct 2020 19:23:52 -0600 X-Authority-Analysis: v=2.4 cv=Ce22WJnl c=1 sm=1 tr=0 ts=5f768128 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=xqWC_Br6kY4A:10 a=kj9zAlcOel0A:10 a=afefHYAZSVUA:10 a=6I5d2MoRAAAA:8 a=IP17e_1XAAAA:8 a=YxBL1-UpAAAA:8 a=EkcXrb_YAAAA:8 a=qBuU5bC0W9aZ4l6sTV8A:9 a=CjuIK1q_8ugA:10 a=71KNwuU-lXsA:10 a=DoawHyg_QpkA:10 a=-RoEEKskQ1sA:10 a=IjZwj45LgO3ly-622nXo:22 a=pIDkZDmBs-rV6VORH8mB:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [IPv6:fc00:1:1:1::5b]) by spqr.komquats.com (Postfix) with ESMTPS id B15E4108; Thu, 1 Oct 2020 18:23:49 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.16.1/8.16.1) with ESMTP id 0921NnJU006207; Thu, 1 Oct 2020 18:23:49 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <202010020123.0921NnJU006207@slippy.cwsent.com> X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Kyle Evans cc: Ed Maste , src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r366344 - in head: lib/libmd sys/crypto/skein/amd64 In-reply-to: References: <202010012105.091L5pAn099334@repo.freebsd.org> Comments: In-reply-to Kyle Evans message dated "Thu, 01 Oct 2020 20:18:11 -0500." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 01 Oct 2020 18:23:49 -0700 X-CMAE-Envelope: MS4xfLc4qTtp8y8AXOq0F9SOfUAQd5gY66TpR7Kc4HB4LpDOxq8HNFoNbjZhMBxP1Y8XmPk+T17HZpztzmWU4Y64lkF3++IGHKY/sEIWQVBHdJirIKrm45hg b4he6sl5FjhBSglzjdEBYvCUNcTl2gs9oGU2gUPX5cQzAD5JDJvCjXW2lJVEch/dZLx6ZV0koaEGJHk3a8r1pycloFo8VFrKs8M4vnBk4NuaUQspF0jRQc2d Uk+oQnx6GpZDZqH+MkuLeXYonoa+PN79ec4VnnGGjpWu1/uwL/yINdCx9dool9dNCZb+LYC4P3A7XcyQO/WQAlkzPkO/C1VnsRJh8LoqbeE= X-Rspamd-Queue-Id: 4C2XMF6jBLz3y0p X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of cy.schubert@cschubert.com has no SPF policy when checking 64.59.136.139) smtp.mailfrom=cy.schubert@cschubert.com X-Spamd-Result: default: False [0.07 / 15.00]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; RCVD_VIA_SMTP_AUTH(0.00)[]; REPLYTO_EQ_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; MV_CASE(0.50)[]; NEURAL_HAM_LONG(-0.34)[-0.336]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[cschubert.com: no valid DMARC record]; ARC_NA(0.00)[]; AUTH_NA(1.00)[]; RCPT_COUNT_FIVE(0.00)[5]; NEURAL_HAM_MEDIUM(-0.41)[-0.415]; RCVD_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; NEURAL_HAM_SHORT(-0.48)[-0.476]; RECEIVED_SPAMHAUS_PBL(0.00)[70.67.125.17:received]; R_SPF_NA(0.00)[no SPF record]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; RCVD_TLS_LAST(0.00)[]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head]; RCVD_IN_DNSWL_LOW(-0.10)[64.59.136.139:from] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Oct 2020 01:23:55 -0000 In message , Kyle Evans writes: > On Thu, Oct 1, 2020 at 4:06 PM Ed Maste wrote: > > > > Author: emaste > > Date: Thu Oct 1 21:05:50 2020 > > New Revision: 366344 > > URL: https://svnweb.freebsd.org/changeset/base/366344 > > > > Log: > > libmd: fix assembly optimized skein implementation > > > > The assembly implementation incorrectly used logical AND instead of > > bitwise AND. Fix, and re-enable in libmd. > > > > Submitted by: Yang Zhong > > Reviewed by: cem (earlier) > > Sponsored by: The FreeBSD Foundation > > Differential Revision: https://reviews.freebsd.org/D26614 > > > > Modified: > > head/lib/libmd/Makefile > > head/sys/crypto/skein/amd64/skein_block_asm.S > > > > Modified: head/lib/libmd/Makefile > > =========================================================================== > === > > --- head/lib/libmd/Makefile Thu Oct 1 20:08:27 2020 (r366343) > > +++ head/lib/libmd/Makefile Thu Oct 1 21:05:50 2020 (r366344) > > @@ -116,12 +116,12 @@ CFLAGS+= -DSHA1_ASM > > SRCS+= rmd160.S > > CFLAGS+= -DRMD160_ASM > > .endif > > -#.if exists(${MACHINE_ARCH}/skein_block_asm.S) > > -## Fully unroll all loops in the assembly optimized version > > -#ACFLAGS+= -DSKEIN_LOOP=0 > > -#SRCS+= skein_block_asm.S > > -#CFLAGS+= -DSKEIN_ASM -DSKEIN_USE_ASM=1792 # list of block functions to re > place with assembly: 256+512+1024 = 1792 > > -#.endif > > +.if exists(${MACHINE_ARCH}/skein_block_asm.S) > > +# Fully unroll all loops in the assembly optimized version > > +ACFLAGS+= -DSKEIN_LOOP=0 > > +SRCS+= skein_block_asm.S > > +CFLAGS+= -DSKEIN_ASM -DSKEIN_USE_ASM=1792 # list of block functions to rep > lace with assembly: 256+512+1024 = 1792 > > +.endif > > .if exists(${MACHINE_ARCH}/sha.S) || exists(${MACHINE_ARCH}/rmd160.S) || e > xists(${MACHINE_ARCH}/skein_block_asm.S) > > ACFLAGS+= -DELF -Wa,--noexecstack > > .endif > > > > We need some kind of magic to walk across this for -DNO_CLEAN builds > -- skein_block.c has no reason to get rebuilt, but we need it to > because we're now defining SKEIN_USE_ASM=1792, which will strip out > some symbols. > > I haven't had time to look into what kind of magic we can apply here, > kind of needed to skip ahead to get this build finished for some other > testing. I did rm -r for .../lib/libmd. Strangely it only failed in the amd64 build. Not in i386. -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org The need of the many outweighs the greed of the few. From owner-svn-src-all@freebsd.org Fri Oct 2 01:25:08 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D17723F189C; Fri, 2 Oct 2020 01:25:08 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2XNh59lbz3yM7; Fri, 2 Oct 2020 01:25:08 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 91EB51A229; Fri, 2 Oct 2020 01:25:08 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0921P8D9060201; Fri, 2 Oct 2020 01:25:08 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0921P8RP060200; Fri, 2 Oct 2020 01:25:08 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <202010020125.0921P8RP060200@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Fri, 2 Oct 2020 01:25:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366353 - head/sys/contrib/openzfs/module/os/freebsd/spl X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/contrib/openzfs/module/os/freebsd/spl X-SVN-Commit-Revision: 366353 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Oct 2020 01:25:08 -0000 Author: mmacy Date: Fri Oct 2 01:25:08 2020 New Revision: 366353 URL: https://svnweb.freebsd.org/changeset/base/366353 Log: OpenZFS: don't call fpu_kern_thread on i386 Modified: head/sys/contrib/openzfs/module/os/freebsd/spl/spl_taskq.c Modified: head/sys/contrib/openzfs/module/os/freebsd/spl/spl_taskq.c ============================================================================== --- head/sys/contrib/openzfs/module/os/freebsd/spl/spl_taskq.c Fri Oct 2 01:08:11 2020 (r366352) +++ head/sys/contrib/openzfs/module/os/freebsd/spl/spl_taskq.c Fri Oct 2 01:25:08 2020 (r366353) @@ -169,7 +169,7 @@ taskq_tsd_set(void *context) { taskq_t *tq = context; -#if defined(__amd64__) || defined(__i386__) || defined(__aarch64__) +#if defined(__amd64__) || defined(__aarch64__) if (context != NULL && tsd_get(taskq_tsd) == NULL) fpu_kern_thread(FPU_KERN_NORMAL); #endif From owner-svn-src-all@freebsd.org Fri Oct 2 01:31:52 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0EC263F18DD; Fri, 2 Oct 2020 01:31:52 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: from mail-qt1-f180.google.com (mail-qt1-f180.google.com [209.85.160.180]) (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 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2XXQ4zCQz3ykH; Fri, 2 Oct 2020 01:31:50 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: by mail-qt1-f180.google.com with SMTP id v54so1128236qtj.7; Thu, 01 Oct 2020 18:31:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=h72Vypx/9tkJvMS8AkgVAeAuD8i4OfhBPJojNUq7dzw=; b=lkrfQ2Z0Jgp/yi/HF39qRYAITxtx6KNhQPaKjFAkA/P7hgaRIWW/BK6nKfnJHFBo1r q/5SuZvi+RoxVKjuVn6L8xTR18XQM9lWXNufihfRNdsGUr3NYKYLp+uivR3ilbmUotG1 hd3TUFUo52QGcH0zu8zgj1HybYu5xAkLG18ZcQRm9kopPYtOWegNz7DLWJhTe5tQRchh 67VHtmNVhooy41Hb3lc+IMvpcvPy2ggqK13Q4TgeZa3492MUmkj64vQ629PiJiKhCZlC o3XpLjOUwJVQ/XHwuk+M4868IJYq4N5d3gmMKTOSAjn6yCiKMw6FzWb6gCccw915ZftW 2VXw== X-Gm-Message-State: AOAM532Wph7TGytxgASBdcLdnQNXHqzJjk5csQleGX0KiXqMOufS7xBn CZmDWpf+aFu/U1EHa0pyhUF+6Ut55Dc= X-Google-Smtp-Source: ABdhPJwTdxopPZFObXNwQZj+RfwdoDEuOK7jft75pO09S3107dkDxAMZfC4Mxb1eByWuw6oMds2I4w== X-Received: by 2002:ac8:7c8f:: with SMTP id y15mr161554qtv.288.1601602309529; Thu, 01 Oct 2020 18:31:49 -0700 (PDT) Received: from mail-qk1-f179.google.com (mail-qk1-f179.google.com. [209.85.222.179]) by smtp.gmail.com with ESMTPSA id 8sm76940qkd.47.2020.10.01.18.31.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 01 Oct 2020 18:31:49 -0700 (PDT) Received: by mail-qk1-f179.google.com with SMTP id w16so538962qkj.7; Thu, 01 Oct 2020 18:31:49 -0700 (PDT) X-Received: by 2002:a05:620a:136e:: with SMTP id d14mr10495406qkl.430.1601602308842; Thu, 01 Oct 2020 18:31:48 -0700 (PDT) MIME-Version: 1.0 References: <202010012105.091L5pAn099334@repo.freebsd.org> <202010020123.0921NnJU006207@slippy.cwsent.com> In-Reply-To: <202010020123.0921NnJU006207@slippy.cwsent.com> From: Kyle Evans Date: Thu, 1 Oct 2020 20:31:37 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r366344 - in head: lib/libmd sys/crypto/skein/amd64 To: Cy Schubert Cc: Ed Maste , src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4C2XXQ4zCQz3ykH X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of byondlenox@gmail.com designates 209.85.160.180 as permitted sender) smtp.mailfrom=byondlenox@gmail.com X-Spamd-Result: default: False [-3.00 / 15.00]; MIME_TRACE(0.00)[0:+]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RWL_MAILSPIKE_GOOD(0.00)[209.85.160.180:from]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; NEURAL_HAM_LONG(-0.96)[-0.962]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[kyle-evans.net]; ARC_NA(0.00)[]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.993]; RCVD_IN_DNSWL_NONE(0.00)[209.85.160.180:from]; NEURAL_HAM_MEDIUM(-1.05)[-1.048]; FORGED_SENDER(0.30)[self@kyle-evans.net,byondlenox@gmail.com]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[self@kyle-evans.net,byondlenox@gmail.com]; TAGGED_FROM(0.00)[]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Oct 2020 01:31:52 -0000 On Thu, Oct 1, 2020 at 8:23 PM Cy Schubert wrote: > > In message om> > , Kyle Evans writes: > > On Thu, Oct 1, 2020 at 4:06 PM Ed Maste wrote: > > > > > > Author: emaste > > > Date: Thu Oct 1 21:05:50 2020 > > > New Revision: 366344 > > > URL: https://svnweb.freebsd.org/changeset/base/366344 > > > > > > Log: > > > libmd: fix assembly optimized skein implementation > > > > > > The assembly implementation incorrectly used logical AND instead of > > > bitwise AND. Fix, and re-enable in libmd. > > > > > > Submitted by: Yang Zhong > > > Reviewed by: cem (earlier) > > > Sponsored by: The FreeBSD Foundation > > > Differential Revision: https://reviews.freebsd.org/D26614 > > > > > > Modified: > > > head/lib/libmd/Makefile > > > head/sys/crypto/skein/amd64/skein_block_asm.S > > > > > > Modified: head/lib/libmd/Makefile > > > =========================================================================== > > === > > > --- head/lib/libmd/Makefile Thu Oct 1 20:08:27 2020 (r366343) > > > +++ head/lib/libmd/Makefile Thu Oct 1 21:05:50 2020 (r366344) > > > @@ -116,12 +116,12 @@ CFLAGS+= -DSHA1_ASM > > > SRCS+= rmd160.S > > > CFLAGS+= -DRMD160_ASM > > > .endif > > > -#.if exists(${MACHINE_ARCH}/skein_block_asm.S) > > > -## Fully unroll all loops in the assembly optimized version > > > -#ACFLAGS+= -DSKEIN_LOOP=0 > > > -#SRCS+= skein_block_asm.S > > > -#CFLAGS+= -DSKEIN_ASM -DSKEIN_USE_ASM=1792 # list of block functions to re > > place with assembly: 256+512+1024 = 1792 > > > -#.endif > > > +.if exists(${MACHINE_ARCH}/skein_block_asm.S) > > > +# Fully unroll all loops in the assembly optimized version > > > +ACFLAGS+= -DSKEIN_LOOP=0 > > > +SRCS+= skein_block_asm.S > > > +CFLAGS+= -DSKEIN_ASM -DSKEIN_USE_ASM=1792 # list of block functions to rep > > lace with assembly: 256+512+1024 = 1792 > > > +.endif > > > .if exists(${MACHINE_ARCH}/sha.S) || exists(${MACHINE_ARCH}/rmd160.S) || e > > xists(${MACHINE_ARCH}/skein_block_asm.S) > > > ACFLAGS+= -DELF -Wa,--noexecstack > > > .endif > > > > > > > We need some kind of magic to walk across this for -DNO_CLEAN builds > > -- skein_block.c has no reason to get rebuilt, but we need it to > > because we're now defining SKEIN_USE_ASM=1792, which will strip out > > some symbols. > > > > I haven't had time to look into what kind of magic we can apply here, > > kind of needed to skip ahead to get this build finished for some other > > testing. > > I did rm -r for .../lib/libmd. > Yeah, either that or... touch skein_block.c or I guess in tools/build/depend-cleanup.sh we can basically: if [ -f ${OBJTOP}/lib/libmd/skein_block_asm.o ]; then if nm ${OBJTOP}/lib/libmd/skein_block.o | grep Skein_512_Process_Block; then rm ${OBJTOP}/lib/libmd/skein_block.* fi fi > Strangely it only failed in the amd64 build. Not in i386. > The optimization in question actually only applies to amd64, so this part is reasonable. From owner-svn-src-all@freebsd.org Fri Oct 2 05:59:56 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 525FA3F7765; Fri, 2 Oct 2020 05:59:56 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2fTm1ScPz4D1P; Fri, 2 Oct 2020 05:59:56 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 167741D428; Fri, 2 Oct 2020 05:59:56 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0925xt0Y027274; Fri, 2 Oct 2020 05:59:55 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0925xtB9027273; Fri, 2 Oct 2020 05:59:55 GMT (envelope-from np@FreeBSD.org) Message-Id: <202010020559.0925xtB9027273@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 2 Oct 2020 05:59:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366354 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 366354 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Oct 2020 05:59:56 -0000 Author: np Date: Fri Oct 2 05:59:55 2020 New Revision: 366354 URL: https://svnweb.freebsd.org/changeset/base/366354 Log: cxgbe(4): validate largest_rx_cluster and safest_rx_cluster. These tunables can only be set to a valid cluster size (2K, 4K, 9K, or 16K) as documented in the man page. Anything else could lead to a panic on interface up. Reported by: mav@ MFC after: 1 week Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Fri Oct 2 01:25:08 2020 (r366353) +++ head/sys/dev/cxgbe/t4_sge.c Fri Oct 2 05:59:55 2020 (r366354) @@ -542,6 +542,28 @@ t4_sge_modload(void) tscale = 1; } + if (largest_rx_cluster != MCLBYTES && +#if MJUMPAGESIZE != MCLBYTES + largest_rx_cluster != MJUMPAGESIZE && +#endif + largest_rx_cluster != MJUM9BYTES && + largest_rx_cluster != MJUM16BYTES) { + printf("Invalid hw.cxgbe.largest_rx_cluster value (%d)," + " using %d instead.\n", largest_rx_cluster, MJUM16BYTES); + largest_rx_cluster = MJUM16BYTES; + } + + if (safest_rx_cluster != MCLBYTES && +#if MJUMPAGESIZE != MCLBYTES + safest_rx_cluster != MJUMPAGESIZE && +#endif + safest_rx_cluster != MJUM9BYTES && + safest_rx_cluster != MJUM16BYTES) { + printf("Invalid hw.cxgbe.safest_rx_cluster value (%d)," + " using %d instead.\n", safest_rx_cluster, MJUMPAGESIZE); + safest_rx_cluster = MJUMPAGESIZE; + } + extfree_refs = counter_u64_alloc(M_WAITOK); extfree_rels = counter_u64_alloc(M_WAITOK); pullups = counter_u64_alloc(M_WAITOK); From owner-svn-src-all@freebsd.org Fri Oct 2 07:30:14 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5FD8B3F9A69; Fri, 2 Oct 2020 07:30:14 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2hTy1X2sz4J82; Fri, 2 Oct 2020 07:30:14 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 894BA1E2D5; Fri, 2 Oct 2020 07:30:11 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0927UBiv083361; Fri, 2 Oct 2020 07:30:11 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0927UBg3083360; Fri, 2 Oct 2020 07:30:11 GMT (envelope-from kp@FreeBSD.org) Message-Id: <202010020730.0927UBg3083360@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Fri, 2 Oct 2020 07:30:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366355 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 366355 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Oct 2020 07:30:14 -0000 Author: kp Date: Fri Oct 2 07:30:11 2020 New Revision: 366355 URL: https://svnweb.freebsd.org/changeset/base/366355 Log: riscv: handle access faults in user mode Access faults in user mode are treated like TLB misses, which leads to an endless loop of faults. It's less serious than the same fault in kernel mode, because we can just terminate the process, but that's not ideal. Treat user mode access faults as a bus error. Suggested by: jrtc27 Reviewed by: br, jhb Sponsored by: Axiado Differential Revision: https://reviews.freebsd.org/D26621 Modified: head/sys/riscv/riscv/trap.c Modified: head/sys/riscv/riscv/trap.c ============================================================================== --- head/sys/riscv/riscv/trap.c Fri Oct 2 05:59:55 2020 (r366354) +++ head/sys/riscv/riscv/trap.c Fri Oct 2 07:30:11 2020 (r366355) @@ -343,6 +343,10 @@ do_trap_user(struct trapframe *frame) case EXCP_FAULT_LOAD: case EXCP_FAULT_STORE: case EXCP_FAULT_FETCH: + call_trapsignal(td, SIGBUS, BUS_ADRERR, (void *)frame->tf_sepc, + exception); + userret(td, frame); + break; case EXCP_STORE_PAGE_FAULT: case EXCP_LOAD_PAGE_FAULT: case EXCP_INST_PAGE_FAULT: From owner-svn-src-all@freebsd.org Fri Oct 2 10:03:18 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3F69E428298; Fri, 2 Oct 2020 10:03:18 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2ltZ0wpGz3d0m; Fri, 2 Oct 2020 10:03:18 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 034152068F; Fri, 2 Oct 2020 10:03:18 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 092A3HZ8011826; Fri, 2 Oct 2020 10:03:17 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 092A3H44011825; Fri, 2 Oct 2020 10:03:17 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202010021003.092A3H44011825@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 2 Oct 2020 10:03:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366356 - stable/12/usr.bin/procstat X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/usr.bin/procstat X-SVN-Commit-Revision: 366356 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Oct 2020 10:03:18 -0000 Author: kib Date: Fri Oct 2 10:03:17 2020 New Revision: 366356 URL: https://svnweb.freebsd.org/changeset/base/366356 Log: MFC r366237: procstat: Fix regression after 365880. Modified: stable/12/usr.bin/procstat/procstat.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.bin/procstat/procstat.c ============================================================================== --- stable/12/usr.bin/procstat/procstat.c Fri Oct 2 07:30:11 2020 (r366355) +++ stable/12/usr.bin/procstat/procstat.c Fri Oct 2 10:03:17 2020 (r366356) @@ -422,9 +422,7 @@ main(int argc, char *argv[]) argc -= optind; argv += optind; - if (cmd == NULL && argv[0] != NULL) - cmd = getcmd(argv[0]); - if (cmd != NULL) { + if (cmd == NULL && argv[0] != NULL && (cmd = getcmd(argv[0])) != NULL) { if ((procstat_opts & PS_SUBCOMMAND_OPTS) != 0) usage(cmd); if (cmd->opt != NULL) { @@ -440,12 +438,13 @@ main(int argc, char *argv[]) argv += 1; } } else { - cmd = getcmd("basic"); + if (cmd == NULL) + cmd = getcmd("basic"); + if (cmd->cmd != procstat_files && + (procstat_opts & PS_OPT_CAPABILITIES) != 0 && + (cmd->cmp & PS_MODE_COMPAT) == 0) + usage(cmd); } - if (cmd->cmd != procstat_files && - (procstat_opts & PS_OPT_CAPABILITIES) != 0 && - (cmd->cmp & PS_MODE_COMPAT) == 0) - usage(cmd); /* Must specify either the -a flag or a list of pids. */ if (!(aflag == 1 && argc == 0) && !(aflag == 0 && argc > 0)) From owner-svn-src-all@freebsd.org Fri Oct 2 12:46:29 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6209E42BED6; Fri, 2 Oct 2020 12:46:29 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2qVs1tDwz434r; Fri, 2 Oct 2020 12:46:29 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1F0692204B; Fri, 2 Oct 2020 12:46:29 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 092CkSUb009430; Fri, 2 Oct 2020 12:46:28 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 092CkSrH009428; Fri, 2 Oct 2020 12:46:28 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202010021246.092CkSrH009428@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 2 Oct 2020 12:46:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366357 - stable/12/sys/dev/iicbus X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/sys/dev/iicbus X-SVN-Commit-Revision: 366357 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Oct 2020 12:46:29 -0000 Author: avg Date: Fri Oct 2 12:46:28 2020 New Revision: 366357 URL: https://svnweb.freebsd.org/changeset/base/366357 Log: MFC r365290: move definition of hw.i2c sysctl node from iicbb to iicbus Modified: stable/12/sys/dev/iicbus/iicbb.c stable/12/sys/dev/iicbus/iicbus.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/iicbus/iicbb.c ============================================================================== --- stable/12/sys/dev/iicbus/iicbb.c Fri Oct 2 10:03:17 2020 (r366356) +++ stable/12/sys/dev/iicbus/iicbb.c Fri Oct 2 12:46:28 2020 (r366357) @@ -228,7 +228,7 @@ iicbb_print_child(device_t bus, device_t dev) #ifdef IICBB_DEBUG static int i2c_debug = 0; -static SYSCTL_NODE(_hw, OID_AUTO, i2c, CTLFLAG_RW, 0, "i2c debug"); +SYSCTL_DECL(_hw_i2c); SYSCTL_INT(_hw_i2c, OID_AUTO, iicbb_debug, CTLFLAG_RWTUN, &i2c_debug, 0, "Enable i2c bit-banging driver debug"); Modified: stable/12/sys/dev/iicbus/iicbus.c ============================================================================== --- stable/12/sys/dev/iicbus/iicbus.c Fri Oct 2 10:03:17 2020 (r366356) +++ stable/12/sys/dev/iicbus/iicbus.c Fri Oct 2 12:46:28 2020 (r366357) @@ -52,6 +52,8 @@ __FBSDID("$FreeBSD$"); /* See comments below for why auto-scanning is a bad idea. */ #define SCAN_IICBUS 0 +SYSCTL_NODE(_hw, OID_AUTO, i2c, CTLFLAG_RW, 0, "i2c controls"); + static int iicbus_probe(device_t dev) { From owner-svn-src-all@freebsd.org Fri Oct 2 12:48:07 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E4F0C42BC7E; Fri, 2 Oct 2020 12:48:07 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2qXl5lWtz42pQ; Fri, 2 Oct 2020 12:48:07 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A91F122408; Fri, 2 Oct 2020 12:48:07 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 092Cm7tl009636; Fri, 2 Oct 2020 12:48:07 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 092Cm7Mw009635; Fri, 2 Oct 2020 12:48:07 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202010021248.092Cm7Mw009635@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 2 Oct 2020 12:48:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366358 - stable/12/sys/dev/iicbus/twsi X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/sys/dev/iicbus/twsi X-SVN-Commit-Revision: 366358 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Oct 2020 12:48:08 -0000 Author: avg Date: Fri Oct 2 12:48:07 2020 New Revision: 366358 URL: https://svnweb.freebsd.org/changeset/base/366358 Log: MFC r365396: twsi: use tsleep instead of pause for better responsiveness Modified: stable/12/sys/dev/iicbus/twsi/twsi.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/iicbus/twsi/twsi.c ============================================================================== --- stable/12/sys/dev/iicbus/twsi/twsi.c Fri Oct 2 12:46:28 2020 (r366357) +++ stable/12/sys/dev/iicbus/twsi/twsi.c Fri Oct 2 12:48:07 2020 (r366358) @@ -506,7 +506,7 @@ twsi_transfer(device_t dev, struct iic_msg *msgs, uint sc->control_val &= ~TWSI_CONTROL_ACK; TWSI_WRITE(sc, sc->reg_control, sc->control_val | TWSI_CONTROL_START); while (sc->error == 0 && sc->transfer != 0) { - pause_sbt("twsi", SBT_1MS * 30, SBT_1MS, 0); + tsleep_sbt(sc, 0, "twsi", SBT_1MS * 30, SBT_1MS, 0); } debugf(sc->dev, "pause finish\n"); From owner-svn-src-all@freebsd.org Fri Oct 2 12:49:28 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 968E842BCE3; Fri, 2 Oct 2020 12:49:28 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2qZJ3QvGz438y; Fri, 2 Oct 2020 12:49:28 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 58E0221EF0; Fri, 2 Oct 2020 12:49:28 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 092CnSDU009820; Fri, 2 Oct 2020 12:49:28 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 092CnSMQ009819; Fri, 2 Oct 2020 12:49:28 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202010021249.092CnSMQ009819@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 2 Oct 2020 12:49:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366359 - stable/12/usr.sbin/pwm X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/usr.sbin/pwm X-SVN-Commit-Revision: 366359 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Oct 2020 12:49:28 -0000 Author: avg Date: Fri Oct 2 12:49:27 2020 New Revision: 366359 URL: https://svnweb.freebsd.org/changeset/base/366359 Log: MFC r366143: pwm(8): do not exit with failure after successfully reading configuration Modified: stable/12/usr.sbin/pwm/pwm.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/pwm/pwm.c ============================================================================== --- stable/12/usr.sbin/pwm/pwm.c Fri Oct 2 12:48:07 2020 (r366358) +++ stable/12/usr.sbin/pwm/pwm.c Fri Oct 2 12:49:27 2020 (r366359) @@ -177,7 +177,6 @@ main(int argc, char *argv[]) state.period, state.duty, state.enable); - goto fail; } else { if (action & PWM_ENABLE) state.enable = true; From owner-svn-src-all@freebsd.org Fri Oct 2 13:31:20 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D7BEF42D137; Fri, 2 Oct 2020 13:31:20 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2rVc5PCXz47yK; Fri, 2 Oct 2020 13:31:20 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9D0E322BB1; Fri, 2 Oct 2020 13:31:20 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 092DVKJH042059; Fri, 2 Oct 2020 13:31:20 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 092DVK5J042058; Fri, 2 Oct 2020 13:31:20 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <202010021331.092DVK5J042058@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Fri, 2 Oct 2020 13:31:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366360 - stable/12/sys/arm64/arm64 X-SVN-Group: stable-12 X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: stable/12/sys/arm64/arm64 X-SVN-Commit-Revision: 366360 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Oct 2020 13:31:20 -0000 Author: mhorne Date: Fri Oct 2 13:31:20 2020 New Revision: 366360 URL: https://svnweb.freebsd.org/changeset/base/366360 Log: MFC r366271: arm64: set the correct HWCAP Modified: stable/12/sys/arm64/arm64/identcpu.c Modified: stable/12/sys/arm64/arm64/identcpu.c ============================================================================== --- stable/12/sys/arm64/arm64/identcpu.c Fri Oct 2 12:49:27 2020 (r366359) +++ stable/12/sys/arm64/arm64/identcpu.c Fri Oct 2 13:31:20 2020 (r366360) @@ -500,7 +500,7 @@ parse_cpu_features_hwcap(u_int cpu) hwcap |= HWCAP_ASIMD; break; case ID_AA64PFR0_AdvSIMD_HP: - hwcap |= HWCAP_ASIMD | HWCAP_ASIMDDP; + hwcap |= HWCAP_ASIMD | HWCAP_ASIMDHP; break; default: break; From owner-svn-src-all@freebsd.org Fri Oct 2 13:36:30 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EF1B842D89D; Fri, 2 Oct 2020 13:36:30 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2rcZ62Nvz49vw; Fri, 2 Oct 2020 13:36:30 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 952B022B5A; Fri, 2 Oct 2020 13:36:30 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 092DaUdj044937; Fri, 2 Oct 2020 13:36:30 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 092DaUdP044936; Fri, 2 Oct 2020 13:36:30 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <202010021336.092DaUdP044936@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Fri, 2 Oct 2020 13:36:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366361 - stable/12 X-SVN-Group: stable-12 X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: stable/12 X-SVN-Commit-Revision: 366361 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Oct 2020 13:36:31 -0000 Author: mhorne Date: Fri Oct 2 13:36:29 2020 New Revision: 366361 URL: https://svnweb.freebsd.org/changeset/base/366361 Log: Add the mergeinfo for r366271 Modified: Directory Properties: stable/12/ (props changed) From owner-svn-src-all@freebsd.org Fri Oct 2 14:00:52 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EA3C242DB6A; Fri, 2 Oct 2020 14:00:52 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2s8h5zqJz4Cys; Fri, 2 Oct 2020 14:00:52 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B0C4B22EB0; Fri, 2 Oct 2020 14:00:52 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 092E0qup058170; Fri, 2 Oct 2020 14:00:52 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 092E0qSD058169; Fri, 2 Oct 2020 14:00:52 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202010021400.092E0qSD058169@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 2 Oct 2020 14:00:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366362 - head/lib/libmd X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/lib/libmd X-SVN-Commit-Revision: 366362 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Oct 2020 14:00:53 -0000 Author: emaste Date: Fri Oct 2 14:00:52 2020 New Revision: 366362 URL: https://svnweb.freebsd.org/changeset/base/366362 Log: libmd: add dependency workaround for r366344 r366344 fixed and reenabled the assembly optimized skein implementation, but skein_block objects were not being rebuilt in no-clean builds. This resulted in failing no-clean builds. SKEIN_USE_ASM controls which routines come from C vs assembly, and with no explicit dependency r366344's change to SKEIN_USE_ASM did not cause skein_block.{o,pico} to be rebuilt. Add a dependency on this Makefile for the skein_block objects. This dependency is broader in scope than absolutely required (that is, the skein_block objects will now be rebuilt on any change to this Makefile). There are ways this could be addressed, but it is probably not worth the additional effort or testing time to pursue them. PR: 248221 Reported by: kevans, Jeremy Faulkner Discussed with: kevans Sponsored by: The FreeBSD Foundation Modified: head/lib/libmd/Makefile Modified: head/lib/libmd/Makefile ============================================================================== --- head/lib/libmd/Makefile Fri Oct 2 13:36:29 2020 (r366361) +++ head/lib/libmd/Makefile Fri Oct 2 14:00:52 2020 (r366362) @@ -121,6 +121,10 @@ CFLAGS+= -DRMD160_ASM ACFLAGS+= -DSKEIN_LOOP=0 SRCS+= skein_block_asm.S CFLAGS+= -DSKEIN_ASM -DSKEIN_USE_ASM=1792 # list of block functions to replace with assembly: 256+512+1024 = 1792 +# 20201002 Add explict Makefile dependency for r366344 (reenabled assembly +# optimized version). SKEIN_USE_ASM determines which routines should come from +# the assembly vs C versions, and skein_block needs to be rebuilt if it changes. +skein_block.o skein_block.pico: Makefile .endif .if exists(${MACHINE_ARCH}/sha.S) || exists(${MACHINE_ARCH}/rmd160.S) || exists(${MACHINE_ARCH}/skein_block_asm.S) ACFLAGS+= -DELF -Wa,--noexecstack From owner-svn-src-all@freebsd.org Fri Oct 2 14:34:53 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1142F42E961; Fri, 2 Oct 2020 14:34:53 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-il1-f175.google.com (mail-il1-f175.google.com [209.85.166.175]) (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 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2svw1xsLz4GvB; Fri, 2 Oct 2020 14:34:52 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-il1-f175.google.com with SMTP id o18so1444482ilg.0; Fri, 02 Oct 2020 07:34:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=E3o3UuiA1SwyhhPF+8BLUVTS7IVr+mPwSw8D7J9wwk0=; b=m1UMviICuv/shvib+5twBVUVg/DwQMKEFDsE3C3QfkVt1Qwh5IeTW39qe5r3oZ8pjZ GTCUB23a5q9cHbHohtaR1qaNhNXvu0vOffetCAVPeFzbfsmxWp55rFjtdGi3gFQFRBSg 3GLCc234Wr2xhmVRS0VjM8Pb0TJt9j4Cg5srIdgUFiocUKGthKTv0NfOhyXnMMvZ4kxw zgDHVcDZX3ohiRQYHy5u/r8qYdhYFxmy5SuOIbJYMysO9W1Sw9jLY6oETL0xfee92SSh qcWN/Ujtd9rdPxQ3SEGKEf6sSh2REV0mjc0wEMLE+5/dEOUrd9/aOjU2Vxn+mrQUa+4W AtPg== X-Gm-Message-State: AOAM531HSQQTDuZBgO35BEZN7rOjheyvghBsGFjSxHTC7//2BhAgKqGG 2ij1FJ9eAmkT8L0lEDjeBC4dMvfk93+9uNmvhS8= X-Google-Smtp-Source: ABdhPJzclRZx1ZesfeT5EU18Ce4AttOuhdwAQztfyBSq+hXGjl+CVtcYZ1QG5DqvU48S/FhavBUpBgtLmSS8Ha3Qk0k= X-Received: by 2002:a92:5f0c:: with SMTP id t12mr1897090ilb.182.1601649291037; Fri, 02 Oct 2020 07:34:51 -0700 (PDT) MIME-Version: 1.0 References: <202010012105.091L5pAn099334@repo.freebsd.org> In-Reply-To: From: Ed Maste Date: Fri, 2 Oct 2020 10:34:38 -0400 Message-ID: Subject: Re: svn commit: r366344 - in head: lib/libmd sys/crypto/skein/amd64 To: Kyle Evans Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4C2svw1xsLz4GvB X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of carpeddiem@gmail.com designates 209.85.166.175 as permitted sender) smtp.mailfrom=carpeddiem@gmail.com X-Spamd-Result: default: False [-1.69 / 15.00]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FREEFALL_USER(0.00)[carpeddiem]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; NEURAL_HAM_LONG(-1.01)[-1.011]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.989]; NEURAL_SPAM_SHORT(0.31)[0.313]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[209.85.166.175:from]; FORGED_SENDER(0.30)[emaste@freebsd.org,carpeddiem@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.166.175:from]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; MIME_TRACE(0.00)[0:+]; FROM_NEQ_ENVFROM(0.00)[emaste@freebsd.org,carpeddiem@gmail.com]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Oct 2020 14:34:53 -0000 On Thu, 1 Oct 2020 at 21:18, Kyle Evans wrote: > > We need some kind of magic to walk across this for -DNO_CLEAN builds > -- skein_block.c has no reason to get rebuilt, but we need it to > because we're now defining SKEIN_USE_ASM=1792, which will strip out > some symbols. kevans and I discussed on IRC yesterday; a workaround is now committed in r366362 From owner-svn-src-all@freebsd.org Fri Oct 2 14:50:03 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CD66D42F307; Fri, 2 Oct 2020 14:50:03 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2tFR5727z4HsW; Fri, 2 Oct 2020 14:50:03 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8F1A2239A8; Fri, 2 Oct 2020 14:50:03 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 092Eo3SU088954; Fri, 2 Oct 2020 14:50:03 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 092Eo3QS088953; Fri, 2 Oct 2020 14:50:03 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202010021450.092Eo3QS088953@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 2 Oct 2020 14:50:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366363 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 366363 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Oct 2020 14:50:03 -0000 Author: mjg Date: Fri Oct 2 14:50:03 2020 New Revision: 366363 URL: https://svnweb.freebsd.org/changeset/base/366363 Log: cache: update the commentary for path parsing Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Fri Oct 2 14:00:52 2020 (r366362) +++ head/sys/kern/vfs_cache.c Fri Oct 2 14:50:03 2020 (r366363) @@ -3948,10 +3948,10 @@ cache_fplookup_need_climb_mount(struct cache_fpl *fpl) /* * Parse the path. * - * The code is mostly copy-pasted from regular lookup, see lookup(). - * The structure is maintained along with comments for easier maintenance. - * Deduplicating the code will become feasible after fast path lookup - * becomes more feature-complete. + * The code was originally copy-pasted from regular lookup and despite + * clean ups leaves performance on the table. Any modifications here + * must take into account that in case off fallback the resulting + * nameidata state has to be compatible with the original. */ static int cache_fplookup_parse(struct cache_fpl *fpl) From owner-svn-src-all@freebsd.org Fri Oct 2 15:37:52 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 99472430058; Fri, 2 Oct 2020 15:37:52 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2vJc3Wryz4LDT; Fri, 2 Oct 2020 15:37:52 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5C53324049; Fri, 2 Oct 2020 15:37:52 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 092Fbq5p019233; Fri, 2 Oct 2020 15:37:52 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 092Fbqfo019232; Fri, 2 Oct 2020 15:37:52 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <202010021537.092Fbqfo019232@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Fri, 2 Oct 2020 15:37:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366364 - head/stand/man X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: head/stand/man X-SVN-Commit-Revision: 366364 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Oct 2020 15:37:52 -0000 Author: 0mp (doc,ports committer) Date: Fri Oct 2 15:37:51 2020 New Revision: 366364 URL: https://svnweb.freebsd.org/changeset/base/366364 Log: Correct the documented size of kern.msgbufsize The correct value is 96KB after r226090. PR: 249971 Submitted by: johannes@jo-t.de MFC after: 3 days Modified: head/stand/man/loader.8 Modified: head/stand/man/loader.8 ============================================================================== --- head/stand/man/loader.8 Fri Oct 2 14:50:03 2020 (r366363) +++ head/stand/man/loader.8 Fri Oct 2 15:37:51 2020 (r366364) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 11, 2020 +.Dd October 2, 2020 .Dt LOADER 8 .Os .Sh NAME @@ -652,7 +652,7 @@ Modifies .Dv VM_BCACHE_SIZE_MAX . .It Va kern.msgbufsize Sets the size of the kernel message buffer. -The default limit of 64KB is usually sufficient unless +The default limit of 96KB is usually sufficient unless large amounts of trace data need to be collected between opportunities to examine the buffer or dump it to a file. From owner-svn-src-all@freebsd.org Fri Oct 2 17:06:07 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7BEE0431DBE; Fri, 2 Oct 2020 17:06:07 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2xGR31zSz4QDS; Fri, 2 Oct 2020 17:06:07 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4AC6C25494; Fri, 2 Oct 2020 17:06:07 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 092H67Wg074254; Fri, 2 Oct 2020 17:06:07 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 092H657X074246; Fri, 2 Oct 2020 17:06:05 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <202010021706.092H657X074246@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 2 Oct 2020 17:06:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366365 - head/tests/sys/fs/fusefs X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/tests/sys/fs/fusefs X-SVN-Commit-Revision: 366365 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Oct 2020 17:06:07 -0000 Author: asomers Date: Fri Oct 2 17:06:05 2020 New Revision: 366365 URL: https://svnweb.freebsd.org/changeset/base/366365 Log: fusefs tests: quell Coverity "Argument cannot be negative" warnings Must abort tests early if open(2) fails. Reported by: Coverity Coverity CID: 1432810 and many others Reviewed by: kevans MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D26635 Modified: head/tests/sys/fs/fusefs/allow_other.cc head/tests/sys/fs/fusefs/create.cc head/tests/sys/fs/fusefs/default_permissions.cc head/tests/sys/fs/fusefs/flush.cc head/tests/sys/fs/fusefs/open.cc head/tests/sys/fs/fusefs/opendir.cc head/tests/sys/fs/fusefs/release.cc head/tests/sys/fs/fusefs/releasedir.cc head/tests/sys/fs/fusefs/write.cc Modified: head/tests/sys/fs/fusefs/allow_other.cc ============================================================================== --- head/tests/sys/fs/fusefs/allow_other.cc Fri Oct 2 15:37:51 2020 (r366364) +++ head/tests/sys/fs/fusefs/allow_other.cc Fri Oct 2 17:06:05 2020 (r366365) @@ -168,7 +168,7 @@ TEST_F(AllowOther, privilege_escalation) .WillRepeatedly(Invoke(ReturnErrno(EPERM))); fd1 = open(FULLPATH, O_RDONLY); - EXPECT_LE(0, fd1) << strerror(errno); + ASSERT_LE(0, fd1) << strerror(errno); }, [] { int fd0; Modified: head/tests/sys/fs/fusefs/create.cc ============================================================================== --- head/tests/sys/fs/fusefs/create.cc Fri Oct 2 15:37:51 2020 (r366364) +++ head/tests/sys/fs/fusefs/create.cc Fri Oct 2 17:06:05 2020 (r366365) @@ -143,7 +143,7 @@ TEST_F(Create, attr_cache) ).Times(0); fd = open(FULLPATH, O_CREAT | O_EXCL, mode); - EXPECT_LE(0, fd) << strerror(errno); + ASSERT_LE(0, fd) << strerror(errno); leak(fd); } @@ -184,7 +184,7 @@ TEST_F(Create, clear_attr_cache) EXPECT_EQ(0, stat("mountpoint", &sb)) << strerror(errno); fd = open(FULLPATH, O_CREAT | O_EXCL, mode); - EXPECT_LE(0, fd) << strerror(errno); + ASSERT_LE(0, fd) << strerror(errno); EXPECT_EQ(0, stat("mountpoint", &sb)) << strerror(errno); leak(fd); @@ -254,7 +254,7 @@ TEST_F(Create, Enosys) }))); fd = open(FULLPATH, O_CREAT | O_EXCL, mode); - EXPECT_LE(0, fd) << strerror(errno); + ASSERT_LE(0, fd) << strerror(errno); leak(fd); } @@ -366,7 +366,7 @@ TEST_F(Create, ok) })); fd = open(FULLPATH, O_CREAT | O_EXCL, mode); - EXPECT_LE(0, fd) << strerror(errno); + ASSERT_LE(0, fd) << strerror(errno); leak(fd); } @@ -398,7 +398,7 @@ TEST_F(Create, wronly_0444) })); fd = open(FULLPATH, O_CREAT | O_WRONLY, mode); - EXPECT_LE(0, fd) << strerror(errno); + ASSERT_LE(0, fd) << strerror(errno); leak(fd); } @@ -422,7 +422,7 @@ TEST_F(Create_7_8, ok) })); fd = open(FULLPATH, O_CREAT | O_EXCL, mode); - EXPECT_LE(0, fd) << strerror(errno); + ASSERT_LE(0, fd) << strerror(errno); leak(fd); } @@ -446,6 +446,6 @@ TEST_F(Create_7_11, ok) })); fd = open(FULLPATH, O_CREAT | O_EXCL, mode); - EXPECT_LE(0, fd) << strerror(errno); + ASSERT_LE(0, fd) << strerror(errno); leak(fd); } Modified: head/tests/sys/fs/fusefs/default_permissions.cc ============================================================================== --- head/tests/sys/fs/fusefs/default_permissions.cc Fri Oct 2 15:37:51 2020 (r366364) +++ head/tests/sys/fs/fusefs/default_permissions.cc Fri Oct 2 17:06:05 2020 (r366365) @@ -490,7 +490,7 @@ TEST_F(Create, ok) expect_create(RELPATH, ino); fd = open(FULLPATH, O_CREAT | O_EXCL, 0644); - EXPECT_LE(0, fd) << strerror(errno); + ASSERT_LE(0, fd) << strerror(errno); leak(fd); } @@ -765,7 +765,7 @@ TEST_F(Open, ok) expect_open(ino, 0, 1); fd = open(FULLPATH, O_RDONLY); - EXPECT_LE(0, fd) << strerror(errno); + ASSERT_LE(0, fd) << strerror(errno); leak(fd); } Modified: head/tests/sys/fs/fusefs/flush.cc ============================================================================== --- head/tests/sys/fs/fusefs/flush.cc Fri Oct 2 15:37:51 2020 (r366364) +++ head/tests/sys/fs/fusefs/flush.cc Fri Oct 2 17:06:05 2020 (r366365) @@ -102,10 +102,10 @@ TEST_F(Flush, open_twice) expect_release(); fd = open(FULLPATH, O_WRONLY); - EXPECT_LE(0, fd) << strerror(errno); + ASSERT_LE(0, fd) << strerror(errno); fd2 = open(FULLPATH, O_WRONLY); - EXPECT_LE(0, fd2) << strerror(errno); + ASSERT_LE(0, fd2) << strerror(errno); EXPECT_EQ(0, close(fd2)) << strerror(errno); EXPECT_EQ(0, close(fd)) << strerror(errno); @@ -132,7 +132,7 @@ TEST_F(Flush, eio) expect_release(); fd = open(FULLPATH, O_WRONLY); - EXPECT_LE(0, fd) << strerror(errno); + ASSERT_LE(0, fd) << strerror(errno); ASSERT_TRUE(0 == close(fd) || errno == EIO) << strerror(errno); } @@ -186,7 +186,7 @@ TEST_F(Flush, flush) expect_release(); fd = open(FULLPATH, O_WRONLY); - EXPECT_LE(0, fd) << strerror(errno); + ASSERT_LE(0, fd) << strerror(errno); ASSERT_TRUE(0 == close(fd)) << strerror(errno); } Modified: head/tests/sys/fs/fusefs/open.cc ============================================================================== --- head/tests/sys/fs/fusefs/open.cc Fri Oct 2 15:37:51 2020 (r366364) +++ head/tests/sys/fs/fusefs/open.cc Fri Oct 2 17:06:05 2020 (r366365) @@ -67,7 +67,7 @@ void test_ok(int os_flags, int fuse_flags) { }))); fd = open(FULLPATH, os_flags); - EXPECT_LE(0, fd) << strerror(errno); + ASSERT_LE(0, fd) << strerror(errno); leak(fd); } }; @@ -201,7 +201,7 @@ TEST_F(Open, multiple_creds) expect_release(ino, fh1); fd1 = open(FULLPATH, O_RDONLY); - EXPECT_LE(0, fd1) << strerror(errno); + ASSERT_LE(0, fd1) << strerror(errno); }, [] { int fd0; Modified: head/tests/sys/fs/fusefs/opendir.cc ============================================================================== --- head/tests/sys/fs/fusefs/opendir.cc Fri Oct 2 15:37:51 2020 (r366364) +++ head/tests/sys/fs/fusefs/opendir.cc Fri Oct 2 17:06:05 2020 (r366365) @@ -132,7 +132,7 @@ TEST_F(Opendir, open) })); fd = open(FULLPATH, O_DIRECTORY); - EXPECT_LE(0, fd) << strerror(errno); + ASSERT_LE(0, fd) << strerror(errno); leak(fd); } Modified: head/tests/sys/fs/fusefs/release.cc ============================================================================== --- head/tests/sys/fs/fusefs/release.cc Fri Oct 2 15:37:51 2020 (r366364) +++ head/tests/sys/fs/fusefs/release.cc Fri Oct 2 17:06:05 2020 (r366365) @@ -87,7 +87,7 @@ TEST_F(Release, dup) expect_release(ino, getpid(), O_RDONLY, 0); fd = open(FULLPATH, O_RDONLY); - EXPECT_LE(0, fd) << strerror(errno); + ASSERT_LE(0, fd) << strerror(errno); fd2 = dup(fd); ASSERT_LE(0, fd2) << strerror(errno); @@ -117,7 +117,7 @@ TEST_F(Release, eio) expect_release(ino, getpid(), O_WRONLY, EIO); fd = open(FULLPATH, O_WRONLY); - EXPECT_LE(0, fd) << strerror(errno); + ASSERT_LE(0, fd) << strerror(errno); ASSERT_TRUE(0 == close(fd) || errno == EIO) << strerror(errno); } @@ -139,7 +139,7 @@ TEST_F(Release, DISABLED_flags) expect_release(ino, getpid(), O_RDWR | O_APPEND, 0); fd = open(FULLPATH, O_RDWR | O_APPEND); - EXPECT_LE(0, fd) << strerror(errno); + ASSERT_LE(0, fd) << strerror(errno); ASSERT_EQ(0, close(fd)) << strerror(errno); } @@ -162,11 +162,11 @@ TEST_F(Release, multiple_opens) expect_release(ino, getpid(), O_RDONLY, 0); fd = open(FULLPATH, O_RDONLY); - EXPECT_LE(0, fd) << strerror(errno); + ASSERT_LE(0, fd) << strerror(errno); expect_release(ino, getpid(), O_WRONLY, 0); fd2 = open(FULLPATH, O_WRONLY); - EXPECT_LE(0, fd2) << strerror(errno); + ASSERT_LE(0, fd2) << strerror(errno); ASSERT_EQ(0, close(fd2)) << strerror(errno); ASSERT_EQ(0, close(fd)) << strerror(errno); @@ -185,7 +185,7 @@ TEST_F(Release, ok) expect_release(ino, getpid(), O_RDONLY, 0); fd = open(FULLPATH, O_RDONLY); - EXPECT_LE(0, fd) << strerror(errno); + ASSERT_LE(0, fd) << strerror(errno); ASSERT_EQ(0, close(fd)) << strerror(errno); } Modified: head/tests/sys/fs/fusefs/releasedir.cc ============================================================================== --- head/tests/sys/fs/fusefs/releasedir.cc Fri Oct 2 15:37:51 2020 (r366364) +++ head/tests/sys/fs/fusefs/releasedir.cc Fri Oct 2 17:06:05 2020 (r366365) @@ -112,7 +112,7 @@ TEST_F(ReleaseDir, o_exec) expect_releasedir(ino, ReturnErrno(0)); fd = open(FULLPATH, O_EXEC | O_DIRECTORY); - EXPECT_LE(0, fd) << strerror(errno); + ASSERT_LE(0, fd) << strerror(errno); ASSERT_EQ(0, close(fd)) << strerror(errno); } Modified: head/tests/sys/fs/fusefs/write.cc ============================================================================== --- head/tests/sys/fs/fusefs/write.cc Fri Oct 2 15:37:51 2020 (r366364) +++ head/tests/sys/fs/fusefs/write.cc Fri Oct 2 17:06:05 2020 (r366365) @@ -216,7 +216,7 @@ TEST_F(AioWrite, DISABLED_aio_write) expect_write(ino, offset, bufsize, bufsize, CONTENTS); fd = open(FULLPATH, O_WRONLY); - EXPECT_LE(0, fd) << strerror(errno); + ASSERT_LE(0, fd) << strerror(errno); iocb.aio_nbytes = bufsize; iocb.aio_fildes = fd; @@ -258,7 +258,7 @@ TEST_F(Write, append) /* Must open O_RDWR or fuse(4) implicitly sets direct_io */ fd = open(FULLPATH, O_RDWR | O_APPEND); - EXPECT_LE(0, fd) << strerror(errno); + ASSERT_LE(0, fd) << strerror(errno); ASSERT_EQ(BUFSIZE, write(fd, CONTENTS, BUFSIZE)) << strerror(errno); leak(fd); @@ -291,7 +291,7 @@ TEST_F(Write, append_to_cached) /* Must open O_RDWR or fuse(4) implicitly sets direct_io */ fd = open(FULLPATH, O_RDWR | O_APPEND); - EXPECT_LE(0, fd) << strerror(errno); + ASSERT_LE(0, fd) << strerror(errno); /* Read the old data into the cache */ ASSERT_EQ((ssize_t)oldsize, read(fd, oldbuf, oldsize)) @@ -319,7 +319,7 @@ TEST_F(Write, append_direct_io) expect_write(ino, initial_offset, BUFSIZE, BUFSIZE, CONTENTS); fd = open(FULLPATH, O_WRONLY | O_APPEND); - EXPECT_LE(0, fd) << strerror(errno); + ASSERT_LE(0, fd) << strerror(errno); ASSERT_EQ(BUFSIZE, write(fd, CONTENTS, BUFSIZE)) << strerror(errno); leak(fd); @@ -343,7 +343,7 @@ TEST_F(Write, direct_io_evicts_cache) expect_write(ino, 0, bufsize, bufsize, CONTENTS1); fd = open(FULLPATH, O_RDWR); - EXPECT_LE(0, fd) << strerror(errno); + ASSERT_LE(0, fd) << strerror(errno); // Prime cache ASSERT_EQ(bufsize, read(fd, readbuf, bufsize)) << strerror(errno); @@ -387,7 +387,7 @@ TEST_F(Write, indirect_io_short_write) expect_write(ino, bufsize0, bufsize1, bufsize1, contents1); fd = open(FULLPATH, O_WRONLY); - EXPECT_LE(0, fd) << strerror(errno); + ASSERT_LE(0, fd) << strerror(errno); ASSERT_EQ(bufsize, write(fd, CONTENTS, bufsize)) << strerror(errno); leak(fd); @@ -412,7 +412,7 @@ TEST_F(Write, direct_io_short_write) expect_write(ino, 0, bufsize, halfbufsize, CONTENTS); fd = open(FULLPATH, O_WRONLY); - EXPECT_LE(0, fd) << strerror(errno); + ASSERT_LE(0, fd) << strerror(errno); ASSERT_EQ(halfbufsize, write(fd, CONTENTS, bufsize)) << strerror(errno); leak(fd); @@ -442,7 +442,7 @@ TEST_F(Write, direct_io_short_write_iov) expect_write(ino, 0, totalsize, size0, EXPECTED0); fd = open(FULLPATH, O_WRONLY); - EXPECT_LE(0, fd) << strerror(errno); + ASSERT_LE(0, fd) << strerror(errno); iov[0].iov_base = __DECONST(void*, CONTENTS0); iov[0].iov_len = strlen(CONTENTS0); @@ -474,7 +474,7 @@ TEST_F(Write, rlimit_fsize) fd = open(FULLPATH, O_WRONLY); - EXPECT_LE(0, fd) << strerror(errno); + ASSERT_LE(0, fd) << strerror(errno); ASSERT_EQ(-1, pwrite(fd, CONTENTS, bufsize, offset)); EXPECT_EQ(EFBIG, errno); @@ -508,7 +508,7 @@ TEST_F(Write, eof_during_rmw) maybe_expect_write(ino, offset, bufsize, CONTENTS); fd = open(FULLPATH, O_RDWR); - EXPECT_LE(0, fd) << strerror(errno); + ASSERT_LE(0, fd) << strerror(errno); ASSERT_EQ(bufsize, pwrite(fd, CONTENTS, bufsize, offset)) << strerror(errno); @@ -553,7 +553,7 @@ TEST_F(Write, mmap) expect_release(ino, ReturnErrno(0)); fd = open(FULLPATH, O_RDWR); - EXPECT_LE(0, fd) << strerror(errno); + ASSERT_LE(0, fd) << strerror(errno); p = mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); ASSERT_NE(MAP_FAILED, p) << strerror(errno); @@ -584,7 +584,7 @@ TEST_F(Write, pwrite) expect_write(ino, offset, bufsize, bufsize, CONTENTS); fd = open(FULLPATH, O_WRONLY); - EXPECT_LE(0, fd) << strerror(errno); + ASSERT_LE(0, fd) << strerror(errno); ASSERT_EQ(bufsize, pwrite(fd, CONTENTS, bufsize, offset)) << strerror(errno); @@ -607,7 +607,7 @@ TEST_F(Write, timestamps) maybe_expect_write(ino, 0, bufsize, CONTENTS); fd = open(FULLPATH, O_RDWR); - EXPECT_LE(0, fd) << strerror(errno); + ASSERT_LE(0, fd) << strerror(errno); ASSERT_EQ(0, fstat(fd, &sb0)) << strerror(errno); ASSERT_EQ(bufsize, write(fd, CONTENTS, bufsize)) << strerror(errno); @@ -636,7 +636,7 @@ TEST_F(Write, write) expect_write(ino, 0, bufsize, bufsize, CONTENTS); fd = open(FULLPATH, O_WRONLY); - EXPECT_LE(0, fd) << strerror(errno); + ASSERT_LE(0, fd) << strerror(errno); ASSERT_EQ(bufsize, write(fd, CONTENTS, bufsize)) << strerror(errno); leak(fd); @@ -667,7 +667,7 @@ TEST_F(Write, write_large) &contents[halfbufsize / sizeof(int)]); fd = open(FULLPATH, O_WRONLY); - EXPECT_LE(0, fd) << strerror(errno); + ASSERT_LE(0, fd) << strerror(errno); ASSERT_EQ(bufsize, write(fd, contents, bufsize)) << strerror(errno); leak(fd); @@ -688,7 +688,7 @@ TEST_F(Write, write_nothing) expect_open(ino, 0, 1); fd = open(FULLPATH, O_WRONLY); - EXPECT_LE(0, fd) << strerror(errno); + ASSERT_LE(0, fd) << strerror(errno); ASSERT_EQ(bufsize, write(fd, CONTENTS, bufsize)) << strerror(errno); leak(fd); @@ -708,7 +708,7 @@ TEST_F(Write_7_8, write) expect_write_7_8(ino, 0, bufsize, bufsize, CONTENTS); fd = open(FULLPATH, O_WRONLY); - EXPECT_LE(0, fd) << strerror(errno); + ASSERT_LE(0, fd) << strerror(errno); ASSERT_EQ(bufsize, write(fd, CONTENTS, bufsize)) << strerror(errno); leak(fd); @@ -854,7 +854,7 @@ TEST_F(WriteBack, rmw) maybe_expect_write(ino, offset, bufsize, CONTENTS); fd = open(FULLPATH, O_WRONLY); - EXPECT_LE(0, fd) << strerror(errno); + ASSERT_LE(0, fd) << strerror(errno); ASSERT_EQ(bufsize, pwrite(fd, CONTENTS, bufsize, offset)) << strerror(errno); @@ -879,7 +879,7 @@ TEST_F(WriteBack, cache) expect_write(ino, 0, bufsize, bufsize, CONTENTS); fd = open(FULLPATH, O_RDWR); - EXPECT_LE(0, fd) << strerror(errno); + ASSERT_LE(0, fd) << strerror(errno); ASSERT_EQ(bufsize, write(fd, CONTENTS, bufsize)) << strerror(errno); /* @@ -913,7 +913,7 @@ TEST_F(WriteBack, o_direct) expect_read(ino, 0, bufsize, bufsize, CONTENTS); fd = open(FULLPATH, O_RDWR | O_DIRECT); - EXPECT_LE(0, fd) << strerror(errno); + ASSERT_LE(0, fd) << strerror(errno); ASSERT_EQ(bufsize, write(fd, CONTENTS, bufsize)) << strerror(errno); /* A subsequent read must query the daemon because cache is empty */ @@ -940,7 +940,7 @@ TEST_F(WriteBack, direct_io) expect_read(ino, 0, bufsize, bufsize, CONTENTS); fd = open(FULLPATH, O_RDWR); - EXPECT_LE(0, fd) << strerror(errno); + ASSERT_LE(0, fd) << strerror(errno); ASSERT_EQ(bufsize, write(fd, CONTENTS, bufsize)) << strerror(errno); /* A subsequent read must query the daemon because cache is empty */ @@ -980,7 +980,7 @@ TEST_F(WriteBack, mmap_direct_io) expect_release(ino, ReturnErrno(0)); fd = open(FULLPATH, O_RDWR); - EXPECT_LE(0, fd) << strerror(errno); + ASSERT_LE(0, fd) << strerror(errno); p = mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); ASSERT_NE(MAP_FAILED, p) << strerror(errno); @@ -1016,7 +1016,7 @@ TEST_F(WriteBackAsync, delay) ).Times(0); fd = open(FULLPATH, O_RDWR); - EXPECT_LE(0, fd) << strerror(errno); + ASSERT_LE(0, fd) << strerror(errno); ASSERT_EQ(bufsize, write(fd, CONTENTS, bufsize)) << strerror(errno); @@ -1051,7 +1051,7 @@ TEST_F(WriteBackAsync, direct_io_ignores_unrelated_cac CONTENTS1); fd = open(FULLPATH, O_RDWR); - EXPECT_LE(0, fd) << strerror(errno); + ASSERT_LE(0, fd) << strerror(errno); // Cache first block with dirty data. This will entail first reading // the existing data. @@ -1105,7 +1105,7 @@ TEST_F(WriteBackAsync, direct_io_partially_overlaps_ca expect_open(ino, 0, 1); fd = open(FULLPATH, O_RDWR); - EXPECT_LE(0, fd) << strerror(errno); + ASSERT_LE(0, fd) << strerror(errno); /* Cache first and third blocks with dirty data. */ ASSERT_EQ(3 * bs, pwrite(fd, zeros, 3 * bs, 0)) << strerror(errno); @@ -1178,7 +1178,7 @@ TEST_F(WriteBackAsync, eof) expect_read(ino, 0, m_maxbcachebuf, old_filesize, CONTENTS0); fd = open(FULLPATH, O_RDWR); - EXPECT_LE(0, fd) << strerror(errno); + ASSERT_LE(0, fd) << strerror(errno); /* Write and cache data beyond EOF */ ASSERT_EQ(wbufsize, pwrite(fd, CONTENTS1, wbufsize, offset)) @@ -1248,7 +1248,7 @@ TEST_F(WriteBackAsync, timestamps) }))); fd = open(FULLPATH, O_RDWR); - EXPECT_LE(0, fd) << strerror(errno); + ASSERT_LE(0, fd) << strerror(errno); ASSERT_EQ(bufsize, write(fd, CONTENTS, bufsize)) << strerror(errno); ASSERT_EQ(0, fstat(fd, &sb)) << strerror(errno); @@ -1287,7 +1287,7 @@ TEST_F(WriteBackAsync, timestamps_during_setattr) }))); fd = open(FULLPATH, O_RDWR); - EXPECT_LE(0, fd) << strerror(errno); + ASSERT_LE(0, fd) << strerror(errno); ASSERT_EQ(bufsize, write(fd, CONTENTS, bufsize)) << strerror(errno); ASSERT_EQ(0, fchmod(fd, newmode)) << strerror(errno); @@ -1324,7 +1324,7 @@ TEST_P(TimeGran, timestamps_during_setattr) }))); fd = open(FULLPATH, O_RDWR); - EXPECT_LE(0, fd) << strerror(errno); + ASSERT_LE(0, fd) << strerror(errno); ASSERT_EQ(bufsize, write(fd, CONTENTS, bufsize)) << strerror(errno); ASSERT_EQ(0, fchmod(fd, newmode)) << strerror(errno); @@ -1351,7 +1351,7 @@ TEST_F(Write, writethrough) expect_write(ino, 0, bufsize, bufsize, CONTENTS); fd = open(FULLPATH, O_RDWR); - EXPECT_LE(0, fd) << strerror(errno); + ASSERT_LE(0, fd) << strerror(errno); ASSERT_EQ(bufsize, write(fd, CONTENTS, bufsize)) << strerror(errno); /* @@ -1379,7 +1379,7 @@ TEST_F(Write, update_file_size) expect_write(ino, 0, bufsize, bufsize, CONTENTS); fd = open(FULLPATH, O_RDWR); - EXPECT_LE(0, fd) << strerror(errno); + ASSERT_LE(0, fd) << strerror(errno); ASSERT_EQ(bufsize, write(fd, CONTENTS, bufsize)) << strerror(errno); /* Get cached attributes */ From owner-svn-src-all@freebsd.org Fri Oct 2 17:33:56 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C90CE4323ED; Fri, 2 Oct 2020 17:33:56 +0000 (UTC) (envelope-from nick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2xtX4vqLz4RVP; Fri, 2 Oct 2020 17:33:56 +0000 (UTC) (envelope-from nick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8B3F92573F; Fri, 2 Oct 2020 17:33:56 +0000 (UTC) (envelope-from nick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 092HXuWq092381; Fri, 2 Oct 2020 17:33:56 GMT (envelope-from nick@FreeBSD.org) Received: (from nick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 092HXukj092380; Fri, 2 Oct 2020 17:33:56 GMT (envelope-from nick@FreeBSD.org) Message-Id: <202010021733.092HXukj092380@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nick set sender to nick@FreeBSD.org using -f From: "Nick O'Brien" Date: Fri, 2 Oct 2020 17:33:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366366 - head/sys/dev/flash X-SVN-Group: head X-SVN-Commit-Author: nick X-SVN-Commit-Paths: head/sys/dev/flash X-SVN-Commit-Revision: 366366 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Oct 2020 17:33:56 -0000 Author: nick Date: Fri Oct 2 17:33:56 2020 New Revision: 366366 URL: https://svnweb.freebsd.org/changeset/base/366366 Log: flash: Add support for SPI flash s25fl512s Reviewed by: kp Approved by: kp (mentor) Sponsored by: Axiado Modified: head/sys/dev/flash/mx25l.c Modified: head/sys/dev/flash/mx25l.c ============================================================================== --- head/sys/dev/flash/mx25l.c Fri Oct 2 17:06:05 2020 (r366365) +++ head/sys/dev/flash/mx25l.c Fri Oct 2 17:33:56 2020 (r366366) @@ -133,6 +133,7 @@ static struct mx25l_flash_ident flash_devices[] = { { "s25fl064", 0x01, 0x0216, 64 * 1024, 128, FL_NONE }, { "s25fl128", 0x01, 0x2018, 64 * 1024, 256, FL_NONE }, { "s25fl256s", 0x01, 0x0219, 64 * 1024, 512, FL_NONE }, + { "s25fl512s", 0x01, 0x0220, 64 * 1024, 1024, FL_NONE }, { "SST25VF010A", 0xbf, 0x2549, 4 * 1024, 32, FL_ERASE_4K | FL_ERASE_32K }, { "SST25VF032B", 0xbf, 0x254a, 64 * 1024, 64, FL_ERASE_4K | FL_ERASE_32K }, From owner-svn-src-all@freebsd.org Fri Oct 2 17:49:13 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B737F432A32; Fri, 2 Oct 2020 17:49:13 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2yD94MTpz4SBm; Fri, 2 Oct 2020 17:49:13 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 79655258DA; Fri, 2 Oct 2020 17:49:13 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 092HnDZa099180; Fri, 2 Oct 2020 17:49:13 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 092HnDHS099179; Fri, 2 Oct 2020 17:49:13 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202010021749.092HnDHS099179@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 2 Oct 2020 17:49:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366367 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 366367 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Oct 2020 17:49:13 -0000 Author: markj Date: Fri Oct 2 17:49:13 2020 New Revision: 366367 URL: https://svnweb.freebsd.org/changeset/base/366367 Log: Simplify the check for non-dumpable VM object types OBJT_DEFAULT, _SWAP, _VNODE and _PHYS is exactly the set of non-fictitious object types, so just check for OBJ_FICTITIOUS. The check no longer excludes dead objects, but such objects have to be handled regardless. No functional change intended. Reviewed by: alc, dougm, kib Tested by: pho MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26589 Modified: head/sys/kern/imgact_elf.c Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Fri Oct 2 17:33:56 2020 (r366366) +++ head/sys/kern/imgact_elf.c Fri Oct 2 17:49:13 2020 (r366367) @@ -1760,7 +1760,7 @@ each_dumpable_segment(struct thread *td, segment_callb vm_map_t map = &p->p_vmspace->vm_map; vm_map_entry_t entry; vm_object_t backing_object, object; - boolean_t ignore_entry; + bool ignore_entry; vm_map_lock_read(map); VM_MAP_ENTRY_FOREACH(entry, map) { @@ -1799,9 +1799,7 @@ each_dumpable_segment(struct thread *td, segment_callb VM_OBJECT_RUNLOCK(object); object = backing_object; } - ignore_entry = object->type != OBJT_DEFAULT && - object->type != OBJT_SWAP && object->type != OBJT_VNODE && - object->type != OBJT_PHYS; + ignore_entry = (object->flags & OBJ_FICTITIOUS) != 0; VM_OBJECT_RUNLOCK(object); if (ignore_entry) continue; From owner-svn-src-all@freebsd.org Fri Oct 2 17:50:24 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2CE30432C92; Fri, 2 Oct 2020 17:50:24 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2yFX0PLwz4SHy; Fri, 2 Oct 2020 17:50:24 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E5FB125E2E; Fri, 2 Oct 2020 17:50:23 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 092HoN5t099313; Fri, 2 Oct 2020 17:50:23 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 092HoNDR099310; Fri, 2 Oct 2020 17:50:23 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202010021750.092HoNDR099310@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 2 Oct 2020 17:50:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366368 - in head/sys: kern vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: kern vm X-SVN-Commit-Revision: 366368 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Oct 2020 17:50:24 -0000 Author: markj Date: Fri Oct 2 17:50:22 2020 New Revision: 366368 URL: https://svnweb.freebsd.org/changeset/base/366368 Log: Implement sparse core dumps Currently we allocate and map zero-filled anonymous pages when dumping core. This can result in lots of needless disk I/O and page allocations. This change tries to make the core dumper more clever and represent unbacked ranges of virtual memory by holes in the core dump file. Add a new page fault type, VM_FAULT_NOFILL, which causes vm_fault() to clean up and return an error when it would otherwise map a zero-filled page. Then, in the core dumper code, prefault all user pages and handle errors by simply extending the size of the core file. This also fixes a bug related to the fact that vn_io_fault1() does not attempt partial I/O in the face of errors from vm_fault_quick_hold_pages(): if a truncated file is mapped into a user process, an attempt to dump beyond the end of the file results in an error, but this means that valid pages immediately preceding the end of the file might not have been dumped either. The change reduces the core dump size of trivial programs by a factor of ten simply by excluding unaccessed libc.so pages. PR: 249067 Reviewed by: kib Tested by: pho MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26590 Modified: head/sys/kern/imgact_elf.c head/sys/vm/vm_fault.c head/sys/vm/vm_map.h Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Fri Oct 2 17:49:13 2020 (r366367) +++ head/sys/kern/imgact_elf.c Fri Oct 2 17:50:22 2020 (r366368) @@ -1459,7 +1459,7 @@ extern int compress_user_cores_level; static void cb_put_phdr(vm_map_entry_t, void *); static void cb_size_segment(vm_map_entry_t, void *); static int core_write(struct coredump_params *, const void *, size_t, off_t, - enum uio_seg); + enum uio_seg, size_t *); static void each_dumpable_segment(struct thread *, segment_callback, void *); static int __elfN(corehdr)(struct coredump_params *, int, void *, size_t, struct note_info_list *, size_t); @@ -1519,46 +1519,88 @@ core_compressed_write(void *base, size_t len, off_t of { return (core_write((struct coredump_params *)arg, base, len, offset, - UIO_SYSSPACE)); + UIO_SYSSPACE, NULL)); } static int core_write(struct coredump_params *p, const void *base, size_t len, - off_t offset, enum uio_seg seg) + off_t offset, enum uio_seg seg, size_t *resid) { return (vn_rdwr_inchunks(UIO_WRITE, p->vp, __DECONST(void *, base), len, offset, seg, IO_UNIT | IO_DIRECT | IO_RANGELOCKED, - p->active_cred, p->file_cred, NULL, p->td)); + p->active_cred, p->file_cred, resid, p->td)); } static int -core_output(void *base, size_t len, off_t offset, struct coredump_params *p, +core_output(char *base, size_t len, off_t offset, struct coredump_params *p, void *tmpbuf) { + vm_map_t map; + struct mount *mp; + size_t resid, runlen; int error; + bool success; + KASSERT((uintptr_t)base % PAGE_SIZE == 0, + ("%s: user address %#lx is not page-aligned", + __func__, (uintptr_t)base)); + if (p->comp != NULL) return (compress_chunk(p, base, tmpbuf, len)); - /* - * EFAULT is a non-fatal error that we can get, for example, - * if the segment is backed by a file but extends beyond its - * end. - */ - error = core_write(p, base, len, offset, UIO_USERSPACE); - if (error == EFAULT) { - log(LOG_WARNING, "Failed to fully fault in a core file segment " - "at VA %p with size 0x%zx to be written at offset 0x%jx " - "for process %s\n", base, len, offset, curproc->p_comm); - + map = &p->td->td_proc->p_vmspace->vm_map; + for (; len > 0; base += runlen, offset += runlen, len -= runlen) { /* - * Write a "real" zero byte at the end of the target region - * in the case this is the last segment. - * The intermediate space will be implicitly zero-filled. + * Attempt to page in all virtual pages in the range. If a + * virtual page is not backed by the pager, it is represented as + * a hole in the file. This can occur with zero-filled + * anonymous memory or truncated files, for example. */ - error = core_write(p, zero_region, 1, offset + len - 1, - UIO_SYSSPACE); + for (runlen = 0; runlen < len; runlen += PAGE_SIZE) { + error = vm_fault(map, (uintptr_t)base + runlen, + VM_PROT_READ, VM_FAULT_NOFILL, NULL); + if (runlen == 0) + success = error == KERN_SUCCESS; + else if ((error == KERN_SUCCESS) != success) + break; + } + + if (success) { + error = core_write(p, base, runlen, offset, + UIO_USERSPACE, &resid); + if (error != 0) { + if (error != EFAULT) + break; + + /* + * EFAULT may be returned if the user mapping + * could not be accessed, e.g., because a mapped + * file has been truncated. Skip the page if no + * progress was made, to protect against a + * hypothetical scenario where vm_fault() was + * successful but core_write() returns EFAULT + * anyway. + */ + runlen -= resid; + if (runlen == 0) { + success = false; + runlen = PAGE_SIZE; + } + } + } + if (!success) { + error = vn_start_write(p->vp, &mp, V_WAIT); + if (error != 0) + break; + vn_lock(p->vp, LK_EXCLUSIVE | LK_RETRY); + error = vn_truncate_locked(p->vp, offset + runlen, + false, p->td->td_ucred); + VOP_UNLOCK(p->vp); + vn_finished_write(mp); + if (error != 0) + break; + } } return (error); } @@ -1589,7 +1631,7 @@ sbuf_drain_core_output(void *arg, const char *data, in error = compressor_write(p->comp, __DECONST(char *, data), len); else error = core_write(p, __DECONST(void *, data), len, p->offset, - UIO_SYSSPACE); + UIO_SYSSPACE, NULL); if (locked) PROC_LOCK(p->td->td_proc); if (error != 0) @@ -1681,7 +1723,7 @@ __elfN(coredump)(struct thread *td, struct vnode *vp, php = (Elf_Phdr *)((char *)hdr + sizeof(Elf_Ehdr)) + 1; offset = round_page(hdrsize + notesz); for (i = 0; i < seginfo.count; i++) { - error = core_output((caddr_t)(uintptr_t)php->p_vaddr, + error = core_output((char *)(uintptr_t)php->p_vaddr, php->p_filesz, offset, ¶ms, tmpbuf); if (error != 0) break; Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Fri Oct 2 17:49:13 2020 (r366367) +++ head/sys/vm/vm_fault.c Fri Oct 2 17:50:22 2020 (r366368) @@ -1476,6 +1476,12 @@ RetryFault: */ if (vm_fault_next(&fs)) continue; + if ((fs.fault_flags & VM_FAULT_NOFILL) != 0) { + if (fs.first_object == fs.object) + fault_page_free(&fs.first_m); + unlock_and_deallocate(&fs); + return (KERN_OUT_OF_BOUNDS); + } VM_OBJECT_WUNLOCK(fs.object); vm_fault_zerofill(&fs); /* Don't try to prefault neighboring pages. */ Modified: head/sys/vm/vm_map.h ============================================================================== --- head/sys/vm/vm_map.h Fri Oct 2 17:49:13 2020 (r366367) +++ head/sys/vm/vm_map.h Fri Oct 2 17:50:22 2020 (r366368) @@ -384,9 +384,10 @@ long vmspace_resident_count(struct vmspace *vmspace); /* * vm_fault option flags */ -#define VM_FAULT_NORMAL 0 /* Nothing special */ -#define VM_FAULT_WIRE 1 /* Wire the mapped page */ -#define VM_FAULT_DIRTY 2 /* Dirty the page; use w/VM_PROT_COPY */ +#define VM_FAULT_NORMAL 0x00 /* Nothing special */ +#define VM_FAULT_WIRE 0x01 /* Wire the mapped page */ +#define VM_FAULT_DIRTY 0x02 /* Dirty the page; use w/VM_PROT_COPY */ +#define VM_FAULT_NOFILL 0x04 /* Fail if the pager doesn't have a copy */ /* * Initially, mappings are slightly sequential. The maximum window size must From owner-svn-src-all@freebsd.org Fri Oct 2 18:18:03 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B7EBA43332A; Fri, 2 Oct 2020 18:18:03 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2ysR4rMxz4TRr; Fri, 2 Oct 2020 18:18:03 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 70ECD26406; Fri, 2 Oct 2020 18:18:03 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 092II3vF017607; Fri, 2 Oct 2020 18:18:03 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 092II1l5017598; Fri, 2 Oct 2020 18:18:01 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202010021818.092II1l5017598@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 2 Oct 2020 18:18:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366369 - in head: share/man/man9 sys/conf sys/dev/backlight sys/modules sys/modules/backlight sys/sys X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head: share/man/man9 sys/conf sys/dev/backlight sys/modules sys/modules/backlight sys/sys X-SVN-Commit-Revision: 366369 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Oct 2020 18:18:03 -0000 Author: manu Date: Fri Oct 2 18:18:01 2020 New Revision: 366369 URL: https://svnweb.freebsd.org/changeset/base/366369 Log: Add backlight subsystem This is a simple subsystem that allow drivers to register as a backlight. Each backlight creates a device node under /dev/backlight/backlightX and an alias based on the name provided. Relnotes: yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26250 Added: head/share/man/man9/backlight.9 (contents, props changed) head/sys/dev/backlight/ head/sys/dev/backlight/backlight.c (contents, props changed) head/sys/dev/backlight/backlight.h (contents, props changed) head/sys/dev/backlight/backlight_if.m (contents, props changed) head/sys/modules/backlight/ head/sys/modules/backlight/Makefile (contents, props changed) head/sys/sys/backlight.h (contents, props changed) Modified: head/share/man/man9/Makefile head/sys/conf/files head/sys/modules/Makefile Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Fri Oct 2 17:50:22 2020 (r366368) +++ head/share/man/man9/Makefile Fri Oct 2 18:18:01 2020 (r366369) @@ -10,6 +10,7 @@ MAN= accept_filter.9 \ alq.9 \ altq.9 \ atomic.9 \ + backlight.9 \ bhnd.9 \ bhnd_erom.9 \ bios.9 \ Added: head/share/man/man9/backlight.9 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man9/backlight.9 Fri Oct 2 18:18:01 2020 (r366369) @@ -0,0 +1,77 @@ +.\" Copyright (c) 2020 Emmanuel Vadot +.\" +.\" 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 DEVELOPERS ``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 DEVELOPERS 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. +.\" +.\" $FreeBSD$ +.\" +.Dd October 02, 2020 +.Dt BACKLIGHT 9 +.Os +.Sh NAME +.Nm backlight , +.Nm backlight_register , +.Nm backlight_destroy , +.Nm BACKLIGHT_GET_STATUS , +.Nm BACKLIGHT_SET_STATUS , +.Nd BACKLIGHT methods +.Sh SYNOPSIS +.Cd "device backlight" +.In "backlight_if.h" +.In "sys/sys/backlight.h" +.Ft int +.Fn BACKLIGHT_GET_STATUS "device_t bus" "struct backlight_props *props" +.Ft int +.Fn BACKLIGHT_SET_STATUS "device_t bus" "struct backlight_props *props" +.Ft struct cdev * +.Fn backlight_register "const char *name" "device_t dev" +.Ft int +.Fn backlight_destroy "struct cdev *cdev" +.Sh DESCRIPTION +The backlight driver provides a generic way for handling a panel backlight. +.Pp +Drivers for backlight system register themselves globally using the +.Fn backlight_register +function. +They must define two methods, +.Fn BACKLIGHT_GET_STATUS +which is used to query the current brightness level and +.Fn BACKLIGHT_SET_STATUS +which is used to update it. +.Sh INTERFACE +.Bl -tag -width indent +.It Fn BACKLIGHT_GET_STATUS "device_t bus" "struct backlight_props *props" +Driver fills the current brightless level and the optional supported levels. +.It Fn BACKLIGHT_SET_STATUS "device_t bus" "struct backlight_props *props" +Driver update the backlight level based on the brightness member of the props +struct. +.El +.Sh FILES +.Bl -tag -width "/dev/backlight/*" +.It Pa /dev/backlight/* +.Sh HISTORY +The +.Nm backlight +interface first appear in +.Fx 13.0 . +The +.Nm backlight +driver and manual page was written by +.An Emmanuel Vadot Aq Mt manu@FreeBSD.org . Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Oct 2 17:50:22 2020 (r366368) +++ head/sys/conf/files Fri Oct 2 18:18:01 2020 (r366369) @@ -1312,6 +1312,8 @@ dev/ath/ath_rate/sample/sample.c optional ath_rate_sam dev/ath/ath_dfs/null/dfs_null.c optional ath \ compile-with "${NORMAL_C} -I$S/dev/ath" # +dev/backlight/backlight_if.m optional backlight +dev/backlight/backlight.c optional backlight dev/bce/if_bce.c optional bce dev/bfe/if_bfe.c optional bfe dev/bge/if_bge.c optional bge Added: head/sys/dev/backlight/backlight.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/backlight/backlight.c Fri Oct 2 18:18:01 2020 (r366369) @@ -0,0 +1,170 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2020 Emmanuel Vadot + * + * 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. + * + * $FreeBSD$ + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "backlight_if.h" + +static struct sx backlight_sx; +static MALLOC_DEFINE(M_BACKLIGHT, "BACKLIGHT", "Backlight driver"); +static struct unrhdr *backlight_unit; + +struct backlight_softc { + struct cdev *cdev; + struct cdev *alias; + int unit; + device_t dev; + uint32_t cached_brightness; +}; + +static int +backlight_ioctl(struct cdev *dev, u_long cmd, caddr_t data, + int fflag, struct thread *td) +{ + struct backlight_softc *sc; + struct backlight_props props; + struct backlight_info info; + int error; + + sc = dev->si_drv1; + + switch (cmd) { + case BACKLIGHTGETSTATUS: + /* Call the driver function so it fills up the props */ + bcopy(data, &props, sizeof(struct backlight_props)); + error = BACKLIGHT_GET_STATUS(sc->dev, &props); + if (error == 0) + bcopy(&props, data, sizeof(struct backlight_props)); + break; + case BACKLIGHTUPDATESTATUS: + bcopy(data, &props, sizeof(struct backlight_props)); + if (props.brightness == sc->cached_brightness) + return (0); + error = BACKLIGHT_UPDATE_STATUS(sc->dev, &props); + if (error == 0) { + bcopy(&props, data, sizeof(struct backlight_props)); + sc->cached_brightness = props.brightness; + } + break; + case BACKLIGHTGETINFO: + memset(&info, 0, sizeof(info)); + error = BACKLIGHT_GET_INFO(sc->dev, &info); + if (error == 0) + bcopy(&info, data, sizeof(struct backlight_info)); + break; + } + + return (error); +} + +static struct cdevsw backlight_cdevsw = { + .d_version = D_VERSION, + .d_ioctl = backlight_ioctl, + .d_name = "backlight", +}; + +struct cdev * +backlight_register(const char *name, device_t dev) +{ + struct make_dev_args args; + struct backlight_softc *sc; + struct backlight_props props; + int error; + + sc = malloc(sizeof(*sc), M_BACKLIGHT, M_WAITOK | M_ZERO); + + sx_xlock(&backlight_sx); + sc->unit = alloc_unr(backlight_unit); + sc->dev = dev; + make_dev_args_init(&args); + args.mda_flags = MAKEDEV_CHECKNAME | MAKEDEV_WAITOK; + args.mda_devsw = &backlight_cdevsw; + args.mda_uid = UID_ROOT; + args.mda_gid = GID_VIDEO; + args.mda_mode = 0660; + args.mda_si_drv1 = sc; + error = make_dev_s(&args, &sc->cdev, "backlight/backlight%d", sc->unit); + + if (error != 0) + goto fail; + + error = make_dev_alias_p(MAKEDEV_CHECKNAME | MAKEDEV_WAITOK, + &sc->alias, sc->cdev, "backlight/%s%d", name, sc->unit); + if (error != 0) + device_printf(dev, "Cannot register with alias %s%d\n", name, + sc->unit); + + sx_xunlock(&backlight_sx); + + error = BACKLIGHT_GET_STATUS(sc->dev, &props); + sc->cached_brightness = props.brightness; + + return (sc->cdev); +fail: + sx_xunlock(&backlight_sx); + return (NULL); +} + +int +backlight_destroy(struct cdev *dev) +{ + struct backlight_softc *sc; + + sc = dev->si_drv1; + sx_xlock(&backlight_sx); + free_unr(backlight_unit, sc->unit); + destroy_dev(dev); + sx_xunlock(&backlight_sx); + return (0); +} + +static void +backlight_drvinit(void *unused) +{ + + backlight_unit = new_unrhdr(0, INT_MAX, NULL); + sx_init(&backlight_sx, "Backlight sx"); +} + +SYSINIT(backlightdev, SI_SUB_DRIVERS, SI_ORDER_MIDDLE, backlight_drvinit, NULL); +MODULE_VERSION(backlight, 1); Added: head/sys/dev/backlight/backlight.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/backlight/backlight.h Fri Oct 2 18:18:01 2020 (r366369) @@ -0,0 +1,33 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2020 Emmanuel Vadot + * + * 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. + * + * $FreeBSD$ + */ + +#include + +struct cdev *backlight_register(const char *name, device_t dev); +int backlight_destroy(struct cdev *dev); Added: head/sys/dev/backlight/backlight_if.m ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/backlight/backlight_if.m Fri Oct 2 18:18:01 2020 (r366369) @@ -0,0 +1,66 @@ +#- +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2020 Emmanuel Vadot +# +# 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. +# +# $FreeBSD$ + +#include + +INTERFACE backlight; + +CODE { + static int + backlight_default_update_status(device_t dev, struct backlight_props *props) + { + return (EOPNOTSUPP); + } + + static int + backlight_default_get_status(device_t dev, struct backlight_props *props) + { + return (EOPNOTSUPP); + } + + static int + backlight_default_get_info(device_t dev, struct backlight_info *info) + { + return (EOPNOTSUPP); + } +}; + +METHOD int update_status { + device_t dev; + struct backlight_props *props; +} DEFAULT backlight_default_update_status; + +METHOD int get_status { + device_t dev; + struct backlight_props *props; +} DEFAULT backlight_default_get_status; + +METHOD int get_info { + device_t dev; + struct backlight_info *info; +} DEFAULT backlight_default_get_info; Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Fri Oct 2 17:50:22 2020 (r366368) +++ head/sys/modules/Makefile Fri Oct 2 18:18:01 2020 (r366369) @@ -59,6 +59,7 @@ SUBDIR= \ ath_rate \ ath_pci \ ${_autofs} \ + backlight \ ${_bce} \ ${_bcm283x_clkman} \ ${_bcm283x_pwm} \ Added: head/sys/modules/backlight/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/backlight/Makefile Fri Oct 2 18:18:01 2020 (r366369) @@ -0,0 +1,13 @@ +# $FreeBSD$ + +.PATH: ${SRCTOP}/sys/dev/backlight +KMOD= backlight +SRCS= backlight.c + +SRCS+= bus_if.h \ + device_if.h \ + opt_platform.h \ + backlight_if.h \ + backlight_if.c + +.include Added: head/sys/sys/backlight.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/sys/backlight.h Fri Oct 2 18:18:01 2020 (r366369) @@ -0,0 +1,61 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2020 Emmanuel Vadot + * + * 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. + * + * $FreeBSD$ + */ + +#ifndef __BACKLIGHT_H__ +#define __BACKLIGHT_H__ + +#define BACKLIGHTMAXLEVELS 100 + +struct backlight_props { + uint32_t brightness; + uint32_t nlevels; + uint32_t levels[BACKLIGHTMAXLEVELS]; +}; + +enum backlight_info_type { + BACKLIGHT_TYPE_PANEL = 0, + BACKLIGHT_TYPE_KEYBOARD +}; + +#define BACKLIGHTMAXNAMELENGTH 64 + +struct backlight_info { + char name[BACKLIGHTMAXNAMELENGTH]; + enum backlight_info_type type; +}; + +/* + * ioctls + */ + +#define BACKLIGHTGETSTATUS _IOWR('G', 0, struct backlight_props) +#define BACKLIGHTUPDATESTATUS _IOWR('G', 1, struct backlight_props) +#define BACKLIGHTGETINFO _IOWR('G', 2, struct backlight_info) + +#endif /* __BACKLIGHT_H__ */ From owner-svn-src-all@freebsd.org Fri Oct 2 18:21:31 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CE76F433516; Fri, 2 Oct 2020 18:21:31 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2yxR590Cz4Tcs; Fri, 2 Oct 2020 18:21:31 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 94792261D8; Fri, 2 Oct 2020 18:21:31 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 092ILVo4018592; Fri, 2 Oct 2020 18:21:31 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 092ILUh4018589; Fri, 2 Oct 2020 18:21:30 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202010021821.092ILUh4018589@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 2 Oct 2020 18:21:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366370 - in head/usr.bin: . backlight X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/usr.bin: . backlight X-SVN-Commit-Revision: 366370 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Oct 2020 18:21:31 -0000 Author: manu Date: Fri Oct 2 18:21:30 2020 New Revision: 366370 URL: https://svnweb.freebsd.org/changeset/base/366370 Log: Add backlight(8) This tool is used to configure registered backlights. It can incr/decr (default to 10%) or accept a percentage value directly. Reviewed by: manpages (gbe@) Relnotes: yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26251 Added: head/usr.bin/backlight/ head/usr.bin/backlight/Makefile (contents, props changed) head/usr.bin/backlight/backlight.8 (contents, props changed) head/usr.bin/backlight/backlight.c (contents, props changed) Modified: head/usr.bin/Makefile Modified: head/usr.bin/Makefile ============================================================================== --- head/usr.bin/Makefile Fri Oct 2 18:18:01 2020 (r366369) +++ head/usr.bin/Makefile Fri Oct 2 18:21:30 2020 (r366370) @@ -7,6 +7,7 @@ SUBDIR= alias \ apply \ asa \ awk \ + backlight \ banner \ basename \ brandelf \ Added: head/usr.bin/backlight/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/backlight/Makefile Fri Oct 2 18:21:30 2020 (r366370) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +PROG= backlight +MAN= backlight.8 + +.include Added: head/usr.bin/backlight/backlight.8 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/backlight/backlight.8 Fri Oct 2 18:21:30 2020 (r366370) @@ -0,0 +1,95 @@ +.\" Copyright (c) 2020 Emmanuel Vadot +.\" +.\" 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 DEVELOPERS ``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 DEVELOPERS 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. +.\" +.\" $FreeBSD$ +.\" +.Dd October 02, 2020 +.Dt BACKLIGHT 8 +.Os +.Sh NAME +.Nm backlight +.Nd configure backlight hardware +.Sh SYNOPSIS +.Nm +.Op Fl f Ar device +.Op Fl q +.Op Fl i +.Op Ar value +.Nm +.Op Fl f Ar device +incr | + +.Op Ar value +.Nm +.Op Fl f Ar device +decr | - +.Op Ar value +.Sh DESCRIPTION +The +.Nm +utility can be used to configure brightness levels for registered backlights +.Pp +The options are as follows: +.Bl -tag -width "-f device" +.It Fl f Ar device +Device to operate on. +If not specified, +.Pa /dev/backlight/backlight0 +is used. +If an unqualified name is provided, +.Pa /dev/backlight +is automatically prepended. +.It Fl q +When querying the brightness level only print the value. +.It Fl i +Query information about the backlight (name, type). +.It Ar value +Set the brightness level to this value, must be between 0 and 100. +.It Ar incr | + +.Op Ar value +Decrement the backlight level. +If no value is specified a default of 10 percent is used. +.It Ar decr | - +.Op Ar value +Increment the backlight level. +If no value is specified a default of 10 percent is used. +.El +.Sh EXAMPLES +.Bl -bullet +.It +Show the current brightness level +.Bd -literal +backlight -f /dev/backlight/backlight0 +.Ed +.El +.Sh SEE ALSO +.Xr backlight 9 +.Sh HISTORY +The +.Nm +utility appeared in +.Fx 13.0 . +.Sh AUTHORS +.An -nosplit +The +.Nm +utility and this manual page were written by +.An Emmanuel Vadot Aq Mt manu@FreeBSD.org . Added: head/usr.bin/backlight/backlight.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/backlight/backlight.c Fri Oct 2 18:21:30 2020 (r366370) @@ -0,0 +1,220 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2020 Emmanuel Vadot + * + * 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. + * + * $FreeBSD$ + */ + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define BACKLIGHT_QUERY 0x0001 +#define BACKLIGHT_SET_BRIGHTNESS 0x0002 +#define BACKLIGHT_INCR 0x0004 +#define BACKLIGHT_DECR 0x0008 +#define BACKLIGHT_INFO 0x0010 + +static char device_name[PATH_MAX] = "/dev/backlight/backlight0"; + +static void +set_device_name(const char *name) +{ + + if (name[0] == '/') + strlcpy(device_name, name, sizeof(device_name)); + else + snprintf(device_name, sizeof(device_name), "/dev/backlight/%s", name); +} + +static void +usage(void) +{ + fprintf(stderr, "Usage:\n"); + fprintf(stderr, "\tbacklight [-f dev]\n"); + fprintf(stderr, "\tbacklight [-f dev] -i\n"); + fprintf(stderr, "\tbacklight [-f dev] \n"); + fprintf(stderr, "\tbacklight [-f dev] incr|+ \n"); + fprintf(stderr, "\tbacklight [-f dev] decr|- \n"); + exit(1); +} + +static const char * +backlight_type_to_string(enum backlight_info_type type) +{ + switch (type) { + case BACKLIGHT_TYPE_PANEL: + return ("Panel"); + case BACKLIGHT_TYPE_KEYBOARD: + return ("Keyboard"); + } + + return ("Unknown"); +} + +int +main(int argc, char *argv[]) +{ + struct backlight_props props; + struct backlight_info info; + int fd; + int action, ch; + cap_rights_t right_ioctl; + const unsigned long backlight_ioctls[] = { + BACKLIGHTGETSTATUS, + BACKLIGHTUPDATESTATUS, + BACKLIGHTGETINFO}; + long percent = 0; + const char *percent_error; + uint32_t i; + bool setname; + bool quiet = false; + + action = BACKLIGHT_QUERY; + setname = false; + fd = -1; + + while ((ch = getopt(argc, argv, "f:qhi")) != -1) { + switch (ch) { + case 'q': + quiet = true; + break; + case 'f': + setname = true; + set_device_name(optarg); + break; + case 'i': + action = BACKLIGHT_INFO; + break; + case 'h': + usage(); + break; + } + } + + argc -= optind; + argv += optind; + if (argc != 0) { + if (strcmp("incr", argv[0]) == 0 || + strcmp("+", argv[0]) == 0) { + action = BACKLIGHT_INCR; + argc -= 1; + argv += 1; + } + else if (strcmp("decr", argv[0]) == 0 || + strcmp("-", argv[0]) == 0) { + action = BACKLIGHT_DECR; + argc -= 1; + argv += 1; + } else + action = BACKLIGHT_SET_BRIGHTNESS; + + if (argc == 1) { + percent = strtonum(argv[0], 0, 100, &percent_error); + if (percent_error) + errx(1, "Cannot parse brightness level %s: %s", + argv[0], + percent_error); + } + } + + if ((fd = open(device_name, O_RDWR)) == -1) + errx(1, "cannot open %s: %s", + device_name, strerror(errno)); + + if (caph_limit_stdio() < 0) + errx(1, "can't limit stdio rights"); + caph_cache_catpages(); + cap_rights_init(&right_ioctl, CAP_IOCTL); + if (caph_rights_limit(fd, &right_ioctl) < 0) + errx(1, "cap_right_limit() failed"); + if (caph_ioctls_limit(fd, backlight_ioctls, nitems(backlight_ioctls)) < 0) + errx(1, "caph_ioctls_limit() failed"); + if (caph_enter() < 0) + errx(1, "failed to enter capability mode"); + + switch (action) { + case BACKLIGHT_QUERY: + if (ioctl(fd, BACKLIGHTGETSTATUS, &props) == -1) + errx(1, "Cannot query the backlight device"); + if (quiet) + printf("%u\n", props.brightness); + else { + printf("brightness: %d\n", props.brightness); + if (props.nlevels != 0) { + printf("levels:"); + for (i = 0; i < props.nlevels; i++) + printf(" %d", props.levels[i]); + printf("\n"); + } + } + break; + case BACKLIGHT_SET_BRIGHTNESS: + props.brightness = percent; + if (ioctl(fd, BACKLIGHTUPDATESTATUS, &props) == -1) + errx(1, "Cannot update the backlight device"); + break; + case BACKLIGHT_INCR: + case BACKLIGHT_DECR: + if (ioctl(fd, BACKLIGHTGETSTATUS, &props) == -1) + errx(1, "Cannot query the backlight device"); + percent = percent == 0 ? 10 : percent; + percent = action == BACKLIGHT_INCR ? percent : -percent; + props.brightness += percent; + if ((int)props.brightness < 0) + props.brightness = 0; + if (props.brightness > 100) + props.brightness = 100; + if (ioctl(fd, BACKLIGHTUPDATESTATUS, &props) == -1) + errx(1, "Cannot update the backlight device"); + break; + case BACKLIGHT_INFO: + if (ioctl(fd, BACKLIGHTGETINFO, &info) == -1) + errx(1, "Cannot query the backlight device"); + if (quiet == false) { + printf("Backlight name: %s\n", info.name); + printf("Backlight hardware type: %s\n", backlight_type_to_string(info.type)); + } else { + printf("%s\n", info.name); + printf("%s\n", backlight_type_to_string(info.type)); + } + break; + } + + close(fd); + return (0); +} From owner-svn-src-all@freebsd.org Fri Oct 2 18:23:28 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C236A4336D4; Fri, 2 Oct 2020 18:23:28 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2yzh4lHyz4Ty5; Fri, 2 Oct 2020 18:23:28 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 86D452651F; Fri, 2 Oct 2020 18:23:28 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 092INSB7023605; Fri, 2 Oct 2020 18:23:28 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 092INRAO023602; Fri, 2 Oct 2020 18:23:27 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202010021823.092INRAO023602@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 2 Oct 2020 18:23:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366371 - in head/sys: conf dev/pwm modules/pwm modules/pwm/pwm_backlight X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys: conf dev/pwm modules/pwm modules/pwm/pwm_backlight X-SVN-Commit-Revision: 366371 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Oct 2020 18:23:28 -0000 Author: manu Date: Fri Oct 2 18:23:27 2020 New Revision: 366371 URL: https://svnweb.freebsd.org/changeset/base/366371 Log: Add pwm_backlight Driver for pwm-backlight compatible device. Relnotes: yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26252 Added: head/sys/dev/pwm/pwm_backlight.c (contents, props changed) head/sys/modules/pwm/pwm_backlight/ head/sys/modules/pwm/pwm_backlight/Makefile (contents, props changed) Modified: head/sys/conf/files head/sys/modules/pwm/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Oct 2 18:21:30 2020 (r366370) +++ head/sys/conf/files Fri Oct 2 18:23:27 2020 (r366371) @@ -2755,6 +2755,7 @@ dev/pwm/pwmbus.c optional pwm | pwmbus dev/pwm/pwmbus_if.m optional pwm | pwmbus dev/pwm/ofw_pwm.c optional pwm fdt | pwmbus fdt dev/pwm/ofw_pwmbus.c optional pwm fdt | pwmbus fdt +dev/pwm/pwm_backlight.c optional pwm pwm_backlight fdt dev/quicc/quicc_core.c optional quicc dev/ral/rt2560.c optional ral dev/ral/rt2661.c optional ral Added: head/sys/dev/pwm/pwm_backlight.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/pwm/pwm_backlight.c Fri Oct 2 18:23:27 2020 (r366371) @@ -0,0 +1,311 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2020 Emmanuel Vadot + * + * 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. + * + * $FreeBSD$ + */ + +#include +__FBSDID("$FreeBSD$"); + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include + +#include + +#include "backlight_if.h" +#include "pwmbus_if.h" + +struct pwm_backlight_softc { + device_t pwmdev; + struct cdev *cdev; + + pwm_channel_t channel; + uint32_t *levels; + ssize_t nlevels; + int default_level; + ssize_t current_level; + + regulator_t power_supply; + uint64_t period; + uint64_t duty; + bool enabled; +}; + +static int pwm_backlight_find_level_per_percent(struct pwm_backlight_softc *sc, int percent); + +static struct ofw_compat_data compat_data[] = { + { "pwm-backlight", 1 }, + { NULL, 0 } +}; + +static int +pwm_backlight_probe(device_t dev) +{ + + if (!ofw_bus_search_compatible(dev, compat_data)->ocd_data) + return (ENXIO); + + device_set_desc(dev, "PWM Backlight"); + return (BUS_PROBE_DEFAULT); +} + +static int +pwm_backlight_attach(device_t dev) +{ + struct pwm_backlight_softc *sc; + phandle_t node; + int rv; + + sc = device_get_softc(dev); + node = ofw_bus_get_node(dev); + + rv = pwm_get_by_ofw_propidx(dev, node, "pwms", 0, &sc->channel); + if (rv != 0) { + device_printf(dev, "Cannot map pwm channel %d\n", rv); + return (ENXIO); + } + + if (regulator_get_by_ofw_property(dev, 0, "power-supply", + &sc->power_supply) != 0) { + device_printf(dev, "No power-supply property\n"); + return (ENXIO); + } + + if (OF_hasprop(node, "brightness-levels")) { + sc->nlevels = OF_getencprop_alloc(node, "brightness-levels", + (void **)&sc->levels); + if (sc->nlevels <= 0) { + device_printf(dev, "Cannot parse brightness levels\n"); + return (ENXIO); + } + sc->nlevels /= sizeof(uint32_t); + + if (OF_getencprop(node, "default-brightness-level", + &sc->default_level, sizeof(uint32_t)) <= 0) { + device_printf(dev, "No default-brightness-level while brightness-levels is specified\n"); + return (ENXIO); + } else { + if (sc->default_level > sc->nlevels) { + device_printf(dev, "default-brightness-level isn't present in brightness-levels range\n"); + return (ENXIO); + } + sc->channel->duty = sc->channel->period * sc->levels[sc->default_level] / 100; + } + + if (bootverbose) { + device_printf(dev, "Number of levels: %zd\n", sc->nlevels); + device_printf(dev, "Configured period time: %lu\n", sc->channel->period); + device_printf(dev, "Default duty cycle: %lu\n", sc->channel->duty); + } + } else { + /* Get the current backlight level */ + PWMBUS_CHANNEL_GET_CONFIG(sc->channel->dev, + sc->channel->channel, + (unsigned int *)&sc->channel->period, + (unsigned int *)&sc->channel->duty); + if (sc->channel->duty > sc->channel->period) + sc->channel->duty = sc->channel->period; + if (bootverbose) { + device_printf(dev, "Configured period time: %lu\n", sc->channel->period); + device_printf(dev, "Default duty cycle: %lu\n", sc->channel->duty); + } + } + + regulator_enable(sc->power_supply); + sc->channel->enabled = true; + PWMBUS_CHANNEL_CONFIG(sc->channel->dev, sc->channel->channel, + sc->channel->period, sc->channel->duty); + PWMBUS_CHANNEL_ENABLE(sc->channel->dev, sc->channel->channel, + sc->channel->enabled); + + sc->current_level = pwm_backlight_find_level_per_percent(sc, + sc->channel->period / sc->channel->duty); + sc->cdev = backlight_register("pwm_backlight", dev); + if (sc->cdev == NULL) + device_printf(dev, "Cannot register as a backlight\n"); + + return (0); +} + +static int +pwm_backlight_detach(device_t dev) +{ + struct pwm_backlight_softc *sc; + + sc = device_get_softc(dev); + if (sc->nlevels > 0) + OF_prop_free(sc->levels); + regulator_disable(sc->power_supply); + backlight_destroy(sc->cdev); + return (0); +} + +static int +pwm_backlight_find_level_per_percent(struct pwm_backlight_softc *sc, int percent) +{ + int i; + int diff; + + if (percent < 0 || percent > 100) + return (-1); + + for (i = 0, diff = 0; i < sc->nlevels; i++) { + if (sc->levels[i] == percent) + return (i); + else if (sc->levels[i] < percent) + diff = percent - sc->levels[i]; + else { + if (diff < abs((percent - sc->levels[i]))) + return (i - 1); + else + return (i); + } + } + + return (-1); +} + +static int +pwm_backlight_update_status(device_t dev, struct backlight_props *props) +{ + struct pwm_backlight_softc *sc; + int reg_status; + int error; + + sc = device_get_softc(dev); + + if (sc->nlevels != 0) { + error = pwm_backlight_find_level_per_percent(sc, + props->brightness); + if (error < 0) + return (ERANGE); + sc->current_level = error; + sc->channel->duty = sc->channel->period * + sc->levels[sc->current_level] / 100; + } else { + if (props->brightness > 100 || props->brightness < 0) + return (ERANGE); + sc->channel->duty = sc->channel->period * + props->brightness / 100; + } + sc->channel->enabled = true; + PWMBUS_CHANNEL_CONFIG(sc->channel->dev, sc->channel->channel, + sc->channel->period, sc->channel->duty); + PWMBUS_CHANNEL_ENABLE(sc->channel->dev, sc->channel->channel, + sc->channel->enabled); + error = regulator_status(sc->power_supply, ®_status); + if (error != 0) + device_printf(dev, + "Cannot get power-supply status: %d\n", error); + else { + if (props->brightness > 0) { + if (reg_status != REGULATOR_STATUS_ENABLED) + regulator_enable(sc->power_supply); + } else { + if (reg_status == REGULATOR_STATUS_ENABLED) + regulator_disable(sc->power_supply); + } + } + + return (0); +} + +static int +pwm_backlight_get_status(device_t dev, struct backlight_props *props) +{ + struct pwm_backlight_softc *sc; + int i; + + sc = device_get_softc(dev); + + if (sc->nlevels != 0) { + props->brightness = sc->levels[sc->current_level]; + props->nlevels = sc->nlevels; + for (i = 0; i < sc->nlevels; i++) + props->levels[i] = sc->levels[i]; + } else { + props->brightness = sc->channel->duty * 100 / sc->channel->period; + props->nlevels = 0; + } + return (0); +} + +static int +pwm_backlight_get_info(device_t dev, struct backlight_info *info) +{ + + info->type = BACKLIGHT_TYPE_PANEL; + strlcpy(info->name, "pwm-backlight", BACKLIGHTMAXNAMELENGTH); + return (0); +} + +static device_method_t pwm_backlight_methods[] = { + /* device_if */ + DEVMETHOD(device_probe, pwm_backlight_probe), + DEVMETHOD(device_attach, pwm_backlight_attach), + DEVMETHOD(device_detach, pwm_backlight_detach), + + /* backlight interface */ + DEVMETHOD(backlight_update_status, pwm_backlight_update_status), + DEVMETHOD(backlight_get_status, pwm_backlight_get_status), + DEVMETHOD(backlight_get_info, pwm_backlight_get_info), + DEVMETHOD_END +}; + +driver_t pwm_backlight_driver = { + "pwm_backlight", + pwm_backlight_methods, + sizeof(struct pwm_backlight_softc), +}; +devclass_t pwm_backlight_devclass; + +DRIVER_MODULE(pwm_backlight, simplebus, pwm_backlight_driver, + pwm_backlight_devclass, 0, 0); +OFWBUS_PNP_INFO(compat_data); Modified: head/sys/modules/pwm/Makefile ============================================================================== --- head/sys/modules/pwm/Makefile Fri Oct 2 18:21:30 2020 (r366370) +++ head/sys/modules/pwm/Makefile Fri Oct 2 18:23:27 2020 (r366371) @@ -5,5 +5,9 @@ SUBDIR = \ pwmbus \ pwmc \ - + +.if !empty(OPT_FDT) +SUBDIR += pwm_backlight +.endif + .include Added: head/sys/modules/pwm/pwm_backlight/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/pwm/pwm_backlight/Makefile Fri Oct 2 18:23:27 2020 (r366371) @@ -0,0 +1,15 @@ +# $FreeBSD$ + +.PATH: ${SRCTOP}/sys/dev/pwm +KMOD= pwm_backlight +SRCS= pwm_backlight.c + +SRCS+= \ + backlight_if.h \ + bus_if.h \ + device_if.h \ + opt_platform.h \ + pwmbus_if.h \ + ofw_bus_if.h + +.include From owner-svn-src-all@freebsd.org Fri Oct 2 18:26:42 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CD21A4338A2; Fri, 2 Oct 2020 18:26:42 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2z3Q4mGXz4VDB; Fri, 2 Oct 2020 18:26:42 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7EBEB26521; Fri, 2 Oct 2020 18:26:42 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 092IQg4l023813; Fri, 2 Oct 2020 18:26:42 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 092IQfdj023808; Fri, 2 Oct 2020 18:26:41 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202010021826.092IQfdj023808@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 2 Oct 2020 18:26:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366372 - in head/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src conf X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src conf X-SVN-Commit-Revision: 366372 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Oct 2020 18:26:42 -0000 Author: manu Date: Fri Oct 2 18:26:41 2020 New Revision: 366372 URL: https://svnweb.freebsd.org/changeset/base/366372 Log: linuxkpi: Add backlight support Add backlight function to linuxkpi. Graphics drivers expose the backlight of the panel directly so allow them to use the backlight subsystem so user can use backlight(8) to configure them. Reviewed by: hselasky Relnotes: yes Differential Revision: The FreeBSD Foundation Added: head/sys/compat/linuxkpi/common/include/linux/backlight.h (contents, props changed) Modified: head/sys/compat/linuxkpi/common/include/linux/device.h head/sys/compat/linuxkpi/common/src/linux_kmod.c head/sys/compat/linuxkpi/common/src/linux_pci.c head/sys/conf/kmod.mk Added: head/sys/compat/linuxkpi/common/include/linux/backlight.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/compat/linuxkpi/common/include/linux/backlight.h Fri Oct 2 18:26:41 2020 (r366372) @@ -0,0 +1,94 @@ +/*- + * Copyright (c) 2020 The FreeBSD Foundation + * + * This software was developed by Emmanuel Vadot under sponsorship + * from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 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. + * + * $FreeBSD$ + */ + +#ifndef _LINUX_BACKLIGHT_H_ +#define _LINUX_BACKLIGHT_H_ + +#include + +struct backlight_device; + +enum backlight_type { + BACKLIGHT_RAW = 0, +}; + +struct backlight_properties { + int type; + int max_brightness; + int brightness; + int power; +}; + +enum backlight_notification { + BACKLIGHT_REGISTERED, + BACKLIGHT_UNREGISTERED, +}; + +enum backlight_update_reason { + BACKLIGHT_UPDATE_HOTKEY = 0 +}; + +struct backlight_ops { + int options; +#define BL_CORE_SUSPENDRESUME 1 + int (*update_status)(struct backlight_device *); + int (*get_brightness)(struct backlight_device *); +}; + +struct backlight_device { + const struct backlight_ops *ops; + struct backlight_properties props; + void *data; + struct device *dev; + char *name; +}; + +#define bl_get_data(bd) (bd)->data + +struct backlight_device *linux_backlight_device_register(const char *name, + struct device *dev, void *data, const struct backlight_ops *ops, struct backlight_properties *props); +void linux_backlight_device_unregister(struct backlight_device *bd); +#define backlight_device_register(name, dev, data, ops, props) \ + linux_backlight_device_register(name, dev, data, ops, props) +#define backlight_device_unregister(bd) linux_backlight_device_unregister(bd) + +static inline void +backlight_update_status(struct backlight_device *bd) +{ + bd->ops->update_status(bd); +} + +static inline void +backlight_force_update(struct backlight_device *bd, int reason) +{ + bd->props.brightness = bd->ops->get_brightness(bd); +} + +#endif /* _LINUX_BACKLIGHT_H_ */ Modified: head/sys/compat/linuxkpi/common/include/linux/device.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/device.h Fri Oct 2 18:23:27 2020 (r366371) +++ head/sys/compat/linuxkpi/common/include/linux/device.h Fri Oct 2 18:26:41 2020 (r366372) @@ -41,9 +41,11 @@ #include #include #include +#include #include #include +#include struct device; struct fwnode_handle; @@ -114,6 +116,8 @@ struct device { unsigned int irq_end; const struct attribute_group **groups; struct fwnode_handle *fwnode; + struct cdev *backlight_dev; + struct backlight_device *bd; spinlock_t devres_lock; struct list_head devres_head; Modified: head/sys/compat/linuxkpi/common/src/linux_kmod.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_kmod.c Fri Oct 2 18:23:27 2020 (r366371) +++ head/sys/compat/linuxkpi/common/src/linux_kmod.c Fri Oct 2 18:26:41 2020 (r366372) @@ -31,4 +31,5 @@ __FBSDID("$FreeBSD$"); #include MODULE_VERSION(linuxkpi, 1); +MODULE_DEPEND(linuxkpi, backlight, 1, 1, 1); MODULE_DEPEND(linuxkpi, pci, 1, 1, 1); Modified: head/sys/compat/linuxkpi/common/src/linux_pci.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_pci.c Fri Oct 2 18:23:27 2020 (r366371) +++ head/sys/compat/linuxkpi/common/src/linux_pci.c Fri Oct 2 18:26:41 2020 (r366372) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -64,6 +65,10 @@ __FBSDID("$FreeBSD$"); #include #include +#include + +#include "backlight_if.h" + static device_probe_t linux_pci_probe; static device_attach_t linux_pci_attach; static device_detach_t linux_pci_detach; @@ -73,6 +78,9 @@ static device_shutdown_t linux_pci_shutdown; static pci_iov_init_t linux_pci_iov_init; static pci_iov_uninit_t linux_pci_iov_uninit; static pci_iov_add_vf_t linux_pci_iov_add_vf; +static int linux_backlight_get_status(device_t dev, struct backlight_props *props); +static int linux_backlight_update_status(device_t dev, struct backlight_props *props); +static int linux_backlight_get_info(device_t dev, struct backlight_info *info); static device_method_t pci_methods[] = { DEVMETHOD(device_probe, linux_pci_probe), @@ -84,6 +92,11 @@ static device_method_t pci_methods[] = { DEVMETHOD(pci_iov_init, linux_pci_iov_init), DEVMETHOD(pci_iov_uninit, linux_pci_iov_uninit), DEVMETHOD(pci_iov_add_vf, linux_pci_iov_add_vf), + + /* backlight interface */ + DEVMETHOD(backlight_update_status, linux_backlight_update_status), + DEVMETHOD(backlight_get_status, linux_backlight_get_status), + DEVMETHOD(backlight_get_info, linux_backlight_get_info), DEVMETHOD_END }; @@ -950,4 +963,74 @@ linux_dma_pool_free(struct dma_pool *pool, void *vaddr DMA_POOL_UNLOCK(pool); uma_zfree_arg(pool->pool_zone, obj, pool); +} + +static int +linux_backlight_get_status(device_t dev, struct backlight_props *props) +{ + struct pci_dev *pdev; + + linux_set_current(curthread); + pdev = device_get_softc(dev); + + props->brightness = pdev->dev.bd->props.brightness; + props->brightness = props->brightness * 100 / pdev->dev.bd->props.max_brightness; + props->nlevels = 0; + + return (0); +} + +static int +linux_backlight_get_info(device_t dev, struct backlight_info *info) +{ + struct pci_dev *pdev; + + linux_set_current(curthread); + pdev = device_get_softc(dev); + + info->type = BACKLIGHT_TYPE_PANEL; + strlcpy(info->name, pdev->dev.bd->name, BACKLIGHTMAXNAMELENGTH); + return (0); +} + +static int +linux_backlight_update_status(device_t dev, struct backlight_props *props) +{ + struct pci_dev *pdev; + + linux_set_current(curthread); + pdev = device_get_softc(dev); + + pdev->dev.bd->props.brightness = pdev->dev.bd->props.max_brightness * + props->brightness / 100; + return (pdev->dev.bd->ops->update_status(pdev->dev.bd)); +} + +struct backlight_device * +linux_backlight_device_register(const char *name, struct device *dev, + void *data, const struct backlight_ops *ops, struct backlight_properties *props) +{ + + dev->bd = malloc(sizeof(*dev->bd), M_DEVBUF, M_WAITOK | M_ZERO); + dev->bd->ops = ops; + dev->bd->props.type = props->type; + dev->bd->props.max_brightness = props->max_brightness; + dev->bd->props.brightness = props->brightness; + dev->bd->props.power = props->power; + dev->bd->data = data; + dev->bd->dev = dev; + dev->bd->name = strdup(name, M_DEVBUF); + + dev->backlight_dev = backlight_register(name, dev->bsddev); + + return (dev->bd); +} + +void +linux_backlight_device_unregister(struct backlight_device *bd) +{ + + backlight_destroy(bd->dev->backlight_dev); + free(bd->name, M_DEVBUF); + free(bd, M_DEVBUF); } Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Fri Oct 2 18:23:27 2020 (r366371) +++ head/sys/conf/kmod.mk Fri Oct 2 18:26:41 2020 (r366372) @@ -91,6 +91,7 @@ CFLAGS+= -fno-strict-aliasing WERROR?= -Werror LINUXKPI_GENSRCS+= \ + backlight_if.h \ bus_if.h \ device_if.h \ pci_if.h \ From owner-svn-src-all@freebsd.org Fri Oct 2 18:28:02 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 07B8E43399F; Fri, 2 Oct 2020 18:28:02 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2z4x6SlHz4VGm; Fri, 2 Oct 2020 18:28:01 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C1E5D261F8; Fri, 2 Oct 2020 18:28:01 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 092IS1H5023930; Fri, 2 Oct 2020 18:28:01 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 092IS0nS023923; Fri, 2 Oct 2020 18:28:00 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202010021828.092IS0nS023923@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 2 Oct 2020 18:28:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366373 - in head/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src conf modules/linuxkpi X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src conf modules/linuxkpi X-SVN-Commit-Revision: 366373 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Oct 2020 18:28:02 -0000 Author: manu Date: Fri Oct 2 18:28:00 2020 New Revision: 366373 URL: https://svnweb.freebsd.org/changeset/base/366373 Log: linuxkpi: Add dmi_* function dmi function are used to get smbios values. The DRM subsystem and drivers use it to enabled (or not) quirks. Reviewed by: hselasky Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26046 Added: head/sys/compat/linuxkpi/common/include/linux/dmi.h (contents, props changed) head/sys/compat/linuxkpi/common/include/linux/mod_devicetable.h (contents, props changed) head/sys/compat/linuxkpi/common/src/linux_dmi.c (contents, props changed) Modified: head/sys/compat/linuxkpi/common/include/linux/fs.h head/sys/conf/files head/sys/modules/linuxkpi/Makefile Added: head/sys/compat/linuxkpi/common/include/linux/dmi.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/compat/linuxkpi/common/include/linux/dmi.h Fri Oct 2 18:28:00 2020 (r366373) @@ -0,0 +1,46 @@ +/*- + * Copyright (c) 2020 The FreeBSD Foundation + * + * This software was developed by Emmanuel Vadot under sponsorship + * from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 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. + * + * $FreeBSD$ + */ + +#ifndef __LINUX_DMI_H__ +#define __LINUX_DMI_H__ + +#include + +int linux_dmi_check_system(const struct dmi_system_id *); +bool linux_dmi_match(enum dmi_field, const char *); +const struct dmi_system_id *linux_dmi_first_match(const struct dmi_system_id *); +const char *linux_dmi_get_system_info(int); + +#define dmi_check_system(sysid) linux_dmi_check_system(sysid) +#define dmi_match(f, str) linux_dmi_match(f, str) +#define dmi_first_match(sysid) linux_dmi_first_match(sysid) +#define dmi_get_system_info(sysid) linux_dmi_get_system_info(sysid) + +#endif /* __LINUX_DMI_H__ */ Modified: head/sys/compat/linuxkpi/common/include/linux/fs.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/fs.h Fri Oct 2 18:26:41 2020 (r366372) +++ head/sys/compat/linuxkpi/common/include/linux/fs.h Fri Oct 2 18:28:00 2020 (r366373) @@ -180,7 +180,7 @@ struct file_operations { #define FMODE_READ FREAD #define FMODE_WRITE FWRITE #define FMODE_EXEC FEXEC - +#define FMODE_UNSIGNED_OFFSET 0x2000 int __register_chrdev(unsigned int major, unsigned int baseminor, unsigned int count, const char *name, const struct file_operations *fops); Added: head/sys/compat/linuxkpi/common/include/linux/mod_devicetable.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/compat/linuxkpi/common/include/linux/mod_devicetable.h Fri Oct 2 18:28:00 2020 (r366373) @@ -0,0 +1,72 @@ +/*- + * Copyright (c) 2020 The FreeBSD Foundation + * + * This software was developed by Emmanuel Vadot under sponsorship + * from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 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. + * + * $FreeBSD$ + */ + +#ifndef __LINUX_MOD_DEVICETABLE_H__ +#define __LINUX_MOD_DEVICETABLE_H__ + +enum dmi_field { + DMI_NONE, + DMI_BIOS_VENDOR, + DMI_BIOS_VERSION, + DMI_BIOS_DATE, + DMI_SYS_VENDOR, + DMI_PRODUCT_NAME, + DMI_PRODUCT_VERSION, + DMI_PRODUCT_SERIAL, + DMI_PRODUCT_UUID, + DMI_BOARD_VENDOR, + DMI_BOARD_NAME, + DMI_BOARD_VERSION, + DMI_BOARD_SERIAL, + DMI_BOARD_ASSET_TAG, + DMI_CHASSIS_VENDOR, + DMI_CHASSIS_TYPE, + DMI_CHASSIS_VERSION, + DMI_CHASSIS_SERIAL, + DMI_CHASSIS_ASSET_TAG, + DMI_STRING_MAX, +}; + +struct dmi_strmatch { + unsigned char slot; + char substr[79]; +}; + +struct dmi_system_id { + int (*callback)(const struct dmi_system_id *); + const char *ident; + struct dmi_strmatch matches[4]; + void *driver_data; +}; + +#define DMI_MATCH(a, b) { .slot = a, .substr = b } +#define DMI_EXACT_MATCH(a, b) { .slot = a, .substr = b, } + +#endif /* __LINUX_MOD_DEVICETABLE_H__ */ Added: head/sys/compat/linuxkpi/common/src/linux_dmi.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/compat/linuxkpi/common/src/linux_dmi.c Fri Oct 2 18:28:00 2020 (r366373) @@ -0,0 +1,140 @@ +/*- + * Copyright (c) 2020 The FreeBSD Foundation + * + * This software was developed by Emmanuel Vadot under sponsorship + * from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 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. + * + * $FreeBSD$ + */ + +#include +#include +#include + +#include + +static char *dmi_data[DMI_STRING_MAX]; + +static void +linux_dmi_preload(void *arg) +{ + + dmi_data[DMI_BIOS_VENDOR] = kern_getenv("smbios.bios.vendor"); + dmi_data[DMI_BIOS_VERSION] = kern_getenv("smbios.bios.version"); + dmi_data[DMI_BIOS_DATE] = kern_getenv("smbios.bios.reldate"); + dmi_data[DMI_SYS_VENDOR] = kern_getenv("smbios.system.maker"); + dmi_data[DMI_PRODUCT_NAME] = kern_getenv("smbios.system.product"); + dmi_data[DMI_PRODUCT_VERSION] = kern_getenv("smbios.system.version"); + dmi_data[DMI_PRODUCT_SERIAL] = kern_getenv("smbios.system.serial"); + dmi_data[DMI_PRODUCT_UUID] = kern_getenv("smbios.system.uuid"); + dmi_data[DMI_BOARD_VENDOR] = kern_getenv("smbios.planar.maker"); + dmi_data[DMI_BOARD_NAME] = kern_getenv("smbios.planar.product"); + dmi_data[DMI_BOARD_VERSION] = kern_getenv("smbios.planar.version"); + dmi_data[DMI_BOARD_SERIAL] = kern_getenv("smbios.planar.serial"); + dmi_data[DMI_BOARD_ASSET_TAG] = kern_getenv("smbios.planar.tag"); + dmi_data[DMI_CHASSIS_VENDOR] = kern_getenv("smbios.chassis.maker"); + dmi_data[DMI_CHASSIS_TYPE] = kern_getenv("smbios.chassis.type"); + dmi_data[DMI_CHASSIS_VERSION] = kern_getenv("smbios.chassis.version"); + dmi_data[DMI_CHASSIS_SERIAL] = kern_getenv("smbios.chassis.serial"); + dmi_data[DMI_CHASSIS_ASSET_TAG] = kern_getenv("smbios.chassis.tag"); +} +SYSINIT(linux_dmi_preload, SI_SUB_DRIVERS, SI_ORDER_ANY, linux_dmi_preload, NULL); + +/* Match a system against a field */ +bool +linux_dmi_match(enum dmi_field f, const char *str) +{ + + if (f < DMI_STRING_MAX && + dmi_data[f] != NULL && + strcmp(dmi_data[f], str) == 0) + return(true); + return (false); +} + +/* Match a system against the struct, all matches must be ok */ +static bool +linux_dmi_matches(const struct dmi_system_id *dsi) +{ + int i; + + for (i = 0; i < nitems(dsi->matches); i++) { + if (dsi->matches[i].slot == DMI_NONE) + break; + if (dmi_match(dsi->matches[i].slot, + dsi->matches[i].substr) == false) + return (false); + } + + return (true); +} + +/* Return the string matching the field */ +const char * +linux_dmi_get_system_info(int field) +{ + + if (field < DMI_STRING_MAX) + return (dmi_data[field]); + return (NULL); +} + +/* + * Match a system against the structs list + * If a match is found return the corresponding structure. + */ +const struct dmi_system_id * +linux_dmi_first_match(const struct dmi_system_id *list) +{ + const struct dmi_system_id *dsi; + + for (dsi = list; dsi->matches[0].slot != 0; dsi++) { + if (linux_dmi_matches(dsi)) + return (dsi); + } + + return (NULL); +} + +/* + * Match a system against the structs list + * For each match call the callback with the corresponding data + * Return the number of matches. + */ +int +linux_dmi_check_system(const struct dmi_system_id *sysid) +{ + const struct dmi_system_id *dsi; + int matches = 0; + + for (dsi = sysid; dsi->matches[0].slot != 0; dsi++) { + if (linux_dmi_matches(dsi)) { + matches++; + if (dsi->callback && dsi->callback(dsi)) + break; + } + } + + return (matches); +} Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Oct 2 18:26:41 2020 (r366372) +++ head/sys/conf/files Fri Oct 2 18:28:00 2020 (r366373) @@ -4510,6 +4510,8 @@ compat/linuxkpi/common/src/linux_compat.c optional com compile-with "${LINUXKPI_C}" compat/linuxkpi/common/src/linux_current.c optional compat_linuxkpi \ compile-with "${LINUXKPI_C}" +compat/linuxkpi/common/src/linux_dmi.c optional compat_linuxkpi \ + compile-with "${LINUXKPI_C}" compat/linuxkpi/common/src/linux_hrtimer.c optional compat_linuxkpi \ compile-with "${LINUXKPI_C}" compat/linuxkpi/common/src/linux_kthread.c optional compat_linuxkpi \ Modified: head/sys/modules/linuxkpi/Makefile ============================================================================== --- head/sys/modules/linuxkpi/Makefile Fri Oct 2 18:26:41 2020 (r366372) +++ head/sys/modules/linuxkpi/Makefile Fri Oct 2 18:28:00 2020 (r366373) @@ -4,6 +4,7 @@ KMOD= linuxkpi SRCS= linux_compat.c \ linux_current.c \ + linux_dmi.c \ linux_hrtimer.c \ linux_idr.c \ linux_kmod.c \ From owner-svn-src-all@freebsd.org Fri Oct 2 18:29:25 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D854C43383D; Fri, 2 Oct 2020 18:29:25 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2z6Y5N2zz4VSY; Fri, 2 Oct 2020 18:29:25 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9BEBA26525; Fri, 2 Oct 2020 18:29:25 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 092ITPim024049; Fri, 2 Oct 2020 18:29:25 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 092ITPlS024048; Fri, 2 Oct 2020 18:29:25 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202010021829.092ITPlS024048@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 2 Oct 2020 18:29:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366374 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 366374 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Oct 2020 18:29:25 -0000 Author: manu Date: Fri Oct 2 18:29:25 2020 New Revision: 366374 URL: https://svnweb.freebsd.org/changeset/base/366374 Log: Bump __FreeBSD_version after latest linuxkpi changes Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Fri Oct 2 18:28:00 2020 (r366373) +++ head/sys/sys/param.h Fri Oct 2 18:29:25 2020 (r366374) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300117 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300118 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Fri Oct 2 18:35:56 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D75E5433D0D; Fri, 2 Oct 2020 18:35:56 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2zG45L6Gz4W7h; Fri, 2 Oct 2020 18:35:56 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8188B2676D; Fri, 2 Oct 2020 18:35:56 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 092IZuqN030498; Fri, 2 Oct 2020 18:35:56 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 092IZuhK030497; Fri, 2 Oct 2020 18:35:56 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202010021835.092IZuhK030497@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 2 Oct 2020 18:35:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366375 - head/lib/libc/locale X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/lib/libc/locale X-SVN-Commit-Revision: 366375 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Oct 2020 18:35:56 -0000 Author: markj Date: Fri Oct 2 18:35:55 2020 New Revision: 366375 URL: https://svnweb.freebsd.org/changeset/base/366375 Log: newlocale(3): Fix a memory leak. newlocale() optionally takes a "base" locale, from which components not specified in the mask are inherited. POSIX says that newlocale() may modify "base" and return it, or free "base" and return a newly allocated locale. We were not doing either, so applications which use newlocale() to modify an existing base locale end up leaking memory on FreeBSD. This diff fixes the leak by releasing a reference to the base locale before returning. This is less efficient than modifying "base" directly, but is simpler for an initial bug fix. Also, update the man page to clarify behaviour with respect to "base". PR: 249416 MFC after: 3 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26522 Modified: head/lib/libc/locale/newlocale.3 head/lib/libc/locale/xlocale.c Modified: head/lib/libc/locale/newlocale.3 ============================================================================== --- head/lib/libc/locale/newlocale.3 Fri Oct 2 18:29:25 2020 (r366374) +++ head/lib/libc/locale/newlocale.3 Fri Oct 2 18:35:55 2020 (r366375) @@ -26,7 +26,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd September 17, 2011 +.Dd October 2, 2020 .Dt NEWLOCALE 3 .Os .Sh NAME @@ -46,7 +46,20 @@ defines the components that the new locale will have s name specified in the .Fa locale parameter. -Any other components will be inherited from +Any components not specified in +.Fa mask +will be inherited from the locale referenced by +.Fa base , +if +.Fa base +is not +.Dv NULL . +If the call is successful, the state of the locale referenced by +.Fa base +is unspecified, and it must not be accessed. +The special locale +.Dv LC_GLOBAL_LOCALE +may not be specified for .Fa base . The .Fa mask Modified: head/lib/libc/locale/xlocale.c ============================================================================== --- head/lib/libc/locale/xlocale.c Fri Oct 2 18:29:25 2020 (r366374) +++ head/lib/libc/locale/xlocale.c Fri Oct 2 18:35:55 2020 (r366375) @@ -251,6 +251,7 @@ static int dupcomponent(int type, locale_t base, local locale_t newlocale(int mask, const char *locale, locale_t base) { + locale_t orig_base; int type; const char *realLocale = locale; int useenv = 0; @@ -263,6 +264,7 @@ locale_t newlocale(int mask, const char *locale, local return (NULL); } + orig_base = base; FIX_LOCALE(base); copyflags(new, base); @@ -297,6 +299,8 @@ locale_t newlocale(int mask, const char *locale, local if (0 == success) { xlocale_release(new); new = NULL; + } else if (base == orig_base) { + xlocale_release(base); } return (new); From owner-svn-src-all@freebsd.org Fri Oct 2 18:54:38 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 81887433FBB; Fri, 2 Oct 2020 18:54:38 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2zgf2rk5z4Wn3; Fri, 2 Oct 2020 18:54:38 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 45347265D1; Fri, 2 Oct 2020 18:54:38 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 092Isc4L042399; Fri, 2 Oct 2020 18:54:38 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 092IscDV042398; Fri, 2 Oct 2020 18:54:38 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202010021854.092IscDV042398@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 2 Oct 2020 18:54:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366376 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 366376 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Oct 2020 18:54:38 -0000 Author: markj Date: Fri Oct 2 18:54:37 2020 New Revision: 366376 URL: https://svnweb.freebsd.org/changeset/base/366376 Log: Fix the INVARIANTS build for 32-bit platforms Reported by: Jenkins MFC with: r366368 Modified: head/sys/kern/imgact_elf.c Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Fri Oct 2 18:35:55 2020 (r366375) +++ head/sys/kern/imgact_elf.c Fri Oct 2 18:54:37 2020 (r366376) @@ -1543,8 +1543,7 @@ core_output(char *base, size_t len, off_t offset, stru bool success; KASSERT((uintptr_t)base % PAGE_SIZE == 0, - ("%s: user address %#lx is not page-aligned", - __func__, (uintptr_t)base)); + ("%s: user address %p is not page-aligned", __func__, base)); if (p->comp != NULL) return (compress_chunk(p, base, tmpbuf, len)); From owner-svn-src-all@freebsd.org Fri Oct 2 19:03:43 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 06F064343A6; Fri, 2 Oct 2020 19:03:43 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2zt66QMgz4XDl; Fri, 2 Oct 2020 19:03:42 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BAAF426D16; Fri, 2 Oct 2020 19:03:42 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 092J3gb3048985; Fri, 2 Oct 2020 19:03:42 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 092J3gkS048984; Fri, 2 Oct 2020 19:03:42 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202010021903.092J3gkS048984@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 2 Oct 2020 19:03:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366377 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 366377 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Oct 2020 19:03:43 -0000 Author: markj Date: Fri Oct 2 19:03:42 2020 New Revision: 366377 URL: https://svnweb.freebsd.org/changeset/base/366377 Log: uma: Remove newlines from panic messages Sponsored by: The FreeBSD Foundation Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Fri Oct 2 18:54:37 2020 (r366376) +++ head/sys/vm/uma_core.c Fri Oct 2 19:03:42 2020 (r366377) @@ -3331,7 +3331,7 @@ uma_zalloc_smr(uma_zone_t zone, int flags) void *item; KASSERT((zone->uz_flags & UMA_ZONE_SMR) != 0, - ("uma_zalloc_arg: called with non-SMR zone.\n")); + ("uma_zalloc_arg: called with non-SMR zone.")); if (uma_zalloc_debug(zone, &item, NULL, flags) == EJUSTRETURN) return (item); #endif @@ -3362,7 +3362,7 @@ uma_zalloc_arg(uma_zone_t zone, void *udata, int flags void *item; KASSERT((zone->uz_flags & UMA_ZONE_SMR) == 0, - ("uma_zalloc_arg: called with SMR zone.\n")); + ("uma_zalloc_arg: called with SMR zone.")); if (uma_zalloc_debug(zone, &item, udata, flags) == EJUSTRETURN) return (item); #endif @@ -4007,7 +4007,7 @@ uma_zfree_smr(uma_zone_t zone, void *item) #ifdef UMA_ZALLOC_DEBUG KASSERT((zone->uz_flags & UMA_ZONE_SMR) != 0, - ("uma_zfree_smr: called with non-SMR zone.\n")); + ("uma_zfree_smr: called with non-SMR zone.")); KASSERT(item != NULL, ("uma_zfree_smr: Called with NULL pointer.")); SMR_ASSERT_NOT_ENTERED(zone->uz_smr); if (uma_zfree_debug(zone, item, NULL) == EJUSTRETURN) @@ -4060,7 +4060,7 @@ uma_zfree_arg(uma_zone_t zone, void *item, void *udata #ifdef UMA_ZALLOC_DEBUG KASSERT((zone->uz_flags & UMA_ZONE_SMR) == 0, - ("uma_zfree_arg: called with SMR zone.\n")); + ("uma_zfree_arg: called with SMR zone.")); if (uma_zfree_debug(zone, item, udata) == EJUSTRETURN) return; #endif @@ -5271,14 +5271,14 @@ uma_dbg_alloc(uma_zone_t zone, uma_slab_t slab, void * if (slab == NULL) { slab = uma_dbg_getslab(zone, item); if (slab == NULL) - panic("uma: item %p did not belong to zone %s\n", + panic("uma: item %p did not belong to zone %s", item, zone->uz_name); } keg = zone->uz_keg; freei = slab_item_index(slab, keg, item); if (BIT_ISSET(keg->uk_ipers, freei, slab_dbg_bits(slab, keg))) - panic("Duplicate alloc of %p from zone %p(%s) slab %p(%d)\n", + panic("Duplicate alloc of %p from zone %p(%s) slab %p(%d)", item, zone, zone->uz_name, slab, freei); BIT_SET_ATOMIC(keg->uk_ipers, freei, slab_dbg_bits(slab, keg)); } @@ -5297,22 +5297,22 @@ uma_dbg_free(uma_zone_t zone, uma_slab_t slab, void *i if (slab == NULL) { slab = uma_dbg_getslab(zone, item); if (slab == NULL) - panic("uma: Freed item %p did not belong to zone %s\n", + panic("uma: Freed item %p did not belong to zone %s", item, zone->uz_name); } keg = zone->uz_keg; freei = slab_item_index(slab, keg, item); if (freei >= keg->uk_ipers) - panic("Invalid free of %p from zone %p(%s) slab %p(%d)\n", + panic("Invalid free of %p from zone %p(%s) slab %p(%d)", item, zone, zone->uz_name, slab, freei); if (slab_item(slab, keg, freei) != item) - panic("Unaligned free of %p from zone %p(%s) slab %p(%d)\n", + panic("Unaligned free of %p from zone %p(%s) slab %p(%d)", item, zone, zone->uz_name, slab, freei); if (!BIT_ISSET(keg->uk_ipers, freei, slab_dbg_bits(slab, keg))) - panic("Duplicate free of %p from zone %p(%s) slab %p(%d)\n", + panic("Duplicate free of %p from zone %p(%s) slab %p(%d)", item, zone, zone->uz_name, slab, freei); BIT_CLR_ATOMIC(keg->uk_ipers, freei, slab_dbg_bits(slab, keg)); From owner-svn-src-all@freebsd.org Fri Oct 2 19:04:10 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1B401434588; Fri, 2 Oct 2020 19:04:10 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2ztd5XbHz4XWr; Fri, 2 Oct 2020 19:04:09 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A15CF26CBB; Fri, 2 Oct 2020 19:04:09 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 092J495V049175; Fri, 2 Oct 2020 19:04:09 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 092J496V049174; Fri, 2 Oct 2020 19:04:09 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202010021904.092J496V049174@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 2 Oct 2020 19:04:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366378 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 366378 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Oct 2020 19:04:10 -0000 Author: markj Date: Fri Oct 2 19:04:09 2020 New Revision: 366378 URL: https://svnweb.freebsd.org/changeset/base/366378 Log: uma: Use LIFO for non-SMR bucket caches When SMR was introduced, zone_put_bucket() was changed to always place full buckets at the end of the queue. However, it is generally preferable to use recently used buckets since their items are more likely to be resident in cache. So, for buckets that have no constraint on item reuse, use a last-in-first-out ordering as we did before. Reviewed by: rlibby Tested by: dhw, glebius Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26426 Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Fri Oct 2 19:03:42 2020 (r366377) +++ head/sys/vm/uma_core.c Fri Oct 2 19:04:09 2020 (r366378) @@ -733,7 +733,15 @@ zone_put_bucket(uma_zone_t zone, int domain, uma_bucke zone_domain_imax_set(zdom, zdom->uzd_nitems); if (STAILQ_EMPTY(&zdom->uzd_buckets)) zdom->uzd_seq = bucket->ub_seq; - STAILQ_INSERT_TAIL(&zdom->uzd_buckets, bucket, ub_link); + + /* + * Try to promote reuse of recently used items. For items + * protected by SMR, try to defer reuse to minimize polling. + */ + if (bucket->ub_seq == SMR_SEQ_INVALID) + STAILQ_INSERT_HEAD(&zdom->uzd_buckets, bucket, ub_link); + else + STAILQ_INSERT_TAIL(&zdom->uzd_buckets, bucket, ub_link); ZDOM_UNLOCK(zdom); return; } From owner-svn-src-all@freebsd.org Fri Oct 2 19:04:30 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5011343424A; Fri, 2 Oct 2020 19:04:30 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2zv21Nqnz4Xlh; Fri, 2 Oct 2020 19:04:30 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 144F1267D6; Fri, 2 Oct 2020 19:04:30 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 092J4Tv6049232; Fri, 2 Oct 2020 19:04:29 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 092J4TYI049231; Fri, 2 Oct 2020 19:04:29 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202010021904.092J4TYI049231@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 2 Oct 2020 19:04:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366379 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 366379 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Oct 2020 19:04:30 -0000 Author: markj Date: Fri Oct 2 19:04:29 2020 New Revision: 366379 URL: https://svnweb.freebsd.org/changeset/base/366379 Log: uma: Use the bucket cache for cross-domain allocations uma_zalloc_domain() allocates from the requested domain instead of following a first-touch policy (the default for most zones). Currently it is only used by malloc_domainset(), and consumers free returned items with free(9) since r363834. Previously uma_zalloc_domain() worked by always going to the keg for an item. As a result, the use of UMA zone caches was unbalanced: we free items to the caches, but always allocate from the keg, skipping the caches. Make some effort to allocate from the UMA caches when performing a cross-domain allocation. This avoids blowing up the caches when something is performing many transient allocations with malloc_domainset(). Reported and tested by: dhw, glebius Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26427 Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Fri Oct 2 19:04:09 2020 (r366378) +++ head/sys/vm/uma_core.c Fri Oct 2 19:04:29 2020 (r366379) @@ -685,8 +685,13 @@ zone_fetch_bucket(uma_zone_t zone, uma_zone_domain_t z if (STAILQ_NEXT(bucket, ub_link) != NULL) zdom->uzd_seq = STAILQ_NEXT(bucket, ub_link)->ub_seq; } - MPASS(zdom->uzd_nitems >= bucket->ub_cnt); STAILQ_REMOVE_HEAD(&zdom->uzd_buckets, ub_link); + + KASSERT(zdom->uzd_nitems >= bucket->ub_cnt, + ("%s: item count underflow (%ld, %d)", + __func__, zdom->uzd_nitems, bucket->ub_cnt)); + KASSERT(bucket->ub_cnt > 0, + ("%s: empty bucket in bucket cache", __func__)); zdom->uzd_nitems -= bucket->ub_cnt; /* @@ -914,11 +919,8 @@ cache_fetch_bucket(uma_zone_t zone, uma_cache_t cache, * Check the zone's cache of buckets. */ zdom = zone_domain_lock(zone, domain); - if ((bucket = zone_fetch_bucket(zone, zdom, false)) != NULL) { - KASSERT(bucket->ub_cnt != 0, - ("cache_fetch_bucket: Returning an empty bucket.")); + if ((bucket = zone_fetch_bucket(zone, zdom, false)) != NULL) return (bucket); - } ZDOM_UNLOCK(zdom); return (NULL); @@ -3495,6 +3497,11 @@ cache_alloc(uma_zone_t zone, uma_cache_t cache, void * void * uma_zalloc_domain(uma_zone_t zone, void *udata, int domain, int flags) { +#ifdef NUMA + uma_bucket_t bucket; + uma_zone_domain_t zdom; + void *item; +#endif /* Enable entropy collection for RANDOM_ENABLE_UMA kernel option */ random_harvest_fast_uma(&zone, sizeof(zone), RANDOM_UMA); @@ -3509,8 +3516,45 @@ uma_zalloc_domain(uma_zone_t zone, void *udata, int do } KASSERT(curthread->td_critnest == 0 || SCHEDULER_STOPPED(), ("uma_zalloc_domain: called with spinlock or critical section held")); + KASSERT((zone->uz_flags & UMA_ZONE_SMR) == 0, + ("uma_zalloc_domain: called with SMR zone.")); +#ifdef NUMA + KASSERT((zone->uz_flags & UMA_ZONE_FIRSTTOUCH) != 0, + ("uma_zalloc_domain: called with non-FIRSTTOUCH zone.")); + if (vm_ndomains == 1) + return (uma_zalloc_arg(zone, udata, flags)); + + /* + * Try to allocate from the bucket cache before falling back to the keg. + * We could try harder and attempt to allocate from per-CPU caches or + * the per-domain cross-domain buckets, but the complexity is probably + * not worth it. It is more important that frees of previous + * cross-domain allocations do not blow up the cache. + */ + zdom = zone_domain_lock(zone, domain); + if ((bucket = zone_fetch_bucket(zone, zdom, false)) != NULL) { + item = bucket->ub_bucket[bucket->ub_cnt - 1]; +#ifdef INVARIANTS + bucket->ub_bucket[bucket->ub_cnt - 1] = NULL; +#endif + bucket->ub_cnt--; + zone_put_bucket(zone, domain, bucket, udata, true); + item = item_ctor(zone, zone->uz_flags, zone->uz_size, udata, + flags, item); + if (item != NULL) { + KASSERT(item_domain(item) == domain, + ("%s: bucket cache item %p from wrong domain", + __func__, item)); + counter_u64_add(zone->uz_allocs, 1); + } + return (item); + } + ZDOM_UNLOCK(zdom); return (zone_alloc_item(zone, udata, domain, flags)); +#else + return (uma_zalloc_arg(zone, udata, flags)); +#endif } /* From owner-svn-src-all@freebsd.org Fri Oct 2 19:16:07 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 75F3A434577; Fri, 2 Oct 2020 19:16:07 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C308R2X8tz4Y9k; Fri, 2 Oct 2020 19:16:07 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 211B526E14; Fri, 2 Oct 2020 19:16:07 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 092JG6ru055419; Fri, 2 Oct 2020 19:16:06 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 092JG682055418; Fri, 2 Oct 2020 19:16:06 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202010021916.092JG682055418@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 2 Oct 2020 19:16:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366380 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 366380 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Oct 2020 19:16:07 -0000 Author: markj Date: Fri Oct 2 19:16:06 2020 New Revision: 366380 URL: https://svnweb.freebsd.org/changeset/base/366380 Log: vm_pageout: Avoid rounding down the inactive scan target With helper page daemon threads, enabled by default in r364786, we divide the inactive target by the number of threads, rounding down, and sum the total number of pages freed by the threads. This sum is compared with the original target, but by rounding down we might lose pages, causing the page daemon control loop to conclude that inactive queue scanning isn't keeping up with demand for free pages. Typically this results in excessive swapping. Fix the problem by accounting for the error in the main pagedaemon thread's target. Note that by default the problem will manifest only in systems with >16 CPUs in a NUMA domain. Reviewed by: cem Discussed with: dougm Reported and tested by: dhw, glebius Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26610 Modified: head/sys/vm/vm_pageout.c Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Fri Oct 2 19:04:29 2020 (r366379) +++ head/sys/vm/vm_pageout.c Fri Oct 2 19:16:06 2020 (r366380) @@ -1649,25 +1649,26 @@ reinsert: /* * Dispatch a number of inactive threads according to load and collect the - * results to prevent a coherent (CEM: incoherent?) view of paging activity on - * this domain. + * results to present a coherent view of paging activity on this domain. */ static int vm_pageout_inactive_dispatch(struct vm_domain *vmd, int shortage) { - u_int freed, pps, threads, us; + u_int freed, pps, slop, threads, us; vmd->vmd_inactive_shortage = shortage; + slop = 0; /* * If we have more work than we can do in a quarter of our interval, we * fire off multiple threads to process it. */ - if (vmd->vmd_inactive_threads > 1 && vmd->vmd_inactive_pps != 0 && + threads = vmd->vmd_inactive_threads; + if (threads > 1 && vmd->vmd_inactive_pps != 0 && shortage > vmd->vmd_inactive_pps / VM_INACT_SCAN_RATE / 4) { - threads = vmd->vmd_inactive_threads; - vm_domain_pageout_lock(vmd); vmd->vmd_inactive_shortage /= threads; + slop = shortage % threads; + vm_domain_pageout_lock(vmd); blockcount_acquire(&vmd->vmd_inactive_starting, threads - 1); blockcount_acquire(&vmd->vmd_inactive_running, threads - 1); wakeup(&vmd->vmd_inactive_shortage); @@ -1675,7 +1676,7 @@ vm_pageout_inactive_dispatch(struct vm_domain *vmd, in } /* Run the local thread scan. */ - vm_pageout_scan_inactive(vmd, vmd->vmd_inactive_shortage); + vm_pageout_scan_inactive(vmd, vmd->vmd_inactive_shortage + slop); /* * Block until helper threads report results and then accumulate From owner-svn-src-all@freebsd.org Fri Oct 2 19:56:54 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ECA854356E8; Fri, 2 Oct 2020 19:56:54 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C313V5yc3z4bWr; Fri, 2 Oct 2020 19:56:54 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B0307273A6; Fri, 2 Oct 2020 19:56:54 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 092Jus8g080667; Fri, 2 Oct 2020 19:56:54 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 092Jus8I080666; Fri, 2 Oct 2020 19:56:54 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202010021956.092Jus8I080666@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 2 Oct 2020 19:56:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366381 - head/sys/modules/pwm X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/modules/pwm X-SVN-Commit-Revision: 366381 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Oct 2020 19:56:55 -0000 Author: manu Date: Fri Oct 2 19:56:54 2020 New Revision: 366381 URL: https://svnweb.freebsd.org/changeset/base/366381 Log: pwm_backlight: Restrict module to armv7 and aarch64 Both powerpc64 and riscv uses fdt but don't use EXT_RESOURCES. Reported by: jenkins Modified: head/sys/modules/pwm/Makefile Modified: head/sys/modules/pwm/Makefile ============================================================================== --- head/sys/modules/pwm/Makefile Fri Oct 2 19:16:06 2020 (r366380) +++ head/sys/modules/pwm/Makefile Fri Oct 2 19:56:54 2020 (r366381) @@ -6,8 +6,10 @@ SUBDIR = \ pwmbus \ pwmc \ +.if ${MACHINE_ARCH} == "armv7" || ${MACHINE_ARCH} == "aarch64" .if !empty(OPT_FDT) SUBDIR += pwm_backlight +.endif .endif .include From owner-svn-src-all@freebsd.org Fri Oct 2 20:52:11 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4182A436C51; Fri, 2 Oct 2020 20:52:11 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C32HH12TGz4fJH; Fri, 2 Oct 2020 20:52:11 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E25D281C5; Fri, 2 Oct 2020 20:52:10 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 092KqAVe017550; Fri, 2 Oct 2020 20:52:10 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 092KqAb9017545; Fri, 2 Oct 2020 20:52:10 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202010022052.092KqAb9017545@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 2 Oct 2020 20:52:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366382 - in head/sys: amd64/conf arm/conf arm64/conf i386/conf powerpc/conf X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys: amd64/conf arm/conf arm64/conf i386/conf powerpc/conf X-SVN-Commit-Revision: 366382 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Oct 2020 20:52:11 -0000 Author: manu Date: Fri Oct 2 20:52:09 2020 New Revision: 366382 URL: https://svnweb.freebsd.org/changeset/base/366382 Log: Fix LINT: Add backlight to NOTES Modified: head/sys/amd64/conf/NOTES head/sys/arm/conf/NOTES head/sys/arm64/conf/NOTES head/sys/i386/conf/NOTES head/sys/powerpc/conf/NOTES Modified: head/sys/amd64/conf/NOTES ============================================================================== --- head/sys/amd64/conf/NOTES Fri Oct 2 19:56:54 2020 (r366381) +++ head/sys/amd64/conf/NOTES Fri Oct 2 20:52:09 2020 (r366382) @@ -538,6 +538,7 @@ device ioat # Intel I/OAT DMA engine # Laptop/Notebook options: # +device backlight # # I2C Bus Modified: head/sys/arm/conf/NOTES ============================================================================== --- head/sys/arm/conf/NOTES Fri Oct 2 19:56:54 2020 (r366381) +++ head/sys/arm/conf/NOTES Fri Oct 2 20:52:09 2020 (r366382) @@ -45,6 +45,9 @@ device nvmem device regulator device syscon +# Backlight subsystem +device backlight + # Undo options from sys/conf/NOTES that we do not want... nooptions COMPAT_FREEBSD4 Modified: head/sys/arm64/conf/NOTES ============================================================================== --- head/sys/arm64/conf/NOTES Fri Oct 2 19:56:54 2020 (r366381) +++ head/sys/arm64/conf/NOTES Fri Oct 2 20:52:09 2020 (r366382) @@ -191,6 +191,9 @@ device regulator device syscon device aw_syscon +# Backlight subsystem +device backlight + # Misc devices. device pl330 # ARM PL330 dma controller device xdma # xDMA framework for SoC on-chip dma controllers Modified: head/sys/i386/conf/NOTES ============================================================================== --- head/sys/i386/conf/NOTES Fri Oct 2 19:56:54 2020 (r366381) +++ head/sys/i386/conf/NOTES Fri Oct 2 20:52:09 2020 (r366382) @@ -784,6 +784,8 @@ device aesni # AES-NI OpenCrypto module # apm under `Miscellaneous hardware' # above. +device backlight + # For older notebooks that signal a powerfail condition (external # power supply dropped, or battery state low) by issuing an NMI: Modified: head/sys/powerpc/conf/NOTES ============================================================================== --- head/sys/powerpc/conf/NOTES Fri Oct 2 19:56:54 2020 (r366381) +++ head/sys/powerpc/conf/NOTES Fri Oct 2 20:52:09 2020 (r366382) @@ -68,6 +68,9 @@ device snd_ai2s # Apple I2S Audio device snd_davbus # Apple Davbus Audio device adm1030 # Apple G4 MDD fan controller +# Backlight subsystem +device backlight + ##################################################################### # Devices we don't want to deal with From owner-svn-src-all@freebsd.org Fri Oct 2 23:48:58 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2FFA83F2163; Fri, 2 Oct 2020 23:48:58 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C36CG0SKQz4nJq; Fri, 2 Oct 2020 23:48:58 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E7C269F38; Fri, 2 Oct 2020 23:48:57 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 092Nmvut022807; Fri, 2 Oct 2020 23:48:57 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 092Nmvd4022806; Fri, 2 Oct 2020 23:48:57 GMT (envelope-from np@FreeBSD.org) Message-Id: <202010022348.092Nmvd4022806@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 2 Oct 2020 23:48:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366384 - head/sys/dev/cxgbe/tom X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe/tom X-SVN-Commit-Revision: 366384 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Oct 2020 23:48:58 -0000 Author: np Date: Fri Oct 2 23:48:57 2020 New Revision: 366384 URL: https://svnweb.freebsd.org/changeset/base/366384 Log: cxgbe(4): set up the firmware flowc for the tid before send_abort_rpl. MFC after: 3 days Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/tom/t4_listen.c Modified: head/sys/dev/cxgbe/tom/t4_listen.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_listen.c Fri Oct 2 21:15:49 2020 (r366383) +++ head/sys/dev/cxgbe/tom/t4_listen.c Fri Oct 2 23:48:57 2020 (r366384) @@ -342,48 +342,32 @@ release_lctx(struct adapter *sc, struct listen_ctx *lc } static void -send_reset_synqe(struct toedev *tod, struct synq_entry *synqe) +send_flowc_wr_synqe(struct adapter *sc, struct synq_entry *synqe) { - struct adapter *sc = tod->tod_softc; struct mbuf *m = synqe->syn; struct ifnet *ifp = m->m_pkthdr.rcvif; struct vi_info *vi = ifp->if_softc; struct port_info *pi = vi->pi; - struct l2t_entry *e = &sc->l2t->l2tab[synqe->params.l2t_idx]; struct wrqe *wr; struct fw_flowc_wr *flowc; - struct cpl_abort_req *req; - int flowclen; struct sge_wrq *ofld_txq; struct sge_ofld_rxq *ofld_rxq; const int nparams = 6; + const int flowclen = sizeof(*flowc) + nparams * sizeof(struct fw_flowc_mnemval); const u_int pfvf = sc->pf << S_FW_VIID_PFN; INP_WLOCK_ASSERT(synqe->lctx->inp); + MPASS((synqe->flags & TPF_FLOWC_WR_SENT) == 0); - CTR5(KTR_CXGBE, "%s: synqe %p (0x%x), tid %d%s", - __func__, synqe, synqe->flags, synqe->tid, - synqe->flags & TPF_ABORT_SHUTDOWN ? - " (abort already in progress)" : ""); - if (synqe->flags & TPF_ABORT_SHUTDOWN) - return; /* abort already in progress */ - synqe->flags |= TPF_ABORT_SHUTDOWN; - ofld_txq = &sc->sge.ofld_txq[synqe->params.txq_idx]; ofld_rxq = &sc->sge.ofld_rxq[synqe->params.rxq_idx]; - /* The wrqe will have two WRs - a flowc followed by an abort_req */ - flowclen = sizeof(*flowc) + nparams * sizeof(struct fw_flowc_mnemval); - - wr = alloc_wrqe(roundup2(flowclen, EQ_ESIZE) + sizeof(*req), ofld_txq); + wr = alloc_wrqe(roundup2(flowclen, 16), ofld_txq); if (wr == NULL) { /* XXX */ panic("%s: allocation failure.", __func__); } flowc = wrtod(wr); - req = (void *)((caddr_t)flowc + roundup2(flowclen, EQ_ESIZE)); - - /* First the flowc ... */ memset(flowc, 0, wr->wr_len); flowc->op_to_nparams = htobe32(V_FW_WR_OP(FW_FLOWC_WR) | V_FW_FLOWC_WR_NPARAMS(nparams)); @@ -397,19 +381,47 @@ send_reset_synqe(struct toedev *tod, struct synq_entry flowc->mnemval[2].val = htobe32(pi->tx_chan); flowc->mnemval[3].mnemonic = FW_FLOWC_MNEM_IQID; flowc->mnemval[3].val = htobe32(ofld_rxq->iq.abs_id); - flowc->mnemval[4].mnemonic = FW_FLOWC_MNEM_SNDBUF; - flowc->mnemval[4].val = htobe32(512); - flowc->mnemval[5].mnemonic = FW_FLOWC_MNEM_MSS; - flowc->mnemval[5].val = htobe32(512); + flowc->mnemval[4].mnemonic = FW_FLOWC_MNEM_SNDBUF; + flowc->mnemval[4].val = htobe32(512); + flowc->mnemval[5].mnemonic = FW_FLOWC_MNEM_MSS; + flowc->mnemval[5].val = htobe32(512); + synqe->flags |= TPF_FLOWC_WR_SENT; + t4_wrq_tx(sc, wr); +} - /* ... then ABORT request */ +static void +send_reset_synqe(struct toedev *tod, struct synq_entry *synqe) +{ + struct adapter *sc = tod->tod_softc; + struct wrqe *wr; + struct cpl_abort_req *req; + + INP_WLOCK_ASSERT(synqe->lctx->inp); + + CTR5(KTR_CXGBE, "%s: synqe %p (0x%x), tid %d%s", + __func__, synqe, synqe->flags, synqe->tid, + synqe->flags & TPF_ABORT_SHUTDOWN ? + " (abort already in progress)" : ""); + if (synqe->flags & TPF_ABORT_SHUTDOWN) + return; /* abort already in progress */ + synqe->flags |= TPF_ABORT_SHUTDOWN; + + if (!(synqe->flags & TPF_FLOWC_WR_SENT)) + send_flowc_wr_synqe(sc, synqe); + + wr = alloc_wrqe(sizeof(*req), &sc->sge.ofld_txq[synqe->params.txq_idx]); + if (wr == NULL) { + /* XXX */ + panic("%s: allocation failure.", __func__); + } + req = wrtod(wr); INIT_TP_WR_MIT_CPL(req, CPL_ABORT_REQ, synqe->tid); req->rsvd0 = 0; /* don't have a snd_nxt */ req->rsvd1 = 1; /* no data sent yet */ req->cmd = CPL_ABORT_SEND_RST; - t4_l2t_send(sc, wr, e); + t4_l2t_send(sc, wr, &sc->l2t->l2tab[synqe->params.l2t_idx]); } static int @@ -891,6 +903,9 @@ do_abort_req_synqe(struct sge_iq *iq, const struct rss INP_WLOCK(inp); ofld_txq = &sc->sge.ofld_txq[synqe->params.txq_idx]; + + if (!(synqe->flags & TPF_FLOWC_WR_SENT)) + send_flowc_wr_synqe(sc, synqe); /* * If we'd initiated an abort earlier the reply to it is responsible for From owner-svn-src-all@freebsd.org Sat Oct 3 02:26:39 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 305573F5EBE; Sat, 3 Oct 2020 02:26:39 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C39jC0XgJz4vGc; Sat, 3 Oct 2020 02:26:39 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E9E00C006; Sat, 3 Oct 2020 02:26:38 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0932Qcr6021057; Sat, 3 Oct 2020 02:26:38 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0932QcX1021056; Sat, 3 Oct 2020 02:26:38 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <202010030226.0932QcX1021056@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 3 Oct 2020 02:26:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366385 - in stable/12/sys/mips: include mips X-SVN-Group: stable-12 X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: in stable/12/sys/mips: include mips X-SVN-Commit-Revision: 366385 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Oct 2020 02:26:39 -0000 Author: jhibbits Date: Sat Oct 3 02:26:38 2020 New Revision: 366385 URL: https://svnweb.freebsd.org/changeset/base/366385 Log: MFC r366162,r366169,r366188 Fix compat32 on mips64: * Elf32_Auxinfo is broken, using pointers in the union, which are 64-bits not 32. * freebsd32_sysarch() doesn't update the 'user local' register when handling MIPS_SET_TLS, leading to a NULL pointer dereference in the 32-bit application. Modified: stable/12/sys/mips/include/elf.h stable/12/sys/mips/mips/freebsd32_machdep.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/mips/include/elf.h ============================================================================== --- stable/12/sys/mips/include/elf.h Fri Oct 2 23:48:57 2020 (r366384) +++ stable/12/sys/mips/include/elf.h Sat Oct 3 02:26:38 2020 (r366385) @@ -105,8 +105,10 @@ typedef struct { /* Auxiliary vector entry on initial int a_type; /* Entry type. */ union { int a_val; /* Integer value. */ +#if defined(__mips_o32) || defined(__mips_n32) void *a_ptr; /* Address. */ void (*a_fcn)(void); /* Function pointer (not used). */ +#endif } a_un; } Elf32_Auxinfo; Modified: stable/12/sys/mips/mips/freebsd32_machdep.c ============================================================================== --- stable/12/sys/mips/mips/freebsd32_machdep.c Fri Oct 2 23:48:57 2020 (r366384) +++ stable/12/sys/mips/mips/freebsd32_machdep.c Sat Oct 3 02:26:38 2020 (r366385) @@ -57,6 +57,7 @@ #include #include +#include #include #include #include @@ -476,6 +477,17 @@ freebsd32_sysarch(struct thread *td, struct freebsd32_ switch (uap->op) { case MIPS_SET_TLS: td->td_md.md_tls = (void *)(intptr_t)uap->parms; + + /* + * If there is an user local register implementation (ULRI) + * update it as well. Add the TLS and TCB offsets so the + * value in this register is adjusted like in the case of the + * rdhwr trap() instruction handler. + */ + if (cpuinfo.userlocal_reg == true) { + mips_wr_userlocal((unsigned long)(uap->parms + + td->td_md.md_tls_tcb_offset)); + } return (0); case MIPS_GET_TLS: tlsbase = (int32_t)(intptr_t)td->td_md.md_tls; From owner-svn-src-all@freebsd.org Sat Oct 3 03:47:27 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AB9C63F9B53; Sat, 3 Oct 2020 03:47:27 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) (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 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C3CVR2X18z3Wfq; Sat, 3 Oct 2020 03:47:27 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wr1-x42c.google.com with SMTP id x14so3794381wrl.12; Fri, 02 Oct 2020 20:47:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=TlBG5HEl4pTFBCD6n5FAeg04KaMY8MTrTDhW5BEy5PA=; b=aRXLnIe8BYSFDLo9YB0WyCGBskF8BwGkDxzEz40UTpACZrJAtvr2coTl69GWzeBCyW qjSBsvo66stKJBw7F4ojP9SWVWRXyVk9wTX4fQEfoYG0JSi05Rqjlr+J0r2Jbs+LkWsA mYixeqnjaiRLPzIBpYVdzFoJt/GCqT7EkurKPu54mK6ZTc7n6knYVlKbMkujow9eoA4V g3dDQN8KzCzhNL/s1bgjZ1TKLFWN6VYGx1JClRkjHaF2sdJC5qbvjsr/0NWYMvc7wCDK 5XUsUaOhnA5FUEO3WDMJQ52M8X6DHOeC10qjXMqXZofExaKJ1sK47dDcGpQCZGcc6NCl ThhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=TlBG5HEl4pTFBCD6n5FAeg04KaMY8MTrTDhW5BEy5PA=; b=PmR/Hn4aA85bz0t1knq5ykoTAbBaVTZaGqCurbClVMhSTQuShdAp0po8m4Tkn7l3Gt GjUwyAJ3V2/EWm80Sm8kINabF/YgYyJyp+OynoX20dKjCWNbkZP0vcPLOUYcnZR7oAEW /2JFWez2vDM8oGDVteMy1wE59D3Rk2CO5bbnR6AKK1bAF88roc4ByHwndcYJBUwAOVW9 G8YS6L/3VK3G3g7e/qndRv7wrrEgZ+QhLdBfy3zdhkkxY0lawhQwfUr1rEfj9PSZye0v Div6B7QrjOkmXmuHLZOf0D2s6Y1Upit/3KTzAHvzmGTTR/9ZvtAnaaKCJazC1RQWVmDb RG/A== X-Gm-Message-State: AOAM530PIRt/mVDQfgqpVxjSvZPoeD/vyrvIJVAi2+vWZFIKNgcF6j/m dyHUmc8zVDcanv5zFwFAdvKhiKmfNW2GpuDafxGvx63FVcw= X-Google-Smtp-Source: ABdhPJxGSYDKIU/piAgg1qA29sfLoK7gCjHvumS/fkeldU3YkUSJuI3zP+AtaZnrqnwd3WZgacqdWvhPr2Q20o8xnxs= X-Received: by 2002:adf:e84a:: with SMTP id d10mr171521wrn.66.1601696843668; Fri, 02 Oct 2020 20:47:23 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a05:6000:187:0:0:0:0 with HTTP; Fri, 2 Oct 2020 20:47:22 -0700 (PDT) In-Reply-To: <202010021956.092Jus8I080666@repo.freebsd.org> References: <202010021956.092Jus8I080666@repo.freebsd.org> From: Mateusz Guzik Date: Sat, 3 Oct 2020 05:47:22 +0200 Message-ID: Subject: Re: svn commit: r366381 - head/sys/modules/pwm To: Emmanuel Vadot Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4C3CVR2X18z3Wfq X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Oct 2020 03:47:27 -0000 On 10/2/20, Emmanuel Vadot wrote: > Author: manu > Date: Fri Oct 2 19:56:54 2020 > New Revision: 366381 > URL: https://svnweb.freebsd.org/changeset/base/366381 > > Log: > pwm_backlight: Restrict module to armv7 and aarch64 > > Both powerpc64 and riscv uses fdt but don't use EXT_RESOURCES. > > Reported by: jenkins > > Modified: > head/sys/modules/pwm/Makefile > > Modified: head/sys/modules/pwm/Makefile > ============================================================================== > --- head/sys/modules/pwm/Makefile Fri Oct 2 19:16:06 2020 (r366380) > +++ head/sys/modules/pwm/Makefile Fri Oct 2 19:56:54 2020 (r366381) > @@ -6,8 +6,10 @@ SUBDIR = \ > pwmbus \ > pwmc \ > > +.if ${MACHINE_ARCH} == "armv7" || ${MACHINE_ARCH} == "aarch64" > .if !empty(OPT_FDT) > SUBDIR += pwm_backlight > +.endif > .endif > > .include I don't know which commits are to blame, but the following is broken in tinderbox: arm GENERIC kernel failed, check _.arm.GENERIC for details arm GENERIC-NODEBUG kernel failed, check _.arm.GENERIC-NODEBUG for details arm TEGRA124 kernel failed, check _.arm.TEGRA124 for details arm ARMADA38X kernel failed, check _.arm.ARMADA38X for details arm VYBRID kernel failed, check _.arm.VYBRID for details arm GENERIC-MMCCAM kernel failed, check _.arm.GENERIC-MMCCAM for details arm LINT kernel failed, check _.arm.LINT for details arm IMX53 kernel failed, check _.arm.IMX53 for details arm IMX6 kernel failed, check _.arm.IMX6 for details arm EFIKA_MX kernel failed, check _.arm.EFIKA_MX for details arm ZEDBOARD kernel failed, check _.arm.ZEDBOARD for details -- Mateusz Guzik From owner-svn-src-all@freebsd.org Sat Oct 3 04:12:08 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2A1623FAD5D; Sat, 3 Oct 2020 04:12:08 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.12]) (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 4C3D2t5BFMz3Y4v; Sat, 3 Oct 2020 04:12:06 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id OYtvkHjb9s3D6OYtwkLxtS; Fri, 02 Oct 2020 22:12:04 -0600 X-Authority-Analysis: v=2.4 cv=bZHV7MDB c=1 sm=1 tr=0 ts=5f77fa14 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=xqWC_Br6kY4A:10 a=kj9zAlcOel0A:10 a=afefHYAZSVUA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=EkcXrb_YAAAA:8 a=3QvW-lDuNlYvjfXI4C0A:9 a=CjuIK1q_8ugA:10 a=G5htwFfI-ksA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [IPv6:fc00:1:1:1::5b]) by spqr.komquats.com (Postfix) with ESMTPS id E91537D2; Fri, 2 Oct 2020 21:12:01 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.16.1/8.16.1) with ESMTP id 0934C1Mu015832; Fri, 2 Oct 2020 21:12:01 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <202010030412.0934C1Mu015832@slippy.cwsent.com> X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Mateusz Guzik cc: Emmanuel Vadot , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r366381 - head/sys/modules/pwm In-reply-to: References: <202010021956.092Jus8I080666@repo.freebsd.org> Comments: In-reply-to Mateusz Guzik message dated "Sat, 03 Oct 2020 05:47:22 +0200." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 02 Oct 2020 21:12:01 -0700 X-CMAE-Envelope: MS4xfATYB1fXkuQ9acB2Xrh0PJ9mJMALKzRpYKGV/p1WCsQraELKlW+mId6nr9jFEVA+y/nVaJz3Cn4qDLeKHMEqLHvpuqLRxOPRe7Kd3C9wCX8Uk2XJUuOf uoN5SVJYjaApF+GidOtqVK2WWS02VogbCHRLx41Gmukb5G402IsMZv7k+G2UZJBllDy7GXhdaTPu5CgiKr9LftarZqz/sYMIZM2W9nAJX15JRa8kKNfWAMDA ZDuv5CgWDIQgqkEgdGe2KJRqnLKVwB9Sh7DqkfCZusTtlSyivOftsrbrVAwsqCRmmwfJ3EXrGgXzVjWew3Ju4F46yVu8ZKhcgqxqOo6Z82A= X-Rspamd-Queue-Id: 4C3D2t5BFMz3Y4v X-Spamd-Bar: + Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of cy.schubert@cschubert.com has no SPF policy when checking 64.59.134.12) smtp.mailfrom=cy.schubert@cschubert.com X-Spamd-Result: default: False [1.59 / 15.00]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; RWL_MAILSPIKE_GOOD(0.00)[64.59.134.12:from]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[4]; FREEMAIL_TO(0.00)[gmail.com]; RECEIVED_SPAMHAUS_PBL(0.00)[70.67.125.17:received]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; MIME_TRACE(0.00)[0:+]; RCVD_IN_DNSWL_LOW(-0.10)[64.59.134.12:from]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.34)[-0.341]; REPLYTO_EQ_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; NEURAL_SPAM_SHORT(0.25)[0.245]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[cschubert.com: no valid DMARC record]; AUTH_NA(1.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_LONG(0.39)[0.389]; RCVD_TLS_LAST(0.00)[]; R_SPF_NA(0.00)[no SPF record]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Oct 2020 04:12:08 -0000 In message , Mateusz Guzik writes: > On 10/2/20, Emmanuel Vadot wrote: > > Author: manu > > Date: Fri Oct 2 19:56:54 2020 > > New Revision: 366381 > > URL: https://svnweb.freebsd.org/changeset/base/366381 > > > > Log: > > pwm_backlight: Restrict module to armv7 and aarch64 > > > > Both powerpc64 and riscv uses fdt but don't use EXT_RESOURCES. > > > > Reported by: jenkins > > > > Modified: > > head/sys/modules/pwm/Makefile > > > > Modified: head/sys/modules/pwm/Makefile > > =========================================================================== > === > > --- head/sys/modules/pwm/Makefile Fri Oct 2 19:16:06 2020 (r36638 > 0) > > +++ head/sys/modules/pwm/Makefile Fri Oct 2 19:56:54 2020 (r36638 > 1) > > @@ -6,8 +6,10 @@ SUBDIR = \ > > pwmbus \ > > pwmc \ > > > > +.if ${MACHINE_ARCH} == "armv7" || ${MACHINE_ARCH} == "aarch64" > > .if !empty(OPT_FDT) > > SUBDIR += pwm_backlight > > +.endif > > .endif > > > > .include > > I don't know which commits are to blame, but the following is broken > in tinderbox: > arm GENERIC kernel failed, check _.arm.GENERIC for details > arm GENERIC-NODEBUG kernel failed, check _.arm.GENERIC-NODEBUG for details > arm TEGRA124 kernel failed, check _.arm.TEGRA124 for details > arm ARMADA38X kernel failed, check _.arm.ARMADA38X for details > arm VYBRID kernel failed, check _.arm.VYBRID for details > arm GENERIC-MMCCAM kernel failed, check _.arm.GENERIC-MMCCAM for details > arm LINT kernel failed, check _.arm.LINT for details > arm IMX53 kernel failed, check _.arm.IMX53 for details > arm IMX6 kernel failed, check _.arm.IMX6 for details > arm EFIKA_MX kernel failed, check _.arm.EFIKA_MX for details > arm ZEDBOARD kernel failed, check _.arm.ZEDBOARD for details And on amd64 my laptop is useless now. Oct 2 18:23:58 slippy kernel: link_elf_obj: symbol acpi_video_get_backlight_type undefined Oct 2 18:23:58 slippy kernel: Warning: memory type debugfsint leaked memory on destroy (2 allocations, 80 bytes leaked). Oct 2 18:23:59 slippy kernel: linker_load_file: /boot/modules/i915kms.ko - unsupported file type And this is also after updating drm-current-kmod. -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org The need of the many outweighs the greed of the few. From owner-svn-src-all@freebsd.org Sat Oct 3 05:54:48 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ECA953FC7F9; Sat, 3 Oct 2020 05:54:48 +0000 (UTC) (envelope-from jkim@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C3GKN5xfNz3cXs; Sat, 3 Oct 2020 05:54:48 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from freefall.freebsd.org (pool-100-8-53-238.nwrknj.fios.verizon.net [100.8.53.238]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jkim/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 974AF26F5A; Sat, 3 Oct 2020 05:54:48 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Subject: Re: svn commit: r366381 - head/sys/modules/pwm To: Cy Schubert , Mateusz Guzik Cc: Emmanuel Vadot , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202010021956.092Jus8I080666@repo.freebsd.org> <202010030412.0934C1Mu015832@slippy.cwsent.com> From: Jung-uk Kim Organization: FreeBSD.org Message-ID: <50246694-58eb-0a68-7c9f-309ae2777e08@FreeBSD.org> Date: Sat, 3 Oct 2020 01:54:48 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.3.1 MIME-Version: 1.0 In-Reply-To: <202010030412.0934C1Mu015832@slippy.cwsent.com> Content-Language: en-US Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Oct 2020 05:54:49 -0000 On 20. 10. 3., Cy Schubert wrote: > In message om> > , Mateusz Guzik writes: >> On 10/2/20, Emmanuel Vadot wrote: >>> Author: manu >>> Date: Fri Oct 2 19:56:54 2020 >>> New Revision: 366381 >>> URL: https://svnweb.freebsd.org/changeset/base/366381 >>> >>> Log: >>> pwm_backlight: Restrict module to armv7 and aarch64 >>> >>> Both powerpc64 and riscv uses fdt but don't use EXT_RESOURCES. >>> >>> Reported by: jenkins >>> >>> Modified: >>> head/sys/modules/pwm/Makefile >>> >>> Modified: head/sys/modules/pwm/Makefile >>> =========================================================================== >> === >>> --- head/sys/modules/pwm/Makefile Fri Oct 2 19:16:06 2020 (r36638 >> 0) >>> +++ head/sys/modules/pwm/Makefile Fri Oct 2 19:56:54 2020 (r36638 >> 1) >>> @@ -6,8 +6,10 @@ SUBDIR = \ >>> pwmbus \ >>> pwmc \ >>> >>> +.if ${MACHINE_ARCH} == "armv7" || ${MACHINE_ARCH} == "aarch64" >>> .if !empty(OPT_FDT) >>> SUBDIR += pwm_backlight >>> +.endif >>> .endif >>> >>> .include >> >> I don't know which commits are to blame, but the following is broken >> in tinderbox: >> arm GENERIC kernel failed, check _.arm.GENERIC for details >> arm GENERIC-NODEBUG kernel failed, check _.arm.GENERIC-NODEBUG for details >> arm TEGRA124 kernel failed, check _.arm.TEGRA124 for details >> arm ARMADA38X kernel failed, check _.arm.ARMADA38X for details >> arm VYBRID kernel failed, check _.arm.VYBRID for details >> arm GENERIC-MMCCAM kernel failed, check _.arm.GENERIC-MMCCAM for details >> arm LINT kernel failed, check _.arm.LINT for details >> arm IMX53 kernel failed, check _.arm.IMX53 for details >> arm IMX6 kernel failed, check _.arm.IMX6 for details >> arm EFIKA_MX kernel failed, check _.arm.EFIKA_MX for details >> arm ZEDBOARD kernel failed, check _.arm.ZEDBOARD for details > > And on amd64 my laptop is useless now. > > Oct 2 18:23:58 slippy kernel: link_elf_obj: symbol > acpi_video_get_backlight_type undefined > Oct 2 18:23:58 slippy kernel: Warning: memory type debugfsint leaked > memory on destroy (2 allocations, 80 bytes leaked). > Oct 2 18:23:59 slippy kernel: linker_load_file: /boot/modules/i915kms.ko - > unsupported file type > > And this is also after updating drm-current-kmod. Create files directory, add the attached patch there, and try again. Jung-uk Kim From owner-svn-src-all@freebsd.org Sat Oct 3 07:31:53 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E6CF73FDFA9; Sat, 3 Oct 2020 07:31:53 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.9]) (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 4C3JTP1qHmz3g8t; Sat, 3 Oct 2020 07:31:52 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id Oc1Fke1pgTWWpOc1HkspJc; Sat, 03 Oct 2020 01:31:51 -0600 X-Authority-Analysis: v=2.4 cv=EcV2/NqC c=1 sm=1 tr=0 ts=5f7828e7 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=xqWC_Br6kY4A:10 a=kj9zAlcOel0A:10 a=afefHYAZSVUA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=EkcXrb_YAAAA:8 a=ldZ4Dgq68PpYkNK4kSMA:9 a=DVHuTNj_sjCuzPD8:21 a=8b_37rNafnk_Pw_E:21 a=CjuIK1q_8ugA:10 a=G5htwFfI-ksA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [IPv6:fc00:1:1:1::5b]) by spqr.komquats.com (Postfix) with ESMTPS id 11F49A42; Sat, 3 Oct 2020 00:31:49 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.16.1/8.16.1) with ESMTP id 0937VmXU026732; Sat, 3 Oct 2020 00:31:48 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <202010030731.0937VmXU026732@slippy.cwsent.com> Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Jung-uk Kim cc: Cy Schubert , Mateusz Guzik , Emmanuel Vadot , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r366381 - head/sys/modules/pwm In-reply-to: <50246694-58eb-0a68-7c9f-309ae2777e08@FreeBSD.org> References: <202010021956.092Jus8I080666@repo.freebsd.org> <202010030412.0934C1Mu015832@slippy.cwsent.com> <50246694-58eb-0a68-7c9f-309ae2777e08@FreeBSD.org> Comments: In-reply-to Jung-uk Kim message dated "Sat, 03 Oct 2020 01:54:48 -0400." MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <26730.1601710308.1@slippy> Content-Transfer-Encoding: quoted-printable Date: Sat, 03 Oct 2020 00:31:48 -0700 X-CMAE-Envelope: MS4xfEOZ5agDJ2V8QMbeBOXx8gUI+66Gh0Un/A5wetYnvqVvjcwKqd9Q5p23izsmMWT/Q59o/RPm1iqomAEwRu16/RdQR2wSyTHDRX0iWmsRtEsz8604B5fn Sh+gwRDca7e+fPyByxHXpUnT3htJs6oXauJQebSuaCLOdg9FQg8GsHa2A9Qq0eERVe5rQwcTmlsUJ6YphKHHeAAk94NTSTci6YIcwVD0oulnS9R6SfjHeHxD r+oekHOUlKtpey+Ac2aARhgZa2AYG41wKTsfFeF2kbYI4OH4BsnG2piqoqtbOpyFw/22QJ60pV1JYmzSP/LHa3giAvsl8sIfGD20JOwE/UZ8hKosrgb47Ufh QyiNrCvy X-Rspamd-Queue-Id: 4C3JTP1qHmz3g8t X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Oct 2020 07:31:54 -0000 In message <50246694-58eb-0a68-7c9f-309ae2777e08@FreeBSD.org>, Jung-uk Kim= writ es: > > On 20. 10. 3., Cy Schubert wrote: > > In message c > > om> > > , Mateusz Guzik writes: > >> On 10/2/20, Emmanuel Vadot wrote: > >>> Author: manu > >>> Date: Fri Oct 2 19:56:54 2020 > >>> New Revision: 366381 > >>> URL: https://svnweb.freebsd.org/changeset/base/366381 > >>> > >>> Log: > >>> pwm_backlight: Restrict module to armv7 and aarch64 > >>> > >>> Both powerpc64 and riscv uses fdt but don't use EXT_RESOURCES. > >>> > >>> Reported by: jenkins > >>> > >>> Modified: > >>> head/sys/modules/pwm/Makefile > >>> > >>> Modified: head/sys/modules/pwm/Makefile > >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > =3D=3D > >> =3D=3D=3D > >>> --- head/sys/modules/pwm/Makefile Fri Oct 2 19:16:06 2020 (r36638 > >> 0) > >>> +++ head/sys/modules/pwm/Makefile Fri Oct 2 19:56:54 2020 (r36638 > >> 1) > >>> @@ -6,8 +6,10 @@ SUBDIR =3D \ > >>> pwmbus \ > >>> pwmc \ > >>> > >>> +.if ${MACHINE_ARCH} =3D=3D "armv7" || ${MACHINE_ARCH} =3D=3D "aarch= 64" > >>> .if !empty(OPT_FDT) > >>> SUBDIR +=3D pwm_backlight > >>> +.endif > >>> .endif > >>> > >>> .include > >> > >> I don't know which commits are to blame, but the following is broken > >> in tinderbox: > >> arm GENERIC kernel failed, check _.arm.GENERIC for details > >> arm GENERIC-NODEBUG kernel failed, check _.arm.GENERIC-NODEBUG for de= tails > >> arm TEGRA124 kernel failed, check _.arm.TEGRA124 for details > >> arm ARMADA38X kernel failed, check _.arm.ARMADA38X for details > >> arm VYBRID kernel failed, check _.arm.VYBRID for details > >> arm GENERIC-MMCCAM kernel failed, check _.arm.GENERIC-MMCCAM for deta= ils > >> arm LINT kernel failed, check _.arm.LINT for details > >> arm IMX53 kernel failed, check _.arm.IMX53 for details > >> arm IMX6 kernel failed, check _.arm.IMX6 for details > >> arm EFIKA_MX kernel failed, check _.arm.EFIKA_MX for details > >> arm ZEDBOARD kernel failed, check _.arm.ZEDBOARD for details > > = > > And on amd64 my laptop is useless now. > > = > > Oct 2 18:23:58 slippy kernel: link_elf_obj: symbol = > > acpi_video_get_backlight_type undefined > > Oct 2 18:23:58 slippy kernel: Warning: memory type debugfsint leaked = > > memory on destroy (2 allocations, 80 bytes leaked). > > Oct 2 18:23:59 slippy kernel: linker_load_file: /boot/modules/i915kms= .ko - > = > > unsupported file type > > = > > And this is also after updating drm-current-kmod. > > Create files directory, add the attached patch there, and try again. > > Jung-uk Kim > > > --- drivers/gpu/drm/i915/display/intel_opregion.c.orig 2020-10-02 18:5 > 0:12 UTC > +++ drivers/gpu/drm/i915/display/intel_opregion.c > @@ -25,6 +25,8 @@ > * > */ > = > +#include > + > #include > #include > #include > @@ -450,10 +452,12 @@ static u32 asle_set_backlight(struct drm_i915_priv= ate = > = > DRM_DEBUG_DRIVER("bclp =3D 0x%08x\n", bclp); > = > +#if __FreeBSD_version < 1300118 > if (acpi_video_get_backlight_type() =3D=3D acpi_backlight_native) { > DRM_DEBUG_KMS("opregion backlight request ignored\n"); > return 0; > } > +#endif > = > if (!(bclp & ASLE_BCLP_VALID)) > return ASLC_BACKLIGHT_FAILED; > This won't work. The machine is already at 1300118. I'll try a #if 0 instead. (I restored a zfs snapshot of /usr/src and /usr/obj.) Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org The need of the many outweighs the greed of the few. From owner-svn-src-all@freebsd.org Sat Oct 3 08:31:29 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 49DE73FF617; Sat, 3 Oct 2020 08:31:29 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C3Kp91JnWz41K6; Sat, 3 Oct 2020 08:31:29 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1048F105BB; Sat, 3 Oct 2020 08:31:29 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0938VSIA046466; Sat, 3 Oct 2020 08:31:28 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0938VSGp046465; Sat, 3 Oct 2020 08:31:28 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202010030831.0938VSGp046465@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sat, 3 Oct 2020 08:31:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366386 - head/sys/dev/pwm X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/dev/pwm X-SVN-Commit-Revision: 366386 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Oct 2020 08:31:29 -0000 Author: manu Date: Sat Oct 3 08:31:28 2020 New Revision: 366386 URL: https://svnweb.freebsd.org/changeset/base/366386 Log: pwm_backlight: Fix 32 bits build Reported by: jenkins, mjg Modified: head/sys/dev/pwm/pwm_backlight.c Modified: head/sys/dev/pwm/pwm_backlight.c ============================================================================== --- head/sys/dev/pwm/pwm_backlight.c Sat Oct 3 02:26:38 2020 (r366385) +++ head/sys/dev/pwm/pwm_backlight.c Sat Oct 3 08:31:28 2020 (r366386) @@ -141,8 +141,8 @@ pwm_backlight_attach(device_t dev) if (bootverbose) { device_printf(dev, "Number of levels: %zd\n", sc->nlevels); - device_printf(dev, "Configured period time: %lu\n", sc->channel->period); - device_printf(dev, "Default duty cycle: %lu\n", sc->channel->duty); + device_printf(dev, "Configured period time: %ju\n", (uintmax_t)sc->channel->period); + device_printf(dev, "Default duty cycle: %ju\n", (uintmax_t)sc->channel->duty); } } else { /* Get the current backlight level */ @@ -153,8 +153,8 @@ pwm_backlight_attach(device_t dev) if (sc->channel->duty > sc->channel->period) sc->channel->duty = sc->channel->period; if (bootverbose) { - device_printf(dev, "Configured period time: %lu\n", sc->channel->period); - device_printf(dev, "Default duty cycle: %lu\n", sc->channel->duty); + device_printf(dev, "Configured period time: %ju\n", (uintmax_t)sc->channel->period); + device_printf(dev, "Default duty cycle: %ju\n", (uintmax_t)sc->channel->duty); } } From owner-svn-src-all@freebsd.org Sat Oct 3 08:33:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2DCA43FF579; Sat, 3 Oct 2020 08:33:46 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mx.blih.net (mx.blih.net [212.83.155.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mx.blih.net", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C3Krm4QyTz41Zp; Sat, 3 Oct 2020 08:33:43 +0000 (UTC) (envelope-from manu@bidouilliste.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bidouilliste.com; s=mx; t=1601714022; 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=EeuKZORo3MVaw6xdSb8kB4qXXgKbv1nO5p0i/GHuinM=; b=E4E2OWhI0hCH7PJGb5GEv8uWxKC6/6V25D3NKEHMYL1UxSOAH2pRmCqMSxnm7GJtgZXSzq VFWKhf858whwx28x1riyiagVKuRCxKXfFy+GxEenHFq1u0/gkBv+Nw4TBXzhSZIh5p0g4E 2VsunbFTWjhDyEgw5HY0rhH+G5rtoCI= Received: from skull.home.blih.net (lfbn-idf2-1-288-247.w82-123.abo.wanadoo.fr [82.123.126.247]) by mx.blih.net (OpenSMTPD) with ESMTPSA id 16190795 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Sat, 3 Oct 2020 08:33:42 +0000 (UTC) Date: Sat, 3 Oct 2020 10:33:41 +0200 From: Emmanuel Vadot To: Mateusz Guzik Cc: Emmanuel Vadot , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r366381 - head/sys/modules/pwm Message-Id: <20201003103341.51a1cd6bc175c73a7e60dc2c@bidouilliste.com> In-Reply-To: References: <202010021956.092Jus8I080666@repo.freebsd.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; amd64-portbld-freebsd13.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4C3Krm4QyTz41Zp X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bidouilliste.com header.s=mx header.b=E4E2OWhI; dmarc=pass (policy=none) header.from=bidouilliste.com; spf=pass (mx1.freebsd.org: domain of manu@bidouilliste.com designates 212.83.155.74 as permitted sender) smtp.mailfrom=manu@bidouilliste.com X-Spamd-Result: default: False [-3.25 / 15.00]; RCVD_TLS_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[bidouilliste.com:s=mx]; FREEFALL_USER(0.00)[manu]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; MID_RHS_MATCH_FROM(0.00)[]; MIME_GOOD(-0.10)[text/plain]; R_SPF_ALLOW(-0.20)[+mx]; ARC_NA(0.00)[]; RCPT_COUNT_FIVE(0.00)[5]; NEURAL_HAM_LONG(-1.04)[-1.035]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bidouilliste.com:+]; DMARC_POLICY_ALLOW(-0.50)[bidouilliste.com,none]; NEURAL_HAM_SHORT(-0.67)[-0.675]; NEURAL_HAM_MEDIUM(-1.04)[-1.044]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:12876, ipnet:212.83.128.0/19, country:FR]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Oct 2020 08:33:46 -0000 On Sat, 3 Oct 2020 05:47:22 +0200 Mateusz Guzik wrote: > On 10/2/20, Emmanuel Vadot wrote: > > Author: manu > > Date: Fri Oct 2 19:56:54 2020 > > New Revision: 366381 > > URL: https://svnweb.freebsd.org/changeset/base/366381 > > > > Log: > > pwm_backlight: Restrict module to armv7 and aarch64 > > > > Both powerpc64 and riscv uses fdt but don't use EXT_RESOURCES. > > > > Reported by: jenkins > > > > Modified: > > head/sys/modules/pwm/Makefile > > > > Modified: head/sys/modules/pwm/Makefile > > ============================================================================== > > --- head/sys/modules/pwm/Makefile Fri Oct 2 19:16:06 2020 (r366380) > > +++ head/sys/modules/pwm/Makefile Fri Oct 2 19:56:54 2020 (r366381) > > @@ -6,8 +6,10 @@ SUBDIR = \ > > pwmbus \ > > pwmc \ > > > > +.if ${MACHINE_ARCH} == "armv7" || ${MACHINE_ARCH} == "aarch64" > > .if !empty(OPT_FDT) > > SUBDIR += pwm_backlight > > +.endif > > .endif > > > > .include > > I don't know which commits are to blame, but the following is broken > in tinderbox: > arm GENERIC kernel failed, check _.arm.GENERIC for details > arm GENERIC-NODEBUG kernel failed, check _.arm.GENERIC-NODEBUG for details > arm TEGRA124 kernel failed, check _.arm.TEGRA124 for details > arm ARMADA38X kernel failed, check _.arm.ARMADA38X for details > arm VYBRID kernel failed, check _.arm.VYBRID for details > arm GENERIC-MMCCAM kernel failed, check _.arm.GENERIC-MMCCAM for details > arm LINT kernel failed, check _.arm.LINT for details > arm IMX53 kernel failed, check _.arm.IMX53 for details > arm IMX6 kernel failed, check _.arm.IMX6 for details > arm EFIKA_MX kernel failed, check _.arm.EFIKA_MX for details > arm ZEDBOARD kernel failed, check _.arm.ZEDBOARD for details > > -- > Mateusz Guzik This is fixed now, sorry. -- Emmanuel Vadot From owner-svn-src-all@freebsd.org Sat Oct 3 08:34:01 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AFC6D3FF2FC; Sat, 3 Oct 2020 08:34:01 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mx.blih.net (mx.blih.net [212.83.155.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mx.blih.net", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C3Ks46K2nz41vH; Sat, 3 Oct 2020 08:34:00 +0000 (UTC) (envelope-from manu@bidouilliste.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bidouilliste.com; s=mx; t=1601714037; 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=myVZ7kp6haa4GlSTtLlO/ns7K/4MY0T27tSvMzWXaPs=; b=oPYRxFmIPtZ+5CxCdZF2ShAd1ETPfCH/HlTt+6As0n+/Bkt2Ys+6C7pbAcXPkVu1Nnh5Va i35KCpcZzSKL50CjXcKY1mg+OwjdrHVK7l6Cc5yOkVc/ZzqDWZHUQVxL0MtuHlALd9BvAK HeyRwo+yYFOaUenTIRo7yXv8+bDN7MI= Received: from skull.home.blih.net (lfbn-idf2-1-288-247.w82-123.abo.wanadoo.fr [82.123.126.247]) by mx.blih.net (OpenSMTPD) with ESMTPSA id 364e35c7 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Sat, 3 Oct 2020 08:33:57 +0000 (UTC) Date: Sat, 3 Oct 2020 10:33:57 +0200 From: Emmanuel Vadot To: Cy Schubert Cc: Mateusz Guzik , Emmanuel Vadot , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r366381 - head/sys/modules/pwm Message-Id: <20201003103357.24c2f3201ab4b2637fb8ea99@bidouilliste.com> In-Reply-To: <202010030412.0934C1Mu015832@slippy.cwsent.com> References: <202010021956.092Jus8I080666@repo.freebsd.org> <202010030412.0934C1Mu015832@slippy.cwsent.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; amd64-portbld-freebsd13.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4C3Ks46K2nz41vH X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bidouilliste.com header.s=mx header.b=oPYRxFmI; dmarc=pass (policy=none) header.from=bidouilliste.com; spf=pass (mx1.freebsd.org: domain of manu@bidouilliste.com designates 212.83.155.74 as permitted sender) smtp.mailfrom=manu@bidouilliste.com X-Spamd-Result: default: False [-3.36 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[bidouilliste.com:s=mx]; FREEFALL_USER(0.00)[manu]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+mx:c]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[text/plain]; MID_RHS_MATCH_FROM(0.00)[]; RCPT_COUNT_FIVE(0.00)[6]; NEURAL_HAM_LONG(-1.03)[-1.027]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bidouilliste.com:+]; RCVD_TLS_ALL(0.00)[]; DMARC_POLICY_ALLOW(-0.50)[bidouilliste.com,none]; NEURAL_HAM_SHORT(-0.78)[-0.781]; NEURAL_HAM_MEDIUM(-1.05)[-1.051]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:12876, ipnet:212.83.128.0/19, country:FR]; FREEMAIL_CC(0.00)[gmail.com,freebsd.org]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Oct 2020 08:34:01 -0000 On Fri, 02 Oct 2020 21:12:01 -0700 Cy Schubert wrote: > In message om> > , Mateusz Guzik writes: > > On 10/2/20, Emmanuel Vadot wrote: > > > Author: manu > > > Date: Fri Oct 2 19:56:54 2020 > > > New Revision: 366381 > > > URL: https://svnweb.freebsd.org/changeset/base/366381 > > > > > > Log: > > > pwm_backlight: Restrict module to armv7 and aarch64 > > > > > > Both powerpc64 and riscv uses fdt but don't use EXT_RESOURCES. > > > > > > Reported by: jenkins > > > > > > Modified: > > > head/sys/modules/pwm/Makefile > > > > > > Modified: head/sys/modules/pwm/Makefile > > > =========================================================================== > > === > > > --- head/sys/modules/pwm/Makefile Fri Oct 2 19:16:06 2020 (r36638 > > 0) > > > +++ head/sys/modules/pwm/Makefile Fri Oct 2 19:56:54 2020 (r36638 > > 1) > > > @@ -6,8 +6,10 @@ SUBDIR = \ > > > pwmbus \ > > > pwmc \ > > > > > > +.if ${MACHINE_ARCH} == "armv7" || ${MACHINE_ARCH} == "aarch64" > > > .if !empty(OPT_FDT) > > > SUBDIR += pwm_backlight > > > +.endif > > > .endif > > > > > > .include > > > > I don't know which commits are to blame, but the following is broken > > in tinderbox: > > arm GENERIC kernel failed, check _.arm.GENERIC for details > > arm GENERIC-NODEBUG kernel failed, check _.arm.GENERIC-NODEBUG for details > > arm TEGRA124 kernel failed, check _.arm.TEGRA124 for details > > arm ARMADA38X kernel failed, check _.arm.ARMADA38X for details > > arm VYBRID kernel failed, check _.arm.VYBRID for details > > arm GENERIC-MMCCAM kernel failed, check _.arm.GENERIC-MMCCAM for details > > arm LINT kernel failed, check _.arm.LINT for details > > arm IMX53 kernel failed, check _.arm.IMX53 for details > > arm IMX6 kernel failed, check _.arm.IMX6 for details > > arm EFIKA_MX kernel failed, check _.arm.EFIKA_MX for details > > arm ZEDBOARD kernel failed, check _.arm.ZEDBOARD for details > > And on amd64 my laptop is useless now. > > Oct 2 18:23:58 slippy kernel: link_elf_obj: symbol > acpi_video_get_backlight_type undefined > Oct 2 18:23:58 slippy kernel: Warning: memory type debugfsint leaked > memory on destroy (2 allocations, 80 bytes leaked). > Oct 2 18:23:59 slippy kernel: linker_load_file: /boot/modules/i915kms.ko - > unsupported file type > > And this is also after updating drm-current-kmod. > > > -- > Cheers, > Cy Schubert > FreeBSD UNIX: Web: https://FreeBSD.org > NTP: Web: https://nwtime.org > > The need of the many outweighs the greed of the few. > > Fixed in ports r551266, sorry. -- Emmanuel Vadot From owner-svn-src-all@freebsd.org Sat Oct 3 09:23:35 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 66B9E429438; Sat, 3 Oct 2020 09:23:35 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C3LyH27qSz44Lq; Sat, 3 Oct 2020 09:23:35 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2DCA410CF2; Sat, 3 Oct 2020 09:23:35 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0939NZwX081404; Sat, 3 Oct 2020 09:23:35 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0939NYg3081402; Sat, 3 Oct 2020 09:23:34 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <202010030923.0939NYg3081402@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Sat, 3 Oct 2020 09:23:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366387 - head/tools/tools/netmap X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: head/tools/tools/netmap X-SVN-Commit-Revision: 366387 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Oct 2020 09:23:35 -0000 Author: vmaffione Date: Sat Oct 3 09:23:34 2020 New Revision: 366387 URL: https://svnweb.freebsd.org/changeset/base/366387 Log: netmap: pkt-gen: minor corrections to documentation Submitted by: Brian Poole MFC after: 3 days Modified: head/tools/tools/netmap/pkt-gen.8 head/tools/tools/netmap/pkt-gen.c Modified: head/tools/tools/netmap/pkt-gen.8 ============================================================================== --- head/tools/tools/netmap/pkt-gen.8 Sat Oct 3 08:31:28 2020 (r366386) +++ head/tools/tools/netmap/pkt-gen.8 Sat Oct 3 09:23:34 2020 (r366387) @@ -95,7 +95,7 @@ for server-side ping-pong operation. .It Fl n Ar count Number of iterations of the .Nm -function, with 0 meaning infinite). +function (with 0 meaning infinite). In case of .Cm tx or @@ -147,10 +147,10 @@ is larger than one, each thread handles a single TX ri .Cm tx mode), a single RX ring (in .Cm rx -mode), or a TX/RX ring couple. +mode), or a TX/RX ring pair. The number of .Ar threads -must be less or equal than the number of TX (or RX) ring available +must be less than or equal to the number of TX (or RX) ring available in the device specified by .Ar interface . .It Fl T Ar report_ms @@ -158,7 +158,7 @@ Number of milliseconds between reports. .It Fl w Ar wait_for_link_time Number of seconds to wait before starting the .Nm -function, useuful to make sure that the network link is up. +function, useful to make sure that the network link is up. A network device driver may take some time to enter netmap mode, or to create a new transmit/receive ring pair when .Xr netmap 4 @@ -168,7 +168,7 @@ Packet transmission rate. Not setting the packet transmission rate tells .Nm to transmit packets as quickly as possible. -On servers from 2010 on-wards +On servers from 2010 onward .Xr netmap 4 is able to completely use all of the bandwidth of a 10 or 40Gbps link, so this option should be used unless your intention is to saturate the link. @@ -231,7 +231,7 @@ This adds 4 bytes of CRC and 20 bytes of framing to ea .It Fl C Ar tx_slots Ns Oo Cm \&, Ns Ar rx_slots Ns Oo Cm \&, Ns Ar tx_rings Ns Oo Cm \&, Ns Ar rx_rings Oc Oc Oc Configuration in terms of number of rings and slots to be used when opening the netmap port. -Such configuration has effect on software ports +Such configuration has an effect on software ports created on the fly, such as VALE ports and netmap pipes. The configuration may consist of 1 to 4 numbers separated by commas: .Dq tx_slots,rx_slots,tx_rings,rx_rings . Modified: head/tools/tools/netmap/pkt-gen.c ============================================================================== --- head/tools/tools/netmap/pkt-gen.c Sat Oct 3 08:31:28 2020 (r366386) +++ head/tools/tools/netmap/pkt-gen.c Sat Oct 3 09:23:34 2020 (r366387) @@ -275,7 +275,7 @@ struct glob_arg { #define OPT_TS 16 /* add a timestamp */ #define OPT_INDIRECT 32 /* use indirect buffers, tx only */ #define OPT_DUMP 64 /* dump rx/tx traffic */ -#define OPT_RUBBISH 256 /* send wathever the buffers contain */ +#define OPT_RUBBISH 256 /* send whatever the buffers contain */ #define OPT_RANDOM_SRC 512 #define OPT_RANDOM_DST 1024 #define OPT_PPS_STATS 2048 @@ -2360,7 +2360,7 @@ usage(int errcode) " for client-side ping-pong operation, and pong for server-side ping-pong operation.\n" "\n" " -n count\n" -" Number of iterations of the pkt-gen function, with 0 meaning infinite). In case of tx or rx,\n" +" Number of iterations of the pkt-gen function (with 0 meaning infinite). In case of tx or rx,\n" " count is the number of packets to receive or transmit. In case of ping or pong, count is the\n" " number of ping-pong transactions.\n" "\n" @@ -2397,20 +2397,20 @@ usage(int errcode) " -p threads\n" " Number of threads to use. By default, only a single thread is used to handle all the netmap\n" " rings. If threads is larger than one, each thread handles a single TX ring (in tx mode), a\n" -" single RX ring (in rx mode), or a TX/RX ring couple. The number of threads must be less or\n" -" equal than the number of TX (or RX) ring available in the device specified by interface.\n" +" single RX ring (in rx mode), or a TX/RX ring pair. The number of threads must be less than or\n" +" equal to the number of TX (or RX) rings available in the device specified by interface.\n" "\n" " -T report_ms\n" " Number of milliseconds between reports.\n" "\n" " -w wait_for_link_time\n" -" Number of seconds to wait before starting the pkt-gen function, useuful to make sure that the\n" +" Number of seconds to wait before starting the pkt-gen function, useful to make sure that the\n" " network link is up. A network device driver may take some time to enter netmap mode, or to\n" " create a new transmit/receive ring pair when netmap(4) requests one.\n" "\n" " -R rate\n" " Packet transmission rate. Not setting the packet transmission rate tells pkt-gen to transmit\n" -" packets as quickly as possible. On servers from 2010 on-wards netmap(4) is able to com-\n" +" packets as quickly as possible. On servers from 2010 onward netmap(4) is able to com-\n" " pletely use all of the bandwidth of a 10 or 40Gbps link, so this option should be used unless\n" " your intention is to saturate the link.\n" "\n" @@ -2456,7 +2456,7 @@ usage(int errcode) "\n" " -C tx_slots[,rx_slots[,tx_rings[,rx_rings]]]\n" " Configuration in terms of number of rings and slots to be used when opening the netmap port.\n" -" Such configuration has effect on software ports created on the fly, such as VALE ports and\n" +" Such configuration has an effect on software ports created on the fly, such as VALE ports and\n" " netmap pipes. The configuration may consist of 1 to 4 numbers separated by commas: tx_slots,\n" " rx_slots, tx_rings, rx_rings. Missing numbers or zeroes stand for default values. As an\n" " additional convenience, if exactly one number is specified, then this is assigned to both\n" @@ -2472,7 +2472,7 @@ usage(int errcode) " OPT_INDIRECT 32 (use indirect buffers)\n" " OPT_DUMP 64 (dump rx/tx traffic)\n" " OPT_RUBBISH 256\n" -" (send wathever the buffers contain)\n" +" (send whatever the buffers contain)\n" " OPT_RANDOM_SRC 512\n" " OPT_RANDOM_DST 1024\n" " OPT_PPS_STATS 2048\n" From owner-svn-src-all@freebsd.org Sat Oct 3 09:33:30 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7A029429C83; Sat, 3 Oct 2020 09:33:30 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C3M9k2cy3z44qP; Sat, 3 Oct 2020 09:33:30 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3EC3811285; Sat, 3 Oct 2020 09:33:30 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0939XUPb087672; Sat, 3 Oct 2020 09:33:30 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0939XUYS087671; Sat, 3 Oct 2020 09:33:30 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <202010030933.0939XUYS087671@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Sat, 3 Oct 2020 09:33:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366388 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 366388 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Oct 2020 09:33:30 -0000 Author: vmaffione Date: Sat Oct 3 09:33:29 2020 New Revision: 366388 URL: https://svnweb.freebsd.org/changeset/base/366388 Log: netmap: fix constness warnings generated by "-Wcast-qual" Submitted by: milosz.kaniewski@gmail.com MFC after: 3 days Modified: head/sys/net/netmap_user.h Modified: head/sys/net/netmap_user.h ============================================================================== --- head/sys/net/netmap_user.h Sat Oct 3 09:23:34 2020 (r366387) +++ head/sys/net/netmap_user.h Sat Oct 3 09:33:29 2020 (r366388) @@ -290,7 +290,7 @@ struct nm_desc { * when the descriptor is open correctly, d->self == d * Eventually we should also use some magic number. */ -#define P2NMD(p) ((struct nm_desc *)(p)) +#define P2NMD(p) ((const struct nm_desc *)(p)) #define IS_NETMAP_DESC(d) ((d) && P2NMD(d)->self == P2NMD(d)) #define NETMAP_FD(d) (P2NMD(d)->fd) @@ -616,7 +616,7 @@ nm_parse(const char *ifname, struct nm_desc *d, char * const char *vpname = NULL; u_int namelen; uint32_t nr_ringid = 0, nr_flags; - char errmsg[MAXERRMSG] = ""; + char errmsg[MAXERRMSG] = "", *tmp; long num; uint16_t nr_arg2 = 0; enum { P_START, P_RNGSFXOK, P_GETNUM, P_FLAGS, P_FLAGSOK, P_MEMID } p_state; @@ -713,12 +713,13 @@ nm_parse(const char *ifname, struct nm_desc *d, char * port++; break; case P_GETNUM: - num = strtol(port, (char **)&port, 10); + num = strtol(port, &tmp, 10); if (num < 0 || num >= NETMAP_RING_MASK) { snprintf(errmsg, MAXERRMSG, "'%ld' out of range [0, %d)", num, NETMAP_RING_MASK); goto fail; } + port = tmp; nr_ringid = num & NETMAP_RING_MASK; p_state = P_RNGSFXOK; break; @@ -760,11 +761,12 @@ nm_parse(const char *ifname, struct nm_desc *d, char * snprintf(errmsg, MAXERRMSG, "double setting of memid"); goto fail; } - num = strtol(port, (char **)&port, 10); + num = strtol(port, &tmp, 10); if (num <= 0) { snprintf(errmsg, MAXERRMSG, "invalid memid %ld, must be >0", num); goto fail; } + port = tmp; nr_arg2 = num; p_state = P_RNGSFXOK; break; @@ -1044,7 +1046,7 @@ nm_inject(struct nm_desc *d, const void *buf, size_t s ring->slot[i].flags = NS_MOREFRAG; nm_pkt_copy(buf, NETMAP_BUF(ring, idx), ring->nr_buf_size); i = nm_ring_next(ring, i); - buf = (char *)buf + ring->nr_buf_size; + buf = (const char *)buf + ring->nr_buf_size; } idx = ring->slot[i].buf_idx; ring->slot[i].len = rem; From owner-svn-src-all@freebsd.org Sat Oct 3 09:36:34 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 242EE4299C1; Sat, 3 Oct 2020 09:36:34 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C3MFF629wz45Q0; Sat, 3 Oct 2020 09:36:33 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B397211308; Sat, 3 Oct 2020 09:36:33 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0939aX1M087877; Sat, 3 Oct 2020 09:36:33 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0939aX6g087875; Sat, 3 Oct 2020 09:36:33 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <202010030936.0939aX6g087875@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Sat, 3 Oct 2020 09:36:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366389 - in head: share/man/man4 tools/tools/netmap X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: in head: share/man/man4 tools/tools/netmap X-SVN-Commit-Revision: 366389 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Oct 2020 09:36:34 -0000 Author: vmaffione Date: Sat Oct 3 09:36:33 2020 New Revision: 366389 URL: https://svnweb.freebsd.org/changeset/base/366389 Log: netmap: minor documentation fix Also update date of pkt-gen.8 (not done in r366387). Submitted by: milosz.kaniewski@gmail.com MFC after: 3 days Modified: head/share/man/man4/netmap.4 head/tools/tools/netmap/pkt-gen.8 Modified: head/share/man/man4/netmap.4 ============================================================================== --- head/share/man/man4/netmap.4 Sat Oct 3 09:33:29 2020 (r366388) +++ head/share/man/man4/netmap.4 Sat Oct 3 09:36:33 2020 (r366389) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 6, 2020 +.Dd October 3, 2020 .Dt NETMAP 4 .Os .Sh NAME @@ -1052,7 +1052,7 @@ void receiver(void) for (;;) { poll(&fds, 1, -1); while ( (buf = nm_nextpkt(d, &h)) ) - consume_pkt(buf, h->len); + consume_pkt(buf, h.len); } nm_close(d); } Modified: head/tools/tools/netmap/pkt-gen.8 ============================================================================== --- head/tools/tools/netmap/pkt-gen.8 Sat Oct 3 09:33:29 2020 (r366388) +++ head/tools/tools/netmap/pkt-gen.8 Sat Oct 3 09:36:33 2020 (r366389) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 31, 2018 +.Dd October 3, 2020 .Dt PKT-GEN 8 .Os .Sh NAME From owner-svn-src-all@freebsd.org Sat Oct 3 10:47:19 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E71C142B4E5; Sat, 3 Oct 2020 10:47:19 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C3Npv61RDz4D97; Sat, 3 Oct 2020 10:47:19 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AD34B11F25; Sat, 3 Oct 2020 10:47:19 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 093AlJvr034350; Sat, 3 Oct 2020 10:47:19 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 093AlHsL034340; Sat, 3 Oct 2020 10:47:17 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <202010031047.093AlHsL034340@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sat, 3 Oct 2020 10:47:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366390 - in head: sys/conf sys/net sys/net/route sys/netinet sys/netinet6 sys/sys usr.bin/netstat X-SVN-Group: head X-SVN-Commit-Author: melifaro X-SVN-Commit-Paths: in head: sys/conf sys/net sys/net/route sys/netinet sys/netinet6 sys/sys usr.bin/netstat X-SVN-Commit-Revision: 366390 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Oct 2020 10:47:20 -0000 Author: melifaro Date: Sat Oct 3 10:47:17 2020 New Revision: 366390 URL: https://svnweb.freebsd.org/changeset/base/366390 Log: Introduce scalable route multipath. This change is based on the nexthop objects landed in D24232. The change introduces the concept of nexthop groups. Each group contains the collection of nexthops with their relative weights and a dataplane-optimized structure to enable efficient nexthop selection. Simular to the nexthops, nexthop groups are immutable. Dataplane part gets compiled during group creation and is basically an array of nexthop pointers, compiled w.r.t their weights. With this change, `rt_nhop` field of `struct rtentry` contains either nexthop or nexthop group. They are distinguished by the presense of NHF_MULTIPATH flag. All dataplane lookup functions returns pointer to the nexthop object, leaving nexhop groups details inside routing subsystem. User-visible changes: The change is intended to be backward-compatible: all non-mpath operations should work as before with ROUTE_MPATH and net.route.multipath=1. All routes now comes with weight, default weight is 1, maximum is 2^24-1. Current maximum multipath group width is statically set to 64. This will become sysctl-tunable in the followup changes. Using functionality: * Recompile kernel with ROUTE_MPATH * set net.route.multipath to 1 route add -6 2001:db8::/32 2001:db8::2 -weight 10 route add -6 2001:db8::/32 2001:db8::3 -weight 20 netstat -6On Nexthop groups data Internet6: GrpIdx NhIdx Weight Slots Gateway Netif Refcnt 1 ------- ------- ------- --------------------------------------- --------- 1 13 10 1 2001:db8::2 vlan2 14 20 2 2001:db8::3 vlan2 Next steps: * Land outbound hashing for locally-originated routes ( D26523 ). * Fix net/bird multipath (net/frr seems to work fine) * Add ROUTE_MPATH to GENERIC * Set net.route.multipath=1 by default Tested by: olivier Reviewed by: glebius Relnotes: yes Differential Revision: https://reviews.freebsd.org/D26449 Added: head/sys/net/route/mpath_ctl.c (contents, props changed) head/sys/net/route/nhgrp.c (contents, props changed) head/sys/net/route/nhgrp_ctl.c (contents, props changed) head/sys/net/route/nhgrp_var.h (contents, props changed) head/usr.bin/netstat/nhgrp.c (contents, props changed) Modified: head/sys/conf/NOTES head/sys/conf/files head/sys/conf/options head/sys/net/radix.c head/sys/net/route.c head/sys/net/route.h head/sys/net/route/nhop.c head/sys/net/route/nhop.h head/sys/net/route/nhop_ctl.c head/sys/net/route/nhop_var.h head/sys/net/route/route_ctl.c head/sys/net/route/route_ctl.h head/sys/net/route/route_helpers.c head/sys/net/route/route_var.h head/sys/net/rtsock.c head/sys/netinet/in.c head/sys/netinet/in_fib.c head/sys/netinet/in_rmx.c head/sys/netinet/ip_output.c head/sys/netinet6/in6_fib.c head/sys/netinet6/in6_rmx.c head/sys/netinet6/nd6.c head/sys/sys/socket.h head/usr.bin/netstat/Makefile head/usr.bin/netstat/common.h head/usr.bin/netstat/main.c head/usr.bin/netstat/netstat.h head/usr.bin/netstat/nhops.c Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Sat Oct 3 09:36:33 2020 (r366389) +++ head/sys/conf/NOTES Sat Oct 3 10:47:17 2020 (r366390) @@ -1002,7 +1002,7 @@ device lagg # # TCP_HHOOK enables the hhook(9) framework hooks for the TCP stack. # -# RADIX_MPATH provides support for equal-cost multi-path routing. +# ROUTE_MPATH provides support for multipath routing. # options MROUTING # Multicast routing options IPFIREWALL #firewall @@ -1023,7 +1023,7 @@ options TCPDEBUG options TCPPCAP options TCP_BLACKBOX options TCP_HHOOK -options RADIX_MPATH +options ROUTE_MPATH # The MBUF_STRESS_TEST option enables options which create # various random failures / extreme cases related to mbuf Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat Oct 3 09:36:33 2020 (r366389) +++ head/sys/conf/files Sat Oct 3 10:47:17 2020 (r366390) @@ -4143,10 +4143,12 @@ net/debugnet.c optional inet debugnet net/debugnet_inet.c optional inet debugnet net/pfil.c optional ether | inet net/radix.c standard -net/radix_mpath.c standard net/raw_cb.c standard net/raw_usrreq.c standard net/route.c standard +net/route/mpath_ctl.c optional route_mpath +net/route/nhgrp.c optional route_mpath +net/route/nhgrp_ctl.c optional route_mpath net/route/nhop.c standard net/route/nhop_ctl.c standard net/route/nhop_utils.c standard Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Sat Oct 3 09:36:33 2020 (r366389) +++ head/sys/conf/options Sat Oct 3 10:47:17 2020 (r366390) @@ -454,6 +454,7 @@ NFSLOCKD PCBGROUP opt_pcbgroup.h PF_DEFAULT_TO_DROP opt_pf.h RADIX_MPATH opt_mpath.h +ROUTE_MPATH opt_route.h ROUTETABLES opt_route.h RSS opt_rss.h SLIP_IFF_OPTS opt_slip.h Modified: head/sys/net/radix.c ============================================================================== --- head/sys/net/radix.c Sat Oct 3 09:36:33 2020 (r366389) +++ head/sys/net/radix.c Sat Oct 3 10:47:17 2020 (r366390) @@ -44,10 +44,6 @@ #include #include #include -#include "opt_mpath.h" -#ifdef RADIX_MPATH -#include -#endif #else /* !_KERNEL */ #include #include Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Sat Oct 3 09:36:33 2020 (r366389) +++ head/sys/net/route.c Sat Oct 3 10:47:17 2020 (r366390) @@ -39,7 +39,6 @@ #include "opt_inet.h" #include "opt_inet6.h" #include "opt_mrouting.h" -#include "opt_mpath.h" #include "opt_route.h" #include Modified: head/sys/net/route.h ============================================================================== --- head/sys/net/route.h Sat Oct 3 09:36:33 2020 (r366389) +++ head/sys/net/route.h Sat Oct 3 10:47:17 2020 (r366390) @@ -178,6 +178,7 @@ VNET_DECLARE(u_int, rt_add_addr_allfibs); /* Announce */ /* Consumer-visible nexthop info flags */ +#define NHF_MULTIPATH 0x0008 /* Nexhop is a nexthop group */ #define NHF_REJECT 0x0010 /* RTF_REJECT */ #define NHF_BLACKHOLE 0x0020 /* RTF_BLACKHOLE */ #define NHF_REDIRECT 0x0040 /* RTF_DYNAMIC|RTF_MODIFIED */ @@ -208,6 +209,10 @@ struct rtstat { uint64_t rts_wildcard; /* lookups satisfied by a wildcard */ uint64_t rts_nh_idx_alloc_failure; /* nexthop index alloc failure*/ uint64_t rts_nh_alloc_failure; /* nexthop allocation failure*/ + uint64_t rts_add_failure; /* # of route addition failures */ + uint64_t rts_add_retry; /* # of route addition retries */ + uint64_t rts_del_failure; /* # of route deletion failure */ + uint64_t rts_del_retry; /* # of route deletion retries */ }; /* Added: head/sys/net/route/mpath_ctl.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/net/route/mpath_ctl.c Sat Oct 3 10:47:17 2020 (r366390) @@ -0,0 +1,165 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2020 Alexander V. Chernikov + * + * 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. + * + * $FreeBSD$ + */ + +#include "opt_inet.h" +#include "opt_route.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include + +/* + * This file contains the supporting functions for adding/deleting/updating + * multipath routes to the routing table. + */ + +SYSCTL_DECL(_net_route); + +/* + * Tries to add @rnd_add nhop to the existing set of nhops (@nh_orig) for the + * prefix specified by @rt. + * + * Return 0 ans consumes rt / rnd_add nhop references. @rc gets populated + * with the operation result. + * Otherwise errno is returned. + * + * caller responsibility is to unlock/free rt and + * rt->rt_nhop. + */ +int +add_route_mpath(struct rib_head *rnh, struct rt_addrinfo *info, + struct rtentry *rt, struct route_nhop_data *rnd_add, + struct route_nhop_data *rnd_orig, struct rib_cmd_info *rc) +{ + RIB_RLOCK_TRACKER; + struct route_nhop_data rnd_new; + int error = 0; + + /* + * It is possible that multiple rtsock speakers will try to update + * the same route simultaneously. Reduce the chance of failing the + * request by retrying the cycle multiple times. + */ + for (int i = 0; i < RIB_MAX_RETRIES; i++) { + error = nhgrp_get_addition_group(rnh, rnd_orig, rnd_add, + &rnd_new); + if (error != 0) { + if (error != EAGAIN) + break; + + /* + * Group creation failed, most probably because + * @rnd_orig data got scheduled for deletion. + * Refresh @rnd_orig data and retry. + */ + RIB_RLOCK(rnh); + lookup_prefix(rnh, info, rnd_orig); + RIB_RUNLOCK(rnh); + continue; + } + + error = change_route_conditional(rnh, rt, info, rnd_orig, + &rnd_new, rc); + if (error != EAGAIN) + break; + RTSTAT_INC(rts_add_retry); + } + + return (error); +} + +struct rt_match_info { + struct rt_addrinfo *info; + struct rtentry *rt; +}; + +static bool +gw_filter_func(const struct nhop_object *nh, void *_data) +{ + struct rt_match_info *ri = (struct rt_match_info *)_data; + + return (check_info_match_nhop(ri->info, ri->rt, nh) == 0); +} + +/* + * Tries to delete matching paths from @nhg. + * Returns 0 on success and updates operation result in @rc. + */ +int +del_route_mpath(struct rib_head *rh, struct rt_addrinfo *info, + struct rtentry *rt, struct nhgrp_object *nhg, + struct rib_cmd_info *rc) +{ + struct route_nhop_data rnd; + struct rt_match_info ri = { .info = info, .rt = rt }; + int error; + + RIB_WLOCK_ASSERT(rh); + + /* + * Require gateway to delete multipath routes, to forbid + * deleting all paths at once. + * If the filter function is provided, skip gateway check to + * allow rib_walk_del() delete routes for any criteria based + * on provided callback. + */ + if ((info->rti_info[RTAX_GATEWAY] == NULL) && (info->rti_filter == NULL)) + return (ESRCH); + + error = nhgrp_get_filtered_group(rh, nhg, gw_filter_func, (void *)&ri, + &rnd); + if (error == 0) + error = change_route_nhop(rh, rt, info, &rnd, rc); + return (error); +} + Added: head/sys/net/route/nhgrp.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/net/route/nhgrp.c Sat Oct 3 10:47:17 2020 (r366390) @@ -0,0 +1,344 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2020 Alexander V. Chernikov + * + * 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. + * + * $FreeBSD$ + */ + +#include "opt_inet.h" +#include "opt_route.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include + +/* + * This file contains data structures management logic for the nexthop + * groups ("nhgrp") route subsystem. + * + * Nexthop groups are used to store multiple routes available for the specific + * prefix. Nexthop groups are immutable and can be shared across multiple + * prefixes. + * + * Each group consists of a control plane part and a dataplane part. + * Control plane is basically a collection of nexthop objects with + * weights and refcount. + * + * Datapath consists of a array of nexthop pointers, compiled from control + * plane data to support O(1) nexthop selection. + * + * For example, consider the following group: + * [(nh1, weight=100), (nh2, weight=200)] + * It will compile to the following array: + * [nh1, nh2, nh2] + * + */ + +static void consider_resize(struct nh_control *ctl, uint32_t new_nh_buckets, + uint32_t new_idx_items); + +static int cmp_nhgrp(const struct nhgrp_priv *a, const struct nhgrp_priv *b); +static unsigned int hash_nhgrp(const struct nhgrp_priv *obj); + +static unsigned +djb_hash(const unsigned char *h, const int len) +{ + unsigned int result = 0; + int i; + + for (i = 0; i < len; i++) + result = 33 * result ^ h[i]; + + return (result); +} + +static int +cmp_nhgrp(const struct nhgrp_priv *a, const struct nhgrp_priv *b) +{ + + /* + * In case of consistent hashing, there can be multiple nexthop groups + * with the same "control plane" list of nexthops with weights and a + * different set of "data plane" nexthops. + * For now, ignore the data plane and focus on the control plane list. + */ + if (a->nhg_nh_count != b->nhg_nh_count) + return (0); + return !memcmp(a->nhg_nh_weights, b->nhg_nh_weights, + sizeof(struct weightened_nhop) * a->nhg_nh_count); +} + +/* + * Hash callback: calculate hash of an object + */ +static unsigned int +hash_nhgrp(const struct nhgrp_priv *obj) +{ + const unsigned char *key; + + key = (const unsigned char *)obj->nhg_nh_weights; + + return (djb_hash(key, sizeof(struct weightened_nhop) * obj->nhg_nh_count)); +} + +/* + * Returns object referenced and unlocked + */ +struct nhgrp_priv * +find_nhgrp(struct nh_control *ctl, const struct nhgrp_priv *key) +{ + struct nhgrp_priv *priv_ret; + + NHOPS_RLOCK(ctl); + CHT_SLIST_FIND_BYOBJ(&ctl->gr_head, mpath, key, priv_ret); + if (priv_ret != NULL) { + if (refcount_acquire_if_not_zero(&priv_ret->nhg_refcount) == 0) { + /* refcount is 0 -> group is being deleted */ + priv_ret = NULL; + } + } + NHOPS_RUNLOCK(ctl); + + return (priv_ret); +} + +int +link_nhgrp(struct nh_control *ctl, struct nhgrp_priv *grp_priv) +{ + uint16_t idx; + uint32_t new_num_buckets, new_num_items; + + NHOPS_WLOCK(ctl); + /* Check if we need to resize hash and index */ + new_num_buckets = CHT_SLIST_GET_RESIZE_BUCKETS(&ctl->gr_head); + new_num_items = bitmask_get_resize_items(&ctl->gr_idx_head); + + if (bitmask_alloc_idx(&ctl->gr_idx_head, &idx) != 0) { + NHOPS_WUNLOCK(ctl); + DPRINTF("Unable to allocate mpath index"); + consider_resize(ctl, new_num_buckets, new_num_items); + return (0); + } + + grp_priv->nhg_idx = idx; + grp_priv->nh_control = ctl; + CHT_SLIST_INSERT_HEAD(&ctl->gr_head, mpath, grp_priv); + + NHOPS_WUNLOCK(ctl); + + consider_resize(ctl, new_num_buckets, new_num_items); + + return (1); +} + +struct nhgrp_priv * +unlink_nhgrp(struct nh_control *ctl, struct nhgrp_priv *key) +{ + struct nhgrp_priv *nhg_priv_ret; + int ret, idx; + + NHOPS_WLOCK(ctl); + + CHT_SLIST_REMOVE_BYOBJ(&ctl->gr_head, mpath, key, nhg_priv_ret); + + if (nhg_priv_ret == NULL) { + DPRINTF("Unable to find nhop group!"); + NHOPS_WUNLOCK(ctl); + return (NULL); + } + + idx = nhg_priv_ret->nhg_idx; + ret = bitmask_free_idx(&ctl->gr_idx_head, idx); + nhg_priv_ret->nhg_idx = 0; + nhg_priv_ret->nh_control = NULL; + + NHOPS_WUNLOCK(ctl); + + return (nhg_priv_ret); +} + +/* + * Checks if hash needs resizing and performs this resize if necessary + * + */ +__noinline static void +consider_resize(struct nh_control *ctl, uint32_t new_nh_buckets, uint32_t new_idx_items) +{ + void *nh_ptr, *nh_idx_ptr; + void *old_idx_ptr; + size_t alloc_size; + + nh_ptr = NULL ; + if (new_nh_buckets != 0) { + alloc_size = CHT_SLIST_GET_RESIZE_SIZE(new_nh_buckets); + nh_ptr = malloc(alloc_size, M_NHOP, M_NOWAIT | M_ZERO); + } + + nh_idx_ptr = NULL; + if (new_idx_items != 0) { + alloc_size = bitmask_get_size(new_idx_items); + nh_idx_ptr = malloc(alloc_size, M_NHOP, M_NOWAIT | M_ZERO); + } + + if (nh_ptr == NULL && nh_idx_ptr == NULL) { + /* Either resize is not required or allocations have failed. */ + return; + } + + DPRINTF("mp: going to resize: nh:[ptr:%p sz:%u] idx:[ptr:%p sz:%u]", + nh_ptr, new_nh_buckets, nh_idx_ptr, new_idx_items); + + old_idx_ptr = NULL; + + NHOPS_WLOCK(ctl); + if (nh_ptr != NULL) { + CHT_SLIST_RESIZE(&ctl->gr_head, mpath, nh_ptr, new_nh_buckets); + } + if (nh_idx_ptr != NULL) { + if (bitmask_copy(&ctl->gr_idx_head, nh_idx_ptr, new_idx_items)) + bitmask_swap(&ctl->nh_idx_head, nh_idx_ptr, new_idx_items, &old_idx_ptr); + } + NHOPS_WUNLOCK(ctl); + + if (nh_ptr != NULL) + free(nh_ptr, M_NHOP); + if (old_idx_ptr != NULL) + free(old_idx_ptr, M_NHOP); +} + +/* + * Function allocating the necessary group data structures. + */ +bool +nhgrp_ctl_alloc_default(struct nh_control *ctl, int malloc_flags) +{ + size_t alloc_size; + uint32_t num_buckets, num_items; + void *cht_ptr, *mask_ptr; + + malloc_flags = (malloc_flags & (M_NOWAIT | M_WAITOK)) | M_ZERO; + + num_buckets = 8; + alloc_size = CHT_SLIST_GET_RESIZE_SIZE(num_buckets); + cht_ptr = malloc(alloc_size, M_NHOP, malloc_flags); + + if (cht_ptr == NULL) { + DPRINTF("mpath init failed"); + return (false); + } + + /* + * Allocate nexthop index bitmask. + */ + num_items = 128; + mask_ptr = malloc(bitmask_get_size(num_items), M_NHOP, malloc_flags); + if (mask_ptr == NULL) { + DPRINTF("mpath bitmask init failed"); + free(cht_ptr, M_NHOP); + return (false); + } + + NHOPS_WLOCK(ctl); + + if (ctl->gr_head.hash_size == 0) { + /* Init hash and bitmask */ + CHT_SLIST_INIT(&ctl->gr_head, cht_ptr, num_buckets); + bitmask_init(&ctl->gr_idx_head, mask_ptr, num_items); + NHOPS_WUNLOCK(ctl); + } else { + /* Other thread has already initiliazed hash/bitmask */ + NHOPS_WUNLOCK(ctl); + free(cht_ptr, M_NHOP); + free(mask_ptr, M_NHOP); + } + + DPRINTF("mpath init done for fib/af %d/%d", ctl->rh->rib_fibnum, + ctl->rh->rib_family); + + return (true); +} + +int +nhgrp_ctl_init(struct nh_control *ctl) +{ + + /* + * By default, do not allocate datastructures as multipath + * routes will not be necessarily used. + */ + CHT_SLIST_INIT(&ctl->gr_head, NULL, 0); + bitmask_init(&ctl->gr_idx_head, NULL, 0); + return (0); +} + +void +nhgrp_ctl_free(struct nh_control *ctl) +{ + + if (ctl->gr_head.ptr != NULL) + free(ctl->gr_head.ptr, M_NHOP); + if (ctl->gr_idx_head.idx != NULL) + free(ctl->gr_idx_head.idx, M_NHOP); +} + +void +nhgrp_ctl_unlink_all(struct nh_control *ctl) +{ + struct nhgrp_priv *nhg_priv; + + NHOPS_WLOCK_ASSERT(ctl); + + CHT_SLIST_FOREACH(&ctl->gr_head, mpath, nhg_priv) { + DPRINTF("Marking nhgrp %u unlinked", nhg_priv->nhg_idx); + refcount_release(&nhg_priv->nhg_linked); + } CHT_SLIST_FOREACH_END; +} + Added: head/sys/net/route/nhgrp_ctl.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/net/route/nhgrp_ctl.c Sat Oct 3 10:47:17 2020 (r366390) @@ -0,0 +1,788 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2020 Alexander V. Chernikov + * + * 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. + * + * $FreeBSD$ + */ +#define RTDEBUG +#include "opt_inet.h" +#include "opt_route.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include + +/* + * This file contains the supporting functions for creating multipath groups + * and compiling their dataplane parts. + */ + +/* MPF_MULTIPATH must be the same as NHF_MULTIPATH for nhop selection to work */ +_Static_assert(MPF_MULTIPATH == NHF_MULTIPATH, + "MPF_MULTIPATH must be the same as NHF_MULTIPATH"); +/* Offset and size of flags field has to be the same for nhop/nhop groups */ +CHK_STRUCT_FIELD_GENERIC(struct nhop_object, nh_flags, struct nhgrp_object, nhg_flags); +/* Cap multipath to 64, as the larger values would break rib_cmd_info bmasks */ +CTASSERT(RIB_MAX_MPATH_WIDTH <= 64); + +static int wn_cmp(const void *a, const void *b); +static void sort_weightened_nhops(struct weightened_nhop *wn, int num_nhops); + +static struct nhgrp_priv *get_nhgrp(struct nh_control *ctl, + struct weightened_nhop *wn, int num_nhops, int *perror); +static void destroy_nhgrp(struct nhgrp_priv *nhg_priv); +static void destroy_nhgrp_epoch(epoch_context_t ctx); +static void free_nhgrp_nhops(struct nhgrp_priv *nhg_priv); + +static int +wn_cmp(const void *a, const void *b) +{ + const struct weightened_nhop *wa = a; + const struct weightened_nhop *wb = b; + + if (wa->weight > wb->weight) + return (1); + else if (wa->weight < wb->weight) + return (-1); + + /* Compare nexthops by pointer */ + if (wa->nh > wb->nh) + return (1); + else if (wa->nh < wb->nh) + return (-1); + else + return (0); +} + +/* + * Perform in-place sorting for array of nexthops in @wn. + * + * To avoid nh groups duplication, nexthops/weights in the + * @wn need to be ordered deterministically. + * As this sorting is needed only for the control plane functionality, + * there are no specific external requirements. + * + * Sort by weight first, to ease calculation of the slot sizes. + */ +static void +sort_weightened_nhops(struct weightened_nhop *wn, int num_nhops) +{ + + qsort(wn, num_nhops, sizeof(struct weightened_nhop), wn_cmp); +} + +/* + * Calculate minimum number of slots required to fit the existing + * set of weights in the common use case where weights are "easily" + * comparable. + * Assumes @wn is sorted by weight ascending and each weight is > 0. + * Returns number of slots or 0 if precise calculation failed. + * + * Some examples: + * note: (i, X) pair means (nhop=i, weight=X): + * (1, 1) (2, 2) -> 3 slots [1, 2, 2] + * (1, 100), (2, 200) -> 3 slots [1, 2, 2] + * (1, 100), (2, 200), (3, 400) -> 7 slots [1, 2, 2, 3, 3, 3] + */ +static uint32_t +calc_min_mpath_slots_fast(const struct weightened_nhop *wn, size_t num_items) +{ + uint32_t i, last, xmin; + uint64_t total = 0; + + last = 0; + xmin = wn[0].weight; + for (i = 0; i < num_items; i++) { + total += wn[i].weight; + if ((wn[i].weight - last < xmin) && (wn[i].weight != last)) + xmin = wn[i].weight - last; + last = wn[i].weight; + } + /* xmin is the minimum unit of desired capacity */ + if ((total % xmin) != 0) + return (0); + for (i = 0; i < num_items; i++) { + if ((wn[i].weight % xmin) != 0) + return (0); + } + + return ((uint32_t)(total / xmin)); +} + +/* + * Calculate minimum number of slots required to fit the existing + * set of weights while maintaining weight coefficients. + * + * Assume @wn is sorted by weight ascending and each weight is > 0. + * + * Tries to find simple precise solution first and falls back to + * RIB_MAX_MPATH_WIDTH in case of any failure. + */ +static uint32_t +calc_min_mpath_slots(const struct weightened_nhop *wn, size_t num_items) +{ + uint32_t v; + + v = calc_min_mpath_slots_fast(wn, num_items); + if ((v == 0) || (v > RIB_MAX_MPATH_WIDTH)) + v = RIB_MAX_MPATH_WIDTH; + + return (v); +} + +/* + * Nexthop group data consists of + * 1) dataplane part, with nhgrp_object as a header followed by an + * arbitrary number of nexthop pointers. + * 2) control plane part, with nhgrp_priv as a header, followed by + * an arbirtrary number of 'struct weightened_nhop' object. + * + * Given nexthop groups are (mostly) immutable, allocate all data + * in one go. + * + */ +__noinline static size_t +get_nhgrp_alloc_size(uint32_t nhg_size, uint32_t num_nhops) +{ + size_t sz; + + sz = sizeof(struct nhgrp_object); + sz += nhg_size * sizeof(struct nhop_object *); + sz += sizeof(struct nhgrp_priv); + sz += num_nhops * sizeof(struct weightened_nhop); + return (sz); +} + +/* + * Compile actual list of nexthops to be used by datapath from + * the nexthop group @dst. + * + * For example, compiling control plane list of 2 nexthops + * [(200, A), (100, B)] would result in the datapath array + * [A, A, B] + */ +static void +compile_nhgrp(struct nhgrp_priv *dst_priv, const struct weightened_nhop *x, + uint32_t num_slots) +{ + struct nhgrp_object *dst; + int i, slot_idx, remaining_slots; + uint64_t remaining_sum, nh_weight, nh_slots; + + slot_idx = 0; + dst = dst_priv->nhg; + /* Calculate sum of all weights */ + remaining_sum = 0; + for (i = 0; i < dst_priv->nhg_nh_count; i++) + remaining_sum += x[i].weight; + remaining_slots = num_slots; + DPRINTF("O: %u/%u", (uint32_t)remaining_sum, remaining_slots); + for (i = 0; i < dst_priv->nhg_nh_count; i++) { + /* Calculate number of slots for the current nexthop */ + if (remaining_sum > 0) { + nh_weight = (uint64_t)x[i].weight; + nh_slots = (nh_weight * remaining_slots / remaining_sum); + } else + nh_slots = 0; + + remaining_sum -= x[i].weight; + remaining_slots -= nh_slots; + + DPRINTF(" OO[%d]: %u/%u curr=%d slot_idx=%d", i, + (uint32_t)remaining_sum, remaining_slots, + (int)nh_slots, slot_idx); + + KASSERT((slot_idx + nh_slots <= num_slots), + ("index overflow during nhg compilation")); + while (nh_slots-- > 0) + dst->nhops[slot_idx++] = x[i].nh; + } +} + +/* + * Allocates new nexthop group for the list of weightened nexthops. + * Assume sorted list. + * Does NOT reference any nexthops in the group. + * Returns group with refcount=1 or NULL. + */ +static struct nhgrp_priv * +alloc_nhgrp(struct weightened_nhop *wn, int num_nhops) +{ + uint32_t nhgrp_size; + int flags = M_NOWAIT; + struct nhgrp_object *nhg; + struct nhgrp_priv *nhg_priv; + + nhgrp_size = calc_min_mpath_slots(wn, num_nhops); + if (nhgrp_size == 0) { + /* Zero weights, abort */ + return (NULL); + } + + size_t sz = get_nhgrp_alloc_size(nhgrp_size, num_nhops); + nhg = malloc(sz, M_NHOP, flags | M_ZERO); + if (nhg == NULL) { + return (NULL); + } + + /* Has to be the first to make NHGRP_PRIV() work */ + nhg->nhg_size = nhgrp_size; + DPRINTF("new mpath group: num_nhops: %u", (uint32_t)nhgrp_size); + nhg->nhg_flags = MPF_MULTIPATH; + + nhg_priv = NHGRP_PRIV(nhg); + nhg_priv->nhg_nh_count = num_nhops; + refcount_init(&nhg_priv->nhg_refcount, 1); + + /* Please see nhgrp_free() comments on the initial value */ + refcount_init(&nhg_priv->nhg_linked, 2); + + nhg_priv->nhg = nhg; + memcpy(&nhg_priv->nhg_nh_weights[0], wn, + num_nhops * sizeof(struct weightened_nhop)); + + compile_nhgrp(nhg_priv, wn, nhg->nhg_size); + + return (nhg_priv); +} + +void +nhgrp_free(struct nhgrp_object *nhg) +{ + struct nhgrp_priv *nhg_priv; + struct nh_control *ctl; + struct epoch_tracker et; + + nhg_priv = NHGRP_PRIV(nhg); + + if (!refcount_release(&nhg_priv->nhg_refcount)) + return; + + /* + * group objects don't have an explicit lock attached to it. + * As groups are reclaimed based on reference count, it is possible + * that some groups will persist after vnet destruction callback + * called. Given that, handle scenario with nhgrp_free_group() being + * called either after or simultaneously with nhgrp_ctl_unlink_all() + * by using another reference counter: nhg_linked. + * + * There are only 2 places, where nhg_linked can be decreased: + * rib destroy (nhgrp_ctl_unlink_all) and this function. + * nhg_link can never be increased. + * + * Hence, use initial value of 2 to make use of + * refcount_release_if_not_last(). + * + * There can be two scenarious when calling this function: + * + * 1) nhg_linked value is 2. This means that either + * nhgrp_ctl_unlink_all() has not been called OR it is running, + * but we are guaranteed that nh_control won't be freed in + * this epoch. Hence, nexthop can be safely unlinked. + * + * 2) nh_linked value is 1. In that case, nhgrp_ctl_unlink_all() + * has been called and nhgrp unlink can be skipped. + */ + + NET_EPOCH_ENTER(et); + if (refcount_release_if_not_last(&nhg_priv->nhg_linked)) { + ctl = nhg_priv->nh_control; + if (unlink_nhgrp(ctl, nhg_priv) == NULL) { + /* Do not try to reclaim */ + DPRINTF("Failed to unlink nexhop group %p", nhg_priv); + NET_EPOCH_EXIT(et); + return; + } + } + NET_EPOCH_EXIT(et); + + epoch_call(net_epoch_preempt, destroy_nhgrp_epoch, + &nhg_priv->nhg_epoch_ctx); +} + +/* + * Destroys all local resources belonging to @nhg_priv. + */ +__noinline static void +destroy_nhgrp_int(struct nhgrp_priv *nhg_priv) +{ + + free(nhg_priv->nhg, M_NHOP); +} + +__noinline static void +destroy_nhgrp(struct nhgrp_priv *nhg_priv) +{ + + KASSERT((nhg_priv->nhg_refcount == 0), ("nhg_refcount != 0")); + + DPRINTF("DEL MPATH %p", nhg_priv); + + KASSERT((nhg_priv->nhg_idx == 0), ("gr_idx != 0")); + + free_nhgrp_nhops(nhg_priv); + + destroy_nhgrp_int(nhg_priv); +} + +/* + * Epoch callback indicating group is safe to destroy + */ +static void +destroy_nhgrp_epoch(epoch_context_t ctx) +{ + struct nhgrp_priv *nhg_priv; + + nhg_priv = __containerof(ctx, struct nhgrp_priv, nhg_epoch_ctx); + + destroy_nhgrp(nhg_priv); +} + +static bool +ref_nhgrp_nhops(struct nhgrp_priv *nhg_priv) +{ + + for (int i = 0; i < nhg_priv->nhg_nh_count; i++) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Oct 3 12:03:09 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BEECF42D644; Sat, 3 Oct 2020 12:03:09 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C3QVP4fDcz4H4G; Sat, 3 Oct 2020 12:03:09 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 83CE812BFF; Sat, 3 Oct 2020 12:03:09 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 093C397S083089; Sat, 3 Oct 2020 12:03:09 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 093C39BW083088; Sat, 3 Oct 2020 12:03:09 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202010031203.093C39BW083088@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 3 Oct 2020 12:03:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366391 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 366391 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Oct 2020 12:03:09 -0000 Author: trasz Date: Sat Oct 3 12:03:08 2020 New Revision: 366391 URL: https://svnweb.freebsd.org/changeset/base/366391 Log: Move KTRUSERRET() from userret() to ast(). It's a really long detour - it writes ktrace entries to the filesystem - so the overhead of ast() won't make any difference. Reviewed by: kib Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D26404 Modified: head/sys/kern/kern_ktrace.c head/sys/kern/subr_trap.c Modified: head/sys/kern/kern_ktrace.c ============================================================================== --- head/sys/kern/kern_ktrace.c Sat Oct 3 10:47:17 2020 (r366390) +++ head/sys/kern/kern_ktrace.c Sat Oct 3 12:03:08 2020 (r366391) @@ -347,6 +347,9 @@ ktr_enqueuerequest(struct thread *td, struct ktr_reque mtx_lock(&ktrace_mtx); STAILQ_INSERT_TAIL(&td->td_proc->p_ktr, req, ktr_list); mtx_unlock(&ktrace_mtx); + thread_lock(td); + td->td_flags |= TDF_ASTPENDING; + thread_unlock(td); } /* Modified: head/sys/kern/subr_trap.c ============================================================================== --- head/sys/kern/subr_trap.c Sat Oct 3 10:47:17 2020 (r366390) +++ head/sys/kern/subr_trap.c Sat Oct 3 12:03:08 2020 (r366391) @@ -130,9 +130,6 @@ userret(struct thread *td, struct trapframe *frame) PROC_UNLOCK(p); } #endif -#ifdef KTRACE - KTRUSERRET(td); -#endif /* * Charge system time if profiling. @@ -340,6 +337,10 @@ ast(struct trapframe *framep) */ if (td->td_pflags & TDP_SIGFASTPENDING) sigfastblock_setpend(td, false); + +#ifdef KTRACE + KTRUSERRET(td); +#endif /* * We need to check to see if we have to exit or wait due to a From owner-svn-src-all@freebsd.org Sat Oct 3 12:30:04 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CB95A42DD03; Sat, 3 Oct 2020 12:30:04 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) (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 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C3R5S3c6vz4JVV; Sat, 3 Oct 2020 12:30:04 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wm1-x334.google.com with SMTP id w2so4197307wmi.1; Sat, 03 Oct 2020 05:30:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=EBHFfciWDu54xGDPDTEKbk8AaFS51Kme6H4qZBugfl4=; b=hk7AcK7n0AwPiudN1JFLHqtwyGY5rw4vLojSanPdOz9TBbHgNsBzQapPDwp0Zw3MEY 9GOsTWm2VDvdq7y5XxsS3n8gWHzh81pkAWlAImaHPnoRbUPYIASiWB5EmAPwu9WekrpK xpQFoDmdmgazWXXtlSCvj4+2xDiMHJGvD4Trab1rLJGXuRX5ynco06jYHilTsUH2iqTO DaI5QN48/udH40sGJt+T8dvAghC49GNqKCXbFbFTVcFAIjnox1dq5UqFB8JNIwhVk5Oq HEYdWYr8j/MAd9BeTl8kuALnjpgdBO7/KJrz485bf4H7taWyoQJwGnlEDqB9sFPIAND/ rxiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=EBHFfciWDu54xGDPDTEKbk8AaFS51Kme6H4qZBugfl4=; b=EYDUgHSQPhIM2pf0P7lKoZ5EACq1EPoTHWpRqDUNWIy2kdD8/r9/Vk+rkJS2tusMC4 NQFSM9pVyDZRzueKoIrJds4yCur/4EWSiwN7Hewq0K3d3tK30xTvNxlNepJRtsZAv0c0 pHWQb0UaE7fvx6H2mQiWGFLcjK1JvVuw9j4jsAEsNGNGM3A5HE9RzfFz2GbBuIb+41wL OnbSyGWqPn1NYo8oamUHIk2oJOXWuQ1G+3f4betsJOIAWLqVg3YAdRwY/zew9DOKXmzf bph/lhtD+9CKyBS/rfzr062j3pI5riooPt/sPLZJHq0wQLhZpGyhZTxxHYeR9PgRqwCy 0tlQ== X-Gm-Message-State: AOAM532Kp2Yl9bggo+YO1ig7n7T+ue36UHcprlp5UZjFKqAuMtP2bkV2 IdN0kecMKJPMyP5I8LrG4la4s/9xUPQr3TvzwNGY4NyWMOU= X-Google-Smtp-Source: ABdhPJwftnAUVsw4d9ZDQNqqkuBaMyJr4qftoMoFdmf7ycs7a5EcvMY7PhFHQHewjSymZaMO31dnk84TMu9CwCMXsG4= X-Received: by 2002:a1c:a5c8:: with SMTP id o191mr7826713wme.127.1601728201919; Sat, 03 Oct 2020 05:30:01 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a05:6000:187:0:0:0:0 with HTTP; Sat, 3 Oct 2020 05:30:00 -0700 (PDT) In-Reply-To: <202010031047.093AlHsL034340@repo.freebsd.org> References: <202010031047.093AlHsL034340@repo.freebsd.org> From: Mateusz Guzik Date: Sat, 3 Oct 2020 14:30:00 +0200 Message-ID: Subject: Re: svn commit: r366390 - in head: sys/conf sys/net sys/net/route sys/netinet sys/netinet6 sys/sys usr.bin/netstat To: "Alexander V. Chernikov" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4C3R5S3c6vz4JVV X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Oct 2020 12:30:04 -0000 This gives me: /tank/users/mjg/src/freebsd/sys/net/route/route_ctl.c:94:13: warning: unused function 'rib_can_multipath' [-Wunused-function] static bool rib_can_multipath(struct rib_head *rh); ^ /tank/users/mjg/src/freebsd/sys/net/rtsock.c:851:1: warning: unused function 'save_del_notification' [-Wunused-function] save_del_notification(struct rib_cmd_info *rc, void *_cbdata) ^ /tank/users/mjg/src/freebsd/sys/net/rtsock.c:860:1: warning: unused function 'save_add_notification' [-Wunused-function] save_add_notification(struct rib_cmd_info *rc, void *_cbdata) ^ On 10/3/20, Alexander V. Chernikov wrote: > Author: melifaro > Date: Sat Oct 3 10:47:17 2020 > New Revision: 366390 > URL: https://svnweb.freebsd.org/changeset/base/366390 > > Log: > Introduce scalable route multipath. > > This change is based on the nexthop objects landed in D24232. > > The change introduces the concept of nexthop groups. > Each group contains the collection of nexthops with their > relative weights and a dataplane-optimized structure to enable > efficient nexthop selection. > > Simular to the nexthops, nexthop groups are immutable. Dataplane part > gets compiled during group creation and is basically an array of > nexthop pointers, compiled w.r.t their weights. > > With this change, `rt_nhop` field of `struct rtentry` contains either > nexthop or nexthop group. They are distinguished by the presense of > NHF_MULTIPATH flag. > All dataplane lookup functions returns pointer to the nexthop object, > leaving nexhop groups details inside routing subsystem. > > User-visible changes: > > The change is intended to be backward-compatible: all non-mpath > operations > should work as before with ROUTE_MPATH and net.route.multipath=1. > > All routes now comes with weight, default weight is 1, maximum is 2^24-1. > > Current maximum multipath group width is statically set to 64. > This will become sysctl-tunable in the followup changes. > > Using functionality: > * Recompile kernel with ROUTE_MPATH > * set net.route.multipath to 1 > > route add -6 2001:db8::/32 2001:db8::2 -weight 10 > route add -6 2001:db8::/32 2001:db8::3 -weight 20 > > netstat -6On > > Nexthop groups data > > Internet6: > GrpIdx NhIdx Weight Slots Gateway > Netif Refcnt > 1 ------- ------- ------- --------------------------------------- > --------- 1 > 13 10 1 2001:db8::2 > vlan2 > 14 20 2 2001:db8::3 > vlan2 > > Next steps: > * Land outbound hashing for locally-originated routes ( D26523 ). > * Fix net/bird multipath (net/frr seems to work fine) > * Add ROUTE_MPATH to GENERIC > * Set net.route.multipath=1 by default > > Tested by: olivier > Reviewed by: glebius > Relnotes: yes > Differential Revision: https://reviews.freebsd.org/D26449 > > Added: > head/sys/net/route/mpath_ctl.c (contents, props changed) > head/sys/net/route/nhgrp.c (contents, props changed) > head/sys/net/route/nhgrp_ctl.c (contents, props changed) > head/sys/net/route/nhgrp_var.h (contents, props changed) > head/usr.bin/netstat/nhgrp.c (contents, props changed) > Modified: > head/sys/conf/NOTES > head/sys/conf/files > head/sys/conf/options > head/sys/net/radix.c > head/sys/net/route.c > head/sys/net/route.h > head/sys/net/route/nhop.c > head/sys/net/route/nhop.h > head/sys/net/route/nhop_ctl.c > head/sys/net/route/nhop_var.h > head/sys/net/route/route_ctl.c > head/sys/net/route/route_ctl.h > head/sys/net/route/route_helpers.c > head/sys/net/route/route_var.h > head/sys/net/rtsock.c > head/sys/netinet/in.c > head/sys/netinet/in_fib.c > head/sys/netinet/in_rmx.c > head/sys/netinet/ip_output.c > head/sys/netinet6/in6_fib.c > head/sys/netinet6/in6_rmx.c > head/sys/netinet6/nd6.c > head/sys/sys/socket.h > head/usr.bin/netstat/Makefile > head/usr.bin/netstat/common.h > head/usr.bin/netstat/main.c > head/usr.bin/netstat/netstat.h > head/usr.bin/netstat/nhops.c > > Modified: head/sys/conf/NOTES > ============================================================================== > --- head/sys/conf/NOTES Sat Oct 3 09:36:33 2020 (r366389) > +++ head/sys/conf/NOTES Sat Oct 3 10:47:17 2020 (r366390) > @@ -1002,7 +1002,7 @@ device lagg > # > # TCP_HHOOK enables the hhook(9) framework hooks for the TCP stack. > # > -# RADIX_MPATH provides support for equal-cost multi-path routing. > +# ROUTE_MPATH provides support for multipath routing. > # > options MROUTING # Multicast routing > options IPFIREWALL #firewall > @@ -1023,7 +1023,7 @@ options TCPDEBUG > options TCPPCAP > options TCP_BLACKBOX > options TCP_HHOOK > -options RADIX_MPATH > +options ROUTE_MPATH > > # The MBUF_STRESS_TEST option enables options which create > # various random failures / extreme cases related to mbuf > > Modified: head/sys/conf/files > ============================================================================== > --- head/sys/conf/files Sat Oct 3 09:36:33 2020 (r366389) > +++ head/sys/conf/files Sat Oct 3 10:47:17 2020 (r366390) > @@ -4143,10 +4143,12 @@ net/debugnet.c optional inet debugnet > net/debugnet_inet.c optional inet debugnet > net/pfil.c optional ether | inet > net/radix.c standard > -net/radix_mpath.c standard > net/raw_cb.c standard > net/raw_usrreq.c standard > net/route.c standard > +net/route/mpath_ctl.c optional route_mpath > +net/route/nhgrp.c optional route_mpath > +net/route/nhgrp_ctl.c optional route_mpath > net/route/nhop.c standard > net/route/nhop_ctl.c standard > net/route/nhop_utils.c standard > > Modified: head/sys/conf/options > ============================================================================== > --- head/sys/conf/options Sat Oct 3 09:36:33 2020 (r366389) > +++ head/sys/conf/options Sat Oct 3 10:47:17 2020 (r366390) > @@ -454,6 +454,7 @@ NFSLOCKD > PCBGROUP opt_pcbgroup.h > PF_DEFAULT_TO_DROP opt_pf.h > RADIX_MPATH opt_mpath.h > +ROUTE_MPATH opt_route.h > ROUTETABLES opt_route.h > RSS opt_rss.h > SLIP_IFF_OPTS opt_slip.h > > Modified: head/sys/net/radix.c > ============================================================================== > --- head/sys/net/radix.c Sat Oct 3 09:36:33 2020 (r366389) > +++ head/sys/net/radix.c Sat Oct 3 10:47:17 2020 (r366390) > @@ -44,10 +44,6 @@ > #include > #include > #include > -#include "opt_mpath.h" > -#ifdef RADIX_MPATH > -#include > -#endif > #else /* !_KERNEL */ > #include > #include > > Modified: head/sys/net/route.c > ============================================================================== > --- head/sys/net/route.c Sat Oct 3 09:36:33 2020 (r366389) > +++ head/sys/net/route.c Sat Oct 3 10:47:17 2020 (r366390) > @@ -39,7 +39,6 @@ > #include "opt_inet.h" > #include "opt_inet6.h" > #include "opt_mrouting.h" > -#include "opt_mpath.h" > #include "opt_route.h" > > #include > > Modified: head/sys/net/route.h > ============================================================================== > --- head/sys/net/route.h Sat Oct 3 09:36:33 2020 (r366389) > +++ head/sys/net/route.h Sat Oct 3 10:47:17 2020 (r366390) > @@ -178,6 +178,7 @@ VNET_DECLARE(u_int, rt_add_addr_allfibs); /* Announce > */ > > /* Consumer-visible nexthop info flags */ > +#define NHF_MULTIPATH 0x0008 /* Nexhop is a nexthop group */ > #define NHF_REJECT 0x0010 /* RTF_REJECT */ > #define NHF_BLACKHOLE 0x0020 /* RTF_BLACKHOLE */ > #define NHF_REDIRECT 0x0040 /* RTF_DYNAMIC|RTF_MODIFIED */ > @@ -208,6 +209,10 @@ struct rtstat { > uint64_t rts_wildcard; /* lookups satisfied by a wildcard */ > uint64_t rts_nh_idx_alloc_failure; /* nexthop index alloc failure*/ > uint64_t rts_nh_alloc_failure; /* nexthop allocation failure*/ > + uint64_t rts_add_failure; /* # of route addition failures */ > + uint64_t rts_add_retry; /* # of route addition retries */ > + uint64_t rts_del_failure; /* # of route deletion failure */ > + uint64_t rts_del_retry; /* # of route deletion retries */ > }; > > /* > > Added: head/sys/net/route/mpath_ctl.c > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/net/route/mpath_ctl.c Sat Oct 3 10:47:17 2020 (r366390) > @@ -0,0 +1,165 @@ > +/*- > + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD > + * > + * Copyright (c) 2020 Alexander V. Chernikov > + * > + * 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. > + * > + * $FreeBSD$ > + */ > + > +#include "opt_inet.h" > +#include "opt_route.h" > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include > +#include > +#include > + > +#include > +#include > +#include > + > +/* > + * This file contains the supporting functions for > adding/deleting/updating > + * multipath routes to the routing table. > + */ > + > +SYSCTL_DECL(_net_route); > + > +/* > + * Tries to add @rnd_add nhop to the existing set of nhops (@nh_orig) for > the > + * prefix specified by @rt. > + * > + * Return 0 ans consumes rt / rnd_add nhop references. @rc gets populated > + * with the operation result. > + * Otherwise errno is returned. > + * > + * caller responsibility is to unlock/free rt and > + * rt->rt_nhop. > + */ > +int > +add_route_mpath(struct rib_head *rnh, struct rt_addrinfo *info, > + struct rtentry *rt, struct route_nhop_data *rnd_add, > + struct route_nhop_data *rnd_orig, struct rib_cmd_info *rc) > +{ > + RIB_RLOCK_TRACKER; > + struct route_nhop_data rnd_new; > + int error = 0; > + > + /* > + * It is possible that multiple rtsock speakers will try to update > + * the same route simultaneously. Reduce the chance of failing the > + * request by retrying the cycle multiple times. > + */ > + for (int i = 0; i < RIB_MAX_RETRIES; i++) { > + error = nhgrp_get_addition_group(rnh, rnd_orig, rnd_add, > + &rnd_new); > + if (error != 0) { > + if (error != EAGAIN) > + break; > + > + /* > + * Group creation failed, most probably because > + * @rnd_orig data got scheduled for deletion. > + * Refresh @rnd_orig data and retry. > + */ > + RIB_RLOCK(rnh); > + lookup_prefix(rnh, info, rnd_orig); > + RIB_RUNLOCK(rnh); > + continue; > + } > + > + error = change_route_conditional(rnh, rt, info, rnd_orig, > + &rnd_new, rc); > + if (error != EAGAIN) > + break; > + RTSTAT_INC(rts_add_retry); > + } > + > + return (error); > +} > + > +struct rt_match_info { > + struct rt_addrinfo *info; > + struct rtentry *rt; > +}; > + > +static bool > +gw_filter_func(const struct nhop_object *nh, void *_data) > +{ > + struct rt_match_info *ri = (struct rt_match_info *)_data; > + > + return (check_info_match_nhop(ri->info, ri->rt, nh) == 0); > +} > + > +/* > + * Tries to delete matching paths from @nhg. > + * Returns 0 on success and updates operation result in @rc. > + */ > +int > +del_route_mpath(struct rib_head *rh, struct rt_addrinfo *info, > + struct rtentry *rt, struct nhgrp_object *nhg, > + struct rib_cmd_info *rc) > +{ > + struct route_nhop_data rnd; > + struct rt_match_info ri = { .info = info, .rt = rt }; > + int error; > + > + RIB_WLOCK_ASSERT(rh); > + > + /* > + * Require gateway to delete multipath routes, to forbid > + * deleting all paths at once. > + * If the filter function is provided, skip gateway check to > + * allow rib_walk_del() delete routes for any criteria based > + * on provided callback. > + */ > + if ((info->rti_info[RTAX_GATEWAY] == NULL) && (info->rti_filter == NULL)) > + return (ESRCH); > + > + error = nhgrp_get_filtered_group(rh, nhg, gw_filter_func, (void *)&ri, > + &rnd); > + if (error == 0) > + error = change_route_nhop(rh, rt, info, &rnd, rc); > + return (error); > +} > + > > Added: head/sys/net/route/nhgrp.c > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/net/route/nhgrp.c Sat Oct 3 10:47:17 2020 (r366390) > @@ -0,0 +1,344 @@ > +/*- > + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD > + * > + * Copyright (c) 2020 Alexander V. Chernikov > + * > + * 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. > + * > + * $FreeBSD$ > + */ > + > +#include "opt_inet.h" > +#include "opt_route.h" > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include > +#include > +#include > + > +#include > +#include > +#include > +#include > + > +/* > + * This file contains data structures management logic for the nexthop > + * groups ("nhgrp") route subsystem. > + * > + * Nexthop groups are used to store multiple routes available for the > specific > + * prefix. Nexthop groups are immutable and can be shared across multiple > + * prefixes. > + * > + * Each group consists of a control plane part and a dataplane part. > + * Control plane is basically a collection of nexthop objects with > + * weights and refcount. > + * > + * Datapath consists of a array of nexthop pointers, compiled from control > + * plane data to support O(1) nexthop selection. > + * > + * For example, consider the following group: > + * [(nh1, weight=100), (nh2, weight=200)] > + * It will compile to the following array: > + * [nh1, nh2, nh2] > + * > + */ > + > +static void consider_resize(struct nh_control *ctl, uint32_t > new_nh_buckets, > + uint32_t new_idx_items); > + > +static int cmp_nhgrp(const struct nhgrp_priv *a, const struct nhgrp_priv > *b); > +static unsigned int hash_nhgrp(const struct nhgrp_priv *obj); > + > +static unsigned > +djb_hash(const unsigned char *h, const int len) > +{ > + unsigned int result = 0; > + int i; > + > + for (i = 0; i < len; i++) > + result = 33 * result ^ h[i]; > + > + return (result); > +} > + > +static int > +cmp_nhgrp(const struct nhgrp_priv *a, const struct nhgrp_priv *b) > +{ > + > + /* > + * In case of consistent hashing, there can be multiple nexthop groups > + * with the same "control plane" list of nexthops with weights and a > + * different set of "data plane" nexthops. > + * For now, ignore the data plane and focus on the control plane list. > + */ > + if (a->nhg_nh_count != b->nhg_nh_count) > + return (0); > + return !memcmp(a->nhg_nh_weights, b->nhg_nh_weights, > + sizeof(struct weightened_nhop) * a->nhg_nh_count); > +} > + > +/* > + * Hash callback: calculate hash of an object > + */ > +static unsigned int > +hash_nhgrp(const struct nhgrp_priv *obj) > +{ > + const unsigned char *key; > + > + key = (const unsigned char *)obj->nhg_nh_weights; > + > + return (djb_hash(key, sizeof(struct weightened_nhop) * > obj->nhg_nh_count)); > +} > + > +/* > + * Returns object referenced and unlocked > + */ > +struct nhgrp_priv * > +find_nhgrp(struct nh_control *ctl, const struct nhgrp_priv *key) > +{ > + struct nhgrp_priv *priv_ret; > + > + NHOPS_RLOCK(ctl); > + CHT_SLIST_FIND_BYOBJ(&ctl->gr_head, mpath, key, priv_ret); > + if (priv_ret != NULL) { > + if (refcount_acquire_if_not_zero(&priv_ret->nhg_refcount) == 0) { > + /* refcount is 0 -> group is being deleted */ > + priv_ret = NULL; > + } > + } > + NHOPS_RUNLOCK(ctl); > + > + return (priv_ret); > +} > + > +int > +link_nhgrp(struct nh_control *ctl, struct nhgrp_priv *grp_priv) > +{ > + uint16_t idx; > + uint32_t new_num_buckets, new_num_items; > + > + NHOPS_WLOCK(ctl); > + /* Check if we need to resize hash and index */ > + new_num_buckets = CHT_SLIST_GET_RESIZE_BUCKETS(&ctl->gr_head); > + new_num_items = bitmask_get_resize_items(&ctl->gr_idx_head); > + > + if (bitmask_alloc_idx(&ctl->gr_idx_head, &idx) != 0) { > + NHOPS_WUNLOCK(ctl); > + DPRINTF("Unable to allocate mpath index"); > + consider_resize(ctl, new_num_buckets, new_num_items); > + return (0); > + } > + > + grp_priv->nhg_idx = idx; > + grp_priv->nh_control = ctl; > + CHT_SLIST_INSERT_HEAD(&ctl->gr_head, mpath, grp_priv); > + > + NHOPS_WUNLOCK(ctl); > + > + consider_resize(ctl, new_num_buckets, new_num_items); > + > + return (1); > +} > + > +struct nhgrp_priv * > +unlink_nhgrp(struct nh_control *ctl, struct nhgrp_priv *key) > +{ > + struct nhgrp_priv *nhg_priv_ret; > + int ret, idx; > + > + NHOPS_WLOCK(ctl); > + > + CHT_SLIST_REMOVE_BYOBJ(&ctl->gr_head, mpath, key, nhg_priv_ret); > + > + if (nhg_priv_ret == NULL) { > + DPRINTF("Unable to find nhop group!"); > + NHOPS_WUNLOCK(ctl); > + return (NULL); > + } > + > + idx = nhg_priv_ret->nhg_idx; > + ret = bitmask_free_idx(&ctl->gr_idx_head, idx); > + nhg_priv_ret->nhg_idx = 0; > + nhg_priv_ret->nh_control = NULL; > + > + NHOPS_WUNLOCK(ctl); > + > + return (nhg_priv_ret); > +} > + > +/* > + * Checks if hash needs resizing and performs this resize if necessary > + * > + */ > +__noinline static void > +consider_resize(struct nh_control *ctl, uint32_t new_nh_buckets, uint32_t > new_idx_items) > +{ > + void *nh_ptr, *nh_idx_ptr; > + void *old_idx_ptr; > + size_t alloc_size; > + > + nh_ptr = NULL ; > + if (new_nh_buckets != 0) { > + alloc_size = CHT_SLIST_GET_RESIZE_SIZE(new_nh_buckets); > + nh_ptr = malloc(alloc_size, M_NHOP, M_NOWAIT | M_ZERO); > + } > + > + nh_idx_ptr = NULL; > + if (new_idx_items != 0) { > + alloc_size = bitmask_get_size(new_idx_items); > + nh_idx_ptr = malloc(alloc_size, M_NHOP, M_NOWAIT | M_ZERO); > + } > + > + if (nh_ptr == NULL && nh_idx_ptr == NULL) { > + /* Either resize is not required or allocations have failed. */ > + return; > + } > + > + DPRINTF("mp: going to resize: nh:[ptr:%p sz:%u] idx:[ptr:%p sz:%u]", > + nh_ptr, new_nh_buckets, nh_idx_ptr, new_idx_items); > + > + old_idx_ptr = NULL; > + > + NHOPS_WLOCK(ctl); > + if (nh_ptr != NULL) { > + CHT_SLIST_RESIZE(&ctl->gr_head, mpath, nh_ptr, new_nh_buckets); > + } > + if (nh_idx_ptr != NULL) { > + if (bitmask_copy(&ctl->gr_idx_head, nh_idx_ptr, new_idx_items)) > + bitmask_swap(&ctl->nh_idx_head, nh_idx_ptr, new_idx_items, > &old_idx_ptr); > + } > + NHOPS_WUNLOCK(ctl); > + > + if (nh_ptr != NULL) > + free(nh_ptr, M_NHOP); > + if (old_idx_ptr != NULL) > + free(old_idx_ptr, M_NHOP); > +} > + > +/* > + * Function allocating the necessary group data structures. > + */ > +bool > +nhgrp_ctl_alloc_default(struct nh_control *ctl, int malloc_flags) > +{ > + size_t alloc_size; > + uint32_t num_buckets, num_items; > + void *cht_ptr, *mask_ptr; > + > + malloc_flags = (malloc_flags & (M_NOWAIT | M_WAITOK)) | M_ZERO; > + > + num_buckets = 8; > + alloc_size = CHT_SLIST_GET_RESIZE_SIZE(num_buckets); > + cht_ptr = malloc(alloc_size, M_NHOP, malloc_flags); > + > + if (cht_ptr == NULL) { > + DPRINTF("mpath init failed"); > + return (false); > + } > + > + /* > + * Allocate nexthop index bitmask. > + */ > + num_items = 128; > + mask_ptr = malloc(bitmask_get_size(num_items), M_NHOP, malloc_flags); > + if (mask_ptr == NULL) { > + DPRINTF("mpath bitmask init failed"); > + free(cht_ptr, M_NHOP); > + return (false); > + } > + > + NHOPS_WLOCK(ctl); > + > + if (ctl->gr_head.hash_size == 0) { > + /* Init hash and bitmask */ > + CHT_SLIST_INIT(&ctl->gr_head, cht_ptr, num_buckets); > + bitmask_init(&ctl->gr_idx_head, mask_ptr, num_items); > + NHOPS_WUNLOCK(ctl); > + } else { > + /* Other thread has already initiliazed hash/bitmask */ > + NHOPS_WUNLOCK(ctl); > + free(cht_ptr, M_NHOP); > + free(mask_ptr, M_NHOP); > + } > + > + DPRINTF("mpath init done for fib/af %d/%d", ctl->rh->rib_fibnum, > + ctl->rh->rib_family); > + > + return (true); > +} > + > +int > +nhgrp_ctl_init(struct nh_control *ctl) > +{ > + > + /* > + * By default, do not allocate datastructures as multipath > + * routes will not be necessarily used. > + */ > + CHT_SLIST_INIT(&ctl->gr_head, NULL, 0); > + bitmask_init(&ctl->gr_idx_head, NULL, 0); > + return (0); > +} > + > +void > +nhgrp_ctl_free(struct nh_control *ctl) > +{ > + > + if (ctl->gr_head.ptr != NULL) > + free(ctl->gr_head.ptr, M_NHOP); > + if (ctl->gr_idx_head.idx != NULL) > + free(ctl->gr_idx_head.idx, M_NHOP); > +} > + > +void > +nhgrp_ctl_unlink_all(struct nh_control *ctl) > +{ > + struct nhgrp_priv *nhg_priv; > + > + NHOPS_WLOCK_ASSERT(ctl); > + > + CHT_SLIST_FOREACH(&ctl->gr_head, mpath, nhg_priv) { > + DPRINTF("Marking nhgrp %u unlinked", nhg_priv->nhg_idx); > + refcount_release(&nhg_priv->nhg_linked); > + } CHT_SLIST_FOREACH_END; > +} > + > > Added: head/sys/net/route/nhgrp_ctl.c > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/net/route/nhgrp_ctl.c Sat Oct 3 10:47:17 2020 (r366390) > @@ -0,0 +1,788 @@ > +/*- > + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD > + * > + * Copyright (c) 2020 Alexander V. Chernikov > + * > + * 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. > + * > + * $FreeBSD$ > + */ > +#define RTDEBUG > +#include "opt_inet.h" > +#include "opt_route.h" > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include > +#include > +#include > + > +#include > +#include > +#include > +#include > + > +/* > + * This file contains the supporting functions for creating multipath > groups > + * and compiling their dataplane parts. > + */ > + > +/* MPF_MULTIPATH must be the same as NHF_MULTIPATH for nhop selection to > work */ > +_Static_assert(MPF_MULTIPATH == NHF_MULTIPATH, > + "MPF_MULTIPATH must be the same as NHF_MULTIPATH"); > +/* Offset and size of flags field has to be the same for nhop/nhop groups > */ > +CHK_STRUCT_FIELD_GENERIC(struct nhop_object, nh_flags, struct nhgrp_object, > nhg_flags); > +/* Cap multipath to 64, as the larger values would break rib_cmd_info > bmasks */ > +CTASSERT(RIB_MAX_MPATH_WIDTH <= 64); > + > +static int wn_cmp(const void *a, const void *b); > +static void sort_weightened_nhops(struct weightened_nhop *wn, int > num_nhops); > + > +static struct nhgrp_priv *get_nhgrp(struct nh_control *ctl, > + struct weightened_nhop *wn, int num_nhops, int *perror); > +static void destroy_nhgrp(struct nhgrp_priv *nhg_priv); > +static void destroy_nhgrp_epoch(epoch_context_t ctx); > +static void free_nhgrp_nhops(struct nhgrp_priv *nhg_priv); > + > +static int > +wn_cmp(const void *a, const void *b) > +{ > + const struct weightened_nhop *wa = a; > + const struct weightened_nhop *wb = b; > + > + if (wa->weight > wb->weight) > + return (1); > + else if (wa->weight < wb->weight) > + return (-1); > + > + /* Compare nexthops by pointer */ > + if (wa->nh > wb->nh) > + return (1); > + else if (wa->nh < wb->nh) > + return (-1); > + else > + return (0); > +} > + > +/* > + * Perform in-place sorting for array of nexthops in @wn. > + * > + * To avoid nh groups duplication, nexthops/weights in the > + * @wn need to be ordered deterministically. > + * As this sorting is needed only for the control plane functionality, > + * there are no specific external requirements. > + * > + * Sort by weight first, to ease calculation of the slot sizes. > + */ > +static void > +sort_weightened_nhops(struct weightened_nhop *wn, int num_nhops) > +{ > + > + qsort(wn, num_nhops, sizeof(struct weightened_nhop), wn_cmp); > +} > + > +/* > + * Calculate minimum number of slots required to fit the existing > + * set of weights in the common use case where weights are "easily" > + * comparable. > + * Assumes @wn is sorted by weight ascending and each weight is > 0. > + * Returns number of slots or 0 if precise calculation failed. > + * > + * Some examples: > + * note: (i, X) pair means (nhop=i, weight=X): > + * (1, 1) (2, 2) -> 3 slots [1, 2, 2] > + * (1, 100), (2, 200) -> 3 slots [1, 2, 2] > + * (1, 100), (2, 200), (3, 400) -> 7 slots [1, 2, 2, 3, 3, 3] > + */ > +static uint32_t > +calc_min_mpath_slots_fast(const struct weightened_nhop *wn, size_t > num_items) > +{ > + uint32_t i, last, xmin; > + uint64_t total = 0; > + > + last = 0; > + xmin = wn[0].weight; > + for (i = 0; i < num_items; i++) { > + total += wn[i].weight; > + if ((wn[i].weight - last < xmin) && (wn[i].weight != last)) > + xmin = wn[i].weight - last; > + last = wn[i].weight; > + } > + /* xmin is the minimum unit of desired capacity */ > + if ((total % xmin) != 0) > + return (0); > + for (i = 0; i < num_items; i++) { > + if ((wn[i].weight % xmin) != 0) > + return (0); > + } > + > + return ((uint32_t)(total / xmin)); > +} > + > +/* > + * Calculate minimum number of slots required to fit the existing > + * set of weights while maintaining weight coefficients. > + * > + * Assume @wn is sorted by weight ascending and each weight is > 0. > + * > + * Tries to find simple precise solution first and falls back to > + * RIB_MAX_MPATH_WIDTH in case of any failure. > + */ > +static uint32_t > +calc_min_mpath_slots(const struct weightened_nhop *wn, size_t num_items) > +{ > + uint32_t v; > + > + v = calc_min_mpath_slots_fast(wn, num_items); > + if ((v == 0) || (v > RIB_MAX_MPATH_WIDTH)) > + v = RIB_MAX_MPATH_WIDTH; > + > + return (v); > +} > + > +/* > + * Nexthop group data consists of > + * 1) dataplane part, with nhgrp_object as a header followed by an > + * arbitrary number of nexthop pointers. > + * 2) control plane part, with nhgrp_priv as a header, followed by > + * an arbirtrary number of 'struct weightened_nhop' object. > + * > + * Given nexthop groups are (mostly) immutable, allocate all data > + * in one go. > + * > + */ > +__noinline static size_t > +get_nhgrp_alloc_size(uint32_t nhg_size, uint32_t num_nhops) > +{ > + size_t sz; > + > + sz = sizeof(struct nhgrp_object); > + sz += nhg_size * sizeof(struct nhop_object *); > + sz += sizeof(struct nhgrp_priv); > + sz += num_nhops * sizeof(struct weightened_nhop); > + return (sz); > +} > + > +/* > + * Compile actual list of nexthops to be used by datapath from > + * the nexthop group @dst. > + * > + * For example, compiling control plane list of 2 nexthops > + * [(200, A), (100, B)] would result in the datapath array > + * [A, A, B] > + */ > +static void > +compile_nhgrp(struct nhgrp_priv *dst_priv, const struct weightened_nhop > *x, > + uint32_t num_slots) > +{ > + struct nhgrp_object *dst; > + int i, slot_idx, remaining_slots; > + uint64_t remaining_sum, nh_weight, nh_slots; > + > + slot_idx = 0; > + dst = dst_priv->nhg; > + /* Calculate sum of all weights */ > + remaining_sum = 0; > + for (i = 0; i < dst_priv->nhg_nh_count; i++) > + remaining_sum += x[i].weight; > + remaining_slots = num_slots; > + DPRINTF("O: %u/%u", (uint32_t)remaining_sum, remaining_slots); > + for (i = 0; i < dst_priv->nhg_nh_count; i++) { > + /* Calculate number of slots for the current nexthop */ > + if (remaining_sum > 0) { > + nh_weight = (uint64_t)x[i].weight; > + nh_slots = (nh_weight * remaining_slots / remaining_sum); > + } else > + nh_slots = 0; > + > + remaining_sum -= x[i].weight; > + remaining_slots -= nh_slots; > + > + DPRINTF(" OO[%d]: %u/%u curr=%d slot_idx=%d", i, > + (uint32_t)remaining_sum, remaining_slots, > + (int)nh_slots, slot_idx); > + > + KASSERT((slot_idx + nh_slots <= num_slots), > + ("index overflow during nhg compilation")); > + while (nh_slots-- > 0) > + dst->nhops[slot_idx++] = x[i].nh; > + } > +} > + > +/* > + * Allocates new nexthop group for the list of weightened nexthops. > + * Assume sorted list. > + * Does NOT reference any nexthops in the group. > + * Returns group with refcount=1 or NULL. > + */ > +static struct nhgrp_priv * > +alloc_nhgrp(struct weightened_nhop *wn, int num_nhops) > +{ > + uint32_t nhgrp_size; > + int flags = M_NOWAIT; > + struct nhgrp_object *nhg; > + struct nhgrp_priv *nhg_priv; > + > + nhgrp_size = calc_min_mpath_slots(wn, num_nhops); > + if (nhgrp_size == 0) { > + /* Zero weights, abort */ > + return (NULL); > + } > + > + size_t sz = get_nhgrp_alloc_size(nhgrp_size, num_nhops); > + nhg = malloc(sz, M_NHOP, flags | M_ZERO); > + if (nhg == NULL) { > + return (NULL); > + } > + > + /* Has to be the first to make NHGRP_PRIV() work */ > + nhg->nhg_size = nhgrp_size; > + DPRINTF("new mpath group: num_nhops: %u", (uint32_t)nhgrp_size); > + nhg->nhg_flags = MPF_MULTIPATH; > + > + nhg_priv = NHGRP_PRIV(nhg); > + nhg_priv->nhg_nh_count = num_nhops; > + refcount_init(&nhg_priv->nhg_refcount, 1); > + > + /* Please see nhgrp_free() comments on the initial value */ > + refcount_init(&nhg_priv->nhg_linked, 2); > + > + nhg_priv->nhg = nhg; > + memcpy(&nhg_priv->nhg_nh_weights[0], wn, > + num_nhops * sizeof(struct weightened_nhop)); > + > + compile_nhgrp(nhg_priv, wn, nhg->nhg_size); > + > + return (nhg_priv); > +} > + > +void > +nhgrp_free(struct nhgrp_object *nhg) > +{ > + struct nhgrp_priv *nhg_priv; > + struct nh_control *ctl; > + struct epoch_tracker et; > + > + nhg_priv = NHGRP_PRIV(nhg); > + > + if (!refcount_release(&nhg_priv->nhg_refcount)) > + return; > + > + /* > + * group objects don't have an explicit lock attached to it. > + * As groups are reclaimed based on reference count, it is possible > + * that some groups will persist after vnet destruction callback > + * called. Given that, handle scenario with nhgrp_free_group() being > + * called either after or simultaneously with nhgrp_ctl_unlink_all() > + * by using another reference counter: nhg_linked. > + * > + * There are only 2 places, where nhg_linked can be decreased: > + * rib destroy (nhgrp_ctl_unlink_all) and this function. > + * nhg_link can never be increased. > + * > + * Hence, use initial value of 2 to make use of > + * refcount_release_if_not_last(). > + * > + * There can be two scenarious when calling this function: > + * > + * 1) nhg_linked value is 2. This means that either > + * nhgrp_ctl_unlink_all() has not been called OR it is running, > + * but we are guaranteed that nh_control won't be freed in > + * this epoch. Hence, nexthop can be safely unlinked. > + * > + * 2) nh_linked value is 1. In that case, nhgrp_ctl_unlink_all() > + * has been called and nhgrp unlink can be skipped. > + */ > + > + NET_EPOCH_ENTER(et); > + if (refcount_release_if_not_last(&nhg_priv->nhg_linked)) { > + ctl = nhg_priv->nh_control; > + if (unlink_nhgrp(ctl, nhg_priv) == NULL) { > + /* Do not try to reclaim */ > + DPRINTF("Failed to unlink nexhop group %p", nhg_priv); > + NET_EPOCH_EXIT(et); > + return; > + } > + } > + NET_EPOCH_EXIT(et); > + > + epoch_call(net_epoch_preempt, destroy_nhgrp_epoch, > + &nhg_priv->nhg_epoch_ctx); > +} > + > +/* > + * Destroys all local resources belonging to @nhg_priv. > + */ > +__noinline static void > +destroy_nhgrp_int(struct nhgrp_priv *nhg_priv) > +{ > + > + free(nhg_priv->nhg, M_NHOP); > +} > + > +__noinline static void > +destroy_nhgrp(struct nhgrp_priv *nhg_priv) > +{ > + > + KASSERT((nhg_priv->nhg_refcount == 0), ("nhg_refcount != 0")); > + > + DPRINTF("DEL MPATH %p", nhg_priv); > + > + KASSERT((nhg_priv->nhg_idx == 0), ("gr_idx != 0")); > + > + free_nhgrp_nhops(nhg_priv); > + > + destroy_nhgrp_int(nhg_priv); > +} > + > +/* > + * Epoch callback indicating group is safe to destroy > + */ > +static void > +destroy_nhgrp_epoch(epoch_context_t ctx) > +{ > + struct nhgrp_priv *nhg_priv; > + > + nhg_priv = __containerof(ctx, struct nhgrp_priv, nhg_epoch_ctx); > + > + destroy_nhgrp(nhg_priv); > +} > + > +static bool > +ref_nhgrp_nhops(struct nhgrp_priv *nhg_priv) > +{ > + > + for (int i = 0; i < nhg_priv->nhg_nh_count; i++) { > > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** > -- Mateusz Guzik From owner-svn-src-all@freebsd.org Sat Oct 3 13:01:08 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 199D842E40D; Sat, 3 Oct 2020 13:01:08 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C3RnH4rtyz4KnD; Sat, 3 Oct 2020 13:01:07 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8ABE9138D6; Sat, 3 Oct 2020 13:01:07 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 093D17KD018916; Sat, 3 Oct 2020 13:01:07 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 093D17aN018915; Sat, 3 Oct 2020 13:01:07 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202010031301.093D17aN018915@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 3 Oct 2020 13:01:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366392 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 366392 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Oct 2020 13:01:08 -0000 Author: trasz Date: Sat Oct 3 13:01:07 2020 New Revision: 366392 URL: https://svnweb.freebsd.org/changeset/base/366392 Log: Optimize riscv's cpu_fetch_syscall_args(), making it possible for the compiler to inline the memcpy. Reviewed by: arichardson, mhorne MFC after: 2 weeks Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D26528 Modified: head/sys/riscv/riscv/trap.c Modified: head/sys/riscv/riscv/trap.c ============================================================================== --- head/sys/riscv/riscv/trap.c Sat Oct 3 12:03:08 2020 (r366391) +++ head/sys/riscv/riscv/trap.c Sat Oct 3 13:01:07 2020 (r366392) @@ -96,30 +96,31 @@ int cpu_fetch_syscall_args(struct thread *td) { struct proc *p; - register_t *ap; + register_t *ap, *dst_ap; struct syscall_args *sa; - int nap; - nap = NARGREG; p = td->td_proc; sa = &td->td_sa; ap = &td->td_frame->tf_a[0]; + dst_ap = &sa->args[0]; sa->code = td->td_frame->tf_t[0]; - if (sa->code == SYS_syscall || sa->code == SYS___syscall) { + if (__predict_false(sa->code == SYS_syscall || sa->code == SYS___syscall)) { sa->code = *ap++; - nap--; + } else { + *dst_ap++ = *ap++; } - if (sa->code >= p->p_sysent->sv_size) + if (__predict_false(sa->code >= p->p_sysent->sv_size)) sa->callp = &p->p_sysent->sv_table[0]; else sa->callp = &p->p_sysent->sv_table[sa->code]; - memcpy(sa->args, ap, nap * sizeof(register_t)); - if (sa->callp->sy_narg > nap) - panic("TODO: Could we have more then %d args?", NARGREG); + KASSERT(sa->callp->sy_narg <= nitems(sa->args), + ("Syscall %d takes too many arguments", sa->code)); + + memcpy(dst_ap, ap, (NARGREG - 1) * sizeof(register_t)); td->td_retval[0] = 0; td->td_retval[1] = 0; From owner-svn-src-all@freebsd.org Sat Oct 3 13:19:50 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C02EA42E948; Sat, 3 Oct 2020 13:19:50 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C3SBt55yQz4Lh3; Sat, 3 Oct 2020 13:19:50 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7A6EE136DB; Sat, 3 Oct 2020 13:19:50 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 093DJoAk027303; Sat, 3 Oct 2020 13:19:50 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 093DJn7n027296; Sat, 3 Oct 2020 13:19:49 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <202010031319.093DJn7n027296@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Sat, 3 Oct 2020 13:19:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366393 - head/tools/tools/netmap X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: head/tools/tools/netmap X-SVN-Commit-Revision: 366393 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Oct 2020 13:19:50 -0000 Author: vmaffione Date: Sat Oct 3 13:19:48 2020 New Revision: 366393 URL: https://svnweb.freebsd.org/changeset/base/366393 Log: netmap: tools: fix several compiler warnings MFC after: 1 week Modified: head/tools/tools/netmap/Makefile head/tools/tools/netmap/bridge.c head/tools/tools/netmap/ctrs.h head/tools/tools/netmap/lb.c head/tools/tools/netmap/nmreplay.c head/tools/tools/netmap/pkt-gen.c head/tools/tools/netmap/pkt_hash.c Modified: head/tools/tools/netmap/Makefile ============================================================================== --- head/tools/tools/netmap/Makefile Sat Oct 3 13:01:07 2020 (r366392) +++ head/tools/tools/netmap/Makefile Sat Oct 3 13:19:48 2020 (r366393) @@ -21,6 +21,8 @@ LDFLAGS += -lm # used by nmreplay .include .include +CFLAGS += -Wno-cast-align + all: $(PROGS) pkt-gen: pkt-gen.o Modified: head/tools/tools/netmap/bridge.c ============================================================================== --- head/tools/tools/netmap/bridge.c Sat Oct 3 13:01:07 2020 (r366392) +++ head/tools/tools/netmap/bridge.c Sat Oct 3 13:19:48 2020 (r366393) @@ -14,7 +14,7 @@ #include #include -int verbose = 0; +static int verbose = 0; static int do_abort = 0; static int zerocopy = 1; /* enable zerocopy if possible */ @@ -31,7 +31,7 @@ sigint_h(int sig) /* * how many packets on this set of queues ? */ -int +static int pkt_queued(struct nm_desc *d, int tx) { u_int i, tot = 0; Modified: head/tools/tools/netmap/ctrs.h ============================================================================== --- head/tools/tools/netmap/ctrs.h Sat Oct 3 13:01:07 2020 (r366392) +++ head/tools/tools/netmap/ctrs.h Sat Oct 3 13:19:48 2020 (r366393) @@ -18,12 +18,12 @@ struct my_ctrs { * Caller has to make sure that the buffer is large enough. */ static const char * -norm2(char *buf, double val, char *fmt, int normalize) +norm2(char *buf, double val, const char *fmt, int normalize) { - char *units[] = { "", "K", "M", "G", "T" }; + const char *units[] = { "", "K", "M", "G", "T" }; u_int i; if (normalize) - for (i = 0; val >=1000 && i < sizeof(units)/sizeof(char *) - 1; i++) + for (i = 0; val >=1000 && i < sizeof(units)/sizeof(const char *) - 1; i++) val /= 1000; else i=0; Modified: head/tools/tools/netmap/lb.c ============================================================================== --- head/tools/tools/netmap/lb.c Sat Oct 3 13:01:07 2020 (r366392) +++ head/tools/tools/netmap/lb.c Sat Oct 3 13:19:48 2020 (r366393) @@ -89,7 +89,7 @@ struct compact_ipv6_hdr { #define BUF_REVOKE 100 #define STAT_MSG_MAXSIZE 1024 -struct { +static struct { char ifname[MAX_IFNAMELEN]; char base_name[MAX_IFNAMELEN]; int netmap_fd; @@ -115,7 +115,7 @@ struct overflow_queue { uint32_t size; }; -struct overflow_queue *freeq; +static struct overflow_queue *freeq; static inline int oq_full(struct overflow_queue *q) @@ -160,12 +160,12 @@ oq_deq(struct overflow_queue *q) static volatile int do_abort = 0; -uint64_t dropped = 0; -uint64_t forwarded = 0; -uint64_t received_bytes = 0; -uint64_t received_pkts = 0; -uint64_t non_ip = 0; -uint32_t freeq_n = 0; +static uint64_t dropped = 0; +static uint64_t forwarded = 0; +static uint64_t received_bytes = 0; +static uint64_t received_pkts = 0; +static uint64_t non_ip = 0; +static uint32_t freeq_n = 0; struct port_des { char interface[MAX_PORTNAMELEN]; @@ -178,7 +178,7 @@ struct port_des { struct group_des *group; }; -struct port_des *ports; +static struct port_des *ports; /* each group of pipes receives all the packets */ struct group_des { @@ -190,7 +190,7 @@ struct group_des { int custom_port; }; -struct group_des *groups; +static struct group_des *groups; /* statistcs */ struct counters { @@ -205,7 +205,7 @@ struct counters { #define COUNTERS_FULL 1 }; -struct counters counters_buf; +static struct counters counters_buf; static void * print_stats(void *arg) @@ -387,7 +387,7 @@ static void sigint_h(int sig) signal(SIGINT, SIG_DFL); } -void usage() +static void usage() { printf("usage: lb [options]\n"); printf("where options are:\n"); @@ -404,9 +404,9 @@ void usage() } static int -parse_pipes(char *spec) +parse_pipes(const char *spec) { - char *end = index(spec, ':'); + const char *end = index(spec, ':'); static int max_groups = 0; struct group_des *g; @@ -458,7 +458,8 @@ parse_pipes(char *spec) } /* complete the initialization of the groups data structure */ -void init_groups(void) +static void +init_groups(void) { int i, j, t = 0; struct group_des *g = NULL; @@ -484,7 +485,8 @@ void init_groups(void) * chain headed by g. * Return a free buffer. */ -uint32_t forward_packet(struct group_des *g, struct netmap_slot *rs) +static uint32_t +forward_packet(struct group_des *g, struct netmap_slot *rs) { uint32_t hash = rs->ptr; uint32_t output_port = hash % g->nports; @@ -886,7 +888,6 @@ run: */ for (i = glob_arg.num_groups - 1U; i > 0; i--) { struct group_des *g = &groups[i - 1]; - int j; for (j = 0; j < g->nports; j++) { struct port_des *p = &g->ports[j]; @@ -917,7 +918,7 @@ run: for (i = 0; i < npipes; i++) { struct port_des *p = &ports[i]; struct overflow_queue *q = p->oq; - uint32_t j, lim; + uint32_t k, lim; struct netmap_ring *ring; struct netmap_slot *slot; @@ -929,7 +930,7 @@ run: continue; if (q->n < lim) lim = q->n; - for (j = 0; j < lim; j++) { + for (k = 0; k < lim; k++) { struct netmap_slot s = oq_deq(q), tmp; tmp.ptr = 0; slot = &ring->slot[ring->head]; Modified: head/tools/tools/netmap/nmreplay.c ============================================================================== --- head/tools/tools/netmap/nmreplay.c Sat Oct 3 13:01:07 2020 (r366392) +++ head/tools/tools/netmap/nmreplay.c Sat Oct 3 13:19:48 2020 (r366393) @@ -431,7 +431,7 @@ readpcap(const char *fn) enum my_pcap_mode { PM_NONE, PM_FAST, PM_FIXED, PM_REAL }; -int verbose = 0; +static int verbose = 0; static int do_abort = 0; @@ -988,7 +988,8 @@ usage(void) static char ** split_arg(const char *src, int *_ac) { - char *my = NULL, **av = NULL, *seps = " \t\r\n,"; + char *my = NULL, **av = NULL; + const char *seps = " \t\r\n,"; int l, i, ac; /* number of entries */ if (!src) @@ -1127,15 +1128,15 @@ main(int argc, char **argv) /* set default values */ for (i = 0; i < N_OPTS; i++) { - struct _qs *q = &bp[i].q; + struct _qs *qs = &bp[i].q; - q->burst = 128; - q->c_delay.optarg = "0"; - q->c_delay.run = null_run_fn; - q->c_loss.optarg = "0"; - q->c_loss.run = null_run_fn; - q->c_bw.optarg = "0"; - q->c_bw.run = null_run_fn; + qs->burst = 128; + qs->c_delay.optarg = "0"; + qs->c_delay.run = null_run_fn; + qs->c_loss.optarg = "0"; + qs->c_loss.run = null_run_fn; + qs->c_bw.optarg = "0"; + qs->c_bw.run = null_run_fn; } // Options: @@ -1250,10 +1251,10 @@ main(int argc, char **argv) /* apply commands */ for (i = 0; i < N_OPTS; i++) { /* once per queue */ - struct _qs *q = &bp[i].q; - err += cmd_apply(delay_cfg, d[i], q, &q->c_delay); - err += cmd_apply(bw_cfg, b[i], q, &q->c_bw); - err += cmd_apply(loss_cfg, l[i], q, &q->c_loss); + struct _qs *qs = &bp[i].q; + err += cmd_apply(delay_cfg, d[i], qs, &qs->c_delay); + err += cmd_apply(bw_cfg, b[i], qs, &qs->c_bw); + err += cmd_apply(loss_cfg, l[i], qs, &qs->c_loss); } pthread_create(&bp[0].cons_tid, NULL, nmreplay_main, (void*)&bp[0]); @@ -1287,7 +1288,7 @@ main(int argc, char **argv) * the final entry has s = NULL. */ struct _sm { /* string and multiplier */ - char *s; + const char *s; double m; }; Modified: head/tools/tools/netmap/pkt-gen.c ============================================================================== --- head/tools/tools/netmap/pkt-gen.c Sat Oct 3 13:01:07 2020 (r366392) +++ head/tools/tools/netmap/pkt-gen.c Sat Oct 3 13:19:48 2020 (r366393) @@ -42,7 +42,6 @@ #define NETMAP_WITH_LIBS #include - #include // isprint() #include // sysconf() #include @@ -179,14 +178,14 @@ static inline void CPU_SET(uint32_t i, cpuset_t *p) do {struct timespec t0 = {0,0}; *(b) = t0; } while (0) #endif /* __APPLE__ */ -const char *default_payload="netmap pkt-gen DIRECT payload\n" +static const char *default_payload = "netmap pkt-gen DIRECT payload\n" "http://info.iet.unipi.it/~luigi/netmap/ "; -const char *indirect_payload="netmap pkt-gen indirect payload\n" +static const char *indirect_payload = "netmap pkt-gen indirect payload\n" "http://info.iet.unipi.it/~luigi/netmap/ "; -int verbose = 0; -int normalize = 1; +static int verbose = 0; +static int normalize = 1; #define VIRT_HDR_1 10 /* length of a base vnet-hdr */ #define VIRT_HDR_2 12 /* length of the extenede vnet-hdr */ @@ -218,7 +217,7 @@ struct pkt { ((af) == AF_INET ? (p)->ipv4.f: (p)->ipv6.f) struct ip_range { - char *name; + const char *name; union { struct { uint32_t start, end; /* same as struct in_addr */ @@ -232,7 +231,7 @@ struct ip_range { }; struct mac_range { - char *name; + const char *name; struct ether_addr start, end; }; @@ -295,7 +294,7 @@ struct glob_arg { int td_type; void *mmap_addr; char ifname[MAX_IFNAMELEN]; - char *nmr_config; + const char *nmr_config; int dummy_send; int virt_header; /* send also the virt_header */ char *packet_file; /* -P option */ @@ -620,7 +619,7 @@ system_ncpus(void) * If there is no 4th number, then the 3rd is assigned to both #tx-rings * and #rx-rings. */ -int +static int parse_nmr_config(const char* conf, struct nmreq *nmr) { char *w, *tok; @@ -727,7 +726,7 @@ checksum(const void *data, uint16_t len, uint32_t sum) /* Checksum all the pairs of bytes first... */ for (i = 0; i < (len & ~1U); i += 2) { - sum += (u_int16_t)ntohs(*((u_int16_t *)(addr + i))); + sum += (uint16_t)ntohs(*((const uint16_t *)(addr + i))); if (sum > 0xFFFF) sum -= 0xFFFF; } @@ -1241,7 +1240,7 @@ send_packets(struct netmap_ring *ring, struct pkt *pkt /* * Index of the highest bit set */ -uint32_t +static uint32_t msb64(uint64_t x) { uint64_t m = 1ULL << 63; @@ -2695,7 +2694,7 @@ main_thread(struct glob_arg *g) struct td_desc { int ty; - char *key; + const char *key; void *f; int default_burst; }; @@ -2715,7 +2714,7 @@ tap_alloc(char *dev) { struct ifreq ifr; int fd, err; - char *clonedev = TAP_CLONEDEV; + const char *clonedev = TAP_CLONEDEV; (void)err; (void)dev; Modified: head/tools/tools/netmap/pkt_hash.c ============================================================================== --- head/tools/tools/netmap/pkt_hash.c Sat Oct 3 13:01:07 2020 (r366392) +++ head/tools/tools/netmap/pkt_hash.c Sat Oct 3 13:19:48 2020 (r366393) @@ -145,7 +145,7 @@ static uint32_t decode_gre_hash(const uint8_t *, uint8 ** Parser + hash function for the IPv4 packet **/ static uint32_t -decode_ip_n_hash(struct ip *iph, uint8_t hash_split, uint8_t seed) +decode_ip_n_hash(const struct ip *iph, uint8_t hash_split, uint8_t seed) { uint32_t rc = 0; @@ -155,19 +155,19 @@ decode_ip_n_hash(struct ip *iph, uint8_t hash_split, u ntohs(0xFFFD) + seed, ntohs(0xFFFE) + seed); } else { - struct tcphdr *tcph = NULL; - struct udphdr *udph = NULL; + const struct tcphdr *tcph = NULL; + const struct udphdr *udph = NULL; switch (iph->ip_p) { case IPPROTO_TCP: - tcph = (struct tcphdr *)((uint8_t *)iph + (iph->ip_hl<<2)); + tcph = (const struct tcphdr *)((const uint8_t *)iph + (iph->ip_hl<<2)); rc = sym_hash_fn(ntohl(iph->ip_src.s_addr), ntohl(iph->ip_dst.s_addr), ntohs(tcph->th_sport) + seed, ntohs(tcph->th_dport) + seed); break; case IPPROTO_UDP: - udph = (struct udphdr *)((uint8_t *)iph + (iph->ip_hl<<2)); + udph = (const struct udphdr *)((const uint8_t *)iph + (iph->ip_hl<<2)); rc = sym_hash_fn(ntohl(iph->ip_src.s_addr), ntohl(iph->ip_dst.s_addr), ntohs(udph->uh_sport) + seed, @@ -175,11 +175,11 @@ decode_ip_n_hash(struct ip *iph, uint8_t hash_split, u break; case IPPROTO_IPIP: /* tunneling */ - rc = decode_ip_n_hash((struct ip *)((uint8_t *)iph + (iph->ip_hl<<2)), + rc = decode_ip_n_hash((const struct ip *)((const uint8_t *)iph + (iph->ip_hl<<2)), hash_split, seed); break; case IPPROTO_GRE: - rc = decode_gre_hash((uint8_t *)iph + (iph->ip_hl<<2), + rc = decode_gre_hash((const uint8_t *)iph + (iph->ip_hl<<2), hash_split, seed); break; case IPPROTO_ICMP: @@ -205,7 +205,7 @@ decode_ip_n_hash(struct ip *iph, uint8_t hash_split, u ** Parser + hash function for the IPv6 packet **/ static uint32_t -decode_ipv6_n_hash(struct ip6_hdr *ipv6h, uint8_t hash_split, uint8_t seed) +decode_ipv6_n_hash(const struct ip6_hdr *ipv6h, uint8_t hash_split, uint8_t seed) { uint32_t saddr, daddr; uint32_t rc = 0; @@ -226,19 +226,19 @@ decode_ipv6_n_hash(struct ip6_hdr *ipv6h, uint8_t hash ntohs(0xFFFD) + seed, ntohs(0xFFFE) + seed); } else { - struct tcphdr *tcph = NULL; - struct udphdr *udph = NULL; + const struct tcphdr *tcph = NULL; + const struct udphdr *udph = NULL; switch(ntohs(ipv6h->ip6_ctlun.ip6_un1.ip6_un1_nxt)) { case IPPROTO_TCP: - tcph = (struct tcphdr *)(ipv6h + 1); + tcph = (const struct tcphdr *)(ipv6h + 1); rc = sym_hash_fn(ntohl(saddr), ntohl(daddr), ntohs(tcph->th_sport) + seed, ntohs(tcph->th_dport) + seed); break; case IPPROTO_UDP: - udph = (struct udphdr *)(ipv6h + 1); + udph = (const struct udphdr *)(ipv6h + 1); rc = sym_hash_fn(ntohl(saddr), ntohl(daddr), ntohs(udph->uh_sport) + seed, @@ -246,16 +246,16 @@ decode_ipv6_n_hash(struct ip6_hdr *ipv6h, uint8_t hash break; case IPPROTO_IPIP: /* tunneling */ - rc = decode_ip_n_hash((struct ip *)(ipv6h + 1), + rc = decode_ip_n_hash((const struct ip *)(ipv6h + 1), hash_split, seed); break; case IPPROTO_IPV6: /* tunneling */ - rc = decode_ipv6_n_hash((struct ip6_hdr *)(ipv6h + 1), + rc = decode_ipv6_n_hash((const struct ip6_hdr *)(ipv6h + 1), hash_split, seed); break; case IPPROTO_GRE: - rc = decode_gre_hash((uint8_t *)(ipv6h + 1), hash_split, seed); + rc = decode_gre_hash((const uint8_t *)(ipv6h + 1), hash_split, seed); break; case IPPROTO_ICMP: case IPPROTO_ESP: @@ -280,7 +280,7 @@ decode_ipv6_n_hash(struct ip6_hdr *ipv6h, uint8_t hash * * (See decode_vlan_n_hash & pkt_hdr_hash functions). * */ static uint32_t -decode_others_n_hash(struct ether_header *ethh, uint8_t seed) +decode_others_n_hash(const struct ether_header *ethh, uint8_t seed) { uint32_t saddr, daddr, rc; @@ -305,18 +305,18 @@ decode_others_n_hash(struct ether_header *ethh, uint8_ ** Parser + hash function for VLAN packet **/ static inline uint32_t -decode_vlan_n_hash(struct ether_header *ethh, uint8_t hash_split, uint8_t seed) +decode_vlan_n_hash(const struct ether_header *ethh, uint8_t hash_split, uint8_t seed) { uint32_t rc = 0; - struct vlanhdr *vhdr = (struct vlanhdr *)(ethh + 1); + const struct vlanhdr *vhdr = (const struct vlanhdr *)(ethh + 1); switch (ntohs(vhdr->proto)) { case ETHERTYPE_IP: - rc = decode_ip_n_hash((struct ip *)(vhdr + 1), + rc = decode_ip_n_hash((const struct ip *)(vhdr + 1), hash_split, seed); break; case ETHERTYPE_IPV6: - rc = decode_ipv6_n_hash((struct ip6_hdr *)(vhdr + 1), + rc = decode_ipv6_n_hash((const struct ip6_hdr *)(vhdr + 1), hash_split, seed); break; case ETHERTYPE_ARP: @@ -336,15 +336,15 @@ uint32_t pkt_hdr_hash(const unsigned char *buffer, uint8_t hash_split, uint8_t seed) { uint32_t rc = 0; - struct ether_header *ethh = (struct ether_header *)buffer; + const struct ether_header *ethh = (const struct ether_header *)buffer; switch (ntohs(ethh->ether_type)) { case ETHERTYPE_IP: - rc = decode_ip_n_hash((struct ip *)(ethh + 1), + rc = decode_ip_n_hash((const struct ip *)(ethh + 1), hash_split, seed); break; case ETHERTYPE_IPV6: - rc = decode_ipv6_n_hash((struct ip6_hdr *)(ethh + 1), + rc = decode_ipv6_n_hash((const struct ip6_hdr *)(ethh + 1), hash_split, seed); break; case ETHERTYPE_VLAN: @@ -372,15 +372,15 @@ decode_gre_hash(const uint8_t *grehdr, uint8_t hash_sp !!(*grehdr & 2) + /* Routing */ !!(*grehdr & 4) + /* Key */ !!(*grehdr & 8)); /* Sequence Number */ - uint16_t proto = ntohs(*(uint16_t *)(void *)(grehdr + 2)); + uint16_t proto = ntohs(*(const uint16_t *)(const void *)(grehdr + 2)); switch (proto) { case ETHERTYPE_IP: - rc = decode_ip_n_hash((struct ip *)(grehdr + len), + rc = decode_ip_n_hash((const struct ip *)(grehdr + len), hash_split, seed); break; case ETHERTYPE_IPV6: - rc = decode_ipv6_n_hash((struct ip6_hdr *)(grehdr + len), + rc = decode_ipv6_n_hash((const struct ip6_hdr *)(grehdr + len), hash_split, seed); break; case 0x6558: /* Transparent Ethernet Bridging */ From owner-svn-src-all@freebsd.org Sat Oct 3 13:27:13 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 55E5842ECAC; Sat, 3 Oct 2020 13:27:13 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C3SMP1f37z4MPZ; Sat, 3 Oct 2020 13:27:13 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1BAF914085; Sat, 3 Oct 2020 13:27:13 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 093DRCXe033928; Sat, 3 Oct 2020 13:27:12 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 093DRCWI033927; Sat, 3 Oct 2020 13:27:12 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <202010031327.093DRCWI033927@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Sat, 3 Oct 2020 13:27:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366394 - head/tools/tools/netmap X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: head/tools/tools/netmap X-SVN-Commit-Revision: 366394 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Oct 2020 13:27:13 -0000 Author: vmaffione Date: Sat Oct 3 13:27:12 2020 New Revision: 366394 URL: https://svnweb.freebsd.org/changeset/base/366394 Log: netmap: tools: extend CFLAGS after including bsd.prog.mk MFC after: 1 week Modified: head/tools/tools/netmap/Makefile Modified: head/tools/tools/netmap/Makefile ============================================================================== --- head/tools/tools/netmap/Makefile Sat Oct 3 13:19:48 2020 (r366393) +++ head/tools/tools/netmap/Makefile Sat Oct 3 13:27:12 2020 (r366394) @@ -7,9 +7,10 @@ PROGS = pkt-gen nmreplay bridge lb CLEANFILES = $(PROGS) *.o MAN= -CFLAGS += -Werror -Wall -CFLAGS += -Wextra +.include +.include + LDFLAGS += -lpthread .ifdef WITHOUT_PCAP CFLAGS += -DNO_PCAP @@ -17,9 +18,6 @@ CFLAGS += -DNO_PCAP LDFLAGS += -lpcap .endif LDFLAGS += -lm # used by nmreplay - -.include -.include CFLAGS += -Wno-cast-align From owner-svn-src-all@freebsd.org Sat Oct 3 13:27:57 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F349742ECB8; Sat, 3 Oct 2020 13:27:57 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C3SNF69dtz4ML3; Sat, 3 Oct 2020 13:27:57 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B87B914086; Sat, 3 Oct 2020 13:27:57 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 093DRv9Z034010; Sat, 3 Oct 2020 13:27:57 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 093DRvAk034009; Sat, 3 Oct 2020 13:27:57 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202010031327.093DRvAk034009@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 3 Oct 2020 13:27:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366395 - stable/12/sys/netgraph/bluetooth/include X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/12/sys/netgraph/bluetooth/include X-SVN-Commit-Revision: 366395 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Oct 2020 13:27:58 -0000 Author: kevans Date: Sat Oct 3 13:27:57 2020 New Revision: 366395 URL: https://svnweb.freebsd.org/changeset/base/366395 Log: MFC r361254: Fix Typo in ng_hci_le_connection_complete_ep struct. PR: 246538 Modified: stable/12/sys/netgraph/bluetooth/include/ng_hci.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netgraph/bluetooth/include/ng_hci.h ============================================================================== --- stable/12/sys/netgraph/bluetooth/include/ng_hci.h Sat Oct 3 13:27:12 2020 (r366394) +++ stable/12/sys/netgraph/bluetooth/include/ng_hci.h Sat Oct 3 13:27:57 2020 (r366395) @@ -1955,7 +1955,7 @@ typedef struct { u_int16_t interval; u_int8_t latency; u_int16_t supervision_timeout; - u_int8_t master_clock_accracy; + u_int8_t master_clock_accuracy; } __attribute__ ((packed)) ng_hci_le_connection_complete_ep; From owner-svn-src-all@freebsd.org Sat Oct 3 13:36:29 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 11EBE42F1C9; Sat, 3 Oct 2020 13:36:29 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) (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 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C3SZ45Jxpz4Mjf; Sat, 3 Oct 2020 13:36:28 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wm1-x32a.google.com with SMTP id t17so4487112wmi.4; Sat, 03 Oct 2020 06:36:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=XgbmRvf26pQTcIfrdaS5eiQf5y5g1h9caVyN+LOVSSI=; b=qcjii/4bi2wOfe6aTdhpd7ALXtvFgaqzrhv7ym+A2ms7NbQLWedef8KYR0uEvp9G6t YXeKHADASEYazfEqW8T/Jrq/0Gwbg268u9FCMCckxsyrE5NDxZtjhg7XGzmCvj+2iYpA 2bUy53C8At2rYkdcgzD9ZzO1tnV94n3uA+Eg0trAHtwwKNjQbBvV45gaNPgcycIO3f3D dohlRydvEo50YpqbgzeWVj11wr9BM00hiRWNWWgfrjxjTDtJjkKT05dBt6ryLWHooch3 rTeg88X5J5mx5X4D0p24Pp+HKb4k1aVhLAmg55UKX2ghO8Y0TQL11BkJ71PcaiApBPa/ cP0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=XgbmRvf26pQTcIfrdaS5eiQf5y5g1h9caVyN+LOVSSI=; b=AHKtahrTJ7/xLUmVwSGZt8WVZQTIYrzABj+VNOXu8uHOG0jmZDn1FhwxtGlFnzGu2f kgBmna3p7+6vAUBuqcNjM8R93Tq9c4kBqJHVF5qoheILGCQ8QxGTm+M+bA/73OQCYnxO cv85NpHN5v2fkOes4Ow5FaYohP5NvKp4dz9GNrcl1wpMiuVqLzgt6FdhZr9BnKJB+TXY ejmrMZeH1Fl6NIx+hnZ0cTnKDzMf/Krvwlieg8+DwofHw4d22lWvSG79Zp664VTO2RjD mCeZT7vFf1JD+D9DoInKSwr/Bo/haXtniCmyGXb2kTw6d6pBA7QNXnSGt0KnpdvoWmfK kJYg== X-Gm-Message-State: AOAM533lh/ClHzhu9PN+hsQQb6EOjJGfvLxg1NhGRfIaTcJQva7yX1eF ca5UWLZYTLdL2wIVmR0eSC3qEaeDEfgp1Fox1uwhRR32ftw= X-Google-Smtp-Source: ABdhPJxv8OJqlJtzm4n+lW5q5U0040KGr0stjP0NQ5JivCN+otgMryCCwAQuaV3O0KLxqdEJ5Bzos1t62Ht8BD2M7Sg= X-Received: by 2002:a7b:ce0d:: with SMTP id m13mr8336211wmc.83.1601732186630; Sat, 03 Oct 2020 06:36:26 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a05:6000:187:0:0:0:0 with HTTP; Sat, 3 Oct 2020 06:36:25 -0700 (PDT) In-Reply-To: <202010030831.0938VSGp046465@repo.freebsd.org> References: <202010030831.0938VSGp046465@repo.freebsd.org> From: Mateusz Guzik Date: Sat, 3 Oct 2020 15:36:25 +0200 Message-ID: Subject: Re: svn commit: r366386 - head/sys/dev/pwm To: Emmanuel Vadot Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4C3SZ45Jxpz4Mjf X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Oct 2020 13:36:29 -0000 On 10/3/20, Emmanuel Vadot wrote: > Author: manu > Date: Sat Oct 3 08:31:28 2020 > New Revision: 366386 > URL: https://svnweb.freebsd.org/changeset/base/366386 > > Log: > pwm_backlight: Fix 32 bits build > Some kernels are still failing at least with: In file included from /usr/src/sys/dev/pwm/pwm_backlight.c:56: /usr/src/sys/dev/extres/regulator/regulator.h:38:10: fatal error: 'regnode_if.h' file not found #include "regnode_if.h" ^~~~~~~~~~~~~~ 1 error generated. --- pwm_backlight.o --- *** [pwm_backlight.o] Error code 1 arm ARMADA38X kernel failed, check _.arm.ARMADA38X for details arm EFIKA_MX kernel failed, check _.arm.EFIKA_MX for details arm IMX6 kernel failed, check _.arm.IMX6 for details arm IMX53 kernel failed, check _.arm.IMX53 for details arm VYBRID kernel failed, check _.arm.VYBRID for details arm ZEDBOARD kernel failed, check _.arm.ZEDBOARD for details -- Mateusz Guzik From owner-svn-src-all@freebsd.org Sat Oct 3 14:00:34 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2790F42F89F; Sat, 3 Oct 2020 14:00:34 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C3T5t0DjBz4Nx1; Sat, 3 Oct 2020 14:00:34 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DF56B144CD; Sat, 3 Oct 2020 14:00:33 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 093E0Xbw052240; Sat, 3 Oct 2020 14:00:33 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 093E0XA3052239; Sat, 3 Oct 2020 14:00:33 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202010031400.093E0XA3052239@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sat, 3 Oct 2020 14:00:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366396 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 366396 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Oct 2020 14:00:34 -0000 Author: manu Date: Sat Oct 3 14:00:33 2020 New Revision: 366396 URL: https://svnweb.freebsd.org/changeset/base/366396 Log: pwm_backlight: Depend on ext_resources This driver cannot work without it. Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat Oct 3 13:27:57 2020 (r366395) +++ head/sys/conf/files Sat Oct 3 14:00:33 2020 (r366396) @@ -2755,7 +2755,7 @@ dev/pwm/pwmbus.c optional pwm | pwmbus dev/pwm/pwmbus_if.m optional pwm | pwmbus dev/pwm/ofw_pwm.c optional pwm fdt | pwmbus fdt dev/pwm/ofw_pwmbus.c optional pwm fdt | pwmbus fdt -dev/pwm/pwm_backlight.c optional pwm pwm_backlight fdt +dev/pwm/pwm_backlight.c optional pwm pwm_backlight ext_resources fdt dev/quicc/quicc_core.c optional quicc dev/ral/rt2560.c optional ral dev/ral/rt2661.c optional ral From owner-svn-src-all@freebsd.org Sat Oct 3 14:01:21 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0ADAE42F6E5; Sat, 3 Oct 2020 14:01:21 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C3T6m6fJ7z4NqC; Sat, 3 Oct 2020 14:01:20 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C79A3142B0; Sat, 3 Oct 2020 14:01:20 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 093E1K8k053058; Sat, 3 Oct 2020 14:01:20 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 093E1KHg053057; Sat, 3 Oct 2020 14:01:20 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202010031401.093E1KHg053057@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sat, 3 Oct 2020 14:01:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366397 - head/sys/modules/pwm/pwm_backlight X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/modules/pwm/pwm_backlight X-SVN-Commit-Revision: 366397 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Oct 2020 14:01:21 -0000 Author: manu Date: Sat Oct 3 14:01:20 2020 New Revision: 366397 URL: https://svnweb.freebsd.org/changeset/base/366397 Log: pwm_backlight: Add regnode_if.h to SRCS If the kernel config doesn't have this pseudo device it will not be generated and then the module will fail to compile. Reported by: mjg Modified: head/sys/modules/pwm/pwm_backlight/Makefile Modified: head/sys/modules/pwm/pwm_backlight/Makefile ============================================================================== --- head/sys/modules/pwm/pwm_backlight/Makefile Sat Oct 3 14:00:33 2020 (r366396) +++ head/sys/modules/pwm/pwm_backlight/Makefile Sat Oct 3 14:01:20 2020 (r366397) @@ -10,6 +10,7 @@ SRCS+= \ device_if.h \ opt_platform.h \ pwmbus_if.h \ + regnode_if.h \ ofw_bus_if.h .include From owner-svn-src-all@freebsd.org Sat Oct 3 14:37:54 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D8ABF430320; Sat, 3 Oct 2020 14:37:54 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C3Twy5QJcz4Qlq; Sat, 3 Oct 2020 14:37:54 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9D4E714E08; Sat, 3 Oct 2020 14:37:54 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 093EbsDX076579; Sat, 3 Oct 2020 14:37:54 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 093EbsMM076578; Sat, 3 Oct 2020 14:37:54 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <202010031437.093EbsMM076578@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sat, 3 Oct 2020 14:37:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366398 - in head/sys/net: . route X-SVN-Group: head X-SVN-Commit-Author: melifaro X-SVN-Commit-Paths: in head/sys/net: . route X-SVN-Commit-Revision: 366398 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Oct 2020 14:37:54 -0000 Author: melifaro Date: Sat Oct 3 14:37:54 2020 New Revision: 366398 URL: https://svnweb.freebsd.org/changeset/base/366398 Log: Remove ROUTE_MPATH-related warnings introduced in r366390. Reported by: mjg Modified: head/sys/net/route/route_ctl.c head/sys/net/rtsock.c Modified: head/sys/net/route/route_ctl.c ============================================================================== --- head/sys/net/route/route_ctl.c Sat Oct 3 14:01:20 2020 (r366397) +++ head/sys/net/route/route_ctl.c Sat Oct 3 14:37:54 2020 (r366398) @@ -91,7 +91,9 @@ static void rib_notify(struct rib_head *rnh, enum rib_ struct rib_cmd_info *rc); static void destroy_subscription_epoch(epoch_context_t ctx); +#ifdef ROUTE_MPATH static bool rib_can_multipath(struct rib_head *rh); +#endif /* Per-vnet multipath routing configuration */ SYSCTL_DECL(_net_route); Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Sat Oct 3 14:01:20 2020 (r366397) +++ head/sys/net/rtsock.c Sat Oct 3 14:37:54 2020 (r366398) @@ -847,6 +847,7 @@ update_rtm_from_rc(struct rt_addrinfo *info, struct rt return (0); } +#ifdef ROUTE_MPATH static void save_del_notification(struct rib_cmd_info *rc, void *_cbdata) { @@ -864,6 +865,7 @@ save_add_notification(struct rib_cmd_info *rc, void *_ if (rc->rc_cmd == RTM_ADD) *rc_new = *rc; } +#endif /*ARGSUSED*/ static int From owner-svn-src-all@freebsd.org Sat Oct 3 14:45:19 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 08E204305D3; Sat, 3 Oct 2020 14:45:19 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C3V5V6R3Jz4QnP; Sat, 3 Oct 2020 14:45:18 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BD08214E26; Sat, 3 Oct 2020 14:45:18 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 093EjIId082978; Sat, 3 Oct 2020 14:45:18 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 093EjIwH082975; Sat, 3 Oct 2020 14:45:18 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202010031445.093EjIwH082975@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Sat, 3 Oct 2020 14:45:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366399 - in stable/12: share/man/man5 share/man/man7 tools/build/options X-SVN-Group: stable-12 X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: in stable/12: share/man/man5 share/man/man7 tools/build/options X-SVN-Commit-Revision: 366399 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Oct 2020 14:45:19 -0000 Author: gbe (doc committer) Date: Sat Oct 3 14:45:17 2020 New Revision: 366399 URL: https://svnweb.freebsd.org/changeset/base/366399 Log: MFC r365640: Improvements for the src.conf(5) and build(7) man pages PR: 203863 (based on) Submitted by: Russell Haley Reviewed by: bcr, imp Approved by: imp Differential Revision: https://reviews.freebsd.org/D26343 Modified: stable/12/share/man/man5/src.conf.5 stable/12/share/man/man7/build.7 stable/12/tools/build/options/makeman Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man5/src.conf.5 ============================================================================== --- stable/12/share/man/man5/src.conf.5 Sat Oct 3 14:37:54 2020 (r366398) +++ stable/12/share/man/man5/src.conf.5 Sat Oct 3 14:45:17 2020 (r366399) @@ -9,7 +9,8 @@ .Sh DESCRIPTION The .Nm -file contains settings that will apply to every build involving the +file contains variables that control what components will be generated during +the build process of the .Fx source tree; see .Xr build 7 . Modified: stable/12/share/man/man7/build.7 ============================================================================== --- stable/12/share/man/man7/build.7 Sat Oct 3 14:37:54 2020 (r366398) +++ stable/12/share/man/man7/build.7 Sat Oct 3 14:45:17 2020 (r366399) @@ -24,12 +24,12 @@ .\" .\" $FreeBSD$ .\" -.Dd November 10, 2018 +.Dd September 11, 2020 .Dt BUILD 7 .Os .Sh NAME .Nm build -.Nd information on how to build the system +.Nd General instructions on how to build the system .Sh DESCRIPTION The sources for the .Fx @@ -68,10 +68,11 @@ command is used in each of these directories to build things in that directory. Issuing the .Xr make 1 -command in any directory or -subdirectory of those directories has the same effect as issuing the -same command in all subdirectories of that directory. -With no target specified, the things in that directory are just built. +command in any directory issues the +.Xr make 1 +command recursively in all subdirectories. +With no target specified, the items in the directories are built +and no further action is taken. .Pp A source tree is allowed to be read-only. As described in @@ -95,6 +96,14 @@ variables described in the section below, and by the variables documented in .Xr make.conf 5 . .Pp +The default components included in the build are specified in the file +.Pa /etc/src.conf +in the source tree. +To override the default file, include the SRCCONF option in the make steps, +pointing to a custom src.conf file. +For more information see +.Xr src.conf 5 . +.Pp The following list provides the names and actions for the targets supported by the build system: .Bl -tag -width ".Cm cleandepend" @@ -573,6 +582,12 @@ process. .Bd -literal -offset indent make PORTS_MODULES=emulators/kqemu-kmod kernel .Ed +.It Va SRCCONF +Specify a file to override the default +.Pa /etc/src.conf . +The src.conf file controls the components to build. +See +.Xr src.conf 5 .It Va STRIPBIN Command to use at install time when stripping binaries. Be sure to add any additional tools required to run Modified: stable/12/tools/build/options/makeman ============================================================================== --- stable/12/tools/build/options/makeman Sat Oct 3 14:37:54 2020 (r366398) +++ stable/12/tools/build/options/makeman Sat Oct 3 14:45:17 2020 (r366399) @@ -154,7 +154,8 @@ main() .Sh DESCRIPTION The .Nm -file contains settings that will apply to every build involving the +file contains variables that control what components will be generated during +the build process of the .Fx source tree; see .Xr build 7 . From owner-svn-src-all@freebsd.org Sat Oct 3 14:51:16 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 894F743093C; Sat, 3 Oct 2020 14:51:16 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C3VDN38Fsz4RXd; Sat, 3 Oct 2020 14:51:16 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4F7E614E3A; Sat, 3 Oct 2020 14:51:16 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 093EpGD9084817; Sat, 3 Oct 2020 14:51:16 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 093EpFxA084815; Sat, 3 Oct 2020 14:51:15 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202010031451.093EpFxA084815@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Sat, 3 Oct 2020 14:51:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366400 - stable/12/tools/build/options X-SVN-Group: stable-12 X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: stable/12/tools/build/options X-SVN-Commit-Revision: 366400 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Oct 2020 14:51:16 -0000 Author: gbe (doc committer) Date: Sat Oct 3 14:51:15 2020 New Revision: 366400 URL: https://svnweb.freebsd.org/changeset/base/366400 Log: MFC r365903: src.conf(5): Fix some mandoc issues in source files - new sentence, new line - blank line in fill mode Event: September 2020 Bugathon Modified: stable/12/tools/build/options/WITH_LOADER_FIREWIRE stable/12/tools/build/options/WITH_NVME Directory Properties: stable/12/ (props changed) Modified: stable/12/tools/build/options/WITH_LOADER_FIREWIRE ============================================================================== --- stable/12/tools/build/options/WITH_LOADER_FIREWIRE Sat Oct 3 14:45:17 2020 (r366399) +++ stable/12/tools/build/options/WITH_LOADER_FIREWIRE Sat Oct 3 14:51:15 2020 (r366400) @@ -1,3 +1,3 @@ .\" $FreeBSD$ -Enable firewire support in /boot/loader on x86. This option is a nop -on all other platforms. +Enable firewire support in /boot/loader on x86. +This option is a nop on all other platforms. Modified: stable/12/tools/build/options/WITH_NVME ============================================================================== --- stable/12/tools/build/options/WITH_NVME Sat Oct 3 14:45:17 2020 (r366399) +++ stable/12/tools/build/options/WITH_NVME Sat Oct 3 14:51:15 2020 (r366400) @@ -1,3 +1,2 @@ .\" $FreeBSD$ Set to build nvme related tools and kernel modules. - From owner-svn-src-all@freebsd.org Sat Oct 3 15:06:47 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ED698430E14; Sat, 3 Oct 2020 15:06:47 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C3VZH61Dgz4SDk; Sat, 3 Oct 2020 15:06:47 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AD92D15380; Sat, 3 Oct 2020 15:06:47 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 093F6lRb095167; Sat, 3 Oct 2020 15:06:47 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 093F6lHO095166; Sat, 3 Oct 2020 15:06:47 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202010031506.093F6lHO095166@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Sat, 3 Oct 2020 15:06:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366401 - stable/12/share/man/man7 X-SVN-Group: stable-12 X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: stable/12/share/man/man7 X-SVN-Commit-Revision: 366401 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Oct 2020 15:06:48 -0000 Author: gbe (doc committer) Date: Sat Oct 3 15:06:47 2020 New Revision: 366401 URL: https://svnweb.freebsd.org/changeset/base/366401 Log: MFC r365904: crypto(7): Correct Sections out of conventional order error Event: September 2020 Bugathon Modified: stable/12/share/man/man7/crypto.7 Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man7/crypto.7 ============================================================================== --- stable/12/share/man/man7/crypto.7 Sat Oct 3 14:51:15 2020 (r366400) +++ stable/12/share/man/man7/crypto.7 Sat Oct 3 15:06:47 2020 (r366401) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 2, 2015 +.Dd June 4, 2020 .Dt CRYPTO 7 .Os .Sh NAME @@ -137,5 +137,10 @@ in the cipher mode section. .Sh SEE ALSO .Xr crypto 4 , .Xr crypto 9 +.Sh HISTORY +The +.Nm +manpage first appeared in +.Fx 10.1 . .Sh BUGS Not all the implemented algorithms are listed. From owner-svn-src-all@freebsd.org Sat Oct 3 16:00:59 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DAA17431B74; Sat, 3 Oct 2020 16:00:59 +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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C3Wmq5Tp9z4WDf; Sat, 3 Oct 2020 16:00:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro.local (unknown [IPv6:2601:648:8681:1cb0:81da:ecc0:56b1:89ec]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 2CAC22B6AB; Sat, 3 Oct 2020 16:00:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r366382 - in head/sys: amd64/conf arm/conf arm64/conf i386/conf powerpc/conf To: Emmanuel Vadot , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202010022052.092KqAb9017545@repo.freebsd.org> From: John Baldwin Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: <984af177-87cc-8523-b638-95aa488d8807@FreeBSD.org> Date: Sat, 3 Oct 2020 09:00:57 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <202010022052.092KqAb9017545@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Oct 2020 16:00:59 -0000 On 10/2/20 1:52 PM, Emmanuel Vadot wrote: > Author: manu > Date: Fri Oct 2 20:52:09 2020 > New Revision: 366382 > URL: https://svnweb.freebsd.org/changeset/base/366382 > > Log: > Fix LINT: Add backlight to NOTES > > Modified: > head/sys/amd64/conf/NOTES > head/sys/arm/conf/NOTES > head/sys/arm64/conf/NOTES > head/sys/i386/conf/NOTES > head/sys/powerpc/conf/NOTES Perhaps sys/x86/conf/NOTES rather than sys/{amd64,i386}/conf/NOTES? -- John Baldwin From owner-svn-src-all@freebsd.org Sat Oct 3 18:11:36 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7E35C4344E4; Sat, 3 Oct 2020 18:11:36 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.13]) (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 4C3ZgW1m9Pz4cj7; Sat, 3 Oct 2020 18:11:34 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id Om0IkhBZpTWWpOm0JktnS4; Sat, 03 Oct 2020 12:11:33 -0600 X-Authority-Analysis: v=2.4 cv=EcV2/NqC c=1 sm=1 tr=0 ts=5f78bed5 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=xqWC_Br6kY4A:10 a=kj9zAlcOel0A:10 a=afefHYAZSVUA:10 a=7ASnObcnAAAA:8 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=EkcXrb_YAAAA:8 a=9f0VPVNlwxFpzvsKiuMA:9 a=CjuIK1q_8ugA:10 a=G5htwFfI-ksA:10 a=pj5rz7AvTRnaHDIeLm0D:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [IPv6:fc00:1:1:1::5b]) by spqr.komquats.com (Postfix) with ESMTPS id 7240B33B; Sat, 3 Oct 2020 11:11:29 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.16.1/8.16.1) with ESMTP id 093IBRsf068514; Sat, 3 Oct 2020 11:11:29 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <202010031811.093IBRsf068514@slippy.cwsent.com> X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Emmanuel Vadot cc: Cy Schubert , Mateusz Guzik , Emmanuel Vadot , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r366381 - head/sys/modules/pwm In-reply-to: <20201003103357.24c2f3201ab4b2637fb8ea99@bidouilliste.com> References: <202010021956.092Jus8I080666@repo.freebsd.org> <202010030412.0934C1Mu015832@slippy.cwsent.com> <20201003103357.24c2f3201ab4b2637fb8ea99@bidouilliste.com> Comments: In-reply-to Emmanuel Vadot message dated "Sat, 03 Oct 2020 10:33:57 +0200." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 03 Oct 2020 11:11:27 -0700 X-CMAE-Envelope: MS4xfA/z7T+m47V9c+yDZqm800Sj8CFxClJLtTY6pAVZa2s967pnP9T2d+Rqe2fXSP/BJxSTlCW4v6ScQh0dPwtTbmmbdm33fYEgGRzGYGWCUdBKzUV3E1He 4vkKVBPZRpRglb5QuN8LowBzmBa2XXoFukpYSEkW0RHrzAdhYo9XIzw0XSZcVkM5sR7qIQKvaWGTmswPcl+Rp+YNw4VSpMlsb4LkP87hWKOrlnf0CW6DqTLg Zs8IOLtt0qWb5o3klXV00xYvHHJAVLHfjwySEsJlDm2KOnunumSGlD7YklpQHhfAMe+mjZTUIxOQxg3MrpoYYaYobzLhSoUow7WjwVs2hn4cP5dz2VxQT09F SCz7qpBdRawQ0uWXpuBjvAGANL6ZyQ== X-Rspamd-Queue-Id: 4C3ZgW1m9Pz4cj7 X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of cy.schubert@cschubert.com has no SPF policy when checking 64.59.134.13) smtp.mailfrom=cy.schubert@cschubert.com X-Spamd-Result: default: False [0.13 / 15.00]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; RCVD_COUNT_THREE(0.00)[4]; RCPT_COUNT_SEVEN(0.00)[7]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; MIME_TRACE(0.00)[0:+]; RCVD_IN_DNSWL_LOW(-0.10)[64.59.134.13:from]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.95)[-0.947]; REPLYTO_EQ_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; NEURAL_SPAM_SHORT(0.25)[0.249]; NEURAL_HAM_LONG(-0.47)[-0.467]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[cschubert.com: no valid DMARC record]; AUTH_NA(1.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; R_SPF_NA(0.00)[no SPF record]; RWL_MAILSPIKE_VERYGOOD(0.00)[64.59.134.13:from]; FREEMAIL_CC(0.00)[cschubert.com,gmail.com,freebsd.org]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Oct 2020 18:11:36 -0000 In message <20201003103357.24c2f3201ab4b2637fb8ea99@bidouilliste.com>, Emmanuel Vadot writes: > On Fri, 02 Oct 2020 21:12:01 -0700 > Cy Schubert wrote: > > > In message c > > om> > > , Mateusz Guzik writes: > > > On 10/2/20, Emmanuel Vadot wrote: > > > > Author: manu > > > > Date: Fri Oct 2 19:56:54 2020 > > > > New Revision: 366381 > > > > URL: https://svnweb.freebsd.org/changeset/base/366381 > > > > > > > > Log: > > > > pwm_backlight: Restrict module to armv7 and aarch64 > > > > > > > > Both powerpc64 and riscv uses fdt but don't use EXT_RESOURCES. > > > > > > > > Reported by: jenkins > > > > > > > > Modified: > > > > head/sys/modules/pwm/Makefile > > > > > > > > Modified: head/sys/modules/pwm/Makefile > > > > ======================================================================= > ==== > > > === > > > > --- head/sys/modules/pwm/Makefile Fri Oct 2 19:16:06 2020 > (r36638 > > > 0) > > > > +++ head/sys/modules/pwm/Makefile Fri Oct 2 19:56:54 2020 > (r36638 > > > 1) > > > > @@ -6,8 +6,10 @@ SUBDIR = \ > > > > pwmbus \ > > > > pwmc \ > > > > > > > > +.if ${MACHINE_ARCH} == "armv7" || ${MACHINE_ARCH} == "aarch64" > > > > .if !empty(OPT_FDT) > > > > SUBDIR += pwm_backlight > > > > +.endif > > > > .endif > > > > > > > > .include > > > > > > I don't know which commits are to blame, but the following is broken > > > in tinderbox: > > > arm GENERIC kernel failed, check _.arm.GENERIC for details > > > arm GENERIC-NODEBUG kernel failed, check _.arm.GENERIC-NODEBUG for detail > s > > > arm TEGRA124 kernel failed, check _.arm.TEGRA124 for details > > > arm ARMADA38X kernel failed, check _.arm.ARMADA38X for details > > > arm VYBRID kernel failed, check _.arm.VYBRID for details > > > arm GENERIC-MMCCAM kernel failed, check _.arm.GENERIC-MMCCAM for details > > > arm LINT kernel failed, check _.arm.LINT for details > > > arm IMX53 kernel failed, check _.arm.IMX53 for details > > > arm IMX6 kernel failed, check _.arm.IMX6 for details > > > arm EFIKA_MX kernel failed, check _.arm.EFIKA_MX for details > > > arm ZEDBOARD kernel failed, check _.arm.ZEDBOARD for details > > > > And on amd64 my laptop is useless now. > > > > Oct 2 18:23:58 slippy kernel: link_elf_obj: symbol > > acpi_video_get_backlight_type undefined > > Oct 2 18:23:58 slippy kernel: Warning: memory type debugfsint leaked > > memory on destroy (2 allocations, 80 bytes leaked). > > Oct 2 18:23:59 slippy kernel: linker_load_file: /boot/modules/i915kms.ko - > > > unsupported file type > > > > And this is also after updating drm-current-kmod. > > > > > > -- > > Cheers, > > Cy Schubert > > FreeBSD UNIX: Web: https://FreeBSD.org > > NTP: Web: https://nwtime.org > > > > The need of the many outweighs the greed of the few. > > > > > > Fixed in ports r551266, sorry. Yes, that fixes it. Thanks. -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org The need of the many outweighs the greed of the few. From owner-svn-src-all@freebsd.org Sat Oct 3 18:30:02 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4C359434927; Sat, 3 Oct 2020 18:30:02 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C3b4p18Vlz4dQt; Sat, 3 Oct 2020 18:30:02 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 077DA178CD; Sat, 3 Oct 2020 18:30:02 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 093IU1E5020373; Sat, 3 Oct 2020 18:30:01 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 093IU1Ej020372; Sat, 3 Oct 2020 18:30:01 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202010031830.093IU1Ej020372@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Sat, 3 Oct 2020 18:30:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366402 - head/sbin/ipfw X-SVN-Group: head X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: head/sbin/ipfw X-SVN-Commit-Revision: 366402 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Oct 2020 18:30:02 -0000 Author: gbe (doc committer) Date: Sat Oct 3 18:30:01 2020 New Revision: 366402 URL: https://svnweb.freebsd.org/changeset/base/366402 Log: ipfw(8): Bugfixes for some issues reported by mandoc - whitespace at end of input line - new sentence, new line - skipping paragraph macro: Pp before Pp MFC after: 1 week Modified: head/sbin/ipfw/ipfw.8 Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Sat Oct 3 15:06:47 2020 (r366401) +++ head/sbin/ipfw/ipfw.8 Sat Oct 3 18:30:01 2020 (r366402) @@ -527,9 +527,9 @@ ipfw add 10 skipto 4000 all from any to any layer2 out ether_demux and bdg_forward). .Pp Also note that only actions -.Cm allow, -.Cm deny, -.Cm netgraph, +.Cm allow , +.Cm deny , +.Cm netgraph , .Cm ngtee and related to .Cm dummynet @@ -682,7 +682,7 @@ to simulate the effect of multiple paths leading to ou packet delivery. .Pp Note: this condition is checked before any other condition, including -ones such as +ones such as .Cm keep-state or .Cm check-state @@ -991,7 +991,8 @@ It is possible to use the .Cm tablearg keyword with a skipto for a .Em computed -skipto. Skipto may work either in O(log(N)) or in O(1) depending +skipto. +Skipto may work either in O(log(N)) or in O(1) depending on amount of memory and/or sysctl variables. See the .Sx SYSCTL VARIABLES @@ -1454,7 +1455,7 @@ or a hostname) and the mask of .Ar mask , specified as allowed by -.Xr inet_pton. +.Xr inet_pton . As an example, fe::640:0:0/ffff::ffff:ffff:0:0 will match fe:*:*:*:0:640:*:*. This form is advised only for non-contiguous @@ -1528,7 +1529,8 @@ Alias for .Cm layer2 . .It Cm defer-immediate-action | defer-action A rule with this option will not perform normal action -upon a match. This option is intended to be used with +upon a match. +This option is intended to be used with .Cm record-state or .Cm keep-state @@ -1539,8 +1541,9 @@ Rules with both and .Cm defer-immediate-action create a dynamic rule and continue with the next rule without actually -performing the action part of this rule. When the rule is later activated -via the state table, the action is performed as usual. +performing the action part of this rule. +When the rule is later activated via the state table, the action is +performed as usual. .It Cm diverted Matches only packets generated by a divert socket. .It Cm diverted-loopback @@ -1604,7 +1607,7 @@ Matches IPv6 packets containing any of the flow labels is a comma separated list of numeric flow labels. .It Cm frag Ar spec Matches IPv4 packets whose -.Cm ip_off +.Cm ip_off field contains the comma separated list of IPv4 fragmentation options specified in .Ar spec . @@ -1793,7 +1796,8 @@ packet is found. The .Ar :flowname is used to assign additional to addresses, ports and protocol parameter -to dynamic rule. It can be used for more accurate matching by +to dynamic rule. +It can be used for more accurate matching by .Cm check-state rule. The @@ -2212,8 +2216,8 @@ One or more entries can be added to a table at once us command. Addition of all items are performed atomically. By default, error in addition of one entry does not influence -addition of other entries. However, non-zero error code is returned -in that case. +addition of other entries. +However, non-zero error code is returned in that case. Special .Cm atomic keyword may be specified before @@ -2224,8 +2228,8 @@ One or more entries can be removed from a table at onc .Cm delete command. By default, error in removal of one entry does not influence -removing of other entries. However, non-zero error code is returned -in that case. +removing of other entries. +However, non-zero error code is returned in that case. .Pp It may be possible to check what entry will be found on particular .Ar table-key @@ -2983,10 +2987,12 @@ and are integer numbers specifying thresholds for queue management (thresholds are computed in bytes if the queue has been defined in bytes, in slots otherwise). -The two parameters can also be of the same value if needed. The +The two parameters can also be of the same value if needed. +The .Nm dummynet also supports the gentle RED variant (gred) and ECN (Explicit Congestion -Notification) as optional. Three +Notification) as optional. +Three .Xr sysctl 8 variables can be used to control the RED behaviour: .Bl -tag -width indent @@ -3266,7 +3272,7 @@ Skip instance in case of global state lookup (see belo .El .Pp Some specials value can be supplied instead of -.Va nat_number: +.Va nat_number : .Bl -tag -width indent .It Cm global Looks up translation state in all configured nat instances. @@ -3370,7 +3376,7 @@ Thus translator host should be configured as IPv4 and Also this means, that a packet is handled by firewall twice. First time an original packet is handled and consumed by translator, and then it is handled again as translated packet. -This behavior can be changed by sysctl variable +This behavior can be changed by sysctl variable .Va net.inet.ip.fw.nat64_direct_output . Also translated packet can be tagged using .Cm tag @@ -3400,7 +3406,8 @@ in the states table will be dropped by translator. Make sure that translation rules handle packets, destined to configured prefix. .It Cm prefix6 Ar ipv6_prefix/length The IPv6 prefix defines IPv4-embedded IPv6 addresses used by translator -to represent IPv4 addresses. This IPv6 prefix should be configured in DNS64. +to represent IPv4 addresses. +This IPv6 prefix should be configured in DNS64. The translator implementation follows RFC6052, that restricts the length of prefixes to one of following: 32, 40, 48, 56, 64, or 96. The Well-Known IPv6 Prefix 64:ff9b:: must be 96 bits long. @@ -3475,9 +3482,9 @@ you are able to see each handled packet before and aft .It Cm -log Turn off logging of all handled packets via BPF. .It Cm allow_private -Turn on processing private IPv4 addresses. By default IPv6 packets with -destinations mapped to private address ranges defined by RFC1918 are not -processed. +Turn on processing private IPv4 addresses. +By default IPv6 packets with destinations mapped to private address ranges +defined by RFC1918 are not processed. .It Cm -allow_private Turn off private address handling in .Nm nat64 @@ -3493,7 +3500,6 @@ To inspect a states table of stateful NAT64 the follow .Ek .Ed .Pp -.Pp Stateless NAT64 translator doesn't use a states table for translation and converts IPv4 addresses to IPv6 and vice versa solely based on the mappings taken from configured lookup tables. @@ -3514,7 +3520,8 @@ The following parameters can be configured: .Bl -tag -width indent .It Cm prefix6 Ar ipv6_prefix/length The IPv6 prefix defines IPv4-embedded IPv6 addresses used by translator -to represent IPv4 addresses. This IPv6 prefix should be configured in DNS64. +to represent IPv4 addresses. +This IPv6 prefix should be configured in DNS64. .It Cm table4 Ar table46 The lookup table .Ar table46 @@ -3530,9 +3537,9 @@ interface. .It Cm -log Turn off logging of all handled packets via BPF. .It Cm allow_private -Turn on processing private IPv4 addresses. By default IPv6 packets with -destinations mapped to private address ranges defined by RFC1918 are not -processed. +Turn on processing private IPv4 addresses. +By default IPv6 packets with destinations mapped to private address ranges +defined by RFC1918 are not processed. .It Cm -allow_private Turn off private address handling in .Nm nat64 @@ -3544,12 +3551,12 @@ packets differs from stateful translator. If corresponding addresses was not found in the lookup tables, the packet will not be dropped and the search continues. .Pp -.Pp .Ss XLAT464 CLAT translation XLAT464 CLAT NAT64 translator implements client-side stateless translation as defined in RFC6877 and is very similar to statless NAT64 translator -explained above. Instead of lookup tables it uses one-to-one mapping -between IPv4 and IPv6 addresses using configured prefixes. +explained above. +Instead of lookup tables it uses one-to-one mapping between IPv4 and IPv6 +addresses using configured prefixes. This mode can be used as a replacement of DNS64 service for applications that are not using it (e.g. VoIP) allowing them to access IPv4-only Internet over IPv6-only networks with help of remote NAT64 translator. @@ -3571,8 +3578,8 @@ The IPv6 prefix defines IPv4-embedded IPv6 addresses u to represent source IPv4 addresses. .It Cm plat_prefix Ar ipv6_prefix/length The IPv6 prefix defines IPv4-embedded IPv6 addresses used by translator -to represent destination IPv4 addresses. This IPv6 prefix should be configured -on a remote NAT64 translator. +to represent destination IPv4 addresses. +This IPv6 prefix should be configured on a remote NAT64 translator. .It Cm log Turn on logging of all handled packets via BPF through .Ar ipfwlog0 @@ -3580,7 +3587,8 @@ interface. .It Cm -log Turn off logging of all handled packets via BPF. .It Cm allow_private -Turn on processing private IPv4 addresses. By default +Turn on processing private IPv4 addresses. +By default .Nm nat64clat instance will not process IPv4 packets with destination address from private ranges as defined in RFC1918. @@ -3632,7 +3640,8 @@ and .Cm ext_if options are mutually exclusive. .It Cm prefixlen Ar length -The length of specified IPv6 prefixes. It must be in range from 8 to 64. +The length of specified IPv6 prefixes. +It must be in range from 8 to 64. .El .Pp Note that the prefix translation rules are silently ignored when IPv6 packet @@ -4086,7 +4095,7 @@ Controls the output method used by module: .Bl -tag -width indent .It Cm 0 -A packet is handled by +A packet is handled by .Nm ipfw twice. First time an original packet is handled by @@ -4277,11 +4286,11 @@ ruleset to minimize the amount of work scanning the ru Your mileage may vary. .Pp For more complex scenarios with dynamic rules -.Cm record-state +.Cm record-state and .Cm defer-action can be used to precisely control creation and checking of dynamic rules. -Example of usage of these options are provided in +Example of usage of these options are provided in .Sx NETWORK ADDRESS TRANSLATION (NAT) Section. .Pp @@ -4552,21 +4561,24 @@ or it could be split in: .Dl "ipfw nat 5 config redirect_port tcp" .Dl " 192.168.0.1:80,192.168.0.10:22,192.168.0.20:25 500" .Pp -Sometimes you may want to mix NAT and dynamic rules. It could be achieved with +Sometimes you may want to mix NAT and dynamic rules. +It could be achieved with .Cm record-state and .Cm defer-action -options. Problem is, you need to create dynamic rule before NAT and check it +options. +Problem is, you need to create dynamic rule before NAT and check it after NAT actions (or vice versa) to have consistent addresses and ports. Rule with .Cm keep-state option will trigger activation of existing dynamic state, and action of such -rule will be performed as soon as rule is matched. In case of NAT and +rule will be performed as soon as rule is matched. +In case of NAT and .Cm allow rule packet need to be passed to NAT, not allowed as soon is possible. .Pp -There is example of set of rules to achieve this. Bear in mind that this -is example only and it is not very useful by itself. +There is example of set of rules to achieve this. +Bear in mind that this is example only and it is not very useful by itself. .Pp On way out, after all checks place this rules: .Pp @@ -4579,10 +4591,11 @@ And on way in there should be something like this: .Dl "ipfw add check-state" .Pp Please note, that first rule on way out doesn't allow packet and doesn't -execute existing dynamic rules. All it does, create new dynamic rule with +execute existing dynamic rules. +All it does, create new dynamic rule with .Cm allow -action, if it is not created yet. Later, this dynamic rule is used on way -in by +action, if it is not created yet. +Later, this dynamic rule is used on way in by .Cm check-state rule. .Ss CONFIGURING CODEL, PIE, FQ-CODEL and FQ-PIE AQM @@ -4593,7 +4606,7 @@ AQM can be configured for .Nm dummynet .Cm pipe or -.Cm queue. +.Cm queue . .Pp To configure a .Cm pipe @@ -4665,7 +4678,7 @@ to 10ms, we do: .Dl "ipfw sched 1 config pipe 1 type fq_codel target 10ms noecn" .Pp Similar to -.Cm fq_codel, +.Cm fq_codel , to configure .Cm fq_pie scheduler using different configurations parameters for traffic from From owner-svn-src-all@freebsd.org Sat Oct 3 18:34:25 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 53770434762; Sat, 3 Oct 2020 18:34:25 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C3b9s1VRFz4dW5; Sat, 3 Oct 2020 18:34:25 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1241817ADF; Sat, 3 Oct 2020 18:34:25 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 093IYOeQ026371; Sat, 3 Oct 2020 18:34:24 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 093IYO3r026370; Sat, 3 Oct 2020 18:34:24 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202010031834.093IYO3r026370@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Sat, 3 Oct 2020 18:34:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366403 - head/bin/ls X-SVN-Group: head X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: head/bin/ls X-SVN-Commit-Revision: 366403 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Oct 2020 18:34:25 -0000 Author: gbe (doc committer) Date: Sat Oct 3 18:34:24 2020 New Revision: 366403 URL: https://svnweb.freebsd.org/changeset/base/366403 Log: ls(1): Bugfix for an issue reported by mandoc - no blank before trailing delimiter MFC after: 1 week Modified: head/bin/ls/ls.1 Modified: head/bin/ls/ls.1 ============================================================================== --- head/bin/ls/ls.1 Sat Oct 3 18:30:01 2020 (r366402) +++ head/bin/ls/ls.1 Sat Oct 3 18:34:24 2020 (r366403) @@ -40,7 +40,7 @@ .Nd list directory contents .Sh SYNOPSIS .Nm -.Op Fl ABCFGHILPRSTUWZabcdfghiklmnopqrstuwxy1, +.Op Fl ABCFGHILPRSTUWZabcdfghiklmnopqrstuwxy1 , .Op Fl -color Ns = Ns Ar when .Op Fl D Ar format .Op Ar From owner-svn-src-all@freebsd.org Sat Oct 3 18:36:23 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 35B7B434DF5; Sat, 3 Oct 2020 18:36:23 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C3bD70jRGz4dnh; Sat, 3 Oct 2020 18:36:23 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EFBB617921; Sat, 3 Oct 2020 18:36:22 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 093IaMrb026505; Sat, 3 Oct 2020 18:36:22 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 093IaMd9026504; Sat, 3 Oct 2020 18:36:22 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202010031836.093IaMd9026504@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Sat, 3 Oct 2020 18:36:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366404 - head/bin/cp X-SVN-Group: head X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: head/bin/cp X-SVN-Commit-Revision: 366404 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Oct 2020 18:36:23 -0000 Author: gbe (doc committer) Date: Sat Oct 3 18:36:22 2020 New Revision: 366404 URL: https://svnweb.freebsd.org/changeset/base/366404 Log: cp(1): Bugfixes for some issues reported by mandoc - no blank before trailing delimiter MFC after: 1 week Modified: head/bin/cp/cp.1 Modified: head/bin/cp/cp.1 ============================================================================== --- head/bin/cp/cp.1 Sat Oct 3 18:34:24 2020 (r366403) +++ head/bin/cp/cp.1 Sat Oct 3 18:36:22 2020 (r366404) @@ -300,9 +300,9 @@ differ as they copy special files as normal files while recreating a hierarchy. .Pp The -.Fl l, -.Fl s, -.Fl v, +.Fl l , +.Fl s , +.Fl v , .Fl x and .Fl n From owner-svn-src-all@freebsd.org Sat Oct 3 18:38:00 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 07AD0434E20; Sat, 3 Oct 2020 18:38:00 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C3bFz6VVHz4f7V; Sat, 3 Oct 2020 18:37:59 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C260B17B82; Sat, 3 Oct 2020 18:37:59 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 093IbxV8026776; Sat, 3 Oct 2020 18:37:59 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 093Ibxia026775; Sat, 3 Oct 2020 18:37:59 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202010031837.093Ibxia026775@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Sat, 3 Oct 2020 18:37:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366405 - head/sbin/devd X-SVN-Group: head X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: head/sbin/devd X-SVN-Commit-Revision: 366405 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Oct 2020 18:38:00 -0000 Author: gbe (doc committer) Date: Sat Oct 3 18:37:59 2020 New Revision: 366405 URL: https://svnweb.freebsd.org/changeset/base/366405 Log: devd.conf(5): Bugfix for an issue reported by mandoc - whitespace at end of input line MFC after: 1 week Modified: head/sbin/devd/devd.conf.5 Modified: head/sbin/devd/devd.conf.5 ============================================================================== --- head/sbin/devd/devd.conf.5 Sat Oct 3 18:36:22 2020 (r366404) +++ head/sbin/devd/devd.conf.5 Sat Oct 3 18:37:59 2020 (r366405) @@ -530,7 +530,7 @@ keyboard has been pressed. A brightness level change has been requested. Direction is in the $notify variable. .It Li PMU Ta Li keys Ta mute Ta -The mute key +The mute key .It Li PMU Ta Li keys Ta volume Ta A volume level change has been requested. Direction is in the $notify variable. From owner-svn-src-all@freebsd.org Sat Oct 3 18:40:02 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B3A92434F3D; Sat, 3 Oct 2020 18:40:02 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C3bJL4Nkrz4fK2; Sat, 3 Oct 2020 18:40:02 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7A69617998; Sat, 3 Oct 2020 18:40:02 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 093Ie2FE026942; Sat, 3 Oct 2020 18:40:02 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 093Ie2gE026941; Sat, 3 Oct 2020 18:40:02 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202010031840.093Ie2gE026941@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Sat, 3 Oct 2020 18:40:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366406 - head/sbin/camcontrol X-SVN-Group: head X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: head/sbin/camcontrol X-SVN-Commit-Revision: 366406 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Oct 2020 18:40:02 -0000 Author: gbe (doc committer) Date: Sat Oct 3 18:40:02 2020 New Revision: 366406 URL: https://svnweb.freebsd.org/changeset/base/366406 Log: camcontrol(8): Bugfixes for some issues reported by mandoc - new sentence, new line MFC after: 1 week Modified: head/sbin/camcontrol/camcontrol.8 Modified: head/sbin/camcontrol/camcontrol.8 ============================================================================== --- head/sbin/camcontrol/camcontrol.8 Sat Oct 3 18:37:59 2020 (r366405) +++ head/sbin/camcontrol/camcontrol.8 Sat Oct 3 18:40:02 2020 (r366406) @@ -1511,10 +1511,10 @@ user. This option can be combined with other options such as .Fl e Em pwd .Pp -A master password may be set in a addition to the user password. The purpose of -the master password is to allow an administrator to establish a password that -is kept secret from the user, and which may be used to unlock the device if the -user password is lost. +A master password may be set in a addition to the user password. +The purpose of the master password is to allow an administrator to establish +a password that is kept secret from the user, and which may be used to unlock +the device if the user password is lost. .Pp .Em Note: Setting the master password does not enable device security. @@ -2528,7 +2528,8 @@ whether it is enabled and what the timer value is. .It Ic timestamp Issue REPORT TIMESTAMP or SET TIMESTAMP .Tn SCSI -commands. Either the +commands. +Either the .Fl r option or the .Fl s @@ -2552,7 +2553,8 @@ time, but override the system time zone and use UTC in .El .Bl -tag -width 6n .It Fl s -Set the device's timestamp. Either the +Set the device's timestamp. +Either the .Fl f and .Fl T From owner-svn-src-all@freebsd.org Sat Oct 3 18:42:16 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1E454435046; Sat, 3 Oct 2020 18:42:16 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C3bLv6fBYz4fqQ; Sat, 3 Oct 2020 18:42:15 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C88AD17CF2; Sat, 3 Oct 2020 18:42:15 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 093IgFD9029353; Sat, 3 Oct 2020 18:42:15 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 093IgFgb029351; Sat, 3 Oct 2020 18:42:15 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202010031842.093IgFgb029351@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Sat, 3 Oct 2020 18:42:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366407 - head/sbin/dhclient X-SVN-Group: head X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: head/sbin/dhclient X-SVN-Commit-Revision: 366407 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Oct 2020 18:42:16 -0000 Author: gbe (doc committer) Date: Sat Oct 3 18:42:15 2020 New Revision: 366407 URL: https://svnweb.freebsd.org/changeset/base/366407 Log: dhclient(8): Bugfixes for some issues reported by mandoc - no blank before trailing delimiter - new sentence, new line MFC after: 1 week Modified: head/sbin/dhclient/dhclient.leases.5 head/sbin/dhclient/dhcp-options.5 Modified: head/sbin/dhclient/dhclient.leases.5 ============================================================================== --- head/sbin/dhclient/dhclient.leases.5 Sat Oct 3 18:40:02 2020 (r366406) +++ head/sbin/dhclient/dhclient.leases.5 Sat Oct 3 18:42:15 2020 (r366407) @@ -54,7 +54,7 @@ the last one in the file is used. The file is written as a log, so this is not an unusual occurrence. .Pp The lease file is named -.Pa dhclient.leases. Ns Ar IFNAME , +.Pa dhclient.leases . Ns Ar IFNAME , where .Ar IFNAME represents the network interface the DHCP client acquired the lease on. @@ -70,7 +70,7 @@ The format of the lease declarations is described in .Xr dhclient.conf 5 . .Sh FILES .Bl -tag -width ".Pa /var/db/dhclient.leases. Ns Ar IFNAME" -.It Pa /var/db/dhclient.leases. Ns Ar IFNAME +.It Pa /var/db/dhclient.leases . Ns Ar IFNAME Current lease file. .El .Sh SEE ALSO Modified: head/sbin/dhclient/dhcp-options.5 ============================================================================== --- head/sbin/dhclient/dhcp-options.5 Sat Oct 3 18:40:02 2020 (r366406) +++ head/sbin/dhclient/dhcp-options.5 Sat Oct 3 18:42:15 2020 (r366407) @@ -267,8 +267,8 @@ This option specifies the domain name that the client resolving hostnames via the Domain Name System. .It Ic option domain-search Ar string ; This option specifies a list of domain names that the client should use -when resolving hostnames via the Domain Name System. This option is -defined in RFC 3397. +when resolving hostnames via the Domain Name System. +This option is defined in RFC 3397. .It Ic option swap-server Ar ip-address ; This specifies the IP address of the client's swap server. .It Ic option root-path Ar string ; From owner-svn-src-all@freebsd.org Sat Oct 3 18:44:14 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 924B243512B; Sat, 3 Oct 2020 18:44:14 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C3bPB3J9yz4fvR; Sat, 3 Oct 2020 18:44:14 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5494417BA6; Sat, 3 Oct 2020 18:44:14 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 093IiEMg033000; Sat, 3 Oct 2020 18:44:14 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 093IiER8032999; Sat, 3 Oct 2020 18:44:14 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202010031844.093IiER8032999@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Sat, 3 Oct 2020 18:44:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366408 - head/sbin/fsdb X-SVN-Group: head X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: head/sbin/fsdb X-SVN-Commit-Revision: 366408 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Oct 2020 18:44:14 -0000 Author: gbe (doc committer) Date: Sat Oct 3 18:44:13 2020 New Revision: 366408 URL: https://svnweb.freebsd.org/changeset/base/366408 Log: fsdb(8): Fix an issue reported by mandoc - whitespace at end of input line MFC after: 1 week Modified: head/sbin/fsdb/fsdb.8 Modified: head/sbin/fsdb/fsdb.8 ============================================================================== --- head/sbin/fsdb/fsdb.8 Sat Oct 3 18:42:15 2020 (r366407) +++ head/sbin/fsdb/fsdb.8 Sat Oct 3 18:44:13 2020 (r366408) @@ -251,7 +251,7 @@ appeared in written by .An John T. Kohl . It first appeared in -.Fx 2.1.5 +.Fx 2.1.5 ported by Peter Wemm. .Sh BUGS Manipulation of ``short'' symlinks has no effect. From owner-svn-src-all@freebsd.org Sat Oct 3 18:46:43 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 56B06435405; Sat, 3 Oct 2020 18:46:43 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C3bS31cXcz4g2q; Sat, 3 Oct 2020 18:46:43 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1B7A1177E4; Sat, 3 Oct 2020 18:46:43 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 093IkgLl033164; Sat, 3 Oct 2020 18:46:42 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 093IkgJT033163; Sat, 3 Oct 2020 18:46:42 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202010031846.093IkgJT033163@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Sat, 3 Oct 2020 18:46:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366409 - head/sbin/veriexec X-SVN-Group: head X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: head/sbin/veriexec X-SVN-Commit-Revision: 366409 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Oct 2020 18:46:43 -0000 Author: gbe (doc committer) Date: Sat Oct 3 18:46:42 2020 New Revision: 366409 URL: https://svnweb.freebsd.org/changeset/base/366409 Log: veriexec(8): Bugfix for an issue reported by mandoc - consider using OS macro: Nx MFC after: 1 week Modified: head/sbin/veriexec/veriexec.8 Modified: head/sbin/veriexec/veriexec.8 ============================================================================== --- head/sbin/veriexec/veriexec.8 Sat Oct 3 18:44:13 2020 (r366408) +++ head/sbin/veriexec/veriexec.8 Sat Oct 3 18:46:42 2020 (r366409) @@ -138,9 +138,8 @@ they are provided for the use of other .Xr mac 4 modules. .Sh HISTORY -The Verified Exec system first appeared in NetBSD. +The Verified Exec system first appeared in +.Nx . This utility derrives from the one found in Junos. The key difference is the requirement that manifest files be digitally signed. - - From owner-svn-src-all@freebsd.org Sat Oct 3 18:47:51 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 54ACB4350FD; Sat, 3 Oct 2020 18:47:51 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C3bTM1dXTz4g8B; Sat, 3 Oct 2020 18:47:51 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1B834179B7; Sat, 3 Oct 2020 18:47:51 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 093IloHN033270; Sat, 3 Oct 2020 18:47:50 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 093IloXs033269; Sat, 3 Oct 2020 18:47:50 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202010031847.093IloXs033269@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Sat, 3 Oct 2020 18:47:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366410 - head/sbin/mdmfs X-SVN-Group: head X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: head/sbin/mdmfs X-SVN-Commit-Revision: 366410 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Oct 2020 18:47:51 -0000 Author: gbe (doc committer) Date: Sat Oct 3 18:47:50 2020 New Revision: 366410 URL: https://svnweb.freebsd.org/changeset/base/366410 Log: mdmfs(8): Fix an issue reported by mandoc - whitespace at end of input line MFC after: 1 week Modified: head/sbin/mdmfs/mdmfs.8 Modified: head/sbin/mdmfs/mdmfs.8 ============================================================================== --- head/sbin/mdmfs/mdmfs.8 Sat Oct 3 18:46:42 2020 (r366409) +++ head/sbin/mdmfs/mdmfs.8 Sat Oct 3 18:47:50 2020 (r366410) @@ -70,7 +70,7 @@ Based on .Ar md-device , the .Nm -utility either creates a +utility either creates a .Xr tmpfs 5 filesystem, or it configures an .Xr md 4 From owner-svn-src-all@freebsd.org Sat Oct 3 18:47:53 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A312743551A; Sat, 3 Oct 2020 18:47:53 +0000 (UTC) (envelope-from xtouqh@hotmail.com) Received: from EUR06-AM7-obe.outbound.protection.outlook.com (mail-am7eur06olkn2105.outbound.protection.outlook.com [40.92.16.105]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "GlobalSign Organization Validation CA - SHA256 - G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C3bTN21Xbz4gJv; Sat, 3 Oct 2020 18:47:51 +0000 (UTC) (envelope-from xtouqh@hotmail.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jfQ8cop6jBiGbBQoREidwlpom3aXZwxIK3KzmJPn56WaSuIEBfd8AgwELzMfeKDUBS/UPbhwEl93ReODFpwmAopu0AWOa3BpqjD52icTy37pptt9tnqN7A94pwPbPeIesEmwu3JRYMKjMLgdZG7JDbXP9WGi6B7aTd8Pb7uBuWEwBYAzIm+c5Z5uHLHpLOzVY57yi9OC6QrHjctPVStakmzwDEDpZzp9IpGIrNsi8fzO/YZ4ZYV/9FbThMrDXURl1YAtWf3dqVVOkwJ1X9UMV7LiBdncQZiw+XPSmKSmOy1Gg1fj9ncfO5X1xVN64ktYBjyTTQmu6aoOkFIdu1hipw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=06aQLw5Rqe1qn+/eO/DFwrlGAgtQB99j2Hv6hBls6BE=; b=NQIdEVQJdad7Q92tivwN+qVY4KXH0XA/Y8lVJgo3tKUDiaUXaeMtK1pzxYmjK/yl6RKovgCqeA44df/D89M2WW2M+Ffu0fazHHsD99ASwZz+L7oq8MtSQQOP6r73+w3oxhpeIT8VIScb/bOqTwbrYPZ/+T3D0A9VmqzwU6fpYPoax6MNdnHegMjX4XGoUyKvedJgttKRtJCqVslIP4sKRtDRW6FQx94xabViSngG6ygIXnhSPB7cUY/n0xEg1nnuVpTBJq2MtaFU7NGIpy3p0idgD9RkbylE2UgeakYpZQBFBERI65WIeFexUTsFlcl8mpx5Eb0OLGohRrJwydV30Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=06aQLw5Rqe1qn+/eO/DFwrlGAgtQB99j2Hv6hBls6BE=; b=VhXB+/yYfIfsbqxiKK5AdC8boWTZnKjkSEcg6tx4xtub4yLzyYdoRVvXyUMqyd6Lpn2lIx6LT87M07fTe9+oXMcuLNpuT4Vsahl+5BD8V75UbuzyKCZYr43COlmltX74LndorKpUTGp6bNJW2DaqT7FNZvCb7DSu5HDGv4LXnxE2yaxgf9xyOBIPxYkHfJ5//GNJl4OEPK+WhvoaMBXTBAaQShdwOmXTdcO6n1Ei1v7BpcUdCthJntESIoNTEkrsuYLaXWT9JfeLVi/8gGkwVa7Zb26EMmgp53sb7YDiun03vzYVLF7W2TXi+oUPh/pnjaBGSIg80HwcoLfbcVU1dQ== Received: from DB8EUR06FT027.eop-eur06.prod.protection.outlook.com (2a01:111:e400:fc35::44) by DB8EUR06HT172.eop-eur06.prod.protection.outlook.com (2a01:111:e400:fc35::504) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3433.34; Sat, 3 Oct 2020 18:47:50 +0000 Received: from AM0PR06MB3986.eurprd06.prod.outlook.com (2a01:111:e400:fc35::47) by DB8EUR06FT027.mail.protection.outlook.com (2a01:111:e400:fc35::305) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3433.34 via Frontend Transport; Sat, 3 Oct 2020 18:47:50 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:10213E99A6D69A8689FBB85481E08B70699458474658DC8AF6079307FB9C003A; UpperCasedChecksum:4B43E780E3C723AA9DA35B984AA1F27CEECA747F7E844D46287BDBC56ECC8F28; SizeAsReceived:8655; Count:47 Received: from AM0PR06MB3986.eurprd06.prod.outlook.com ([fe80::759a:af46:6f2:8fb8]) by AM0PR06MB3986.eurprd06.prod.outlook.com ([fe80::759a:af46:6f2:8fb8%7]) with mapi id 15.20.3433.038; Sat, 3 Oct 2020 18:47:50 +0000 Subject: Re: svn commit: r366403 - head/bin/ls To: Gordon Bergling , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202010031834.093IYO3r026370@repo.freebsd.org> From: xtouqh@hotmail.com Message-ID: Date: Sat, 3 Oct 2020 21:47:48 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.3.1 In-Reply-To: <202010031834.093IYO3r026370@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-TMN: [4/dsdIXAgyuXRCdsAKg8kD3CSBd6Qsbu] X-ClientProxiedBy: AM0PR08CA0019.eurprd08.prod.outlook.com (2603:10a6:208:d2::32) To AM0PR06MB3986.eurprd06.prod.outlook.com (2603:10a6:208:b6::28) X-Microsoft-Original-Message-ID: <5fbfaa0d-70df-57e2-88ae-290896d6884c@hotmail.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [192.168.1.6] (91.240.124.157) by AM0PR08CA0019.eurprd08.prod.outlook.com (2603:10a6:208:d2::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3433.38 via Frontend Transport; Sat, 3 Oct 2020 18:47:49 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 47 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 854fffa3-fee7-4e5b-57a2-08d867ccd3cd X-MS-TrafficTypeDiagnostic: DB8EUR06HT172: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4mB0HCWTlaixAFk7mBavYBD1w6ZOE79I7aqH+qogVRTDZ+FaiXKJBrm3MI2ZcfdP0TYxzMpWShTEYnx1hQgyuISaQvqt70wdbEviLIRI47C4yGAEAjOauSRVoXndLseK14c0yaPGxVTjMwuk8tOzDyejK3i8ggCHHpqGyClplSj0JOARL4lQF0r+IIz7RehK9CUzhvnM9wnGfcsKqlZesKf3BAbmbIIDcn7lESmuZPXbt5L32vPXdpOvHLTz9v1o X-MS-Exchange-AntiSpam-MessageData: 0Bzw4K2mPHZmHnDVrLM/KaYK1TVNvFsMeeePEQTNss8vm4jlcVfE7U4cxsdFioC0iiDU+eMTdIKPmyWRqRDX5d2z4TDBWD2onEDqMLdrULjnP1R8bD/MVk80kFbTR/O7pJwFzikQenQGpmQxaenCaA== X-OriginatorOrg: hotmail.com X-MS-Exchange-CrossTenant-Network-Message-Id: 854fffa3-fee7-4e5b-57a2-08d867ccd3cd X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Oct 2020 18:47:49.9762 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: DB8EUR06FT027.eop-eur06.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8EUR06HT172 X-Rspamd-Queue-Id: 4C3bTN21Xbz4gJv X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=hotmail.com header.s=selector1 header.b=VhXB+/yY; dmarc=pass (policy=none) header.from=hotmail.com; spf=pass (mx1.freebsd.org: domain of xtouqh@hotmail.com designates 40.92.16.105 as permitted sender) smtp.mailfrom=xtouqh@hotmail.com X-Spamd-Result: default: False [-2.83 / 15.00]; RCVD_TLS_LAST(0.00)[]; NEURAL_HAM_MEDIUM(-1.04)[-1.037]; R_DKIM_ALLOW(-0.20)[hotmail.com:s=selector1]; RCVD_COUNT_FIVE(0.00)[5]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[hotmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; R_SPF_ALLOW(-0.20)[+ip4:40.92.0.0/15]; NEURAL_HAM_LONG(-1.04)[-1.038]; ARC_ALLOW(-1.00)[microsoft.com:s=arcselector9901:i=1]; RWL_MAILSPIKE_POSSIBLE(0.00)[40.92.16.105:from]; DKIM_TRACE(0.00)[hotmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[hotmail.com,none]; FROM_NO_DN(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[40.92.16.105:from]; NEURAL_HAM_SHORT(-1.26)[-1.258]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[hotmail.com]; ASN(0.00)[asn:8075, ipnet:40.80.0.0/12, country:US]; FORGED_MUA_THUNDERBIRD_MSGID_UNKNOWN(2.50)[]; MAILMAN_DEST(0.00)[svn-src-head,svn-src-all]; DWL_DNSWL_NONE(0.00)[hotmail.com:dkim] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Oct 2020 18:47:53 -0000 Gordon Bergling wrote: > Author: gbe (doc committer) > Date: Sat Oct 3 18:34:24 2020 > New Revision: 366403 > URL: https://svnweb.freebsd.org/changeset/base/366403 > > Log: > ls(1): Bugfix for an issue reported by mandoc > > - no blank before trailing delimiter > > MFC after: 1 week > > Modified: > head/bin/ls/ls.1 > > Modified: head/bin/ls/ls.1 > ============================================================================== > --- head/bin/ls/ls.1 Sat Oct 3 18:30:01 2020 (r366402) > +++ head/bin/ls/ls.1 Sat Oct 3 18:34:24 2020 (r366403) > @@ -40,7 +40,7 @@ > .Nd list directory contents > .Sh SYNOPSIS > .Nm > -.Op Fl ABCFGHILPRSTUWZabcdfghiklmnopqrstuwxy1, > +.Op Fl ABCFGHILPRSTUWZabcdfghiklmnopqrstuwxy1 , This makes the "," appear after the "]", how about using the following instead: .Op Fl ABCFGHILPRSTUWZabcdfghiklmnopqrstuwxy1\&, > .Op Fl -color Ns = Ns Ar when > .Op Fl D Ar format > .Op Ar From owner-svn-src-all@freebsd.org Sat Oct 3 18:49:00 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CE7DD4355A5; Sat, 3 Oct 2020 18:49:00 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C3bVh59qYz3S6f; Sat, 3 Oct 2020 18:49:00 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9647A17CFE; Sat, 3 Oct 2020 18:49:00 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 093In0A2033394; Sat, 3 Oct 2020 18:49:00 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 093In0wt033393; Sat, 3 Oct 2020 18:49:00 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202010031849.093In0wt033393@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Sat, 3 Oct 2020 18:49:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366411 - head/sbin/gvinum X-SVN-Group: head X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: head/sbin/gvinum X-SVN-Commit-Revision: 366411 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Oct 2020 18:49:00 -0000 Author: gbe (doc committer) Date: Sat Oct 3 18:49:00 2020 New Revision: 366411 URL: https://svnweb.freebsd.org/changeset/base/366411 Log: gvinum(8): Fix an issue reported by mandoc - new sentence, new line MFC after: 1 week Modified: head/sbin/gvinum/gvinum.8 Modified: head/sbin/gvinum/gvinum.8 ============================================================================== --- head/sbin/gvinum/gvinum.8 Sat Oct 3 18:47:50 2020 (r366410) +++ head/sbin/gvinum/gvinum.8 Sat Oct 3 18:49:00 2020 (r366411) @@ -202,8 +202,8 @@ Terminate access to the objects, or stop .Nm if no parameters are specified. .It Ic stripe Oo Fl fv Oc Oo Fl n Ar name Oc Ar drives -Create a striped volume from the specified drives. If no name is specified, -a unique name will be set by +Create a striped volume from the specified drives. +If no name is specified, a unique name will be set by .Ic gvinum . This organization requires at least two drives. .El From owner-svn-src-all@freebsd.org Sat Oct 3 18:52:55 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 74A11435A35; Sat, 3 Oct 2020 18:52:55 +0000 (UTC) (envelope-from jceel@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C3bbC2FpQz3SRY; Sat, 3 Oct 2020 18:52:55 +0000 (UTC) (envelope-from jceel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3141817BC5; Sat, 3 Oct 2020 18:52:55 +0000 (UTC) (envelope-from jceel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 093Iqt7j039010; Sat, 3 Oct 2020 18:52:55 GMT (envelope-from jceel@FreeBSD.org) Received: (from jceel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 093Iqt0L039009; Sat, 3 Oct 2020 18:52:55 GMT (envelope-from jceel@FreeBSD.org) Message-Id: <202010031852.093Iqt0L039009@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jceel set sender to jceel@FreeBSD.org using -f From: Jakub Wojciech Klama Date: Sat, 3 Oct 2020 18:52:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366412 - head/contrib/lib9p/transport X-SVN-Group: head X-SVN-Commit-Author: jceel X-SVN-Commit-Paths: head/contrib/lib9p/transport X-SVN-Commit-Revision: 366412 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Oct 2020 18:52:55 -0000 Author: jceel Date: Sat Oct 3 18:52:54 2020 New Revision: 366412 URL: https://svnweb.freebsd.org/changeset/base/366412 Log: Import lib9p 9d5aee77bcc1bf0e79b0a3bfefff5fdf2146283c. Approved by: trasz (mentor) Sponsored by: Conclusive Engineering Sp. z o. o. Modified: head/contrib/lib9p/transport/socket.c Directory Properties: head/contrib/lib9p/ (props changed) Modified: head/contrib/lib9p/transport/socket.c ============================================================================== --- head/contrib/lib9p/transport/socket.c Sat Oct 3 18:49:00 2020 (r366411) +++ head/contrib/lib9p/transport/socket.c Sat Oct 3 18:52:54 2020 (r366412) @@ -307,7 +307,7 @@ l9p_socket_send_response(struct l9p_request *req __unu static void l9p_socket_drop_response(struct l9p_request *req __unused, - const struct iovec *iov, size_t niov __unused, void *arg) + const struct iovec *iov, size_t niov __unused, void *arg __unused) { L9P_LOG(L9P_DEBUG, "%p: drop buf=%p", arg, iov[0].iov_base); From owner-svn-src-all@freebsd.org Sat Oct 3 19:05:15 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 92B01435F57; Sat, 3 Oct 2020 19:05:15 +0000 (UTC) (envelope-from jceel@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C3bsR3Yzpz3Slc; Sat, 3 Oct 2020 19:05:15 +0000 (UTC) (envelope-from jceel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5DAD91809B; Sat, 3 Oct 2020 19:05:15 +0000 (UTC) (envelope-from jceel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 093J5Ffm045207; Sat, 3 Oct 2020 19:05:15 GMT (envelope-from jceel@FreeBSD.org) Received: (from jceel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 093J5Ddp045195; Sat, 3 Oct 2020 19:05:13 GMT (envelope-from jceel@FreeBSD.org) Message-Id: <202010031905.093J5Ddp045195@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jceel set sender to jceel@FreeBSD.org using -f From: Jakub Wojciech Klama Date: Sat, 3 Oct 2020 19:05:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366413 - in head: etc/mtree lib lib/lib9p share/mk usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: jceel X-SVN-Commit-Paths: in head: etc/mtree lib lib/lib9p share/mk usr.sbin/bhyve X-SVN-Commit-Revision: 366413 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Oct 2020 19:05:15 -0000 Author: jceel Date: Sat Oct 3 19:05:13 2020 New Revision: 366413 URL: https://svnweb.freebsd.org/changeset/base/366413 Log: Add virtio-9p (aka VirtFS) filesystem sharing to bhyve. VirtFS allows sharing an arbitrary directory tree between bhyve virtual machine and the host. Current implementation has a fairly complete support for 9P2000.L protocol, except for the extended attribute support. It has been verified to work with the qemu-kvm hypervisor. Reviewed by: rgrimes, emaste, jhb, trasz Approved by: trasz (mentor) MFC after: 1 month Relnotes: yes Sponsored by: Conclusive Engineering (development), vStack.com (funding) Differential Revision: https://reviews.freebsd.org/D10335 Added: head/lib/lib9p/ head/lib/lib9p/Makefile (contents, props changed) head/usr.sbin/bhyve/pci_virtio_9p.c (contents, props changed) Modified: head/etc/mtree/BSD.include.dist head/lib/Makefile head/share/mk/bsd.libnames.mk head/share/mk/src.libnames.mk head/usr.sbin/bhyve/Makefile head/usr.sbin/bhyve/bhyve.8 head/usr.sbin/bhyve/virtio.h Modified: head/etc/mtree/BSD.include.dist ============================================================================== --- head/etc/mtree/BSD.include.dist Sat Oct 3 18:52:54 2020 (r366412) +++ head/etc/mtree/BSD.include.dist Sat Oct 3 19:05:13 2020 (r366413) @@ -193,6 +193,8 @@ .. lib80211 .. + lib9p + .. libipt .. libmilter Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Sat Oct 3 18:52:54 2020 (r366412) +++ head/lib/Makefile Sat Oct 3 19:05:13 2020 (r366413) @@ -30,6 +30,7 @@ SUBDIR= ${SUBDIR_BOOTSTRAP} \ .WAIT \ libsqlite3 \ geom \ + lib9p \ libalias \ libarchive \ libauditd \ Added: head/lib/lib9p/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/lib9p/Makefile Sat Oct 3 19:05:13 2020 (r366413) @@ -0,0 +1,28 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../contrib/lib9p +CFLAGS+= -DWITH_CASPER +CFLAGS+= -I${.CURDIR} +CFLAGS+= -I${.CURDIR}/../../contrib/lib9p + +LIB= 9p +PACKAGE= lib${LIB} +SHLIB_MAJOR= 1 +SRCS= connection.c \ + genacl.c \ + hashtable.c \ + log.c \ + pack.c \ + request.c \ + rfuncs.c \ + threadpool.c \ + utils.c \ + backend/fs.c \ + transport/socket.c + +INCSDIR= ${INCLUDEDIR}/lib9p +INCS= fid.h lib9p.h backend/fs.h + +LIBADD= sbuf + +.include Modified: head/share/mk/bsd.libnames.mk ============================================================================== --- head/share/mk/bsd.libnames.mk Sat Oct 3 18:52:54 2020 (r366412) +++ head/share/mk/bsd.libnames.mk Sat Oct 3 19:05:13 2020 (r366413) @@ -17,6 +17,7 @@ LIBDESTDIR= ${SYSROOT:U${DESTDIR}} LIBCRT0?= ${LIBDESTDIR}${LIBDIR_BASE}/crt0.o LIB80211?= ${LIBDESTDIR}${LIBDIR_BASE}/lib80211.a +LIB9P?= ${LIBDESTDIR}${LIBDIR_BASE}/lib9p.a LIBALIAS?= ${LIBDESTDIR}${LIBDIR_BASE}/libalias.a LIBARCHIVE?= ${LIBDESTDIR}${LIBDIR_BASE}/libarchive.a LIBASN1?= ${LIBDESTDIR}${LIBDIR_BASE}/libasn1.a Modified: head/share/mk/src.libnames.mk ============================================================================== --- head/share/mk/src.libnames.mk Sat Oct 3 18:52:54 2020 (r366412) +++ head/share/mk/src.libnames.mk Sat Oct 3 19:05:13 2020 (r366413) @@ -70,6 +70,7 @@ _LIBRARIES= \ ${_INTERNALLIBS} \ ${LOCAL_LIBRARIES} \ 80211 \ + 9p \ alias \ archive \ asn1 \ @@ -246,6 +247,7 @@ LIBVERIEXEC?= ${LIBVERIEXECDIR}/libveriexec.a # Each library's LIBADD needs to be duplicated here for static linkage of # 2nd+ order consumers. Auto-generating this would be better. _DP_80211= sbuf bsdxml +_DP_9p= sbuf _DP_archive= z bz2 lzma bsdxml zstd _DP_zstd= pthread .if ${MK_BLACKLIST} != "no" Modified: head/usr.sbin/bhyve/Makefile ============================================================================== --- head/usr.sbin/bhyve/Makefile Sat Oct 3 18:52:54 2020 (r366412) +++ head/usr.sbin/bhyve/Makefile Sat Oct 3 19:05:13 2020 (r366413) @@ -3,6 +3,7 @@ # .include +CFLAGS+=-I${.CURDIR}/../../contrib/lib9p CFLAGS+=-I${SRCTOP}/sys .PATH: ${SRCTOP}/sys/cam/ctl @@ -47,6 +48,7 @@ SRCS= \ pci_lpc.c \ pci_nvme.c \ pci_passthru.c \ + pci_virtio_9p.c \ pci_virtio_block.c \ pci_virtio_console.c \ pci_virtio_net.c \ @@ -82,7 +84,7 @@ CFLAGS.kernemu_dev.c+= -I${SRCTOP}/sys/amd64 .PATH: ${BHYVE_SYSDIR}/sys/amd64/vmm SRCS+= vmm_instruction_emul.c -LIBADD= vmmapi md pthread z util sbuf cam +LIBADD= vmmapi md pthread z util sbuf cam 9p casper cap_pwd cap_grp .if ${MK_BHYVE_SNAPSHOT} != "no" LIBADD+= ucl xo .endif Modified: head/usr.sbin/bhyve/bhyve.8 ============================================================================== --- head/usr.sbin/bhyve/bhyve.8 Sat Oct 3 18:52:54 2020 (r366412) +++ head/usr.sbin/bhyve/bhyve.8 Sat Oct 3 19:05:13 2020 (r366413) @@ -258,6 +258,8 @@ Virtio network interface. Virtio block storage interface. .It Li virtio-scsi Virtio SCSI interface. +.It Li virtio-9p +Virtio 9p (VirtFS) interface. .It Li virtio-rnd Virtio RNG interface. .It Li virtio-console @@ -372,6 +374,19 @@ are: .It Li iid= Ns Ar IID Initiator ID to use when sending requests to specified CTL port. The default value is 0. +.El +.Pp +9P devices: +.Bl -tag -width 10n +.It Pa sharename=/path/to/share[,9p-device-options] +.El +.Pp +The +.Ar 9p-device-options +are: +.Bl -tag -width 10n +.It Li ro +Expose the share in read-only mode. .El .Pp TTY devices: Added: head/usr.sbin/bhyve/pci_virtio_9p.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bhyve/pci_virtio_9p.c Sat Oct 3 19:05:13 2020 (r366413) @@ -0,0 +1,344 @@ +/*- + * Copyright (c) 2015 iXsystems Inc. + * Copyright (c) 2017-2018 Jakub Klama + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer + * in this position and unchanged. + * 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. + */ + +/* + * VirtIO filesystem passthrough using 9p protocol. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "bhyverun.h" +#include "pci_emul.h" +#include "virtio.h" + +#define VT9P_MAX_IOV 128 +#define VT9P_RINGSZ 256 +#define VT9P_MAXTAGSZ 256 +#define VT9P_CONFIGSPACESZ (VT9P_MAXTAGSZ + sizeof(uint16_t)) + +static int pci_vt9p_debug; +#define DPRINTF(params) if (pci_vt9p_debug) printf params +#define WPRINTF(params) printf params + +/* + * Per-device softc + */ +struct pci_vt9p_softc { + struct virtio_softc vsc_vs; + struct vqueue_info vsc_vq; + pthread_mutex_t vsc_mtx; + uint64_t vsc_cfg; + uint64_t vsc_features; + char * vsc_rootpath; + struct pci_vt9p_config * vsc_config; + struct l9p_backend * vsc_fs_backend; + struct l9p_server * vsc_server; + struct l9p_connection * vsc_conn; +}; + +struct pci_vt9p_request { + struct pci_vt9p_softc * vsr_sc; + struct iovec * vsr_iov; + size_t vsr_niov; + size_t vsr_respidx; + size_t vsr_iolen; + uint16_t vsr_idx; +}; + +struct pci_vt9p_config { + uint16_t tag_len; + char tag[0]; +} __attribute__((packed)); + +static int pci_vt9p_send(struct l9p_request *, const struct iovec *, + const size_t, const size_t, void *); +static void pci_vt9p_drop(struct l9p_request *, const struct iovec *, size_t, + void *); +static void pci_vt9p_reset(void *); +static void pci_vt9p_notify(void *, struct vqueue_info *); +static int pci_vt9p_cfgread(void *, int, int, uint32_t *); +static void pci_vt9p_neg_features(void *, uint64_t); + +static struct virtio_consts vt9p_vi_consts = { + "vt9p", /* our name */ + 1, /* we support 1 virtqueue */ + VT9P_CONFIGSPACESZ, /* config reg size */ + pci_vt9p_reset, /* reset */ + pci_vt9p_notify, /* device-wide qnotify */ + pci_vt9p_cfgread, /* read virtio config */ + NULL, /* write virtio config */ + pci_vt9p_neg_features, /* apply negotiated features */ + (1 << 0), /* our capabilities */ +}; + + +static void +pci_vt9p_reset(void *vsc) +{ + struct pci_vt9p_softc *sc; + + sc = vsc; + + DPRINTF(("vt9p: device reset requested !\n")); + vi_reset_dev(&sc->vsc_vs); +} + +static void +pci_vt9p_neg_features(void *vsc, uint64_t negotiated_features) +{ + struct pci_vt9p_softc *sc = vsc; + + sc->vsc_features = negotiated_features; +} + +static int +pci_vt9p_cfgread(void *vsc, int offset, int size, uint32_t *retval) +{ + struct pci_vt9p_softc *sc = vsc; + void *ptr; + + ptr = (uint8_t *)sc->vsc_config + offset; + memcpy(retval, ptr, size); + return (0); +} + +static int +pci_vt9p_get_buffer(struct l9p_request *req, struct iovec *iov, size_t *niov, + void *arg) +{ + struct pci_vt9p_request *preq = req->lr_aux; + size_t n = preq->vsr_niov - preq->vsr_respidx; + + memcpy(iov, preq->vsr_iov + preq->vsr_respidx, + n * sizeof(struct iovec)); + *niov = n; + return (0); +} + +static int +pci_vt9p_send(struct l9p_request *req, const struct iovec *iov, + const size_t niov, const size_t iolen, void *arg) +{ + struct pci_vt9p_request *preq = req->lr_aux; + struct pci_vt9p_softc *sc = preq->vsr_sc; + + preq->vsr_iolen = iolen; + + pthread_mutex_lock(&sc->vsc_mtx); + vq_relchain(&sc->vsc_vq, preq->vsr_idx, preq->vsr_iolen); + vq_endchains(&sc->vsc_vq, 1); + pthread_mutex_unlock(&sc->vsc_mtx); + free(preq); + return (0); +} + +static void +pci_vt9p_drop(struct l9p_request *req, const struct iovec *iov, size_t niov, + void *arg) +{ + struct pci_vt9p_request *preq = req->lr_aux; + struct pci_vt9p_softc *sc = preq->vsr_sc; + + pthread_mutex_lock(&sc->vsc_mtx); + vq_relchain(&sc->vsc_vq, preq->vsr_idx, 0); + vq_endchains(&sc->vsc_vq, 1); + pthread_mutex_unlock(&sc->vsc_mtx); + free(preq); +} + +static void +pci_vt9p_notify(void *vsc, struct vqueue_info *vq) +{ + struct iovec iov[VT9P_MAX_IOV]; + struct pci_vt9p_softc *sc; + struct pci_vt9p_request *preq; + uint16_t idx, n, i; + uint16_t flags[VT9P_MAX_IOV]; + + sc = vsc; + + while (vq_has_descs(vq)) { + n = vq_getchain(vq, &idx, iov, VT9P_MAX_IOV, flags); + preq = calloc(1, sizeof(struct pci_vt9p_request)); + preq->vsr_sc = sc; + preq->vsr_idx = idx; + preq->vsr_iov = iov; + preq->vsr_niov = n; + preq->vsr_respidx = 0; + + /* Count readable descriptors */ + for (i = 0; i < n; i++) { + if (flags[i] & VRING_DESC_F_WRITE) + break; + + preq->vsr_respidx++; + } + + for (int i = 0; i < n; i++) { + DPRINTF(("vt9p: vt9p_notify(): desc%d base=%p, " + "len=%zu, flags=0x%04x\r\n", i, iov[i].iov_base, + iov[i].iov_len, flags[i])); + } + + l9p_connection_recv(sc->vsc_conn, iov, preq->vsr_respidx, preq); + } +} + + +static int +pci_vt9p_init(struct vmctx *ctx, struct pci_devinst *pi, char *opts) +{ + struct pci_vt9p_softc *sc; + char *opt; + char *sharename = NULL; + char *rootpath = NULL; + int rootfd; + bool ro = false; + cap_rights_t rootcap; + + if (opts == NULL) { + printf("virtio-9p: share name and path required\n"); + return (1); + } + + while ((opt = strsep(&opts, ",")) != NULL) { + if (strchr(opt, '=') != NULL) { + if (sharename != NULL) { + printf("virtio-9p: more than one share name given\n"); + return (1); + } + + sharename = strsep(&opt, "="); + rootpath = opt; + continue; + } + + if (strcmp(opt, "ro") == 0) { + DPRINTF(("read-only mount requested\r\n")); + ro = true; + continue; + } + + printf("virtio-9p: invalid option '%s'\n", opt); + return (1); + } + + if (strlen(sharename) > VT9P_MAXTAGSZ) { + printf("virtio-9p: share name too long\n"); + return (1); + } + + rootfd = open(rootpath, O_DIRECTORY); + if (rootfd < 0) + return (-1); + + sc = calloc(1, sizeof(struct pci_vt9p_softc)); + sc->vsc_config = calloc(1, sizeof(struct pci_vt9p_config) + + VT9P_MAXTAGSZ); + + pthread_mutex_init(&sc->vsc_mtx, NULL); + + cap_rights_init(&rootcap, + CAP_LOOKUP, CAP_ACL_CHECK, CAP_ACL_DELETE, CAP_ACL_GET, + CAP_ACL_SET, CAP_READ, CAP_WRITE, CAP_SEEK, CAP_FSTAT, + CAP_CREATE, CAP_FCHMODAT, CAP_FCHOWNAT, CAP_FTRUNCATE, + CAP_LINKAT_SOURCE, CAP_LINKAT_TARGET, CAP_MKDIRAT, CAP_MKNODAT, + CAP_PREAD, CAP_PWRITE, CAP_RENAMEAT_SOURCE, CAP_RENAMEAT_TARGET, + CAP_SEEK, CAP_SYMLINKAT, CAP_UNLINKAT, CAP_EXTATTR_DELETE, + CAP_EXTATTR_GET, CAP_EXTATTR_LIST, CAP_EXTATTR_SET, + CAP_FUTIMES, CAP_FSTATFS, CAP_FSYNC, CAP_FPATHCONF); + + if (cap_rights_limit(rootfd, &rootcap) != 0) + return (1); + + sc->vsc_config->tag_len = (uint16_t)strlen(sharename); + memcpy(sc->vsc_config->tag, sharename, sc->vsc_config->tag_len); + + if (l9p_backend_fs_init(&sc->vsc_fs_backend, rootfd, ro) != 0) { + errno = ENXIO; + return (1); + } + + if (l9p_server_init(&sc->vsc_server, sc->vsc_fs_backend) != 0) { + errno = ENXIO; + return (1); + } + + if (l9p_connection_init(sc->vsc_server, &sc->vsc_conn) != 0) { + errno = EIO; + return (1); + } + + sc->vsc_conn->lc_msize = L9P_MAX_IOV * PAGE_SIZE; + sc->vsc_conn->lc_lt.lt_get_response_buffer = pci_vt9p_get_buffer; + sc->vsc_conn->lc_lt.lt_send_response = pci_vt9p_send; + sc->vsc_conn->lc_lt.lt_drop_response = pci_vt9p_drop; + + vi_softc_linkup(&sc->vsc_vs, &vt9p_vi_consts, sc, pi, &sc->vsc_vq); + sc->vsc_vs.vs_mtx = &sc->vsc_mtx; + sc->vsc_vq.vq_qsize = VT9P_RINGSZ; + + /* initialize config space */ + pci_set_cfgdata16(pi, PCIR_DEVICE, VIRTIO_DEV_9P); + pci_set_cfgdata16(pi, PCIR_VENDOR, VIRTIO_VENDOR); + pci_set_cfgdata8(pi, PCIR_CLASS, PCIC_STORAGE); + pci_set_cfgdata16(pi, PCIR_SUBDEV_0, VIRTIO_TYPE_9P); + pci_set_cfgdata16(pi, PCIR_SUBVEND_0, VIRTIO_VENDOR); + + if (vi_intr_init(&sc->vsc_vs, 1, fbsdrun_virtio_msix())) + return (1); + vi_set_io_bar(&sc->vsc_vs, 0); + + return (0); +} + +struct pci_devemu pci_de_v9p = { + .pe_emu = "virtio-9p", + .pe_init = pci_vt9p_init, + .pe_barwrite = vi_pci_write, + .pe_barread = vi_pci_read +}; +PCI_EMUL_SET(pci_de_v9p); Modified: head/usr.sbin/bhyve/virtio.h ============================================================================== --- head/usr.sbin/bhyve/virtio.h Sat Oct 3 18:52:54 2020 (r366412) +++ head/usr.sbin/bhyve/virtio.h Sat Oct 3 19:05:13 2020 (r366413) @@ -216,6 +216,7 @@ struct vring_used { #define VIRTIO_DEV_CONSOLE 0x1003 #define VIRTIO_DEV_RANDOM 0x1005 #define VIRTIO_DEV_SCSI 0x1008 +#define VIRTIO_DEV_9P 0x1009 /* * PCI config space constants. From owner-svn-src-all@freebsd.org Sat Oct 3 19:10:55 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 186F4436020; Sat, 3 Oct 2020 19:10:55 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C3bzy6zJTz3TT7; Sat, 3 Oct 2020 19:10:54 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D3E5C18125; Sat, 3 Oct 2020 19:10:54 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 093JAsgn045532; Sat, 3 Oct 2020 19:10:54 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 093JAs0w045531; Sat, 3 Oct 2020 19:10:54 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202010031910.093JAs0w045531@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Sat, 3 Oct 2020 19:10:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366414 - head/usr.bin/cpuset X-SVN-Group: head X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: head/usr.bin/cpuset X-SVN-Commit-Revision: 366414 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Oct 2020 19:10:55 -0000 Author: gbe (doc committer) Date: Sat Oct 3 19:10:54 2020 New Revision: 366414 URL: https://svnweb.freebsd.org/changeset/base/366414 Log: cpuset(1): Fix some issues reported by mandoc - whitespace at end of input line - new sentence, new line MFC after: 1 week Modified: head/usr.bin/cpuset/cpuset.1 Modified: head/usr.bin/cpuset/cpuset.1 ============================================================================== --- head/usr.bin/cpuset/cpuset.1 Sat Oct 3 19:05:13 2020 (r366413) +++ head/usr.bin/cpuset/cpuset.1 Sat Oct 3 19:10:54 2020 (r366414) @@ -34,24 +34,24 @@ .Sh SYNOPSIS .Nm .Op Fl l Ar cpu-list -.Op Fl n Ar policy:domain-list +.Op Fl n Ar policy:domain-list .Op Fl s Ar setid .Ar cmd ... .Nm .Op Fl l Ar cpu-list -.Op Fl n Ar policy:domain-list +.Op Fl n Ar policy:domain-list .Op Fl s Ar setid .Fl p Ar pid .Nm .Op Fl c .Op Fl l Ar cpu-list -.Op Fl n Ar policy:domain-list +.Op Fl n Ar policy:domain-list .Fl C .Fl p Ar pid .Nm .Op Fl c .Op Fl l Ar cpu-list -.Op Fl n Ar policy:domain-list +.Op Fl n Ar policy:domain-list .Op Fl j Ar jail | Fl p Ar pid | Fl t Ar tid | Fl s Ar setid | Fl x Ar irq .Nm .Fl g @@ -97,8 +97,8 @@ This last set is the list of all possible CPUs in the queried using .Fl r . .Pp -Most sets include NUMA memory domain and policy information. This can be -inspected with +Most sets include NUMA memory domain and policy information. +This can be inspected with .Fl g and set with .Fl n . @@ -124,8 +124,8 @@ Create a new cpuset and assign the target process to t The requested operation should reference the cpuset available via the target specifier. .It Fl d Ar domain -Specifies a NUMA domain id as the target of the operation. This can only -be used to query the cpus visible in each numberd domain. +Specifies a NUMA domain id as the target of the operation. +This can only be used to query the cpus visible in each numberd domain. .It Fl g Causes .Nm @@ -146,8 +146,8 @@ A special list of .Dq all may be specified in which case the list includes all CPUs from the root set. .It Fl n Ar policy:domain-list -Specifies a list of domains and allocation policy to apply to a target. Ranges -may be specified as in +Specifies a list of domains and allocation policy to apply to a target. +Ranges may be specified as in .Fl l . Valid policies include first-touch (ft), round-robin (rr), prefer and interleave (il). From owner-svn-src-all@freebsd.org Sat Oct 3 19:29:18 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 09696436591; Sat, 3 Oct 2020 19:29:18 +0000 (UTC) (envelope-from gbe@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C3cP96H5xz3TpF; Sat, 3 Oct 2020 19:29:17 +0000 (UTC) (envelope-from gbe@freebsd.org) Received: from localhost (p4fd3acce.dip0.t-ipconnect.de [79.211.172.206]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gbe) by smtp.freebsd.org (Postfix) with ESMTPSA id 7D4812D373; Sat, 3 Oct 2020 19:29:17 +0000 (UTC) (envelope-from gbe@freebsd.org) Date: Sat, 3 Oct 2020 21:29:16 +0200 From: Gordon Bergling To: xtouqh@hotmail.com Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r366403 - head/bin/ls Message-ID: <20201003192916.GA41544@lion.0xfce3.net> References: <202010031834.093IYO3r026370@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Url: X-Operating-System: FreeBSD 12.2-STABLE amd64 X-Host-Uptime: 9:23PM up 16 days, 10:31, 3 users, load averages: 0.43, 0.36, 0.40 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Oct 2020 19:29:18 -0000 On Sat, Oct 03, 2020 at 09:47:48PM +0300, xtouqh@hotmail.com wrote: > Gordon Bergling wrote: > > Author: gbe (doc committer) > > Date: Sat Oct 3 18:34:24 2020 > > New Revision: 366403 > > URL: https://svnweb.freebsd.org/changeset/base/366403 > > > > Log: > > ls(1): Bugfix for an issue reported by mandoc > > > > - no blank before trailing delimiter > > > > MFC after: 1 week > > > > Modified: > > head/bin/ls/ls.1 > > > > Modified: head/bin/ls/ls.1 > > ============================================================================== > > --- head/bin/ls/ls.1 Sat Oct 3 18:30:01 2020 (r366402) > > +++ head/bin/ls/ls.1 Sat Oct 3 18:34:24 2020 (r366403) > > @@ -40,7 +40,7 @@ > > .Nd list directory contents > > .Sh SYNOPSIS > > .Nm > > -.Op Fl ABCFGHILPRSTUWZabcdfghiklmnopqrstuwxy1, > > +.Op Fl ABCFGHILPRSTUWZabcdfghiklmnopqrstuwxy1 , > > This makes the "," appear after the "]", how about using the following > instead: > > .Op Fl ABCFGHILPRSTUWZabcdfghiklmnopqrstuwxy1\&, The comma is appearing right before the ']', like it was before. I'll check the recommended syntax regarding '\&' tomorrow. Thank you, Gordon Bergling From owner-svn-src-all@freebsd.org Sat Oct 3 19:33:33 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3CF1643654C; Sat, 3 Oct 2020 19:33:33 +0000 (UTC) (envelope-from xtouqh@hotmail.com) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05olkn20825.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e1b::825]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "GlobalSign Organization Validation CA - SHA256 - G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C3cV36dQNz3VWh; Sat, 3 Oct 2020 19:33:31 +0000 (UTC) (envelope-from xtouqh@hotmail.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MWABuUrNkyXnDWwfqICNo9GTgLbGGMfRjygVo/GPew2yAhakB5VBv4KyOmTNSsKBE1DPAJVigHFUfQvnMB6G71oCYYxEfDNcJ/ABU2Ju6l00sfu3weIv8ft5fOA4rwIdKD3BbTNyh9rPCHmKp0wT/bDZW4SDjo2F1VR9OOSJKVfySNDo0F90gsZIsIacUF8Ge5rpmjZkLUOHyJmGR+poMvlWUCXZdkoqqDzI23xY2NQqQ6KK4AkjuVvxeppdfNrObzKZCA1xKYBpwf9ZjdqPoC371PEa9GYqikc8t3RNjAQ24411UzMYgzn8lMORvBmtcqi/bVM4zmUi3o+dIh3RpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SSX6cBr78O967P6l6t6GaqvaJM6doOIhIO6hW8OhPRc=; b=RE7irL62D5PD3ma01E9emqG8Vjaq7SyJA5AQYut0OoHfJd3VSUUcKlAEJfphrC57U8Ls0r2/Yx94kKcor7agLGA+ogB/xpKyDFBA/qktq781tHWt+U0vy6yg0JF43a2WNTLW0PttQoeRryxPPu+0Tjdqy/MBoKW32LQyccR6TB0Fg+hBxk2t5F0zb8FMgg1EeO1KaVh9KvQ8Z9ChNuG06QpM66ySUKCJAts6q9xgqaF9X3Jefk9EWVZzeOLd0bNGEKpz3j6mF5ixAi7p8j/UfWO+pUz043njXNoVEPl8IT/p/rsupKmTyayTNEzmw1tgKowduSvEWuhAGyTlUqlGUg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SSX6cBr78O967P6l6t6GaqvaJM6doOIhIO6hW8OhPRc=; b=R6GAf8gIfJvKtqp5plR1Tqx7k5cCJdNzyWPiUkBfCLAlsQ50z3saZwgRIv/m/utvekr3fJ+lWabjssJKNRXZQt3m8IbAguEUwrJSnI45lmwu2E/r0D7nhw7eLmtTXi8ZEz5chwKrmBPOA+rDkwyh06mScsT2jmz1OcHdBOXlaJb7oYO2gn17BbTEg90fjjg+6iY9rgv9Ns0tIoMHcuiWr1FhLkSoqkA1N4GvfIaBOyNn08QTolnCaGMjfTr5KYXQsZ7nZE6B7/NMG1lFt8accL0O1UPR1kRAhQDB/6IXGeZBT7fEQG51esdoV5pj9Gv9aiqIg46WGs6dEyjkUvfFvA== Received: from DB8EUR05FT027.eop-eur05.prod.protection.outlook.com (2a01:111:e400:fc0f::51) by DB8EUR05HT128.eop-eur05.prod.protection.outlook.com (2a01:111:e400:fc0f::170) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3433.34; Sat, 3 Oct 2020 19:33:30 +0000 Received: from AM0PR06MB3986.eurprd06.prod.outlook.com (2a01:111:e400:fc0f::51) by DB8EUR05FT027.mail.protection.outlook.com (2a01:111:e400:fc0f::448) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3433.34 via Frontend Transport; Sat, 3 Oct 2020 19:33:30 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:139DBA29DADB4F2FA2CB716929004AF3603558A73679892712942E51013A4A78; UpperCasedChecksum:7EAE11F1D392544EDE8B44670B45B95DEF7D47034AC228C7D776DE132ADE2E21; SizeAsReceived:8770; Count:48 Received: from AM0PR06MB3986.eurprd06.prod.outlook.com ([fe80::759a:af46:6f2:8fb8]) by AM0PR06MB3986.eurprd06.prod.outlook.com ([fe80::759a:af46:6f2:8fb8%7]) with mapi id 15.20.3433.038; Sat, 3 Oct 2020 19:33:30 +0000 Subject: Re: svn commit: r366403 - head/bin/ls To: Gordon Bergling Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202010031834.093IYO3r026370@repo.freebsd.org> <20201003192916.GA41544@lion.0xfce3.net> From: xtouqh@hotmail.com Message-ID: Date: Sat, 3 Oct 2020 22:33:28 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.3.1 In-Reply-To: <20201003192916.GA41544@lion.0xfce3.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-TMN: [uBYtMCJ+cqOKqOwoUxdQIwkwFmWcKpOa] X-ClientProxiedBy: AM0PR08CA0010.eurprd08.prod.outlook.com (2603:10a6:208:d2::23) To AM0PR06MB3986.eurprd06.prod.outlook.com (2603:10a6:208:b6::28) X-Microsoft-Original-Message-ID: <573366d0-0e62-da7c-5ece-369bd23769b2@hotmail.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [192.168.1.6] (91.240.124.157) by AM0PR08CA0010.eurprd08.prod.outlook.com (2603:10a6:208:d2::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3433.34 via Frontend Transport; Sat, 3 Oct 2020 19:33:29 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 48 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: b7d64099-b659-4789-eeea-08d867d3351b X-MS-TrafficTypeDiagnostic: DB8EUR05HT128: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kUQnOA1AqbS9icBohvdC2C/ompDl85EZ44cygBAlv+cZtQ5F/d2k2sxu13ATp+7lR9ShfVbXHwHPYXobRUtfaK2M9mIq8KgK2fJwc1WxrI99q898YmCw/B2Le5Mmz8HC5y87dqkH5RY8t8CWhw4277oV4dCjJmTM+I9uZqZ5hQMDD6aiysHa6Np2d5sv6LeTv2p/KhXx6NbHOpDD/rGUZlIYr4dLn1mwUhYH9oAUuOIN+e/l+aSe3WO4aRRk46T2 X-MS-Exchange-AntiSpam-MessageData: 621Al9iEfns5ImNh+kQikPFw9gCy4xxWfrfDFiglxR3AnSy+7Ii7F8Bval6Ax0h6UWS4WXwUK9exdXloPpavO/y9S0z9bUeimrhMSPlkAraInmotg5nFbmn2tTzwNP8FPlUNkawH3+tDnIeprhiEDg== X-OriginatorOrg: hotmail.com X-MS-Exchange-CrossTenant-Network-Message-Id: b7d64099-b659-4789-eeea-08d867d3351b X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Oct 2020 19:33:30.1477 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: DB8EUR05FT027.eop-eur05.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8EUR05HT128 X-Rspamd-Queue-Id: 4C3cV36dQNz3VWh X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=hotmail.com header.s=selector1 header.b=R6GAf8gI; dmarc=pass (policy=none) header.from=hotmail.com; spf=pass (mx1.freebsd.org: domain of xtouqh@hotmail.com designates 2a01:111:f400:7e1b::825 as permitted sender) smtp.mailfrom=xtouqh@hotmail.com X-Spamd-Result: default: False [-2.82 / 15.00]; RCVD_TLS_LAST(0.00)[]; NEURAL_HAM_MEDIUM(-1.03)[-1.035]; R_DKIM_ALLOW(-0.20)[hotmail.com:s=selector1]; RCVD_COUNT_FIVE(0.00)[5]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[hotmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; R_SPF_ALLOW(-0.20)[+ip6:2a01:111:f400::/48]; NEURAL_HAM_LONG(-1.04)[-1.038]; ARC_ALLOW(-1.00)[microsoft.com:s=arcselector9901:i=1]; DKIM_TRACE(0.00)[hotmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[hotmail.com,none]; FROM_NO_DN(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2a01:111:f400:7e1b::825:from]; NEURAL_HAM_SHORT(-1.25)[-1.246]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[hotmail.com]; ASN(0.00)[asn:8075, ipnet:2a01:111:f000::/36, country:US]; FORGED_MUA_THUNDERBIRD_MSGID_UNKNOWN(2.50)[]; MAILMAN_DEST(0.00)[svn-src-head,svn-src-all]; DWL_DNSWL_NONE(0.00)[hotmail.com:dkim] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Oct 2020 19:33:33 -0000 Gordon Bergling wrote: > On Sat, Oct 03, 2020 at 09:47:48PM +0300, xtouqh@hotmail.com wrote: >> Gordon Bergling wrote: >>> Author: gbe (doc committer) >>> Date: Sat Oct 3 18:34:24 2020 >>> New Revision: 366403 >>> URL: https://svnweb.freebsd.org/changeset/base/366403 >>> >>> Log: >>> ls(1): Bugfix for an issue reported by mandoc >>> >>> - no blank before trailing delimiter >>> >>> MFC after: 1 week >>> >>> Modified: >>> head/bin/ls/ls.1 >>> >>> Modified: head/bin/ls/ls.1 >>> ============================================================================== >>> --- head/bin/ls/ls.1 Sat Oct 3 18:30:01 2020 (r366402) >>> +++ head/bin/ls/ls.1 Sat Oct 3 18:34:24 2020 (r366403) >>> @@ -40,7 +40,7 @@ >>> .Nd list directory contents >>> .Sh SYNOPSIS >>> .Nm >>> -.Op Fl ABCFGHILPRSTUWZabcdfghiklmnopqrstuwxy1, >>> +.Op Fl ABCFGHILPRSTUWZabcdfghiklmnopqrstuwxy1 , >> >> This makes the "," appear after the "]", how about using the following >> instead: >> >> .Op Fl ABCFGHILPRSTUWZabcdfghiklmnopqrstuwxy1\&, > > The comma is appearing right before the ']', like it was before. I'll check > the recommended syntax regarding '\&' tomorrow. That's not what I'm seeing: polaris:xtouqh:/usr/src$ svnlite info bin/ls/ls.1 Path: bin/ls/ls.1 Name: ls.1 Working Copy Root Path: /usr/src URL: svn://svn.freebsd.org/base/head/bin/ls/ls.1 Relative URL: ^/head/bin/ls/ls.1 Repository Root: svn://svn.freebsd.org/base Repository UUID: ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f Revision: 366414 Node Kind: file Schedule: normal Last Changed Author: gbe Last Changed Rev: 366403 Last Changed Date: 2020-10-03 18:34:24 +0000 (Sat, 03 Oct 2020) Text Last Updated: 2020-10-03 18:51:31 +0000 (Sat, 03 Oct 2020) Checksum: 72fe092ab2b5ac3363ea0681cfda216876d24fcd $ man bin/ls/ls.1 | head LS(1) FreeBSD General Commands Manual LS(1) NAME ls – list directory contents SYNOPSIS ls [-ABCFGHILPRSTUWZabcdfghiklmnopqrstuwxy1], [--color=when] [-D format] [file ...] DESCRIPTION From owner-svn-src-all@freebsd.org Sat Oct 3 23:07:10 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A6AD63F2CE2; Sat, 3 Oct 2020 23:07:10 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C3jDZ3wcYz3gMm; Sat, 3 Oct 2020 23:07:10 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 69FE41AC56; Sat, 3 Oct 2020 23:07:10 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 093N7AwT092624; Sat, 3 Oct 2020 23:07:10 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 093N7AIK092622; Sat, 3 Oct 2020 23:07:10 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202010032307.093N7AIK092622@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 3 Oct 2020 23:07:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366415 - in head/sys: amd64/include x86/include X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: amd64/include x86/include X-SVN-Commit-Revision: 366415 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Oct 2020 23:07:10 -0000 Author: kib Date: Sat Oct 3 23:07:09 2020 New Revision: 366415 URL: https://svnweb.freebsd.org/changeset/base/366415 Log: Move ctx_switch_xsave declaration to amd64 md_var.h. Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/sys/amd64/include/md_var.h head/sys/x86/include/x86_var.h Modified: head/sys/amd64/include/md_var.h ============================================================================== --- head/sys/amd64/include/md_var.h Sat Oct 3 19:10:54 2020 (r366414) +++ head/sys/amd64/include/md_var.h Sat Oct 3 23:07:09 2020 (r366415) @@ -36,6 +36,7 @@ #include +extern char ctx_switch_xsave[]; extern int hw_lower_amd64_sharedpage; extern int hw_ibrs_disable; extern int hw_ssb_disable; Modified: head/sys/x86/include/x86_var.h ============================================================================== --- head/sys/x86/include/x86_var.h Sat Oct 3 19:10:54 2020 (r366414) +++ head/sys/x86/include/x86_var.h Sat Oct 3 23:07:09 2020 (r366415) @@ -71,7 +71,6 @@ extern u_int cpu_power_eax; extern u_int cpu_power_ebx; extern u_int cpu_power_ecx; extern u_int cpu_power_edx; -extern char ctx_switch_xsave[]; extern u_int hv_base; extern u_int hv_high; extern char hv_vendor[]; From owner-svn-src-all@freebsd.org Sat Oct 3 23:11:21 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 741953F2F32; Sat, 3 Oct 2020 23:11:21 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C3jKP2W1sz3gNp; Sat, 3 Oct 2020 23:11:21 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 39A111AE1F; Sat, 3 Oct 2020 23:11:21 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 093NBL4e094585; Sat, 3 Oct 2020 23:11:21 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 093NBLK3094584; Sat, 3 Oct 2020 23:11:21 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202010032311.093NBLK3094584@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 3 Oct 2020 23:11:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366416 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 366416 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Oct 2020 23:11:21 -0000 Author: kib Date: Sat Oct 3 23:11:20 2020 New Revision: 366416 URL: https://svnweb.freebsd.org/changeset/base/366416 Log: Fix pmap_pti_add_kva() call for doublefault stack page. After r354889 stack got struct nmi_pcpu at top, which makes IST top not page-aligned. Since pmap_pti_add_kva() truncates/rounds up addresses, it erronously entered a page mapped before double fault stack into the pti page table. Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Sat Oct 3 23:07:09 2020 (r366415) +++ head/sys/amd64/amd64/pmap.c Sat Oct 3 23:11:20 2020 (r366416) @@ -10479,7 +10479,7 @@ pmap_pti_init(void) sizeof(struct gate_descriptor) * NIDT, false); CPU_FOREACH(i) { /* Doublefault stack IST 1 */ - va = __pcpu[i].pc_common_tss.tss_ist1; + va = __pcpu[i].pc_common_tss.tss_ist1 + sizeof(struct nmi_pcpu); pmap_pti_add_kva_locked(va - PAGE_SIZE, va, false); /* NMI stack IST 2 */ va = __pcpu[i].pc_common_tss.tss_ist2 + sizeof(struct nmi_pcpu); From owner-svn-src-all@freebsd.org Sat Oct 3 23:17:30 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5EF993F312D; Sat, 3 Oct 2020 23:17:30 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C3jSV1sXdz3gvj; Sat, 3 Oct 2020 23:17:30 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 23C821ACEE; Sat, 3 Oct 2020 23:17:30 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 093NHTUk098926; Sat, 3 Oct 2020 23:17:29 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 093NHT9T098923; Sat, 3 Oct 2020 23:17:29 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202010032317.093NHT9T098923@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 3 Oct 2020 23:17:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366417 - in head/sys/amd64: amd64 include X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys/amd64: amd64 include X-SVN-Commit-Revision: 366417 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Oct 2020 23:17:30 -0000 Author: kib Date: Sat Oct 3 23:17:29 2020 New Revision: 366417 URL: https://svnweb.freebsd.org/changeset/base/366417 Log: amd64: Store full 64bit of FIP/FDP for 64bit processes when using XSAVE. If current process is 64bit, use rex-prefixed version of XSAVE (XSAVE64). If current process is 32bit and CPU supports saving segment registers cs/ds in the FPU save area, use non-prefixed variant of XSAVE. Reported and tested by: Michał Górny PR: 250043 Reviewed by: emaste, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D26643 Modified: head/sys/amd64/amd64/cpu_switch.S head/sys/amd64/amd64/fpu.c head/sys/amd64/include/md_var.h Modified: head/sys/amd64/amd64/cpu_switch.S ============================================================================== --- head/sys/amd64/amd64/cpu_switch.S Sat Oct 3 23:11:20 2020 (r366416) +++ head/sys/amd64/amd64/cpu_switch.S Sat Oct 3 23:17:29 2020 (r366417) @@ -116,22 +116,25 @@ done_store_dr: /* have we used fp, and need a save? */ cmpq %rdi,PCPU(FPCURTHREAD) - jne 2f - movq PCB_SAVEFPU(%r8),%r8 + jne ctx_switch_fpusave_done + movq PCB_SAVEFPU(%r8),%r9 clts cmpl $0,use_xsave(%rip) jne 1f - fxsave (%r8) - jmp 2f + fxsave (%r9) + jmp ctx_switch_fpusave_done 1: movq %rdx,%rcx movl xsave_mask,%eax movl xsave_mask+4,%edx + testl $PCB_32BIT,PCB_FLAGS(%r8) + jne ctx_switch_xsave32 .globl ctx_switch_xsave ctx_switch_xsave: /* This is patched to xsaveopt if supported, see fpuinit_bsp1() */ - xsave (%r8) + xsave64 (%r9) +ctx_switch_xsave_done: movq %rcx,%rdx -2: +ctx_switch_fpusave_done: /* Save is done. Now fire up new thread. Leave old vmspace. */ movq %rsi,%r12 movq %rdi,%r13 @@ -294,6 +297,11 @@ do_ldt: movq PCPU(LDT),%rax movq %rdx,8(%rax) movl $LDTSEL,%eax jmp ld_ldt + + .globl ctx_switch_xsave32 +ctx_switch_xsave32: + xsave (%r9) + jmp ctx_switch_xsave_done END(cpu_switch) /* Modified: head/sys/amd64/amd64/fpu.c ============================================================================== --- head/sys/amd64/amd64/fpu.c Sat Oct 3 23:11:20 2020 (r366416) +++ head/sys/amd64/amd64/fpu.c Sat Oct 3 23:17:29 2020 (r366417) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -81,7 +82,7 @@ __FBSDID("$FreeBSD$"); #define stmxcsr(addr) __asm __volatile("stmxcsr %0" : : "m" (*(addr))) static __inline void -xrstor(char *addr, uint64_t mask) +xrstor32(char *addr, uint64_t mask) { uint32_t low, hi; @@ -91,27 +92,59 @@ xrstor(char *addr, uint64_t mask) } static __inline void -xsave(char *addr, uint64_t mask) +xrstor64(char *addr, uint64_t mask) { uint32_t low, hi; low = mask; hi = mask >> 32; + __asm __volatile("xrstor64 %0" : : "m" (*addr), "a" (low), "d" (hi)); +} + +static __inline void +xsave32(char *addr, uint64_t mask) +{ + uint32_t low, hi; + + low = mask; + hi = mask >> 32; __asm __volatile("xsave %0" : "=m" (*addr) : "a" (low), "d" (hi) : "memory"); } static __inline void -xsaveopt(char *addr, uint64_t mask) +xsave64(char *addr, uint64_t mask) { uint32_t low, hi; low = mask; hi = mask >> 32; + __asm __volatile("xsave64 %0" : "=m" (*addr) : "a" (low), "d" (hi) : + "memory"); +} + +static __inline void +xsaveopt32(char *addr, uint64_t mask) +{ + uint32_t low, hi; + + low = mask; + hi = mask >> 32; __asm __volatile("xsaveopt %0" : "=m" (*addr) : "a" (low), "d" (hi) : "memory"); } +static __inline void +xsaveopt64(char *addr, uint64_t mask) +{ + uint32_t low, hi; + + low = mask; + hi = mask >> 32; + __asm __volatile("xsaveopt64 %0" : "=m" (*addr) : "a" (low), "d" (hi) : + "memory"); +} + #else /* !(__GNUCLIKE_ASM && !lint) */ void fldcw(u_short cw); @@ -123,9 +156,12 @@ void fxsave(caddr_t addr); void fxrstor(caddr_t addr); void ldmxcsr(u_int csr); void stmxcsr(u_int *csr); -void xrstor(char *addr, uint64_t mask); -void xsave(char *addr, uint64_t mask); -void xsaveopt(char *addr, uint64_t mask); +void xrstor32(char *addr, uint64_t mask); +void xrstor64(char *addr, uint64_t mask); +void xsave32(char *addr, uint64_t mask); +void xsave64(char *addr, uint64_t mask); +void xsaveopt32(char *addr, uint64_t mask); +void xsaveopt64(char *addr, uint64_t mask); #endif /* __GNUCLIKE_ASM && !lint */ @@ -166,24 +202,48 @@ static struct xsave_area_elm_descr { } *xsave_area_desc; static void -fpusave_xsaveopt(void *addr) +fpusave_xsaveopt64(void *addr) { + xsaveopt64((char *)addr, xsave_mask); +} - xsaveopt((char *)addr, xsave_mask); +static void +fpusave_xsaveopt3264(void *addr) +{ + if (SV_CURPROC_FLAG(SV_ILP32)) + xsaveopt32((char *)addr, xsave_mask); + else + xsaveopt64((char *)addr, xsave_mask); } static void -fpusave_xsave(void *addr) +fpusave_xsave64(void *addr) { + xsave64((char *)addr, xsave_mask); +} - xsave((char *)addr, xsave_mask); +static void +fpusave_xsave3264(void *addr) +{ + if (SV_CURPROC_FLAG(SV_ILP32)) + xsave32((char *)addr, xsave_mask); + else + xsave64((char *)addr, xsave_mask); } static void -fpurestore_xrstor(void *addr) +fpurestore_xrstor64(void *addr) { + xrstor64((char *)addr, xsave_mask); +} - xrstor((char *)addr, xsave_mask); +static void +fpurestore_xrstor3264(void *addr) +{ + if (SV_CURPROC_FLAG(SV_ILP32)) + xrstor32((char *)addr, xsave_mask); + else + xrstor64((char *)addr, xsave_mask); } static void @@ -216,17 +276,24 @@ DEFINE_IFUNC(, void, fpusave, (void *)) { init_xsave(); - if (use_xsave) - return ((cpu_stdext_feature & CPUID_EXTSTATE_XSAVEOPT) != 0 ? - fpusave_xsaveopt : fpusave_xsave); - return (fpusave_fxsave); + if (!use_xsave) + return (fpusave_fxsave); + if ((cpu_stdext_feature & CPUID_EXTSTATE_XSAVEOPT) != 0) { + return ((cpu_stdext_feature & CPUID_STDEXT_NFPUSG) != 0 ? + fpusave_xsaveopt64 : fpusave_xsaveopt3264); + } + return ((cpu_stdext_feature & CPUID_STDEXT_NFPUSG) != 0 ? + fpusave_xsave64 : fpusave_xsave3264); } DEFINE_IFUNC(, void, fpurestore, (void *)) { init_xsave(); - return (use_xsave ? fpurestore_xrstor : fpurestore_fxrstor); + if (!use_xsave) + return (fpurestore_fxrstor); + return ((cpu_stdext_feature & CPUID_STDEXT_NFPUSG) != 0 ? + fpurestore_xrstor64 : fpurestore_xrstor3264); } void @@ -293,6 +360,7 @@ fpuinit_bsp1(void) * read-only before cpu_startup(). */ old_wp = disable_wp(); + ctx_switch_xsave32[3] |= 0x10; ctx_switch_xsave[3] |= 0x10; restore_wp(old_wp); } Modified: head/sys/amd64/include/md_var.h ============================================================================== --- head/sys/amd64/include/md_var.h Sat Oct 3 23:11:20 2020 (r366416) +++ head/sys/amd64/include/md_var.h Sat Oct 3 23:17:29 2020 (r366417) @@ -37,6 +37,7 @@ #include extern char ctx_switch_xsave[]; +extern char ctx_switch_xsave32[]; extern int hw_lower_amd64_sharedpage; extern int hw_ibrs_disable; extern int hw_ssb_disable;