From owner-svn-src-stable-12@freebsd.org Sun Nov 4 06:25:08 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68C4E10F55F2; Sun, 4 Nov 2018 06:25:08 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E98917B744; Sun, 4 Nov 2018 06:25:07 +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 CA6C724AA7; Sun, 4 Nov 2018 06:25:07 +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 wA46P7Cw093587; Sun, 4 Nov 2018 06:25:07 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA46P7Um093586; Sun, 4 Nov 2018 06:25:07 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201811040625.wA46P7Um093586@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sun, 4 Nov 2018 06:25: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: r340109 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: bz X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 340109 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E98917B744 X-Spamd-Result: default: False [-0.87 / 200.00]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-0.76)[-0.755,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2018 06:25:08 -0000 Author: bz Date: Sun Nov 4 06:25:07 2018 New Revision: 340109 URL: https://svnweb.freebsd.org/changeset/base/340109 Log: MFC r340009: carpstats are the last virtualised variable in the file and end up at the end of the vnet_set. The generated code uses an absolute relocation at one byte beyond the end of the carpstats array. This means the relocation for the vnet does not happen for carpstats initialisation and as a result the kernel panics on module load. This problem has only been observed with carp and only on i386. We considered various possible solutions including using linker scripts to add padding to all kernel modules for pcpu and vnet sections. While the symbols (by chance) stay in the order of appearance in the file adding an unused non-file-local variable at the end of the file will extend the size of set_vnet and hence make the absolute relocation for carpstats work (think of this as a single-module set_vnet padding). This is a (tmporary) hack. It is the least intrusive one as we need a timely solution for the upcoming release. We will revisit the problem in HEAD. For a lot more information and the possible alternate solutions please see the PR and the references therein. PR: 230857 Approved by: re (kib) Modified: stable/12/sys/netinet/ip_carp.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/ip_carp.c ============================================================================== --- stable/12/sys/netinet/ip_carp.c Sun Nov 4 06:24:27 2018 (r340108) +++ stable/12/sys/netinet/ip_carp.c Sun Nov 4 06:25:07 2018 (r340109) @@ -2176,6 +2176,21 @@ static struct protosw in6_carp_protosw = { }; #endif +#ifdef VIMAGE +#if defined(__i386__) +/* + * XXX This is a hack to work around an absolute relocation outside + * set_vnet by one (on the stop symbol) for carpstats. Add a dummy variable + * to the end of the file in the hope that the linker will just keep the + * order (as it seems to do at the moment). It is understood to be fragile. + * See PR 230857 for a longer discussion of the problem and the referenced + * review for possible alternate solutions. Each is a hack; we just need + * the least intrusive one for the next release. + */ +VNET_DEFINE(char, carp_zzz) = 0xde; +#endif +#endif + static void carp_mod_cleanup(void) { From owner-svn-src-stable-12@freebsd.org Mon Nov 5 18:11:39 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B13E31107CFD; Mon, 5 Nov 2018 18:11: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3F69A6BDCC; Mon, 5 Nov 2018 18:11: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 2087F1B185; Mon, 5 Nov 2018 18:11: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 wA5IBd1G040455; Mon, 5 Nov 2018 18:11:39 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA5IBdJC040454; Mon, 5 Nov 2018 18:11:39 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201811051811.wA5IBdJC040454@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 5 Nov 2018 18:11: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: r340153 - stable/12/rescue/rescue X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/12/rescue/rescue X-SVN-Commit-Revision: 340153 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3F69A6BDCC X-Spamd-Result: default: False [-0.80 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.81)[-0.811,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_SPAM_SHORT(0.12)[0.117,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2018 18:11:39 -0000 Author: kevans Date: Mon Nov 5 18:11:38 2018 New Revision: 340153 URL: https://svnweb.freebsd.org/changeset/base/340153 Log: MFC r339972: rescue: Add bectl(8) Approved by: re (gjb) Modified: stable/12/rescue/rescue/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/rescue/rescue/Makefile ============================================================================== --- stable/12/rescue/rescue/Makefile Mon Nov 5 16:20:07 2018 (r340152) +++ stable/12/rescue/rescue/Makefile Mon Nov 5 18:11:38 2018 (r340153) @@ -116,6 +116,7 @@ CRUNCH_PROGS_sbin+= routed rtquery .endif .if ${MK_ZFS} != "no" +CRUNCH_PROGS_sbin+= bectl CRUNCH_PROGS_sbin+= zfs CRUNCH_PROGS_sbin+= zpool CRUNCH_PROGS_usr.sbin+= zdb @@ -127,6 +128,7 @@ CRUNCH_PROGS_usr.sbin+= zdb CRUNCH_LIBS+= -l80211 -lalias -lcam -lncursesw -ldevstat -lipsec -llzma .if ${MK_ZFS} != "no" CRUNCH_LIBS+= -lavl -lzpool -lzfs_core -lzfs -lnvpair -lpthread -luutil -lumem +CRUNCH_LIBS+= -lbe .else # liblzma needs pthread CRUNCH_LIBS+= -lpthread From owner-svn-src-stable-12@freebsd.org Mon Nov 5 18:12:42 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 716621108001; Mon, 5 Nov 2018 18:12:42 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1EC136C0CE; Mon, 5 Nov 2018 18:12:42 +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 B83011B1D0; Mon, 5 Nov 2018 18:12:41 +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 wA5ICfDi040559; Mon, 5 Nov 2018 18:12:41 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA5ICfSI040558; Mon, 5 Nov 2018 18:12:41 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201811051812.wA5ICfSI040558@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 5 Nov 2018 18:12: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: r340154 - stable/12/lib/libbe X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/12/lib/libbe X-SVN-Commit-Revision: 340154 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1EC136C0CE X-Spamd-Result: default: False [-0.79 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.79)[-0.794,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_SPAM_SHORT(0.11)[0.110,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2018 18:12:42 -0000 Author: kevans Date: Mon Nov 5 18:12:41 2018 New Revision: 340154 URL: https://svnweb.freebsd.org/changeset/base/340154 Log: MFC r339994: libbe(3): Don't promote non-cloned BEs Most easily reproducible by attempting to activate the currently activated BE, one would get a "not a cloned filesystem" error instead of success or a sane message. PR: 232488 Approved by: re (gjb) Modified: stable/12/lib/libbe/be.c Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libbe/be.c ============================================================================== --- stable/12/lib/libbe/be.c Mon Nov 5 18:11:38 2018 (r340153) +++ stable/12/lib/libbe/be.c Mon Nov 5 18:12:41 2018 (r340154) @@ -928,7 +928,8 @@ be_activate(libbe_handle_t *lbh, const char *bootenv, { char be_path[BE_MAXPATHLEN]; char buf[BE_MAXPATHLEN]; - nvlist_t *config, *vdevs; + nvlist_t *config, *dsprops, *vdevs; + char *origin; uint64_t pool_guid; zfs_handle_t *zhp; int err; @@ -969,7 +970,18 @@ be_activate(libbe_handle_t *lbh, const char *bootenv, if (zhp == NULL) return (-1); - err = zfs_promote(zhp); + if (be_prop_list_alloc(&dsprops) != 0) + return (-1); + + if (be_get_dataset_props(lbh, be_path, dsprops) != 0) { + nvlist_free(dsprops); + return (-1); + } + + if (nvlist_lookup_string(dsprops, "origin", &origin) == 0) + err = zfs_promote(zhp); + nvlist_free(dsprops); + zfs_close(zhp); if (err) From owner-svn-src-stable-12@freebsd.org Mon Nov 5 21:28:34 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 40BDA110C3EE; Mon, 5 Nov 2018 21:28:34 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9D66073B94; Mon, 5 Nov 2018 21:28:33 +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 7A2441D0B2; Mon, 5 Nov 2018 21:28:33 +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 wA5LSXRd039847; Mon, 5 Nov 2018 21:28:33 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA5LSWo3039845; Mon, 5 Nov 2018 21:28:33 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201811052128.wA5LSWo3039845@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 5 Nov 2018 21:28:32 +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: r340161 - in stable/12: release/pkg_repos usr.sbin/pkg X-SVN-Group: stable-12 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in stable/12: release/pkg_repos usr.sbin/pkg X-SVN-Commit-Revision: 340161 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9D66073B94 X-Spamd-Result: default: False [-101.68 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.75)[-0.752,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-0.82)[-0.823,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2018 21:28:34 -0000 Author: gjb Date: Mon Nov 5 21:28:32 2018 New Revision: 340161 URL: https://svnweb.freebsd.org/changeset/base/340161 Log: Switch the dvd1.iso pkg(8) configuration to use the quarterly branch, now that the package sets are now available. This normally would have been after BETA1, however there were issues preventing package builds to succeed. Switch the default pkg(8) repository to the quarterly branch as well, to prevent 'pkg upgrade' from downgrading packages as the 12.0-RELEASE cycle progresses. These changes will be reverted after releng/12.0 is branched. This is a direct commit to stable/12. MFC after: 2 weeks MFC note: fake MFC timeframe as a reminder to revert Approved by: re (delphij) Sponsored by: The FreeBSD Foundation Modified: stable/12/release/pkg_repos/release-dvd.conf stable/12/usr.sbin/pkg/FreeBSD.conf Modified: stable/12/release/pkg_repos/release-dvd.conf ============================================================================== --- stable/12/release/pkg_repos/release-dvd.conf Mon Nov 5 21:01:45 2018 (r340160) +++ stable/12/release/pkg_repos/release-dvd.conf Mon Nov 5 21:28:32 2018 (r340161) @@ -1,6 +1,6 @@ # $FreeBSD$ release: { - url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest", + url: "pkg+http://pkg.FreeBSD.org/${ABI}/quarterly", mirror_type: "srv", signature_type: "fingerprints", fingerprints: "/usr/share/keys/pkg", Modified: stable/12/usr.sbin/pkg/FreeBSD.conf ============================================================================== --- stable/12/usr.sbin/pkg/FreeBSD.conf Mon Nov 5 21:01:45 2018 (r340160) +++ stable/12/usr.sbin/pkg/FreeBSD.conf Mon Nov 5 21:28:32 2018 (r340161) @@ -8,7 +8,7 @@ # FreeBSD: { - url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest", + url: "pkg+http://pkg.FreeBSD.org/${ABI}/quarterly", mirror_type: "srv", signature_type: "fingerprints", fingerprints: "/usr/share/keys/pkg", From owner-svn-src-stable-12@freebsd.org Tue Nov 6 17:31:10 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5A78112AD91; Tue, 6 Nov 2018 17:31:10 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2F89B81AF0; Tue, 6 Nov 2018 17:31:10 +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 11C1F1B88; Tue, 6 Nov 2018 17:31:10 +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 wA6HV98j065620; Tue, 6 Nov 2018 17:31:09 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA6HV9NE065619; Tue, 6 Nov 2018 17:31:09 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201811061731.wA6HV9NE065619@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 6 Nov 2018 17:31:09 +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: r340190 - stable/12/sys/dev/ichwd X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/sys/dev/ichwd X-SVN-Commit-Revision: 340190 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2F89B81AF0 X-Spamd-Result: default: False [-103.10 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-0.995,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-0.998,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2018 17:31:10 -0000 Author: avg Date: Tue Nov 6 17:31:09 2018 New Revision: 340190 URL: https://svnweb.freebsd.org/changeset/base/340190 Log: MFC r339591: ichwd: add support for TCO watchdog timer in Lewisburg PCH (C620) PR: 222079 Approved by: re (rgrimes) Relnotes: maybe Sponsored by: Panzura Modified: stable/12/sys/dev/ichwd/ichwd.c stable/12/sys/dev/ichwd/ichwd.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/ichwd/ichwd.c ============================================================================== --- stable/12/sys/dev/ichwd/ichwd.c Tue Nov 6 16:56:49 2018 (r340189) +++ stable/12/sys/dev/ichwd/ichwd.c Tue Nov 6 17:31:09 2018 (r340190) @@ -289,6 +289,11 @@ static struct ichwd_device ichwd_devices[] = { { 0, NULL, 0, 0 }, }; +static struct ichwd_device ichwd_smb_devices[] = { + { DEVICEID_LEWISBURG_SMB, "Lewisburg watchdog timer", 10, 4 }, + { 0, NULL, 0, 0 }, +}; + static devclass_t ichwd_devclass; #define ichwd_read_tco_1(sc, off) \ @@ -374,7 +379,8 @@ ichwd_sts_reset(struct ichwd_softc *sc) * be done in two separate operations. */ ichwd_write_tco_2(sc, TCO2_STS, TCO_SECOND_TO_STS); - ichwd_write_tco_2(sc, TCO2_STS, TCO_BOOT_STS); + if (sc->tco_version < 4) + ichwd_write_tco_2(sc, TCO2_STS, TCO_BOOT_STS); } /* @@ -488,6 +494,11 @@ ichwd_clear_noreboot(struct ichwd_softc *sc) if (status & ICH_PMC_NO_REBOOT) rc = EIO; break; + case 4: + /* + * TODO. This needs access to a hidden PCI device at 31:1. + */ + break; default: ichwd_verbose_printf(sc->device, "Unknown TCO Version: %d, can't set NO_REBOOT.\n", @@ -560,6 +571,36 @@ ichwd_find_ich_lpc_bridge(device_t isa, struct ichwd_d return (NULL); } +static device_t +ichwd_find_smb_dev(device_t isa, struct ichwd_device **id_p) +{ + struct ichwd_device *id; + device_t isab, smb; + uint16_t devid; + + /* + * Check if SMBus controller provides TCO configuration. + * The controller's device and function are fixed and we expect + * it to be on the same bus as ISA bridge. + */ + isab = device_get_parent(isa); + smb = pci_find_dbsf(pci_get_domain(isab), pci_get_bus(isab), 31, 4); + if (smb == NULL) + return (NULL); + if (pci_get_vendor(smb) != VENDORID_INTEL) + return (NULL); + devid = pci_get_device(smb); + for (id = ichwd_smb_devices; id->desc != NULL; ++id) { + if (devid == id->device) { + if (id_p != NULL) + *id_p = id; + return (smb); + } + } + + return (NULL); +} + /* * Look for an ICH LPC interface bridge. If one is found, register an * ichwd device. There can be only one. @@ -568,14 +609,18 @@ static void ichwd_identify(driver_t *driver, device_t parent) { struct ichwd_device *id_p; - device_t ich = NULL; + device_t ich, smb; device_t dev; uint32_t base_address; + uint32_t ctl; int rc; ich = ichwd_find_ich_lpc_bridge(parent, &id_p); - if (ich == NULL) - return; + if (ich == NULL) { + smb = ichwd_find_smb_dev(parent, &id_p); + if (smb == NULL) + return; + } /* good, add child to bus */ if ((dev = device_find_child(parent, driver->name, 0)) == NULL) @@ -609,6 +654,24 @@ ichwd_identify(driver_t *driver, device_t parent) "Can not set TCO v%d memory resource for PBASE\n", id_p->tco_version); break; + case 4: + /* Get TCO base address. */ + ctl = pci_read_config(smb, ICH_TCOCTL, 4); + if ((ctl & ICH_TCOCTL_TCO_BASE_EN) == 0) { + ichwd_verbose_printf(dev, + "TCO v%d decoding is not enabled\n", + id_p->tco_version); + break; + } + base_address = pci_read_config(smb, ICH_TCOBASE, 4); + rc = bus_set_resource(dev, SYS_RES_IOPORT, 0, + base_address & ICH_TCOBASE_ADDRMASK, ICH_TCOBASE_SIZE); + if (rc != 0) { + ichwd_verbose_printf(dev, + "Can not set TCO v%d I/O resource (err = %d)\n", + id_p->tco_version, rc); + } + break; default: ichwd_verbose_printf(dev, "Can not set unknown TCO v%d memory resource for unknown base address\n", @@ -626,7 +689,8 @@ ichwd_probe(device_t dev) if (isa_get_logicalid(dev) != 0) return (ENXIO); - if (ichwd_find_ich_lpc_bridge(device_get_parent(dev), &id_p) == NULL) + if (ichwd_find_ich_lpc_bridge(device_get_parent(dev), &id_p) == NULL && + ichwd_find_smb_dev(device_get_parent(dev), &id_p) == NULL) return (ENXIO); device_set_desc_copy(dev, id_p->desc); @@ -634,21 +698,71 @@ ichwd_probe(device_t dev) } static int -ichwd_attach(device_t dev) +ichwd_smb_attach(device_t dev) { struct ichwd_softc *sc; struct ichwd_device *id_p; + device_t isab, pmdev; + device_t smb; + uint32_t acpi_base; + + sc = device_get_softc(dev); + smb = ichwd_find_smb_dev(device_get_parent(dev), &id_p); + if (smb == NULL) + return (ENXIO); + + sc->ich_version = id_p->ich_version; + sc->tco_version = id_p->tco_version; + + /* Allocate TCO control I/O register space. */ + sc->tco_rid = 0; + sc->tco_res = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &sc->tco_rid, + RF_ACTIVE | RF_SHAREABLE); + if (sc->tco_res == NULL) { + device_printf(dev, "unable to reserve TCO registers\n"); + return (ENXIO); + } + + /* Get ACPI base address. */ + isab = device_get_parent(device_get_parent(dev)); + pmdev = pci_find_dbsf(pci_get_domain(isab), pci_get_bus(isab), 31, 2); + if (pmdev == NULL) { + device_printf(dev, "unable to find Power Management device\n"); + return (ENXIO); + } + acpi_base = pci_read_config(pmdev, ICH_PMBASE, 4) & 0xffffff00; + if (acpi_base == 0) { + device_printf(dev, "ACPI base address is not set\n"); + return (ENXIO); + } + + /* Allocate SMI control I/O register space. */ + sc->smi_rid = 1; + sc->smi_res = bus_alloc_resource(dev, SYS_RES_IOPORT, &sc->smi_rid, + acpi_base + SMI_BASE, acpi_base + SMI_BASE + SMI_LEN - 1, SMI_LEN, + RF_ACTIVE | RF_SHAREABLE); + if (sc->smi_res == NULL) { + device_printf(dev, "unable to reserve SMI registers\n"); + return (ENXIO); + } + + return (0); +} + +static int +ichwd_lpc_attach(device_t dev) +{ + struct ichwd_softc *sc; + struct ichwd_device *id_p; device_t ich; unsigned int pmbase = 0; sc = device_get_softc(dev); - sc->device = dev; ich = ichwd_find_ich_lpc_bridge(device_get_parent(dev), &id_p); - if (ich == NULL) { - device_printf(sc->device, "Can not find ICH device.\n"); - goto fail; - } + if (ich == NULL) + return (ENXIO); + sc->ich = ich; sc->ich_version = id_p->ich_version; sc->tco_version = id_p->tco_version; @@ -657,7 +771,7 @@ ichwd_attach(device_t dev) pmbase = pci_read_config(ich, ICH_PMBASE, 2) & ICH_PMBASE_MASK; if (pmbase == 0) { device_printf(dev, "ICH PMBASE register is empty\n"); - goto fail; + return (ENXIO); } /* allocate I/O register space */ @@ -667,7 +781,7 @@ ichwd_attach(device_t dev) RF_ACTIVE | RF_SHAREABLE); if (sc->smi_res == NULL) { device_printf(dev, "unable to reserve SMI registers\n"); - goto fail; + return (ENXIO); } sc->tco_rid = 1; @@ -676,7 +790,7 @@ ichwd_attach(device_t dev) RF_ACTIVE | RF_SHAREABLE); if (sc->tco_res == NULL) { device_printf(dev, "unable to reserve TCO registers\n"); - goto fail; + return (ENXIO); } sc->gcs_rid = 0; @@ -685,10 +799,24 @@ ichwd_attach(device_t dev) &sc->gcs_rid, RF_ACTIVE|RF_SHAREABLE); if (sc->gcs_res == NULL) { device_printf(dev, "unable to reserve GCS registers\n"); - goto fail; + return (ENXIO); } } + return (0); +} + +static int +ichwd_attach(device_t dev) +{ + struct ichwd_softc *sc; + + sc = device_get_softc(dev); + sc->device = dev; + + if (ichwd_lpc_attach(dev) != 0 && ichwd_smb_attach(dev) != 0) + goto fail; + if (ichwd_clear_noreboot(sc) != 0) goto fail; @@ -724,7 +852,7 @@ ichwd_attach(device_t dev) bus_release_resource(dev, SYS_RES_IOPORT, sc->smi_rid, sc->smi_res); if (sc->gcs_res != NULL) - bus_release_resource(ich, SYS_RES_MEMORY, + bus_release_resource(sc->ich, SYS_RES_MEMORY, sc->gcs_rid, sc->gcs_res); return (ENXIO); Modified: stable/12/sys/dev/ichwd/ichwd.h ============================================================================== --- stable/12/sys/dev/ichwd/ichwd.h Tue Nov 6 16:56:49 2018 (r340189) +++ stable/12/sys/dev/ichwd/ichwd.h Tue Nov 6 17:31:09 2018 (r340190) @@ -272,6 +272,7 @@ struct ichwd_softc { #define DEVICEID_WCPT_LP6 0x9cc6 #define DEVICEID_WCPT_LP7 0x9cc7 #define DEVICEID_WCPT_LP9 0x9cc9 +#define DEVICEID_LEWISBURG_SMB 0xa1a3 /* ICH LPC Interface Bridge Registers (ICH5 and older) */ #define ICH_GEN_STA 0xd4 @@ -290,6 +291,14 @@ struct ichwd_softc { #define ICH_PMC_OFFSET 0x08 #define ICH_PMC_SIZE 0x4 #define ICH_PMC_NO_REBOOT 0x10 + +/* Lewisburg configration registers in SMBus controller. */ +#define ICH_TCOBASE 0x50 /* TCO Base Addr */ +#define ICH_TCOBASE_ADDRMASK 0xffe0 +#define ICH_TCOBASE_SIZE 32 +#define ICH_TCOCTL 0x54 /* TCO Control */ +#define ICH_TCOCTL_TCO_BASE_EN 0x0100 /* TCO Base decoding enabled */ +#define ICH_TCOCTL_TCO_BASE_LOCK 0x0001 /* TCOBASE is locked */ /* register names and locations (relative to PMBASE) */ #define SMI_BASE 0x30 /* base address for SMI registers */ From owner-svn-src-stable-12@freebsd.org Tue Nov 6 20:46:02 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 296271130EAF; Tue, 6 Nov 2018 20:46:02 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A5BEB6D7A6; Tue, 6 Nov 2018 20:46:01 +0000 (UTC) (envelope-from shurd@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 87D8A40EE; Tue, 6 Nov 2018 20:46:01 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wA6Kk16T069100; Tue, 6 Nov 2018 20:46:01 GMT (envelope-from shurd@FreeBSD.org) Received: (from shurd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA6Kk1Lo069099; Tue, 6 Nov 2018 20:46:01 GMT (envelope-from shurd@FreeBSD.org) Message-Id: <201811062046.wA6Kk1Lo069099@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: shurd set sender to shurd@FreeBSD.org using -f From: Stephen Hurd Date: Tue, 6 Nov 2018 20:46: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: r340202 - in stable/12/sys: kern sys X-SVN-Group: stable-12 X-SVN-Commit-Author: shurd X-SVN-Commit-Paths: in stable/12/sys: kern sys X-SVN-Commit-Revision: 340202 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A5BEB6D7A6 X-Spamd-Result: default: False [-103.09 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-0.99)[-0.992,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-0.99)[-0.988,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2018 20:46:02 -0000 Author: shurd Date: Tue Nov 6 20:46:00 2018 New Revision: 340202 URL: https://svnweb.freebsd.org/changeset/base/340202 Log: MFC r339861: Drain grouptaskqueue of the gtask before detaching it. taskqgroup_detach() would remove the task even if it was running or enqueued, which could lead to panics (see D17404). With this change, taskqgroup_detach() drains the task and sets a new flag which prevents the task from being scheduled again. I've added grouptask_block() and grouptask_unblock() to allow control over the flag from other locations as well. Reviewed by: Jeffrey Pieper Approved by: re (kib) Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D17674 Modified: stable/12/sys/kern/subr_gtaskqueue.c stable/12/sys/sys/gtaskqueue.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/subr_gtaskqueue.c ============================================================================== --- stable/12/sys/kern/subr_gtaskqueue.c Tue Nov 6 20:45:15 2018 (r340201) +++ stable/12/sys/kern/subr_gtaskqueue.c Tue Nov 6 20:46:00 2018 (r340202) @@ -51,6 +51,8 @@ __FBSDID("$FreeBSD$"); static MALLOC_DEFINE(M_GTASKQUEUE, "gtaskqueue", "Group Task Queues"); static void gtaskqueue_thread_enqueue(void *); static void gtaskqueue_thread_loop(void *arg); +static int task_is_running(struct gtaskqueue *queue, struct gtask *gtask); +static void gtaskqueue_drain_locked(struct gtaskqueue *queue, struct gtask *gtask); TASKQGROUP_DEFINE(softirq, mp_ncpus, 1); TASKQGROUP_DEFINE(config, 1, 1); @@ -183,6 +185,44 @@ gtaskqueue_free(struct gtaskqueue *queue) free(queue, M_GTASKQUEUE); } +/* + * Wait for all to complete, then prevent it from being enqueued + */ +void +grouptask_block(struct grouptask *grouptask) +{ + struct gtaskqueue *queue = grouptask->gt_taskqueue; + struct gtask *gtask = &grouptask->gt_task; + +#ifdef INVARIANTS + if (queue == NULL) { + gtask_dump(gtask); + panic("queue == NULL"); + } +#endif + TQ_LOCK(queue); + gtask->ta_flags |= TASK_NOENQUEUE; + gtaskqueue_drain_locked(queue, gtask); + TQ_UNLOCK(queue); +} + +void +grouptask_unblock(struct grouptask *grouptask) +{ + struct gtaskqueue *queue = grouptask->gt_taskqueue; + struct gtask *gtask = &grouptask->gt_task; + +#ifdef INVARIANTS + if (queue == NULL) { + gtask_dump(gtask); + panic("queue == NULL"); + } +#endif + TQ_LOCK(queue); + gtask->ta_flags &= ~TASK_NOENQUEUE; + TQ_UNLOCK(queue); +} + int grouptaskqueue_enqueue(struct gtaskqueue *queue, struct gtask *gtask) { @@ -197,6 +237,10 @@ grouptaskqueue_enqueue(struct gtaskqueue *queue, struc TQ_UNLOCK(queue); return (0); } + if (gtask->ta_flags & TASK_NOENQUEUE) { + TQ_UNLOCK(queue); + return (EAGAIN); + } STAILQ_INSERT_TAIL(&queue->tq_queue, gtask, ta_link); gtask->ta_flags |= TASK_ENQUEUED; TQ_UNLOCK(queue); @@ -378,6 +422,13 @@ gtaskqueue_cancel(struct gtaskqueue *queue, struct gta return (error); } +static void +gtaskqueue_drain_locked(struct gtaskqueue *queue, struct gtask *gtask) +{ + while ((gtask->ta_flags & TASK_ENQUEUED) || task_is_running(queue, gtask)) + TQ_SLEEP(queue, gtask, &queue->tq_mutex, PWAIT, "-", 0); +} + void gtaskqueue_drain(struct gtaskqueue *queue, struct gtask *gtask) { @@ -386,8 +437,7 @@ gtaskqueue_drain(struct gtaskqueue *queue, struct gtas WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, __func__); TQ_LOCK(queue); - while ((gtask->ta_flags & TASK_ENQUEUED) || task_is_running(queue, gtask)) - TQ_SLEEP(queue, gtask, &queue->tq_mutex, PWAIT, "-", 0); + gtaskqueue_drain_locked(queue, gtask); TQ_UNLOCK(queue); } @@ -803,6 +853,7 @@ taskqgroup_detach(struct taskqgroup *qgroup, struct gr { int i; + grouptask_block(gtask); mtx_lock(&qgroup->tqg_lock); for (i = 0; i < qgroup->tqg_cnt; i++) if (qgroup->tqg_queue[i].tgc_taskq == gtask->gt_taskqueue) @@ -813,6 +864,7 @@ taskqgroup_detach(struct taskqgroup *qgroup, struct gr LIST_REMOVE(gtask, gt_list); mtx_unlock(&qgroup->tqg_lock); gtask->gt_taskqueue = NULL; + gtask->gt_task.ta_flags &= ~TASK_NOENQUEUE; } static void Modified: stable/12/sys/sys/gtaskqueue.h ============================================================================== --- stable/12/sys/sys/gtaskqueue.h Tue Nov 6 20:45:15 2018 (r340201) +++ stable/12/sys/sys/gtaskqueue.h Tue Nov 6 20:46:00 2018 (r340202) @@ -52,7 +52,9 @@ int gtaskqueue_cancel(struct gtaskqueue *queue, struct void gtaskqueue_drain(struct gtaskqueue *queue, struct gtask *task); void gtaskqueue_drain_all(struct gtaskqueue *queue); -int grouptaskqueue_enqueue(struct gtaskqueue *queue, struct gtask *task); +void grouptask_block(struct grouptask *grouptask); +void grouptask_unblock(struct grouptask *grouptask); +int grouptaskqueue_enqueue(struct gtaskqueue *queue, struct gtask *task); void taskqgroup_attach(struct taskqgroup *qgroup, struct grouptask *grptask, void *uniq, int irq, const char *name); int taskqgroup_attach_cpu(struct taskqgroup *qgroup, struct grouptask *grptask, @@ -67,6 +69,7 @@ void taskqgroup_config_gtask_deinit(struct grouptask * #define TASK_ENQUEUED 0x1 #define TASK_SKIP_WAKEUP 0x2 +#define TASK_NOENQUEUE 0x4 #define GTASK_INIT(task, flags, priority, func, context) do { \ From owner-svn-src-stable-12@freebsd.org Wed Nov 7 16:22:21 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EFE361129AB2; Wed, 7 Nov 2018 16:22:20 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7CC936F33E; Wed, 7 Nov 2018 16:22:20 +0000 (UTC) (envelope-from des@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 5F49418061; Wed, 7 Nov 2018 16:22:20 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wA7GMKTb081386; Wed, 7 Nov 2018 16:22:20 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA7GMIIb081379; Wed, 7 Nov 2018 16:22:18 GMT (envelope-from des@FreeBSD.org) Message-Id: <201811071622.wA7GMIIb081379@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Wed, 7 Nov 2018 16:22: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: r340219 - in stable/12: contrib/unbound contrib/unbound/util libexec/rc libexec/rc/rc.d X-SVN-Group: stable-12 X-SVN-Commit-Author: des X-SVN-Commit-Paths: in stable/12: contrib/unbound contrib/unbound/util libexec/rc libexec/rc/rc.d X-SVN-Commit-Revision: 340219 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7CC936F33E X-Spamd-Result: default: False [-106.84 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-1.000,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.73)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.90), asn: 11403(-3.75), country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Nov 2018 16:22:21 -0000 Author: des Date: Wed Nov 7 16:22:18 2018 New Revision: 340219 URL: https://svnweb.freebsd.org/changeset/base/340219 Log: MFH (r339812): add default value for local_unbound_tls MFH (r339995): run unbound-anchor if root.key is empty (PR 232555) MFH (r340037): turn off so-reuseport by default Approved by: re (gjb) Modified: stable/12/contrib/unbound/config.h stable/12/contrib/unbound/config.h.in stable/12/contrib/unbound/configure stable/12/contrib/unbound/configure.ac stable/12/contrib/unbound/util/config_file.c stable/12/libexec/rc/rc.conf stable/12/libexec/rc/rc.d/local_unbound Directory Properties: stable/12/ (props changed) Modified: stable/12/contrib/unbound/config.h ============================================================================== --- stable/12/contrib/unbound/config.h Wed Nov 7 15:04:41 2018 (r340218) +++ stable/12/contrib/unbound/config.h Wed Nov 7 16:22:18 2018 (r340219) @@ -664,6 +664,9 @@ /* Define as the return type of signal handlers (`int' or `void'). */ #define RETSIGTYPE void +/* if REUSEPORT is enabled by default */ +#define REUSEPORT_DEFAULT 0 + /* default rootkey location */ #define ROOT_ANCHOR_FILE "/var/unbound/root.key" Modified: stable/12/contrib/unbound/config.h.in ============================================================================== --- stable/12/contrib/unbound/config.h.in Wed Nov 7 15:04:41 2018 (r340218) +++ stable/12/contrib/unbound/config.h.in Wed Nov 7 16:22:18 2018 (r340219) @@ -663,6 +663,9 @@ /* Define as the return type of signal handlers (`int' or `void'). */ #undef RETSIGTYPE +/* if REUSEPORT is enabled by default */ +#undef REUSEPORT_DEFAULT + /* default rootkey location */ #undef ROOT_ANCHOR_FILE Modified: stable/12/contrib/unbound/configure ============================================================================== --- stable/12/contrib/unbound/configure Wed Nov 7 15:04:41 2018 (r340218) +++ stable/12/contrib/unbound/configure Wed Nov 7 16:22:18 2018 (r340219) @@ -15966,6 +15966,17 @@ fi done +# check if we can use SO_REUSEPORT +if echo "$host" | grep -i -e linux -e dragonfly >/dev/null; then + +$as_echo "#define REUSEPORT_DEFAULT 1" >>confdefs.h + +else + +$as_echo "#define REUSEPORT_DEFAULT 0" >>confdefs.h + +fi + # set memory allocation checking if requested # Check whether --enable-alloc-checks was given. if test "${enable_alloc_checks+set}" = set; then : Modified: stable/12/contrib/unbound/configure.ac ============================================================================== --- stable/12/contrib/unbound/configure.ac Wed Nov 7 15:04:41 2018 (r340218) +++ stable/12/contrib/unbound/configure.ac Wed Nov 7 16:22:18 2018 (r340219) @@ -461,6 +461,13 @@ ACX_CHECK_NONBLOCKING_BROKEN ACX_MKDIR_ONE_ARG AC_CHECK_FUNCS([strptime],[AC_CHECK_STRPTIME_WORKS],[AC_LIBOBJ([strptime])]) +# check if we can use SO_REUSEPORT +if echo "$host" | grep -i -e linux -e dragonfly >/dev/null; then + AC_DEFINE(REUSEPORT_DEFAULT, 1, [if REUSEPORT is enabled by default]) +else + AC_DEFINE(REUSEPORT_DEFAULT, 0, [if REUSEPORT is enabled by default]) +fi + # set memory allocation checking if requested AC_ARG_ENABLE(alloc-checks, AC_HELP_STRING([--enable-alloc-checks], [ enable to memory allocation statistics, for debug purposes ]), Modified: stable/12/contrib/unbound/util/config_file.c ============================================================================== --- stable/12/contrib/unbound/util/config_file.c Wed Nov 7 15:04:41 2018 (r340218) +++ stable/12/contrib/unbound/util/config_file.c Wed Nov 7 16:22:18 2018 (r340219) @@ -177,7 +177,7 @@ config_create(void) cfg->if_automatic = 0; cfg->so_rcvbuf = 0; cfg->so_sndbuf = 0; - cfg->so_reuseport = 1; + cfg->so_reuseport = REUSEPORT_DEFAULT; cfg->ip_transparent = 0; cfg->ip_freebind = 0; cfg->num_ifs = 0; Modified: stable/12/libexec/rc/rc.conf ============================================================================== --- stable/12/libexec/rc/rc.conf Wed Nov 7 15:04:41 2018 (r340218) +++ stable/12/libexec/rc/rc.conf Wed Nov 7 16:22:18 2018 (r340219) @@ -283,8 +283,9 @@ hastd_enable="NO" # Run the HAST daemon (YES/NO). hastd_program="/sbin/hastd" # path to hastd, if you want a different one. hastd_flags="" # Optional flags to hastd. ctld_enable="NO" # CAM Target Layer / iSCSI target daemon. -local_unbound_enable="NO" # local caching resolver -blacklistd_enable="NO" # Run blacklistd daemon (YES/NO). +local_unbound_enable="NO" # Local caching resolver +local_unbound_tls="NO" # Use DNS over TLS +blacklistd_enable="NO" # Run blacklistd daemon (YES/NO). blacklistd_flags="" # Optional flags for blacklistd(8). resolv_enable="YES" # Enable resolv / resolvconf Modified: stable/12/libexec/rc/rc.d/local_unbound ============================================================================== --- stable/12/libexec/rc/rc.d/local_unbound Wed Nov 7 15:04:41 2018 (r340218) +++ stable/12/libexec/rc/rc.d/local_unbound Wed Nov 7 16:22:18 2018 (r340219) @@ -92,7 +92,7 @@ local_unbound_prestart() fi # Retrieve DNSSEC root key - if [ ! -f ${local_unbound_anchor} ] ; then + if [ ! -s ${local_unbound_anchor} ] ; then run_rc_command anchor fi } From owner-svn-src-stable-12@freebsd.org Wed Nov 7 17:44:29 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73144112B448; Wed, 7 Nov 2018 17:44:29 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D86467241E; Wed, 7 Nov 2018 17:44:28 +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 B034E18D87; Wed, 7 Nov 2018 17:44:28 +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 wA7HiSLx022378; Wed, 7 Nov 2018 17:44:28 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA7HiRIa022373; Wed, 7 Nov 2018 17:44:27 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201811071744.wA7HiRIa022373@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 7 Nov 2018 17:44:27 +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: r340224 - in stable/12/sys: amd64/amd64 amd64/include conf x86/pci X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/12/sys: amd64/amd64 amd64/include conf x86/pci X-SVN-Commit-Revision: 340224 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D86467241E X-Spamd-Result: default: False [-106.84 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-0.999,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.73)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.91), asn: 11403(-3.76), country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Nov 2018 17:44:29 -0000 Author: kib Date: Wed Nov 7 17:44:27 2018 New Revision: 340224 URL: https://svnweb.freebsd.org/changeset/base/340224 Log: MFC r339979: Add pci_early function to detect Intel stolen memory. Approved by: re (rgrimes) Added: stable/12/sys/x86/pci/pci_early_quirks.c - copied unchanged from r339979, head/sys/x86/pci/pci_early_quirks.c stable/12/sys/x86/pci/pci_early_quirks.h - copied unchanged from r339979, head/sys/x86/pci/pci_early_quirks.h Modified: stable/12/sys/amd64/amd64/machdep.c stable/12/sys/amd64/include/md_var.h stable/12/sys/conf/files.amd64 Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/amd64/machdep.c ============================================================================== --- stable/12/sys/amd64/amd64/machdep.c Wed Nov 7 16:56:32 2018 (r340223) +++ stable/12/sys/amd64/amd64/machdep.c Wed Nov 7 17:44:27 2018 (r340224) @@ -317,6 +317,12 @@ cpu_startup(dummy) printf("avail memory = %ju (%ju MB)\n", ptoa((uintmax_t)vm_free_count()), ptoa((uintmax_t)vm_free_count()) / 1048576); +#ifdef DEV_PCI + if (bootverbose && intel_graphics_stolen_base != 0) + printf("intel stolen mem: base %#jx size %ju MB\n", + (uintmax_t)intel_graphics_stolen_base, + (uintmax_t)intel_graphics_stolen_size / 1024 / 1024); +#endif /* * Set up buffers, so they can be used to read disk labels. @@ -1786,6 +1792,11 @@ hammer_time(u_int64_t modulep, u_int64_t physfree) init_param2(physmem); /* now running on new page tables, configured,and u/iom is accessible */ + +#ifdef DEV_PCI + /* This call might adjust phys_avail[]. */ + pci_early_quirks(); +#endif if (late_console) cninit(); Modified: stable/12/sys/amd64/include/md_var.h ============================================================================== --- stable/12/sys/amd64/include/md_var.h Wed Nov 7 16:56:32 2018 (r340223) +++ stable/12/sys/amd64/include/md_var.h Wed Nov 7 17:44:27 2018 (r340224) @@ -42,6 +42,9 @@ extern int hw_ibrs_disable; extern int hw_ssb_disable; extern int nmi_flush_l1d_sw; +extern vm_paddr_t intel_graphics_stolen_base; +extern vm_paddr_t intel_graphics_stolen_size; + /* * The file "conf/ldscript.amd64" defines the symbol "kernphys". Its * value is the physical address at which the kernel is loaded. @@ -75,5 +78,6 @@ void setidt(int idx, alias_for_inthand_t *func, int ty void sse2_pagezero(void *addr); struct savefpu *get_pcb_user_save_td(struct thread *td); struct savefpu *get_pcb_user_save_pcb(struct pcb *pcb); +void pci_early_quirks(void); #endif /* !_MACHINE_MD_VAR_H_ */ Modified: stable/12/sys/conf/files.amd64 ============================================================================== --- stable/12/sys/conf/files.amd64 Wed Nov 7 16:56:32 2018 (r340223) +++ stable/12/sys/conf/files.amd64 Wed Nov 7 17:44:27 2018 (r340224) @@ -720,6 +720,7 @@ x86/isa/isa_dma.c standard x86/isa/nmi.c standard x86/isa/orm.c optional isa x86/pci/pci_bus.c optional pci +x86/pci/pci_early_quirks.c optional pci x86/pci/qpi.c optional pci x86/x86/autoconf.c standard x86/x86/bus_machdep.c standard Copied: stable/12/sys/x86/pci/pci_early_quirks.c (from r339979, head/sys/x86/pci/pci_early_quirks.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/x86/pci/pci_early_quirks.c Wed Nov 7 17:44:27 2018 (r340224, copy of r339979, head/sys/x86/pci/pci_early_quirks.c) @@ -0,0 +1,287 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018 Johannes Lundberg + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +/* XXX: enable this once the KPI is available */ +/* #include */ +#include +#include +#include +#include + +#include + +#define MiB(v) ((unsigned long)(v) << 20) + +struct pci_device_id { + uint32_t vendor; + uint32_t device; + const struct intel_stolen_ops *data; +}; + +/* + * These global variables are read by LinuxKPI. + * LinuxKPI provide this information to the i915 driver. + */ +vm_paddr_t intel_graphics_stolen_base = 0; +vm_paddr_t intel_graphics_stolen_size = 0; + +/* + * Intel early quirks functions + */ +static vm_paddr_t +intel_stolen_base_gen3(int bus, int slot, int func) +{ + uint32_t ctrl; + vm_paddr_t val; + + ctrl = pci_cfgregread(bus, slot, func, INTEL_BSM, 4); + val = ctrl & INTEL_BSM_MASK; + return (val); +} + +static vm_paddr_t +intel_stolen_size_gen3(int bus, int slot, int func) +{ + uint32_t ctrl; + vm_paddr_t val; + + ctrl = pci_cfgregread(0, 0, 0, I830_GMCH_CTRL, 2); + val = ctrl & I855_GMCH_GMS_MASK; + + switch (val) { + case I855_GMCH_GMS_STOLEN_1M: + return (MiB(1)); + case I855_GMCH_GMS_STOLEN_4M: + return (MiB(4)); + case I855_GMCH_GMS_STOLEN_8M: + return (MiB(8)); + case I855_GMCH_GMS_STOLEN_16M: + return (MiB(16)); + case I855_GMCH_GMS_STOLEN_32M: + return (MiB(32)); + case I915_GMCH_GMS_STOLEN_48M: + return (MiB(48)); + case I915_GMCH_GMS_STOLEN_64M: + return (MiB(64)); + case G33_GMCH_GMS_STOLEN_128M: + return (MiB(128)); + case G33_GMCH_GMS_STOLEN_256M: + return (MiB(256)); + case INTEL_GMCH_GMS_STOLEN_96M: + return (MiB(96)); + case INTEL_GMCH_GMS_STOLEN_160M: + return (MiB(160)); + case INTEL_GMCH_GMS_STOLEN_224M: + return (MiB(224)); + case INTEL_GMCH_GMS_STOLEN_352M: + return (MiB(352)); + } + return (0); +} + +static vm_paddr_t +intel_stolen_size_gen6(int bus, int slot, int func) +{ + uint32_t ctrl; + vm_paddr_t val; + + ctrl = pci_cfgregread(bus, slot, func, SNB_GMCH_CTRL, 2); + val = (ctrl >> SNB_GMCH_GMS_SHIFT) & SNB_GMCH_GMS_MASK; + return (val * MiB(32)); +} + +static vm_paddr_t +intel_stolen_size_gen8(int bus, int slot, int func) +{ + uint32_t ctrl; + vm_paddr_t val; + + ctrl = pci_cfgregread(bus, slot, func, SNB_GMCH_CTRL, 2); + val = (ctrl >> BDW_GMCH_GMS_SHIFT) & BDW_GMCH_GMS_MASK; + return (val * MiB(32)); +} + +static vm_paddr_t +intel_stolen_size_chv(int bus, int slot, int func) +{ + uint32_t ctrl; + vm_paddr_t val; + + ctrl = pci_cfgregread(bus, slot, func, SNB_GMCH_CTRL, 2); + val = (ctrl >> SNB_GMCH_GMS_SHIFT) & SNB_GMCH_GMS_MASK; + + /* + * 0x0 to 0x10: 32MB increments starting at 0MB + * 0x11 to 0x16: 4MB increments starting at 8MB + * 0x17 to 0x1d: 4MB increments start at 36MB + */ + if (val < 0x11) + return (val * MiB(32)); + else if (val < 0x17) + return ((val - 0x11) * MiB(4) + MiB(8)); + else + return ((val - 0x17) * MiB(4) + MiB(36)); +} + +static vm_paddr_t +intel_stolen_size_gen9(int bus, int slot, int func) +{ + uint32_t ctrl; + vm_paddr_t val; + + ctrl = pci_cfgregread(bus, slot, func, SNB_GMCH_CTRL, 2); + val = (ctrl >> BDW_GMCH_GMS_SHIFT) & BDW_GMCH_GMS_MASK; + + /* 0x0 to 0xEF: 32MB increments starting at 0MB */ + /* 0xF0 to 0xFE: 4MB increments starting at 4MB */ + if (val < 0xF0) + return (val * MiB(32)); + return ((val - 0xF0) * MiB(4) + MiB(4)); +} + +struct intel_stolen_ops { + vm_paddr_t (*base)(int bus, int slot, int func); + vm_paddr_t (*size)(int bus, int slot, int func); +}; + +static const struct intel_stolen_ops intel_stolen_ops_gen3 = { + .base = intel_stolen_base_gen3, + .size = intel_stolen_size_gen3, +}; + +static const struct intel_stolen_ops intel_stolen_ops_gen6 = { + .base = intel_stolen_base_gen3, + .size = intel_stolen_size_gen6, +}; + +static const struct intel_stolen_ops intel_stolen_ops_gen8 = { + .base = intel_stolen_base_gen3, + .size = intel_stolen_size_gen8, +}; + +static const struct intel_stolen_ops intel_stolen_ops_gen9 = { + .base = intel_stolen_base_gen3, + .size = intel_stolen_size_gen9, +}; + +static const struct intel_stolen_ops intel_stolen_ops_chv = { + .base = intel_stolen_base_gen3, + .size = intel_stolen_size_chv, +}; + +static const struct pci_device_id intel_ids[] = { + INTEL_I915G_IDS(&intel_stolen_ops_gen3), + INTEL_I915GM_IDS(&intel_stolen_ops_gen3), + INTEL_I945G_IDS(&intel_stolen_ops_gen3), + INTEL_I945GM_IDS(&intel_stolen_ops_gen3), + INTEL_VLV_IDS(&intel_stolen_ops_gen6), + INTEL_PINEVIEW_IDS(&intel_stolen_ops_gen3), + INTEL_I965G_IDS(&intel_stolen_ops_gen3), + INTEL_G33_IDS(&intel_stolen_ops_gen3), + INTEL_I965GM_IDS(&intel_stolen_ops_gen3), + INTEL_GM45_IDS(&intel_stolen_ops_gen3), + INTEL_G45_IDS(&intel_stolen_ops_gen3), + INTEL_IRONLAKE_D_IDS(&intel_stolen_ops_gen3), + INTEL_IRONLAKE_M_IDS(&intel_stolen_ops_gen3), + INTEL_SNB_D_IDS(&intel_stolen_ops_gen6), + INTEL_SNB_M_IDS(&intel_stolen_ops_gen6), + INTEL_IVB_M_IDS(&intel_stolen_ops_gen6), + INTEL_IVB_D_IDS(&intel_stolen_ops_gen6), + INTEL_HSW_IDS(&intel_stolen_ops_gen6), + INTEL_BDW_IDS(&intel_stolen_ops_gen8), + INTEL_CHV_IDS(&intel_stolen_ops_chv), + INTEL_SKL_IDS(&intel_stolen_ops_gen9), + INTEL_BXT_IDS(&intel_stolen_ops_gen9), + INTEL_KBL_IDS(&intel_stolen_ops_gen9), + INTEL_CFL_IDS(&intel_stolen_ops_gen9), + INTEL_GLK_IDS(&intel_stolen_ops_gen9), + INTEL_CNL_IDS(&intel_stolen_ops_gen9), +}; + +/* + * Buggy BIOS don't reserve memory for the GPU properly and the OS + * can claim it before the GPU driver is loaded. This function will + * check the registers for base and size of this memory and reserve + * it for the GPU driver. + * gen3 (2004) and newer devices are supported. Support for older hw + * can be ported from Linux if needed. + */ +static void +intel_graphics_stolen(void) +{ + const struct intel_stolen_ops *ops; + uint32_t vendor, device, class; + int i; + + /* XXX: Scan bus instead of assuming 0:2:0? */ + const int bus = 0; + const int slot = 2; + const int func = 0; + + if (pci_cfgregopen() == 0) + return; + + vendor = pci_cfgregread(bus, slot, func, PCIR_VENDOR, 2); + if (vendor != PCI_VENDOR_INTEL) + return; + + class = pci_cfgregread(bus, slot, func, PCIR_SUBCLASS, 2); + if (class != PCI_CLASS_VGA) + return; + + device = pci_cfgregread(bus, slot, func, PCIR_DEVICE, 2); + if (device == 0xFFFF) + return; + + for (i = 0; i < nitems(intel_ids); i++) { + if (intel_ids[i].device != device) + continue; + ops = intel_ids[i].data; + intel_graphics_stolen_base = ops->base(bus, slot, func); + intel_graphics_stolen_size = ops->size(bus, slot, func); + break; + } + + /* XXX: enable this once the KPI is available */ + /* phys_avail_reserve(intel_graphics_stolen_base, */ + /* intel_graphics_stolen_base + intel_graphics_stolen_size); */ +} + +void +pci_early_quirks(void) +{ + + intel_graphics_stolen(); +} Copied: stable/12/sys/x86/pci/pci_early_quirks.h (from r339979, head/sys/x86/pci/pci_early_quirks.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/x86/pci/pci_early_quirks.h Wed Nov 7 17:44:27 2018 (r340224, copy of r339979, head/sys/x86/pci/pci_early_quirks.h) @@ -0,0 +1,479 @@ +/*- + * Copyright (c) 2018 Johannes Lundberg + * + * 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 _PCI_EARLY_QUIRKS_H_ +#define _PCI_EARLY_QUIRKS_H_ + +/* + * TODO: + * Make a common drm/gpu header that both base and out of tree + * drm modules can use. + */ + +#define PCI_ANY_ID (-1) +#define PCI_VENDOR_INTEL 0x8086 +#define PCI_CLASS_VGA 0x0300 + +#define INTEL_BSM 0x5c +#define INTEL_BSM_MASK (-(1u << 20)) + +#define INTEL_GMCH_CTRL 0x52 +#define INTEL_GMCH_VGA_DISABLE (1 << 1) +#define SNB_GMCH_CTRL 0x50 +#define SNB_GMCH_GGMS_SHIFT 8 /* GTT Graphics Memory Size */ +#define SNB_GMCH_GGMS_MASK 0x3 +#define SNB_GMCH_GMS_SHIFT 3 /* Graphics Mode Select */ +#define SNB_GMCH_GMS_MASK 0x1f +#define BDW_GMCH_GGMS_SHIFT 6 +#define BDW_GMCH_GGMS_MASK 0x3 +#define BDW_GMCH_GMS_SHIFT 8 +#define BDW_GMCH_GMS_MASK 0xff + +#define I830_GMCH_CTRL 0x52 +#define I830_GMCH_GMS_MASK 0x70 +#define I830_GMCH_GMS_LOCAL 0x10 +#define I830_GMCH_GMS_STOLEN_512 0x20 +#define I830_GMCH_GMS_STOLEN_1024 0x30 +#define I830_GMCH_GMS_STOLEN_8192 0x40 + +#define I855_GMCH_GMS_MASK 0xF0 +#define I855_GMCH_GMS_STOLEN_0M 0x0 +#define I855_GMCH_GMS_STOLEN_1M (0x1 << 4) +#define I855_GMCH_GMS_STOLEN_4M (0x2 << 4) +#define I855_GMCH_GMS_STOLEN_8M (0x3 << 4) +#define I855_GMCH_GMS_STOLEN_16M (0x4 << 4) +#define I855_GMCH_GMS_STOLEN_32M (0x5 << 4) +#define I915_GMCH_GMS_STOLEN_48M (0x6 << 4) +#define I915_GMCH_GMS_STOLEN_64M (0x7 << 4) +#define G33_GMCH_GMS_STOLEN_128M (0x8 << 4) +#define G33_GMCH_GMS_STOLEN_256M (0x9 << 4) +#define INTEL_GMCH_GMS_STOLEN_96M (0xa << 4) +#define INTEL_GMCH_GMS_STOLEN_160M (0xb << 4) +#define INTEL_GMCH_GMS_STOLEN_224M (0xc << 4) +#define INTEL_GMCH_GMS_STOLEN_352M (0xd << 4) + +#define INTEL_VGA_DEVICE(id, info) { \ + 0x8086, id, \ + info } + +#define INTEL_I810_IDS(info) \ + INTEL_VGA_DEVICE(0x7121, info), /* I810 */ \ + INTEL_VGA_DEVICE(0x7123, info), /* I810_DC100 */ \ + INTEL_VGA_DEVICE(0x7125, info) /* I810_E */ + +#define INTEL_I815_IDS(info) \ + INTEL_VGA_DEVICE(0x1132, info) /* I815*/ + +#define INTEL_I830_IDS(info) \ + INTEL_VGA_DEVICE(0x3577, info) + +#define INTEL_I845G_IDS(info) \ + INTEL_VGA_DEVICE(0x2562, info) + +#define INTEL_I85X_IDS(info) \ + INTEL_VGA_DEVICE(0x3582, info), /* I855_GM */ \ + INTEL_VGA_DEVICE(0x358e, info) + +#define INTEL_I865G_IDS(info) \ + INTEL_VGA_DEVICE(0x2572, info) /* I865_G */ + +#define INTEL_I915G_IDS(info) \ + INTEL_VGA_DEVICE(0x2582, info), /* I915_G */ \ + INTEL_VGA_DEVICE(0x258a, info) /* E7221_G */ + +#define INTEL_I915GM_IDS(info) \ + INTEL_VGA_DEVICE(0x2592, info) /* I915_GM */ + +#define INTEL_I945G_IDS(info) \ + INTEL_VGA_DEVICE(0x2772, info) /* I945_G */ + +#define INTEL_I945GM_IDS(info) \ + INTEL_VGA_DEVICE(0x27a2, info), /* I945_GM */ \ + INTEL_VGA_DEVICE(0x27ae, info) /* I945_GME */ + +#define INTEL_I965G_IDS(info) \ + INTEL_VGA_DEVICE(0x2972, info), /* I946_GZ */ \ + INTEL_VGA_DEVICE(0x2982, info), /* G35_G */ \ + INTEL_VGA_DEVICE(0x2992, info), /* I965_Q */ \ + INTEL_VGA_DEVICE(0x29a2, info) /* I965_G */ + +#define INTEL_G33_IDS(info) \ + INTEL_VGA_DEVICE(0x29b2, info), /* Q35_G */ \ + INTEL_VGA_DEVICE(0x29c2, info), /* G33_G */ \ + INTEL_VGA_DEVICE(0x29d2, info) /* Q33_G */ + +#define INTEL_I965GM_IDS(info) \ + INTEL_VGA_DEVICE(0x2a02, info), /* I965_GM */ \ + INTEL_VGA_DEVICE(0x2a12, info) /* I965_GME */ + +#define INTEL_GM45_IDS(info) \ + INTEL_VGA_DEVICE(0x2a42, info) /* GM45_G */ + +#define INTEL_G45_IDS(info) \ + INTEL_VGA_DEVICE(0x2e02, info), /* IGD_E_G */ \ + INTEL_VGA_DEVICE(0x2e12, info), /* Q45_G */ \ + INTEL_VGA_DEVICE(0x2e22, info), /* G45_G */ \ + INTEL_VGA_DEVICE(0x2e32, info), /* G41_G */ \ + INTEL_VGA_DEVICE(0x2e42, info), /* B43_G */ \ + INTEL_VGA_DEVICE(0x2e92, info) /* B43_G.1 */ + +#define INTEL_PINEVIEW_IDS(info) \ + INTEL_VGA_DEVICE(0xa001, info), \ + INTEL_VGA_DEVICE(0xa011, info) + +#define INTEL_IRONLAKE_D_IDS(info) \ + INTEL_VGA_DEVICE(0x0042, info) + +#define INTEL_IRONLAKE_M_IDS(info) \ + INTEL_VGA_DEVICE(0x0046, info) + +#define INTEL_SNB_D_GT1_IDS(info) \ + INTEL_VGA_DEVICE(0x0102, info), \ + INTEL_VGA_DEVICE(0x010A, info) + +#define INTEL_SNB_D_GT2_IDS(info) \ + INTEL_VGA_DEVICE(0x0112, info), \ + INTEL_VGA_DEVICE(0x0122, info) + +#define INTEL_SNB_D_IDS(info) \ + INTEL_SNB_D_GT1_IDS(info), \ + INTEL_SNB_D_GT2_IDS(info) + +#define INTEL_SNB_M_GT1_IDS(info) \ + INTEL_VGA_DEVICE(0x0106, info) + +#define INTEL_SNB_M_GT2_IDS(info) \ + INTEL_VGA_DEVICE(0x0116, info), \ + INTEL_VGA_DEVICE(0x0126, info) + +#define INTEL_SNB_M_IDS(info) \ + INTEL_SNB_M_GT1_IDS(info), \ + INTEL_SNB_M_GT2_IDS(info) + +#define INTEL_IVB_M_GT1_IDS(info) \ + INTEL_VGA_DEVICE(0x0156, info) /* GT1 mobile */ + +#define INTEL_IVB_M_GT2_IDS(info) \ + INTEL_VGA_DEVICE(0x0166, info) /* GT2 mobile */ + +#define INTEL_IVB_M_IDS(info) \ + INTEL_IVB_M_GT1_IDS(info), \ + INTEL_IVB_M_GT2_IDS(info) + +#define INTEL_IVB_D_GT1_IDS(info) \ + INTEL_VGA_DEVICE(0x0152, info), /* GT1 desktop */ \ + INTEL_VGA_DEVICE(0x015a, info) /* GT1 server */ + +#define INTEL_IVB_D_GT2_IDS(info) \ + INTEL_VGA_DEVICE(0x0162, info), /* GT2 desktop */ \ + INTEL_VGA_DEVICE(0x016a, info) /* GT2 server */ + +#define INTEL_IVB_D_IDS(info) \ + INTEL_IVB_D_GT1_IDS(info), \ + INTEL_IVB_D_GT2_IDS(info) + +#define INTEL_IVB_Q_IDS(info) \ + INTEL_QUANTA_VGA_DEVICE(info) /* Quanta transcode */ + +#define INTEL_HSW_GT1_IDS(info) \ + INTEL_VGA_DEVICE(0x0402, info), /* GT1 desktop */ \ + INTEL_VGA_DEVICE(0x040a, info), /* GT1 server */ \ + INTEL_VGA_DEVICE(0x040B, info), /* GT1 reserved */ \ + INTEL_VGA_DEVICE(0x040E, info), /* GT1 reserved */ \ + INTEL_VGA_DEVICE(0x0C02, info), /* SDV GT1 desktop */ \ + INTEL_VGA_DEVICE(0x0C0A, info), /* SDV GT1 server */ \ + INTEL_VGA_DEVICE(0x0C0B, info), /* SDV GT1 reserved */ \ + INTEL_VGA_DEVICE(0x0C0E, info), /* SDV GT1 reserved */ \ + INTEL_VGA_DEVICE(0x0A02, info), /* ULT GT1 desktop */ \ + INTEL_VGA_DEVICE(0x0A0A, info), /* ULT GT1 server */ \ + INTEL_VGA_DEVICE(0x0A0B, info), /* ULT GT1 reserved */ \ + INTEL_VGA_DEVICE(0x0D02, info), /* CRW GT1 desktop */ \ + INTEL_VGA_DEVICE(0x0D0A, info), /* CRW GT1 server */ \ + INTEL_VGA_DEVICE(0x0D0B, info), /* CRW GT1 reserved */ \ + INTEL_VGA_DEVICE(0x0D0E, info), /* CRW GT1 reserved */ \ + INTEL_VGA_DEVICE(0x0406, info), /* GT1 mobile */ \ + INTEL_VGA_DEVICE(0x0C06, info), /* SDV GT1 mobile */ \ + INTEL_VGA_DEVICE(0x0A06, info), /* ULT GT1 mobile */ \ + INTEL_VGA_DEVICE(0x0A0E, info), /* ULX GT1 mobile */ \ + INTEL_VGA_DEVICE(0x0D06, info) /* CRW GT1 mobile */ + +#define INTEL_HSW_GT2_IDS(info) \ + INTEL_VGA_DEVICE(0x0412, info), /* GT2 desktop */ \ + INTEL_VGA_DEVICE(0x041a, info), /* GT2 server */ \ + INTEL_VGA_DEVICE(0x041B, info), /* GT2 reserved */ \ + INTEL_VGA_DEVICE(0x041E, info), /* GT2 reserved */ \ + INTEL_VGA_DEVICE(0x0C12, info), /* SDV GT2 desktop */ \ + INTEL_VGA_DEVICE(0x0C1A, info), /* SDV GT2 server */ \ + INTEL_VGA_DEVICE(0x0C1B, info), /* SDV GT2 reserved */ \ + INTEL_VGA_DEVICE(0x0C1E, info), /* SDV GT2 reserved */ \ + INTEL_VGA_DEVICE(0x0A12, info), /* ULT GT2 desktop */ \ + INTEL_VGA_DEVICE(0x0A1A, info), /* ULT GT2 server */ \ + INTEL_VGA_DEVICE(0x0A1B, info), /* ULT GT2 reserved */ \ + INTEL_VGA_DEVICE(0x0D12, info), /* CRW GT2 desktop */ \ + INTEL_VGA_DEVICE(0x0D1A, info), /* CRW GT2 server */ \ + INTEL_VGA_DEVICE(0x0D1B, info), /* CRW GT2 reserved */ \ + INTEL_VGA_DEVICE(0x0D1E, info), /* CRW GT2 reserved */ \ + INTEL_VGA_DEVICE(0x0416, info), /* GT2 mobile */ \ + INTEL_VGA_DEVICE(0x0426, info), /* GT2 mobile */ \ + INTEL_VGA_DEVICE(0x0C16, info), /* SDV GT2 mobile */ \ + INTEL_VGA_DEVICE(0x0A16, info), /* ULT GT2 mobile */ \ + INTEL_VGA_DEVICE(0x0A1E, info), /* ULX GT2 mobile */ \ + INTEL_VGA_DEVICE(0x0D16, info) /* CRW GT2 mobile */ + +#define INTEL_HSW_GT3_IDS(info) \ + INTEL_VGA_DEVICE(0x0422, info), /* GT3 desktop */ \ + INTEL_VGA_DEVICE(0x042a, info), /* GT3 server */ \ + INTEL_VGA_DEVICE(0x042B, info), /* GT3 reserved */ \ + INTEL_VGA_DEVICE(0x042E, info), /* GT3 reserved */ \ + INTEL_VGA_DEVICE(0x0C22, info), /* SDV GT3 desktop */ \ + INTEL_VGA_DEVICE(0x0C2A, info), /* SDV GT3 server */ \ + INTEL_VGA_DEVICE(0x0C2B, info), /* SDV GT3 reserved */ \ + INTEL_VGA_DEVICE(0x0C2E, info), /* SDV GT3 reserved */ \ + INTEL_VGA_DEVICE(0x0A22, info), /* ULT GT3 desktop */ \ + INTEL_VGA_DEVICE(0x0A2A, info), /* ULT GT3 server */ \ + INTEL_VGA_DEVICE(0x0A2B, info), /* ULT GT3 reserved */ \ + INTEL_VGA_DEVICE(0x0D22, info), /* CRW GT3 desktop */ \ + INTEL_VGA_DEVICE(0x0D2A, info), /* CRW GT3 server */ \ + INTEL_VGA_DEVICE(0x0D2B, info), /* CRW GT3 reserved */ \ + INTEL_VGA_DEVICE(0x0D2E, info), /* CRW GT3 reserved */ \ + INTEL_VGA_DEVICE(0x0C26, info), /* SDV GT3 mobile */ \ + INTEL_VGA_DEVICE(0x0A26, info), /* ULT GT3 mobile */ \ + INTEL_VGA_DEVICE(0x0A2E, info), /* ULT GT3 reserved */ \ + INTEL_VGA_DEVICE(0x0D26, info) /* CRW GT3 mobile */ + +#define INTEL_HSW_IDS(info) \ + INTEL_HSW_GT1_IDS(info), \ + INTEL_HSW_GT2_IDS(info), \ + INTEL_HSW_GT3_IDS(info) + +#define INTEL_VLV_IDS(info) \ + INTEL_VGA_DEVICE(0x0f30, info), \ + INTEL_VGA_DEVICE(0x0f31, info), \ + INTEL_VGA_DEVICE(0x0f32, info), \ + INTEL_VGA_DEVICE(0x0f33, info), \ + INTEL_VGA_DEVICE(0x0157, info), \ + INTEL_VGA_DEVICE(0x0155, info) + +#define INTEL_BDW_GT1_IDS(info) \ + INTEL_VGA_DEVICE(0x1602, info), /* GT1 ULT */ \ + INTEL_VGA_DEVICE(0x1606, info), /* GT1 ULT */ \ + INTEL_VGA_DEVICE(0x160B, info), /* GT1 Iris */ \ + INTEL_VGA_DEVICE(0x160E, info), /* GT1 ULX */ \ + INTEL_VGA_DEVICE(0x160A, info), /* GT1 Server */ \ + INTEL_VGA_DEVICE(0x160D, info) /* GT1 Workstation */ + +#define INTEL_BDW_GT2_IDS(info) \ + INTEL_VGA_DEVICE(0x1612, info), /* GT2 Halo */ \ + INTEL_VGA_DEVICE(0x1616, info), /* GT2 ULT */ \ + INTEL_VGA_DEVICE(0x161B, info), /* GT2 ULT */ \ + INTEL_VGA_DEVICE(0x161E, info), /* GT2 ULX */ \ + INTEL_VGA_DEVICE(0x161A, info), /* GT2 Server */ \ + INTEL_VGA_DEVICE(0x161D, info) /* GT2 Workstation */ + +#define INTEL_BDW_GT3_IDS(info) \ + INTEL_VGA_DEVICE(0x1622, info), /* ULT */ \ + INTEL_VGA_DEVICE(0x1626, info), /* ULT */ \ + INTEL_VGA_DEVICE(0x162B, info), /* Iris */ \ + INTEL_VGA_DEVICE(0x162E, info), /* ULX */\ + INTEL_VGA_DEVICE(0x162A, info), /* Server */ \ + INTEL_VGA_DEVICE(0x162D, info) /* Workstation */ + +#define INTEL_BDW_RSVD_IDS(info) \ + INTEL_VGA_DEVICE(0x1632, info), /* ULT */ \ + INTEL_VGA_DEVICE(0x1636, info), /* ULT */ \ + INTEL_VGA_DEVICE(0x163B, info), /* Iris */ \ + INTEL_VGA_DEVICE(0x163E, info), /* ULX */ \ + INTEL_VGA_DEVICE(0x163A, info), /* Server */ \ + INTEL_VGA_DEVICE(0x163D, info) /* Workstation */ + +#define INTEL_BDW_IDS(info) \ + INTEL_BDW_GT1_IDS(info), \ + INTEL_BDW_GT2_IDS(info), \ + INTEL_BDW_GT3_IDS(info), \ + INTEL_BDW_RSVD_IDS(info) + +#define INTEL_CHV_IDS(info) \ + INTEL_VGA_DEVICE(0x22b0, info), \ + INTEL_VGA_DEVICE(0x22b1, info), \ + INTEL_VGA_DEVICE(0x22b2, info), \ + INTEL_VGA_DEVICE(0x22b3, info) + +#define INTEL_SKL_GT1_IDS(info) \ + INTEL_VGA_DEVICE(0x1906, info), /* ULT GT1 */ \ + INTEL_VGA_DEVICE(0x190E, info), /* ULX GT1 */ \ + INTEL_VGA_DEVICE(0x1902, info), /* DT GT1 */ \ + INTEL_VGA_DEVICE(0x190B, info), /* Halo GT1 */ \ + INTEL_VGA_DEVICE(0x190A, info) /* SRV GT1 */ + +#define INTEL_SKL_GT2_IDS(info) \ + INTEL_VGA_DEVICE(0x1916, info), /* ULT GT2 */ \ + INTEL_VGA_DEVICE(0x1921, info), /* ULT GT2F */ \ + INTEL_VGA_DEVICE(0x191E, info), /* ULX GT2 */ \ + INTEL_VGA_DEVICE(0x1912, info), /* DT GT2 */ \ + INTEL_VGA_DEVICE(0x191B, info), /* Halo GT2 */ \ + INTEL_VGA_DEVICE(0x191A, info), /* SRV GT2 */ \ + INTEL_VGA_DEVICE(0x191D, info) /* WKS GT2 */ + +#define INTEL_SKL_GT3_IDS(info) \ + INTEL_VGA_DEVICE(0x1923, info), /* ULT GT3 */ \ + INTEL_VGA_DEVICE(0x1926, info), /* ULT GT3 */ \ + INTEL_VGA_DEVICE(0x1927, info), /* ULT GT3 */ \ + INTEL_VGA_DEVICE(0x192B, info), /* Halo GT3 */ \ + INTEL_VGA_DEVICE(0x192D, info) /* SRV GT3 */ + +#define INTEL_SKL_GT4_IDS(info) \ + INTEL_VGA_DEVICE(0x1932, info), /* DT GT4 */ \ + INTEL_VGA_DEVICE(0x193B, info), /* Halo GT4 */ \ + INTEL_VGA_DEVICE(0x193D, info), /* WKS GT4 */ \ + INTEL_VGA_DEVICE(0x192A, info), /* SRV GT4 */ \ + INTEL_VGA_DEVICE(0x193A, info) /* SRV GT4e */ + +#define INTEL_SKL_IDS(info) \ + INTEL_SKL_GT1_IDS(info), \ + INTEL_SKL_GT2_IDS(info), \ + INTEL_SKL_GT3_IDS(info), \ + INTEL_SKL_GT4_IDS(info) + +#define INTEL_BXT_IDS(info) \ + INTEL_VGA_DEVICE(0x0A84, info), \ + INTEL_VGA_DEVICE(0x1A84, info), \ + INTEL_VGA_DEVICE(0x1A85, info), \ + INTEL_VGA_DEVICE(0x5A84, info), /* APL HD Graphics 505 */ \ + INTEL_VGA_DEVICE(0x5A85, info) /* APL HD Graphics 500 */ + +#define INTEL_GLK_IDS(info) \ + INTEL_VGA_DEVICE(0x3184, info), \ + INTEL_VGA_DEVICE(0x3185, info) + +#define INTEL_KBL_GT1_IDS(info) \ + INTEL_VGA_DEVICE(0x5913, info), /* ULT GT1.5 */ \ + INTEL_VGA_DEVICE(0x5915, info), /* ULX GT1.5 */ \ + INTEL_VGA_DEVICE(0x5906, info), /* ULT GT1 */ \ + INTEL_VGA_DEVICE(0x590E, info), /* ULX GT1 */ \ + INTEL_VGA_DEVICE(0x5902, info), /* DT GT1 */ \ + INTEL_VGA_DEVICE(0x5908, info), /* Halo GT1 */ \ + INTEL_VGA_DEVICE(0x590B, info), /* Halo GT1 */ \ + INTEL_VGA_DEVICE(0x590A, info) /* SRV GT1 */ + +#define INTEL_KBL_GT2_IDS(info) \ + INTEL_VGA_DEVICE(0x5916, info), /* ULT GT2 */ \ + INTEL_VGA_DEVICE(0x5917, info), /* Mobile GT2 */ \ + INTEL_VGA_DEVICE(0x5921, info), /* ULT GT2F */ \ + INTEL_VGA_DEVICE(0x591E, info), /* ULX GT2 */ \ + INTEL_VGA_DEVICE(0x5912, info), /* DT GT2 */ \ + INTEL_VGA_DEVICE(0x591B, info), /* Halo GT2 */ \ + INTEL_VGA_DEVICE(0x591A, info), /* SRV GT2 */ \ + INTEL_VGA_DEVICE(0x591D, info) /* WKS GT2 */ + +#define INTEL_KBL_GT3_IDS(info) \ + INTEL_VGA_DEVICE(0x5923, info), /* ULT GT3 */ \ + INTEL_VGA_DEVICE(0x5926, info), /* ULT GT3 */ \ + INTEL_VGA_DEVICE(0x5927, info) /* ULT GT3 */ + +#define INTEL_KBL_GT4_IDS(info) \ + INTEL_VGA_DEVICE(0x593B, info) /* Halo GT4 */ + +#define INTEL_KBL_IDS(info) \ + INTEL_KBL_GT1_IDS(info), \ + INTEL_KBL_GT2_IDS(info), \ + INTEL_KBL_GT3_IDS(info), \ + INTEL_KBL_GT4_IDS(info) + +/* CFL S */ +#define INTEL_CFL_S_GT1_IDS(info) \ + INTEL_VGA_DEVICE(0x3E90, info), /* SRV GT1 */ \ + INTEL_VGA_DEVICE(0x3E93, info), /* SRV GT1 */ \ + INTEL_VGA_DEVICE(0x3E99, info) /* SRV GT1 */ + +#define INTEL_CFL_S_GT2_IDS(info) \ + INTEL_VGA_DEVICE(0x3E91, info), /* SRV GT2 */ \ + INTEL_VGA_DEVICE(0x3E92, info), /* SRV GT2 */ \ + INTEL_VGA_DEVICE(0x3E96, info), /* SRV GT2 */ \ + INTEL_VGA_DEVICE(0x3E9A, info) /* SRV GT2 */ + +/* CFL H */ +#define INTEL_CFL_H_GT2_IDS(info) \ + INTEL_VGA_DEVICE(0x3E9B, info), /* Halo GT2 */ \ + INTEL_VGA_DEVICE(0x3E94, info) /* Halo GT2 */ + +/* CFL U GT1 */ +#define INTEL_CFL_U_GT1_IDS(info) \ + INTEL_VGA_DEVICE(0x3EA1, info), \ + INTEL_VGA_DEVICE(0x3EA4, info) + +/* CFL U GT2 */ +#define INTEL_CFL_U_GT2_IDS(info) \ + INTEL_VGA_DEVICE(0x3EA0, info), \ + INTEL_VGA_DEVICE(0x3EA3, info), \ + INTEL_VGA_DEVICE(0x3EA9, info) + +/* CFL U GT3 */ +#define INTEL_CFL_U_GT3_IDS(info) \ + INTEL_VGA_DEVICE(0x3EA2, info), /* ULT GT3 */ \ + INTEL_VGA_DEVICE(0x3EA5, info), /* ULT GT3 */ \ + INTEL_VGA_DEVICE(0x3EA6, info), /* ULT GT3 */ \ + INTEL_VGA_DEVICE(0x3EA7, info), /* ULT GT3 */ \ + INTEL_VGA_DEVICE(0x3EA8, info) /* ULT GT3 */ + +#define INTEL_CFL_IDS(info) \ + INTEL_CFL_S_GT1_IDS(info), \ + INTEL_CFL_S_GT2_IDS(info), \ + INTEL_CFL_H_GT2_IDS(info), \ + INTEL_CFL_U_GT1_IDS(info), \ + INTEL_CFL_U_GT2_IDS(info), \ + INTEL_CFL_U_GT3_IDS(info) + +/* CNL */ +#define INTEL_CNL_IDS(info) \ + INTEL_VGA_DEVICE(0x5A51, info), \ + INTEL_VGA_DEVICE(0x5A59, info), \ + INTEL_VGA_DEVICE(0x5A41, info), \ + INTEL_VGA_DEVICE(0x5A49, info), \ + INTEL_VGA_DEVICE(0x5A52, info), \ + INTEL_VGA_DEVICE(0x5A5A, info), \ + INTEL_VGA_DEVICE(0x5A42, info), \ + INTEL_VGA_DEVICE(0x5A4A, info), \ + INTEL_VGA_DEVICE(0x5A50, info), \ + INTEL_VGA_DEVICE(0x5A40, info), \ + INTEL_VGA_DEVICE(0x5A54, info), \ + INTEL_VGA_DEVICE(0x5A5C, info), \ + INTEL_VGA_DEVICE(0x5A44, info), \ + INTEL_VGA_DEVICE(0x5A4C, info) + +/* ICL */ +#define INTEL_ICL_11_IDS(info) \ + INTEL_VGA_DEVICE(0x8A50, info), \ + INTEL_VGA_DEVICE(0x8A51, info), \ + INTEL_VGA_DEVICE(0x8A5C, info), \ + INTEL_VGA_DEVICE(0x8A5D, info), \ + INTEL_VGA_DEVICE(0x8A52, info), \ + INTEL_VGA_DEVICE(0x8A5A, info), \ + INTEL_VGA_DEVICE(0x8A5B, info), \ + INTEL_VGA_DEVICE(0x8A71, info), \ + INTEL_VGA_DEVICE(0x8A70, info) + +#endif /* _PCI_EARLY_QUIRKS_H_ */ From owner-svn-src-stable-12@freebsd.org Wed Nov 7 18:04:20 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 096A2112B84F; Wed, 7 Nov 2018 18:04:20 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8DE0872C75; Wed, 7 Nov 2018 18:04:19 +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 6ED58190BA; Wed, 7 Nov 2018 18:04:19 +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 wA7I4Jag032764; Wed, 7 Nov 2018 18:04:19 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA7I4JiR032763; Wed, 7 Nov 2018 18:04:19 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201811071804.wA7I4JiR032763@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 7 Nov 2018 18:04: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: r340225 - stable/12/libexec/rtld-elf X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/12/libexec/rtld-elf X-SVN-Commit-Revision: 340225 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8DE0872C75 X-Spamd-Result: default: False [-106.84 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-0.999,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.73)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.91), asn: 11403(-3.76), country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Nov 2018 18:04:20 -0000 Author: emaste Date: Wed Nov 7 18:04:19 2018 New Revision: 340225 URL: https://svnweb.freebsd.org/changeset/base/340225 Log: MFC r340137: rtld: move relro enforcement after ifunc processing Previously the combination of relro (implicit), -z now and ifunc use resulted in a segfault when applying ifuncs after relro (test binary here just calls amd64_get_fsbase()): | % env LD_DEBUG=1 libexec/rtld-elf/obj/ld-elf.so.1 a.out | ... | enforcing main obj relro | ... | resolving ifuncs | reloc_jmpslot: *0x203198 = 0x189368ea4570 | zsh: bus error (core dumped) LD_DEBUG=1 obj/ld-elf.so.1 ~/a.out Approved by: re (gjb) Modified: stable/12/libexec/rtld-elf/rtld.c Directory Properties: stable/12/ (props changed) Modified: stable/12/libexec/rtld-elf/rtld.c ============================================================================== --- stable/12/libexec/rtld-elf/rtld.c Wed Nov 7 17:44:27 2018 (r340224) +++ stable/12/libexec/rtld-elf/rtld.c Wed Nov 7 18:04:19 2018 (r340225) @@ -683,10 +683,6 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entr if (do_copy_relocations(obj_main) == -1) rtld_die(); - dbg("enforcing main obj relro"); - if (obj_enforce_relro(obj_main) == -1) - rtld_die(); - if (getenv(_LD("DUMP_REL_POST")) != NULL) { dump_relocations(obj_main); exit (0); @@ -719,6 +715,10 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entr if (resolve_objects_ifunc(obj_main, ld_bind_now != NULL && *ld_bind_now != '\0', SYMLOOK_EARLY, NULL) == -1) + rtld_die(); + + dbg("enforcing main obj relro"); + if (obj_enforce_relro(obj_main) == -1) rtld_die(); if (!obj_main->crt_no_init) { From owner-svn-src-stable-12@freebsd.org Wed Nov 7 18:07:30 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3519D112B95A; Wed, 7 Nov 2018 18:07: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B12DE72E37; Wed, 7 Nov 2018 18:07:29 +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 8E35F190BB; Wed, 7 Nov 2018 18:07:29 +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 wA7I7TqY032942; Wed, 7 Nov 2018 18:07:29 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA7I7TrH032941; Wed, 7 Nov 2018 18:07:29 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201811071807.wA7I7TrH032941@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 7 Nov 2018 18:07: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: r340226 - stable/12/libexec/rtld-elf X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/libexec/rtld-elf X-SVN-Commit-Revision: 340226 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B12DE72E37 X-Spamd-Result: default: False [-106.84 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-0.999,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.73)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.91), asn: 11403(-3.76), country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Nov 2018 18:07:30 -0000 Author: kib Date: Wed Nov 7 18:07:29 2018 New Revision: 340226 URL: https://svnweb.freebsd.org/changeset/base/340226 Log: MFC r339896: Initialize ifunc calling machinery earlier. Approved by: re (gjb) Modified: stable/12/libexec/rtld-elf/rtld.c Directory Properties: stable/12/ (props changed) Modified: stable/12/libexec/rtld-elf/rtld.c ============================================================================== --- stable/12/libexec/rtld-elf/rtld.c Wed Nov 7 18:04:19 2018 (r340225) +++ stable/12/libexec/rtld-elf/rtld.c Wed Nov 7 18:07:29 2018 (r340226) @@ -688,6 +688,8 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entr exit (0); } + ifunc_init(aux); + /* * Setup TLS for main thread. This must be done after the * relocations are processed, since tls initialization section @@ -709,7 +711,6 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entr r_debug_state(NULL, &obj_main->linkmap); /* say hello to gdb! */ map_stacks_exec(NULL); - ifunc_init(aux); dbg("resolving ifuncs"); if (resolve_objects_ifunc(obj_main, From owner-svn-src-stable-12@freebsd.org Wed Nov 7 18:29:55 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ACD58112C163; Wed, 7 Nov 2018 18:29:55 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 31C8873C0A; Wed, 7 Nov 2018 18:29:55 +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 12CEB19401; Wed, 7 Nov 2018 18:29:55 +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 wA7ITsdv043464; Wed, 7 Nov 2018 18:29:54 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA7ITsFH043463; Wed, 7 Nov 2018 18:29:54 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201811071829.wA7ITsFH043463@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 7 Nov 2018 18:29:54 +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: r340230 - stable/12/sys/sys X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/sys X-SVN-Commit-Revision: 340230 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 31C8873C0A X-Spamd-Result: default: False [-106.84 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-1.000,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.73)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.91), asn: 11403(-3.76), country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Nov 2018 18:29:55 -0000 Author: kib Date: Wed Nov 7 18:29:54 2018 New Revision: 340230 URL: https://svnweb.freebsd.org/changeset/base/340230 Log: MFC r339892: Clarify explanation of VFCF_SBDRY. Approved by: re (gjb) Modified: stable/12/sys/sys/mount.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/sys/mount.h ============================================================================== --- stable/12/sys/sys/mount.h Wed Nov 7 18:28:55 2018 (r340229) +++ stable/12/sys/sys/mount.h Wed Nov 7 18:29:54 2018 (r340230) @@ -553,7 +553,8 @@ struct ovfsconf { #define VFCF_UNICODE 0x00200000 /* stores file names as Unicode */ #define VFCF_JAIL 0x00400000 /* can be mounted from within a jail */ #define VFCF_DELEGADMIN 0x00800000 /* supports delegated administration */ -#define VFCF_SBDRY 0x01000000 /* defer stop requests */ +#define VFCF_SBDRY 0x01000000 /* Stop at Boundary: defer stop requests + to kernel->user (AST) transition */ typedef uint32_t fsctlop_t; From owner-svn-src-stable-12@freebsd.org Thu Nov 8 03:24:25 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E6201109D61; Thu, 8 Nov 2018 03:24:25 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ECB7B6B0CF; Thu, 8 Nov 2018 03:24:24 +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 CD6381F03B; Thu, 8 Nov 2018 03:24:24 +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 wA83OO4s022527; Thu, 8 Nov 2018 03:24:24 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA83OOCI022525; Thu, 8 Nov 2018 03:24:24 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201811080324.wA83OOCI022525@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 8 Nov 2018 03:24: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: r340243 - in stable/12: lib usr.sbin X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/12: lib usr.sbin X-SVN-Commit-Revision: 340243 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: ECB7B6B0CF X-Spamd-Result: default: False [-103.10 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-0.99)[-0.990,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2018 03:24:25 -0000 Author: kevans Date: Thu Nov 8 03:24:24 2018 New Revision: 340243 URL: https://svnweb.freebsd.org/changeset/base/340243 Log: MFC r340146: Move pmc* bits behind MK_PMC to fix WITHOUT_PMC build Approved by: re (rgrimes) Modified: stable/12/lib/Makefile stable/12/usr.sbin/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/Makefile ============================================================================== --- stable/12/lib/Makefile Thu Nov 8 00:35:00 2018 (r340242) +++ stable/12/lib/Makefile Thu Nov 8 03:24:24 2018 (r340243) @@ -70,8 +70,6 @@ SUBDIR= ${SUBDIR_BOOTSTRAP} \ libpathconv \ libpcap \ libpjdlog \ - libpmc \ - libpmcstat \ ${_libproc} \ libprocstat \ libregex \ @@ -200,6 +198,7 @@ _libdl= libdl .endif SUBDIR.${MK_OPENSSL}+= libmp +SUBDIR.${MK_PMC}+= libpmc libpmcstat SUBDIR.${MK_RADIUS_SUPPORT}+= libradius SUBDIR.${MK_SENDMAIL}+= libmilter libsm libsmdb libsmutil SUBDIR.${MK_TELNET}+= libtelnet Modified: stable/12/usr.sbin/Makefile ============================================================================== --- stable/12/usr.sbin/Makefile Thu Nov 8 00:35:00 2018 (r340242) +++ stable/12/usr.sbin/Makefile Thu Nov 8 03:24:24 2018 (r340243) @@ -59,9 +59,6 @@ SUBDIR= adduser \ nologin \ pciconf \ periodic \ - pmcannotate \ - pmccontrol \ - pmcstat \ pnfsdscopymr \ pnfsdsfile \ pnfsdskill \ @@ -191,7 +188,7 @@ SUBDIR.${MK_PKGBOOTSTRAP}+= pkg .if ${COMPILER_FEATURES:Mc++11} SUBDIR.${MK_PMC}+= pmc .endif -SUBDIR.${MK_PMC}+= pmcstudy +SUBDIR.${MK_PMC}+= pmcannotate pmccontrol pmcstat pmcstudy SUBDIR.${MK_PORTSNAP}+= portsnap SUBDIR.${MK_PPP}+= ppp SUBDIR.${MK_QUOTAS}+= edquota From owner-svn-src-stable-12@freebsd.org Thu Nov 8 03:25:20 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0B641109DD2; Thu, 8 Nov 2018 03:25:20 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1E4686B1E1; Thu, 8 Nov 2018 03:25:20 +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 DB69E1F03D; Thu, 8 Nov 2018 03:25:19 +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 wA83PJYO022624; Thu, 8 Nov 2018 03:25:19 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA83PJHK022620; Thu, 8 Nov 2018 03:25:19 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201811080325.wA83PJHK022620@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 8 Nov 2018 03:25: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: r340244 - stable/12/stand/lua X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/12/stand/lua X-SVN-Commit-Revision: 340244 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1E4686B1E1 X-Spamd-Result: default: False [-103.10 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-0.99)[-0.989,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2018 03:25:20 -0000 Author: kevans Date: Thu Nov 8 03:25:18 2018 New Revision: 340244 URL: https://svnweb.freebsd.org/changeset/base/340244 Log: MFC r340040, r340152: lualoader boot-conf and chainload r340040: lualoader: Implement boot-conf r340152: lualoader: Add chainload menu entry Approved by: re (rgrimes) Modified: stable/12/stand/lua/cli.lua stable/12/stand/lua/cli.lua.8 stable/12/stand/lua/menu.lua Directory Properties: stable/12/ (props changed) Modified: stable/12/stand/lua/cli.lua ============================================================================== --- stable/12/stand/lua/cli.lua Thu Nov 8 03:24:24 2018 (r340243) +++ stable/12/stand/lua/cli.lua Thu Nov 8 03:25:18 2018 (r340244) @@ -115,6 +115,16 @@ function cli.autoboot(...) core.autoboot(argstr) end +cli['boot-conf'] = function(...) + local _, argv = cli.arguments(...) + local kernel, argstr = parseBootArgs(argv) + if kernel ~= nil then + loader.perform("unload") + config.selectKernel(kernel) + end + core.autoboot(argstr) +end + -- Used for splitting cli varargs into cmd_name and the rest of argv function cli.arguments(...) local argv = {...} Modified: stable/12/stand/lua/cli.lua.8 ============================================================================== --- stable/12/stand/lua/cli.lua.8 Thu Nov 8 03:24:24 2018 (r340243) +++ stable/12/stand/lua/cli.lua.8 Thu Nov 8 03:25:18 2018 (r340244) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 9, 2018 +.Dd October 31, 2018 .Dt CLI.LUA 8 .Os .Sh NAME @@ -80,10 +80,11 @@ Arguments may be passed to it as usual, space-delimite As of present, the .Nm module by default provides commands for -.Ic autoboot +.Ic autoboot , +.Ic boot , and -.Ic boot . -In both cases, the +.Ic boot-conf. +In all three cases, the .Xr core.lua 8 module will load all ELF modules as-needed before executing the equivalent built-in loader commands. Modified: stable/12/stand/lua/menu.lua ============================================================================== --- stable/12/stand/lua/menu.lua Thu Nov 8 03:24:24 2018 (r340243) +++ stable/12/stand/lua/menu.lua Thu Nov 8 03:25:18 2018 (r340244) @@ -337,6 +337,22 @@ menu.welcome = { submenu = menu.boot_environments, alias = {"e", "E"}, }, + -- chainload + { + entry_type = core.MENU_ENTRY, + name = function() + return 'Chain' .. color.highlight("L") .. + "oad " .. loader.getenv('chain_disk') + end, + func = function() + loader.perform("chain " .. + loader.getenv('chain_disk')) + end, + visible = function() + return loader.getenv('chain_disk') ~= nil + end, + alias = {"l", "L"}, + }, }, } From owner-svn-src-stable-12@freebsd.org Thu Nov 8 14:21:27 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3463112BAD9; Thu, 8 Nov 2018 14:21:26 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 31F05804B4; Thu, 8 Nov 2018 14:21:26 +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 12E0825A18; Thu, 8 Nov 2018 14:21:26 +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 wA8ELPc8059666; Thu, 8 Nov 2018 14:21:25 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA8ELPZA059665; Thu, 8 Nov 2018 14:21:25 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201811081421.wA8ELPZA059665@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 8 Nov 2018 14:21: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: r340250 - stable/12/sys/cam/scsi X-SVN-Group: stable-12 X-SVN-Commit-Author: imp X-SVN-Commit-Paths: stable/12/sys/cam/scsi X-SVN-Commit-Revision: 340250 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 31F05804B4 X-Spamd-Result: default: False [-103.11 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-1.000,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2018 14:21:27 -0000 Author: imp Date: Thu Nov 8 14:21:25 2018 New Revision: 340250 URL: https://svnweb.freebsd.org/changeset/base/340250 Log: MFC r340155: Assert locks held for async events. Approved by: re@ (gjb) Modified: stable/12/sys/cam/scsi/scsi_da.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/12/sys/cam/scsi/scsi_da.c Thu Nov 8 13:17:38 2018 (r340249) +++ stable/12/sys/cam/scsi/scsi_da.c Thu Nov 8 14:21:25 2018 (r340250) @@ -2002,7 +2002,7 @@ daasync(void *callback_arg, u_int32_t code, periph = (struct cam_periph *)callback_arg; switch (code) { - case AC_FOUND_DEVICE: + case AC_FOUND_DEVICE: /* callback to create periph, no locking yet */ { struct ccb_getdev *cgd; cam_status status; @@ -2038,7 +2038,7 @@ daasync(void *callback_arg, u_int32_t code, "due to status 0x%x\n", status); return; } - case AC_ADVINFO_CHANGED: + case AC_ADVINFO_CHANGED: /* Doesn't touch periph */ { uintptr_t buftype; @@ -2061,8 +2061,10 @@ daasync(void *callback_arg, u_int32_t code, ccb = (union ccb *)arg; /* - * Handle all UNIT ATTENTIONs except our own, - * as they will be handled by daerror(). + * Handle all UNIT ATTENTIONs except our own, as they will be + * handled by daerror(). Since this comes from a different periph, + * that periph's lock is held, not ours, so we have to take it ours + * out to touch softc flags. */ if (xpt_path_periph(ccb->ccb_h.path) != periph && scsi_extract_sense_ccb(ccb, @@ -2090,9 +2092,13 @@ daasync(void *callback_arg, u_int32_t code, } break; } - case AC_SCSI_AEN: + case AC_SCSI_AEN: /* Called for this path: periph locked */ + /* + * Appears to be currently unused for SCSI devices, only ata SIMs + * generate this. + */ + cam_periph_assert(periph, MA_OWNED); softc = (struct da_softc *)periph->softc; - cam_periph_lock(periph); if (!cam_iosched_has_work_flags(softc->cam_iosched, DA_WORK_TUR) && (softc->flags & DA_FLAG_TUR_PENDING) == 0) { if (da_periph_acquire(periph, DA_REF_TUR) == 0) { @@ -2100,31 +2106,28 @@ daasync(void *callback_arg, u_int32_t code, daschedule(periph); } } - cam_periph_unlock(periph); /* FALLTHROUGH */ - case AC_SENT_BDR: - case AC_BUS_RESET: + case AC_SENT_BDR: /* Called for this path: periph locked */ + case AC_BUS_RESET: /* Called for this path: periph locked */ { struct ccb_hdr *ccbh; + cam_periph_assert(periph, MA_OWNED); softc = (struct da_softc *)periph->softc; /* * Don't fail on the expected unit attention * that will occur. */ - cam_periph_lock(periph); softc->flags |= DA_FLAG_RETRY_UA; LIST_FOREACH(ccbh, &softc->pending_ccbs, periph_links.le) ccbh->ccb_state |= DA_CCB_RETRY_UA; - cam_periph_unlock(periph); break; } - case AC_INQ_CHANGED: - cam_periph_lock(periph); + case AC_INQ_CHANGED: /* Called for this path: periph locked */ + cam_periph_assert(periph, MA_OWNED); softc = (struct da_softc *)periph->softc; softc->flags &= ~DA_FLAG_PROBED; dareprobe(periph); - cam_periph_unlock(periph); break; default: break; From owner-svn-src-stable-12@freebsd.org Thu Nov 8 19:56:31 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3C4E11031B5; Thu, 8 Nov 2018 19:56:30 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 83F4D8FA5A; Thu, 8 Nov 2018 19:56:30 +0000 (UTC) (envelope-from tijl@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 62F971440; Thu, 8 Nov 2018 19:56:30 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wA8JuUYk028976; Thu, 8 Nov 2018 19:56:30 GMT (envelope-from tijl@FreeBSD.org) Received: (from tijl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA8JuT0l028972; Thu, 8 Nov 2018 19:56:29 GMT (envelope-from tijl@FreeBSD.org) Message-Id: <201811081956.wA8JuT0l028972@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tijl set sender to tijl@FreeBSD.org using -f From: Tijl Coosemans Date: Thu, 8 Nov 2018 19:56: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: r340258 - in stable/12/sys: amd64/linux32 compat/linux X-SVN-Group: stable-12 X-SVN-Commit-Author: tijl X-SVN-Commit-Paths: in stable/12/sys: amd64/linux32 compat/linux X-SVN-Commit-Revision: 340258 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 83F4D8FA5A X-Spamd-Result: default: False [-106.86 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-0.999,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.75)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.91), asn: 11403(-3.82), country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2018 19:56:31 -0000 Author: tijl Date: Thu Nov 8 19:56:29 2018 New Revision: 340258 URL: https://svnweb.freebsd.org/changeset/base/340258 Log: MFC r340181, r340185: On amd64 both Linux compat modules, linux.ko and linux64.ko, provide linux_ioctl_(un)register_handler that allows other driver modules to register ioctl handlers. The ioctl syscall implementation in each Linux compat module iterates over the list of handlers and forwards the call to the appropriate driver. Because the registration functions have the same name in each module it is not possible for a driver to support both 32 and 64 bit linux compatibility. Move the list of ioctl handlers to linux_common.ko so it is shared by both Linux modules and all drivers receive both 32 and 64 bit ioctl calls with one registration. These ioctl handlers normally forward the call to the FreeBSD ioctl handler which can handle both 32 and 64 bit. Keep the special COMPAT_LINUX32 ioctl handlers in linux.ko in a separate list for now and let the ioctl syscall iterate over that list first. Later, COMPAT_LINUX32 support can be added to the 64 bit ioctl handlers via a runtime check for ILP32 like is done for COMPAT_FREEBSD32 and then this separate list would disappear again. That is a much bigger effort however and this commit is meant to be MFCable. This enables linux64 support in x11/nvidia-driver*. PR: 206711 Reviewed by: kib Approved by: re (gjb) Modified: stable/12/sys/amd64/linux32/linux32_sysvec.c stable/12/sys/compat/linux/linux_common.c stable/12/sys/compat/linux/linux_ioctl.c stable/12/sys/compat/linux/linux_ioctl.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- stable/12/sys/amd64/linux32/linux32_sysvec.c Thu Nov 8 19:50:23 2018 (r340257) +++ stable/12/sys/amd64/linux32/linux32_sysvec.c Thu Nov 8 19:56:29 2018 (r340258) @@ -32,6 +32,8 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include "opt_compat.h" + #include __FBSDID("$FreeBSD$"); @@ -1071,7 +1073,7 @@ linux_elf_modevent(module_t mod, int type, void *data) error = EINVAL; if (error == 0) { SET_FOREACH(lihp, linux_ioctl_handler_set) - linux_ioctl_register_handler(*lihp); + linux32_ioctl_register_handler(*lihp); LIST_INIT(&futex_list); mtx_init(&futex_mtx, "ftllk", NULL, MTX_DEF); stclohz = (stathz ? stathz : hz); @@ -1093,7 +1095,7 @@ linux_elf_modevent(module_t mod, int type, void *data) } if (error == 0) { SET_FOREACH(lihp, linux_ioctl_handler_set) - linux_ioctl_unregister_handler(*lihp); + linux32_ioctl_unregister_handler(*lihp); mtx_destroy(&futex_mtx); if (bootverbose) printf("Linux ELF exec handler removed\n"); Modified: stable/12/sys/compat/linux/linux_common.c ============================================================================== --- stable/12/sys/compat/linux/linux_common.c Thu Nov 8 19:50:23 2018 (r340257) +++ stable/12/sys/compat/linux/linux_common.c Thu Nov 8 19:56:29 2018 (r340258) @@ -35,9 +35,11 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include +#include #include #include @@ -47,6 +49,11 @@ FEATURE(linuxulator_v4l2, "V4L2 ioctl wrapper support MODULE_VERSION(linux_common, 1); SET_DECLARE(linux_device_handler_set, struct linux_device_handler); + +TAILQ_HEAD(, linux_ioctl_handler_element) linux_ioctl_handlers = + TAILQ_HEAD_INITIALIZER(linux_ioctl_handlers); +struct sx linux_ioctl_sx; +SX_SYSINIT(linux_ioctl, &linux_ioctl_sx, "Linux ioctl handlers"); static eventhandler_tag linux_exec_tag; static eventhandler_tag linux_thread_dtor_tag; Modified: stable/12/sys/compat/linux/linux_ioctl.c ============================================================================== --- stable/12/sys/compat/linux/linux_ioctl.c Thu Nov 8 19:50:23 2018 (r340257) +++ stable/12/sys/compat/linux/linux_ioctl.c Thu Nov 8 19:56:29 2018 (r340258) @@ -161,17 +161,19 @@ DATA_SET(linux_ioctl_handler_set, video2_handler); DATA_SET(linux_ioctl_handler_set, fbsd_usb); DATA_SET(linux_ioctl_handler_set, evdev_handler); -struct handler_element -{ - TAILQ_ENTRY(handler_element) list; - int (*func)(struct thread *, struct linux_ioctl_args *); - int low, high, span; -}; - -static TAILQ_HEAD(, handler_element) handlers = - TAILQ_HEAD_INITIALIZER(handlers); +#ifdef __i386__ +static TAILQ_HEAD(, linux_ioctl_handler_element) linux_ioctl_handlers = + TAILQ_HEAD_INITIALIZER(linux_ioctl_handlers); static struct sx linux_ioctl_sx; SX_SYSINIT(linux_ioctl, &linux_ioctl_sx, "Linux ioctl handlers"); +#else +extern TAILQ_HEAD(, linux_ioctl_handler_element) linux_ioctl_handlers; +extern struct sx linux_ioctl_sx; +#endif +#ifdef COMPAT_LINUX32 +static TAILQ_HEAD(, linux_ioctl_handler_element) linux32_ioctl_handlers = + TAILQ_HEAD_INITIALIZER(linux32_ioctl_handlers); +#endif /* * hdio related ioctls for VMWare support @@ -3684,7 +3686,7 @@ int linux_ioctl(struct thread *td, struct linux_ioctl_args *args) { struct file *fp; - struct handler_element *he; + struct linux_ioctl_handler_element *he; int error, cmd; #ifdef DEBUG @@ -3705,7 +3707,8 @@ linux_ioctl(struct thread *td, struct linux_ioctl_args cmd = args->cmd & 0xffff; sx_slock(&linux_ioctl_sx); mtx_lock(&Giant); - TAILQ_FOREACH(he, &handlers, list) { +#ifdef COMPAT_LINUX32 + TAILQ_FOREACH(he, &linux32_ioctl_handlers, list) { if (cmd >= he->low && cmd <= he->high) { error = (*he->func)(td, args); if (error != ENOIOCTL) { @@ -3716,6 +3719,18 @@ linux_ioctl(struct thread *td, struct linux_ioctl_args } } } +#endif + TAILQ_FOREACH(he, &linux_ioctl_handlers, list) { + if (cmd >= he->low && cmd <= he->high) { + error = (*he->func)(td, args); + if (error != ENOIOCTL) { + mtx_unlock(&Giant); + sx_sunlock(&linux_ioctl_sx); + fdrop(fp, td); + return (error); + } + } + } mtx_unlock(&Giant); sx_sunlock(&linux_ioctl_sx); fdrop(fp, td); @@ -3737,7 +3752,7 @@ linux_ioctl(struct thread *td, struct linux_ioctl_args int linux_ioctl_register_handler(struct linux_ioctl_handler *h) { - struct handler_element *he, *cur; + struct linux_ioctl_handler_element *he, *cur; if (h == NULL || h->func == NULL) return (EINVAL); @@ -3747,7 +3762,7 @@ linux_ioctl_register_handler(struct linux_ioctl_handle * create a new element. */ sx_xlock(&linux_ioctl_sx); - TAILQ_FOREACH(he, &handlers, list) { + TAILQ_FOREACH(he, &linux_ioctl_handlers, list) { if (he->func == h->func) break; } @@ -3756,7 +3771,7 @@ linux_ioctl_register_handler(struct linux_ioctl_handle M_LINUX, M_WAITOK); he->func = h->func; } else - TAILQ_REMOVE(&handlers, he, list); + TAILQ_REMOVE(&linux_ioctl_handlers, he, list); /* Initialize range information. */ he->low = h->low; @@ -3764,14 +3779,14 @@ linux_ioctl_register_handler(struct linux_ioctl_handle he->span = h->high - h->low + 1; /* Add the element to the list, sorted on span. */ - TAILQ_FOREACH(cur, &handlers, list) { + TAILQ_FOREACH(cur, &linux_ioctl_handlers, list) { if (cur->span > he->span) { TAILQ_INSERT_BEFORE(cur, he, list); sx_xunlock(&linux_ioctl_sx); return (0); } } - TAILQ_INSERT_TAIL(&handlers, he, list); + TAILQ_INSERT_TAIL(&linux_ioctl_handlers, he, list); sx_xunlock(&linux_ioctl_sx); return (0); @@ -3780,15 +3795,15 @@ linux_ioctl_register_handler(struct linux_ioctl_handle int linux_ioctl_unregister_handler(struct linux_ioctl_handler *h) { - struct handler_element *he; + struct linux_ioctl_handler_element *he; if (h == NULL || h->func == NULL) return (EINVAL); sx_xlock(&linux_ioctl_sx); - TAILQ_FOREACH(he, &handlers, list) { + TAILQ_FOREACH(he, &linux_ioctl_handlers, list) { if (he->func == h->func) { - TAILQ_REMOVE(&handlers, he, list); + TAILQ_REMOVE(&linux_ioctl_handlers, he, list); sx_xunlock(&linux_ioctl_sx); free(he, M_LINUX); return (0); @@ -3798,3 +3813,69 @@ linux_ioctl_unregister_handler(struct linux_ioctl_hand return (EINVAL); } + +#ifdef COMPAT_LINUX32 +int +linux32_ioctl_register_handler(struct linux_ioctl_handler *h) +{ + struct linux_ioctl_handler_element *he, *cur; + + if (h == NULL || h->func == NULL) + return (EINVAL); + + /* + * Reuse the element if the handler is already on the list, otherwise + * create a new element. + */ + sx_xlock(&linux_ioctl_sx); + TAILQ_FOREACH(he, &linux32_ioctl_handlers, list) { + if (he->func == h->func) + break; + } + if (he == NULL) { + he = malloc(sizeof(*he), M_LINUX, M_WAITOK); + he->func = h->func; + } else + TAILQ_REMOVE(&linux32_ioctl_handlers, he, list); + + /* Initialize range information. */ + he->low = h->low; + he->high = h->high; + he->span = h->high - h->low + 1; + + /* Add the element to the list, sorted on span. */ + TAILQ_FOREACH(cur, &linux32_ioctl_handlers, list) { + if (cur->span > he->span) { + TAILQ_INSERT_BEFORE(cur, he, list); + sx_xunlock(&linux_ioctl_sx); + return (0); + } + } + TAILQ_INSERT_TAIL(&linux32_ioctl_handlers, he, list); + sx_xunlock(&linux_ioctl_sx); + + return (0); +} + +int +linux32_ioctl_unregister_handler(struct linux_ioctl_handler *h) +{ + struct linux_ioctl_handler_element *he; + + if (h == NULL || h->func == NULL) + return (EINVAL); + + sx_xlock(&linux_ioctl_sx); + TAILQ_FOREACH(he, &linux32_ioctl_handlers, list) { + if (he->func == h->func) { + TAILQ_REMOVE(&linux32_ioctl_handlers, he, list); + sx_xunlock(&linux_ioctl_sx); + free(he, M_LINUX); + return (0); + } + } + sx_xunlock(&linux_ioctl_sx); + + return (EINVAL); +} +#endif Modified: stable/12/sys/compat/linux/linux_ioctl.h ============================================================================== --- stable/12/sys/compat/linux/linux_ioctl.h Thu Nov 8 19:50:23 2018 (r340257) +++ stable/12/sys/compat/linux/linux_ioctl.h Thu Nov 8 19:56:29 2018 (r340258) @@ -770,7 +770,18 @@ struct linux_ioctl_handler { int low, high; }; +struct linux_ioctl_handler_element +{ + TAILQ_ENTRY(linux_ioctl_handler_element) list; + int (*func)(struct thread *, struct linux_ioctl_args *); + int low, high, span; +}; + int linux_ioctl_register_handler(struct linux_ioctl_handler *h); int linux_ioctl_unregister_handler(struct linux_ioctl_handler *h); +#ifdef COMPAT_LINUX32 +int linux32_ioctl_register_handler(struct linux_ioctl_handler *h); +int linux32_ioctl_unregister_handler(struct linux_ioctl_handler *h); +#endif #endif /* !_LINUX_IOCTL_H_ */ From owner-svn-src-stable-12@freebsd.org Thu Nov 8 21:36:47 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE2C31107104; Thu, 8 Nov 2018 21:36:47 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3CBE46E2A4; Thu, 8 Nov 2018 21:36:47 +0000 (UTC) (envelope-from erj@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 04DF22504; Thu, 8 Nov 2018 21:36:47 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wA8Lak7E080422; Thu, 8 Nov 2018 21:36:46 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA8LakPi080418; Thu, 8 Nov 2018 21:36:46 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201811082136.wA8LakPi080418@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Thu, 8 Nov 2018 21:36: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: r340263 - stable/12/sys/dev/ixl X-SVN-Group: stable-12 X-SVN-Commit-Author: erj X-SVN-Commit-Paths: stable/12/sys/dev/ixl X-SVN-Commit-Revision: 340263 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3CBE46E2A4 X-Spamd-Result: default: False [-106.86 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-0.999,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.75)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.92), asn: 11403(-3.82), country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2018 21:36:47 -0000 Author: erj Date: Thu Nov 8 21:36:45 2018 New Revision: 340263 URL: https://svnweb.freebsd.org/changeset/base/340263 Log: MFC r340256: ixl/iavf(4): Fix TSO offloads when TXCSUM is disabled Approved by: re (gjb@) Modified: stable/12/sys/dev/ixl/if_iavf.c stable/12/sys/dev/ixl/if_ixl.c stable/12/sys/dev/ixl/ixl.h stable/12/sys/dev/ixl/ixl_txrx.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/ixl/if_iavf.c ============================================================================== --- stable/12/sys/dev/ixl/if_iavf.c Thu Nov 8 20:48:44 2018 (r340262) +++ stable/12/sys/dev/ixl/if_iavf.c Thu Nov 8 21:36:45 2018 (r340263) @@ -261,7 +261,7 @@ static struct if_shared_ctx iavf_sctx_init = { .isc_vendor_info = iavf_vendor_info_array, .isc_driver_version = IAVF_DRIVER_VERSION_STRING, .isc_driver = &iavf_if_driver, - .isc_flags = IFLIB_NEED_SCRATCH | IFLIB_NEED_ZERO_CSUM | IFLIB_IS_VF, + .isc_flags = IFLIB_NEED_SCRATCH | IFLIB_NEED_ZERO_CSUM | IFLIB_TSO_INIT_IP | IFLIB_IS_VF, .isc_nrxd_min = {IXL_MIN_RING}, .isc_ntxd_min = {IXL_MIN_RING}, Modified: stable/12/sys/dev/ixl/if_ixl.c ============================================================================== --- stable/12/sys/dev/ixl/if_ixl.c Thu Nov 8 20:48:44 2018 (r340262) +++ stable/12/sys/dev/ixl/if_ixl.c Thu Nov 8 21:36:45 2018 (r340263) @@ -323,7 +323,7 @@ static struct if_shared_ctx ixl_sctx_init = { .isc_vendor_info = ixl_vendor_info_array, .isc_driver_version = IXL_DRIVER_VERSION_STRING, .isc_driver = &ixl_if_driver, - .isc_flags = IFLIB_NEED_SCRATCH | IFLIB_NEED_ZERO_CSUM | IFLIB_ADMIN_ALWAYS_RUN, + .isc_flags = IFLIB_NEED_SCRATCH | IFLIB_NEED_ZERO_CSUM | IFLIB_TSO_INIT_IP | IFLIB_ADMIN_ALWAYS_RUN, .isc_nrxd_min = {IXL_MIN_RING}, .isc_ntxd_min = {IXL_MIN_RING}, Modified: stable/12/sys/dev/ixl/ixl.h ============================================================================== --- stable/12/sys/dev/ixl/ixl.h Thu Nov 8 20:48:44 2018 (r340262) +++ stable/12/sys/dev/ixl/ixl.h Thu Nov 8 21:36:45 2018 (r340263) @@ -258,6 +258,8 @@ (CSUM_IP_UDP|CSUM_IP6_UDP) #define IXL_CSUM_SCTP \ (CSUM_IP_SCTP|CSUM_IP6_SCTP) +#define IXL_CSUM_IPV4 \ + (CSUM_IP|CSUM_IP_TSO) /* Pre-11 counter(9) compatibility */ #if __FreeBSD_version >= 1100036 Modified: stable/12/sys/dev/ixl/ixl_txrx.c ============================================================================== --- stable/12/sys/dev/ixl/ixl_txrx.c Thu Nov 8 20:48:44 2018 (r340262) +++ stable/12/sys/dev/ixl/ixl_txrx.c Thu Nov 8 21:36:45 2018 (r340263) @@ -225,7 +225,7 @@ ixl_tx_setup_offload(struct ixl_tx_queue *que, switch (pi->ipi_etype) { #ifdef INET case ETHERTYPE_IP: - if (pi->ipi_csum_flags & CSUM_IP) + if (pi->ipi_csum_flags & IXL_CSUM_IPV4) *cmd |= I40E_TX_DESC_CMD_IIPT_IPV4_CSUM; else *cmd |= I40E_TX_DESC_CMD_IIPT_IPV4; From owner-svn-src-stable-12@freebsd.org Thu Nov 8 21:58:24 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 155371108117; Thu, 8 Nov 2018 21:58:24 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9B7396F769; Thu, 8 Nov 2018 21:58:23 +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 7A6CA2874; Thu, 8 Nov 2018 21:58:23 +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 wA8LwNGB093132; Thu, 8 Nov 2018 21:58:23 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA8LwNWk093130; Thu, 8 Nov 2018 21:58:23 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201811082158.wA8LwNWk093130@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 8 Nov 2018 21:58: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: r340267 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 340267 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9B7396F769 X-Spamd-Result: default: False [-106.86 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-1.000,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.75)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.92), asn: 11403(-3.83), country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2018 21:58:24 -0000 Author: gjb Date: Thu Nov 8 21:58:23 2018 New Revision: 340267 URL: https://svnweb.freebsd.org/changeset/base/340267 Log: MFC r340260 (emaste): Avoid buffer underwrite in icmp_error icmp_error allocates either an mbuf (with pkthdr) or a cluster depending on the size of data to be quoted in the ICMP reply, but the calculation failed to account for the additional padding that m_align may apply. Include the ip header in the size passed to m_align. On 64-bit archs this will have the net effect of moving everything 4 bytes later in the mbuf or cluster. This will result in slightly pessimal alignment for the ICMP data copy. Also add an assertion that we do not move m_data before the beginning of the mbuf or cluster. Approved by: re (kib) Security: CVE-2018-17156 Sponsored by: The FreeBSD Foundation Modified: stable/12/sys/netinet/ip_icmp.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/ip_icmp.c ============================================================================== --- stable/12/sys/netinet/ip_icmp.c Thu Nov 8 21:56:06 2018 (r340266) +++ stable/12/sys/netinet/ip_icmp.c Thu Nov 8 21:58:23 2018 (r340267) @@ -313,7 +313,8 @@ stdreply: icmpelen = max(8, min(V_icmp_quotelen, ntohs #endif icmplen = min(icmplen, M_TRAILINGSPACE(m) - sizeof(struct ip) - ICMP_MINLEN); - m_align(m, ICMP_MINLEN + icmplen); + m_align(m, sizeof(struct ip) + ICMP_MINLEN + icmplen); + m->m_data += sizeof(struct ip); m->m_len = ICMP_MINLEN + icmplen; /* XXX MRT make the outgoing packet use the same FIB @@ -355,6 +356,8 @@ stdreply: icmpelen = max(8, min(V_icmp_quotelen, ntohs * reply should bypass as well. */ m->m_flags |= n->m_flags & M_SKIP_FIREWALL; + KASSERT(M_LEADINGSPACE(m) >= sizeof(struct ip), + ("insufficient space for ip header")); m->m_data -= sizeof(struct ip); m->m_len += sizeof(struct ip); m->m_pkthdr.len = m->m_len; From owner-svn-src-stable-12@freebsd.org Thu Nov 8 22:39:41 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E91B611098B9; Thu, 8 Nov 2018 22:39:40 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6DF7B716F5; Thu, 8 Nov 2018 22:39:40 +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 500D12F2F; Thu, 8 Nov 2018 22:39:40 +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 wA8MdeMF013499; Thu, 8 Nov 2018 22:39:40 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA8MdcIM013489; Thu, 8 Nov 2018 22:39:38 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201811082239.wA8MdcIM013489@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 8 Nov 2018 22: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: r340269 - in stable/12/sys: amd64/include arm/include arm64/include i386/include kern mips/include powerpc/include riscv/include sparc64/include x86/x86 X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable/12/sys: amd64/include arm/include arm64/include i386/include kern mips/include powerpc/include riscv/include sparc64/include x86/x86 X-SVN-Commit-Revision: 340269 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6DF7B716F5 X-Spamd-Result: default: False [-106.86 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-1.000,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.75)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.92), asn: 11403(-3.83), country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2018 22:39:41 -0000 Author: jhb Date: Thu Nov 8 22:39:38 2018 New Revision: 340269 URL: https://svnweb.freebsd.org/changeset/base/340269 Log: MFC 340164,340168,340170: Add custom cpu_lock_delay() for x86. 340164: Add a KPI for the delay while spinning on a spin lock. Replace a call to DELAY(1) with a new cpu_lock_delay() KPI. Currently cpu_lock_delay() is defined to DELAY(1) on all platforms. However, platforms with a DELAY() implementation that uses spin locks should implement a custom cpu_lock_delay() doesn't use locks. 340168: Add a delay_tsc() static function for when DELAY() uses the TSC. This uses slightly simpler logic than the existing code by using the full 64-bit counter and thus not having to worry about counter overflow. 340170: Add a custom implementation of cpu_lock_delay() for x86. Avoid using DELAY() since it can try to use spin locks on CPUs without a P-state invariant TSC. For cpu_lock_delay(), always use the TSC if it exists (even if it is not P-state invariant) to delay for a microsecond. If the TSC does not exist, read from I/O port 0x84 to delay instead. PR: 228768 Approved by: re (gjb) Modified: stable/12/sys/amd64/include/cpu.h stable/12/sys/arm/include/cpu.h stable/12/sys/arm64/include/cpu.h stable/12/sys/i386/include/cpu.h stable/12/sys/kern/kern_mutex.c stable/12/sys/mips/include/cpu.h stable/12/sys/powerpc/include/cpu.h stable/12/sys/riscv/include/cpu.h stable/12/sys/sparc64/include/cpu.h stable/12/sys/x86/x86/delay.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/include/cpu.h ============================================================================== --- stable/12/sys/amd64/include/cpu.h Thu Nov 8 21:58:51 2018 (r340268) +++ stable/12/sys/amd64/include/cpu.h Thu Nov 8 22:39:38 2018 (r340269) @@ -77,6 +77,7 @@ extern char etext[]; extern void (*vmm_resume_p)(void); void cpu_halt(void); +void cpu_lock_delay(void); void cpu_reset(void); void fork_trampoline(void); void swi_vm(void *); Modified: stable/12/sys/arm/include/cpu.h ============================================================================== --- stable/12/sys/arm/include/cpu.h Thu Nov 8 21:58:51 2018 (r340268) +++ stable/12/sys/arm/include/cpu.h Thu Nov 8 22:39:38 2018 (r340269) @@ -61,6 +61,7 @@ get_cyclecount(void) #define cpu_getstack(td) ((td)->td_frame->tf_usr_sp) #define cpu_setstack(td, sp) ((td)->td_frame->tf_usr_sp = (sp)) #define cpu_spinwait() /* nothing */ +#define cpu_lock_delay() DELAY(1) #define ARM_NVEC 8 #define ARM_VEC_ALL 0xffffffff Modified: stable/12/sys/arm64/include/cpu.h ============================================================================== --- stable/12/sys/arm64/include/cpu.h Thu Nov 8 21:58:51 2018 (r340268) +++ stable/12/sys/arm64/include/cpu.h Thu Nov 8 22:39:38 2018 (r340269) @@ -51,6 +51,7 @@ #define cpu_getstack(td) ((td)->td_frame->tf_sp) #define cpu_setstack(td, sp) ((td)->td_frame->tf_sp = (sp)) #define cpu_spinwait() __asm __volatile("yield" ::: "memory") +#define cpu_lock_delay() DELAY(1) /* Extract CPU affinity levels 0-3 */ #define CPU_AFF0(mpidr) (u_int)(((mpidr) >> 0) & 0xff) Modified: stable/12/sys/i386/include/cpu.h ============================================================================== --- stable/12/sys/i386/include/cpu.h Thu Nov 8 21:58:51 2018 (r340268) +++ stable/12/sys/i386/include/cpu.h Thu Nov 8 22:39:38 2018 (r340269) @@ -72,6 +72,7 @@ extern char btext[]; extern char etext[]; void cpu_halt(void); +void cpu_lock_delay(void); void cpu_reset(void); void fork_trampoline(void); void swi_vm(void *); Modified: stable/12/sys/kern/kern_mutex.c ============================================================================== --- stable/12/sys/kern/kern_mutex.c Thu Nov 8 21:58:51 2018 (r340268) +++ stable/12/sys/kern/kern_mutex.c Thu Nov 8 22:39:38 2018 (r340269) @@ -1206,7 +1206,7 @@ _mtx_lock_indefinite_check(struct mtx *m, struct lock_ ldap->spin_cnt++; if (ldap->spin_cnt < 60000000 || kdb_active || panicstr != NULL) - DELAY(1); + cpu_lock_delay(); else { td = mtx_owner(m); Modified: stable/12/sys/mips/include/cpu.h ============================================================================== --- stable/12/sys/mips/include/cpu.h Thu Nov 8 21:58:51 2018 (r340268) +++ stable/12/sys/mips/include/cpu.h Thu Nov 8 22:39:38 2018 (r340269) @@ -71,6 +71,7 @@ #define cpu_getstack(td) ((td)->td_frame->sp) #define cpu_setstack(td, nsp) ((td)->td_frame->sp = (nsp)) #define cpu_spinwait() /* nothing */ +#define cpu_lock_delay() DELAY(1) /* * A machine-independent interface to the CPU's counter. Modified: stable/12/sys/powerpc/include/cpu.h ============================================================================== --- stable/12/sys/powerpc/include/cpu.h Thu Nov 8 21:58:51 2018 (r340268) +++ stable/12/sys/powerpc/include/cpu.h Thu Nov 8 22:39:38 2018 (r340269) @@ -128,6 +128,7 @@ get_cyclecount(void) #define cpu_getstack(td) ((td)->td_frame->fixreg[1]) #define cpu_spinwait() __asm __volatile("or 27,27,27") /* yield */ +#define cpu_lock_delay() DELAY(1) extern char btext[]; extern char etext[]; Modified: stable/12/sys/riscv/include/cpu.h ============================================================================== --- stable/12/sys/riscv/include/cpu.h Thu Nov 8 21:58:51 2018 (r340268) +++ stable/12/sys/riscv/include/cpu.h Thu Nov 8 22:39:38 2018 (r340269) @@ -46,6 +46,7 @@ #define cpu_getstack(td) ((td)->td_frame->tf_sp) #define cpu_setstack(td, sp) ((td)->td_frame->tf_sp = (sp)) #define cpu_spinwait() /* nothing */ +#define cpu_lock_delay() DELAY(1) #ifdef _KERNEL Modified: stable/12/sys/sparc64/include/cpu.h ============================================================================== --- stable/12/sys/sparc64/include/cpu.h Thu Nov 8 21:58:51 2018 (r340268) +++ stable/12/sys/sparc64/include/cpu.h Thu Nov 8 22:39:38 2018 (r340269) @@ -48,6 +48,7 @@ #define cpu_getstack(td) ((td)->td_frame->tf_sp) #define cpu_setstack(td, sp) ((td)->td_frame->tf_sp = (sp)) #define cpu_spinwait() /* nothing */ +#define cpu_lock_delay() DELAY(1) #ifdef _KERNEL Modified: stable/12/sys/x86/x86/delay.c ============================================================================== --- stable/12/sys/x86/x86/delay.c Thu Nov 8 21:58:51 2018 (r340268) +++ stable/12/sys/x86/x86/delay.c Thu Nov 8 22:39:38 2018 (r340269) @@ -51,11 +51,23 @@ __FBSDID("$FreeBSD$"); #include #include -static u_int -get_tsc(__unused struct timecounter *tc) +static void +delay_tsc(int n) { + uint64_t end, now; - return (rdtsc32()); + /* + * Pin the current thread ensure correct behavior if the TSCs + * on different CPUs are not in sync. + */ + sched_pin(); + now = rdtsc(); + end = now + tsc_freq * n / 1000000; + do { + cpu_spinwait(); + now = rdtsc(); + } while (now < end); + sched_unpin(); } static int @@ -66,22 +78,24 @@ delay_tc(int n) uint64_t end, freq, now; u_int last, mask, u; - tc = timecounter; - freq = atomic_load_acq_64(&tsc_freq); - if (tsc_is_invariant && freq != 0) { - func = get_tsc; - mask = ~0u; - } else { - if (tc->tc_quality <= 0) - return (0); - func = tc->tc_get_timecount; - mask = tc->tc_counter_mask; - freq = tc->tc_frequency; + /* + * Only use the TSC if it is P-state invariant. If the TSC is + * not P-state invariant and the CPU is not running at the + * "full" P-state, then the TSC will increment at some rate + * less than tsc_freq and delay_tsc() will wait too long. + */ + if (tsc_is_invariant && tsc_freq != 0) { + delay_tsc(n); + return (1); } + tc = timecounter; + if (tc->tc_quality <= 0) + return (0); + func = tc->tc_get_timecount; + mask = tc->tc_counter_mask; + freq = tc->tc_frequency; now = 0; end = freq * n / 1000000; - if (func == get_tsc) - sched_pin(); last = func(tc) & mask; do { cpu_spinwait(); @@ -92,8 +106,6 @@ delay_tc(int n) now += u - last; last = u; } while (now < end); - if (func == get_tsc) - sched_unpin(); return (1); } @@ -109,4 +121,23 @@ DELAY(int n) init_ops.early_delay(n); TSEXIT(); +} + +void +cpu_lock_delay(void) +{ + + /* + * Use TSC to wait for a usec if present, otherwise fall back + * to reading from port 0x84. We can't call into timecounters + * for this delay since timecounters might use spin locks. + * + * Note that unlike delay_tc(), this uses the TSC even if it + * is not P-state invariant. For this function it is ok to + * wait even a few usecs. + */ + if (tsc_freq != 0) + delay_tsc(1); + else + inb(0x84); } From owner-svn-src-stable-12@freebsd.org Fri Nov 9 00:01:54 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14CB2110CC81; Fri, 9 Nov 2018 00:01:54 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 99FF975262; Fri, 9 Nov 2018 00:01:53 +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 7C95642C0; Fri, 9 Nov 2018 00:01:53 +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 wA901rX5059672; Fri, 9 Nov 2018 00:01:53 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA901rdW059671; Fri, 9 Nov 2018 00:01:53 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201811090001.wA901rdW059671@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 9 Nov 2018 00:01: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: r340271 - stable/12/sys/conf X-SVN-Group: stable-12 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: stable/12/sys/conf X-SVN-Commit-Revision: 340271 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 99FF975262 X-Spamd-Result: default: False [-106.86 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-0.999,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.75)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.92), asn: 11403(-3.83), country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Nov 2018 00:01:54 -0000 Author: gjb Date: Fri Nov 9 00:01:53 2018 New Revision: 340271 URL: https://svnweb.freebsd.org/changeset/base/340271 Log: Update stable/12 from BETA3 to BETA4 as part of the 12.0-RELEASE cycle. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/12/sys/conf/newvers.sh Modified: stable/12/sys/conf/newvers.sh ============================================================================== --- stable/12/sys/conf/newvers.sh Thu Nov 8 22:42:55 2018 (r340270) +++ stable/12/sys/conf/newvers.sh Fri Nov 9 00:01:53 2018 (r340271) @@ -46,7 +46,7 @@ TYPE="FreeBSD" REVISION="12.0" -BRANCH="BETA3" +BRANCH="BETA4" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-stable-12@freebsd.org Fri Nov 9 08:14:49 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20DAB1129201; Fri, 9 Nov 2018 08:14:49 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9EC9283F28; Fri, 9 Nov 2018 08:14:48 +0000 (UTC) (envelope-from ae@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 7FC7B11403; Fri, 9 Nov 2018 08:14:48 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wA98Emnl010772; Fri, 9 Nov 2018 08:14:48 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA98EmOp010771; Fri, 9 Nov 2018 08:14:48 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201811090814.wA98EmOp010771@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Fri, 9 Nov 2018 08:14:48 +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: r340277 - stable/12/sbin/ipfw X-SVN-Group: stable-12 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: stable/12/sbin/ipfw X-SVN-Commit-Revision: 340277 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9EC9283F28 X-Spamd-Result: default: False [-106.87 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-1.000,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.76)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.92), asn: 11403(-3.85), country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Nov 2018 08:14:49 -0000 Author: ae Date: Fri Nov 9 08:14:47 2018 New Revision: 340277 URL: https://svnweb.freebsd.org/changeset/base/340277 Log: MFC r340100: Do not use bzero() for the O_ICMP6TYPE opcode. The buffer is already zeroed in compile_rule() function, and also it may contain configured F_NOT flag in o.len field. This fixes the filling for "not icmp6types" opcode. MFC r340175: Do not print "ip6" keyword in print_icmp6types() for O_ICMP6TYPE opcode. It produces incompatibility when rules listing is used again to restore saved ruleset, because "ip6" keyword produces separate opcode. The kernel already has the check and only IPv6 packets will be checked for matching. PR: 232939 Approved by: re (kib) Modified: stable/12/sbin/ipfw/ipv6.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/ipfw/ipv6.c ============================================================================== --- stable/12/sbin/ipfw/ipv6.c Fri Nov 9 03:32:53 2018 (r340276) +++ stable/12/sbin/ipfw/ipv6.c Fri Nov 9 08:14:47 2018 (r340277) @@ -143,8 +143,6 @@ fill_icmp6types(ipfw_insn_icmp6 *cmd, char *av, int cb uint8_t type; CHECK_LENGTH(cblen, F_INSN_SIZE(ipfw_insn_icmp6)); - - bzero(cmd, sizeof(*cmd)); while (*av) { if (*av == ',') av++; @@ -171,7 +169,7 @@ print_icmp6types(struct buf_pr *bp, ipfw_insn_u32 *cmd int i, j; char sep= ' '; - bprintf(bp, " ip6 icmp6types"); + bprintf(bp, " icmp6types"); for (i = 0; i < 7; i++) for (j=0; j < 32; ++j) { if ( (cmd->d[i] & (1 << (j))) == 0) From owner-svn-src-stable-12@freebsd.org Fri Nov 9 09:26:12 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5FC14112B5BD; Fri, 9 Nov 2018 09:26:12 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 776F46D433; Fri, 9 Nov 2018 09:26:11 +0000 (UTC) (envelope-from hselasky@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 59A7B11FCF; Fri, 9 Nov 2018 09:26:11 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wA99QB7M046815; Fri, 9 Nov 2018 09:26:11 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA99QBnK046814; Fri, 9 Nov 2018 09:26:11 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201811090926.wA99QBnK046814@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 9 Nov 2018 09:26:11 +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: r340282 - stable/12/usr.sbin/uhsoctl X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/usr.sbin/uhsoctl X-SVN-Commit-Revision: 340282 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 776F46D433 X-Spamd-Result: default: False [-106.86 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-0.99)[-0.994,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.76)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.92), asn: 11403(-3.85), country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Nov 2018 09:26:12 -0000 Author: hselasky Date: Fri Nov 9 09:26:10 2018 New Revision: 340282 URL: https://svnweb.freebsd.org/changeset/base/340282 Log: MFC r340089: Use correct type for IOCTL request argument. This fixes signed IOCTL value warnings in uhsoctl(). Approved by: re (kib) Submitted by: Marcin Cieslak Sponsored by: Mellanox Technologies Modified: stable/12/usr.sbin/uhsoctl/uhsoctl.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/uhsoctl/uhsoctl.c ============================================================================== --- stable/12/usr.sbin/uhsoctl/uhsoctl.c Fri Nov 9 08:47:54 2018 (r340281) +++ stable/12/usr.sbin/uhsoctl/uhsoctl.c Fri Nov 9 09:26:10 2018 (r340282) @@ -360,7 +360,7 @@ logger(int pri, const char *fmt, ...) /* Add/remove IP address from an interface */ static int -ifaddr_ad(int d, const char *ifnam, struct sockaddr *sa, struct sockaddr *mask) +ifaddr_ad(unsigned long d, const char *ifnam, struct sockaddr *sa, struct sockaddr *mask) { struct ifaliasreq req; int fd, error; From owner-svn-src-stable-12@freebsd.org Sat Nov 10 10:30:03 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04BB6112F94D; Sat, 10 Nov 2018 10:30:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 492EE839FD; Sat, 10 Nov 2018 10:30:02 +0000 (UTC) (envelope-from hselasky@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 2A526219E9; Sat, 10 Nov 2018 10:30:02 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAAAU25J031191; Sat, 10 Nov 2018 10:30:02 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAAAU2Ud031190; Sat, 10 Nov 2018 10:30:02 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201811101030.wAAAU2Ud031190@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 10 Nov 2018 10:30:02 +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: r340315 - stable/12/sys/dev/usb/controller X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/sys/dev/usb/controller X-SVN-Commit-Revision: 340315 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 492EE839FD X-Spamd-Result: default: False [-106.87 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-1.000,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.76)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.88), country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2018 10:30:03 -0000 Author: hselasky Date: Sat Nov 10 10:30:01 2018 New Revision: 340315 URL: https://svnweb.freebsd.org/changeset/base/340315 Log: MFC r340212: Sometimes the complete split packet may be queued too early and the transaction translator will return a NAK. Ignore this message and retry the complete split instead. Approved by: re (kib) Sponsored by: Mellanox Technologies Modified: stable/12/sys/dev/usb/controller/dwc_otg.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/usb/controller/dwc_otg.c ============================================================================== --- stable/12/sys/dev/usb/controller/dwc_otg.c Sat Nov 10 03:10:22 2018 (r340314) +++ stable/12/sys/dev/usb/controller/dwc_otg.c Sat Nov 10 10:30:01 2018 (r340315) @@ -1432,6 +1432,19 @@ dwc_otg_host_data_rx(struct dwc_otg_softc *sc, struct goto receive_pkt; } } else if (td->ep_type == UE_ISOCHRONOUS) { + if (td->hcsplt != 0) { + /* + * Sometimes the complete + * split packet may be queued + * too early and the + * transaction translator will + * return a NAK. Ignore + * this message and retry the + * complete split instead. + */ + DPRINTF("Retrying complete split\n"); + goto receive_pkt; + } goto complete; } td->did_nak = 1; From owner-svn-src-stable-12@freebsd.org Sat Nov 10 20:35:01 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1CBAB1109B05; Sat, 10 Nov 2018 20:35:01 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9CD997AECF; Sat, 10 Nov 2018 20:35:00 +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 7976727EB1; Sat, 10 Nov 2018 20:35:00 +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 wAAKZ0R8058684; Sat, 10 Nov 2018 20:35:00 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAAKZ0l6058682; Sat, 10 Nov 2018 20:35:00 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811102035.wAAKZ0l6058682@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 10 Nov 2018 20:35: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: r340332 - stable/12/bin/setfacl X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/bin/setfacl X-SVN-Commit-Revision: 340332 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9CD997AECF X-Spamd-Result: default: False [-106.88 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-1.000,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.89), country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2018 20:35:01 -0000 Author: markj Date: Sat Nov 10 20:34:59 2018 New Revision: 340332 URL: https://svnweb.freebsd.org/changeset/base/340332 Log: MFC r339793: Don't set NFSv4 ACL inheritance flags on non-directories. PR: 155163 Approved by: re (gjb) Modified: stable/12/bin/setfacl/setfacl.1 stable/12/bin/setfacl/setfacl.c Directory Properties: stable/12/ (props changed) Modified: stable/12/bin/setfacl/setfacl.1 ============================================================================== --- stable/12/bin/setfacl/setfacl.1 Sat Nov 10 20:33:08 2018 (r340331) +++ stable/12/bin/setfacl/setfacl.1 Sat Nov 10 20:34:59 2018 (r340332) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 10, 2018 +.Dd October 26, 2018 .Dt SETFACL 1 .Os .Sh NAME @@ -136,6 +136,8 @@ option is specified, no symbolic links are followed. This is the default. .It Fl R Perform the action recursively on any specified directories. +When modifying or adding NFSv4 ACL entries, inheritance flags +are applied only to directories. .It Fl x Ar entries | position If .Ar entries Modified: stable/12/bin/setfacl/setfacl.c ============================================================================== --- stable/12/bin/setfacl/setfacl.c Sat Nov 10 20:33:08 2018 (r340331) +++ stable/12/bin/setfacl/setfacl.c Sat Nov 10 20:34:59 2018 (r340332) @@ -27,9 +27,7 @@ #include __FBSDID("$FreeBSD$"); -#include #include -#include #include #include @@ -73,6 +71,7 @@ static bool need_mask; static acl_type_t acl_type = ACL_TYPE_ACCESS; static int handle_file(FTS *ftsp, FTSENT *file); +static acl_t clear_inheritance_flags(acl_t acl); static char **stdin_files(void); static void usage(void); @@ -124,10 +123,57 @@ stdin_files(void) return (files_list); } +/* + * Remove any inheritance flags from NFSv4 ACLs when running in recursive + * mode. This is to avoid files being assigned identical ACLs to their + * parent directory while also being set to inherit them. + * + * The acl argument is assumed to be valid. + */ +static acl_t +clear_inheritance_flags(acl_t acl) +{ + acl_t nacl; + acl_entry_t acl_entry; + acl_flagset_t acl_flagset; + int acl_brand, entry_id; + + (void)acl_get_brand_np(acl, &acl_brand); + if (acl_brand != ACL_BRAND_NFS4) + return (acl); + + nacl = acl_dup(acl); + if (nacl == NULL) { + warn("acl_dup() failed"); + return (acl); + } + + entry_id = ACL_FIRST_ENTRY; + while (acl_get_entry(nacl, entry_id, &acl_entry) == 1) { + entry_id = ACL_NEXT_ENTRY; + if (acl_get_flagset_np(acl_entry, &acl_flagset) != 0) { + warn("acl_get_flagset_np() failed"); + continue; + } + if (acl_get_flag_np(acl_flagset, ACL_ENTRY_INHERIT_ONLY) == 1) { + if (acl_delete_entry(nacl, acl_entry) != 0) + warn("acl_delete_entry() failed"); + continue; + } + if (acl_delete_flag_np(acl_flagset, + ACL_ENTRY_FILE_INHERIT | + ACL_ENTRY_DIRECTORY_INHERIT | + ACL_ENTRY_NO_PROPAGATE_INHERIT) != 0) + warn("acl_delete_flag_np() failed"); + } + + return (nacl); +} + static int handle_file(FTS *ftsp, FTSENT *file) { - acl_t acl; + acl_t acl, nacl; acl_entry_t unused_entry; int local_error, ret; struct sf_entry *entry; @@ -193,17 +239,20 @@ handle_file(FTS *ftsp, FTSENT *file) /* Cycle through each option. */ TAILQ_FOREACH(entry, &entrylist, next) { - if (local_error) - continue; - - switch(entry->op) { + nacl = entry->acl; + switch (entry->op) { case OP_ADD_ACL: - local_error += add_acl(entry->acl, entry->entry_number, - &acl, file->fts_path); + if (R_flag && file->fts_info != FTS_D && + acl_type == ACL_TYPE_NFS4) + nacl = clear_inheritance_flags(nacl); + local_error += add_acl(nacl, entry->entry_number, &acl, + file->fts_path); break; case OP_MERGE_ACL: - local_error += merge_acl(entry->acl, &acl, - file->fts_path); + if (R_flag && file->fts_info != FTS_D && + acl_type == ACL_TYPE_NFS4) + nacl = clear_inheritance_flags(nacl); + local_error += merge_acl(nacl, &acl, file->fts_path); need_mask = true; break; case OP_REMOVE_EXT: @@ -240,8 +289,7 @@ handle_file(FTS *ftsp, FTSENT *file) need_mask = false; break; case OP_REMOVE_ACL: - local_error += remove_acl(entry->acl, &acl, - file->fts_path); + local_error += remove_acl(nacl, &acl, file->fts_path); need_mask = true; break; case OP_REMOVE_BY_NUMBER: @@ -250,6 +298,13 @@ handle_file(FTS *ftsp, FTSENT *file) need_mask = true; break; } + + if (nacl != entry->acl) { + acl_free(nacl); + nacl = NULL; + } + if (local_error) + break; } /* From owner-svn-src-stable-12@freebsd.org Sat Nov 10 20:36:49 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C18811109BA9; Sat, 10 Nov 2018 20:36:49 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DB4C7B040; Sat, 10 Nov 2018 20:36:49 +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 2EBB627EB4; Sat, 10 Nov 2018 20:36:49 +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 wAAKanIM058825; Sat, 10 Nov 2018 20:36:49 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAAKanZE058824; Sat, 10 Nov 2018 20:36:49 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811102036.wAAKanZE058824@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 10 Nov 2018 20:36: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: r340333 - 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: 340333 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4DB4C7B040 X-Spamd-Result: default: False [-106.88 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-1.000,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.89), country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2018 20:36:49 -0000 Author: markj Date: Sat Nov 10 20:36:48 2018 New Revision: 340333 URL: https://svnweb.freebsd.org/changeset/base/340333 Log: MFC r340241: Fix a use-after-free in swp_pager_meta_free(). Approved by: re (gjb) Modified: stable/12/sys/vm/swap_pager.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/vm/swap_pager.c ============================================================================== --- stable/12/sys/vm/swap_pager.c Sat Nov 10 20:34:59 2018 (r340332) +++ stable/12/sys/vm/swap_pager.c Sat Nov 10 20:36:48 2018 (r340333) @@ -1972,13 +1972,13 @@ swp_pager_meta_free(vm_object_t object, vm_pindex_t pi swp_pager_update_freerange(&s_free, &n_free, sb->d[i]); sb->d[i] = SWAPBLK_NONE; } + pindex = sb->p + SWAP_META_PAGES; if (swp_pager_swblk_empty(sb, 0, start) && swp_pager_swblk_empty(sb, limit, SWAP_META_PAGES)) { SWAP_PCTRIE_REMOVE(&object->un_pager.swp.swp_blks, sb->p); uma_zfree(swblk_zone, sb); } - pindex = sb->p + SWAP_META_PAGES; } swp_pager_freeswapspace(s_free, n_free); }