From owner-dev-commits-src-main@freebsd.org Wed Dec 23 04:29:09 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A7CC54B2077; Wed, 23 Dec 2020 04:29:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D10b94C47z3pc2; Wed, 23 Dec 2020 04:29:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8387417FB6; Wed, 23 Dec 2020 04:29:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BN4T94K083029; Wed, 23 Dec 2020 04:29:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BN4T9an083028; Wed, 23 Dec 2020 04:29:09 GMT (envelope-from git) Date: Wed, 23 Dec 2020 04:29:09 GMT Message-Id: <202012230429.0BN4T9an083028@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Li-Wen Hsu Subject: git: 5ef5f51d2bef - Mark the repository has been converted to Git MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: lwhsu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5ef5f51d2bef80b0ede9b10ad5b0e9440b60518c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2020 04:29:09 -0000 The branch main has been updated by lwhsu: URL: https://cgit.FreeBSD.org/src/commit/?id=5ef5f51d2bef80b0ede9b10ad5b0e9440b60518c commit 5ef5f51d2bef80b0ede9b10ad5b0e9440b60518c Author: Li-Wen Hsu AuthorDate: 2020-12-23 04:27:27 +0000 Commit: Li-Wen Hsu CommitDate: 2020-12-23 04:27:27 +0000 Mark the repository has been converted to Git This is the first Git commit to src. Sponsored by: The FreeBSD Foundation --- README | 2 -- README.md | 2 -- 2 files changed, 4 deletions(-) diff --git a/README b/README index eb38522b1357..aad363baf9ea 100644 --- a/README +++ b/README @@ -1,5 +1,3 @@ -This repository is being converted from Subversion to Git. - This is the top level of the FreeBSD source directory. This file was last revised on: $FreeBSD$ diff --git a/README.md b/README.md index 0eba39438e46..72bd634cd813 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,3 @@ -This repository is being converted from Subversion to Git. - FreeBSD Source: --------------- This is the top level of the FreeBSD source directory. This file From owner-dev-commits-src-main@freebsd.org Wed Dec 23 04:32:19 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 60C4A4B23E9; Wed, 23 Dec 2020 04:32:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D10fq2LPqz3q0h; Wed, 23 Dec 2020 04:32:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 42E4B18397; Wed, 23 Dec 2020 04:32:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BN4WJEL001562; Wed, 23 Dec 2020 04:32:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BN4WJIi001561; Wed, 23 Dec 2020 04:32:19 GMT (envelope-from git) Date: Wed, 23 Dec 2020 04:32:19 GMT Message-Id: <202012230432.0BN4WJIi001561@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 17eba5e32a2c - newvers.sh: fix sense of git dirty check MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 17eba5e32a2cf7a217bb9f1e5dcca351f2b71cfc Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2020 04:32:19 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=17eba5e32a2cf7a217bb9f1e5dcca351f2b71cfc commit 17eba5e32a2cf7a217bb9f1e5dcca351f2b71cfc Author: Ed Maste AuthorDate: 2020-12-23 04:31:15 +0000 Commit: Ed Maste CommitDate: 2020-12-23 04:31:15 +0000 newvers.sh: fix sense of git dirty check Previously we reported -dirty for an unmodified tree, and no -dirty if there were changes. PR: 252028 Reported by: John Kennedy --- sys/conf/newvers.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index f5e34b4946a5..5ce93567e3af 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -162,7 +162,7 @@ findvcs() git_tree_modified() { - $git_cmd "--work-tree=${VCSTOP}" -c core.checkStat=minimal -c core.fileMode=off diff --quiet + ! $git_cmd "--work-tree=${VCSTOP}" -c core.checkStat=minimal -c core.fileMode=off diff --quiet } LC_ALL=C; export LC_ALL From owner-dev-commits-src-main@freebsd.org Wed Dec 23 05:05:03 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1F4E34B267F; Wed, 23 Dec 2020 05:05:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D11Nb0G86z3rKq; Wed, 23 Dec 2020 05:05:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F02D218AD4; Wed, 23 Dec 2020 05:05:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BN552GJ036377; Wed, 23 Dec 2020 05:05:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BN5526v036376; Wed, 23 Dec 2020 05:05:02 GMT (envelope-from git) Date: Wed, 23 Dec 2020 05:05:02 GMT Message-Id: <202012230505.0BN5526v036376@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Xin LI Subject: git: 1cc908de3ab2 - Remove unused includes. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: delphij X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1cc908de3ab2e11fca648fc874df2f9d255fc087 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2020 05:05:03 -0000 The branch main has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=1cc908de3ab2e11fca648fc874df2f9d255fc087 commit 1cc908de3ab2e11fca648fc874df2f9d255fc087 Author: Xin LI AuthorDate: 2020-12-23 05:04:36 +0000 Commit: Xin LI CommitDate: 2020-12-23 05:04:36 +0000 Remove unused includes. --- bin/sleep/sleep.c | 2 -- bin/test/test.c | 2 -- 2 files changed, 4 deletions(-) diff --git a/bin/sleep/sleep.c b/bin/sleep/sleep.c index 0515e944181b..b4b54a336100 100644 --- a/bin/sleep/sleep.c +++ b/bin/sleep/sleep.c @@ -42,12 +42,10 @@ static char sccsid[] = "@(#)sleep.c 8.3 (Berkeley) 4/2/94"; __FBSDID("$FreeBSD$"); #include -#include #include #include #include #include -#include #include #include #include diff --git a/bin/test/test.c b/bin/test/test.c index b500067649f8..1570238300e9 100644 --- a/bin/test/test.c +++ b/bin/test/test.c @@ -24,9 +24,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include -#include #include #include #include From owner-dev-commits-src-main@freebsd.org Wed Dec 23 05:12:34 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1EF804B3321; Wed, 23 Dec 2020 05:12:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D11YG0Jm2z3rmZ; Wed, 23 Dec 2020 05:12:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F1D8718D80; Wed, 23 Dec 2020 05:12:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BN5CXRL047777; Wed, 23 Dec 2020 05:12:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BN5CXUq047776; Wed, 23 Dec 2020 05:12:33 GMT (envelope-from git) Date: Wed, 23 Dec 2020 05:12:33 GMT Message-Id: <202012230512.0BN5CXUq047776@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: cd698c51790e - netgraph: Fix ng_ether's shutdown handing MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cd698c51790e956fed0975f451d3dfc361dc7c24 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2020 05:12:34 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=cd698c51790e956fed0975f451d3dfc361dc7c24 commit cd698c51790e956fed0975f451d3dfc361dc7c24 Author: Mark Johnston AuthorDate: 2020-12-23 05:11:16 +0000 Commit: Mark Johnston CommitDate: 2020-12-23 05:12:16 +0000 netgraph: Fix ng_ether's shutdown handing When tearing down a VNET, netgraph sends shutdown messages to all of the nodes before detaching interfaces (SI_SUB_NETGRAPH comes before SI_SUB_INIT_IF in teardown order). ng_ether nodes handle this by destroying themselves without detaching from the parent ifnet. Then, when ifnets go away they detach their ng_ether nodes again, triggering a use-after-free. Handle this by modifying ng_ether_shutdown() to detach from the ifnet. If the shutdown was triggered by an ifnet being destroyed, we will clear priv->ifp in the ng_ether detach callback, so priv->ifp may be NULL. Also get rid of the printf in vnet_netgraph_uninit(). It can be triggered trivially by ng_ether since ng_ether_shutdown() persists the node unless NG_REALLY_DIE is set. PR: 233622 Reviewed by: afedorov, kp, Lutz Donnerhacke MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D27662 --- sys/netgraph/ng_base.c | 4 +--- sys/netgraph/ng_ether.c | 13 ++++++------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/sys/netgraph/ng_base.c b/sys/netgraph/ng_base.c index c5b38dc1fdd6..dadf86eb8dde 100644 --- a/sys/netgraph/ng_base.c +++ b/sys/netgraph/ng_base.c @@ -3166,12 +3166,10 @@ vnet_netgraph_uninit(const void *unused __unused) /* Attempt to kill it only if it is a regular node */ if (node != NULL) { if (node == last_killed) { - /* This should never happen */ - printf("ng node %s needs NGF_REALLY_DIE\n", - node->nd_name); if (node->nd_flags & NGF_REALLY_DIE) panic("ng node %s won't die", node->nd_name); + /* The node persisted itself. Try again. */ node->nd_flags |= NGF_REALLY_DIE; } ng_rmnode(node, NULL, NULL, 0); diff --git a/sys/netgraph/ng_ether.c b/sys/netgraph/ng_ether.c index 0d0d5f990f84..5718de235c4c 100644 --- a/sys/netgraph/ng_ether.c +++ b/sys/netgraph/ng_ether.c @@ -414,8 +414,7 @@ ng_ether_ifnet_arrival_event(void *arg __unused, struct ifnet *ifp) node_p node; /* Only ethernet interfaces are of interest. */ - if (ifp->if_type != IFT_ETHER - && ifp->if_type != IFT_L2VLAN) + if (ifp->if_type != IFT_ETHER && ifp->if_type != IFT_L2VLAN) return; /* @@ -753,13 +752,13 @@ ng_ether_shutdown(node_p node) if (node->nd_flags & NGF_REALLY_DIE) { /* - * WE came here because the ethernet card is being unloaded, - * so stop being persistent. - * Actually undo all the things we did on creation. - * Assume the ifp has already been freed. + * The ifnet is going away, perhaps because the driver was + * unloaded or its vnet is being torn down. */ NG_NODE_SET_PRIVATE(node, NULL); - free(priv, M_NETGRAPH); + if (priv->ifp != NULL) + IFP2NG(priv->ifp) = NULL; + free(priv, M_NETGRAPH); NG_NODE_UNREF(node); /* free node itself */ return (0); } From owner-dev-commits-src-main@freebsd.org Wed Dec 23 07:25:45 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E2EEA4B6188; Wed, 23 Dec 2020 07:25:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D14Vx65xtz4SXp; Wed, 23 Dec 2020 07:25:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C46F31A276; Wed, 23 Dec 2020 07:25:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BN7PjlX096552; Wed, 23 Dec 2020 07:25:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BN7Pjmb096551; Wed, 23 Dec 2020 07:25:45 GMT (envelope-from git) Date: Wed, 23 Dec 2020 07:25:45 GMT Message-Id: <202012230725.0BN7Pjmb096551@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 906a73e791a0 - cache: fix up cache_hold_vnode comment MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 906a73e791a005e228c1e3c9f8cb1e581359c786 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2020 07:25:45 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=906a73e791a005e228c1e3c9f8cb1e581359c786 commit 906a73e791a005e228c1e3c9f8cb1e581359c786 Author: Mateusz Guzik AuthorDate: 2020-12-23 07:23:08 +0000 Commit: Mateusz Guzik CommitDate: 2020-12-23 07:24:29 +0000 cache: fix up cache_hold_vnode comment --- sys/kern/vfs_cache.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index be2ed58ff4fc..38121893126e 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -514,9 +514,8 @@ cache_assert_vnode_locked(struct vnode *vp) * 1. make them less of a target for reclamation in vnlru * 2. suffer smaller performance penalty in locked lookup as requeieing is avoided * - * Note this preferably would not be done and it's a hold over from. It will be - * feasible to eliminate altogether if all filesystems start supporting - * lockless lookup. + * It will be feasible to stop doing it altogether if all filesystems start + * supporting lockless lookup. */ static void cache_hold_vnode(struct vnode *vp) From owner-dev-commits-src-main@freebsd.org Wed Dec 23 07:59:58 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0CCB94B689B; Wed, 23 Dec 2020 07:59:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D15GP6wfbz4Txw; Wed, 23 Dec 2020 07:59:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E0F051AD0D; Wed, 23 Dec 2020 07:59:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BN7xvR5031240; Wed, 23 Dec 2020 07:59:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BN7xvZZ031239; Wed, 23 Dec 2020 07:59:57 GMT (envelope-from git) Date: Wed, 23 Dec 2020 07:59:57 GMT Message-Id: <202012230759.0BN7xvZZ031239@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 659f1a6aad04 - Improve address generation in the early arm64 boot MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 659f1a6aad04adf0a0d27415f7a967d231ce4cfb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2020 07:59:58 -0000 The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=659f1a6aad04adf0a0d27415f7a967d231ce4cfb commit 659f1a6aad04adf0a0d27415f7a967d231ce4cfb Author: Andrew Turner AuthorDate: 2020-12-23 07:24:07 +0000 Commit: Andrew Turner CommitDate: 2020-12-23 07:54:59 +0000 Improve address generation in the early arm64 boot The adr instruction allows for an address of +-1M from the instruction. If we replace these with an adrp and an add instruction we can generate an address +-4G. The adrp will get an address of the 4k page the label is within, and the add uses the :lo12: prefix to add just the low bits to this address. This will allow us to move things around with fewer issues than if we needed to keep them within the +-1MB range. Sponsored by: Innovate UK --- sys/arm64/arm64/locore.S | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/sys/arm64/arm64/locore.S b/sys/arm64/arm64/locore.S index f438865a961a..6f8d007b2efa 100644 --- a/sys/arm64/arm64/locore.S +++ b/sys/arm64/arm64/locore.S @@ -127,7 +127,8 @@ _start: bl start_mmu /* Load the new ttbr0 pagetable */ - adr x27, pagetable_l0_ttbr0 + adrp x27, pagetable_l0_ttbr0 + add x27, x27, :lo12:pagetable_l0_ttbr0 /* Jump to the virtual address space */ ldr x15, .Lvirtdone @@ -135,7 +136,8 @@ _start: virtdone: /* Set up the stack */ - adr x25, initstack_end + adrp x25, initstack_end + add x25, x25, :lo12:initstack_end mov sp, x25 sub sp, sp, #PCB_SIZE @@ -163,7 +165,8 @@ virtdone: str x1, [x0, #BP_MODULEP] str x26, [x0, #BP_KERN_L1PT] str x29, [x0, #BP_KERN_DELTA] - adr x25, initstack + adrp x25, initstack + add x25, x25, :lo12:initstack str x25, [x0, #BP_KERN_STACK] str x24, [x0, #BP_KERN_L0PT] str x27, [x0, #BP_KERN_TTBR0] @@ -206,15 +209,18 @@ ENTRY(mpentry) msr contextidr_el1, xzr /* Load the kernel page table */ - adr x24, pagetable_l0_ttbr1 + adrp x24, pagetable_l0_ttbr1 + add x24, x24, :lo12:pagetable_l0_ttbr1 /* Load the identity page table */ - adr x27, pagetable_l0_ttbr0_boostrap + adrp x27, pagetable_l0_ttbr0_boostrap + add x27, x27, :lo12:pagetable_l0_ttbr0_boostrap /* Enable the mmu */ bl start_mmu /* Load the new ttbr0 pagetable */ - adr x27, pagetable_l0_ttbr0 + adrp x27, pagetable_l0_ttbr0 + add x27, x27, :lo12:pagetable_l0_ttbr0 /* Jump to the virtual address space */ ldr x15, =mp_virtdone @@ -282,7 +288,8 @@ drop_to_el1: msr cntvoff_el2, xzr /* Hypervisor trap functions */ - adr x2, hyp_vectors + adrp x2, hyp_vectors + add x2, x2, :lo12:hyp_vectors msr vbar_el2, x2 mov x2, #(PSR_F | PSR_I | PSR_A | PSR_D | PSR_M_EL1h) @@ -345,7 +352,8 @@ hyp_vectors: */ get_virt_delta: /* Load the physical address of virt_map */ - adr x29, virt_map + adrp x29, virt_map + add x29, x29, :lo12:virt_map /* Load the virtual address of virt_map stored in virt_map */ ldr x28, [x29] /* Find PA - VA as PA' = VA' - VA + PA = VA' + (PA - VA) = VA' + x29 */ @@ -383,9 +391,11 @@ create_pagetables: mov x5, x30 /* Clean the page table */ - adr x6, pagetable + adrp x6, pagetable + add x6, x6, :lo12:pagetable mov x26, x6 - adr x27, pagetable_end + adrp x27, pagetable_end + add x27, x27, :lo12:pagetable_end 1: stp xzr, xzr, [x6], #16 stp xzr, xzr, [x6], #16 @@ -474,7 +484,8 @@ common: /* Link the DMAP tables */ ldr x8, =DMAP_MIN_ADDRESS - adr x9, pagetable_dmap; + adrp x9, pagetable_dmap + add x9, x9, :lo12:pagetable_dmap mov x10, #DMAP_TABLES bl link_l0_pagetable From owner-dev-commits-src-main@freebsd.org Wed Dec 23 08:11:56 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3FA0A4B71AF; Wed, 23 Dec 2020 08:11:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D15XD1Nd8z4VNY; Wed, 23 Dec 2020 08:11:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 22AB71AAF6; Wed, 23 Dec 2020 08:11:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BN8BuVP054474; Wed, 23 Dec 2020 08:11:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BN8Bu4q054473; Wed, 23 Dec 2020 08:11:56 GMT (envelope-from git) Date: Wed, 23 Dec 2020 08:11:56 GMT Message-Id: <202012230811.0BN8Bu4q054473@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: 2ac1c1927258 - psm(4): Always initialize Synaptics touchpad report range with defaults MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2ac1c1927258e649e3ca3269aea40fb4c63e2296 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2020 08:11:56 -0000 The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=2ac1c1927258e649e3ca3269aea40fb4c63e2296 commit 2ac1c1927258e649e3ca3269aea40fb4c63e2296 Author: Vladimir Kondratyev AuthorDate: 2020-12-22 20:44:42 +0000 Commit: Vladimir Kondratyev CommitDate: 2020-12-23 08:10:53 +0000 psm(4): Always initialize Synaptics touchpad report range with defaults Otherwise libinput refuses to recoginize some Synaptics touchpads with "kernel bug: device has min == max on ABS_X" message in Xorg.log. PR: 251149 Reported-by: Jens Grassel Tested-by: Jens Grassel MFC-after: 2 weeks --- sys/dev/atkbdc/psm.c | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/sys/dev/atkbdc/psm.c b/sys/dev/atkbdc/psm.c index f2c4cc71e242..3774b0a3b734 100644 --- a/sys/dev/atkbdc/psm.c +++ b/sys/dev/atkbdc/psm.c @@ -6423,6 +6423,15 @@ enable_synaptics(struct psm_softc *sc, enum probearg arg) printf(" infoGeometry: %d\n", synhw.infoGeometry); } + /* + * Typical bezel limits. Taken from 'Synaptics + * PS/2 * TouchPad Interfacing Guide' p.3.2.3. + */ + synhw.maximumXCoord = 5472; + synhw.maximumYCoord = 4448; + synhw.minimumXCoord = 1472; + synhw.minimumYCoord = 1408; + /* Read the extended capability bits. */ if (mouse_ext_command(kbdc, SYNAPTICS_READ_CAPABILITIES) == 0) return (FALSE); @@ -6564,13 +6573,6 @@ enable_synaptics(struct psm_softc *sc, enum probearg arg) ((status[1] & 0x0f) << 1); synhw.maximumYCoord = (status[2] << 5) | ((status[1] & 0xf0) >> 3); - } else { - /* - * Typical bezel limits. Taken from 'Synaptics - * PS/2 * TouchPad Interfacing Guide' p.3.2.3. - */ - synhw.maximumXCoord = 5472; - synhw.maximumYCoord = 4448; } if (synhw.capReportsMin) { @@ -6586,13 +6588,6 @@ enable_synaptics(struct psm_softc *sc, enum probearg arg) ((status[1] & 0x0f) << 1); synhw.minimumYCoord = (status[2] << 5) | ((status[1] & 0xf0) >> 3); - } else { - /* - * Typical bezel limits. Taken from 'Synaptics - * PS/2 * TouchPad Interfacing Guide' p.3.2.3. - */ - synhw.minimumXCoord = 1472; - synhw.minimumYCoord = 1408; } /* From owner-dev-commits-src-main@freebsd.org Wed Dec 23 08:11:56 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 682254B6FBC; Wed, 23 Dec 2020 08:11:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D15XD2S9kz4VVg; Wed, 23 Dec 2020 08:11:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 472491ABD4; Wed, 23 Dec 2020 08:11:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BN8BunM054508; Wed, 23 Dec 2020 08:11:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BN8Bu9M054507; Wed, 23 Dec 2020 08:11:56 GMT (envelope-from git) Date: Wed, 23 Dec 2020 08:11:56 GMT Message-Id: <202012230811.0BN8Bu9M054507@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: 54d2dfc4b24d - cyapa(4): Add support for evdev protocol MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 54d2dfc4b24db110c8a4b75e2f02a2360fd9fc8c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2020 08:11:56 -0000 The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=54d2dfc4b24db110c8a4b75e2f02a2360fd9fc8c commit 54d2dfc4b24db110c8a4b75e2f02a2360fd9fc8c Author: Vladimir Kondratyev AuthorDate: 2020-12-21 15:44:28 +0000 Commit: Vladimir Kondratyev CommitDate: 2020-12-23 08:10:49 +0000 cyapa(4): Add support for evdev protocol Tested-by: Matthias Apitz MFC-after: 2 weeks --- sys/dev/cyapa/cyapa.c | 89 ++++++++++++++++++++++++++++++++++++++++++ sys/modules/i2c/cyapa/Makefile | 3 +- 2 files changed, 91 insertions(+), 1 deletion(-) diff --git a/sys/dev/cyapa/cyapa.c b/sys/dev/cyapa/cyapa.c index 644d59ae095f..caad161cb56a 100644 --- a/sys/dev/cyapa/cyapa.c +++ b/sys/dev/cyapa/cyapa.c @@ -99,6 +99,8 @@ __FBSDID("$FreeBSD$"); * below) the other two. */ +#include "opt_evdev.h" + #include #include #include @@ -126,6 +128,11 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef EVDEV_SUPPORT +#include +#include +#endif + #include "iicbus_if.h" #include "bus_if.h" #include "device_if.h" @@ -153,6 +160,9 @@ struct cyapa_softc { struct selinfo selinfo; struct mtx mutex; struct intr_config_hook intr_hook; +#ifdef EVDEV_SUPPORT + struct evdev_dev *evdev; +#endif int cap_resx; int cap_resy; @@ -562,8 +572,47 @@ cyapa_attach(device_t dev) sc->intr_hook.ich_func = cyapa_start; sc->intr_hook.ich_arg = sc->dev; +#ifdef EVDEV_SUPPORT + sc->evdev = evdev_alloc(); + evdev_set_name(sc->evdev, device_get_desc(sc->dev)); + evdev_set_phys(sc->evdev, device_get_nameunit(sc->dev)); + evdev_set_id(sc->evdev, BUS_I2C, 0, 0, 1); + evdev_set_flag(sc->evdev, EVDEV_FLAG_MT_STCOMPAT); + evdev_set_flag(sc->evdev, EVDEV_FLAG_MT_AUTOREL); + + evdev_support_event(sc->evdev, EV_SYN); + evdev_support_event(sc->evdev, EV_ABS); + evdev_support_event(sc->evdev, EV_KEY); + evdev_support_prop(sc->evdev, INPUT_PROP_POINTER); + if (sc->cap_buttons & CYAPA_FNGR_LEFT) + evdev_support_key(sc->evdev, BTN_LEFT); + if (sc->cap_buttons & CYAPA_FNGR_RIGHT) + evdev_support_key(sc->evdev, BTN_RIGHT); + if (sc->cap_buttons & CYAPA_FNGR_MIDDLE) + evdev_support_key(sc->evdev, BTN_MIDDLE); + if (sc->cap_buttons == CYAPA_FNGR_LEFT) + evdev_support_prop(sc->evdev, INPUT_PROP_BUTTONPAD); + + evdev_support_abs(sc->evdev, ABS_MT_SLOT, + 0, 0, CYAPA_MAX_MT - 1, 0, 0, 0); + evdev_support_abs(sc->evdev, ABS_MT_TRACKING_ID, 0, -1, 15, 0, 0, 0); + evdev_support_abs(sc->evdev, ABS_MT_POSITION_X, 0, 0, sc->cap_resx, + 0, 0, sc->cap_phyx != 0 ? sc->cap_resx / sc->cap_phyx : 0); + evdev_support_abs(sc->evdev, ABS_MT_POSITION_Y, 0, 0, sc->cap_resy, + 0, 0, sc->cap_phyy != 0 ? sc->cap_resy / sc->cap_phyy : 0); + evdev_support_abs(sc->evdev, ABS_MT_PRESSURE, 0, 0, 255, 0, 0, 0); + + if (evdev_register(sc->evdev) != 0) { + mtx_destroy(&sc->mutex); + return (ENOMEM); + } +#endif + /* Postpone start of the polling thread until sleep is available */ if (config_intrhook_establish(&sc->intr_hook) != 0) { +#ifdef EVDEV_SUPPORT + evdev_free(sc->evdev); +#endif mtx_destroy(&sc->mutex); return (ENOMEM); } @@ -596,6 +645,9 @@ cyapa_detach(device_t dev) knlist_clear(&sc->selinfo.si_note, 0); seldrain(&sc->selinfo); knlist_destroy(&sc->selinfo.si_note); +#ifdef EVDEV_SUPPORT + evdev_free(sc->evdev); +#endif mtx_destroy(&sc->mutex); @@ -1322,6 +1374,40 @@ cyapa_raw_input(struct cyapa_softc *sc, struct cyapa_regs *regs, int freq) nfingers); } +#ifdef EVDEV_SUPPORT + if (evdev_rcpt_mask & EVDEV_RCPT_HW_MOUSE) { + for (i = 0; i < nfingers; ++i) { + int32_t slot = evdev_get_mt_slot_by_tracking_id( + sc->evdev, regs->touch[i].id); + if (slot == -1) { + if (cyapa_debug) + printf("Slot overflow for i=%d\n", + regs->touch[i].id); + continue; + } + evdev_push_abs(sc->evdev, ABS_MT_SLOT, slot); + evdev_push_abs(sc->evdev, ABS_MT_TRACKING_ID, + regs->touch[i].id); + evdev_push_abs(sc->evdev, ABS_MT_POSITION_X, + CYAPA_TOUCH_X(regs, i)); + evdev_push_abs(sc->evdev, ABS_MT_POSITION_Y, + CYAPA_TOUCH_Y(regs, i)); + evdev_push_abs(sc->evdev, ABS_MT_PRESSURE, + CYAPA_TOUCH_P(regs, i)); + } + if (sc->cap_buttons & CYAPA_FNGR_LEFT) + evdev_push_key(sc->evdev, BTN_LEFT, + regs->fngr & CYAPA_FNGR_LEFT); + if (sc->cap_buttons & CYAPA_FNGR_RIGHT) + evdev_push_key(sc->evdev, BTN_RIGHT, + regs->fngr & CYAPA_FNGR_RIGHT); + if (sc->cap_buttons & CYAPA_FNGR_MIDDLE) + evdev_push_key(sc->evdev, BTN_MIDDLE, + regs->fngr & CYAPA_FNGR_MIDDLE); + evdev_sync(sc->evdev); + } +#endif + seen_thumb = 0; for (i = 0; i < afingers; ) { if (cyapa_debug) { @@ -1732,4 +1818,7 @@ cyapa_fuzz(int delta, int *fuzzp) DRIVER_MODULE(cyapa, iicbus, cyapa_driver, cyapa_devclass, NULL, NULL); MODULE_DEPEND(cyapa, iicbus, IICBUS_MINVER, IICBUS_PREFVER, IICBUS_MAXVER); +#ifdef EVDEV_SUPPORT +MODULE_DEPEND(cyapa, evdev, 1, 1, 1); +#endif MODULE_VERSION(cyapa, 1); diff --git a/sys/modules/i2c/cyapa/Makefile b/sys/modules/i2c/cyapa/Makefile index 0f5b3aa26561..817c5ba68777 100644 --- a/sys/modules/i2c/cyapa/Makefile +++ b/sys/modules/i2c/cyapa/Makefile @@ -2,6 +2,7 @@ .PATH: ${SRCTOP}/sys/dev/cyapa KMOD = cyapa -SRCS = cyapa.c device_if.h bus_if.h iicbus_if.h vnode_if.h +SRCS = cyapa.c device_if.h bus_if.h iicbus_if.h vnode_if.h \ + opt_evdev.h .include From owner-dev-commits-src-main@freebsd.org Wed Dec 23 08:11:56 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 52CE74B6F61; Wed, 23 Dec 2020 08:11:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D15XD1vh0z4VSk; Wed, 23 Dec 2020 08:11:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 34C331AAF7; Wed, 23 Dec 2020 08:11:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BN8BuN8054491; Wed, 23 Dec 2020 08:11:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BN8BuWI054490; Wed, 23 Dec 2020 08:11:56 GMT (envelope-from git) Date: Wed, 23 Dec 2020 08:11:56 GMT Message-Id: <202012230811.0BN8BuWI054490@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: bde56c994264 - acpi_wmi(4): Allow attachment to ACPI node if EC is not found MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bde56c99426431c6319afd35c2a3cd66e315034a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2020 08:11:56 -0000 The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=bde56c99426431c6319afd35c2a3cd66e315034a commit bde56c99426431c6319afd35c2a3cd66e315034a Author: Vladimir Kondratyev AuthorDate: 2020-12-21 15:48:50 +0000 Commit: Vladimir Kondratyev CommitDate: 2020-12-23 08:10:53 +0000 acpi_wmi(4): Allow attachment to ACPI node if EC is not found Conducted tests showed that Embedded Controller is not mandatory for WMI extensions to work. Reported-by: yuripv Reviewed-by: avg MFC-after: 2 weeks Differential-Revision: https://reviews.freebsd.org/D27653 --- sys/dev/acpi_support/acpi_wmi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/dev/acpi_support/acpi_wmi.c b/sys/dev/acpi_support/acpi_wmi.c index 379cfd1705f1..efae96cdcc9a 100644 --- a/sys/dev/acpi_support/acpi_wmi.c +++ b/sys/dev/acpi_support/acpi_wmi.c @@ -246,7 +246,7 @@ acpi_wmi_attach(device_t dev) if ((sc->ec_dev = devclass_get_device(devclass_find("acpi_ec"), 0)) == NULL) device_printf(dev, "cannot find EC device\n"); - else if (ACPI_FAILURE((status = AcpiInstallNotifyHandler(sc->wmi_handle, + if (ACPI_FAILURE((status = AcpiInstallNotifyHandler(sc->wmi_handle, ACPI_DEVICE_NOTIFY, acpi_wmi_notify_handler, sc)))) device_printf(sc->wmi_dev, "couldn't install notify handler - %s\n", AcpiFormatException(status)); @@ -701,6 +701,8 @@ acpi_wmi_ec_handler(UINT32 function, ACPI_PHYSICAL_ADDRESS address, return (AE_BAD_PARAMETER); if (address + (width / 8) - 1 > 0xFF) return (AE_BAD_ADDRESS); + if (sc->ec_dev == NULL) + return (AE_NOT_FOUND); if (function == ACPI_READ) *value = 0; ec_addr = address; From owner-dev-commits-src-main@freebsd.org Wed Dec 23 08:11:56 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 834794B6F69; Wed, 23 Dec 2020 08:11:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D15XD31z8z4V8D; Wed, 23 Dec 2020 08:11:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5913D1AF89; Wed, 23 Dec 2020 08:11:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BN8BuYj054525; Wed, 23 Dec 2020 08:11:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BN8Bu22054524; Wed, 23 Dec 2020 08:11:56 GMT (envelope-from git) Date: Wed, 23 Dec 2020 08:11:56 GMT Message-Id: <202012230811.0BN8Bu22054524@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: a223aa8abd6d - cyapa(4): Make button detection matching ChromeOS driver MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a223aa8abd6d1bf9547262c9a52333bcf4d0d13a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2020 08:11:56 -0000 The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=a223aa8abd6d1bf9547262c9a52333bcf4d0d13a commit a223aa8abd6d1bf9547262c9a52333bcf4d0d13a Author: Vladimir Kondratyev AuthorDate: 2020-12-21 15:24:09 +0000 Commit: Vladimir Kondratyev CommitDate: 2020-12-23 08:09:25 +0000 cyapa(4): Make button detection matching ChromeOS driver Tested-by: Matthias Apitz MFC-after: 2 weeks --- sys/dev/cyapa/cyapa.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sys/dev/cyapa/cyapa.c b/sys/dev/cyapa/cyapa.c index 293d68e9abdc..644d59ae095f 100644 --- a/sys/dev/cyapa/cyapa.c +++ b/sys/dev/cyapa/cyapa.c @@ -536,13 +536,14 @@ cyapa_attach(device_t dev) cap.phy_siz_x_low; sc->cap_phyy = ((cap.phy_siz_xy_high << 8) & 0x0F00) | cap.phy_siz_y_low; - sc->cap_buttons = cap.buttons; + sc->cap_buttons = cap.buttons >> 3 & + (CYAPA_FNGR_LEFT | CYAPA_FNGR_RIGHT | CYAPA_FNGR_MIDDLE); device_printf(dev, "%5.5s-%6.6s-%2.2s buttons=%c%c%c res=%dx%d\n", cap.prod_ida, cap.prod_idb, cap.prod_idc, - ((cap.buttons & CYAPA_FNGR_LEFT) ? 'L' : '-'), - ((cap.buttons & CYAPA_FNGR_MIDDLE) ? 'M' : '-'), - ((cap.buttons & CYAPA_FNGR_RIGHT) ? 'R' : '-'), + ((sc->cap_buttons & CYAPA_FNGR_LEFT) ? 'L' : '-'), + ((sc->cap_buttons & CYAPA_FNGR_MIDDLE) ? 'M' : '-'), + ((sc->cap_buttons & CYAPA_FNGR_RIGHT) ? 'R' : '-'), sc->cap_resx, sc->cap_resy); sc->hw.buttons = 5; From owner-dev-commits-src-main@freebsd.org Wed Dec 23 08:24:52 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C36BD4B76C3; Wed, 23 Dec 2020 08:24:52 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D15q84gqRz4WSp; Wed, 23 Dec 2020 08:24:52 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from [192.168.0.30] (unknown [176.120.244.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: wulf) by smtp.freebsd.org (Postfix) with ESMTPSA id 1D1422460C; Wed, 23 Dec 2020 08:24:51 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Subject: Re: git: 2ac1c1927258 - psm(4): Always initialize Synaptics touchpad report range with defaults From: Vladimir Kondratyev To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202012230811.0BN8Bu4q054473@gitrepo.freebsd.org> Message-ID: <12865df7-3904-d8a0-dce5-938d4f8622c5@FreeBSD.org> Date: Wed, 23 Dec 2020 11:24:00 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: <202012230811.0BN8Bu4q054473@gitrepo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2020 08:24:52 -0000 On 23.12.2020 11:11, Vladimir Kondratyev wrote: > The branch main has been updated by wulf: > > URL: https://cgit.FreeBSD.org/src/commit/?id=2ac1c1927258e649e3ca3269aea40fb4c63e2296 > > commit 2ac1c1927258e649e3ca3269aea40fb4c63e2296 > Author: Vladimir Kondratyev > AuthorDate: 2020-12-22 20:44:42 +0000 > Commit: Vladimir Kondratyev > CommitDate: 2020-12-23 08:10:53 +0000 > > psm(4): Always initialize Synaptics touchpad report range with defaults > > Otherwise libinput refuses to recoginize some Synaptics touchpads with > "kernel bug: device has min == max on ABS_X" message in Xorg.log. > > PR: 251149 Pushing multiple commits results in bugzilla updated with all of them, not with the only one referencing the PR. See: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=251149 > Reported-by: Jens Grassel > Tested-by: Jens Grassel > MFC-after: 2 weeks > --- > sys/dev/atkbdc/psm.c | 23 +++++++++-------------- > 1 file changed, 9 insertions(+), 14 deletions(-) > > diff --git a/sys/dev/atkbdc/psm.c b/sys/dev/atkbdc/psm.c > index f2c4cc71e242..3774b0a3b734 100644 > --- a/sys/dev/atkbdc/psm.c > +++ b/sys/dev/atkbdc/psm.c > @@ -6423,6 +6423,15 @@ enable_synaptics(struct psm_softc *sc, enum probearg arg) > printf(" infoGeometry: %d\n", synhw.infoGeometry); > } From owner-dev-commits-src-main@freebsd.org Wed Dec 23 08:56:28 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B69D44B7BEF; Wed, 23 Dec 2020 08:56:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D16Wc4n2Bz4YSs; Wed, 23 Dec 2020 08:56:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 924011B8E1; Wed, 23 Dec 2020 08:56:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BN8uS28000598; Wed, 23 Dec 2020 08:56:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BN8uSWq000597; Wed, 23 Dec 2020 08:56:28 GMT (envelope-from git) Date: Wed, 23 Dec 2020 08:56:28 GMT Message-Id: <202012230856.0BN8uSWq000597@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 994e47023ac8 - vxlan: stop checking CSUM_ENCAP_VXLAN when converting inner CSUM flags into normal, for decapsulation. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 994e47023ac87ede16e9c785ac5d6880e3d3a23c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2020 08:56:28 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=994e47023ac87ede16e9c785ac5d6880e3d3a23c commit 994e47023ac87ede16e9c785ac5d6880e3d3a23c Author: Konstantin Belousov AuthorDate: 2020-12-21 16:59:26 +0000 Commit: Konstantin Belousov CommitDate: 2020-12-23 08:54:06 +0000 vxlan: stop checking CSUM_ENCAP_VXLAN when converting inner CSUM flags into normal, for decapsulation. The packet, if processed at this point, was already parsed to be UDP directed to a vxlan port. Connect-X 4+ does not provide easy method to infer which parser processed the packet, so driver cannot set the flag without a lot of efforts which are only to satisfy the formal requirements. Reviewed by: bryanv, np Sponsored by: Mellanox Technologies/NVidia Networking Differential revision: https://reviews.freebsd.org/D27449 MFC after: 1 week --- sys/net/if_vxlan.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/net/if_vxlan.c b/sys/net/if_vxlan.c index 9f6541f9db43..d0d335dba9ed 100644 --- a/sys/net/if_vxlan.c +++ b/sys/net/if_vxlan.c @@ -2824,8 +2824,7 @@ vxlan_input(struct vxlan_socket *vso, uint32_t vni, struct mbuf **m0, m_clrprotoflags(m); m->m_pkthdr.rcvif = ifp; M_SETFIB(m, ifp->if_fib); - if (m->m_pkthdr.csum_flags & CSUM_ENCAP_VXLAN && - ((ifp->if_capenable & IFCAP_RXCSUM && + if (((ifp->if_capenable & IFCAP_RXCSUM && m->m_pkthdr.csum_flags & CSUM_INNER_L3_CALC) || (ifp->if_capenable & IFCAP_RXCSUM_IPV6 && !(m->m_pkthdr.csum_flags & CSUM_INNER_L3_CALC)))) { From owner-dev-commits-src-main@freebsd.org Wed Dec 23 10:46:10 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 638154BAF4C; Wed, 23 Dec 2020 10:46:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D18yB2QW1z4g7R; Wed, 23 Dec 2020 10:46:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 416AC1CB38; Wed, 23 Dec 2020 10:46:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BNAkAxj027090; Wed, 23 Dec 2020 10:46:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BNAkAEw027089; Wed, 23 Dec 2020 10:46:10 GMT (envelope-from git) Date: Wed, 23 Dec 2020 10:46:10 GMT Message-Id: <202012231046.0BNAkAEw027089@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 84eaf2ccc6aa - x86: stop punishing VMs with low priority for TSC timecounter MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 84eaf2ccc6aa05da7b7389991d3023698b756e3f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2020 10:46:10 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=84eaf2ccc6aa05da7b7389991d3023698b756e3f commit 84eaf2ccc6aa05da7b7389991d3023698b756e3f Author: Konstantin Belousov AuthorDate: 2020-12-21 17:02:31 +0000 Commit: Konstantin Belousov CommitDate: 2020-12-23 10:45:15 +0000 x86: stop punishing VMs with low priority for TSC timecounter I suspect that virtualization techniques improved from the time when we have to effectively disable TSC use in VM. For instance, it was reported (complained) in https://github.com/JuliaLang/julia/issues/38877 that FreeBSD is groundlessly slow on AWS with some loads. Remove the check and start watching for complaints. Reviewed by: emaste, grehan Discussed with: cperciva Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D27629 --- sys/x86/x86/tsc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/x86/x86/tsc.c b/sys/x86/x86/tsc.c index c8e9be0c3cd5..6b5242fb5d4f 100644 --- a/sys/x86/x86/tsc.c +++ b/sys/x86/x86/tsc.c @@ -499,7 +499,7 @@ test_tsc(int adj_max_count) uint64_t *data, *tsc; u_int i, size, adj; - if ((!smp_tsc && !tsc_is_invariant) || vm_guest) + if ((!smp_tsc && !tsc_is_invariant)) return (-100); size = (mp_maxid + 1) * 3; data = malloc(sizeof(*data) * size * N, M_TEMP, M_WAITOK); From owner-dev-commits-src-main@freebsd.org Wed Dec 23 11:05:56 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A24E54BB72A; Wed, 23 Dec 2020 11:05:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D19P04GGRz4hHb; Wed, 23 Dec 2020 11:05:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 813A21D28C; Wed, 23 Dec 2020 11:05:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BNB5uv0049819; Wed, 23 Dec 2020 11:05:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BNB5u2p049818; Wed, 23 Dec 2020 11:05:56 GMT (envelope-from git) Date: Wed, 23 Dec 2020 11:05:56 GMT Message-Id: <202012231105.0BNB5u2p049818@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Hans Petter Selasky Subject: git: ddce63fcb6d0 - Remove not needed variable initialization. And switch from int to bool while at it. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ddce63fcb6d0fe03a5f62fe819e04192c74f27c0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2020 11:05:56 -0000 The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=ddce63fcb6d0fe03a5f62fe819e04192c74f27c0 commit ddce63fcb6d0fe03a5f62fe819e04192c74f27c0 Author: Hans Petter Selasky AuthorDate: 2020-12-23 10:37:44 +0000 Commit: Hans Petter Selasky CommitDate: 2020-12-23 11:04:46 +0000 Remove not needed variable initialization. And switch from int to bool while at it. Reviewed by: melifaro@ Differential Revision: https://reviews.freebsd.org/D27725 MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking --- sys/net/if_ethersubr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c index 8731cb5b0188..77c138d7a092 100644 --- a/sys/net/if_ethersubr.c +++ b/sys/net/if_ethersubr.c @@ -287,7 +287,7 @@ ether_output(struct ifnet *ifp, struct mbuf *m, char linkhdr[ETHER_HDR_LEN], *phdr; struct ether_header *eh; struct pf_mtag *t; - int loop_copy = 1; + bool loop_copy; int hlen; /* link layer header length */ uint32_t pflags; struct llentry *lle = NULL; @@ -357,7 +357,7 @@ ether_output(struct ifnet *ifp, struct mbuf *m, update_mbuf_csumflags(m, m); return (if_simloop(ifp, m, dst->sa_family, 0)); } - loop_copy = pflags & RT_MAY_LOOP; + loop_copy = (pflags & RT_MAY_LOOP) != 0; /* * Add local net header. If no space in first mbuf, From owner-dev-commits-src-main@freebsd.org Wed Dec 23 11:05:56 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8D3224BB531; Wed, 23 Dec 2020 11:05:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D19P03drDz4h6h; Wed, 23 Dec 2020 11:05:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6FADC1CD46; Wed, 23 Dec 2020 11:05:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BNB5uL1049802; Wed, 23 Dec 2020 11:05:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BNB5uYI049801; Wed, 23 Dec 2020 11:05:56 GMT (envelope-from git) Date: Wed, 23 Dec 2020 11:05:56 GMT Message-Id: <202012231105.0BNB5uYI049801@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Hans Petter Selasky Subject: git: 1622a498525b - No need to stop XHCI endpoints in disabled state. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1622a498525b4ef0d23d30a587b9a3888c3ee0d5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2020 11:05:56 -0000 The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=1622a498525b4ef0d23d30a587b9a3888c3ee0d5 commit 1622a498525b4ef0d23d30a587b9a3888c3ee0d5 Author: Hans Petter Selasky AuthorDate: 2020-12-23 10:54:42 +0000 Commit: Hans Petter Selasky CommitDate: 2020-12-23 11:04:51 +0000 No need to stop XHCI endpoints in disabled state. Some AMD XHCI implementations apparently assert a permanent internal failure if this happens. Submitted by: ali.abdallah@suse.com PR: 251503 MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking --- sys/dev/usb/controller/xhci.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/dev/usb/controller/xhci.c b/sys/dev/usb/controller/xhci.c index 1f8877546c27..10e37c97c254 100644 --- a/sys/dev/usb/controller/xhci.c +++ b/sys/dev/usb/controller/xhci.c @@ -3870,6 +3870,8 @@ xhci_configure_reset_endpoint(struct usb_xfer *xfer) * endpoint context state diagram in the XHCI specification: */ switch (xhci_get_endpoint_state(udev, epno)) { + case XHCI_EPCTX_0_EPSTATE_DISABLED: + break; case XHCI_EPCTX_0_EPSTATE_STOPPED: break; case XHCI_EPCTX_0_EPSTATE_HALTED: From owner-dev-commits-src-main@freebsd.org Wed Dec 23 12:03:45 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 252BF4BD724; Wed, 23 Dec 2020 12:03:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D1Bgj0bctz4m65; Wed, 23 Dec 2020 12:03:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 07DB41D9D2; Wed, 23 Dec 2020 12:03:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BNC3iur097149; Wed, 23 Dec 2020 12:03:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BNC3iGs097148; Wed, 23 Dec 2020 12:03:44 GMT (envelope-from git) Date: Wed, 23 Dec 2020 12:03:44 GMT Message-Id: <202012231203.0BNC3iGs097148@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 2d3fda5fa1dc - pf tests: Verify (tcp) checksum modification on unaligned options MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2d3fda5fa1dc99aa8788e5f8d8bb71e682101063 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2020 12:03:45 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=2d3fda5fa1dc99aa8788e5f8d8bb71e682101063 commit 2d3fda5fa1dc99aa8788e5f8d8bb71e682101063 Author: Kristof Provost AuthorDate: 2020-12-19 15:06:03 +0000 Commit: Kristof Provost CommitDate: 2020-12-23 11:03:20 +0000 pf tests: Verify (tcp) checksum modification on unaligned options It turns out pf incorrectly updates the TCP checksum if the TCP option we're modifying is not 2-byte algined with respect to the start of the packet. Create a TCP packet with such an option and throw it through a scrub rule, which will update timestamps and modify the packet. PR: 240416 MFC after: 1 week Differential revision: https://reviews.freebsd.org/D27688 --- tests/sys/netpfil/common/pft_ping.py | 69 +++++++++++++++++++++++++++-- tests/sys/netpfil/pf/Makefile | 1 + tests/sys/netpfil/pf/checksum.sh | 85 ++++++++++++++++++++++++++++++++++++ 3 files changed, 151 insertions(+), 4 deletions(-) diff --git a/tests/sys/netpfil/common/pft_ping.py b/tests/sys/netpfil/common/pft_ping.py index 5d347adf8796..d960426e4b42 100644 --- a/tests/sys/netpfil/common/pft_ping.py +++ b/tests/sys/netpfil/common/pft_ping.py @@ -28,6 +28,7 @@ import argparse import scapy.all as sp +import socket import sys from sniffer import Sniffer @@ -113,6 +114,53 @@ def ping6(send_if, dst_ip, args): req = ether / ip6 / icmp sp.sendp(req, iface=send_if, verbose=False) +def check_tcpsyn(args, packet): + dst_ip = args.to[0] + + ip = packet.getlayer(sp.IP) + if not ip: + return False + if ip.dst != dst_ip: + return False + + tcp = packet.getlayer(sp.TCP) + if not tcp: + return False + + # Verify IP checksum + chksum = ip.chksum + ip.chksum = None + new_chksum = sp.IP(sp.raw(ip)).chksum + if chksum != new_chksum: + print("Expected IP checksum %x but found %x\n" % (new_cshkum, chksum)) + return False + + # Verify TCP checksum + chksum = tcp.chksum + packet_raw = sp.raw(packet) + tcp.chksum = None + newpacket = sp.Ether(sp.raw(packet[sp.Ether])) + new_chksum = newpacket[sp.TCP].chksum + if chksum != new_chksum: + print("Expected TCP checksum %x but found %x\n" % (new_chksum, chksum)) + return False + + return True + +def tcpsyn(send_if, dst_ip, args): + opts=[('Timestamp', (1, 1)), ('MSS', 1280)] + + if args.tcpopt_unaligned: + opts = [('NOP', 0 )] + opts + + ether = sp.Ether() + ip = sp.IP(dst=dst_ip) + tcp = sp.TCP(dport=666, flags='S', options=opts) + + req = ether / ip / tcp + sp.sendp(req, iface=send_if, verbose=False) + + def main(): parser = argparse.ArgumentParser("pft_ping.py", description="Ping test tool") @@ -127,6 +175,12 @@ def main(): required=True, help='The destination IP address for the ICMP echo request') + # TCP options + parser.add_argument('--tcpsyn', action='store_true', + help='Send a TCP SYN packet') + parser.add_argument('--tcpopt_unaligned', action='store_true', + help='Include unaligned TCP options') + # Packet settings parser.add_argument('--send-tos', nargs=1, help='Set the ToS value for the transmitted packet') @@ -142,12 +196,19 @@ def main(): sniffer = None if not args.recvif is None: - sniffer = Sniffer(args, check_ping_request) + checkfn=check_ping_request + if args.tcpsyn: + checkfn=check_tcpsyn - if args.ip6: - ping6(args.sendif[0], args.to[0], args) + sniffer = Sniffer(args, checkfn) + + if args.tcpsyn: + tcpsyn(args.sendif[0], args.to[0], args) else: - ping(args.sendif[0], args.to[0], args) + if args.ip6: + ping6(args.sendif[0], args.to[0], args) + else: + ping(args.sendif[0], args.to[0], args) if sniffer: sniffer.join() diff --git a/tests/sys/netpfil/pf/Makefile b/tests/sys/netpfil/pf/Makefile index 73c85320c013..68f54c801297 100644 --- a/tests/sys/netpfil/pf/Makefile +++ b/tests/sys/netpfil/pf/Makefile @@ -6,6 +6,7 @@ TESTSDIR= ${TESTSBASE}/sys/netpfil/pf TESTS_SUBDIRS+= ioctl ATF_TESTS_SH+= anchor \ + checksum \ forward \ fragmentation \ icmp \ diff --git a/tests/sys/netpfil/pf/checksum.sh b/tests/sys/netpfil/pf/checksum.sh new file mode 100644 index 000000000000..778ae1cd6e9f --- /dev/null +++ b/tests/sys/netpfil/pf/checksum.sh @@ -0,0 +1,85 @@ +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2020 Kristof Provost +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. + +. $(atf_get_srcdir)/utils.subr + +common_dir=$(atf_get_srcdir)/../common + +atf_test_case "unaligned" "cleanup" +unaligned_head() +{ + atf_set descr 'Test unaligned checksum updates' + atf_set require.user root +} + +unaligned_body() +{ + pft_init + + epair_in=$(vnet_mkepair) + epair_out=$(vnet_mkepair) + + vnet_mkjail alcatraz ${epair_in}b ${epair_out}a + + ifconfig ${epair_in}a 192.0.2.2/24 up + route add -net 198.51.100.0/24 192.0.2.1 + + jexec alcatraz ifconfig ${epair_in}b 192.0.2.1/24 up + jexec alcatraz sysctl net.inet.ip.forwarding=1 + + jexec alcatraz ifconfig ${epair_out}a 198.51.100.1/24 up + jexec alcatraz arp -s 198.51.100.2 00:01:02:03:04:05 + + ifconfig ${epair_out}b up + + jexec alcatraz pfctl -e + pft_set_rules alcatraz \ + "scrub on ${epair_in}b reassemble tcp max-mss 1200" + + # Check aligned + atf_check -s exit:0 ${common_dir}/pft_ping.py \ + --sendif ${epair_in}a \ + --to 198.51.100.2 \ + --recvif ${epair_out}b \ + --tcpsyn + + # And unaligned + atf_check -s exit:0 ${common_dir}/pft_ping.py \ + --sendif ${epair_in}a \ + --to 198.51.100.2 \ + --recvif ${epair_out}b \ + --tcpsyn \ + --tcpopt_unaligned +} + +unaligned_cleanup() +{ + pft_cleanup +} + +atf_init_test_cases() +{ + atf_add_test_case "unaligned" +} From owner-dev-commits-src-main@freebsd.org Wed Dec 23 12:03:45 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 384674BD904; Wed, 23 Dec 2020 12:03:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D1Bgj1BMxz4m1C; Wed, 23 Dec 2020 12:03:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1BC291D9D3; Wed, 23 Dec 2020 12:03:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BNC3jO5097166; Wed, 23 Dec 2020 12:03:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BNC3jTD097165; Wed, 23 Dec 2020 12:03:45 GMT (envelope-from git) Date: Wed, 23 Dec 2020 12:03:45 GMT Message-Id: <202012231203.0BNC3jTD097165@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: e1f6571a12ed - pf tests: Sort Makefile entries MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e1f6571a12ed7acba428357b67f6b34df1971605 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2020 12:03:45 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=e1f6571a12ed7acba428357b67f6b34df1971605 commit e1f6571a12ed7acba428357b67f6b34df1971605 Author: Kristof Provost AuthorDate: 2020-12-19 14:27:33 +0000 Commit: Kristof Provost CommitDate: 2020-12-23 11:03:20 +0000 pf tests: Sort Makefile entries MFC after: 1 week --- tests/sys/netpfil/pf/Makefile | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/sys/netpfil/pf/Makefile b/tests/sys/netpfil/pf/Makefile index 3dc20788aa87..73c85320c013 100644 --- a/tests/sys/netpfil/pf/Makefile +++ b/tests/sys/netpfil/pf/Makefile @@ -6,25 +6,25 @@ TESTSDIR= ${TESTSBASE}/sys/netpfil/pf TESTS_SUBDIRS+= ioctl ATF_TESTS_SH+= anchor \ - pass_block \ forward \ fragmentation \ + icmp \ names \ nat \ - set_tos \ - src_track \ + pass_block \ + pfsync \ rdr \ route_to \ - synproxy \ set_skip \ - table \ - pfsync \ - icmp + set_tos \ + src_track \ + synproxy \ + table -${PACKAGE}FILES+= utils.subr \ +${PACKAGE}FILES+= CVE-2019-5597.py \ + CVE-2019-5598.py \ echo_inetd.conf \ - CVE-2019-5597.py \ - CVE-2019-5598.py + utils.subr ${PACKAGE}FILESMODE_CVE-2019-5597.py= 0555 ${PACKAGE}FILESMODE_CVE-2019-5598.py= 0555 From owner-dev-commits-src-main@freebsd.org Wed Dec 23 12:03:45 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4AB6B4BD5A2; Wed, 23 Dec 2020 12:03:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D1Bgj1jFNz4m66; Wed, 23 Dec 2020 12:03:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2DBAC1DE0C; Wed, 23 Dec 2020 12:03:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BNC3jnm097183; Wed, 23 Dec 2020 12:03:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BNC3jG0097182; Wed, 23 Dec 2020 12:03:45 GMT (envelope-from git) Date: Wed, 23 Dec 2020 12:03:45 GMT Message-Id: <202012231203.0BNC3jG0097182@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: c3f69af03ae7 - pf: Fix unaligned checksum updates MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c3f69af03ae7acc167cc1151f0c1ecc5e014ce4e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2020 12:03:45 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=c3f69af03ae7acc167cc1151f0c1ecc5e014ce4e commit c3f69af03ae7acc167cc1151f0c1ecc5e014ce4e Author: Kristof Provost AuthorDate: 2020-12-20 20:06:32 +0000 Commit: Kristof Provost CommitDate: 2020-12-23 11:03:20 +0000 pf: Fix unaligned checksum updates The algorithm we use to update checksums only works correctly if the updated data is aligned on 16-bit boundaries (relative to the start of the packet). Import the OpenBSD fix for this issue. PR: 240416 Obtained from: OpenBSD MFC after: 1 week Reviewed by: tuexen (previous version) Differential Revision: https://reviews.freebsd.org/D27696 --- sys/net/pfvar.h | 6 ++++ sys/netpfil/pf/pf.c | 81 +++++++++++++++++++++++++++++++++++++++--------- sys/netpfil/pf/pf_norm.c | 23 ++++++++++---- 3 files changed, 90 insertions(+), 20 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 5cc613a543e4..bd6a8c8bd7c4 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -330,6 +330,8 @@ extern struct sx pf_end_lock; (neg) \ ) +#define PF_ALGNMNT(off) (((off) % 2) == 0) + struct pf_rule_uid { uid_t uid[2]; u_int8_t op; @@ -1735,6 +1737,10 @@ void pf_change_a(void *, u_int16_t *, u_int32_t, u_int8_t); void pf_change_proto_a(struct mbuf *, void *, u_int16_t *, u_int32_t, u_int8_t); void pf_change_tcp_a(struct mbuf *, void *, u_int16_t *, u_int32_t); +void pf_patch_16_unaligned(struct mbuf *, u_int16_t *, void *, u_int16_t, + bool, u_int8_t); +void pf_patch_32_unaligned(struct mbuf *, u_int16_t *, void *, u_int32_t, + bool, u_int8_t); void pf_send_deferred_syn(struct pf_state *); int pf_match_addr(u_int8_t, struct pf_addr *, struct pf_addr *, struct pf_addr *, sa_family_t); diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 2908a5746b54..047ad7fc308d 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -288,6 +288,8 @@ static void pf_print_state_parts(struct pf_state *, struct pf_state_key *, struct pf_state_key *); static int pf_addr_wrap_neq(struct pf_addr_wrap *, struct pf_addr_wrap *); +static void pf_patch_8(struct mbuf *, u_int16_t *, u_int8_t *, u_int8_t, + bool, u_int8_t); static struct pf_state *pf_find_state(struct pfi_kif *, struct pf_state_key_cmp *, u_int); static int pf_src_connlimit(struct pf_state **); @@ -2084,16 +2086,60 @@ pf_addr_wrap_neq(struct pf_addr_wrap *aw1, struct pf_addr_wrap *aw2) u_int16_t pf_cksum_fixup(u_int16_t cksum, u_int16_t old, u_int16_t new, u_int8_t udp) { - u_int32_t l; - - if (udp && !cksum) - return (0x0000); - l = cksum + old - new; - l = (l >> 16) + (l & 65535); - l = l & 65535; - if (udp && !l) - return (0xFFFF); - return (l); + u_int32_t x; + + x = cksum + old - new; + x = (x + (x >> 16)) & 0xffff; + + /* optimise: eliminate a branch when not udp */ + if (udp && cksum == 0x0000) + return cksum; + if (udp && x == 0x0000) + x = 0xffff; + + return (u_int16_t)(x); +} + +static void +pf_patch_8(struct mbuf *m, u_int16_t *cksum, u_int8_t *f, u_int8_t v, bool hi, + u_int8_t udp) +{ + u_int16_t old = htons(hi ? (*f << 8) : *f); + u_int16_t new = htons(hi ? ( v << 8) : v); + + if (*f == v) + return; + + *f = v; + + if (m->m_pkthdr.csum_flags & (CSUM_DELAY_DATA | CSUM_DELAY_DATA_IPV6)) + return; + + *cksum = pf_cksum_fixup(*cksum, old, new, udp); +} + +void +pf_patch_16_unaligned(struct mbuf *m, u_int16_t *cksum, void *f, u_int16_t v, + bool hi, u_int8_t udp) +{ + u_int8_t *fb = (u_int8_t *)f; + u_int8_t *vb = (u_int8_t *)&v; + + pf_patch_8(m, cksum, fb++, *vb++, hi, udp); + pf_patch_8(m, cksum, fb++, *vb++, !hi, udp); +} + +void +pf_patch_32_unaligned(struct mbuf *m, u_int16_t *cksum, void *f, u_int32_t v, + bool hi, u_int8_t udp) +{ + u_int8_t *fb = (u_int8_t *)f; + u_int8_t *vb = (u_int8_t *)&v; + + pf_patch_8(m, cksum, fb++, *vb++, hi, udp); + pf_patch_8(m, cksum, fb++, *vb++, !hi, udp); + pf_patch_8(m, cksum, fb++, *vb++, hi, udp); + pf_patch_8(m, cksum, fb++, *vb++, !hi, udp); } u_int16_t @@ -2319,6 +2365,7 @@ pf_modulate_sack(struct mbuf *m, int off, struct pf_pdesc *pd, return 0; while (hlen >= TCPOLEN_SACKLEN) { + size_t startoff = opt - opts; olen = opt[1]; switch (*opt) { case TCPOPT_EOL: /* FALLTHROUGH */ @@ -2333,10 +2380,16 @@ pf_modulate_sack(struct mbuf *m, int off, struct pf_pdesc *pd, for (i = 2; i + TCPOLEN_SACK <= olen; i += TCPOLEN_SACK) { memcpy(&sack, &opt[i], sizeof(sack)); - pf_change_proto_a(m, &sack.start, &th->th_sum, - htonl(ntohl(sack.start) - dst->seqdiff), 0); - pf_change_proto_a(m, &sack.end, &th->th_sum, - htonl(ntohl(sack.end) - dst->seqdiff), 0); + pf_patch_32_unaligned(m, + &th->th_sum, &sack.start, + htonl(ntohl(sack.start) - dst->seqdiff), + PF_ALGNMNT(startoff), + 0); + pf_patch_32_unaligned(m, &th->th_sum, + &sack.end, + htonl(ntohl(sack.end) - dst->seqdiff), + PF_ALGNMNT(startoff), + 0); memcpy(&opt[i], &sack, sizeof(sack)); } copyback = 1; diff --git a/sys/netpfil/pf/pf_norm.c b/sys/netpfil/pf/pf_norm.c index b3f867a997c6..1f99dafe2b27 100644 --- a/sys/netpfil/pf/pf_norm.c +++ b/sys/netpfil/pf/pf_norm.c @@ -1517,6 +1517,7 @@ pf_normalize_tcp_stateful(struct mbuf *m, int off, struct pf_pdesc *pd, u_int8_t *opt; int copyback = 0; int got_ts = 0; + size_t startoff; KASSERT((src->scrub || dst->scrub), ("%s: src->scrub && dst->scrub!", __func__)); @@ -1560,6 +1561,7 @@ pf_normalize_tcp_stateful(struct mbuf *m, int off, struct pf_pdesc *pd, opt = hdr + sizeof(struct tcphdr); hlen = (th->th_off << 2) - sizeof(struct tcphdr); while (hlen >= TCPOLEN_TIMESTAMP) { + startoff = opt - (hdr + sizeof(struct tcphdr)); switch (*opt) { case TCPOPT_EOL: /* FALLTHROUGH */ case TCPOPT_NOP: @@ -1589,10 +1591,12 @@ pf_normalize_tcp_stateful(struct mbuf *m, int off, struct pf_pdesc *pd, (src->scrub->pfss_flags & PFSS_TIMESTAMP)) { tsval = ntohl(tsval); - pf_change_proto_a(m, &opt[2], + pf_patch_32_unaligned(m, &th->th_sum, + &opt[2], htonl(tsval + src->scrub->pfss_ts_mod), + PF_ALGNMNT(startoff), 0); copyback = 1; } @@ -1605,8 +1609,11 @@ pf_normalize_tcp_stateful(struct mbuf *m, int off, struct pf_pdesc *pd, PFSS_TIMESTAMP)) { tsecr = ntohl(tsecr) - dst->scrub->pfss_ts_mod; - pf_change_proto_a(m, &opt[6], - &th->th_sum, htonl(tsecr), + pf_patch_32_unaligned(m, + &th->th_sum, + &opt[6], + htonl(tsecr), + PF_ALGNMNT(startoff), 0); copyback = 1; } @@ -1903,6 +1910,7 @@ pf_normalize_tcpopt(struct pf_rule *r, struct mbuf *m, struct tcphdr *th, int rewrite = 0; u_char opts[TCP_MAXOLEN]; u_char *optp = opts; + size_t startoff; thoff = th->th_off << 2; cnt = thoff - sizeof(struct tcphdr); @@ -1912,6 +1920,7 @@ pf_normalize_tcpopt(struct pf_rule *r, struct mbuf *m, struct tcphdr *th, return (rewrite); for (; cnt > 0; cnt -= optlen, optp += optlen) { + startoff = optp - opts; opt = optp[0]; if (opt == TCPOPT_EOL) break; @@ -1928,9 +1937,11 @@ pf_normalize_tcpopt(struct pf_rule *r, struct mbuf *m, struct tcphdr *th, case TCPOPT_MAXSEG: mss = (u_int16_t *)(optp + 2); if ((ntohs(*mss)) > r->max_mss) { - th->th_sum = pf_proto_cksum_fixup(m, - th->th_sum, *mss, htons(r->max_mss), 0); - *mss = htons(r->max_mss); + pf_patch_16_unaligned(m, + &th->th_sum, + mss, htons(r->max_mss), + PF_ALGNMNT(startoff), + 0); rewrite = 1; } break; From owner-dev-commits-src-main@freebsd.org Wed Dec 23 12:03:45 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 149424BD903; Wed, 23 Dec 2020 12:03:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D1Bgj03y1z4mK0; Wed, 23 Dec 2020 12:03:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E927E1D7F4; Wed, 23 Dec 2020 12:03:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BNC3inr097132; Wed, 23 Dec 2020 12:03:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BNC3ilU097131; Wed, 23 Dec 2020 12:03:44 GMT (envelope-from git) Date: Wed, 23 Dec 2020 12:03:44 GMT Message-Id: <202012231203.0BNC3ilU097131@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 1c00efe98ed7 - pf: Use counter(9) for pf_state byte/packet tracking MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1c00efe98ed7d103b9684ff692ffd5e3b64d0237 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2020 12:03:45 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=1c00efe98ed7d103b9684ff692ffd5e3b64d0237 commit 1c00efe98ed7d103b9684ff692ffd5e3b64d0237 Author: Kristof Provost AuthorDate: 2020-12-23 08:37:59 +0000 Commit: Kristof Provost CommitDate: 2020-12-23 11:03:21 +0000 pf: Use counter(9) for pf_state byte/packet tracking This improves cache behaviour by not writing to the same variable from multiple cores simultaneously. pf_state is only used in the kernel, so can be safely modified. Reviewed by: Lutz Donnerhacke, philip MFC after: 1 week Sponsed by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D27661 --- sys/net/pfvar.h | 4 ++-- sys/netpfil/pf/if_pfsync.c | 13 +++++++++++++ sys/netpfil/pf/pf.c | 34 ++++++++++++++++++++++++++-------- sys/netpfil/pf/pf_ioctl.c | 10 ++++++---- 4 files changed, 47 insertions(+), 14 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index bd6a8c8bd7c4..eadd3c785d73 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -740,8 +740,8 @@ struct pf_state { struct pfi_kif *rt_kif; struct pf_src_node *src_node; struct pf_src_node *nat_src_node; - u_int64_t packets[2]; - u_int64_t bytes[2]; + counter_u64_t packets[2]; + counter_u64_t bytes[2]; u_int32_t creation; u_int32_t expire; u_int32_t pfsync_time; diff --git a/sys/netpfil/pf/if_pfsync.c b/sys/netpfil/pf/if_pfsync.c index b24efe10688d..2f696698e3eb 100644 --- a/sys/netpfil/pf/if_pfsync.c +++ b/sys/netpfil/pf/if_pfsync.c @@ -507,6 +507,13 @@ pfsync_state_import(struct pfsync_state *sp, u_int8_t flags) if ((st = uma_zalloc(V_pf_state_z, M_NOWAIT | M_ZERO)) == NULL) goto cleanup; + for (int i = 0; i < 2; i++) { + st->packets[i] = counter_u64_alloc(M_NOWAIT); + st->bytes[i] = counter_u64_alloc(M_NOWAIT); + if (st->packets[i] == NULL || st->bytes[i] == NULL) + goto cleanup; + } + if ((skw = uma_zalloc(V_pf_state_key_z, M_NOWAIT)) == NULL) goto cleanup; @@ -616,6 +623,12 @@ cleanup: cleanup_state: /* pf_state_insert() frees the state keys. */ if (st) { + for (int i = 0; i < 2; i++) { + if (st->packets[i] != NULL) + counter_u64_free(st->packets[i]); + if (st->bytes[i] != NULL) + counter_u64_free(st->bytes[i]); + } if (st->dst.scrub) uma_zfree(V_pf_state_scrub_z, st->dst.scrub); if (st->src.scrub) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 047ad7fc308d..3cb423d8afa7 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -1714,6 +1714,13 @@ pf_free_state(struct pf_state *cur) KASSERT(cur->timeout == PFTM_UNLINKED, ("%s: timeout %u", __func__, cur->timeout)); + for (int i = 0; i < 2; i++) { + if (cur->bytes[i] != NULL) + counter_u64_free(cur->bytes[i]); + if (cur->packets[i] != NULL) + counter_u64_free(cur->packets[i]); + } + pf_normalize_tcp_cleanup(cur); uma_zfree(V_pf_state_z, cur); counter_u64_add(V_pf_status.fcounters[FCNT_STATE_REMOVALS], 1); @@ -3704,6 +3711,16 @@ pf_create_state(struct pf_rule *r, struct pf_rule *nr, struct pf_rule *a, REASON_SET(&reason, PFRES_MEMORY); goto csfailed; } + for (int i = 0; i < 2; i++) { + s->bytes[i] = counter_u64_alloc(M_NOWAIT); + s->packets[i] = counter_u64_alloc(M_NOWAIT); + + if (s->bytes[i] == NULL || s->packets[i] == NULL) { + pf_free_state(s); + REASON_SET(&reason, PFRES_MEMORY); + goto csfailed; + } + } s->rule.ptr = r; s->nat_rule.ptr = nr; s->anchor.ptr = a; @@ -4263,8 +4280,9 @@ pf_tcp_track_full(struct pf_state_peer *src, struct pf_state_peer *dst, pf_print_flags(th->th_flags); printf(" seq=%u (%u) ack=%u len=%u ackskew=%d " "pkts=%llu:%llu dir=%s,%s\n", seq, orig_seq, ack, - pd->p_len, ackskew, (unsigned long long)(*state)->packets[0], - (unsigned long long)(*state)->packets[1], + pd->p_len, ackskew, + (unsigned long long)counter_u64_fetch((*state)->packets[0]), + (unsigned long long)counter_u64_fetch((*state)->packets[1]), pd->dir == PF_IN ? "in" : "out", pd->dir == (*state)->direction ? "fwd" : "rev"); } @@ -4319,8 +4337,8 @@ pf_tcp_track_full(struct pf_state_peer *src, struct pf_state_peer *dst, printf(" seq=%u (%u) ack=%u len=%u ackskew=%d " "pkts=%llu:%llu dir=%s,%s\n", seq, orig_seq, ack, pd->p_len, ackskew, - (unsigned long long)(*state)->packets[0], - (unsigned long long)(*state)->packets[1], + (unsigned long long)counter_u64_fetch((*state)->packets[0]), + (unsigned long long)counter_u64_fetch((*state)->packets[1]), pd->dir == PF_IN ? "in" : "out", pd->dir == (*state)->direction ? "fwd" : "rev"); printf("pf: State failure on: %c %c %c %c | %c %c\n", @@ -6179,8 +6197,8 @@ done: s->nat_src_node->bytes[dirndx] += pd.tot_len; } dirndx = (dir == s->direction) ? 0 : 1; - s->packets[dirndx]++; - s->bytes[dirndx] += pd.tot_len; + counter_u64_add(s->packets[dirndx], 1); + counter_u64_add(s->bytes[dirndx], pd.tot_len); } tr = r; nr = (s != NULL) ? s->nat_rule.ptr : pd.nat_rule; @@ -6575,8 +6593,8 @@ done: s->nat_src_node->bytes[dirndx] += pd.tot_len; } dirndx = (dir == s->direction) ? 0 : 1; - s->packets[dirndx]++; - s->bytes[dirndx] += pd.tot_len; + counter_u64_add(s->packets[dirndx], 1); + counter_u64_add(s->bytes[dirndx], pd.tot_len); } tr = r; nr = (s != NULL) ? s->nat_rule.ptr : pd.nat_rule; diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index 1be52e1e1a84..9e31d1c966d9 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -3974,10 +3974,12 @@ pfsync_state_export(struct pfsync_state *sp, struct pf_state *st) else sp->nat_rule = htonl(st->nat_rule.ptr->nr); - pf_state_counter_hton(st->packets[0], sp->packets[0]); - pf_state_counter_hton(st->packets[1], sp->packets[1]); - pf_state_counter_hton(st->bytes[0], sp->bytes[0]); - pf_state_counter_hton(st->bytes[1], sp->bytes[1]); + pf_state_counter_hton(counter_u64_fetch(st->packets[0]), + sp->packets[0]); + pf_state_counter_hton(counter_u64_fetch(st->packets[1]), + sp->packets[1]); + pf_state_counter_hton(counter_u64_fetch(st->bytes[0]), sp->bytes[0]); + pf_state_counter_hton(counter_u64_fetch(st->bytes[1]), sp->bytes[1]); } From owner-dev-commits-src-main@freebsd.org Wed Dec 23 12:54:48 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 434294BEB99; Wed, 23 Dec 2020 12:54:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D1Cpc0tl1z4qDH; Wed, 23 Dec 2020 12:54:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0D3FD1E4EC; Wed, 23 Dec 2020 12:54:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BNCsl7k054941; Wed, 23 Dec 2020 12:54:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BNCsleA054940; Wed, 23 Dec 2020 12:54:47 GMT (envelope-from git) Date: Wed, 23 Dec 2020 12:54:47 GMT Message-Id: <202012231254.0BNCsleA054940@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Yuri Pankov Subject: git: f952bdf1425d - tools/tools/locale: skip control character widths MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: yuripv X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f952bdf1425d6a877f99b5c5ca59f25fc8bedabe Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2020 12:54:48 -0000 The branch main has been updated by yuripv: URL: https://cgit.FreeBSD.org/src/commit/?id=f952bdf1425d6a877f99b5c5ca59f25fc8bedabe commit f952bdf1425d6a877f99b5c5ca59f25fc8bedabe Author: Yuri Pankov AuthorDate: 2020-12-23 12:49:25 +0000 Commit: Yuri Pankov CommitDate: 2020-12-23 12:53:43 +0000 tools/tools/locale: skip control character widths Do not explicitly encode control characters widths as 0 allowing wcwidth() to return the proper implicit value for non-printable characters (-1). Reported by: naddy --- tools/tools/locale/etc/final-maps/widths.txt | 65 ---------------------------- tools/tools/locale/tools/getwidths.c | 4 ++ 2 files changed, 4 insertions(+), 65 deletions(-) diff --git a/tools/tools/locale/etc/final-maps/widths.txt b/tools/tools/locale/etc/final-maps/widths.txt index f01a4d5a0dd5..74c28ac58463 100644 --- a/tools/tools/locale/etc/final-maps/widths.txt +++ b/tools/tools/locale/etc/final-maps/widths.txt @@ -3,71 +3,6 @@ # utf8proc 2.5.0. # ----------------------------------------------------------------------------- WIDTH - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 0 0 0 diff --git a/tools/tools/locale/tools/getwidths.c b/tools/tools/locale/tools/getwidths.c index 670ebd957878..f1c7c6cc463d 100644 --- a/tools/tools/locale/tools/getwidths.c +++ b/tools/tools/locale/tools/getwidths.c @@ -35,12 +35,16 @@ main(void) { int32_t wc; int i, wcw; + utf8proc_category_t wcc; setlocale(LC_CTYPE, "C.UTF-8"); printf("%s\n", utf8proc_version()); for (wc = 0; wc < 0x110000; wc++) { + wcc = utf8proc_category(wc); + if (wcc == UTF8PROC_CATEGORY_CC) + continue; wcw = utf8proc_charwidth(wc); if (wcw == 1) continue; From owner-dev-commits-src-main@freebsd.org Wed Dec 23 13:14:48 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AC0064BEEB9; Wed, 23 Dec 2020 13:14:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D1DFh4NK1z4rLh; Wed, 23 Dec 2020 13:14:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 889851E9C1; Wed, 23 Dec 2020 13:14:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BNDEm13047669; Wed, 23 Dec 2020 13:14:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BNDEmRd047668; Wed, 23 Dec 2020 13:14:48 GMT (envelope-from git) Date: Wed, 23 Dec 2020 13:14:48 GMT Message-Id: <202012231314.0BNDEmRd047668@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 42f71007d5c9 - Use the new PAGE_SIZE_4K in the GICv3 driver MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 42f71007d5c92e42c9e3ad763ca371801c48432b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2020 13:14:48 -0000 The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=42f71007d5c92e42c9e3ad763ca371801c48432b commit 42f71007d5c92e42c9e3ad763ca371801c48432b Author: Andrew Turner AuthorDate: 2020-12-23 09:49:53 +0000 Commit: Andrew Turner CommitDate: 2020-12-23 13:10:26 +0000 Use the new PAGE_SIZE_4K in the GICv3 driver Stop assuming PAGE_SIZE is 4k in the GICv3 ITS driver. We could use a 16k or 64k page in the future. Sponsored by: Innovate UK --- sys/arm64/arm64/gicv3_its.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/arm64/arm64/gicv3_its.c b/sys/arm64/arm64/gicv3_its.c index 2c9a7dae77a2..061d5a1dbdb9 100644 --- a/sys/arm64/arm64/gicv3_its.c +++ b/sys/arm64/arm64/gicv3_its.c @@ -513,7 +513,7 @@ gicv3_its_table_init(device_t dev, struct gicv3_its_softc *sc) (nitspages - 1); switch (page_size) { - case PAGE_SIZE: /* 4KB */ + case PAGE_SIZE_4K: /* 4KB */ reg |= GITS_BASER_PSZ_4K << GITS_BASER_PSZ_SHIFT; break; @@ -544,7 +544,7 @@ gicv3_its_table_init(device_t dev, struct gicv3_its_softc *sc) (reg & GITS_BASER_PSZ_MASK)) { switch (page_size) { case PAGE_SIZE_16K: - page_size = PAGE_SIZE; + page_size = PAGE_SIZE_4K; continue; case PAGE_SIZE_64K: page_size = PAGE_SIZE_16K; From owner-dev-commits-src-main@freebsd.org Wed Dec 23 13:14:48 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D37764BEE4B; Wed, 23 Dec 2020 13:14:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D1DFh5hD8z4rTB; Wed, 23 Dec 2020 13:14:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B670B1ED02; Wed, 23 Dec 2020 13:14:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BNDEmfB047703; Wed, 23 Dec 2020 13:14:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BNDEmKH047702; Wed, 23 Dec 2020 13:14:48 GMT (envelope-from git) Date: Wed, 23 Dec 2020 13:14:48 GMT Message-Id: <202012231314.0BNDEmKH047702@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: e324f1e9f458 - Stop redefining PAGE_SHIFT in virtio-mmio MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e324f1e9f458ef5b402c7999b01bedc8a775047d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2020 13:14:48 -0000 The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=e324f1e9f458ef5b402c7999b01bedc8a775047d commit e324f1e9f458ef5b402c7999b01bedc8a775047d Author: Andrew Turner AuthorDate: 2020-12-23 10:59:38 +0000 Commit: Andrew Turner CommitDate: 2020-12-23 13:10:26 +0000 Stop redefining PAGE_SHIFT in virtio-mmio This is alreaady defined by each architecture as that is the only place we can know what the correct page shift should be. Sponsored by: Innovate UK --- sys/dev/virtio/mmio/virtio_mmio.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/dev/virtio/mmio/virtio_mmio.c b/sys/dev/virtio/mmio/virtio_mmio.c index 348c82da3528..bb5d84754f09 100644 --- a/sys/dev/virtio/mmio/virtio_mmio.c +++ b/sys/dev/virtio/mmio/virtio_mmio.c @@ -60,8 +60,6 @@ __FBSDID("$FreeBSD$"); #include "virtio_bus_if.h" #include "virtio_if.h" -#define PAGE_SHIFT 12 - struct vtmmio_virtqueue { struct virtqueue *vtv_vq; int vtv_no_intr; From owner-dev-commits-src-main@freebsd.org Wed Dec 23 13:14:48 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BAF844BED38; Wed, 23 Dec 2020 13:14:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D1DFh4tXPz4rbp; Wed, 23 Dec 2020 13:14:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9A9011E9C2; Wed, 23 Dec 2020 13:14:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BNDEm0I047686; Wed, 23 Dec 2020 13:14:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BNDEmjn047685; Wed, 23 Dec 2020 13:14:48 GMT (envelope-from git) Date: Wed, 23 Dec 2020 13:14:48 GMT Message-Id: <202012231314.0BNDEmjn047685@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 3413a8cd819b - Rename the arm64 4k PAGE_* macros MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3413a8cd819b584d44d8dfb886795060b7f95b0a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2020 13:14:48 -0000 The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=3413a8cd819b584d44d8dfb886795060b7f95b0a commit 3413a8cd819b584d44d8dfb886795060b7f95b0a Author: Andrew Turner AuthorDate: 2020-12-23 09:46:13 +0000 Commit: Andrew Turner CommitDate: 2020-12-23 13:10:26 +0000 Rename the arm64 4k PAGE_* macros These now have a _4K suffix to allow us to be explicit when we mean to use a 4k page rather than assuming PAGE_SIZE is 4k. Sponsored by: Innovate UK --- sys/arm64/include/param.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/sys/arm64/include/param.h b/sys/arm64/include/param.h index f9d09eb49ed4..a01b37da84c5 100644 --- a/sys/arm64/include/param.h +++ b/sys/arm64/include/param.h @@ -83,9 +83,9 @@ #define CACHE_LINE_SHIFT 7 #define CACHE_LINE_SIZE (1 << CACHE_LINE_SHIFT) -#define PAGE_SHIFT 12 -#define PAGE_SIZE (1 << PAGE_SHIFT) /* Page size */ -#define PAGE_MASK (PAGE_SIZE - 1) +#define PAGE_SHIFT_4K 12 +#define PAGE_SIZE_4K (1 << PAGE_SHIFT_4K) +#define PAGE_MASK_4K (PAGE_SIZE_4K - 1) #define PAGE_SHIFT_16K 14 #define PAGE_SIZE_16K (1 << PAGE_SHIFT_16K) @@ -95,6 +95,10 @@ #define PAGE_SIZE_64K (1 << PAGE_SHIFT_64K) #define PAGE_MASK_64K (PAGE_SIZE_64K - 1) +#define PAGE_SHIFT PAGE_SHIFT_4K +#define PAGE_SIZE PAGE_SIZE_4K +#define PAGE_MASK PAGE_MASK_4K + #define MAXPAGESIZES 3 /* maximum number of supported page sizes */ #ifndef KSTACK_PAGES From owner-dev-commits-src-main@freebsd.org Wed Dec 23 13:14:48 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E54844BEFF4; Wed, 23 Dec 2020 13:14:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D1DFh6CWlz4rbq; Wed, 23 Dec 2020 13:14:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BE26D1EB9B; Wed, 23 Dec 2020 13:14:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BNDEmx8047720; Wed, 23 Dec 2020 13:14:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BNDEmiw047719; Wed, 23 Dec 2020 13:14:48 GMT (envelope-from git) Date: Wed, 23 Dec 2020 13:14:48 GMT Message-Id: <202012231314.0BNDEmiw047719@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 166ceb6fd18b - More the arm64 early page tables and stack to .bss MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 166ceb6fd18ba315b66c8b712e04f9ded3b31277 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2020 13:14:49 -0000 The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=166ceb6fd18ba315b66c8b712e04f9ded3b31277 commit 166ceb6fd18ba315b66c8b712e04f9ded3b31277 Author: Andrew Turner AuthorDate: 2020-12-23 08:05:21 +0000 Commit: Andrew Turner CommitDate: 2020-12-23 13:10:23 +0000 More the arm64 early page tables and stack to .bss This removes 806k from the kernel ELF file that is only needed while the kernel is running, not in the static file. Sponsored by: Innovate UK --- sys/arm64/arm64/locore.S | 12 +++++++----- sys/conf/ldscript.arm64 | 7 ++++++- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/sys/arm64/arm64/locore.S b/sys/arm64/arm64/locore.S index 6f8d007b2efa..6735ffe8900b 100644 --- a/sys/arm64/arm64/locore.S +++ b/sys/arm64/arm64/locore.S @@ -189,7 +189,7 @@ virtdone: .Lbss: .quad __bss_start .Lend: - .quad _end + .quad __bss_end #ifdef SMP /* @@ -780,8 +780,12 @@ sctlr_clear: abort: b abort - //.section .init_pagetable - .align 12 /* 4KiB aligned */ + .align 3 +init_pt_va: + .quad pagetable /* XXX: Keep page tables VA */ + + .section .init_pagetable, "aw", %nobits + .align PAGE_SHIFT /* * 6 initial tables (in the following order): * L2 for kernel (High addresses) @@ -813,8 +817,6 @@ el2_pagetable: .space PAGE_SIZE .globl init_pt_va -init_pt_va: - .quad pagetable /* XXX: Keep page tables VA */ .align 4 initstack: diff --git a/sys/conf/ldscript.arm64 b/sys/conf/ldscript.arm64 index 36af34589db9..3c4b77034725 100644 --- a/sys/conf/ldscript.arm64 +++ b/sys/conf/ldscript.arm64 @@ -112,8 +112,13 @@ SECTIONS *(.dynbss) *(.bss) *(COMMON) + . = ALIGN(8); + __bss_end = .; + /* A section for the initial page table, it doesn't need to be in the + kernel file, however unlike normal .bss entries should not be zeroed + out as we use it before the .bss section is cleared. */ + *(.init_pagetable) } - . = ALIGN(8); _end = . ; PROVIDE (end = .); /* Stabs debugging sections. */ From owner-dev-commits-src-main@freebsd.org Wed Dec 23 13:59:14 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 577C64BFF41; Wed, 23 Dec 2020 13:59:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D1FDy21lSz4tj5; Wed, 23 Dec 2020 13:59:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 38C921F25E; Wed, 23 Dec 2020 13:59:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BNDxELG093699; Wed, 23 Dec 2020 13:59:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BNDxENj093698; Wed, 23 Dec 2020 13:59:14 GMT (envelope-from git) Date: Wed, 23 Dec 2020 13:59:14 GMT Message-Id: <202012231359.0BNDxENj093698@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: a62107ed19a1 - make the git commit message template more compact MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a62107ed19a1095158f454132a3b6ec536a4de7c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2020 13:59:14 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=a62107ed19a1095158f454132a3b6ec536a4de7c commit a62107ed19a1095158f454132a3b6ec536a4de7c Author: Ed Maste AuthorDate: 2020-12-23 13:58:17 +0000 Commit: Ed Maste CommitDate: 2020-12-23 13:58:17 +0000 make the git commit message template more compact git's default commit message includes the list of staged, unstaged, and untracked files; adding our metadata tags and then their descriptions made for a very long template. Move the descriptions to the metadata lines themselves. Reviewed by: bcr Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D27664 --- tools/tools/git/hooks/prepare-commit-msg | 44 ++++++++++++-------------------- 1 file changed, 17 insertions(+), 27 deletions(-) diff --git a/tools/tools/git/hooks/prepare-commit-msg b/tools/tools/git/hooks/prepare-commit-msg index 9e623371447f..9dcb85cd1a3f 100755 --- a/tools/tools/git/hooks/prepare-commit-msg +++ b/tools/tools/git/hooks/prepare-commit-msg @@ -28,36 +28,26 @@ outfile=$(mktemp /tmp/freebsd-git-commit.XXXXXXXX) cat >$outfile < +# Submitted by: +# Reported by: +# Reviewed by: +# Approved by: +# Obtained from: +# MFC after: +# MFH: +# Relnotes: +# Security: +# Sponsored by: +# Pull Request: /pull/###> +# Differential Revision: # -# Description of fields to fill in above: 72 columns --| -# PR: If and which Problem Report is related. -# Submitted by: If someone else sent in the change. -# Reported by: If someone else reported the issue. -# Reviewed by: If someone else reviewed your modification. -# Approved by: If you needed approval for this commit. -# Obtained from: If the change is from a third party. -# MFC after: N [day[s]|week[s]|month[s]]. Request a reminder email. -# MFH: Ports tree branch name. Request approval for merge. -# Relnotes: Set to 'yes' for mention in release notes. -# Security: Vulnerability reference (one per line) or description. -# Sponsored by: If the change was sponsored by an organization. -# Pull Request: https://github.com/freebsd//pull/### (*full* GitHub URL needed). -# Differential Revision: https://reviews.freebsd.org/D### (*full* phabric URL needed). +# "Pull Request" and "Differential Revision" require the *full* GitHub or +# Phabricator URL. $(awk '/^#$/,EOF' $1) EOF From owner-dev-commits-src-main@freebsd.org Wed Dec 23 14:13:34 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 26D144C0030; Wed, 23 Dec 2020 14:13:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D1FYV0b9Jz4vZD; Wed, 23 Dec 2020 14:13:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 075DC1F8D3; Wed, 23 Dec 2020 14:13:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BNEDXSG016574; Wed, 23 Dec 2020 14:13:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BNEDXh5016573; Wed, 23 Dec 2020 14:13:33 GMT (envelope-from git) Date: Wed, 23 Dec 2020 14:13:33 GMT Message-Id: <202012231413.0BNEDXh5016573@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 449ebf135b2e - Move the literal pool to the end of asm functions MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 449ebf135b2ef81cdea90e518e53f03acfd455a8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2020 14:13:34 -0000 The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=449ebf135b2ef81cdea90e518e53f03acfd455a8 commit 449ebf135b2ef81cdea90e518e53f03acfd455a8 Author: Andrew Turner AuthorDate: 2020-12-23 13:42:09 +0000 Commit: Andrew Turner CommitDate: 2020-12-23 13:57:25 +0000 Move the literal pool to the end of asm functions This keeps the data at the end of a function, near to where it's used. Sponsored by: Innovate UK --- sys/arm64/include/asm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/arm64/include/asm.h b/sys/arm64/include/asm.h index b6a18cf8a7e4..05e618500e59 100644 --- a/sys/arm64/include/asm.h +++ b/sys/arm64/include/asm.h @@ -45,7 +45,7 @@ .globl sym; LENTRY(sym) #define EENTRY(sym) \ .globl sym; sym: -#define LEND(sym) .cfi_endproc; .size sym, . - sym +#define LEND(sym) .ltorg; .cfi_endproc; .size sym, . - sym #define END(sym) LEND(sym) #define EEND(sym) From owner-dev-commits-src-main@freebsd.org Wed Dec 23 14:13:34 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2BE694C0337; Wed, 23 Dec 2020 14:13:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D1FYV0pTPz4vrQ; Wed, 23 Dec 2020 14:13:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0EC6D1F759; Wed, 23 Dec 2020 14:13:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BNEDXle016591; Wed, 23 Dec 2020 14:13:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BNEDXe0016590; Wed, 23 Dec 2020 14:13:33 GMT (envelope-from git) Date: Wed, 23 Dec 2020 14:13:33 GMT Message-Id: <202012231413.0BNEDXe0016590@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: edb48ff6e736 - Mark all arm64 locore functions with ENTRY/LENTRY MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: edb48ff6e736ca39eb5b9db7dab4e43fefe387a0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2020 14:13:34 -0000 The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=edb48ff6e736ca39eb5b9db7dab4e43fefe387a0 commit edb48ff6e736ca39eb5b9db7dab4e43fefe387a0 Author: Andrew Turner AuthorDate: 2020-12-23 13:24:52 +0000 Commit: Andrew Turner CommitDate: 2020-12-23 13:57:25 +0000 Mark all arm64 locore functions with ENTRY/LENTRY It is useful to know where these are within the code, and will be needed by later changes. Sponsored by: Innovate UK --- sys/arm64/arm64/locore.S | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/sys/arm64/arm64/locore.S b/sys/arm64/arm64/locore.S index 6735ffe8900b..20a0379a9aa1 100644 --- a/sys/arm64/arm64/locore.S +++ b/sys/arm64/arm64/locore.S @@ -67,9 +67,7 @@ * We are loaded at a 2MiB aligned address */ - .text - .globl _start -_start: +ENTRY(_start) #if defined(LINUX_BOOT_ABI) /* U-boot image header */ b 1f /* code 0 */ @@ -190,6 +188,7 @@ virtdone: .quad __bss_start .Lend: .quad __bss_end +END(_start) #ifdef SMP /* @@ -249,7 +248,7 @@ END(mpentry) * If we are started in EL2, configure the required hypervisor * registers and drop to EL1. */ -drop_to_el1: +LENTRY(drop_to_el1) mrs x23, CurrentEL lsr x23, x23, #2 cmp x23, #0x2 @@ -318,6 +317,7 @@ drop_to_el1: .align 3 .Lsctlr_res1: .quad SCTLR_RES1 +LEND(drop_to_el1) #define VECT_EMPTY \ .align 7; \ @@ -350,7 +350,7 @@ hyp_vectors: * virtual address we expect to run from. This is used when building the * initial page table. */ -get_virt_delta: +LENTRY(get_virt_delta) /* Load the physical address of virt_map */ adrp x29, virt_map add x29, x29, :lo12:virt_map @@ -366,6 +366,7 @@ get_virt_delta: .align 3 virt_map: .quad virt_map +LEND(get_virt_delta) /* * This builds the page tables containing the identity map, and the kernel @@ -386,7 +387,7 @@ virt_map: * - The identity (PA = VA) L0 table (TTBR0) * - The DMAP L1 tables */ -create_pagetables: +LENTRY(create_pagetables) /* Save the Link register */ mov x5, x30 @@ -538,6 +539,7 @@ common: /* Restore the Link register */ mov x30, x5 ret +LEND(create_pagetables) /* * Builds an L0 -> L1 table descriptor @@ -551,7 +553,7 @@ common: * x10 = Entry count * x11, x12 and x13 are trashed */ -link_l0_pagetable: +LENTRY(link_l0_pagetable) /* * Link an L0 -> L1 table entry. */ @@ -575,6 +577,7 @@ link_l0_pagetable: cbnz x10, 1b ret +LEND(link_l0_pagetable) /* * Builds an L1 -> L2 table descriptor @@ -587,7 +590,7 @@ link_l0_pagetable: * x9 = L2 PA (trashed) * x11, x12 and x13 are trashed */ -link_l1_pagetable: +LENTRY(link_l1_pagetable) /* * Link an L1 -> L2 table entry. */ @@ -606,6 +609,7 @@ link_l1_pagetable: str x13, [x6, x11, lsl #3] ret +LEND(link_l1_pagetable) /* * Builds count 1 GiB page table entry @@ -616,7 +620,7 @@ link_l1_pagetable: * x10 = Entry count * x11, x12 and x13 are trashed */ -build_l1_block_pagetable: +LENTRY(build_l1_block_pagetable) /* * Build the L1 table entry. */ @@ -643,6 +647,7 @@ build_l1_block_pagetable: cbnz x10, 1b ret +LEND(build_l1_block_pagetable) /* * Builds count 2 MiB page table entry @@ -653,7 +658,7 @@ build_l1_block_pagetable: * x10 = Entry count * x11, x12 and x13 are trashed */ -build_l2_block_pagetable: +LENTRY(build_l2_block_pagetable) /* * Build the L2 table entry. */ @@ -682,8 +687,9 @@ build_l2_block_pagetable: cbnz x10, 1b ret +LEND(build_l2_block_pagetable) -start_mmu: +LENTRY(start_mmu) dsb sy /* Load the exception vectors */ @@ -775,10 +781,11 @@ sctlr_clear: /* Bits to clear */ .quad (SCTLR_EE | SCTLR_EOE | SCTLR_IESB | SCTLR_WXN | SCTLR_UMA | \ SCTLR_ITD | SCTLR_A) +LEND(start_mmu) - .globl abort -abort: +ENTRY(abort) b abort +END(abort) .align 3 init_pt_va: From owner-dev-commits-src-main@freebsd.org Wed Dec 23 14:13:34 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 412694C01C2; Wed, 23 Dec 2020 14:13:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D1FYV1JYFz4vlc; Wed, 23 Dec 2020 14:13:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 202D91F75A; Wed, 23 Dec 2020 14:13:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BNEDYKH016608; Wed, 23 Dec 2020 14:13:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BNEDY1h016607; Wed, 23 Dec 2020 14:13:34 GMT (envelope-from git) Date: Wed, 23 Dec 2020 14:13:34 GMT Message-Id: <202012231413.0BNEDY1h016607@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 6f8866af349c - Add LENTRY and LEND to arm64 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6f8866af349ceda693edee0dad4aedf4d727096d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2020 14:13:34 -0000 The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=6f8866af349ceda693edee0dad4aedf4d727096d commit 6f8866af349ceda693edee0dad4aedf4d727096d Author: Andrew Turner AuthorDate: 2020-12-23 13:17:56 +0000 Commit: Andrew Turner CommitDate: 2020-12-23 13:57:25 +0000 Add LENTRY and LEND to arm64 These allow us to mark local asm functions as a function Sponsored by: Innovate UK --- sys/arm64/include/asm.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sys/arm64/include/asm.h b/sys/arm64/include/asm.h index 443377bf0c14..b6a18cf8a7e4 100644 --- a/sys/arm64/include/asm.h +++ b/sys/arm64/include/asm.h @@ -38,12 +38,15 @@ #define _C_LABEL(x) x -#define ENTRY(sym) \ - .text; .globl sym; .align 2; .type sym,#function; sym: \ +#define LENTRY(sym) \ + .text; .align 2; .type sym,#function; sym: \ .cfi_startproc +#define ENTRY(sym) \ + .globl sym; LENTRY(sym) #define EENTRY(sym) \ .globl sym; sym: -#define END(sym) .cfi_endproc; .size sym, . - sym +#define LEND(sym) .cfi_endproc; .size sym, . - sym +#define END(sym) LEND(sym) #define EEND(sym) #define WEAK_REFERENCE(sym, alias) \ From owner-dev-commits-src-main@freebsd.org Wed Dec 23 16:07:34 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 191BF4C3839; Wed, 23 Dec 2020 16:07:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D1J520976z3Lmc; Wed, 23 Dec 2020 16:07:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EC95020EA0; Wed, 23 Dec 2020 16:07:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BNG7XCg043746; Wed, 23 Dec 2020 16:07:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BNG7XsV043745; Wed, 23 Dec 2020 16:07:33 GMT (envelope-from git) Date: Wed, 23 Dec 2020 16:07:33 GMT Message-Id: <202012231607.0BNG7XsV043745@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Somers Subject: git: 0120603891ec - AIO: remove the kaiocb->bio linkage MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0120603891ec0d082c41e1f8d2b83e71429aea8c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2020 16:07:34 -0000 The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=0120603891ec0d082c41e1f8d2b83e71429aea8c commit 0120603891ec0d082c41e1f8d2b83e71429aea8c Author: Alan Somers AuthorDate: 2020-12-21 21:48:29 +0000 Commit: Alan Somers CommitDate: 2020-12-23 16:06:15 +0000 AIO: remove the kaiocb->bio linkage Vectored aio will require each aiocb to be associated with multiple bios, so we can't store a link to the latter from the former. But we don't really need to. aio_biowakeup already knows the bio it's using, and the other fields can be stored within the bio and/or buf itself. Also, remove the unused kaiocb.backend2 field. Reviewed By: kib Differential Revision: https://reviews.freebsd.org/D27682 --- sys/kern/vfs_aio.c | 50 +++++++++++++++++++++++++------------------------- sys/sys/aio.h | 9 +-------- 2 files changed, 26 insertions(+), 33 deletions(-) diff --git a/sys/kern/vfs_aio.c b/sys/kern/vfs_aio.c index 6c70714d5421..37e19557d807 100644 --- a/sys/kern/vfs_aio.c +++ b/sys/kern/vfs_aio.c @@ -1216,7 +1216,8 @@ aio_qbio(struct proc *p, struct kaiocb *job) struct cdevsw *csw; struct cdev *dev; struct kaioinfo *ki; - int error, ref, poff; + struct vm_page **pages; + int error, npages, poff, ref; vm_prot_t prot; cb = &job->uaiocb; @@ -1259,7 +1260,7 @@ aio_qbio(struct proc *p, struct kaiocb *job) } pbuf = NULL; - job->pages = malloc(sizeof(vm_page_t) * (atop(round_page( + pages = malloc(sizeof(vm_page_t) * (atop(round_page( cb->aio_nbytes)) + 1), M_TEMP, M_WAITOK | M_ZERO); } else { if (cb->aio_nbytes > maxphys) { @@ -1271,14 +1272,14 @@ aio_qbio(struct proc *p, struct kaiocb *job) goto unref; } - job->pbuf = pbuf = uma_zalloc(pbuf_zone, M_WAITOK); + pbuf = uma_zalloc(pbuf_zone, M_WAITOK); BUF_KERNPROC(pbuf); AIO_LOCK(ki); ki->kaio_buffer_count++; AIO_UNLOCK(ki); - job->pages = pbuf->b_pages; + pages = pbuf->b_pages; } - job->bp = bp = g_alloc_bio(); + bp = g_alloc_bio(); bp->bio_length = cb->aio_nbytes; bp->bio_bcount = cb->aio_nbytes; @@ -1286,26 +1287,27 @@ aio_qbio(struct proc *p, struct kaiocb *job) bp->bio_offset = cb->aio_offset; bp->bio_cmd = cb->aio_lio_opcode == LIO_WRITE ? BIO_WRITE : BIO_READ; bp->bio_dev = dev; - bp->bio_caller1 = (void *)job; + bp->bio_caller1 = job; + bp->bio_caller2 = pbuf; prot = VM_PROT_READ; if (cb->aio_lio_opcode == LIO_READ) prot |= VM_PROT_WRITE; /* Less backwards than it looks */ - job->npages = vm_fault_quick_hold_pages(&curproc->p_vmspace->vm_map, - (vm_offset_t)cb->aio_buf, bp->bio_length, prot, job->pages, + npages = vm_fault_quick_hold_pages(&curproc->p_vmspace->vm_map, + (vm_offset_t)cb->aio_buf, bp->bio_length, prot, pages, atop(maxphys) + 1); - if (job->npages < 0) { + if (npages < 0) { error = EFAULT; goto doerror; } if (pbuf != NULL) { - pmap_qenter((vm_offset_t)pbuf->b_data, - job->pages, job->npages); + pmap_qenter((vm_offset_t)pbuf->b_data, pages, npages); bp->bio_data = pbuf->b_data + poff; atomic_add_int(&num_buf_aio, 1); + pbuf->b_npages = npages; } else { - bp->bio_ma = job->pages; - bp->bio_ma_n = job->npages; + bp->bio_ma = pages; + bp->bio_ma_n = npages; bp->bio_ma_offset = poff; bp->bio_data = unmapped_buf; bp->bio_flags |= BIO_UNMAPPED; @@ -1323,12 +1325,10 @@ doerror: ki->kaio_buffer_count--; AIO_UNLOCK(ki); uma_zfree(pbuf_zone, pbuf); - job->pbuf = NULL; } else { - free(job->pages, M_TEMP); + free(pages, M_TEMP); } g_destroy_bio(bp); - job->bp = NULL; unref: dev_relthread(dev, ref); return (error); @@ -2341,28 +2341,28 @@ aio_biowakeup(struct bio *bp) { struct kaiocb *job = (struct kaiocb *)bp->bio_caller1; struct kaioinfo *ki; + struct buf *pbuf = (struct buf*)bp->bio_caller2; size_t nbytes; int error, nblks; /* Release mapping into kernel space. */ - if (job->pbuf != NULL) { - pmap_qremove((vm_offset_t)job->pbuf->b_data, job->npages); - vm_page_unhold_pages(job->pages, job->npages); - uma_zfree(pbuf_zone, job->pbuf); - job->pbuf = NULL; + if (pbuf != NULL) { + MPASS(pbuf->b_npages <= atop(maxphys) + 1); + pmap_qremove((vm_offset_t)pbuf->b_data, pbuf->b_npages); + vm_page_unhold_pages(pbuf->b_pages, pbuf->b_npages); + uma_zfree(pbuf_zone, pbuf); atomic_subtract_int(&num_buf_aio, 1); ki = job->userproc->p_aioinfo; AIO_LOCK(ki); ki->kaio_buffer_count--; AIO_UNLOCK(ki); } else { - vm_page_unhold_pages(job->pages, job->npages); - free(job->pages, M_TEMP); + MPASS(bp->bio_ma_n <= atop(maxphys) + 1); + vm_page_unhold_pages(bp->bio_ma, bp->bio_ma_n); + free(bp->bio_ma, M_TEMP); atomic_subtract_int(&num_unmapped_aio, 1); } - bp = job->bp; - job->bp = NULL; nbytes = job->uaiocb.aio_nbytes - bp->bio_resid; error = 0; if (bp->bio_flags & BIO_ERROR) diff --git a/sys/sys/aio.h b/sys/sys/aio.h index 380c5bcf7cf9..71afdbf31b35 100644 --- a/sys/sys/aio.h +++ b/sys/sys/aio.h @@ -137,18 +137,11 @@ struct kaiocb { aio_cancel_fn_t *cancel_fn; /* (a) backend cancel function */ aio_handle_fn_t *handle_fn; /* (c) backend handle function */ union { /* Backend-specific data fields */ - struct { /* BIO backend */ - struct bio *bp; /* (*) BIO pointer */ - struct buf *pbuf; /* (*) buffer pointer */ - int npages; /* (*) number of pages */ - struct vm_page **pages; /* (*) */ - }; struct { /* fsync() requests */ int pending; /* (a) number of pending I/O */ }; - struct { + struct { /* socket backend */ void *backend1; - void *backend2; long backend3; int backend4; }; From owner-dev-commits-src-main@freebsd.org Wed Dec 23 16:17:44 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 459D14C3A46; Wed, 23 Dec 2020 16:17:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D1JJm1GQhz3MK7; Wed, 23 Dec 2020 16:17:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 19CC221037; Wed, 23 Dec 2020 16:17:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BNGHiYk055130; Wed, 23 Dec 2020 16:17:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BNGHhIQ055129; Wed, 23 Dec 2020 16:17:43 GMT (envelope-from git) Date: Wed, 23 Dec 2020 16:17:43 GMT Message-Id: <202012231617.0BNGHhIQ055129@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 92be2847e845 - rtsock: Avoid copying uninitialized padding bytes MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 92be2847e845ba90e4da028cfd7f5a8013919f90 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2020 16:17:44 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=92be2847e845ba90e4da028cfd7f5a8013919f90 commit 92be2847e845ba90e4da028cfd7f5a8013919f90 Author: Mark Johnston AuthorDate: 2020-12-23 16:15:11 +0000 Commit: Mark Johnston CommitDate: 2020-12-23 16:16:40 +0000 rtsock: Avoid copying uninitialized padding bytes When copying sockaddrs out to userspace, we pad them to a multiple of the platform alignment (sizeof(long)). However, some sockaddr sizes, such as struct sockaddr_dl, are not an integer multiple of the alignment, so we may end up copying out uninitialized bytes. Fix this by always bouncing through a pre-zeroed sockaddr_storage. Reported by: KASAN Reviewed by: melifaro MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D27729 --- sys/net/rtsock.c | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c index 4c35642866c9..5acfd658caf6 100644 --- a/sys/net/rtsock.c +++ b/sys/net/rtsock.c @@ -1258,12 +1258,12 @@ rtsock_fix_netmask(const struct sockaddr *dst, const struct sockaddr *smask, static struct mbuf * rtsock_msg_mbuf(int type, struct rt_addrinfo *rtinfo) { + struct sockaddr_storage ss; struct rt_msghdr *rtm; struct mbuf *m; int i; struct sockaddr *sa; #ifdef INET6 - struct sockaddr_storage ss; struct sockaddr_in6 *sin6; #endif int len, dlen; @@ -1308,13 +1308,17 @@ rtsock_msg_mbuf(int type, struct rt_addrinfo *rtinfo) if ((sa = rtinfo->rti_info[i]) == NULL) continue; rtinfo->rti_addrs |= (1 << i); + dlen = SA_SIZE(sa); + KASSERT(dlen <= sizeof(ss), + ("%s: sockaddr size overflow", __func__)); + bzero(&ss, sizeof(ss)); + bcopy(sa, &ss, sa->sa_len); + sa = (struct sockaddr *)&ss; #ifdef INET6 if (sa->sa_family == AF_INET6) { - sin6 = (struct sockaddr_in6 *)&ss; - bcopy(sa, sin6, sizeof(*sin6)); - if (sa6_recoverscope(sin6) == 0) - sa = (struct sockaddr *)sin6; + sin6 = (struct sockaddr_in6 *)sa; + (void)sa6_recoverscope(sin6); } #endif m_copyback(m, len, dlen, (caddr_t)sa); @@ -1342,12 +1346,11 @@ rtsock_msg_mbuf(int type, struct rt_addrinfo *rtinfo) static int rtsock_msg_buffer(int type, struct rt_addrinfo *rtinfo, struct walkarg *w, int *plen) { - int i; - int len, buflen = 0, dlen; + struct sockaddr_storage ss; + int len, buflen = 0, dlen, i; caddr_t cp = NULL; struct rt_msghdr *rtm = NULL; #ifdef INET6 - struct sockaddr_storage ss; struct sockaddr_in6 *sin6; #endif #ifdef COMPAT_FREEBSD32 @@ -1414,12 +1417,15 @@ rtsock_msg_buffer(int type, struct rt_addrinfo *rtinfo, struct walkarg *w, int * #endif dlen = SA_SIZE(sa); if (cp != NULL && buflen >= dlen) { + KASSERT(dlen <= sizeof(ss), + ("%s: sockaddr size overflow", __func__)); + bzero(&ss, sizeof(ss)); + bcopy(sa, &ss, sa->sa_len); + sa = (struct sockaddr *)&ss; #ifdef INET6 if (sa->sa_family == AF_INET6) { - sin6 = (struct sockaddr_in6 *)&ss; - bcopy(sa, sin6, sizeof(*sin6)); - if (sa6_recoverscope(sin6) == 0) - sa = (struct sockaddr *)sin6; + sin6 = (struct sockaddr_in6 *)sa; + (void)sa6_recoverscope(sin6); } #endif bcopy((caddr_t)sa, cp, (unsigned)dlen); From owner-dev-commits-src-main@freebsd.org Wed Dec 23 16:17:44 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 462084C3AB1; Wed, 23 Dec 2020 16:17:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D1JJm1T1qz3MgQ; Wed, 23 Dec 2020 16:17:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2168121122; Wed, 23 Dec 2020 16:17:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BNGHi6K055147; Wed, 23 Dec 2020 16:17:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BNGHisT055146; Wed, 23 Dec 2020 16:17:44 GMT (envelope-from git) Date: Wed, 23 Dec 2020 16:17:44 GMT Message-Id: <202012231617.0BNGHisT055146@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: a7a7c306bfb0 - md: Fix a read-after-free in BIO_GETATTR handling MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a7a7c306bfb0d8d1a83569a098cf6cde492f8bf7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2020 16:17:44 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=a7a7c306bfb0d8d1a83569a098cf6cde492f8bf7 commit a7a7c306bfb0d8d1a83569a098cf6cde492f8bf7 Author: Mark Johnston AuthorDate: 2020-12-23 16:13:31 +0000 Commit: Mark Johnston CommitDate: 2020-12-23 16:16:40 +0000 md: Fix a read-after-free in BIO_GETATTR handling g_handleattr_int() consumes the bio if the attribute matches, so when we check bp->bio_cmd bp may have been freed. Move GETATTR handling to a separate function to avoid the problem. We do not need to set bio_completed for such bios, g_handleattr_int() will handle it. Also remove the setting of bio_resid before the devstat_end_transaction_bio() call. All of the md(4) bio handlers set bio_resid already. Reported by: KASAN Reviewed by: kib MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D27724 --- sys/dev/md/md.c | 65 ++++++++++++++++++++++++++++----------------------------- 1 file changed, 32 insertions(+), 33 deletions(-) diff --git a/sys/dev/md/md.c b/sys/dev/md/md.c index 1d17603ffdfe..1778eda48f35 100644 --- a/sys/dev/md/md.c +++ b/sys/dev/md/md.c @@ -1012,11 +1012,11 @@ unmapped_step: goto unmapped_step; } uma_zfree(md_pbuf_zone, pb); + } else { + bp->bio_resid = auio.uio_resid; } free(piov, M_MD); - if (pb == NULL) - bp->bio_resid = auio.uio_resid; return (error); } @@ -1184,6 +1184,23 @@ mdstart_null(struct md_s *sc, struct bio *bp) return (0); } +static void +md_handleattr(struct md_s *sc, struct bio *bp) +{ + if (sc->fwsectors && sc->fwheads && + (g_handleattr_int(bp, "GEOM::fwsectors", sc->fwsectors) != 0 || + g_handleattr_int(bp, "GEOM::fwheads", sc->fwheads) != 0)) + return; + if (g_handleattr_int(bp, "GEOM::candelete", 1) != 0) + return; + if (sc->ident[0] != '\0' && + g_handleattr_str(bp, "GEOM::ident", sc->ident) != 0) + return; + if (g_handleattr_int(bp, "MNT::verified", (sc->flags & MD_VERIFY) != 0)) + return; + g_io_deliver(bp, EOPNOTSUPP); +} + static void md_kthread(void *arg) { @@ -1212,39 +1229,21 @@ md_kthread(void *arg) } mtx_unlock(&sc->queue_mtx); if (bp->bio_cmd == BIO_GETATTR) { - int isv = ((sc->flags & MD_VERIFY) != 0); - - if ((sc->fwsectors && sc->fwheads && - (g_handleattr_int(bp, "GEOM::fwsectors", - sc->fwsectors) || - g_handleattr_int(bp, "GEOM::fwheads", - sc->fwheads))) || - g_handleattr_int(bp, "GEOM::candelete", 1)) - error = -1; - else if (sc->ident[0] != '\0' && - g_handleattr_str(bp, "GEOM::ident", sc->ident)) - error = -1; - else if (g_handleattr_int(bp, "MNT::verified", isv)) - error = -1; - else - error = EOPNOTSUPP; + md_handleattr(sc, bp); } else { error = sc->start(sc, bp); - } - - if (bp->bio_cmd == BIO_READ || bp->bio_cmd == BIO_WRITE) { - /* - * Devstat uses (bio_bcount, bio_resid) for - * determining the length of the completed part of - * the i/o. g_io_deliver() will translate from - * bio_completed to that, but it also destroys the - * bio so we must do our own translation. - */ - bp->bio_bcount = bp->bio_length; - bp->bio_resid = (error == -1 ? bp->bio_bcount : 0); - devstat_end_transaction_bio(sc->devstat, bp); - } - if (error != -1) { + if (bp->bio_cmd == BIO_READ || bp->bio_cmd == BIO_WRITE) { + /* + * Devstat uses (bio_bcount, bio_resid) for + * determining the length of the completed part + * of the i/o. g_io_deliver() will translate + * from bio_completed to that, but it also + * destroys the bio so we must do our own + * translation. + */ + bp->bio_bcount = bp->bio_length; + devstat_end_transaction_bio(sc->devstat, bp); + } bp->bio_completed = bp->bio_length; g_io_deliver(bp, error); } From owner-dev-commits-src-main@freebsd.org Wed Dec 23 16:17:44 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 558164C3DF7; Wed, 23 Dec 2020 16:17:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D1JJm200Tz3Mjs; Wed, 23 Dec 2020 16:17:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 337B421091; Wed, 23 Dec 2020 16:17:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BNGHidH055164; Wed, 23 Dec 2020 16:17:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BNGHiuJ055163; Wed, 23 Dec 2020 16:17:44 GMT (envelope-from git) Date: Wed, 23 Dec 2020 16:17:44 GMT Message-Id: <202012231617.0BNGHiuJ055163@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: ace3d9475cee - ffs: Avoid out-of-bounds accesses in the fs_active bitmap MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ace3d9475ceecd9bcb766bb82a1c8f87e8f560be Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2020 16:17:44 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=ace3d9475ceecd9bcb766bb82a1c8f87e8f560be commit ace3d9475ceecd9bcb766bb82a1c8f87e8f560be Author: Mark Johnston AuthorDate: 2020-12-23 16:13:00 +0000 Commit: Mark Johnston CommitDate: 2020-12-23 16:16:40 +0000 ffs: Avoid out-of-bounds accesses in the fs_active bitmap We use a bitmap to track which cylinder groups have changed between snapshot creation and filesystem suspension. The "legs" of the bitmap are four bytes wide (see ACTIVESET()) so we must round up the allocation size to a multiple of four bytes. I believe this bug is harmless since UMA/kmem_* will both pad the allocation and zero the full allocation. Note that malloc() does inline zeroing when the allocation size is known at compile-time. Reported by: pho (using KASAN) Reviewed by: kib, mckusick MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D27731 --- sys/ufs/ffs/ffs_snapshot.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/ufs/ffs/ffs_snapshot.c b/sys/ufs/ffs/ffs_snapshot.c index f224e828062b..201dbf6000de 100644 --- a/sys/ufs/ffs/ffs_snapshot.c +++ b/sys/ufs/ffs/ffs_snapshot.c @@ -385,8 +385,8 @@ restart: * touch up the few cylinder groups that changed during * the suspension period. */ - len = howmany(fs->fs_ncg, NBBY); - space = malloc(len, M_DEVBUF, M_WAITOK|M_ZERO); + len = roundup2(howmany(fs->fs_ncg, NBBY), sizeof(int)); + space = malloc(len, M_DEVBUF, M_WAITOK | M_ZERO); UFS_LOCK(ump); fs->fs_active = space; UFS_UNLOCK(ump); From owner-dev-commits-src-main@freebsd.org Wed Dec 23 16:37:07 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3D1EA4C414C; Wed, 23 Dec 2020 16:37:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D1Jl71B0Gz3P7w; Wed, 23 Dec 2020 16:37:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1B627211EB; Wed, 23 Dec 2020 16:37:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BNGb7da077928; Wed, 23 Dec 2020 16:37:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BNGb7uW077927; Wed, 23 Dec 2020 16:37:07 GMT (envelope-from git) Date: Wed, 23 Dec 2020 16:37:07 GMT Message-Id: <202012231637.0BNGb7uW077927@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 3b216bfb6cce - qatfw: Fix firmware autoloading for qat_c2xxx devices MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3b216bfb6cce24aa84519315138be8d23ac5d613 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2020 16:37:07 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=3b216bfb6cce24aa84519315138be8d23ac5d613 commit 3b216bfb6cce24aa84519315138be8d23ac5d613 Author: Mark Johnston AuthorDate: 2020-12-23 16:31:47 +0000 Commit: Mark Johnston CommitDate: 2020-12-23 16:36:45 +0000 qatfw: Fix firmware autoloading for qat_c2xxx devices r368193 was suppsed to rename the MOF firmware image, but the qat_c2xxxfw makefile defined the two images in the wrong order so the MMP image was renamed instead. MFC after: 3 days Sponsored by: Rubicon Communications, LLC (Netgate) --- sys/modules/qatfw/qat_c2xxx/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/modules/qatfw/qat_c2xxx/Makefile b/sys/modules/qatfw/qat_c2xxx/Makefile index 094d2ecdfdf6..fe73d1ef6aea 100644 --- a/sys/modules/qatfw/qat_c2xxx/Makefile +++ b/sys/modules/qatfw/qat_c2xxx/Makefile @@ -3,8 +3,8 @@ .PATH: ${SRCTOP}/sys/contrib/dev/qat KMOD= qat_c2xxxfw -IMG1= mmp_firmware_c2xxx -IMG2= mof_firmware_c2xxx +IMG1= mof_firmware_c2xxx +IMG2= mmp_firmware_c2xxx FIRMWS= ${IMG1}.bin:${KMOD}:111 ${IMG2}.bin:${IMG2}:111 From owner-dev-commits-src-main@freebsd.org Wed Dec 23 16:42:17 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0900B4C41E1; Wed, 23 Dec 2020 16:42:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D1Js46rKdz3PkW; Wed, 23 Dec 2020 16:42:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DDA3D21424; Wed, 23 Dec 2020 16:42:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BNGgGqN089054; Wed, 23 Dec 2020 16:42:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BNGgGq2089053; Wed, 23 Dec 2020 16:42:16 GMT (envelope-from git) Date: Wed, 23 Dec 2020 16:42:16 GMT Message-Id: <202012231642.0BNGgGq2089053@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 878d53410f75 - UPDATING: Announce git transition MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 878d53410f75dbd9401def736562c906f8fecc33 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2020 16:42:17 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=878d53410f75dbd9401def736562c906f8fecc33 commit 878d53410f75dbd9401def736562c906f8fecc33 Author: Warner Losh AuthorDate: 2020-12-23 16:40:45 +0000 Commit: Warner Losh CommitDate: 2020-12-23 16:40:45 +0000 UPDATING: Announce git transition Add an entry for the transition to git. --- UPDATING | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/UPDATING b/UPDATING index bfa428538b6b..d10e21604558 100644 --- a/UPDATING +++ b/UPDATING @@ -26,6 +26,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW: world, or to merely disable the most expensive debugging functionality at runtime, run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20201223: + The FreeBSD project has migrated from Subversion to Git. Temporary + instructions can be found at + https://github.com/bsdimp/freebsd-git-docs/blob/main/src-cvt.md + and other documents in that repo. + 20201216: The services database has been updated to cover more of the basic services expected in a modern system. The database is big enough From owner-dev-commits-src-main@freebsd.org Wed Dec 23 17:00:10 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A216E4C521A for ; Wed, 23 Dec 2020 17:00:10 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: from mail-ej1-f53.google.com (mail-ej1-f53.google.com [209.85.218.53]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D1KFk45Phz3R7m for ; Wed, 23 Dec 2020 17:00:07 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: by mail-ej1-f53.google.com with SMTP id lt17so88938ejb.3 for ; Wed, 23 Dec 2020 09:00:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=dZ4K7z9I81mVI/Bkhefzh88kyJi++EQvYutT/WOA+2E=; b=I2mB6bTQLW6CzBP36wPvsQPWZtdHxPQTR7wFQOSkbl3fUCqmieYQwtbsTy9sKaDTuU BjLUEqxJRKk7J08RQMeOEU1PRb6qzhtclU8UT9pWWneGseeLyG458t8Yhxvk/cDL8+Oj wmMyowvpeRFVM4r4WAQ0elXgRRsc86t1zdBXRPzDDs5vQv4LptXXs9HBicPFp45Uy9qE 8TlK0t0B9epCnlZ0wkwwQLjroxBluIjCRXS3gOSR/jpit1lUfZgisvNv1IDXangyAFaj Kix7ZiIj773HR8ALJSRrHjDyTjtEM7j9gMCbZxlyU0kG6FiD8jk3suwlNs5u+BXqEHPs xlFQ== X-Gm-Message-State: AOAM531SJ4vyJAIddnO25GYSPxkIj44AOKH+bZUokf5DS01BURaCtZ7h d3/1LfHvhIfunQdwtXHO8BfmBXGb/4M51P0rQs1qzA== X-Google-Smtp-Source: ABdhPJy8nPKSdIdZ+K25bU90Q64N2dbwyP5OGkkmgsu8ZQekfRcWNHYcVg4x3mOdBAzyFI2fLYSbnFZAeFkvKtBhhAk= X-Received: by 2002:a17:906:aec6:: with SMTP id me6mr24771461ejb.542.1608742805356; Wed, 23 Dec 2020 09:00:05 -0800 (PST) MIME-Version: 1.0 References: <202012231046.0BNAkAEw027089@gitrepo.freebsd.org> In-Reply-To: <202012231046.0BNAkAEw027089@gitrepo.freebsd.org> From: Maxim Sobolev Date: Wed, 23 Dec 2020 08:59:54 -0800 Message-ID: Subject: Re: git: 84eaf2ccc6aa - x86: stop punishing VMs with low priority for TSC timecounter To: Konstantin Belousov Cc: src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org X-Rspamd-Queue-Id: 4D1KFk45Phz3R7m X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2020 17:00:10 -0000 Thanks! The slowdown in my experience mostly comes from the fact that only TSC has userspace-mapped implementation for the clock_gettime(2) and friends. Combined of course with the fact that syscall is still horrendously expensive on VM. So if you have say 10 threads calling clock_gettime() 100 times per second (not uncommon for RTP/RTC apps) that causes 1,000 context switches just to do that. Let alone any useful workload the app might be doing. Unless the MFC is planned it might also be a good idea to document that for 12.x/11.x, the issue can easily be worked around by forcing TSC via loader tunable / sysctl. -Max On Wed., Dec. 23, 2020, 2:46 a.m. Konstantin Belousov, wrote: > The branch main has been updated by kib: > > URL: > https://cgit.FreeBSD.org/src/commit/?id=84eaf2ccc6aa05da7b7389991d3023698b756e3f > > commit 84eaf2ccc6aa05da7b7389991d3023698b756e3f > Author: Konstantin Belousov > AuthorDate: 2020-12-21 17:02:31 +0000 > Commit: Konstantin Belousov > CommitDate: 2020-12-23 10:45:15 +0000 > > x86: stop punishing VMs with low priority for TSC timecounter > > I suspect that virtualization techniques improved from the time when we > have to effectively disable TSC use in VM. For instance, it was > reported > (complained) in https://github.com/JuliaLang/julia/issues/38877 that > FreeBSD is groundlessly slow on AWS with some loads. > > Remove the check and start watching for complaints. > > Reviewed by: emaste, grehan > Discussed with: cperciva > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D27629 > --- > sys/x86/x86/tsc.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/sys/x86/x86/tsc.c b/sys/x86/x86/tsc.c > index c8e9be0c3cd5..6b5242fb5d4f 100644 > --- a/sys/x86/x86/tsc.c > +++ b/sys/x86/x86/tsc.c > @@ -499,7 +499,7 @@ test_tsc(int adj_max_count) > uint64_t *data, *tsc; > u_int i, size, adj; > > - if ((!smp_tsc && !tsc_is_invariant) || vm_guest) > + if ((!smp_tsc && !tsc_is_invariant)) > return (-100); > size = (mp_maxid + 1) * 3; > data = malloc(sizeof(*data) * size * N, M_TEMP, M_WAITOK); > > From owner-dev-commits-src-main@freebsd.org Wed Dec 23 17:05:52 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A2C3B4C5D1C; Wed, 23 Dec 2020 17:05:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D1KNJ4CsXz3hwk; Wed, 23 Dec 2020 17:05:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 834BF21D04; Wed, 23 Dec 2020 17:05:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BNH5qb9012922; Wed, 23 Dec 2020 17:05:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BNH5qwb012921; Wed, 23 Dec 2020 17:05:52 GMT (envelope-from git) Date: Wed, 23 Dec 2020 17:05:52 GMT Message-Id: <202012231705.0BNH5qwb012921@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 0ec2ce0d3273 - Improve input validation for parameters in ASCONF and ASCONF-ACK chunks MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0ec2ce0d32735e14708653ea08da055816f3f817 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2020 17:05:52 -0000 The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=0ec2ce0d32735e14708653ea08da055816f3f817 commit 0ec2ce0d32735e14708653ea08da055816f3f817 Author: Michael Tuexen AuthorDate: 2020-12-23 17:03:47 +0000 Commit: Michael Tuexen CommitDate: 2020-12-23 17:03:47 +0000 Improve input validation for parameters in ASCONF and ASCONF-ACK chunks Thanks to Tolya Korniltsev for drawing my attention to this part of the code by reporting an issue for the userland stack. --- sys/netinet/sctp_asconf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netinet/sctp_asconf.c b/sys/netinet/sctp_asconf.c index 3e425afef81a..c06ddf7b1f2e 100644 --- a/sys/netinet/sctp_asconf.c +++ b/sys/netinet/sctp_asconf.c @@ -723,7 +723,7 @@ sctp_handle_asconf(struct mbuf *m, unsigned int offset, sctp_m_freem(m_ack); return; } - if (param_length <= sizeof(struct sctp_paramhdr)) { + if (param_length < sizeof(struct sctp_asconf_paramhdr)) { SCTPDBG(SCTP_DEBUG_ASCONF1, "handle_asconf: param length (%u) too short\n", param_length); sctp_m_freem(m_ack); return; @@ -1743,7 +1743,7 @@ sctp_handle_asconf_ack(struct mbuf *m, int offset, sctp_asconf_ack_clear(stcb); return; } - if (param_length < sizeof(struct sctp_paramhdr)) { + if (param_length < sizeof(struct sctp_asconf_paramhdr)) { sctp_asconf_ack_clear(stcb); return; } From owner-dev-commits-src-main@freebsd.org Wed Dec 23 17:21:42 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0D7154C6281; Wed, 23 Dec 2020 17:21:42 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4D1KkY550Vz3jnW; Wed, 23 Dec 2020 17:21:41 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.16.1/8.16.1) with ESMTPS id 0BNHLRIq091660 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Wed, 23 Dec 2020 19:21:31 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 0BNHLRIq091660 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 0BNHLRur091659; Wed, 23 Dec 2020 19:21:27 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 23 Dec 2020 19:21:27 +0200 From: Konstantin Belousov To: Maxim Sobolev Cc: src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 84eaf2ccc6aa - x86: stop punishing VMs with low priority for TSC timecounter Message-ID: References: <202012231046.0BNAkAEw027089@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on tom.home X-Rspamd-Queue-Id: 4D1KkY550Vz3jnW X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2020 17:21:42 -0000 On Wed, Dec 23, 2020 at 08:59:54AM -0800, Maxim Sobolev wrote: > Thanks! The slowdown in my experience mostly comes from the fact that only > TSC has userspace-mapped implementation for the clock_gettime(2) and > friends. Combined of course with the fact that syscall is still HPET has userspace implementation, but of course HPET page access is slower by several orders than RDTSC, if hypervisor is not involved. That said, it really depends on hypervisor. It is possible to trap RDTSC* and some hypervisors do that. Some use feature available on most Intel machines, where tsc can be adjusted by some fixed amount, which avoids VMX exit. Other clocks, like typically used ACPI-fast or i8254 if TSC is disabled, always require VMX exit in addition to syscall, that makes gettimeofday() prohibitely slow. > horrendously expensive on VM. So if you have say 10 threads calling > clock_gettime() 100 times per second (not uncommon for RTP/RTC apps) that > causes 1,000 context switches just to do that. Let alone any useful > workload the app might be doing. > > Unless the MFC is planned it might also be a good idea to document that for > 12.x/11.x, the issue can easily be worked around by forcing TSC via loader > tunable / sysctl. I plan to do MFC, but plan to give a long time for this change in HEAD to see complains. Although in practicy I rarely get good feedback before such kind of changes are merged to stable. From owner-dev-commits-src-main@freebsd.org Wed Dec 23 17:47:07 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 156914C64C2; Wed, 23 Dec 2020 17:47:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D1LHv08QNz3kyk; Wed, 23 Dec 2020 17:47:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E899522217; Wed, 23 Dec 2020 17:47:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BNHl6dA059011; Wed, 23 Dec 2020 17:47:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BNHl609059010; Wed, 23 Dec 2020 17:47:06 GMT (envelope-from git) Date: Wed, 23 Dec 2020 17:47:06 GMT Message-Id: <202012231747.0BNHl609059010@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ryan Moeller Subject: git: a5ec1dd453cd - sbin/sysctl: Always honor skip in sysctl_all MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: freqlabs X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a5ec1dd453cde12524033c7d5c68b4d68d1b2360 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2020 17:47:07 -0000 The branch main has been updated by freqlabs: URL: https://cgit.FreeBSD.org/src/commit/?id=a5ec1dd453cde12524033c7d5c68b4d68d1b2360 commit a5ec1dd453cde12524033c7d5c68b4d68d1b2360 Author: Ryan Moeller AuthorDate: 2020-12-23 17:42:38 +0000 Commit: Ryan Moeller CommitDate: 2020-12-23 17:42:38 +0000 sbin/sysctl: Always honor skip in sysctl_all Fix broken CTLFLAG_SKIP when present on the first child of the requested node. We don't need to ignore skip for the first node because in sysctl_all() we've implicitly visited the first node already when oid is specified. The first call to show_var() in here is after we have iterated to the next node. When the command line specifically requests a non-node sysctl we go straight into show_var() without calling sysctl_all(). Reported by: jhb Reviewed by: jhb Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D27674 --- sbin/sysctl/sysctl.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c index a2b02c86fb4c..adfe6c6d3b2c 100644 --- a/sbin/sysctl/sysctl.c +++ b/sbin/sysctl/sysctl.c @@ -1227,7 +1227,6 @@ sysctl_all(int *oid, int len) int name1[22], name2[22]; int i, j; size_t l1, l2; - bool honor_skip = false; name1[0] = CTL_SYSCTL; name1[1] = (oid != NULL || Nflag || dflag || tflag) ? @@ -1258,12 +1257,11 @@ sysctl_all(int *oid, int len) if (memcmp(name2, oid, len * sizeof(int)) != 0) return (0); - i = show_var(name2, l2, honor_skip); + i = show_var(name2, l2, true); if (!i && !bflag) putchar('\n'); memcpy(name1 + 2, name2, l2 * sizeof(int)); l1 = 2 + l2; - honor_skip = true; } } From owner-dev-commits-src-main@freebsd.org Wed Dec 23 17:47:07 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 037964C65E5; Wed, 23 Dec 2020 17:47:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D1LHt6dYwz3lCm; Wed, 23 Dec 2020 17:47:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D69F52214F; Wed, 23 Dec 2020 17:47:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BNHl6vM058994; Wed, 23 Dec 2020 17:47:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BNHl6gZ058993; Wed, 23 Dec 2020 17:47:06 GMT (envelope-from git) Date: Wed, 23 Dec 2020 17:47:06 GMT Message-Id: <202012231747.0BNHl6gZ058993@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ryan Moeller Subject: git: 401f82df4879 - sbin/sysctl: Style fix MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: freqlabs X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 401f82df4879236e082e2bfce4095692c3942122 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2020 17:47:07 -0000 The branch main has been updated by freqlabs: URL: https://cgit.FreeBSD.org/src/commit/?id=401f82df4879236e082e2bfce4095692c3942122 commit 401f82df4879236e082e2bfce4095692c3942122 Author: Ryan Moeller AuthorDate: 2020-12-23 17:45:11 +0000 Commit: Ryan Moeller CommitDate: 2020-12-23 17:45:11 +0000 sbin/sysctl: Style fix Remove parameter names from function prototype to match other prototypes in the file. Sponsored by: iXsystems, Inc. --- sbin/sysctl/sysctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c index adfe6c6d3b2c..bd1e357065dc 100644 --- a/sbin/sysctl/sysctl.c +++ b/sbin/sysctl/sysctl.c @@ -71,7 +71,7 @@ static int oidfmt(int *, int, char *, u_int *); static int parsefile(const char *); static int parse(const char *, int); static int show_var(int *, int, bool); -static int sysctl_all(int *oid, int len); +static int sysctl_all(int *, int); static int name2oid(const char *, int *); static int strIKtoi(const char *, char **, const char *); From owner-dev-commits-src-main@freebsd.org Wed Dec 23 18:26:58 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A36E64C8073; Wed, 23 Dec 2020 18:26:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D1M9t4B90z3pH1; Wed, 23 Dec 2020 18:26:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7DD8D22A29; Wed, 23 Dec 2020 18:26:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BNIQwNW005362; Wed, 23 Dec 2020 18:26:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BNIQwkM005361; Wed, 23 Dec 2020 18:26:58 GMT (envelope-from git) Date: Wed, 23 Dec 2020 18:26:58 GMT Message-Id: <202012231826.0BNIQwkM005361@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Robert Wing Subject: git: c4df8cbfde53 - Remove bvmconsole and bvmdebug. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c4df8cbfde53c376d93f439eac3f45a7b4fc705e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2020 18:26:58 -0000 The branch main has been updated by rew: URL: https://cgit.FreeBSD.org/src/commit/?id=c4df8cbfde53c376d93f439eac3f45a7b4fc705e commit c4df8cbfde53c376d93f439eac3f45a7b4fc705e Author: Robert Wing AuthorDate: 2020-12-24 01:15:33 +0000 Commit: Robert Wing CommitDate: 2020-12-24 02:15:23 +0000 Remove bvmconsole and bvmdebug. Now that bhyve(8) supports UART, bvmconsole and bvmdebug are no longer needed. This also removes the '-b' and '-g' flag from bhyve(8). These two flags were marked deprecated in r368519. Reviewed by: grehan, kevans Approved by: kevans (mentor) Differential Revision: https://reviews.freebsd.org/D27490 --- sys/conf/files.amd64 | 5 - sys/conf/files.i386 | 5 - sys/dev/bvm/bvm_console.c | 241 ---------------------------------------------- sys/dev/bvm/bvm_dbg.c | 104 -------------------- usr.sbin/bhyve/Makefile | 2 - usr.sbin/bhyve/bhyve.8 | 21 +--- usr.sbin/bhyve/bhyverun.c | 28 +----- usr.sbin/bhyve/consport.c | 178 ---------------------------------- usr.sbin/bhyve/dbgport.c | 178 ---------------------------------- usr.sbin/bhyve/dbgport.h | 36 ------- usr.sbin/bhyve/inout.h | 1 - usr.sbin/bhyve/snapshot.c | 1 - 12 files changed, 7 insertions(+), 793 deletions(-) diff --git a/sys/conf/files.amd64 b/sys/conf/files.amd64 index 983fea2cb8c2..00b8b8c57ee1 100644 --- a/sys/conf/files.amd64 +++ b/sys/conf/files.amd64 @@ -444,11 +444,6 @@ compat/ndis/winx64_wrap.S optional ndisapi pci # compat/x86bios/x86bios.c optional x86bios | dpms | pci | vesa contrib/x86emu/x86emu.c optional x86bios | dpms | pci | vesa -# -# bvm console -# -dev/bvm/bvm_console.c optional bvmconsole -dev/bvm/bvm_dbg.c optional bvmdebug # Common files where we currently configure the system differently, but perhaps shouldn't # config(8) doesn't have a way to force standard options, so we've been inconsistent # about marking non-optional things 'standard'. diff --git a/sys/conf/files.i386 b/sys/conf/files.i386 index bae1a8cde184..96d2413b532d 100644 --- a/sys/conf/files.i386 +++ b/sys/conf/files.i386 @@ -226,11 +226,6 @@ libkern/umoddi3.c standard # x86 real mode BIOS support, required by dpms/pci/vesa # compat/x86bios/x86bios.c optional x86bios | dpms | pci | vesa -# -# bvm console -# -dev/bvm/bvm_console.c optional bvmconsole -dev/bvm/bvm_dbg.c optional bvmdebug # Common files where we currently configure the system differently, but perhaps shouldn't # config(8) doesn't have a way to force standard options, so we've been inconsistent # about marking non-optional things 'standard'. diff --git a/sys/dev/bvm/bvm_console.c b/sys/dev/bvm/bvm_console.c deleted file mode 100644 index c73f462ed84f..000000000000 --- a/sys/dev/bvm/bvm_console.c +++ /dev/null @@ -1,241 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD - * - * Copyright (c) 2011 NetApp, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY NETAPP, INC ``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 NETAPP, INC OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#ifndef BVMCONS_POLL_HZ -#define BVMCONS_POLL_HZ 4 -#endif -#define BVMBURSTLEN 16 /* max number of bytes to write in one chunk */ - -static tsw_open_t bvm_tty_open; -static tsw_close_t bvm_tty_close; -static tsw_outwakeup_t bvm_tty_outwakeup; - -static struct ttydevsw bvm_ttydevsw = { - .tsw_flags = TF_NOPREFIX, - .tsw_open = bvm_tty_open, - .tsw_close = bvm_tty_close, - .tsw_outwakeup = bvm_tty_outwakeup, -}; - -static int polltime; -static struct callout bvm_timer; - -#if defined(KDB) -static int alt_break_state; -#endif - -#define BVM_CONS_PORT 0x220 -static int bvm_cons_port = BVM_CONS_PORT; - -#define BVM_CONS_SIG ('b' << 8 | 'v') - -static void bvm_timeout(void *); - -static cn_probe_t bvm_cnprobe; -static cn_init_t bvm_cninit; -static cn_term_t bvm_cnterm; -static cn_getc_t bvm_cngetc; -static cn_putc_t bvm_cnputc; -static cn_grab_t bvm_cngrab; -static cn_ungrab_t bvm_cnungrab; - -CONSOLE_DRIVER(bvm); - -static int -bvm_rcons(u_char *ch) -{ - int c; - - c = inl(bvm_cons_port); - if (c != -1) { - *ch = (u_char)c; - return (0); - } else - return (-1); -} - -static void -bvm_wcons(u_char ch) -{ - - outl(bvm_cons_port, ch); -} - -static void -cn_drvinit(void *unused) -{ - struct tty *tp; - - gone_in(13, "bvmconsole"); - - if (bvm_consdev.cn_pri != CN_DEAD) { - tp = tty_alloc(&bvm_ttydevsw, NULL); - callout_init_mtx(&bvm_timer, tty_getlock(tp), 0); - tty_makedev(tp, NULL, "bvmcons"); - } -} - -static int -bvm_tty_open(struct tty *tp) -{ - polltime = hz / BVMCONS_POLL_HZ; - if (polltime < 1) - polltime = 1; - callout_reset(&bvm_timer, polltime, bvm_timeout, tp); - - return (0); -} - -static void -bvm_tty_close(struct tty *tp) -{ - - tty_assert_locked(tp); - callout_stop(&bvm_timer); -} - -static void -bvm_tty_outwakeup(struct tty *tp) -{ - int len, written; - u_char buf[BVMBURSTLEN]; - - for (;;) { - len = ttydisc_getc(tp, buf, sizeof(buf)); - if (len == 0) - break; - - written = 0; - while (written < len) - bvm_wcons(buf[written++]); - } -} - -static void -bvm_timeout(void *v) -{ - struct tty *tp; - int c; - - tp = (struct tty *)v; - - tty_assert_locked(tp); - while ((c = bvm_cngetc(NULL)) != -1) - ttydisc_rint(tp, c, 0); - ttydisc_rint_done(tp); - - callout_reset(&bvm_timer, polltime, bvm_timeout, tp); -} - -static void -bvm_cnprobe(struct consdev *cp) -{ - int disabled, port; - - disabled = 0; - cp->cn_pri = CN_DEAD; - strcpy(cp->cn_name, "bvmcons"); - - resource_int_value("bvmconsole", 0, "disabled", &disabled); - if (!disabled) { - if (resource_int_value("bvmconsole", 0, "port", &port) == 0) - bvm_cons_port = port; - - if (inw(bvm_cons_port) == BVM_CONS_SIG) - cp->cn_pri = CN_REMOTE; - } -} - -static void -bvm_cninit(struct consdev *cp) -{ - int i; - const char *bootmsg = "Using bvm console.\n"; - - if (boothowto & RB_VERBOSE) { - for (i = 0; i < strlen(bootmsg); i++) - bvm_cnputc(cp, bootmsg[i]); - } -} - -static void -bvm_cnterm(struct consdev *cp) -{ - -} - -static int -bvm_cngetc(struct consdev *cp) -{ - unsigned char ch; - - if (bvm_rcons(&ch) == 0) { -#if defined(KDB) - kdb_alt_break(ch, &alt_break_state); -#endif - return (ch); - } - - return (-1); -} - -static void -bvm_cnputc(struct consdev *cp, int c) -{ - - bvm_wcons(c); -} - -static void -bvm_cngrab(struct consdev *cp) -{ -} - -static void -bvm_cnungrab(struct consdev *cp) -{ -} - -SYSINIT(cndev, SI_SUB_CONFIGURE, SI_ORDER_MIDDLE, cn_drvinit, NULL); diff --git a/sys/dev/bvm/bvm_dbg.c b/sys/dev/bvm/bvm_dbg.c deleted file mode 100644 index 9aff8c10c8fb..000000000000 --- a/sys/dev/bvm/bvm_dbg.c +++ /dev/null @@ -1,104 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD - * - * Copyright (c) 2011 NetApp, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY NETAPP, INC ``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 NETAPP, INC OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include - -#include - -#include - -static gdb_probe_f bvm_dbg_probe; -static gdb_init_f bvm_dbg_init; -static gdb_term_f bvm_dbg_term; -static gdb_getc_f bvm_dbg_getc; -static gdb_putc_f bvm_dbg_putc; - -GDB_DBGPORT(bvm, bvm_dbg_probe, bvm_dbg_init, bvm_dbg_term, - bvm_dbg_getc, bvm_dbg_putc); - -#define BVM_DBG_PORT 0x224 -static int bvm_dbg_port = BVM_DBG_PORT; - -#define BVM_DBG_SIG ('B' << 8 | 'V') - -static int -bvm_dbg_probe(void) -{ - int disabled, port; - - disabled = 0; - resource_int_value("bvmdbg", 0, "disabled", &disabled); - - gone_in(13, "bvmdebug"); - - if (!disabled) { - if (resource_int_value("bvmdbg", 0, "port", &port) == 0) - bvm_dbg_port = port; - - if (inw(bvm_dbg_port) == BVM_DBG_SIG) { - /* - * Return a higher priority than 0 to override other - * gdb dbgport providers that may be present (e.g. uart) - */ - return (1); - } - } - - return (-1); -} - -static void -bvm_dbg_init(void) -{ -} - -static void -bvm_dbg_term(void) -{ -} - -static void -bvm_dbg_putc(int c) -{ - - outl(bvm_dbg_port, c); -} - -static int -bvm_dbg_getc(void) -{ - - return (inl(bvm_dbg_port)); -} diff --git a/usr.sbin/bhyve/Makefile b/usr.sbin/bhyve/Makefile index b884930d5b03..0233690a5082 100644 --- a/usr.sbin/bhyve/Makefile +++ b/usr.sbin/bhyve/Makefile @@ -23,10 +23,8 @@ SRCS= \ block_if.c \ bootrom.c \ console.c \ - consport.c \ ctl_util.c \ ctl_scsi_all.c \ - dbgport.c \ fwctl.c \ gdb.c \ hda_codec.c \ diff --git a/usr.sbin/bhyve/bhyve.8 b/usr.sbin/bhyve/bhyve.8 index f93e73e2e1be..a3ea7be0b579 100644 --- a/usr.sbin/bhyve/bhyve.8 +++ b/usr.sbin/bhyve/bhyve.8 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 8, 2020 +.Dd December 23, 2020 .Dt BHYVE 8 .Os .Sh NAME @@ -32,7 +32,7 @@ .Nd "run a guest operating system inside a virtual machine" .Sh SYNOPSIS .Nm -.Op Fl AabCDeHhPSuWwxY +.Op Fl AaCDeHhPSuWwxY .Oo .Sm off .Fl c\~ @@ -46,7 +46,6 @@ .Oc .Sm on .Op Fl G Ar port -.Op Fl g Ar gdbport .Oo Fl l .Sm off .Cm help | Ar lpcdev Op Cm \&, Ar conf @@ -99,13 +98,6 @@ Generate ACPI tables. Required for .Fx Ns /amd64 guests. -.It Fl b -Enable a low-level console device supported by -.Fx -kernels compiled with -.Cd "device bvmconsole" . -This option is deprecated and will be removed in -.Fx 13.0 . .It Fl c Op Ar setting ... Number of guest virtual CPUs and/or the CPU topology. @@ -139,15 +131,6 @@ Force .Nm to exit when a guest issues an access to an I/O port that is not emulated. This is intended for debug purposes. -.It Fl g Ar gdbport -For -.Fx -kernels compiled with -.Cd "device bvmdebug" , -allow a remote kernel kgdb to be relayed to the guest kernel gdb stub -via a local IPv4 address and this port. -This option is deprecated and will be removed in -.Fx 13.0 . .It Fl G Ar port Start a debug server that uses the GDB protocol to export guest state to a debugger. diff --git a/usr.sbin/bhyve/bhyverun.c b/usr.sbin/bhyve/bhyverun.c index bca5f44c2b40..aafab4af8d8c 100644 --- a/usr.sbin/bhyve/bhyverun.c +++ b/usr.sbin/bhyve/bhyverun.c @@ -88,7 +88,6 @@ __FBSDID("$FreeBSD$"); #include "atkbdc.h" #include "bootrom.h" #include "inout.h" -#include "dbgport.h" #include "debug.h" #include "fwctl.h" #include "gdb.h" @@ -237,9 +236,9 @@ usage(int code) { fprintf(stderr, - "Usage: %s [-abehuwxACDHPSWY]\n" + "Usage: %s [-aehuwxACDHPSWY]\n" " %*s [-c [[cpus=]numcpus][,sockets=n][,cores=n][,threads=n]]\n" - " %*s [-g ] [-l ]\n" + " %*s [-l ]\n" " %*s [-m mem] [-p vcpu:hostcpu] [-s ] [-U uuid] \n" " -a: local apic is in xAPIC mode (deprecated)\n" " -A: create ACPI tables\n" @@ -247,7 +246,6 @@ usage(int code) " -C: include guest memory in core file\n" " -D: destroy on power-off\n" " -e: exit on unhandled I/O access\n" - " -g: gdb port\n" " -h: help\n" " -H: vmexit from the guest on hlt\n" " -l: LPC device configuration\n" @@ -1082,7 +1080,7 @@ spinup_vcpu(struct vmctx *ctx, int vcpu) int main(int argc, char *argv[]) { - int c, error, dbg_port, err, bvmcons; + int c, error, err; int max_vcpus, mptgen, memflags; int rtc_localtime; bool gdb_stop; @@ -1098,9 +1096,7 @@ main(int argc, char *argv[]) restore_file = NULL; #endif - bvmcons = 0; progname = basename(argv[0]); - dbg_port = 0; gdb_stop = false; guest_ncpus = 1; sockets = cores = threads = 1; @@ -1111,9 +1107,9 @@ main(int argc, char *argv[]) memflags = 0; #ifdef BHYVE_SNAPSHOT - optstr = "abehuwxACDHIPSWYp:g:G:c:s:m:l:U:r:"; + optstr = "aehuwxACDHIPSWYp:G:c:s:m:l:U:r:"; #else - optstr = "abehuwxACDHIPSWYp:g:G:c:s:m:l:U:"; + optstr = "aehuwxACDHIPSWYp:G:c:s:m:l:U:"; #endif while ((c = getopt(argc, argv, optstr)) != -1) { switch (c) { @@ -1123,10 +1119,6 @@ main(int argc, char *argv[]) case 'A': acpi = 1; break; - case 'b': - warnx("-b flag is deprecated and will be removed in FreeBSD 13.0"); - bvmcons = 1; - break; case 'D': destroy_on_poweroff = 1; break; @@ -1145,10 +1137,6 @@ main(int argc, char *argv[]) case 'C': memflags |= VM_MEM_F_INCORE; break; - case 'g': - warnx("-g flag is deprecated and will be removed in FreeBSD 13.0"); - dbg_port = atoi(optarg); - break; case 'G': if (optarg[0] == 'w') { gdb_stop = true; @@ -1323,15 +1311,9 @@ main(int argc, char *argv[]) if (acpi) vmgenc_init(ctx); - if (dbg_port != 0) - init_dbgport(dbg_port); - if (gdb_port != 0) init_gdb(ctx, gdb_port, gdb_stop); - if (bvmcons) - init_bvmcons(); - if (lpc_bootrom()) { if (vm_set_capability(ctx, BSP, VM_CAP_UNRESTRICTED_GUEST, 1)) { fprintf(stderr, "ROM boot failed: unrestricted guest " diff --git a/usr.sbin/bhyve/consport.c b/usr.sbin/bhyve/consport.c deleted file mode 100644 index 634521985541..000000000000 --- a/usr.sbin/bhyve/consport.c +++ /dev/null @@ -1,178 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD - * - * Copyright (c) 2011 NetApp, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY NETAPP, INC ``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 NETAPP, INC OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#ifndef WITHOUT_CAPSICUM -#include -#endif -#include - -#ifndef WITHOUT_CAPSICUM -#include -#endif -#include -#include -#include -#include -#include -#include -#include -#include - -#include "inout.h" -#include "pci_lpc.h" -#include "debug.h" - -#define BVM_CONSOLE_PORT 0x220 -#define BVM_CONS_SIG ('b' << 8 | 'v') - -static struct termios tio_orig, tio_new; - -static void -ttyclose(void) -{ - tcsetattr(STDIN_FILENO, TCSANOW, &tio_orig); -} - -static void -ttyopen(void) -{ - tcgetattr(STDIN_FILENO, &tio_orig); - - cfmakeraw(&tio_new); - tcsetattr(STDIN_FILENO, TCSANOW, &tio_new); - raw_stdio = 1; - - atexit(ttyclose); -} - -static bool -tty_char_available(void) -{ - fd_set rfds; - struct timeval tv; - - FD_ZERO(&rfds); - FD_SET(STDIN_FILENO, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 0; - if (select(STDIN_FILENO + 1, &rfds, NULL, NULL, &tv) > 0) { - return (true); - } else { - return (false); - } -} - -static int -ttyread(void) -{ - char rb; - - if (tty_char_available()) { - read(STDIN_FILENO, &rb, 1); - return (rb & 0xff); - } else { - return (-1); - } -} - -static void -ttywrite(unsigned char wb) -{ - (void) write(STDOUT_FILENO, &wb, 1); -} - -static int -console_handler(struct vmctx *ctx, int vcpu, int in, int port, int bytes, - uint32_t *eax, void *arg) -{ - static int opened; -#ifndef WITHOUT_CAPSICUM - cap_rights_t rights; - cap_ioctl_t cmds[] = { TIOCGETA, TIOCSETA, TIOCGWINSZ }; -#endif - - if (bytes == 2 && in) { - *eax = BVM_CONS_SIG; - return (0); - } - - /* - * Guests might probe this port to look for old ISA devices - * using single-byte reads. Return 0xff for those. - */ - if (bytes == 1 && in) { - *eax = 0xff; - return (0); - } - - if (bytes != 4) - return (-1); - - if (!opened) { -#ifndef WITHOUT_CAPSICUM - cap_rights_init(&rights, CAP_EVENT, CAP_IOCTL, CAP_READ, - CAP_WRITE); - if (caph_rights_limit(STDIN_FILENO, &rights) == -1) - errx(EX_OSERR, "Unable to apply rights for sandbox"); - if (caph_ioctls_limit(STDIN_FILENO, cmds, nitems(cmds)) == -1) - errx(EX_OSERR, "Unable to apply rights for sandbox"); -#endif - ttyopen(); - opened = 1; - } - - if (in) - *eax = ttyread(); - else - ttywrite(*eax); - - return (0); -} - -SYSRES_IO(BVM_CONSOLE_PORT, 4); - -static struct inout_port consport = { - "bvmcons", - BVM_CONSOLE_PORT, - 1, - IOPORT_F_INOUT, - console_handler -}; - -void -init_bvmcons(void) -{ - - register_inout(&consport); -} diff --git a/usr.sbin/bhyve/dbgport.c b/usr.sbin/bhyve/dbgport.c deleted file mode 100644 index e0aab7e64ff2..000000000000 --- a/usr.sbin/bhyve/dbgport.c +++ /dev/null @@ -1,178 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD - * - * Copyright (c) 2011 NetApp, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY NETAPP, INC ``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 NETAPP, INC OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#ifndef WITHOUT_CAPSICUM -#include -#endif -#include -#include -#include -#include - -#ifndef WITHOUT_CAPSICUM -#include -#endif -#include -#include -#include -#include -#include -#include -#include - -#include "inout.h" -#include "dbgport.h" -#include "pci_lpc.h" - -#define BVM_DBG_PORT 0x224 -#define BVM_DBG_SIG ('B' << 8 | 'V') - -static int listen_fd, conn_fd; - -static struct sockaddr_in sin; - -static int -dbg_handler(struct vmctx *ctx, int vcpu, int in, int port, int bytes, - uint32_t *eax, void *arg) -{ - int nwritten, nread, printonce; - int on = 1; - char ch; - - if (bytes == 2 && in) { - *eax = BVM_DBG_SIG; - return (0); - } - - if (bytes != 4) - return (-1); - -again: - printonce = 0; - while (conn_fd < 0) { - if (!printonce) { - printf("Waiting for connection from gdb\r\n"); - printonce = 1; - } - conn_fd = accept4(listen_fd, NULL, NULL, SOCK_NONBLOCK); - if (conn_fd >= 0) { - /* Avoid EPIPE after the client drops off. */ - (void)setsockopt(conn_fd, SOL_SOCKET, SO_NOSIGPIPE, - &on, sizeof(on)); - /* Improve latency for one byte at a time tranfers. */ - (void)setsockopt(conn_fd, IPPROTO_TCP, TCP_NODELAY, - &on, sizeof(on)); - } else if (errno != EINTR) { - perror("accept"); - } - } - - if (in) { - nread = read(conn_fd, &ch, 1); - if (nread == -1 && errno == EAGAIN) - *eax = -1; - else if (nread == 1) - *eax = ch; - else { - close(conn_fd); - conn_fd = -1; - goto again; - } - } else { - ch = *eax; - nwritten = write(conn_fd, &ch, 1); - if (nwritten != 1) { - close(conn_fd); - conn_fd = -1; - goto again; - } - } - return (0); -} - -static struct inout_port dbgport = { - "bvmdbg", - BVM_DBG_PORT, - 1, - IOPORT_F_INOUT, - dbg_handler -}; - -SYSRES_IO(BVM_DBG_PORT, 4); - -void -init_dbgport(int sport) -{ - int reuse; -#ifndef WITHOUT_CAPSICUM - cap_rights_t rights; -#endif - - conn_fd = -1; - - if ((listen_fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) { - perror("cannot create socket"); - exit(4); - } - - sin.sin_len = sizeof(sin); - sin.sin_family = AF_INET; - sin.sin_addr.s_addr = htonl(INADDR_ANY); - sin.sin_port = htons(sport); - - reuse = 1; - if (setsockopt(listen_fd, SOL_SOCKET, SO_REUSEADDR, &reuse, - sizeof(reuse)) < 0) { - perror("cannot set socket options"); - exit(4); - } - - if (bind(listen_fd, (struct sockaddr *)&sin, sizeof(sin)) < 0) { - perror("cannot bind socket"); - exit(4); - } - - if (listen(listen_fd, 1) < 0) { - perror("cannot listen socket"); - exit(4); - } - -#ifndef WITHOUT_CAPSICUM - cap_rights_init(&rights, CAP_ACCEPT, CAP_READ, CAP_WRITE); - if (caph_rights_limit(listen_fd, &rights) == -1) - errx(EX_OSERR, "Unable to apply rights for sandbox"); -#endif - - register_inout(&dbgport); -} diff --git a/usr.sbin/bhyve/dbgport.h b/usr.sbin/bhyve/dbgport.h deleted file mode 100644 index 407ff3ffbf5f..000000000000 --- a/usr.sbin/bhyve/dbgport.h +++ /dev/null @@ -1,36 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD - * - * Copyright (c) 2011 NetApp, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the *** 46 LINES SKIPPED *** From owner-dev-commits-src-main@freebsd.org Wed Dec 23 18:36:24 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 213A84C83D6; Wed, 23 Dec 2020 18:36:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D1MNm0RTLz3pgw; Wed, 23 Dec 2020 18:36:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 01EBB229CF; Wed, 23 Dec 2020 18:36:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BNIaNbI017680; Wed, 23 Dec 2020 18:36:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BNIaN0v017679; Wed, 23 Dec 2020 18:36:23 GMT (envelope-from git) Date: Wed, 23 Dec 2020 18:36:23 GMT Message-Id: <202012231836.0BNIaN0v017679@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: fd29833d9a7d - gdb(4): handle single register read packets MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fd29833d9a7d8355ce21743ed8c706b72ba03363 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2020 18:36:24 -0000 The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=fd29833d9a7d8355ce21743ed8c706b72ba03363 commit fd29833d9a7d8355ce21743ed8c706b72ba03363 Author: Mitchell Horne AuthorDate: 2020-12-23 18:36:08 +0000 Commit: Mitchell Horne CommitDate: 2020-12-23 18:36:08 +0000 gdb(4): handle single register read packets We support bulk reads of the register set, but not reading specific registers via the 'p' packet. This is useful at least for the 'call' command in gdb. Reviewed by: cem MFC after: 1 week Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. NetApp PR: 44 Differential Revision: https://reviews.freebsd.org/D27644 --- sys/gdb/gdb_main.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sys/gdb/gdb_main.c b/sys/gdb/gdb_main.c index 70ffe0719c45..588a97c56a40 100644 --- a/sys/gdb/gdb_main.c +++ b/sys/gdb/gdb_main.c @@ -755,6 +755,17 @@ gdb_trap(int type, int code) gdb_tx_ok(); break; } + case 'p': { /* Read register. */ + uintmax_t reg; + if (gdb_rx_varhex(®)) { + gdb_tx_err(EINVAL); + break; + } + gdb_tx_begin(0); + gdb_tx_reg(reg); + gdb_tx_end(); + break; + } case 'P': { /* Write register. */ char *val; uintmax_t reg; From owner-dev-commits-src-main@freebsd.org Wed Dec 23 18:50:27 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C29274C8C10; Wed, 23 Dec 2020 18:50:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D1Mhz5CQmz3qkp; Wed, 23 Dec 2020 18:50:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A34D822D1A; Wed, 23 Dec 2020 18:50:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BNIoRdo036961; Wed, 23 Dec 2020 18:50:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BNIoRwx036960; Wed, 23 Dec 2020 18:50:27 GMT (envelope-from git) Date: Wed, 23 Dec 2020 18:50:27 GMT Message-Id: <202012231850.0BNIoRwx036960@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: 3f3cc995a35a - gdb(4): allow bulk write of registers MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3f3cc995a35a3e9136204a98af0af5808c11047f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2020 18:50:27 -0000 The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=3f3cc995a35a3e9136204a98af0af5808c11047f commit 3f3cc995a35a3e9136204a98af0af5808c11047f Author: Mitchell Horne AuthorDate: 2020-12-23 18:37:05 +0000 Commit: Mitchell Horne CommitDate: 2020-12-23 18:37:05 +0000 gdb(4): allow bulk write of registers Add support for the remote 'G' packet. This is not widely used by gdb when 'P' is supported, but is technically required by any remote gdb stub implementation [1]. [1] https://sourceware.org/gdb/current/onlinedocs/gdb/Overview.html Reviewed by: cem MFC after: 1 week Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. NetApp PR: 44 Differential Revision: https://reviews.freebsd.org/D27644 --- sys/gdb/gdb_main.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/sys/gdb/gdb_main.c b/sys/gdb/gdb_main.c index 588a97c56a40..6e0c9f21f947 100644 --- a/sys/gdb/gdb_main.c +++ b/sys/gdb/gdb_main.c @@ -700,9 +700,23 @@ gdb_trap(int type, int code) gdb_tx_end(); break; } - case 'G': /* Write registers. */ - gdb_tx_err(0); + case 'G': { /* Write registers. */ + char *val; + bool success; + size_t r; + for (success = true, r = 0; r < GDB_NREGS; r++) { + val = gdb_rxp; + if (!gdb_rx_mem(val, gdb_cpu_regsz(r))) { + gdb_tx_err(EINVAL); + success = false; + break; + } + gdb_cpu_setreg(r, val); + } + if (success) + gdb_tx_ok(); break; + } case 'H': { /* Set thread. */ intmax_t tid; struct thread *thr; From owner-dev-commits-src-main@freebsd.org Wed Dec 23 19:42:08 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 563D54C99A4; Wed, 23 Dec 2020 19:42:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D1Nrc22MDz3t5b; Wed, 23 Dec 2020 19:42:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3907223AC1; Wed, 23 Dec 2020 19:42:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BNJg8gR098819; Wed, 23 Dec 2020 19:42:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BNJg82S098818; Wed, 23 Dec 2020 19:42:08 GMT (envelope-from git) Date: Wed, 23 Dec 2020 19:42:08 GMT Message-Id: <202012231942.0BNJg82S098818@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: 962c06c5a32d - gdb(4) fix x86 signal reporting MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 962c06c5a32deb9357851d5aca060defc79e6e90 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2020 19:42:08 -0000 The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=962c06c5a32deb9357851d5aca060defc79e6e90 commit 962c06c5a32deb9357851d5aca060defc79e6e90 Author: Mitchell Horne AuthorDate: 2020-12-23 19:36:17 +0000 Commit: Mitchell Horne CommitDate: 2020-12-23 19:40:14 +0000 gdb(4) fix x86 signal reporting The existing values correspond to x86 exception vector numbers, but the trap numbers used in the kernel do not match these 1-to-1. Prefer the definitions from x86/trap.h, as they are what actually get passed to kdb_trap(). This is of little consequence, as gdb_cpu_signal() only reports the trap reason (signal number) to the gdb client. This is limited to the subset of trap values for which kdb_trap() is reachable. Reviewed by: kib Discussed with: jhb MFC after: 1 week Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D27645 --- sys/amd64/amd64/gdb_machdep.c | 27 ++++++++++++--------------- sys/i386/i386/gdb_machdep.c | 27 ++++++++++++--------------- 2 files changed, 24 insertions(+), 30 deletions(-) diff --git a/sys/amd64/amd64/gdb_machdep.c b/sys/amd64/amd64/gdb_machdep.c index eda1ab72168d..610096e1355d 100644 --- a/sys/amd64/amd64/gdb_machdep.c +++ b/sys/amd64/amd64/gdb_machdep.c @@ -136,21 +136,18 @@ gdb_cpu_signal(int type, int code) { switch (type & ~T_USER) { - case 0: return (SIGFPE); /* Divide by zero. */ - case 1: return (SIGTRAP); /* Debug exception. */ - case 3: return (SIGTRAP); /* Breakpoint. */ - case 4: return (SIGSEGV); /* into instr. (overflow). */ - case 5: return (SIGURG); /* bound instruction. */ - case 6: return (SIGILL); /* Invalid opcode. */ - case 7: return (SIGFPE); /* Coprocessor not present. */ - case 8: return (SIGEMT); /* Double fault. */ - case 9: return (SIGSEGV); /* Coprocessor segment overrun. */ - case 10: return (SIGTRAP); /* Invalid TSS (also single-step). */ - case 11: return (SIGSEGV); /* Segment not present. */ - case 12: return (SIGSEGV); /* Stack exception. */ - case 13: return (SIGSEGV); /* General protection. */ - case 14: return (SIGSEGV); /* Page fault. */ - case 16: return (SIGEMT); /* Coprocessor error. */ + case T_BPTFLT: return (SIGTRAP); + case T_ARITHTRAP: return (SIGFPE); + case T_PROTFLT: return (SIGSEGV); + case T_TRCTRAP: return (SIGTRAP); + case T_PAGEFLT: return (SIGSEGV); + case T_DIVIDE: return (SIGFPE); + case T_NMI: return (SIGTRAP); + case T_FPOPFLT: return (SIGILL); + case T_TSSFLT: return (SIGSEGV); + case T_SEGNPFLT: return (SIGSEGV); + case T_STKFLT: return (SIGSEGV); + case T_XMMFLT: return (SIGFPE); } return (SIGEMT); } diff --git a/sys/i386/i386/gdb_machdep.c b/sys/i386/i386/gdb_machdep.c index d501b847fda9..fd522309dbb2 100644 --- a/sys/i386/i386/gdb_machdep.c +++ b/sys/i386/i386/gdb_machdep.c @@ -99,21 +99,18 @@ gdb_cpu_signal(int type, int code) { switch (type & ~T_USER) { - case 0: return (SIGFPE); /* Divide by zero. */ - case 1: return (SIGTRAP); /* Debug exception. */ - case 3: return (SIGTRAP); /* Breakpoint. */ - case 4: return (SIGURG); /* into instr. (overflow). */ - case 5: return (SIGURG); /* bound instruction. */ - case 6: return (SIGILL); /* Invalid opcode. */ - case 7: return (SIGFPE); /* Coprocessor not present. */ - case 8: return (SIGEMT); /* Double fault. */ - case 9: return (SIGSEGV); /* Coprocessor segment overrun. */ - case 10: return (SIGTRAP); /* Invalid TSS (also single-step). */ - case 11: return (SIGSEGV); /* Segment not present. */ - case 12: return (SIGSEGV); /* Stack exception. */ - case 13: return (SIGSEGV); /* General protection. */ - case 14: return (SIGSEGV); /* Page fault. */ - case 16: return (SIGEMT); /* Coprocessor error. */ + case T_BPTFLT: return (SIGTRAP); + case T_ARITHTRAP: return (SIGFPE); + case T_PROTFLT: return (SIGSEGV); + case T_TRCTRAP: return (SIGTRAP); + case T_PAGEFLT: return (SIGSEGV); + case T_DIVIDE: return (SIGFPE); + case T_NMI: return (SIGTRAP); + case T_FPOPFLT: return (SIGILL); + case T_TSSFLT: return (SIGSEGV); + case T_SEGNPFLT: return (SIGSEGV); + case T_STKFLT: return (SIGSEGV); + case T_XMMFLT: return (SIGFPE); } return (SIGEMT); } From owner-dev-commits-src-main@freebsd.org Wed Dec 23 20:30:10 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 031D94CA9FF; Wed, 23 Dec 2020 20:30:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D1Pw16bgKz4RxT; Wed, 23 Dec 2020 20:30:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9E5C4241FB; Wed, 23 Dec 2020 20:30:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BNKU99s047370; Wed, 23 Dec 2020 20:30:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BNKU9nF047368; Wed, 23 Dec 2020 20:30:09 GMT (envelope-from git) Date: Wed, 23 Dec 2020 20:30:09 GMT Message-Id: <202012232030.0BNKU9nF047368@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Oleksandr Tymoshenko Subject: git: e52326210786 - [if_dwc] add support for multi-descriptor packets in TX path MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gonzo X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e523262107865130e40fb19f7c3c571c8dd0b252 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2020 20:30:10 -0000 The branch main has been updated by gonzo: URL: https://cgit.FreeBSD.org/src/commit/?id=e523262107865130e40fb19f7c3c571c8dd0b252 commit e523262107865130e40fb19f7c3c571c8dd0b252 Author: Oleksandr Tymoshenko AuthorDate: 2020-12-23 19:43:46 +0000 Commit: Oleksandr Tymoshenko CommitDate: 2020-12-23 20:29:29 +0000 [if_dwc] add support for multi-descriptor packets in TX path Original if_dwc driver used m_defrag as an implementation shortcut but on 1000Mb networks it affects performance. Implement multi-descriptor support for TX path. Tested on RK3399-Firefly, patch adds ~15% of network throughput. Reviewed By: manu Differential Revision: https://reviews.freebsd.org/D27520 --- sys/dev/dwc/if_dwc.c | 146 +++++++++++++++++++++++++++++++++++------------- sys/dev/dwc/if_dwcvar.h | 13 ++++- 2 files changed, 116 insertions(+), 43 deletions(-) diff --git a/sys/dev/dwc/if_dwc.c b/sys/dev/dwc/if_dwc.c index ee871c268ea6..776d0d0dc392 100644 --- a/sys/dev/dwc/if_dwc.c +++ b/sys/dev/dwc/if_dwc.c @@ -627,7 +627,7 @@ dwc_get1paddr(void *arg, bus_dma_segment_t *segs, int nsegs, int error) inline static void dwc_setup_txdesc(struct dwc_softc *sc, int idx, bus_addr_t paddr, - uint32_t len, uint32_t flags) + uint32_t len, uint32_t flags, bool first, bool last) { uint32_t desc0, desc1; @@ -635,55 +635,72 @@ dwc_setup_txdesc(struct dwc_softc *sc, int idx, bus_addr_t paddr, if (paddr == 0 || len == 0) { desc0 = 0; desc1 = 0; - --sc->txcount; + --sc->tx_desccount; } else { if (sc->mactype != DWC_GMAC_EXT_DESC) { desc0 = 0; - desc1 = NTDESC1_TCH | NTDESC1_FS | NTDESC1_LS | - NTDESC1_IC | len | flags; + desc1 = NTDESC1_TCH | len | flags; + if (first) + desc1 |= NTDESC1_FS; + if (last) + desc1 |= NTDESC1_LS | NTDESC1_IC; } else { - desc0 = ETDESC0_TCH | ETDESC0_FS | ETDESC0_LS | - ETDESC0_IC | flags; + desc0 = ETDESC0_TCH | flags; + if (first) + desc0 |= ETDESC0_FS; + if (last) + desc0 |= ETDESC0_LS | ETDESC0_IC; desc1 = len; } - ++sc->txcount; + ++sc->tx_desccount; } sc->txdesc_ring[idx].addr1 = (uint32_t)(paddr); sc->txdesc_ring[idx].desc0 = desc0; sc->txdesc_ring[idx].desc1 = desc1; +} - if (paddr && len) { - wmb(); - sc->txdesc_ring[idx].desc0 |= TDESC0_OWN; - wmb(); - } +inline static void +dwc_set_owner(struct dwc_softc *sc, int idx) +{ + wmb(); + sc->txdesc_ring[idx].desc0 |= TDESC0_OWN; + wmb(); } static int dwc_setup_txbuf(struct dwc_softc *sc, int idx, struct mbuf **mp) { - struct bus_dma_segment seg; + struct bus_dma_segment segs[TX_MAP_MAX_SEGS]; int error, nsegs; struct mbuf * m; uint32_t flags = 0; + int i; + int first, last; - if ((m = m_defrag(*mp, M_NOWAIT)) == NULL) + error = bus_dmamap_load_mbuf_sg(sc->txbuf_tag, sc->txbuf_map[idx].map, + *mp, segs, &nsegs, 0); + if (error == EFBIG) { + /* + * The map may be partially mapped from the first call. + * Make sure to reset it. + */ + bus_dmamap_unload(sc->txbuf_tag, sc->txbuf_map[idx].map); + if ((m = m_defrag(*mp, M_NOWAIT)) == NULL) + return (ENOMEM); + *mp = m; + error = bus_dmamap_load_mbuf_sg(sc->txbuf_tag, sc->txbuf_map[idx].map, + *mp, segs, &nsegs, 0); + } + if (error != 0) return (ENOMEM); - *mp = m; - error = bus_dmamap_load_mbuf_sg(sc->txbuf_tag, sc->txbuf_map[idx].map, - m, &seg, &nsegs, 0); - if (error != 0) { + if (sc->tx_desccount + nsegs > TX_DESC_COUNT) { + bus_dmamap_unload(sc->txbuf_tag, sc->txbuf_map[idx].map); return (ENOMEM); } - KASSERT(nsegs == 1, ("%s: %d segments returned!", __func__, nsegs)); - - bus_dmamap_sync(sc->txbuf_tag, sc->txbuf_map[idx].map, - BUS_DMASYNC_PREWRITE); - - sc->txbuf_map[idx].mbuf = m; + m = *mp; if ((m->m_pkthdr.csum_flags & CSUM_IP) != 0) { if ((m->m_pkthdr.csum_flags & (CSUM_TCP|CSUM_UDP)) != 0) { @@ -699,7 +716,27 @@ dwc_setup_txbuf(struct dwc_softc *sc, int idx, struct mbuf **mp) } } - dwc_setup_txdesc(sc, idx, seg.ds_addr, seg.ds_len, flags); + bus_dmamap_sync(sc->txbuf_tag, sc->txbuf_map[idx].map, + BUS_DMASYNC_PREWRITE); + + sc->txbuf_map[idx].mbuf = m; + + first = sc->tx_desc_head; + for (i = 0; i < nsegs; i++) { + dwc_setup_txdesc(sc, sc->tx_desc_head, + segs[i].ds_addr, segs[i].ds_len, + (i == 0) ? flags : 0, /* only first desc needs flags */ + (i == 0), + (i == nsegs - 1)); + if (i > 0) + dwc_set_owner(sc, sc->tx_desc_head); + last = sc->tx_desc_head; + sc->tx_desc_head = next_txidx(sc, sc->tx_desc_head); + } + + sc->txbuf_map[idx].last_desc_idx = last; + + dwc_set_owner(sc, first); return (0); } @@ -900,7 +937,8 @@ setup_dma(struct dwc_softc *sc) BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ - MCLBYTES, 1, /* maxsize, nsegments */ + MCLBYTES*TX_MAP_MAX_SEGS, /* maxsize */ + TX_MAP_MAX_SEGS, /* nsegments */ MCLBYTES, /* maxsegsize */ 0, /* flags */ NULL, NULL, /* lockfunc, lockarg */ @@ -911,7 +949,7 @@ setup_dma(struct dwc_softc *sc) goto out; } - for (idx = 0; idx < TX_DESC_COUNT; idx++) { + for (idx = 0; idx < TX_MAP_COUNT; idx++) { error = bus_dmamap_create(sc->txbuf_tag, BUS_DMA_COHERENT, &sc->txbuf_map[idx].map); if (error != 0) { @@ -919,9 +957,11 @@ setup_dma(struct dwc_softc *sc) "could not create TX buffer DMA map.\n"); goto out; } - dwc_setup_txdesc(sc, idx, 0, 0, 0); } + for (idx = 0; idx < TX_DESC_COUNT; idx++) + dwc_setup_txdesc(sc, idx, 0, 0, 0, false, false); + /* * Set up RX descriptor ring, descriptors, dma maps, and mbufs. */ @@ -1029,7 +1069,12 @@ dwc_txstart_locked(struct dwc_softc *sc) enqueued = 0; for (;;) { - if (sc->txcount == (TX_DESC_COUNT - 1)) { + if (sc->tx_desccount > (TX_DESC_COUNT - TX_MAP_MAX_SEGS + 1)) { + if_setdrvflagbits(ifp, IFF_DRV_OACTIVE, 0); + break; + } + + if (sc->tx_mapcount == (TX_MAP_COUNT - 1)) { if_setdrvflagbits(ifp, IFF_DRV_OACTIVE, 0); break; } @@ -1037,12 +1082,14 @@ dwc_txstart_locked(struct dwc_softc *sc) m = if_dequeue(ifp); if (m == NULL) break; - if (dwc_setup_txbuf(sc, sc->tx_idx_head, &m) != 0) { + if (dwc_setup_txbuf(sc, sc->tx_map_head, &m) != 0) { if_sendq_prepend(ifp, m); + if_setdrvflagbits(ifp, IFF_DRV_OACTIVE, 0); break; } if_bpfmtap(ifp, m); - sc->tx_idx_head = next_txidx(sc, sc->tx_idx_head); + sc->tx_map_head = next_txidx(sc, sc->tx_map_head); + sc->tx_mapcount++; ++enqueued; } @@ -1193,28 +1240,46 @@ dwc_txfinish_locked(struct dwc_softc *sc) struct dwc_bufmap *bmap; struct dwc_hwdesc *desc; struct ifnet *ifp; + int idx, last_idx; + bool map_finished; DWC_ASSERT_LOCKED(sc); ifp = sc->ifp; - while (sc->tx_idx_tail != sc->tx_idx_head) { - desc = &sc->txdesc_ring[sc->tx_idx_tail]; - if ((desc->desc0 & TDESC0_OWN) != 0) + /* check if all descriptors of the map are done */ + while (sc->tx_map_tail != sc->tx_map_head) { + map_finished = true; + bmap = &sc->txbuf_map[sc->tx_map_tail]; + idx = sc->tx_desc_tail; + last_idx = next_txidx(sc, bmap->last_desc_idx); + while (idx != last_idx) { + desc = &sc->txdesc_ring[idx]; + if ((desc->desc0 & TDESC0_OWN) != 0) { + map_finished = false; + break; + } + idx = next_txidx(sc, idx); + } + + if (!map_finished) break; - bmap = &sc->txbuf_map[sc->tx_idx_tail]; bus_dmamap_sync(sc->txbuf_tag, bmap->map, BUS_DMASYNC_POSTWRITE); bus_dmamap_unload(sc->txbuf_tag, bmap->map); m_freem(bmap->mbuf); bmap->mbuf = NULL; - dwc_setup_txdesc(sc, sc->tx_idx_tail, 0, 0, 0); - sc->tx_idx_tail = next_txidx(sc, sc->tx_idx_tail); + sc->tx_mapcount--; + while (sc->tx_desc_tail != last_idx) { + dwc_setup_txdesc(sc, sc->tx_desc_tail, 0, 0, 0, false, false); + sc->tx_desc_tail = next_txidx(sc, sc->tx_desc_tail); + } + sc->tx_map_tail = next_txidx(sc, sc->tx_map_tail); if_setdrvflagbits(ifp, 0, IFF_DRV_OACTIVE); if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); } /* If there are no buffers outstanding, muzzle the watchdog. */ - if (sc->tx_idx_tail == sc->tx_idx_head) { + if (sc->tx_desc_tail == sc->tx_desc_head) { sc->tx_watchdog_count = 0; } } @@ -1503,7 +1568,8 @@ dwc_attach(device_t dev) sc = device_get_softc(dev); sc->dev = dev; sc->rx_idx = 0; - sc->txcount = TX_DESC_COUNT; + sc->tx_desccount = TX_DESC_COUNT; + sc->tx_mapcount = 0; sc->mii_clk = IF_DWC_MII_CLK(dev); sc->mactype = IF_DWC_MAC_TYPE(dev); @@ -1610,7 +1676,7 @@ dwc_attach(device_t dev) if_setstartfn(ifp, dwc_txstart); if_setioctlfn(ifp, dwc_ioctl); if_setinitfn(ifp, dwc_init); - if_setsendqlen(ifp, TX_DESC_COUNT - 1); + if_setsendqlen(ifp, TX_MAP_COUNT - 1); if_setsendqready(sc->ifp); if_sethwassist(sc->ifp, CSUM_IP | CSUM_UDP | CSUM_TCP); if_setcapabilities(sc->ifp, IFCAP_VLAN_MTU | IFCAP_HWCSUM); diff --git a/sys/dev/dwc/if_dwcvar.h b/sys/dev/dwc/if_dwcvar.h index 0470b29cb0e1..97ae0ea681c8 100644 --- a/sys/dev/dwc/if_dwcvar.h +++ b/sys/dev/dwc/if_dwcvar.h @@ -47,11 +47,15 @@ #define RX_DESC_COUNT 1024 #define RX_DESC_SIZE (sizeof(struct dwc_hwdesc) * RX_DESC_COUNT) #define TX_DESC_COUNT 1024 +#define TX_MAP_COUNT TX_DESC_COUNT #define TX_DESC_SIZE (sizeof(struct dwc_hwdesc) * TX_DESC_COUNT) +#define TX_MAP_MAX_SEGS 32 struct dwc_bufmap { bus_dmamap_t map; struct mbuf *mbuf; + /* Only used for TX descirptors */ + int last_desc_idx; }; struct dwc_softc { @@ -89,9 +93,12 @@ struct dwc_softc { bus_addr_t txdesc_ring_paddr; bus_dma_tag_t txbuf_tag; struct dwc_bufmap txbuf_map[TX_DESC_COUNT]; - uint32_t tx_idx_head; - uint32_t tx_idx_tail; - int txcount; + uint32_t tx_desc_head; + uint32_t tx_desc_tail; + uint32_t tx_map_head; + uint32_t tx_map_tail; + int tx_desccount; + int tx_mapcount; }; #endif /* __IF_DWCVAR_H__ */ From owner-dev-commits-src-main@freebsd.org Wed Dec 23 21:20:22 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A5E014CBDD7 for ; Wed, 23 Dec 2020 21:20:22 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D1R1y4CDgz4VtL for ; Wed, 23 Dec 2020 21:20:22 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wm1-f41.google.com with SMTP id c124so72985wma.5 for ; Wed, 23 Dec 2020 13:20:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=4giUqsl6OlXDLr6OFFUKnLm1Qxl5+5VfcAs0P567NpA=; b=U5IPyUUW5tzy0eTEgDsAt5KBT0eDyK7TP+JyvrhEV0ZlN61U6IE0YfHPCskLhOzBlM IMZzqorOoB8iP1x1kUO9I5LMy58X49/CHPAy/n2XNgmh4yu/qWPN/5+HRuKG7JahhNaN YBKcg8KUmimKATgOtI8sRWwpRXD9YxHBEjm72lXM8kMNApPtBM62LZT47/SlrvUoP2Bc esFYJ7eVeiMAWDvNiZ+XAnh0fIMrqUBk/rkhNKettaMwPdNsSc2TUqCu/amY98s3UC4z bfd+tyakeh+sWdrDHTe3iucqrQl91kWN1IJbz68ReJSLfDDgFShGIUkVxt/UkMv68B4V EdHg== X-Gm-Message-State: AOAM531UnOURJL7lTWO3cYTjtpjFD6dYYFQ6Z4/38t7bcqskGHnjvqrF IesSUWwdRLobMzKTwHJeNG+sCw== X-Google-Smtp-Source: ABdhPJzcK2zBtiv21pW3PBgi583VCkjCAjLtMZPxlYE1aMhM4+hxhnFObXW9puTfBS96amI3f3l0JA== X-Received: by 2002:a1c:5406:: with SMTP id i6mr1394203wmb.137.1608758421123; Wed, 23 Dec 2020 13:20:21 -0800 (PST) Received: from [192.168.149.251] (trinity-students-nat.trin.cam.ac.uk. [131.111.193.104]) by smtp.gmail.com with ESMTPSA id i18sm37589505wrp.74.2020.12.23.13.20.20 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Dec 2020 13:20:20 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Subject: Re: git: c4df8cbfde53 - Remove bvmconsole and bvmdebug. From: Jessica Clarke In-Reply-To: <202012231826.0BNIQwkM005361@gitrepo.freebsd.org> Date: Wed, 23 Dec 2020 21:20:17 +0000 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <4E9D53F7-1CFA-471F-BB50-20AF85BB3F5E@freebsd.org> References: <202012231826.0BNIQwkM005361@gitrepo.freebsd.org> To: Robert Wing X-Mailer: Apple Mail (2.3608.120.23.2.4) X-Rspamd-Queue-Id: 4D1R1y4CDgz4VtL X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2020 21:20:22 -0000 On 23 Dec 2020, at 18:26, Robert Wing wrote: >=20 > The branch main has been updated by rew: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3Dc4df8cbfde53c376d93f439eac3f45a7= b4fc705e >=20 > commit c4df8cbfde53c376d93f439eac3f45a7b4fc705e > Author: Robert Wing > AuthorDate: 2020-12-24 01:15:33 +0000 > Commit: Robert Wing > CommitDate: 2020-12-24 02:15:23 +0000 Hi Robert, You might wish to correct your system time :) Jess From owner-dev-commits-src-main@freebsd.org Wed Dec 23 21:24:48 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CB8364CBFD0; Wed, 23 Dec 2020 21:24:48 +0000 (UTC) (envelope-from oliver.pntr@gmail.com) Received: from mail-oi1-x22c.google.com (mail-oi1-x22c.google.com [IPv6:2607:f8b0:4864:20::22c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D1R7458cxz4WDm; Wed, 23 Dec 2020 21:24:48 +0000 (UTC) (envelope-from oliver.pntr@gmail.com) Received: by mail-oi1-x22c.google.com with SMTP id s75so527201oih.1; Wed, 23 Dec 2020 13:24:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=n7Q2+h57QoDs4sBqPYJOkjHmWVDwkvrI6IVIS9w7S6o=; b=H2DYvR4GbEMI9RkobCwqsJDA42z++T7iitWt+67vDin0iC/Nua6spTv/U7rjUQ75Op uIUu8txz0yJcXuhjguHQiOIlE+1WNsiULTx7tsgYMrfLqEwFJg5amnRGE1b9Hf080fZd oXtggc01xCGbns7PAegauhY1jvXpmYmSbKImG910RScIMidYKCxfonBt1WS+aGI6Fhrm +IAxTbMH73mucPa4RsextsJzeAFvxyXkbqkI7gZtAgFQv65n/g9hd5TGUapSFvmTIfp+ tX0xPbIm1aUfO73QbPVHNRW1ZkZrg/KrxbP0Ebn3tiiw7OAIhsSHRSivfxgxpNFXKZkY objg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=n7Q2+h57QoDs4sBqPYJOkjHmWVDwkvrI6IVIS9w7S6o=; b=gIT5WFkEkkRDmIVKIJXeKRaq8o8K/4s8fGL4PVxHJGb6YqgwJdEsWjRRLiskvFhZo5 TWha8VWgc1bXweLQERuZ1eOESd743Co9CE5lk0K47dWOqJcUPozsJvGD2S+Yp82Ioxjg fArNUmYjD4ugxcUjIfmupvG7OOr2JNiPtiJNSdudIAPf2q7skEO1MPa8UaUAYqDy62u4 H56yrM6jzIlxX81rNaugDXq1LY34uSU1FxfqzKqGYMVQ+BoFkreDBhbq56pLZWjIbWq1 UEbNWrr8SUYUkE5nkR6y1e/4WGgQC9WiFe5VzAZOL3kxELnt6JrlSr9v4WeBWak8a2mE DcWQ== X-Gm-Message-State: AOAM530wg05enhIhAR5yAIuW4WxZ9FazjLN19eQmtYLhw/75JLjjjJ62 08K/6RvraZQzen60MIJQ5KO03B4jjcSg6DoLC9965U4m X-Google-Smtp-Source: ABdhPJwGLEI32gkJKtALoupIcwb6yauikx6AYaDt+pAXDVOEC54M34CqToEejqaYuz5bJoJhTVImHCD1uo175czDf34= X-Received: by 2002:aca:474b:: with SMTP id u72mr1178333oia.114.1608758686984; Wed, 23 Dec 2020 13:24:46 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a4a:a187:0:0:0:0:0 with HTTP; Wed, 23 Dec 2020 13:24:46 -0800 (PST) In-Reply-To: <202012231642.0BNGgGq2089053@gitrepo.freebsd.org> References: <202012231642.0BNGgGq2089053@gitrepo.freebsd.org> From: Oliver Pinter Date: Wed, 23 Dec 2020 22:24:46 +0100 Message-ID: Subject: Re: git: 878d53410f75 - UPDATING: Announce git transition To: Warner Losh Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" X-Rspamd-Queue-Id: 4D1R7458cxz4WDm X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2020 21:24:48 -0000 Hi! On Wednesday, December 23, 2020, Warner Losh wrote: > The branch main has been updated by imp: > > URL: https://cgit.FreeBSD.org/src/commit/?id= > 878d53410f75dbd9401def736562c906f8fecc33 > > commit 878d53410f75dbd9401def736562c906f8fecc33 > Author: Warner Losh > AuthorDate: 2020-12-23 16:40:45 +0000 > Commit: Warner Losh > CommitDate: 2020-12-23 16:40:45 +0000 > > UPDATING: Announce git transition > > Add an entry for the transition to git. > --- > UPDATING | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/UPDATING b/UPDATING > index bfa428538b6b..d10e21604558 100644 > --- a/UPDATING > +++ b/UPDATING > @@ -26,6 +26,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW: > world, or to merely disable the most expensive debugging > functionality > at runtime, run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) > > +20201223: > + The FreeBSD project has migrated from Subversion to Git. Temporary > + instructions can be found at > + https://github.com/bsdimp/freebsd-git-docs/blob/main/src-cvt.md > + and other documents in that repo. Wouldn't be better to migrate this repo to FreeBSD's namespace? > + > 20201216: > The services database has been updated to cover more of the basic > services expected in a modern system. The database is big enough > _______________________________________________ > dev-commits-src-all@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all > To unsubscribe, send any mail to "dev-commits-src-all- > unsubscribe@freebsd.org" > From owner-dev-commits-src-main@freebsd.org Wed Dec 23 21:43:33 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 343404CC84C; Wed, 23 Dec 2020 21:43:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D1RXj0mtbz4XQG; Wed, 23 Dec 2020 21:43:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0D3D82547A; Wed, 23 Dec 2020 21:43:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BNLhWOh037014; Wed, 23 Dec 2020 21:43:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BNLhWTG037012; Wed, 23 Dec 2020 21:43:32 GMT (envelope-from git) Date: Wed, 23 Dec 2020 21:43:32 GMT Message-Id: <202012232143.0BNLhWTG037012@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: 665b1365fe8e - Add a new "tlscertname" NFS mount option. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 665b1365fe8e24d618d63b0d57b0b4ad39e97824 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2020 21:43:33 -0000 The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=665b1365fe8e24d618d63b0d57b0b4ad39e97824 commit 665b1365fe8e24d618d63b0d57b0b4ad39e97824 Author: Rick Macklem AuthorDate: 2020-12-21 23:14:53 +0000 Commit: Rick Macklem CommitDate: 2020-12-23 21:42:55 +0000 Add a new "tlscertname" NFS mount option. When using NFS-over-TLS, an NFS client can optionally provide an X.509 certificate to the server during the TLS handshake. For some situations, such as different NFS servers or different certificates being mapped to different user credentials on the NFS server, there may be a need for different mounts to provide different certificates. This new mount option called "tlscertname" may be used to specify a non-default certificate be provided. This alernate certificate will be stored in /etc/rpc.tlsclntd in a file with a name based on what is provided by this mount option. --- sys/fs/nfs/nfs_commonkrpc.c | 6 +++++- sys/fs/nfsclient/nfs_clvfsops.c | 34 ++++++++++++++++++++++++++++------ sys/fs/nfsclient/nfsmount.h | 1 + sys/rpc/clnt.h | 1 + sys/rpc/clnt_rc.c | 20 +++++++++++++++++++- sys/rpc/krpc.h | 1 + sys/rpc/rpcsec_tls.h | 4 ++-- sys/rpc/rpcsec_tls/rpctls_impl.c | 12 +++++++++--- sys/rpc/rpcsec_tls/rpctlscd.x | 6 +++++- 9 files changed, 71 insertions(+), 14 deletions(-) diff --git a/sys/fs/nfs/nfs_commonkrpc.c b/sys/fs/nfs/nfs_commonkrpc.c index 19896a59718d..daf8082fa1c3 100644 --- a/sys/fs/nfs/nfs_commonkrpc.c +++ b/sys/fs/nfs/nfs_commonkrpc.c @@ -281,8 +281,12 @@ newnfs_connect(struct nfsmount *nmp, struct nfssockreq *nrp, CLNT_CONTROL(client, CLSET_INTERRUPTIBLE, &one); if ((nmp->nm_flag & NFSMNT_RESVPORT)) CLNT_CONTROL(client, CLSET_PRIVPORT, &one); - if (NFSHASTLS(nmp)) + if (NFSHASTLS(nmp)) { CLNT_CONTROL(client, CLSET_TLS, &one); + if (nmp->nm_tlscertname != NULL) + CLNT_CONTROL(client, CLSET_TLSCERTNAME, + nmp->nm_tlscertname); + } if (NFSHASSOFT(nmp)) { if (nmp->nm_sotype == SOCK_DGRAM) /* diff --git a/sys/fs/nfsclient/nfs_clvfsops.c b/sys/fs/nfsclient/nfs_clvfsops.c index 8b059ef1be9f..365b1c387cc2 100644 --- a/sys/fs/nfsclient/nfs_clvfsops.c +++ b/sys/fs/nfsclient/nfs_clvfsops.c @@ -119,7 +119,7 @@ static void nfs_decode_args(struct mount *mp, struct nfsmount *nmp, static int mountnfs(struct nfs_args *, struct mount *, struct sockaddr *, char *, u_char *, int, u_char *, int, u_char *, int, struct vnode **, struct ucred *, - struct thread *, int, int, int, uint32_t); + struct thread *, int, int, int, uint32_t, char *); static void nfs_getnlminfo(struct vnode *, uint8_t *, size_t *, struct sockaddr_storage *, int *, off_t *, struct timeval *); @@ -545,7 +545,7 @@ nfs_mountdiskless(char *path, nam = sodupsockaddr((struct sockaddr *)sin, M_WAITOK); if ((error = mountnfs(args, mp, nam, path, NULL, 0, dirpath, dirlen, NULL, 0, vpp, td->td_ucred, td, NFS_DEFAULT_NAMETIMEO, - NFS_DEFAULT_NEGNAMETIMEO, 0, 0)) != 0) { + NFS_DEFAULT_NEGNAMETIMEO, 0, 0, NULL)) != 0) { printf("nfs_mountroot: mount %s on /: %d\n", path, error); return (error); } @@ -747,7 +747,7 @@ static const char *nfs_opts[] = { "from", "nfs_args", "resvport", "readahead", "hostname", "timeo", "timeout", "addr", "fh", "nfsv3", "sec", "principal", "nfsv4", "gssname", "allgssname", "dirpath", "minorversion", "nametimeo", "negnametimeo", "nocto", "noncontigwr", - "pnfs", "wcommitsize", "oneopenown", "tls", + "pnfs", "wcommitsize", "oneopenown", "tls", "tlscertname", NULL }; /* @@ -891,7 +891,7 @@ nfs_mount(struct mount *mp) struct thread *td; char *hst; u_char nfh[NFSX_FHMAX], krbname[100], dirpath[100], srvkrbname[100]; - char *cp, *opt, *name, *secname; + char *cp, *opt, *name, *secname, *tlscertname; int nametimeo = NFS_DEFAULT_NAMETIMEO; int negnametimeo = NFS_DEFAULT_NEGNAMETIMEO; int minvers = 0; @@ -903,6 +903,7 @@ nfs_mount(struct mount *mp) has_nfs_args_opt = 0; has_nfs_from_opt = 0; newflag = 0; + tlscertname = NULL; hst = malloc(MNAMELEN, M_TEMP, M_WAITOK); if (vfs_filteropt(mp->mnt_optnew, nfs_opts)) { error = EINVAL; @@ -988,6 +989,22 @@ nfs_mount(struct mount *mp) args.flags |= NFSMNT_ONEOPENOWN; if (vfs_getopt(mp->mnt_optnew, "tls", NULL, NULL) == 0) newflag |= NFSMNT_TLS; + if (vfs_getopt(mp->mnt_optnew, "tlscertname", (void **)&opt, &len) == + 0) { + /* + * tlscertname with "key.pem" appended to it forms a file + * name. As such, the maximum allowable strlen(tlscertname) is + * NAME_MAX - 7. However, "len" includes the nul termination + * byte so it can be up to NAME_MAX - 6. + */ + if (opt == NULL || len <= 1 || len > NAME_MAX - 6) { + vfs_mount_error(mp, "invalid tlscertname"); + error = EINVAL; + goto out; + } + tlscertname = malloc(len, M_NEWNFSMNT, M_WAITOK); + strlcpy(tlscertname, opt, len); + } if (vfs_getopt(mp->mnt_optnew, "readdirsize", (void **)&opt, NULL) == 0) { if (opt == NULL) { vfs_mount_error(mp, "illegal readdirsize"); @@ -1342,7 +1359,7 @@ nfs_mount(struct mount *mp) args.fh = nfh; error = mountnfs(&args, mp, nam, hst, krbname, krbnamelen, dirpath, dirlen, srvkrbname, srvkrbnamelen, &vp, td->td_ucred, td, - nametimeo, negnametimeo, minvers, newflag); + nametimeo, negnametimeo, minvers, newflag, tlscertname); out: if (!error) { MNT_ILOCK(mp); @@ -1390,7 +1407,7 @@ mountnfs(struct nfs_args *argp, struct mount *mp, struct sockaddr *nam, char *hst, u_char *krbname, int krbnamelen, u_char *dirpath, int dirlen, u_char *srvkrbname, int srvkrbnamelen, struct vnode **vpp, struct ucred *cred, struct thread *td, int nametimeo, int negnametimeo, - int minvers, uint32_t newflag) + int minvers, uint32_t newflag, char *tlscertname) { struct nfsmount *nmp; struct nfsnode *np; @@ -1410,6 +1427,7 @@ mountnfs(struct nfs_args *argp, struct mount *mp, struct sockaddr *nam, nmp = VFSTONFS(mp); printf("%s: MNT_UPDATE is no longer handled here\n", __func__); free(nam, M_SONAME); + free(tlscertname, M_NEWNFSMNT); return (0); } else { /* NFS-over-TLS requires that rpctls be functioning. */ @@ -1423,12 +1441,14 @@ mountnfs(struct nfs_args *argp, struct mount *mp, struct sockaddr *nam, #endif if (error != 0) { free(nam, M_SONAME); + free(tlscertname, M_NEWNFSMNT); return (error); } } nmp = malloc(sizeof (struct nfsmount) + krbnamelen + dirlen + srvkrbnamelen + 2, M_NEWNFSMNT, M_WAITOK | M_ZERO); + nmp->nm_tlscertname = tlscertname; nmp->nm_newflag = newflag; TAILQ_INIT(&nmp->nm_bufq); TAILQ_INIT(&nmp->nm_sess); @@ -1681,6 +1701,7 @@ bad: newnfs_disconnect(dsp->nfsclds_sockp); nfscl_freenfsclds(dsp); } + free(nmp->nm_tlscertname, M_NEWNFSMNT); free(nmp, M_NEWNFSMNT); free(nam, M_SONAME); return (error); @@ -1776,6 +1797,7 @@ nfs_unmount(struct mount *mp, int mntflags) newnfs_disconnect(dsp->nfsclds_sockp); nfscl_freenfsclds(dsp); } + free(nmp->nm_tlscertname, M_NEWNFSMNT); free(nmp, M_NEWNFSMNT); out: return (error); diff --git a/sys/fs/nfsclient/nfsmount.h b/sys/fs/nfsclient/nfsmount.h index 063926eceaf5..57adcd8f2fca 100644 --- a/sys/fs/nfsclient/nfsmount.h +++ b/sys/fs/nfsclient/nfsmount.h @@ -76,6 +76,7 @@ struct nfsmount { /* Newnfs additions */ TAILQ_HEAD(, nfsclds) nm_sess; /* Session(s) for NFSv4.1. */ struct nfsclclient *nm_clp; + char *nm_tlscertname; /* TLS certificate file name */ uid_t nm_uid; /* Uid for SetClientID etc. */ u_int64_t nm_clval; /* identifies which clientid */ u_int64_t nm_fsid[2]; /* NFSv4 fsid */ diff --git a/sys/rpc/clnt.h b/sys/rpc/clnt.h index 23c92103edff..f4cc78b1c3b6 100644 --- a/sys/rpc/clnt.h +++ b/sys/rpc/clnt.h @@ -359,6 +359,7 @@ enum clnt_stat clnt_call_private(CLIENT *, struct rpc_callextra *, rpcproc_t, #define CLSET_BACKCHANNEL 29 /* set backchannel for socket */ #define CLSET_TLS 30 /* set TLS for socket */ #define CLSET_BLOCKRCV 31 /* Temporarily block reception */ +#define CLSET_TLSCERTNAME 32 /* TLS certificate file name */ #endif diff --git a/sys/rpc/clnt_rc.c b/sys/rpc/clnt_rc.c index 730001723e94..8c204989d0ea 100644 --- a/sys/rpc/clnt_rc.c +++ b/sys/rpc/clnt_rc.c @@ -110,6 +110,7 @@ clnt_reconnect_create( rc->rc_ucred = crdup(curthread->td_ucred); rc->rc_client = NULL; rc->rc_tls = false; + rc->rc_tlscertname = NULL; cl->cl_refs = 1; cl->cl_ops = &clnt_reconnect_ops; @@ -198,7 +199,8 @@ clnt_reconnect_connect(CLIENT *cl) (struct sockaddr *) &rc->rc_addr, rc->rc_prog, rc->rc_vers, rc->rc_sendsz, rc->rc_recvsz, rc->rc_intr); if (rc->rc_tls && newclient != NULL) { - stat = rpctls_connect(newclient, so, ssl, &reterr); + stat = rpctls_connect(newclient, rc->rc_tlscertname, so, + ssl, &reterr); if (stat != RPC_SUCCESS || reterr != RPCTLSERR_OK) { if (stat == RPC_SUCCESS) stat = RPC_FAILED; @@ -405,6 +407,7 @@ clnt_reconnect_control(CLIENT *cl, u_int request, void *info) { struct rc_data *rc = (struct rc_data *)cl->cl_private; SVCXPRT *xprt; + size_t slen; if (info == NULL) { return (FALSE); @@ -496,6 +499,20 @@ clnt_reconnect_control(CLIENT *cl, u_int request, void *info) rc->rc_tls = true; break; + case CLSET_TLSCERTNAME: + slen = strlen(info) + 1; + /* + * tlscertname with "key.pem" appended to it forms a file + * name. As such, the maximum allowable strlen(info) is + * NAME_MAX - 7. However, "slen" includes the nul termination + * byte so it can be up to NAME_MAX - 6. + */ + if (slen <= 1 || slen > NAME_MAX - 6) + return (FALSE); + rc->rc_tlscertname = mem_alloc(slen); + strlcpy(rc->rc_tlscertname, info, slen); + break; + default: return (FALSE); } @@ -543,6 +560,7 @@ clnt_reconnect_destroy(CLIENT *cl) } crfree(rc->rc_ucred); mtx_destroy(&rc->rc_lock); + mem_free(rc->rc_tlscertname, 0); /* 0 ok, since arg. ignored. */ mem_free(rc, sizeof(*rc)); mem_free(cl, sizeof (CLIENT)); } diff --git a/sys/rpc/krpc.h b/sys/rpc/krpc.h index 53d46deddf65..77facdcf16cc 100644 --- a/sys/rpc/krpc.h +++ b/sys/rpc/krpc.h @@ -80,6 +80,7 @@ struct rc_data { struct rpc_err rc_err; void *rc_backchannel; bool rc_tls; /* Enable TLS on connection */ + char *rc_tlscertname; }; /* Bits for ct_rcvstate. */ diff --git a/sys/rpc/rpcsec_tls.h b/sys/rpc/rpcsec_tls.h index a33feff17c06..49a7e71b7514 100644 --- a/sys/rpc/rpcsec_tls.h +++ b/sys/rpc/rpcsec_tls.h @@ -58,8 +58,8 @@ int rpctls_syscall(int, const char *); #ifdef _KERNEL /* Functions that perform upcalls to the rpctlsd daemon. */ -enum clnt_stat rpctls_connect(CLIENT *newclient, struct socket *so, - uint64_t *sslp, uint32_t *reterr); +enum clnt_stat rpctls_connect(CLIENT *newclient, char *certname, + struct socket *so, uint64_t *sslp, uint32_t *reterr); enum clnt_stat rpctls_cl_handlerecord(uint64_t sec, uint64_t usec, uint64_t ssl, uint32_t *reterr); enum clnt_stat rpctls_srv_handlerecord(uint64_t sec, uint64_t usec, diff --git a/sys/rpc/rpcsec_tls/rpctls_impl.c b/sys/rpc/rpcsec_tls/rpctls_impl.c index c5f3ce5d46a6..638f27eaf350 100644 --- a/sys/rpc/rpcsec_tls/rpctls_impl.c +++ b/sys/rpc/rpcsec_tls/rpctls_impl.c @@ -356,9 +356,10 @@ rpctls_server_client(void) /* Do an upcall for a new socket connect using TLS. */ enum clnt_stat -rpctls_connect(CLIENT *newclient, struct socket *so, uint64_t *sslp, - uint32_t *reterr) +rpctls_connect(CLIENT *newclient, char *certname, struct socket *so, + uint64_t *sslp, uint32_t *reterr) { + struct rpctlscd_connect_arg arg; struct rpctlscd_connect_res res; struct rpc_callextra ext; struct timeval utimeout; @@ -399,7 +400,12 @@ rpctls_connect(CLIENT *newclient, struct socket *so, uint64_t *sslp, CLNT_CONTROL(newclient, CLSET_BLOCKRCV, &val); /* Do the connect handshake upcall. */ - stat = rpctlscd_connect_1(NULL, &res, cl); + if (certname != NULL) { + arg.certname.certname_len = strlen(certname); + arg.certname.certname_val = certname; + } else + arg.certname.certname_len = 0; + stat = rpctlscd_connect_1(&arg, &res, cl); if (stat == RPC_SUCCESS) { *reterr = res.reterr; if (res.reterr == 0) { diff --git a/sys/rpc/rpcsec_tls/rpctlscd.x b/sys/rpc/rpcsec_tls/rpctlscd.x index d5c4d61a43a8..1ae53d7b8d17 100644 --- a/sys/rpc/rpcsec_tls/rpctlscd.x +++ b/sys/rpc/rpcsec_tls/rpctlscd.x @@ -29,6 +29,10 @@ /* $FreeBSD$ */ +struct rpctlscd_connect_arg { + char certname<>; +}; + struct rpctlscd_connect_res { uint32_t reterr; uint64_t sec; @@ -61,7 +65,7 @@ program RPCTLSCD { void RPCTLSCD_NULL(void) = 0; rpctlscd_connect_res - RPCTLSCD_CONNECT(void) = 1; + RPCTLSCD_CONNECT(rpctlscd_connect_arg) = 1; rpctlscd_handlerecord_res RPCTLSCD_HANDLERECORD(rpctlscd_handlerecord_arg) = 2; From owner-dev-commits-src-main@freebsd.org Wed Dec 23 22:29:37 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D90584CCF77; Wed, 23 Dec 2020 22:29:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D1SYs5p5Dz4ZGL; Wed, 23 Dec 2020 22:29:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B982725B92; Wed, 23 Dec 2020 22:29:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BNMTb0f083075; Wed, 23 Dec 2020 22:29:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BNMTbAW083074; Wed, 23 Dec 2020 22:29:37 GMT (envelope-from git) Date: Wed, 23 Dec 2020 22:29:37 GMT Message-Id: <202012232229.0BNMTbAW083074@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: 501022d3a066 - wmt(4): Add support for hardware timestamp reporting MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 501022d3a066f74a1575a714fce2f0dc42e19588 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2020 22:29:37 -0000 The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=501022d3a066f74a1575a714fce2f0dc42e19588 commit 501022d3a066f74a1575a714fce2f0dc42e19588 Author: Vladimir Kondratyev AuthorDate: 2020-12-23 22:18:18 +0000 Commit: Vladimir Kondratyev CommitDate: 2020-12-23 22:24:53 +0000 wmt(4): Add support for hardware timestamp reporting Hardware timestamp reporting is disabled by default as it produces many extra events which are not handled by consumers like libinput. Add hw.usb.wmt.timestamps=1 tunable to loader.conf to enable it. Obtained from: sysutils/iichid --- sys/dev/usb/input/wmt.c | 45 ++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 42 insertions(+), 3 deletions(-) diff --git a/sys/dev/usb/input/wmt.c b/sys/dev/usb/input/wmt.c index 745d0af9b20e..1377d8d1af40 100644 --- a/sys/dev/usb/input/wmt.c +++ b/sys/dev/usb/input/wmt.c @@ -59,14 +59,16 @@ __FBSDID("$FreeBSD$"); #define USB_DEBUG_VAR wmt_debug #include -#ifdef USB_DEBUG -static int wmt_debug = 0; - static SYSCTL_NODE(_hw_usb, OID_AUTO, wmt, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "USB MSWindows 7/8/10 compatible Multi-touch Device"); +#ifdef USB_DEBUG +static int wmt_debug = 0; SYSCTL_INT(_hw_usb_wmt, OID_AUTO, debug, CTLFLAG_RWTUN, &wmt_debug, 1, "Debug level"); #endif +static bool wmt_timestamps = 0; +SYSCTL_BOOL(_hw_usb_wmt, OID_AUTO, timestamps, CTLFLAG_RDTUN, + &wmt_timestamps, 1, "Enable hardware timestamp reporting"); #define WMT_BSIZE 1024 /* bytes, buffer size */ #define WMT_BTN_MAX 8 /* Number of buttons supported */ @@ -209,6 +211,12 @@ struct wmt_softc { struct hid_location cont_count_loc; struct hid_location btn_loc[WMT_BTN_MAX]; struct hid_location int_btn_loc; + struct hid_location scan_time_loc; + int32_t scan_time_max; + int32_t scan_time; + int32_t timestamp; + bool touch; + bool prev_touch; struct usb_xfer *xfer[WMT_N_TRANSFER]; struct evdev_dev *evdev; @@ -224,6 +232,7 @@ struct wmt_softc { uint32_t max_button; bool has_int_button; bool is_clickpad; + bool do_timestamps; struct hid_location cont_max_loc; uint32_t cont_max_rlen; @@ -382,6 +391,9 @@ wmt_attach(device_t dev) DPRINTF("Failed to set input mode: %d\n", err); } + if (/*usb_test_quirk(hw, UQ_MT_TIMESTAMP) ||*/ wmt_timestamps) + sc->do_timestamps = true; + mtx_init(&sc->mtx, "wmt lock", NULL, MTX_DEF); err = usbd_transfer_setup(uaa->device, &uaa->info.bIfaceIndex, @@ -413,6 +425,10 @@ wmt_attach(device_t dev) } evdev_support_event(sc->evdev, EV_SYN); evdev_support_event(sc->evdev, EV_ABS); + if (sc->do_timestamps) { + evdev_support_event(sc->evdev, EV_MSC); + evdev_support_msc(sc->evdev, MSC_TIMESTAMP); + } if (sc->max_button != 0 || sc->has_int_button) { evdev_support_event(sc->evdev, EV_KEY); if (sc->has_int_button) @@ -478,6 +494,8 @@ wmt_process_report(struct wmt_softc *sc, uint8_t *buf, int len) uint32_t int_btn = 0; uint32_t left_btn = 0; int32_t slot; + uint32_t scan_time; + int32_t delta; /* * "In Parallel mode, devices report all contact information in a @@ -553,6 +571,7 @@ wmt_process_report(struct wmt_softc *sc, uint8_t *buf, int len) !(USAGE_SUPPORTED(sc->caps, WMT_CONFIDENCE) && slot_data[WMT_CONFIDENCE] == 0)) { /* This finger is in proximity of the sensor */ + sc->touch = true; slot_data[WMT_SLOT] = slot; slot_data[WMT_IN_RANGE] = !slot_data[WMT_IN_RANGE]; /* Divided by two to match visual scale of touch */ @@ -574,6 +593,24 @@ wmt_process_report(struct wmt_softc *sc, uint8_t *buf, int len) } sc->nconts_todo -= cont_count; + if (sc->do_timestamps && sc->nconts_todo == 0) { + /* HUD_SCAN_TIME is measured in 100us, convert to us. */ + scan_time = + hid_get_data_unsigned(buf, len, &sc->scan_time_loc); + if (sc->prev_touch) { + delta = scan_time - sc->scan_time; + if (delta < 0) + delta += sc->scan_time_max; + } else + delta = 0; + sc->scan_time = scan_time; + sc->timestamp += delta * 100; + evdev_push_msc(sc->evdev, MSC_TIMESTAMP, sc->timestamp); + sc->prev_touch = sc->touch; + sc->touch = false; + if (!sc->prev_touch) + sc->timestamp = 0; + } if (sc->nconts_todo == 0) { /* Report both the click and external left btns as BTN_LEFT */ if (sc->has_int_button) @@ -869,6 +906,8 @@ wmt_hid_parse(struct wmt_softc *sc, const void *d_ptr, uint16_t d_len) if (hi.collevel == 1 && hi.usage == HID_USAGE2(HUP_DIGITIZERS, HUD_SCAN_TIME)) { scan_time_found = true; + sc->scan_time_loc = hi.loc; + sc->scan_time_max = hi.logical_maximum; break; } From owner-dev-commits-src-main@freebsd.org Wed Dec 23 22:29:37 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E86F14CD357; Wed, 23 Dec 2020 22:29:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D1SYs6D40z4ZR7; Wed, 23 Dec 2020 22:29:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C258325B93; Wed, 23 Dec 2020 22:29:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BNMTbo4083092; Wed, 23 Dec 2020 22:29:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BNMTbk3083091; Wed, 23 Dec 2020 22:29:37 GMT (envelope-from git) Date: Wed, 23 Dec 2020 22:29:37 GMT Message-Id: <202012232229.0BNMTbk3083091@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: 8de78df54d90 - wmt(4): Add support for touchpads MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8de78df54d907d4b5aa4b962c2c89259938aeda5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2020 22:29:38 -0000 The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=8de78df54d907d4b5aa4b962c2c89259938aeda5 commit 8de78df54d907d4b5aa4b962c2c89259938aeda5 Author: Vladimir Kondratyev AuthorDate: 2020-12-23 22:18:18 +0000 Commit: Vladimir Kondratyev CommitDate: 2020-12-23 22:22:56 +0000 wmt(4): Add support for touchpads Obtained from: sysutils/iichid --- share/man/man4/wmt.4 | 4 - sys/dev/usb/input/wmt.c | 199 ++++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 184 insertions(+), 19 deletions(-) diff --git a/share/man/man4/wmt.4 b/share/man/man4/wmt.4 index f778a07a5983..ddea0a6b45d3 100644 --- a/share/man/man4/wmt.4 +++ b/share/man/man4/wmt.4 @@ -73,10 +73,6 @@ driver was written by .An Vladimir Kondratyev Aq Mt wulf@FreeBSD.org . .Sh BUGS .Nm -works only with touchscreens now. -Neither pens nor touchpads are supported. -.Pp -.Nm cannot act like .Xr sysmouse 4 , as diff --git a/sys/dev/usb/input/wmt.c b/sys/dev/usb/input/wmt.c index b3fbd8c82a13..745d0af9b20e 100644 --- a/sys/dev/usb/input/wmt.c +++ b/sys/dev/usb/input/wmt.c @@ -69,12 +69,26 @@ SYSCTL_INT(_hw_usb_wmt, OID_AUTO, debug, CTLFLAG_RWTUN, #endif #define WMT_BSIZE 1024 /* bytes, buffer size */ +#define WMT_BTN_MAX 8 /* Number of buttons supported */ enum { WMT_INTR_DT, WMT_N_TRANSFER, }; +enum wmt_type { + WMT_TYPE_UNKNOWN = 0, /* HID report descriptor is not probed */ + WMT_TYPE_UNSUPPORTED, /* Repdescr does not belong to MT device */ + WMT_TYPE_TOUCHPAD, + WMT_TYPE_TOUCHSCREEN, +}; + +enum wmt_input_mode { + WMT_INPUT_MODE_MOUSE = 0x0, + WMT_INPUT_MODE_MT_TOUCHSCREEN = 0x2, + WMT_INPUT_MODE_MT_TOUCHPAD = 0x3, +}; + enum { WMT_TIP_SWITCH, #define WMT_SLOT WMT_TIP_SWITCH @@ -187,29 +201,41 @@ struct wmt_absinfo { struct wmt_softc { device_t dev; - bool supported; + enum wmt_type type; struct mtx mtx; struct wmt_absinfo ai[WMT_N_USAGES]; struct hid_location locs[MAX_MT_SLOTS][WMT_N_USAGES]; struct hid_location cont_count_loc; + struct hid_location btn_loc[WMT_BTN_MAX]; + struct hid_location int_btn_loc; struct usb_xfer *xfer[WMT_N_TRANSFER]; struct evdev_dev *evdev; uint32_t slot_data[WMT_N_USAGES]; uint32_t caps; + uint32_t buttons; uint32_t isize; uint32_t nconts_per_report; uint32_t nconts_todo; uint32_t report_len; uint8_t report_id; + uint32_t max_button; + bool has_int_button; + bool is_clickpad; struct hid_location cont_max_loc; uint32_t cont_max_rlen; uint8_t cont_max_rid; + struct hid_location btn_type_loc; + uint32_t btn_type_rlen; + uint8_t btn_type_rid; uint32_t thqa_cert_rlen; uint8_t thqa_cert_rid; + struct hid_location input_mode_loc; + uint32_t input_mode_rlen; + uint8_t input_mode_rid; uint8_t buf[WMT_BSIZE] __aligned(4); }; @@ -219,8 +245,9 @@ struct wmt_softc { for ((usage) = 0; (usage) < WMT_N_USAGES; ++(usage)) \ if (USAGE_SUPPORTED((caps), (usage))) -static bool wmt_hid_parse(struct wmt_softc *, const void *, uint16_t); +static enum wmt_type wmt_hid_parse(struct wmt_softc *, const void *, uint16_t); static void wmt_cont_max_parse(struct wmt_softc *, const void *, uint16_t); +static int wmt_set_input_mode(struct wmt_softc *, enum wmt_input_mode); static usb_callback_t wmt_intr_callback; @@ -281,15 +308,16 @@ wmt_probe(device_t dev) return (ENXIO); /* Check if report descriptor belongs to a HID multitouch device */ - if (!sc->supported) - sc->supported = wmt_hid_parse(sc, d_ptr, d_len); - if (sc->supported) + if (sc->type == WMT_TYPE_UNKNOWN) + sc->type = wmt_hid_parse(sc, d_ptr, d_len); + if (sc->type != WMT_TYPE_UNSUPPORTED) err = BUS_PROBE_DEFAULT; else err = ENXIO; /* Check HID report length */ - if (sc->supported && (sc->isize <= 0 || sc->isize > WMT_BSIZE)) { + if (sc->type != WMT_TYPE_UNSUPPORTED && + (sc->isize <= 0 || sc->isize > WMT_BSIZE)) { DPRINTF("Input size invalid or too large: %d\n", sc->isize); err = ENXIO; } @@ -303,6 +331,7 @@ wmt_attach(device_t dev) { struct usb_attach_arg *uaa = device_get_ivars(dev); struct wmt_softc *sc = device_get_softc(dev); + int nbuttons, btn; size_t i; int err; @@ -323,6 +352,22 @@ wmt_attach(device_t dev) DPRINTF("Feature report %hhu size invalid or too large: %u\n", sc->cont_max_rid, sc->cont_max_rlen); + /* Fetch and parse "Button type" feature report */ + if (sc->btn_type_rlen > 1 && sc->btn_type_rlen <= WMT_BSIZE && + sc->btn_type_rid != sc->cont_max_rid) { + bzero(sc->buf, sc->btn_type_rlen); + err = usbd_req_get_report(uaa->device, NULL, sc->buf, + sc->btn_type_rlen, uaa->info.bIfaceIndex, + UHID_FEATURE_REPORT, sc->btn_type_rid); + } + if (sc->btn_type_rlen > 1) { + if (err == 0) + sc->is_clickpad = hid_get_data_unsigned(sc->buf + 1, + sc->btn_type_rlen - 1, &sc->btn_type_loc) == 0; + else + DPRINTF("usbd_req_get_report error=%d\n", err); + } + /* Fetch THQA certificate to enable some devices like WaveShare */ if (sc->thqa_cert_rlen > 0 && sc->thqa_cert_rlen <= WMT_BSIZE && sc->thqa_cert_rid != sc->cont_max_rid) @@ -330,6 +375,13 @@ wmt_attach(device_t dev) sc->thqa_cert_rlen, uaa->info.bIfaceIndex, UHID_FEATURE_REPORT, sc->thqa_cert_rid); + /* Switch touchpad in to absolute multitouch mode */ + if (sc->type == WMT_TYPE_TOUCHPAD) { + err = wmt_set_input_mode(sc, WMT_INPUT_MODE_MT_TOUCHPAD); + if (err != 0) + DPRINTF("Failed to set input mode: %d\n", err); + } + mtx_init(&sc->mtx, "wmt lock", NULL, MTX_DEF); err = usbd_transfer_setup(uaa->device, &uaa->info.bIfaceIndex, @@ -347,9 +399,28 @@ wmt_attach(device_t dev) evdev_set_serial(sc->evdev, usb_get_serial(uaa->device)); evdev_set_methods(sc->evdev, sc, &wmt_evdev_methods); evdev_set_flag(sc->evdev, EVDEV_FLAG_MT_STCOMPAT); - evdev_support_prop(sc->evdev, INPUT_PROP_DIRECT); + switch (sc->type) { + case WMT_TYPE_TOUCHSCREEN: + evdev_support_prop(sc->evdev, INPUT_PROP_DIRECT); + break; + case WMT_TYPE_TOUCHPAD: + evdev_support_prop(sc->evdev, INPUT_PROP_POINTER); + if (sc->is_clickpad) + evdev_support_prop(sc->evdev, INPUT_PROP_BUTTONPAD); + break; + default: + KASSERT(0, ("wmt_attach: unsupported touch device type")); + } evdev_support_event(sc->evdev, EV_SYN); evdev_support_event(sc->evdev, EV_ABS); + if (sc->max_button != 0 || sc->has_int_button) { + evdev_support_event(sc->evdev, EV_KEY); + if (sc->has_int_button) + evdev_support_key(sc->evdev, BTN_LEFT); + for (btn = 0; btn < sc->max_button; ++btn) + if (USAGE_SUPPORTED(sc->buttons, btn)) + evdev_support_key(sc->evdev, BTN_MOUSE + btn); + } WMT_FOREACH_USAGE(sc->caps, i) { if (wmt_hid_map[i].code != WMT_NO_CODE) evdev_support_abs(sc->evdev, wmt_hid_map[i].code, 0, @@ -361,6 +432,11 @@ wmt_attach(device_t dev) goto detach; /* Announce information about the touch device */ + nbuttons = bitcount32(sc->buttons); + device_printf(sc->dev, "Multitouch %s with %d external button%s%s\n", + sc->type == WMT_TYPE_TOUCHSCREEN ? "touchscreen" : "touchpad", + nbuttons, nbuttons != 1 ? "s" : "", + sc->is_clickpad ? ", click-pad" : ""); device_printf(sc->dev, "%d contacts and [%s%s%s%s%s]. Report range [%d:%d] - [%d:%d]\n", (int)sc->ai[WMT_SLOT].max + 1, @@ -395,10 +471,12 @@ wmt_process_report(struct wmt_softc *sc, uint8_t *buf, int len) { size_t usage; uint32_t *slot_data = sc->slot_data; - uint32_t cont; + uint32_t cont, btn; uint32_t cont_count; uint32_t width; uint32_t height; + uint32_t int_btn = 0; + uint32_t left_btn = 0; int32_t slot; /* @@ -496,8 +574,25 @@ wmt_process_report(struct wmt_softc *sc, uint8_t *buf, int len) } sc->nconts_todo -= cont_count; - if (sc->nconts_todo == 0) + if (sc->nconts_todo == 0) { + /* Report both the click and external left btns as BTN_LEFT */ + if (sc->has_int_button) + int_btn = hid_get_data(buf, len, &sc->int_btn_loc); + if (sc->max_button != 0 && (sc->buttons & 1 << 0) != 0) + left_btn = hid_get_data(buf, len, &sc->btn_loc[0]); + if (sc->has_int_button || + (sc->max_button != 0 && (sc->buttons & 1 << 0) != 0)) + evdev_push_key(sc->evdev, BTN_LEFT, + int_btn != 0 | left_btn != 0); + for (btn = 1; btn < sc->max_button; ++btn) { + if ((sc->buttons & 1 << btn) != 0) + evdev_push_key(sc->evdev, BTN_MOUSE + btn, + hid_get_data(buf, + len, + &sc->btn_loc[btn]) != 0); + } evdev_sync(sc->evdev); + } } static void @@ -640,19 +735,22 @@ wmt_hid_report_size(const void *buf, uint16_t len, enum hid_kind k, uint8_t id) return ((temp + 7) / 8 + report_id); } -static bool +static enum wmt_type wmt_hid_parse(struct wmt_softc *sc, const void *d_ptr, uint16_t d_len) { struct hid_item hi; struct hid_data *hd; size_t i; size_t cont = 0; + enum wmt_type type = WMT_TYPE_UNSUPPORTED; + uint32_t left_btn, btn; int32_t cont_count_max = 0; uint8_t report_id = 0; bool touch_coll = false; bool finger_coll = false; bool cont_count_found = false; bool scan_time_found = false; + bool has_int_button = false; #define WMT_HI_ABSOLUTE(hi) \ (((hi).flags & (HIO_CONST|HIO_VARIABLE|HIO_RELATIVE)) == HIO_VARIABLE) @@ -664,8 +762,18 @@ wmt_hid_parse(struct wmt_softc *sc, const void *d_ptr, uint16_t d_len) switch (hi.kind) { case hid_collection: if (hi.collevel == 1 && hi.usage == - HID_USAGE2(HUP_DIGITIZERS, HUD_TOUCHSCREEN)) + HID_USAGE2(HUP_DIGITIZERS, HUD_TOUCHSCREEN)) { + touch_coll = true; + type = WMT_TYPE_TOUCHSCREEN; + left_btn = 1; + break; + } + if (hi.collevel == 1 && hi.usage == + HID_USAGE2(HUP_DIGITIZERS, HUD_TOUCHPAD)) { touch_coll = true; + type = WMT_TYPE_TOUCHPAD; + left_btn = 2; + } break; case hid_endcollection: if (hi.collevel == 0 && touch_coll) @@ -682,6 +790,12 @@ wmt_hid_parse(struct wmt_softc *sc, const void *d_ptr, uint16_t d_len) cont_count_max = hi.logical_maximum; sc->cont_max_rid = hi.report_ID; sc->cont_max_loc = hi.loc; + break; + } + if (hi.collevel == 1 && touch_coll && hi.usage == + HID_USAGE2(HUP_DIGITIZERS, HUD_BUTTON_TYPE)) { + sc->btn_type_rid = hi.report_ID; + sc->btn_type_loc = hi.loc; } break; default: @@ -690,9 +804,11 @@ wmt_hid_parse(struct wmt_softc *sc, const void *d_ptr, uint16_t d_len) } hid_end_parse(hd); + if (type == WMT_TYPE_UNSUPPORTED) + return (WMT_TYPE_UNSUPPORTED); /* Maximum contact count is required usage */ if (sc->cont_max_rid == 0) - return (false); + return (WMT_TYPE_UNSUPPORTED); touch_coll = false; @@ -727,6 +843,22 @@ wmt_hid_parse(struct wmt_softc *sc, const void *d_ptr, uint16_t d_len) else break; + if (hi.collevel == 1 && left_btn == 2 && + hi.usage == HID_USAGE2(HUP_BUTTON, 1)) { + has_int_button = true; + sc->int_btn_loc = hi.loc; + break; + } + if (hi.collevel == 1 && + hi.usage >= HID_USAGE2(HUP_BUTTON, left_btn) && + hi.usage <= HID_USAGE2(HUP_BUTTON, WMT_BTN_MAX)) { + btn = (hi.usage & 0xFFFF) - left_btn; + sc->buttons |= 1 << btn; + sc->btn_loc[btn] = hi.loc; + if (btn >= sc->max_button) + sc->max_button = btn + 1; + break; + } if (hi.collevel == 1 && hi.usage == HID_USAGE2(HUP_DIGITIZERS, HUD_CONTACTCOUNT)) { cont_count_found = true; @@ -783,12 +915,16 @@ wmt_hid_parse(struct wmt_softc *sc, const void *d_ptr, uint16_t d_len) /* Check for required HID Usages */ if (!cont_count_found || !scan_time_found || cont == 0) - return (false); + return (WMT_TYPE_UNSUPPORTED); for (i = 0; i < WMT_N_USAGES; i++) { if (wmt_hid_map[i].required && !USAGE_SUPPORTED(sc->caps, i)) - return (false); + return (WMT_TYPE_UNSUPPORTED); } + /* Touchpads must have at least one button */ + if (type == WMT_TYPE_TOUCHPAD && !sc->max_button && !has_int_button) + return (WMT_TYPE_UNSUPPORTED); + /* * According to specifications 'Contact Count Maximum' should be read * from Feature Report rather than from HID descriptor. Set sane @@ -820,14 +956,18 @@ wmt_hid_parse(struct wmt_softc *sc, const void *d_ptr, uint16_t d_len) report_id); sc->cont_max_rlen = wmt_hid_report_size(d_ptr, d_len, hid_feature, sc->cont_max_rid); + if (sc->btn_type_rid > 0) + sc->btn_type_rlen = wmt_hid_report_size(d_ptr, d_len, + hid_feature, sc->btn_type_rid); if (sc->thqa_cert_rid > 0) sc->thqa_cert_rlen = wmt_hid_report_size(d_ptr, d_len, hid_feature, sc->thqa_cert_rid); sc->report_id = report_id; sc->nconts_per_report = cont; + sc->has_int_button = has_int_button; - return (true); + return (type); } static void @@ -851,6 +991,35 @@ wmt_cont_max_parse(struct wmt_softc *sc, const void *r_ptr, uint16_t r_len) } } +static int +wmt_set_input_mode(struct wmt_softc *sc, enum wmt_input_mode mode) +{ + struct usb_attach_arg *uaa = device_get_ivars(sc->dev); + int err; + + if (sc->input_mode_rlen < 3 || sc->input_mode_rlen > WMT_BSIZE) { + DPRINTF("Feature report %hhu size invalid or too large: %u\n", + sc->input_mode_rid, sc->input_mode_rlen); + return (USB_ERR_BAD_BUFSIZE); + } + + /* Input Mode report is not strictly required to be readable */ + err = usbd_req_get_report(uaa->device, NULL, sc->buf, + sc->input_mode_rlen, uaa->info.bIfaceIndex, + UHID_FEATURE_REPORT, sc->input_mode_rid); + if (err != USB_ERR_NORMAL_COMPLETION) + bzero(sc->buf + 1, sc->input_mode_rlen - 1); + + sc->buf[0] = sc->input_mode_rid; + hid_put_data_unsigned(sc->buf + 1, sc->input_mode_rlen - 1, + &sc->input_mode_loc, mode); + err = usbd_req_set_report(uaa->device, NULL, sc->buf, + sc->input_mode_rlen, uaa->info.bIfaceIndex, + UHID_FEATURE_REPORT, sc->input_mode_rid); + + return (err); +} + static const STRUCT_USB_HOST_ID wmt_devs[] = { /* generic HID class w/o boot interface */ {USB_IFACE_CLASS(UICLASS_HID), From owner-dev-commits-src-main@freebsd.org Wed Dec 23 22:29:38 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1F16D4CD696; Wed, 23 Dec 2020 22:29:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D1SYt0JVtz4ZZG; Wed, 23 Dec 2020 22:29:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F061325939; Wed, 23 Dec 2020 22:29:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BNMTbV5083126; Wed, 23 Dec 2020 22:29:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BNMTbln083125; Wed, 23 Dec 2020 22:29:37 GMT (envelope-from git) Date: Wed, 23 Dec 2020 22:29:37 GMT Message-Id: <202012232229.0BNMTbln083125@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: 0ba4b5ff4c21 - wmt(4): Add support for hybrid mode MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0ba4b5ff4c21645c3b331b4073f6440147dc95c2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2020 22:29:38 -0000 The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=0ba4b5ff4c21645c3b331b4073f6440147dc95c2 commit 0ba4b5ff4c21645c3b331b4073f6440147dc95c2 Author: Vladimir Kondratyev AuthorDate: 2020-12-23 22:18:18 +0000 Commit: Vladimir Kondratyev CommitDate: 2020-12-23 22:19:41 +0000 wmt(4): Add support for hybrid mode In Hybrid mode, the number of contacts that can be reported in one report is less than the maximum number of contacts that the device supports. For example, a device that supports a maximum of 4 concurrent physical contacts, can set up its top-level collection to deliver a maximum of two contacts in one report. If four contact points are present, the device can break these up into two serial reports that deliver two contacts each. Obtained from: sysutils/iichid --- sys/dev/usb/input/wmt.c | 53 +++++++++++++++++++++++++++++++++++++------------ 1 file changed, 40 insertions(+), 13 deletions(-) diff --git a/sys/dev/usb/input/wmt.c b/sys/dev/usb/input/wmt.c index 14733dc48209..3d4663693f5f 100644 --- a/sys/dev/usb/input/wmt.c +++ b/sys/dev/usb/input/wmt.c @@ -191,7 +191,7 @@ struct wmt_softc struct mtx mtx; struct wmt_absinfo ai[WMT_N_USAGES]; struct hid_location locs[MAX_MT_SLOTS][WMT_N_USAGES]; - struct hid_location nconts_loc; + struct hid_location cont_count_loc; struct usb_xfer *xfer[WMT_N_TRANSFER]; struct evdev_dev *evdev; @@ -199,7 +199,8 @@ struct wmt_softc uint32_t slot_data[WMT_N_USAGES]; uint32_t caps; uint32_t isize; - uint32_t nconts_max; + uint32_t nconts_per_report; + uint32_t nconts_todo; uint32_t report_len; uint8_t report_id; @@ -396,15 +397,40 @@ wmt_process_report(struct wmt_softc *sc, uint8_t *buf, int len) size_t usage; uint32_t *slot_data = sc->slot_data; uint32_t cont; - uint32_t nconts; + uint32_t cont_count; uint32_t width; uint32_t height; int32_t slot; - nconts = hid_get_data_unsigned(buf, len, &sc->nconts_loc); + /* + * "In Parallel mode, devices report all contact information in a + * single packet. Each physical contact is represented by a logical + * collection that is embedded in the top-level collection." + * + * Since additional contacts that were not present will still be in the + * report with contactid=0 but contactids are zero-based, find + * contactcount first. + */ + cont_count = hid_get_data_unsigned(buf, len, &sc->cont_count_loc); + /* + * "In Hybrid mode, the number of contacts that can be reported in one + * report is less than the maximum number of contacts that the device + * supports. For example, a device that supports a maximum of + * 4 concurrent physical contacts, can set up its top-level collection + * to deliver a maximum of two contacts in one report. If four contact + * points are present, the device can break these up into two serial + * reports that deliver two contacts each. + * + * "When a device delivers data in this manner, the Contact Count usage + * value in the first report should reflect the total number of + * contacts that are being delivered in the hybrid reports. The other + * serial reports should have a contact count of zero (0)." + */ + if (cont_count != 0) + sc->nconts_todo = cont_count; #ifdef USB_DEBUG - DPRINTFN(6, "nconts = %u ", (unsigned)nconts); + DPRINTFN(6, "cont_count:%2u", (unsigned)cont_count); if (wmt_debug >= 6) { WMT_FOREACH_USAGE(sc->caps, usage) { if (wmt_hid_map[usage].usage != WMT_NO_USAGE) @@ -414,13 +440,11 @@ wmt_process_report(struct wmt_softc *sc, uint8_t *buf, int len) } #endif - if (nconts > sc->nconts_max) { - DPRINTF("Contact count overflow %u\n", (unsigned)nconts); - nconts = sc->nconts_max; - } + /* Find the number of contacts reported in current report */ + cont_count = MIN(sc->nconts_todo, sc->nconts_per_report); /* Use protocol Type B for reporting events */ - for (cont = 0; cont < nconts; cont++) { + for (cont = 0; cont < cont_count; cont++) { bzero(slot_data, sizeof(sc->slot_data)); WMT_FOREACH_USAGE(sc->caps, usage) { if (sc->locs[cont][usage].size > 0) @@ -471,7 +495,10 @@ wmt_process_report(struct wmt_softc *sc, uint8_t *buf, int len) evdev_push_abs(sc->evdev, ABS_MT_TRACKING_ID, -1); } } - evdev_sync(sc->evdev); + + sc->nconts_todo -= cont_count; + if (sc->nconts_todo == 0) + evdev_sync(sc->evdev); } static void @@ -709,7 +736,7 @@ wmt_hid_parse(struct wmt_softc *sc, const void *d_ptr, uint16_t d_len) HID_USAGE2(HUP_DIGITIZERS, HUD_CONTACTCOUNT)) { cont_count_found = true; if (sc != NULL) - sc->nconts_loc = hi.loc; + sc->cont_count_loc = hi.loc; break; } /* Scan time is required but clobbered by evdev */ @@ -817,7 +844,7 @@ wmt_hid_parse(struct wmt_softc *sc, const void *d_ptr, uint16_t d_len) sc->report_id = report_id; sc->caps = caps; - sc->nconts_max = cont; + sc->nconts_per_report = cont; sc->cont_max_rid = cont_max_rid; sc->thqa_cert_rid = thqa_cert_rid; From owner-dev-commits-src-main@freebsd.org Wed Dec 23 22:29:38 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0156E4CD5A5; Wed, 23 Dec 2020 22:29:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D1SYs6c6Tz4ZGM; Wed, 23 Dec 2020 22:29:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D508525678; Wed, 23 Dec 2020 22:29:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BNMTbaJ083109; Wed, 23 Dec 2020 22:29:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BNMTbFZ083108; Wed, 23 Dec 2020 22:29:37 GMT (envelope-from git) Date: Wed, 23 Dec 2020 22:29:37 GMT Message-Id: <202012232229.0BNMTbFZ083108@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: 7eae6aab7d79 - wmt(4): Fetch and parse HID report descriptor only one time MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7eae6aab7d79eea0f30cd1a0be145404867c0a2f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2020 22:29:38 -0000 The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=7eae6aab7d79eea0f30cd1a0be145404867c0a2f commit 7eae6aab7d79eea0f30cd1a0be145404867c0a2f Author: Vladimir Kondratyev AuthorDate: 2020-12-23 22:18:18 +0000 Commit: Vladimir Kondratyev CommitDate: 2020-12-23 22:21:53 +0000 wmt(4): Fetch and parse HID report descriptor only one time Do it at probe stage and reuse results during attach. Obtained from: sysutils/iichid --- sys/dev/usb/input/wmt.c | 110 +++++++++++++++++------------------------------- 1 file changed, 39 insertions(+), 71 deletions(-) diff --git a/sys/dev/usb/input/wmt.c b/sys/dev/usb/input/wmt.c index 3d4663693f5f..b3fbd8c82a13 100644 --- a/sys/dev/usb/input/wmt.c +++ b/sys/dev/usb/input/wmt.c @@ -185,9 +185,10 @@ struct wmt_absinfo { int32_t res; }; -struct wmt_softc -{ +struct wmt_softc { device_t dev; + bool supported; + struct mtx mtx; struct wmt_absinfo ai[WMT_N_USAGES]; struct hid_location locs[MAX_MT_SLOTS][WMT_N_USAGES]; @@ -260,6 +261,7 @@ static int wmt_probe(device_t dev) { struct usb_attach_arg *uaa = device_get_ivars(dev); + struct wmt_softc *sc = device_get_softc(dev); void *d_ptr; uint16_t d_len; int err; @@ -278,11 +280,20 @@ wmt_probe(device_t dev) if (err) return (ENXIO); - if (wmt_hid_parse(NULL, d_ptr, d_len)) + /* Check if report descriptor belongs to a HID multitouch device */ + if (!sc->supported) + sc->supported = wmt_hid_parse(sc, d_ptr, d_len); + if (sc->supported) err = BUS_PROBE_DEFAULT; else err = ENXIO; + /* Check HID report length */ + if (sc->supported && (sc->isize <= 0 || sc->isize > WMT_BSIZE)) { + DPRINTF("Input size invalid or too large: %d\n", sc->isize); + err = ENXIO; + } + free(d_ptr, M_TEMP); return (err); } @@ -292,36 +303,12 @@ wmt_attach(device_t dev) { struct usb_attach_arg *uaa = device_get_ivars(dev); struct wmt_softc *sc = device_get_softc(dev); - void *d_ptr; - uint16_t d_len; size_t i; int err; - bool hid_ok; device_set_usb_desc(dev); sc->dev = dev; - /* Get HID descriptor */ - err = usbd_req_get_hid_desc(uaa->device, NULL, - &d_ptr, &d_len, M_TEMP, uaa->info.bIfaceIndex); - if (err) { - DPRINTF("usbd_req_get_hid_desc error=%s\n", usbd_errstr(err)); - return (ENXIO); - } - - hid_ok = wmt_hid_parse(sc, d_ptr, d_len); - free(d_ptr, M_TEMP); - if (!hid_ok) { - DPRINTF("multi-touch HID descriptor not found\n"); - return (ENXIO); - } - - /* Check HID report length */ - if (sc->isize <= 0 || sc->isize > WMT_BSIZE) { - DPRINTF("Input size invalid or too large: %d\n", sc->isize); - return (ENXIO); - } - /* Fetch and parse "Contact count maximum" feature report */ if (sc->cont_max_rlen > 0 && sc->cont_max_rlen <= WMT_BSIZE) { err = usbd_req_get_report(uaa->device, NULL, sc->buf, @@ -373,6 +360,18 @@ wmt_attach(device_t dev) if (err) goto detach; + /* Announce information about the touch device */ + device_printf(sc->dev, + "%d contacts and [%s%s%s%s%s]. Report range [%d:%d] - [%d:%d]\n", + (int)sc->ai[WMT_SLOT].max + 1, + USAGE_SUPPORTED(sc->caps, WMT_IN_RANGE) ? "R" : "", + USAGE_SUPPORTED(sc->caps, WMT_CONFIDENCE) ? "C" : "", + USAGE_SUPPORTED(sc->caps, WMT_WIDTH) ? "W" : "", + USAGE_SUPPORTED(sc->caps, WMT_HEIGHT) ? "H" : "", + USAGE_SUPPORTED(sc->caps, WMT_PRESSURE) ? "P" : "", + (int)sc->ai[WMT_X].min, (int)sc->ai[WMT_Y].min, + (int)sc->ai[WMT_X].max, (int)sc->ai[WMT_Y].max); + return (0); detach: @@ -648,11 +647,8 @@ wmt_hid_parse(struct wmt_softc *sc, const void *d_ptr, uint16_t d_len) struct hid_data *hd; size_t i; size_t cont = 0; - uint32_t caps = 0; int32_t cont_count_max = 0; uint8_t report_id = 0; - uint8_t cont_max_rid = 0; - uint8_t thqa_cert_rid = 0; bool touch_coll = false; bool finger_coll = false; bool cont_count_found = false; @@ -678,15 +674,14 @@ wmt_hid_parse(struct wmt_softc *sc, const void *d_ptr, uint16_t d_len) case hid_feature: if (hi.collevel == 1 && touch_coll && hi.usage == HID_USAGE2(HUP_MICROSOFT, HUMS_THQA_CERT)) { - thqa_cert_rid = hi.report_ID; + sc->thqa_cert_rid = hi.report_ID; break; } if (hi.collevel == 1 && touch_coll && hi.usage == HID_USAGE2(HUP_DIGITIZERS, HUD_CONTACT_MAX)) { cont_count_max = hi.logical_maximum; - cont_max_rid = hi.report_ID; - if (sc != NULL) - sc->cont_max_loc = hi.loc; + sc->cont_max_rid = hi.report_ID; + sc->cont_max_loc = hi.loc; } break; default: @@ -696,7 +691,7 @@ wmt_hid_parse(struct wmt_softc *sc, const void *d_ptr, uint16_t d_len) hid_end_parse(hd); /* Maximum contact count is required usage */ - if (cont_max_rid == 0) + if (sc->cont_max_rid == 0) return (false); touch_coll = false; @@ -735,8 +730,7 @@ wmt_hid_parse(struct wmt_softc *sc, const void *d_ptr, uint16_t d_len) if (hi.collevel == 1 && hi.usage == HID_USAGE2(HUP_DIGITIZERS, HUD_CONTACTCOUNT)) { cont_count_found = true; - if (sc != NULL) - sc->cont_count_loc = hi.loc; + sc->cont_count_loc = hi.loc; break; } /* Scan time is required but clobbered by evdev */ @@ -748,8 +742,6 @@ wmt_hid_parse(struct wmt_softc *sc, const void *d_ptr, uint16_t d_len) if (!finger_coll || hi.collevel != 2) break; - if (sc == NULL && cont > 0) - break; if (cont >= MAX_MT_SLOTS) { DPRINTF("Finger %zu ignored\n", cont); break; @@ -757,12 +749,6 @@ wmt_hid_parse(struct wmt_softc *sc, const void *d_ptr, uint16_t d_len) for (i = 0; i < WMT_N_USAGES; i++) { if (hi.usage == wmt_hid_map[i].usage) { - if (sc == NULL) { - if (USAGE_SUPPORTED(caps, i)) - continue; - caps |= 1 << i; - break; - } /* * HUG_X usage is an array mapped to * both ABS_MT_POSITION and ABS_MT_TOOL @@ -779,7 +765,7 @@ wmt_hid_parse(struct wmt_softc *sc, const void *d_ptr, uint16_t d_len) */ if (cont > 0) break; - caps |= 1 << i; + sc->caps |= 1 << i; sc->ai[i] = (struct wmt_absinfo) { .max = hi.logical_maximum, .min = hi.logical_minimum, @@ -799,14 +785,10 @@ wmt_hid_parse(struct wmt_softc *sc, const void *d_ptr, uint16_t d_len) if (!cont_count_found || !scan_time_found || cont == 0) return (false); for (i = 0; i < WMT_N_USAGES; i++) { - if (wmt_hid_map[i].required && !USAGE_SUPPORTED(caps, i)) + if (wmt_hid_map[i].required && !USAGE_SUPPORTED(sc->caps, i)) return (false); } - /* Stop probing here */ - if (sc == NULL) - return (true); - /* * According to specifications 'Contact Count Maximum' should be read * from Feature Report rather than from HID descriptor. Set sane @@ -827,9 +809,9 @@ wmt_hid_parse(struct wmt_softc *sc, const void *d_ptr, uint16_t d_len) }; /* Report touch orientation if both width and height are supported */ - if (USAGE_SUPPORTED(caps, WMT_WIDTH) && - USAGE_SUPPORTED(caps, WMT_HEIGHT)) { - caps |= (1 << WMT_ORIENTATION); + if (USAGE_SUPPORTED(sc->caps, WMT_WIDTH) && + USAGE_SUPPORTED(sc->caps, WMT_HEIGHT)) { + sc->caps |= 1 << WMT_ORIENTATION; sc->ai[WMT_ORIENTATION].max = 1; } @@ -837,28 +819,14 @@ wmt_hid_parse(struct wmt_softc *sc, const void *d_ptr, uint16_t d_len) sc->report_len = wmt_hid_report_size(d_ptr, d_len, hid_input, report_id); sc->cont_max_rlen = wmt_hid_report_size(d_ptr, d_len, hid_feature, - cont_max_rid); - if (thqa_cert_rid > 0) + sc->cont_max_rid); + if (sc->thqa_cert_rid > 0) sc->thqa_cert_rlen = wmt_hid_report_size(d_ptr, d_len, - hid_feature, thqa_cert_rid); + hid_feature, sc->thqa_cert_rid); sc->report_id = report_id; - sc->caps = caps; sc->nconts_per_report = cont; - sc->cont_max_rid = cont_max_rid; - sc->thqa_cert_rid = thqa_cert_rid; - /* Announce information about the touch device */ - device_printf(sc->dev, - "%d contacts and [%s%s%s%s%s]. Report range [%d:%d] - [%d:%d]\n", - (int)cont_count_max, - USAGE_SUPPORTED(sc->caps, WMT_IN_RANGE) ? "R" : "", - USAGE_SUPPORTED(sc->caps, WMT_CONFIDENCE) ? "C" : "", - USAGE_SUPPORTED(sc->caps, WMT_WIDTH) ? "W" : "", - USAGE_SUPPORTED(sc->caps, WMT_HEIGHT) ? "H" : "", - USAGE_SUPPORTED(sc->caps, WMT_PRESSURE) ? "P" : "", - (int)sc->ai[WMT_X].min, (int)sc->ai[WMT_Y].min, - (int)sc->ai[WMT_X].max, (int)sc->ai[WMT_Y].max); return (true); } From owner-dev-commits-src-main@freebsd.org Wed Dec 23 22:29:37 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AE9A04CD70E; Wed, 23 Dec 2020 22:29:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D1SYs4TCxz4ZR6; Wed, 23 Dec 2020 22:29:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8CFC4259D8; Wed, 23 Dec 2020 22:29:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BNMTb5k083041; Wed, 23 Dec 2020 22:29:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BNMTbVU083040; Wed, 23 Dec 2020 22:29:37 GMT (envelope-from git) Date: Wed, 23 Dec 2020 22:29:37 GMT Message-Id: <202012232229.0BNMTbVU083040@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: c26a34842760 - wmt(4): Use sys/param.h macroses to work with bit fields MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c26a34842760f522d3b4ba02668fc1cb1c0024d0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2020 22:29:37 -0000 The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=c26a34842760f522d3b4ba02668fc1cb1c0024d0 commit c26a34842760f522d3b4ba02668fc1cb1c0024d0 Author: Vladimir Kondratyev AuthorDate: 2020-12-23 22:18:18 +0000 Commit: Vladimir Kondratyev CommitDate: 2020-12-23 22:27:17 +0000 wmt(4): Use sys/param.h macroses to work with bit fields Obtained from: sysutils/iichid --- sys/dev/usb/input/wmt.c | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/sys/dev/usb/input/wmt.c b/sys/dev/usb/input/wmt.c index 927d019ea099..788341df288c 100644 --- a/sys/dev/usb/input/wmt.c +++ b/sys/dev/usb/input/wmt.c @@ -222,8 +222,8 @@ struct wmt_softc { struct evdev_dev *evdev; uint32_t slot_data[WMT_N_USAGES]; - uint32_t caps; - uint32_t buttons; + uint8_t caps[howmany(WMT_N_USAGES, 8)]; + uint8_t buttons[howmany(WMT_BTN_MAX, 8)]; uint32_t isize; uint32_t nconts_per_report; uint32_t nconts_todo; @@ -249,10 +249,9 @@ struct wmt_softc { uint8_t buf[WMT_BSIZE] __aligned(4); }; -#define USAGE_SUPPORTED(caps, usage) ((caps) & (1 << (usage))) #define WMT_FOREACH_USAGE(caps, usage) \ for ((usage) = 0; (usage) < WMT_N_USAGES; ++(usage)) \ - if (USAGE_SUPPORTED((caps), (usage))) + if (isset((caps), (usage))) static enum wmt_type wmt_hid_parse(struct wmt_softc *, const void *, uint16_t); static int wmt_set_input_mode(struct wmt_softc *, enum wmt_input_mode); @@ -443,13 +442,17 @@ wmt_attach(device_t dev) evdev_support_event(sc->evdev, EV_MSC); evdev_support_msc(sc->evdev, MSC_TIMESTAMP); } + nbuttons = 0; if (sc->max_button != 0 || sc->has_int_button) { evdev_support_event(sc->evdev, EV_KEY); if (sc->has_int_button) evdev_support_key(sc->evdev, BTN_LEFT); - for (btn = 0; btn < sc->max_button; ++btn) - if (USAGE_SUPPORTED(sc->buttons, btn)) + for (btn = 0; btn < sc->max_button; ++btn) { + if (isset(sc->buttons, btn)) { evdev_support_key(sc->evdev, BTN_MOUSE + btn); + nbuttons++; + } + } } WMT_FOREACH_USAGE(sc->caps, i) { if (wmt_hid_map[i].code != WMT_NO_CODE) @@ -462,7 +465,6 @@ wmt_attach(device_t dev) goto detach; /* Announce information about the touch device */ - nbuttons = bitcount32(sc->buttons); device_printf(sc->dev, "Multitouch %s with %d external button%s%s\n", sc->type == WMT_TYPE_TOUCHSCREEN ? "touchscreen" : "touchpad", nbuttons, nbuttons != 1 ? "s" : "", @@ -470,11 +472,11 @@ wmt_attach(device_t dev) device_printf(sc->dev, "%d contacts and [%s%s%s%s%s]. Report range [%d:%d] - [%d:%d]\n", (int)sc->ai[WMT_SLOT].max + 1, - USAGE_SUPPORTED(sc->caps, WMT_IN_RANGE) ? "R" : "", - USAGE_SUPPORTED(sc->caps, WMT_CONFIDENCE) ? "C" : "", - USAGE_SUPPORTED(sc->caps, WMT_WIDTH) ? "W" : "", - USAGE_SUPPORTED(sc->caps, WMT_HEIGHT) ? "H" : "", - USAGE_SUPPORTED(sc->caps, WMT_PRESSURE) ? "P" : "", + isset(sc->caps, WMT_IN_RANGE) ? "R" : "", + isset(sc->caps, WMT_CONFIDENCE) ? "C" : "", + isset(sc->caps, WMT_WIDTH) ? "W" : "", + isset(sc->caps, WMT_HEIGHT) ? "H" : "", + isset(sc->caps, WMT_PRESSURE) ? "P" : "", (int)sc->ai[WMT_X].min, (int)sc->ai[WMT_Y].min, (int)sc->ai[WMT_X].max, (int)sc->ai[WMT_Y].max); @@ -582,7 +584,7 @@ wmt_process_report(struct wmt_softc *sc, uint8_t *buf, int len) } if (slot_data[WMT_TIP_SWITCH] != 0 && - !(USAGE_SUPPORTED(sc->caps, WMT_CONFIDENCE) && + !(isset(sc->caps, WMT_CONFIDENCE) && slot_data[WMT_CONFIDENCE] == 0)) { /* This finger is in proximity of the sensor */ sc->touch = true; @@ -629,14 +631,13 @@ wmt_process_report(struct wmt_softc *sc, uint8_t *buf, int len) /* Report both the click and external left btns as BTN_LEFT */ if (sc->has_int_button) int_btn = hid_get_data(buf, len, &sc->int_btn_loc); - if (sc->max_button != 0 && (sc->buttons & 1 << 0) != 0) + if (isset(sc->buttons, 0)) left_btn = hid_get_data(buf, len, &sc->btn_loc[0]); - if (sc->has_int_button || - (sc->max_button != 0 && (sc->buttons & 1 << 0) != 0)) + if (sc->has_int_button || isset(sc->buttons, 0)) evdev_push_key(sc->evdev, BTN_LEFT, int_btn != 0 | left_btn != 0); for (btn = 1; btn < sc->max_button; ++btn) { - if ((sc->buttons & 1 << btn) != 0) + if (isset(sc->buttons, btn)) evdev_push_key(sc->evdev, BTN_MOUSE + btn, hid_get_data(buf, len, @@ -904,7 +905,7 @@ wmt_hid_parse(struct wmt_softc *sc, const void *d_ptr, uint16_t d_len) hi.usage >= HID_USAGE2(HUP_BUTTON, left_btn) && hi.usage <= HID_USAGE2(HUP_BUTTON, WMT_BTN_MAX)) { btn = (hi.usage & 0xFFFF) - left_btn; - sc->buttons |= 1 << btn; + setbit(sc->buttons, btn); sc->btn_loc[btn] = hi.loc; if (btn >= sc->max_button) sc->max_button = btn + 1; @@ -950,7 +951,7 @@ wmt_hid_parse(struct wmt_softc *sc, const void *d_ptr, uint16_t d_len) */ if (cont > 0) break; - sc->caps |= 1 << i; + setbit(sc->caps, i); sc->ai[i] = (struct wmt_absinfo) { .max = hi.logical_maximum, .min = hi.logical_minimum, @@ -970,7 +971,7 @@ wmt_hid_parse(struct wmt_softc *sc, const void *d_ptr, uint16_t d_len) if (!cont_count_found || !scan_time_found || cont == 0) return (WMT_TYPE_UNSUPPORTED); for (i = 0; i < WMT_N_USAGES; i++) { - if (wmt_hid_map[i].required && !USAGE_SUPPORTED(sc->caps, i)) + if (wmt_hid_map[i].required && isclr(sc->caps, i)) return (WMT_TYPE_UNSUPPORTED); } @@ -994,9 +995,8 @@ wmt_hid_parse(struct wmt_softc *sc, const void *d_ptr, uint16_t d_len) }; /* Report touch orientation if both width and height are supported */ - if (USAGE_SUPPORTED(sc->caps, WMT_WIDTH) && - USAGE_SUPPORTED(sc->caps, WMT_HEIGHT)) { - sc->caps |= 1 << WMT_ORIENTATION; + if (isset(sc->caps, WMT_WIDTH) && isset(sc->caps, WMT_HEIGHT)) { + setbit(sc->caps, WMT_ORIENTATION); sc->ai[WMT_ORIENTATION].max = 1; } From owner-dev-commits-src-main@freebsd.org Wed Dec 23 22:29:37 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C9A584CD536; Wed, 23 Dec 2020 22:29:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D1SYs5LnDz4ZTt; Wed, 23 Dec 2020 22:29:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A7FCB25CC2; Wed, 23 Dec 2020 22:29:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BNMTbuT083058; Wed, 23 Dec 2020 22:29:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BNMTbHL083057; Wed, 23 Dec 2020 22:29:37 GMT (envelope-from git) Date: Wed, 23 Dec 2020 22:29:37 GMT Message-Id: <202012232229.0BNMTbHL083057@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: 18a3b77e226e - wmt(4): Refactor 'Contact Count Maximum' parsing MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 18a3b77e226ef0f39f92579e0e261146d99a3bdb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2020 22:29:37 -0000 The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=18a3b77e226ef0f39f92579e0e261146d99a3bdb commit 18a3b77e226ef0f39f92579e0e261146d99a3bdb Author: Vladimir Kondratyev AuthorDate: 2020-12-23 22:18:18 +0000 Commit: Vladimir Kondratyev CommitDate: 2020-12-23 22:26:06 +0000 wmt(4): Refactor 'Contact Count Maximum' parsing That is done mainly to reduce diff with upstream. Obtained from: sysutils/iichid --- sys/dev/usb/input/wmt.c | 47 ++++++++++++++++++----------------------------- 1 file changed, 18 insertions(+), 29 deletions(-) diff --git a/sys/dev/usb/input/wmt.c b/sys/dev/usb/input/wmt.c index 1377d8d1af40..927d019ea099 100644 --- a/sys/dev/usb/input/wmt.c +++ b/sys/dev/usb/input/wmt.c @@ -255,7 +255,6 @@ struct wmt_softc { if (USAGE_SUPPORTED((caps), (usage))) static enum wmt_type wmt_hid_parse(struct wmt_softc *, const void *, uint16_t); -static void wmt_cont_max_parse(struct wmt_softc *, const void *, uint16_t); static int wmt_set_input_mode(struct wmt_softc *, enum wmt_input_mode); static usb_callback_t wmt_intr_callback; @@ -340,6 +339,7 @@ wmt_attach(device_t dev) { struct usb_attach_arg *uaa = device_get_ivars(dev); struct wmt_softc *sc = device_get_softc(dev); + uint32_t cont_count_max; int nbuttons, btn; size_t i; int err; @@ -352,9 +352,16 @@ wmt_attach(device_t dev) err = usbd_req_get_report(uaa->device, NULL, sc->buf, sc->cont_max_rlen, uaa->info.bIfaceIndex, UHID_FEATURE_REPORT, sc->cont_max_rid); - if (err == USB_ERR_NORMAL_COMPLETION) - wmt_cont_max_parse(sc, sc->buf, sc->cont_max_rlen); - else + if (err == USB_ERR_NORMAL_COMPLETION) { + cont_count_max = hid_get_data_unsigned(sc->buf + 1, + sc->cont_max_rlen - 1, &sc->cont_max_loc); + /* + * Feature report is a primary source of + * 'Contact Count Maximum' + */ + if (cont_count_max > 0) + sc->ai[WMT_SLOT].max = cont_count_max - 1; + } else DPRINTF("usbd_req_get_report error=(%s)\n", usbd_errstr(err)); } else @@ -391,6 +398,13 @@ wmt_attach(device_t dev) DPRINTF("Failed to set input mode: %d\n", err); } + /* Cap contact count maximum to MAX_MT_SLOTS */ + if (sc->ai[WMT_SLOT].max >= MAX_MT_SLOTS) { + DPRINTF("Hardware reported %d contacts while only %d is " + "supported\n", (int)sc->ai[WMT_SLOT].max+1, MAX_MT_SLOTS); + sc->ai[WMT_SLOT].max = MAX_MT_SLOTS - 1; + } + if (/*usb_test_quirk(hw, UQ_MT_TIMESTAMP) ||*/ wmt_timestamps) sc->do_timestamps = true; @@ -972,10 +986,6 @@ wmt_hid_parse(struct wmt_softc *sc, const void *d_ptr, uint16_t d_len) if (cont_count_max < 1) cont_count_max = cont; - /* Cap contact count maximum to MAX_MT_SLOTS */ - if (cont_count_max > MAX_MT_SLOTS) - cont_count_max = MAX_MT_SLOTS; - /* Set number of MT protocol type B slots */ sc->ai[WMT_SLOT] = (struct wmt_absinfo) { .min = 0, @@ -1009,27 +1019,6 @@ wmt_hid_parse(struct wmt_softc *sc, const void *d_ptr, uint16_t d_len) return (type); } -static void -wmt_cont_max_parse(struct wmt_softc *sc, const void *r_ptr, uint16_t r_len) -{ - uint32_t cont_count_max; - - cont_count_max = hid_get_data_unsigned((const uint8_t *)r_ptr + 1, - r_len - 1, &sc->cont_max_loc); - if (cont_count_max > MAX_MT_SLOTS) { - DPRINTF("Hardware reported %d contacts while only %d is " - "supported\n", (int)cont_count_max, MAX_MT_SLOTS); - cont_count_max = MAX_MT_SLOTS; - } - /* Feature report is a primary source of 'Contact Count Maximum' */ - if (cont_count_max > 0 && - cont_count_max != sc->ai[WMT_SLOT].max + 1) { - sc->ai[WMT_SLOT].max = cont_count_max - 1; - device_printf(sc->dev, "%d feature report contacts", - cont_count_max); - } -} - static int wmt_set_input_mode(struct wmt_softc *sc, enum wmt_input_mode mode) { From owner-dev-commits-src-main@freebsd.org Wed Dec 23 22:44:55 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BA7284CD976; Wed, 23 Dec 2020 22:44:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D1SvW4hS6z4bfV; Wed, 23 Dec 2020 22:44:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8FB0525BDA; Wed, 23 Dec 2020 22:44:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BNMitoN006528; Wed, 23 Dec 2020 22:44:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BNMit5o006527; Wed, 23 Dec 2020 22:44:55 GMT (envelope-from git) Date: Wed, 23 Dec 2020 22:44:55 GMT Message-Id: <202012232244.0BNMit5o006527@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: 2ed0c8d801f5 - version bump for commit 665b1365fe8e24d618d63b0d57b0b4ad39e97824 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2ed0c8d801f5f72dbde7a7d30135c1cc361a1e90 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2020 22:44:55 -0000 The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=2ed0c8d801f5f72dbde7a7d30135c1cc361a1e90 commit 2ed0c8d801f5f72dbde7a7d30135c1cc361a1e90 Author: Rick Macklem AuthorDate: 2020-12-23 22:41:47 +0000 Commit: Rick Macklem CommitDate: 2020-12-23 22:41:47 +0000 version bump for commit 665b1365fe8e24d618d63b0d57b0b4ad39e97824 The commit changed the internal API between the NFS and kernel RPC modules. Bump the version so that all modules get rebuilt from sources. --- sys/sys/param.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/param.h b/sys/sys/param.h index fc41df6acc4f..3137693848f1 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300132 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300133 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-dev-commits-src-main@freebsd.org Wed Dec 23 23:08:45 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DCDA34CDEBD; Wed, 23 Dec 2020 23:08:45 +0000 (UTC) (envelope-from rew@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D1TR15nZnz4cbr; Wed, 23 Dec 2020 23:08:45 +0000 (UTC) (envelope-from rew@freebsd.org) Received: from mail-oi1-f182.google.com (mail-oi1-f182.google.com [209.85.167.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: rew) by smtp.freebsd.org (Postfix) with ESMTPSA id B45A52A7B7; Wed, 23 Dec 2020 23:08:45 +0000 (UTC) (envelope-from rew@freebsd.org) Received: by mail-oi1-f182.google.com with SMTP id d189so713997oig.11; Wed, 23 Dec 2020 15:08:45 -0800 (PST) X-Gm-Message-State: AOAM531VTxS/SWMRVxPC472VuK6I6w8ImKOwG6d7Yk5Bk1R6tVZ7+OLG C++Dspk80GBHLulPp/G3v+ah5yBQFWQHKWzss+U= X-Google-Smtp-Source: ABdhPJzh+UmM4QSW5e3Fqqw18DFYWLcXxLQFR5+vJdGLxyoHd/SenZOETG8Jo5KLXgb+HhqaHyXQdE5+bkWqltYrRH8= X-Received: by 2002:aca:c206:: with SMTP id s6mr1393915oif.0.1608764925056; Wed, 23 Dec 2020 15:08:45 -0800 (PST) MIME-Version: 1.0 Received: by 2002:ac9:19c5:0:0:0:0:0 with HTTP; Wed, 23 Dec 2020 15:08:44 -0800 (PST) In-Reply-To: <4E9D53F7-1CFA-471F-BB50-20AF85BB3F5E@freebsd.org> References: <202012231826.0BNIQwkM005361@gitrepo.freebsd.org> <4E9D53F7-1CFA-471F-BB50-20AF85BB3F5E@freebsd.org> From: Rob Wing Date: Wed, 23 Dec 2020 14:08:44 -0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: c4df8cbfde53 - Remove bvmconsole and bvmdebug. To: Jessica Clarke Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2020 23:08:45 -0000 Too bad having my system time set forward doesn=E2=80=99t put me a step ahe= ad of everything else. Thanks for pointing that out, I didn=E2=80=99t notice. -Rob On Wednesday, December 23, 2020, Jessica Clarke wrote: > On 23 Dec 2020, at 18:26, Robert Wing wrote: > > > > The branch main has been updated by rew: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D > c4df8cbfde53c376d93f439eac3f45a7b4fc705e > > > > commit c4df8cbfde53c376d93f439eac3f45a7b4fc705e > > Author: Robert Wing > > AuthorDate: 2020-12-24 01:15:33 +0000 > > Commit: Robert Wing > > CommitDate: 2020-12-24 02:15:23 +0000 > > Hi Robert, > You might wish to correct your system time :) > > Jess > > From owner-dev-commits-src-main@freebsd.org Thu Dec 24 01:04:46 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B304A4CFE12; Thu, 24 Dec 2020 01:04:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D1X0t4hFQz4jFL; Thu, 24 Dec 2020 01:04:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9257E278DE; Thu, 24 Dec 2020 01:04:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BO14kJx067832; Thu, 24 Dec 2020 01:04:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BO14kJF067831; Thu, 24 Dec 2020 01:04:46 GMT (envelope-from git) Date: Thu, 24 Dec 2020 01:04:46 GMT Message-Id: <202012240104.0BO14kJF067831@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: 7d8ff3245227 - Sync ippool.8 man page synopsis with reality and the rest of the man page.. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7d8ff3245227ddb517c02ba573405838018c2b44 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2020 01:04:46 -0000 The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=7d8ff3245227ddb517c02ba573405838018c2b44 commit 7d8ff3245227ddb517c02ba573405838018c2b44 Author: Cy Schubert AuthorDate: 2020-12-24 01:02:14 +0000 Commit: Cy Schubert CommitDate: 2020-12-24 01:04:34 +0000 Sync ippool.8 man page synopsis with reality and the rest of the man page.. MFC after: 3 days --- contrib/ipfilter/man/ippool.8 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib/ipfilter/man/ippool.8 b/contrib/ipfilter/man/ippool.8 index 3411ac19f409..446684d4ad10 100644 --- a/contrib/ipfilter/man/ippool.8 +++ b/contrib/ipfilter/man/ippool.8 @@ -12,7 +12,7 @@ ippool \- user interface to the IPFilter pools -A [-dnv] [-m ] [-o ] [-S ] -t .br .B ippool --f [-dnuv] [-f [-dnuvR] [-f ] [-t ] @@ -24,7 +24,7 @@ ippool \- user interface to the IPFilter pools -r [-dnv] [-m ] [-o ] [-t ] -i [/] .br .B ippool --R [-dnv] [-m ] [-o ] [-t ] +-R [-dnv] [-m ] [-o ] -t .br .B ippool -s [-dtv] [-M ] [-N ] @@ -120,7 +120,7 @@ as a number of seconds. .B -u When parsing a configuration file, rather than load new pool data into the kernel, unload it. -.DT +.TP .SH FILES .br /dev/iplookup From owner-dev-commits-src-main@freebsd.org Thu Dec 24 11:59:49 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E40854C15AA; Thu, 24 Dec 2020 11:59:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D1pXj69Mrz3q3t; Thu, 24 Dec 2020 11:59:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BC82F1013E; Thu, 24 Dec 2020 11:59:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BOBxnmH009863; Thu, 24 Dec 2020 11:59:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BOBxnbA009862; Thu, 24 Dec 2020 11:59:49 GMT (envelope-from git) Date: Thu, 24 Dec 2020 11:59:49 GMT Message-Id: <202012241159.0BOBxnbA009862@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Hans Petter Selasky Subject: git: a8261b70e681 - Add support for USB-C and TB3 Gen2 to if_ure(4). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a8261b70e6814d09f2f7bef0d344e23ad554f14e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2020 11:59:50 -0000 The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=a8261b70e6814d09f2f7bef0d344e23ad554f14e commit a8261b70e6814d09f2f7bef0d344e23ad554f14e Author: Hans Petter Selasky AuthorDate: 2020-12-24 11:59:19 +0000 Commit: Hans Petter Selasky CommitDate: 2020-12-24 11:59:19 +0000 Add support for USB-C and TB3 Gen2 to if_ure(4). Add support for LAN found on Thinkpad USB-C and Thunderbolt Gen 2 docking stations. Submitted by: ali.abdallah@suse.com MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking --- sys/dev/usb/net/if_ure.c | 2 ++ sys/dev/usb/usbdevs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/sys/dev/usb/net/if_ure.c b/sys/dev/usb/net/if_ure.c index 2be46371cd28..9d43b9a59a44 100644 --- a/sys/dev/usb/net/if_ure.c +++ b/sys/dev/usb/net/if_ure.c @@ -98,8 +98,10 @@ static const STRUCT_USB_HOST_ID ure_devs[] = { #define URE_DEV(v,p,i) { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, i) } URE_DEV(LENOVO, RTL8153, 0), URE_DEV(LENOVO, TBT3LAN, 0), + URE_DEV(LENOVO, TBT3LANGEN2, 0), URE_DEV(LENOVO, ONELINK, 0), URE_DEV(LENOVO, USBCLAN, 0), + URE_DEV(LENOVO, USBCLANGEN2, 0), URE_DEV(NVIDIA, RTL8153, 0), URE_DEV(REALTEK, RTL8152, URE_FLAG_8152), URE_DEV(REALTEK, RTL8153, 0), diff --git a/sys/dev/usb/usbdevs b/sys/dev/usb/usbdevs index 64a22648743a..8ea76d44ce14 100644 --- a/sys/dev/usb/usbdevs +++ b/sys/dev/usb/usbdevs @@ -2801,6 +2801,8 @@ product LENOVO RTL8153 0x7205 USB 3.0 Ethernet product LENOVO ONELINK 0x720a USB 3.0 Ethernet product LENOVO TBT3LAN 0x3069 LAN port in Thinkpad TB3 dock product LENOVO USBCLAN 0x3062 LAN port in Thinkpad USB-C dock +product LENOVO TBT3LANGEN2 0x3082 LAN port in Thinkpad TB3 dock gen2 +product LENOVO USBCLANGEN2 0xa387 LAN port in Thinkpad UBS-C dock gen2 /* Lexar products */ product LEXAR JUMPSHOT 0x0001 jumpSHOT CompactFlash Reader From owner-dev-commits-src-main@freebsd.org Thu Dec 24 14:09:12 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 978D14C6465; Thu, 24 Dec 2020 14:09:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D1sQ03s9hz4Ztd; Thu, 24 Dec 2020 14:09:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7723E11DB4; Thu, 24 Dec 2020 14:09:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BOE9CJd051259; Thu, 24 Dec 2020 14:09:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BOE9CYb051258; Thu, 24 Dec 2020 14:09:12 GMT (envelope-from git) Date: Thu, 24 Dec 2020 14:09:12 GMT Message-Id: <202012241409.0BOE9CYb051258@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Guangyuan Yang Subject: git: 81720dbab2a8 - mmap(2): Fix a typo MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ygy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 81720dbab2a84669ec719149501b75ae78c3d4ee Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2020 14:09:12 -0000 The branch main has been updated by ygy (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=81720dbab2a84669ec719149501b75ae78c3d4ee commit 81720dbab2a84669ec719149501b75ae78c3d4ee Author: Guangyuan Yang AuthorDate: 2020-12-24 14:08:34 +0000 Commit: Guangyuan Yang CommitDate: 2020-12-24 14:08:34 +0000 mmap(2): Fix a typo PR: 252097 MFC after: 1 week Reported by: Nick Frampton --- lib/libc/sys/mmap.2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libc/sys/mmap.2 b/lib/libc/sys/mmap.2 index 4635a33e0958..143705fed103 100644 --- a/lib/libc/sys/mmap.2 +++ b/lib/libc/sys/mmap.2 @@ -79,7 +79,7 @@ If references a device file, the interpretation of the .Fa offset value is device specific and defined by the device driver. -The virtual memory subsystem does not impose any restrictitions on the +The virtual memory subsystem does not impose any restrictions on the .Fa offset value in this case, passing it unchanged to the driver. .Pp From owner-dev-commits-src-main@freebsd.org Thu Dec 24 14:17:19 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EE83A4C6AEE; Thu, 24 Dec 2020 14:17:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D1sbM6Rdmz4cD3; Thu, 24 Dec 2020 14:17:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D096611F95; Thu, 24 Dec 2020 14:17:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BOEHJrd061898; Thu, 24 Dec 2020 14:17:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BOEHJGo061897; Thu, 24 Dec 2020 14:17:19 GMT (envelope-from git) Date: Thu, 24 Dec 2020 14:17:19 GMT Message-Id: <202012241417.0BOEHJGo061897@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Guangyuan Yang Subject: git: a1d783675213 - mmap(2): Update .Dd missed in the last commit MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ygy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a1d783675213798620550f4af137340458abe6c5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2020 14:17:20 -0000 The branch main has been updated by ygy (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=a1d783675213798620550f4af137340458abe6c5 commit a1d783675213798620550f4af137340458abe6c5 Author: Guangyuan Yang AuthorDate: 2020-12-24 14:14:56 +0000 Commit: Guangyuan Yang CommitDate: 2020-12-24 14:14:56 +0000 mmap(2): Update .Dd missed in the last commit PR: 252097 MFC after: 1 week --- lib/libc/sys/mmap.2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libc/sys/mmap.2 b/lib/libc/sys/mmap.2 index 143705fed103..5a3c6eb5d06e 100644 --- a/lib/libc/sys/mmap.2 +++ b/lib/libc/sys/mmap.2 @@ -28,7 +28,7 @@ .\" @(#)mmap.2 8.4 (Berkeley) 5/11/95 .\" $FreeBSD$ .\" -.Dd October 27, 2020 +.Dd December 24, 2020 .Dt MMAP 2 .Os .Sh NAME From owner-dev-commits-src-main@freebsd.org Thu Dec 24 19:08:18 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 753F24CDC65; Thu, 24 Dec 2020 19:08:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D20362yQQz4vJn; Thu, 24 Dec 2020 19:08:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 58AB015A99; Thu, 24 Dec 2020 19:08:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BOJ8Irb074599; Thu, 24 Dec 2020 19:08:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BOJ8IVn074598; Thu, 24 Dec 2020 19:08:18 GMT (envelope-from git) Date: Thu, 24 Dec 2020 19:08:18 GMT Message-Id: <202012241908.0BOJ8IVn074598@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: 769935a4edf8 - ukbd(4): Do not serialize evdev key events MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 769935a4edf8a75805000900d44a66ad5d2eaabe Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2020 19:08:18 -0000 The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=769935a4edf8a75805000900d44a66ad5d2eaabe commit 769935a4edf8a75805000900d44a66ad5d2eaabe Author: Vladimir Kondratyev AuthorDate: 2020-12-24 18:56:33 +0000 Commit: Vladimir Kondratyev CommitDate: 2020-12-24 18:56:33 +0000 ukbd(4): Do not serialize evdev key events Unlike AT keyboards, HID devices are able to send all pc105 key states within a single report. Let evdev to transmit all key state changes within a single report too. Reviewed by: hselasky Obtained from: sysutils/iichid MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D27749 --- sys/dev/usb/input/ukbd.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sys/dev/usb/input/ukbd.c b/sys/dev/usb/input/ukbd.c index 9fb3acbd7ba1..1ab26ccfb258 100644 --- a/sys/dev/usb/input/ukbd.c +++ b/sys/dev/usb/input/ukbd.c @@ -389,11 +389,9 @@ ukbd_put_key(struct ukbd_softc *sc, uint32_t key) (key & KEY_RELEASE) ? "released" : "pressed"); #ifdef EVDEV_SUPPORT - if (evdev_rcpt_mask & EVDEV_RCPT_HW_KBD && sc->sc_evdev != NULL) { + if (evdev_rcpt_mask & EVDEV_RCPT_HW_KBD && sc->sc_evdev != NULL) evdev_push_event(sc->sc_evdev, EV_KEY, evdev_hid2key(KEY_INDEX(key)), !(key & KEY_RELEASE)); - evdev_sync(sc->sc_evdev); - } #endif if (sc->sc_inputs < UKBD_IN_BUF_SIZE) { @@ -559,6 +557,11 @@ ukbd_interrupt(struct ukbd_softc *sc) } } +#ifdef EVDEV_SUPPORT + if (evdev_rcpt_mask & EVDEV_RCPT_HW_KBD && sc->sc_evdev != NULL) + evdev_sync(sc->sc_evdev); +#endif + /* wakeup keyboard system */ ukbd_event_keyinput(sc); } From owner-dev-commits-src-main@freebsd.org Thu Dec 24 19:11:57 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 16A0C4CE12E; Thu, 24 Dec 2020 19:11:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D207K09N7z4vQ8; Thu, 24 Dec 2020 19:11:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ED42C158F6; Thu, 24 Dec 2020 19:11:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BOJBu6P085181; Thu, 24 Dec 2020 19:11:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BOJBuUN085180; Thu, 24 Dec 2020 19:11:56 GMT (envelope-from git) Date: Thu, 24 Dec 2020 19:11:56 GMT Message-Id: <202012241911.0BOJBuUN085180@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: 30f34a519372 - ukbd(4): Push LED events in ioctl handler rather than in xfer callback MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 30f34a519372ebce29c4439d0e6a7bc8c2df0566 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2020 19:11:57 -0000 The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=30f34a519372ebce29c4439d0e6a7bc8c2df0566 commit 30f34a519372ebce29c4439d0e6a7bc8c2df0566 Author: Vladimir Kondratyev AuthorDate: 2020-12-24 19:08:04 +0000 Commit: Vladimir Kondratyev CommitDate: 2020-12-24 19:08:04 +0000 ukbd(4): Push LED events in ioctl handler rather than in xfer callback If LED state is set through evdev interface, than asynchronous nature of USB transfer callback can lead to change of order of events echoed back to userland as it causes LED events to be echoed with some lag. Fix that with echoing of LED events synchronously in ioctl handler. Reviewed by: hselasky Obtained from: sysutils/iichid MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D27750 --- sys/dev/usb/input/ukbd.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/dev/usb/input/ukbd.c b/sys/dev/usb/input/ukbd.c index 1ab26ccfb258..4f27bf95b948 100644 --- a/sys/dev/usb/input/ukbd.c +++ b/sys/dev/usb/input/ukbd.c @@ -845,11 +845,6 @@ ukbd_set_leds_callback(struct usb_xfer *xfer, usb_error_t error) if (!any) break; -#ifdef EVDEV_SUPPORT - if (sc->sc_evdev != NULL) - evdev_push_leds(sc->sc_evdev, sc->sc_leds); -#endif - /* range check output report length */ len = sc->sc_led_size; if (len > (UKBD_BUFFER_SIZE - 1)) @@ -1973,6 +1968,11 @@ ukbd_set_leds(struct ukbd_softc *sc, uint8_t leds) UKBD_LOCK_ASSERT(); DPRINTF("leds=0x%02x\n", leds); +#ifdef EVDEV_SUPPORT + if (sc->sc_evdev != NULL) + evdev_push_leds(sc->sc_evdev, leds); +#endif + sc->sc_leds = leds; sc->sc_flags |= UKBD_FLAG_SET_LEDS; From owner-dev-commits-src-main@freebsd.org Thu Dec 24 20:35:51 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0355D4D03EC; Thu, 24 Dec 2020 20:35:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D22066m7vz3GfW; Thu, 24 Dec 2020 20:35:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DB1A916E83; Thu, 24 Dec 2020 20:35:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BOKZojw071530; Thu, 24 Dec 2020 20:35:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BOKZo8R071529; Thu, 24 Dec 2020 20:35:50 GMT (envelope-from git) Date: Thu, 24 Dec 2020 20:35:50 GMT Message-Id: <202012242035.0BOKZo8R071529@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ryan Libby Subject: git: 1ee339e257b3 - openzfs: fix gcc in-kernel builds MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rlibby X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1ee339e257b39cdfad7995f98336e3cd0edbc9a5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2020 20:35:51 -0000 The branch main has been updated by rlibby: URL: https://cgit.FreeBSD.org/src/commit/?id=1ee339e257b39cdfad7995f98336e3cd0edbc9a5 commit 1ee339e257b39cdfad7995f98336e3cd0edbc9a5 Author: Ryan Libby AuthorDate: 2020-12-24 20:34:18 +0000 Commit: Ryan Libby CommitDate: 2020-12-24 20:34:18 +0000 openzfs: fix gcc in-kernel builds Fix gcc builds of in-kernel modules using CDDL_CFLAGS (e.g. options ZFS). - Remove nonexistent include dirs for -Wmissing-include-dirs - Suppress -Wnested-externs, a useless warning - Sort and uniq warning flags while here Reviewed by: markj Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D27684 --- sys/conf/kern.pre.mk | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/sys/conf/kern.pre.mk b/sys/conf/kern.pre.mk index cb1703097836..4a0663f49753 100644 --- a/sys/conf/kern.pre.mk +++ b/sys/conf/kern.pre.mk @@ -209,29 +209,27 @@ CDDL_CFLAGS= \ -nostdinc \ -include $S/modules/zfs/static_ccompile.h \ -I${ZINCDIR} \ - -I${ZINCDIR}/spl \ -I${ZINCDIR}/os/freebsd \ -I${ZINCDIR}/os/freebsd/spl \ -I${ZINCDIR}/os/freebsd/zfs \ -I$S/modules/zfs \ -I$S/contrib/openzfs/module/zstd/include \ - -I$S/contrib/openzfs/module/zstd/lib/freebsd/ \ ${CFLAGS} \ - -Wno-unknown-pragmas \ - -Wno-missing-prototypes \ - -Wno-undef \ - -Wno-strict-prototypes \ -Wno-cast-qual \ + -Wno-duplicate-decl-specifier \ + -Wno-inline \ + -Wno-missing-braces \ + -Wno-missing-prototypes \ + -Wno-nested-externs \ -Wno-parentheses \ + -Wno-pointer-arith \ -Wno-redundant-decls \ - -Wno-missing-braces \ - -Wno-uninitialized \ - -Wno-unused \ - -Wno-inline \ + -Wno-strict-prototypes \ -Wno-switch \ - -Wno-pointer-arith \ + -Wno-undef \ + -Wno-uninitialized \ -Wno-unknown-pragmas \ - -Wno-duplicate-decl-specifier \ + -Wno-unused \ -include ${ZINCDIR}/os/freebsd/spl/sys/ccompile.h \ -I$S/cddl/contrib/opensolaris/uts/common \ -I$S -I$S/cddl/compat/opensolaris From owner-dev-commits-src-main@freebsd.org Thu Dec 24 20:35:50 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E8CC34D0241; Thu, 24 Dec 2020 20:35:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D22066GMpz3GdW; Thu, 24 Dec 2020 20:35:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CA02F16E23; Thu, 24 Dec 2020 20:35:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BOKZoA4071513; Thu, 24 Dec 2020 20:35:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BOKZomN071512; Thu, 24 Dec 2020 20:35:50 GMT (envelope-from git) Date: Thu, 24 Dec 2020 20:35:50 GMT Message-Id: <202012242035.0BOKZomN071512@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ryan Libby Subject: git: 2fb4a03d55a9 - rtsock: quiet -Wunused-variable in LINT-NOIP kernels MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rlibby X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2fb4a03d55a9135346f1b8fc3aadbc1a29eeeb5d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2020 20:35:51 -0000 The branch main has been updated by rlibby: URL: https://cgit.FreeBSD.org/src/commit/?id=2fb4a03d55a9135346f1b8fc3aadbc1a29eeeb5d commit 2fb4a03d55a9135346f1b8fc3aadbc1a29eeeb5d Author: Ryan Libby AuthorDate: 2020-12-24 20:34:18 +0000 Commit: Ryan Libby CommitDate: 2020-12-24 20:34:18 +0000 rtsock: quiet -Wunused-variable in LINT-NOIP kernels Fixup after r368769 / d68fb8d978bbd3cf1b5db35f309aaeab30636d43. Reported by: mjg Reviewed by: melifaro Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D27730 --- sys/net/rtsock.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c index 5acfd658caf6..88ae0c0868c8 100644 --- a/sys/net/rtsock.c +++ b/sys/net/rtsock.c @@ -799,11 +799,11 @@ static void export_rtaddrs(const struct rtentry *rt, struct sockaddr *dst, struct sockaddr *mask) { - uint32_t scopeid = 0; #ifdef INET if (dst->sa_family == AF_INET) { struct sockaddr_in *dst4 = (struct sockaddr_in *)dst; struct sockaddr_in *mask4 = (struct sockaddr_in *)mask; + uint32_t scopeid = 0; rt_get_inet_prefix_pmask(rt, &dst4->sin_addr, &mask4->sin_addr, &scopeid); return; @@ -813,8 +813,9 @@ export_rtaddrs(const struct rtentry *rt, struct sockaddr *dst, if (dst->sa_family == AF_INET6) { struct sockaddr_in6 *dst6 = (struct sockaddr_in6 *)dst; struct sockaddr_in6 *mask6 = (struct sockaddr_in6 *)mask; - rt_get_inet6_prefix_pmask(rt, &dst6->sin6_addr, &mask6->sin6_addr, - &scopeid); + uint32_t scopeid = 0; + rt_get_inet6_prefix_pmask(rt, &dst6->sin6_addr, + &mask6->sin6_addr, &scopeid); dst6->sin6_scope_id = scopeid; return; } From owner-dev-commits-src-main@freebsd.org Thu Dec 24 20:50:01 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 416114D073B; Thu, 24 Dec 2020 20:50:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D22JT1M92z3H3y; Thu, 24 Dec 2020 20:50:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1D1481687E; Thu, 24 Dec 2020 20:50:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BOKo1Dd083893; Thu, 24 Dec 2020 20:50:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BOKo1Ii083890; Thu, 24 Dec 2020 20:50:01 GMT (envelope-from git) Date: Thu, 24 Dec 2020 20:50:01 GMT Message-Id: <202012242050.0BOKo1Ii083890@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ryan Libby Subject: git: 322a188d45f1 - wmt: quiet gcc -Wparentheses MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rlibby X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 322a188d45f17457f0de00a78c77228751dff03c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2020 20:50:01 -0000 The branch main has been updated by rlibby: URL: https://cgit.FreeBSD.org/src/commit/?id=322a188d45f17457f0de00a78c77228751dff03c commit 322a188d45f17457f0de00a78c77228751dff03c Author: Ryan Libby AuthorDate: 2020-12-24 20:49:27 +0000 Commit: Ryan Libby CommitDate: 2020-12-24 20:49:27 +0000 wmt: quiet gcc -Wparentheses Reviewed by: wulf Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D27767 --- sys/dev/usb/input/wmt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/usb/input/wmt.c b/sys/dev/usb/input/wmt.c index 788341df288c..62e56fe026ca 100644 --- a/sys/dev/usb/input/wmt.c +++ b/sys/dev/usb/input/wmt.c @@ -635,7 +635,7 @@ wmt_process_report(struct wmt_softc *sc, uint8_t *buf, int len) left_btn = hid_get_data(buf, len, &sc->btn_loc[0]); if (sc->has_int_button || isset(sc->buttons, 0)) evdev_push_key(sc->evdev, BTN_LEFT, - int_btn != 0 | left_btn != 0); + (int_btn != 0) | (left_btn != 0)); for (btn = 1; btn < sc->max_button; ++btn) { if (isset(sc->buttons, btn)) evdev_push_key(sc->evdev, BTN_MOUSE + btn, From owner-dev-commits-src-main@freebsd.org Thu Dec 24 21:32:49 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0A0FB4D20C5; Thu, 24 Dec 2020 21:32:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D23Fr6Gxmz3LX2; Thu, 24 Dec 2020 21:32:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CA76F1747B; Thu, 24 Dec 2020 21:32:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BOLWmV9036651; Thu, 24 Dec 2020 21:32:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BOLWmO4036650; Thu, 24 Dec 2020 21:32:48 GMT (envelope-from git) Date: Thu, 24 Dec 2020 21:32:48 GMT Message-Id: <202012242132.0BOLWmO4036650@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 3b5008b065a9 - Fix amd64 GENERIC-MMCCAM kernel build MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3b5008b065a913c675ec3e41f06ec22f571ad7ea Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2020 21:32:49 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=3b5008b065a913c675ec3e41f06ec22f571ad7ea commit 3b5008b065a913c675ec3e41f06ec22f571ad7ea Author: Kristof Provost AuthorDate: 2020-12-24 21:30:52 +0000 Commit: Kristof Provost CommitDate: 2020-12-24 21:30:52 +0000 Fix amd64 GENERIC-MMCCAM kernel build c4df8cbfde53c376d93f439eac3f45a7b4fc705e removed bvmconsole and bvmdebug, but missed the bvmconsole entry in GENERIC-MMCCAM. --- sys/amd64/conf/GENERIC-MMCCAM | 3 --- 1 file changed, 3 deletions(-) diff --git a/sys/amd64/conf/GENERIC-MMCCAM b/sys/amd64/conf/GENERIC-MMCCAM index 19dc27b95e3d..8a5bc7175d68 100644 --- a/sys/amd64/conf/GENERIC-MMCCAM +++ b/sys/amd64/conf/GENERIC-MMCCAM @@ -12,9 +12,6 @@ options GEOM_LABEL # UART -- for bhyve console device uart -# kgdb stub -device bvmdebug - # VirtIO support, needed for bhyve device virtio # Generic VirtIO bus (required) device virtio_pci # VirtIO PCI device From owner-dev-commits-src-main@freebsd.org Thu Dec 24 22:23:00 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F39A84D3A05; Thu, 24 Dec 2020 22:23:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D24Mm5b7sz3Q2Y; Thu, 24 Dec 2020 22:23:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B26D9181F0; Thu, 24 Dec 2020 22:23:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BOMN0hA090106; Thu, 24 Dec 2020 22:23:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BOMN0p1090105; Thu, 24 Dec 2020 22:23:00 GMT (envelope-from git) Date: Thu, 24 Dec 2020 22:23:00 GMT Message-Id: <202012242223.0BOMN0p1090105@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: 79302a6304b1 - mount_nfs(8): add a description for the new "tlscertname" option MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 79302a6304b1074bdb8ca60cb29982cf64197c92 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2020 22:23:01 -0000 The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=79302a6304b1074bdb8ca60cb29982cf64197c92 commit 79302a6304b1074bdb8ca60cb29982cf64197c92 Author: Rick Macklem AuthorDate: 2020-12-24 22:20:06 +0000 Commit: Rick Macklem CommitDate: 2020-12-24 22:20:06 +0000 mount_nfs(8): add a description for the new "tlscertname" option commit 665b1365fe8e added a new NFS mount option that is used to set a non-default X.509 certificate, that can be used for nfs-over-tls NFS mounts. This patch adds a description for it to the man page. Reviewed by: 0mp Differential Revision: https://reviews.freebsd.org/D27733 --- sbin/mount_nfs/mount_nfs.8 | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/sbin/mount_nfs/mount_nfs.8 b/sbin/mount_nfs/mount_nfs.8 index 44490d6945fe..b2c561bc5cc8 100644 --- a/sbin/mount_nfs/mount_nfs.8 +++ b/sbin/mount_nfs/mount_nfs.8 @@ -28,7 +28,7 @@ .\" @(#)mount_nfs.8 8.3 (Berkeley) 3/29/95 .\" $FreeBSD$ .\" -.Dd November 30, 2020 +.Dd December 21, 2020 .Dt MOUNT_NFS 8 .Os .Sh NAME @@ -418,6 +418,36 @@ per RFC NNNN. TLS is only supported for TCP connections and the .Xr rpc.tlsclntd 8 daemon must be running for an NFS over TCP connection to use TLS. +.It Cm tlscertname Ns = Ns Aq Ar name +This option specifies the name of an alternate certificate to be +presented to the NFS server during TLS handshake. +The default certificate file names are +.Dq cert.pem +and +.Dq certkey.pem . +When this option is specified, +.Ar name +replaces +.Dq cert +in the above file names. +For example, if the value of +.Ar name +is specified as +.Dq other +the certificate file names to be used will be +.Dq other.pem +and +.Dq otherkey.pem . +These files are stored in +.Pa /etc/rpc.tlsclntd +by default. +This option is only meaningful when used with the +.Cm tls +option and the +.Xr rpc.tlsclntd 8 +is running with the +.Fl m +command line flag set. .It Cm udp Use UDP transport. .It Cm vers Ns = Ns Aq Ar vers_number From owner-dev-commits-src-main@freebsd.org Fri Dec 25 02:50:19 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A1FA54B3C1F; Fri, 25 Dec 2020 02:50:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D2BJC4B48z3w8g; Fri, 25 Dec 2020 02:50:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 82A461B160; Fri, 25 Dec 2020 02:50:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BP2oJtV076200; Fri, 25 Dec 2020 02:50:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BP2oJEe076195; Fri, 25 Dec 2020 02:50:19 GMT (envelope-from git) Date: Fri, 25 Dec 2020 02:50:19 GMT Message-Id: <202012250250.0BP2oJEe076195@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Xin LI Subject: git: 760dbe84abfb - Don't set more_data which is never used. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: delphij X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 760dbe84abfb0b3aa9b72f7474fb9a066bbdd0cf Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Dec 2020 02:50:19 -0000 The branch main has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=760dbe84abfb0b3aa9b72f7474fb9a066bbdd0cf commit 760dbe84abfb0b3aa9b72f7474fb9a066bbdd0cf Author: Xin LI AuthorDate: 2020-12-25 02:49:12 +0000 Commit: Xin LI CommitDate: 2020-12-25 02:49:12 +0000 Don't set more_data which is never used. MFC after: 2 weeks --- usr.sbin/zonectl/zonectl.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/usr.sbin/zonectl/zonectl.c b/usr.sbin/zonectl/zonectl.c index 6ab38cbd9503..dac773974deb 100644 --- a/usr.sbin/zonectl/zonectl.c +++ b/usr.sbin/zonectl/zonectl.c @@ -226,7 +226,6 @@ zonectl_print_rz(struct disk_zone_report *report, zone_output_flags out_flags, uint64_t next_lba = 0; char tmpstr[80]; char word_sep; - int more_data = 0; uint32_t i; field_widths[ZONE_FW_START] = 11; @@ -237,10 +236,8 @@ zonectl_print_rz(struct disk_zone_report *report, zone_output_flags out_flags, field_widths[ZONE_FW_SEQ] = 14; field_widths[ZONE_FW_RESET] = 16; - if ((report->entries_available - report->entries_filled) > 0) { - more_data = 1; + if ((report->entries_available - report->entries_filled) > 0) status = ZONE_PRINT_MORE_DATA; - } if (out_flags == ZONE_OF_SCRIPT) word_sep = '_'; From owner-dev-commits-src-main@freebsd.org Fri Dec 25 11:36:18 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C6CD94BE8D6; Fri, 25 Dec 2020 11:36:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D2Pz65BgQz4rbT; Fri, 25 Dec 2020 11:36:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A501822204; Fri, 25 Dec 2020 11:36:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BPBaISP041080; Fri, 25 Dec 2020 11:36:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BPBaIh2041079; Fri, 25 Dec 2020 11:36:18 GMT (envelope-from git) Date: Fri, 25 Dec 2020 11:36:18 GMT Message-Id: <202012251136.0BPBaIh2041079@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: f5baf8bb12f3 - Add modular fib lookup framework. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f5baf8bb12f39d0e8d64508c47eb6c4386ef716d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Dec 2020 11:36:18 -0000 The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=f5baf8bb12f39d0e8d64508c47eb6c4386ef716d commit f5baf8bb12f39d0e8d64508c47eb6c4386ef716d Author: Alexander V. Chernikov AuthorDate: 2020-12-25 10:39:52 +0000 Commit: Alexander V. Chernikov CommitDate: 2020-12-25 11:33:17 +0000 Add modular fib lookup framework. This change introduces framework that allows to dynamically attach or detach longest prefix match (lpm) lookup algorithms to speed up datapath route tables lookups. Framework takes care of handling initial synchronisation, route subscription, nhop/nhop groups reference and indexing, dataplane attachments and fib instance algorithm setup/teardown. Framework features automatic algorithm selection, allowing for picking the best matching algorithm on-the-fly based on the amount of routes in the routing table. Currently framework code is guarded under FIB_ALGO config option. An idea is to enable it by default in the next couple of weeks. The following algorithms are provided by default: IPv4: * bsearch4 (lockless binary search in a special IP array), tailored for small-fib (<16 routes) * radix4_lockless (lockless immutable radix, re-created on every rtable change), tailored for small-fib (<1000 routes) * radix4 (base system radix backend) * dpdk_lpm4 (DPDK DIR24-8-based lookups), lockless datastrucure, optimized for large-fib (D27412) IPv6: * radix6_lockless (lockless immutable radix, re-created on every rtable change), tailed for small-fib (<1000 routes) * radix6 (base system radix backend) * dpdk_lpm6 (DPDK DIR24-8-based lookups), lockless datastrucure, optimized for large-fib (D27412) Performance changes: Micro benchmarks (I7-7660U, single-core lookups, 2048k dst, code in D27604): IPv4: 8 routes: radix4: ~20mpps radix4_lockless: ~24.8mpps bsearch4: ~69mpps dpdk_lpm4: ~67 mpps 700k routes: radix4_lockless: 3.3mpps dpdk_lpm4: 46mpps IPv6: 8 routes: radix6_lockless: ~20mpps dpdk_lpm6: ~70mpps 100k routes: radix6_lockless: 13.9mpps dpdk_lpm6: 57mpps Forwarding benchmarks: + 10-15% IPv4 forwarding performance (small-fib, bsearch4) + 25% IPv4 forwarding performance (full-view, dpdk_lpm4) + 20% IPv6 forwarding performance (full-view, dpdk_lpm6) Control: Framwork adds the following runtime sysctls: List algos * net.route.algo.inet.algo_list: bsearch4, radix4_lockless, radix4 * net.route.algo.inet6.algo_list: radix6_lockless, radix6, dpdk_lpm6 Debug level (7=LOG_DEBUG, per-route) net.route.algo.debug_level: 5 Algo selection (currently only for fib 0): net.route.algo.inet.algo: bsearch4 net.route.algo.inet6.algo: radix6_lockless Support for manually changing algos in non-default fib will be added soon. Some sysctl names will be changed in the near future. Differential Revision: https://reviews.freebsd.org/D27401 --- sys/conf/files | 3 + sys/conf/options | 1 + sys/net/route.c | 8 + sys/net/route/fib_algo.c | 1608 ++++++++++++++++++++++++++++++++++++++++++ sys/net/route/fib_algo.h | 109 +++ sys/net/route/route_tables.c | 29 +- sys/net/route/route_var.h | 10 + sys/netinet/in_fib.c | 37 + sys/netinet/in_fib_algo.c | 765 ++++++++++++++++++++ sys/netinet6/in6_fib.c | 35 + sys/netinet6/in6_fib.h | 2 + sys/netinet6/in6_fib_algo.c | 361 ++++++++++ 12 files changed, 2962 insertions(+), 6 deletions(-) diff --git a/sys/conf/files b/sys/conf/files index aa376b0bb9a3..2a71e21ace71 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -4178,6 +4178,7 @@ net/route/nhgrp_ctl.c optional route_mpath net/route/nhop.c standard net/route/nhop_ctl.c standard net/route/nhop_utils.c standard +net/route/fib_algo.c optional fib_algo net/route/route_ctl.c standard net/route/route_ddb.c optional ddb net/route/route_helpers.c standard @@ -4329,6 +4330,7 @@ netinet/in_debug.c optional inet ddb netinet/in_kdtrace.c optional inet | inet6 netinet/ip_carp.c optional inet carp | inet6 carp netinet/in_fib.c optional inet +netinet/in_fib_algo.c optional inet fib_algo netinet/in_gif.c optional gif inet | netgraph_gif inet netinet/ip_gre.c optional gre inet netinet/ip_id.c optional inet @@ -4405,6 +4407,7 @@ netinet6/icmp6.c optional inet6 netinet6/in6.c optional inet6 netinet6/in6_cksum.c optional inet6 netinet6/in6_fib.c optional inet6 +netinet6/in6_fib_algo.c optional inet6 fib_algo netinet6/in6_gif.c optional gif inet6 | netgraph_gif inet6 netinet6/in6_ifattach.c optional inet6 netinet6/in6_jail.c optional inet6 diff --git a/sys/conf/options b/sys/conf/options index 24f984930dc2..68c8a2e0d3ca 100644 --- a/sys/conf/options +++ b/sys/conf/options @@ -454,6 +454,7 @@ PCBGROUP opt_pcbgroup.h PF_DEFAULT_TO_DROP opt_pf.h ROUTE_MPATH opt_route.h ROUTETABLES opt_route.h +FIB_ALGO opt_route.h RSS opt_rss.h SLIP_IFF_OPTS opt_slip.h TCPDEBUG diff --git a/sys/net/route.c b/sys/net/route.c index 6c051e389d82..2f4ae40e83aa 100644 --- a/sys/net/route.c +++ b/sys/net/route.c @@ -151,6 +151,14 @@ void rt_table_destroy(struct rib_head *rh) { + RIB_WLOCK(rh); + rh->rib_dying = true; + RIB_WUNLOCK(rh); + +#ifdef FIB_ALGO + fib_destroy_rib(rh); +#endif + tmproutes_destroy(rh); rn_walktree(&rh->rmhead.head, rt_freeentry, &rh->rmhead.head); diff --git a/sys/net/route/fib_algo.c b/sys/net/route/fib_algo.c new file mode 100644 index 000000000000..afb009d4c8cf --- /dev/null +++ b/sys/net/route/fib_algo.c @@ -0,0 +1,1608 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2020 Alexander V. Chernikov + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); +#include "opt_inet.h" +#include "opt_inet6.h" +#include "opt_route.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#ifdef INET6 +#include +#include +#endif + +#include +#include +#include +#include +#include + +#include + +/* + * Fib lookup framework. + * + * This framework enables accelerated longest-prefix-match lookups for the + * routing tables by adding the ability to dynamically attach/detach lookup + * algorithms implementation to/from the datapath. + * + * flm - fib lookup modules - implementation of particular lookup algorithm + * fd - fib data - instance of an flm bound to specific routing table + * + * This file provides main framework functionality. + * + * The following are the features provided by the framework + * + * 1) nexhops abstraction -> provides transparent referencing, indexing + * and efficient idx->ptr mappings for nexthop and nexthop groups. + * 2) Routing table synchronisation + * 3) dataplane attachment points + * 4) automatic algorithm selection based on the provided preference. + * + * + * DATAPATH + * For each supported address family, there is a an allocated array of fib_dp + * structures, indexed by fib number. Each array entry contains callback function + * and its argument. This function will be called with a family-specific lookup key, + * scope and provided argument. This array gets re-created every time when new algo + * instance gets created. Please take a look at the replace_rtables_family() function + * for more details. + * + */ + +SYSCTL_DECL(_net_route); +SYSCTL_NODE(_net_route, OID_AUTO, algo, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "Fib algorithm lookups"); + +#ifdef INET6 +bool algo_fixed_inet6 = false; +SYSCTL_NODE(_net_route_algo, OID_AUTO, inet6, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "IPv6 longest prefix match lookups"); +#endif +#ifdef INET +bool algo_fixed_inet = false; +SYSCTL_NODE(_net_route_algo, OID_AUTO, inet, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "IPv4 longest prefix match lookups"); +#endif + +struct nhop_ref_table { + uint32_t count; + int32_t refcnt[0]; +}; + +/* + * Data structure for the fib lookup instance tied to the particular rib. + */ +struct fib_data { + uint32_t number_nhops; /* current # of nhops */ + uint8_t hit_nhops; /* true if out of nhop limit */ + uint8_t init_done; /* true if init is competed */ + uint32_t fd_dead:1; /* Scheduled for deletion */ + uint32_t fd_linked:1; /* true if linked */ + uint32_t fd_need_rebuild:1; /* true if rebuild scheduled */ + uint32_t fd_force_eval:1;/* true if rebuild scheduled */ + uint8_t fd_family; /* family */ + uint32_t fd_fibnum; /* fibnum */ + uint32_t fd_failed_rebuilds; /* stat: failed rebuilds */ + uint32_t fd_algo_mask; /* bitmask for algo data */ + struct callout fd_callout; /* rebuild callout */ + void *fd_algo_data; /* algorithm data */ + struct nhop_object **nh_idx; /* nhop idx->ptr array */ + struct nhop_ref_table *nh_ref_table; /* array with # of nhop references */ + struct rib_head *fd_rh; /* RIB table we're attached to */ + struct rib_subscription *fd_rs; /* storing table subscription */ + struct fib_dp fd_dp; /* fib datapath data */ + struct vnet *fd_vnet; /* vnet fib belongs to */ + struct epoch_context fd_epoch_ctx; /* epoch context for deletion */ + struct fib_lookup_module *fd_flm;/* pointer to the lookup module */ + uint32_t fd_num_changes; /* number of changes since last callout */ + TAILQ_ENTRY(fib_data) entries; /* list of all fds in vnet */ +}; + +static void rebuild_fd_callout(void *_data); +static void destroy_fd_instance_epoch(epoch_context_t ctx); +static enum flm_op_result attach_datapath(struct fib_data *fd); +static bool is_idx_free(struct fib_data *fd, uint32_t index); +static void set_algo_fixed(struct rib_head *rh); + +static uint32_t fib_ref_nhop(struct fib_data *fd, struct nhop_object *nh); +static void fib_unref_nhop(struct fib_data *fd, struct nhop_object *nh); + +static struct fib_lookup_module *fib_check_best_algo(struct rib_head *rh, + struct fib_lookup_module *orig_flm); +static void fib_unref_algo(struct fib_lookup_module *flm); +static bool flm_error_check(const struct fib_lookup_module *flm, uint32_t fibnum); + +struct mtx fib_mtx; +#define FIB_MOD_LOCK() mtx_lock(&fib_mtx) +#define FIB_MOD_UNLOCK() mtx_unlock(&fib_mtx) +#define FIB_MOD_LOCK_ASSERT() mtx_assert(&fib_mtx, MA_OWNED) + + +/* Algorithm has to be this percent better than the current to switch */ +#define BEST_DIFF_PERCENT (5 * 256 / 100) +/* Schedule algo re-evaluation X seconds after a change */ +#define ALGO_EVAL_DELAY_MS 30000 +/* Force algo re-evaluation after X changes */ +#define ALGO_EVAL_NUM_ROUTES 100 +/* Try to setup algorithm X times */ +#define FIB_MAX_TRIES 32 +/* Max amount of supported nexthops */ +#define FIB_MAX_NHOPS 262144 +#define FIB_CALLOUT_DELAY_MS 50 + +/* Debug */ +static int flm_debug_level = LOG_NOTICE; +SYSCTL_INT(_net_route_algo, OID_AUTO, debug_level, CTLFLAG_RW | CTLFLAG_RWTUN, + &flm_debug_level, 0, "debuglevel"); +#define FLM_MAX_DEBUG_LEVEL LOG_DEBUG + +#define _PASS_MSG(_l) (flm_debug_level >= (_l)) +#define ALGO_PRINTF(_fmt, ...) printf("[fib_algo] %s: " _fmt "\n", __func__, ##__VA_ARGS__) +#define _ALGO_PRINTF(_fib, _fam, _aname, _func, _fmt, ...) \ + printf("[fib_algo] %s.%u (%s) %s: " _fmt "\n",\ + print_family(_fam), _fib, _aname, _func, ## __VA_ARGS__) +#define _RH_PRINTF(_fib, _fam, _func, _fmt, ...) \ + printf("[fib_algo] %s.%u %s: " _fmt "\n", print_family(_fam), _fib, _func, ## __VA_ARGS__) +#define RH_PRINTF(_l, _rh, _fmt, ...) if (_PASS_MSG(_l)) { \ + _RH_PRINTF(_rh->rib_fibnum, _rh->rib_family, __func__, _fmt, ## __VA_ARGS__);\ +} +#define FD_PRINTF(_l, _fd, _fmt, ...) FD_PRINTF_##_l(_l, _fd, _fmt, ## __VA_ARGS__) +#define _FD_PRINTF(_l, _fd, _fmt, ...) if (_PASS_MSG(_l)) { \ + _ALGO_PRINTF(_fd->fd_fibnum, _fd->fd_family, _fd->fd_flm->flm_name, \ + __func__, _fmt, ## __VA_ARGS__); \ +} +#if FLM_MAX_DEBUG_LEVEL>=LOG_DEBUG +#define FD_PRINTF_LOG_DEBUG _FD_PRINTF +#else +#define FD_PRINTF_LOG_DEBUG() +#endif +#if FLM_MAX_DEBUG_LEVEL>=LOG_INFO +#define FD_PRINTF_LOG_INFO _FD_PRINTF +#else +#define FD_PRINTF_LOG_INFO() +#endif +#define FD_PRINTF_LOG_NOTICE _FD_PRINTF +#define FD_PRINTF_LOG_ERR _FD_PRINTF +#define FD_PRINTF_LOG_WARNING _FD_PRINTF + + +/* List of all registered lookup algorithms */ +static TAILQ_HEAD(, fib_lookup_module) all_algo_list; + +/* List of all fib lookup instances in the vnet */ +VNET_DEFINE_STATIC(TAILQ_HEAD(fib_data_head, fib_data), fib_data_list); +#define V_fib_data_list VNET(fib_data_list) + +/* Datastructure for storing non-transient fib lookup module failures */ +struct fib_error { + int fe_family; + uint32_t fe_fibnum; /* failed rtable */ + struct fib_lookup_module *fe_flm; /* failed module */ + TAILQ_ENTRY(fib_error) entries;/* list of all errored entries */ +}; +VNET_DEFINE_STATIC(TAILQ_HEAD(fib_error_head, fib_error), fib_error_list); +#define V_fib_error_list VNET(fib_error_list) + +/* Per-family array of fibnum -> {func, arg} mappings used in datapath */ +struct fib_dp_header { + struct epoch_context fdh_epoch_ctx; + uint32_t fdh_num_tables; + struct fib_dp fdh_idx[0]; +}; + +/* + * Tries to add new non-transient algorithm error to the list of + * errors. + * Returns true on success. + */ +static bool +flm_error_add(struct fib_lookup_module *flm, uint32_t fibnum) +{ + struct fib_error *fe; + + fe = malloc(sizeof(struct fib_error), M_TEMP, M_NOWAIT | M_ZERO); + if (fe == NULL) + return (false); + fe->fe_flm = flm; + fe->fe_family = flm->flm_family; + fe->fe_fibnum = fibnum; + + FIB_MOD_LOCK(); + /* Avoid duplicates by checking if error already exists first */ + if (flm_error_check(flm, fibnum)) { + FIB_MOD_UNLOCK(); + free(fe, M_TEMP); + return (true); + } + TAILQ_INSERT_HEAD(&V_fib_error_list, fe, entries); + FIB_MOD_UNLOCK(); + + return (true); +} + +/* + * True if non-transient error has been registered for @flm in @fibnum. + */ +static bool +flm_error_check(const struct fib_lookup_module *flm, uint32_t fibnum) +{ + const struct fib_error *fe; + + TAILQ_FOREACH(fe, &V_fib_error_list, entries) { + if ((fe->fe_flm == flm) && (fe->fe_fibnum == fibnum)) + return (true); + } + + return (false); +} + +/* + * Clear all errors of algo specified by @flm. + */ +static void +fib_error_clear_flm(struct fib_lookup_module *flm) +{ + struct fib_error *fe, *fe_tmp; + + FIB_MOD_LOCK_ASSERT(); + + TAILQ_FOREACH_SAFE(fe, &V_fib_error_list, entries, fe_tmp) { + if (fe->fe_flm == flm) { + TAILQ_REMOVE(&V_fib_error_list, fe, entries); + free(fe, M_TEMP); + } + } +} + +/* + * Clears all errors in current VNET. + */ +static void +fib_error_clear() +{ + struct fib_error *fe, *fe_tmp; + + FIB_MOD_LOCK_ASSERT(); + + TAILQ_FOREACH_SAFE(fe, &V_fib_error_list, entries, fe_tmp) { + TAILQ_REMOVE(&V_fib_error_list, fe, entries); + free(fe, M_TEMP); + } +} + +static const char * +print_family(int family) +{ + + if (family == AF_INET) + return ("inet"); + else if (family == AF_INET6) + return ("inet6"); + else + return ("unknown"); +} + +/* + * Debug function used by lookup algorithms. + * Outputs message denoted by @fmt, prepended by "[fib_algo] inetX.Y (algo) " + */ +void +fib_printf(int level, struct fib_data *fd, const char *func, char *fmt, ...) +{ + char buf[128]; + va_list ap; + + if (level > flm_debug_level) + return; + + va_start(ap, fmt); + vsnprintf(buf, sizeof(buf), fmt, ap); + va_end(ap); + + _ALGO_PRINTF(fd->fd_fibnum, fd->fd_family, fd->fd_flm->flm_name, + func, "%s", buf); +} + +/* + * Outputs list of algorithms supported by the provided address family. + */ +static int +print_algos_sysctl(struct sysctl_req *req, int family) +{ + struct fib_lookup_module *flm; + struct sbuf sbuf; + int error, count = 0; + + error = sysctl_wire_old_buffer(req, 0); + if (error == 0) { + sbuf_new_for_sysctl(&sbuf, NULL, 512, req); + TAILQ_FOREACH(flm, &all_algo_list, entries) { + if (flm->flm_family == family) { + if (count++ > 0) + sbuf_cat(&sbuf, ", "); + sbuf_cat(&sbuf, flm->flm_name); + } + } + error = sbuf_finish(&sbuf); + sbuf_delete(&sbuf); + } + return (error); +} + +#ifdef INET6 +static int +print_algos_sysctl_inet6(SYSCTL_HANDLER_ARGS) +{ + + return (print_algos_sysctl(req, AF_INET6)); +} +SYSCTL_PROC(_net_route_algo_inet6, OID_AUTO, algo_list, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0, + print_algos_sysctl_inet6, "A", "List of IPv6 lookup algorithms"); +#endif + +#ifdef INET +static int +print_algos_sysctl_inet(SYSCTL_HANDLER_ARGS) +{ + + return (print_algos_sysctl(req, AF_INET)); +} +SYSCTL_PROC(_net_route_algo_inet, OID_AUTO, algo_list, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0, + print_algos_sysctl_inet, "A", "List of IPv4 lookup algorithms"); +#endif + +/* + * Calculate delay between repeated failures. + * Returns current delay in milliseconds. + */ +static uint32_t +callout_calc_delay_ms(struct fib_data *fd) +{ + uint32_t shift; + + if (fd->fd_failed_rebuilds > 10) + shift = 10; + else + shift = fd->fd_failed_rebuilds; + + return ((1 << shift) * FIB_CALLOUT_DELAY_MS); +} + +static void +schedule_callout(struct fib_data *fd, int delay_ms) +{ + + callout_reset_sbt(&fd->fd_callout, 0, SBT_1MS * delay_ms, + rebuild_fd_callout, fd, 0); +} + +static void +schedule_fd_rebuild(struct fib_data *fd) +{ + + FIB_MOD_LOCK(); + if (!fd->fd_need_rebuild) { + fd->fd_need_rebuild = true; + + /* + * Potentially re-schedules pending callout + * initiated by schedule_algo_eval. + */ + FD_PRINTF(LOG_INFO, fd, "Scheduling rebuilt"); + schedule_callout(fd, callout_calc_delay_ms(fd)); + } + FIB_MOD_UNLOCK(); +} + +static void +schedule_algo_eval(struct fib_data *fd) +{ + + if (fd->fd_num_changes++ == 0) { + /* Start callout to consider switch */ + FIB_MOD_LOCK(); + if (!callout_pending(&fd->fd_callout)) + schedule_callout(fd, ALGO_EVAL_DELAY_MS); + FIB_MOD_UNLOCK(); + } else if (fd->fd_num_changes > ALGO_EVAL_NUM_ROUTES && !fd->fd_force_eval) { + /* Reset callout to exec immediately */ + FIB_MOD_LOCK(); + if (!fd->fd_need_rebuild) { + fd->fd_force_eval = true; + schedule_callout(fd, 1); + } + FIB_MOD_UNLOCK(); + } +} + +/* + * Rib subscription handler. Checks if the algorithm is ready to + * receive updates, handles nexthop refcounting and passes change + * data to the algorithm callback. + */ +static void +handle_rtable_change_cb(struct rib_head *rnh, struct rib_cmd_info *rc, + void *_data) +{ + struct fib_data *fd = (struct fib_data *)_data; + enum flm_op_result result; + + RIB_WLOCK_ASSERT(rnh); + + /* + * There is a small gap between subscribing for route changes + * and initiating rtable dump. Avoid receiving route changes + * prior to finishing rtable dump by checking `init_done`. + */ + if (!fd->init_done) + return; + /* + * If algo requested rebuild, stop sending updates by default. + * This simplifies nexthop refcount handling logic. + */ + if (fd->fd_need_rebuild) + return; + + /* Consider scheduling algorithm re-evaluation */ + schedule_algo_eval(fd); + + /* + * Maintain guarantee that every nexthop returned by the dataplane + * lookup has > 0 refcount, so can be safely referenced within current + * epoch. + */ + if (rc->rc_nh_new != NULL) { + if (fib_ref_nhop(fd, rc->rc_nh_new) == 0) { + /* ran out of indexes */ + schedule_fd_rebuild(fd); + return; + } + } + + result = fd->fd_flm->flm_change_rib_item_cb(rnh, rc, fd->fd_algo_data); + + switch (result) { + case FLM_SUCCESS: + /* Unref old nexthop on success */ + if (rc->rc_nh_old != NULL) + fib_unref_nhop(fd, rc->rc_nh_old); + break; + case FLM_REBUILD: + + /* + * Algo is not able to apply the update. + * Schedule algo rebuild. + */ + schedule_fd_rebuild(fd); + break; + case FLM_ERROR: + + /* + * Algo reported a non-recoverable error. + * Record the error and schedule rebuild, which will + * trigger best algo selection. + */ + FD_PRINTF(LOG_ERR, fd, "algo reported non-recoverable error"); + if (!flm_error_add(fd->fd_flm, fd->fd_fibnum)) + FD_PRINTF(LOG_ERR, fd, "failed to ban algo"); + schedule_fd_rebuild(fd); + } +} + +static void +estimate_nhop_scale(const struct fib_data *old_fd, struct fib_data *fd) +{ + + if (old_fd == NULL) { + // TODO: read from rtable + fd->number_nhops = 16; + return; + } + + if (old_fd->hit_nhops && old_fd->number_nhops < FIB_MAX_NHOPS) + fd->number_nhops = 2 * old_fd->number_nhops; + else + fd->number_nhops = old_fd->number_nhops; +} + +struct walk_cbdata { + struct fib_data *fd; + flm_dump_t *func; + enum flm_op_result result; +}; + +/* + * Handler called after all rtenties have been dumped. + * Performs post-dump framework checks and calls + * algo:flm_dump_end_cb(). + * + * Updates walk_cbdata result. + */ +static void +sync_algo_end_cb(struct rib_head *rnh, enum rib_walk_hook stage, void *_data) +{ + struct walk_cbdata *w = (struct walk_cbdata *)_data; + struct fib_data *fd = w->fd; + + RIB_WLOCK_ASSERT(w->fd->fd_rh); + + if (rnh->rib_dying) { + w->result = FLM_ERROR; + return; + } + + if (stage != RIB_WALK_HOOK_POST || w->result != FLM_SUCCESS) + return; + + /* Post-dump hook, dump successful */ + + if (fd->hit_nhops) { + FD_PRINTF(LOG_INFO, fd, "ran out of nexthops at %u nhops", + fd->nh_ref_table->count); + w->result = FLM_REBUILD; + return; + } + + w->result = fd->fd_flm->flm_dump_end_cb(fd->fd_algo_data, &fd->fd_dp); + + if (w->result == FLM_SUCCESS) { + /* Mark init as done to allow routing updates */ + fd->init_done = 1; + } +} + +/* + * Callback for each entry in rib. + * Calls algo:flm_dump_rib_item_cb func as a part of initial + * route table synchronisation. + */ +static int +sync_algo_cb(struct rtentry *rt, void *_data) +{ + struct walk_cbdata *w = (struct walk_cbdata *)_data; + + RIB_WLOCK_ASSERT(w->fd->fd_rh); + + if (w->result == FLM_SUCCESS && w->func) { + + /* + * Reference nexthops to maintain guarantee that + * each nexthop returned by datapath has > 0 references + * and can be safely referenced within current epoch. + */ + struct nhop_object *nh = rt_get_raw_nhop(rt); + if (fib_ref_nhop(w->fd, nh) != 0) + w->result = w->func(rt, w->fd->fd_algo_data); + else + w->result = FLM_REBUILD; + } + + return (0); +} + +/* + * Dump all routing table state to the algo instance. + */ +static enum flm_op_result +sync_algo(struct fib_data *fd) +{ + struct walk_cbdata w = { + .fd = fd, + .func = fd->fd_flm->flm_dump_rib_item_cb, + .result = FLM_SUCCESS, + }; + + rib_walk_ext_internal(fd->fd_rh, true, sync_algo_cb, sync_algo_end_cb, &w); + + FD_PRINTF(LOG_INFO, fd, "initial dump completed."); + + return (w.result); +} + +/* + * Schedules epoch-backed @fd instance deletion. + * * Unlinks @fd from the list of active algo instances. + * * Removes rib subscription. + * * Stops callout. + * * Schedules actual deletion. + * + * Assume @fd is already unlinked from the datapath. + */ +static int +schedule_destroy_fd_instance(struct fib_data *fd, bool in_callout) +{ + bool is_dead; + + NET_EPOCH_ASSERT(); + + FIB_MOD_LOCK(); + is_dead = fd->fd_dead; + if (!is_dead) + fd->fd_dead = true; + if (fd->fd_linked) { + TAILQ_REMOVE(&V_fib_data_list, fd, entries); + fd->fd_linked = false; + } + FIB_MOD_UNLOCK(); + if (is_dead) + return (0); + + FD_PRINTF(LOG_INFO, fd, "DETACH"); + + if (fd->fd_rs != NULL) + rib_unsibscribe(fd->fd_rs); + + /* + * After rib_unsubscribe() no _new_ handle_rtable_change_cb() calls + * will be executed, hence no _new_ callout schedules will happen. + * + * There can be 2 possible scenarious here: + * 1) we're running inside a callout when we're deleting ourselves + * due to migration to a newer fd + * 2) we're running from rt_table_destroy() and callout is scheduled + * for execution OR is executing + * + * For (2) we need to wait for the callout termination, as the routing table + * will be destroyed after this function returns. + * For (1) we cannot call drain, but can ensure that this is the last invocation. + */ + + if (in_callout) + callout_stop(&fd->fd_callout); + else + callout_drain(&fd->fd_callout); + + FD_PRINTF(LOG_INFO, fd, "destroying old instance"); + epoch_call(net_epoch_preempt, destroy_fd_instance_epoch, + &fd->fd_epoch_ctx); + + return (0); +} + +/* + * Wipe all fd instances from the list matching rib specified by @rh. + * If @keep_first is set, remove all but the first record. + */ +static void +fib_cleanup_algo(struct rib_head *rh, bool keep_first, bool in_callout) +{ + struct fib_data_head tmp_head = TAILQ_HEAD_INITIALIZER(tmp_head); + struct fib_data *fd, *fd_tmp; + struct epoch_tracker et; + + FIB_MOD_LOCK(); + TAILQ_FOREACH_SAFE(fd, &V_fib_data_list, entries, fd_tmp) { + if (fd->fd_rh == rh) { + if (keep_first) { + keep_first = false; + continue; + } + TAILQ_REMOVE(&V_fib_data_list, fd, entries); + fd->fd_linked = false; + TAILQ_INSERT_TAIL(&tmp_head, fd, entries); + } + } + FIB_MOD_UNLOCK(); + + /* Pass 2: remove each entry */ + NET_EPOCH_ENTER(et); + TAILQ_FOREACH_SAFE(fd, &tmp_head, entries, fd_tmp) { + schedule_destroy_fd_instance(fd, in_callout); + } + NET_EPOCH_EXIT(et); +} + +void +fib_destroy_rib(struct rib_head *rh) +{ + + /* + * rnh has `is_dying` flag set, so setup of new fd's will fail at + * sync_algo() stage, preventing new entries to be added to the list + * of active algos. Remove all existing entries for the particular rib. + */ + fib_cleanup_algo(rh, false, false); +} + +/* + * Finalises fd destruction by freeing all fd resources. + */ +static void +destroy_fd_instance(struct fib_data *fd) +{ + + FD_PRINTF(LOG_INFO, fd, "destroy fd %p", fd); + + /* Call destroy callback first */ + if (fd->fd_algo_data != NULL) + fd->fd_flm->flm_destroy_cb(fd->fd_algo_data); + + /* Nhop table */ + if ((fd->nh_idx != NULL) && (fd->nh_ref_table != NULL)) { + for (int i = 0; i < fd->number_nhops; i++) { + if (!is_idx_free(fd, i)) { + FD_PRINTF(LOG_DEBUG, fd, " FREE nhop %d %p", + i, fd->nh_idx[i]); + nhop_free_any(fd->nh_idx[i]); + } + } + free(fd->nh_idx, M_RTABLE); + } + if (fd->nh_ref_table != NULL) + free(fd->nh_ref_table, M_RTABLE); + + fib_unref_algo(fd->fd_flm); + + free(fd, M_RTABLE); +} + +/* + * Epoch callback indicating fd is safe to destroy + */ +static void +destroy_fd_instance_epoch(epoch_context_t ctx) +{ + struct fib_data *fd; + + fd = __containerof(ctx, struct fib_data, fd_epoch_ctx); + + destroy_fd_instance(fd); +} + +/* + * Tries to setup fd instance. + * - Allocates fd/nhop table + * - Runs algo:flm_init_cb algo init + * - Subscribes fd to the rib + * - Runs rtable dump + * - Adds instance to the list of active instances. + * + * Returns: operation result. Fills in @pfd with resulting fd on success. + * + */ +static enum flm_op_result +try_setup_fd_instance(struct fib_lookup_module *flm, struct rib_head *rh, + struct fib_data *old_fd, struct fib_data **pfd) +{ + struct fib_data *fd; + size_t size; + enum flm_op_result result; + *** 2314 LINES SKIPPED *** From owner-dev-commits-src-main@freebsd.org Fri Dec 25 14:53:55 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C37C64C3E97; Fri, 25 Dec 2020 14:53:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D2VM74CjQz3K1S; Fri, 25 Dec 2020 14:53:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7723A24725; Fri, 25 Dec 2020 14:53:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BPErtnH064186; Fri, 25 Dec 2020 14:53:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BPErt4W064185; Fri, 25 Dec 2020 14:53:55 GMT (envelope-from git) Date: Fri, 25 Dec 2020 14:53:55 GMT Message-Id: <202012251453.0BPErt4W064185@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michal Meloun Subject: git: aa76f0c39741 - PMC: remove now orphaned PMC for INTEL XScale processors. Support for XScale architecture has been deleted in FreeBSD 13. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mmel X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: aa76f0c39741527f14562b1823427774b993668c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Dec 2020 14:53:55 -0000 The branch main has been updated by mmel: URL: https://cgit.FreeBSD.org/src/commit/?id=aa76f0c39741527f14562b1823427774b993668c commit aa76f0c39741527f14562b1823427774b993668c Author: Michal Meloun AuthorDate: 2020-12-25 10:41:34 +0000 Commit: Michal Meloun CommitDate: 2020-12-25 14:21:53 +0000 PMC: remove now orphaned PMC for INTEL XScale processors. Support for XScale architecture has been deleted in FreeBSD 13. --- lib/libpmc/Makefile | 1 - lib/libpmc/libpmc.c | 46 +------------ lib/libpmc/pmc.3 | 3 +- lib/libpmc/pmc.xscale.3 | 156 ------------------------------------------- sys/arm/include/pmc_mdep.h | 6 -- sys/dev/hwpmc/hwpmc_xscale.h | 72 -------------------- sys/dev/hwpmc/pmc_events.h | 50 +------------- 7 files changed, 3 insertions(+), 331 deletions(-) diff --git a/lib/libpmc/Makefile b/lib/libpmc/Makefile index 15ea1e2d510c..01554e9b1526 100644 --- a/lib/libpmc/Makefile +++ b/lib/libpmc/Makefile @@ -93,7 +93,6 @@ MAN+= pmc.tsc.3 MAN+= pmc.ucf.3 MAN+= pmc.westmere.3 MAN+= pmc.westmereuc.3 -MAN+= pmc.xscale.3 MLINKS+= \ pmc_allocate.3 pmc_release.3 \ diff --git a/lib/libpmc/libpmc.c b/lib/libpmc/libpmc.c index 2f7142fc5747..512f3957962a 100644 --- a/lib/libpmc/libpmc.c +++ b/lib/libpmc/libpmc.c @@ -59,10 +59,6 @@ static int tsc_allocate_pmc(enum pmc_event _pe, char *_ctrspec, struct pmc_op_pmcallocate *_pmc_config); #endif #if defined(__arm__) -#if defined(__XSCALE__) -static int xscale_allocate_pmc(enum pmc_event _pe, char *_ctrspec, - struct pmc_op_pmcallocate *_pmc_config); -#endif static int armv7_allocate_pmc(enum pmc_event _pe, char *_ctrspec, struct pmc_op_pmcallocate *_pmc_config); #endif @@ -140,7 +136,6 @@ struct pmc_class_descr { PMC_CLASSDEP_TABLE(iaf, IAF); PMC_CLASSDEP_TABLE(k8, K8); -PMC_CLASSDEP_TABLE(xscale, XSCALE); PMC_CLASSDEP_TABLE(armv7, ARMV7); PMC_CLASSDEP_TABLE(armv8, ARMV8); PMC_CLASSDEP_TABLE(beri, BERI); @@ -193,7 +188,6 @@ static const struct pmc_event_descr cortex_a76_event_table[] = } PMC_MDEP_TABLE(k8, K8, PMC_CLASS_SOFT, PMC_CLASS_TSC); -PMC_MDEP_TABLE(xscale, XSCALE, PMC_CLASS_SOFT, PMC_CLASS_XSCALE); PMC_MDEP_TABLE(beri, BERI, PMC_CLASS_SOFT, PMC_CLASS_BERI); PMC_MDEP_TABLE(cortex_a8, ARMV7, PMC_CLASS_SOFT, PMC_CLASS_ARMV7); PMC_MDEP_TABLE(cortex_a9, ARMV7, PMC_CLASS_SOFT, PMC_CLASS_ARMV7); @@ -234,9 +228,6 @@ PMC_CLASS_TABLE_DESC(k8, K8, k8, k8); PMC_CLASS_TABLE_DESC(tsc, TSC, tsc, tsc); #endif #if defined(__arm__) -#if defined(__XSCALE__) -PMC_CLASS_TABLE_DESC(xscale, XSCALE, xscale, xscale); -#endif PMC_CLASS_TABLE_DESC(cortex_a8, ARMV7, cortex_a8, armv7); PMC_CLASS_TABLE_DESC(cortex_a9, ARMV7, cortex_a9, armv7); #endif @@ -770,29 +761,6 @@ soft_allocate_pmc(enum pmc_event pe, char *ctrspec, } #if defined(__arm__) -#if defined(__XSCALE__) - -static struct pmc_event_alias xscale_aliases[] = { - EV_ALIAS("branches", "BRANCH_RETIRED"), - EV_ALIAS("branch-mispredicts", "BRANCH_MISPRED"), - EV_ALIAS("dc-misses", "DC_MISS"), - EV_ALIAS("ic-misses", "IC_MISS"), - EV_ALIAS("instructions", "INSTR_RETIRED"), - EV_ALIAS(NULL, NULL) -}; -static int -xscale_allocate_pmc(enum pmc_event pe, char *ctrspec __unused, - struct pmc_op_pmcallocate *pmc_config __unused) -{ - switch (pe) { - default: - break; - } - - return (0); -} -#endif - static struct pmc_event_alias cortex_a8_aliases[] = { EV_ALIAS("dc-misses", "L1_DCACHE_REFILL"), EV_ALIAS("ic-misses", "L1_ICACHE_REFILL"), @@ -1264,10 +1232,6 @@ pmc_event_names_of_class(enum pmc_class cl, const char ***eventnames, ev = k8_event_table; count = PMC_EVENT_TABLE_SIZE(k8); break; - case PMC_CLASS_XSCALE: - ev = xscale_event_table; - count = PMC_EVENT_TABLE_SIZE(xscale); - break; case PMC_CLASS_ARMV7: switch (cpu_info.pm_cputype) { default: @@ -1521,12 +1485,6 @@ pmc_init(void) PMC_MDEP_INIT(generic); break; #if defined(__arm__) -#if defined(__XSCALE__) - case PMC_CPU_INTEL_XSCALE: - PMC_MDEP_INIT(xscale); - pmc_class_table[n] = &xscale_class_table_descr; - break; -#endif case PMC_CPU_ARMV7_CORTEX_A8: PMC_MDEP_INIT(cortex_a8); pmc_class_table[n] = &cortex_a8_class_table_descr; @@ -1667,9 +1625,7 @@ _pmc_name_of_event(enum pmc_event pe, enum pmc_cputype cpu) if (pe >= PMC_EV_K8_FIRST && pe <= PMC_EV_K8_LAST) { ev = k8_event_table; evfence = k8_event_table + PMC_EVENT_TABLE_SIZE(k8); - } else if (pe >= PMC_EV_XSCALE_FIRST && pe <= PMC_EV_XSCALE_LAST) { - ev = xscale_event_table; - evfence = xscale_event_table + PMC_EVENT_TABLE_SIZE(xscale); + } else if (pe >= PMC_EV_ARMV7_FIRST && pe <= PMC_EV_ARMV7_LAST) { switch (cpu) { case PMC_CPU_ARMV7_CORTEX_A8: diff --git a/lib/libpmc/pmc.3 b/lib/libpmc/pmc.3 index ee9de22d23ce..c70862668980 100644 --- a/lib/libpmc/pmc.3 +++ b/lib/libpmc/pmc.3 @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 6, 2017 +.Dd December 12, 2020 .Dt PMC 3 .Os .Sh NAME @@ -545,7 +545,6 @@ API is .Xr pmc.tsc 3 , .Xr pmc.westmere 3 , .Xr pmc.westmereuc 3 , -.Xr pmc.xscale 3 , .Xr pmc_allocate 3 , .Xr pmc_attach 3 , .Xr pmc_capabilities 3 , diff --git a/lib/libpmc/pmc.xscale.3 b/lib/libpmc/pmc.xscale.3 deleted file mode 100644 index d5766e347173..000000000000 --- a/lib/libpmc/pmc.xscale.3 +++ /dev/null @@ -1,156 +0,0 @@ -.\" Copyright (c) 2009, 2010 Rui Paulo. All rights reserved. -.\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\" notice, this list of conditions and the following disclaimer in the -.\" documentation and/or other materials provided with the distribution. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -.\" SUCH DAMAGE. -.\" -.\" $FreeBSD$ -.\" -.Dd December 23, 2009 -.Dt PMC.XSCALE 3 -.Os -.Sh NAME -.Nm pmc.xscale -.Nd measurement events for -.Tn Intel -.Tn XScale -family CPUs -.Sh LIBRARY -.Lb libpmc -.Sh SYNOPSIS -.In pmc.h -.Sh DESCRIPTION -.Tn Intel XScale -CPUs are ARM CPUs based on the ARMv5e core. -.Pp -Second generation cores have 2 counters, while third generation cores -have 4 counters. -Third generation cores also have an increased number of PMC events. -.Pp -.Tn Intel XScale -PMCs are documented in -.Rs -.%B "3rd Generation Intel XScale Microarchitecture Developer's Manual" -.%D May 2007 -.Re -.Ss Event Specifiers (Programmable PMCs) -.Tn Intel XScale -programmable PMCs support the following events: -.Bl -tag -width indent -.It Li IC_FETCH -External memory fetch due to L1 instruction cache miss. -.It Li IC_MISS -Instruction cache or TLB miss. -.It Li DATA_DEPENDENCY_STALLED -A data dependency stalled -.It Li ITLB_MISS -Instruction TLB miss. -.It Li DTLB_MISS -Data TLB miss. -.It Li BRANCH_RETIRED -Branch instruction retired (executed). -.It Li BRANCH_MISPRED -Branch mispredicted. -.It Li INSTR_RETIRED -Instructions retired (executed). -.It Li DC_FULL_CYCLE -L1 data cache buffer full stall. -Event occurs on every cycle the -condition is present. -.It Li DC_FULL_CONTIG -L1 data cache buffer full stall. -Event occurs once for each contiguous sequence of this type of stall. -.It Li DC_ACCESS -L1 data cache access, not including cache operations. -.It Li DC_MISS -L1 data cache miss, not including cache operations. -.It Li DC_WRITEBACK -L1 data cache write-back. -Occurs for each cache line that's written back from the cache. -.It Li PC_CHANGE -Software changed the program counter. -.It Li BRANCH_RETIRED_ALL -Branch instruction retired (executed). -This event counts all branch instructions, indirect or direct. -.It Li INSTR_CYCLE -Count the number of microarchitecture cycles each instruction requires -to issue. -.It Li CP_STALL -Coprocessor stalled the instruction pipeline. -.It Li PC_CHANGE_ALL -Software changed the program counter (includes exceptions). -.It Li PIPELINE_FLUSH -Pipeline flushes due to mispredictions or exceptions. -.It Li BACKEND_STALL -Backend stalled the instruction pipeline. -.It Li MULTIPLIER_USE -Multiplier used. -.It Li MULTIPLIER_STALLED -Multiplier stalled the instruction pipeline. -.It Li DATA_CACHE_STALLED -Data cache stalled the instruction pipeline. -.It Li L2_CACHE_REQ -L2 cache request, not including cache operations. -.It Li L2_CACHE_MISS -L2 cache miss, not including cache operations. -.It Li ADDRESS_BUS_TRANS -Address bus transaction. -.It Li SELF_ADDRESS_BUS_TRANS -Self initiated address bus transaction. -.It Li DATA_BUS_TRANS -Data bus transaction. -.El -.Ss Event Name Aliases -The following table shows the mapping between the PMC-independent -aliases supported by -.Lb libpmc -and the underlying hardware events used. -.Bl -column "branch-mispredicts" "BRANCH_MISPRED" -.It Em Alias Ta Em Event -.It Li branches Ta Li BRANCH_RETIRED -.It Li branch-mispredicts Ta Li BRANCH_MISPRED -.It Li dc-misses Ta Li DC_MISS -.It Li ic-misses Ta Li IC_MISS -.It Li instructions Ta Li INSTR_RETIRED -.El -.Sh SEE ALSO -.Xr pmc 3 , -.Xr pmc.soft 3 , -.Xr pmc_cpuinfo 3 , -.Xr pmclog 3 , -.Xr hwpmc 4 -.Sh HISTORY -The -.Nm pmc -library first appeared in -.Fx 6.0 . -Intel XScale support first appeared in -.Fx 9.0 . -.Sh AUTHORS -.An -nosplit -The -.Lb libpmc -library was written by -.An Joseph Koshy Aq Mt jkoshy@FreeBSD.org . -.Pp -Intel XScale support was added by -.An Rui Paulo Aq Mt rpaulo@FreeBSD.org . -.Sh CAVEATS -The Intel XScale code does not yet support sampling. diff --git a/sys/arm/include/pmc_mdep.h b/sys/arm/include/pmc_mdep.h index dcae9c8cb2e3..69cb0c84deca 100644 --- a/sys/arm/include/pmc_mdep.h +++ b/sys/arm/include/pmc_mdep.h @@ -31,15 +31,12 @@ #ifndef _MACHINE_PMC_MDEP_H_ #define _MACHINE_PMC_MDEP_H_ -#define PMC_MDEP_CLASS_INDEX_XSCALE 1 #define PMC_MDEP_CLASS_INDEX_ARMV7 1 /* * On the ARM platform we support the following PMCs. * - * XSCALE Intel XScale processors * ARMV7 ARM Cortex-A processors */ -#include #include union pmc_md_op_pmcallocate { @@ -52,7 +49,6 @@ union pmc_md_op_pmcallocate { #ifdef _KERNEL union pmc_md_pmc { - struct pmc_md_xscale_pmc pm_xscale; struct pmc_md_armv7_pmc pm_armv7; }; @@ -80,8 +76,6 @@ union pmc_md_pmc { /* * Prototypes */ -struct pmc_mdep *pmc_xscale_initialize(void); -void pmc_xscale_finalize(struct pmc_mdep *_md); struct pmc_mdep *pmc_armv7_initialize(void); void pmc_armv7_finalize(struct pmc_mdep *_md); #endif /* _KERNEL */ diff --git a/sys/dev/hwpmc/hwpmc_xscale.h b/sys/dev/hwpmc/hwpmc_xscale.h deleted file mode 100644 index 384586451adb..000000000000 --- a/sys/dev/hwpmc/hwpmc_xscale.h +++ /dev/null @@ -1,72 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD - * - * Copyright (c) 2009 Rui Paulo - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -#ifndef _DEV_HWPMC_XSCALE_H_ -#define _DEV_HWPMC_XSCALE_H_ - -#define XSCALE_PMC_CAPS (PMC_CAP_INTERRUPT | PMC_CAP_USER | \ - PMC_CAP_SYSTEM | PMC_CAP_EDGE | \ - PMC_CAP_THRESHOLD | PMC_CAP_READ | \ - PMC_CAP_WRITE | PMC_CAP_INVERT | \ - PMC_CAP_QUALIFIER) - - -#define XSCALE_PMNC_ENABLE 0x01 /* Enable all Counters */ -#define XSCALE_PMNC_PMNRESET 0x02 /* Performance Counter Reset */ -#define XSCALE_PMNC_CCNTRESET 0x04 /* Clock Counter Reset */ -#define XSCALE_PMNC_CCNTDIV 0x08 /* Clock Counter Divider */ - -#define XSCALE_INTEN_CCNT 0x01 /* Enable Clock Counter Int. */ -#define XSCALE_INTEN_PMN0 0x02 /* Enable PMN0 Interrupts */ -#define XSCALE_INTEN_PMN1 0x04 /* Enable PMN1 Interrupts */ -#define XSCALE_INTEN_PMN2 0x08 /* Enable PMN2 Interrupts */ -#define XSCALE_INTEN_PMN3 0x10 /* Enable PMN3 Interrupts */ - -#define XSCALE_EVTSEL_EVT0_MASK 0x000000ff -#define XSCALE_EVTSEL_EVT1_MASK 0x0000ff00 -#define XSCALE_EVTSEL_EVT2_MASK 0x00ff0000 -#define XSCALE_EVTSEL_EVT3_MASK 0xff000000 - -#define XSCALE_FLAG_CCNT_OVERFLOW 0x01 -#define XSCALE_FLAG_PMN0_OVERFLOW 0x02 -#define XSCALE_FLAG_PMN1_OVERFLOW 0x04 -#define XSCALE_FLAG_PMN2_OVERFLOW 0x08 -#define XSCALE_FLAG_PMN3_OVERFLOW 0x10 - -#define XSCALE_RELOAD_COUNT_TO_PERFCTR_VALUE(R) (-(R)) -#define XSCALE_PERFCTR_VALUE_TO_RELOAD_COUNT(P) (-(P)) - -#ifdef _KERNEL -/* MD extension for 'struct pmc' */ -struct pmc_md_xscale_pmc { - uint32_t pm_xscale_evsel; -}; -#endif /* _KERNEL */ -#endif /* _DEV_HWPMC_XSCALE_H_ */ diff --git a/sys/dev/hwpmc/pmc_events.h b/sys/dev/hwpmc/pmc_events.h index fa16dc856b99..df56d728907a 100644 --- a/sys/dev/hwpmc/pmc_events.h +++ b/sys/dev/hwpmc/pmc_events.h @@ -227,52 +227,6 @@ __PMC_EV_ALIAS("unhalted-core-cycles", IAP_ARCH_UNH_COR_CYC) __PMC_EV(UCP, EVENT_0CH_08H_M) \ __PMC_EV(UCP, EVENT_0CH_08H_S) \ -/* - * Intel XScale events from: - * - * Intel XScale Core Developer's Manual - * January, 2004, #27347302 - * - * 3rd Generation Intel XScale Microarchitecture - * Developer's Manual - * May 2007, #31628302 - * - * First 14 events are for 1st and 2nd Generation Intel XScale cores. The - * remaining are available only on 3rd Generation Intel XScale cores. - */ -#define __PMC_EV_XSCALE() \ - __PMC_EV(XSCALE, IC_FETCH) \ - __PMC_EV(XSCALE, IC_MISS) \ - __PMC_EV(XSCALE, DATA_DEPENDENCY_STALLED) \ - __PMC_EV(XSCALE, ITLB_MISS) \ - __PMC_EV(XSCALE, DTLB_MISS) \ - __PMC_EV(XSCALE, BRANCH_RETIRED) \ - __PMC_EV(XSCALE, BRANCH_MISPRED) \ - __PMC_EV(XSCALE, INSTR_RETIRED) \ - __PMC_EV(XSCALE, DC_FULL_CYCLE) \ - __PMC_EV(XSCALE, DC_FULL_CONTIG) \ - __PMC_EV(XSCALE, DC_ACCESS) \ - __PMC_EV(XSCALE, DC_MISS) \ - __PMC_EV(XSCALE, DC_WRITEBACK) \ - __PMC_EV(XSCALE, PC_CHANGE) \ - __PMC_EV(XSCALE, BRANCH_RETIRED_ALL) \ - __PMC_EV(XSCALE, INSTR_CYCLE) \ - __PMC_EV(XSCALE, CP_STALL) \ - __PMC_EV(XSCALE, PC_CHANGE_ALL) \ - __PMC_EV(XSCALE, PIPELINE_FLUSH) \ - __PMC_EV(XSCALE, BACKEND_STALL) \ - __PMC_EV(XSCALE, MULTIPLIER_USE) \ - __PMC_EV(XSCALE, MULTIPLIER_STALLED) \ - __PMC_EV(XSCALE, DATA_CACHE_STALLED) \ - __PMC_EV(XSCALE, L2_CACHE_REQ) \ - __PMC_EV(XSCALE, L2_CACHE_MISS) \ - __PMC_EV(XSCALE, ADDRESS_BUS_TRANS) \ - __PMC_EV(XSCALE, SELF_ADDRESS_BUS_TRANS) \ - __PMC_EV(XSCALE, DATA_BUS_TRANS) - -#define PMC_EV_XSCALE_FIRST PMC_EV_XSCALE_IC_FETCH -#define PMC_EV_XSCALE_LAST PMC_EV_XSCALE_DATA_BUS_TRANS - /* * ARMv7 Events */ @@ -1899,7 +1853,7 @@ __PMC_EV_ALIAS("unhalted-core-cycles", IAP_ARCH_UNH_COR_CYC) * 0x11000 0x0080 INTEL Pentium 4 events * 0x11080 0x0080 INTEL Pentium MMX events * 0x11100 0x0100 INTEL Pentium Pro/P-II/P-III/Pentium-M events - * 0x11200 0x00FF INTEL XScale events + * 0x11200 0x00FF free (was INTEL XScale events) * 0x11300 0x00FF MIPS 24K events * 0x11400 0x00FF Octeon events * 0x11500 0x00FF MIPS 74K events @@ -1921,8 +1875,6 @@ __PMC_EV_ALIAS("unhalted-core-cycles", IAP_ARCH_UNH_COR_CYC) __PMC_EV_K7() \ __PMC_EV_BLOCK(K8, 0x2080) \ __PMC_EV_K8() \ - __PMC_EV_BLOCK(XSCALE, 0x11200) \ - __PMC_EV_XSCALE() \ __PMC_EV_BLOCK(MIPS24K, 0x11300) \ __PMC_EV_MIPS24K() \ __PMC_EV_BLOCK(OCTEON, 0x11400) \ From owner-dev-commits-src-main@freebsd.org Fri Dec 25 15:18:22 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 461D14C4355; Fri, 25 Dec 2020 15:18:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D2VvL14y2z3LCy; Fri, 25 Dec 2020 15:18:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 13DA024AE1; Fri, 25 Dec 2020 15:18:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BPFIMEK086268; Fri, 25 Dec 2020 15:18:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BPFILtF086267; Fri, 25 Dec 2020 15:18:21 GMT (envelope-from git) Date: Fri, 25 Dec 2020 15:18:21 GMT Message-Id: <202012251518.0BPFILtF086267@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Philip Paeps Subject: git: dc505d53dcc1 - contrib/tzdata: import tzdata 2020e MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: philip X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dc505d53dcc15636aea9df8c03298f8c32147fa9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Dec 2020 15:18:22 -0000 The branch main has been updated by philip: URL: https://cgit.FreeBSD.org/src/commit/?id=dc505d53dcc15636aea9df8c03298f8c32147fa9 commit dc505d53dcc15636aea9df8c03298f8c32147fa9 Merge: aa76f0c39741 b239e6979546 Author: Philip Paeps AuthorDate: 2020-12-25 15:16:38 +0000 Commit: Philip Paeps CommitDate: 2020-12-25 15:16:38 +0000 contrib/tzdata: import tzdata 2020e Changes: https://github.com/eggert/tz/blob/2020e/NEWS MFC after: insta-MFC contrib/tzdata/Makefile | 57 ++++++--- contrib/tzdata/NEWS | 46 +++++++ contrib/tzdata/africa | 236 ++++++++++++++++++++++++++++++----- contrib/tzdata/asia | 274 +++++++++++++++++++++++++++++++---------- contrib/tzdata/australasia | 106 ++++++++++++---- contrib/tzdata/backward | 1 + contrib/tzdata/backzone | 6 + contrib/tzdata/etcetera | 11 +- contrib/tzdata/europe | 16 ++- contrib/tzdata/leapseconds | 4 + contrib/tzdata/leapseconds.awk | 4 + contrib/tzdata/northamerica | 202 ++++++++++++++++++++++++++++-- contrib/tzdata/theory.html | 5 +- contrib/tzdata/version | 2 +- contrib/tzdata/zone.tab | 9 +- contrib/tzdata/zone1970.tab | 9 +- 16 files changed, 816 insertions(+), 172 deletions(-) diff --cc contrib/tzdata/Makefile index 40b81d18b0d5,000000000000..5064a190c5a5 mode 100644,000000..100644 --- a/contrib/tzdata/Makefile +++ b/contrib/tzdata/Makefile @@@ -1,1098 -1,0 +1,1127 @@@ +# Make and install tzdb code and data. + +# This file is in the public domain, so clarified as of +# 2009-05-17 by Arthur David Olson. + +# Package name for the code distribution. +PACKAGE= tzcode + +# Version number for the distribution, overridden in the 'tarballs' rule below. +VERSION= unknown + +# Email address for bug reports. +BUGEMAIL= tz@iana.org + +# DATAFORM selects the data format. +# Available formats represent essentially the same data, albeit +# possibly with minor discrepancies that users are not likely to notice. +# To get new features and the best data right away, use: +# DATAFORM= vanguard +# To wait a while before using new features, to give downstream users +# time to upgrade zic (the default), use: +# DATAFORM= main +# To wait even longer for new features, use: +# DATAFORM= rearguard +# Rearguard users might also want "ZFLAGS = -b fat"; see below. +DATAFORM= main + +# Change the line below for your timezone (after finding the one you want in +# one of the $(TDATA) source files, or adding it to a source file). +# Alternatively, if you discover you've got the wrong timezone, you can just +# 'zic -l -' to remove it, or 'zic -l rightzone' to change it. +# Use the command +# make zonenames +# to get a list of the values you can use for LOCALTIME. + +LOCALTIME= GMT + +# The POSIXRULES macro controls interpretation of nonstandard and obsolete +# POSIX-like TZ settings like TZ='EET-2EEST' that lack DST transition rules. +# Such a setting uses the rules in a template file to determine +# "spring forward" and "fall back" days and times; the environment +# variable itself specifies UT offsets of standard and daylight saving time. +# +# If POSIXRULES is '-', no template is installed; this is the default. +# +# Any other value for POSIXRULES is obsolete and should not be relied on, as: +# * It does not work correctly in popular implementations such as GNU/Linux. +# * It does not work in the tzdb implementation for timestamps after 2037. +# * It is incompatible with 'zic -b slim' if POSIXRULES specifies transitions +# at standard time or UT rather than at local time. +# In short, software should avoid ruleless settings like TZ='EET-2EEST' +# and so should not depend on the value of POSIXRULES. +# +# If, despite the above, you want a template for handling these settings, +# you can change the line below (after finding the timezone you want in the +# one of the $(TDATA) source files, or adding it to a source file). +# Alternatively, if you discover you've got the wrong timezone, you can just +# 'zic -p -' to remove it, or 'zic -p rightzone' to change it. +# Use the command +# make zonenames +# to get a list of the values you can use for POSIXRULES. + +POSIXRULES= - + +# Also see TZDEFRULESTRING below, which takes effect only +# if the time zone files cannot be accessed. + + +# Installation locations. +# +# The defaults are suitable for Debian, except that if REDO is +# posix_right or right_posix then files that Debian puts under +# /usr/share/zoneinfo/posix and /usr/share/zoneinfo/right are instead +# put under /usr/share/zoneinfo-posix and /usr/share/zoneinfo-leaps, +# respectively. Problems with the Debian approach are discussed in +# the commentary for the right_posix rule (below). + +# Destination directory, which can be used for staging. +# 'make DESTDIR=/stage install' installs under /stage (e.g., to +# /stage/etc/localtime instead of to /etc/localtime). Files under +# /stage are not intended to work as-is, but can be copied by hand to +# the root directory later. If DESTDIR is empty, 'make install' does +# not stage, but installs directly into production locations. +DESTDIR = + +# Everything is installed into subdirectories of TOPDIR, and used there. +# TOPDIR should be empty (meaning the root directory), +# or a directory name that does not end in "/". +# TOPDIR should be empty or an absolute name unless you're just testing. +TOPDIR = + +# The default local timezone is taken from the file TZDEFAULT. +TZDEFAULT = $(TOPDIR)/etc/localtime + +# The subdirectory containing installed program and data files, and +# likewise for installed files that can be shared among architectures. +# These should be relative file names. +USRDIR = usr +USRSHAREDIR = $(USRDIR)/share + +# "Compiled" timezone information is placed in the "TZDIR" directory +# (and subdirectories). +# TZDIR_BASENAME should not contain "/" and should not be ".", ".." or empty. +TZDIR_BASENAME= zoneinfo +TZDIR = $(TOPDIR)/$(USRSHAREDIR)/$(TZDIR_BASENAME) + +# The "tzselect" and (if you do "make INSTALL") "date" commands go in: +BINDIR = $(TOPDIR)/$(USRDIR)/bin + +# The "zdump" command goes in: +ZDUMPDIR = $(BINDIR) + +# The "zic" command goes in: +ZICDIR = $(TOPDIR)/$(USRDIR)/sbin + +# Manual pages go in subdirectories of. . . +MANDIR = $(TOPDIR)/$(USRSHAREDIR)/man + +# Library functions are put in an archive in LIBDIR. +LIBDIR = $(TOPDIR)/$(USRDIR)/lib + + +# Types to try, as an alternative to time_t. +TIME_T_ALTERNATIVES = $(TIME_T_ALTERNATIVES_HEAD) $(TIME_T_ALTERNATIVES_TAIL) +TIME_T_ALTERNATIVES_HEAD = int64_t +TIME_T_ALTERNATIVES_TAIL = int32_t uint32_t uint64_t + +# What kind of TZif data files to generate. (TZif is the binary time +# zone data format that zic generates; see Internet RFC 8536.) +# If you want only POSIX time, with time values interpreted as +# seconds since the epoch (not counting leap seconds), use +# REDO= posix_only +# below. If you want only "right" time, with values interpreted +# as seconds since the epoch (counting leap seconds), use +# REDO= right_only +# below. If you want both sets of data available, with leap seconds not +# counted normally, use +# REDO= posix_right +# below. If you want both sets of data available, with leap seconds counted +# normally, use +# REDO= right_posix +# below. POSIX mandates that leap seconds not be counted; for compatibility +# with it, use "posix_only" or "posix_right". Use POSIX time on systems with +# leap smearing; this can work better than unsmeared "right" time with +# applications that are not leap second aware, and is closer to unsmeared +# "right" time than unsmeared POSIX time is (e.g., 0.5 vs 1.0 s max error). + +REDO= posix_right + +# Whether to put an "Expires" line in the leapseconds file. +# Use EXPIRES_LINE=1 to put the line in, 0 to omit it. +# The EXPIRES_LINE value matters only if REDO's value contains "right". +# If you change EXPIRES_LINE, remove the leapseconds file before running "make". +# zic's support for the Expires line was introduced in tzdb 2020a, +# and EXPIRES_LINE defaults to 0 for now so that the leapseconds file +# can be given to older zic implementations. +EXPIRES_LINE= 0 + +# To install data in text form that has all the information of the TZif data, +# (optionally incorporating leap second information), use +# TZDATA_TEXT= tzdata.zi leapseconds +# To install text data without leap second information (e.g., because +# REDO='posix_only'), use +# TZDATA_TEXT= tzdata.zi +# To avoid installing text data, use +# TZDATA_TEXT= + +TZDATA_TEXT= leapseconds tzdata.zi + +# For backward-compatibility links for old zone names, use +# BACKWARD= backward +# To omit these links, use +# BACKWARD= + +BACKWARD= backward + +# If you want out-of-scope and often-wrong data from the file 'backzone', use +# PACKRATDATA= backzone +# To omit this data, use +# PACKRATDATA= + +PACKRATDATA= + +# The name of a locale using the UTF-8 encoding, used during self-tests. +# The tests are skipped if the name does not appear to work on this system. + +UTF8_LOCALE= en_US.utf8 + +# Non-default libraries needed to link. +LDLIBS= + +# Add the following to the end of the "CFLAGS=" line as needed to override +# defaults specified in the source code. "-DFOO" is equivalent to "-DFOO=1". +# -DDEPRECATE_TWO_DIGIT_YEARS for optional runtime warnings about strftime +# formats that generate only the last two digits of year numbers +# -DEPOCH_LOCAL if the 'time' function returns local time not UT +# -DEPOCH_OFFSET=N if the 'time' function returns a value N greater +# than what POSIX specifies, assuming local time is UT. +# For example, N is 252460800 on AmigaOS. +# -DHAVE_DECL_ASCTIME_R=0 if does not declare asctime_r +# -DHAVE_DECL_ENVIRON if declares 'environ' +# -DHAVE_DIRECT_H if mkdir needs (MS-Windows) +# -DHAVE_GENERIC=0 if _Generic does not work +# -DHAVE_GETTEXT if 'gettext' works (e.g., GNU/Linux, FreeBSD, Solaris) +# -DHAVE_INCOMPATIBLE_CTIME_R if your system's time.h declares +# ctime_r and asctime_r incompatibly with the POSIX standard +# (Solaris when _POSIX_PTHREAD_SEMANTICS is not defined). +# -DHAVE_INTTYPES_H if you have a non-C99 compiler with +# -DHAVE_LINK=0 if your system lacks a link function +# -DHAVE_LOCALTIME_R=0 if your system lacks a localtime_r function +# -DHAVE_LOCALTIME_RZ=0 if you do not want zdump to use localtime_rz +# localtime_rz can make zdump significantly faster, but is nonstandard. +# -DHAVE_POSIX_DECLS=0 if your system's include files do not declare +# functions like 'link' or variables like 'tzname' required by POSIX +# -DHAVE_SNPRINTF=0 if your system lacks the snprintf function +# -DHAVE_STDBOOL_H if you have a non-C99 compiler with +# -DHAVE_STDINT_H if you have a non-C99 compiler with +# -DHAVE_STRFTIME_L if declares locale_t and strftime_l +# -DHAVE_STRDUP=0 if your system lacks the strdup function +# -DHAVE_STRTOLL=0 if your system lacks the strtoll function +# -DHAVE_SYMLINK=0 if your system lacks the symlink function +# -DHAVE_SYS_STAT_H=0 if your compiler lacks a +# -DHAVE_SYS_WAIT_H=0 if your compiler lacks a +# -DHAVE_TZSET=0 if your system lacks a tzset function +# -DHAVE_UNISTD_H=0 if your compiler lacks a +# -Dlocale_t=XXX if your system uses XXX instead of locale_t +# -DRESERVE_STD_EXT_IDS if your platform reserves standard identifiers +# with external linkage, e.g., applications cannot define 'localtime'. +# -Dssize_t=long on hosts like MS-Windows that lack ssize_t +# -DSUPPRESS_TZDIR to not prepend TZDIR to file names; this has +# security implications and is not recommended for general use +# -DTHREAD_SAFE to make localtime.c thread-safe, as POSIX requires; +# not needed by the main-program tz code, which is single-threaded. +# Append other compiler flags as needed, e.g., -pthread on GNU/Linux. +# -Dtime_tz=\"T\" to use T as the time_t type, rather than the system time_t +# This is intended for internal use only; it mangles external names. +# -DTZ_DOMAIN=\"foo\" to use "foo" for gettext domain name; default is "tz" +# -DTZ_DOMAINDIR=\"/path\" to use "/path" for gettext directory; +# the default is system-supplied, typically "/usr/lib/locale" +# -DTZDEFRULESTRING=\",date/time,date/time\" to default to the specified +# DST transitions if the time zone files cannot be accessed +# -DUNINIT_TRAP if reading uninitialized storage can cause problems +# other than simply getting garbage data +# -DUSE_LTZ=0 to build zdump with the system time zone library +# Also set TZDOBJS=zdump.o and CHECK_TIME_T_ALTERNATIVES= below. +# -DZIC_BLOAT_DEFAULT=\"fat\" to default zic's -b option to "fat", and +# similarly for "slim". Fat TZif files work around incompatibilities +# and bugs in some TZif readers, notably readers that mishandle 64-bit +# data in TZif files. Slim TZif files are more efficient and do not +# work around these incompatibilities and bugs. If not given, the +# default is "slim". +# -DZIC_MAX_ABBR_LEN_WO_WARN=3 +# (or some other number) to set the maximum time zone abbreviation length +# that zic will accept without a warning (the default is 6) +# $(GCC_DEBUG_FLAGS) if you are using recent GCC and want lots of checking +# Select instrumentation via "make GCC_INSTRUMENT='whatever'". +GCC_INSTRUMENT = \ + -fsanitize=undefined -fsanitize-address-use-after-scope \ + -fsanitize-undefined-trap-on-error -fstack-protector +GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 -fno-common \ + $(GCC_INSTRUMENT) \ + -Wall -Wextra \ + -Walloc-size-larger-than=100000 -Warray-bounds=2 \ + -Wbad-function-cast -Wcast-align=strict -Wdate-time \ + -Wdeclaration-after-statement -Wdouble-promotion \ + -Wformat=2 -Wformat-overflow=2 -Wformat-signedness -Wformat-truncation \ + -Winit-self -Wjump-misses-init -Wlogical-op \ + -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ + -Wold-style-definition -Woverlength-strings -Wpointer-arith \ + -Wshadow -Wshift-overflow=2 -Wstrict-prototypes -Wstringop-overflow=4 \ + -Wstringop-truncation -Wsuggest-attribute=cold \ + -Wsuggest-attribute=const -Wsuggest-attribute=format \ + -Wsuggest-attribute=malloc \ + -Wsuggest-attribute=noreturn -Wsuggest-attribute=pure \ + -Wtrampolines -Wundef -Wuninitialized -Wunused \ + -Wvariadic-macros -Wvla -Wwrite-strings \ + -Wno-address -Wno-format-nonliteral -Wno-sign-compare \ + -Wno-type-limits -Wno-unused-parameter +# +# If your system has a "GMT offset" field in its "struct tm"s +# (or if you decide to add such a field in your system's "time.h" file), +# add the name to a define such as +# -DTM_GMTOFF=tm_gmtoff +# to the end of the "CFLAGS=" line. If not defined, the code attempts to +# guess TM_GMTOFF from other macros; define NO_TM_GMTOFF to suppress this. +# Similarly, if your system has a "zone abbreviation" field, define +# -DTM_ZONE=tm_zone +# and define NO_TM_ZONE to suppress any guessing. These two fields are not +# required by POSIX, but are widely available on GNU/Linux and BSD systems. +# +# The next batch of options control support for external variables +# exported by tzcode. In practice these variables are less useful +# than TM_GMTOFF and TM_ZONE. However, most of them are standardized. +# # +# # To omit or support the external variable "tzname", add one of: +# # -DHAVE_TZNAME=0 # do not support "tzname" +# # -DHAVE_TZNAME=1 # support "tzname", which is defined by system library +# # -DHAVE_TZNAME=2 # support and define "tzname" +# # to the "CFLAGS=" line. "tzname" is required by POSIX 1988 and later. +# # If not defined, the code attempts to guess HAVE_TZNAME from other macros. +# # Warning: unless time_tz is also defined, HAVE_TZNAME=1 can cause +# # crashes when combined with some platforms' standard libraries, +# # presumably due to memory allocation issues. +# # +# # To omit or support the external variables "timezone" and "daylight", add +# # -DUSG_COMPAT=0 # do not support +# # -DUSG_COMPAT=1 # support, and variables are defined by system library +# # -DUSG_COMPAT=2 # support and define variables +# # to the "CFLAGS=" line; "timezone" and "daylight" are inspired by +# # Unix Systems Group code and are required by POSIX 2008 (with XSI) and later. +# # If not defined, the code attempts to guess USG_COMPAT from other macros. +# # +# # To support the external variable "altzone", add +# # -DALTZONE=0 # do not support +# # -DALTZONE=1 # support "altzone", which is defined by system library +# # -DALTZONE=2 # support and define "altzone" +# # to the end of the "CFLAGS=" line; although "altzone" appeared in +# # System V Release 3.1 it has not been standardized. +# # If not defined, the code attempts to guess ALTZONE from other macros. +# +# If you want functions that were inspired by early versions of X3J11's work, +# add +# -DSTD_INSPIRED +# to the end of the "CFLAGS=" line. This arranges for the functions +# "offtime", "timelocal", "timegm", "timeoff", +# "posix2time", and "time2posix" to be added to the time conversion library. +# "offtime" is like "gmtime" except that it accepts a second (long) argument +# that gives an offset to add to the time_t when converting it. +# "timelocal" is equivalent to "mktime". +# "timegm" is like "timelocal" except that it turns a struct tm into +# a time_t using UT (rather than local time as "timelocal" does). +# "timeoff" is like "timegm" except that it accepts a second (long) argument +# that gives an offset to use when converting to a time_t. +# "posix2time" and "time2posix" are described in an included manual page. +# X3J11's work does not describe any of these functions. +# These functions may well disappear in future releases of the time +# conversion package. +# +# If you don't want functions that were inspired by NetBSD, add +# -DNETBSD_INSPIRED=0 +# to the end of the "CFLAGS=" line. Otherwise, the functions +# "localtime_rz", "mktime_z", "tzalloc", and "tzfree" are added to the +# time library, and if STD_INSPIRED is also defined the functions +# "posix2time_z" and "time2posix_z" are added as well. +# The functions ending in "_z" (or "_rz") are like their unsuffixed +# (or suffixed-by-"_r") counterparts, except with an extra first +# argument of opaque type timezone_t that specifies the timezone. +# "tzalloc" allocates a timezone_t value, and "tzfree" frees it. +# +# If you want to allocate state structures in localtime, add +# -DALL_STATE +# to the end of the "CFLAGS=" line. Storage is obtained by calling malloc. +# +# NIST-PCTS:151-2, Version 1.4, (1993-12-03) is a test suite put +# out by the National Institute of Standards and Technology +# which claims to test C and Posix conformance. If you want to pass PCTS, add +# -DPCTS +# to the end of the "CFLAGS=" line. +# +# If you want strict compliance with XPG4 as of 1994-04-09, add +# -DXPG4_1994_04_09 +# to the end of the "CFLAGS=" line. This causes "strftime" to always return +# 53 as a week number (rather than 52 or 53) for January days before +# January's first Monday when a "%V" format is used and January 1 +# falls on a Friday, Saturday, or Sunday. + +CFLAGS= + +# Linker flags. Default to $(LFLAGS) for backwards compatibility +# to release 2012h and earlier. + +LDFLAGS= $(LFLAGS) + +# For leap seconds, this Makefile uses LEAPSECONDS='-L leapseconds' in +# submake command lines. The default is no leap seconds. + +LEAPSECONDS= + +# The zic command and its arguments. + +zic= ./zic +ZIC= $(zic) $(ZFLAGS) + +# To shrink the size of installed TZif files, +# append "-r @N" to omit data before N-seconds-after-the-Epoch. +# To grow the files and work around older application bugs, append "-b fat"; +# see ZIC_BLOAT_DEFAULT above. +# See the zic man page for more about -b and -r. +ZFLAGS= + +# How to use zic to install TZif files. + +ZIC_INSTALL= $(ZIC) -d '$(DESTDIR)$(TZDIR)' $(LEAPSECONDS) + +# The name of a Posix-compliant 'awk' on your system. +# Older 'mawk' versions, such as the 'mawk' in Ubuntu 16.04, might dump core; +# on Ubuntu you can work around this with +# AWK= gawk +AWK= awk + +# The full path name of a Posix-compliant shell, preferably one that supports +# the Korn shell's 'select' statement as an extension. +# These days, Bash is the most popular. +# It should be OK to set this to /bin/sh, on platforms where /bin/sh +# lacks 'select' or doesn't completely conform to Posix, but /bin/bash +# is typically nicer if it works. +KSHELL= /bin/bash + +# Name of curl , used for HTML validation. +CURL= curl + +# Name of GNU Privacy Guard , used to sign distributions. +GPG= gpg + +# This expensive test requires USE_LTZ. +# To suppress it, define this macro to be empty. +CHECK_TIME_T_ALTERNATIVES = check_time_t_alternatives + +# SAFE_CHAR is a regular expression that matches a safe character. +# Some parts of this distribution are limited to safe characters; +# others can use any UTF-8 character. +# For now, the safe characters are a safe subset of ASCII. +# The caller must set the shell variable 'sharp' to the character '#', +# since Makefile macros cannot contain '#'. +# TAB_CHAR is a single tab character, in single quotes. +TAB_CHAR= ' ' +SAFE_CHARSET1= $(TAB_CHAR)' !\"'$$sharp'$$%&'\''()*+,./0123456789:;<=>?@' +SAFE_CHARSET2= 'ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\^_`' +SAFE_CHARSET3= 'abcdefghijklmnopqrstuvwxyz{|}~' +SAFE_CHARSET= $(SAFE_CHARSET1)$(SAFE_CHARSET2)$(SAFE_CHARSET3) +SAFE_CHAR= '[]'$(SAFE_CHARSET)'-]' + +# These characters are Latin-1, and so are likely to be displayable +# even in editors with limited character sets. +UNUSUAL_OK_LATIN_1 = «°±»½¾× +# This IPA symbol is represented in Unicode as the composition of +# U+0075 and U+032F, and U+032F is not considered alphabetic by some +# grep implementations that do not grok composition. +UNUSUAL_OK_IPA = u̯ +# Non-ASCII non-letters that OK_CHAR allows, as these characters are +# useful in commentary. +UNUSUAL_OK_CHARSET= $(UNUSUAL_OK_LATIN_1)$(UNUSUAL_OK_IPA) + +# OK_CHAR matches any character allowed in the distributed files. +# This is the same as SAFE_CHAR, except that UNUSUAL_OK_CHARSET and +# multibyte letters are also allowed so that commentary can contain a +# few safe symbols and people's names and can quote non-English sources. +# Other non-letters are limited to ASCII renderings for the +# convenience of maintainers using XEmacs 21.5.34, which by default +# mishandles Unicode characters U+0100 and greater. +OK_CHAR= '[][:alpha:]$(UNUSUAL_OK_CHARSET)'$(SAFE_CHARSET)'-]' + +# SAFE_LINE matches a line of safe characters. +# SAFE_SHARP_LINE is similar, except any OK character can follow '#'; +# this is so that comments can contain non-ASCII characters. +# OK_LINE matches a line of OK characters. +SAFE_LINE= '^'$(SAFE_CHAR)'*$$' +SAFE_SHARP_LINE='^'$(SAFE_CHAR)'*('$$sharp$(OK_CHAR)'*)?$$' +OK_LINE= '^'$(OK_CHAR)'*$$' + +# Flags to give 'tar' when making a distribution. +# Try to use flags appropriate for GNU tar. +GNUTARFLAGS= --numeric-owner --owner=0 --group=0 --mode=go+u,go-w --sort=name +TARFLAGS= `if tar $(GNUTARFLAGS) --version >/dev/null 2>&1; \ + then echo $(GNUTARFLAGS); \ + else :; \ + fi` + +# Flags to give 'gzip' when making a distribution. +GZIPFLAGS= -9n + +############################################################################### + +#MAKE= make + +cc= cc +CC= $(cc) -DTZDIR='"$(TZDIR)"' + +AR= ar + +# ':' on typical hosts; 'ranlib' on the ancient hosts that still need ranlib. +RANLIB= : + +TZCOBJS= zic.o +TZDOBJS= zdump.o localtime.o asctime.o strftime.o +DATEOBJS= date.o localtime.o strftime.o asctime.o +LIBSRCS= localtime.c asctime.c difftime.c strftime.c +LIBOBJS= localtime.o asctime.o difftime.o strftime.o +HEADERS= tzfile.h private.h +NONLIBSRCS= zic.c zdump.c +NEWUCBSRCS= date.c +SOURCES= $(HEADERS) $(LIBSRCS) $(NONLIBSRCS) $(NEWUCBSRCS) \ + tzselect.ksh workman.sh +MANS= newctime.3 newstrftime.3 newtzset.3 time2posix.3 \ + tzfile.5 tzselect.8 zic.8 zdump.8 +MANTXTS= newctime.3.txt newstrftime.3.txt newtzset.3.txt \ + time2posix.3.txt \ + tzfile.5.txt tzselect.8.txt zic.8.txt zdump.8.txt \ + date.1.txt +COMMON= calendars CONTRIBUTING LICENSE Makefile \ + NEWS README theory.html version +WEB_PAGES= tz-art.html tz-how-to.html tz-link.html +CHECK_WEB_PAGES=check_theory.html check_tz-art.html \ + check_tz-how-to.html check_tz-link.html +DOCS= $(MANS) date.1 $(MANTXTS) $(WEB_PAGES) +PRIMARY_YDATA= africa antarctica asia australasia \ + europe northamerica southamerica +YDATA= $(PRIMARY_YDATA) etcetera +NDATA= factory +TDATA_TO_CHECK= $(YDATA) $(NDATA) backward +TDATA= $(YDATA) $(NDATA) $(BACKWARD) +ZONETABLES= zone1970.tab zone.tab +TABDATA= iso3166.tab $(TZDATA_TEXT) $(ZONETABLES) +LEAP_DEPS= leapseconds.awk leap-seconds.list +TZDATA_ZI_DEPS= ziguard.awk zishrink.awk version $(TDATA) $(PACKRATDATA) +DSTDATA_ZI_DEPS= ziguard.awk $(TDATA) $(PACKRATDATA) +DATA= $(TDATA_TO_CHECK) backzone iso3166.tab leap-seconds.list \ + leapseconds $(ZONETABLES) +AWK_SCRIPTS= checklinks.awk checktab.awk leapseconds.awk \ + ziguard.awk zishrink.awk +MISC= $(AWK_SCRIPTS) zoneinfo2tdf.pl +TZS_YEAR= 2050 +TZS_CUTOFF_FLAG= -c $(TZS_YEAR) +TZS= to$(TZS_YEAR).tzs +TZS_NEW= to$(TZS_YEAR)new.tzs +TZS_DEPS= $(PRIMARY_YDATA) asctime.c localtime.c \ + private.h tzfile.h zdump.c zic.c +# EIGHT_YARDS is just a yard short of the whole ENCHILADA. +EIGHT_YARDS = $(COMMON) $(DOCS) $(SOURCES) $(DATA) $(MISC) tzdata.zi +ENCHILADA = $(EIGHT_YARDS) $(TZS) + +# Consult these files when deciding whether to rebuild the 'version' file. +# This list is not the same as the output of 'git ls-files', since +# .gitignore is not distributed. +VERSION_DEPS= \ + calendars CONTRIBUTING LICENSE Makefile NEWS README \ + africa antarctica asctime.c asia australasia \ + backward backzone \ + checklinks.awk checktab.awk \ + date.1 date.c difftime.c \ + etcetera europe factory iso3166.tab \ + leap-seconds.list leapseconds.awk localtime.c \ + newctime.3 newstrftime.3 newtzset.3 northamerica \ + private.h southamerica strftime.c theory.html \ + time2posix.3 tz-art.html tz-how-to.html tz-link.html \ + tzfile.5 tzfile.h tzselect.8 tzselect.ksh \ + workman.sh zdump.8 zdump.c zic.8 zic.c \ + ziguard.awk zishrink.awk \ + zone.tab zone1970.tab zoneinfo2tdf.pl + +# And for the benefit of csh users on systems that assume the user +# shell should be used to handle commands in Makefiles. . . + +SHELL= /bin/sh + +all: tzselect zic zdump libtz.a $(TABDATA) \ + vanguard.zi main.zi rearguard.zi + +ALL: all date $(ENCHILADA) + +install: all $(DATA) $(REDO) $(MANS) + mkdir -p '$(DESTDIR)$(BINDIR)' \ + '$(DESTDIR)$(ZDUMPDIR)' '$(DESTDIR)$(ZICDIR)' \ + '$(DESTDIR)$(LIBDIR)' \ + '$(DESTDIR)$(MANDIR)/man3' '$(DESTDIR)$(MANDIR)/man5' \ + '$(DESTDIR)$(MANDIR)/man8' + $(ZIC_INSTALL) -l $(LOCALTIME) \ + `case '$(POSIXRULES)' in ?*) echo '-p';; esac \ + ` $(POSIXRULES) \ + -t '$(DESTDIR)$(TZDEFAULT)' + cp -f $(TABDATA) '$(DESTDIR)$(TZDIR)/.' + cp tzselect '$(DESTDIR)$(BINDIR)/.' + cp zdump '$(DESTDIR)$(ZDUMPDIR)/.' + cp zic '$(DESTDIR)$(ZICDIR)/.' + cp libtz.a '$(DESTDIR)$(LIBDIR)/.' + $(RANLIB) '$(DESTDIR)$(LIBDIR)/libtz.a' + cp -f newctime.3 newtzset.3 '$(DESTDIR)$(MANDIR)/man3/.' + cp -f tzfile.5 '$(DESTDIR)$(MANDIR)/man5/.' + cp -f tzselect.8 zdump.8 zic.8 '$(DESTDIR)$(MANDIR)/man8/.' + +INSTALL: ALL install date.1 + mkdir -p '$(DESTDIR)$(BINDIR)' '$(DESTDIR)$(MANDIR)/man1' + cp date '$(DESTDIR)$(BINDIR)/.' + cp -f date.1 '$(DESTDIR)$(MANDIR)/man1/.' + ++# Calculate version number from git, if available. ++# Otherwise, use $(VERSION) unless it is "unknown" and there is already ++# a 'version' file, in which case reuse the existing 'version' contents ++# and append "-dirty" if the contents do not already end in "-dirty". +version: $(VERSION_DEPS) + { (type git) >/dev/null 2>&1 && \ + V=`git describe --match '[0-9][0-9][0-9][0-9][a-z]*' \ + --abbrev=7 --dirty` || \ - V='$(VERSION)'; } && \ ++ if test '$(VERSION)' = unknown && V=`cat $@`; then \ ++ case $$V in *-dirty);; *) V=$$V-dirty;; esac; \ ++ else \ ++ V='$(VERSION)'; \ ++ fi; } && \ + printf '%s\n' "$$V" >$@.out + mv $@.out $@ + +# These files can be tailored by setting BACKWARD and PACKRATDATA. +vanguard.zi main.zi rearguard.zi: $(DSTDATA_ZI_DEPS) + $(AWK) -v DATAFORM=`expr $@ : '\(.*\).zi'` -f ziguard.awk \ + $(TDATA) $(PACKRATDATA) >$@.out + mv $@.out $@ +# This file has a version comment that attempts to capture any tailoring +# via BACKWARD, DATAFORM, PACKRATDATA, and REDO. +tzdata.zi: $(DATAFORM).zi version zishrink.awk + version=`sed 1q version` && \ + LC_ALL=C $(AWK) \ + -v dataform='$(DATAFORM)' \ + -v deps='$(DSTDATA_ZI_DEPS) zishrink.awk' \ + -v redo='$(REDO)' \ + -v version="$$version" \ + -f zishrink.awk \ + $(DATAFORM).zi >$@.out + mv $@.out $@ + +version.h: version + VERSION=`cat version` && printf '%s\n' \ + 'static char const PKGVERSION[]="($(PACKAGE)) ";' \ + "static char const TZVERSION[]=\"$$VERSION\";" \ + 'static char const REPORT_BUGS_TO[]="$(BUGEMAIL)";' \ + >$@.out + mv $@.out $@ + +zdump: $(TZDOBJS) + $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(TZDOBJS) $(LDLIBS) + +zic: $(TZCOBJS) + $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(TZCOBJS) $(LDLIBS) + +leapseconds: $(LEAP_DEPS) + $(AWK) -v EXPIRES_LINE=$(EXPIRES_LINE) \ + -f leapseconds.awk leap-seconds.list >$@.out + mv $@.out $@ + +# Arguments to pass to submakes of install_data. +# They can be overridden by later submake arguments. +INSTALLARGS = \ + BACKWARD='$(BACKWARD)' \ + DESTDIR='$(DESTDIR)' \ + LEAPSECONDS='$(LEAPSECONDS)' \ + PACKRATDATA='$(PACKRATDATA)' \ + TZDEFAULT='$(TZDEFAULT)' \ + TZDIR='$(TZDIR)' \ + ZIC='$(ZIC)' + +INSTALL_DATA_DEPS = zic leapseconds tzdata.zi + +# 'make install_data' installs one set of TZif files. +install_data: $(INSTALL_DATA_DEPS) + $(ZIC_INSTALL) tzdata.zi + +posix_only: $(INSTALL_DATA_DEPS) + $(MAKE) $(INSTALLARGS) LEAPSECONDS= install_data + +right_only: $(INSTALL_DATA_DEPS) + $(MAKE) $(INSTALLARGS) LEAPSECONDS='-L leapseconds' \ + install_data + +# In earlier versions of this makefile, the other two directories were +# subdirectories of $(TZDIR). However, this led to configuration errors. +# For example, with posix_right under the earlier scheme, +# TZ='right/Australia/Adelaide' got you localtime with leap seconds, +# but gmtime without leap seconds, which led to problems with applications +# like sendmail that subtract gmtime from localtime. +# Therefore, the other two directories are now siblings of $(TZDIR). +# You must replace all of $(TZDIR) to switch from not using leap seconds +# to using them, or vice versa. +right_posix: right_only + rm -fr '$(DESTDIR)$(TZDIR)-leaps' + ln -s '$(TZDIR_BASENAME)' '$(DESTDIR)$(TZDIR)-leaps' || \ + $(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-leaps' right_only + $(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-posix' posix_only + +posix_right: posix_only + rm -fr '$(DESTDIR)$(TZDIR)-posix' + ln -s '$(TZDIR_BASENAME)' '$(DESTDIR)$(TZDIR)-posix' || \ + $(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-posix' posix_only + $(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-leaps' right_only + +# This obsolescent rule is present for backwards compatibility with +# tz releases 2014g through 2015g. It should go away eventually. +posix_packrat: $(INSTALL_DATA_DEPS) + $(MAKE) $(INSTALLARGS) PACKRATDATA=backzone posix_only + +zones: $(REDO) + +# dummy.zd is not a real file; it is mentioned here only so that the +# top-level 'make' does not have a syntax error. +ZDS = dummy.zd +# Rule used only by submakes invoked by the $(TZS_NEW) rule. +# It is separate so that GNU 'make -j' can run instances in parallel. +$(ZDS): zdump + ./zdump -i $(TZS_CUTOFF_FLAG) '$(wd)/'$$(expr $@ : '\(.*\).zd') \ + >$@ + +TZS_NEW_DEPS = tzdata.zi zdump zic +$(TZS_NEW): $(TZS_NEW_DEPS) + rm -fr tzs$(TZS_YEAR).dir + mkdir tzs$(TZS_YEAR).dir + $(zic) -d tzs$(TZS_YEAR).dir tzdata.zi + $(AWK) '/^L/{print "Link\t" $$2 "\t" $$3}' \ + tzdata.zi | LC_ALL=C sort >$@.out + wd=`pwd` && \ + x=`$(AWK) '/^Z/{print "tzs$(TZS_YEAR).dir/" $$2 ".zd"}' \ + tzdata.zi \ + | LC_ALL=C sort -t . -k 2,2` && \ + set x $$x && \ + shift && \ + ZDS=$$* && \ + $(MAKE) wd="$$wd" TZS_CUTOFF_FLAG="$(TZS_CUTOFF_FLAG)" \ + ZDS="$$ZDS" $$ZDS && \ + sed 's,^TZ=".*\.dir/,TZ=",' $$ZDS >>$@.out + rm -fr tzs$(TZS_YEAR).dir + mv $@.out $@ + +# If $(TZS) exists but 'make check_tzs' fails, a maintainer should inspect the +# failed output and fix the inconsistency, perhaps by running 'make force_tzs'. +$(TZS): + touch $@ + +force_tzs: $(TZS_NEW) + cp $(TZS_NEW) $(TZS) + +libtz.a: $(LIBOBJS) + rm -f $@ + $(AR) -rc $@ $(LIBOBJS) + $(RANLIB) $@ + +date: $(DATEOBJS) + $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(DATEOBJS) $(LDLIBS) + +tzselect: tzselect.ksh version + VERSION=`cat version` && sed \ + -e 's|#!/bin/bash|#!$(KSHELL)|g' \ + -e 's|AWK=[^}]*|AWK=$(AWK)|g' \ + -e 's|\(PKGVERSION\)=.*|\1='\''($(PACKAGE)) '\''|' \ + -e 's|\(REPORT_BUGS_TO\)=.*|\1=$(BUGEMAIL)|' \ + -e 's|TZDIR=[^}]*|TZDIR=$(TZDIR)|' \ + -e 's|\(TZVERSION\)=.*|\1='"$$VERSION"'|' \ + <$@.ksh >$@.out + chmod +x $@.out + mv $@.out $@ + +check: check_character_set check_white_space check_links \ + check_name_lengths check_sorted \ + check_tables check_web check_zishrink check_tzs + +check_character_set: $(ENCHILADA) + test ! '$(UTF8_LOCALE)' || \ + ! printf 'A\304\200B\n' | \ + LC_ALL='$(UTF8_LOCALE)' grep -q '^A.B$$' >/dev/null 2>&1 || { \ + LC_ALL='$(UTF8_LOCALE)' && export LC_ALL && \ + sharp='#' && \ + ! grep -Env $(SAFE_LINE) $(MANS) date.1 $(MANTXTS) \ + $(MISC) $(SOURCES) $(WEB_PAGES) \ + CONTRIBUTING LICENSE README \ + version tzdata.zi && \ + ! grep -Env $(SAFE_LINE)'|^UNUSUAL_OK_'$(OK_CHAR)'*$$' \ + Makefile && \ + ! grep -Env $(SAFE_SHARP_LINE) $(TDATA_TO_CHECK) backzone \ + leapseconds zone.tab && \ + ! grep -Env $(OK_LINE) $(ENCHILADA); \ + } + touch $@ + +check_white_space: $(ENCHILADA) + patfmt=' \t|[\f\r\v]' && pat=`printf "$$patfmt\\n"` && \ + ! grep -En "$$pat" \ + $$(ls $(ENCHILADA) | grep -Fvx leap-seconds.list) + ! grep -n '[[:space:]]$$' \ + $$(ls $(ENCHILADA) | grep -Fvx leap-seconds.list) + touch $@ + +PRECEDES_FILE_NAME = ^(Zone|Link[[:space:]]+[^[:space:]]+)[[:space:]]+ +FILE_NAME_COMPONENT_TOO_LONG = \ + $(PRECEDES_FILE_NAME)[^[:space:]]*[^/[:space:]]{15} + +check_name_lengths: $(TDATA_TO_CHECK) backzone + ! grep -En '$(FILE_NAME_COMPONENT_TOO_LONG)' \ + $(TDATA_TO_CHECK) backzone + touch $@ + +CHECK_CC_LIST = { n = split($$1,a,/,/); for (i=2; i<=n; i++) print a[1], a[i]; } + +check_sorted: backward backzone iso3166.tab zone.tab zone1970.tab + $(AWK) '/^Link/ {print $$3}' backward | LC_ALL=C sort -cu + $(AWK) '/^Zone/ {print $$2}' backzone | LC_ALL=C sort -cu + touch $@ + +check_links: checklinks.awk $(TDATA_TO_CHECK) tzdata.zi + $(AWK) -f checklinks.awk $(TDATA_TO_CHECK) + $(AWK) -f checklinks.awk tzdata.zi + touch $@ + +check_tables: checktab.awk $(PRIMARY_YDATA) $(ZONETABLES) + for tab in $(ZONETABLES); do \ + $(AWK) -f checktab.awk -v zone_table=$$tab $(PRIMARY_YDATA) \ + || exit; \ + done + touch $@ + +check_tzs: $(TZS) $(TZS_NEW) + if test -s $(TZS); then \ + diff -u $(TZS) $(TZS_NEW); \ + else \ + cp $(TZS_NEW) $(TZS); \ + fi + touch $@ + +check_web: $(CHECK_WEB_PAGES) +check_theory.html: theory.html +check_tz-art.html: tz-art.html +check_tz-how-to.html: tz-how-to.html +check_tz-link.html: tz-link.html +check_theory.html check_tz-art.html check_tz-how-to.html check_tz-link.html: + $(CURL) -sS --url https://validator.w3.org/nu/ -F out=gnu \ + -F file=@$$(expr $@ : 'check_\(.*\)') -o $@.out && \ + test ! -s $@.out || { cat $@.out; exit 1; } + mv $@.out $@ + +# Check that zishrink.awk does not alter the data, and that ziguard.awk +# preserves main-format data. +check_zishrink: check_zishrink_posix check_zishrink_right +check_zishrink_posix check_zishrink_right: \ + zic leapseconds $(PACKRATDATA) $(TDATA) $(DATAFORM).zi tzdata.zi + rm -fr $@.dir $@-t.dir $@-shrunk.dir + mkdir $@.dir $@-t.dir $@-shrunk.dir + case $@ in \ + *_right) leap='-L leapseconds';; \ + *) leap=;; \ + esac && \ + $(ZIC) $$leap -d $@.dir $(DATAFORM).zi && \ + $(ZIC) $$leap -d $@-shrunk.dir tzdata.zi && \ + case $(DATAFORM) in \ + main) \ + $(ZIC) $$leap -d $@-t.dir $(TDATA) && \ + $(AWK) '/^Rule/' $(TDATA) | \ + $(ZIC) $$leap -d $@-t.dir - $(PACKRATDATA) && \ + diff -r $@.dir $@-t.dir;; \ + esac + diff -r $@.dir $@-shrunk.dir + rm -fr $@.dir $@-t.dir $@-shrunk.dir + touch $@ + +clean_misc: + rm -fr check_*.dir + rm -f *.o *.out $(TIME_T_ALTERNATIVES) \ + check_* core typecheck_* \ + date tzselect version.h zdump zic libtz.a +clean: clean_misc + rm -fr *.dir tzdb-*/ + rm -f *.zi $(TZS_NEW) + +maintainer-clean: clean + @echo 'This command is intended for maintainers to use; it' + @echo 'deletes files that may need special tools to rebuild.' + rm -f leapseconds version $(MANTXTS) $(TZS) *.asc *.tar.* + +names: + @echo $(ENCHILADA) + +public: check check_public $(CHECK_TIME_T_ALTERNATIVES) \ + tarballs signatures + +date.1.txt: date.1 +newctime.3.txt: newctime.3 +newstrftime.3.txt: newstrftime.3 +newtzset.3.txt: newtzset.3 +time2posix.3.txt: time2posix.3 +tzfile.5.txt: tzfile.5 +tzselect.8.txt: tzselect.8 +zdump.8.txt: zdump.8 +zic.8.txt: zic.8 + +$(MANTXTS): workman.sh + LC_ALL=C sh workman.sh `expr $@ : '\(.*\)\.txt$$'` >$@.out + mv $@.out $@ + ++# Set file timestamps deterministically if possible, ++# so that tarballs containing the timestamps are reproducible. ++# ++# '$(SET_TIMESTAMP_N) N DEST A B C ...' sets the timestamp of the ++# file DEST to the maximum of the timestamps of the files A B C ..., ++# plus N if GNU ls and touch are available. ++SET_TIMESTAMP_N = sh -c '\ ++ n=$$0 dest=$$1; shift; \ ++ touch -cmr `ls -t "$$@" | sed 1q` "$$dest" && \ ++ if test $$n != 0 && \ ++ lsout=`ls -n --time-style="+%s" "$$dest" 2>/dev/null`; then \ ++ set x $$lsout && \ ++ touch -cmd @`expr $$7 + $$n` "$$dest"; \ ++ else :; fi' ++# If DEST depends on A B C ... in this Makefile, callers should use ++# $(SET_TIMESTAMP_DEP) DEST A B C ..., for the benefit of any ++# downstream 'make' that considers equal timestamps to be out of date. ++# POSIX allows this 'make' behavior, and HP-UX 'make' does it. ++# If all that matters is that the timestamp be reproducible ++# and plausible, use $(SET_TIMESTAMP). ++SET_TIMESTAMP = $(SET_TIMESTAMP_N) 0 ++SET_TIMESTAMP_DEP = $(SET_TIMESTAMP_N) 1 ++ +# Set the timestamps to those of the git repository, if available, +# and if the files have not changed since then. - # This uses GNU 'touch' syntax 'touch -d@N FILE', - # where N is the number of seconds since 1970. - # If git or GNU 'touch' is absent, don't bother to sync with git timestamps. ++# This uses GNU 'ls --time-style=+%s', which outputs the seconds count, ++# and GNU 'touch -d@N FILE', where N is the number of seconds since 1970. ++# If git or GNU is absent, don't bother to sync with git timestamps. +# Also, set the timestamp of each prebuilt file like 'leapseconds' +# to be the maximum of the files it depends on. +set-timestamps.out: $(EIGHT_YARDS) + rm -f $@ + if (type git) >/dev/null 2>&1 && \ + files=`git ls-files $(EIGHT_YARDS)` && \ + touch -md @1 test.out; then \ + rm -f test.out && \ + for file in $$files; do \ + if git diff --quiet $$file; then \ + time=`git log -1 --format='tformat:%ct' $$file` && \ + touch -cmd @$$time $$file; \ + else \ + echo >&2 "$$file: warning: does not match repository"; \ + fi || exit; \ + done; \ + fi - touch -cmr `ls -t $(LEAP_DEPS) | sed 1q` leapseconds ++ $(SET_TIMESTAMP_DEP) leapseconds $(LEAP_DEPS) + for file in `ls $(MANTXTS) | sed 's/\.txt$$//'`; do \ - touch -cmr `ls -t $$file workman.sh | sed 1q` $$file.txt || \ ++ $(SET_TIMESTAMP_DEP) $$file.txt $$file workman.sh || \ + exit; \ + done - touch -cmr `ls -t $(TZDATA_ZI_DEPS) | sed 1q` tzdata.zi - touch -cmr `ls -t $(VERSION_DEPS) | sed 1q` version ++ $(SET_TIMESTAMP_DEP) version $(VERSION_DEPS) ++ $(SET_TIMESTAMP_DEP) tzdata.zi $(TZDATA_ZI_DEPS) + touch $@ +set-tzs-timestamp.out: $(TZS) - touch -cmr `ls -t $(TZS_DEPS) | sed 1q` $(TZS) ++ $(SET_TIMESTAMP_DEP) $(TZS) $(TZS_DEPS) *** 685 LINES SKIPPED *** From owner-dev-commits-src-main@freebsd.org Fri Dec 25 15:56:10 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0755C4C53A2; Fri, 25 Dec 2020 15:56:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D2Wkx6kGTz3NQy; Fri, 25 Dec 2020 15:56:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D53AB252BA; Fri, 25 Dec 2020 15:56:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BPFu9uc029903; Fri, 25 Dec 2020 15:56:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BPFu9l7029902; Fri, 25 Dec 2020 15:56:09 GMT (envelope-from git) Date: Fri, 25 Dec 2020 15:56:09 GMT Message-Id: <202012251556.0BPFu9l7029902@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Conrad Meyer Subject: git: f7cd7fe51c41 - sys/contrib/zstd: Import zstd 1.4.8 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f7cd7fe51c4140960ebea00410ed62894f5625d1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Dec 2020 15:56:10 -0000 The branch main has been updated by cem: URL: https://cgit.FreeBSD.org/src/commit/?id=f7cd7fe51c4140960ebea00410ed62894f5625d1 commit f7cd7fe51c4140960ebea00410ed62894f5625d1 Merge: dc505d53dcc1 f6ae97673c28 Author: Conrad Meyer AuthorDate: 2020-12-25 15:42:41 +0000 Commit: Conrad Meyer CommitDate: 2020-12-25 15:42:41 +0000 sys/contrib/zstd: Import zstd 1.4.8 Merge commit 'f6ae97673c28bdb9ae795bd235ab6f26f2536a2d' into main Changes from 1.4.5: * https://github.com/facebook/zstd/releases/tag/v1.4.8 * https://github.com/facebook/zstd/releases/tag/v1.4.7 (and there was no public v1.4.6) Conflicts: sys/contrib/zstd/lib/common/zstd_internal.h (new ZSTD_NO_INTRINSICS) sys/conf/kern.pre.mk | 6 +- sys/contrib/zstd/CHANGELOG | 173 +- sys/contrib/zstd/CONTRIBUTING.md | 18 +- sys/contrib/zstd/Makefile | 68 +- sys/contrib/zstd/README.md | 12 +- sys/contrib/zstd/TESTING.md | 2 +- sys/contrib/zstd/appveyor.yml | 19 +- sys/contrib/zstd/doc/zstd_compression_format.md | 114 +- sys/contrib/zstd/doc/zstd_manual.html | 314 +++- sys/contrib/zstd/examples/Makefile | 53 +- sys/contrib/zstd/examples/streaming_compression.c | 1 + .../examples/streaming_compression_thread_pool.c | 178 ++ sys/contrib/zstd/lib/Makefile | 365 ++-- sys/contrib/zstd/lib/README.md | 28 + sys/contrib/zstd/lib/common/bitstream.h | 39 +- sys/contrib/zstd/lib/common/compiler.h | 119 +- sys/contrib/zstd/lib/common/cpu.h | 2 - sys/contrib/zstd/lib/common/debug.h | 29 +- sys/contrib/zstd/lib/common/entropy_common.c | 230 ++- sys/contrib/zstd/lib/common/error_private.c | 1 + sys/contrib/zstd/lib/common/error_private.h | 2 +- sys/contrib/zstd/lib/common/fse.h | 50 +- sys/contrib/zstd/lib/common/fse_decompress.c | 139 +- sys/contrib/zstd/lib/common/huf.h | 31 +- sys/contrib/zstd/lib/common/mem.h | 159 +- sys/contrib/zstd/lib/common/pool.c | 38 +- sys/contrib/zstd/lib/common/pool.h | 2 +- sys/contrib/zstd/lib/common/threading.c | 11 +- sys/contrib/zstd/lib/common/xxhash.c | 74 +- sys/contrib/zstd/lib/common/xxhash.h | 2 +- sys/contrib/zstd/lib/common/zstd_common.c | 18 +- sys/contrib/zstd/lib/common/zstd_deps.h | 111 ++ sys/contrib/zstd/lib/common/zstd_errors.h | 1 + sys/contrib/zstd/lib/common/zstd_internal.h | 147 +- sys/contrib/zstd/lib/compress/fse_compress.c | 53 +- sys/contrib/zstd/lib/compress/hist.c | 54 +- sys/contrib/zstd/lib/compress/hist.h | 2 +- sys/contrib/zstd/lib/compress/huf_compress.c | 316 ++-- sys/contrib/zstd/lib/compress/zstd_compress.c | 1750 +++++++++++++++----- .../zstd/lib/compress/zstd_compress_internal.h | 160 +- .../zstd/lib/compress/zstd_compress_literals.c | 8 +- .../zstd/lib/compress/zstd_compress_sequences.c | 20 +- .../zstd/lib/compress/zstd_compress_superblock.c | 42 +- sys/contrib/zstd/lib/compress/zstd_cwksp.h | 84 +- sys/contrib/zstd/lib/compress/zstd_double_fast.c | 44 +- sys/contrib/zstd/lib/compress/zstd_fast.c | 38 +- sys/contrib/zstd/lib/compress/zstd_lazy.c | 428 ++++- sys/contrib/zstd/lib/compress/zstd_lazy.h | 20 + sys/contrib/zstd/lib/compress/zstd_ldm.c | 77 +- sys/contrib/zstd/lib/compress/zstd_ldm.h | 6 + sys/contrib/zstd/lib/compress/zstd_opt.c | 235 ++- sys/contrib/zstd/lib/compress/zstdmt_compress.c | 480 +----- sys/contrib/zstd/lib/compress/zstdmt_compress.h | 134 +- sys/contrib/zstd/lib/decompress/huf_decompress.c | 502 +++--- sys/contrib/zstd/lib/decompress/zstd_ddict.c | 16 +- sys/contrib/zstd/lib/decompress/zstd_ddict.h | 2 +- sys/contrib/zstd/lib/decompress/zstd_decompress.c | 205 ++- .../zstd/lib/decompress/zstd_decompress_block.c | 184 +- .../zstd/lib/decompress/zstd_decompress_block.h | 7 +- .../zstd/lib/decompress/zstd_decompress_internal.h | 21 +- sys/contrib/zstd/lib/dictBuilder/cover.c | 49 +- sys/contrib/zstd/lib/dictBuilder/cover.h | 2 +- sys/contrib/zstd/lib/dictBuilder/fastcover.c | 39 +- sys/contrib/zstd/lib/dictBuilder/zdict.c | 31 +- sys/contrib/zstd/lib/dictBuilder/zdict.h | 2 +- sys/contrib/zstd/lib/legacy/zstd_v01.c | 6 +- sys/contrib/zstd/lib/legacy/zstd_v02.c | 6 +- sys/contrib/zstd/lib/legacy/zstd_v03.c | 6 +- sys/contrib/zstd/lib/legacy/zstd_v04.c | 8 +- sys/contrib/zstd/lib/legacy/zstd_v05.c | 6 +- sys/contrib/zstd/lib/legacy/zstd_v06.c | 6 +- sys/contrib/zstd/lib/legacy/zstd_v07.c | 6 +- sys/contrib/zstd/lib/libzstd.pc.in | 6 +- sys/contrib/zstd/lib/zstd.h | 395 ++++- sys/contrib/zstd/programs/Makefile | 284 ++-- sys/contrib/zstd/programs/README.md | 70 +- sys/contrib/zstd/programs/dibio.c | 2 +- sys/contrib/zstd/programs/fileio.c | 462 ++++-- sys/contrib/zstd/programs/fileio.h | 29 +- sys/contrib/zstd/programs/platform.h | 6 + sys/contrib/zstd/programs/timefn.h | 6 +- sys/contrib/zstd/programs/util.c | 407 ++++- sys/contrib/zstd/programs/util.h | 62 +- sys/contrib/zstd/programs/zstd.1 | 77 +- sys/contrib/zstd/programs/zstd.1.md | 150 +- sys/contrib/zstd/programs/zstdcli.c | 195 ++- sys/contrib/zstd/programs/zstdgrep.1 | 2 +- sys/contrib/zstd/programs/zstdless.1 | 2 +- sys/contrib/zstd/zlibWrapper/Makefile | 4 +- sys/contrib/zstd/zlibWrapper/zstd_zlibwrapper.c | 137 +- 90 files changed, 6825 insertions(+), 3082 deletions(-) diff --cc sys/conf/kern.pre.mk index 4a0663f49753,000000000000..4754092694c1 mode 100644,000000..100644 --- a/sys/conf/kern.pre.mk +++ b/sys/conf/kern.pre.mk @@@ -1,363 -1,0 +1,367 @@@ +# $FreeBSD$ + +# Part of a unified Makefile for building kernels. This part contains all +# of the definitions that need to be before %BEFORE_DEPEND. + +# Allow user to configure things that only effect src tree builds. +# Note: This is duplicated from src.sys.mk to ensure that we include +# /etc/src.conf when building the kernel. Kernels can be built without +# the rest of /usr/src, but they still always process SRCCONF even though +# the normal mechanisms to prevent that (compiling out of tree) won't +# work. To ensure they do work, we have to duplicate thee few lines here. +SRCCONF?= /etc/src.conf +.if (exists(${SRCCONF}) || ${SRCCONF} != "/etc/src.conf") && !target(_srcconf_included_) +.include "${SRCCONF}" +_srcconf_included_: +.endif + +.include +.include +.include "kern.opts.mk" + +# The kernel build always occurs in the object directory which is .CURDIR. +.if ${.MAKE.MODE:Unormal:Mmeta} +.MAKE.MODE+= curdirOk=yes +.endif + +# The kernel build always expects .OBJDIR=.CURDIR. +.OBJDIR: ${.CURDIR} + +.if defined(NO_OBJWALK) || ${MK_AUTO_OBJ} == "yes" +NO_OBJWALK= t +NO_MODULES_OBJ= t +.endif +.if !defined(NO_OBJWALK) +_obj= obj +.endif + +# Can be overridden by makeoptions or /etc/make.conf +KERNEL_KO?= kernel +KERNEL?= kernel +KODIR?= /boot/${KERNEL} +LDSCRIPT_NAME?= ldscript.$M +LDSCRIPT?= $S/conf/${LDSCRIPT_NAME} + +M= ${MACHINE} + +AWK?= awk +CP?= cp +NM?= nm +OBJCOPY?= objcopy +SIZE?= size + +.if defined(DEBUG) +CTFFLAGS+= -g +.endif +.if ${MACHINE_CPUARCH} == "amd64" && ${COMPILER_TYPE} != "clang" +_COPTFLAGS_EXTRA=-frename-registers +.else +_COPTFLAGS_EXTRA= +.endif +COPTFLAGS?=-O2 -pipe ${_COPTFLAGS_EXTRA} +.if !empty(COPTFLAGS:M-O[23s]) && empty(COPTFLAGS:M-fno-strict-aliasing) +COPTFLAGS+= -fno-strict-aliasing +.endif +.if !defined(NO_CPU_COPTFLAGS) +COPTFLAGS+= ${_CPUCFLAGS} +.endif +NOSTDINC= -nostdinc + +INCLUDES= ${NOSTDINC} ${INCLMAGIC} -I. -I$S -I$S/contrib/ck/include + +CFLAGS= ${COPTFLAGS} ${DEBUG} +CFLAGS+= ${INCLUDES} -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h +CFLAGS_PARAM_INLINE_UNIT_GROWTH?=100 +CFLAGS_PARAM_LARGE_FUNCTION_GROWTH?=1000 +.if ${MACHINE_CPUARCH} == "mips" +CFLAGS_ARCH_PARAMS?=--param max-inline-insns-single=1000 -DMACHINE_ARCH='"${MACHINE_ARCH}"' +.endif +CFLAGS.gcc+= -fms-extensions -finline-limit=${INLINE_LIMIT} +CFLAGS.gcc+= --param inline-unit-growth=${CFLAGS_PARAM_INLINE_UNIT_GROWTH} +CFLAGS.gcc+= --param large-function-growth=${CFLAGS_PARAM_LARGE_FUNCTION_GROWTH} +CFLAGS.gcc+= -fms-extensions +.if defined(CFLAGS_ARCH_PARAMS) +CFLAGS.gcc+=${CFLAGS_ARCH_PARAMS} +.endif +WERROR?= -Werror +# The following should be removed no earlier than LLVM11 being imported into the +# tree, to ensure we don't regress the build. LLVM11 and GCC10 will switch the +# default over to -fno-common, making this redundant. +CFLAGS+= -fno-common + +# XXX LOCORE means "don't declare C stuff" not "for locore.s". +ASM_CFLAGS= -x assembler-with-cpp -DLOCORE ${CFLAGS} ${ASM_CFLAGS.${.IMPSRC:T}} + +.if defined(PROFLEVEL) && ${PROFLEVEL} >= 1 +CFLAGS+= -DGPROF +CFLAGS.gcc+= -falign-functions=16 +.if ${PROFLEVEL} >= 2 +CFLAGS+= -DGPROF4 -DGUPROF +PROF= -pg +.if ${COMPILER_TYPE} == "gcc" +PROF+= -mprofiler-epilogue +.endif +.else +PROF= -pg +.endif +.endif +DEFINED_PROF= ${PROF} + +KCSAN_ENABLED!= grep KCSAN opt_global.h || true ; echo +.if !empty(KCSAN_ENABLED) +SAN_CFLAGS+= -fsanitize=thread +.endif + +KUBSAN_ENABLED!= grep KUBSAN opt_global.h || true ; echo +.if !empty(KUBSAN_ENABLED) +SAN_CFLAGS+= -fsanitize=undefined +.endif + +COVERAGE_ENABLED!= grep COVERAGE opt_global.h || true ; echo +.if !empty(COVERAGE_ENABLED) +.if ${COMPILER_TYPE} == "clang" || \ + (${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 80100) +SAN_CFLAGS+= -fsanitize-coverage=trace-pc,trace-cmp +.else +SAN_CFLAGS+= -fsanitize-coverage=trace-pc +.endif +.endif + +CFLAGS+= ${SAN_CFLAGS} + +GCOV_ENABLED!= grep GCOV opt_global.h || true ; echo +.if !empty(GCOV_ENABLED) +.if ${COMPILER_TYPE} == "gcc" +GCOV_CFLAGS+= -fprofile-arcs -ftest-coverage +.endif +.endif + +CFLAGS+= ${GCOV_CFLAGS} + +# Put configuration-specific C flags last (except for ${PROF}) so that they +# can override the others. +CFLAGS+= ${CONF_CFLAGS} + +.if defined(LINKER_FEATURES) && ${LINKER_FEATURES:Mbuild-id} +LDFLAGS+= --build-id=sha1 +.endif + +.if (${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \ + ${MACHINE_CPUARCH} == "i386" || ${MACHINE} == "powerpc") && \ + defined(LINKER_FEATURES) && ${LINKER_FEATURES:Mifunc} == "" +.error amd64/arm64/i386/ppc* kernel requires linker ifunc support +.endif +.if ${MACHINE_CPUARCH} == "amd64" +LDFLAGS+= -z max-page-size=2097152 +.if ${LINKER_TYPE} != "lld" +LDFLAGS+= -z common-page-size=4096 +.else +.if defined(LINKER_FEATURES) && !${LINKER_FEATURES:Mifunc-noplt} +.warning "Linker ${LD} does not support -z ifunc-noplt -> ifunc calls are unoptimized." +.else +LDFLAGS+= -z notext -z ifunc-noplt +.endif +.endif +.endif # ${MACHINE_CPUARCH} == "amd64" + +.if ${MACHINE_CPUARCH} == "riscv" +# Hack: Work around undefined weak symbols being out of range when linking with +# LLD (address is a PC-relative calculation, and BFD works around this by +# rewriting the instructions to generate an absolute address of 0); -fPIE +# avoids this since it uses the GOT for all extern symbols, which is overly +# inefficient for us. Drop once undefined weak symbols work with medany. +.if ${LINKER_TYPE} == "lld" +CFLAGS+= -fPIE +.endif +.endif + +NORMAL_C= ${CC} -c ${CFLAGS} ${WERROR} ${PROF} ${.IMPSRC} +NORMAL_S= ${CC:N${CCACHE_BIN}} -c ${ASM_CFLAGS} ${WERROR} ${.IMPSRC} +PROFILE_C= ${CC} -c ${CFLAGS} ${WERROR} ${.IMPSRC} +NORMAL_C_NOWERROR= ${CC} -c ${CFLAGS} ${PROF} ${.IMPSRC} + +NORMAL_M= ${AWK} -f $S/tools/makeobjops.awk ${.IMPSRC} -c ; \ + ${CC} -c ${CFLAGS} ${WERROR} ${PROF} ${.PREFIX}.c + +NORMAL_FW= uudecode -o ${.TARGET} ${.ALLSRC} +NORMAL_FWO= ${CC:N${CCACHE_BIN}} -c ${ASM_CFLAGS} ${WERROR} -o ${.TARGET} \ + $S/kern/firmw.S -DFIRMW_FILE="${.ALLSRC:M*.fw}" \ + -DFIRMW_SYMBOL="${.ALLSRC:M*.fw:C/[-.\/]/_/g}" + +# for ZSTD in the kernel (include zstd/lib/freebsd before other CFLAGS) - ZSTD_C= ${CC} -c -DZSTD_HEAPMODE=1 -I$S/contrib/zstd/lib/freebsd ${CFLAGS} -I$S/contrib/zstd/lib -I$S/contrib/zstd/lib/common ${WERROR} -Wno-inline -Wno-missing-prototypes ${PROF} -U__BMI__ ${.IMPSRC} ++ZSTD_C= ${CC} -c -DZSTD_HEAPMODE=1 -I$S/contrib/zstd/lib/freebsd ${CFLAGS} \ ++ -I$S/contrib/zstd/lib -I$S/contrib/zstd/lib/common ${WERROR} \ ++ -Wno-inline -Wno-missing-prototypes ${PROF} -U__BMI__ \ ++ -DZSTD_NO_INTRINSICS \ ++ ${.IMPSRC} +# https://github.com/facebook/zstd/commit/812e8f2a [zstd 1.4.1] +# "Note that [GCC] autovectorization still does not do a good job on the +# optimized version, so it's turned off via attribute and flag. I found +# that neither attribute nor command-line flag were entirely successful in +# turning off vectorization, which is why there were both." +.if ${COMPILER_TYPE} == "gcc" +ZSTD_DECOMPRESS_BLOCK_FLAGS= -fno-tree-vectorize +.endif + +ZINCDIR=$S/contrib/openzfs/include +# Common for dtrace / zfs +CDDL_CFLAGS= \ + -DFREEBSD_NAMECACHE \ + -D_SYS_VMEM_H_ \ + -D__KERNEL \ + -D__KERNEL__ \ + -nostdinc \ + -include $S/modules/zfs/static_ccompile.h \ + -I${ZINCDIR} \ + -I${ZINCDIR}/os/freebsd \ + -I${ZINCDIR}/os/freebsd/spl \ + -I${ZINCDIR}/os/freebsd/zfs \ + -I$S/modules/zfs \ + -I$S/contrib/openzfs/module/zstd/include \ + ${CFLAGS} \ + -Wno-cast-qual \ + -Wno-duplicate-decl-specifier \ + -Wno-inline \ + -Wno-missing-braces \ + -Wno-missing-prototypes \ + -Wno-nested-externs \ + -Wno-parentheses \ + -Wno-pointer-arith \ + -Wno-redundant-decls \ + -Wno-strict-prototypes \ + -Wno-switch \ + -Wno-undef \ + -Wno-uninitialized \ + -Wno-unknown-pragmas \ + -Wno-unused \ + -include ${ZINCDIR}/os/freebsd/spl/sys/ccompile.h \ + -I$S/cddl/contrib/opensolaris/uts/common \ + -I$S -I$S/cddl/compat/opensolaris +CDDL_C= ${CC} -c ${CDDL_CFLAGS} ${WERROR} ${PROF} ${.IMPSRC} + +# Special flags for managing the compat compiles for ZFS +ZFS_CFLAGS+= ${CDDL_CFLAGS} -DBUILDING_ZFS -DHAVE_UIO_ZEROCOPY \ + -DWITH_NETDUMP -D__KERNEL__ -D_SYS_CONDVAR_H_ -DSMP \ + -DIN_FREEBSD_BASE -DHAVE_KSID + +.if ${MACHINE_ARCH} == "amd64" +ZFS_CFLAGS+= -DHAVE_AVX2 -DHAVE_AVX -D__x86_64 -DHAVE_SSE2 -DHAVE_AVX512F \ + -DHAVE_SSSE3 -DHAVE_AVX512BW +.endif + +.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "powerpc" || \ + ${MACHINE_ARCH} == "powerpcspe" || ${MACHINE_ARCH} == "arm" +ZFS_CFLAGS+= -DBITS_PER_LONG=32 +.else +ZFS_CFLAGS+= -DBITS_PER_LONG=64 +.endif + + +ZFS_ASM_CFLAGS= -x assembler-with-cpp -DLOCORE ${ZFS_CFLAGS} +ZFS_C= ${CC} -c ${ZFS_CFLAGS} ${WERROR} ${PROF} ${.IMPSRC} +ZFS_RPC_C= ${CC} -c ${ZFS_CFLAGS} -DHAVE_RPC_TYPES ${WERROR} ${PROF} ${.IMPSRC} +ZFS_S= ${CC} -c ${ZFS_ASM_CFLAGS} ${WERROR} ${.IMPSRC} + + + +# Special flags for managing the compat compiles for DTrace +DTRACE_CFLAGS= -DBUILDING_DTRACE ${CDDL_CFLAGS} -I$S/cddl/dev/dtrace -I$S/cddl/dev/dtrace/${MACHINE_CPUARCH} +.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" +DTRACE_CFLAGS+= -I$S/cddl/contrib/opensolaris/uts/intel -I$S/cddl/dev/dtrace/x86 +.endif +DTRACE_CFLAGS+= -I$S/cddl/contrib/opensolaris/common/util -I$S -DDIS_MEM -DSMP -I$S/cddl/compat/opensolaris +DTRACE_CFLAGS+= -I$S/cddl/contrib/opensolaris/uts/common +DTRACE_ASM_CFLAGS= -x assembler-with-cpp -DLOCORE ${DTRACE_CFLAGS} +DTRACE_C= ${CC} -c ${DTRACE_CFLAGS} ${WERROR} ${PROF} ${.IMPSRC} +DTRACE_S= ${CC} -c ${DTRACE_ASM_CFLAGS} ${WERROR} ${.IMPSRC} + +# Special flags for managing the compat compiles for DTrace/FBT +FBT_CFLAGS= -DBUILDING_DTRACE -nostdinc -I$S/cddl/dev/fbt/${MACHINE_CPUARCH} -I$S/cddl/dev/fbt ${CDDL_CFLAGS} -I$S/cddl/compat/opensolaris -I$S/cddl/contrib/opensolaris/uts/common +.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" +FBT_CFLAGS+= -I$S/cddl/dev/fbt/x86 +.endif +FBT_C= ${CC} -c ${FBT_CFLAGS} ${WERROR} ${PROF} ${.IMPSRC} + +.if ${MK_CTF} != "no" +NORMAL_CTFCONVERT= ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} +.elif ${MAKE_VERSION} >= 5201111300 +NORMAL_CTFCONVERT= +.else +NORMAL_CTFCONVERT= @: +.endif + +# Linux Kernel Programming Interface C-flags +LINUXKPI_INCLUDES= -I$S/compat/linuxkpi/common/include +LINUXKPI_C= ${NORMAL_C} ${LINUXKPI_INCLUDES} + +# Infiniband C flags. Correct include paths and omit errors that linux +# does not honor. +OFEDINCLUDES= -I$S/ofed/include -I$S/ofed/include/uapi ${LINUXKPI_INCLUDES} +OFEDNOERR= -Wno-cast-qual -Wno-pointer-arith +OFEDCFLAGS= ${CFLAGS:N-I*} -DCONFIG_INFINIBAND_USER_MEM \ + ${OFEDINCLUDES} ${CFLAGS:M-I*} ${OFEDNOERR} +OFED_C_NOIMP= ${CC} -c -o ${.TARGET} ${OFEDCFLAGS} ${WERROR} ${PROF} +OFED_C= ${OFED_C_NOIMP} ${.IMPSRC} + +# mlxfw C flags. +MLXFW_C= ${OFED_C_NOIMP} \ + -I${SRCTOP}/sys/contrib/xz-embedded/freebsd \ + -I${SRCTOP}/sys/contrib/xz-embedded/linux/lib/xz \ + ${.IMPSRC} + +GEN_CFILES= $S/$M/$M/genassym.c ${MFILES:T:S/.m$/.c/} +SYSTEM_CFILES= config.c env.c hints.c vnode_if.c +SYSTEM_DEP= Makefile ${SYSTEM_OBJS} +SYSTEM_OBJS= locore.o ${MDOBJS} ${OBJS} +SYSTEM_OBJS+= ${SYSTEM_CFILES:.c=.o} +SYSTEM_OBJS+= hack.pico + +KEYMAP=kbdcontrol -P ${SRCTOP}/share/vt/keymaps -P ${SRCTOP}/share/syscons/keymaps +KEYMAP_FIX=sed -e 's/^static keymap_t.* = /static keymap_t key_map = /' -e 's/^static accentmap_t.* = /static accentmap_t accent_map = /' + +MD_ROOT_SIZE_CONFIGURED!= grep MD_ROOT_SIZE opt_md.h || true ; echo +.if ${MFS_IMAGE:Uno} != "no" +.if empty(MD_ROOT_SIZE_CONFIGURED) +SYSTEM_OBJS+= embedfs_${MFS_IMAGE:T:R}.o +.endif +.endif +SYSTEM_LD_BASECMD= \ + ${LD} -m ${LD_EMULATION} -Bdynamic -T ${LDSCRIPT} ${_LDFLAGS} \ + --no-warn-mismatch --warn-common --export-dynamic \ + --dynamic-linker /red/herring -X +SYSTEM_LD= @${SYSTEM_LD_BASECMD} -o ${.TARGET} ${SYSTEM_OBJS} vers.o +SYSTEM_LD_TAIL= @${OBJCOPY} --strip-symbol gcc2_compiled. ${.TARGET} ; \ + ${SIZE} ${.TARGET} ; chmod 755 ${.TARGET} +SYSTEM_DEP+= ${LDSCRIPT} + +# Calculate path for .m files early, if needed. +.if !defined(NO_MODULES) && !defined(__MPATH) && !make(install) && \ + (empty(.MAKEFLAGS:M-V) || defined(NO_SKIP_MPATH)) +__MPATH!=find ${S:tA}/ -name \*_if.m +.endif + +# MKMODULESENV is set here so that port makefiles can augment +# them. + +MKMODULESENV+= MAKEOBJDIRPREFIX=${.OBJDIR}/modules KMODDIR=${KODIR} +MKMODULESENV+= MACHINE_CPUARCH=${MACHINE_CPUARCH} +MKMODULESENV+= MACHINE=${MACHINE} MACHINE_ARCH=${MACHINE_ARCH} +MKMODULESENV+= MODULES_EXTRA="${MODULES_EXTRA}" WITHOUT_MODULES="${WITHOUT_MODULES}" +MKMODULESENV+= ARCH_FLAGS="${ARCH_FLAGS}" +.if (${KERN_IDENT} == LINT) +MKMODULESENV+= ALL_MODULES=LINT +.endif +.if defined(MODULES_OVERRIDE) +MKMODULESENV+= MODULES_OVERRIDE="${MODULES_OVERRIDE}" +.endif +.if defined(DEBUG) +MKMODULESENV+= DEBUG_FLAGS="${DEBUG}" +.endif +.if !defined(NO_MODULES) +MKMODULESENV+= __MPATH="${__MPATH}" +.endif + +# Detect kernel config options that force stack frames to be turned on. +DDB_ENABLED!= grep DDB opt_ddb.h || true ; echo +DTR_ENABLED!= grep KDTRACE_FRAME opt_kdtrace.h || true ; echo +HWPMC_ENABLED!= grep HWPMC opt_hwpmc_hooks.h || true ; echo diff --cc sys/contrib/zstd/Makefile index 2c1d34604fe9,000000000000..2832fb4752b8 mode 100644,000000..100644 --- a/sys/contrib/zstd/Makefile +++ b/sys/contrib/zstd/Makefile @@@ -1,414 -1,0 +1,420 @@@ +# ################################################################ +# Copyright (c) 2015-2020, Yann Collet, Facebook, Inc. +# All rights reserved. +# +# This source code is licensed under both the BSD-style license (found in the +# LICENSE file in the root directory of this source tree) and the GPLv2 (found +# in the COPYING file in the root directory of this source tree). +# You may select, at your option, one of the above-listed licenses. +# ################################################################ + ++# verbose mode (print commands) on V=1 or VERBOSE=1 ++Q = $(if $(filter 1,$(V) $(VERBOSE)),,@) ++ +PRGDIR = programs +ZSTDDIR = lib +BUILDIR = build +ZWRAPDIR = zlibWrapper +TESTDIR = tests +FUZZDIR = $(TESTDIR)/fuzz + +# Define nul output +VOID = /dev/null + +# When cross-compiling from linux to windows, you might +# need to specify this as "Windows." Fedora build fails +# without it. +# +# Note: mingw-w64 build from linux to windows does not +# fail on other tested distros (ubuntu, debian) even +# without manually specifying the TARGET_SYSTEM. +TARGET_SYSTEM ?= $(OS) + +ifneq (,$(filter Windows%,$(TARGET_SYSTEM))) - EXT =.exe ++ EXT =.exe +else - EXT = ++ EXT = +endif + +## default: Build lib-release and zstd-release +.PHONY: default +default: lib-release zstd-release + +.PHONY: all +all: allmost examples manual contrib + +.PHONY: allmost +allmost: allzstd zlibwrapper + +# skip zwrapper, can't build that on alternate architectures without the proper zlib installed +.PHONY: allzstd +allzstd: lib-all - $(MAKE) -C $(PRGDIR) all - $(MAKE) -C $(TESTDIR) all ++ $(Q)$(MAKE) -C $(PRGDIR) all ++ $(Q)$(MAKE) -C $(TESTDIR) all + +.PHONY: all32 +all32: + $(MAKE) -C $(PRGDIR) zstd32 + $(MAKE) -C $(TESTDIR) all32 + +.PHONY: lib lib-release libzstd.a ++lib-all : lib +lib lib-release lib-all : - @$(MAKE) -C $(ZSTDDIR) $@ ++ $(Q)$(MAKE) -C $(ZSTDDIR) $@ + +.PHONY: zstd zstd-release +zstd zstd-release: - @$(MAKE) -C $(PRGDIR) $@ - cp $(PRGDIR)/zstd$(EXT) . ++ $(Q)$(MAKE) -C $(PRGDIR) $@ ++ $(Q)ln -sf $(PRGDIR)/zstd$(EXT) zstd$(EXT) + +.PHONY: zstdmt +zstdmt: - @$(MAKE) -C $(PRGDIR) $@ - cp $(PRGDIR)/zstd$(EXT) ./zstdmt$(EXT) ++ $(Q)$(MAKE) -C $(PRGDIR) $@ ++ $(Q)cp $(PRGDIR)/zstd$(EXT) ./zstdmt$(EXT) + +.PHONY: zlibwrapper +zlibwrapper: lib + $(MAKE) -C $(ZWRAPDIR) all + +## test: run long-duration tests +.PHONY: test +DEBUGLEVEL ?= 1 - test: MOREFLAGS += -g -DDEBUGLEVEL=$(DEBUGLEVEL) -Werror ++test: MOREFLAGS += -g -Werror +test: - MOREFLAGS="$(MOREFLAGS)" $(MAKE) -j -C $(PRGDIR) allVariants ++ DEBUGLEVEL=$(DEBUGLEVEL) MOREFLAGS="$(MOREFLAGS)" $(MAKE) -j -C $(PRGDIR) allVariants + $(MAKE) -C $(TESTDIR) $@ - ZSTD=../../programs/zstd $(MAKE) -C doc/educational_decoder test ++ ZSTD=../../programs/zstd $(MAKE) -C doc/educational_decoder $@ + +## shortest: same as `make check` +.PHONY: shortest +shortest: - $(MAKE) -C $(TESTDIR) $@ ++ $(Q)$(MAKE) -C $(TESTDIR) $@ + +## check: run basic tests for `zstd` cli +.PHONY: check +check: shortest + +.PHONY: automated_benchmarking +automated_benchmarking: + $(MAKE) -C $(TESTDIR) $@ + +.PHONY: benchmarking +benchmarking: automated_benchmarking + - ## examples: build all examples in `/examples` directory ++## examples: build all examples in `examples/` directory +.PHONY: examples +examples: lib - CPPFLAGS=-I../lib LDFLAGS=-L../lib $(MAKE) -C examples/ all ++ $(MAKE) -C examples all + +## manual: generate API documentation in html format +.PHONY: manual +manual: + $(MAKE) -C contrib/gen_html $@ + +## man: generate man page +.PHONY: man +man: + $(MAKE) -C programs $@ + +## contrib: build all supported projects in `/contrib` directory +.PHONY: contrib +contrib: lib + $(MAKE) -C contrib/pzstd all + $(MAKE) -C contrib/seekable_format/examples all ++ $(MAKE) -C contrib/seekable_format/tests test + $(MAKE) -C contrib/largeNbDicts all + cd contrib/single_file_libs/ ; ./build_decoder_test.sh + cd contrib/single_file_libs/ ; ./build_library_test.sh + +.PHONY: cleanTabs +cleanTabs: + cd contrib; ./cleanTabs + +.PHONY: clean +clean: - @$(MAKE) -C $(ZSTDDIR) $@ > $(VOID) - @$(MAKE) -C $(PRGDIR) $@ > $(VOID) - @$(MAKE) -C $(TESTDIR) $@ > $(VOID) - @$(MAKE) -C $(ZWRAPDIR) $@ > $(VOID) - @$(MAKE) -C examples/ $@ > $(VOID) - @$(MAKE) -C contrib/gen_html $@ > $(VOID) - @$(MAKE) -C contrib/pzstd $@ > $(VOID) - @$(MAKE) -C contrib/seekable_format/examples $@ > $(VOID) - @$(MAKE) -C contrib/largeNbDicts $@ > $(VOID) - @$(RM) zstd$(EXT) zstdmt$(EXT) tmp* - @$(RM) -r lz4 ++ $(Q)$(MAKE) -C $(ZSTDDIR) $@ > $(VOID) ++ $(Q)$(MAKE) -C $(PRGDIR) $@ > $(VOID) ++ $(Q)$(MAKE) -C $(TESTDIR) $@ > $(VOID) ++ $(Q)$(MAKE) -C $(ZWRAPDIR) $@ > $(VOID) ++ $(Q)$(MAKE) -C examples/ $@ > $(VOID) ++ $(Q)$(MAKE) -C contrib/gen_html $@ > $(VOID) ++ $(Q)$(MAKE) -C contrib/pzstd $@ > $(VOID) ++ $(Q)$(MAKE) -C contrib/seekable_format/examples $@ > $(VOID) ++ $(Q)$(MAKE) -C contrib/seekable_format/tests $@ > $(VOID) ++ $(Q)$(MAKE) -C contrib/largeNbDicts $@ > $(VOID) ++ $(Q)$(RM) zstd$(EXT) zstdmt$(EXT) tmp* ++ $(Q)$(RM) -r lz4 + @echo Cleaning completed + +#------------------------------------------------------------------------------ +# make install is validated only for Linux, macOS, Hurd and some BSD targets +#------------------------------------------------------------------------------ +ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD DragonFly NetBSD MSYS_NT Haiku)) + +HOST_OS = POSIX +CMAKE_PARAMS = -DZSTD_BUILD_CONTRIB:BOOL=ON -DZSTD_BUILD_STATIC:BOOL=ON -DZSTD_BUILD_TESTS:BOOL=ON -DZSTD_ZLIB_SUPPORT:BOOL=ON -DZSTD_LZMA_SUPPORT:BOOL=ON -DCMAKE_BUILD_TYPE=Release + +HAVE_COLORNEVER = $(shell echo a | egrep --color=never a > /dev/null 2> /dev/null && echo 1 || echo 0) +EGREP_OPTIONS ?= +ifeq ($HAVE_COLORNEVER, 1) +EGREP_OPTIONS += --color=never +endif +EGREP = egrep $(EGREP_OPTIONS) + +# Print a two column output of targets and their description. To add a target description, put a +# comment in the Makefile with the format "## : ". For example: +# +## list: Print all targets and their descriptions (if provided) +.PHONY: list +list: - @TARGETS=$$($(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null \ ++ $(Q)TARGETS=$$($(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null \ + | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' \ + | $(EGREP) -v -e '^[^[:alnum:]]' | sort); \ + { \ + printf "Target Name\tDescription\n"; \ + printf "%0.s-" {1..16}; printf "\t"; printf "%0.s-" {1..40}; printf "\n"; \ + for target in $$TARGETS; do \ + line=$$($(EGREP) "^##[[:space:]]+$$target:" $(lastword $(MAKEFILE_LIST))); \ + description=$$(echo $$line | awk '{i=index($$0,":"); print substr($$0,i+1)}' | xargs); \ + printf "$$target\t$$description\n"; \ + done \ + } | column -t -s $$'\t' + +.PHONY: install armtest usan asan uasan +install: - @$(MAKE) -C $(ZSTDDIR) $@ - @$(MAKE) -C $(PRGDIR) $@ ++ $(Q)$(MAKE) -C $(ZSTDDIR) $@ ++ $(Q)$(MAKE) -C $(PRGDIR) $@ + +.PHONY: uninstall +uninstall: - @$(MAKE) -C $(ZSTDDIR) $@ - @$(MAKE) -C $(PRGDIR) $@ ++ $(Q)$(MAKE) -C $(ZSTDDIR) $@ ++ $(Q)$(MAKE) -C $(PRGDIR) $@ + +.PHONY: travis-install +travis-install: + $(MAKE) install PREFIX=~/install_test_dir + +.PHONY: gcc5build +gcc5build: clean + gcc-5 -v + CC=gcc-5 $(MAKE) all MOREFLAGS="-Werror" + +.PHONY: gcc6build +gcc6build: clean + gcc-6 -v + CC=gcc-6 $(MAKE) all MOREFLAGS="-Werror" + +.PHONY: gcc7build +gcc7build: clean + gcc-7 -v + CC=gcc-7 $(MAKE) all MOREFLAGS="-Werror" + +.PHONY: clangbuild +clangbuild: clean + clang -v + CXX=clang++ CC=clang CFLAGS="-Werror -Wconversion -Wno-sign-conversion -Wdocumentation" $(MAKE) all + +m32build: clean + gcc -v + $(MAKE) all32 + +armbuild: clean + CC=arm-linux-gnueabi-gcc CFLAGS="-Werror" $(MAKE) allzstd + +aarch64build: clean + CC=aarch64-linux-gnu-gcc CFLAGS="-Werror" $(MAKE) allzstd + +ppcbuild: clean + CC=powerpc-linux-gnu-gcc CFLAGS="-m32 -Wno-attributes -Werror" $(MAKE) allzstd + +ppc64build: clean + CC=powerpc-linux-gnu-gcc CFLAGS="-m64 -Werror" $(MAKE) allzstd + +armfuzz: clean + CC=arm-linux-gnueabi-gcc QEMU_SYS=qemu-arm-static MOREFLAGS="-static" FUZZER_FLAGS=--no-big-tests $(MAKE) -C $(TESTDIR) fuzztest + +aarch64fuzz: clean + ld -v + CC=aarch64-linux-gnu-gcc QEMU_SYS=qemu-aarch64-static MOREFLAGS="-static" FUZZER_FLAGS=--no-big-tests $(MAKE) -C $(TESTDIR) fuzztest + +ppcfuzz: clean + CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc-static MOREFLAGS="-static" FUZZER_FLAGS=--no-big-tests $(MAKE) -C $(TESTDIR) fuzztest + +ppc64fuzz: clean + CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc64-static MOREFLAGS="-m64 -static" FUZZER_FLAGS=--no-big-tests $(MAKE) -C $(TESTDIR) fuzztest + +.PHONY: cxxtest +cxxtest: CXXFLAGS += -Wall -Wextra -Wundef -Wshadow -Wcast-align -Werror +cxxtest: clean + $(MAKE) -C $(PRGDIR) all CC="$(CXX) -Wno-deprecated" CFLAGS="$(CXXFLAGS)" # adding -Wno-deprecated to avoid clang++ warning on dealing with C files directly + +gcc5test: clean + gcc-5 -v + $(MAKE) all CC=gcc-5 MOREFLAGS="-Werror" + +gcc6test: clean + gcc-6 -v + $(MAKE) all CC=gcc-6 MOREFLAGS="-Werror" + +armtest: clean + $(MAKE) -C $(TESTDIR) datagen # use native, faster + $(MAKE) -C $(TESTDIR) test CC=arm-linux-gnueabi-gcc QEMU_SYS=qemu-arm-static ZSTDRTTEST= MOREFLAGS="-Werror -static" FUZZER_FLAGS=--no-big-tests + +aarch64test: + $(MAKE) -C $(TESTDIR) datagen # use native, faster + $(MAKE) -C $(TESTDIR) test CC=aarch64-linux-gnu-gcc QEMU_SYS=qemu-aarch64-static ZSTDRTTEST= MOREFLAGS="-Werror -static" FUZZER_FLAGS=--no-big-tests + +ppctest: clean + $(MAKE) -C $(TESTDIR) datagen # use native, faster + $(MAKE) -C $(TESTDIR) test CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc-static ZSTDRTTEST= MOREFLAGS="-Werror -Wno-attributes -static" FUZZER_FLAGS=--no-big-tests + +ppc64test: clean + $(MAKE) -C $(TESTDIR) datagen # use native, faster + $(MAKE) -C $(TESTDIR) test CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc64-static ZSTDRTTEST= MOREFLAGS="-m64 -static" FUZZER_FLAGS=--no-big-tests + +arm-ppc-compilation: + $(MAKE) -C $(PRGDIR) clean zstd CC=arm-linux-gnueabi-gcc QEMU_SYS=qemu-arm-static ZSTDRTTEST= MOREFLAGS="-Werror -static" + $(MAKE) -C $(PRGDIR) clean zstd CC=aarch64-linux-gnu-gcc QEMU_SYS=qemu-aarch64-static ZSTDRTTEST= MOREFLAGS="-Werror -static" + $(MAKE) -C $(PRGDIR) clean zstd CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc-static ZSTDRTTEST= MOREFLAGS="-Werror -Wno-attributes -static" + $(MAKE) -C $(PRGDIR) clean zstd CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc64-static ZSTDRTTEST= MOREFLAGS="-m64 -static" + +regressiontest: + $(MAKE) -C $(FUZZDIR) regressiontest + +uasanregressiontest: + $(MAKE) -C $(FUZZDIR) regressiontest CC=clang CXX=clang++ CFLAGS="-O3 -fsanitize=address,undefined" CXXFLAGS="-O3 -fsanitize=address,undefined" + +msanregressiontest: + $(MAKE) -C $(FUZZDIR) regressiontest CC=clang CXX=clang++ CFLAGS="-O3 -fsanitize=memory" CXXFLAGS="-O3 -fsanitize=memory" + +# run UBsan with -fsanitize-recover=signed-integer-overflow +# due to a bug in UBsan when doing pointer subtraction +# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63303 + +usan: clean + $(MAKE) test CC=clang MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize-recover=signed-integer-overflow -fsanitize=undefined -Werror" + +asan: clean + $(MAKE) test CC=clang MOREFLAGS="-g -fsanitize=address -Werror" + +asan-%: clean + LDFLAGS=-fuse-ld=gold MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize=address -Werror" $(MAKE) -C $(TESTDIR) $* + +msan: clean + $(MAKE) test CC=clang MOREFLAGS="-g -fsanitize=memory -fno-omit-frame-pointer -Werror" HAVE_LZMA=0 # datagen.c fails this test for no obvious reason + +msan-%: clean + LDFLAGS=-fuse-ld=gold MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize=memory -fno-omit-frame-pointer -Werror" FUZZER_FLAGS=--no-big-tests $(MAKE) -C $(TESTDIR) HAVE_LZMA=0 $* + +asan32: clean + $(MAKE) -C $(TESTDIR) test32 CC=clang MOREFLAGS="-g -fsanitize=address" + +uasan: clean + $(MAKE) test CC=clang MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize-recover=signed-integer-overflow -fsanitize=address,undefined -Werror" + +uasan-%: clean + LDFLAGS=-fuse-ld=gold MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize-recover=signed-integer-overflow -fsanitize=address,undefined -Werror" $(MAKE) -C $(TESTDIR) $* + +tsan-%: clean + LDFLAGS=-fuse-ld=gold MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize=thread -Werror" $(MAKE) -C $(TESTDIR) $* FUZZER_FLAGS=--no-big-tests + +apt-install: + sudo apt-get -yq --no-install-suggests --no-install-recommends --force-yes install $(APT_PACKAGES) + +apt-add-repo: + sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test + sudo apt-get update -y -qq + +ppcinstall: + APT_PACKAGES="qemu-system-ppc qemu-user-static gcc-powerpc-linux-gnu" $(MAKE) apt-install + +arminstall: + APT_PACKAGES="qemu-system-arm qemu-user-static gcc-arm-linux-gnueabi libc6-dev-armel-cross gcc-aarch64-linux-gnu libc6-dev-arm64-cross" $(MAKE) apt-install + +valgrindinstall: + APT_PACKAGES="valgrind" $(MAKE) apt-install + +libc6install: + APT_PACKAGES="libc6-dev-i386 gcc-multilib" $(MAKE) apt-install + +gcc6install: apt-add-repo + APT_PACKAGES="libc6-dev-i386 gcc-multilib gcc-6 gcc-6-multilib" $(MAKE) apt-install + +gcc7install: apt-add-repo + APT_PACKAGES="libc6-dev-i386 gcc-multilib gcc-7 gcc-7-multilib" $(MAKE) apt-install + +gcc8install: apt-add-repo + APT_PACKAGES="libc6-dev-i386 gcc-multilib gcc-8 gcc-8-multilib" $(MAKE) apt-install + +gpp6install: apt-add-repo + APT_PACKAGES="libc6-dev-i386 g++-multilib gcc-6 g++-6 g++-6-multilib" $(MAKE) apt-install + +clang38install: + APT_PACKAGES="clang-3.8" $(MAKE) apt-install + +# Ubuntu 14.04 ships a too-old lz4 +lz4install: + [ -e lz4 ] || git clone https://github.com/lz4/lz4 && sudo $(MAKE) -C lz4 install + +endif + + +ifneq (,$(filter MSYS%,$(shell uname))) +HOST_OS = MSYS +CMAKE_PARAMS = -G"MSYS Makefiles" -DCMAKE_BUILD_TYPE=Debug -DZSTD_MULTITHREAD_SUPPORT:BOOL=OFF -DZSTD_BUILD_STATIC:BOOL=ON -DZSTD_BUILD_TESTS:BOOL=ON +endif + + +#------------------------------------------------------------------------ +# target specific tests +#------------------------------------------------------------------------ +ifneq (,$(filter $(HOST_OS),MSYS POSIX)) +cmakebuild: + cmake --version + $(RM) -r $(BUILDIR)/cmake/build + mkdir $(BUILDIR)/cmake/build + cd $(BUILDIR)/cmake/build; cmake -DCMAKE_INSTALL_PREFIX:PATH=~/install_test_dir $(CMAKE_PARAMS) .. + $(MAKE) -C $(BUILDIR)/cmake/build -j4; + $(MAKE) -C $(BUILDIR)/cmake/build install; + $(MAKE) -C $(BUILDIR)/cmake/build uninstall; + cd $(BUILDIR)/cmake/build; ctest -V -L Medium + +c89build: clean + $(CC) -v + CFLAGS="-std=c89 -Werror" $(MAKE) allmost # will fail, due to missing support for `long long` + +gnu90build: clean + $(CC) -v + CFLAGS="-std=gnu90 -Werror" $(MAKE) allmost + +c99build: clean + $(CC) -v + CFLAGS="-std=c99 -Werror" $(MAKE) allmost + +gnu99build: clean + $(CC) -v + CFLAGS="-std=gnu99 -Werror" $(MAKE) allmost + +c11build: clean + $(CC) -v + CFLAGS="-std=c11 -Werror" $(MAKE) allmost + +bmix64build: clean + $(CC) -v + CFLAGS="-O3 -mbmi -Werror" $(MAKE) -C $(TESTDIR) test + +bmix32build: clean + $(CC) -v + CFLAGS="-O3 -mbmi -mx32 -Werror" $(MAKE) -C $(TESTDIR) test + +bmi32build: clean + $(CC) -v + CFLAGS="-O3 -mbmi -m32 -Werror" $(MAKE) -C $(TESTDIR) test + +# static analyzer test uses clang's scan-build +# does not analyze zlibWrapper, due to detected issues in zlib source code +staticAnalyze: SCANBUILD ?= scan-build +staticAnalyze: + $(CC) -v + CC=$(CC) CPPFLAGS=-g $(SCANBUILD) --status-bugs -v $(MAKE) allzstd examples contrib +endif diff --cc sys/contrib/zstd/README.md index 5c300fdc49aa,000000000000..dcca7662d2ff mode 100644,000000..100644 --- a/sys/contrib/zstd/README.md +++ b/sys/contrib/zstd/README.md @@@ -1,193 -1,0 +1,199 @@@ +

Zstandard

+ +__Zstandard__, or `zstd` as short version, is a fast lossless compression algorithm, +targeting real-time compression scenarios at zlib-level and better compression ratios. +It's backed by a very fast entropy stage, provided by [Huff0 and FSE library](https://github.com/Cyan4973/FiniteStateEntropy). + +The project is provided as an open-source dual [BSD](LICENSE) and [GPLv2](COPYING) licensed **C** library, +and a command line utility producing and decoding `.zst`, `.gz`, `.xz` and `.lz4` files. +Should your project require another programming language, +a list of known ports and bindings is provided on [Zstandard homepage](http://www.zstd.net/#other-languages). + +**Development branch status:** + +[![Build Status][travisDevBadge]][travisLink] +[![Build status][AppveyorDevBadge]][AppveyorLink] +[![Build status][CircleDevBadge]][CircleLink] +[![Build status][CirrusDevBadge]][CirrusLink] +[![Fuzzing Status][OSSFuzzBadge]][OSSFuzzLink] + +[travisDevBadge]: https://travis-ci.org/facebook/zstd.svg?branch=dev "Continuous Integration test suite" +[travisLink]: https://travis-ci.org/facebook/zstd +[AppveyorDevBadge]: https://ci.appveyor.com/api/projects/status/xt38wbdxjk5mrbem/branch/dev?svg=true "Windows test suite" +[AppveyorLink]: https://ci.appveyor.com/project/YannCollet/zstd-p0yf0 +[CircleDevBadge]: https://circleci.com/gh/facebook/zstd/tree/dev.svg?style=shield "Short test suite" +[CircleLink]: https://circleci.com/gh/facebook/zstd +[CirrusDevBadge]: https://api.cirrus-ci.com/github/facebook/zstd.svg?branch=dev +[CirrusLink]: https://cirrus-ci.com/github/facebook/zstd +[OSSFuzzBadge]: https://oss-fuzz-build-logs.storage.googleapis.com/badges/zstd.svg +[OSSFuzzLink]: https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:zstd + +## Benchmarks + +For reference, several fast compression algorithms were tested and compared +on a server running Arch Linux (`Linux version 5.5.11-arch1-1`), +with a Core i9-9900K CPU @ 5.0GHz, *** 2020 LINES SKIPPED *** From owner-dev-commits-src-main@freebsd.org Fri Dec 25 16:58:52 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1245D4C6507; Fri, 25 Dec 2020 16:58:52 +0000 (UTC) (envelope-from oliver.pntr@gmail.com) Received: from mail-ot1-x32b.google.com (mail-ot1-x32b.google.com [IPv6:2607:f8b0:4864:20::32b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D2Y7H6jSBz3QrL; Fri, 25 Dec 2020 16:58:51 +0000 (UTC) (envelope-from oliver.pntr@gmail.com) Received: by mail-ot1-x32b.google.com with SMTP id d20so4158424otl.3; Fri, 25 Dec 2020 08:58:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=0UPyBaCkHCQA5JZ336Jej7dtQy+SajfDmjAnnCeahXk=; b=OZ+MsMf+XfpjaMHy/9Bu9psWnnSbHTf38cwevDoFrWA+oOrGZulVPnAXP+2xIdK+If azycKhL7TgOszJQMG+IvT15SA58hshutRB4Tk8hkjG7pejigUJXqVDXHdbO/Mg+eCBkj mrdcjNXgPdtVX/ElI83bdrhiukMjd/RdKPCiQN8Z5Amcb24HPFFmiL40si5bLJWww5JC la7/rBxI6M428BG8lFEs+B7x+nunZ+MFgiipnk92PjXFUXeNNLtVh10xfhYg0Sez442r ZGL4ifYPRHs0/xvQat/T+pR2CMldavnILni0FaLty/fNAQQQtTk90Nly9iBNnxI8ZAyx dFcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=0UPyBaCkHCQA5JZ336Jej7dtQy+SajfDmjAnnCeahXk=; b=kIHRWvNovPtYTTWpDvHQngAzEx1wz25iWxhc5UJIp0ietjyeu178m0gmwiFi+YfiI8 2Iy2r287c+b6QXOpqapjhQ7m/negCFbEj5+hYa3D7/hWbB4rcVqV1lwaa4lUYiuNgudR x5PhBOeU5qweXk2Fbiw+8eGOLlFT6VjPYwLTH7/Z/lQO78tQeoyVjkyfYLI/LSX0m852 /Hb5UtqvOvzq3yy5G6CiMcgiRYwUA+63vHdMm/2IqmSfSrOw8YU0w6DgNYgcgZiS57Z5 P1shQXoJuiUuSrqGO90KljCbEeiEyd7GzqO/IFoiuwvudwdg4qfPNrMTWeiAHqj0oW+l cyYA== X-Gm-Message-State: AOAM533RNglMydb87jyNh3n4Sgfb5xgGIEUpBB4Fyemfd+mqV+JRgMzC vpo3TrYURWlCYxVG0FC5lqPZ1vLTDyDWGIMZSKOfNvjY X-Google-Smtp-Source: ABdhPJxKv4nOzZs2UKV7G0vrueAJvPEu0jmMKTXrxxqIbJbpULvtrPEAtJ1qeacHvcDPUqXbzraMQ4tQXhFHiz5aL/g= X-Received: by 2002:a9d:620d:: with SMTP id g13mr25695508otj.56.1608915530605; Fri, 25 Dec 2020 08:58:50 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a4a:a187:0:0:0:0:0 with HTTP; Fri, 25 Dec 2020 08:58:50 -0800 (PST) In-Reply-To: <202012251556.0BPFu9l7029902@gitrepo.freebsd.org> References: <202012251556.0BPFu9l7029902@gitrepo.freebsd.org> From: Oliver Pinter Date: Fri, 25 Dec 2020 17:58:50 +0100 Message-ID: Subject: Re: git: f7cd7fe51c41 - sys/contrib/zstd: Import zstd 1.4.8 To: Conrad Meyer Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" X-Rspamd-Queue-Id: 4D2Y7H6jSBz3QrL X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; TAGGED_FROM(0.00)[]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Dec 2020 16:58:52 -0000 On Friday, December 25, 2020, Conrad Meyer wrote: > The branch main has been updated by cem: > > URL: https://cgit.FreeBSD.org/src/commit/?id= > f7cd7fe51c4140960ebea00410ed62894f5625d1 > > commit f7cd7fe51c4140960ebea00410ed62894f5625d1 > Merge: dc505d53dcc1 f6ae97673c28 > Author: Conrad Meyer > AuthorDate: 2020-12-25 15:42:41 +0000 > Commit: Conrad Meyer > CommitDate: 2020-12-25 15:42:41 +0000 > > sys/contrib/zstd: Import zstd 1.4.8 > > Merge commit 'f6ae97673c28bdb9ae795bd235ab6f26f2536a2d' into main > > Changes from 1.4.5: > * https://github.com/facebook/zstd/releases/tag/v1.4.8 > * https://github.com/facebook/zstd/releases/tag/v1.4.7 > (and there was no public v1.4.6) > > Conflicts: > sys/contrib/zstd/lib/common/zstd_internal.h (new > ZSTD_NO_INTRINSICS) Next time it would be nice to rebase to the most recent master. With the rebase, you could avoid the merge conflicts. > > sys/conf/kern.pre.mk | 6 +- > sys/contrib/zstd/CHANGELOG | 173 +- > sys/contrib/zstd/CONTRIBUTING.md | 18 +- > sys/contrib/zstd/Makefile | 68 +- > sys/contrib/zstd/README.md | 12 +- > sys/contrib/zstd/TESTING.md | 2 +- > sys/contrib/zstd/appveyor.yml | 19 +- > sys/contrib/zstd/doc/zstd_compression_format.md | 114 +- > sys/contrib/zstd/doc/zstd_manual.html | 314 +++- > sys/contrib/zstd/examples/Makefile | 53 +- > sys/contrib/zstd/examples/streaming_compression.c | 1 + > .../examples/streaming_compression_thread_pool.c | 178 ++ > sys/contrib/zstd/lib/Makefile | 365 ++-- > sys/contrib/zstd/lib/README.md | 28 + > sys/contrib/zstd/lib/common/bitstream.h | 39 +- > sys/contrib/zstd/lib/common/compiler.h | 119 +- > sys/contrib/zstd/lib/common/cpu.h | 2 - > sys/contrib/zstd/lib/common/debug.h | 29 +- > sys/contrib/zstd/lib/common/entropy_common.c | 230 ++- > sys/contrib/zstd/lib/common/error_private.c | 1 + > sys/contrib/zstd/lib/common/error_private.h | 2 +- > sys/contrib/zstd/lib/common/fse.h | 50 +- > sys/contrib/zstd/lib/common/fse_decompress.c | 139 +- > sys/contrib/zstd/lib/common/huf.h | 31 +- > sys/contrib/zstd/lib/common/mem.h | 159 +- > sys/contrib/zstd/lib/common/pool.c | 38 +- > sys/contrib/zstd/lib/common/pool.h | 2 +- > sys/contrib/zstd/lib/common/threading.c | 11 +- > sys/contrib/zstd/lib/common/xxhash.c | 74 +- > sys/contrib/zstd/lib/common/xxhash.h | 2 +- > sys/contrib/zstd/lib/common/zstd_common.c | 18 +- > sys/contrib/zstd/lib/common/zstd_deps.h | 111 ++ > sys/contrib/zstd/lib/common/zstd_errors.h | 1 + > sys/contrib/zstd/lib/common/zstd_internal.h | 147 +- > sys/contrib/zstd/lib/compress/fse_compress.c | 53 +- > sys/contrib/zstd/lib/compress/hist.c | 54 +- > sys/contrib/zstd/lib/compress/hist.h | 2 +- > sys/contrib/zstd/lib/compress/huf_compress.c | 316 ++-- > sys/contrib/zstd/lib/compress/zstd_compress.c | 1750 > +++++++++++++++----- > .../zstd/lib/compress/zstd_compress_internal.h | 160 +- > .../zstd/lib/compress/zstd_compress_literals.c | 8 +- > .../zstd/lib/compress/zstd_compress_sequences.c | 20 +- > .../zstd/lib/compress/zstd_compress_superblock.c | 42 +- > sys/contrib/zstd/lib/compress/zstd_cwksp.h | 84 +- > sys/contrib/zstd/lib/compress/zstd_double_fast.c | 44 +- > sys/contrib/zstd/lib/compress/zstd_fast.c | 38 +- > sys/contrib/zstd/lib/compress/zstd_lazy.c | 428 ++++- > sys/contrib/zstd/lib/compress/zstd_lazy.h | 20 + > sys/contrib/zstd/lib/compress/zstd_ldm.c | 77 +- > sys/contrib/zstd/lib/compress/zstd_ldm.h | 6 + > sys/contrib/zstd/lib/compress/zstd_opt.c | 235 ++- > sys/contrib/zstd/lib/compress/zstdmt_compress.c | 480 +----- > sys/contrib/zstd/lib/compress/zstdmt_compress.h | 134 +- > sys/contrib/zstd/lib/decompress/huf_decompress.c | 502 +++--- > sys/contrib/zstd/lib/decompress/zstd_ddict.c | 16 +- > sys/contrib/zstd/lib/decompress/zstd_ddict.h | 2 +- > sys/contrib/zstd/lib/decompress/zstd_decompress.c | 205 ++- > .../zstd/lib/decompress/zstd_decompress_block.c | 184 +- > .../zstd/lib/decompress/zstd_decompress_block.h | 7 +- > .../zstd/lib/decompress/zstd_decompress_internal.h | 21 +- > sys/contrib/zstd/lib/dictBuilder/cover.c | 49 +- > sys/contrib/zstd/lib/dictBuilder/cover.h | 2 +- > sys/contrib/zstd/lib/dictBuilder/fastcover.c | 39 +- > sys/contrib/zstd/lib/dictBuilder/zdict.c | 31 +- > sys/contrib/zstd/lib/dictBuilder/zdict.h | 2 +- > sys/contrib/zstd/lib/legacy/zstd_v01.c | 6 +- > sys/contrib/zstd/lib/legacy/zstd_v02.c | 6 +- > sys/contrib/zstd/lib/legacy/zstd_v03.c | 6 +- > sys/contrib/zstd/lib/legacy/zstd_v04.c | 8 +- > sys/contrib/zstd/lib/legacy/zstd_v05.c | 6 +- > sys/contrib/zstd/lib/legacy/zstd_v06.c | 6 +- > sys/contrib/zstd/lib/legacy/zstd_v07.c | 6 +- > sys/contrib/zstd/lib/libzstd.pc.in | 6 +- > sys/contrib/zstd/lib/zstd.h | 395 ++++- > sys/contrib/zstd/programs/Makefile | 284 ++-- > sys/contrib/zstd/programs/README.md | 70 +- > sys/contrib/zstd/programs/dibio.c | 2 +- > sys/contrib/zstd/programs/fileio.c | 462 ++++-- > sys/contrib/zstd/programs/fileio.h | 29 +- > sys/contrib/zstd/programs/platform.h | 6 + > sys/contrib/zstd/programs/timefn.h | 6 +- > sys/contrib/zstd/programs/util.c | 407 ++++- > sys/contrib/zstd/programs/util.h | 62 +- > sys/contrib/zstd/programs/zstd.1 | 77 +- > sys/contrib/zstd/programs/zstd.1.md | 150 +- > sys/contrib/zstd/programs/zstdcli.c | 195 ++- > sys/contrib/zstd/programs/zstdgrep.1 | 2 +- > sys/contrib/zstd/programs/zstdless.1 | 2 +- > sys/contrib/zstd/zlibWrapper/Makefile | 4 +- > sys/contrib/zstd/zlibWrapper/zstd_zlibwrapper.c | 137 +- > 90 files changed, 6825 insertions(+), 3082 deletions(-) > > > Trim From owner-dev-commits-src-main@freebsd.org Fri Dec 25 17:32:36 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8EFF64C6E1D; Fri, 25 Dec 2020 17:32:36 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-oi1-f179.google.com (mail-oi1-f179.google.com [209.85.167.179]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D2YtC5q0wz3j5h; Fri, 25 Dec 2020 17:32:35 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-oi1-f179.google.com with SMTP id l200so5247463oig.9; Fri, 25 Dec 2020 09:32:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=cxGwa1u2tgsgWEkywRsX2jVtIMhvLJXIo9/UOOWO3GE=; b=JBjH5c/rdOKpq+7VZcPTQK7Y75fXKo6IRVEiDw95Qo/k9VOiMUaUPHyXR95SHAiFWu jMDQNTZHDzyAsWZSBI9vBjGf/Twcb0HQdz/Gmq7iwNMiDQ7HkFUFQYlP2lfaGBonRtSR qoW2J/k17CbAkrojff17rwgVn76jMuWVkDWJL8/w2NabLIg/HngTFo1uYA6TWADBKp+O DNDmwpLPukp6U6IVJljxI1zf4hzXTPPnhBWEDurqOd/fRTF9/aAjIF8dBl/SDw/fylLh SR9PRyzkPhKZoN4TQ8G3nTNLIjswX0mT4hiKzEp7kmMq8tvDW6enl/hqzaA0w1sPOn2M gkPA== X-Gm-Message-State: AOAM5318y1ZAkSWuZLrxay54yn0+ZQumjF+rT1Y8Ya/1HZpGkRKaFu5Z bZcYgO1Er/ocPjLRIo+go4ZCvWBJOdY= X-Google-Smtp-Source: ABdhPJzGfn3TspCiadh7IkJpKZV0jb4+eELhYGC2tp0bcgWNy81wqyB4ykWT/NniTln6l/koGKGWVg== X-Received: by 2002:aca:438b:: with SMTP id q133mr5984794oia.50.1608917554808; Fri, 25 Dec 2020 09:32:34 -0800 (PST) Received: from mail-ot1-f48.google.com (mail-ot1-f48.google.com. [209.85.210.48]) by smtp.gmail.com with ESMTPSA id j11sm7688066oos.47.2020.12.25.09.32.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 25 Dec 2020 09:32:34 -0800 (PST) Received: by mail-ot1-f48.google.com with SMTP id d20so4207912otl.3; Fri, 25 Dec 2020 09:32:34 -0800 (PST) X-Received: by 2002:a9d:37c4:: with SMTP id x62mr26697623otb.87.1608917554572; Fri, 25 Dec 2020 09:32:34 -0800 (PST) MIME-Version: 1.0 References: <202012251556.0BPFu9l7029902@gitrepo.freebsd.org> In-Reply-To: Reply-To: cem@freebsd.org From: Conrad Meyer Date: Fri, 25 Dec 2020 09:32:22 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: f7cd7fe51c41 - sys/contrib/zstd: Import zstd 1.4.8 To: Oliver Pinter Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4D2YtC5q0wz3j5h X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of csecem@gmail.com designates 209.85.167.179 as permitted sender) smtp.mailfrom=csecem@gmail.com X-Spamd-Result: default: False [-0.61 / 15.00]; HAS_REPLYTO(0.00)[cem@freebsd.org]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; REPLYTO_ADDR_EQ_FROM(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; FREEMAIL_TO(0.00)[gmail.com]; FORGED_SENDER(0.30)[cem@freebsd.org,csecem@gmail.com]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; R_DKIM_NA(0.00)[]; TAGGED_FROM(0.00)[]; ARC_NA(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[209.85.167.179:from]; FROM_NEQ_ENVFROM(0.00)[cem@freebsd.org,csecem@gmail.com]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; NEURAL_HAM_MEDIUM(-0.61)[-0.611]; NEURAL_HAM_LONG(-1.00)[-1.000]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; NEURAL_SPAM_SHORT(1.00)[1.000]; SPAMHAUS_ZRD(0.00)[209.85.167.179:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[209.85.167.179:from]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.167.179:from]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[dev-commits-src-all,dev-commits-src-main] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Dec 2020 17:32:36 -0000 On Fri, Dec 25, 2020 at 8:58 AM Oliver Pinter wrote: > On Friday, December 25, 2020, Conrad Meyer wrote: >> >> The branch main has been updated by cem: >> >> URL: https://cgit.FreeBSD.org/src/commit/?id=f7cd7fe51c4140960ebea00410ed62894f5625d1 >> >> commit f7cd7fe51c4140960ebea00410ed62894f5625d1 >> ... >> >> Conflicts: >> sys/contrib/zstd/lib/common/zstd_internal.h (new ZSTD_NO_INTRINSICS) > > > Next time it would be nice to rebase to the most recent master. With the rebase, you could avoid the merge conflicts. Hi Oliver, I believe you are wholly mistaken. The conflict has nothing do with an old master (and in fact, the merge was done on the then-current 'main' branch). The conflict is between local FreeBSD modifications to the sys/contrib code (r361427) that were never present in upstream zstd. Those changes conflicted because upstream introduced a similar mechanism with a different spelling in the same location. In the merge conflict resolution, we dropped our version of the change and added -DZSTD_NO_INTRINSICS to the kernel zstd build (kern.pre.mk ZSTD_C). Conrad From owner-dev-commits-src-main@freebsd.org Fri Dec 25 18:47:07 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8EC234C7AE8; Fri, 25 Dec 2020 18:47:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D2bXC3j06z3m5Y; Fri, 25 Dec 2020 18:47:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 632E727614; Fri, 25 Dec 2020 18:47:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BPIl7r3012747; Fri, 25 Dec 2020 18:47:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BPIl7wx012746; Fri, 25 Dec 2020 18:47:07 GMT (envelope-from git) Date: Fri, 25 Dec 2020 18:47:07 GMT Message-Id: <202012251847.0BPIl7wx012746@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 7d7fad7bd969 - Add tcgetwinsize(3) and tcsetwinsize(3) to termios MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7d7fad7bd969fb464f64d34932234060cee112af Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Dec 2020 18:47:07 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=7d7fad7bd969fb464f64d34932234060cee112af commit 7d7fad7bd969fb464f64d34932234060cee112af Author: Konstantin Belousov AuthorDate: 2020-12-24 23:05:31 +0000 Commit: Konstantin Belousov CommitDate: 2020-12-25 18:43:09 +0000 Add tcgetwinsize(3) and tcsetwinsize(3) to termios These functions get/set tty winsize respectively, and are trivial wrappers around corresponding termio ioctls. The functions are expected to be a part of POSIX.1 issue 8: https://www.austingroupbugs.net/view.php?id=1151#c3856. They are currently available in NetBSD and in musl libc. PR: 251868 Submitted by: Soumendra Ganguly MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D27650 --- include/termios.h | 6 ++++++ lib/libc/gen/Symbol.map | 2 ++ lib/libc/gen/termios.c | 14 ++++++++++++++ sys/sys/_winsize.h | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ sys/sys/ttycom.h | 12 +----------- 5 files changed, 72 insertions(+), 11 deletions(-) diff --git a/include/termios.h b/include/termios.h index ce31d447f60a..9b808329a426 100644 --- a/include/termios.h +++ b/include/termios.h @@ -38,6 +38,9 @@ #include #include #include +#if __BSD_VISIBLE +#include +#endif #ifndef _PID_T_DECLARED typedef __pid_t pid_t; @@ -92,6 +95,9 @@ int tcsetsid(int, pid_t); void cfmakeraw(struct termios *); void cfmakesane(struct termios *); int cfsetspeed(struct termios *, speed_t); + +int tcgetwinsize(int, struct winsize *); +int tcsetwinsize(int, const struct winsize *); #endif __END_DECLS diff --git a/lib/libc/gen/Symbol.map b/lib/libc/gen/Symbol.map index df9ac2227ace..2fb8e080de6a 100644 --- a/lib/libc/gen/Symbol.map +++ b/lib/libc/gen/Symbol.map @@ -428,6 +428,8 @@ FBSD_1.6 { sigandset; sigisemptyset; sigorset; + tcgetwinsize; + tcsetwinsize; }; FBSDprivate_1.0 { diff --git a/lib/libc/gen/termios.c b/lib/libc/gen/termios.c index 7b98c486f472..f072b2f045d9 100644 --- a/lib/libc/gen/termios.c +++ b/lib/libc/gen/termios.c @@ -275,3 +275,17 @@ tcflow(int fd, int action) } /* NOTREACHED */ } + +int +tcgetwinsize(int fd, struct winsize *w) +{ + + return (_ioctl(fd, TIOCGWINSZ, w)); +} + +int +tcsetwinsize(int fd, const struct winsize *w) +{ + + return (_ioctl(fd, TIOCSWINSZ, w)); +} diff --git a/sys/sys/_winsize.h b/sys/sys/_winsize.h new file mode 100644 index 000000000000..78d0b8a6ec38 --- /dev/null +++ b/sys/sys/_winsize.h @@ -0,0 +1,49 @@ +/*- + * SPDX-License-Identifier: BSD-3-Clause + * + * Copyright (c) 1988, 1989, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)ttycom.h 8.1 (Berkeley) 3/28/94 + * $FreeBSD$ + */ + +#ifndef _SYS__WINSIZE_H_ +#define _SYS__WINSIZE_H_ + +/* + * Window/terminal size structure. This information is stored by the kernel + * in order to provide a consistent interface, but is not used by the kernel. + */ +struct winsize { + unsigned short ws_row; /* rows, in characters */ + unsigned short ws_col; /* columns, in characters */ + unsigned short ws_xpixel; /* horizontal size, pixels */ + unsigned short ws_ypixel; /* vertical size, pixels */ +}; + +#endif /* !_SYS__WINSIZE_H_ */ diff --git a/sys/sys/ttycom.h b/sys/sys/ttycom.h index 5aabb074a009..a7309d4c5d6b 100644 --- a/sys/sys/ttycom.h +++ b/sys/sys/ttycom.h @@ -41,23 +41,13 @@ #define _SYS_TTYCOM_H_ #include +#include /* * Tty ioctl's except for those supported only for backwards compatibility * with the old tty driver. */ -/* - * Window/terminal size structure. This information is stored by the kernel - * in order to provide a consistent interface, but is not used by the kernel. - */ -struct winsize { - unsigned short ws_row; /* rows, in characters */ - unsigned short ws_col; /* columns, in characters */ - unsigned short ws_xpixel; /* horizontal size, pixels */ - unsigned short ws_ypixel; /* vertical size, pixels */ -}; - /* 0-2 compat */ /* 3-7 unused */ /* 8-10 compat */ From owner-dev-commits-src-main@freebsd.org Fri Dec 25 19:28:32 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0B4CA4C8946; Fri, 25 Dec 2020 19:28:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D2cRz6QCFz3nGK; Fri, 25 Dec 2020 19:28:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CA1CB27E59; Fri, 25 Dec 2020 19:28:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BPJSVo6056412; Fri, 25 Dec 2020 19:28:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BPJSVcB056411; Fri, 25 Dec 2020 19:28:31 GMT (envelope-from git) Date: Fri, 25 Dec 2020 19:28:31 GMT Message-Id: <202012251928.0BPJSVcB056411@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Marius Strobl Subject: git: eae35125e948 - ada(4): remove remainder of MD geometry translation support MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: marius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: eae35125e948b2d92d3ba1d9687cb08086393ae8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Dec 2020 19:28:32 -0000 The branch main has been updated by marius: URL: https://cgit.FreeBSD.org/src/commit/?id=eae35125e948b2d92d3ba1d9687cb08086393ae8 commit eae35125e948b2d92d3ba1d9687cb08086393ae8 Author: Marius Strobl AuthorDate: 2020-12-25 19:20:54 +0000 Commit: Marius Strobl CommitDate: 2020-12-25 19:20:54 +0000 ada(4): remove remainder of MD geometry translation support This was missed in 9cf738228dc8563732f7cb332737a6d2b732e2e3 and r359718 respectively. --- sys/cam/ata/ata_da.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/sys/cam/ata/ata_da.c b/sys/cam/ata/ata_da.c index cd49776e4f8b..a34df577174c 100644 --- a/sys/cam/ata/ata_da.c +++ b/sys/cam/ata/ata_da.c @@ -894,14 +894,6 @@ static void adaresume(void *arg); #define ADA_WC (softc->write_cache >= 0 ? \ softc->write_cache : ada_write_cache) -/* - * Most platforms map firmware geometry to actual, but some don't. If - * not overridden, default to nothing. - */ -#ifndef ata_disk_firmware_geom_adjust -#define ata_disk_firmware_geom_adjust(disk) -#endif - static int ada_retry_count = ADA_DEFAULT_RETRY; static int ada_default_timeout = ADA_DEFAULT_TIMEOUT; static int ada_send_ordered = ADA_DEFAULT_SEND_ORDERED; @@ -3495,7 +3487,6 @@ adasetgeom(struct ada_softc *softc, struct ccb_getdev *cgd) } softc->disk->d_fwsectors = softc->params.secs_per_track; softc->disk->d_fwheads = softc->params.heads; - ata_disk_firmware_geom_adjust(softc->disk); softc->disk->d_rotation_rate = cgd->ident_data.media_rotation_rate; snprintf(softc->disk->d_attachment, sizeof(softc->disk->d_attachment), "%s%d", softc->cpi.dev_name, softc->cpi.unit_number); From owner-dev-commits-src-main@freebsd.org Fri Dec 25 19:28:32 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 57AC14C89BA; Fri, 25 Dec 2020 19:28:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D2cS016tWz3nGP; Fri, 25 Dec 2020 19:28:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 17EC727D19; Fri, 25 Dec 2020 19:28:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BPJSW4o056480; Fri, 25 Dec 2020 19:28:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BPJSWUP056479; Fri, 25 Dec 2020 19:28:32 GMT (envelope-from git) Date: Fri, 25 Dec 2020 19:28:32 GMT Message-Id: <202012251928.0BPJSWUP056479@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Marius Strobl Subject: git: 5db1ed2f332f - ohci(4): remove support for Sun PCIO-2 USB controllers MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: marius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5db1ed2f332fd784b7c8bf3a0c2182d86cd00d57 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Dec 2020 19:28:32 -0000 The branch main has been updated by marius: URL: https://cgit.FreeBSD.org/src/commit/?id=5db1ed2f332fd784b7c8bf3a0c2182d86cd00d57 commit 5db1ed2f332fd784b7c8bf3a0c2182d86cd00d57 Author: Marius Strobl AuthorDate: 2020-12-24 19:38:46 +0000 Commit: Marius Strobl CommitDate: 2020-12-25 18:47:46 +0000 ohci(4): remove support for Sun PCIO-2 USB controllers It's no longer used since 58aa35d42975c298ca0adba705c042596303c9f5 and r357455 respectively. --- share/man/man4/ohci.4 | 2 -- sys/dev/usb/controller/ohci_pci.c | 14 -------------- 2 files changed, 16 deletions(-) diff --git a/share/man/man4/ohci.4 b/share/man/man4/ohci.4 index a2f2e9ef8e08..318ee511fb61 100644 --- a/share/man/man4/ohci.4 +++ b/share/man/man4/ohci.4 @@ -56,8 +56,6 @@ CMD Tech 670 (USB0670) CMD Tech 673 (USB0673) .It NVIDIA nForce3 -.It -Sun PCIO-2 (RIO USB) .El .Sh SYSCTL VARIABLES The following variables are available as both diff --git a/sys/dev/usb/controller/ohci_pci.c b/sys/dev/usb/controller/ohci_pci.c index 882a9db8885e..8c3ee521b5b1 100644 --- a/sys/dev/usb/controller/ohci_pci.c +++ b/sys/dev/usb/controller/ohci_pci.c @@ -89,7 +89,6 @@ __FBSDID("$FreeBSD$"); #define PCI_OHCI_VENDORID_NVIDIA2 0x10DE #define PCI_OHCI_VENDORID_OPTI 0x1045 #define PCI_OHCI_VENDORID_SIS 0x1039 -#define PCI_OHCI_VENDORID_SUN 0x108e #define PCI_OHCI_BASE_REG 0x10 @@ -174,9 +173,6 @@ ohci_pci_match(device_t self) case 0x70011039: return ("SiS 5571 USB controller"); - case 0x1103108e: - return "Sun PCIO-2 USB controller"; - case 0x0019106b: return ("Apple KeyLargo USB controller"); case 0x003f106b: @@ -228,13 +224,6 @@ ohci_pci_attach(device_t self) pci_enable_busmaster(self); - /* - * Some Sun PCIO-2 USB controllers have their intpin register - * bogusly set to 0, although it should be 4. Correct that. - */ - if (pci_get_devid(self) == 0x1103108e && pci_get_intpin(self) == 0) - pci_set_intpin(self, 4); - rid = PCI_CBMEM; sc->sc_io_res = bus_alloc_resource_any(self, SYS_RES_MEMORY, &rid, RF_ACTIVE); @@ -297,9 +286,6 @@ ohci_pci_attach(device_t self) case PCI_OHCI_VENDORID_SIS: sprintf(sc->sc_vendor, "SiS"); break; - case PCI_OHCI_VENDORID_SUN: - sprintf(sc->sc_vendor, "SUN"); - break; default: if (bootverbose) { device_printf(self, "(New OHCI DeviceId=0x%08x)\n", From owner-dev-commits-src-main@freebsd.org Fri Dec 25 19:28:32 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1C71A4C8737; Fri, 25 Dec 2020 19:28:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D2cS007pLz3nNc; Fri, 25 Dec 2020 19:28:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E6EB227D18; Fri, 25 Dec 2020 19:28:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BPJSVwi056446; Fri, 25 Dec 2020 19:28:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BPJSVwD056445; Fri, 25 Dec 2020 19:28:31 GMT (envelope-from git) Date: Fri, 25 Dec 2020 19:28:31 GMT Message-Id: <202012251928.0BPJSVwD056445@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Marius Strobl Subject: git: b58c853edffc - rtld-elf(1): remove obsolete pre_init() hook MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: marius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b58c853edffcaedf1a38ea34bd8ae1e8a853e129 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Dec 2020 19:28:32 -0000 The branch main has been updated by marius: URL: https://cgit.FreeBSD.org/src/commit/?id=b58c853edffcaedf1a38ea34bd8ae1e8a853e129 commit b58c853edffcaedf1a38ea34bd8ae1e8a853e129 Author: Marius Strobl AuthorDate: 2020-12-24 20:18:44 +0000 Commit: Marius Strobl CommitDate: 2020-12-25 18:47:46 +0000 rtld-elf(1): remove obsolete pre_init() hook It's no longer used since 600ee699ed2805894f5972c6ac2c3d17dca7f6ce and r358358 respectively. --- libexec/rtld-elf/aarch64/reloc.c | 6 ------ libexec/rtld-elf/amd64/reloc.c | 6 ------ libexec/rtld-elf/arm/reloc.c | 6 ------ libexec/rtld-elf/i386/reloc.c | 6 ------ libexec/rtld-elf/mips/reloc.c | 6 ------ libexec/rtld-elf/powerpc/reloc.c | 6 ------ libexec/rtld-elf/powerpc64/reloc.c | 6 ------ libexec/rtld-elf/riscv/reloc.c | 6 ------ libexec/rtld-elf/rtld.c | 6 ------ libexec/rtld-elf/rtld.h | 1 - 10 files changed, 55 deletions(-) diff --git a/libexec/rtld-elf/aarch64/reloc.c b/libexec/rtld-elf/aarch64/reloc.c index 073c0dfaf1a2..8d9c23a41aa5 100644 --- a/libexec/rtld-elf/aarch64/reloc.c +++ b/libexec/rtld-elf/aarch64/reloc.c @@ -360,12 +360,6 @@ ifunc_init(Elf_Auxinfo aux_info[__min_size(AT_COUNT)] __unused) } -void -pre_init(void) -{ - -} - /* * Process non-PLT relocations */ diff --git a/libexec/rtld-elf/amd64/reloc.c b/libexec/rtld-elf/amd64/reloc.c index 4bdda929c0c7..00e538d4b647 100644 --- a/libexec/rtld-elf/amd64/reloc.c +++ b/libexec/rtld-elf/amd64/reloc.c @@ -516,12 +516,6 @@ ifunc_init(Elf_Auxinfo aux_info[__min_size(AT_COUNT)] __unused) } } -void -pre_init(void) -{ - -} - int __getosreldate(void); void diff --git a/libexec/rtld-elf/arm/reloc.c b/libexec/rtld-elf/arm/reloc.c index d389bb0f8e87..7779169667be 100644 --- a/libexec/rtld-elf/arm/reloc.c +++ b/libexec/rtld-elf/arm/reloc.c @@ -488,12 +488,6 @@ ifunc_init(Elf_Auxinfo aux_info[__min_size(AT_COUNT)] __unused) } -void -pre_init(void) -{ - -} - void allocate_initial_tls(Obj_Entry *objs) { diff --git a/libexec/rtld-elf/i386/reloc.c b/libexec/rtld-elf/i386/reloc.c index b4bd09d677b4..7f8ecfa40f8f 100644 --- a/libexec/rtld-elf/i386/reloc.c +++ b/libexec/rtld-elf/i386/reloc.c @@ -502,12 +502,6 @@ ifunc_init(Elf_Auxinfo aux_info[__min_size(AT_COUNT)] __unused) } } -void -pre_init(void) -{ - -} - void allocate_initial_tls(Obj_Entry *objs) { diff --git a/libexec/rtld-elf/mips/reloc.c b/libexec/rtld-elf/mips/reloc.c index b116978114b1..163f9a170872 100644 --- a/libexec/rtld-elf/mips/reloc.c +++ b/libexec/rtld-elf/mips/reloc.c @@ -759,12 +759,6 @@ ifunc_init(Elf_Auxinfo aux_info[__min_size(AT_COUNT)] __unused) } -void -pre_init(void) -{ - -} - void allocate_initial_tls(Obj_Entry *objs) { diff --git a/libexec/rtld-elf/powerpc/reloc.c b/libexec/rtld-elf/powerpc/reloc.c index e98252833014..b624599d7df4 100644 --- a/libexec/rtld-elf/powerpc/reloc.c +++ b/libexec/rtld-elf/powerpc/reloc.c @@ -809,12 +809,6 @@ ifunc_init(Elf_Auxinfo aux_info[__min_size(AT_COUNT)] __unused) } -void -pre_init(void) -{ - -} - void allocate_initial_tls(Obj_Entry *list) { diff --git a/libexec/rtld-elf/powerpc64/reloc.c b/libexec/rtld-elf/powerpc64/reloc.c index e2fbb109f632..a7a963a290e8 100644 --- a/libexec/rtld-elf/powerpc64/reloc.c +++ b/libexec/rtld-elf/powerpc64/reloc.c @@ -706,12 +706,6 @@ ifunc_init(Elf_Auxinfo aux_info[__min_size(AT_COUNT)] __unused) } -void -pre_init(void) -{ - -} - void allocate_initial_tls(Obj_Entry *list) { diff --git a/libexec/rtld-elf/riscv/reloc.c b/libexec/rtld-elf/riscv/reloc.c index 79a045ff0253..1e749206e9b9 100644 --- a/libexec/rtld-elf/riscv/reloc.c +++ b/libexec/rtld-elf/riscv/reloc.c @@ -384,12 +384,6 @@ ifunc_init(Elf_Auxinfo aux_info[__min_size(AT_COUNT)] __unused) } -void -pre_init(void) -{ - -} - void allocate_initial_tls(Obj_Entry *objs) { diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index c6cd285c71d0..27262ab9dbc5 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -803,12 +803,6 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp) obj_main->fini_array = (Elf_Addr)NULL; } - /* - * Execute MD initializers required before we call the objects' - * init functions. - */ - pre_init(); - if (direct_exec) { /* Set osrel for direct-execed binary */ mib[0] = CTL_KERN; diff --git a/libexec/rtld-elf/rtld.h b/libexec/rtld-elf/rtld.h index 32b4e8d3a3a7..85472826a4ec 100644 --- a/libexec/rtld-elf/rtld.h +++ b/libexec/rtld-elf/rtld.h @@ -414,7 +414,6 @@ int reloc_iresolve(Obj_Entry *, struct Struct_RtldLockState *); int reloc_iresolve_nonplt(Obj_Entry *, struct Struct_RtldLockState *); int reloc_gnu_ifunc(Obj_Entry *, int flags, struct Struct_RtldLockState *); void ifunc_init(Elf_Auxinfo[__min_size(AT_COUNT)]); -void pre_init(void); void init_pltgot(Obj_Entry *); void allocate_initial_tls(Obj_Entry *); From owner-dev-commits-src-main@freebsd.org Fri Dec 25 19:28:32 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 36EF94C87BD; Fri, 25 Dec 2020 19:28:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D2cS00sypz3nGM; Fri, 25 Dec 2020 19:28:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0493227A67; Fri, 25 Dec 2020 19:28:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BPJSVWa056463; Fri, 25 Dec 2020 19:28:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BPJSVho056462; Fri, 25 Dec 2020 19:28:31 GMT (envelope-from git) Date: Fri, 25 Dec 2020 19:28:31 GMT Message-Id: <202012251928.0BPJSVho056462@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Marius Strobl Subject: git: 50d823d5b8b6 - fwohci(4): remove support for Sun PCIO-2 FireWire controllers MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: marius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 50d823d5b8b61b96b17dff6f1658774bd438f067 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Dec 2020 19:28:32 -0000 The branch main has been updated by marius: URL: https://cgit.FreeBSD.org/src/commit/?id=50d823d5b8b61b96b17dff6f1658774bd438f067 commit 50d823d5b8b61b96b17dff6f1658774bd438f067 Author: Marius Strobl AuthorDate: 2020-12-24 19:42:41 +0000 Commit: Marius Strobl CommitDate: 2020-12-25 18:47:46 +0000 fwohci(4): remove support for Sun PCIO-2 FireWire controllers It's no longer used since 58aa35d42975c298ca0adba705c042596303c9f5 and r357455 respectively. --- share/man/man4/fwohci.4 | 2 -- sys/dev/firewire/fwohci_pci.c | 12 ------------ sys/dev/firewire/fwohcireg.h | 2 -- 3 files changed, 16 deletions(-) diff --git a/share/man/man4/fwohci.4 b/share/man/man4/fwohci.4 index aa9aff3055f2..3d9f763baef5 100644 --- a/share/man/man4/fwohci.4 +++ b/share/man/man4/fwohci.4 @@ -100,8 +100,6 @@ Sony CX3022 .It Sony i.LINK (CXD3222) .It -Sun PCIO-2 (RIO 1394) -.It Texas Instruments PCI4410A .It Texas Instruments PCI4450 diff --git a/sys/dev/firewire/fwohci_pci.c b/sys/dev/firewire/fwohci_pci.c index aa024df42ac6..595a9d402983 100644 --- a/sys/dev/firewire/fwohci_pci.c +++ b/sys/dev/firewire/fwohci_pci.c @@ -187,10 +187,6 @@ fwohci_pci_probe(device_t dev) device_set_desc(dev, "Adaptec AHA-894x/AIC-5800"); return BUS_PROBE_DEFAULT; } - if (id == (FW_VENDORID_SUN | FW_DEVICE_PCIO2FW)) { - device_set_desc(dev, "Sun PCIO-2"); - return BUS_PROBE_DEFAULT; - } if (pci_get_class(dev) == PCIC_SERIALBUS && pci_get_subclass(dev) == PCIS_SERIALBUS_FW && pci_get_progif(dev) == PCI_INTERFACE_OHCI) { @@ -217,14 +213,6 @@ fwohci_pci_init(device_t self) #endif pci_write_config(self, PCIR_COMMAND, cmd, 2); - /* - * Some Sun PCIO-2 FireWire controllers have their intpin register - * bogusly set to 0, although it should be 3. Correct that. - */ - if (pci_get_devid(self) == (FW_VENDORID_SUN | FW_DEVICE_PCIO2FW) && - pci_get_intpin(self) == 0) - pci_set_intpin(self, 3); - latency = olatency = pci_read_config(self, PCIR_LATTIMER, 1); #define DEF_LATENCY 0x20 if (olatency < DEF_LATENCY) { diff --git a/sys/dev/firewire/fwohcireg.h b/sys/dev/firewire/fwohcireg.h index 775ad62fda1d..9d4626998987 100644 --- a/sys/dev/firewire/fwohcireg.h +++ b/sys/dev/firewire/fwohcireg.h @@ -49,7 +49,6 @@ #define FW_VENDORID_LUCENT 0x11c1 #define FW_VENDORID_INTEL 0x8086 #define FW_VENDORID_ADAPTEC 0x9004 -#define FW_VENDORID_SUN 0x108e #define FW_DEVICE_CS4210 (0x000f << 16) #define FW_DEVICE_UPD861 (0x0063 << 16) @@ -79,7 +78,6 @@ #define FW_DEVICE_FW322 (0x5811 << 16) #define FW_DEVICE_7007 (0x7007 << 16) #define FW_DEVICE_82372FB (0x7605 << 16) -#define FW_DEVICE_PCIO2FW (0x1102 << 16) #define PCI_INTERFACE_OHCI 0x10 From owner-dev-commits-src-main@freebsd.org Fri Dec 25 19:28:32 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0BC564C8A2A; Fri, 25 Dec 2020 19:28:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D2cRz6fCXz3nNb; Fri, 25 Dec 2020 19:28:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D2D4227D17; Fri, 25 Dec 2020 19:28:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BPJSVcL056429; Fri, 25 Dec 2020 19:28:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BPJSVv4056428; Fri, 25 Dec 2020 19:28:31 GMT (envelope-from git) Date: Fri, 25 Dec 2020 19:28:31 GMT Message-Id: <202012251928.0BPJSVv4056428@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Marius Strobl Subject: git: 6535f188f1df - bge(4): remove obsolete support for on-board Fujitsu and Sun MACs MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: marius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6535f188f1df2a13f11925d03ee1bac8d99ffeaf Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Dec 2020 19:28:32 -0000 The branch main has been updated by marius: URL: https://cgit.FreeBSD.org/src/commit/?id=6535f188f1df2a13f11925d03ee1bac8d99ffeaf commit 6535f188f1df2a13f11925d03ee1bac8d99ffeaf Author: Marius Strobl AuthorDate: 2020-12-24 21:32:39 +0000 Commit: Marius Strobl CommitDate: 2020-12-25 19:04:19 +0000 bge(4): remove obsolete support for on-board Fujitsu and Sun MACs It's no longer used since 58aa35d42975c298ca0adba705c042596303c9f5 and r357455 respectively. --- sys/dev/bge/if_bge.c | 1 - sys/dev/bge/if_bgereg.h | 6 ------ 2 files changed, 7 deletions(-) diff --git a/sys/dev/bge/if_bge.c b/sys/dev/bge/if_bge.c index 335230f0ed23..e63a821888e4 100644 --- a/sys/dev/bge/if_bge.c +++ b/sys/dev/bge/if_bge.c @@ -239,7 +239,6 @@ static const struct bge_type { { FJTSU_VENDORID, FJTSU_DEVICEID_PW008GE4 }, { FJTSU_VENDORID, FJTSU_DEVICEID_PW008GE5 }, - { FJTSU_VENDORID, FJTSU_DEVICEID_PP250450 }, { 0, 0 } }; diff --git a/sys/dev/bge/if_bgereg.h b/sys/dev/bge/if_bgereg.h index da3cc6c36af7..494b5f53694f 100644 --- a/sys/dev/bge/if_bgereg.h +++ b/sys/dev/bge/if_bgereg.h @@ -2551,18 +2551,12 @@ struct bge_status_block { #define APPLE_VENDORID 0x106b #define APPLE_DEVICE_BCM5701 0x1645 -/* - * Sun PCI vendor ID - */ -#define SUN_VENDORID 0x108e - /* * Fujitsu vendor/device IDs */ #define FJTSU_VENDORID 0x10cf #define FJTSU_DEVICEID_PW008GE5 0x11a1 #define FJTSU_DEVICEID_PW008GE4 0x11a2 -#define FJTSU_DEVICEID_PP250450 0x11cc /* PRIMEPOWER250/450 LAN */ /* * Offset of MAC address inside EEPROM. From owner-dev-commits-src-main@freebsd.org Fri Dec 25 19:28:32 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8D16E4C8A30; Fri, 25 Dec 2020 19:28:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D2cS029ybz3nTF; Fri, 25 Dec 2020 19:28:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 314DB27E8C; Fri, 25 Dec 2020 19:28:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BPJSW9c056497; Fri, 25 Dec 2020 19:28:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BPJSWtA056496; Fri, 25 Dec 2020 19:28:32 GMT (envelope-from git) Date: Fri, 25 Dec 2020 19:28:32 GMT Message-Id: <202012251928.0BPJSWtA056496@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Marius Strobl Subject: git: 28ca6c20cf72 - gallant12x22(4): remove obsolete font MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: marius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 28ca6c20cf728f9eec1596bfa61464877f471483 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Dec 2020 19:28:33 -0000 The branch main has been updated by marius: URL: https://cgit.FreeBSD.org/src/commit/?id=28ca6c20cf728f9eec1596bfa61464877f471483 commit 28ca6c20cf728f9eec1596bfa61464877f471483 Author: Marius Strobl AuthorDate: 2020-12-24 19:29:22 +0000 Commit: Marius Strobl CommitDate: 2020-12-25 18:47:45 +0000 gallant12x22(4): remove obsolete font It's no longer used since 58aa35d42975c298ca0adba705c042596303c9f5 and r357455 respectively. --- sys/dev/fb/gallant12x22.c | 6196 --------------------------------------------- 1 file changed, 6196 deletions(-) diff --git a/sys/dev/fb/gallant12x22.c b/sys/dev/fb/gallant12x22.c deleted file mode 100644 index 6cb82fac6602..000000000000 --- a/sys/dev/fb/gallant12x22.c +++ /dev/null @@ -1,6196 +0,0 @@ -/* $OpenBSD: gallant12x22.h,v 1.2 2002/05/09 08:59:03 maja Exp $ */ -/* $NetBSD: gallant12x22.h,v 1.2 1999/05/18 21:51:58 ad Exp $ */ - -/*- - * SPDX-License-Identifier: BSD-3-Clause - * - * Copyright (c) 1992, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to the Computer Systems - * Engineering Group at Lawrence Berkeley Laboratory and to the University - * of California at Berkeley by Jef Poskanzer. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * Derived from: @(#)gallant19.h 8.1 (Berkeley) 6/11/93 - */ - -#include -__FBSDID("$FreeBSD$"); - -#include - -#include - -const struct gfb_font gallant12x22 = { - 12, - 22, - { - /* 0 0x00 '^@' */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - - /* 1 0x01 '^A' */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - - /* 2 0x02 '^B' */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - - /* 3 0x03 '^C' */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - - /* 4 0x04 '^D' */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - - /* 5 0x05 '^E' */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - - /* 6 0x06 '^F' */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - - /* 7 0x07 '^G' */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - - /* 8 0x08 '^H' */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - - /* 9 0x09 '^I' */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - - /* 10 0x0a '^J' */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - - /* 11 0x0b '^K' */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - - /* 12 0x0c '^L' */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - - /* 13 0x0d '^M' */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - - /* 14 0x0e '^N' */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - - /* 15 0x0f '^O' */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - - /* 16 0x10 '^P' */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - - /* 17 0x11 '^Q' */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - - /* 18 0x12 '^R' */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - - /* 19 0x13 '^S' */ - 0x00, 0x00, /* ............ */ - 0x31, 0x80, /* ..**...**... */ - 0x31, 0x80, /* ..**...**... */ - 0x31, 0x80, /* ..**...**... */ - 0x31, 0x80, /* ..**...**... */ - 0x31, 0x80, /* ..**...**... */ - 0x31, 0x80, /* ..**...**... */ - 0x31, 0x80, /* ..**...**... */ - 0x31, 0x80, /* ..**...**... */ - 0x31, 0x80, /* ..**...**... */ - 0x31, 0x80, /* ..**...**... */ - 0x31, 0x80, /* ..**...**... */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x31, 0x80, /* ..**...**... */ - 0x31, 0x80, /* ..**...**... */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - - /* 20 0x14 '^T' */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x1f, 0xf0, /* ...********* */ - 0x3c, 0xc0, /* ..****..**.. */ - 0x7c, 0xc0, /* .*****..**.. */ - 0x7c, 0xc0, /* .*****..**.. */ - 0x7c, 0xc0, /* .*****..**.. */ - 0x3c, 0xc0, /* ..****..**.. */ - 0x1c, 0xc0, /* ...***..**.. */ - 0x0c, 0xc0, /* ....**..**.. */ - 0x0c, 0xc0, /* ....**..**.. */ - 0x0c, 0xc0, /* ....**..**.. */ - 0x0c, 0xc0, /* ....**..**.. */ - 0x0c, 0xc0, /* ....**..**.. */ - 0x0c, 0xc0, /* ....**..**.. */ - 0x1c, 0xe0, /* ...***..***. */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - - /* 21 0x15 '^U' */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x1f, 0x00, /* ...*****.... */ - 0x31, 0x80, /* ..**...**... */ - 0x31, 0x80, /* ..**...**... */ - 0x30, 0x00, /* ..**........ */ - 0x30, 0x00, /* ..**........ */ - 0x1f, 0x00, /* ...*****.... */ - 0x31, 0x80, /* ..**...**... */ - 0x31, 0x80, /* ..**...**... */ - 0x1f, 0x00, /* ...*****.... */ - 0x01, 0x80, /* .......**... */ - 0x01, 0x80, /* .......**... */ - 0x31, 0x80, /* ..**...**... */ - 0x31, 0x80, /* ..**...**... */ - 0x1f, 0x00, /* ...*****.... */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - - /* 22 0x16 '^V' */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - - /* 23 0x17 '^W' */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - - /* 24 0x18 '^X' */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - - /* 25 0x19 '^Y' */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - - /* 26 0x1a '^Z' */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - - /* 27 0x1b '^[' */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - - /* 28 0x1c '^\' */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - - /* 29 0x1d '^]' */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - - /* 30 0x1e '^^' */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - - /* 31 0x1f '^_' */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x3f, 0xc0, /* ..********.. */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - - /* 32 0x20 ' ' */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - - /* 33 0x21 '!' */ - 0x00, 0x00, /* ............ */ - 0x06, 0x00, /* .....**..... */ - 0x06, 0x00, /* .....**..... */ - 0x06, 0x00, /* .....**..... */ - 0x06, 0x00, /* .....**..... */ - 0x06, 0x00, /* .....**..... */ - 0x06, 0x00, /* .....**..... */ - 0x06, 0x00, /* .....**..... */ - 0x06, 0x00, /* .....**..... */ - 0x06, 0x00, /* .....**..... */ - 0x06, 0x00, /* .....**..... */ - 0x06, 0x00, /* .....**..... */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x06, 0x00, /* .....**..... */ - 0x06, 0x00, /* .....**..... */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - - /* 34 0x22 '"' */ - 0x00, 0x00, /* ............ */ - 0x19, 0x80, /* ...**..**... */ - 0x19, 0x80, /* ...**..**... */ - 0x19, 0x80, /* ...**..**... */ - 0x19, 0x80, /* ...**..**... */ - 0x19, 0x80, /* ...**..**... */ - 0x19, 0x80, /* ...**..**... */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - - /* 35 0x23 '#' */ - 0x00, 0x00, /* ............ */ - 0x03, 0x30, /* ......**..** */ - 0x03, 0x30, /* ......**..** */ - 0x03, 0x30, /* ......**..** */ - 0x06, 0x60, /* .....**..**. */ - 0x1f, 0xf0, /* ...********* */ - 0x1f, 0xf0, /* ...********* */ - 0x0c, 0xc0, /* ....**..**.. */ - 0x0c, 0xc0, /* ....**..**.. */ - 0x19, 0x80, /* ...**..**... */ - 0x19, 0x80, /* ...**..**... */ - 0x7f, 0xc0, /* .*********.. */ - 0x7f, 0xc0, /* .*********.. */ - 0x33, 0x00, /* ..**..**.... */ - 0x66, 0x00, /* .**..**..... */ - 0x66, 0x00, /* .**..**..... */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - - /* 36 0x24 '$' */ - 0x00, 0x00, /* ............ */ - 0x06, 0x00, /* .....**..... */ - 0x1f, 0x80, /* ...******... */ - 0x3f, 0xc0, /* ..********.. */ - 0x66, 0xe0, /* .**..**.***. */ - 0x66, 0x60, /* .**..**..**. */ - 0x66, 0x00, /* .**..**..... */ - 0x3e, 0x00, /* ..*****..... */ - 0x1f, 0x80, /* ...******... */ - 0x07, 0xc0, /* .....*****.. */ - 0x06, 0x60, /* .....**..**. */ - 0x06, 0x60, /* .....**..**. */ - 0x66, 0x60, /* .**..**..**. */ - 0x7f, 0xc0, /* .*********.. */ - 0x3f, 0x80, /* ..*******... */ - 0x06, 0x00, /* .....**..... */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - - /* 37 0x25 '%' */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x38, 0xc0, /* ..***...**.. */ - 0x4c, 0xc0, /* .*..**..**.. */ - 0x45, 0x80, /* .*...*.**... */ - 0x65, 0x80, /* .**..*.**... */ - 0x3b, 0x00, /* ..***.**.... */ - 0x03, 0x00, /* ......**.... */ - 0x06, 0x00, /* .....**..... */ - 0x06, 0x00, /* .....**..... */ - 0x0c, 0x00, /* ....**...... */ - 0x0d, 0xc0, /* ....**.***.. */ - 0x1a, 0x60, /* ...**.*..**. */ - 0x1a, 0x20, /* ...**.*...*. */ - 0x33, 0x20, /* ..**..**..*. */ - 0x31, 0xc0, /* ..**...***.. */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - *** 5233 LINES SKIPPED *** From owner-dev-commits-src-main@freebsd.org Fri Dec 25 19:28:33 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CEBAF4C89BC; Fri, 25 Dec 2020 19:28:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D2cS034VHz3nGS; Fri, 25 Dec 2020 19:28:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3FFA627E5A; Fri, 25 Dec 2020 19:28:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BPJSWDr056514; Fri, 25 Dec 2020 19:28:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BPJSWuo056513; Fri, 25 Dec 2020 19:28:32 GMT (envelope-from git) Date: Fri, 25 Dec 2020 19:28:32 GMT Message-Id: <202012251928.0BPJSWuo056513@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Marius Strobl Subject: git: 9cca83b6dba1 - mk48txx(4): remove obsolete driver MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: marius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9cca83b6dba1114454c77a7afa9c7f1f016a140b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Dec 2020 19:28:33 -0000 The branch main has been updated by marius: URL: https://cgit.FreeBSD.org/src/commit/?id=9cca83b6dba1114454c77a7afa9c7f1f016a140b commit 9cca83b6dba1114454c77a7afa9c7f1f016a140b Author: Marius Strobl AuthorDate: 2020-12-24 19:27:20 +0000 Commit: Marius Strobl CommitDate: 2020-12-25 18:47:45 +0000 mk48txx(4): remove obsolete driver It's no longer used since 58aa35d42975c298ca0adba705c042596303c9f5 and r357455 respectively. --- ObsoleteFiles.inc | 3 + share/man/man4/Makefile | 1 - share/man/man4/mk48txx.4 | 225 ------------------- sys/conf/files | 1 - sys/dev/mk48txx/mk48txx.c | 332 ---------------------------- sys/dev/mk48txx/mk48txxreg.h | 161 -------------- sys/dev/mk48txx/mk48txxvar.h | 63 ------ tools/kerneldoc/subsys/Doxyfile-dev_mk48txx | 21 -- 8 files changed, 3 insertions(+), 804 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index f551bc759399..27f59a757080 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -36,6 +36,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20201224: mk48txx(4) removed +OLD_FILES+=usr/share/man/man4/mk48txx.4.gz + # 20201215: in-tree gdb removed OLD_FILES+=usr/libexec/gdb OLD_FILES+=usr/libexec/kgdb diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index 626e83a4c4df..c9bf21503096 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -286,7 +286,6 @@ MAN= aac.4 \ meteor.4 \ mfi.4 \ miibus.4 \ - mk48txx.4 \ mld.4 \ mlx.4 \ mlx4en.4 \ diff --git a/share/man/man4/mk48txx.4 b/share/man/man4/mk48txx.4 deleted file mode 100644 index 30385934f5e8..000000000000 --- a/share/man/man4/mk48txx.4 +++ /dev/null @@ -1,225 +0,0 @@ -.\" $NetBSD: mk48txx.4,v 1.16 2009/04/10 17:14:07 joerg Exp $ -.\" -.\" Copyright (c) 2000, 2002 The NetBSD Foundation, Inc. -.\" All rights reserved. -.\" -.\" This code is derived from software contributed to The NetBSD Foundation -.\" by Paul Kranenburg. -.\" -.\" 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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$ -.\" -.Dd December 25, 2009 -.Dt MK48TXX 4 -.Os -.Sh NAME -.Nm mk48txx -.Nd -.Tn Mostek -time-of-day clock driver -.Sh SYNOPSIS -.In sys/eventhandler.h -.In sys/lock.h -.In sys/mutex.h -.In dev/mk48txx/mk48txxvar.h -.Pp -To compile this driver into the kernel, -place the following line in your -kernel configuration file: -.Bd -ragged -offset indent -.Cd "device mk48txx" -.Ed -.Sh DESCRIPTION -The -.Nm -driver is a back-end for several models of -.Tn Mostek -time-of-day clock chips. -It provides access methods to retrieve and set date and time for use with the -.Dq Li clock -KOBJ interface. -.Pp -To tie an instance of this device to the system, use the -.Fn mk48txx_attach -function and the mk48txx_softc structure defined as follows: -.Pp -.Ft "int" -.Fn mk48txx_attach "device_t dev" -.Bd -literal -typedef uint8_t (*mk48txx_nvrd_t)(device_t dev, int off); -typedef void (*mk48txx_nvwr_t)(device_t dev, int off, uint8_t v); -.Ed -.Bd -literal -struct mk48txx_softc { - struct resource sc_res; - struct mtx sc_mtx; - eventhandler_tag sc_wet; - const char *sc_model; - bus_size_t sc_nvramsz; - bus_size_t sc_clkoffset; - u_int sc_year0; - u_int sc_flag; - mk48txx_nvrd_t sc_nvrd; - mk48txx_nvwr_t sc_nvwr; -}; -.Ed -.Bl -tag -width indent -.It Fa sc_res -The bus resource used for accessing the chip's non-volatile memory -.Pq including the clock registers , -which must be supplied by the front-end when using the default access methods -.Pq see below . -Otherwise this member is optional. -.It Fa sc_mtx -The hardware mutex used when accessing the chip's non-volatile memory -.Pq including the clock registers , -which must be initialized with -.Dv MTX_DEF -by the front-end. -.It Fa sc_wet -The event handler tag for the watchdog functionality, -which is registered by the -.Fn mk48txx_attach -function if supported by the chip and specified as part of the -machine-dependent features -.Pq see below . -.It Fa sc_model -The chip model which this instance should serve. -This member must be set to one of -.Dq mk48t02 , -.Dq mk48t08 , -.Dq mk48t18 , -or -.Dq mk48t59 -by the front-end. -.It Fa sc_nvramsz -The size of the non-volatile RAM in the -.Tn Mostek -chip, -which is set by the -.Fn mk48txx_attach -function. -.It Fa sc_clkoffset -The offset into the control registers of the -.Tn Mostek -chip, -which is set by the -.Fn mk48txx_attach -function. -.It Fa sc_year0 -The year offset to be used with the -.Sq year -counter of the clock, -which must be set by the front-end. -This value is generally dependent on the system configuration in which -the clock device is mounted. -For instance, on -.Tn Sun Microsystems -machines the convention is to have clock's two-digit year represent -the year since 1968. -.It Fa sc_flag -This flag is used to specify machine-dependent features. -The following flags are supported: -.Bl -tag -width ".Dv MK48TXX_WDOG_ENABLE_WDS" -.It Dv MK48TXX_NO_CENT_ADJUST -If the resulting date retrieved with the -.Dq Li clock_gettime() method -would be earlier than January 1, 1970, -the driver will assume that the chip's year counter actually represents a -year in the 21st century. -This behavior can be overridden by setting this flag, -which causes the -.Nm -driver to respect the clock's century bit instead. -.It Dv MK48TXX_WDOG_REGISTER -When this flag is set, -the -.Nm -driver will register as a watchdog via the interface defined in -.Xr watchdog 9 -if supported by the specific chip model. -.It Dv MK48TXX_WDOG_ENABLE_WDS -When this flag is set, -the -.Nm -driver will set the watchdog steering -.Pq WDS -bit when enabling the watchdog functionality of the chip. -enabled -.Pq see the chip documentation for further information regarding the WDS bit . -.El -.It Fa sc_nvread -.It Fa sc_nvwrite -These members specify the access methods for reading respectively writing -clock device registers. -The default, -when -.Dv NULL -is passed as an access method, -is to access the chip memory -.Pq and clock registers -as if they were direct-mapped using the specified bus resource. -.Pp -Otherwise, the driver will call the respective function supplied by the -front-end to perform the access, -passing it the offset -.Va off -of the chip memory -.Pq or clock register -location to be read from or written to, respectively. -.El -.Sh HARDWARE -The following models are supported: -.Pp -.Bl -tag -width indent -offset indent -compact -.It Tn Mostek MK48T02 -.It Tn Mostek MK48T08 -.It Tn Mostek MK48T18 -.It Tn Mostek MK48T59 -.El -.Sh SEE ALSO -.Xr intro 4 , -.Xr watchdog 9 -.Sh HISTORY -The -.Nm mk48txx -driver appeared in -.Nx 1.5 . -The first -.Fx -version to include it was -.Fx 5.0 . -.Sh AUTHORS -.An -nosplit -The -.Nm -driver was written for -.Nx -by -.An Paul Kranenburg Aq Mt pk@NetBSD.org . -It was ported to -.Fx -by -.An Thomas Moestl Aq Mt tmm@FreeBSD.org -and later on improved by -.An Marius Strobl Aq Mt marius@FreeBSD.org . diff --git a/sys/conf/files b/sys/conf/files index 6f6fcac25bbe..86dce97eb5e8 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -2439,7 +2439,6 @@ dev/mii/ukphy.c optional miibus | mii dev/mii/ukphy_subr.c optional miibus | mii dev/mii/vscphy.c optional miibus | vscphy dev/mii/xmphy.c optional miibus | xmphy -dev/mk48txx/mk48txx.c optional mk48txx dev/mlxfw/mlxfw_fsm.c optional mlxfw \ compile-with "${MLXFW_C}" dev/mlxfw/mlxfw_mfa2.c optional mlxfw \ diff --git a/sys/dev/mk48txx/mk48txx.c b/sys/dev/mk48txx/mk48txx.c deleted file mode 100644 index 04867b14c0f2..000000000000 --- a/sys/dev/mk48txx/mk48txx.c +++ /dev/null @@ -1,332 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD - * - * Copyright (c) 2000 The NetBSD Foundation, Inc. - * All rights reserved. - * - * This code is derived from software contributed to The NetBSD Foundation - * by Paul Kranenburg. - * - * 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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. - * - * $NetBSD: mk48txx.c,v 1.25 2008/04/28 20:23:50 martin Exp $ - */ - -#include -__FBSDID("$FreeBSD$"); - -/* - * Mostek MK48T02, MK48T08, MK48T18, MK48T37 and MK48T59 time-of-day chip - * subroutines - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include - -#include "clock_if.h" - -static uint8_t mk48txx_def_nvrd(device_t dev, int off); -static void mk48txx_def_nvwr(device_t dev, int off, uint8_t v); -static void mk48txx_watchdog(void *arg, u_int cmd, int *error); - -static const struct { - const char *name; - bus_size_t nvramsz; - bus_size_t clkoff; - u_int flags; -#define MK48TXX_EXT_REGISTERS 1 /* Has extended register set. */ -} mk48txx_models[] = { - { "mk48t02", MK48T02_CLKSZ, MK48T02_CLKOFF, 0 }, - { "mk48t08", MK48T08_CLKSZ, MK48T08_CLKOFF, 0 }, - { "mk48t18", MK48T18_CLKSZ, MK48T18_CLKOFF, 0 }, - { "mk48t37", MK48T37_CLKSZ, MK48T37_CLKOFF, MK48TXX_EXT_REGISTERS }, - { "mk48t59", MK48T59_CLKSZ, MK48T59_CLKOFF, MK48TXX_EXT_REGISTERS }, -}; - -int -mk48txx_attach(device_t dev) -{ - struct mk48txx_softc *sc; - int i; - uint8_t wday; - - sc = device_get_softc(dev); - - if (mtx_initialized(&sc->sc_mtx) == 0) { - device_printf(dev, "%s: mutex not initialized\n", __func__); - return (ENXIO); - } - - device_printf(dev, "model %s", sc->sc_model); - i = sizeof(mk48txx_models) / sizeof(mk48txx_models[0]); - while (--i >= 0) { - if (strcmp(sc->sc_model, mk48txx_models[i].name) == 0) { - break; - } - } - if (i < 0) { - device_printf(dev, " (unsupported)\n"); - return (ENXIO); - } - printf("\n"); - sc->sc_nvramsz = mk48txx_models[i].nvramsz; - sc->sc_clkoffset = mk48txx_models[i].clkoff; - - if (sc->sc_nvrd == NULL) - sc->sc_nvrd = mk48txx_def_nvrd; - if (sc->sc_nvwr == NULL) - sc->sc_nvwr = mk48txx_def_nvwr; - - if (mk48txx_models[i].flags & MK48TXX_EXT_REGISTERS) { - mtx_lock(&sc->sc_mtx); - if ((*sc->sc_nvrd)(dev, sc->sc_clkoffset + MK48TXX_FLAGS) & - MK48TXX_FLAGS_BL) { - mtx_unlock(&sc->sc_mtx); - device_printf(dev, "%s: battery low\n", __func__); - return (ENXIO); - } - mtx_unlock(&sc->sc_mtx); - } - - if (sc->sc_flag & MK48TXX_NO_CENT_ADJUST) { - /* - * Use MK48TXX_WDAY_CB instead of manually adjusting the - * century. - */ - if (!(mk48txx_models[i].flags & MK48TXX_EXT_REGISTERS)) { - device_printf(dev, "%s: no century bit\n", __func__); - return (ENXIO); - } else { - mtx_lock(&sc->sc_mtx); - wday = (*sc->sc_nvrd) - (dev, sc->sc_clkoffset + MK48TXX_IWDAY); - wday |= MK48TXX_WDAY_CEB; - (*sc->sc_nvwr) - (dev, sc->sc_clkoffset + MK48TXX_IWDAY, wday); - mtx_unlock(&sc->sc_mtx); - } - } - - clock_register(dev, 1000000); /* 1 second resolution */ - - if ((sc->sc_flag & MK48TXX_WDOG_REGISTER) && - (mk48txx_models[i].flags & MK48TXX_EXT_REGISTERS)) { - sc->sc_wet = EVENTHANDLER_REGISTER(watchdog_list, - mk48txx_watchdog, dev, 0); - device_printf(dev, - "watchdog registered, timeout interval max. 128 sec\n"); - } - - return (0); -} - -/* - * Get time-of-day and convert to a `struct timespec' - * Return 0 on success; an error number otherwise. - */ -int -mk48txx_gettime(device_t dev, struct timespec *ts) -{ - struct mk48txx_softc *sc; - bus_size_t clkoff; - struct clocktime ct; - int year; - uint8_t csr; - - sc = device_get_softc(dev); - clkoff = sc->sc_clkoffset; - - mtx_lock(&sc->sc_mtx); - /* enable read (stop time) */ - csr = (*sc->sc_nvrd)(dev, clkoff + MK48TXX_ICSR); - csr |= MK48TXX_CSR_READ; - (*sc->sc_nvwr)(dev, clkoff + MK48TXX_ICSR, csr); - -#define FROMREG(reg, mask) ((*sc->sc_nvrd)(dev, clkoff + (reg)) & (mask)) - - ct.nsec = 0; - ct.sec = FROMBCD(FROMREG(MK48TXX_ISEC, MK48TXX_SEC_MASK)); - ct.min = FROMBCD(FROMREG(MK48TXX_IMIN, MK48TXX_MIN_MASK)); - ct.hour = FROMBCD(FROMREG(MK48TXX_IHOUR, MK48TXX_HOUR_MASK)); - ct.day = FROMBCD(FROMREG(MK48TXX_IDAY, MK48TXX_DAY_MASK)); -#if 0 - /* Map dow from 1 - 7 to 0 - 6; FROMBCD() isn't necessary here. */ - ct.dow = FROMREG(MK48TXX_IWDAY, MK48TXX_WDAY_MASK) - 1; -#else - /* - * Set dow = -1 because some drivers (for example the NetBSD and - * OpenBSD mk48txx(4)) don't set it correctly. - */ - ct.dow = -1; -#endif - ct.mon = FROMBCD(FROMREG(MK48TXX_IMON, MK48TXX_MON_MASK)); - year = FROMBCD(FROMREG(MK48TXX_IYEAR, MK48TXX_YEAR_MASK)); - year += sc->sc_year0; - if (sc->sc_flag & MK48TXX_NO_CENT_ADJUST) - year += (FROMREG(MK48TXX_IWDAY, MK48TXX_WDAY_CB) >> - MK48TXX_WDAY_CB_SHIFT) * 100; - else if (year < POSIX_BASE_YEAR) - year += 100; - -#undef FROMREG - - ct.year = year; - - /* time wears on */ - csr = (*sc->sc_nvrd)(dev, clkoff + MK48TXX_ICSR); - csr &= ~MK48TXX_CSR_READ; - (*sc->sc_nvwr)(dev, clkoff + MK48TXX_ICSR, csr); - mtx_unlock(&sc->sc_mtx); - - return (clock_ct_to_ts(&ct, ts)); -} - -/* - * Set the time-of-day clock based on the value of the `struct timespec' arg. - * Return 0 on success; an error number otherwise. - */ -int -mk48txx_settime(device_t dev, struct timespec *ts) -{ - struct mk48txx_softc *sc; - bus_size_t clkoff; - struct clocktime ct; - uint8_t csr; - int cent, year; - - sc = device_get_softc(dev); - clkoff = sc->sc_clkoffset; - - /* Accuracy is only one second. */ - if (ts->tv_nsec >= 500000000) - ts->tv_sec++; - ts->tv_nsec = 0; - clock_ts_to_ct(ts, &ct); - - mtx_lock(&sc->sc_mtx); - /* enable write */ - csr = (*sc->sc_nvrd)(dev, clkoff + MK48TXX_ICSR); - csr |= MK48TXX_CSR_WRITE; - (*sc->sc_nvwr)(dev, clkoff + MK48TXX_ICSR, csr); - -#define TOREG(reg, mask, val) \ - ((*sc->sc_nvwr)(dev, clkoff + (reg), \ - ((*sc->sc_nvrd)(dev, clkoff + (reg)) & ~(mask)) | \ - ((val) & (mask)))) - - TOREG(MK48TXX_ISEC, MK48TXX_SEC_MASK, TOBCD(ct.sec)); - TOREG(MK48TXX_IMIN, MK48TXX_MIN_MASK, TOBCD(ct.min)); - TOREG(MK48TXX_IHOUR, MK48TXX_HOUR_MASK, TOBCD(ct.hour)); - /* Map dow from 0 - 6 to 1 - 7; TOBCD() isn't necessary here. */ - TOREG(MK48TXX_IWDAY, MK48TXX_WDAY_MASK, ct.dow + 1); - TOREG(MK48TXX_IDAY, MK48TXX_DAY_MASK, TOBCD(ct.day)); - TOREG(MK48TXX_IMON, MK48TXX_MON_MASK, TOBCD(ct.mon)); - - year = ct.year - sc->sc_year0; - if (sc->sc_flag & MK48TXX_NO_CENT_ADJUST) { - cent = year / 100; - TOREG(MK48TXX_IWDAY, MK48TXX_WDAY_CB, - cent << MK48TXX_WDAY_CB_SHIFT); - year -= cent * 100; - } else if (year > 99) - year -= 100; - TOREG(MK48TXX_IYEAR, MK48TXX_YEAR_MASK, TOBCD(year)); - -#undef TOREG - - /* load them up */ - csr = (*sc->sc_nvrd)(dev, clkoff + MK48TXX_ICSR); - csr &= ~MK48TXX_CSR_WRITE; - (*sc->sc_nvwr)(dev, clkoff + MK48TXX_ICSR, csr); - mtx_unlock(&sc->sc_mtx); - return (0); -} - -static uint8_t -mk48txx_def_nvrd(device_t dev, int off) -{ - struct mk48txx_softc *sc; - - sc = device_get_softc(dev); - return (bus_read_1(sc->sc_res, off)); -} - -static void -mk48txx_def_nvwr(device_t dev, int off, uint8_t v) -{ - struct mk48txx_softc *sc; - - sc = device_get_softc(dev); - bus_write_1(sc->sc_res, off, v); -} - -static void -mk48txx_watchdog(void *arg, u_int cmd, int *error) -{ - device_t dev; - struct mk48txx_softc *sc; - uint8_t t, wdog; - - dev = arg; - sc = device_get_softc(dev); - - t = cmd & WD_INTERVAL; - if (t >= 26 && t <= 37) { - wdog = 0; - if (t <= WD_TO_2SEC) { - wdog |= MK48TXX_WDOG_RB_1_16; - t -= 26; - } else if (t <= WD_TO_8SEC) { - wdog |= MK48TXX_WDOG_RB_1_4; - t -= WD_TO_250MS; - } else if (t <= WD_TO_32SEC) { - wdog |= MK48TXX_WDOG_RB_1; - t -= WD_TO_1SEC; - } else { - wdog |= MK48TXX_WDOG_RB_4; - t -= WD_TO_4SEC; - } - wdog |= (min(1 << t, - MK48TXX_WDOG_BMB_MASK >> MK48TXX_WDOG_BMB_SHIFT)) << - MK48TXX_WDOG_BMB_SHIFT; - if (sc->sc_flag & MK48TXX_WDOG_ENABLE_WDS) - wdog |= MK48TXX_WDOG_WDS; - *error = 0; - } else { - wdog = 0; - } - mtx_lock(&sc->sc_mtx); - (*sc->sc_nvwr)(dev, sc->sc_clkoffset + MK48TXX_WDOG, wdog); - mtx_unlock(&sc->sc_mtx); -} diff --git a/sys/dev/mk48txx/mk48txxreg.h b/sys/dev/mk48txx/mk48txxreg.h deleted file mode 100644 index 7ff432c4b3b7..000000000000 --- a/sys/dev/mk48txx/mk48txxreg.h +++ /dev/null @@ -1,161 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD - * - * Copyright (c) 2000 The NetBSD Foundation, Inc. - * All rights reserved. - * - * This code is derived from software contributed to The NetBSD Foundation - * by Paul Kranenburg. - * - * 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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. - * - * $NetBSD: mk48txxreg.h,v 1.10 2008/04/28 20:23:50 martin Exp $ - * - * $FreeBSD$ - */ - -/* - * Mostek MK48Txx clocks. - * - * The MK48T02 has 2KB of non-volatile memory. The time-of-day clock - * registers start at offset 0x7f8. - * - * The MK48T08 and MK48T18 have 8KB of non-volatile memory - * - * The MK48T59 also has 8KB of non-volatile memory but in addition it - * has a battery low detection bit and a power supply wakeup alarm for - * power management. It's at offset 0x1ff0 in the NVRAM. - */ - -/* - * Mostek MK48TXX register definitions - */ - -/* - * The first bank of eight registers at offset (nvramsz - 16) is - * available only on recenter (which?) MK48Txx models. - */ -#define MK48TXX_FLAGS 0 /* flags register */ -#define MK48TXX_UNUSED 1 /* unused */ -#define MK48TXX_ASEC 2 /* alarm seconds (0..59; BCD) */ -#define MK48TXX_AMIN 3 /* alarm minutes (0..59; BCD) */ -#define MK48TXX_AHOUR 4 /* alarm hours (0..23; BCD) */ -#define MK48TXX_ADAY 5 /* alarm day in month (1..31; BCD) */ -#define MK48TXX_INTR 6 /* interrupts register */ -#define MK48TXX_WDOG 7 /* watchdog register */ - -#define MK48TXX_ICSR 8 /* control register */ -#define MK48TXX_ISEC 9 /* seconds (0..59; BCD) */ -#define MK48TXX_IMIN 10 /* minutes (0..59; BCD) */ -#define MK48TXX_IHOUR 11 /* hours (0..23; BCD) */ -#define MK48TXX_IWDAY 12 /* weekday (1..7) */ -#define MK48TXX_IDAY 13 /* day in month (1..31; BCD) */ -#define MK48TXX_IMON 14 /* month (1..12; BCD) */ -#define MK48TXX_IYEAR 15 /* year (0..99; BCD) */ - -/* - * Note that some of the bits below that are not in the first eight - * registers are also only available on models with an extended - * register set. - */ - -/* Bits in the flags register (extended only) */ -#define MK48TXX_FLAGS_BL 0x10 /* battery low (read only) */ -#define MK48TXX_FLAGS_AF 0x40 /* alarm flag (read only) */ -#define MK48TXX_FLAGS_WDF 0x80 /* watchdog flag (read only) */ - -/* Bits in the alarm seconds register (extended only) */ -#define MK48TXX_ASEC_MASK 0x7f /* mask for alarm seconds */ -#define MK48TXX_ASEC_RPT1 0x80 /* alarm repeat mode bit 1 */ - -/* Bits in the alarm minutes register (extended only) */ -#define MK48TXX_AMIN_MASK 0x7f /* mask for alarm minutes */ -#define MK48TXX_AMIN_RPT2 0x80 /* alarm repeat mode bit 2 */ - -/* Bits in the alarm hours register (extended only) */ -#define MK48TXX_AHOUR_MASK 0x3f /* mask for alarm hours */ -#define MK48TXX_AHOUR_RPT3 0x80 /* alarm repeat mode bit 3 */ - -/* Bits in the alarm day in month register (extended only) */ -#define MK48TXX_ADAY_MASK 0x3f /* mask for alarm day in month */ -#define MK48TXX_ADAY_RPT4 0x80 /* alarm repeat mode bit 4 */ - -/* Bits in the interrupts register (extended only) */ -#define MK48TXX_INTR_ABE 0x20 /* alarm in battery back-up mode */ -#define MK48TXX_INTR_AFE 0x80 /* alarm flag enable */ - -/* Bits in the watchdog register (extended only) */ -#define MK48TXX_WDOG_RB_1_16 0x00 /* watchdog resolution 1/16 second */ -#define MK48TXX_WDOG_RB_1_4 0x01 /* watchdog resolution 1/4 second */ -#define MK48TXX_WDOG_RB_1 0x02 /* watchdog resolution 1 second */ -#define MK48TXX_WDOG_RB_4 0x03 /* watchdog resolution 4 seconds */ -#define MK48TXX_WDOG_BMB_MASK 0x7c /* mask for watchdog multiplier */ -#define MK48TXX_WDOG_BMB_SHIFT 2 /* shift for watchdog multiplier */ -#define MK48TXX_WDOG_WDS 0x80 /* watchdog steering bit */ - -/* Bits in the control register */ -#define MK48TXX_CSR_CALIB_MASK 0x1f /* mask for calibration step width */ -#define MK48TXX_CSR_SIGN 0x20 /* sign of above calibration witdh */ -#define MK48TXX_CSR_READ 0x40 /* want to read (freeze clock) */ -#define MK48TXX_CSR_WRITE 0x80 /* want to write */ - -/* Bits in the seconds register */ -#define MK48TXX_SEC_MASK 0x7f /* mask for seconds */ -#define MK48TXX_SEC_ST 0x80 /* stop oscillator */ - -/* Bits in the minutes register */ -#define MK48TXX_MIN_MASK 0x7f /* mask for minutes */ - -/* Bits in the hours register */ -#define MK48TXX_HOUR_MASK 0x3f /* mask for hours */ - -/* Bits in the century/weekday register */ -#define MK48TXX_WDAY_MASK 0x07 /* mask for weekday */ -#define MK48TXX_WDAY_CB 0x10 /* century bit (extended only) */ -#define MK48TXX_WDAY_CB_SHIFT 4 /* shift for century bit */ -#define MK48TXX_WDAY_CEB 0x20 /* century enable bit (extended only) */ -#define MK48TXX_WDAY_FT 0x40 /* frequency test */ - -/* Bits in the day in month register */ -#define MK48TXX_DAY_MASK 0x3f /* mask for day in month */ - -/* Bits in the month register */ -#define MK48TXX_MON_MASK 0x1f /* mask for month */ - -/* Bits in the year register */ -#define MK48TXX_YEAR_MASK 0xff /* mask for year */ - -/* Model specific NVRAM sizes and clock offsets */ -#define MK48T02_CLKSZ 2048 -#define MK48T02_CLKOFF 0x7f0 - -#define MK48T08_CLKSZ 8192 -#define MK48T08_CLKOFF 0x1ff0 - -#define MK48T18_CLKSZ 8192 -#define MK48T18_CLKOFF 0x1ff0 - -#define MK48T37_CLKSZ 32768 -#define MK48T37_CLKOFF 0x1ff0 - -#define MK48T59_CLKSZ 8192 -#define MK48T59_CLKOFF 0x1ff0 diff --git a/sys/dev/mk48txx/mk48txxvar.h b/sys/dev/mk48txx/mk48txxvar.h deleted file mode 100644 index f51f4e715415..000000000000 --- a/sys/dev/mk48txx/mk48txxvar.h +++ /dev/null @@ -1,63 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD - * - * Copyright (c) 2000 The NetBSD Foundation, Inc. - * All rights reserved. - * - * This code is derived from software contributed to The NetBSD Foundation - * by Paul Kranenburg. - * - * 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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. - * - * $NetBSD: mk48txxvar.h,v 1.6 2008/04/28 20:23:50 martin Exp $ - * - * $FreeBSD$ - */ - -typedef uint8_t (*mk48txx_nvrd_t)(device_t dev, int off); -typedef void (*mk48txx_nvwr_t)(device_t dev, int off, uint8_t v); - -struct mk48txx_softc { - struct resource *sc_res;/* bus resource */ - - struct mtx sc_mtx; /* hardware mutex */ - eventhandler_tag sc_wet; /* watchdog event handler tag */ - - const char *sc_model; /* chip model name */ - bus_size_t sc_nvramsz; /* Size of NVRAM on the chip */ - bus_size_t sc_clkoffset; /* Offset in NVRAM to clock bits */ - u_int sc_year0; /* year counter offset */ - u_int sc_flag; /* MD flags */ -#define MK48TXX_NO_CENT_ADJUST 0x0001 /* don't manually adjust century */ -#define MK48TXX_WDOG_REGISTER 0x0002 /* register watchdog */ -#define MK48TXX_WDOG_ENABLE_WDS 0x0004 /* enable watchdog steering bit */ - - mk48txx_nvrd_t sc_nvrd; /* NVRAM/RTC read function */ - mk48txx_nvwr_t sc_nvwr; /* NVRAM/RTC write function */ -}; - -/* Chip attach function */ -int mk48txx_attach(device_t dev); - -/* Methods for the clock interface */ -int mk48txx_gettime(device_t dev, struct timespec *ts); -int mk48txx_settime(device_t dev, struct timespec *ts); diff --git a/tools/kerneldoc/subsys/Doxyfile-dev_mk48txx b/tools/kerneldoc/subsys/Doxyfile-dev_mk48txx deleted file mode 100644 index dc1e6a55ffa2..000000000000 --- a/tools/kerneldoc/subsys/Doxyfile-dev_mk48txx +++ /dev/null @@ -1,21 +0,0 @@ -# Doxyfile 1.5.2 - -# $FreeBSD$ - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- -PROJECT_NAME = "FreeBSD kernel MK48TXX device code" -OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_mk48txx/ -EXTRACT_ALL = YES # for undocumented src, no warnings enabled -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- -INPUT = $(DOXYGEN_SRC_PATH)/dev/mk48txx/ \ - $(NOTREVIEWED) - -GENERATE_TAGFILE = dev_mk48txx/dev_mk48txx.tag - -@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) -@INCLUDE = common-Doxyfile - From owner-dev-commits-src-main@freebsd.org Fri Dec 25 19:28:32 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BDB8F4C87C6; Fri, 25 Dec 2020 19:28:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D2cS03hyTz3nWm; Fri, 25 Dec 2020 19:28:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5EB1D27D1A; Fri, 25 Dec 2020 19:28:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BPJSWjD056548; Fri, 25 Dec 2020 19:28:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BPJSW6J056547; Fri, 25 Dec 2020 19:28:32 GMT (envelope-from git) Date: Fri, 25 Dec 2020 19:28:32 GMT Message-Id: <202012251928.0BPJSW6J056547@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Marius Strobl Subject: git: 5731987b71d0 - mips: fix build w/ TICK_USE_MALTA_RTC defined MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: marius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5731987b71d0eb8ffdd8133a0a46f7b80e11804b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Dec 2020 19:28:34 -0000 The branch main has been updated by marius: URL: https://cgit.FreeBSD.org/src/commit/?id=5731987b71d0eb8ffdd8133a0a46f7b80e11804b commit 5731987b71d0eb8ffdd8133a0a46f7b80e11804b Author: Marius Strobl AuthorDate: 2020-12-25 14:44:39 +0000 Commit: Marius Strobl CommitDate: 2020-12-25 18:47:45 +0000 mips: fix build w/ TICK_USE_MALTA_RTC defined This was mainly broken by 7e82012aff9888d64a85d19aaed51def9ebbff22 and r178192 respectively. Also, remove unused #include. --- sys/mips/malta/malta_machdep.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/sys/mips/malta/malta_machdep.c b/sys/mips/malta/malta_machdep.c index 0536abe09460..fd2b00355f89 100644 --- a/sys/mips/malta/malta_machdep.c +++ b/sys/mips/malta/malta_machdep.c @@ -73,8 +73,7 @@ __FBSDID("$FreeBSD$"); #endif #ifdef TICK_USE_MALTA_RTC -#include -#include +#include #include #endif @@ -157,7 +156,7 @@ lcd_puts(char *s) #ifdef TICK_USE_MALTA_RTC static __inline uint8_t -rtcin(uint8_t addr) +malta_rtcin(uint8_t addr) { *((volatile uint8_t *) @@ -167,7 +166,7 @@ rtcin(uint8_t addr) } static __inline void -writertc(uint8_t addr, uint8_t val) +malta_writertc(uint8_t addr, uint8_t val) { *((volatile uint8_t *) @@ -257,19 +256,19 @@ malta_cpu_freq(void) u_int64_t counterval[2]; /* Set RTC to binary mode. */ - writertc(RTC_STATUSB, (rtcin(RTC_STATUSB) | RTCSB_BCD)); + malta_writertc(RTC_STATUSB, (malta_rtcin(RTC_STATUSB) | RTCSB_BCD)); /* Busy-wait for falling edge of RTC update. */ - while (((rtcin(RTC_STATUSA) & RTCSA_TUP) == 0)) + while (((malta_rtcin(RTC_STATUSA) & RTCSA_TUP) == 0)) ; - while (((rtcin(RTC_STATUSA)& RTCSA_TUP) != 0)) + while (((malta_rtcin(RTC_STATUSA)& RTCSA_TUP) != 0)) ; counterval[0] = mips_rd_count(); /* Busy-wait for falling edge of RTC update. */ - while (((rtcin(RTC_STATUSA) & RTCSA_TUP) == 0)) + while (((malta_rtcin(RTC_STATUSA) & RTCSA_TUP) == 0)) ; - while (((rtcin(RTC_STATUSA)& RTCSA_TUP) != 0)) + while (((malta_rtcin(RTC_STATUSA)& RTCSA_TUP) != 0)) ; counterval[1] = mips_rd_count(); From owner-dev-commits-src-main@freebsd.org Fri Dec 25 19:28:33 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DB8994C8A31; Fri, 25 Dec 2020 19:28:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D2cS03GjRz3nTG; Fri, 25 Dec 2020 19:28:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5791127A68; Fri, 25 Dec 2020 19:28:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BPJSW7c056531; Fri, 25 Dec 2020 19:28:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BPJSWAN056530; Fri, 25 Dec 2020 19:28:32 GMT (envelope-from git) Date: Fri, 25 Dec 2020 19:28:32 GMT Message-Id: <202012251928.0BPJSWAN056530@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Marius Strobl Subject: git: d141239c56ae - mc146818(4): remove obsolete driver MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: marius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d141239c56ae26a8757fbf703b22b68a931c3d24 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Dec 2020 19:28:34 -0000 The branch main has been updated by marius: URL: https://cgit.FreeBSD.org/src/commit/?id=d141239c56ae26a8757fbf703b22b68a931c3d24 commit d141239c56ae26a8757fbf703b22b68a931c3d24 Author: Marius Strobl AuthorDate: 2020-12-24 19:06:53 +0000 Commit: Marius Strobl CommitDate: 2020-12-25 18:47:45 +0000 mc146818(4): remove obsolete driver It's no longer used since 58aa35d42975c298ca0adba705c042596303c9f5 and r357455 respectively. --- sys/conf/files | 1 - sys/dev/mc146818/mc146818.c | 290 --------------------------- sys/dev/mc146818/mc146818reg.h | 150 -------------- sys/dev/mc146818/mc146818var.h | 67 ------- tools/kerneldoc/subsys/Doxyfile-dev_mc146818 | 21 -- 5 files changed, 529 deletions(-) diff --git a/sys/conf/files b/sys/conf/files index 2a71e21ace71..6f6fcac25bbe 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -2388,7 +2388,6 @@ lio_23xx_nic.bin.fw optional lio \ dev/malo/if_malo.c optional malo dev/malo/if_malohal.c optional malo dev/malo/if_malo_pci.c optional malo pci -dev/mc146818/mc146818.c optional mc146818 dev/md/md.c optional md dev/mdio/mdio_if.m optional miiproxy | mdio dev/mdio/mdio.c optional miiproxy | mdio diff --git a/sys/dev/mc146818/mc146818.c b/sys/dev/mc146818/mc146818.c deleted file mode 100644 index 518c8cde8a2e..000000000000 --- a/sys/dev/mc146818/mc146818.c +++ /dev/null @@ -1,290 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD - * - * Copyright (c) 2003 Izumi Tsutsui. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 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. - * - * $NetBSD: mc146818.c,v 1.16 2008/05/14 13:29:28 tsutsui Exp $ - */ - -#include -__FBSDID("$FreeBSD$"); - -/* - * mc146818 and compatible time of day chip subroutines - */ - -#include -#include -#include -#include -#include -#include - -#include - -#include -#include - -#include "clock_if.h" - -static u_int mc146818_def_getcent(device_t); -static void mc146818_def_setcent(device_t, u_int); - -int -mc146818_attach(device_t dev) -{ - struct mc146818_softc *sc; - - sc = device_get_softc(dev); - - if (mtx_initialized(&sc->sc_mtx) == 0) { - device_printf(dev, "%s: mutex not initialized\n", __func__); - return (ENXIO); - } - - if (sc->sc_mcread == NULL) - sc->sc_mcread = mc146818_def_read; - if (sc->sc_mcwrite == NULL) - sc->sc_mcwrite = mc146818_def_write; - - if (sc->sc_flag & MC146818_NO_CENT_ADJUST) { - /* - * Note that setting MC146818_NO_CENT_ADJUST means that - * the century has to be stored in NVRAM somewhere. - */ - if (sc->sc_getcent == NULL) - sc->sc_getcent = mc146818_def_getcent; - if (sc->sc_setcent == NULL) - sc->sc_setcent = mc146818_def_setcent; - } - - mtx_lock_spin(&sc->sc_mtx); - if (((*sc->sc_mcread)(dev, MC_REGD) & MC_REGD_VRT) == 0) { - mtx_unlock_spin(&sc->sc_mtx); - device_printf(dev, "%s: battery low\n", __func__); - return (ENXIO); - } - - sc->sc_rega = MC_BASE_32_KHz; - (*sc->sc_mcwrite)(dev, MC_REGA, sc->sc_rega); - - sc->sc_regb = 0; - sc->sc_regb |= (sc->sc_flag & MC146818_BCD) ? 0 : MC_REGB_BINARY; - sc->sc_regb |= (sc->sc_flag & MC146818_12HR) ? 0 : MC_REGB_24HR; - (*sc->sc_mcwrite)(dev, MC_REGB, sc->sc_regb); - mtx_unlock_spin(&sc->sc_mtx); - - clock_register(dev, 1000000); /* 1 second resolution */ - - return (0); -} - -/* - * Get time of day and convert it to a struct timespec. - * Return 0 on success, an error number otherwise. - */ -int -mc146818_gettime(device_t dev, struct timespec *ts) -{ - struct mc146818_softc *sc; - struct clocktime ct; - int timeout, cent, year; - - sc = device_get_softc(dev); - - timeout = 1000000; /* XXX how long should we wait? */ - - /* - * If MC_REGA_UIP is 0 we have at least 244us before the next - * update. If it's 1 an update is imminent. - */ - for (;;) { - mtx_lock_spin(&sc->sc_mtx); - if (((*sc->sc_mcread)(dev, MC_REGA) & MC_REGA_UIP) == 0) - break; - mtx_unlock_spin(&sc->sc_mtx); - if (--timeout < 0) { - device_printf(dev, "%s: timeout\n", __func__); - return (EBUSY); - } - } - -#define FROMREG(x) ((sc->sc_flag & MC146818_BCD) ? FROMBCD(x) : (x)) - - ct.nsec = 0; - ct.sec = FROMREG((*sc->sc_mcread)(dev, MC_SEC)); - ct.min = FROMREG((*sc->sc_mcread)(dev, MC_MIN)); - ct.hour = FROMREG((*sc->sc_mcread)(dev, MC_HOUR)); - /* Map dow from 1 - 7 to 0 - 6. */ - ct.dow = FROMREG((*sc->sc_mcread)(dev, MC_DOW)) - 1; - ct.day = FROMREG((*sc->sc_mcread)(dev, MC_DOM)); - ct.mon = FROMREG((*sc->sc_mcread)(dev, MC_MONTH)); - year = FROMREG((*sc->sc_mcread)(dev, MC_YEAR)); - year += sc->sc_year0; - if (sc->sc_flag & MC146818_NO_CENT_ADJUST) { - cent = (*sc->sc_getcent)(dev); - year += cent * 100; - } else if (year < POSIX_BASE_YEAR) - year += 100; - mtx_unlock_spin(&sc->sc_mtx); - - ct.year = year; - - return (clock_ct_to_ts(&ct, ts)); -} - -#ifdef notyet -int -mc146818_getsecs(device_t dev, int *secp) -{ - struct mc146818_softc *sc; - int sec, timeout; - - sc = device_get_softc(dev); - - timeout = 1000000; /* XXX how long should we wait? */ - - for (;;) { - mtx_lock_spin(&sc->sc_mtx); - if (((*sc->sc_mcread)(dev, MC_REGA) & MC_REGA_UIP) == 0) { - sec = FROMREG((*sc->sc_mcread)(dev, MC_SEC)); - mtx_unlock_spin(&sc->sc_mtx); - break; - } - mtx_unlock_spin(&sc->sc_mtx); - if (--timeout == 0) { - device_printf(dev, "%s: timeout\n", __func__); - return (EBUSY); - } - } - -#undef FROMREG - - *secp = sec; - return (0); -} -#endif - -/* - * Set the time of day clock based on the value of the struct timespec arg. - * Return 0 on success, an error number otherwise. - */ -int -mc146818_settime(device_t dev, struct timespec *ts) -{ - struct mc146818_softc *sc; - struct clocktime ct; - int cent, year; - - sc = device_get_softc(dev); - - /* Accuracy is only one second. */ - if (ts->tv_nsec >= 500000000) - ts->tv_sec++; - ts->tv_nsec = 0; - clock_ts_to_ct(ts, &ct); - - mtx_lock_spin(&sc->sc_mtx); - /* Disable RTC updates and interrupts (if enabled). */ - (*sc->sc_mcwrite)(dev, MC_REGB, - ((sc->sc_regb & (MC_REGB_BINARY | MC_REGB_24HR)) | MC_REGB_SET)); - -#define TOREG(x) ((sc->sc_flag & MC146818_BCD) ? TOBCD(x) : (x)) - - (*sc->sc_mcwrite)(dev, MC_SEC, TOREG(ct.sec)); - (*sc->sc_mcwrite)(dev, MC_MIN, TOREG(ct.min)); - (*sc->sc_mcwrite)(dev, MC_HOUR, TOREG(ct.hour)); - /* Map dow from 0 - 6 to 1 - 7. */ - (*sc->sc_mcwrite)(dev, MC_DOW, TOREG(ct.dow + 1)); - (*sc->sc_mcwrite)(dev, MC_DOM, TOREG(ct.day)); - (*sc->sc_mcwrite)(dev, MC_MONTH, TOREG(ct.mon)); - - year = ct.year - sc->sc_year0; - if (sc->sc_flag & MC146818_NO_CENT_ADJUST) { - cent = year / 100; - (*sc->sc_setcent)(dev, cent); - year -= cent * 100; - } else if (year > 99) - year -= 100; - (*sc->sc_mcwrite)(dev, MC_YEAR, TOREG(year)); - - /* Reenable RTC updates and interrupts. */ - (*sc->sc_mcwrite)(dev, MC_REGB, sc->sc_regb); - mtx_unlock_spin(&sc->sc_mtx); - -#undef TOREG - - return (0); -} - -#define MC_ADDR 0 -#define MC_DATA 1 - -u_int -mc146818_def_read(device_t dev, u_int reg) -{ - struct mc146818_softc *sc; - - sc = device_get_softc(dev); - bus_space_write_1(sc->sc_bst, sc->sc_bsh, MC_ADDR, reg); - return (bus_space_read_1(sc->sc_bst, sc->sc_bsh, MC_DATA)); -} - -void -mc146818_def_write(device_t dev, u_int reg, u_int val) -{ - struct mc146818_softc *sc; - - sc = device_get_softc(dev); - bus_space_write_1(sc->sc_bst, sc->sc_bsh, MC_ADDR, reg); - bus_space_write_1(sc->sc_bst, sc->sc_bsh, MC_DATA, val); -} - -#undef MC_ADDR -#undef MC_DATA - -/* - * Looks like it's common even across platforms to store the century at - * 0x32 in the NVRAM of the mc146818. - */ -#define MC_CENT 0x32 - -static u_int -mc146818_def_getcent(device_t dev) -{ - struct mc146818_softc *sc; - - sc = device_get_softc(dev); - return ((*sc->sc_mcread)(dev, MC_CENT)); -} - -static void -mc146818_def_setcent(device_t dev, u_int cent) -{ - struct mc146818_softc *sc; - - sc = device_get_softc(dev); - (*sc->sc_mcwrite)(dev, MC_CENT, cent); -} - -#undef MC_CENT diff --git a/sys/dev/mc146818/mc146818reg.h b/sys/dev/mc146818/mc146818reg.h deleted file mode 100644 index 10071699882a..000000000000 --- a/sys/dev/mc146818/mc146818reg.h +++ /dev/null @@ -1,150 +0,0 @@ -/*- - * SPDX-License-Identifier: MIT-CMU - * - * Copyright (c) 1995 Carnegie-Mellon University. - * All rights reserved. - * - * Permission to use, copy, modify and distribute this software and - * its documentation is hereby granted, provided that both the copyright - * notice and this permission notice appear in all copies of the - * software, derivative works or modified versions, and any portions - * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" - * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND - * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * - * Carnegie Mellon requests users of this software to return to - * - * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU - * School of Computer Science - * Carnegie Mellon University - * Pittsburgh PA 15213-3890 - * - * any improvements or extensions that they make and grant Carnegie the - * rights to redistribute these changes. - * - * $NetBSD: mc146818reg.h,v 1.9 2006/03/08 23:46:25 lukem Exp $ - * - * $FreeBSD$ - */ - -/* - * Definitions for the Motorola MC146818A Real Time Clock. - * They also apply for the (compatible) Dallas Semiconductor DS1287A RTC. - * - * Though there are undoubtedly other (better) sources, this material was - * culled from the DEC "KN121 System Module Programmer's Reference - * Information." - * - * The MC146818A has 16 registers. The first 10 contain time-of-year - * and alarm data. The rest contain various control and status bits. - * - * To read or write the registers, one writes the register number to - * the RTC's control port, then either reads from or writes the new - * data to the RTC's data port. Since the locations of these ports - * and the method used to access them can be machine-dependent, the - * low-level details of reading and writing the RTC's registers are - * handled by machine-specific functions. - * - * The time-of-year and alarm data can be expressed in either binary - * or BCD, and they are selected by a bit in register B. - * - * The "hour" time-of-year and alarm fields can either be expressed in - * AM/PM format, or in 24-hour format. If AM/PM format is chosen, the - * hour fields can have the values: 1-12 and 81-92 (the latter being - * PM). If the 24-hour format is chosen, they can have the values - * 0-24. The hour format is selectable by a bit in register B. - * (XXX IS AM/PM MODE DESCRIPTION CORRECT?) - * - * It is assumed the if systems are going to use BCD (rather than - * binary) mode, or AM/PM hour format, they'll do the appropriate - * conversions in machine-dependent code. Also, if the clock is - * switched between BCD and binary mode, or between AM/PM mode and - * 24-hour mode, the time-of-day and alarm registers are NOT - * automatically reset; they must be reprogrammed with correct values. - */ - -/* - * The registers, and the bits within each register. - */ - -#define MC_SEC 0x0 /* Time of year: seconds (0-59) */ -#define MC_ASEC 0x1 /* Alarm: seconds */ -#define MC_MIN 0x2 /* Time of year: minutes (0-59) */ -#define MC_AMIN 0x3 /* Alarm: minutes */ -#define MC_HOUR 0x4 /* Time of year: hour (see above) */ -#define MC_AHOUR 0x5 /* Alarm: hour */ -#define MC_DOW 0x6 /* Time of year: day of week (1-7) */ -#define MC_DOM 0x7 /* Time of year: day of month (1-31) */ -#define MC_MONTH 0x8 /* Time of year: month (1-12) */ -#define MC_YEAR 0x9 /* Time of year: year in century (0-99) */ - -#define MC_REGA 0xa /* Control register A */ - -#define MC_REGA_RSMASK 0x0f /* Interrupt rate select mask (see below) */ -#define MC_REGA_DVMASK 0x70 /* Divisor select mask (see below) */ -#define MC_REGA_DV0 0x10 /* Divisor 0 */ -#define MC_REGA_DV1 0x20 /* Divisor 1 */ -#define MC_REGA_DV2 0x40 /* Divisor 2 */ -#define MC_REGA_UIP 0x80 /* Update in progress; read only. */ - -#define MC_REGB 0xb /* Control register B */ - -#define MC_REGB_DSE 0x01 /* Daylight Savings Enable */ -#define MC_REGB_24HR 0x02 /* 24-hour mode (AM/PM mode when clear) */ -#define MC_REGB_BINARY 0x04 /* Binary mode (BCD mode when clear) */ -#define MC_REGB_SQWE 0x08 /* Square Wave Enable */ -#define MC_REGB_UIE 0x10 /* Update End interrupt enable */ -#define MC_REGB_AIE 0x20 /* Alarm interrupt enable */ -#define MC_REGB_PIE 0x40 /* Periodic interrupt enable */ -#define MC_REGB_SET 0x80 /* Allow time to be set; stops updates */ - -#define MC_REGC 0xc /* Control register C */ - -/* MC_REGC_UNUSED 0x0f UNUSED */ -#define MC_REGC_UF 0x10 /* Update End interrupt flag */ -#define MC_REGC_AF 0x20 /* Alarm interrupt flag */ -#define MC_REGC_PF 0x40 /* Periodic interrupt flag */ -#define MC_REGC_IRQF 0x80 /* Interrupt request pending flag */ - -#define MC_REGD 0xd /* Control register D */ - -/* MC_REGD_UNUSED 0x7f UNUSED */ -#define MC_REGD_VRT 0x80 /* Valid RAM and Time bit */ - - -#define MC_NREGS 0xe /* 14 registers; CMOS follows */ -#define MC_NTODREGS 0xa /* 10 of those regs are for TOD and alarm */ - -#define MC_NVRAM_START 0xe /* start of NVRAM: offset 14 */ -#define MC_NVRAM_SIZE 50 /* 50 bytes of NVRAM */ - -/* - * Periodic Interrupt Rate Select constants (Control register A) - */ -#define MC_RATE_NONE 0x0 /* No periodic interrupt */ -#define MC_RATE_1 0x1 /* 256 Hz if MC_BASE_32_KHz, else 32768 Hz */ -#define MC_RATE_2 0x2 /* 128 Hz if MC_BASE_32_KHz, else 16384 Hz */ -#define MC_RATE_8192_Hz 0x3 /* 122.070 us period */ -#define MC_RATE_4096_Hz 0x4 /* 244.141 us period */ -#define MC_RATE_2048_Hz 0x5 /* 488.281 us period */ -#define MC_RATE_1024_Hz 0x6 /* 976.562 us period */ -#define MC_RATE_512_Hz 0x7 /* 1.953125 ms period */ -#define MC_RATE_256_Hz 0x8 /* 3.90625 ms period */ -#define MC_RATE_128_Hz 0x9 /* 7.8125 ms period */ -#define MC_RATE_64_Hz 0xa /* 15.625 ms period */ -#define MC_RATE_32_Hz 0xb /* 31.25 ms period */ -#define MC_RATE_16_Hz 0xc /* 62.5 ms period */ -#define MC_RATE_8_Hz 0xd /* 125 ms period */ -#define MC_RATE_4_Hz 0xe /* 250 ms period */ -#define MC_RATE_2_Hz 0xf /* 500 ms period */ - -/* - * Time base (divisor select) constants (Control register A) - */ -#define MC_BASE_4_MHz 0x00 /* 4 MHz crystal */ -#define MC_BASE_1_MHz MC_REGA_DV0 /* 1 MHz crystal */ -#define MC_BASE_32_KHz MC_REGA_DV1 /* 32 KHz crystal */ -#define MC_BASE_NONE (MC_REGA_DV2 | MC_REGA_DV1) /* actually also resets */ -#define MC_BASE_RESET (MC_REGA_DV2 | MC_REGA_DV1 | MC_REGA_DV0) diff --git a/sys/dev/mc146818/mc146818var.h b/sys/dev/mc146818/mc146818var.h deleted file mode 100644 index 7cca69991b20..000000000000 --- a/sys/dev/mc146818/mc146818var.h +++ /dev/null @@ -1,67 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD - * - * Copyright (c) 2003 Izumi Tsutsui. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 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. - * - * $NetBSD: mc146818var.h,v 1.7 2008/05/14 13:29:29 tsutsui Exp $ - * - * $FreeBSD$ - */ - -struct mc146818_softc { - bus_space_tag_t sc_bst; /* bus space tag */ - bus_space_handle_t sc_bsh; /* bus space handle */ - - struct mtx sc_mtx; /* hardware mutex */ - - u_char sc_rega; /* register A */ - u_char sc_regb; /* register B */ - - u_int sc_year0; /* year counter offset */ - - u_int sc_flag; /* MD flags */ -#define MC146818_NO_CENT_ADJUST 0x0001 /* don't adjust century */ -#define MC146818_BCD 0x0002 /* use BCD mode */ -#define MC146818_12HR 0x0004 /* use AM/PM mode */ - - /* MD chip register read/write functions */ - u_int (*sc_mcread)(device_t dev, u_int reg); - void (*sc_mcwrite)(device_t dev, u_int reg, u_int val); - /* MD century get/set functions */ - u_int (*sc_getcent)(device_t dev); - void (*sc_setcent)(device_t dev, u_int cent); -}; - -/* Default read/write functions */ -u_int mc146818_def_read(device_t dev, u_int reg); -void mc146818_def_write(device_t dev, u_int reg, u_int val); - -/* Chip attach function */ -int mc146818_attach(device_t); - -/* Methods for the clock interface */ -#ifdef notyet -int mc146818_getsecs(device_t dev, int *secp); -#endif -int mc146818_gettime(device_t dev, struct timespec *ts); -int mc146818_settime(device_t dev, struct timespec *ts); diff --git a/tools/kerneldoc/subsys/Doxyfile-dev_mc146818 b/tools/kerneldoc/subsys/Doxyfile-dev_mc146818 deleted file mode 100644 index 6240906fc19e..000000000000 --- a/tools/kerneldoc/subsys/Doxyfile-dev_mc146818 +++ /dev/null @@ -1,21 +0,0 @@ -# Doxyfile 1.5.2 - -# $FreeBSD$ - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- -PROJECT_NAME = "FreeBSD kernel MC146818 device code" -OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_mc146818/ -EXTRACT_ALL = YES # for undocumented src, no warnings enabled -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- -INPUT = $(DOXYGEN_SRC_PATH)/dev/mc146818/ \ - $(NOTREVIEWED) - -GENERATE_TAGFILE = dev_mc146818/dev_mc146818.tag - -@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) -@INCLUDE = common-Doxyfile - From owner-dev-commits-src-main@freebsd.org Fri Dec 25 21:19:06 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B5E1E4CA44F; Fri, 25 Dec 2020 21:19:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D2fvZ4K4Xz3tYK; Fri, 25 Dec 2020 21:19:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 86CDB11B3; Fri, 25 Dec 2020 21:19:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BPLJ6l1075170; Fri, 25 Dec 2020 21:19:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BPLJ6b9075169; Fri, 25 Dec 2020 21:19:06 GMT (envelope-from git) Date: Fri, 25 Dec 2020 21:19:06 GMT Message-Id: <202012252119.0BPLJ6b9075169@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 47d1ad2413da - gnu: remove gnugrep and libgnuregex MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 47d1ad2413da619b3b435f6f181483fb66d5fa8d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Dec 2020 21:19:06 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=47d1ad2413da619b3b435f6f181483fb66d5fa8d commit 47d1ad2413da619b3b435f6f181483fb66d5fa8d Author: Kyle Evans AuthorDate: 2020-12-22 21:38:09 +0000 Commit: Kyle Evans CommitDate: 2020-12-25 21:16:33 +0000 gnu: remove gnugrep and libgnuregex Differential Revision: https://reviews.freebsd.org/D27732 --- gnu/lib/libregex/Makefile | 32 - gnu/lib/libregex/Makefile.depend | 16 - gnu/lib/libregex/config.h | 15 - gnu/lib/libregex/gnuregex.h | 33 - gnu/lib/libregex/regex.h | 54 - gnu/usr.bin/grep/AUTHORS | 44 - gnu/usr.bin/grep/COPYING | 340 ---- gnu/usr.bin/grep/ChangeLog | 2477 ----------------------- gnu/usr.bin/grep/FREEBSD-upgrade | 37 - gnu/usr.bin/grep/Makefile | 58 - gnu/usr.bin/grep/Makefile.depend | 20 - gnu/usr.bin/grep/NEWS | 238 --- gnu/usr.bin/grep/README | 26 - gnu/usr.bin/grep/THANKS | 72 - gnu/usr.bin/grep/closeout.c | 121 -- gnu/usr.bin/grep/closeout.h | 17 - gnu/usr.bin/grep/config.h | 342 ---- gnu/usr.bin/grep/dfa.c | 3586 --------------------------------- gnu/usr.bin/grep/dfa.h | 434 ---- gnu/usr.bin/grep/error.c | 276 --- gnu/usr.bin/grep/error.h | 78 - gnu/usr.bin/grep/exclude.c | 128 -- gnu/usr.bin/grep/exclude.h | 35 - gnu/usr.bin/grep/getpagesize.h | 48 - gnu/usr.bin/grep/grep.1 | 780 ------- gnu/usr.bin/grep/grep.c | 1867 ----------------- gnu/usr.bin/grep/grep.h | 44 - gnu/usr.bin/grep/grepmat.c | 6 - gnu/usr.bin/grep/hard-locale.c | 87 - gnu/usr.bin/grep/hard-locale.h | 18 - gnu/usr.bin/grep/isdir.c | 42 - gnu/usr.bin/grep/kwset.c | 773 ------- gnu/usr.bin/grep/kwset.h | 59 - gnu/usr.bin/grep/obstack.c | 598 ------ gnu/usr.bin/grep/obstack.h | 593 ------ gnu/usr.bin/grep/quotearg.c | 613 ------ gnu/usr.bin/grep/quotearg.h | 110 - gnu/usr.bin/grep/savedir.c | 183 -- gnu/usr.bin/grep/savedir.h | 18 - gnu/usr.bin/grep/search.c | 1303 ------------ gnu/usr.bin/grep/system.h | 206 -- gnu/usr.bin/grep/tests/backref.sh | 38 - gnu/usr.bin/grep/tests/bre.awk | 27 - gnu/usr.bin/grep/tests/bre.sh | 13 - gnu/usr.bin/grep/tests/bre.tests | 62 - gnu/usr.bin/grep/tests/empty.sh | 33 - gnu/usr.bin/grep/tests/ere.awk | 32 - gnu/usr.bin/grep/tests/ere.sh | 13 - gnu/usr.bin/grep/tests/ere.tests | 215 -- gnu/usr.bin/grep/tests/file.sh | 59 - gnu/usr.bin/grep/tests/formatbre.awk | 55 - gnu/usr.bin/grep/tests/formatere.awk | 60 - gnu/usr.bin/grep/tests/khadafy.lines | 32 - gnu/usr.bin/grep/tests/khadafy.regexp | 1 - gnu/usr.bin/grep/tests/khadafy.sh | 20 - gnu/usr.bin/grep/tests/options.sh | 36 - gnu/usr.bin/grep/tests/spencer1.awk | 15 - gnu/usr.bin/grep/tests/spencer1.sh | 13 - gnu/usr.bin/grep/tests/spencer1.tests | 122 -- gnu/usr.bin/grep/tests/spencer2.sh | 13 - gnu/usr.bin/grep/tests/spencer2.tests | 317 --- gnu/usr.bin/grep/tests/status.sh | 52 - gnu/usr.bin/grep/tests/tests | 475 ----- gnu/usr.bin/grep/tests/warning.sh | 19 - gnu/usr.bin/grep/xalloc.h | 87 - gnu/usr.bin/grep/xmalloc.c | 116 -- gnu/usr.bin/grep/xstrtol.c | 282 --- gnu/usr.bin/grep/xstrtol.h | 64 - gnu/usr.bin/grep/xstrtoumax.c | 31 - 69 files changed, 18129 deletions(-) diff --git a/gnu/lib/libregex/Makefile b/gnu/lib/libregex/Makefile deleted file mode 100644 index c18243a81065..000000000000 --- a/gnu/lib/libregex/Makefile +++ /dev/null @@ -1,32 +0,0 @@ -# $FreeBSD$ - -LIB= gnuregex -SHLIB_MAJOR= 5 - -REGEXDIR= ${SRCTOP}/contrib/libgnuregex -.PATH: ${REGEXDIR} - -WARNS?= 1 - -SRCS= gnuregex.c -INCSGROUPS= INCS WRINCS PXINCS -INCS= regex.h.patched -INCSNAME= regex.h -INCSDIR= ${INCLUDEDIR}/gnu -WRINCS= gnuregex.h -PXINCS= ${REGEXDIR}/regex.h -PXINCSDIR= ${INCSDIR}/posix - -CFLAGS+= -D__attribute_warn_unused_result__="" -CFLAGS+= -DHAVE_CONFIG_H -I${.CURDIR} -I${REGEXDIR} - -CLEANFILES= regex.h.patched gnuregex.c -regex.h.patched: regex.h - sed 's===g' \ - < ${.ALLSRC} > ${.TARGET} - -gnuregex.c: regex.c - sed 's===g' \ - < ${.ALLSRC} > ${.TARGET} - -.include diff --git a/gnu/lib/libregex/Makefile.depend b/gnu/lib/libregex/Makefile.depend deleted file mode 100644 index 8d409f5263ac..000000000000 --- a/gnu/lib/libregex/Makefile.depend +++ /dev/null @@ -1,16 +0,0 @@ -# $FreeBSD$ -# Autogenerated - do NOT edit! - -DIRDEPS = \ - include \ - include/xlocale \ - lib/${CSU_DIR} \ - lib/libc \ - lib/libcompiler_rt \ - - -.include - -.if ${DEP_RELDIR} == ${_DEP_RELDIR} -# local dependencies - needed for -jN in clean tree -.endif diff --git a/gnu/lib/libregex/config.h b/gnu/lib/libregex/config.h deleted file mode 100644 index 0076f3d76dfc..000000000000 --- a/gnu/lib/libregex/config.h +++ /dev/null @@ -1,15 +0,0 @@ -/* $FreeBSD$ */ - -#define _REGEX_RE_COMP 1 -#define HAVE_LANGINFO_H 1 -#define HAVE_LANGINFO_CODESET 1 -#define HAVE_LOCALE_H 1 -#define HAVE_WCHAR_H 1 -#define HAVE_WCTYPE_H 1 -#define HAVE_ISBLANK 1 -#define HAVE_WCRTOMB 1 -#define HAVE_MBRTOWC 1 -#define HAVE_WCSCOLL 1 -#define HAVE_ALLOCA 1 -#define HAVE_STDBOOL_H 1 -#define HAVE_STDINT_H 1 diff --git a/gnu/lib/libregex/gnuregex.h b/gnu/lib/libregex/gnuregex.h deleted file mode 100644 index 7356f9ffbe42..000000000000 --- a/gnu/lib/libregex/gnuregex.h +++ /dev/null @@ -1,33 +0,0 @@ -/*- - * Copyright (c) 2004 David E. O'Brien - * Copyright (c) 2004 Andrey A. Chernov - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -#ifdef __GNUC__ -#warning "Use -I/usr/include/gnu and instead of " -#endif -#include diff --git a/gnu/lib/libregex/regex.h b/gnu/lib/libregex/regex.h deleted file mode 100644 index 85410a2a7495..000000000000 --- a/gnu/lib/libregex/regex.h +++ /dev/null @@ -1,54 +0,0 @@ -/* $FreeBSD$ */ -#ifndef _REGEX_H - -#ifndef __USE_GNU -#define __USE_GNU -#endif - -#include - -/* Document internal interfaces. */ -extern reg_syntax_t __re_set_syntax (reg_syntax_t __syntax); - -extern const char *__re_compile_pattern (const char *__pattern, size_t __length, - struct re_pattern_buffer *__buffer); - -extern int __re_compile_fastmap (struct re_pattern_buffer *__buffer); - -extern int __re_search (struct re_pattern_buffer *__buffer, const char *__string, - int __length, int __start, int __range, - struct re_registers *__regs); - -extern int __re_search_2 (struct re_pattern_buffer *__buffer, - const char *__string1, int __length1, - const char *__string2, int __length2, int __start, - int __range, struct re_registers *__regs, int __stop); - -extern int __re_match (struct re_pattern_buffer *__buffer, const char *__string, - int __length, int __start, struct re_registers *__regs); - -extern int __re_match_2 (struct re_pattern_buffer *__buffer, - const char *__string1, int __length1, - const char *__string2, int __length2, int __start, - struct re_registers *__regs, int __stop); - -extern void __re_set_registers (struct re_pattern_buffer *__buffer, - struct re_registers *__regs, - unsigned int __num_regs, - regoff_t *__starts, regoff_t *__ends); - -extern int __regcomp (regex_t *__restrict __preg, - const char *__restrict __pattern, - int __cflags); - -extern int __regexec (const regex_t *__restrict __preg, - const char *__restrict __string, size_t __nmatch, - regmatch_t __pmatch[__restrict_arr], - int __eflags); - -extern size_t __regerror (int __errcode, const regex_t *__restrict __preg, - char *__restrict __errbuf, size_t __errbuf_size); - -extern void __regfree (regex_t *__preg); - -#endif /* _REGEX_H */ diff --git a/gnu/usr.bin/grep/AUTHORS b/gnu/usr.bin/grep/AUTHORS deleted file mode 100644 index e08a38cf24e6..000000000000 --- a/gnu/usr.bin/grep/AUTHORS +++ /dev/null @@ -1,44 +0,0 @@ -Mike Haertel wrote the main program and the dfa and kwset matchers. - -Arthur David Olson contributed the heuristics for finding fixed substrings -at the end of dfa.c. - -Richard Stallman and Karl Berry wrote the regex backtracking matcher. - -Henry Spencer wrote the original test suite from which grep's was derived. - -Scott Anderson invented the Khadafy test. - -David MacKenzie wrote the automatic configuration software use to -produce the configure script. - -Authors of the replacements for standard library routines are identified -in the corresponding source files. - -The idea of using Boyer-Moore type algorithms to quickly filter out -non-matching text before calling the regexp matcher was originally due -to James Woods. He also contributed some code to early versions of -GNU grep. - -Mike Haertel would like to thank Andrew Hume for many fascinating discussions -of string searching issues over the years. Hume & Sunday's excellent -paper on fast string searching (AT&T Bell Laboratories CSTR #156) -describes some of the history of the subject, as well as providing -exhaustive performance analysis of various implementation alternatives. -The inner loop of GNU grep is similar to Hume & Sunday's recommended -"Tuned Boyer Moore" inner loop. - -More work was done on regex.[ch] by Ulrich Drepper and Arnold -Robbins. Regex is now part of GNU C library, see this package -for complete details and credits. - -Arnold Robbins contributed to improve dfa.[ch]. In fact -it came straight from gawk-3.0.3 with small editing and fixes. - -Many folks contributed see THANKS, if I omited someone please -send me email. - -Alain Magloire maintained GNU grep until version 2.5e. - -Bernhard "Bero" Rosenkränzer is the current maintainer. - diff --git a/gnu/usr.bin/grep/COPYING b/gnu/usr.bin/grep/COPYING deleted file mode 100644 index 60549be514af..000000000000 --- a/gnu/usr.bin/grep/COPYING +++ /dev/null @@ -1,340 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) 19yy - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) 19yy name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. diff --git a/gnu/usr.bin/grep/ChangeLog b/gnu/usr.bin/grep/ChangeLog deleted file mode 100644 index aa50e78c1f40..000000000000 --- a/gnu/usr.bin/grep/ChangeLog +++ /dev/null @@ -1,2477 +0,0 @@ -2002-03-26 Bernhard Rosenkraenzer - * src/grep.c: Don't fail if we don't have an stdout fd and -q - is used (happens e.g. on calls from hotplug scripts) - * src/grep.c: Don't hang forever if fed with an empty string to - grep for and --color enabled - * src/grep.c: Fix infinite loop on - echo "1 one" | grep -E "[0-9]*" -o - echo "1 one" | grep -E "[0-9]*" --color - * po/*: Sync wiith translation project - * src/grep.c, src/Makefile.am, configure.in: Add patch from - Paul Eggert to comply with ridiculous - guidelines (don't act differently if invoked as egrep or fgrep) - * configure.in: Bump version number, require a recent autoconf - -2002-03-14 Bernhard Rosenkraenzer - * src/Makefile.am, po/Makefile.in.in: Support DESTDIR properly - * tests/bre.tests: Add fix from - Peter Breitenlohner - -2002-03-13 Bernhard Rosenkraenzer - * configure.in, m4/regex.m4, m4/malloc.m4, m4/realloc.m4: - Don't set LIBOBJS directly, autoconf 2.53 doesn't like it - * intl/*: Sync with gettext 0.11 - * po/*: Sync with translation project - * configure.in, src/Makefile.am: Don't duplicate code - make - egrep and fgrep links to grep and set matcher based on - application name, suggestion from - Guillaume Cottenceau - * src/grep.c: (prline) Add fix for -i --color from - Jim Meyering - * configure.in: Version 2.5; release - -2002-01-23 Bernhard Rosenkraenzer - * configure.in: Version 2.5g - * Makefile.cvs, grep.spec: Add packaging tools - Merge djgpp changes from Andrew Cottrell : - * src/grep.c: Added conditional compilation for DJGPP - * djgpp: remove directory as it is no longer required with DJGPP 2.03 - (or 2.04 when released) - * README.DOS: Moved djgpp/readme to readme.dos - * PATCHES.AC, PATCHES.AM: delete files - redundant - * configure.in, Makefile.am: remove djgpp directory from list - -2002-01-22 Bernhard Rosenkraenzer - * doc/grep.texi, doc/grep.1, NEWS: Document --label - * po/ru.po: Sync with translation project - * po/grep.pot: Sync with source - -2002-01-18 Bernhard Rosenkraenzer - * src/grep.c: Add --label, based on patch from Stepan Koltsov - -2001-11-20 Bernhard Rosenkraenzer - * autogen.sh: Don't hardcode aclocal dir - -2001-11-19 Bernhard Rosenkraenzer - * src/grep.c: Add --only-matching (-o) switch (see NEWS) - * doc/grep.texi, doc/grep.1, NEWS: Document changes - * configure.in, lib/Makefile.am: Don't use internal getopt if - we're on a system that provides a working getopt function - -2001-09-25 Bernhard Rosenkraenzer - * configure.in: Detect pcre correctly even when it's in - non-standard locations, using pcre-config - * src/grep.c: Add --color={always,never,tty} argument (like in ls) - * src/grep.c: Turn off blinking in the default colorization - * src/grep.c: Add --devices (-D) switch (analogous to --directories) - * src/dfa.c: Fix an i18n bug: echo "A" | grep '[A-Z0-9]' wouldn't work - in non-C-Locales on systems using current versions of glibc. - * AUTHORS: Change maintainer, credit Alain for his work until now - * configure.in, m4/decl.m4, m4/dosfile.m4, m4/gettext.m4, - m4/init.m4, m4/install.m4, m4/largefile.m4, m4/lcmessage.m4, - m4/header.m4, m4/isc-posix.m4, m4/missing.m4, m4/progtest.m4, - m4/sanity.m4: - Fix build with autoconf 2.5x, retain 2.1x compatibility for now - * autogen.sh: Add some crude hacks to make it possible to build with - both autoconf 2.5x and 2.1x - * acconfig.h: removed (no longer required) - * Makefile.am: add cvs-clean target - * doc/grep.texi, doc/grep.1, NEWS: Document changes - (--color, --devices, -D) - * src/dfa.c, src/grep.c: Add vim modelines - -2001-08-30 Alain Magloire - - * configure.in: Add gl in ALL_LINGUAS. - -2001-08-30 Kurt D Schwehr - - * doc/grep.1: Warn that grep insert a "--" between groups of matches, - when using the context options. - * doc/grep.texi: Likewised. - -2001-08-25 Heikki Korpela - - * doc/grep.texi: Point out that some Platforms do not support - reading of directories and silently ignore them. - -2001-08-21 Alain Magloire - - * lib/malloc.c: New file: - * lib/realloc.c: New file: - * lib/Makefile.am: Add malloc.c and realloc.c in EXTRA_DIST. - -2001-07-31 Alain Magloire - - * po/*.po: New files from the translation team: - grep-2.5e.de.po grep-2.5e.el.po grep-2.5e.eo.po grep-2.5e.es.po - grep-2.5e.et.po grep-2.5e.fr.po grep-2.5e.gl.po grep-2.5e.it.po - grep-2.5e.pl.po grep-2.5e.sl.po - -2001-07-31 Andreas Schwab - - * src/grep.c: Fix all uses of error to pass a proper format - string. - -2001-07-29 Alain Magloire - - * grep/src/grep.c (usage): Typos corrected. - Patches from Santiago Vila. - -2001-07-29 Alain Magloire - - David Clissold, wrote: - a small bug in the GNU grep 2.4.2, which may have gone unnoticed - because it only causes a failure if building on a system with large - files enabled (e.g. an "off_t" is a "long long" rather than a "long"). - savedir() takes on off_t argument, but in grepdir() the parameter - is cast to an (unsigned). Well, if an off_t is larger than an int, - the value gets truncated. This would not normally have an effect on a - little-endian platform (unless the file is >2GB), but on a big-endian - system it will always fail. The external effect is that - "grep -r foo dir_name" fails with ENOMEM (from malloc() within - savedir()). - - * grep/src/grep.c (grepdir): Remove the (unsigned) cast when calling - savedir(). - Patch from David Clissold. - -2001-07-29 Alain Magloire - - * grep/doc/grep.texi: In Bugs report use {n,m} for consistency. - * grep/doc/grep.1: Likewised. - Noted by Steven Lucy. - -2001-04-27 Isamu Hasegawa - - * dfa.c (mblen_buf) : New variable contains the amount of remain - byte of corresponding multibyte character in the input string. - (SKIP_REMAIN_MB_IF_INITIAL_STATE) : Use mblen_buf. - (match_anychar) : Use mblen_buf. - (match_mb_charset) : Use mblen_buf. - (transit_state_consume_1char) : Use mblen_buf. - (transit_state) : Use inputwcs to get current (multibyte) character. - (dfaexec) : Add initialization of mblen_buf. - -2001-04-27 Isamu Hasegawa - - * dfa.c (addtok) : Set appropriate value to multibyte_prop. - (dfastate) : Add the initialization of the variable. - (dfaexec) : Call transit_state if d->fail may transit by - multibyte characters. - (transit_state_singlebyte) : Clean up unnecessary code. - (transit_state_consume_1char) : Likewise. - (transit_state) : Add checking for word and newline. - -2001-04-19 Isamu Hasegawa - - * search.c (check_multibyte_string) : Check the case when mbclen == 0. - -2001-04-11 Isamu Hasegawa - - * search.c (check_multibyte_string) : Check the head of multibyte - characters, and optimize a bit. - (EGexecute) : Optimize a bit. - (Fexecute) : Fix the index. - -2001-04-02 Alain Magloire - - * lib/regex.c: Update from GNU lib C, with the changes - provided by Paul Eggert. - * lib/posix/regex.h: Likewise. - -2001-02-17 Paul Eggert - - Stop trying to support hosts that have nonstandard declarations for - mbrtowc and/or mbstate_t. It's not worth the portability hassle. - - * lib/quotearg.c (mbrtowc, mbsinit): Remove workaround macros - for hosts that have mbrtowc but not mbstate_t, as we now - insist on proper declarations for both before using mbrtowc. - -2001-03-18 Alain Magloire - - * configure.in: Call AC_MBSTATE_T. - * Makefile.am: Add mbstate_t.m4 - * m4/Makefile.am: Add mbstate_t.m4 - * m4/mbstate_t.m4: New m4 macro. - * lib/strtol.c: Define CHAR_BITS. - Uwe H. Steinfeld, Ruslan Ermilov, Volkert Bochert, noted - that mbstate_t was not define for certain platforms. - -2001-03-18 Paul Eggert - - * src/grep.c (fillbuf): Fix storage allocation performance - bug: buffer was doubling in size in many cases where it didn't - have to. - -2001-03-17 Paul Eggert - - * src/grep.c (fillbuf): Avoid unnecessary division by 2. - Don't check xrealloc return value; it's guaranteed to be nonzero. - (fillbuf, grepdir): Use xalloc_die rather than error; it's shorter. - -2001-03-17 Alain Magloire - - * src/grep.c (context_length_arg): error () passing wrong format. - Spotted by Jim Meyering. - -2001-03-07 Alain Magloire - - * README-alpha: Removed reference to GNU tar, add the location - of the CVSROOT. - -2001-03-06 Alain Magloire - - Only the Regex patterns should be split in an array, patterns[]. - The dfa and KWset compiled patterns should remain global and the - patterns compiled all at once. - - * src/search.c: include "error.h" and "xalloc.h" to get prototyping - of x*alloc() and error(). - (kwsinit): Reverse to previous behaviour and takes no argument. - (kwsmusts): Likewised. - (Gcompile): For the regex pattern, split them and each pattern - is put in different compiled structure patterns[]. The patterns - are given to dfacomp() and kwsmusts() as is. - (Ecompile): Likewised. - (Fcompile): Reverse to the old behaviour of compiling the enire - patterns in one shot. - (EGexecute): If falling to GNU regex for the matching, loop in the - array of compile patterns[] to find a match. - (error): Many error () were call with arguments in the wrong order. - * tests/file.sh: Simple test to check for pattern in files. - - Reaction to bug report fired by Greg Louis - -2001-03-06 Isamu Hasegawa - - In multibyte environments, handle multibyte characters as single - characters in bracket expressions. - - * src/dfa.h (mb_char_classes) : new structure. - (mbcsets): new variable. - (nmbcsets): new variable. - (mbcsets_alloc) : new variable. - * src/dfa.c (prtok) : handle MBCSET. - (fetch_wc): new function to fetch a wide character. - (parse_bracket_exp_mb) : new function to handle multibyte character - in lex(). - (lex): invoke parse_bracket_exp_mb() for multibyte bracket expression. - (atom): handle MBCSET. - (epsclosure): likewise. - (dfaanalyze): likewise. - (dfastate): likewise. - (match_mb_charset): new function to judge whether a bracket match - with a multibyte character. - (check_matching_with_multibyte_ops) : handle MBCSET. - (dfainit): initialize new variables. - (dfafree): free new variables. - -2001-03-04 Alain Magloire - - To get more in sync with other GNU utilities like GNU tar and fetish - all the supporting functions are now under lib. - Thanks to Jim Meyering, Volkert Bochert and Paul Eggert for - the code and the reminders. - - * src/grep.c (fatal): Function removed, using error () from - lib/error.c instead. - (usage): Copyright updated. - (error): Function removed, using error () from lib/error.c instead, - adjust prototypes. - (prog): Global variable rename to program_name, to work with new - lib/error.c. - (xrealloc): Removed using lib/xmalloc.c. - (xmalloc): Removed using lib/xmalloc.c - (main): Register with atexit() to check for error on stdout. - * configure.in: Check for atexit(), call jm_MALLOC, jm_RELLOC and - jm_PREREQ_ERROR. - * tests/bre.awk: Removed the hack to drain the buffer since we - always fclose(stdout) atexit. - * tests/ere.awk: Likewise. - * tests/spencer1.awk: Likewise. - * bootstrap/Makefile.try: Update the Makefile to reflect the changes - in the new hierarchy. - - * README-alpha: New File. - * m4/realloc.m4: New File. - * m4/malloc.m4: New File. - * m4/error.m4: New File. - * m4/Makefile.am: Updated. - * lib: New directory. - * lib/Makefile.am: New file. - * lib/closeout.c: New file. - * lib/closeout.h: New file. - * lib/fnmatch.c: New file. - * lib/fnmatch.h: New file. - * lib/atexit.c: New file. - * lib/error.c: New file. - * lib/error.h: New file. - * lib/quotearg.h: New file. - * lib/quotearg.c: New file. - * lib/xmalloc.c: New file. - * lib/posix: New directory. - * lib/posix/Makefile.am: New file. - * src/getopt.c: Moved to lib. - * src/getopt1.c: Moved to lib. - * src/getopt.h: Moved to lib. - * src/alloca.c: Moved to lib. - * src/exclude.c: Moved to lib. *** 17641 LINES SKIPPED *** From owner-dev-commits-src-main@freebsd.org Fri Dec 25 21:19:06 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E14CA4CA1C0; Fri, 25 Dec 2020 21:19:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D2fvZ667Tz3tKp; Fri, 25 Dec 2020 21:19:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C320F11B4; Fri, 25 Dec 2020 21:19:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BPLJ6sH075221; Fri, 25 Dec 2020 21:19:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BPLJ6nm075220; Fri, 25 Dec 2020 21:19:06 GMT (envelope-from git) Date: Fri, 25 Dec 2020 21:19:06 GMT Message-Id: <202012252119.0BPLJ6nm075220@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 8aff76fb37b5 - build: remove the option to build gnugrep MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8aff76fb37b58a74832831ac1c54a013a64b35e7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Dec 2020 21:19:06 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=8aff76fb37b58a74832831ac1c54a013a64b35e7 commit 8aff76fb37b58a74832831ac1c54a013a64b35e7 Author: Kyle Evans AuthorDate: 2020-12-22 21:36:40 +0000 Commit: Kyle Evans CommitDate: 2020-12-25 21:14:17 +0000 build: remove the option to build gnugrep Unconditionally install bsdgrep as grep, bootstrap or not. Remove all build glue and stop installing both gnugrep and libgnuregex now that all consumers of the latter are gone. Relnotes: yes Differential Revision: https://reviews.freebsd.org/D27732 --- ObsoleteFiles.inc | 14 ++++++++++++++ etc/mtree/BSD.include.dist | 4 ---- gnu/lib/Makefile | 4 ---- gnu/usr.bin/Makefile | 1 - share/mk/bsd.libnames.mk | 1 - share/mk/src.libnames.mk | 2 -- share/mk/src.opts.mk | 2 -- tools/build/mk/OptionalObsoleteFiles.inc | 26 -------------------------- tools/build/options/WITHOUT_BSD_GREP | 2 -- tools/build/options/WITHOUT_GNU_GREP | 3 --- tools/build/options/WITH_BSD_GREP | 2 -- tools/build/options/WITH_GNU_GREP | 3 --- usr.bin/grep/Makefile | 26 ++++++++------------------ 13 files changed, 22 insertions(+), 68 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 27f59a757080..040e2115275b 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -36,6 +36,20 @@ # xargs -n1 | sort | uniq -d; # done +# 20201225: libregex removed +OLD_FILES+=usr/lib/libgnuregex.so +OLD_LIBS+=usr/lib/libgnuregex.so.5 +OLD_FILES+=usr/lib/libgnuregex_p.a +OLD_FILES+=usr/include/gnu/posix/regex.h +OLD_DIRS+=usr/include/gnu/posix +OLD_FILES+=usr/include/gnu/regex.h +OLD_DIRS+=usr/include/gnu +OLD_FILES+=usr/include/gnuregex.h + +# 20201225: gnugrep removed +OLD_FILES+=usr/bin/gnugrep +OLD_FILES+=usr/share/man/man1/gnugrep.1.gz + # 20201224: mk48txx(4) removed OLD_FILES+=usr/share/man/man4/mk48txx.4.gz diff --git a/etc/mtree/BSD.include.dist b/etc/mtree/BSD.include.dist index ec71a7f4509f..071fba7e87ac 100644 --- a/etc/mtree/BSD.include.dist +++ b/etc/mtree/BSD.include.dist @@ -167,10 +167,6 @@ virstor .. .. - gnu - posix - .. - .. gssapi .. infiniband diff --git a/gnu/lib/Makefile b/gnu/lib/Makefile index b31838503ded..1b42da377883 100644 --- a/gnu/lib/Makefile +++ b/gnu/lib/Makefile @@ -6,10 +6,6 @@ SUBDIR= SUBDIR.${MK_DIALOG}+= libdialog SUBDIR.${MK_TESTS}+= tests -.if ${MK_GNU_GREP} != "no" -SUBDIR+= libregex -.endif - SUBDIR_PARALLEL= .include diff --git a/gnu/usr.bin/Makefile b/gnu/usr.bin/Makefile index f0aff545ddc9..9910365a5b0a 100644 --- a/gnu/usr.bin/Makefile +++ b/gnu/usr.bin/Makefile @@ -4,7 +4,6 @@ SUBDIR.${MK_DIALOG}+= dialog SUBDIR.${MK_GNU_DIFF}+= diff3 -SUBDIR.${MK_GNU_GREP}+= grep SUBDIR.${MK_TESTS}+= tests SUBDIR_PARALLEL= diff --git a/share/mk/bsd.libnames.mk b/share/mk/bsd.libnames.mk index eba09ffa5fda..feb7f4c4070e 100644 --- a/share/mk/bsd.libnames.mk +++ b/share/mk/bsd.libnames.mk @@ -67,7 +67,6 @@ LIBFL?= "don't use LIBFL, use LIBL" LIBFORM?= ${LIBDESTDIR}${LIBDIR_BASE}/libform.a LIBG2C?= ${LIBDESTDIR}${LIBDIR_BASE}/libg2c.a LIBGEOM?= ${LIBDESTDIR}${LIBDIR_BASE}/libgeom.a -LIBGNUREGEX?= ${LIBDESTDIR}${LIBDIR_BASE}/libgnuregex.a LIBGPIO?= ${LIBDESTDIR}${LIBDIR_BASE}/libgpio.a LIBGSSAPI?= ${LIBDESTDIR}${LIBDIR_BASE}/libgssapi.a LIBGSSAPI_KRB5?= ${LIBDESTDIR}${LIBDIR_BASE}/libgssapi_krb5.a diff --git a/share/mk/src.libnames.mk b/share/mk/src.libnames.mk index aa2ab42da62b..ee94279e0cca 100644 --- a/share/mk/src.libnames.mk +++ b/share/mk/src.libnames.mk @@ -117,7 +117,6 @@ _LIBRARIES= \ fetch \ figpar \ geom \ - gnuregex \ gpio \ gssapi \ gssapi_krb5 \ @@ -624,7 +623,6 @@ LIBOPENSMDIR= ${OBJTOP}/lib/ofed/libopensm LIBOSMVENDORDIR=${OBJTOP}/lib/ofed/libvendor LIBDIALOGDIR= ${OBJTOP}/gnu/lib/libdialog -LIBGNUREGEXDIR= ${OBJTOP}/gnu/lib/libregex LIBSSPDIR= ${OBJTOP}/lib/libssp LIBSSP_NONSHAREDDIR= ${OBJTOP}/lib/libssp_nonshared LIBASN1DIR= ${OBJTOP}/kerberos5/lib/libasn1 diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index ef8a71a6ebb9..b87826781318 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -68,7 +68,6 @@ __DEFAULT_YES_OPTIONS = \ BOOTPARAMD \ BOOTPD \ BSD_CPIO \ - BSD_GREP \ BSDINSTALL \ BSNMP \ BZIP2 \ @@ -206,7 +205,6 @@ __DEFAULT_NO_OPTIONS = \ CLANG_FORMAT \ DTRACE_TESTS \ EXPERIMENTAL \ - GNU_GREP \ HESIOD \ LIBSOFT \ LOADER_FIREWIRE \ diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc index a3e353e5574b..2c554f5f58c3 100644 --- a/tools/build/mk/OptionalObsoleteFiles.inc +++ b/tools/build/mk/OptionalObsoleteFiles.inc @@ -2312,31 +2312,6 @@ OLD_FILES+=usr/bin/diff3 OLD_FILES+=usr/share/man/man1/diff3.1.gz .endif -.if ${MK_GNU_GREP} == no -OLD_FILES+=usr/bin/gnugrep -OLD_FILES+=usr/share/man/man1/gnugrep.1.gz -.if ${MK_BSD_GREP} == no -OLD_FILES+=usr/bin/bzgrep -OLD_FILES+=usr/bin/bzegrep -OLD_FILES+=usr/bin/bzfgrep -OLD_FILES+=usr/bin/egrep -OLD_FILES+=usr/bin/fgrep -OLD_FILES+=usr/bin/grep -OLD_FILES+=usr/bin/zegrep -OLD_FILES+=usr/bin/zfgrep -OLD_FILES+=usr/bin/zgrep -OLD_FILES+=usr/share/man/man1/bzegrep.1.gz -OLD_FILES+=usr/share/man/man1/bzfgrep.1.gz -OLD_FILES+=usr/share/man/man1/bzgrep.1.gz -OLD_FILES+=usr/share/man/man1/egrep.1.gz -OLD_FILES+=usr/share/man/man1/fgrep.1.gz -OLD_FILES+=usr/share/man/man1/grep.1.gz -OLD_FILES+=usr/share/man/man1/zegrep.1.gz -OLD_FILES+=usr/share/man/man1/zfgrep.1.gz -OLD_FILES+=usr/share/man/man1/zgrep.1.gz -.endif -.endif - .if ${MK_GSSAPI} == no OLD_FILES+=usr/include/gssapi/gssapi.h OLD_DIRS+=usr/include/gssapi @@ -7440,7 +7415,6 @@ OLD_FILES+=usr/lib/libformw_p.a OLD_FILES+=usr/lib/libgcc_eh_p.a OLD_FILES+=usr/lib/libgcc_p.a OLD_FILES+=usr/lib/libgeom_p.a -OLD_FILES+=usr/lib/libgnuregex_p.a OLD_FILES+=usr/lib/libgpio_p.a OLD_FILES+=usr/lib/libgssapi_krb5_p.a OLD_FILES+=usr/lib/libgssapi_ntlm_p.a diff --git a/tools/build/options/WITHOUT_BSD_GREP b/tools/build/options/WITHOUT_BSD_GREP deleted file mode 100644 index b598d8aca012..000000000000 --- a/tools/build/options/WITHOUT_BSD_GREP +++ /dev/null @@ -1,2 +0,0 @@ -.\" $FreeBSD$ -Install GNU grep as '[ef]grep' instead of BSD grep. diff --git a/tools/build/options/WITHOUT_GNU_GREP b/tools/build/options/WITHOUT_GNU_GREP deleted file mode 100644 index 1bb7d4a53eba..000000000000 --- a/tools/build/options/WITHOUT_GNU_GREP +++ /dev/null @@ -1,3 +0,0 @@ -.\" $FreeBSD$ -Set to not build GNU -.Xr grep 1 . diff --git a/tools/build/options/WITH_BSD_GREP b/tools/build/options/WITH_BSD_GREP deleted file mode 100644 index e6641173e2d1..000000000000 --- a/tools/build/options/WITH_BSD_GREP +++ /dev/null @@ -1,2 +0,0 @@ -.\" $FreeBSD$ -Install BSD-licensed grep as '[ef]grep' instead of GNU grep. diff --git a/tools/build/options/WITH_GNU_GREP b/tools/build/options/WITH_GNU_GREP deleted file mode 100644 index 1d19a7df092c..000000000000 --- a/tools/build/options/WITH_GNU_GREP +++ /dev/null @@ -1,3 +0,0 @@ -.\" $FreeBSD$ -Build and install GNU -.Xr grep 1 . diff --git a/usr.bin/grep/Makefile b/usr.bin/grep/Makefile index be3f095c1ad8..3210dffd71fb 100644 --- a/usr.bin/grep/Makefile +++ b/usr.bin/grep/Makefile @@ -4,17 +4,9 @@ .include -.if ${MK_BSD_GREP} == "yes" || defined(BOOTSTRAPPING) PROG= grep MAN1= grep.1 zgrep.1 -.else -PROG= bsdgrep -CLEANFILES+= bsdgrep.1 -MAN1= bsdgrep.1 zgrep.1 -bsdgrep.1: grep.1 - ${CP} ${.ALLSRC} ${.TARGET} -.endif SRCS= file.c grep.c queue.c util.c SCRIPTS= zgrep.sh @@ -33,6 +25,10 @@ LINKS= ${BINDIR}/zgrep ${BINDIR}/zfgrep \ ${BINDIR}/zgrep ${BINDIR}/zstdegrep \ ${BINDIR}/zgrep ${BINDIR}/zstdegrep +LINKS+= ${BINDIR}/grep ${BINDIR}/egrep \ + ${BINDIR}/grep ${BINDIR}/fgrep \ + ${BINDIR}/grep ${BINDIR}/rgrep \ + MLINKS= zgrep.1 zfgrep.1 \ zgrep.1 zegrep.1 \ zgrep.1 bzgrep.1 \ @@ -48,17 +44,11 @@ MLINKS= zgrep.1 zfgrep.1 \ zgrep.1 zstdegrep.1 \ zgrep.1 zstdfgrep.1 -CFLAGS.gcc+= --param max-inline-insns-single=500 - -.if ${MK_BSD_GREP} == "yes" || defined(BOOTSTRAPPING) -LINKS+= ${BINDIR}/grep ${BINDIR}/egrep \ - ${BINDIR}/grep ${BINDIR}/fgrep \ - ${BINDIR}/grep ${BINDIR}/rgrep \ +MLINKS+= grep.1 egrep.1 \ + grep.1 fgrep.1 \ + grep.1 rgrep.1 -MLINKS+= grep.1 egrep.1 \ - grep.1 fgrep.1 \ - grep.1 rgrep.1 -.endif +CFLAGS.gcc+= --param max-inline-insns-single=500 .if !defined(BOOTSTRAPPING) LIBADD+= regex From owner-dev-commits-src-main@freebsd.org Fri Dec 25 21:19:06 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CAF924C9A78; Fri, 25 Dec 2020 21:19:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D2fvZ5Rpmz3tBc; Fri, 25 Dec 2020 21:19:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AA09C1583; Fri, 25 Dec 2020 21:19:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BPLJ6p4075204; Fri, 25 Dec 2020 21:19:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BPLJ6II075203; Fri, 25 Dec 2020 21:19:06 GMT (envelope-from git) Date: Fri, 25 Dec 2020 21:19:06 GMT Message-Id: <202012252119.0BPLJ6II075203@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 8542e8f4ddbc - src.conf: regenerate after GREP option removal MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8542e8f4ddbcc1e30cbb268c8a4220cc2fb50295 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Dec 2020 21:19:06 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=8542e8f4ddbcc1e30cbb268c8a4220cc2fb50295 commit 8542e8f4ddbcc1e30cbb268c8a4220cc2fb50295 Author: Kyle Evans AuthorDate: 2020-12-22 22:12:49 +0000 Commit: Kyle Evans CommitDate: 2020-12-25 21:16:29 +0000 src.conf: regenerate after GREP option removal Differential Revision: https://reviews.freebsd.org/D27732 --- share/man/man5/src.conf.5 | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5 index 37ebd0585431..0461a76c94b5 100644 --- a/share/man/man5/src.conf.5 +++ b/share/man/man5/src.conf.5 @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd December 15, 2020 +.Dd December 25, 2020 .Dt SRC.CONF 5 .Os .Sh NAME @@ -222,8 +222,6 @@ and related programs. .It Va WITHOUT_BSD_CPIO Set to not build the BSD licensed version of cpio based on .Xr libarchive 3 . -.It Va WITHOUT_BSD_GREP -Install GNU grep as '[ef]grep' instead of BSD grep. .It Va WITHOUT_BSNMP Set to not build or install .Xr bsnmpd 1 @@ -665,9 +663,6 @@ programs instead of the traditional FreeBSD versions. .It Va WITHOUT_GNU_DIFF Set to not build GNU .Xr diff3 1 . -.It Va WITH_GNU_GREP -Build and install GNU -.Xr grep 1 . .It Va WITHOUT_GOOGLETEST Set to neither build nor install .Lb libgmock , From owner-dev-commits-src-main@freebsd.org Fri Dec 25 21:19:06 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C4E114CA485; Fri, 25 Dec 2020 21:19:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D2fvZ5D1hz3tdT; Fri, 25 Dec 2020 21:19:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A1E221230; Fri, 25 Dec 2020 21:19:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BPLJ6h5075187; Fri, 25 Dec 2020 21:19:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BPLJ64L075186; Fri, 25 Dec 2020 21:19:06 GMT (envelope-from git) Date: Fri, 25 Dec 2020 21:19:06 GMT Message-Id: <202012252119.0BPLJ64L075186@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: d1c965f1436a - grep: tests: stop testing for a nonexistent version of grep MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d1c965f1436aae22127485370332555ec01b3a23 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Dec 2020 21:19:06 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=d1c965f1436aae22127485370332555ec01b3a23 commit d1c965f1436aae22127485370332555ec01b3a23 Author: Kyle Evans AuthorDate: 2020-12-22 21:39:12 +0000 Commit: Kyle Evans CommitDate: 2020-12-25 21:16:33 +0000 grep: tests: stop testing for a nonexistent version of grep Differential Revision: https://reviews.freebsd.org/D27732 --- usr.bin/grep/tests/grep_freebsd_test.sh | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/usr.bin/grep/tests/grep_freebsd_test.sh b/usr.bin/grep/tests/grep_freebsd_test.sh index 52455cd1d653..0d068d5d1c65 100755 --- a/usr.bin/grep/tests/grep_freebsd_test.sh +++ b/usr.bin/grep/tests/grep_freebsd_test.sh @@ -28,12 +28,9 @@ # What grep(1) are we working with? # - 0 : bsdgrep -# - 1 : gnu grep 2.51 (base) -# - 2 : gnu grep (ports) +# - 1 : gnu grep (ports) GREP_TYPE_BSD=0 -GREP_TYPE_GNU_FREEBSD=1 -GREP_TYPE_GNU=2 -GREP_TYPE_UNKNOWN=3 +GREP_TYPE_GNU=1 grep_type() { @@ -44,14 +41,7 @@ grep_type() return $GREP_TYPE_BSD ;; *"GNU grep"*) - case "$grep_version" in - *2.5.1-FreeBSD*) - return $GREP_TYPE_GNU_FREEBSD - ;; - *) - return $GREP_TYPE_GNU - ;; - esac + return $GREP_TYPE_GNU ;; esac atf_fail "unknown grep type: $grep_version" @@ -87,9 +77,6 @@ gnuext_body() { grep_type _type=$? - if [ $_type -eq $GREP_TYPE_GNU_FREEBSD ]; then - atf_expect_fail "\\s and \\S are known to be buggy in base gnugrep" - fi atf_check -o save:grep_alnum.out grep -o '[[:alnum:]]' /COPYRIGHT atf_check -o file:grep_alnum.out grep -o '\w' /COPYRIGHT From owner-dev-commits-src-main@freebsd.org Fri Dec 25 21:22:38 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 88D3A4CA690 for ; Fri, 25 Dec 2020 21:22:38 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D2fzf3KL6z3vHN for ; Fri, 25 Dec 2020 21:22:38 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qt1-f170.google.com (mail-qt1-f170.google.com [209.85.160.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 5C2AFFE4F for ; Fri, 25 Dec 2020 21:22:38 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qt1-f170.google.com with SMTP id 2so3482301qtt.10 for ; Fri, 25 Dec 2020 13:22:38 -0800 (PST) X-Gm-Message-State: AOAM531BPbb0ukm8cNB2YHOYEAyLQigl9xNRmsF8SDfuCxZvSfSl3UHK oZLBpfh2MsPpUIy9we5Y2RIOZ3TGDupeOMZb6vY= X-Received: by 2002:ac8:3656:: with SMTP id n22mt35948071qtb.242.1608931357876; Fri, 25 Dec 2020 13:22:37 -0800 (PST) MIME-Version: 1.0 References: <202012252119.0BPLJ6b9075169@gitrepo.freebsd.org> In-Reply-To: <202012252119.0BPLJ6b9075169@gitrepo.freebsd.org> From: Kyle Evans Date: Fri, 25 Dec 2020 15:22:27 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: 47d1ad2413da - gnu: remove gnugrep and libgnuregex Cc: src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Dec 2020 21:22:38 -0000 On Fri, Dec 25, 2020 at 3:19 PM Kyle Evans wrote: > > The branch main has been updated by kevans: > > URL: https://cgit.FreeBSD.org/src/commit/?id=47d1ad2413da619b3b435f6f181483fb66d5fa8d > > commit 47d1ad2413da619b3b435f6f181483fb66d5fa8d > Author: Kyle Evans > AuthorDate: 2020-12-22 21:38:09 +0000 > Commit: Kyle Evans > CommitDate: 2020-12-25 21:16:33 +0000 > > gnu: remove gnugrep and libgnuregex > > Differential Revision: https://reviews.freebsd.org/D27732 I forgot to edit these in, my apologies. :-( Reviewed by: brooks, emaste, bcr (manpages) From owner-dev-commits-src-main@freebsd.org Fri Dec 25 21:28:27 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 99EC54CA350; Fri, 25 Dec 2020 21:28:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D2g6M3dc1z3vNH; Fri, 25 Dec 2020 21:28:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6A0B412E0; Fri, 25 Dec 2020 21:28:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BPLSRU8086505; Fri, 25 Dec 2020 21:28:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BPLSRAH086504; Fri, 25 Dec 2020 21:28:27 GMT (envelope-from git) Date: Fri, 25 Dec 2020 21:28:27 GMT Message-Id: <202012252128.0BPLSRAH086504@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Marius Strobl Subject: git: 261295ba4c8f - fwohci.4: Bump .Dd MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: marius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 261295ba4c8f4c4598c8ce2d7299d056da341876 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Dec 2020 21:28:27 -0000 The branch main has been updated by marius: URL: https://cgit.FreeBSD.org/src/commit/?id=261295ba4c8f4c4598c8ce2d7299d056da341876 commit 261295ba4c8f4c4598c8ce2d7299d056da341876 Author: Marius Strobl AuthorDate: 2020-12-25 21:21:49 +0000 Commit: Marius Strobl CommitDate: 2020-12-25 21:23:28 +0000 fwohci.4: Bump .Dd Missed in 50d823d5b8b61b96b17dff6f1658774bd438f067 --- share/man/man4/fwohci.4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man4/fwohci.4 b/share/man/man4/fwohci.4 index 3d9f763baef5..a4f7d42be5b2 100644 --- a/share/man/man4/fwohci.4 +++ b/share/man/man4/fwohci.4 @@ -32,7 +32,7 @@ .\" $FreeBSD$ .\" .\" -.Dd March 3, 2008 +.Dd December 24, 2020 .Dt FWOHCI 4 .Os .Sh NAME From owner-dev-commits-src-main@freebsd.org Fri Dec 25 21:28:27 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9A6A34CA705; Fri, 25 Dec 2020 21:28:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D2g6M3mbWz3vJ9; Fri, 25 Dec 2020 21:28:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7037914F6; Fri, 25 Dec 2020 21:28:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BPLSRiN086522; Fri, 25 Dec 2020 21:28:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BPLSRL0086521; Fri, 25 Dec 2020 21:28:27 GMT (envelope-from git) Date: Fri, 25 Dec 2020 21:28:27 GMT Message-Id: <202012252128.0BPLSRL0086521@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Marius Strobl Subject: git: f18782e49aa4 - ohci.4: Bump .Dd MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: marius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f18782e49aa4b91fc0942ec31adc9f2c515d3846 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Dec 2020 21:28:27 -0000 The branch main has been updated by marius: URL: https://cgit.FreeBSD.org/src/commit/?id=f18782e49aa4b91fc0942ec31adc9f2c515d3846 commit f18782e49aa4b91fc0942ec31adc9f2c515d3846 Author: Marius Strobl AuthorDate: 2020-12-25 21:20:22 +0000 Commit: Marius Strobl CommitDate: 2020-12-25 21:23:28 +0000 ohci.4: Bump .Dd Missed in 5db1ed2f332fd784b7c8bf3a0c2182d86cd00d57 --- share/man/man4/ohci.4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man4/ohci.4 b/share/man/man4/ohci.4 index 318ee511fb61..1371928145ef 100644 --- a/share/man/man4/ohci.4 +++ b/share/man/man4/ohci.4 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 24, 2018 +.Dd December 24, 2020 .Dt OHCI 4 .Os .Sh NAME From owner-dev-commits-src-main@freebsd.org Fri Dec 25 22:39:36 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 125604CC547; Fri, 25 Dec 2020 22:39:36 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4D2hhG1fndz4TR1; Fri, 25 Dec 2020 22:39:25 +0000 (UTC) (envelope-from avg@FreeBSD.org) X-Originating-IP: 195.64.148.76 Received: from [192.168.0.24] (unknown [195.64.148.76]) (Authenticated sender: andriy.gapon@uabsd.com) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id 6E313FF803; Fri, 25 Dec 2020 22:39:23 +0000 (UTC) Subject: Re: git: 760dbe84abfb - Don't set more_data which is never used. To: Xin LI , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202012250250.0BP2oJEe076195@gitrepo.freebsd.org> From: Andriy Gapon Message-ID: <1f199cd4-5560-08b2-539b-145945af6dec@FreeBSD.org> Date: Sat, 26 Dec 2020 00:39:21 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <202012250250.0BP2oJEe076195@gitrepo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4D2hhG1fndz4TR1 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Dec 2020 22:39:36 -0000 On 2020-12-25 04:50, Xin LI wrote: > Don't set more_data which is never used. > > MFC after: 2 weeks > --- > usr.sbin/zonectl/zonectl.c | 5 +---- I think it would be better to prepend the commit message with something like "zonectl:". Otherwise, using git log --oneline or even just git log it is hard to tell where the change was made and if it's potentially of interest to a reader. Of course, git log --stat reveals that information. -- Andriy From owner-dev-commits-src-main@freebsd.org Sat Dec 26 01:43:05 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5F0D24CFF24; Sat, 26 Dec 2020 01:43:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D2mm92Hgzz4cyh; Sat, 26 Dec 2020 01:43:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 410664BFF; Sat, 26 Dec 2020 01:43:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BQ1h5mg066536; Sat, 26 Dec 2020 01:43:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BQ1h5U0066535; Sat, 26 Dec 2020 01:43:05 GMT (envelope-from git) Date: Sat, 26 Dec 2020 01:43:05 GMT Message-Id: <202012260143.0BQ1h5U0066535@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Xin LI Subject: git: 7e7571829512 - sbin/routed: Remove unused code for sgi and NetBSD. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: delphij X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7e7571829512b08641effefc9f112dc264a79e78 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Dec 2020 01:43:05 -0000 The branch main has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=7e7571829512b08641effefc9f112dc264a79e78 commit 7e7571829512b08641effefc9f112dc264a79e78 Author: Xin LI AuthorDate: 2020-12-26 01:42:11 +0000 Commit: Xin LI CommitDate: 2020-12-26 01:42:47 +0000 sbin/routed: Remove unused code for sgi and NetBSD. MFC after: 2 weeks --- sbin/routed/defs.h | 41 ----------------------------------------- sbin/routed/if.c | 20 -------------------- sbin/routed/input.c | 7 ------- sbin/routed/main.c | 20 -------------------- sbin/routed/output.c | 7 ------- sbin/routed/parms.c | 7 ------- sbin/routed/pathnames.h | 4 ---- sbin/routed/radix.c | 7 ------- sbin/routed/rdisc.c | 7 ------- sbin/routed/table.c | 7 ------- sbin/routed/trace.c | 15 --------------- 11 files changed, 142 deletions(-) diff --git a/sbin/routed/defs.h b/sbin/routed/defs.h index 5ce7b5be3b16..9b0218163d3b 100644 --- a/sbin/routed/defs.h +++ b/sbin/routed/defs.h @@ -33,9 +33,6 @@ * $FreeBSD$ */ -#ifdef sgi -#ident "$FreeBSD$" -#endif /* Definitions for RIPv2 routing process. * @@ -69,10 +66,6 @@ #include #include #include -#ifdef sgi -#include -#include -#endif #include #include #include @@ -84,14 +77,9 @@ #include #include #include -#ifdef sgi -#define _USER_ROUTE_TREE -#include -#else #include "radix.h" #define UNUSED __attribute__((unused)) #define PATTRIB(f,l) __attribute__((format (printf,f,l))) -#endif #include #include #include @@ -113,17 +101,9 @@ * So define it here so it can be changed for the target system. * It should be defined somewhere netinet/in.h, but it is not. */ -#ifdef sgi -#define naddr u_int32_t -#elif defined (__NetBSD__) -#define naddr u_int32_t -#define _HAVE_SA_LEN -#define _HAVE_SIN_LEN -#else #define naddr u_long #define _HAVE_SA_LEN #define _HAVE_SIN_LEN -#endif #define DAY (24*60*60) #define NEVER DAY /* a long time */ @@ -147,9 +127,7 @@ /* Router Discovery parameters */ -#ifndef sgi #define INADDR_ALLROUTERS_GROUP 0xe0000002 /* 224.0.0.2 */ -#endif #define MaxMaxAdvertiseInterval 1800 #define MinMaxAdvertiseInterval 4 #define DefMaxAdvertiseInterval 600 @@ -295,9 +273,6 @@ struct interface { u_int ierrors; u_int opackets; u_int oerrors; -#ifdef sgi - u_int odrops; -#endif time_t ts; /* timestamp on network stats */ } int_data; # define MAX_AUTH_KEYS 5 @@ -502,10 +477,6 @@ extern char inittracename[PATH_MAX]; extern struct radix_node_head *rhead; -#ifdef sgi -/* Fix conflicts */ -#define dup2(x,y) BSDdup2(x,y) -#endif /* sgi */ void fix_sock(int, const char *); void fix_select(void); @@ -635,16 +606,4 @@ struct interface *iflookup(naddr); struct auth *find_auth(struct interface *); void end_md5_auth(struct ws_buf *, struct auth *); -#if defined(__FreeBSD__) || defined(__NetBSD__) #include -#else -#define MD5_DIGEST_LEN 16 -typedef struct { - u_int32_t state[4]; /* state (ABCD) */ - u_int32_t count[2]; /* # of bits, modulo 2^64 (LSB 1st) */ - unsigned char buffer[64]; /* input buffer */ -} MD5_CTX; -void MD5Init(MD5_CTX*); -void MD5Update(MD5_CTX*, u_char*, u_int); -void MD5Final(u_char[MD5_DIGEST_LEN], MD5_CTX*); -#endif diff --git a/sbin/routed/if.c b/sbin/routed/if.c index af02b9e87391..da451e69e4d8 100644 --- a/sbin/routed/if.c +++ b/sbin/routed/if.c @@ -36,14 +36,7 @@ #include "defs.h" #include "pathnames.h" -#ifdef __NetBSD__ -__RCSID("$NetBSD$"); -#elif defined(__FreeBSD__) __RCSID("$FreeBSD$"); -#else -__RCSID("$Revision: 2.27 $"); -#ident "$Revision: 2.27 $" -#endif struct ifhead ifnet = LIST_HEAD_INITIALIZER(ifnet); /* all interfaces */ struct ifhead remote_if = LIST_HEAD_INITIALIZER(remote_if); /* remote interfaces */ @@ -735,9 +728,6 @@ ifinit(void) ifs0.int_data.ierrors = ifm->ifm_data.ifi_ierrors; ifs0.int_data.opackets = ifm->ifm_data.ifi_opackets; ifs0.int_data.oerrors = ifm->ifm_data.ifi_oerrors; -#ifdef sgi - ifs0.int_data.odrops = ifm->ifm_data.ifi_odrops; -#endif sdl = (struct sockaddr_dl *)(ifm + 1); sdl->sdl_data[sdl->sdl_nlen] = 0; strncpy(ifs0.int_name, sdl->sdl_data, @@ -977,16 +967,6 @@ ifinit(void) ierr = ifs.int_data.ierrors - ifp->int_data.ierrors; out = ifs.int_data.opackets - ifp->int_data.opackets; oerr = ifs.int_data.oerrors - ifp->int_data.oerrors; -#ifdef sgi - /* Through at least IRIX 6.2, PPP and SLIP - * count packets dropped by the filters. - * But FDDI rings stuck non-operational count - * dropped packets as they wait for improvement. - */ - if (!(ifp->int_if_flags & IFF_POINTOPOINT)) - oerr += (ifs.int_data.odrops - - ifp->int_data.odrops); -#endif /* If the interface just awoke, restart the counters. */ if (ifp->int_data.ts == 0) { diff --git a/sbin/routed/input.c b/sbin/routed/input.c index 116d15ca7437..ef1c025e8f81 100644 --- a/sbin/routed/input.c +++ b/sbin/routed/input.c @@ -33,14 +33,7 @@ #include "defs.h" -#ifdef __NetBSD__ -__RCSID("$NetBSD$"); -#elif defined(__FreeBSD__) __RCSID("$FreeBSD$"); -#else -__RCSID("$Revision: 2.26 $"); -#ident "$Revision: 2.26 $" -#endif static void input(struct sockaddr_in *, struct interface *, struct interface *, struct rip *, int); diff --git a/sbin/routed/main.c b/sbin/routed/main.c index c4f9e56065e6..d3b6a4484689 100644 --- a/sbin/routed/main.c +++ b/sbin/routed/main.c @@ -33,9 +33,6 @@ #include "defs.h" #include "pathnames.h" -#ifdef sgi -#include "math.h" -#endif #include #include #include @@ -43,15 +40,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 1988, 1993 " "The Regents of the University of California." " All rights reserved."); -#ifdef __NetBSD__ -__RCSID("$NetBSD$"); -#include -#elif defined(__FreeBSD__) __RCSID("$FreeBSD$"); -#else -__RCSID("$Revision: 2.31 $"); -#ident "$Revision: 2.31 $" -#endif pid_t mypid; @@ -292,18 +281,9 @@ usage: signal(SIGUSR2, sigtrace_off); /* get into the background */ -#ifdef sgi - if (0 > _daemonize(background ? 0 : (_DF_NOCHDIR|_DF_NOFORK), - STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO)) - BADERR(0, "_daemonize()"); -#else if (background && daemon(0, 1) < 0) BADERR(0,"daemon()"); -#endif -#if defined(__NetBSD__) - pidfile(0); -#endif mypid = getpid(); /* prepare socket connected to the kernel. diff --git a/sbin/routed/output.c b/sbin/routed/output.c index 7d5b1e4131a6..af4085ac02da 100644 --- a/sbin/routed/output.c +++ b/sbin/routed/output.c @@ -33,14 +33,7 @@ #include "defs.h" -#ifdef __NetBSD__ -__RCSID("$NetBSD$"); -#elif defined(__FreeBSD__) __RCSID("$FreeBSD$"); -#else -__RCSID("$Revision: 2.27 $"); -#ident "$Revision: 2.27 $" -#endif u_int update_seqno; diff --git a/sbin/routed/parms.c b/sbin/routed/parms.c index ef501b043244..16665b18407f 100644 --- a/sbin/routed/parms.c +++ b/sbin/routed/parms.c @@ -35,14 +35,7 @@ #include "pathnames.h" #include -#ifdef __NetBSD__ -__RCSID("$NetBSD$"); -#elif defined(__FreeBSD__) __RCSID("$FreeBSD$"); -#else -__RCSID("$Revision: 2.26 $"); -#ident "$Revision: 2.26 $" -#endif static struct parm *parms; diff --git a/sbin/routed/pathnames.h b/sbin/routed/pathnames.h index fff6de671cfa..5a31fa7e86bc 100644 --- a/sbin/routed/pathnames.h +++ b/sbin/routed/pathnames.h @@ -47,8 +47,4 @@ * Leave this undefined, and only the trace file originally specified * when routed was started, if any, will be appended to. */ -#ifndef __NetBSD__ #define _PATH_TRACE "/etc/routed.trace" -#else -#undef _PATH_TRACE -#endif diff --git a/sbin/routed/radix.c b/sbin/routed/radix.c index 0f3ef39ec213..2372b8c68581 100644 --- a/sbin/routed/radix.c +++ b/sbin/routed/radix.c @@ -39,14 +39,7 @@ #include "defs.h" -#ifdef __NetBSD__ -__RCSID("$NetBSD$"); -#elif defined(__FreeBSD__) __RCSID("$FreeBSD$"); -#else -__RCSID("$Revision: 2.23 $"); -#ident "$Revision: 2.23 $" -#endif #define log(x, msg) syslog(x, msg) #define panic(s) {log(LOG_ERR,s); exit(1);} diff --git a/sbin/routed/rdisc.c b/sbin/routed/rdisc.c index b8b02d7b9e1a..3494f061b64b 100644 --- a/sbin/routed/rdisc.c +++ b/sbin/routed/rdisc.c @@ -36,14 +36,7 @@ #include #include -#ifdef __NetBSD__ -__RCSID("$NetBSD$"); -#elif defined(__FreeBSD__) __RCSID("$FreeBSD$"); -#else -__RCSID("$Revision: 2.27 $"); -#ident "$Revision: 2.27 $" -#endif /* router advertisement ICMP packet */ struct icmp_ad { diff --git a/sbin/routed/table.c b/sbin/routed/table.c index 04b2f79f5e08..648a1d1a6b25 100644 --- a/sbin/routed/table.c +++ b/sbin/routed/table.c @@ -33,14 +33,7 @@ #include "defs.h" -#ifdef __NetBSD__ -__RCSID("$NetBSD$"); -#elif defined(__FreeBSD__) __RCSID("$FreeBSD$"); -#else -__RCSID("$Revision: 2.27 $"); -#ident "$Revision: 2.27 $" -#endif static struct rt_spare *rts_better(struct rt_entry *); static struct rt_spare rts_empty = {0,0,0,HOPCNT_INFINITY,0,0,0}; diff --git a/sbin/routed/trace.c b/sbin/routed/trace.c index 5fe4a97c2146..98c29218fb89 100644 --- a/sbin/routed/trace.c +++ b/sbin/routed/trace.c @@ -38,20 +38,9 @@ #include #include -#ifdef __NetBSD__ -__RCSID("$NetBSD$"); -#elif defined(__FreeBSD__) __RCSID("$FreeBSD$"); -#else -__RCSID("$Revision: 2.27 $"); -#ident "$Revision: 2.27 $" -#endif -#ifdef sgi -/* use *stat64 for files on large file systems */ -#define stat stat64 -#endif int tracelevel, new_tracelevel; FILE *ftrace; /* output trace file */ @@ -150,12 +139,8 @@ ts(time_t secs) { static char s[20]; secs += epoch.tv_sec; -#ifdef sgi - (void)cftime(s, "%T", &secs); -#else memcpy(s, ctime(&secs)+11, 8); s[8] = '\0'; -#endif return s; } From owner-dev-commits-src-main@freebsd.org Sat Dec 26 01:52:57 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3F9E14D0626; Sat, 26 Dec 2020 01:52:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D2mzY1JYKz4dp6; Sat, 26 Dec 2020 01:52:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1F9364F27; Sat, 26 Dec 2020 01:52:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BQ1qvN5077156; Sat, 26 Dec 2020 01:52:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BQ1qvxH077155; Sat, 26 Dec 2020 01:52:57 GMT (envelope-from git) Date: Sat, 26 Dec 2020 01:52:57 GMT Message-Id: <202012260152.0BQ1qvxH077155@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Xin LI Subject: git: 804b4afb9cf8 - sbin/init: Reduce code duplication by using %m for error message instead of passing %s with return value from strerror(). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: delphij X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 804b4afb9cf897dc353d9ba379dbedbba1541016 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Dec 2020 01:52:57 -0000 The branch main has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=804b4afb9cf897dc353d9ba379dbedbba1541016 commit 804b4afb9cf897dc353d9ba379dbedbba1541016 Author: Xin LI AuthorDate: 2020-12-26 01:49:33 +0000 Commit: Xin LI CommitDate: 2020-12-26 01:49:33 +0000 sbin/init: Reduce code duplication by using %m for error message instead of passing %s with return value from strerror(). MFC after: 2 weeks --- sbin/init/init.c | 53 +++++++++++++++++++++++++---------------------------- 1 file changed, 25 insertions(+), 28 deletions(-) diff --git a/sbin/init/init.c b/sbin/init/init.c index f7c4144eb6a5..c5f3c121f7f9 100644 --- a/sbin/init/init.c +++ b/sbin/init/init.c @@ -532,8 +532,7 @@ getsecuritylevel(void) name[1] = KERN_SECURELVL; len = sizeof curlevel; if (sysctl(name, 2, &curlevel, &len, NULL, 0) == -1) { - emergency("cannot get kernel security level: %s", - strerror(errno)); + emergency("cannot get kernel security level: %m"); return (-1); } return (curlevel); @@ -558,8 +557,8 @@ setsecuritylevel(int newlevel) name[1] = KERN_SECURELVL; if (sysctl(name, 2, NULL, NULL, &newlevel, sizeof newlevel) == -1) { emergency( - "cannot change kernel security level from %d to %d: %s", - curlevel, newlevel, strerror(errno)); + "cannot change kernel security level from %d to %d: %m", + curlevel, newlevel); return; } #ifdef SECURE @@ -651,13 +650,13 @@ read_file(const char *path, void **bufp, size_t *bufsizep) fd = open(path, O_RDONLY); if (fd < 0) { - emergency("%s: %s", path, strerror(errno)); + emergency("%s: %m", path); return (-1); } error = fstat(fd, &sb); if (error != 0) { - emergency("fstat: %s", strerror(errno)); + emergency("fstat: %m"); close(fd); return (error); } @@ -665,14 +664,14 @@ read_file(const char *path, void **bufp, size_t *bufsizep) bufsize = sb.st_size; buf = malloc(bufsize); if (buf == NULL) { - emergency("malloc: %s", strerror(errno)); + emergency("malloc: %m"); close(fd); return (error); } nbytes = read(fd, buf, bufsize); if (nbytes != (ssize_t)bufsize) { - emergency("read: %s", strerror(errno)); + emergency("read: %m"); close(fd); free(buf); return (error); @@ -680,7 +679,7 @@ read_file(const char *path, void **bufp, size_t *bufsizep) error = close(fd); if (error != 0) { - emergency("close: %s", strerror(errno)); + emergency("close: %m"); free(buf); return (error); } @@ -699,20 +698,20 @@ create_file(const char *path, const void *buf, size_t bufsize) fd = open(path, O_WRONLY | O_CREAT | O_EXCL, 0700); if (fd < 0) { - emergency("%s: %s", path, strerror(errno)); + emergency("%s: %m", path); return (-1); } nbytes = write(fd, buf, bufsize); if (nbytes != (ssize_t)bufsize) { - emergency("write: %s", strerror(errno)); + emergency("write: %m"); close(fd); return (-1); } error = close(fd); if (error != 0) { - emergency("close: %s", strerror(errno)); + emergency("close: %m"); return (-1); } @@ -739,11 +738,11 @@ mount_tmpfs(const char *fspath) error = nmount(iov, iovlen, 0); if (error != 0) { if (*errmsg != '\0') { - emergency("cannot mount tmpfs on %s: %s: %s", - fspath, errmsg, strerror(errno)); + emergency("cannot mount tmpfs on %s: %s: %m", + fspath, errmsg); } else { - emergency("cannot mount tmpfs on %s: %s", - fspath, strerror(errno)); + emergency("cannot mount tmpfs on %s: %m", + fspath); } return (error); } @@ -770,7 +769,7 @@ reroot(void) */ error = kill(-1, SIGKILL); if (error != 0 && errno != ESRCH) { - emergency("kill(2) failed: %s", strerror(errno)); + emergency("kill(2) failed: %m"); goto out; } @@ -792,7 +791,7 @@ reroot(void) * Execute the temporary init. */ execl(_PATH_REROOT_INIT, _PATH_REROOT_INIT, "-r", NULL); - emergency("cannot exec %s: %s", _PATH_REROOT_INIT, strerror(errno)); + emergency("cannot exec %s: %m", _PATH_REROOT_INIT); out: emergency("reroot failed; going to single user mode"); @@ -812,7 +811,7 @@ reroot_phase_two(void) */ error = reboot(RB_REROOT); if (error != 0) { - emergency("RB_REBOOT failed: %s", strerror(errno)); + emergency("RB_REBOOT failed: %m"); goto out; } @@ -829,8 +828,7 @@ reroot_phase_two(void) error = sysctlbyname("kern.init_path", init_path, &init_path_len, NULL, 0); if (error != 0) { - emergency("failed to retrieve kern.init_path: %s", - strerror(errno)); + emergency("failed to retrieve kern.init_path: %m"); goto out; } } @@ -845,7 +843,7 @@ reroot_phase_two(void) */ execl(path, path, NULL); } - emergency("cannot exec init from %s: %s", init_path, strerror(errno)); + emergency("cannot exec init from %s: %m", init_path); out: emergency("reroot failed; going to single user mode"); @@ -879,8 +877,7 @@ single_user(void) /* Instead of going single user, let's reboot the machine */ sync(); if (reboot(howto) == -1) { - emergency("reboot(%#x) failed, %s", howto, - strerror(errno)); + emergency("reboot(%#x) failed, %m", howto); _exit(1); /* panic and reboot */ } warning("reboot(%#x) returned", howto); @@ -1187,9 +1184,9 @@ static int start_session_db(void) { if (session_db && (*session_db->close)(session_db)) - emergency("session database close: %s", strerror(errno)); + emergency("session database close: %m"); if ((session_db = dbopen(NULL, O_RDWR, 0, DB_HASH, NULL)) == NULL) { - emergency("session database open: %s", strerror(errno)); + emergency("session database open: %m"); return (1); } return (0); @@ -1211,7 +1208,7 @@ add_session(session_t *sp) data.size = sizeof sp; if ((*session_db->put)(session_db, &key, &data, 0)) - emergency("insert %d: %s", sp->se_process, strerror(errno)); + emergency("insert %d: %m", sp->se_process); } /* @@ -1226,7 +1223,7 @@ del_session(session_t *sp) key.size = sizeof sp->se_process; if ((*session_db->del)(session_db, &key, 0)) - emergency("delete %d: %s", sp->se_process, strerror(errno)); + emergency("delete %d: %m", sp->se_process); } /* From owner-dev-commits-src-main@freebsd.org Sat Dec 26 02:57:49 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F10BC4D394A; Sat, 26 Dec 2020 02:57:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D2pQP6SbPz4k6L; Sat, 26 Dec 2020 02:57:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D09315AC3; Sat, 26 Dec 2020 02:57:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BQ2vnjd041964; Sat, 26 Dec 2020 02:57:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BQ2vn9W041963; Sat, 26 Dec 2020 02:57:49 GMT (envelope-from git) Date: Sat, 26 Dec 2020 02:57:49 GMT Message-Id: <202012260257.0BQ2vn9W041963@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Philip Paeps Subject: git: 24c7311bff83 - share/zoneinfo: update import documentation for Git MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: philip X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 24c7311bff83fb9147b5d890aae4e9546903b6ef Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Dec 2020 02:57:50 -0000 The branch main has been updated by philip: URL: https://cgit.FreeBSD.org/src/commit/?id=24c7311bff83fb9147b5d890aae4e9546903b6ef commit 24c7311bff83fb9147b5d890aae4e9546903b6ef Author: Philip Paeps AuthorDate: 2020-12-26 02:55:57 +0000 Commit: Philip Paeps CommitDate: 2020-12-26 02:55:57 +0000 share/zoneinfo: update import documentation for Git Document the steps needed to import and MFC new versions of tzdata now that FreeBSD has moved from Subversion to Git. --- share/zoneinfo/Makefile | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/share/zoneinfo/Makefile b/share/zoneinfo/Makefile index 08867dc673fd..3cbca07c1b94 100644 --- a/share/zoneinfo/Makefile +++ b/share/zoneinfo/Makefile @@ -3,29 +3,31 @@ # # HOW TO UPDATE THE ZONEINFO DATA # -# With the use of subversion, this is a little bit simpler than the CVS method. -# # Import the new sources to the vendor branch: # -# $ cd ~/svn/vendor/tzdata/dist -# $ tar zxvf /usr/ports/distfile/tzdata2008X.tar.gz -# (check with "svn stat" and "svn diff" if it all makes sense) -# $ svn commit # Commit message: "Vendor import of tzdata2008X (+details)" +# $ cd ~/freebsd/src +# $ git worktree add ../tzdata vendor/tzdata +# $ pushd ../tzdata +# $ tar -xvf ../tzdata-latest.tar.gz +# (check with "git status" and "git diff" if it all makes sense) +# $ git add -A +# $ git commit -m "Import tzdata 20XXX" +# $ git tag -a -m "Tag import of tzdata 20XXX" +# $ git push --follow-tags freebsd vendor/tzdata +# $ popd # -# Tag it +# Merge-from-vendor # -# $ cd ~/svn/vendor/tzdata -# $ svn cp svn+ssh://svn.freebsd.org/base/vendor/tzdata/dist \ -# svn+ssh://svn.freebsd.org/base/vendor/tzdata/tzdata2008X -# $ svn commit # Commit message: "Tag of tzdata2008X" +# $ git subtree merge -P contrib/tzdata vendor/tzdata +# (write a meaningful commit message) +# $ git push freebsd HEAD:main # -# Merge-from-vendor +# MFC # -# $ cd ~/svn/head/contrib/tzdata -# $ svn update -# $ svn merge -c X --accept=postpone \ -# svn+ssh://svn.freebsd.org/base/vendor/tzdata/dist . -# $ svn commit # Commit message: "MFV of tzdata2008X" +# $ git checkout -b freebsd/stable/12 stable-12 +# $ git cherry-pick -x [hash of merge commit to main] -m 1 --edit +# (write a meaningful commit message) +# $ git push freebsd HEAD:stable/12 # .include From owner-dev-commits-src-main@freebsd.org Sat Dec 26 11:31:19 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9A5B94B6790; Sat, 26 Dec 2020 11:31:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D31pv417nz3Qdf; Sat, 26 Dec 2020 11:31:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7CA0C144CA; Sat, 26 Dec 2020 11:31:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BQBVJeG000627; Sat, 26 Dec 2020 11:31:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BQBVJJN000626; Sat, 26 Dec 2020 11:31:19 GMT (envelope-from git) Date: Sat, 26 Dec 2020 11:31:19 GMT Message-Id: <202012261131.0BQBVJJN000626@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 4e19e0d92ac6 - Use light-weight versions of routing lookup functions in ng_netflow. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4e19e0d92ac6dfa5d2df6d525922f1e60487a9cc Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Dec 2020 11:31:19 -0000 The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=4e19e0d92ac6dfa5d2df6d525922f1e60487a9cc commit 4e19e0d92ac6dfa5d2df6d525922f1e60487a9cc Author: Alexander V. Chernikov AuthorDate: 2020-12-26 11:07:30 +0000 Commit: Alexander V. Chernikov CommitDate: 2020-12-26 11:27:38 +0000 Use light-weight versions of routing lookup functions in ng_netflow. Use recently-added combination of `fib[46]_lookup_rt()` which returns rtentry & raw nexthop with `rt_get_inet[6]_plen()` which returns address/prefix length of prefix inside `rt`. Add `nhop_select_func()` wrapper around inlined `nhop_select()` to allow callers external to the routing subsystem select the proper nexthop from the multipath group without including internal headers. New calls does not require reference counting objects and reduce the amount of copied/processed rtentry data. Differential Revision: https://reviews.freebsd.org/D27675 --- sys/net/route/nhop.h | 1 + sys/net/route/nhop_ctl.c | 7 ++ sys/netgraph/netflow/netflow.c | 164 +++++++++++++++----------------------- sys/netgraph/netflow/ng_netflow.c | 17 +++- 4 files changed, 86 insertions(+), 103 deletions(-) diff --git a/sys/net/route/nhop.h b/sys/net/route/nhop.h index 3944d8946b07..8b5ac7ada072 100644 --- a/sys/net/route/nhop.h +++ b/sys/net/route/nhop.h @@ -181,6 +181,7 @@ uint32_t nhop_get_idx(const struct nhop_object *nh); enum nhop_type nhop_get_type(const struct nhop_object *nh); int nhop_get_rtflags(const struct nhop_object *nh); struct vnet *nhop_get_vnet(const struct nhop_object *nh); +struct nhop_object *nhop_select_func(struct nhop_object *nh, uint32_t flowid); #endif /* _KERNEL */ diff --git a/sys/net/route/nhop_ctl.c b/sys/net/route/nhop_ctl.c index 2b676663a782..542380afd64b 100644 --- a/sys/net/route/nhop_ctl.c +++ b/sys/net/route/nhop_ctl.c @@ -761,6 +761,13 @@ nhop_get_vnet(const struct nhop_object *nh) return (nh->nh_priv->nh_vnet); } +struct nhop_object * +nhop_select_func(struct nhop_object *nh, uint32_t flowid) +{ + + return (nhop_select(nh, flowid)); +} + void nhops_update_ifmtu(struct rib_head *rh, struct ifnet *ifp, uint32_t mtu) { diff --git a/sys/netgraph/netflow/netflow.c b/sys/netgraph/netflow/netflow.c index 8e1bcddd6895..e9fb83773a4b 100644 --- a/sys/netgraph/netflow/netflow.c +++ b/sys/netgraph/netflow/netflow.c @@ -33,6 +33,7 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_inet.h" #include "opt_inet6.h" #include "opt_route.h" #include @@ -51,14 +52,19 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include +#include #include #include #include #include #include +#include + #include #include @@ -100,8 +106,10 @@ MALLOC_DEFINE(M_NETFLOW_HASH, "netflow_hash", "NetFlow hash"); static int export_add(item_p, struct flow_entry *); static int export_send(priv_p, fib_export_p, item_p, int); +#ifdef INET static int hash_insert(priv_p, struct flow_hash_entry *, struct flow_rec *, int, uint8_t, uint8_t); +#endif #ifdef INET6 static int hash6_insert(priv_p, struct flow_hash_entry *, struct flow6_rec *, int, uint8_t, uint8_t); @@ -151,18 +159,6 @@ ip6_hash(struct flow6_rec *r) } } -static inline int -ip6_masklen(struct in6_addr *saddr, struct rt_addrinfo *info) -{ - const int nbits = sizeof(*saddr) * NBBY; - int mlen; - - if (info->rti_addrs & RTA_NETMASK) - bit_count((bitstr_t *)saddr, 0, nbits, &mlen); - else - mlen = nbits; - return (mlen); -} #endif /* @@ -320,14 +316,12 @@ ng_netflow_copyinfo(priv_p priv, struct ng_netflow_info *i) * as this was done in previous version. Need to test & profile * to be sure. */ +#ifdef INET static int hash_insert(priv_p priv, struct flow_hash_entry *hsh, struct flow_rec *r, int plen, uint8_t flags, uint8_t tcp_flags) { struct flow_entry *fle; - struct sockaddr_in sin, sin_mask; - struct sockaddr_dl rt_gateway; - struct rt_addrinfo info; mtx_assert(&hsh->mtx, MA_OWNED); @@ -354,57 +348,37 @@ hash_insert(priv_p priv, struct flow_hash_entry *hsh, struct flow_rec *r, * fill in out_ifx, dst_mask, nexthop, and dst_as in future releases. */ if ((flags & NG_NETFLOW_CONF_NODSTLOOKUP) == 0) { - bzero(&sin, sizeof(sin)); - sin.sin_len = sizeof(struct sockaddr_in); - sin.sin_family = AF_INET; - sin.sin_addr = fle->f.r.r_dst; - - rt_gateway.sdl_len = sizeof(rt_gateway); - sin_mask.sin_len = sizeof(struct sockaddr_in); - bzero(&info, sizeof(info)); - - info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)&rt_gateway; - info.rti_info[RTAX_NETMASK] = (struct sockaddr *)&sin_mask; - - if (rib_lookup_info(r->fib, (struct sockaddr *)&sin, NHR_REF, 0, - &info) == 0) { - fle->f.fle_o_ifx = info.rti_ifp->if_index; - - if (info.rti_flags & RTF_GATEWAY && - rt_gateway.sdl_family == AF_INET) - fle->f.next_hop = - ((struct sockaddr_in *)&rt_gateway)->sin_addr; - - if (info.rti_addrs & RTA_NETMASK) - fle->f.dst_mask = bitcount32(sin_mask.sin_addr.s_addr); - else if (info.rti_flags & RTF_HOST) - /* Give up. We can't determine mask :( */ - fle->f.dst_mask = 32; - - rib_free_info(&info); + struct rtentry *rt; + struct route_nhop_data rnd; + + rt = fib4_lookup_rt(r->fib, fle->f.r.r_dst, 0, NHR_NONE, &rnd); + if (rt != NULL) { + struct in_addr addr; + uint32_t scopeid; + struct nhop_object *nh = nhop_select_func(rnd.rnd_nhop, 0); + int plen; + + rt_get_inet_prefix_plen(rt, &addr, &plen, &scopeid); + fle->f.fle_o_ifx = nh->nh_ifp->if_index; + if (nh->gw_sa.sa_len == AF_INET) + fle->f.next_hop = nh->gw4_sa.sin_addr; + fle->f.dst_mask = plen; } } /* Do route lookup on source address, to fill in src_mask. */ if ((flags & NG_NETFLOW_CONF_NOSRCLOOKUP) == 0) { - bzero(&sin, sizeof(sin)); - sin.sin_len = sizeof(struct sockaddr_in); - sin.sin_family = AF_INET; - sin.sin_addr = fle->f.r.r_src; - - sin_mask.sin_len = sizeof(struct sockaddr_in); - bzero(&info, sizeof(info)); - - info.rti_info[RTAX_NETMASK] = (struct sockaddr *)&sin_mask; - - if (rib_lookup_info(r->fib, (struct sockaddr *)&sin, 0, 0, - &info) == 0) { - if (info.rti_addrs & RTA_NETMASK) - fle->f.src_mask = - bitcount32(sin_mask.sin_addr.s_addr); - else if (info.rti_flags & RTF_HOST) - /* Give up. We can't determine mask :( */ - fle->f.src_mask = 32; + struct rtentry *rt; + struct route_nhop_data rnd; + + rt = fib4_lookup_rt(r->fib, fle->f.r.r_src, 0, NHR_NONE, &rnd); + if (rt != NULL) { + struct in_addr addr; + uint32_t scopeid; + int plen; + + rt_get_inet_prefix_plen(rt, &addr, &plen, &scopeid); + fle->f.src_mask = plen; } } @@ -413,6 +387,7 @@ hash_insert(priv_p priv, struct flow_hash_entry *hsh, struct flow_rec *r, return (0); } +#endif #ifdef INET6 static int @@ -420,9 +395,6 @@ hash6_insert(priv_p priv, struct flow_hash_entry *hsh6, struct flow6_rec *r, int plen, uint8_t flags, uint8_t tcp_flags) { struct flow6_entry *fle6; - struct sockaddr_in6 sin6, sin6_mask; - struct sockaddr_dl rt_gateway; - struct rt_addrinfo info; mtx_assert(&hsh6->mtx, MA_OWNED); @@ -450,50 +422,38 @@ hash6_insert(priv_p priv, struct flow_hash_entry *hsh6, struct flow6_rec *r, * fill in out_ifx, dst_mask, nexthop, and dst_as in future releases. */ if ((flags & NG_NETFLOW_CONF_NODSTLOOKUP) == 0) { - bzero(&sin6, sizeof(struct sockaddr_in6)); - sin6.sin6_len = sizeof(struct sockaddr_in6); - sin6.sin6_family = AF_INET6; - sin6.sin6_addr = r->dst.r_dst6; - - rt_gateway.sdl_len = sizeof(rt_gateway); - sin6_mask.sin6_len = sizeof(struct sockaddr_in6); - bzero(&info, sizeof(info)); - - info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)&rt_gateway; - info.rti_info[RTAX_NETMASK] = (struct sockaddr *)&sin6_mask; - - if (rib_lookup_info(r->fib, (struct sockaddr *)&sin6, NHR_REF, - 0, &info) == 0) { - fle6->f.fle_o_ifx = info.rti_ifp->if_index; - - if (info.rti_flags & RTF_GATEWAY && - rt_gateway.sdl_family == AF_INET6) - fle6->f.n.next_hop6 = - ((struct sockaddr_in6 *)&rt_gateway)->sin6_addr; - - fle6->f.dst_mask = - ip6_masklen(&sin6_mask.sin6_addr, &info); - - rib_free_info(&info); + struct rtentry *rt; + struct route_nhop_data rnd; + + rt = fib6_lookup_rt(r->fib, &fle6->f.r.dst.r_dst6, 0, NHR_NONE, &rnd); + if (rt != NULL) { + struct in6_addr addr; + uint32_t scopeid; + struct nhop_object *nh = nhop_select_func(rnd.rnd_nhop, 0); + int plen; + + rt_get_inet6_prefix_plen(rt, &addr, &plen, &scopeid); + fle6->f.fle_o_ifx = nh->nh_ifp->if_index; + if (nh->gw_sa.sa_len == AF_INET6) + fle6->f.n.next_hop6 = nh->gw6_sa.sin6_addr; + fle6->f.dst_mask = plen; } } if ((flags & NG_NETFLOW_CONF_NOSRCLOOKUP) == 0) { /* Do route lookup on source address, to fill in src_mask. */ - bzero(&sin6, sizeof(struct sockaddr_in6)); - sin6.sin6_len = sizeof(struct sockaddr_in6); - sin6.sin6_family = AF_INET6; - sin6.sin6_addr = r->src.r_src6; - - sin6_mask.sin6_len = sizeof(struct sockaddr_in6); - bzero(&info, sizeof(info)); + struct rtentry *rt; + struct route_nhop_data rnd; - info.rti_info[RTAX_NETMASK] = (struct sockaddr *)&sin6_mask; + rt = fib6_lookup_rt(r->fib, &fle6->f.r.src.r_src6, 0, NHR_NONE, &rnd); + if (rt != NULL) { + struct in6_addr addr; + uint32_t scopeid; + int plen; - if (rib_lookup_info(r->fib, (struct sockaddr *)&sin6, 0, 0, - &info) == 0) - fle6->f.src_mask = - ip6_masklen(&sin6_mask.sin6_addr, &info); + rt_get_inet6_prefix_plen(rt, &addr, &plen, &scopeid); + fle6->f.src_mask = plen; + } } /* Push new flow at the and of hash. */ @@ -682,6 +642,7 @@ ng_netflow_cache_flush(priv_p priv) ng_netflow_v9_cache_flush(priv); } +#ifdef INET /* Insert packet from into flow cache. */ int ng_netflow_flow_add(priv_p priv, fib_export_p fe, struct ip *ip, @@ -808,6 +769,7 @@ ng_netflow_flow_add(priv_p priv, fib_export_p fe, struct ip *ip, return (error); } +#endif #ifdef INET6 /* Insert IPv6 packet from into flow cache. */ diff --git a/sys/netgraph/netflow/ng_netflow.c b/sys/netgraph/netflow/ng_netflow.c index 6180fe573b60..187e18a3130e 100644 --- a/sys/netgraph/netflow/ng_netflow.c +++ b/sys/netgraph/netflow/ng_netflow.c @@ -33,6 +33,7 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_inet.h" #include "opt_inet6.h" #include "opt_route.h" @@ -700,12 +701,14 @@ ng_netflow_rcvdata (hook_p hook, item_p item) /* Make sure this is IP frame. */ etype = ntohs(eh->ether_type); switch (etype) { +#ifdef INET case ETHERTYPE_IP: M_CHECK(sizeof(struct ip)); eh = mtod(m, struct ether_header *); ip = (struct ip *)(eh + 1); l3_off = sizeof(struct ether_header); break; +#endif #ifdef INET6 case ETHERTYPE_IPV6: /* @@ -730,9 +733,11 @@ ng_netflow_rcvdata (hook_p hook, item_p item) l3_off = sizeof(struct ether_vlan_header); if (etype == ETHERTYPE_IP) { +#ifdef INET M_CHECK(sizeof(struct ip)); ip = (struct ip *)(evh + 1); break; +#endif #ifdef INET6 } else if (etype == ETHERTYPE_IPV6) { M_CHECK(sizeof(struct ip6_hdr)); @@ -760,6 +765,9 @@ ng_netflow_rcvdata (hook_p hook, item_p item) M_CHECK(sizeof(struct ip6_hdr) - sizeof(struct ip)); ip6 = mtod(m, struct ip6_hdr *); } +#endif +#ifndef INET + ip = NULL; #endif break; default: @@ -935,11 +943,16 @@ loopend: fe = priv_to_fib(priv, fib); } +#ifdef INET if (ip != NULL) error = ng_netflow_flow_add(priv, fe, ip, upper_ptr, upper_proto, flags, src_if_index); -#ifdef INET6 - else if (ip6 != NULL) +#endif +#if defined(INET6) && defined(INET) + else +#endif +#ifdef INET6 + if (ip6 != NULL) error = ng_netflow_flow6_add(priv, fe, ip6, upper_ptr, upper_proto, flags, src_if_index); #endif From owner-dev-commits-src-main@freebsd.org Sat Dec 26 12:52:57 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0A1DC4B88F0; Sat, 26 Dec 2020 12:52:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D33d46tk0z3lJ2; Sat, 26 Dec 2020 12:52:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DF2E1156FD; Sat, 26 Dec 2020 12:52:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BQCqunj087831; Sat, 26 Dec 2020 12:52:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BQCquf1087830; Sat, 26 Dec 2020 12:52:56 GMT (envelope-from git) Date: Sat, 26 Dec 2020 12:52:56 GMT Message-Id: <202012261252.0BQCquf1087830@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Marius Strobl Subject: git: b63eeef41f93 - scc(4)/uart(4): Remove obsolete support for Siemens SAB 82532 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: marius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b63eeef41f9335f653c608c2000bea6c28a8a823 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Dec 2020 12:52:57 -0000 The branch main has been updated by marius: URL: https://cgit.FreeBSD.org/src/commit/?id=b63eeef41f9335f653c608c2000bea6c28a8a823 commit b63eeef41f9335f653c608c2000bea6c28a8a823 Author: Marius Strobl AuthorDate: 2020-12-26 12:44:00 +0000 Commit: Marius Strobl CommitDate: 2020-12-26 12:48:06 +0000 scc(4)/uart(4): Remove obsolete support for Siemens SAB 82532 It's no longer used since 58aa35d42975c298ca0adba705c042596303c9f5 and r357455 respectively. --- share/man/man4/scc.4 | 4 +- sys/conf/NOTES | 4 +- sys/conf/files | 2 - sys/dev/ic/sab82532.h | 327 ----------------- sys/dev/scc/scc_bfe.h | 1 - sys/dev/scc/scc_bus.h | 2 +- sys/dev/scc/scc_dev_sab82532.c | 154 -------- sys/dev/uart/uart.h | 1 - sys/dev/uart/uart_bus_scc.c | 3 - sys/dev/uart/uart_dev_sab82532.c | 762 --------------------------------------- sys/dev/uart/uart_subr.c | 1 - sys/modules/scc/Makefile | 2 +- sys/modules/uart/Makefile | 2 +- 13 files changed, 6 insertions(+), 1259 deletions(-) diff --git a/share/man/man4/scc.4 b/share/man/man4/scc.4 index 45f6a5e6d596..e03f43011b07 100644 --- a/share/man/man4/scc.4 +++ b/share/man/man4/scc.4 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 25, 2020 +.Dd December 26, 2020 .Dt SCC 4 .Os .\" @@ -56,8 +56,6 @@ driver supports the following classes of SCCs: .It QUICC: Freescale/NXP QUad Integrated Communications Controllers. .It -SAB82532: Siemens SAB 82532 based serial communications controllers. -.It Z8530: Zilog 8530 based serial communications controllers. .El .\" diff --git a/sys/conf/NOTES b/sys/conf/NOTES index 22fb430a76c7..657f51c2abb1 100644 --- a/sys/conf/NOTES +++ b/sys/conf/NOTES @@ -1771,8 +1771,8 @@ options BREAK_TO_DEBUGGER # A BREAK/DBG on the console goes to options ALT_BREAK_TO_DEBUGGER # Serial Communications Controller -# Supports the Freescale/NXP QUad Integrated, Siemens SAB 82532 and Zilog Z8530 -# multi-channel communications controllers. +# Supports the Freescale/NXP QUad Integrated and Zilog Z8530 multi-channel +# communications controllers. device scc # PCI Universal Communications driver diff --git a/sys/conf/files b/sys/conf/files index 86dce97eb5e8..dc4cadb36c14 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -3066,7 +3066,6 @@ dev/scc/scc_if.m optional scc dev/scc/scc_bfe_quicc.c optional scc quicc dev/scc/scc_core.c optional scc dev/scc/scc_dev_quicc.c optional scc quicc -dev/scc/scc_dev_sab82532.c optional scc dev/scc/scc_dev_z8530.c optional scc dev/sdhci/sdhci.c optional sdhci dev/sdhci/sdhci_fdt.c optional sdhci fdt @@ -3240,7 +3239,6 @@ dev/uart/uart_dev_mvebu.c optional uart uart_mvebu dev/uart/uart_dev_ns8250.c optional uart uart_ns8250 | uart uart_snps dev/uart/uart_dev_pl011.c optional uart pl011 dev/uart/uart_dev_quicc.c optional uart quicc -dev/uart/uart_dev_sab82532.c optional uart uart_sab82532 | uart scc dev/uart/uart_dev_snps.c optional uart uart_snps fdt dev/uart/uart_dev_z8530.c optional uart uart_z8530 | uart scc dev/uart/uart_if.m optional uart diff --git a/sys/dev/ic/sab82532.h b/sys/dev/ic/sab82532.h deleted file mode 100644 index 4cc723b6464c..000000000000 --- a/sys/dev/ic/sab82532.h +++ /dev/null @@ -1,327 +0,0 @@ -/* $OpenBSD: sab82532reg.h,v 1.2 2002/04/08 17:49:42 jason Exp $ */ - -/*- - * SPDX-License-Identifier: BSD-4-Clause - * - * Copyright (c) 2001 Jason L. Wright (jason@thought.net) - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Jason L. Wright - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 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. - * - * Effort sponsored in part by the Defense Advanced Research Projects - * Agency (DARPA) and Air Force Research Laboratory, Air Force - * Materiel Command, USAF, under agreement number F30602-01-2-0537. - * - * $FreeBSD$ - */ - -#ifndef _DEV_IC_SAB82532_H_ -#define _DEV_IC_SAB82532_H_ - -/* - * Register definitions for SAB82532 based on "Enhanced Serial Communication - * Controller ESCC2 Version 3.2 User's Manual 07.96" from: - * http://www.infineon.com - */ - -#define SAB_NCHAN 2 /* number of channels */ -#define SAB_CHANLEN 0x40 /* length of channel register set */ - -#define SAB_CHAN_A 0x00 /* channel A register offset */ -#define SAB_CHAN_B 0x40 /* channel B register offset */ - -#define SAB_RFIFO 0x00 /* r: rx fifo */ -#define SAB_XFIFO 0x00 /* w: tx fifo */ -#define SAB_STAR 0x20 /* r: status register */ -#define SAB_CMDR 0x20 /* w: command register */ -#define SAB_MODE 0x22 /* rw: mode register */ -#define SAB_TIMR 0x23 /* rw: timer register */ -#define SAB_XON 0x24 /* rw: xon character */ -#define SAB_XOFF 0x25 /* rw: xoff character */ -#define SAB_TCR 0x26 /* rw: termination character */ -#define SAB_DAFO 0x27 /* rw: data format */ -#define SAB_RFC 0x28 /* rw: rfifo control register */ -#define SAB_RBCL 0x2a /* r: rx byte count low */ -#define SAB_TBCL 0x2a /* w: tx byte count low */ -#define SAB_RBCH 0x2b /* r: rx byte count high */ -#define SAB_XBCH 0x2b /* w: tx byte count high */ -#define SAB_CCR0 0x2c /* rw: channel configuration register 0 */ -#define SAB_CCR1 0x2d /* rw: channel configuration register 1 */ -#define SAB_CCR2 0x2e /* rw: channel configuration register 2 */ -#define SAB_CCR3 0x2f /* rw: channel configuration register 3 */ -#define SAB_TSAX 0x30 /* w: time-slot assignment register tx */ -#define SAB_TSAR 0x31 /* w: time-slot assignment register rx */ -#define SAB_XCCR 0x32 /* w: tx channel capacity register */ -#define SAB_RCCR 0x33 /* w: receive channel capacity register */ -#define SAB_VSTR 0x34 /* r: version status */ -#define SAB_BGR 0x34 /* w: baud rate generator */ -#define SAB_TIC 0x35 /* w: transmit immediate character */ -#define SAB_MXN 0x36 /* w: mask xon character */ -#define SAB_MXF 0x37 /* w: mask xoff character */ -#define SAB_GIS 0x38 /* r: global interrupt status */ -#define SAB_IVA 0x38 /* w: interrupt vector address */ -#define SAB_IPC 0x39 /* rw: interrupt port configuration */ -#define SAB_ISR0 0x3a /* r: interrupt status 0 */ -#define SAB_IMR0 0x3a /* w: interrupt mask 0 */ -#define SAB_ISR1 0x3b /* r: interrupt status 1 */ -#define SAB_IMR1 0x3b /* w: interrupt mask 1 */ -#define SAB_PVR 0x3c /* rw: port value register */ -#define SAB_PIS 0x3d /* r: port interrupt status */ -#define SAB_PIM 0x3d /* w: port interrupt mask */ -#define SAB_PCR 0x3e /* w: port configuration register */ -#define SAB_CCR4 0x3f /* rw: channel configuration register 4 */ - -/* SAB_STAR: status register */ -#define SAB_STAR_XDOV 0x80 /* transmit data overflow */ -#define SAB_STAR_XFW 0x40 /* transmit fifo write enable */ -#define SAB_STAR_RFNE 0x20 /* rfifo not empty */ -#define SAB_STAR_FCS 0x10 /* flow control status */ -#define SAB_STAR_TEC 0x08 /* tx immediate char is executing */ -#define SAB_STAR_CEC 0x04 /* command is executing */ -#define SAB_STAR_CTS 0x02 /* cts status: 0:inactive/high,1:active/low */ - -/* SAB_CMDR: command register */ -#define SAB_CMDR_RMC 0x80 /* receive message complete */ -#define SAB_CMDR_RRES 0x40 /* receiver reset */ -#define SAB_CMDR_RFRD 0x20 /* receive fifo read enable */ -#define SAB_CMDR_STI 0x10 /* start timer */ -#define SAB_CMDR_XF 0x08 /* transmit frame */ -#define SAB_CMDR_XRES 0x01 /* transmit reset */ - -/* SAB_MODE: mode register */ -#define SAB_MODE_FRTS 0x40 /* flow control using rts */ -#define SAB_MODE_FCTS 0x20 /* flow control using cts */ -#define SAB_MODE_FLON 0x10 /* flow control on */ -#define SAB_MODE_RAC 0x08 /* receiver active */ -#define SAB_MODE_RTS 0x04 /* request to send */ -#define SAB_MODE_TRS 0x02 /* timer resolution */ -#define SAB_MODE_TLP 0x01 /* test loop */ - -/* SAB_TIMR: timer register */ -#define SAB_TIMR_CNT 0xe0 /* count mask */ -#define SAB_TIMR_VAL 0x1f /* value mask */ - -/* SAB_DAFO: data format */ -#define SAB_DAFO_XBRK 0x40 /* transmit break */ -#define SAB_DAFO_STOP 0x20 /* stop bit: 0:1 bit, 1:2 bits */ -#define SAB_DAFO_PAR1 0x10 /* parity 1, see below */ -#define SAB_DAFO_PAR0 0x08 /* parity 0, see below */ -#define SAB_DAFO_PARE 0x04 /* parity enable */ -#define SAB_DAFO_CHL1 0x02 /* character length 1, see below */ -#define SAB_DAFO_CHL0 0x01 /* character length 0, see below */ - -#define SAB_DAFO_CHL_CSIZE (SAB_DAFO_CHL1|SAB_DAFO_CHL0) -#define SAB_DAFO_CHL_CS5 (SAB_DAFO_CHL1|SAB_DAFO_CHL0) -#define SAB_DAFO_CHL_CS6 (SAB_DAFO_CHL1) -#define SAB_DAFO_CHL_CS7 (SAB_DAFO_CHL0) -#define SAB_DAFO_CHL_CS8 (0) - -#define SAB_DAFO_PARMASK (SAB_DAFO_PAR1|SAB_DAFO_PAR0|SAB_DAFO_PARE) -#define SAB_DAFO_PAR_MARK (SAB_DAFO_PAR1|SAB_DAFO_PAR0|SAB_DAFO_PARE) -#define SAB_DAFO_PAR_EVEN (SAB_DAFO_PAR1|SAB_DAFO_PARE) -#define SAB_DAFO_PAR_ODD (SAB_DAFO_PAR0|SAB_DAFO_PARE) -#define SAB_DAFO_PAR_SPACE (SAB_DAFO_PARE) -#define SAB_DAFO_PAR_NONE (0) - -/* SAB_RFC: rfifo control register */ -#define SAB_RFC_DPS 0x40 /* disable parity storage */ -#define SAB_RFC_DXS 0x20 /* disable storage of xon/xoff characters */ -#define SAB_RFC_RFDF 0x10 /* rfifo data format: 0 data,1 data+stat */ -#define SAB_RFC_RFTH1 0x08 /* rfifo threshold level 1, see below */ -#define SAB_RFC_RFTH0 0x04 /* rfifo threshold level 0, see below */ -#define SAB_RFC_TCDE 0x01 /* termination character detection enable */ - -#define SAB_RFC_RFTH_MASK (SAB_RFC_RFTH1|SAB_RFC_RFTH0) -#define SAB_RFC_RFTH_32CHAR (SAB_RFC_RFTH1|SAB_RFC_RFTH0) -#define SAB_RFC_RFTH_16CHAR (SAB_RFC_RFTH1) -#define SAB_RFC_RFTH_4CHAR (SAB_RFC_RFTH0) -#define SAB_RFC_RFTH_1CHAR (0) - -/* SAB_RBCH: received byte count high */ -#define SAB_RBCH_DMA 0x80 /* read back of XBCH DMA bit */ -#define SAB_RBCH_CAS 0x20 /* read back of XBCH CAS bit */ -#define SAB_RBCH_CNT 0x0f /* ms 4 bits of rx byte count (not used) */ - -/* SAB_XBCH: transmit byte count high */ -#define SAB_XBCH_DMA 0x80 /* dma mode: 1:dma, 0:interrupt */ -#define SAB_XBCH_CAS 0x20 /* carrier detect auto-start */ -#define SAB_XBCH_XC 0x10 /* transmit continuously */ -#define SAB_XBCH_CNT 0x0f /* ms 4 bits of tx byte count */ - -/* SAB_CCR0: channel configuration register 0 */ -#define SAB_CCR0_PU 0x80 /* 0:power-down, 1:power-up */ -#define SAB_CCR0_MCE 0x40 /* master clock enable */ -#define SAB_CCR0_SC2 0x10 /* serial port config 2, see below */ -#define SAB_CCR0_SC1 0x08 /* serial port config 1, see below */ -#define SAB_CCR0_SC0 0x04 /* serial port config 0, see below */ -#define SAB_CCR0_SM1 0x02 /* serial mode 1, see below */ -#define SAB_CCR0_SM0 0x01 /* serial mode 0, see below */ - -#define SAB_CCR0_SC_MASK (SAB_CCR0_SC2|SAB_CCR0_SC1|SAB_CCR0_SC0) -#define SAB_CCR0_SC_NRZ (0) -#define SAB_CCR0_SC_NRZI (SAB_CCR0_SC1) -#define SAB_CCR0_SC_FM0 (SAB_CCR0_SC2) -#define SAB_CCR0_SC_FM1 (SAB_CCR0_SC2|SAB_CCR0_SC0) -#define SAB_CCR0_SC_MANCHESTER (SAB_CCR0_SC2|SAB_CCR0_SC1) - -#define SAB_CCR0_SM_MASK (SAB_CCR0_SM1|SAB_CCR0_SM0) -#define SAB_CCR0_SM_DLC (0) -#define SAB_CCR0_SM_DLCLOOP (SAB_CCR0_SM0) -#define SAB_CCR0_SM_BISYNC (SAB_CCR0_SM1) -#define SAB_CCR0_SM_ASYNC (SAB_CCR0_SM1|SAB_CCR0_SM0) - -/* SAB_CCR1: channel configuration register 1 */ -#define SAB_CCR1_ODS 0x10 /* Output driver select:1:pushpull,0:odrain */ -#define SAB_CCR1_BCR 0x08 /* bit clock rate: 1:async, 0:isochronous */ -#define SAB_CCR1_CM2 0x04 /* clock mode 2, see below */ -#define SAB_CCR1_CM1 0x02 /* clock mode 1, see below */ -#define SAB_CCR1_CM0 0x01 /* clock mode 0, see below */ - -#define SAB_CCR1_CM_MASK (SAB_CCR1_CM2|SAB_CCR1_CM1|SAB_CCR1_CM0) -#define SAB_CCR1_CM_7 (SAB_CCR1_CM2|SAB_CCR1_CM1|SAB_CCR1_CM0) - -/* SAB_CCR2: channel configuration register 2, depends on clock mode above */ -/* clock mode 0a, 1, 4, 5 */ -#define SAB_CCR2_SOC1 0x80 /* special output 1, below */ -#define SAB_CCR2_SOC0 0x40 /* special output 0, below */ -#define SAB_CCR2_SOC_MASK (SAB_CCR2_SOC1|SAB_CCR2_SOC0) -#define SAB_CCR2_SOC_RTSHIGH (SAB_CCR2_SOC1) -#define SAB_CCR2_SOC_RTSNORM (0) -#define SAB_CCR2_SOC_RTSRX (SAB_CCR2_SOC1|SAB_CCR2_SOC0) -/* clock mode 0b, 2, 3, 6, 7 */ -#define SAB_CCR2_BR9 0x80 /* baud rate bit 9 */ -#define SAB_CCR2_BR8 0x40 /* baud rate bit 8 */ -#define SAB_CCR2_BDF 0x20 /* baud rate division factor: 0:1: 1:BRG */ -#define SAB_CCR2_SSEL 0x10 /* clock source select */ -/* clock mode 5 */ -#define SAB_CCR2_XCS0 0x20 /* tx clock shift, bit 0 */ -#define SAB_CCR2_RCS0 0x10 /* rx clock shift, bit 0 */ -/* clock mode 0b, 2, 3, 4, 5, 6, 7 */ -#define SAB_CCR2_TOE 0x08 /* tx clock output enable */ -/* clock mode 0a, 0b, 1, 2, 3, 4, 5, 6, 7 */ -#define SAB_CCR2_RWX 0x04 /* read/write exchange (dma mode only) */ -#define SAB_CCR2_DIV 0x01 /* data inversion (nrz) */ - -/* SAB_CCR3: channel configuration register 3 (v2 or greater) */ -#define SAB_CCR3_PSD 0x01 /* dpll phase shift disable (nrz/nrzi) */ - -/* SAB_TSAX: time-slot assignment register transmit (clock mode 5 only) */ -#define SAB_TSAX_TSNX 0xfc /* time-slot number transmit */ -#define SAB_TSAX_XCS2 0x02 /* transmit clock shift bit 2 */ -#define SAB_TSAX_XCS1 0x01 /* transmit clock shift bit 1 */ - -/* SAB_TSAR: time-slot assignment register receive (clock mode 5 only) */ -#define SAB_TSAR_TSNR 0xfc /* time-slot number receive */ -#define SAB_TSAR_RCS2 0x02 /* receive clock shift bit 2 */ -#define SAB_TSAR_RCS1 0x01 /* receive clock shift bit 1 */ - -/* SAB_VSTR: version status register */ -#define SAB_VSTR_CD 0x80 /* carrier detect status */ -#define SAB_VSTR_DPLA 0x40 /* dpll asynchronous */ -#define SAB_VSTR_VMASK 0x0f /* chip version mask: */ -#define SAB_VSTR_V_1 0x00 /* version 1 */ -#define SAB_VSTR_V_2 0x01 /* version 2 */ -#define SAB_VSTR_V_32 0x02 /* version 3.2 */ - -/* SAB_GIS: global interrupt status register */ -#define SAB_GIS_PI 0x80 /* universal port interrupt */ -#define SAB_GIS_ISA1 0x08 /* interrupt status a1 */ -#define SAB_GIS_ISA0 0x04 /* interrupt status a0 */ -#define SAB_GIS_ISB1 0x02 /* interrupt status b1 */ -#define SAB_GIS_ISB0 0x01 /* interrupt status b0 */ - -/* SAB_IVA: interrupt vector address */ -#define SAB_IVA_MASK 0xf8 /* interrupt vector address mask */ - -/* SAB_IPC: interrupt port configuration */ -#define SAB_IPC_VIS 0x80 /* masked interrupt bits visible */ -#define SAB_IPC_SLAMASK 0x18 /* slave address mask */ -#define SAB_IPC_CASM 0x04 /* cascading mode */ -#define SAB_IPC_ICMASK 0x03 /* port config mask: */ -#define SAB_IPC_ICOD 0x00 /* open drain output */ -#define SAB_IPC_ICPL 0x01 /* push/pull active low output */ -#define SAB_IPC_ICPH 0x03 /* push/pull active high output */ - -/* SAB_ISR0: interrupt status 0 */ -#define SAB_ISR0_TCD 0x80 /* termination character detected */ -#define SAB_ISR0_TIME 0x40 /* time-out limit exceeded */ -#define SAB_ISR0_PERR 0x20 /* parity error */ -#define SAB_ISR0_FERR 0x10 /* framing error */ -#define SAB_ISR0_PLLA 0x08 /* dpll asynchronous */ -#define SAB_ISR0_CDSC 0x04 /* carrier detect status change */ -#define SAB_ISR0_RFO 0x02 /* rfifo overflow */ -#define SAB_ISR0_RPF 0x01 /* receive pool full */ - -/* SAB_ISR1: interrupt status 1 */ -#define SAB_ISR1_BRK 0x80 /* break detected */ -#define SAB_ISR1_BRKT 0x40 /* break terminated */ -#define SAB_ISR1_ALLS 0x20 /* all sent */ -#define SAB_ISR1_XOFF 0x10 /* xoff detected */ -#define SAB_ISR1_TIN 0x08 /* timer interrupt */ -#define SAB_ISR1_CSC 0x04 /* clear to send status change */ -#define SAB_ISR1_XON 0x02 /* xon detected */ -#define SAB_ISR1_XPR 0x01 /* transmit pool ready */ - -/* SAB_IMR0: interrupt mask 0 */ -#define SAB_IMR0_TCD 0x80 /* termination character detected */ -#define SAB_IMR0_TIME 0x40 /* time-out limit exceeded */ -#define SAB_IMR0_PERR 0x20 /* parity error */ -#define SAB_IMR0_FERR 0x10 /* framing error */ -#define SAB_IMR0_PLLA 0x08 /* dpll asynchronous */ -#define SAB_IMR0_CDSC 0x04 /* carrier detect status change */ -#define SAB_IMR0_RFO 0x02 /* rfifo overflow */ -#define SAB_IMR0_RPF 0x01 /* receive pool full */ - -/* SAB_ISR1: interrupt mask 1 */ -#define SAB_IMR1_BRK 0x80 /* break detected */ -#define SAB_IMR1_BRKT 0x40 /* break terminated */ -#define SAB_IMR1_ALLS 0x20 /* all sent */ -#define SAB_IMR1_XDU 0x10 /* xoff detected */ -#define SAB_IMR1_TIN 0x08 /* timer interrupt */ -#define SAB_IMR1_CSC 0x04 /* clear to send status change */ -#define SAB_IMR1_XMR 0x02 /* xon detected */ -#define SAB_IMR1_XPR 0x01 /* transmit pool ready */ - -/* SAB_PVR: port value register */ -#define SAB_PVR_DSR_A 0x01 /* port A DSR */ -#define SAB_PVR_DTR_A 0x02 /* port A DTR */ -#define SAB_PVR_DTR_B 0x04 /* port B DTR */ -#define SAB_PVR_DSR_B 0x08 /* port B DSR */ -#define SAB_PVR_MAGIC 0x10 /* dunno... */ - -/* SAB_CCR4: channel configuration register 4 */ -#define SAB_CCR4_MCK4 0x80 /* master clock divide by 4 */ -#define SAB_CCR4_EBRG 0x40 /* enhanced baud rate generator mode */ -#define SAB_CCR4_TST1 0x20 /* test pin */ -#define SAB_CCR4_ICD 0x10 /* invert polarity of carrier detect */ - -/* Receive status byte */ -#define SAB_RSTAT_PE 0x80 /* parity error */ -#define SAB_RSTAT_FE 0x40 /* framing error */ -#define SAB_RSTAT_PAR 0x01 /* parity bit */ - -#endif /* _DEV_IC_SAB82532_H_ */ diff --git a/sys/dev/scc/scc_bfe.h b/sys/dev/scc/scc_bfe.h index 0b7f91f83f99..1ccd176e5539 100644 --- a/sys/dev/scc/scc_bfe.h +++ b/sys/dev/scc/scc_bfe.h @@ -113,7 +113,6 @@ struct scc_class { }; extern struct scc_class scc_quicc_class; -extern struct scc_class scc_sab82532_class; extern struct scc_class scc_z8530_escc_class; extern struct scc_class scc_z8530_legacy_class; diff --git a/sys/dev/scc/scc_bus.h b/sys/dev/scc/scc_bus.h index 47a43db01a65..08fcd2626fa5 100644 --- a/sys/dev/scc/scc_bus.h +++ b/sys/dev/scc/scc_bus.h @@ -42,7 +42,7 @@ #define SCC_IVAR_HWMTX 5 /* Hardware class -- the SCC type. */ -#define SCC_CLASS_SAB82532 0 +#define SCC_CLASS_UNUSED 0 #define SCC_CLASS_Z8530 1 #define SCC_CLASS_QUICC 2 diff --git a/sys/dev/scc/scc_dev_sab82532.c b/sys/dev/scc/scc_dev_sab82532.c deleted file mode 100644 index 9bf02198552f..000000000000 --- a/sys/dev/scc/scc_dev_sab82532.c +++ /dev/null @@ -1,154 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD - * - * Copyright (c) 2004-2006 Marcel Moolenaar - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include - -#include "scc_if.h" - -static int sab82532_bfe_attach(struct scc_softc *, int); -static int sab82532_bfe_iclear(struct scc_softc *, struct scc_chan *); -static int sab82532_bfe_ipend(struct scc_softc *); -static int sab82532_bfe_probe(struct scc_softc *); - -static kobj_method_t sab82532_methods[] = { - KOBJMETHOD(scc_attach, sab82532_bfe_attach), - KOBJMETHOD(scc_iclear, sab82532_bfe_iclear), - KOBJMETHOD(scc_ipend, sab82532_bfe_ipend), - KOBJMETHOD(scc_probe, sab82532_bfe_probe), - KOBJMETHOD_END -}; - -struct scc_class scc_sab82532_class = { - "sab82532 class", - sab82532_methods, - sizeof(struct scc_softc), - .cl_channels = SAB_NCHAN, - .cl_class = SCC_CLASS_SAB82532, - .cl_modes = SCC_MODE_ASYNC | SCC_MODE_BISYNC | SCC_MODE_HDLC, - .cl_range = SAB_CHANLEN, -}; - -static int -sab82532_bfe_attach(struct scc_softc *sc __unused, int reset __unused) -{ - - return (0); -} - -static int -sab82532_bfe_iclear(struct scc_softc *sc, struct scc_chan *ch) -{ - struct scc_bas *bas; - int i, ofs, rbcl; - - bas = &sc->sc_bas; - ofs = (ch->ch_nr - 1) * SAB_CHANLEN; - mtx_lock_spin(&sc->sc_hwmtx); - if (ch->ch_ipend & SER_INT_RXREADY) { - if (scc_getreg(bas, ofs + SAB_STAR) & SAB_STAR_RFNE) { - rbcl = scc_getreg(bas, ofs + SAB_RBCL) & 31; - if (rbcl == 0) - rbcl = 32; - for (i = 0; i < rbcl; i += 2) { - (void)scc_getreg(bas, ofs + SAB_RFIFO); - (void)scc_getreg(bas, ofs + SAB_RFIFO + 1); - } - } - while (scc_getreg(bas, ofs + SAB_STAR) & SAB_STAR_CEC) - ; - scc_setreg(bas, ofs + SAB_CMDR, SAB_CMDR_RMC); - scc_barrier(bas); - } - mtx_unlock_spin(&sc->sc_hwmtx); - return (0); -} - -static int -sab82532_bfe_ipend(struct scc_softc *sc) -{ - struct scc_bas *bas; - struct scc_chan *ch; - int ipend; - int c, ofs; - uint8_t isr0, isr1; - - bas = &sc->sc_bas; - ipend = 0; - for (c = 0; c < SAB_NCHAN; c++) { - ch = &sc->sc_chan[c]; - ofs = c * SAB_CHANLEN; - mtx_lock_spin(&sc->sc_hwmtx); - isr0 = scc_getreg(bas, ofs + SAB_ISR0); - isr1 = scc_getreg(bas, ofs + SAB_ISR1); - scc_barrier(bas); - if (isr0 & SAB_ISR0_TIME) { - while (scc_getreg(bas, ofs + SAB_STAR) & SAB_STAR_CEC) - ; - scc_setreg(bas, ofs + SAB_CMDR, SAB_CMDR_RFRD); - scc_barrier(bas); - } - mtx_unlock_spin(&sc->sc_hwmtx); - - ch->ch_ipend = 0; - if (isr1 & SAB_ISR1_BRKT) - ch->ch_ipend |= SER_INT_BREAK; - if (isr0 & SAB_ISR0_RFO) - ch->ch_ipend |= SER_INT_OVERRUN; - if (isr0 & (SAB_ISR0_TCD|SAB_ISR0_RPF)) - ch->ch_ipend |= SER_INT_RXREADY; - if ((isr0 & SAB_ISR0_CDSC) || (isr1 & SAB_ISR1_CSC)) - ch->ch_ipend |= SER_INT_SIGCHG; - if (isr1 & SAB_ISR1_ALLS) - ch->ch_ipend |= SER_INT_TXIDLE; - ipend |= ch->ch_ipend; - } - return (ipend); -} - -static int -sab82532_bfe_probe(struct scc_softc *sc __unused) -{ - - return (0); -} diff --git a/sys/dev/uart/uart.h b/sys/dev/uart/uart.h index 4ef6af3d901b..ed3b7017d746 100644 --- a/sys/dev/uart/uart.h +++ b/sys/dev/uart/uart.h @@ -104,7 +104,6 @@ struct uart_class; extern struct uart_class uart_ns8250_class __attribute__((weak)); extern struct uart_class uart_quicc_class __attribute__((weak)); extern struct uart_class uart_s3c2410_class __attribute__((weak)); -extern struct uart_class uart_sab82532_class __attribute__((weak)); extern struct uart_class uart_sbbc_class __attribute__((weak)); extern struct uart_class uart_z8530_class __attribute__((weak)); diff --git a/sys/dev/uart/uart_bus_scc.c b/sys/dev/uart/uart_bus_scc.c index 6666a35e272e..3b643524825e 100644 --- a/sys/dev/uart/uart_bus_scc.c +++ b/sys/dev/uart/uart_bus_scc.c @@ -100,9 +100,6 @@ uart_scc_probe(device_t dev) case SCC_CLASS_QUICC: sc->sc_class = &uart_quicc_class; break; - case SCC_CLASS_SAB82532: - sc->sc_class = &uart_sab82532_class; - break; case SCC_CLASS_Z8530: sc->sc_class = &uart_z8530_class; break; diff --git a/sys/dev/uart/uart_dev_sab82532.c b/sys/dev/uart/uart_dev_sab82532.c deleted file mode 100644 index 9cf41be5d7ab..000000000000 --- a/sys/dev/uart/uart_dev_sab82532.c +++ /dev/null @@ -1,762 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD - * - * Copyright (c) 2003 Marcel Moolenaar - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include - -#include -#include -#include - -#include - -#include "uart_if.h" - -#define DEFAULT_RCLK 29491200 - -/* - * NOTE: To allow us to read the baudrate divisor from the chip, we - * copy the value written to the write-only BGR register to an unused - * read-write register. We use TCR for that. - */ - -static int -sab82532_delay(struct uart_bas *bas) -{ - int divisor, m, n; - uint8_t bgr, ccr2; - - bgr = uart_getreg(bas, SAB_TCR); - ccr2 = uart_getreg(bas, SAB_CCR2); - n = (bgr & 0x3f) + 1; - m = (bgr >> 6) | ((ccr2 >> 4) & 0xC); - divisor = n * (1<rclk); -} - -static int -sab82532_divisor(int rclk, int baudrate) -{ - int act_baud, act_div, divisor; - int error, m, n; - - if (baudrate == 0) - return (0); - - divisor = (rclk / (baudrate << 3) + 1) >> 1; - if (divisor < 2 || divisor >= 1048576) - return (0); - - /* Find the best (N+1,M) pair. */ - for (m = 1; m < 15; m++) { - n = divisor / (1< 63) - continue; - act_div = n * (1<> 1; - - /* 3.0% maximum error tolerance: */ - if (error < -30 || error > 30) - continue; - - /* Got it. */ - return ((n - 1) | (m << 6)); - } - - return (0); -} - -static void -sab82532_flush(struct uart_bas *bas, int what) -{ - - if (what & UART_FLUSH_TRANSMITTER) { - while (uart_getreg(bas, SAB_STAR) & SAB_STAR_CEC) - ; - uart_setreg(bas, SAB_CMDR, SAB_CMDR_XRES); - uart_barrier(bas); - } - if (what & UART_FLUSH_RECEIVER) { - while (uart_getreg(bas, SAB_STAR) & SAB_STAR_CEC) - ; - uart_setreg(bas, SAB_CMDR, SAB_CMDR_RRES); - uart_barrier(bas); - } -} - -static int -sab82532_param(struct uart_bas *bas, int baudrate, int databits, int stopbits, - int parity) -{ - int divisor; - uint8_t ccr2, dafo; - - if (databits >= 8) - dafo = SAB_DAFO_CHL_CS8; - else if (databits == 7) - dafo = SAB_DAFO_CHL_CS7; - else if (databits == 6) - dafo = SAB_DAFO_CHL_CS6; - else - dafo = SAB_DAFO_CHL_CS5; - if (stopbits > 1) - dafo |= SAB_DAFO_STOP; - switch (parity) { - case UART_PARITY_EVEN: dafo |= SAB_DAFO_PAR_EVEN; break; - case UART_PARITY_MARK: dafo |= SAB_DAFO_PAR_MARK; break; - case UART_PARITY_NONE: dafo |= SAB_DAFO_PAR_NONE; break; - case UART_PARITY_ODD: dafo |= SAB_DAFO_PAR_ODD; break; - case UART_PARITY_SPACE: dafo |= SAB_DAFO_PAR_SPACE; break; - default: return (EINVAL); - } - - /* Set baudrate. */ - if (baudrate > 0) { - divisor = sab82532_divisor(bas->rclk, baudrate); - if (divisor == 0) - return (EINVAL); - uart_setreg(bas, SAB_BGR, divisor & 0xff); - uart_barrier(bas); - /* Allow reading the (n-1,m) tuple from the chip. */ - uart_setreg(bas, SAB_TCR, divisor & 0xff); - uart_barrier(bas); - ccr2 = uart_getreg(bas, SAB_CCR2); - ccr2 &= ~(SAB_CCR2_BR9 | SAB_CCR2_BR8); - ccr2 |= (divisor >> 2) & (SAB_CCR2_BR9 | SAB_CCR2_BR8); - uart_setreg(bas, SAB_CCR2, ccr2); - uart_barrier(bas); - } - - uart_setreg(bas, SAB_DAFO, dafo); - uart_barrier(bas); - return (0); -} - -/* - * Low-level UART interface. - */ -static int sab82532_probe(struct uart_bas *bas); -static void sab82532_init(struct uart_bas *bas, int, int, int, int); -static void sab82532_term(struct uart_bas *bas); -static void sab82532_putc(struct uart_bas *bas, int); -static int sab82532_rxready(struct uart_bas *bas); -static int sab82532_getc(struct uart_bas *bas, struct mtx *); - -static struct uart_ops uart_sab82532_ops = { - .probe = sab82532_probe, - .init = sab82532_init, - .term = sab82532_term, - .putc = sab82532_putc, - .rxready = sab82532_rxready, - .getc = sab82532_getc, -}; - -static int -sab82532_probe(struct uart_bas *bas) -{ - - return (0); -} - -static void -sab82532_init(struct uart_bas *bas, int baudrate, int databits, int stopbits, - int parity) -{ - uint8_t ccr0, pvr; - - if (bas->rclk == 0) - bas->rclk = DEFAULT_RCLK; - - /* - * Set all pins, except the DTR pins (pin 1 and 2) to be inputs. - * Pin 4 is magical, meaning that I don't know what it does, but - * it too has to be set to output. - */ - uart_setreg(bas, SAB_PCR, - ~(SAB_PVR_DTR_A|SAB_PVR_DTR_B|SAB_PVR_MAGIC)); - uart_barrier(bas); - /* Disable port interrupts. */ - uart_setreg(bas, SAB_PIM, 0xff); - uart_barrier(bas); - /* Interrupts are active low. */ - uart_setreg(bas, SAB_IPC, SAB_IPC_ICPL); - uart_barrier(bas); - /* Set DTR. */ - pvr = uart_getreg(bas, SAB_PVR); - switch (bas->chan) { - case 1: - pvr &= ~SAB_PVR_DTR_A; - break; - case 2: - pvr &= ~SAB_PVR_DTR_B; - break; - } - uart_setreg(bas, SAB_PVR, pvr | SAB_PVR_MAGIC); - uart_barrier(bas); - - /* power down */ - uart_setreg(bas, SAB_CCR0, 0); - uart_barrier(bas); - - /* set basic configuration */ - ccr0 = SAB_CCR0_MCE|SAB_CCR0_SC_NRZ|SAB_CCR0_SM_ASYNC; - uart_setreg(bas, SAB_CCR0, ccr0); - uart_barrier(bas); - uart_setreg(bas, SAB_CCR1, SAB_CCR1_ODS|SAB_CCR1_BCR|SAB_CCR1_CM_7); - uart_barrier(bas); - uart_setreg(bas, SAB_CCR2, SAB_CCR2_BDF|SAB_CCR2_SSEL|SAB_CCR2_TOE); - uart_barrier(bas); - uart_setreg(bas, SAB_CCR3, 0); - uart_barrier(bas); - uart_setreg(bas, SAB_CCR4, SAB_CCR4_MCK4|SAB_CCR4_EBRG|SAB_CCR4_ICD); - uart_barrier(bas); - uart_setreg(bas, SAB_MODE, SAB_MODE_FCTS|SAB_MODE_RTS|SAB_MODE_RAC); - uart_barrier(bas); - uart_setreg(bas, SAB_RFC, SAB_RFC_DPS|SAB_RFC_RFDF| - SAB_RFC_RFTH_32CHAR); - uart_barrier(bas); - - sab82532_param(bas, baudrate, databits, stopbits, parity); - - /* Clear interrupts. */ - uart_setreg(bas, SAB_IMR0, (unsigned char)~SAB_IMR0_TCD); - uart_setreg(bas, SAB_IMR1, 0xff); - uart_barrier(bas); - uart_getreg(bas, SAB_ISR0); - uart_getreg(bas, SAB_ISR1); - uart_barrier(bas); - - sab82532_flush(bas, UART_FLUSH_TRANSMITTER|UART_FLUSH_RECEIVER); - - /* Power up. */ - uart_setreg(bas, SAB_CCR0, ccr0|SAB_CCR0_PU); - uart_barrier(bas); -} - -static void -sab82532_term(struct uart_bas *bas) -{ - uint8_t pvr; - - pvr = uart_getreg(bas, SAB_PVR); - switch (bas->chan) { - case 1: - pvr |= SAB_PVR_DTR_A; - break; - case 2: - pvr |= SAB_PVR_DTR_B; - break; - } - uart_setreg(bas, SAB_PVR, pvr); - uart_barrier(bas); -} - -static void -sab82532_putc(struct uart_bas *bas, int c) -{ - int delay, limit; - - /* 1/10th the time to transmit 1 character (estimate). */ - delay = sab82532_delay(bas); - - limit = 20; - while ((uart_getreg(bas, SAB_STAR) & SAB_STAR_TEC) && --limit) - DELAY(delay); - uart_setreg(bas, SAB_TIC, c); - limit = 20; - while ((uart_getreg(bas, SAB_STAR) & SAB_STAR_TEC) && --limit) - DELAY(delay); -} - -static int -sab82532_rxready(struct uart_bas *bas) -{ - - return ((uart_getreg(bas, SAB_STAR) & SAB_STAR_RFNE) != 0 ? 1 : 0); -} - -static int -sab82532_getc(struct uart_bas *bas, struct mtx *hwmtx) -{ - int c, delay; - - uart_lock(hwmtx); - - /* 1/10th the time to transmit 1 character (estimate). */ - delay = sab82532_delay(bas); - - while (!(uart_getreg(bas, SAB_STAR) & SAB_STAR_RFNE)) { - uart_unlock(hwmtx); - DELAY(delay); - uart_lock(hwmtx); - } - - while (uart_getreg(bas, SAB_STAR) & SAB_STAR_CEC) - ; - uart_setreg(bas, SAB_CMDR, SAB_CMDR_RFRD); - uart_barrier(bas); - - while (!(uart_getreg(bas, SAB_ISR0) & SAB_ISR0_TCD)) - DELAY(delay); - - c = uart_getreg(bas, SAB_RFIFO); - uart_barrier(bas); - - /* Blow away everything left in the FIFO... */ - while (uart_getreg(bas, SAB_STAR) & SAB_STAR_CEC) - ; - uart_setreg(bas, SAB_CMDR, SAB_CMDR_RMC); - uart_barrier(bas); - - uart_unlock(hwmtx); - - return (c); -} *** 450 LINES SKIPPED *** From owner-dev-commits-src-main@freebsd.org Sat Dec 26 12:52:57 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1BB7E4B88F1; Sat, 26 Dec 2020 12:52:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D33d50GnRz3lSF; Sat, 26 Dec 2020 12:52:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F0F77152F2; Sat, 26 Dec 2020 12:52:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BQCquWY087848; Sat, 26 Dec 2020 12:52:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BQCqulA087847; Sat, 26 Dec 2020 12:52:56 GMT (envelope-from git) Date: Sat, 26 Dec 2020 12:52:56 GMT Message-Id: <202012261252.0BQCqulA087847@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Marius Strobl Subject: git: 863de60ebc3c - scc.4: Add Freescale/NXP QUICC to the list of supported controllers MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: marius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 863de60ebc3cce280f294fd7f7e18aded44d4c62 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Dec 2020 12:52:57 -0000 The branch main has been updated by marius: URL: https://cgit.FreeBSD.org/src/commit/?id=863de60ebc3cce280f294fd7f7e18aded44d4c62 commit 863de60ebc3cce280f294fd7f7e18aded44d4c62 Author: Marius Strobl AuthorDate: 2020-12-25 21:35:34 +0000 Commit: Marius Strobl CommitDate: 2020-12-26 12:48:06 +0000 scc.4: Add Freescale/NXP QUICC to the list of supported controllers Support was added in e1ef781113fba635a7fa4a979607261385971992 and r176772 respectively. --- share/man/man4/scc.4 | 4 +++- sys/conf/NOTES | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/share/man/man4/scc.4 b/share/man/man4/scc.4 index 80072f55d690..45f6a5e6d596 100644 --- a/share/man/man4/scc.4 +++ b/share/man/man4/scc.4 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 29, 2006 +.Dd December 25, 2020 .Dt SCC 4 .Os .\" @@ -54,6 +54,8 @@ driver supports the following classes of SCCs: .Pp .Bl -bullet -compact .It +QUICC: Freescale/NXP QUad Integrated Communications Controllers. +.It SAB82532: Siemens SAB 82532 based serial communications controllers. .It Z8530: Zilog 8530 based serial communications controllers. diff --git a/sys/conf/NOTES b/sys/conf/NOTES index 3dc5d6e3ba59..22fb430a76c7 100644 --- a/sys/conf/NOTES +++ b/sys/conf/NOTES @@ -1771,8 +1771,8 @@ options BREAK_TO_DEBUGGER # A BREAK/DBG on the console goes to options ALT_BREAK_TO_DEBUGGER # Serial Communications Controller -# Supports the Siemens SAB 82532 and Zilog Z8530 multi-channel -# communications controllers. +# Supports the Freescale/NXP QUad Integrated, Siemens SAB 82532 and Zilog Z8530 +# multi-channel communications controllers. device scc # PCI Universal Communications driver From owner-dev-commits-src-main@freebsd.org Sat Dec 26 15:00:03 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 068DA4BB54D; Sat, 26 Dec 2020 15:00:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D36Rk6Zp2z3rjx; Sat, 26 Dec 2020 15:00:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D4BEA16D98; Sat, 26 Dec 2020 15:00:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BQF02l3018638; Sat, 26 Dec 2020 15:00:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BQF02Xe018635; Sat, 26 Dec 2020 15:00:02 GMT (envelope-from git) Date: Sat, 26 Dec 2020 15:00:02 GMT Message-Id: <202012261500.0BQF02Xe018635@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jilles Tjoelker Subject: git: ab41d7f371f5 - sh: Explain duplicate tcsetpgrp() calls MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jilles X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ab41d7f371f52097ab0cb183565f1d8e7c122760 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Dec 2020 15:00:03 -0000 The branch main has been updated by jilles: URL: https://cgit.FreeBSD.org/src/commit/?id=ab41d7f371f52097ab0cb183565f1d8e7c122760 commit ab41d7f371f52097ab0cb183565f1d8e7c122760 Author: Jilles Tjoelker AuthorDate: 2020-12-26 14:27:33 +0000 Commit: Jilles Tjoelker CommitDate: 2020-12-26 14:27:33 +0000 sh: Explain duplicate tcsetpgrp() calls This is a comment change only. --- bin/sh/jobs.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bin/sh/jobs.c b/bin/sh/jobs.c index c46e526eab67..c0ba7d75e16d 100644 --- a/bin/sh/jobs.c +++ b/bin/sh/jobs.c @@ -928,7 +928,12 @@ forkshell(struct job *jp, union node *n, int mode) pgrp = jp->ps[0].pid; if (setpgid(0, pgrp) == 0 && mode == FORK_FG && ttyfd >= 0) { - /*** this causes superfluous TIOCSPGRPS ***/ + /* + * Each process in a pipeline must have the tty + * pgrp set before running its code. + * Only for pipelines of three or more processes + * could this be reduced to two calls. + */ if (tcsetpgrp(ttyfd, pgrp) < 0) error("tcsetpgrp failed, errno=%d", errno); } From owner-dev-commits-src-main@freebsd.org Sat Dec 26 15:38:02 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C4A334BBE33; Sat, 26 Dec 2020 15:38:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D37HZ4Gwgz3sk8; Sat, 26 Dec 2020 15:38:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 812701743F; Sat, 26 Dec 2020 15:38:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BQFc2nF060417; Sat, 26 Dec 2020 15:38:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BQFc2Rb060416; Sat, 26 Dec 2020 15:38:02 GMT (envelope-from git) Date: Sat, 26 Dec 2020 15:38:02 GMT Message-Id: <202012261538.0BQFc2Rb060416@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Marius Strobl Subject: git: 942c6b98db27 - esp.4: Remove references to Sun devices MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: marius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 942c6b98db27b0719448d1f6d31eb73fb7a3931f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Dec 2020 15:38:02 -0000 The branch main has been updated by marius: URL: https://cgit.FreeBSD.org/src/commit/?id=942c6b98db27b0719448d1f6d31eb73fb7a3931f commit 942c6b98db27b0719448d1f6d31eb73fb7a3931f Author: Marius Strobl AuthorDate: 2020-12-26 13:51:03 +0000 Commit: Marius Strobl CommitDate: 2020-12-26 15:34:22 +0000 esp.4: Remove references to Sun devices Support has been removed in 58aa35d42975c298ca0adba705c042596303c9f5 and r357455 respectively. --- share/man/man4/esp.4 | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/share/man/man4/esp.4 b/share/man/man4/esp.4 index 0057e128f4c8..7fb426a02573 100644 --- a/share/man/man4/esp.4 +++ b/share/man/man4/esp.4 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 10, 2020 +.Dd December 26, 2020 .Dt ESP 4 .Os .Sh NAME @@ -71,10 +71,6 @@ driver include: .Pp .Bl -bullet -compact .It -Sun ESP family -.It -Sun FAS family -.It Tekram DC390 .It Tekram DC390T @@ -86,7 +82,6 @@ Tekram DC390T .Xr intro 4 , .Xr pci 4 , .Xr sa 4 , -.Xr sbus 4 , .Xr scsi 4 , .Xr camcontrol 8 .Sh HISTORY From owner-dev-commits-src-main@freebsd.org Sat Dec 26 15:38:02 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DBA694BC079; Sat, 26 Dec 2020 15:38:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D37HZ3f1Tz3sxH; Sat, 26 Dec 2020 15:38:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6FAD017782; Sat, 26 Dec 2020 15:38:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BQFc2QX060400; Sat, 26 Dec 2020 15:38:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BQFc2vX060399; Sat, 26 Dec 2020 15:38:02 GMT (envelope-from git) Date: Sat, 26 Dec 2020 15:38:02 GMT Message-Id: <202012261538.0BQFc2vX060399@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Marius Strobl Subject: git: bc4fc770af61 - man4: remove references to gone eeprom(8) and obsolete devices MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: marius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bc4fc770af61bb53a50777e1daf9e263e4b50b3f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Dec 2020 15:38:03 -0000 The branch main has been updated by marius: URL: https://cgit.FreeBSD.org/src/commit/?id=bc4fc770af61bb53a50777e1daf9e263e4b50b3f commit bc4fc770af61bb53a50777e1daf9e263e4b50b3f Author: Marius Strobl AuthorDate: 2020-12-26 15:18:35 +0000 Commit: Marius Strobl CommitDate: 2020-12-26 15:34:23 +0000 man4: remove references to gone eeprom(8) and obsolete devices The former was missed in 702547720ca01437081fb1b6f9eb281c9541021b and r357794 respectively. Additionally for dc.4 and gem.4, remove on-board and SBus devices whose support was removed as part of 58aa35d42975c298ca0adba705c042596303c9f5 and r357455 respectively. --- share/man/man4/cas.4 | 3 +-- share/man/man4/dc.4 | 6 +----- share/man/man4/gem.4 | 6 +----- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/share/man/man4/cas.4 b/share/man/man4/cas.4 index c205c6fbe4b4..fa19cc33c2ab 100644 --- a/share/man/man4/cas.4 +++ b/share/man/man4/cas.4 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 24, 2012 +.Dd December 26, 2020 .Dt CAS 4 .Os .Sh NAME @@ -110,7 +110,6 @@ Sun Quad GigaSwift Ethernet PCI-X (QGE-X) .Xr miibus 4 , .Xr netintro 4 , .Xr vlan 4 , -.Xr eeprom 8 , .Xr ifconfig 8 .Sh HISTORY The diff --git a/share/man/man4/dc.4 b/share/man/man4/dc.4 index a1634b84ead4..57ff604b3cf8 100644 --- a/share/man/man4/dc.4 +++ b/share/man/man4/dc.4 @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 24, 2011 +.Dd December 26, 2020 .Dt DC 4 .Os .Sh NAME @@ -199,9 +199,6 @@ Alfa Inc GFC2204 (ASIX AX88140A) Built in 10Mbps only Ethernet on Compaq Presario 7900 series desktops (21143, non-MII) .It -Built in Sun DMFE 10/100 Mbps Ethernet on Sun Netra X1 and Sun Fire V100 -(DM9102A, MII) -.It Built in Ethernet on LinkSys EtherFast 10/100 Instant GigaDrive (DM9102, MII) .It CNet Pro110B (ASIX AX88140A) @@ -326,7 +323,6 @@ the card should be configured correctly. .Xr ng_ether 4 , .Xr polling 4 , .Xr vlan 4 , -.Xr eeprom 8 , .Xr ifconfig 8 .Rs .%T ADMtek AL981, AL983 and AL985 data sheets diff --git a/share/man/man4/gem.4 b/share/man/man4/gem.4 index c8a396d9f95a..9224920c07dc 100644 --- a/share/man/man4/gem.4 +++ b/share/man/man4/gem.4 @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 25, 2009 +.Dd December 26, 2020 .Dt GEM 4 .Os .Sh NAME @@ -83,16 +83,12 @@ driver at this time: .It Sun Gigabit Ethernet PCI 2.0/3.0 (GBE/P) (part no.\& 501-4373) -.It -Sun Gigabit Ethernet SBus 2.0/3.0 (GBE/S) -(part no.\& 501-4375) .El .Sh SEE ALSO .Xr altq 4 , .Xr miibus 4 , .Xr netintro 4 , .Xr vlan 4 , -.Xr eeprom 8 , .Xr ifconfig 8 .Sh HISTORY The From owner-dev-commits-src-main@freebsd.org Sat Dec 26 15:38:02 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DC1374BBA72; Sat, 26 Dec 2020 15:38:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D37HZ5FTVz3sgv; Sat, 26 Dec 2020 15:38:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A307317440; Sat, 26 Dec 2020 15:38:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BQFc2Lo060451; Sat, 26 Dec 2020 15:38:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BQFc2c6060450; Sat, 26 Dec 2020 15:38:02 GMT (envelope-from git) Date: Sat, 26 Dec 2020 15:38:02 GMT Message-Id: <202012261538.0BQFc2c6060450@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Marius Strobl Subject: git: 23af96ad2220 - man4: remove references to drivers deorbited as part of FCP-101 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: marius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 23af96ad2220b409b64d3d8e32869c294eee1272 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Dec 2020 15:38:03 -0000 The branch main has been updated by marius: URL: https://cgit.FreeBSD.org/src/commit/?id=23af96ad2220b409b64d3d8e32869c294eee1272 commit 23af96ad2220b409b64d3d8e32869c294eee1272 Author: Marius Strobl AuthorDate: 2020-12-26 13:41:10 +0000 Commit: Marius Strobl CommitDate: 2020-12-26 15:34:22 +0000 man4: remove references to drivers deorbited as part of FCP-101 As for pcn(4), point to le(4) now. --- share/man/man4/altq.4 | 7 +------ share/man/man4/ifmib.4 | 8 ++------ share/man/man4/le.4 | 15 ++------------- share/man/man4/miibus.4 | 17 +---------------- share/man/man4/my.4 | 3 +-- share/man/man4/polling.4 | 3 +-- share/man/man4/vlan.4 | 6 +----- share/man/man4/vmx.4 | 6 +++--- 8 files changed, 12 insertions(+), 53 deletions(-) diff --git a/share/man/man4/altq.4 b/share/man/man4/altq.4 index adac1452a049..d1a08a89c590 100644 --- a/share/man/man4/altq.4 +++ b/share/man/man4/altq.4 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 9, 2019 +.Dd December 26, 2020 .Dt ALTQ 4 .Os .Sh NAME @@ -140,10 +140,7 @@ They have been applied to the following hardware drivers: .Xr cas 4 , .Xr cxgbe 4 , .Xr dc 4 , -.Xr de 4 , -.Xr ed 4 , .Xr em 4 , -.Xr ep 4 , .Xr epair 4 , .Xr et 4 , .Xr fxp 4 , @@ -162,14 +159,12 @@ They have been applied to the following hardware drivers: .Xr qlxgb 4 , .Xr re 4 , .Xr rl 4 , -.Xr sf 4 , .Xr sge 4 , .Xr sis 4 , .Xr sk 4 , .Xr ste 4 , .Xr stge 4 , .Xr ti 4 , -.Xr txp 4 , .Xr udav 4 , .Xr vge 4 , .Xr vr 4 , diff --git a/share/man/man4/ifmib.4 b/share/man/man4/ifmib.4 index 3d12a96bea07..9ebdc59e461a 100644 --- a/share/man/man4/ifmib.4 +++ b/share/man/man4/ifmib.4 @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 28, 2009 +.Dd December 26, 2020 .Dt IFMIB 4 .Os .Sh NAME @@ -182,9 +182,5 @@ The interface first appeared in .Fx 2.2 . .Sh BUGS -Many Ethernet-like interfaces do not yet support the Ethernet MIB; -the interfaces known to support it include -.Xr ed 4 -and -.Xr de 4 . +Many Ethernet-like interfaces do not yet support the Ethernet MIB. Regardless, all interfaces automatically support the generic MIB. diff --git a/share/man/man4/le.4 b/share/man/man4/le.4 index fd8e12e55cff..2c7f9cc3e55e 100644 --- a/share/man/man4/le.4 +++ b/share/man/man4/le.4 @@ -36,7 +36,7 @@ .\" from: @(#)le.4 8.1 (Berkeley) 6/9/93 .\" $FreeBSD$ .\" -.Dd February 15, 2017 +.Dd December 26, 2020 .Dt LE 4 .Os .Sh NAME @@ -87,11 +87,6 @@ as well as the family of chips, which are single-chip implementations of a .Tn LANCE chip and a DMA engine. -This includes a superset of the -.Tn PCI -bus Ethernet chips supported by the -.Xr pcn 4 -driver. The .Nm driver treats all of these @@ -101,9 +96,6 @@ bus Ethernet chips as an and does not support the additional features like the MII bus and burst mode of .Tn AMD Am79C971 PCnet-FAST and greater chips. -Thus the -.Xr pcn 4 -driver should be preferred for the latter. .Pp Generally, the .Nm @@ -239,9 +231,7 @@ The following media option is supported with these media types: Select full duplex operation. .El .Pp -Note that unlike the -.Xr pcn 4 -driver, the +Note that the .Nm driver does not support selecting 100Mbps (Fast Ethernet) media types. .Sh DIAGNOSTICS @@ -312,7 +302,6 @@ was turned off due to an error. .Xr arp 4 , .Xr intro 4 , .Xr netintro 4 , -.Xr pcn 4 , .Xr vlan 4 , .Xr ifconfig 8 .Sh HISTORY diff --git a/share/man/man4/miibus.4 b/share/man/man4/miibus.4 index 9e7643198628..62954146ea3d 100644 --- a/share/man/man4/miibus.4 +++ b/share/man/man4/miibus.4 @@ -8,7 +8,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 1, 2015 +.Dd December 26, 2020 .Dt MIIBUS 4 .Os .Sh NAME @@ -87,16 +87,12 @@ Marvell/SysKonnect Yukon II Gigabit Ethernet NVIDIA nForce MCP Networking Adapter .It Xr nge 4 National Semiconductor DP83820/DP83821 Gigabit Ethernet -.It Xr pcn 4 -AMD Am79C97x PCI 10/100 .It Xr re 4 RealTek 8139C+/8169/8169S/8110S .It Xr rl 4 RealTek 8129/8139 .It Xr rue 4 RealTek RTL8150 USB To Fast Ethernet -.It Xr sf 4 -Adaptec AIC-6915 .It Xr sge 4 Silicon Integrated Systems SiS190/191 Ethernet .It Xr sis 4 @@ -109,10 +105,6 @@ SMSC LAN9xxx USB Fast Ethernet Sundance ST201 (D-Link DFE-550TX) .It Xr stge 4 Sundance/Tamarack TC9021 Gigabit Ethernet -.It Xr tl 4 -Texas Instruments ThunderLAN -.It Xr tx 4 -SMC EtherPower II (83c170) .It Xr udav 4 Davicom DM9601 USB Ethernet .It Xr ure 4 @@ -123,8 +115,6 @@ VIA VT612x PCI Gigabit Ethernet VIA Rhine, Rhine II .It Xr vte 4 DM&P Vortex86 RDC R6040 Fast Ethernet -.It Xr wb 4 -Winbond W89C840F .It Xr xl 4 3Com 3c90x .El @@ -161,26 +151,21 @@ but as a result are not well behaved newbus device drivers. .Xr netintro 4 , .Xr nfe 4 , .Xr nge 4 , -.Xr pcn 4 , .Xr re 4 , .Xr rgephy 4 , .Xr rl 4 , .Xr rue 4 , -.Xr sf 4 , .Xr sge 4 , .Xr sis 4 , .Xr sk 4 , .Xr smsc 4 , .Xr ste 4 , .Xr stge 4 , -.Xr tl 4 , -.Xr tx 4 , .Xr udav 4 , .Xr ure 4 , .Xr vge 4 , .Xr vr 4 , .Xr vte 4 , -.Xr wb 4 , .Xr xl 4 .Sh STANDARDS More information on MII can be found in the IEEE 802.3 Standard. diff --git a/share/man/man4/my.4 b/share/man/man4/my.4 index b1ca8043afcd..f92fff79306e 100644 --- a/share/man/man4/my.4 +++ b/share/man/man4/my.4 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 11, 2007 +.Dd December 26, 2020 .Dt MY 4 .Os .Sh NAME @@ -68,7 +68,6 @@ Myson MTD89X PCI Gigabit Ethernet chip .El .Sh SEE ALSO .Xr altq 4 , -.Xr de 4 , .Xr netintro 4 , .Xr pci 4 , .Xr ifconfig 8 diff --git a/share/man/man4/polling.4 b/share/man/man4/polling.4 index 621f6366b87c..eae6170f33b8 100644 --- a/share/man/man4/polling.4 +++ b/share/man/man4/polling.4 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 6, 2007 +.Dd December 26, 2020 .Dt POLLING 4 .Os .Sh NAME @@ -189,7 +189,6 @@ As of this writing, the .Xr nge 4 , .Xr re 4 , .Xr rl 4 , -.Xr sf 4 , .Xr sis 4 , .Xr ste 4 , .Xr stge 4 , diff --git a/share/man/man4/vlan.4 b/share/man/man4/vlan.4 index a034bf7e54cf..da5467d8588e 100644 --- a/share/man/man4/vlan.4 +++ b/share/man/man4/vlan.4 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 8, 2018 +.Dd December 26, 2020 .Dt VLAN 4 .Os .Sh NAME @@ -142,7 +142,6 @@ in hardware: .Xr sge 4 , .Xr stge 4 , .Xr ti 4 , -.Xr txp 4 , and .Xr vge 4 . .Pp @@ -175,12 +174,9 @@ These interfaces natively support long frames for .Xr le 4 , .Xr nfe 4 , .Xr rl 4 , -.Xr sf 4 , .Xr sis 4 , .Xr sk 4 , .Xr ste 4 , -.Xr tl 4 , -.Xr tx 4 , .Xr vr 4 , .Xr vte 4 , and diff --git a/share/man/man4/vmx.4 b/share/man/man4/vmx.4 index c09084342a21..7d8ef9e1518f 100644 --- a/share/man/man4/vmx.4 +++ b/share/man/man4/vmx.4 @@ -17,7 +17,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 17, 2019 +.Dd December 26, 2020 .Dt VMX 4 .Os .Sh NAME @@ -49,7 +49,7 @@ interface to the underlying host operating system. This driver supports the .Ic VMXNET3 driver protocol, as an alternative to the emulated -.Xr pcn 4 , +.Xr le 4 , .Xr em 4 interfaces also available in the VMware environment. The @@ -140,7 +140,7 @@ ethernet0.virtualDev = "vmxnet3" .Xr iflib 4 , .Xr netintro 4 , .Xr ng_ether 4 , -.Xr pcn 4 , +.Xr le 4 , .Xr vlan 4 , .Xr ifconfig 8 .Sh AUTHORS From owner-dev-commits-src-main@freebsd.org Sat Dec 26 15:38:02 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DBA2B4BBFE2; Sat, 26 Dec 2020 15:38:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D37HZ4kHkz3sxJ; Sat, 26 Dec 2020 15:38:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9196C173AC; Sat, 26 Dec 2020 15:38:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BQFc2Gj060434; Sat, 26 Dec 2020 15:38:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BQFc2TN060433; Sat, 26 Dec 2020 15:38:02 GMT (envelope-from git) Date: Sat, 26 Dec 2020 15:38:02 GMT Message-Id: <202012261538.0BQFc2TN060433@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Marius Strobl Subject: git: 8a154a4f025b - pcm.4: remove reference to snd_audiocs(4) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: marius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8a154a4f025b76810c4959dd905fe75b46f4f9c3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Dec 2020 15:38:02 -0000 The branch main has been updated by marius: URL: https://cgit.FreeBSD.org/src/commit/?id=8a154a4f025b76810c4959dd905fe75b46f4f9c3 commit 8a154a4f025b76810c4959dd905fe75b46f4f9c3 Author: Marius Strobl AuthorDate: 2020-12-26 13:44:27 +0000 Commit: Marius Strobl CommitDate: 2020-12-26 15:34:22 +0000 pcm.4: remove reference to snd_audiocs(4) The latter has been removed in 58aa35d42975c298ca0adba705c042596303c9f5 and r357455 respectively. --- share/man/man4/pcm.4 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/share/man/man4/pcm.4 b/share/man/man4/pcm.4 index cb688a982814..ea128c46a900 100644 --- a/share/man/man4/pcm.4 +++ b/share/man/man4/pcm.4 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 5, 2020 +.Dd December 26, 2020 .Dt SOUND 4 .Os .Sh NAME @@ -706,7 +706,6 @@ A device node is not created properly. .Xr snd_ai2s 4 , .Xr snd_als4000 4 , .Xr snd_atiixp 4 , -.Xr snd_audiocs 4 , .Xr snd_cmi 4 , .Xr snd_cs4281 4 , .Xr snd_csa 4 , From owner-dev-commits-src-main@freebsd.org Sat Dec 26 15:42:04 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BA7134BBD49; Sat, 26 Dec 2020 15:42:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D37ND4pmVz3tKD; Sat, 26 Dec 2020 15:42:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7C9181745B; Sat, 26 Dec 2020 15:42:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BQFg42A068808; Sat, 26 Dec 2020 15:42:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BQFg4Y6068807; Sat, 26 Dec 2020 15:42:04 GMT (envelope-from git) Date: Sat, 26 Dec 2020 15:42:04 GMT Message-Id: <202012261542.0BQFg4Y6068807@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: a2a908ed00d7 - pci_info: update to 2020-12-26 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a2a908ed00d7bcdfac326e79d3bbf06ccf9b5d8e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Dec 2020 15:42:04 -0000 The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=a2a908ed00d7bcdfac326e79d3bbf06ccf9b5d8e commit a2a908ed00d7bcdfac326e79d3bbf06ccf9b5d8e Author: Baptiste Daroussin AuthorDate: 2020-12-26 15:30:07 +0000 Commit: Baptiste Daroussin CommitDate: 2020-12-26 15:41:48 +0000 pci_info: update to 2020-12-26 --- share/misc/pci_vendors | 645 ++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 559 insertions(+), 86 deletions(-) diff --git a/share/misc/pci_vendors b/share/misc/pci_vendors index 37d73e72a5f8..61b9069d9ca7 100644 --- a/share/misc/pci_vendors +++ b/share/misc/pci_vendors @@ -1,10 +1,8 @@ -# $FreeBSD$ - # # List of PCI ID's # -# Version: 2020.08.19 -# Date: 2020-08-19 03:15:02 +# Version: 2020.12.26 +# Date: 2020-12-26 03:15:02 # # Maintained by Albert Pool, Martin Mares, and other volunteers from # the PCI ID Project at https://pci-ids.ucw.cz/. @@ -72,6 +70,8 @@ 018a LevelOne 0106 FPC-0106TX misprogrammed [RTL81xx] 01de Oxide Computer Company +# probably misprogrammed Intel Atom C2338 on Dell 0K8Y0N board +0200 Dell (wrong ID) # 021b is not Compaq but there is a board misprogrammed 021b Compaq Computer Corporation 8139 HNE-300 (RealTek RTL8139c) [iPaq Networking] @@ -440,6 +440,7 @@ 1000 9363 MegaRAID SAS 9361-4i 1000 9364 MegaRAID SAS 9364-8i 1000 936a MegaRAID SAS 9364-8i + 1000 9380 MegaRAID SAS 9380-8e 1028 1f41 PERC H830 Adapter 1028 1f42 PERC H730P Adapter 1028 1f43 PERC H730 Adapter @@ -704,6 +705,9 @@ 1d49 0200 ThinkSystem 430-8i SAS/SATA 12Gb HBA 1d49 0202 ThinkSystem 430-8e SAS/SATA 12Gb HBA 1d49 0204 ThinkSystem 430-8i SAS/SATA 12Gb Dense HBA +# PCIe switch SES management endpoint + 00b2 PEX880xx PCIe Gen 4 Switch SES management endpoint + 1d49 0003 ThinkSystem 1611-8P PCIe Gen4 NVMe Switch Adapter 00be SAS3504 Fusion-MPT Tri-Mode RAID On Chip (ROC) 00bf SAS3404 Fusion-MPT Tri-Mode I/O Controller Chip (IOC) 00c0 SAS3324 PCI-Express Fusion-MPT SAS-3 @@ -766,7 +770,7 @@ 1028 200b HBA355i Adapter 1028 200c HBA355i Front 1028 200d HBA355e Adapter - 1028 200e HBA355i MX + 1028 200e HBA350i MX 1d49 0205 ThinkSystem 440-16i SAS/SATA PCIe Gen4 12Gb Internal HBA 1d49 0206 ThinkSystem 440-16e SAS/SATA PCIe Gen4 12Gb HBA 00e7 Fusion-MPT 12GSAS/PCIe Unsupported SAS38xx @@ -904,6 +908,8 @@ 8086 0523 MegaRAID RAID Controller SRCS16 3050 SAS2008 PCI-Express Fusion-MPT SAS-2 6001 DX1 Multiformat Broadcast HD/SD Encoder/Decoder + c012 PEX880xx PCIe Gen 4 Switch + 1d49 0003 ThinkSystem 1611-8P PCIe Gen4 NVMe Switch Adapter 1001 Kolter Electronic 0010 PCI 1616 Measurement card with 32 digital I/O lines 0011 OPTO-PCI Opto-Isolated digital I/O board @@ -954,14 +960,20 @@ 15d8 Picasso 103c 8615 Pavilion Laptop 15-cw1xxx 17aa 5124 ThinkPad E595 + ea50 cc10 RXi2-BP 15dd Raven Ridge [Radeon Vega Series / Radeon Vega Mobile Series] 103c 83c6 Radeon Vega 8 Mobile + 1043 876b PRIME B450M-A Motherboard 1458 d000 Radeon RX Vega 11 + ea50 cc10 RXi2-BP 15de Raven/Raven2/Fenghuang HDMI/DP Audio Controller 103c 8615 Pavilion Laptop 15-cw1xxx + 1043 876b PRIME B450M-A Motherboard 17aa 5124 ThinkPad E595 + ea50 cc10 RXi2-BP 15df Raven/Raven2/Fenghuang/Renoir Cryptographic Coprocessor 103c 8615 Pavilion Laptop 15-cw1xxx + ea50 ce19 mCOM10-L1900 15ff Fenghuang [Zhongshan Subor Z+] 1607 Arden 1636 Renoir @@ -974,9 +986,9 @@ 3154 RV380/M24 GL [Mobility FireGL V3200] 3155 RV380 GL [FireMV 2400] 3171 RV380 GL [FireMV 2400] (Secondary) - 3e50 RV380 [Radeon X600] + 3e50 RV380 [Radeon X550/X600] 3e54 RV380 GL [FireGL V3200] - 3e70 RV380 [Radeon X600] (Secondary) + 3e70 RV380 [Radeon X550/X600] (Secondary) 4136 RS100 [Mobility IGP 320M] 4137 RS200 [Radeon IGP 340] 4144 R300 [Radeon 9500] @@ -1541,7 +1553,7 @@ 5044 All-In-Wonder 128 PCI 1002 0028 Rage 128 AIW 1002 0029 Rage 128 AIW - 5046 Rage 4 [Rage 128 PRO AGP 4X TMDS] + 5046 Rage 4 [Rage 128 PRO AGP 4X] 1002 0004 Rage Fury Pro 1002 0008 Rage Fury Pro/Xpert 2000 Pro 1002 0014 Rage Fury Pro @@ -1551,9 +1563,9 @@ 1002 0048 Rage Fury Pro 1002 2000 Rage Fury MAXX AGP 4x (TMDS) (VGA device) 1002 2001 Rage Fury MAXX AGP 4x (TMDS) (Extra device?!) - 5050 Rage128 [Xpert 128 PCI] + 5050 Rage 4 [Rage 128 PRO PCI / Xpert 128 PCI] 1002 0008 Xpert 128 - 5052 Rage 128 PRO AGP 4X TMDS + 5052 Rage 4 [Rage 128 PRO AGP 4X] 5144 R100 [Radeon 7200 / All-In-Wonder Radeon] 1002 0008 Radeon 7000/Radeon VE 1002 0009 Radeon 7000/Radeon @@ -1652,8 +1664,6 @@ 524c Rage 128 VR AGP 1002 0008 Xpert 99/Xpert 2000 1002 0088 Xpert 99 - 5346 Rage 128 SF/4x AGP 2x - 1002 0048 RAGE 128 16MB VGA TVOUT AMC PAL 534d Rage 128 4X AGP 4x 1002 0008 Xpert 99/Xpert 2000 1002 0018 Xpert 2000 @@ -1740,7 +1750,7 @@ 5957 RX780/RX790 Host Bridge 1849 5957 A770CrossFire Motherboard 5958 RD780 Host Bridge - 5960 RV280 [Radeon 9200 PRO] + 5960 RV280 [Radeon 9200 PRO / 9250] 17af 2020 Excalibur Radeon 9250 5961 RV280 [Radeon 9200] 1002 2f72 All-in-Wonder 9200 Series @@ -1909,7 +1919,7 @@ 1642 3c81 Radeon HD 8670 1642 3c91 Radeon HD 8670 1642 3f09 Radeon R7 350 - 6611 Oland [Radeon HD 8570 / R7 240/340 / Radeon 520 OEM] + 6611 Oland [Radeon HD 8570 / R5 430 OEM / R7 240/340 / Radeon 520 OEM] 1028 210b Radeon R5 240 OEM 1642 1869 Radeon 520 OEM 174b 4248 Radeon R7 240 OEM @@ -2590,6 +2600,7 @@ 67cc Ellesmere [Polaris10] 67cf Ellesmere [Polaris10] 67d0 Ellesmere [Radeon Pro V7300X / V7350x2] + 67d7 Ellesmere [Radeon Pro WX 5100 / Barco MXRT-6700] 67df Ellesmere [Radeon RX 470/480/570/570X/580/580X/590] 1002 0b37 Radeon RX 480 1028 1722 Radeon RX 570X @@ -2621,8 +2632,10 @@ 148c 2379 Radeon RX 570 4G [Red Dragon] 1682 9470 Radeon RX 470 1682 9480 Radeon RX 480 + 1682 9587 Radeon RX 590 FATBOY 8GB 1682 9588 Radeon RX 580 XTR 1682 c570 Radeon RX 570 + 1682 c580 Radeon RX 580 174b e347 Radeon RX 470/480 174b e349 Radeon RX 470 1787 a470 Radeon RX 470 @@ -2649,6 +2662,7 @@ 67e9 Baffin [Polaris11] 67eb Baffin [Radeon Pro V5300X] 67ef Baffin [Radeon RX 460/560D / Pro 450/455/460/555/555X/560/560X] + 1025 1367 RX560X 4GB 1028 1703 RX 560D OEM OC 2 GB 103c 3421 Radeon RX 460 1043 0561 AREZ Radeon RX 560 @@ -2726,6 +2740,7 @@ 17aa 3643 Radeon R9 A375 17aa 3801 Radeon R9 M275 17aa 3824 Radeon R9 M375 + 1da2 e26a Radeon R7 250 6821 Venus XT [Radeon HD 8870M / R9 M270X/M370X] 1002 031e FirePro SX4000 1028 05cc FirePro M5100 @@ -2894,6 +2909,7 @@ 1002 0b36 RX Vega64 1002 6b76 RX Vega64 1458 230c Radeon RX VEGA 56 GAMING OC 8G + 1da2 e376 Radeon RX VEGA 56 Pulse 8GB OC HBM2 6880 Lexington [Radeon HD 6550M] 103c 163c Pavilion dv6 Radeon HD 6550M 6888 Cypress XT [FirePro V8800] @@ -3411,6 +3427,8 @@ 148c 9380 Radeon R9 380 # Make naming scheme consistent 174b e308 Radeon R9 380 Nitro 4G D5 + 174b e315 Radeon R9 285 + 693b Tonga PRO GL [FirePro W7100 / Barco MXRT-7600] 694c Polaris 22 XT [Radeon RX Vega M GH] 694e Polaris 22 XL [Radeon RX Vega M GL] 694f Polaris 22 MGL XL [Radeon Pro WX Vega M GL] @@ -3435,7 +3453,7 @@ 7100 R520 [Radeon X1800 XT] 7101 R520/M58 [Mobility Radeon X1800 XT] 7102 R520/M58 [Mobility Radeon X1800] - 7104 R520 GL [FireGL V7200] + 7104 R520 GL [FireGL V7200 / Barco MXTR-5100] 13cc 3d0a MXRT-5100 7109 R520 [Radeon X1800 XL] 1002 0322 All-in-Wonder X1800XL @@ -3577,12 +3595,17 @@ 7312 Navi 10 [Radeon Pro W5700] 731f Navi 10 [Radeon RX 5600 OEM/5600 XT / 5700/5700 XT] 1458 2313 Radeon RX 5700 XT Gaming OC + 1682 5701 RX 5700 XT RAW II 1da2 e411 Radeon RX 5600 XT 7340 Navi 14 [Radeon RX 5500/5500M / Pro 5500M] 7341 Navi 14 [Radeon Pro W5500] 7347 Navi 14 [Radeon Pro W5500M] 734f Navi 14 [Radeon Pro W5300M] 7360 Navi 12 [Radeon Pro 5600M] + 73bf Navi 21 [Radeon RX 6800/6800 XT / 6900 XT] + 73c3 Navi 22 + 73df Navi 22 + 73ff Navi 23 7833 RS350 Host Bridge 7834 RS350 [Radeon 9100 PRO/XT IGP] 7835 RS350M [Mobility Radeon 9000 IGP] @@ -3837,6 +3860,7 @@ 9809 Wrestler [Radeon HD 7310] 980a Wrestler [Radeon HD 7290] 9830 Kabini [Radeon HD 8400 / R3 Series] + 1043 8623 AM1I-A Motherboard 9831 Kabini [Radeon HD 8400E] 9832 Kabini [Radeon HD 8330] 1849 9832 QC5000-ITX/PH @@ -3849,6 +3873,7 @@ 9839 Kabini [Radeon HD 8180] 983d Temash [Radeon HD 8250/8280G] 9840 Kabini HDMI/DP Audio + 1043 8623 AM1I-A Motherboard 1849 9840 QC5000-ITX/PH 9850 Mullins [Radeon R3 Graphics] 9851 Mullins [Radeon R4/R5 Graphics] @@ -4666,6 +4691,7 @@ 1534 Family 16h Processor Function 4 1535 Family 16h Processor Function 5 1536 Family 16h Processor Root Complex + 1043 8623 AM1I-A Motherboard 1849 1536 QC5000-ITX/PH 1537 Kabini/Mullins PSP-Platform Security Processor 1538 Family 16h Processor Function 0 @@ -4736,8 +4762,11 @@ 15be Stoney Audio Processor 15d0 Raven/Raven2 Root Complex 103c 8615 Pavilion Laptop 15-cw1xxx + 1043 876b PRIME B450M-A Motherboard 15d1 Raven/Raven2 IOMMU 103c 8615 Pavilion Laptop 15-cw1xxx + 1043 876b PRIME B450M-A Motherboard + ea50 ce19 mCOM10-L1900 15d2 Raven/Raven2 PCIe Dummy Host Bridge 15d3 Raven/Raven2 PCIe GPP Bridge [6:0] 15d4 FireFlight USB 3.1 @@ -4747,17 +4776,24 @@ 15dc Raven/Raven2 Internal PCIe GPP Bridge 0 to Bus B 15de Raven/Raven2/FireFlight HD Audio Controller 15df Family 17h (Models 10h-1fh) Platform Security Processor + 1043 876b PRIME B450M-A Motherboard 17aa 5124 ThinkPad E595 + ea50 ce19 mCOM10-L1900 15e0 Raven USB 3.1 103c 8615 Pavilion Laptop 15-cw1xxx + 1043 876b PRIME B450M-A Motherboard 17aa 5124 ThinkPad E595 + ea50 ce19 mCOM10-L1900 15e1 Raven USB 3.1 103c 8615 Pavilion Laptop 15-cw1xxx + 1043 876b PRIME B450M-A Motherboard 17aa 5124 ThinkPad E595 + ea50 ce19 mCOM10-L1900 15e2 Raven/Raven2/FireFlight/Renoir Audio Processor 17aa 5124 ThinkPad E595 15e3 Family 17h (Models 10h-1fh) HD Audio Controller 103c 8615 Pavilion Laptop 15-cw1xxx + 1043 86c7 PRIME B450M-A Motherboard 17aa 5124 ThinkPad E595 15e4 Raven/Raven2/Renoir Sensor Fusion Hub 15e5 Raven2 USB 3.1 @@ -4967,6 +5003,7 @@ 7801 FCH SATA Controller [AHCI mode] 103c 168b ProBook 4535s Notebook 103c 194e ProBook 455 G1 Notebook + 1043 8623 AM1I-A Motherboard 17aa 3988 Z50-75 1849 7801 QC5000-ITX/PH 7802 FCH SATA Controller [RAID mode] @@ -4978,11 +5015,13 @@ 7807 FCH USB OHCI Controller 103c 194e ProBook 455 G1 Notebook 103c 1985 Pavilion 17-e163sg Notebook PC + 1043 8623 AM1I-A Motherboard 17aa 3988 Z50-75 1849 7807 QC5000-ITX/PH 7808 FCH USB EHCI Controller 103c 194e ProBook 455 G1 Notebook 103c 1985 Pavilion 17-e163sg Notebook PC + 1043 8623 AM1I-A Motherboard 17aa 3988 Z50-75 1849 7808 QC5000-ITX/PH 7809 FCH USB OHCI Controller @@ -4992,6 +5031,7 @@ 780b FCH SMBus Controller 103c 194e ProBook 455 G1 Notebook 103c 1985 Pavilion 17-e163sg Notebook PC + 1043 8623 AM1I-A Motherboard 17aa 3988 Z50-75 1849 780b QC5000-ITX/PH 780c FCH IDE Controller @@ -4999,11 +5039,13 @@ 103c 194e ProBook 455 G1 Notebook 103c 1985 Pavilion 17-e163sg Notebook PC 1043 8444 F2A85-M Series + 1043 8576 AM1I-A Motherboard 17aa 3988 Z50-75 1849 8892 QC5000-ITX/PH 780e FCH LPC Bridge 103c 194e ProBook 455 G1 Notebook 103c 1985 Pavilion 17-e163sg Notebook PC + 1043 8623 AM1I-A Motherboard 17aa 3988 Z50-75 1849 780e QC5000-ITX/PH 780f FCH PCI Bridge @@ -5012,12 +5054,15 @@ 7814 FCH USB XHCI Controller 103c 194e ProBook 455 G1 Notebook 103c 1985 Pavilion 17-e163sg Notebook PC + 1043 8623 AM1I-A Motherboard 17aa 3988 Z50-75 1849 7814 QC5000-ITX/PH 7900 FCH SATA Controller [IDE mode] 7901 FCH SATA Controller [AHCI mode] 103c 8615 Pavilion Laptop 15-cw1xxx + 1043 876b PRIME B450M-A Motherboard 1462 7c37 X570-A PRO motherboard + ea50 ce19 mCOM10-L1900 7902 FCH SATA Controller [RAID mode] 7903 FCH SATA Controller [RAID mode] 7904 FCH SATA Controller [AHCI mode] @@ -5025,12 +5070,16 @@ 7908 FCH USB EHCI Controller 790b FCH SMBus Controller 103c 8615 Pavilion Laptop 15-cw1xxx + 1043 876b PRIME B450M-A Motherboard 1462 7c37 X570-A PRO motherboard 17aa 5124 ThinkPad E595 + ea50 ce19 mCOM10-L1900 790e FCH LPC Bridge 103c 8615 Pavilion Laptop 15-cw1xxx + 1043 876b PRIME B450M-A Motherboard 1462 7c37 X570-A PRO motherboard 17aa 5124 ThinkPad E595 + ea50 ce19 mCOM10-L1900 790f FCH PCI Bridge 7914 FCH USB XHCI Controller 9600 RS780 Host Bridge @@ -8556,6 +8605,7 @@ 10b5 2905 Alpermann+Velte PCI TS: Time Synchronisation Board 10b5 3196 Goramo PLX200SYN sync serial card 10b5 9050 PCI-I04 PCI Passive PC/CAN Interface + 12fe 0001 CAN-PCI/331 CAN bus controller 1369 8901 PCX11+ PCI 1369 8f01 VX222 1369 9401 PCX924 @@ -9463,7 +9513,7 @@ 1682 211c GeForce 6600 256MB DDR DUAL DVI TV 00f3 NV43 [GeForce 6200] 00f4 NV43 [GeForce 6600 LE] - 00f5 G71 [GeForce 7800 GS] + 00f5 G70/G71 [GeForce 7800 GS AGP] 00f6 NV43 [GeForce 6800 GS/XT] 1682 217e XFX GeForce 6800 XTreme 256MB DDR3 AGP 00f8 NV45GL [Quadro FX 3400/4400] @@ -9858,15 +9908,16 @@ 02a0 NV2A [XGPU] 02a5 MCPX CPU Bridge 02a6 MCPX Memory Controller - 02e0 G73 [GeForce 7600 GT] + 02e0 G73 [GeForce 7600 GT AGP] 02e0 2249 GF 7600GT 560M 256MB DDR3 DUAL DVI TV - 02e1 G73 [GeForce 7600 GS] + 02e1 G73 [GeForce 7600 GS AGP] 1682 222b PV-T73K-UAL3 (256MB) 1682 2247 GF 7600GS 512MB DDR2 - 02e2 G73 [GeForce 7300 GT] - 02e3 G71 [GeForce 7900 GS] - 02e4 G71 [GeForce 7950 GT] + 02e2 G73 [GeForce 7300 GT AGP] + 02e3 G71 [GeForce 7900 GS AGP] + 02e4 G71 [GeForce 7950 GT AGP] 1682 2271 PV-T71A-YDF7 (512MB) + 02e5 G71 [GeForce 7600 GS AGP] 02f0 C51 Host Bridge 103c 2a34 Pavilion a1677c 103c 30b7 Presario V6133CL @@ -10725,6 +10776,7 @@ 0a21 GT216M [GeForce GT 330M] 0a22 GT216 [GeForce 315] 0a23 GT216 [GeForce 210] + 0a24 GT216 [GeForce 405] 0a26 GT216 [GeForce 405] 0a27 GT216 [GeForce 405] 0a28 GT216M [GeForce GT 230M] @@ -11698,6 +11750,7 @@ 128a GK208B 128b GK208B [GeForce GT 710] 1043 85f7 GT710-SL-1GD5 + 1043 8770 GT710-4H-SL-2GD5 128c GK208B 1290 GK208M [GeForce GT 730M] 103c 2afa GeForce GT 730A @@ -11815,6 +11868,7 @@ 13fb GM204GLM [Quadro M5500] 1401 GM206 [GeForce GTX 960] 1402 GM206 [GeForce GTX 950] + 1404 GM206 [GeForce GTX 960 FAKE] 1406 GM206 [GeForce GTX 960 OEM] 1407 GM206 [GeForce GTX 750 v2] 1427 GM206M [GeForce GTX 965M] @@ -11865,6 +11919,7 @@ 1b07 GP102 [P102-100] 1b30 GP102GL [Quadro P6000] 1b38 GP102GL [Tesla P40] + 1b39 GP102GL [Tesla P10] 1b70 GP102GL 1b78 GP102GL 1b80 GP104 [GeForce GTX 1080] @@ -11920,6 +11975,7 @@ 1c30 GP106GL [Quadro P2000] 1c31 GP106GL [Quadro P2200] 1c35 GP106 + 1c36 GP106 1c60 GP106BM [GeForce GTX 1060 Mobile 6GB] 103c 8390 GeForce GTX 1060 Max-Q 6GB 1c61 GP106BM [GeForce GTX 1050 Ti Mobile] @@ -12053,6 +12109,7 @@ 1f51 TU106BM [GeForce RTX 2060 Mobile] 1f54 TU106BM [GeForce RTX 2070 Mobile] 1f55 TU106BM [GeForce RTX 2060 Mobile] + 1f76 TU106GLM [Quadro RTX 3000 Mobile Refresh] 1f81 TU117 1f82 TU117 [GeForce GTX 1650] 1f91 TU117M [GeForce GTX 1650 Mobile / Max-Q] @@ -12061,14 +12118,18 @@ 1f95 TU117M [GeForce GTX 1650 Ti Mobile] 1f96 TU117M [GeForce GTX 1650 Mobile / Max-Q] 1f97 TU117M [GeForce MX450] + 1f98 TU117M [GeForce MX450] 1f99 TU117M + 1f9c TU117M [GeForce MX450] 1fae TU117GL 1fb8 TU117GLM [Quadro T2000 Mobile / Max-Q] 1fb9 TU117GLM [Quadro T1000 Mobile] + 1fbb TU117GLM [Quadro T500 Mobile] 1fbf TU117GL 1fd9 TU117BM [GeForce GTX 1650 Mobile Refresh] 1ff9 TU117GLM [Quadro T1000 Mobile] 20b0 GA100 [A100 SXM4 40GB] + 20b1 GA100 [A100 PCIe 40GB] 20be GA100 [GRID A100A] 20bf GA100 [GRID A100B] 20f1 GA100 [A100 PCIe 40GB] @@ -12083,6 +12144,40 @@ 21bf TU116GL 21c4 TU116 [GeForce GTX 1660 SUPER] 21d1 TU116BM [GeForce GTX 1660 Ti Mobile] + 2204 GA102 [GeForce RTX 3090] + 2205 GA102 [GeForce RTX 3080 Ti] + 2206 GA102 [GeForce RTX 3080] + 10de 1467 GA102 [GeForce RTX 3080] + 10de 146d GA102 [GeForce RTX 3080 20GB] + 1462 3892 RTX 3080 10GB GAMING X TRIO + 222b GA102 [GeForce RTX 3090 Engineering Sample] + 222f GA102 [GeForce RTX 3080 11GB / 12GB Engineering Sample] + 2230 GA102GL [RTX A6000] + 2235 GA102GL [RTX A40] + 223f GA102GL + 228b GA104 High Definition Audio Controller + 2321 GA103 + 2482 GA104 [GeForce RTX 3070 Ti] + 2484 GA104 [GeForce RTX 3070] + 10de 146b GA104 [GeForce RTX 3070] + 10de 14ae GA104 [GeForce RTX 3070 16GB] + 2486 GA104 [GeForce RTX 3060 Ti] + 249c GA104M [GeForce RTX 3080 Mobile / Max-Q 8GB/16GB] + 249d GA104M [GeForce RTX 3070 Mobile / Max-Q] + 24ac GA104 [GeForce RTX 30x0 Engineering Sample] + 24ad GA104 [GeForce RTX 3060 Engineering Sample] + 24af GA104 [GeForce RTX 3070 Engineering Sample] + 24bf GA104 [GeForce RTX 3070 Engineering Sample] + 24dc GA104M [GeForce RTX 3080 Mobile / Max-Q 8GB/16GB] + 24dd GA104M [GeForce RTX 3070 Mobile / Max-Q] + 2501 GA106 [GeForce RTX 3060 12GB] + 2503 GA106 [GeForce RTX 3060 6GB] + 2505 GA106 + 2520 GA106M [GeForce RTX 3060 Mobile / Max-Q] + 252f GA106 [GeForce RTX 3060 Engineering Sample] + 2560 GA106M [GeForce RTX 3060 Mobile / Max-Q] + 2583 GA107 [GeForce RTX 3050] + 25af GA107 [GeForce RTX 3050 Engineering Sample] 10df Emulex Corporation 0720 OneConnect NIC (Skyhawk) 103c 1934 FlexFabric 20Gb 2-port 650M Adapter @@ -12177,6 +12272,7 @@ 10df f419 LPe35002-M2-L 2-Port 32Gb PCIe Fibre Channel Adapter 1590 02d5 StoreFabric SN1610E 1-Port 32Gb Fibre Channel Adapter 1590 02d6 StoreFabric SN1610E 2-Port 32Gb Fibre Channel Adapter + f500 LPe37000/LPe38000 Series 32Gb/64Gb Fibre Channel Adapter f700 LP7000 Fibre Channel Host Adapter f701 LP7000 Fibre Channel Host Adapter Alternate ID (JX1:2-3, JX2:1-2) f800 LP8000 Fibre Channel Host Adapter @@ -12284,6 +12380,7 @@ 8111 Twist3 Frame Grabber 10ec Realtek Semiconductor Co., Ltd. 0139 RTL-8139/8139C/8139C+ Ethernet Controller + 3000 Killer E3000 2.5GbE Controller 5208 RTS5208 PCI Express Card Reader 5209 RTS5209 PCI Express Card Reader 5227 RTS5227 PCI Express Card Reader @@ -12306,6 +12403,7 @@ 1028 06d6 Latitude 7275 tablet 1028 06dc Latitude E7470 1028 06e4 XPS 15 9550 + 1028 06e6 Latitude 11 5175 2-in-1 17aa 224f ThinkPad X1 Carbon 5th Gen 5260 RTS5260 PCI Express Card Reader 5286 RTS5286 PCI Express Card Reader @@ -12314,6 +12412,7 @@ 5288 RTS5288 PCI Express Card Reader 5289 RTL8411 PCI Express Card Reader 1043 1457 K55A Laptop + 5762 RTS5763DL NVMe SSD Controller 8029 RTL-8029(AS) 10b8 2011 EZ-Card (SMC1208) 10ec 8029 RTL-8029(AS) @@ -12386,6 +12485,8 @@ 8e2e 7000 KF-230TX 8e2e 7100 KF-230TX/2 a0a0 0007 ALN-325C + 8161 RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller + 10ec 8168 TP-Link TG-3468 v4.0 Gigabit PCI Express Network Adapter 8167 RTL-8110SC/8169SC Gigabit Ethernet 105b 0e10 RTL-8110SC-GR on a N15235/A74MX mainboard 1458 e000 GA-MA69G-S3H Motherboard @@ -12412,6 +12513,9 @@ 1043 83a3 M4A785/P7P55 Motherboard 1043 8432 P8P67 and other motherboards 1043 8505 P8 series motherboard + 1043 8554 H81M-C Motherboard + 1043 859e AM1I-A Motherboard + 1043 8677 PRIME B450M-A Motherboard 105b 0d7c D270S/D250S Motherboard 10ec 8168 RTL8111/8168 PCI Express Gigabit Ethernet controller 144d c652 RTL8168 on a NP300E5C series laptop @@ -12423,6 +12527,7 @@ 1462 7522 X58 Pro-E 1462 7c37 X570-A PRO motherboard 1775 11cc CC11/CL11 + 17aa 3098 ThinkCentre E73 17aa 3814 Z50-75 17aa 3823 Lenovo V130-15IGM Laptop - Type 81HL 17aa 5124 ThinkPad E595 @@ -12430,6 +12535,7 @@ 7470 3468 TG-3468 Gigabit PCI Express Network Adapter 8086 2055 NUC Kit DN2820FYKH 8086 d615 Desktop Board D510MO/D525MW + ea50 ce19 mCOM10-L1900 8169 RTL8169 PCI Gigabit Ethernet Controller 1025 0079 Aspire 5024WLMi 10bd 3202 EP-320G-TX1 32-bit PCI Gigabit Ethernet Adapter @@ -12446,6 +12552,14 @@ 16ec 011f USR997903 1734 1091 D2030-A1 a0a0 0449 AK86-L motherboard + 816a RTL8111xP UART #1 + ea50 ce19 mCOM10-L1900 + 816b RTL8111xP UART #2 + ea50 ce19 mCOM10-L1900 + 816c RTL8111xP IPMI interface + ea50 ce19 mCOM10-L1900 + 816d RTL8111xP EHCI host controller + ea50 ce19 mCOM10-L1900 8171 RTL8191SEvA Wireless LAN Controller 8172 RTL8191SEvB Wireless LAN Controller 8173 RTL8192SE Wireless LAN Controller @@ -12483,6 +12597,7 @@ 17aa b023 ThinkPad E595 c821 RTL8821CE 802.11ac PCIe Wireless Network Adapter c822 RTL8822CE 802.11ac PCIe Wireless Network Adapter + c82f RTL8822CE 802.11ac PCIe Wireless Network Adapter d723 RTL8723DE 802.11b/g/n PCIe Adapter 10ed Ascii Corporation 7310 V7310 @@ -14000,6 +14115,8 @@ 1137 00ce VIC 1225T PCIe Management Controller 1137 012e VIC 1227 PCIe Management Controller 1137 014d VIC 1385 PCIe Management Controller + 1137 0217 VIC 1455 PCIe Management Controller + 1137 0218 VIC 1457 PCIe Management Controller 0043 VIC Ethernet NIC 1137 0047 VIC P81E PCIe Ethernet NIC 1137 0048 VIC M81KR Mezzanine Ethernet NIC @@ -14446,6 +14563,7 @@ 1172 Altera Corporation 00a7 Stratix V 0530 Stratix IV + 646c KT-500/KT-521 board 1173 Adobe Systems, Inc 1174 Bridgeport Machines 1175 Mitron Computer Inc. @@ -14456,6 +14574,7 @@ 1179 Toshiba Corporation 0102 Extended IDE Controller 0103 EX-IDE Type-B + 010e PXP04 NVMe SSD 010f NVMe Controller 0110 NVMe SSD Controller Cx5 1028 1ffb Express Flash NVMe 960G (RI) U.2 (CD5) @@ -14467,7 +14586,9 @@ 1d49 4039 Thinksystem U.2 CM5 NVMe SSD 1d49 403a Thinksystem AIC CM5 NVMe SSD 0113 BG3 NVMe SSD Controller + 1179 0001 Toshiba KBG30ZMS128G 128GB NVMe SSD 0115 XG4 NVMe SSD Controller + 011a XG6 NVMe SSD Controller 0404 DVD Decoder card 0406 Tecra Video Capture device 0407 DVD Decoder card (Version 2) @@ -14530,6 +14651,16 @@ 117c 00a2 Celerity FC-321E 117c 00a3 Celerity FC-322E 117c 00ac Celerity FC-324E + 00bb Celerity FC 32/64Gb/s Gen 7 Fibre Channel HBA + 117c 00bc Celerity FC-321P + 117c 00bd Celerity FC-322P + 117c 00be Celerity FC-324P + 00e6 ExpressSAS GT 12Gb/s SAS/SATA HBA + 117c 00c0 ExpressSAS H1280 GT + 117c 00c1 ExpressSAS H1208 GT + 117c 00c2 ExpressSAS H1244 GT + 117c 00c3 ExpressSAS H12F0 GT + 117c 00c4 ExpressSAS H120F GT 8013 ExpressPCI UL4D 8014 ExpressPCI UL4S 8027 ExpressPCI UL5D @@ -15748,6 +15879,12 @@ 125b Asix Electronics Corporation 1400 AX88141 Fast Ethernet Controller 1186 1100 AX8814X Based PCI Fast Ethernet Adapter + 9100 AX99100 PCIe to Multi I/O Controller + a000 1000 Serial Port + a000 2000 Parallel Port + a000 6000 SPI + a000 7000 Local Bus + ea50 1c10 RXi2-BP 125c Aurora Technologies, Inc. 0101 Saturn 4520P 0640 Aries 16000P @@ -15879,6 +16016,7 @@ 0820 SM820 Lynx3D 0910 SM910 2262 SM2262/SM2262EN SSD Controller + 2263 SM2263EN/SM2263XT SSD Controller 1270 Olympus Optical Co., Ltd. 1271 GW Instruments 1272 Telematics International @@ -16096,9 +16234,9 @@ 1281 Yokogawa Electric Corporation 1282 Davicom Semiconductor, Inc. 6585 DM562P V90 Modem - 9009 Ethernet 100/10 MBit + 9009 DM9009 Ethernet Controller 9100 21x4x DEC-Tulip compatible 10/100 Ethernet - 9102 21x4x DEC-Tulip compatible 10/100 Ethernet + 9102 DM9102 Fast Ethernet Controller # Subsystem ID is main ID reveresed. 0291 8212 DM9102A (DM9102AE, SM9102AF) Ethernet 100/10 MBit 9132 Ethernet 100/10 MBit @@ -16346,6 +16484,7 @@ 2304 PI7C9X2G304 EL/SL PCIe2 3-Port/4-Lane Packet Switch 2404 PI7C9X2G404 EL/SL PCIe2 4-Port/4-Lane Packet Switch 2608 PI7C9X2G608GP PCIe2 6-Port/8-Lane Packet Switch + ea50 cc10 RXi2-BP 400a PI7C9X442SL PCI Express Bridge Port 400e PI7C9X442SL USB OHCI Controller 400f PI7C9X442SL USB EHCI Controller @@ -16356,6 +16495,7 @@ 8150 PCI to PCI Bridge 8152 PI7C8152A/PI7C8152B/PI7C8152BI PCI-to-PCI Bridge 8154 PI7C8154A/PI7C8154B/PI7C8154BI PCI-to-PCI Bridge + 8619 PI7C9X2G1616PR PCIe2 16-Port/16-Lane Packet Switch e110 PI7C9X110 PCI Express to PCI bridge 1775 11cc CC11/CL11 CompactPCI Bridge e111 PI7C9X111SL PCIe-to-PCI Reversible Bridge @@ -16390,12 +16530,13 @@ 12ea Zuken 12eb Aureal Semiconductor 0001 Vortex 1 + 0000 0300 Terasound A3D PCI 104d 8036 AU8820 Vortex Digital Audio Processor 1092 2000 Sonic Impact A3D 1092 2100 Sonic Impact A3D 1092 2110 Sonic Impact A3D 1092 2200 Sonic Impact A3D - 122d 1002 AU8820 Vortex Digital Audio Processor + 122d 1002 SC 338-A3D 12eb 0001 AU8820 Vortex Digital Audio Processor 5053 3355 Montego 50b2 1111 XLerate @@ -16683,12 +16824,14 @@ 134f Algo System Co Ltd 1350 Systec Co. Ltd 1351 Sonix Inc -# nee Thales Idatys -1353 Vierling Communication SAS +# nee Vierling Communication SAS, nee Thales Idatys +1353 dbeeSet Technology 0002 Proserver 0003 PCI-FUT 0004 PCI-S0 0005 PCI-FUT-S0 + 0006 OTDU-1U (FPGA Zynq-7000) + 0007 OTDU-EX 1354 Dwave System Inc 1355 Kratos Analytical Ltd 1356 The Logical Co @@ -18193,9 +18336,12 @@ 144c Catalina Research Inc 144d Samsung Electronics Co Ltd 1600 Apple PCIe SSD + a544 Exynos 8890 PCIe Root Complex a800 XP941 PCIe SSD a802 NVMe SSD Controller SM951/PM951 - a804 NVMe SSD Controller SM961/PM961 + 144d a801 PM963 2.5" NVMe PCIe SSD + a804 NVMe SSD Controller SM961/PM961/SM963 + 144d a801 SM963 2.5" NVMe PCIe SSD a808 NVMe SSD Controller SM981/PM981/PM983 1d49 403b Thinksystem U.2 PM983 NVMe SSD a820 NVMe SSD Controller 171X @@ -18261,6 +18407,7 @@ 1028 2097 EMC PowerEdge Express Flash Ent NVMe AGN SED RI U.2 Gen4 1.92TB 1028 2098 EMC PowerEdge Express Flash Ent NVMe AGN SED RI U.2 Gen4 3.84TB 1028 2099 EMC PowerEdge Express Flash Ent NVMe AGN SED RI U.2 Gen4 7.68TB + ecec Exynos 8895 PCIe Root Complex 144e OLITEC 144f Askey Computer Corp. 1450 Octave Communications Ind. @@ -19012,6 +19159,12 @@ 14e4 5208 NetXtreme-E Dual-port 100G QSFP56 Ethernet OCP 3.0 Adapter (BCM957508-N2100G) 1751 BCM57504 NetXtreme-E 10Gb/25Gb/40Gb/50Gb/100Gb/200Gb Ethernet 1752 BCM57502 NetXtreme-E 10Gb/25Gb/40Gb/50Gb Ethernet + 1800 BCM57502 NetXtreme-E Ethernet Partition + 1801 BCM57504 NetXtreme-E Ethernet Partition + 1802 BCM57508 NetXtreme-E Ethernet Partition + 1803 BCM57502 NetXtreme-E RDMA Partition + 1804 BCM57504 NetXtreme-E RDMA Partition + 1805 BCM57508 NetXtreme-E RDMA Partition 1806 BCM5750X NetXtreme-E Ethernet Virtual Function 1807 BCM5750X NetXtreme-E RDMA Virtual Function 3352 BCM3352 @@ -19215,6 +19368,9 @@ 4410 BCM4413 iLine32 HomePNA 2.0 4411 BCM4413 V.90 56k modem 4412 BCM4412 10/100BaseT + 441f BCM4361 802.11ac Dual-Band Wireless Network Controller + 4420 BCM4361 802.11ac 2.4 GHz Wireless Network Controller + 4421 BCM4361 802.11ac 5 GHz Wireless Network Controller 4430 BCM44xx CardBus iLine32 HomePNA 2.0 4432 BCM4432 CardBus 10/100BaseT 4464 BCM4364 802.11ac Wireless Network Adapter @@ -19482,6 +19638,7 @@ 0070 6902 WinTV HVR-4000-HD 0070 7801 WinTV HVR-1800 MCE 0070 9001 Nova-T DVB-T + 0070 9002 Nova-T DVB-T Model 909 0070 9200 Nova-SE2 DVB-S 0070 9202 Nova-S-Plus DVB-S 0070 9402 WinTV-HVR1100 DVB-T/Hybrid @@ -19734,7 +19891,8 @@ 1526 ISS, Inc 1527 SOLECTRON 1528 ACKSYS -1529 AMERICAN MICROSystems Inc +# nee American Microsystems Inc +1529 ON Semiconductor 152a QUICKTURN DESIGN Systems 152b FLYTECH Technology CO Ltd 152c MACRAIGOR Systems LLC @@ -19803,7 +19961,12 @@ 1100 PCI Express Core Reference Design 110f PCI Express Core Reference Design Virtual Function 1110 XpressRich Reference Design + 1111 XpressRich-AXI Ref Design + 1112 QuickPCIe 1113 XpressSwitch + 1114 Inspector + 1115 XpressLINK Ref Design + 1116 XpressLINK-SOC Ref Design be00 PCI Express Bridge 1557 MEDIASTAR Co Ltd 1558 CLEVO/KAPOK Computer @@ -20183,8 +20346,16 @@ 15b7 Sandisk Corp 2001 Skyhawk Series NVME SSD 5001 WD Black NVMe SSD - 5002 WD Black 2018/PC SN720 NVMe SSD - 5003 WD Black 2018/PC SN520 NVMe SSD + 5002 WD Black 2018 / PC SN720 NVMe SSD + 5003 WD Blue SN500 / PC SN520 NVMe SSD + 5004 PC SN520 NVMe SSD + 5005 PC SN520 NVMe SSD + 5006 WD Black SN750 / PC SN730 NVMe SSD + 5009 WD Blue SN550 NVMe SSD + 15b7 5009 WD Blue SN550 NVMe SSD + 500b PC SN530 NVMe SSD + 1414 500b Xbox Series X + 500d WD Ultrastar DC SN340 NVMe SSD 15b8 ADDI-DATA GmbH 1001 APCI1516 SP controller (16 digi outputs) 1003 APCI1032 SP controller (32 digi inputs w/ opto coupler) @@ -20960,6 +21131,16 @@ 0142 PCA7208AS - Analog inputs/Outputs 0143 PCA7408AL - Analog Inputs/Outputs 0144 PCA7408AS - Analog Inputs/Outputs + 0145 PCA-7228AL Multifunction PCI IO card + 0146 PCA-7228AS Multifunction PCI IO card + 0147 PCA7428AL Multifunction PCI IO card + 0148 PCA7428AS Multifunction PCI IO card + 0149 PCA7228EL Multifunction PCI IO card with isolated analog inputs + 0150 PCA7428EL Multifunction PCI IO card with isolated analog inputs + 0151 PCA7628AL - PCI card with analog inputs, counters and DIO + 0152 PCA7628AS PCI card with analog inputs, outputs, counters and DIO + 0161 PCA7288A PCI card with analog outputs, counters and DIO + 0180 PCI1052 Communication card for MicroUnit network 0214 PCT-7424C (F0) PC card with standard counters 0215 PCT-7424C (F1) PC card with standard counters 0216 PCT-7424E (F0) PC card with standard counters @@ -21149,6 +21330,7 @@ 8083 GL880 USB 1.1 UHCI controller 8084 GL880 USB 2.0 EHCI controller 9750 GL9750 SD Host Controller + e763 GL9763E eMMC Controller 17aa Lenovo 402b Intel 82599ES 10Gb 2-port Server Adapter X520-2 17ab Phillips Components @@ -21659,6 +21841,8 @@ 0185 NT40A01 Network Adapter 01a5 NT200A01 Network Adapter 01c5 NT200A02 Network Adapter + 01d5 NT50B01 Network Adapter + 01e5 NT100A01 Network Adapter 18f6 NextIO 1000 [Nexsis] Switch Virtual P2P PCIe Bridge 1001 [Texsis] Switch Virtual P2P PCIe Bridge @@ -21936,7 +22120,7 @@ 0087 MPC8343 00b4 MPC8315E 00b6 MPC8314E - 1a56 1101 Killer Xeno Pro Gigabit Ethernet Controller + 1a56 1101 Bigfoot Killer Xeno Pro Gigabit Ethernet Controller 00c2 MPC8379E 00c3 MPC8379 00c4 MPC8378E @@ -21975,7 +22159,7 @@ 7011 MPC8641D PCI Host Bridge 7018 MPC8610 c006 MPC8308 - 1a56 1201 Killer E2100 Gigabit Ethernet Controller + 1a56 1201 Bigfoot Killer E2100 Gigabit Ethernet Controller # PCIe interface for emulator fc02 RedStone # CFI device over PCIe @@ -22045,12 +22229,15 @@ 1974 Star Electronics GmbH & Co. KG 0009 FlexCard PMC-II 0011 FlexCard PMC-II Ethernet + 0018 FlexCard PXIe3 + 0019 FlexCard PCIe3 1976 TRENDnet 1977 Parsec 197b JMicron Technology Corp. 0250 JMC250 PCI Express Gigabit Ethernet Controller 0260 JMC260 PCI Express Fast Ethernet Controller 0368 JMB368 IDE controller + 0585 JMB58x AHCI SATA controller 2360 JMB360 AHCI Controller 2361 JMB361 AHCI/IDE 1462 7235 P965 Neo MS-7235 mainboard @@ -22195,13 +22382,25 @@ 19e5 d303 Hi1822 SP522 (2*8G FC) 19e5 d306 Hi1822 SP523 (2*8G FC) 1710 iBMA Virtual Network Adapter - 1711 Hi1710 [iBMC Intelligent Management system chip w/VGA support] + 1711 Hi171x Series [iBMC Intelligent Management system chip w/VGA support] 1822 Hi1822 Family (4*25GE) 19e5 d129 Hi1822 SP570 (4*25GE) 19e5 d136 Hi1822 SP580 (4*25GE) 19e5 d141 Hi1822 SP583 (4*25GE) 19e5 d146 Hi1822 SP585 (4*25GE) + 3714 ES3000 V5 NVMe PCIe SSD + 19e5 5312 NVMe SSD ES3500P V5 2000GB 2.5" U.2 371e Hi1822 Family Virtual Bridge + 3754 ES3000 V6 NVMe PCIe SSD + 19e5 6122 NVMe SSD ES3600P V6 1600GB 2.5" U.2 + 19e5 6123 NVMe SSD ES3600P V6 3200GB 2.5" U.2 + 19e5 6124 NVMe SSD ES3600P V6 6400GB 2.5" U.2 + 19e5 6141 NVMe SSD ES3800P V6 800GB 2.5" U.2 + 19e5 6142 NVMe SSD ES3800P V6 1600GB 2.5" U.2 + 19e5 6212 NVMe SSD ES3500P V6 1920GB 2.5" U.2 + 19e5 6213 NVMe SSD ES3500P V6 3840GB 2.5" U.2 + 19e5 6214 NVMe SSD ES3500P V6 7680GB 2.5" U.2 + 19e5 6215 NVMe SSD ES3500P V6 15360GB 2.5" U.2 375e Hi1822 Family Virtual Function 379e Hi1822 Family Virtual Function a120 HiSilicon PCIe Root Port with Gen4 @@ -22259,6 +22458,7 @@ 0009 CAN interface PCI104 HS/HS 1a08 Sierra semiconductor 0000 SC15064 +1a0d SEAKR Engineering 1a0e DekTec Digital Video B.V. 083f DTA-2111 VHF/UHF Modulator 1a17 Force10 Networks, Inc. @@ -22295,13 +22495,17 @@ 1a4a SLAC National Accelerator Lab TID-AIR 1000 MCOR Power Supply Controller 1010 AMC EVR - Stockholm Timing Board - 1020 Cluster On Board (COB) Ethernet Switch + 1020 PGPCard - Gen3 Cameralink Interface + 1030 PGPCard - Gen3 GIGe Interface 2000 PGPCard - 4 Lane 2001 PGPCard - 8 Lane Plus EVR 2010 PCI-Express EVR -# PC-260-101-03 - 2020 PGP-GEN3 PCIe + 2011 PCI-Express EVR - TPR Version + 2020 PGP-GEN3 PCIe - 8 Lane Plus EVR 2030 AXI Stream DAQ PCIe card + 2040 EXO PCIe TEM + 3000 COB DTM V1 + 3001 COB DTM V2 1a51 Hectronic AB 1a55 Rohde & Schwarz DVS GmbH 0010 SDStationOEM @@ -22320,7 +22524,8 @@ 0065 Atomix HDMI STAN 0070 RED Rocket 0090 CinePlay -1a56 Bigfoot Networks, Inc. +# nee Bigfoot Networks, now owned by Intel +1a56 Rivet Networks 1a57 Highly Reliable Systems 1a58 Razer USA Ltd. 1a5d Celoxica @@ -22383,10 +22588,58 @@ 1ae7 First Wise Media GmbH 0520 HFC-S PCI A [X-TENSIONS XC-520] 1ae8 Silicon Software GmbH - 0a40 microEnable IV-BASE x1 - 0a41 microEnable IV-FULL x1 - 0a44 microEnable IV-FULL x4 - 0e44 microEnable IV-GigE x4 +# CameraLink frame grabber for Visual Applets + 0751 mE5 marathon VCL +# CameraLink HS frame grabber + 0752 mE5 marathon AF2 +# CoaXpress frame grabber *** 1052 LINES SKIPPED *** From owner-dev-commits-src-main@freebsd.org Sat Dec 26 15:52:28 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 608724BC8A6; Sat, 26 Dec 2020 15:52:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D37c619dqz3v11; Sat, 26 Dec 2020 15:52:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 25D261790E; Sat, 26 Dec 2020 15:52:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BQFqK2M082410; Sat, 26 Dec 2020 15:52:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BQFqKNH082409; Sat, 26 Dec 2020 15:52:20 GMT (envelope-from git) Date: Sat, 26 Dec 2020 15:52:20 GMT Message-Id: <202012261552.0BQFqKNH082409@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ulrich Spörlein Subject: git: 8d405efd73d3 - Fix newvers.sh to no longer print an outdated SVN rev MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: uqs X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8d405efd73d3991fe1647f91a2b7c9989dd5f18f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Dec 2020 15:52:28 -0000 The branch main has been updated by uqs: URL: https://cgit.FreeBSD.org/src/commit/?id=8d405efd73d3991fe1647f91a2b7c9989dd5f18f commit 8d405efd73d3991fe1647f91a2b7c9989dd5f18f Author: Ulrich Spörlein AuthorDate: 2020-12-23 21:29:34 +0000 Commit: Ulrich Spörlein CommitDate: 2020-12-26 15:47:43 +0000 Fix newvers.sh to no longer print an outdated SVN rev We have stopped using SVN, so the notes containing the old SVN revisions are no longer populated, so fall back to purely counting the number of commits (currently at about 255337). Also turn the format more into what git-describe produces, with a name first, then the number of commits and the hash last. Note that as we don't tag anything on `main`, git describe will never produce something useful there and finds the newest vendor tag that was merged in instead. Sample output: FreeBSD 13.0-CURRENT #6 main-c255126-gb81783dc98e6-dirty FreeBSD 12.2-STABLE #0 stable/12-c243035-gd16dac42b641-dirty MFC after: 3 weeks Reviewed by: imp, glebius Differential Revision: https://reviews.freebsd.org/D27751 --- sys/conf/newvers.sh | 31 ++++--------------------------- 1 file changed, 4 insertions(+), 27 deletions(-) diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index 5ce93567e3af..b8667844210b 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -248,42 +248,19 @@ fi if [ -n "$git_cmd" ] ; then git=$($git_cmd rev-parse --verify --short HEAD 2>/dev/null) - gitsvn=$($git_cmd svn find-rev $git 2>/dev/null) - if [ -n "$gitsvn" ] ; then - svn=" r${gitsvn}" - git="=${git}" - else -# Log searches are limited to 10k commits to speed up failures. -# We assume that if a tree is more than 10k commits out-of-sync -# with FreeBSD, it has forked the the OS and the SVN rev no -# longer matters. - gitsvn=$($git_cmd log -n 10000 | - grep '^ git-svn-id:' | head -1 | \ - sed -n 's/^.*@\([0-9][0-9]*\).*$/\1/p') - if [ -z "$gitsvn" ] ; then - gitsvn=$($git_cmd log -n 10000 --format='format:%N' | \ - grep '^svn ' | head -1 | \ - sed -n 's/^.*revision=\([0-9][0-9]*\).*$/\1/p') - fi - if [ -n "$gitsvn" ] ; then - svn=" r${gitsvn}" - git="+${git}" - else - git=" ${git}" - fi - fi git_cnt=$($git_cmd rev-list --count HEAD 2>/dev/null) if [ -n "$git_cnt" ] ; then - git="${git}-c${git_cnt}" + git="c${git_cnt}-g${git}" fi git_b=$($git_cmd rev-parse --abbrev-ref HEAD) - if [ -n "$git_b" ] ; then - git="${git}(${git_b})" + if [ -n "$git_b" -a "$git_b" != "HEAD" ] ; then + git="${git_b}-${git}" fi if git_tree_modified; then git="${git}-dirty" modified=yes fi + git=" ${git}" fi if [ -n "$hg_cmd" ] ; then From owner-dev-commits-src-main@freebsd.org Sat Dec 26 16:48:11 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E511D4BD7E5; Sat, 26 Dec 2020 16:48:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D38rW6995z4S5X; Sat, 26 Dec 2020 16:48:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C21E118493; Sat, 26 Dec 2020 16:48:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BQGmBiD036126; Sat, 26 Dec 2020 16:48:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BQGmB3Z036125; Sat, 26 Dec 2020 16:48:11 GMT (envelope-from git) Date: Sat, 26 Dec 2020 16:48:11 GMT Message-Id: <202012261648.0BQGmB3Z036125@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 9bc6c7219a37 - gprof: Retire a.out support MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9bc6c7219a376f905f2ecd1f7fbfb42d17b93b49 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Dec 2020 16:48:12 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=9bc6c7219a376f905f2ecd1f7fbfb42d17b93b49 commit 9bc6c7219a376f905f2ecd1f7fbfb42d17b93b49 Author: Ed Maste AuthorDate: 2020-12-26 16:43:44 +0000 Commit: Ed Maste CommitDate: 2020-12-26 16:47:47 +0000 gprof: Retire a.out support FreeBSD has used ELF binaries/libraries for decades, but still has some support for legacy a.out binaries. Portions of this have been retired over time, but support remained in ldd, ldconfig, and gprof. Retire gprof support; if anyone needs to do development on a.out binaries still they will be best served by installing a full FreeBSD 2.x or other obsolete version in a jail. Kernel support for executing a.out binaries is unchnaged. Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D27480 --- usr.bin/gprof/Makefile | 4 - usr.bin/gprof/aout.c | 231 ------------------------------------------------- usr.bin/gprof/gprof.c | 6 +- usr.bin/gprof/gprof.h | 4 - 4 files changed, 1 insertion(+), 244 deletions(-) diff --git a/usr.bin/gprof/Makefile b/usr.bin/gprof/Makefile index d98475f174a8..1b540355cd45 100644 --- a/usr.bin/gprof/Makefile +++ b/usr.bin/gprof/Makefile @@ -5,10 +5,6 @@ PROG= gprof SRCS= gprof.c arcs.c dfn.c elf.c lookup.c hertz.c \ printgprof.c printlist.c kernel.c -.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" -SRCS+= aout.c -CFLAGS+= -DWITH_AOUT -.endif FILES= gprof.flat gprof.callg FILESDIR= ${SHAREDIR}/misc diff --git a/usr.bin/gprof/aout.c b/usr.bin/gprof/aout.c deleted file mode 100644 index 752c67280d2d..000000000000 --- a/usr.bin/gprof/aout.c +++ /dev/null @@ -1,231 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-3-Clause - * - * Copyright (c) 1983, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#if 0 -/* From: */ -#ifndef lint -static char sccsid[] = "@(#)gprof.c 8.1 (Berkeley) 6/6/93"; -#endif /* not lint */ -#endif - -#include -__FBSDID("$FreeBSD$"); - -#include - -#include -#include -#include - -#include "gprof.h" - -static void getstrtab(FILE *, const char *); -static void getsymtab(FILE *, const char *); -static void gettextspace(FILE *); -static bool funcsymbol(struct nlist *); - -static char *strtab; /* string table in core */ -static long ssiz; /* size of the string table */ -static struct exec xbuf; /* exec header of a.out */ - -/* Things which get -E excluded by default. */ -static char *excludes[] = { "mcount", "__mcleanup", NULL }; - - /* - * Set up string and symbol tables from a.out. - * and optionally the text space. - * On return symbol table is sorted by value. - * - * Returns 0 on success, -1 on failure. - */ -int -aout_getnfile(const char *filename, char ***defaultEs) -{ - FILE *nfile; - - nfile = fopen( filename ,"r"); - if (nfile == NULL) - err( 1 , "%s", filename ); - fread(&xbuf, 1, sizeof(xbuf), nfile); - if (N_BADMAG(xbuf)) { - fclose(nfile); - return -1; - } - getstrtab(nfile, filename); - getsymtab(nfile, filename); - gettextspace( nfile ); - fclose(nfile); -# ifdef DEBUG - if ( debug & AOUTDEBUG ) { - register int j; - - for (j = 0; j < nname; j++){ - printf("[getnfile] 0X%08lx\t%s\n", nl[j].value, nl[j].name); - } - } -# endif /* DEBUG */ - *defaultEs = excludes; - return 0; -} - -static void -getstrtab(FILE *nfile, const char *filename) -{ - - fseek(nfile, (long)(N_SYMOFF(xbuf) + xbuf.a_syms), 0); - if (fread(&ssiz, sizeof (ssiz), 1, nfile) == 0) - errx( 1 , "%s: no string table (old format?)" , filename ); - strtab = calloc(ssiz, 1); - if (strtab == NULL) - errx( 1 , "%s: no room for %ld bytes of string table", filename , ssiz); - if (fread(strtab+sizeof(ssiz), ssiz-sizeof(ssiz), 1, nfile) != 1) - errx( 1 , "%s: error reading string table" , filename ); -} - - /* - * Read in symbol table - */ -static void -getsymtab(FILE *nfile, const char *filename) -{ - register long i; - int askfor; - struct nlist nbuf; - - /* pass1 - count symbols */ - fseek(nfile, (long)N_SYMOFF(xbuf), 0); - nname = 0; - for (i = xbuf.a_syms; i > 0; i -= sizeof(struct nlist)) { - fread(&nbuf, sizeof(nbuf), 1, nfile); - if ( ! funcsymbol( &nbuf ) ) { - continue; - } - nname++; - } - if (nname == 0) - errx( 1 , "%s: no symbols" , filename ); - askfor = nname + 1; - nl = (nltype *) calloc( askfor , sizeof(nltype) ); - if (nl == NULL) - errx( 1 , "no room for %zu bytes of symbol table" , - askfor * sizeof(nltype) ); - - /* pass2 - read symbols */ - fseek(nfile, (long)N_SYMOFF(xbuf), 0); - npe = nl; - nname = 0; - for (i = xbuf.a_syms; i > 0; i -= sizeof(struct nlist)) { - fread(&nbuf, sizeof(nbuf), 1, nfile); - if ( ! funcsymbol( &nbuf ) ) { -# ifdef DEBUG - if ( debug & AOUTDEBUG ) { - printf( "[getsymtab] rejecting: 0x%x %s\n" , - nbuf.n_type , strtab + nbuf.n_un.n_strx ); - } -# endif /* DEBUG */ - continue; - } - npe->value = nbuf.n_value; - npe->name = strtab+nbuf.n_un.n_strx; -# ifdef DEBUG - if ( debug & AOUTDEBUG ) { - printf( "[getsymtab] %d %s 0x%08lx\n" , - nname , npe -> name , npe -> value ); - } -# endif /* DEBUG */ - npe++; - nname++; - } - npe->value = -1; -} - - /* - * read in the text space of an a.out file - */ -static void -gettextspace(FILE *nfile) -{ - - textspace = (u_char *) malloc( xbuf.a_text ); - if ( textspace == NULL ) { - warnx("no room for %u bytes of text space: can't do -c" , - xbuf.a_text ); - return; - } - (void) fseek( nfile , N_TXTOFF( xbuf ) , 0 ); - if ( fread( textspace , 1 , xbuf.a_text , nfile ) != xbuf.a_text ) { - warnx("couldn't read text space: can't do -c"); - free( textspace ); - textspace = 0; - return; - } -} - -static bool -funcsymbol(struct nlist *nlistp) -{ - char *name, c; - - /* - * must be a text symbol, - * and static text symbols don't qualify if aflag set. - */ - if ( ! ( ( nlistp -> n_type == ( N_TEXT | N_EXT ) ) - || ( ( nlistp -> n_type == N_TEXT ) && ( aflag == 0 ) ) ) ) { - return FALSE; - } - /* - * name must start with an underscore if uflag is set. - * can't have any `funny' characters in name, - * where `funny' means `.' (.o file names) - * need to make an exception for sparc .mul & co. - * perhaps we should just drop this code entirely... - */ - name = strtab + nlistp -> n_un.n_strx; - if ( uflag && *name != '_' ) - return FALSE; -#ifdef sparc - if ( *name == '.' ) { - char *p = name + 1; - if ( *p == 'u' ) - p++; - if ( strcmp ( p, "mul" ) == 0 || strcmp ( p, "div" ) == 0 || - strcmp ( p, "rem" ) == 0 ) - return TRUE; - } -#endif - while ( (c = *name++) ) { - if ( c == '.' ) { - return FALSE; - } - } - return TRUE; -} diff --git a/usr.bin/gprof/gprof.c b/usr.bin/gprof/gprof.c index 8e1b0709229a..2723eb2d8178 100644 --- a/usr.bin/gprof/gprof.c +++ b/usr.bin/gprof/gprof.c @@ -161,11 +161,7 @@ main(int argc, char **argv) * get information from the executable file. */ if ((Kflag && kernel_getnfile(a_outname, &defaultEs) == -1) || - (!Kflag && elf_getnfile(a_outname, &defaultEs) == -1 -#ifdef WITH_AOUT - && aout_getnfile(a_outname, &defaultEs) == -1 -#endif - )) + (!Kflag && elf_getnfile(a_outname, &defaultEs) == -1)) errx(1, "%s: bad format", a_outname); /* * sort symbol table. diff --git a/usr.bin/gprof/gprof.h b/usr.bin/gprof/gprof.h index fd27f3a46d93..d13d4eb04455 100644 --- a/usr.bin/gprof/gprof.h +++ b/usr.bin/gprof/gprof.h @@ -253,9 +253,6 @@ void addarc(nltype *, nltype *, long); bool addcycle(arctype **, arctype **); void addlist(struct stringlist *, char *); void alignentries(void); -#ifdef WITH_AOUT -int aout_getnfile(const char *, char ***); -#endif int arccmp(arctype *, arctype *); arctype *arclookup(nltype *, nltype *); void asgnsamples(void); @@ -322,7 +319,6 @@ int totalcmp(const void *, const void *); #define TALLYDEBUG 8 #define TIMEDEBUG 16 #define SAMPLEDEBUG 32 -#define AOUTDEBUG 64 #define CALLDEBUG 128 #define LOOKUPDEBUG 256 #define PROPDEBUG 512 From owner-dev-commits-src-main@freebsd.org Sat Dec 26 18:27:15 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A23584C005D; Sat, 26 Dec 2020 18:27:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D3C2q48kRz4YbD; Sat, 26 Dec 2020 18:27:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7CE50197C6; Sat, 26 Dec 2020 18:27:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BQIRFuY043705; Sat, 26 Dec 2020 18:27:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BQIRFk4043704; Sat, 26 Dec 2020 18:27:15 GMT (envelope-from git) Date: Sat, 26 Dec 2020 18:27:15 GMT Message-Id: <202012261827.0BQIRFk4043704@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michal Meloun Subject: git: b9cbd68d1cbb - ARM: Enhance common Nvidia Tegra drivers by support for Tegra210 SoC. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mmel X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b9cbd68d1cbbb21eade18182a797d5fa7d0dc110 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Dec 2020 18:27:15 -0000 The branch main has been updated by mmel: URL: https://cgit.FreeBSD.org/src/commit/?id=b9cbd68d1cbbb21eade18182a797d5fa7d0dc110 commit b9cbd68d1cbbb21eade18182a797d5fa7d0dc110 Author: Michal Meloun AuthorDate: 2018-01-04 11:50:12 +0000 Commit: Michal Meloun CommitDate: 2020-12-26 18:13:10 +0000 ARM: Enhance common Nvidia Tegra drivers by support for Tegra210 SoC. MFC after: 4 weeks --- sys/arm/nvidia/tegra_abpmisc.c | 1 + sys/arm/nvidia/tegra_ahci.c | 431 ++-- sys/arm/nvidia/tegra_efuse.c | 226 +- sys/arm/nvidia/tegra_ehci.c | 2 + sys/arm/nvidia/tegra_gpio.c | 1 + sys/arm/nvidia/tegra_i2c.c | 2 +- sys/arm/nvidia/tegra_lic.c | 3 +- sys/arm/nvidia/tegra_mc.c | 7 +- sys/arm/nvidia/tegra_pcie.c | 258 +-- sys/arm/nvidia/tegra_pmc.h | 16 +- sys/arm/nvidia/tegra_sdhci.c | 42 +- sys/arm/nvidia/tegra_soctherm.c | 328 ++- sys/arm/nvidia/tegra_uart.c | 5 +- sys/arm/nvidia/tegra_usbphy.c | 2 +- sys/arm/nvidia/tegra_xhci.c | 299 ++- sys/contrib/dev/nvidia/tegra210_xusb.bin.uu | 2950 +++++++++++++++++++++++++++ sys/modules/dtb/nvidia/Makefile | 10 +- 17 files changed, 4013 insertions(+), 570 deletions(-) diff --git a/sys/arm/nvidia/tegra_abpmisc.c b/sys/arm/nvidia/tegra_abpmisc.c index 0841af27f247..8a8e39862ca3 100644 --- a/sys/arm/nvidia/tegra_abpmisc.c +++ b/sys/arm/nvidia/tegra_abpmisc.c @@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$"); static struct ofw_compat_data compat_data[] = { {"nvidia,tegra124-apbmisc", 1}, + {"nvidia,tegra210-apbmisc", 1}, {NULL, 0} }; diff --git a/sys/arm/nvidia/tegra_ahci.c b/sys/arm/nvidia/tegra_ahci.c index ceb2c9faadfc..725fc999a3a3 100644 --- a/sys/arm/nvidia/tegra_ahci.c +++ b/sys/arm/nvidia/tegra_ahci.c @@ -57,54 +57,14 @@ __FBSDID("$FreeBSD$"); #include #include -#define AHCI_WR4(_sc, _r, _v) bus_write_4((_sc)->ctlr.r_mem, (_r), (_v)) -#define AHCI_RD4(_sc, _r) bus_read_4((_sc)->ctlr.r_mem, (_r)) -#define SATA_WR4(_sc, _r, _v) bus_write_4((_sc)->sata_mem, (_r), (_v)) -#define SATA_RD4(_sc, _r) bus_read_4((_sc)->sata_mem, (_r)) - -static struct ofw_compat_data compat_data[] = { - {"nvidia,tegra124-ahci", 1}, - {NULL, 0} -}; - -struct tegra_ahci_sc { - struct ahci_controller ctlr; /* Must be first */ - device_t dev; - struct resource *sata_mem; - clk_t clk_sata; - clk_t clk_sata_oob; - clk_t clk_pll_e; - clk_t clk_cml; - hwreset_t hwreset_sata; - hwreset_t hwreset_sata_oob; - hwreset_t hwreset_sata_cold; - regulator_t supply_hvdd; - regulator_t supply_vddio; - regulator_t supply_avdd; - regulator_t supply_target_5v; - regulator_t supply_target_12v; - phy_t phy; -}; - -struct sata_pad_calibration { - uint32_t gen1_tx_amp; - uint32_t gen1_tx_peak; - uint32_t gen2_tx_amp; - uint32_t gen2_tx_peak; -}; - -static const struct sata_pad_calibration tegra124_pad_calibration[] = { - {0x18, 0x04, 0x18, 0x0a}, - {0x0e, 0x04, 0x14, 0x0a}, - {0x0e, 0x07, 0x1a, 0x0e}, - {0x14, 0x0e, 0x1a, 0x0e}, -}; #define SATA_CONFIGURATION 0x180 -#define SATA_CONFIGURATION_EN_FPCI (1 << 0) +#define SATA_CONFIGURATION_CLK_OVERRIDE (1U << 31) +#define SATA_CONFIGURATION_EN_FPCI (1 << 0) #define SATA_FPCI_BAR5 0x94 -#define SATA_FPCI_BAR5_START_SHIFT 4 +#define SATA_FPCI_BAR_START(x) (((x) & 0xFFFFFFF) << 4) +#define SATA_FPCI_BAR_ACCESS_TYPE (1 << 0) #define SATA_INTR_MASK 0x188 #define SATA_INTR_MASK_IP_INT_MASK (1 << 16) @@ -120,8 +80,46 @@ static const struct sata_pad_calibration tegra124_pad_calibration[] = { #define T_SATA0_CFG_9 0x24 #define T_SATA0_CFG_9_BASE_ADDRESS_SHIFT 13 +#define T_SATA0_CFG_35 0x94 +#define T_SATA0_CFG_35_IDP_INDEX_MASK (0x7ff << 2) +#define T_SATA0_CFG_35_IDP_INDEX (0x2a << 2) + +#define T_SATA0_AHCI_IDP1 0x98 +#define T_SATA0_AHCI_IDP1_DATA 0x400040 + +#define T_SATA0_CFG_PHY_1 0x12c +#define T_SATA0_CFG_PHY_1_PADS_IDDQ_EN (1 << 23) +#define T_SATA0_CFG_PHY_1_PAD_PLL_IDDQ_EN (1 << 22) + +#define T_SATA0_NVOOB 0x114 +#define T_SATA0_NVOOB_SQUELCH_FILTER_LENGTH_MASK (0x3 << 26) +#define T_SATA0_NVOOB_SQUELCH_FILTER_LENGTH (0x3 << 26) +#define T_SATA0_NVOOB_SQUELCH_FILTER_MODE_MASK (0x3 << 24) +#define T_SATA0_NVOOB_SQUELCH_FILTER_MODE (0x1 << 24) +#define T_SATA0_NVOOB_COMMA_CNT_MASK (0xff << 16) +#define T_SATA0_NVOOB_COMMA_CNT (0x07 << 16) + +#define T_SATA0_CFG_PHY 0x120 +#define T_SATA0_CFG_PHY_MASK_SQUELCH (1 << 24) +#define T_SATA0_CFG_PHY_USE_7BIT_ALIGN_DET_FOR_SPD (1 << 11) + +#define T_SATA0_CFG2NVOOB_2 0x134 +#define T_SATA0_CFG2NVOOB_2_COMWAKE_IDLE_CNT_LOW_MASK (0x1ff << 18) +#define T_SATA0_CFG2NVOOB_2_COMWAKE_IDLE_CNT_LOW (0xc << 18) + #define T_SATA0_AHCI_HBA_CAP_BKDR 0x300 +#define T_SATA0_AHCI_HBA_CAP_BKDR_SNCQ (1 << 30) +#define T_SATA0_AHCI_HBA_CAP_BKDR_SUPP_PM (1 << 17) +#define T_SATA0_AHCI_HBA_CAP_BKDR_SALP (1 << 26) +#define T_SATA0_AHCI_HBA_CAP_BKDR_SLUMBER_ST_CAP (1 << 14) +#define T_SATA0_AHCI_HBA_CAP_BKDR_PARTIAL_ST_CAP (1 << 13) + #define T_SATA0_BKDOOR_CC 0x4a4 +#define T_SATA0_BKDOOR_CC_CLASS_CODE_MASK (0xffff << 16) +#define T_SATA0_BKDOOR_CC_CLASS_CODE (0x0106 << 16) +#define T_SATA0_BKDOOR_CC_PROG_IF_MASK (0xff << 8) +#define T_SATA0_BKDOOR_CC_PROG_IF (0x01 << 8) + #define T_SATA0_CFG_SATA 0x54c #define T_SATA0_CFG_SATA_BACKDOOR_PROG_IF_EN (1 << 12) @@ -146,6 +144,11 @@ static const struct sata_pad_calibration tegra124_pad_calibration[] = { #define T_SATA0_CHX_PHY_CTRL11 0x6d0 #define T_SATA0_CHX_PHY_CTRL11_GEN2_RX_EQ (0x2800 << 16) +#define T_SATA0_CHX_PHY_CTRL17 0x6e8 +#define T_SATA0_CHX_PHY_CTRL18 0x6ec +#define T_SATA0_CHX_PHY_CTRL20 0x6f4 +#define T_SATA0_CHX_PHY_CTRL21 0x6f8 + #define FUSE_SATA_CALIB 0x124 #define FUSE_SATA_CALIB_MASK 0x3 @@ -197,42 +200,109 @@ static const struct sata_pad_calibration tegra124_pad_calibration[] = { #define T_AHCI_PORT_BKDR_COLD_PRSN_DET (1 << 1) #define T_AHCI_PORT_BKDR_EXT_SATA_SUPP (1 << 0) +/* AUX registers */ +#define SATA_AUX_MISC_CNTL_1 0x008 +#define SATA_AUX_MISC_CNTL_1_DEVSLP_OVERRIDE (1 << 17) +#define SATA_AUX_MISC_CNTL_1_SDS_SUPPORT (1 << 13) +#define SATA_AUX_MISC_CNTL_1_DESO_SUPPORT (1 << 15) + +#define AHCI_WR4(_sc, _r, _v) bus_write_4((_sc)->ctlr.r_mem, (_r), (_v)) +#define AHCI_RD4(_sc, _r) bus_read_4((_sc)->ctlr.r_mem, (_r)) +#define SATA_WR4(_sc, _r, _v) bus_write_4((_sc)->sata_mem, (_r), (_v)) +#define SATA_RD4(_sc, _r) bus_read_4((_sc)->sata_mem, (_r)) + +struct sata_pad_calibration { + uint32_t gen1_tx_amp; + uint32_t gen1_tx_peak; + uint32_t gen2_tx_amp; + uint32_t gen2_tx_peak; +}; + +static const struct sata_pad_calibration tegra124_pad_calibration[] = { + {0x18, 0x04, 0x18, 0x0a}, + {0x0e, 0x04, 0x14, 0x0a}, + {0x0e, 0x07, 0x1a, 0x0e}, + {0x14, 0x0e, 0x1a, 0x0e}, +}; + +struct ahci_soc; +struct tegra_ahci_sc { + struct ahci_controller ctlr; /* Must be first */ + device_t dev; + struct ahci_soc *soc; + struct resource *sata_mem; + struct resource *aux_mem; + clk_t clk_sata; + clk_t clk_sata_oob; + clk_t clk_pll_e; + clk_t clk_cml; + hwreset_t hwreset_sata; + hwreset_t hwreset_sata_oob; + hwreset_t hwreset_sata_cold; + regulator_t regulators[16]; /* Safe maximum */ + phy_t phy; +}; + +struct ahci_soc { + char **regulator_names; + int (*init)(struct tegra_ahci_sc *sc); +}; + +/* Tegra 124 config. */ +static char *tegra124_reg_names[] = { + "hvdd-supply", + "vddio-supply", + "avdd-supply", + "target-5v-supply", + "target-12v-supply", + NULL +}; + +static int tegra124_ahci_init(struct tegra_ahci_sc *sc); +static struct ahci_soc tegra124_soc = { + .regulator_names = tegra124_reg_names, + .init = tegra124_ahci_init, +}; + +/* Tegra 210 config. */ +static char *tegra210_reg_names[] = { + NULL +}; + +static struct ahci_soc tegra210_soc = { + .regulator_names = tegra210_reg_names, +}; + + +static struct ofw_compat_data compat_data[] = { + {"nvidia,tegra124-ahci", (uintptr_t)&tegra124_soc}, + {"nvidia,tegra210-ahci", (uintptr_t)&tegra210_soc}, + {NULL, 0} +}; + static int get_fdt_resources(struct tegra_ahci_sc *sc, phandle_t node) { - int rv; - - rv = regulator_get_by_ofw_property(sc->dev, 0, "hvdd-supply", - &sc->supply_hvdd ); - if (rv != 0) { - device_printf(sc->dev, "Cannot get 'hvdd' regulator\n"); - return (ENXIO); - } - rv = regulator_get_by_ofw_property(sc->dev, 0, "vddio-supply", - &sc->supply_vddio); - if (rv != 0) { - device_printf(sc->dev, "Cannot get 'vddio' regulator\n"); - return (ENXIO); - } - rv = regulator_get_by_ofw_property(sc->dev, 0, "avdd-supply", - &sc->supply_avdd); - if (rv != 0) { - device_printf(sc->dev, "Cannot get 'avdd' regulator\n"); - return (ENXIO); - } - rv = regulator_get_by_ofw_property(sc->dev, 0, "target-5v-supply", - &sc->supply_target_5v); - if (rv != 0) { - device_printf(sc->dev, "Cannot get 'target-5v' regulator\n"); - return (ENXIO); - } - rv = regulator_get_by_ofw_property(sc->dev, 0, "target-12v-supply", - &sc->supply_target_12v); - if (rv != 0) { - device_printf(sc->dev, "Cannot get 'target-12v' regulator\n"); - return (ENXIO); - } - + int i, rv; + + /* Regulators. */ + for (i = 0; sc->soc->regulator_names[i] != NULL; i++) { + if (i >= nitems(sc->regulators)) { + device_printf(sc->dev, + "Too many regulators present in DT.\n"); + return (EOVERFLOW); + } + rv = regulator_get_by_ofw_property(sc->dev, 0, + sc->soc->regulator_names[i], sc->regulators + i); + if (rv != 0) { + device_printf(sc->dev, + "Cannot get '%s' regulator\n", + sc->soc->regulator_names[i]); + return (ENXIO); + } + } + + /* Resets. */ rv = hwreset_get_by_ofw_name(sc->dev, 0, "sata", &sc->hwreset_sata ); if (rv != 0) { device_printf(sc->dev, "Cannot get 'sata' reset\n"); @@ -251,12 +321,17 @@ get_fdt_resources(struct tegra_ahci_sc *sc, phandle_t node) return (ENXIO); } + /* Phy */ rv = phy_get_by_ofw_name(sc->dev, 0, "sata-0", &sc->phy); if (rv != 0) { - device_printf(sc->dev, "Cannot get 'sata' phy\n"); - return (ENXIO); + rv = phy_get_by_ofw_idx(sc->dev, 0, 0, &sc->phy); + if (rv != 0) { + device_printf(sc->dev, "Cannot get 'sata' phy\n"); + return (ENXIO); + } } + /* Clocks. */ rv = clk_get_by_ofw_name(sc->dev, 0, "sata", &sc->clk_sata); if (rv != 0) { device_printf(sc->dev, "Cannot get 'sata' clock\n"); @@ -267,50 +342,33 @@ get_fdt_resources(struct tegra_ahci_sc *sc, phandle_t node) device_printf(sc->dev, "Cannot get 'sata oob' clock\n"); return (ENXIO); } + /* These are optional */ rv = clk_get_by_ofw_name(sc->dev, 0, "cml1", &sc->clk_cml); - if (rv != 0) { - device_printf(sc->dev, "Cannot get 'cml1' clock\n"); - return (ENXIO); - } + if (rv != 0) + sc->clk_cml = NULL; + rv = clk_get_by_ofw_name(sc->dev, 0, "pll_e", &sc->clk_pll_e); - if (rv != 0) { - device_printf(sc->dev, "Cannot get 'pll_e' clock\n"); - return (ENXIO); - } + if (rv != 0) + sc->clk_pll_e = NULL; return (0); } static int enable_fdt_resources(struct tegra_ahci_sc *sc) { - int rv; + int i, rv; - rv = regulator_enable(sc->supply_hvdd); - if (rv != 0) { - device_printf(sc->dev, "Cannot enable 'hvdd' regulator\n"); - return (rv); - } - rv = regulator_enable(sc->supply_vddio); - if (rv != 0) { - device_printf(sc->dev, "Cannot enable 'vddio' regulator\n"); - return (rv); - } - rv = regulator_enable(sc->supply_avdd); - if (rv != 0) { - device_printf(sc->dev, "Cannot enable 'avdd' regulator\n"); - return (rv); - } - rv = regulator_enable(sc->supply_target_5v); - if (rv != 0) { - device_printf(sc->dev, - "Cannot enable 'target-5v' regulator\n"); - return (rv); - } - rv = regulator_enable(sc->supply_target_12v); - if (rv != 0) { - device_printf(sc->dev, - "Cannot enable 'sc->target-12v' regulator\n"); - return (rv); + /* Enable regulators. */ + for (i = 0; i < nitems(sc->regulators); i++) { + if (sc->regulators[i] == NULL) + continue; + rv = regulator_enable(sc->regulators[i]); + if (rv != 0) { + device_printf(sc->dev, + "Cannot enable '%s' regulator\n", + sc->soc->regulator_names[i]); + return (rv); + } } /* Stop clocks */ @@ -346,15 +404,19 @@ enable_fdt_resources(struct tegra_ahci_sc *sc) device_printf(sc->dev, "Cannot enable 'sata oob' clock\n"); return (rv); } - rv = clk_enable(sc->clk_cml); - if (rv != 0) { - device_printf(sc->dev, "Cannot enable 'cml' clock\n"); - return (rv); + if (sc->clk_cml != NULL) { + rv = clk_enable(sc->clk_cml); + if (rv != 0) { + device_printf(sc->dev, "Cannot enable 'cml' clock\n"); + return (rv); + } } - rv = clk_enable(sc->clk_pll_e); - if (rv != 0) { - device_printf(sc->dev, "Cannot enable 'pll e' clock\n"); - return (rv); + if (sc->clk_pll_e != NULL) { + rv = clk_enable(sc->clk_pll_e); + if (rv != 0) { + device_printf(sc->dev, "Cannot enable 'pll e' clock\n"); + return (rv); + } } rv = hwreset_deassert(sc->hwreset_sata_cold); @@ -378,15 +440,11 @@ enable_fdt_resources(struct tegra_ahci_sc *sc) } static int -tegra_ahci_ctrl_init(struct tegra_ahci_sc *sc) +tegra124_ahci_init(struct tegra_ahci_sc *sc) { uint32_t val; const struct sata_pad_calibration *calib; - val = SATA_RD4(sc, SATA_CONFIGURATION); - val |= SATA_CONFIGURATION_EN_FPCI; - SATA_WR4(sc, SATA_CONFIGURATION, val); - /* Pad calibration. */ val = tegra_fuse_read_4(FUSE_SATA_CALIB); calib = tegra124_pad_calibration + (val & FUSE_SATA_CALIB_MASK); @@ -418,17 +476,118 @@ tegra_ahci_ctrl_init(struct tegra_ahci_sc *sc) SATA_WR4(sc, SCFG_OFFSET + T_SATA0_INDEX, 0); - /* Set device ID. */ + return (0); +} + +static int +tegra_ahci_ctrl_init(struct tegra_ahci_sc *sc) +{ + uint32_t val; + int rv; + + /* Enable SATA MMIO. */ + val = SATA_RD4(sc, SATA_FPCI_BAR5); + val &= ~SATA_FPCI_BAR_START(~0); + val |= SATA_FPCI_BAR_START(0x10000); + val |= SATA_FPCI_BAR_ACCESS_TYPE; + SATA_WR4(sc, SATA_FPCI_BAR5, val); + + /* Enable FPCI access */ + val = SATA_RD4(sc, SATA_CONFIGURATION); + val |= SATA_CONFIGURATION_EN_FPCI; + SATA_WR4(sc, SATA_CONFIGURATION, val); + + /* Recommended electrical settings for phy */ + SATA_WR4(sc, SCFG_OFFSET + T_SATA0_CHX_PHY_CTRL17, 0x55010000); + SATA_WR4(sc, SCFG_OFFSET + T_SATA0_CHX_PHY_CTRL18, 0x55010000); + SATA_WR4(sc, SCFG_OFFSET + T_SATA0_CHX_PHY_CTRL20, 0x1); + SATA_WR4(sc, SCFG_OFFSET + T_SATA0_CHX_PHY_CTRL21, 0x1); + + /* SQUELCH and Gen3 */ + val = SATA_RD4(sc, SCFG_OFFSET + T_SATA0_CFG_PHY); + val |= T_SATA0_CFG_PHY_MASK_SQUELCH; + val &= ~T_SATA0_CFG_PHY_USE_7BIT_ALIGN_DET_FOR_SPD; + SATA_WR4(sc, SCFG_OFFSET + T_SATA0_CFG_PHY, val); + + val = SATA_RD4(sc, SCFG_OFFSET + T_SATA0_NVOOB); + val &= ~T_SATA0_NVOOB_COMMA_CNT_MASK; + val &= ~T_SATA0_NVOOB_SQUELCH_FILTER_LENGTH_MASK; + val &= ~T_SATA0_NVOOB_SQUELCH_FILTER_MODE_MASK; + val |= T_SATA0_NVOOB_COMMA_CNT; + val |= T_SATA0_NVOOB_SQUELCH_FILTER_LENGTH; + val |= T_SATA0_NVOOB_SQUELCH_FILTER_MODE; + SATA_WR4(sc, SCFG_OFFSET + T_SATA0_NVOOB, val); + + /* Setup COMWAKE_IDLE_CNT */ + val = SATA_RD4(sc, SCFG_OFFSET + T_SATA0_CFG2NVOOB_2); + val &= ~T_SATA0_CFG2NVOOB_2_COMWAKE_IDLE_CNT_LOW_MASK; + val |= T_SATA0_CFG2NVOOB_2_COMWAKE_IDLE_CNT_LOW; + SATA_WR4(sc, SCFG_OFFSET + T_SATA0_CFG2NVOOB_2, val); + + if (sc->soc->init != NULL) { + rv = sc->soc->init(sc); + if (rv != 0) { + device_printf(sc->dev, + "SOC specific intialization failed: %d\n", rv); + return (rv); + } + } + + /* Enable backdoor programming. */ val = SATA_RD4(sc, SCFG_OFFSET + T_SATA0_CFG_SATA); val |= T_SATA0_CFG_SATA_BACKDOOR_PROG_IF_EN; SATA_WR4(sc, SCFG_OFFSET + T_SATA0_CFG_SATA, val); - SATA_WR4(sc, SCFG_OFFSET + T_SATA0_BKDOOR_CC, 0x01060100); - + /* Set device class and interface */ + val = SATA_RD4(sc, SCFG_OFFSET + T_SATA0_BKDOOR_CC); + val &= ~T_SATA0_BKDOOR_CC_CLASS_CODE_MASK; + val &= ~T_SATA0_BKDOOR_CC_PROG_IF_MASK; + val |= T_SATA0_BKDOOR_CC_CLASS_CODE; + val |= T_SATA0_BKDOOR_CC_PROG_IF; + SATA_WR4(sc, SCFG_OFFSET + T_SATA0_BKDOOR_CC, val); + + /* Enable LPM capabilities */ + val = SATA_RD4(sc, SCFG_OFFSET + T_SATA0_AHCI_HBA_CAP_BKDR); + val |= T_SATA0_AHCI_HBA_CAP_BKDR_PARTIAL_ST_CAP; + val |= T_SATA0_AHCI_HBA_CAP_BKDR_SLUMBER_ST_CAP; + val |= T_SATA0_AHCI_HBA_CAP_BKDR_SALP; + val |= T_SATA0_AHCI_HBA_CAP_BKDR_SUPP_PM; + SATA_WR4(sc, SCFG_OFFSET + T_SATA0_AHCI_HBA_CAP_BKDR, val); + + /* Disable backdoor programming. */ val = SATA_RD4(sc, SCFG_OFFSET + T_SATA0_CFG_SATA); val &= ~T_SATA0_CFG_SATA_BACKDOOR_PROG_IF_EN; SATA_WR4(sc, SCFG_OFFSET + T_SATA0_CFG_SATA, val); + /* SATA Second Level Clock Gating */ + val = SATA_RD4(sc, SCFG_OFFSET + T_SATA0_CFG_35); + val &= ~T_SATA0_CFG_35_IDP_INDEX_MASK; + val |= T_SATA0_CFG_35_IDP_INDEX; + SATA_WR4(sc, SCFG_OFFSET + T_SATA0_CFG_35, val); + + SATA_WR4(sc, SCFG_OFFSET + T_SATA0_AHCI_IDP1, 0x400040); + + val = SATA_RD4(sc, SCFG_OFFSET + T_SATA0_CFG_PHY_1); + val |= T_SATA0_CFG_PHY_1_PADS_IDDQ_EN; + val |= T_SATA0_CFG_PHY_1_PAD_PLL_IDDQ_EN; + SATA_WR4(sc, SCFG_OFFSET + T_SATA0_CFG_PHY_1, val); + + /* + * Indicate Sata only has the capability to enter DevSleep + * from slumber link. + */ + if (sc->aux_mem != NULL) { + val = bus_read_4(sc->aux_mem, SATA_AUX_MISC_CNTL_1); + val |= SATA_AUX_MISC_CNTL_1_DESO_SUPPORT; + bus_write_4(sc->aux_mem, SATA_AUX_MISC_CNTL_1, val); + } + + /* Enable IPFS Clock Gating */ + val = SATA_RD4(sc, SCFG_OFFSET + SATA_CONFIGURATION); + val &= ~SATA_CONFIGURATION_CLK_OVERRIDE; + SATA_WR4(sc, SCFG_OFFSET + SATA_CONFIGURATION, val); + + /* Enable IO & memory access, bus master mode */ val = SATA_RD4(sc, SCFG_OFFSET + T_SATA0_CFG_1); val |= T_SATA0_CFG_1_IO_SPACE; @@ -437,10 +596,8 @@ tegra_ahci_ctrl_init(struct tegra_ahci_sc *sc) val |= T_SATA0_CFG_1_SERR; SATA_WR4(sc, SCFG_OFFSET + T_SATA0_CFG_1, val); - /* SATA MMIO. */ - SATA_WR4(sc, SATA_FPCI_BAR5, 0x10000 << SATA_FPCI_BAR5_START_SHIFT); /* AHCI bar */ - SATA_WR4(sc, SCFG_OFFSET + T_SATA0_CFG_9, + SATA_WR4(sc, SCFG_OFFSET + T_SATA0_CFG_9, 0x08000 << T_SATA0_CFG_9_BASE_ADDRESS_SHIFT); /* Unmask interrupts. */ @@ -513,6 +670,8 @@ tegra_ahci_attach(device_t dev) sc->dev = dev; ctlr = &sc->ctlr; node = ofw_bus_get_node(dev); + sc->soc = (struct ahci_soc *)ofw_bus_search_compatible(dev, + compat_data)->ocd_data; ctlr->r_rid = 0; ctlr->r_mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, @@ -527,6 +686,12 @@ tegra_ahci_attach(device_t dev) rv = ENXIO; goto fail; } + + /* Aux is optionall */ + rid = 2; + sc->aux_mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &rid, RF_ACTIVE); + rv = get_fdt_resources(sc, node); if (rv != 0) { device_printf(sc->dev, "Failed to allocate FDT resource(s)\n"); diff --git a/sys/arm/nvidia/tegra_efuse.c b/sys/arm/nvidia/tegra_efuse.c index 253ae8b6cf36..e18fd9c3a274 100644 --- a/sys/arm/nvidia/tegra_efuse.c +++ b/sys/arm/nvidia/tegra_efuse.c @@ -49,23 +49,20 @@ __FBSDID("$FreeBSD$"); #include -#define RD4(_sc, _r) bus_read_4((_sc)->mem_res, (_sc)->fuse_begin + (_r)) - -static struct ofw_compat_data compat_data[] = { - {"nvidia,tegra124-efuse", 1}, - {NULL, 0} -}; +#define FUSES_START 0x100 +#define RD4(_sc, _r) bus_read_4((_sc)->mem_res, (FUSES_START + (_r))) +struct efuse_soc; struct tegra_efuse_softc { device_t dev; struct resource *mem_res; - int fuse_begin; + struct efuse_soc *soc; clk_t clk; - hwreset_t reset; + hwreset_t reset; }; -struct tegra_efuse_softc *dev_sc; +struct tegra_efuse_softc *dev_sc; struct tegra_sku_info tegra_sku_info; static char *tegra_rev_name[] = { [TEGRA_REVISION_UNKNOWN] = "unknown", @@ -76,18 +73,30 @@ static char *tegra_rev_name[] = { [TEGRA_REVISION_A04] = "A04", }; -/* Tegra30 and later */ -#define FUSE_VENDOR_CODE 0x100 -#define FUSE_FAB_CODE 0x104 -#define FUSE_LOT_CODE_0 0x108 -#define FUSE_LOT_CODE_1 0x10c -#define FUSE_WAFER_ID 0x110 -#define FUSE_X_COORDINATE 0x114 -#define FUSE_Y_COORDINATE 0x118 +struct efuse_soc { + void (*init)(struct tegra_efuse_softc *sc, + struct tegra_sku_info *sku); +}; -/* ---------------------- Tegra 124 specific code & data --------------- */ -#define TEGRA124_FUSE_BEGIN 0x100 +static void tegra124_init(struct tegra_efuse_softc *sc, + struct tegra_sku_info *sku); +struct efuse_soc tegra124_efuse_soc = { + .init = tegra124_init, +}; + +static void tegra210_init(struct tegra_efuse_softc *sc, + struct tegra_sku_info *sku); +struct efuse_soc tegra210_efuse_soc = { + .init = tegra210_init, +}; +static struct ofw_compat_data compat_data[] = { + {"nvidia,tegra124-efuse", (intptr_t)&tegra124_efuse_soc}, + {"nvidia,tegra210-efuse", (intptr_t)&tegra210_efuse_soc}, + {NULL, 0} +}; + +/* ---------------------- Tegra 124 specific code & data --------------- */ #define TEGRA124_CPU_PROCESS_CORNERS 2 #define TEGRA124_GPU_PROCESS_CORNERS 2 #define TEGRA124_SOC_PROCESS_CORNERS 2 @@ -128,12 +137,13 @@ static uint32_t tegra124_soc_process_speedos[][TEGRA124_SOC_PROCESS_CORNERS] = {0, UINT_MAX}, }; + static void tegra124_rev_sku_to_speedo_ids(struct tegra_efuse_softc *sc, struct tegra_sku_info *sku, int *threshold) { - /* Assign to default */ + /* Set default */ sku->cpu_speedo_id = 0; sku->soc_speedo_id = 0; sku->gpu_speedo_id = 0; @@ -180,7 +190,7 @@ tegra124_rev_sku_to_speedo_ids(struct tegra_efuse_softc *sc, } static void -tegra124_init_speedo(struct tegra_efuse_softc *sc, struct tegra_sku_info *sku) +tegra124_init(struct tegra_efuse_softc *sc, struct tegra_sku_info *sku) { int i, threshold; @@ -221,9 +231,175 @@ tegra124_init_speedo(struct tegra_efuse_softc *sc, struct tegra_sku_info *sku) sku->gpu_process_id = i; } - /* ----------------- End of Tegra 124 specific code & data --------------- */ +/* -------------------- Tegra 201 specific code & data ------------------- */ +#define TEGRA210_CPU_PROCESS_CORNERS 2 +#define TEGRA210_GPU_PROCESS_CORNERS 2 +#define TEGRA210_SOC_PROCESS_CORNERS 3 + +#define TEGRA210_FUSE_SKU_INFO 0x010 +#define TEGRA210_FUSE_CPU_SPEEDO_0 0x014 +#define TEGRA210_FUSE_CPU_IDDQ 0x018 +#define TEGRA210_FUSE_FT_REV 0x028 +#define TEGRA210_FUSE_CPU_SPEEDO_1 0x02c +#define TEGRA210_FUSE_CPU_SPEEDO_2 0x030 +#define TEGRA210_FUSE_SOC_SPEEDO_0 0x034 +#define TEGRA210_FUSE_SOC_SPEEDO_1 0x038 +#define TEGRA210_FUSE_SOC_SPEEDO_2 0x03c +#define TEGRA210_FUSE_SOC_IDDQ 0x040 +#define TEGRA210_FUSE_GPU_IDDQ 0x128 +#define TEGRA210_FUSE_SPARE 0x270 + +enum { + TEGRA210_THRESHOLD_INDEX_0, + TEGRA210_THRESHOLD_INDEX_1, + TEGRA210_THRESHOLD_INDEX_COUNT, +}; + +static uint32_t tegra210_cpu_process_speedos[][TEGRA210_CPU_PROCESS_CORNERS] = +{ + {2119, UINT_MAX}, + {2119, UINT_MAX}, +}; + +static uint32_t tegra210_gpu_process_speedos[][TEGRA210_GPU_PROCESS_CORNERS] = +{ + {UINT_MAX, UINT_MAX}, + {UINT_MAX, UINT_MAX}, +}; + +static uint32_t tegra210_soc_process_speedos[][TEGRA210_SOC_PROCESS_CORNERS] = +{ + {1950, 2100, UINT_MAX}, + {1950, 2100, UINT_MAX}, +}; + +static uint32_t +tegra210_get_speedo_revision(struct tegra_efuse_softc *sc) +{ + uint32_t reg; + uint32_t val; + + val = 0; + + /* Revision i encoded in spare fields */ + reg = RD4(sc, TEGRA210_FUSE_SPARE + 2 * 4); + val |= (reg & 1) << 0; + reg = RD4(sc, TEGRA210_FUSE_SPARE + 3 * 4); + val |= (reg & 1) << 1; + reg = RD4(sc, TEGRA210_FUSE_SPARE + 4 * 4); + val |= (reg & 1) << 2; + + return (val); +} + + +static void +tegra210_rev_sku_to_speedo_ids(struct tegra_efuse_softc *sc, + struct tegra_sku_info *sku, int speedo_rev, int *threshold) +{ + + /* Set defaults */ + sku->cpu_speedo_id = 0; + sku->soc_speedo_id = 0; + sku->gpu_speedo_id = 0; + *threshold = TEGRA210_THRESHOLD_INDEX_0; + + switch (sku->sku_id) { + case 0x00: /* Eng sku */ + case 0x01: /* Eng sku */ + case 0x07: + case 0x17: + case 0x27: + /* Use defaults */ + if (speedo_rev >= 2) + sku->gpu_speedo_id = 1; + break; + case 0x13: + if (speedo_rev >= 2) + sku->gpu_speedo_id = 1; + sku->cpu_speedo_id = 1; + break; + + default: + device_printf(sc->dev, " Unknown SKU ID %d\n", sku->sku_id); + break; + } +} + + +static void +tegra210_init(struct tegra_efuse_softc *sc, struct tegra_sku_info *sku) +{ + int i, threshold, speedo_rev; + uint32_t cpu_speedo[3], soc_speedo[3]; + uint32_t cpu_iddq, soc_iddq, gpu_iddq; + + cpu_speedo[0] = RD4(sc, TEGRA210_FUSE_CPU_SPEEDO_0); + cpu_speedo[1] = RD4(sc, TEGRA210_FUSE_CPU_SPEEDO_1); + cpu_speedo[2] = RD4(sc, TEGRA210_FUSE_CPU_SPEEDO_2); + soc_speedo[0] = RD4(sc, TEGRA210_FUSE_SOC_SPEEDO_0); + soc_speedo[1] = RD4(sc, TEGRA210_FUSE_SOC_SPEEDO_1); + soc_speedo[2] = RD4(sc, TEGRA210_FUSE_SOC_SPEEDO_2); + + + sku->cpu_iddq_value = RD4(sc, TEGRA210_FUSE_CPU_IDDQ); + sku->soc_iddq_value = RD4(sc, TEGRA210_FUSE_SOC_IDDQ); + sku->gpu_iddq_value = RD4(sc, TEGRA210_FUSE_GPU_IDDQ); + + cpu_iddq = RD4(sc, TEGRA210_FUSE_CPU_IDDQ) * 4; + soc_iddq = RD4(sc, TEGRA210_FUSE_SOC_IDDQ) * 4; + gpu_iddq = RD4(sc, TEGRA210_FUSE_GPU_IDDQ) * 5; + + speedo_rev = tegra210_get_speedo_revision(sc); +device_printf(sc->dev, " Speedo revision: %u\n", speedo_rev); + + if (speedo_rev >= 3) { + sku->cpu_speedo_value = cpu_speedo[0]; + sku->gpu_speedo_value = cpu_speedo[2]; + sku->soc_speedo_value = soc_speedo[0]; + } else if (speedo_rev == 2) { + sku->cpu_speedo_value = + (-1938 + (1095 * cpu_speedo[0] / 100)) / 10; + sku->gpu_speedo_value = + (-1662 + (1082 * cpu_speedo[2] / 100)) / 10; + sku->soc_speedo_value = + ( -705 + (1037 * soc_speedo[0] / 100)) / 10; + } else { + sku->cpu_speedo_value = 2100; + sku->gpu_speedo_value = cpu_speedo[2] - 75; + sku->soc_speedo_value = 1900; + } + + tegra210_rev_sku_to_speedo_ids(sc, sku, speedo_rev, &threshold); + + for (i = 0; i < TEGRA210_SOC_PROCESS_CORNERS; i++) { + if (sku->soc_speedo_value < + tegra210_soc_process_speedos[threshold][i]) + break; + } + sku->soc_process_id = i; + + for (i = 0; i < TEGRA210_CPU_PROCESS_CORNERS; i++) { + if (sku->cpu_speedo_value < + tegra210_cpu_process_speedos[threshold][i]) + break; + } + sku->cpu_process_id = i; + + for (i = 0; i < TEGRA210_GPU_PROCESS_CORNERS; i++) { + if (sku->gpu_speedo_value < + tegra210_gpu_process_speedos[threshold][i]) + break; + } + sku->gpu_process_id = i; + +} + +/* ----------------- End of Tegra 210 specific code & data --------------- */ + + uint32_t tegra_fuse_read_4(int addr) { if (dev_sc == NULL) @@ -274,6 +450,8 @@ tegra_efuse_attach(device_t dev) sc = device_get_softc(dev); sc->dev = dev; node = ofw_bus_get_node(dev); + sc->soc = (struct efuse_soc *)ofw_bus_search_compatible(dev, + compat_data)->ocd_data; /* Get the memory resource for the register mapping. */ rid = 0; @@ -307,9 +485,7 @@ tegra_efuse_attach(device_t dev) goto fail; } - /* Tegra124 specific init. */ - sc->fuse_begin = TEGRA124_FUSE_BEGIN; - tegra124_init_speedo(sc, &tegra_sku_info); + sc->soc->init(sc, &tegra_sku_info); dev_sc = sc; diff --git a/sys/arm/nvidia/tegra_ehci.c b/sys/arm/nvidia/tegra_ehci.c index de0ebd8801a6..058cbe7c5fb9 100644 --- a/sys/arm/nvidia/tegra_ehci.c +++ b/sys/arm/nvidia/tegra_ehci.c @@ -65,8 +65,10 @@ __FBSDID("$FreeBSD$"); /* Compatible devices. */ #define TEGRA124_EHCI 1 +#define TEGRA210_EHCI 2 static struct ofw_compat_data compat_data[] = { {"nvidia,tegra124-ehci", (uintptr_t)TEGRA124_EHCI}, + {"nvidia,tegra210-ehci", (uintptr_t)TEGRA210_EHCI}, {NULL, 0}, }; diff --git a/sys/arm/nvidia/tegra_gpio.c b/sys/arm/nvidia/tegra_gpio.c index 3cd30ad0dc30..17a7ac2a9fb7 100644 --- a/sys/arm/nvidia/tegra_gpio.c +++ b/sys/arm/nvidia/tegra_gpio.c @@ -137,6 +137,7 @@ struct tegra_gpio_softc { static struct ofw_compat_data compat_data[] = { {"nvidia,tegra124-gpio", 1}, + {"nvidia,tegra210-gpio", 1}, {NULL, 0} }; diff --git a/sys/arm/nvidia/tegra_i2c.c b/sys/arm/nvidia/tegra_i2c.c index 6e5285808bc7..02db5218b883 100644 --- a/sys/arm/nvidia/tegra_i2c.c +++ b/sys/arm/nvidia/tegra_i2c.c @@ -205,6 +205,7 @@ __FBSDID("$FreeBSD$"); static struct ofw_compat_data compat_data[] = { {"nvidia,tegra124-i2c", 1}, + {"nvidia,tegra210-i2c", 1}, {NULL, 0} }; enum tegra_i2c_xfer_type { @@ -678,7 +679,6 @@ tegra_i2c_attach(device_t dev) sizeof(sc->bus_freq)); if (rv != sizeof(sc->bus_freq)) { sc->bus_freq = 100000; - goto fail; } /* Request maximum frequency for I2C block 136MHz (408MHz / 3). */ diff --git a/sys/arm/nvidia/tegra_lic.c b/sys/arm/nvidia/tegra_lic.c index 0ac293f4962d..d457bd4b0f73 100644 --- a/sys/arm/nvidia/tegra_lic.c +++ b/sys/arm/nvidia/tegra_lic.c @@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include @@ -78,6 +78,7 @@ static struct resource_spec lic_spec[] = { static struct ofw_compat_data compat_data[] = { {"nvidia,tegra124-ictlr", 1}, + {"nvidia,tegra210-ictlr", 1}, {NULL, 0} }; diff --git a/sys/arm/nvidia/tegra_mc.c b/sys/arm/nvidia/tegra_mc.c index 7612e7bbff6a..7ff480b55dbd 100644 --- a/sys/arm/nvidia/tegra_mc.c +++ b/sys/arm/nvidia/tegra_mc.c @@ -110,6 +110,7 @@ __FBSDID("$FreeBSD$"); static struct ofw_compat_data compat_data[] = { {"nvidia,tegra124-mc", 1}, + {"nvidia,tegra210-mc", 1}, {NULL, 0} }; @@ -132,7 +133,7 @@ static char *smmu_err_tbl[16] = { "Security carveout", /* 4 */ "reserved", /* 5 */ "Invalid SMMU page", /* 6 */ - "reserved", /* 7 */ + "reserved", /* 7 */ }; static void @@ -173,8 +174,8 @@ tegra_mc_intr(void *arg) err = RD4(sc, MC_ERR_STATUS); *** 4533 LINES SKIPPED *** From owner-dev-commits-src-main@freebsd.org Sat Dec 26 18:39:54 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AA2144BFEFD; Sat, 26 Dec 2020 18:39:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D3CKQ4SbHz4Z5H; Sat, 26 Dec 2020 18:39:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8C06F197D9; Sat, 26 Dec 2020 18:39:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BQIdsdb055027; Sat, 26 Dec 2020 18:39:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BQIdsJb055026; Sat, 26 Dec 2020 18:39:54 GMT (envelope-from git) Date: Sat, 26 Dec 2020 18:39:54 GMT Message-Id: <202012261839.0BQIdsJb055026@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jamie Gritton Subject: git: 7de883c82f50 - jail: Fix an O(n^2) loop when adding jails MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jamie X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7de883c82f50cd6945154915166fb0df97c70952 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Dec 2020 18:39:54 -0000 The branch main has been updated by jamie: URL: https://cgit.FreeBSD.org/src/commit/?id=7de883c82f50cd6945154915166fb0df97c70952 commit 7de883c82f50cd6945154915166fb0df97c70952 Author: Jamie Gritton AuthorDate: 2020-12-26 18:39:34 +0000 Commit: Jamie Gritton CommitDate: 2020-12-26 18:39:34 +0000 jail: Fix an O(n^2) loop when adding jails When a jail is added using the default (system-chosen) JID, and non-default-JID jails already exist, a loop through the allprison list could restart and result in unnecessary O(n^2) behaviour. There should never be more than two list passes required. Also clean up inefficient (though still O(n)) allprison list traversal when finding jails by ID, or when adding jails in the common case of all default JIDs. --- sys/kern/kern_jail.c | 163 +++++++++++++++++++++++++++++++++++---------------- 1 file changed, 114 insertions(+), 49 deletions(-) diff --git a/sys/kern/kern_jail.c b/sys/kern/kern_jail.c index 1bad2d7488c1..c29d966283f8 100644 --- a/sys/kern/kern_jail.c +++ b/sys/kern/kern_jail.c @@ -136,6 +136,7 @@ struct prisonlist allprison = TAILQ_HEAD_INITIALIZER(allprison); LIST_HEAD(, prison_racct) allprison_racct; int lastprid = 0; +static int get_next_prid(struct prison **insprp); static int do_jail_attach(struct thread *td, struct prison *pr); static void prison_complete(void *context, int pending); static void prison_deref(struct prison *pr, int flags); @@ -506,7 +507,7 @@ kern_jail_set(struct thread *td, struct uio *optuio, int flags) #endif struct vfsopt *opt; struct vfsoptlist *opts; - struct prison *pr, *deadpr, *mypr, *ppr, *tpr; + struct prison *pr, *deadpr, *inspr, *mypr, *ppr, *tpr; struct vnode *root; char *domain, *errmsg, *host, *name, *namelc, *p, *path, *uuid; char *g_path, *osrelstr; @@ -977,6 +978,7 @@ kern_jail_set(struct thread *td, struct uio *optuio, int flags) */ pr = NULL; ppr = mypr; + inspr = NULL; if (cuflags == JAIL_CREATE && jid == 0 && name != NULL) { namelc = strrchr(name, '.'); jid = strtoul(namelc != NULL ? namelc + 1 : name, &p, 10); @@ -985,23 +987,36 @@ kern_jail_set(struct thread *td, struct uio *optuio, int flags) } sx_xlock(&allprison_lock); if (jid != 0) { - /* - * See if a requested jid already exists. There is an - * information leak here if the jid exists but is not within - * the caller's jail hierarchy. Jail creators will get EEXIST - * even though they cannot see the jail, and CREATE | UPDATE - * will return ENOENT which is not normally a valid error. - */ if (jid < 0) { error = EINVAL; vfs_opterror(opts, "negative jid"); goto done_unlock_list; } - pr = prison_find(jid); + /* + * See if a requested jid already exists. Keep track of + * where it can be inserted later. + */ + TAILQ_FOREACH(inspr, &allprison, pr_list) { + if (inspr->pr_id == jid) { + mtx_lock(&inspr->pr_mtx); + if (inspr->pr_ref > 0) { + pr = inspr; + inspr = NULL; + } else + mtx_unlock(&inspr->pr_mtx); + break; + } + if (inspr->pr_id > jid) + break; + } if (pr != NULL) { ppr = pr->pr_parent; /* Create: jid must not exist. */ if (cuflags == JAIL_CREATE) { + /* + * Even creators that cannot see the jail will + * get EEXIST. + */ mtx_unlock(&pr->pr_mtx); error = EEXIST; vfs_opterror(opts, "jail %d already exists", @@ -1009,6 +1024,11 @@ kern_jail_set(struct thread *td, struct uio *optuio, int flags) goto done_unlock_list; } if (!prison_ischild(mypr, pr)) { + /* + * Updaters get ENOENT if they cannot see the + * jail. This is true even for CREATE | UPDATE, + * which normally cannot give this error. + */ mtx_unlock(&pr->pr_mtx); pr = NULL; } else if (pr->pr_uref == 0) { @@ -1175,52 +1195,26 @@ kern_jail_set(struct thread *td, struct uio *optuio, int flags) ppr->pr_uref++; mtx_unlock(&ppr->pr_mtx); pr = malloc(sizeof(*pr), M_PRISON, M_WAITOK | M_ZERO); - if (jid == 0) { - /* Find the next free jid. */ - jid = lastprid + 1; - findnext: - if (jid == JAIL_MAX) - jid = 1; - TAILQ_FOREACH(tpr, &allprison, pr_list) { - if (tpr->pr_id < jid) - continue; - if (tpr->pr_id > jid || tpr->pr_ref == 0) { - TAILQ_INSERT_BEFORE(tpr, pr, pr_list); - break; - } - if (jid == lastprid) { - error = EAGAIN; - vfs_opterror(opts, - "no available jail IDs"); - free(pr, M_PRISON); - prison_deref(ppr, PD_DEREF | - PD_DEUREF | PD_LIST_XLOCKED); - goto done_releroot; - } - jid++; - goto findnext; - } - lastprid = jid; - } else { - /* - * The jail already has a jid (that did not yet exist), - * so just find where to insert it. - */ - TAILQ_FOREACH(tpr, &allprison, pr_list) - if (tpr->pr_id >= jid) { - TAILQ_INSERT_BEFORE(tpr, pr, pr_list); - break; - } + + if (jid == 0 && (jid = get_next_prid(&inspr)) == 0) { + error = EAGAIN; + vfs_opterror(opts, "no available jail IDs"); + free(pr, M_PRISON); + prison_deref(ppr, + PD_DEREF | PD_DEUREF | PD_LIST_XLOCKED); + goto done_releroot; } - if (tpr == NULL) + pr->pr_id = jid; + if (inspr != NULL) + TAILQ_INSERT_BEFORE(inspr, pr, pr_list); + else TAILQ_INSERT_TAIL(&allprison, pr, pr_list); + + pr->pr_parent = ppr; LIST_INSERT_HEAD(&ppr->pr_children, pr, pr_sibling); for (tpr = ppr; tpr != NULL; tpr = tpr->pr_parent) tpr->pr_childcount++; - pr->pr_parent = ppr; - pr->pr_id = jid; - /* Set some default values, and inherit some from the parent. */ if (namelc == NULL) namelc = ""; @@ -1913,6 +1907,70 @@ kern_jail_set(struct thread *td, struct uio *optuio, int flags) return (error); } +/* + * Find the next available prison ID. Return the ID on success, or zero + * on failure. Also set a pointer to the allprison list entry the prison + * should be inserted before. + */ +static int +get_next_prid(struct prison **insprp) +{ + struct prison *inspr; + int jid, maxid; + + jid = lastprid % JAIL_MAX + 1; + if (TAILQ_EMPTY(&allprison) || + TAILQ_LAST(&allprison, prisonlist)->pr_id < jid) { + /* + * A common case is for all jails to be implicitly numbered, + * which means they'll go on the end of the list, at least + * for the first JAIL_MAX times. + */ + inspr = NULL; + } else { + /* + * Take two passes through the allprison list: first starting + * with the proposed jid, then ending with it. + */ + for (maxid = JAIL_MAX; maxid != 0; ) { + TAILQ_FOREACH(inspr, &allprison, pr_list) { + if (inspr->pr_id < jid) + continue; + if (inspr->pr_id > jid || inspr->pr_ref == 0) { + /* + * Found an opening. This may be a gap + * in the list, or a dead jail with the + * same ID. + */ + maxid = 0; + break; + } + if (++jid > maxid) { + if (lastprid == maxid || lastprid == 0) + { + /* + * The entire legal range + * has been traversed + */ + return 0; + } + /* Try again from the start. */ + jid = 1; + maxid = lastprid; + break; + } + } + if (inspr == NULL) { + /* Found room at the end of the list. */ + break; + } + } + } + *insprp = inspr; + lastprid = jid; + return (jid); +} + /* * struct jail_get_args { * struct iovec *iovp; @@ -2453,8 +2511,15 @@ prison_find(int prid) mtx_lock(&pr->pr_mtx); if (pr->pr_ref > 0) return (pr); + /* + * Any active prison with the same ID would have + * been inserted before a dead one. + */ mtx_unlock(&pr->pr_mtx); + break; } + if (pr->pr_id > prid) + break; } return (NULL); } From owner-dev-commits-src-main@freebsd.org Sat Dec 26 18:41:10 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 283AB4C0481; Sat, 26 Dec 2020 18:41:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D3CLt0hQDz4Z8X; Sat, 26 Dec 2020 18:41:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0A6AF197DE; Sat, 26 Dec 2020 18:41:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BQIf9vH063363; Sat, 26 Dec 2020 18:41:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BQIf9pb063362; Sat, 26 Dec 2020 18:41:09 GMT (envelope-from git) Date: Sat, 26 Dec 2020 18:41:09 GMT Message-Id: <202012261841.0BQIf9pb063362@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Marius Strobl Subject: git: 2f00fe725b7a - nsphy(4): Remove obsolete support for pcn(4) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: marius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2f00fe725b7a17c2be61bf5986b4b7a78c956bbe Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Dec 2020 18:41:10 -0000 The branch main has been updated by marius: URL: https://cgit.FreeBSD.org/src/commit/?id=2f00fe725b7a17c2be61bf5986b4b7a78c956bbe commit 2f00fe725b7a17c2be61bf5986b4b7a78c956bbe Author: Marius Strobl AuthorDate: 2020-12-26 18:20:03 +0000 Commit: Marius Strobl CommitDate: 2020-12-26 18:40:56 +0000 nsphy(4): Remove obsolete support for pcn(4) This should have gone in 607790d10fdb97d25cdc0bbe9ed6eaae67383ae1 and r347915 respectively along with pcn(4). --- sys/dev/mii/nsphy.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/sys/dev/mii/nsphy.c b/sys/dev/mii/nsphy.c index 76ef81320a5c..8feab4f023f5 100644 --- a/sys/dev/mii/nsphy.c +++ b/sys/dev/mii/nsphy.c @@ -131,15 +131,8 @@ nsphy_probe(device_t dev) static int nsphy_attach(device_t dev) { - u_int flags; - flags = MIIF_NOMANPAUSE; - /* - * Am79C971 wedge when isolating all of their external PHYs. - */ - if (mii_dev_mac_match(dev,"pcn")) - flags |= MIIF_NOISOLATE; - mii_phy_dev_attach(dev, flags, &nsphy_funcs, 1); + mii_phy_dev_attach(dev, MIIF_NOMANPAUSE, &nsphy_funcs, 1); return (0); } From owner-dev-commits-src-main@freebsd.org Sat Dec 26 18:41:10 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3A9894BFF66; Sat, 26 Dec 2020 18:41:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D3CLt1C77z4Z2C; Sat, 26 Dec 2020 18:41:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 16130193D8; Sat, 26 Dec 2020 18:41:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BQIfAKB063380; Sat, 26 Dec 2020 18:41:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BQIfAni063379; Sat, 26 Dec 2020 18:41:10 GMT (envelope-from git) Date: Sat, 26 Dec 2020 18:41:10 GMT Message-Id: <202012261841.0BQIfAni063379@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Marius Strobl Subject: git: e51ed06ae157 - mlphy(4)/tlphy(4): Remove obsolete drivers MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: marius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e51ed06ae1577cbcb10251c8c1f68ab2f7048b9b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Dec 2020 18:41:10 -0000 The branch main has been updated by marius: URL: https://cgit.FreeBSD.org/src/commit/?id=e51ed06ae1577cbcb10251c8c1f68ab2f7048b9b commit e51ed06ae1577cbcb10251c8c1f68ab2f7048b9b Author: Marius Strobl AuthorDate: 2020-12-26 18:07:50 +0000 Commit: Marius Strobl CommitDate: 2020-12-26 18:40:55 +0000 mlphy(4)/tlphy(4): Remove obsolete drivers These drivers should have been removed along with tl(4) as part of 7c897ca91fe1cdb785531d2f5aa0d441c1d73142 and r347918 respectively as these fromer made sure to only ever attach to the latter, e. g.: <...> static int tlphy_probe(device_t dev) { if (!mii_dev_mac_match(dev, "tl")) return (ENXIO); <...> --- sys/conf/NOTES | 2 - sys/conf/files | 2 - sys/dev/mii/mlphy.c | 360 --------------------------------------------- sys/dev/mii/tlphy.c | 376 ----------------------------------------------- sys/dev/mii/tlphyreg.h | 56 ------- sys/modules/mii/Makefile | 4 +- 6 files changed, 2 insertions(+), 798 deletions(-) diff --git a/sys/conf/NOTES b/sys/conf/NOTES index 657f51c2abb1..62213a2a16ee 100644 --- a/sys/conf/NOTES +++ b/sys/conf/NOTES @@ -1810,7 +1810,6 @@ device icsphy # ICS ICS1889-1893 device ip1000phy # IC Plus IP1000A/IP1001 device jmphy # JMicron JMP211/JMP202 device lxtphy # Level One LXT-970 -device mlphy # Micro Linear 6692 device nsgphy # NatSemi DP8361/DP83865/DP83891 device nsphy # NatSemi DP83840A device nsphyter # NatSemi DP83843/DP83815 @@ -1822,7 +1821,6 @@ device rlphy # RealTek 8139 device rlswitch # RealTek 8305 device smcphy # SMSC LAN91C111 device tdkphy # TDK 89Q2120 -device tlphy # Texas Instruments ThunderLAN device truephy # LSI TruePHY device xmphy # XaQti XMAC II diff --git a/sys/conf/files b/sys/conf/files index dc4cadb36c14..8e30ae1eded1 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -2420,7 +2420,6 @@ dev/mii/mii_bitbang.c optional miibus | mii_bitbang dev/mii/mii_physubr.c optional miibus | mii dev/mii/mii_fdt.c optional miibus fdt | mii fdt dev/mii/miibus_if.m optional miibus | mii -dev/mii/mlphy.c optional miibus | mlphy dev/mii/nsgphy.c optional miibus | nsgphy dev/mii/nsphy.c optional miibus | nsphy dev/mii/nsphyter.c optional miibus | nsphyter @@ -2433,7 +2432,6 @@ dev/mii/rlswitch.c optional rlswitch dev/mii/smcphy.c optional miibus | smcphy dev/mii/smscphy.c optional miibus | smscphy dev/mii/tdkphy.c optional miibus | tdkphy -dev/mii/tlphy.c optional miibus | tlphy dev/mii/truephy.c optional miibus | truephy dev/mii/ukphy.c optional miibus | mii dev/mii/ukphy_subr.c optional miibus | mii diff --git a/sys/dev/mii/mlphy.c b/sys/dev/mii/mlphy.c deleted file mode 100644 index 8f31062f4b27..000000000000 --- a/sys/dev/mii/mlphy.c +++ /dev/null @@ -1,360 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-4-Clause - * - * Copyright (c) 1997, 1998, 1999 - * Bill Paul . All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Bill Paul. - * 4. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY Bill Paul 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 Bill Paul OR THE VOICES IN HIS HEAD - * 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$"); - -/* - * driver for Micro Linear 6692 PHYs - * - * The Micro Linear 6692 is a strange beast, and dealing with it using - * this code framework is tricky. The 6692 is actually a 100Mbps-only - * device, which means that a second PHY is required to support 10Mbps - * modes. However, even though the 6692 does not support 10Mbps modes, - * it can still advertise them when performing autonegotiation. If a - * 10Mbps mode is negotiated, we must program the registers of the - * companion PHY accordingly in addition to programming the registers - * of the 6692. - * - * This device also does not have vendor/device ID registers. - */ - -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include - -#include "miibus_if.h" - -#define ML_STATE_AUTO_SELF 1 -#define ML_STATE_AUTO_OTHER 2 - -struct mlphy_softc { - struct mii_softc ml_mii; - device_t ml_dev; - int ml_state; - int ml_linked; -}; - -static int mlphy_probe(device_t); -static int mlphy_attach(device_t); - -static device_method_t mlphy_methods[] = { - /* device interface */ - DEVMETHOD(device_probe, mlphy_probe), - DEVMETHOD(device_attach, mlphy_attach), - DEVMETHOD(device_detach, mii_phy_detach), - DEVMETHOD(device_shutdown, bus_generic_shutdown), - DEVMETHOD_END -}; - -static devclass_t mlphy_devclass; - -static driver_t mlphy_driver = { - "mlphy", - mlphy_methods, - sizeof(struct mlphy_softc) -}; - -DRIVER_MODULE(mlphy, miibus, mlphy_driver, mlphy_devclass, 0, 0); - -static struct mii_softc *mlphy_find_other(struct mlphy_softc *); -static int mlphy_service(struct mii_softc *, struct mii_data *, int); -static void mlphy_reset(struct mii_softc *); -static void mlphy_status(struct mii_softc *); - -static const struct mii_phy_funcs mlphy_funcs = { - mlphy_service, - mlphy_status, - mlphy_reset -}; - -static int -mlphy_probe(dev) - device_t dev; -{ - struct mii_attach_args *ma; - - ma = device_get_ivars(dev); - - /* - * Micro Linear PHY reports oui == 0 model == 0 - */ - if (MII_OUI(ma->mii_id1, ma->mii_id2) != 0 || - MII_MODEL(ma->mii_id2) != 0) - return (ENXIO); - - /* - * Make sure the parent is a `tl'. So far, I have only - * encountered the 6692 on an Olicom card with a ThunderLAN - * controller chip. - */ - if (!mii_dev_mac_match(dev, "tl")) - return (ENXIO); - - device_set_desc(dev, "Micro Linear 6692 media interface"); - - return (BUS_PROBE_DEFAULT); -} - -static int -mlphy_attach(dev) - device_t dev; -{ - struct mlphy_softc *msc; - struct mii_softc *sc; - - msc = device_get_softc(dev); - sc = &msc->ml_mii; - msc->ml_dev = dev; - mii_phy_dev_attach(dev, MIIF_NOMANPAUSE, &mlphy_funcs, 0); - - PHY_RESET(sc); - - sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & sc->mii_capmask; - /* Let the companion PHY (if any) only handle the media we don't. */ - sc->mii_capmask = ~sc->mii_capabilities; - device_printf(dev, " "); - mii_phy_add_media(sc); - printf("\n"); - - MIIBUS_MEDIAINIT(sc->mii_dev); - return (0); -} - -static struct mii_softc * -mlphy_find_other(struct mlphy_softc *msc) -{ - device_t *devlist; - struct mii_softc *retval; - int i, devs; - - retval = NULL; - if (device_get_children(msc->ml_mii.mii_dev, &devlist, &devs) != 0) - return (NULL); - for (i = 0; i < devs; i++) { - if (devlist[i] != msc->ml_dev) { - retval = device_get_softc(devlist[i]); - break; - } - } - free(devlist, M_TEMP); - return (retval); -} - -static int -mlphy_service(xsc, mii, cmd) - struct mii_softc *xsc; - struct mii_data *mii; - int cmd; -{ - struct ifmedia_entry *ife = mii->mii_media.ifm_cur; - struct mii_softc *other = NULL; - struct mlphy_softc *msc = (struct mlphy_softc *)xsc; - struct mii_softc *sc = (struct mii_softc *)&msc->ml_mii; - int other_inst, reg; - - /* - * See if there's another PHY on this bus with us. - * If so, we may need it for 10Mbps modes. - */ - other = mlphy_find_other(msc); - - switch (cmd) { - case MII_POLLSTAT: - break; - - case MII_MEDIACHG: - switch (IFM_SUBTYPE(ife->ifm_media)) { - case IFM_AUTO: - /* - * For autonegotiation, reset and isolate the - * companion PHY (if any) and then do NWAY - * autonegotiation ourselves. - */ - msc->ml_state = ML_STATE_AUTO_SELF; - if (other != NULL) { - PHY_RESET(other); - PHY_WRITE(other, MII_BMCR, BMCR_ISO); - } - (void)mii_phy_auto(sc); - msc->ml_linked = 0; - return (0); - case IFM_10_T: - case IFM_100_TX: - /* - * For 10baseT and 100baseTX modes, reset and isolate - * the companion PHY (if any), then program ourselves - * accordingly. - */ - if (other != NULL) { - PHY_RESET(other); - PHY_WRITE(other, MII_BMCR, BMCR_ISO); - } - mii_phy_setmedia(sc); - msc->ml_state = 0; - break; - default: - return (EINVAL); - } - break; - - case MII_TICK: - /* - * Only used for autonegotiation. - */ - if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO) - break; - - /* - * Check to see if we have link. If we do, we don't - * need to restart the autonegotiation process. Read - * the BMSR twice in case it's latched. - * If we're in a 10Mbps mode, check the link of the - * 10Mbps PHY. Sometimes the Micro Linear PHY's - * linkstat bit will clear while the linkstat bit of - * the companion PHY will remain set. - */ - if (msc->ml_state == ML_STATE_AUTO_OTHER) { - reg = PHY_READ(other, MII_BMSR) | - PHY_READ(other, MII_BMSR); - } else { - reg = PHY_READ(sc, MII_BMSR) | - PHY_READ(sc, MII_BMSR); - } - - if (reg & BMSR_LINK) { - if (!msc->ml_linked) { - msc->ml_linked = 1; - PHY_STATUS(sc); - } - break; - } - - /* - * Only retry autonegotiation every 5 seconds. - */ - if (++sc->mii_ticks <= MII_ANEGTICKS) - break; - - sc->mii_ticks = 0; - msc->ml_linked = 0; - mii->mii_media_active = IFM_NONE; - PHY_RESET(sc); - msc->ml_state = ML_STATE_AUTO_SELF; - if (other != NULL) { - PHY_RESET(other); - PHY_WRITE(other, MII_BMCR, BMCR_ISO); - } - mii_phy_auto(sc); - return (0); - } - - /* Update the media status. */ - - if (msc->ml_state == ML_STATE_AUTO_OTHER) { - other_inst = other->mii_inst; - other->mii_inst = sc->mii_inst; - if (IFM_INST(ife->ifm_media) == other->mii_inst) - (void)PHY_SERVICE(other, mii, MII_POLLSTAT); - other->mii_inst = other_inst; - sc->mii_media_active = other->mii_media_active; - sc->mii_media_status = other->mii_media_status; - } else - ukphy_status(sc); - - /* Callback if something changed. */ - mii_phy_update(sc, cmd); - return (0); -} - -/* - * The Micro Linear PHY comes out of reset with the 'autoneg - * enable' bit set, which we don't want. - */ -static void -mlphy_reset(sc) - struct mii_softc *sc; -{ - int reg; - - mii_phy_reset(sc); - reg = PHY_READ(sc, MII_BMCR); - reg &= ~BMCR_AUTOEN; - PHY_WRITE(sc, MII_BMCR, reg); -} - -/* - * If we negotiate a 10Mbps mode, we need to check for an alternate - * PHY and make sure it's enabled and set correctly. - */ -static void -mlphy_status(sc) - struct mii_softc *sc; -{ - struct mlphy_softc *msc = (struct mlphy_softc *)sc; - struct mii_data *mii = msc->ml_mii.mii_pdata; - struct mii_softc *other = NULL; - - /* See if there's another PHY on the bus with us. */ - other = mlphy_find_other(msc); - if (other == NULL) - return; - - ukphy_status(sc); - - if (IFM_SUBTYPE(mii->mii_media_active) != IFM_10_T) { - msc->ml_state = ML_STATE_AUTO_SELF; - PHY_RESET(other); - PHY_WRITE(other, MII_BMCR, BMCR_ISO); - } - - if (IFM_SUBTYPE(mii->mii_media_active) == IFM_10_T) { - msc->ml_state = ML_STATE_AUTO_OTHER; - PHY_RESET(&msc->ml_mii); - PHY_WRITE(&msc->ml_mii, MII_BMCR, BMCR_ISO); - PHY_RESET(other); - mii_phy_auto(other); - } -} diff --git a/sys/dev/mii/tlphy.c b/sys/dev/mii/tlphy.c deleted file mode 100644 index 438db72f78b7..000000000000 --- a/sys/dev/mii/tlphy.c +++ /dev/null @@ -1,376 +0,0 @@ -/* $NetBSD: tlphy.c,v 1.18 1999/05/14 11:40:28 drochner Exp $ */ - -/*- - * SPDX-License-Identifier: BSD-2-Clause-NetBSD AND BSD-2-Clause - * - * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc. - * All rights reserved. - * - * This code is derived from software contributed to The NetBSD Foundation - * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility, - * NASA Ames Research Center. - * - * 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 NETBSD FOUNDATION, INC. 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 FOUNDATION OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -/*- - * Copyright (c) 1997 Manuel Bouyer. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 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$"); - -/* - * Driver for Texas Instruments's ThunderLAN PHYs - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include - -#include -#include -#include "miidevs.h" - -#include - -#include "miibus_if.h" - -struct tlphy_softc { - struct mii_softc sc_mii; /* generic PHY */ - int sc_need_acomp; -}; - -static int tlphy_probe(device_t); -static int tlphy_attach(device_t); - -static device_method_t tlphy_methods[] = { - /* device interface */ - DEVMETHOD(device_probe, tlphy_probe), - DEVMETHOD(device_attach, tlphy_attach), - DEVMETHOD(device_detach, mii_phy_detach), - DEVMETHOD(device_shutdown, bus_generic_shutdown), - DEVMETHOD_END -}; - -static devclass_t tlphy_devclass; - -static driver_t tlphy_driver = { - "tlphy", - tlphy_methods, - sizeof(struct tlphy_softc) -}; - -DRIVER_MODULE(tlphy, miibus, tlphy_driver, tlphy_devclass, 0, 0); - -static int tlphy_service(struct mii_softc *, struct mii_data *, int); -static int tlphy_auto(struct tlphy_softc *); -static void tlphy_acomp(struct tlphy_softc *); -static void tlphy_status(struct mii_softc *); - -static const struct mii_phydesc tlphys[] = { - MII_PHY_DESC(TI, TLAN10T), - MII_PHY_END -}; - -static const struct mii_phy_funcs tlphy_funcs = { - tlphy_service, - tlphy_status, - mii_phy_reset -}; - -static int -tlphy_probe(device_t dev) -{ - - if (!mii_dev_mac_match(dev, "tl")) - return (ENXIO); - return (mii_phy_dev_probe(dev, tlphys, BUS_PROBE_DEFAULT)); -} - -static int -tlphy_attach(device_t dev) -{ - device_t *devlist; - struct mii_softc *other, *sc_mii; - const char *sep = ""; - int capmask, devs, i; - - sc_mii = device_get_softc(dev); - - mii_phy_dev_attach(dev, MIIF_NOMANPAUSE, &tlphy_funcs, 0); - - /* - * Note that if we're on a device that also supports 100baseTX, - * we are not going to want to use the built-in 10baseT port, - * since there will be another PHY on the MII wired up to the - * UTP connector. - */ - capmask = BMSR_DEFCAPMASK; - if (sc_mii->mii_inst && - device_get_children(sc_mii->mii_dev, &devlist, &devs) == 0) { - for (i = 0; i < devs; i++) { - if (devlist[i] != dev) { - other = device_get_softc(devlist[i]); - capmask &= ~other->mii_capabilities; - break; - } - } - free(devlist, M_TEMP); - } - - PHY_RESET(sc_mii); - - sc_mii->mii_capabilities = PHY_READ(sc_mii, MII_BMSR) & capmask; - -#define ADD(m, c) \ - ifmedia_add(&sc_mii->mii_pdata->mii_media, (m), (c), NULL) -#define PRINT(s) printf("%s%s", sep, s); sep = ", " - - if ((sc_mii->mii_flags & (MIIF_MACPRIV0 | MIIF_MACPRIV1)) != 0 && - (sc_mii->mii_capabilities & BMSR_MEDIAMASK) != 0) - device_printf(dev, " "); - if ((sc_mii->mii_flags & MIIF_MACPRIV0) != 0) { - ADD(IFM_MAKEWORD(IFM_ETHER, IFM_10_2, 0, sc_mii->mii_inst), - 0); - PRINT("10base2/BNC"); - } - if ((sc_mii->mii_flags & MIIF_MACPRIV1) != 0) { - ADD(IFM_MAKEWORD(IFM_ETHER, IFM_10_5, 0, sc_mii->mii_inst), - 0); - PRINT("10base5/AUI"); - } - if ((sc_mii->mii_capabilities & BMSR_MEDIAMASK) != 0) { - printf("%s", sep); - mii_phy_add_media(sc_mii); - } - if ((sc_mii->mii_flags & (MIIF_MACPRIV0 | MIIF_MACPRIV1)) != 0 && - (sc_mii->mii_capabilities & BMSR_MEDIAMASK) != 0) - printf("\n"); -#undef ADD -#undef PRINT - - MIIBUS_MEDIAINIT(sc_mii->mii_dev); - return (0); -} - -static int -tlphy_service(struct mii_softc *self, struct mii_data *mii, int cmd) -{ - struct tlphy_softc *sc = (struct tlphy_softc *)self; - struct ifmedia_entry *ife = mii->mii_media.ifm_cur; - int reg; - - if (sc->sc_need_acomp) - tlphy_acomp(sc); - - switch (cmd) { - case MII_POLLSTAT: - break; - - case MII_MEDIACHG: - switch (IFM_SUBTYPE(ife->ifm_media)) { - case IFM_AUTO: - /* - * The ThunderLAN PHY doesn't self-configure after - * an autonegotiation cycle, so there's no such - * thing as "already in auto mode". - */ - (void)tlphy_auto(sc); - break; - case IFM_10_2: - case IFM_10_5: - PHY_WRITE(&sc->sc_mii, MII_BMCR, 0); - PHY_WRITE(&sc->sc_mii, MII_TLPHY_CTRL, CTRL_AUISEL); - DELAY(100000); - break; - default: - PHY_WRITE(&sc->sc_mii, MII_TLPHY_CTRL, 0); - DELAY(100000); - mii_phy_setmedia(&sc->sc_mii); - } - break; - - case MII_TICK: - /* - * Only used for autonegotiation. - */ - if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO) - break; - - /* - * Check to see if we have link. If we do, we don't - * need to restart the autonegotiation process. Read - * the BMSR twice in case it's latched. - * - * XXX WHAT ABOUT CHECKING LINK ON THE BNC/AUI?! - */ - reg = PHY_READ(&sc->sc_mii, MII_BMSR) | - PHY_READ(&sc->sc_mii, MII_BMSR); - if (reg & BMSR_LINK) - break; - - /* - * Only retry autonegotiation every 5 seconds. - */ - if (++sc->sc_mii.mii_ticks <= MII_ANEGTICKS) - break; - - sc->sc_mii.mii_ticks = 0; - PHY_RESET(&sc->sc_mii); - (void)tlphy_auto(sc); - return (0); - } - - /* Update the media status. */ - PHY_STATUS(self); - - /* Callback if something changed. */ - mii_phy_update(&sc->sc_mii, cmd); - return (0); -} - -static void -tlphy_status(struct mii_softc *self) -{ - struct tlphy_softc *sc = (struct tlphy_softc *)self; - struct mii_data *mii = sc->sc_mii.mii_pdata; - int bmsr, bmcr, tlctrl; - - mii->mii_media_status = IFM_AVALID; - mii->mii_media_active = IFM_ETHER; - - bmcr = PHY_READ(&sc->sc_mii, MII_BMCR); - if (bmcr & BMCR_ISO) { - mii->mii_media_active |= IFM_NONE; - mii->mii_media_status = 0; - return; - } - - tlctrl = PHY_READ(&sc->sc_mii, MII_TLPHY_CTRL); - if (tlctrl & CTRL_AUISEL) { - mii->mii_media_status = 0; - mii->mii_media_active = mii->mii_media.ifm_cur->ifm_media; - return; - } - - bmsr = PHY_READ(&sc->sc_mii, MII_BMSR) | - PHY_READ(&sc->sc_mii, MII_BMSR); - if (bmsr & BMSR_LINK) - mii->mii_media_status |= IFM_ACTIVE; - - if (bmcr & BMCR_LOOP) - mii->mii_media_active |= IFM_LOOP; - - /* - * Grr, braindead ThunderLAN PHY doesn't have any way to - * tell which media is actually active. (Note it also - * doesn't self-configure after autonegotiation.) We - * just have to report what's in the BMCR. - */ - if (bmcr & BMCR_FDX) - mii->mii_media_active |= IFM_FDX | mii_phy_flowstatus(self); - else - mii->mii_media_active |= IFM_HDX; - mii->mii_media_active |= IFM_10_T; -} - -static int -tlphy_auto(struct tlphy_softc *sc) -{ - int error; - - switch ((error = mii_phy_auto(&sc->sc_mii))) { - case EIO: - /* - * Just assume we're not in full-duplex mode. - * XXX Check link and try AUI/BNC? - */ - PHY_WRITE(&sc->sc_mii, MII_BMCR, 0); - break; - - case EJUSTRETURN: - /* Flag that we need to program when it completes. */ - sc->sc_need_acomp = 1; - break; - - default: - tlphy_acomp(sc); - } - - return (error); -} - -static void -tlphy_acomp(struct tlphy_softc *sc) -{ - int aner, anlpar; - - sc->sc_need_acomp = 0; - - /* - * Grr, braindead ThunderLAN PHY doesn't self-configure - * after autonegotiation. We have to do it ourselves - * based on the link partner status. - */ - - aner = PHY_READ(&sc->sc_mii, MII_ANER); - if (aner & ANER_LPAN) { - anlpar = PHY_READ(&sc->sc_mii, MII_ANLPAR) & - PHY_READ(&sc->sc_mii, MII_ANAR); - if (anlpar & ANAR_10_FD) { - PHY_WRITE(&sc->sc_mii, MII_BMCR, BMCR_FDX); - return; - } - } - PHY_WRITE(&sc->sc_mii, MII_BMCR, 0); -} diff --git a/sys/dev/mii/tlphyreg.h b/sys/dev/mii/tlphyreg.h deleted file mode 100644 index 2e21d0eb8745..000000000000 --- a/sys/dev/mii/tlphyreg.h +++ /dev/null @@ -1,56 +0,0 @@ -/* $NetBSD: tlphyreg.h,v 1.1 1998/08/10 23:59:58 thorpej Exp $ */ - -/*- - * SPDX-License-Identifier: BSD-2-Clause-NetBSD - * - * Copyright (c) 1997 Manuel Bouyer. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 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 _DEV_MII_TLPHYREG_H_ -#define _DEV_MII_TLPHYREG_H_ - -/* - * Registers for the TI ThunderLAN internal PHY. - */ - -#define MII_TLPHY_ID 0x10 /* ThunderLAN PHY ID */ -#define ID_10BASETAUI 0x0001 /* 10baseT/AUI PHY */ - -#define MII_TLPHY_CTRL 0x11 /* Control regiseter */ -#define CTRL_ILINK 0x8000 /* Ignore link */ -#define CTRL_SWPOL 0x4000 /* swap polarity */ -#define CTRL_AUISEL 0x2000 /* Select AUI */ -#define CTRL_SQEEN 0x1000 /* Enable SQE */ -#define CTRL_NFEW 0x0004 /* Not far end wrap */ -#define CTRL_INTEN 0x0002 /* Interrupts enable */ -#define CTRL_TINT 0x0001 /* Test Interrupts */ - -#define MII_TLPHY_ST 0x12 /* Status register */ -#define ST_MII_INT 0x8000 /* MII interrupt */ -#define ST_PHOK 0x4000 /* Power high OK */ -#define ST_POLOK 0x2000 /* Polarity OK */ -#define ST_TPE 0x1000 /* Twisted pair energy */ - -#endif /* _DEV_MII_TLPHYREG_H_ */ diff --git a/sys/modules/mii/Makefile b/sys/modules/mii/Makefile index 51b4f056d0d2..5709af97b720 100644 --- a/sys/modules/mii/Makefile +++ b/sys/modules/mii/Makefile @@ -7,9 +7,9 @@ SRCS= acphy.c amphy.c atphy.c axphy.c bmtphy.c brgphy.c bus_if.h SRCS+= ciphy.c device_if.h SRCS+= e1000phy.c gentbi.c icsphy.c ip1000phy.c jmphy.c lxtphy.c SRCS+= miibus_if.c miibus_if.h mii.c miidevs.h mii_bitbang.c mii_physubr.c -SRCS+= mlphy.c nsgphy.c nsphy.c nsphyter.c pci_if.h pnaphy.c qsphy.c +SRCS+= nsgphy.c nsphy.c nsphyter.c pci_if.h pnaphy.c qsphy.c SRCS+= rdcphy.c rgephy.c rlphy.c smcphy.c -SRCS+= smscphy.c tdkphy.c tlphy.c truephy.c +SRCS+= smscphy.c tdkphy.c truephy.c SRCS+= ukphy.c ukphy_subr.c SRCS+= xmphy.c From owner-dev-commits-src-main@freebsd.org Sat Dec 26 19:10:21 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 337F94C0AAE; Sat, 26 Dec 2020 19:10:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D3D0Y0xwLz4bWL; Sat, 26 Dec 2020 19:10:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1383A19F7D; Sat, 26 Dec 2020 19:10:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BQJALVX094158; Sat, 26 Dec 2020 19:10:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BQJALps094152; Sat, 26 Dec 2020 19:10:21 GMT (envelope-from git) Date: Sat, 26 Dec 2020 19:10:21 GMT Message-Id: <202012261910.0BQJALps094152@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 6270ee0b6726 - Use the base address for early arm64 page tables MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6270ee0b672614efe3e2a2384ec04721608a9658 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Dec 2020 19:10:21 -0000 The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=6270ee0b672614efe3e2a2384ec04721608a9658 commit 6270ee0b672614efe3e2a2384ec04721608a9658 Author: Andrew Turner AuthorDate: 2020-12-23 18:56:09 +0000 Commit: Andrew Turner CommitDate: 2020-12-26 19:04:57 +0000 Use the base address for early arm64 page tables Use the kernel physical base rather than the ttbr0 base when building the kernel identity map. The latter is correct with current assumptions but may not always be the case. Sponsored by: Innovate UK --- sys/arm64/arm64/locore.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/arm64/arm64/locore.S b/sys/arm64/arm64/locore.S index 20a0379a9aa1..3e7ea7b44b70 100644 --- a/sys/arm64/arm64/locore.S +++ b/sys/arm64/arm64/locore.S @@ -522,7 +522,7 @@ common: /* Create the VA = PA map */ mov x7, #(ATTR_S1_nG | ATTR_S1_IDX(VM_MEMATTR_WRITE_BACK)) - mov x9, x27 + mov x9, x28 mov x8, x9 /* VA start (== PA start) */ mov x10, #1 bl build_l1_block_pagetable From owner-dev-commits-src-main@freebsd.org Sat Dec 26 20:53:35 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CC9934C2817; Sat, 26 Dec 2020 20:53:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D3GHg5J6yz4hRn; Sat, 26 Dec 2020 20:53:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A8C861B432; Sat, 26 Dec 2020 20:53:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BQKrZaD005512; Sat, 26 Dec 2020 20:53:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BQKrZVp005511; Sat, 26 Dec 2020 20:53:35 GMT (envelope-from git) Date: Sat, 26 Dec 2020 20:53:35 GMT Message-Id: <202012262053.0BQKrZVp005511@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jamie Gritton Subject: git: 5d58f959d39b - main - jail: Fix lock-free access to dynamic pr.allow flags MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jamie X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5d58f959d39bc1d4cbe11634060c18455a46606b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Dec 2020 20:53:35 -0000 The branch main has been updated by jamie: URL: https://cgit.FreeBSD.org/src/commit/?id=5d58f959d39bc1d4cbe11634060c18455a46606b commit 5d58f959d39bc1d4cbe11634060c18455a46606b Author: Jamie Gritton AuthorDate: 2020-12-26 20:53:28 +0000 Commit: Jamie Gritton CommitDate: 2020-12-26 20:53:28 +0000 jail: Fix lock-free access to dynamic pr.allow flags Use atomic access and a memory barrier to ensure that the flag parameter in pr_flag_allow is indeed set after the rest of the structure is valid. Simplify adding flag bits with pr_allow_all, a dynamic version of PR_ALLOW_ALL_STATIC. --- sys/kern/kern_jail.c | 56 ++++++++++++++++++++++++++++++---------------------- 1 file changed, 32 insertions(+), 24 deletions(-) diff --git a/sys/kern/kern_jail.c b/sys/kern/kern_jail.c index c29d966283f8..bdcebcdfaf6c 100644 --- a/sys/kern/kern_jail.c +++ b/sys/kern/kern_jail.c @@ -121,7 +121,7 @@ MTX_SYSINIT(prison0, &prison0.pr_mtx, "jail mutex", MTX_DEF); struct bool_flags { const char *name; const char *noname; - unsigned flag; + volatile u_int flag; }; struct jailsys_flags { const char *name; @@ -185,7 +185,11 @@ static struct jailsys_flags pr_flag_jailsys[] = { }; const size_t pr_flag_jailsys_size = sizeof(pr_flag_jailsys); -/* Make this array full-size so dynamic parameters can be added. */ +/* + * Make this array full-size so dynamic parameters can be added. + * It is protected by prison0.mtx, but lockless reading is allowed + * with an atomic check of the flag values. + */ static struct bool_flags pr_flag_allow[NBBY * NBPW] = { {"allow.set_hostname", "allow.noset_hostname", PR_ALLOW_SET_HOSTNAME}, {"allow.sysvipc", "allow.nosysvipc", PR_ALLOW_SYSVIPC}, @@ -202,6 +206,7 @@ static struct bool_flags pr_flag_allow[NBBY * NBPW] = { PR_ALLOW_UNPRIV_DEBUG}, {"allow.suser", "allow.nosuser", PR_ALLOW_SUSER}, }; +static unsigned pr_allow_all = PR_ALLOW_ALL_STATIC; const size_t pr_flag_allow_size = sizeof(pr_flag_allow); #define JAIL_DEFAULT_ALLOW (PR_ALLOW_SET_HOSTNAME | \ @@ -349,7 +354,7 @@ kern_jail(struct thread *td, struct jail *j) if (!jailed(td->td_ucred)) { for (bf = pr_flag_allow; bf < pr_flag_allow + nitems(pr_flag_allow) && - bf->flag != 0; + atomic_load_int(&bf->flag) != 0; bf++) { optiov[opt.uio_iovcnt].iov_base = __DECONST(char *, (jail_default_allow & bf->flag) @@ -684,7 +689,8 @@ kern_jail_set(struct thread *td, struct uio *optuio, int flags) pr_allow = ch_allow = 0; for (bf = pr_flag_allow; - bf < pr_flag_allow + nitems(pr_flag_allow) && bf->flag != 0; + bf < pr_flag_allow + nitems(pr_flag_allow) && + atomic_load_int(&bf->flag) != 0; bf++) { vfs_flagopt(opts, bf->name, &pr_allow, bf->flag); vfs_flagopt(opts, bf->noname, &ch_allow, bf->flag); @@ -2190,7 +2196,8 @@ kern_jail_get(struct thread *td, struct uio *optuio, int flags) goto done_deref; } for (bf = pr_flag_allow; - bf < pr_flag_allow + nitems(pr_flag_allow) && bf->flag != 0; + bf < pr_flag_allow + nitems(pr_flag_allow) && + atomic_load_int(&bf->flag) != 0; bf++) { i = (pr->pr_allow & bf->flag) ? 1 : 0; error = vfs_setopt(opts, bf->name, &i, sizeof(i)); @@ -3904,7 +3911,7 @@ prison_add_allow(const char *prefix, const char *name, const char *prefix_descr, #ifndef NO_SYSCTL_DESCR char *descr_deprecated; #endif - unsigned allow_flag; + u_int allow_flag; if (prefix ? asprintf(&allow_name, M_PRISON, "allow.%s.%s", prefix, name) @@ -3923,7 +3930,8 @@ prison_add_allow(const char *prefix, const char *name, const char *prefix_descr, */ mtx_lock(&prison0.pr_mtx); for (bf = pr_flag_allow; - bf < pr_flag_allow + nitems(pr_flag_allow) && bf->flag != 0; + bf < pr_flag_allow + nitems(pr_flag_allow) && + atomic_load_int(&bf->flag) != 0; bf++) { if (strcmp(bf->name, allow_name) == 0) { allow_flag = bf->flag; @@ -3932,38 +3940,37 @@ prison_add_allow(const char *prefix, const char *name, const char *prefix_descr, } /* - * Find a free bit in prison0's pr_allow, failing if there are none + * Find a free bit in pr_allow_all, failing if there are none * (which shouldn't happen as long as we keep track of how many * potential dynamic flags exist). - * - * Due to per-jail unprivileged process debugging support - * using pr_allow, also verify against PR_ALLOW_ALL_STATIC. - * prison0 may have unprivileged process debugging unset. */ for (allow_flag = 1;; allow_flag <<= 1) { if (allow_flag == 0) goto no_add; - if (allow_flag & PR_ALLOW_ALL_STATIC) - continue; - if ((prison0.pr_allow & allow_flag) == 0) + if ((pr_allow_all & allow_flag) == 0) break; } - /* - * Note the parameter in the next open slot in pr_flag_allow. - * Set the flag last so code that checks pr_flag_allow can do so - * without locking. - */ - for (bf = pr_flag_allow; bf->flag != 0; bf++) + /* Note the parameter in the next open slot in pr_flag_allow. */ + for (bf = pr_flag_allow; ; bf++) { if (bf == pr_flag_allow + nitems(pr_flag_allow)) { /* This should never happen, but is not fatal. */ allow_flag = 0; goto no_add; } - prison0.pr_allow |= allow_flag; + if (atomic_load_int(&bf->flag) == 0) + break; + } bf->name = allow_name; bf->noname = allow_noname; - bf->flag = allow_flag; + pr_allow_all |= allow_flag; + /* + * prison0 always has permission for the new parameter. + * Other jails must have it granted to them. + */ + prison0.pr_allow |= allow_flag; + /* The flag indicates a valid entry, so make sure it is set last. */ + atomic_store_rel_int(&bf->flag, allow_flag); mtx_unlock(&prison0.pr_mtx); /* @@ -4260,7 +4267,8 @@ db_show_prison(struct prison *pr) } db_printf(" allow = 0x%x", pr->pr_allow); for (bf = pr_flag_allow; - bf < pr_flag_allow + nitems(pr_flag_allow) && bf->flag != 0; + bf < pr_flag_allow + nitems(pr_flag_allow) && + atomic_load_int(&bf->flag) != 0; bf++) if (pr->pr_allow & bf->flag) db_printf(" %s", bf->name); From owner-dev-commits-src-main@freebsd.org Sat Dec 26 21:14:46 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 64D7B4C237B; Sat, 26 Dec 2020 21:14:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D3Gm62Q9Bz4jPn; Sat, 26 Dec 2020 21:14:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4188C1B91F; Sat, 26 Dec 2020 21:14:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BQLEk2u027511; Sat, 26 Dec 2020 21:14:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BQLEkgf027510; Sat, 26 Dec 2020 21:14:46 GMT (envelope-from git) Date: Sat, 26 Dec 2020 21:14:46 GMT Message-Id: <202012262114.0BQLEkgf027510@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 26b23f07fb98 - main - sendfile: Ensure that sfio->npages is initialized MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 26b23f07fb981662debd69b9969f78864c262466 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Dec 2020 21:14:46 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=26b23f07fb981662debd69b9969f78864c262466 commit 26b23f07fb981662debd69b9969f78864c262466 Author: Mark Johnston AuthorDate: 2020-12-26 21:07:40 +0000 Commit: Mark Johnston CommitDate: 2020-12-26 21:07:40 +0000 sendfile: Ensure that sfio->npages is initialized We initialize sfio->npages only when some I/O is required to satisfy the request. However, sendfile_iodone() contains an INVARIANTS-only check that references sfio->npages, and this check is executed even if no I/O is performed, so the check may use an uninitialized value. Fix the problem by initializing sfio->npages earlier. Note that sendfile_swapin() always initializes the page array. In some rare cases we need to trim the page array so ensure that sfio->npages gets updated accordingly. Reported by: syzkaller (with KASAN) Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D27726 --- sys/kern/kern_sendfile.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/sys/kern/kern_sendfile.c b/sys/kern/kern_sendfile.c index e0b9b0e261d4..18c9ade721a9 100644 --- a/sys/kern/kern_sendfile.c +++ b/sys/kern/kern_sendfile.c @@ -413,12 +413,13 @@ out_with_ref: */ static int sendfile_swapin(vm_object_t obj, struct sf_io *sfio, int *nios, off_t off, - off_t len, int npages, int rhpages, int flags) + off_t len, int rhpages, int flags) { vm_page_t *pa; - int a, count, count1, grabbed, i, j, rv; + int a, count, count1, grabbed, i, j, npages, rv; pa = sfio->pa; + npages = sfio->npages; *nios = 0; flags = (flags & SF_NODISKIO) ? VM_ALLOC_NOWAIT : 0; sfio->pindex0 = OFF_TO_IDX(off); @@ -905,6 +906,7 @@ retry_space: sfio->obj = obj; sfio->error = 0; sfio->m = NULL; + sfio->npages = npages; #ifdef KERN_TLS /* * This doesn't use ktls_hold() because sfio->m will @@ -914,8 +916,8 @@ retry_space: sfio->tls = tls; #endif vm_object_pip_add(obj, 1); - error = sendfile_swapin(obj, sfio, &nios, off, space, npages, - rhpages, flags); + error = sendfile_swapin(obj, sfio, &nios, off, space, rhpages, + flags); if (error != 0) { if (vp != NULL) VOP_UNLOCK(vp); @@ -963,7 +965,7 @@ retry_space: if (pa[i] == NULL) { SFSTAT_INC(sf_busy); fixspace(npages, i, off, &space); - npages = i; + sfio->npages = i; softerr = EBUSY; break; } @@ -1042,12 +1044,14 @@ retry_space: if (sf == NULL) { SFSTAT_INC(sf_allocfail); sendfile_iowait(sfio, "sfnosf"); - for (int j = i; j < npages; j++) + for (int j = i; j < npages; j++) { vm_page_unwire(pa[j], PQ_INACTIVE); + pa[j] = NULL; + } if (m == NULL) softerr = ENOBUFS; fixspace(npages, i, off, &space); - npages = i; + sfio->npages = i; break; } @@ -1152,7 +1156,6 @@ prepend_header: } else { sfio->so = so; sfio->m = m0; - sfio->npages = npages; soref(so); error = (*so->so_proto->pr_usrreqs->pru_send) (so, PRUS_NOTREADY, m, NULL, NULL, td); From owner-dev-commits-src-main@freebsd.org Sat Dec 26 21:42:34 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9D9C94C3814; Sat, 26 Dec 2020 21:42:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D3HNB3rqRz4krv; Sat, 26 Dec 2020 21:42:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 773081BF73; Sat, 26 Dec 2020 21:42:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BQLgYAo060172; Sat, 26 Dec 2020 21:42:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BQLgYY2060171; Sat, 26 Dec 2020 21:42:34 GMT (envelope-from git) Date: Sat, 26 Dec 2020 21:42:34 GMT Message-Id: <202012262142.0BQLgYY2060171@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Marius Strobl Subject: git: 180439a1731a - main - sym.4: Remove remainder of SYM_SETUP_LP_PROBE_MAP documentation MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: marius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 180439a1731a3138c9d57e0b994afe82528365f9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Dec 2020 21:42:34 -0000 The branch main has been updated by marius: URL: https://cgit.FreeBSD.org/src/commit/?id=180439a1731a3138c9d57e0b994afe82528365f9 commit 180439a1731a3138c9d57e0b994afe82528365f9 Author: Marius Strobl AuthorDate: 2020-12-26 21:38:59 +0000 Commit: Marius Strobl CommitDate: 2020-12-26 21:42:26 +0000 sym.4: Remove remainder of SYM_SETUP_LP_PROBE_MAP documentation This option has been removed in 221ac8f4cd823a2b047c2807e2cf744c7176dd1f and r339575 respectively. --- share/man/man4/sym.4 | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/share/man/man4/sym.4 b/share/man/man4/sym.4 index bb043b48e0ed..7df2a0ec320e 100644 --- a/share/man/man4/sym.4 +++ b/share/man/man4/sym.4 @@ -56,7 +56,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 19, 2004 +.Dd December 26, 2020 .Dt SYM 4 .Os .Sh NAME @@ -77,10 +77,6 @@ To disable PCI parity checking (needed for broken bridges): To control driver probing against HVD buses: .Cd "options SYM_SETUP_SCSI_DIFF=" .Pp -To control chip attachment balancing between the ncr driver and this driver: -.Cd "options SYM_SETUP_LP_PROBE_MAP=" -.Ed -.Pp Alternatively, to load the driver as a module at boot time, place the following line in .Xr loader.conf 5 : From owner-dev-commits-src-main@freebsd.org Sat Dec 26 22:51:12 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A06534C4CEC; Sat, 26 Dec 2020 22:51:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D3JvN46tLz4nn0; Sat, 26 Dec 2020 22:51:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 80DC41C86A; Sat, 26 Dec 2020 22:51:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BQMpCQa031849; Sat, 26 Dec 2020 22:51:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BQMpCpQ031848; Sat, 26 Dec 2020 22:51:12 GMT (envelope-from git) Date: Sat, 26 Dec 2020 22:51:12 GMT Message-Id: <202012262251.0BQMpCpQ031848@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: f733d9701b7e - main - Fix default route handling in radix4_lockless algo. Improve nexthop debugging. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f733d9701b7ebe3ebd7b92932ec6fb7e96d3166c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Dec 2020 22:51:12 -0000 The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=f733d9701b7ebe3ebd7b92932ec6fb7e96d3166c commit f733d9701b7ebe3ebd7b92932ec6fb7e96d3166c Author: Alexander V. Chernikov AuthorDate: 2020-12-26 22:46:43 +0000 Commit: Alexander V. Chernikov CommitDate: 2020-12-26 22:51:02 +0000 Fix default route handling in radix4_lockless algo. Improve nexthop debugging. Reported by: Florian Smeets --- sys/net/route/fib_algo.c | 35 ++++++++++++++++++++++++++--------- sys/netinet/in_fib_algo.c | 7 ++++--- 2 files changed, 30 insertions(+), 12 deletions(-) diff --git a/sys/net/route/fib_algo.c b/sys/net/route/fib_algo.c index afb009d4c8cf..32bafbaca3d1 100644 --- a/sys/net/route/fib_algo.c +++ b/sys/net/route/fib_algo.c @@ -322,6 +322,21 @@ fib_error_clear() } } +static const char * +print_op_result(enum flm_op_result result) +{ + switch (result) { + case FLM_SUCCESS: + return "success"; + case FLM_REBUILD: + return "rebuild"; + case FLM_ERROR: + return "error"; + } + + return "unknown"; +} + static const char * print_family(int family) { @@ -585,18 +600,18 @@ sync_algo_end_cb(struct rib_head *rnh, enum rib_walk_hook stage, void *_data) return; } - if (stage != RIB_WALK_HOOK_POST || w->result != FLM_SUCCESS) - return; - - /* Post-dump hook, dump successful */ - if (fd->hit_nhops) { FD_PRINTF(LOG_INFO, fd, "ran out of nexthops at %u nhops", fd->nh_ref_table->count); - w->result = FLM_REBUILD; + if (w->result == FLM_SUCCESS) + w->result = FLM_REBUILD; return; } + if (stage != RIB_WALK_HOOK_POST || w->result != FLM_SUCCESS) + return; + + /* Post-dump hook, dump successful */ w->result = fd->fd_flm->flm_dump_end_cb(fd->fd_algo_data, &fd->fd_dp); if (w->result == FLM_SUCCESS) { @@ -648,7 +663,8 @@ sync_algo(struct fib_data *fd) rib_walk_ext_internal(fd->fd_rh, true, sync_algo_cb, sync_algo_end_cb, &w); - FD_PRINTF(LOG_INFO, fd, "initial dump completed."); + FD_PRINTF(LOG_INFO, fd, "initial dump completed, result: %s", + print_op_result(w.result)); return (w.result); } @@ -706,7 +722,6 @@ schedule_destroy_fd_instance(struct fib_data *fd, bool in_callout) else callout_drain(&fd->fd_callout); - FD_PRINTF(LOG_INFO, fd, "destroying old instance"); epoch_call(net_epoch_preempt, destroy_fd_instance_epoch, &fd->fd_epoch_ctx); @@ -859,6 +874,7 @@ try_setup_fd_instance(struct fib_lookup_module *flm, struct rib_head *rh, FD_PRINTF(LOG_INFO, fd, "Unable to allocate nhop refcount table (sz:%zu)", size); return (FLM_REBUILD); } + FD_PRINTF(LOG_DEBUG, fd, "Allocated %u nhop indexes", fd->number_nhops); /* Okay, we're ready for algo init */ void *old_algo_data = (old_fd != NULL) ? old_fd->fd_algo_data : NULL; @@ -920,7 +936,8 @@ setup_fd_instance(struct fib_lookup_module *flm, struct rib_head *rh, } NET_EPOCH_EXIT(et); - RH_PRINTF(LOG_INFO, rh, "try %d: fib algo result: %d", i, result); + RH_PRINTF(LOG_INFO, rh, "try %d: fib algo result: %s", i, + print_op_result(result)); if (result == FLM_REBUILD) { prev_fd = new_fd; diff --git a/sys/netinet/in_fib_algo.c b/sys/netinet/in_fib_algo.c index a5048c52b75d..92592a6a286f 100644 --- a/sys/netinet/in_fib_algo.c +++ b/sys/netinet/in_fib_algo.c @@ -590,7 +590,7 @@ lradix4_add_route_cb(struct rtentry *rt, void *_data) struct lradix4_data *lr = (struct lradix4_data *)_data; struct radix4_addr_entry *ae; struct sockaddr_in mask; - struct sockaddr *rt_mask = NULL; + struct sockaddr *rt_mask; struct radix_node *rn; struct in_addr addr4, mask4; uint32_t scopeid; @@ -607,12 +607,13 @@ lradix4_add_route_cb(struct rtentry *rt, void *_data) ae->addr.sin_len = KEY_LEN_INET; ae->addr.sin_addr = addr4; - if (mask4.s_addr != INADDR_ANY) { + if (mask4.s_addr != INADDR_BROADCAST) { bzero(&mask, sizeof(mask)); mask.sin_len = KEY_LEN_INET; mask.sin_addr = mask4; rt_mask = (struct sockaddr *)&mask; - } + } else + rt_mask = NULL; rn = lr->rnh->rnh_addaddr((struct sockaddr *)&ae->addr, rt_mask, &lr->rnh->rh, ae->rn); From owner-dev-commits-src-main@freebsd.org Sun Dec 27 00:27:28 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0648E4C73AC; Sun, 27 Dec 2020 00:27:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D3M2R6lRLz4tgQ; Sun, 27 Dec 2020 00:27:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DAA401DE8B; Sun, 27 Dec 2020 00:27:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BR0RRRH032470; Sun, 27 Dec 2020 00:27:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BR0RRNo032469; Sun, 27 Dec 2020 00:27:27 GMT (envelope-from git) Date: Sun, 27 Dec 2020 00:27:27 GMT Message-Id: <202012270027.0BR0RRNo032469@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 93900fc69799 - main - Fix daily_backup_gpart_exclude in periodic daily 221.backup-gpart MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 93900fc697992f893e2e69dce0c2f67b1f66a774 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Dec 2020 00:27:28 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=93900fc697992f893e2e69dce0c2f67b1f66a774 commit 93900fc697992f893e2e69dce0c2f67b1f66a774 Author: Ed Maste AuthorDate: 2020-12-27 00:24:18 +0000 Commit: Ed Maste CommitDate: 2020-12-27 00:27:12 +0000 Fix daily_backup_gpart_exclude in periodic daily 221.backup-gpart Since gpart_devs was not quoted (losing embedded newlines), if daily_backup_gpart_exclude matched something, gpart_devs was empty. PR: 251961 Submitted by: Kan Sasaki MFC after: 1 week --- usr.sbin/periodic/etc/daily/221.backup-gpart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/periodic/etc/daily/221.backup-gpart b/usr.sbin/periodic/etc/daily/221.backup-gpart index d71bd8ffe12a..b2bfde820272 100755 --- a/usr.sbin/periodic/etc/daily/221.backup-gpart +++ b/usr.sbin/periodic/etc/daily/221.backup-gpart @@ -54,7 +54,7 @@ case "$daily_backup_gpart_enable" in gpart_devs=$(gpart show | awk '$1 == "=>" { print $4 }') if [ -n "$daily_backup_gpart_exclude" ]; then - gpart_devs=$(echo ${gpart_devs} | grep -E -v "${daily_backup_gpart_exclude}") + gpart_devs=$(echo "${gpart_devs}" | grep -E -v "${daily_backup_gpart_exclude}") fi if [ -z "$gpart_devs" ]; then From owner-dev-commits-src-main@freebsd.org Sun Dec 27 01:01:32 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EE5BD4C756A; Sun, 27 Dec 2020 01:01:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D3Mnm6TdSz3CKV; Sun, 27 Dec 2020 01:01:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D1E061E734; Sun, 27 Dec 2020 01:01:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BR11Wqj074592; Sun, 27 Dec 2020 01:01:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BR11Wle074591; Sun, 27 Dec 2020 01:01:32 GMT (envelope-from git) Date: Sun, 27 Dec 2020 01:01:32 GMT Message-Id: <202012270101.0BR11Wle074591@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jamie Gritton Subject: git: 43c273489523 - main - jail: Make comments on struct prison locking more precise MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jamie X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 43c273489523fa39232b499ac547720f45dfffcf Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Dec 2020 01:01:33 -0000 The branch main has been updated by jamie: URL: https://cgit.FreeBSD.org/src/commit/?id=43c273489523fa39232b499ac547720f45dfffcf commit 43c273489523fa39232b499ac547720f45dfffcf Author: Jamie Gritton AuthorDate: 2020-12-27 01:01:16 +0000 Commit: Jamie Gritton CommitDate: 2020-12-27 01:01:16 +0000 jail: Make comments on struct prison locking more precise --- sys/sys/jail.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/sys/jail.h b/sys/sys/jail.h index 2a6ee07ecc47..b95406079ea1 100644 --- a/sys/sys/jail.h +++ b/sys/sys/jail.h @@ -150,15 +150,17 @@ struct prison_racct; * * Lock key: * (a) allprison_lock - * (p) locked by pr_mtx + * (m) locked by pr_mtx + * (p) locked by pr_mtx, and also at least shared allprison_lock required + * to update * (c) set only during creation before the structure is shared, no mutex * required to read */ struct prison { TAILQ_ENTRY(prison) pr_list; /* (a) all prisons */ int pr_id; /* (c) prison id */ - int pr_ref; /* (p) refcount */ - int pr_uref; /* (p) user (alive) refcount */ + int pr_ref; /* (m) refcount */ + int pr_uref; /* (m) user (alive) refcount */ unsigned pr_flags; /* (p) PR_* flags */ LIST_HEAD(, prison) pr_children; /* (a) list of child jails */ LIST_ENTRY(prison) pr_sibling; /* (a) next in parent's list */ From owner-dev-commits-src-main@freebsd.org Sun Dec 27 04:25:19 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 111414CDE1A; Sun, 27 Dec 2020 04:25:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D3SJt73PTz3QVL; Sun, 27 Dec 2020 04:25:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E54F821183; Sun, 27 Dec 2020 04:25:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BR4PI4e092659; Sun, 27 Dec 2020 04:25:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BR4PIbp092658; Sun, 27 Dec 2020 04:25:18 GMT (envelope-from git) Date: Sun, 27 Dec 2020 04:25:18 GMT Message-Id: <202012270425.0BR4PIbp092658@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jamie Gritton Subject: git: 0fe74ae624fc - main - jail: Consistently handle the pr_allow bitmask MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jamie X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0fe74ae624fcbd9378eeee30f257b08f4eae5abc Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Dec 2020 04:25:19 -0000 The branch main has been updated by jamie: URL: https://cgit.FreeBSD.org/src/commit/?id=0fe74ae624fcbd9378eeee30f257b08f4eae5abc commit 0fe74ae624fcbd9378eeee30f257b08f4eae5abc Author: Jamie Gritton AuthorDate: 2020-12-27 04:25:02 +0000 Commit: Jamie Gritton CommitDate: 2020-12-27 04:25:02 +0000 jail: Consistently handle the pr_allow bitmask Return a boolean (i.e. 0 or 1) from prison_allow, instead of the flag value itself, which is what sysctl expects. Add prison_set_allow(), which can set or clear a permission bit, and propagates cleared bits down to child jails. Use prison_allow() and prison_set_allow() in the various jail.allow.* sysctls, and others that depend on thoe permissions. Add locking around checking both pr_allow and pr_enforce_statfs in prison_priv_check(). --- sys/kern/kern_jail.c | 77 +++++++++++++++++++++++++++++++++++++++------------- sys/kern/kern_mib.c | 37 +++++++++++++++---------- sys/kern/kern_priv.c | 31 ++------------------- sys/kern/kern_prot.c | 22 ++++----------- sys/sys/jail.h | 1 + 5 files changed, 89 insertions(+), 79 deletions(-) diff --git a/sys/kern/kern_jail.c b/sys/kern/kern_jail.c index bdcebcdfaf6c..a140b6f537d1 100644 --- a/sys/kern/kern_jail.c +++ b/sys/kern/kern_jail.c @@ -140,6 +140,8 @@ static int get_next_prid(struct prison **insprp); static int do_jail_attach(struct thread *td, struct prison *pr); static void prison_complete(void *context, int pending); static void prison_deref(struct prison *pr, int flags); +static void prison_set_allow_locked(struct prison *pr, unsigned flag, + int enable); static char *prison_path(struct prison *pr1, struct prison *pr2); static void prison_remove_one(struct prison *pr); #ifdef RACCT @@ -1726,12 +1728,9 @@ kern_jail_set(struct thread *td, struct uio *optuio, int flags) } } } - if ((tallow = ch_allow & ~pr_allow)) { - /* Clear allow bits in all children. */ - FOREACH_PRISON_DESCENDANT_LOCKED(pr, tpr, descend) - tpr->pr_allow &= ~tallow; - } pr->pr_allow = (pr->pr_allow & ~ch_allow) | pr_allow; + if ((tallow = ch_allow & ~pr_allow)) + prison_set_allow_locked(pr, tallow, 0); /* * Persistent prisons get an extra reference, and prisons losing their * persist flag lose that reference. Only do this for existing prisons @@ -2589,13 +2588,15 @@ prison_find_name(struct prison *mypr, const char *name) } /* - * See if a prison has the specific flag set. + * See if a prison has the specific flag set. The prison should be locked, + * unless checking for flags that are only set at jail creation (such as + * PR_IP4 and PR_IP6), or only the single bit is examined, without regard + * to any other prison data. */ int prison_flag(struct ucred *cred, unsigned flag) { - /* This is an atomic read, so no locking is necessary. */ return (cred->cr_prison->pr_flags & flag); } @@ -2603,8 +2604,7 @@ int prison_allow(struct ucred *cred, unsigned flag) { - /* This is an atomic read, so no locking is necessary. */ - return (cred->cr_prison->pr_allow & flag); + return ((cred->cr_prison->pr_allow & flag) != 0); } /* @@ -2802,6 +2802,38 @@ prison_proc_free(struct prison *pr) mtx_unlock(&pr->pr_mtx); } +/* + * Set or clear a permission bit in the pr_allow field, passing restrictions + * (cleared permission) down to child jails. + */ +void +prison_set_allow(struct ucred *cred, unsigned flag, int enable) +{ + struct prison *pr; + + pr = cred->cr_prison; + sx_slock(&allprison_lock); + mtx_lock(&pr->pr_mtx); + prison_set_allow_locked(pr, flag, enable); + mtx_unlock(&pr->pr_mtx); + sx_sunlock(&allprison_lock); +} + +static void +prison_set_allow_locked(struct prison *pr, unsigned flag, int enable) +{ + struct prison *cpr; + int descend; + + if (enable != 0) + pr->pr_allow |= flag; + else { + pr->pr_allow &= ~flag; + FOREACH_PRISON_DESCENDANT_LOCKED(pr, cpr, descend) + cpr->pr_allow &= ~flag; + } +} + /* * Check if a jail supports the given address family. * @@ -3117,6 +3149,8 @@ prison_enforce_statfs(struct ucred *cred, struct mount *mp, struct statfs *sp) int prison_priv_check(struct ucred *cred, int priv) { + struct prison *pr; + int error; /* * Some policies have custom handlers. This routine should not be @@ -3388,11 +3422,14 @@ prison_priv_check(struct ucred *cred, int priv) case PRIV_VFS_UNMOUNT: case PRIV_VFS_MOUNT_NONUSER: case PRIV_VFS_MOUNT_OWNER: - if (cred->cr_prison->pr_allow & PR_ALLOW_MOUNT && - cred->cr_prison->pr_enforce_statfs < 2) - return (0); + pr = cred->cr_prison; + prison_lock(pr); + if (pr->pr_allow & PR_ALLOW_MOUNT && pr->pr_enforce_statfs < 2) + error = 0; else - return (EPERM); + error = EPERM; + prison_unlock(pr); + return (error); /* * Jails should hold no disposition on the PRIV_VFS_READ_DIR @@ -3685,14 +3722,16 @@ SYSCTL_UINT(_security_jail, OID_AUTO, jail_max_af_ips, CTLFLAG_RW, static int sysctl_jail_default_allow(SYSCTL_HANDLER_ARGS) { - struct prison *pr; - int allow, error, i; - - pr = req->td->td_ucred->cr_prison; - allow = (pr == &prison0) ? jail_default_allow : pr->pr_allow; + int error, i; /* Get the current flag value, and convert it to a boolean. */ - i = (allow & arg2) ? 1 : 0; + if (req->td->td_ucred->cr_prison == &prison0) { + mtx_lock(&prison0.pr_mtx); + i = (jail_default_allow & arg2) != 0; + mtx_unlock(&prison0.pr_mtx); + } else + i = prison_allow(req->td->td_ucred, arg2); + if (arg1 != NULL) i = !i; error = sysctl_handle_int(oidp, &i, 0, req); diff --git a/sys/kern/kern_mib.c b/sys/kern/kern_mib.c index abd04b47023b..483bbe453b0c 100644 --- a/sys/kern/kern_mib.c +++ b/sys/kern/kern_mib.c @@ -346,25 +346,27 @@ sysctl_hostname(SYSCTL_HANDLER_ARGS) KASSERT(len <= sizeof(tmpname), ("length %d too long for %s", len, __func__)); - pr = req->td->td_ucred->cr_prison; - if (!(pr->pr_allow & PR_ALLOW_SET_HOSTNAME) && req->newptr) - return (EPERM); /* * Make a local copy of hostname to get/set so we don't have to hold * the jail mutex during the sysctl copyin/copyout activities. */ + pr = req->td->td_ucred->cr_prison; mtx_lock(&pr->pr_mtx); bcopy((char *)pr + pr_offset, tmpname, len); mtx_unlock(&pr->pr_mtx); error = sysctl_handle_string(oidp, tmpname, len, req); + if (error != 0 || req->newptr == NULL) + return (error); - if (req->newptr != NULL && error == 0) { - /* - * Copy the locally set hostname to all jails that share - * this host info. - */ - sx_slock(&allprison_lock); + /* + * Copy the locally set hostname to all jails that share + * this host info. + */ + sx_slock(&allprison_lock); + if (!(pr->pr_allow & PR_ALLOW_SET_HOSTNAME)) + error = EPERM; + else { while (!(pr->pr_flags & PR_HOST)) pr = pr->pr_parent; mtx_lock(&pr->pr_mtx); @@ -375,8 +377,8 @@ sysctl_hostname(SYSCTL_HANDLER_ARGS) else bcopy(tmpname, (char *)cpr + pr_offset, len); mtx_unlock(&pr->pr_mtx); - sx_sunlock(&allprison_lock); } + sx_sunlock(&allprison_lock); return (error); } @@ -465,13 +467,18 @@ sysctl_hostid(SYSCTL_HANDLER_ARGS) * instead of a string, and is used only for hostid. */ pr = req->td->td_ucred->cr_prison; - if (!(pr->pr_allow & PR_ALLOW_SET_HOSTNAME) && req->newptr) - return (EPERM); + mtx_lock(&pr->pr_mtx); tmpid = pr->pr_hostid; + mtx_unlock(&pr->pr_mtx); + error = sysctl_handle_long(oidp, &tmpid, 0, req); + if (error != 0 || req->newptr == NULL) + return (error); - if (req->newptr != NULL && error == 0) { - sx_slock(&allprison_lock); + sx_slock(&allprison_lock); + if (!(pr->pr_allow & PR_ALLOW_SET_HOSTNAME)) + error = EPERM; + else { while (!(pr->pr_flags & PR_HOST)) pr = pr->pr_parent; mtx_lock(&pr->pr_mtx); @@ -482,8 +489,8 @@ sysctl_hostid(SYSCTL_HANDLER_ARGS) else cpr->pr_hostid = tmpid; mtx_unlock(&pr->pr_mtx); - sx_sunlock(&allprison_lock); } + sx_sunlock(&allprison_lock); return (error); } diff --git a/sys/kern/kern_priv.c b/sys/kern/kern_priv.c index b621de58f685..c1bd373bcb9e 100644 --- a/sys/kern/kern_priv.c +++ b/sys/kern/kern_priv.c @@ -63,46 +63,21 @@ static bool suser_enabled(struct ucred *cred) { - return (prison_allow(cred, PR_ALLOW_SUSER) ? true : false); -} - -static void inline -prison_suser_set(struct prison *pr, int enabled) -{ - - if (enabled) { - pr->pr_allow |= PR_ALLOW_SUSER; - } else { - pr->pr_allow &= ~PR_ALLOW_SUSER; - } + return (prison_allow(cred, PR_ALLOW_SUSER)); } static int sysctl_kern_suser_enabled(SYSCTL_HANDLER_ARGS) { - struct prison *pr, *cpr; struct ucred *cred; - int descend, error, enabled; + int error, enabled; cred = req->td->td_ucred; enabled = suser_enabled(cred); - error = sysctl_handle_int(oidp, &enabled, 0, req); if (error || !req->newptr) return (error); - - pr = cred->cr_prison; - sx_slock(&allprison_lock); - mtx_lock(&pr->pr_mtx); - - prison_suser_set(pr, enabled); - if (!enabled) { - FOREACH_PRISON_DESCENDANT_LOCKED(pr, cpr, descend) { - prison_suser_set(cpr, 0); - } - } - mtx_unlock(&pr->pr_mtx); - sx_sunlock(&allprison_lock); + prison_set_allow(cred, PR_ALLOW_SUSER, enabled); return (0); } diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c index 73b89582230d..529a6de4b2c8 100644 --- a/sys/kern/kern_prot.c +++ b/sys/kern/kern_prot.c @@ -1646,28 +1646,16 @@ p_cansched(struct thread *td, struct proc *p) static int sysctl_unprivileged_proc_debug(SYSCTL_HANDLER_ARGS) { - struct prison *pr; int error, val; - val = prison_allow(req->td->td_ucred, PR_ALLOW_UNPRIV_DEBUG) != 0; + val = prison_allow(req->td->td_ucred, PR_ALLOW_UNPRIV_DEBUG); error = sysctl_handle_int(oidp, &val, 0, req); if (error != 0 || req->newptr == NULL) return (error); - pr = req->td->td_ucred->cr_prison; - mtx_lock(&pr->pr_mtx); - switch (val) { - case 0: - pr->pr_allow &= ~(PR_ALLOW_UNPRIV_DEBUG); - break; - case 1: - pr->pr_allow |= PR_ALLOW_UNPRIV_DEBUG; - break; - default: - error = EINVAL; - } - mtx_unlock(&pr->pr_mtx); - - return (error); + if (val != 0 && val != 1) + return (EINVAL); + prison_set_allow(req->td->td_ucred, PR_ALLOW_UNPRIV_DEBUG, val); + return (0); } /* diff --git a/sys/sys/jail.h b/sys/sys/jail.h index b95406079ea1..96201b0638b3 100644 --- a/sys/sys/jail.h +++ b/sys/sys/jail.h @@ -405,6 +405,7 @@ void prison_hold(struct prison *pr); void prison_hold_locked(struct prison *pr); void prison_proc_hold(struct prison *); void prison_proc_free(struct prison *); +void prison_set_allow(struct ucred *cred, unsigned flag, int enable); int prison_ischild(struct prison *, struct prison *); int prison_equal_ip4(struct prison *, struct prison *); int prison_get_ip4(struct ucred *cred, struct in_addr *ia); From owner-dev-commits-src-main@freebsd.org Sun Dec 27 04:50:20 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 28BC74CE0F6; Sun, 27 Dec 2020 04:50:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D3Ssm0chLz3h7H; Sun, 27 Dec 2020 04:50:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0859D211B9; Sun, 27 Dec 2020 04:50:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BR4oJ4T020850; Sun, 27 Dec 2020 04:50:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BR4oJoq020846; Sun, 27 Dec 2020 04:50:19 GMT (envelope-from git) Date: Sun, 27 Dec 2020 04:50:19 GMT Message-Id: <202012270450.0BR4oJoq020846@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jamie Gritton Subject: git: 7f4e724829e5 - main - jail: add a missing lock around an osd_jail_call(). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jamie X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7f4e724829e556fc646056669c2af3551b7e8724 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Dec 2020 04:50:20 -0000 The branch main has been updated by jamie: URL: https://cgit.FreeBSD.org/src/commit/?id=7f4e724829e556fc646056669c2af3551b7e8724 commit 7f4e724829e556fc646056669c2af3551b7e8724 Author: Jamie Gritton AuthorDate: 2020-12-27 04:49:30 +0000 Commit: Jamie Gritton CommitDate: 2020-12-27 04:49:30 +0000 jail: add a missing lock around an osd_jail_call(). allprison_lock should be at least held shared when jail OSD methods are called. Add a shared lock around one such call where that wasn't the case. In another such call, change an exclusive lock grab to be shared in what is likely the more common case. --- sys/kern/kern_jail.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/sys/kern/kern_jail.c b/sys/kern/kern_jail.c index a140b6f537d1..fb77cf87126d 100644 --- a/sys/kern/kern_jail.c +++ b/sys/kern/kern_jail.c @@ -2498,8 +2498,9 @@ do_jail_attach(struct thread *td, struct prison *pr) VOP_UNLOCK(pr->pr_root); e_revert_osd: /* Tell modules this thread is still in its old jail after all. */ + sx_slock(&allprison_lock); (void)osd_jail_call(td->td_ucred->cr_prison, PR_METHOD_ATTACH, td); - prison_deref(pr, PD_DEREF | PD_DEUREF); + prison_deref(pr, PD_DEREF | PD_DEUREF | PD_LIST_SLOCKED); return (error); } @@ -2687,8 +2688,13 @@ prison_deref(struct prison *pr, int flags) */ if (lasturef) { if (!(flags & (PD_LIST_SLOCKED | PD_LIST_XLOCKED))) { - sx_xlock(&allprison_lock); - flags |= PD_LIST_XLOCKED; + if (ref > 1) { + sx_slock(&allprison_lock); + flags |= PD_LIST_SLOCKED; + } else { + sx_xlock(&allprison_lock); + flags |= PD_LIST_XLOCKED; + } } (void)osd_jail_call(pr, PR_METHOD_REMOVE, NULL); mtx_lock(&pr->pr_mtx); From owner-dev-commits-src-main@freebsd.org Sun Dec 27 10:57:39 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8A4434B6E58; Sun, 27 Dec 2020 10:57:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D3d1b3X0gz4SNs; Sun, 27 Dec 2020 10:57:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 66ED325D1D; Sun, 27 Dec 2020 10:57:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BRAvdJO013879; Sun, 27 Dec 2020 10:57:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BRAvd9M013878; Sun, 27 Dec 2020 10:57:39 GMT (envelope-from git) Date: Sun, 27 Dec 2020 10:57:39 GMT Message-Id: <202012271057.0BRAvd9M013878@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 0ef405eee935 - main - kqueue(2): Use .Fo instead .Ft MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0ef405eee935e9c8c87f82461da95edf813b780c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Dec 2020 10:57:39 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=0ef405eee935e9c8c87f82461da95edf813b780c commit 0ef405eee935e9c8c87f82461da95edf813b780c Author: Konstantin Belousov AuthorDate: 2020-12-23 15:22:09 +0000 Commit: Konstantin Belousov CommitDate: 2020-12-27 10:57:26 +0000 kqueue(2): Use .Fo instead .Ft MFC after: 3 days Sponsored by: The FreeBSD Foundation --- lib/libc/sys/kqueue.2 | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/libc/sys/kqueue.2 b/lib/libc/sys/kqueue.2 index 95fc86d01a83..ef4278cf3c35 100644 --- a/lib/libc/sys/kqueue.2 +++ b/lib/libc/sys/kqueue.2 @@ -38,7 +38,14 @@ .Ft int .Fn kqueue "void" .Ft int -.Fn kevent "int kq" "const struct kevent *changelist" "int nchanges" "struct kevent *eventlist" "int nevents" "const struct timespec *timeout" +.Fo kevent +.Fa "int kq" +.Fa "const struct kevent *changelist" +.Fa "int nchanges" +.Fa "struct kevent *eventlist" +.Fa "int nevents" +.Fa "const struct timespec *timeout" +.Fc .Fn EV_SET "kev" ident filter flags fflags data udata .Sh DESCRIPTION The From owner-dev-commits-src-main@freebsd.org Sun Dec 27 10:57:39 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 51C624B7132; Sun, 27 Dec 2020 10:57:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D3d1b1rvKz4SRb; Sun, 27 Dec 2020 10:57:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 327E725F8B; Sun, 27 Dec 2020 10:57:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BRAvdD2013828; Sun, 27 Dec 2020 10:57:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BRAvdTm013827; Sun, 27 Dec 2020 10:57:39 GMT (envelope-from git) Date: Sun, 27 Dec 2020 10:57:39 GMT Message-Id: <202012271057.0BRAvdTm013827@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 9dd48b87e6ca - main - Regen. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9dd48b87e6caa617799700db7f2f5db91b68dbcc Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Dec 2020 10:57:39 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=9dd48b87e6caa617799700db7f2f5db91b68dbcc commit 9dd48b87e6caa617799700db7f2f5db91b68dbcc Author: Konstantin Belousov AuthorDate: 2020-12-27 10:55:50 +0000 Commit: Konstantin Belousov CommitDate: 2020-12-27 10:57:27 +0000 Regen. --- sys/compat/freebsd32/freebsd32_syscall.h | 3 ++- sys/compat/freebsd32/freebsd32_syscalls.c | 1 + sys/compat/freebsd32/freebsd32_sysent.c | 1 + sys/compat/freebsd32/freebsd32_systrace_args.c | 30 ++++++++++++++++++++++++++ sys/kern/init_sysent.c | 1 + sys/kern/syscalls.c | 1 + sys/kern/systrace_args.c | 30 ++++++++++++++++++++++++++ sys/sys/syscall.h | 3 ++- sys/sys/syscall.mk | 3 ++- sys/sys/sysproto.h | 7 ++++++ 10 files changed, 77 insertions(+), 3 deletions(-) diff --git a/sys/compat/freebsd32/freebsd32_syscall.h b/sys/compat/freebsd32/freebsd32_syscall.h index d5493ace13c4..f3633479f271 100644 --- a/sys/compat/freebsd32/freebsd32_syscall.h +++ b/sys/compat/freebsd32/freebsd32_syscall.h @@ -503,4 +503,5 @@ #define FREEBSD32_SYS___realpathat 574 #define FREEBSD32_SYS_close_range 575 #define FREEBSD32_SYS_rpctls_syscall 576 -#define FREEBSD32_SYS_MAXSYSCALL 577 +#define FREEBSD32_SYS___specialfd 577 +#define FREEBSD32_SYS_MAXSYSCALL 578 diff --git a/sys/compat/freebsd32/freebsd32_syscalls.c b/sys/compat/freebsd32/freebsd32_syscalls.c index d13d5e44115c..bb0af9d0b546 100644 --- a/sys/compat/freebsd32/freebsd32_syscalls.c +++ b/sys/compat/freebsd32/freebsd32_syscalls.c @@ -613,4 +613,5 @@ const char *freebsd32_syscallnames[] = { "__realpathat", /* 574 = __realpathat */ "close_range", /* 575 = close_range */ "rpctls_syscall", /* 576 = rpctls_syscall */ + "__specialfd", /* 577 = __specialfd */ }; diff --git a/sys/compat/freebsd32/freebsd32_sysent.c b/sys/compat/freebsd32/freebsd32_sysent.c index dfa05880978e..0207bb356041 100644 --- a/sys/compat/freebsd32/freebsd32_sysent.c +++ b/sys/compat/freebsd32/freebsd32_sysent.c @@ -666,4 +666,5 @@ struct sysent freebsd32_sysent[] = { { .sy_narg = AS(__realpathat_args), .sy_call = (sy_call_t *)sys___realpathat, .sy_auevent = AUE_REALPATHAT, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 574 = __realpathat */ { .sy_narg = AS(close_range_args), .sy_call = (sy_call_t *)sys_close_range, .sy_auevent = AUE_CLOSERANGE, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 575 = close_range */ { .sy_narg = AS(rpctls_syscall_args), .sy_call = (sy_call_t *)lkmressys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 576 = rpctls_syscall */ + { .sy_narg = AS(__specialfd_args), .sy_call = (sy_call_t *)sys___specialfd, .sy_auevent = AUE_SPECIALFD, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 577 = __specialfd */ }; diff --git a/sys/compat/freebsd32/freebsd32_systrace_args.c b/sys/compat/freebsd32/freebsd32_systrace_args.c index 6822bc29b551..88a073508586 100644 --- a/sys/compat/freebsd32/freebsd32_systrace_args.c +++ b/sys/compat/freebsd32/freebsd32_systrace_args.c @@ -3384,6 +3384,15 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) *n_args = 2; break; } + /* __specialfd */ + case 577: { + struct __specialfd_args *p = params; + iarg[0] = p->type; /* int */ + uarg[1] = (intptr_t) p->req; /* const void * */ + uarg[2] = p->len; /* size_t */ + *n_args = 3; + break; + } default: *n_args = 0; break; @@ -9124,6 +9133,22 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) break; }; break; + /* __specialfd */ + case 577: + switch(ndx) { + case 0: + p = "int"; + break; + case 1: + p = "userland const void *"; + break; + case 2: + p = "size_t"; + break; + default: + break; + }; + break; default: break; }; @@ -11028,6 +11053,11 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) if (ndx == 0 || ndx == 1) p = "int"; break; + /* __specialfd */ + case 577: + if (ndx == 0 || ndx == 1) + p = "int"; + break; default: break; }; diff --git a/sys/kern/init_sysent.c b/sys/kern/init_sysent.c index adf57817f66b..80b10ac6b626 100644 --- a/sys/kern/init_sysent.c +++ b/sys/kern/init_sysent.c @@ -632,4 +632,5 @@ struct sysent sysent[] = { { .sy_narg = AS(__realpathat_args), .sy_call = (sy_call_t *)sys___realpathat, .sy_auevent = AUE_REALPATHAT, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 574 = __realpathat */ { .sy_narg = AS(close_range_args), .sy_call = (sy_call_t *)sys_close_range, .sy_auevent = AUE_CLOSERANGE, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 575 = close_range */ { .sy_narg = AS(rpctls_syscall_args), .sy_call = (sy_call_t *)lkmressys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 576 = rpctls_syscall */ + { .sy_narg = AS(__specialfd_args), .sy_call = (sy_call_t *)sys___specialfd, .sy_auevent = AUE_SPECIALFD, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 577 = __specialfd */ }; diff --git a/sys/kern/syscalls.c b/sys/kern/syscalls.c index e1d7cdaf9f3d..e986d999640f 100644 --- a/sys/kern/syscalls.c +++ b/sys/kern/syscalls.c @@ -583,4 +583,5 @@ const char *syscallnames[] = { "__realpathat", /* 574 = __realpathat */ "close_range", /* 575 = close_range */ "rpctls_syscall", /* 576 = rpctls_syscall */ + "__specialfd", /* 577 = __specialfd */ }; diff --git a/sys/kern/systrace_args.c b/sys/kern/systrace_args.c index a3ca65f4cc11..8076cc441137 100644 --- a/sys/kern/systrace_args.c +++ b/sys/kern/systrace_args.c @@ -3376,6 +3376,15 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) *n_args = 2; break; } + /* __specialfd */ + case 577: { + struct __specialfd_args *p = params; + iarg[0] = p->type; /* int */ + uarg[1] = (intptr_t) p->req; /* const void * */ + uarg[2] = p->len; /* size_t */ + *n_args = 3; + break; + } default: *n_args = 0; break; @@ -9029,6 +9038,22 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) break; }; break; + /* __specialfd */ + case 577: + switch(ndx) { + case 0: + p = "int"; + break; + case 1: + p = "userland const void *"; + break; + case 2: + p = "size_t"; + break; + default: + break; + }; + break; default: break; }; @@ -10960,6 +10985,11 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) if (ndx == 0 || ndx == 1) p = "int"; break; + /* __specialfd */ + case 577: + if (ndx == 0 || ndx == 1) + p = "int"; + break; default: break; }; diff --git a/sys/sys/syscall.h b/sys/sys/syscall.h index 550d9b735e06..cbbbe7c1d211 100644 --- a/sys/sys/syscall.h +++ b/sys/sys/syscall.h @@ -512,4 +512,5 @@ #define SYS___realpathat 574 #define SYS_close_range 575 #define SYS_rpctls_syscall 576 -#define SYS_MAXSYSCALL 577 +#define SYS___specialfd 577 +#define SYS_MAXSYSCALL 578 diff --git a/sys/sys/syscall.mk b/sys/sys/syscall.mk index 63d73c1e4830..ecd82f1722da 100644 --- a/sys/sys/syscall.mk +++ b/sys/sys/syscall.mk @@ -417,4 +417,5 @@ MIASM = \ sigfastblock.o \ __realpathat.o \ close_range.o \ - rpctls_syscall.o + rpctls_syscall.o \ + __specialfd.o diff --git a/sys/sys/sysproto.h b/sys/sys/sysproto.h index 03abffb41afb..3ff472872a5a 100644 --- a/sys/sys/sysproto.h +++ b/sys/sys/sysproto.h @@ -1836,6 +1836,11 @@ struct rpctls_syscall_args { char op_l_[PADL_(int)]; int op; char op_r_[PADR_(int)]; char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; }; +struct __specialfd_args { + char type_l_[PADL_(int)]; int type; char type_r_[PADR_(int)]; + char req_l_[PADL_(const void *)]; const void * req; char req_r_[PADR_(const void *)]; + char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)]; +}; int nosys(struct thread *, struct nosys_args *); void sys_sys_exit(struct thread *, struct sys_exit_args *); int sys_fork(struct thread *, struct fork_args *); @@ -2227,6 +2232,7 @@ int sys_sigfastblock(struct thread *, struct sigfastblock_args *); int sys___realpathat(struct thread *, struct __realpathat_args *); int sys_close_range(struct thread *, struct close_range_args *); int sys_rpctls_syscall(struct thread *, struct rpctls_syscall_args *); +int sys___specialfd(struct thread *, struct __specialfd_args *); #ifdef COMPAT_43 @@ -3158,6 +3164,7 @@ int freebsd12_closefrom(struct thread *, struct freebsd12_closefrom_args *); #define SYS_AUE___realpathat AUE_REALPATHAT #define SYS_AUE_close_range AUE_CLOSERANGE #define SYS_AUE_rpctls_syscall AUE_NULL +#define SYS_AUE___specialfd AUE_SPECIALFD #undef PAD_ #undef PADL_ From owner-dev-commits-src-main@freebsd.org Sun Dec 27 10:57:39 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BD43A4B6E59; Sun, 27 Dec 2020 10:57:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D3d1b4MJMz4SmN; Sun, 27 Dec 2020 10:57:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8739025CBF; Sun, 27 Dec 2020 10:57:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BRAvdN1013913; Sun, 27 Dec 2020 10:57:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BRAvdqK013912; Sun, 27 Dec 2020 10:57:39 GMT (envelope-from git) Date: Sun, 27 Dec 2020 10:57:39 GMT Message-Id: <202012271057.0BRAvdqK013912@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 7a202823aa54 - main - Expose eventfd in the native API/ABI using a new __specialfd syscall MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7a202823aa54ba18c485bdbcf355269bcfee1ab9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Dec 2020 10:57:39 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=7a202823aa54ba18c485bdbcf355269bcfee1ab9 commit 7a202823aa54ba18c485bdbcf355269bcfee1ab9 Author: Konstantin Belousov AuthorDate: 2020-12-23 14:14:04 +0000 Commit: Konstantin Belousov CommitDate: 2020-12-27 10:57:26 +0000 Expose eventfd in the native API/ABI using a new __specialfd syscall eventfd is a Linux system call that produces special file descriptors for event notification. When porting Linux software, it is currently usually emulated by epoll-shim on top of kqueues. Unfortunately, kqueues are not passable between processes. And, as noted by the author of epoll-shim, even if they were, the library state would also have to be passed somehow. This came up when debugging strange HW video decode failures in Firefox. A native implementation would avoid these problems and help with porting Linux software. Since we now already have an eventfd implementation in the kernel (for the Linuxulator), it's pretty easy to expose it natively, which is what this patch does. Submitted by: greg@unrelenting.technology Reviewed by: markj (previous version) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D26668 --- sys/bsm/audit_kevents.h | 1 + sys/compat/freebsd32/syscalls.master | 2 + sys/compat/linux/linux_event.c | 368 ++++------------------------------- sys/conf/files | 1 + sys/kern/capabilities.conf | 5 + sys/kern/kern_descrip.c | 4 +- sys/kern/sys_eventfd.c | 349 +++++++++++++++++++++++++++++++++ sys/kern/sys_generic.c | 63 ++++++ sys/kern/syscalls.master | 7 + sys/sys/eventfd.h | 54 +++++ sys/sys/file.h | 2 +- sys/sys/specialfd.h | 42 ++++ sys/sys/syscallsubr.h | 1 + sys/sys/user.h | 5 + 14 files changed, 574 insertions(+), 330 deletions(-) diff --git a/sys/bsm/audit_kevents.h b/sys/bsm/audit_kevents.h index 150ecc1b49ac..5b37329078a1 100644 --- a/sys/bsm/audit_kevents.h +++ b/sys/bsm/audit_kevents.h @@ -659,6 +659,7 @@ #define AUE_SHMRENAME 43263 /* FreeBSD-specific. */ #define AUE_REALPATHAT 43264 /* FreeBSD-specific. */ #define AUE_CLOSERANGE 43265 /* FreeBSD-specific. */ +#define AUE_SPECIALFD 43266 /* FreeBSD-specific. */ /* * Darwin BSM uses a number of AUE_O_* definitions, which are aliased to the diff --git a/sys/compat/freebsd32/syscalls.master b/sys/compat/freebsd32/syscalls.master index 1e3d26d727a1..f4339795781a 100644 --- a/sys/compat/freebsd32/syscalls.master +++ b/sys/compat/freebsd32/syscalls.master @@ -1168,5 +1168,7 @@ ; 576 is initialised by the krpc code, if present. 576 AUE_NULL NOSTD|NOPROTO { int rpctls_syscall(int op, \ const char *path); } +577 AUE_SPECIALFD NOPROTO { int __specialfd(int type, const void *req, \ + size_t len); } ; vim: syntax=off diff --git a/sys/compat/linux/linux_event.c b/sys/compat/linux/linux_event.c index c67d62d8aff0..b4b4be1f7b49 100644 --- a/sys/compat/linux/linux_event.c +++ b/sys/compat/linux/linux_event.c @@ -51,9 +51,11 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include +#include #ifdef COMPAT_LINUX32 #include @@ -124,53 +126,11 @@ struct epoll_copyout_args { int error; }; -/* eventfd */ -typedef uint64_t eventfd_t; - -static fo_rdwr_t eventfd_read; -static fo_rdwr_t eventfd_write; -static fo_ioctl_t eventfd_ioctl; -static fo_poll_t eventfd_poll; -static fo_kqfilter_t eventfd_kqfilter; -static fo_stat_t eventfd_stat; -static fo_close_t eventfd_close; -static fo_fill_kinfo_t eventfd_fill_kinfo; - -static struct fileops eventfdops = { - .fo_read = eventfd_read, - .fo_write = eventfd_write, - .fo_truncate = invfo_truncate, - .fo_ioctl = eventfd_ioctl, - .fo_poll = eventfd_poll, - .fo_kqfilter = eventfd_kqfilter, - .fo_stat = eventfd_stat, - .fo_close = eventfd_close, - .fo_chmod = invfo_chmod, - .fo_chown = invfo_chown, - .fo_sendfile = invfo_sendfile, - .fo_fill_kinfo = eventfd_fill_kinfo, - .fo_flags = DFLAG_PASSABLE -}; - -static void filt_eventfddetach(struct knote *kn); -static int filt_eventfdread(struct knote *kn, long hint); -static int filt_eventfdwrite(struct knote *kn, long hint); - -static struct filterops eventfd_rfiltops = { - .f_isfd = 1, - .f_detach = filt_eventfddetach, - .f_event = filt_eventfdread -}; -static struct filterops eventfd_wfiltops = { - .f_isfd = 1, - .f_detach = filt_eventfddetach, - .f_event = filt_eventfdwrite -}; - /* timerfd */ typedef uint64_t timerfd_t; static fo_rdwr_t timerfd_read; +static fo_ioctl_t timerfd_ioctl; static fo_poll_t timerfd_poll; static fo_kqfilter_t timerfd_kqfilter; static fo_stat_t timerfd_stat; @@ -181,7 +141,7 @@ static struct fileops timerfdops = { .fo_read = timerfd_read, .fo_write = invfo_rdwr, .fo_truncate = invfo_truncate, - .fo_ioctl = eventfd_ioctl, + .fo_ioctl = timerfd_ioctl, .fo_poll = timerfd_poll, .fo_kqfilter = timerfd_kqfilter, .fo_stat = timerfd_stat, @@ -202,13 +162,6 @@ static struct filterops timerfd_rfiltops = { .f_event = filt_timerfdread }; -struct eventfd { - eventfd_t efd_count; - uint32_t efd_flags; - struct selinfo efd_sel; - struct mtx efd_lock; -}; - struct timerfd { clockid_t tfd_clockid; struct itimerspec tfd_time; @@ -219,7 +172,6 @@ struct timerfd { struct mtx tfd_lock; }; -static int eventfd_create(struct thread *td, uint32_t initval, int flags); static void linux_timerfd_expire(void *); static void linux_timerfd_curval(struct timerfd *, struct itimerspec *); @@ -691,294 +643,39 @@ epoll_delete_all_events(struct thread *td, struct file *epfp, int fd) return (error1 == 0 ? 0 : error2); } -static int -eventfd_create(struct thread *td, uint32_t initval, int flags) -{ - struct filedesc *fdp; - struct eventfd *efd; - struct file *fp; - int fflags, fd, error; - - fflags = 0; - if ((flags & LINUX_O_CLOEXEC) != 0) - fflags |= O_CLOEXEC; - - fdp = td->td_proc->p_fd; - error = falloc(td, &fp, &fd, fflags); - if (error != 0) - return (error); - - efd = malloc(sizeof(*efd), M_EPOLL, M_WAITOK | M_ZERO); - efd->efd_flags = flags; - efd->efd_count = initval; - mtx_init(&efd->efd_lock, "eventfd", NULL, MTX_DEF); - - knlist_init_mtx(&efd->efd_sel.si_note, &efd->efd_lock); - - fflags = FREAD | FWRITE; - if ((flags & LINUX_O_NONBLOCK) != 0) - fflags |= FNONBLOCK; - - finit(fp, fflags, DTYPE_LINUXEFD, efd, &eventfdops); - fdrop(fp, td); - - td->td_retval[0] = fd; - return (error); -} - #ifdef LINUX_LEGACY_SYSCALLS int linux_eventfd(struct thread *td, struct linux_eventfd_args *args) { + struct specialfd_eventfd ae; - return (eventfd_create(td, args->initval, 0)); + bzero(&ae, sizeof(ae)); + ae.initval = args->initval; + return (kern_specialfd(td, SPECIALFD_EVENTFD, &ae)); } #endif int linux_eventfd2(struct thread *td, struct linux_eventfd2_args *args) { + struct specialfd_eventfd ae; + int flags; - if ((args->flags & ~(LINUX_O_CLOEXEC|LINUX_O_NONBLOCK|LINUX_EFD_SEMAPHORE)) != 0) - return (EINVAL); - - return (eventfd_create(td, args->initval, args->flags)); -} - -static int -eventfd_close(struct file *fp, struct thread *td) -{ - struct eventfd *efd; - - efd = fp->f_data; - if (fp->f_type != DTYPE_LINUXEFD || efd == NULL) - return (EINVAL); - - seldrain(&efd->efd_sel); - knlist_destroy(&efd->efd_sel.si_note); - - fp->f_ops = &badfileops; - mtx_destroy(&efd->efd_lock); - free(efd, M_EPOLL); - - return (0); -} - -static int -eventfd_read(struct file *fp, struct uio *uio, struct ucred *active_cred, - int flags, struct thread *td) -{ - struct eventfd *efd; - eventfd_t count; - int error; - - efd = fp->f_data; - if (fp->f_type != DTYPE_LINUXEFD || efd == NULL) - return (EINVAL); - - if (uio->uio_resid < sizeof(eventfd_t)) - return (EINVAL); - - error = 0; - mtx_lock(&efd->efd_lock); -retry: - if (efd->efd_count == 0) { - if ((fp->f_flag & FNONBLOCK) != 0) { - mtx_unlock(&efd->efd_lock); - return (EAGAIN); - } - error = mtx_sleep(&efd->efd_count, &efd->efd_lock, PCATCH, "lefdrd", 0); - if (error == 0) - goto retry; - } - if (error == 0) { - if ((efd->efd_flags & LINUX_EFD_SEMAPHORE) != 0) { - count = 1; - --efd->efd_count; - } else { - count = efd->efd_count; - efd->efd_count = 0; - } - KNOTE_LOCKED(&efd->efd_sel.si_note, 0); - selwakeup(&efd->efd_sel); - wakeup(&efd->efd_count); - mtx_unlock(&efd->efd_lock); - error = uiomove(&count, sizeof(eventfd_t), uio); - } else - mtx_unlock(&efd->efd_lock); - - return (error); -} - -static int -eventfd_write(struct file *fp, struct uio *uio, struct ucred *active_cred, - int flags, struct thread *td) -{ - struct eventfd *efd; - eventfd_t count; - int error; - - efd = fp->f_data; - if (fp->f_type != DTYPE_LINUXEFD || efd == NULL) - return (EINVAL); - - if (uio->uio_resid < sizeof(eventfd_t)) - return (EINVAL); - - error = uiomove(&count, sizeof(eventfd_t), uio); - if (error != 0) - return (error); - if (count == UINT64_MAX) - return (EINVAL); - - mtx_lock(&efd->efd_lock); -retry: - if (UINT64_MAX - efd->efd_count <= count) { - if ((fp->f_flag & FNONBLOCK) != 0) { - mtx_unlock(&efd->efd_lock); - /* Do not not return the number of bytes written */ - uio->uio_resid += sizeof(eventfd_t); - return (EAGAIN); - } - error = mtx_sleep(&efd->efd_count, &efd->efd_lock, - PCATCH, "lefdwr", 0); - if (error == 0) - goto retry; - } - if (error == 0) { - efd->efd_count += count; - KNOTE_LOCKED(&efd->efd_sel.si_note, 0); - selwakeup(&efd->efd_sel); - wakeup(&efd->efd_count); - } - mtx_unlock(&efd->efd_lock); - - return (error); -} - -static int -eventfd_poll(struct file *fp, int events, struct ucred *active_cred, - struct thread *td) -{ - struct eventfd *efd; - int revents = 0; - - efd = fp->f_data; - if (fp->f_type != DTYPE_LINUXEFD || efd == NULL) - return (POLLERR); - - mtx_lock(&efd->efd_lock); - if ((events & (POLLIN|POLLRDNORM)) && efd->efd_count > 0) - revents |= events & (POLLIN|POLLRDNORM); - if ((events & (POLLOUT|POLLWRNORM)) && UINT64_MAX - 1 > efd->efd_count) - revents |= events & (POLLOUT|POLLWRNORM); - if (revents == 0) - selrecord(td, &efd->efd_sel); - mtx_unlock(&efd->efd_lock); - - return (revents); -} - -static int -eventfd_kqfilter(struct file *fp, struct knote *kn) -{ - struct eventfd *efd; - - efd = fp->f_data; - if (fp->f_type != DTYPE_LINUXEFD || efd == NULL) - return (EINVAL); - - mtx_lock(&efd->efd_lock); - switch (kn->kn_filter) { - case EVFILT_READ: - kn->kn_fop = &eventfd_rfiltops; - break; - case EVFILT_WRITE: - kn->kn_fop = &eventfd_wfiltops; - break; - default: - mtx_unlock(&efd->efd_lock); - return (EINVAL); - } - - kn->kn_hook = efd; - knlist_add(&efd->efd_sel.si_note, kn, 1); - mtx_unlock(&efd->efd_lock); - - return (0); -} - -static void -filt_eventfddetach(struct knote *kn) -{ - struct eventfd *efd = kn->kn_hook; - - mtx_lock(&efd->efd_lock); - knlist_remove(&efd->efd_sel.si_note, kn, 1); - mtx_unlock(&efd->efd_lock); -} - -static int -filt_eventfdread(struct knote *kn, long hint) -{ - struct eventfd *efd = kn->kn_hook; - int ret; - - mtx_assert(&efd->efd_lock, MA_OWNED); - ret = (efd->efd_count > 0); - - return (ret); -} - -static int -filt_eventfdwrite(struct knote *kn, long hint) -{ - struct eventfd *efd = kn->kn_hook; - int ret; - - mtx_assert(&efd->efd_lock, MA_OWNED); - ret = (UINT64_MAX - 1 > efd->efd_count); - - return (ret); -} - -static int -eventfd_ioctl(struct file *fp, u_long cmd, void *data, - struct ucred *active_cred, struct thread *td) -{ - - if (fp->f_data == NULL || (fp->f_type != DTYPE_LINUXEFD && - fp->f_type != DTYPE_LINUXTFD)) + if ((args->flags & ~(LINUX_O_CLOEXEC | LINUX_O_NONBLOCK | + LINUX_EFD_SEMAPHORE)) != 0) return (EINVAL); - - switch (cmd) - { - case FIONBIO: - if ((*(int *)data)) - atomic_set_int(&fp->f_flag, FNONBLOCK); - else - atomic_clear_int(&fp->f_flag, FNONBLOCK); - case FIOASYNC: - return (0); - default: - return (ENXIO); - } -} - -static int -eventfd_stat(struct file *fp, struct stat *st, struct ucred *active_cred, - struct thread *td) -{ - - return (ENXIO); -} - -static int -eventfd_fill_kinfo(struct file *fp, struct kinfo_file *kif, struct filedesc *fdp) -{ - - kif->kf_type = KF_TYPE_UNKNOWN; - return (0); + flags = 0; + if ((args->flags & LINUX_O_CLOEXEC) != 0) + flags |= EFD_CLOEXEC; + if ((args->flags & LINUX_O_NONBLOCK) != 0) + flags |= EFD_NONBLOCK; + if ((args->flags & LINUX_EFD_SEMAPHORE) != 0) + flags |= EFD_SEMAPHORE; + + bzero(&ae, sizeof(ae)); + ae.flags = flags; + ae.initval = args->initval; + return (kern_specialfd(td, SPECIALFD_EVENTFD, &ae)); } int @@ -1154,6 +851,23 @@ filt_timerfdread(struct knote *kn, long hint) return (tfd->tfd_count > 0); } +static int +timerfd_ioctl(struct file *fp, u_long cmd, void *data, + struct ucred *active_cred, struct thread *td) +{ + + if (fp->f_data == NULL || fp->f_type != DTYPE_LINUXTFD) + return (EINVAL); + + switch (cmd) { + case FIONBIO: + case FIOASYNC: + return (0); + } + + return (ENOTTY); +} + static int timerfd_stat(struct file *fp, struct stat *st, struct ucred *active_cred, struct thread *td) diff --git a/sys/conf/files b/sys/conf/files index 8e30ae1eded1..0258fca24836 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -3926,6 +3926,7 @@ kern/subr_unit.c standard kern/subr_vmem.c standard kern/subr_witness.c optional witness kern/sys_capability.c standard +kern/sys_eventfd.c standard kern/sys_generic.c standard kern/sys_getrandom.c standard kern/sys_pipe.c standard diff --git a/sys/kern/capabilities.conf b/sys/kern/capabilities.conf index 09d09515c816..3d552255d823 100644 --- a/sys/kern/capabilities.conf +++ b/sys/kern/capabilities.conf @@ -55,6 +55,11 @@ __mac_get_proc __mac_set_fd __mac_set_proc +## +## Allow creating special file descriptors like eventfd(2). +## +__specialfd + ## ## Allow sysctl(2) as we scope internal to the call; this is a global ## namespace, but there are several critical sysctls required for almost diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index 3c9664c69da6..a510ad90a618 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -4609,8 +4609,8 @@ file_type_to_name(short type) return ("dev"); case DTYPE_PROCDESC: return ("proc"); - case DTYPE_LINUXEFD: - return ("levent"); + case DTYPE_EVENTFD: + return ("eventfd"); case DTYPE_LINUXTFD: return ("ltimer"); default: diff --git a/sys/kern/sys_eventfd.c b/sys/kern/sys_eventfd.c new file mode 100644 index 000000000000..3fdb4afc7850 --- /dev/null +++ b/sys/kern/sys_eventfd.c @@ -0,0 +1,349 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2007 Roman Divacky + * Copyright (c) 2014 Dmitry Chagin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +_Static_assert(EFD_CLOEXEC == O_CLOEXEC, "Mismatched EFD_CLOEXEC"); +_Static_assert(EFD_NONBLOCK == O_NONBLOCK, "Mismatched EFD_NONBLOCK"); + +MALLOC_DEFINE(M_EVENTFD, "eventfd", "eventfd structures"); + +static fo_rdwr_t eventfd_read; +static fo_rdwr_t eventfd_write; +static fo_ioctl_t eventfd_ioctl; +static fo_poll_t eventfd_poll; +static fo_kqfilter_t eventfd_kqfilter; +static fo_stat_t eventfd_stat; +static fo_close_t eventfd_close; +static fo_fill_kinfo_t eventfd_fill_kinfo; + +static struct fileops eventfdops = { + .fo_read = eventfd_read, + .fo_write = eventfd_write, + .fo_truncate = invfo_truncate, + .fo_ioctl = eventfd_ioctl, + .fo_poll = eventfd_poll, + .fo_kqfilter = eventfd_kqfilter, + .fo_stat = eventfd_stat, + .fo_close = eventfd_close, + .fo_chmod = invfo_chmod, + .fo_chown = invfo_chown, + .fo_sendfile = invfo_sendfile, + .fo_fill_kinfo = eventfd_fill_kinfo, + .fo_flags = DFLAG_PASSABLE +}; + +static void filt_eventfddetach(struct knote *kn); +static int filt_eventfdread(struct knote *kn, long hint); +static int filt_eventfdwrite(struct knote *kn, long hint); + +static struct filterops eventfd_rfiltops = { + .f_isfd = 1, + .f_detach = filt_eventfddetach, + .f_event = filt_eventfdread +}; + +static struct filterops eventfd_wfiltops = { + .f_isfd = 1, + .f_detach = filt_eventfddetach, + .f_event = filt_eventfdwrite +}; + +struct eventfd { + eventfd_t efd_count; + uint32_t efd_flags; + struct selinfo efd_sel; + struct mtx efd_lock; +}; + +int +eventfd_create_file(struct thread *td, struct file *fp, uint32_t initval, + int flags) +{ + struct eventfd *efd; + int fflags; + + AUDIT_ARG_FFLAGS(flags); + AUDIT_ARG_VALUE(initval); + + efd = malloc(sizeof(*efd), M_EVENTFD, M_WAITOK | M_ZERO); + efd->efd_flags = flags; + efd->efd_count = initval; + mtx_init(&efd->efd_lock, "eventfd", NULL, MTX_DEF); + knlist_init_mtx(&efd->efd_sel.si_note, &efd->efd_lock); + + fflags = FREAD | FWRITE; + if ((flags & EFD_NONBLOCK) != 0) + fflags |= FNONBLOCK; + finit(fp, fflags, DTYPE_EVENTFD, efd, &eventfdops); + + return (0); +} + +static int +eventfd_close(struct file *fp, struct thread *td) +{ + struct eventfd *efd; + + efd = fp->f_data; + seldrain(&efd->efd_sel); + knlist_destroy(&efd->efd_sel.si_note); + mtx_destroy(&efd->efd_lock); + free(efd, M_EVENTFD); + return (0); +} + +static int +eventfd_read(struct file *fp, struct uio *uio, struct ucred *active_cred, + int flags, struct thread *td) +{ + struct eventfd *efd; + eventfd_t count; + int error; + + if (uio->uio_resid < sizeof(eventfd_t)) + return (EINVAL); + + error = 0; + efd = fp->f_data; + mtx_lock(&efd->efd_lock); + while (error == 0 && efd->efd_count == 0) { + if ((fp->f_flag & FNONBLOCK) != 0) { + mtx_unlock(&efd->efd_lock); + return (EAGAIN); + } + error = mtx_sleep(&efd->efd_count, &efd->efd_lock, PCATCH, + "efdrd", 0); + } + if (error == 0) { + MPASS(efd->efd_count > 0); + if ((efd->efd_flags & EFD_SEMAPHORE) != 0) { + count = 1; + --efd->efd_count; + } else { + count = efd->efd_count; + efd->efd_count = 0; + } + KNOTE_LOCKED(&efd->efd_sel.si_note, 0); + selwakeup(&efd->efd_sel); + wakeup(&efd->efd_count); + mtx_unlock(&efd->efd_lock); + error = uiomove(&count, sizeof(eventfd_t), uio); + } else + mtx_unlock(&efd->efd_lock); + + return (error); +} + +static int +eventfd_write(struct file *fp, struct uio *uio, struct ucred *active_cred, + int flags, struct thread *td) +{ + struct eventfd *efd; + eventfd_t count; + int error; + + if (uio->uio_resid < sizeof(eventfd_t)) + return (EINVAL); + + error = uiomove(&count, sizeof(eventfd_t), uio); + if (error != 0) + return (error); + if (count == UINT64_MAX) + return (EINVAL); + + efd = fp->f_data; + mtx_lock(&efd->efd_lock); +retry: + if (UINT64_MAX - efd->efd_count <= count) { + if ((fp->f_flag & FNONBLOCK) != 0) { + mtx_unlock(&efd->efd_lock); + /* Do not not return the number of bytes written */ + uio->uio_resid += sizeof(eventfd_t); + return (EAGAIN); + } + error = mtx_sleep(&efd->efd_count, &efd->efd_lock, + PCATCH, "efdwr", 0); + if (error == 0) + goto retry; + } + if (error == 0) { + MPASS(UINT64_MAX - efd->efd_count > count); + efd->efd_count += count; + KNOTE_LOCKED(&efd->efd_sel.si_note, 0); + selwakeup(&efd->efd_sel); + wakeup(&efd->efd_count); + } + mtx_unlock(&efd->efd_lock); + + return (error); +} + +static int +eventfd_poll(struct file *fp, int events, struct ucred *active_cred, + struct thread *td) +{ + struct eventfd *efd; + int revents; + + efd = fp->f_data; + revents = 0; + mtx_lock(&efd->efd_lock); + if ((events & (POLLIN | POLLRDNORM)) != 0 && efd->efd_count > 0) + revents |= events & (POLLIN | POLLRDNORM); + if ((events & (POLLOUT | POLLWRNORM)) != 0 && UINT64_MAX - 1 > + efd->efd_count) + revents |= events & (POLLOUT | POLLWRNORM); + if (revents == 0) + selrecord(td, &efd->efd_sel); + mtx_unlock(&efd->efd_lock); + + return (revents); +} + +static int +eventfd_kqfilter(struct file *fp, struct knote *kn) +{ + struct eventfd *efd = fp->f_data; + + mtx_lock(&efd->efd_lock); + switch (kn->kn_filter) { + case EVFILT_READ: + kn->kn_fop = &eventfd_rfiltops; + break; + case EVFILT_WRITE: + kn->kn_fop = &eventfd_wfiltops; + break; + default: + mtx_unlock(&efd->efd_lock); + return (EINVAL); + } + + kn->kn_hook = efd; + knlist_add(&efd->efd_sel.si_note, kn, 1); + mtx_unlock(&efd->efd_lock); + + return (0); +} + +static void +filt_eventfddetach(struct knote *kn) +{ + struct eventfd *efd = kn->kn_hook; + + mtx_lock(&efd->efd_lock); + knlist_remove(&efd->efd_sel.si_note, kn, 1); + mtx_unlock(&efd->efd_lock); +} + +static int +filt_eventfdread(struct knote *kn, long hint) +{ + struct eventfd *efd = kn->kn_hook; + int ret; + + mtx_assert(&efd->efd_lock, MA_OWNED); + kn->kn_data = (int64_t)efd->efd_count; + ret = efd->efd_count > 0; + + return (ret); +} + +static int +filt_eventfdwrite(struct knote *kn, long hint) +{ + struct eventfd *efd = kn->kn_hook; + int ret; + + mtx_assert(&efd->efd_lock, MA_OWNED); + kn->kn_data = (int64_t)(UINT64_MAX - 1 - efd->efd_count); + ret = UINT64_MAX - 1 > efd->efd_count; + + return (ret); +} + +static int +eventfd_ioctl(struct file *fp, u_long cmd, void *data, + struct ucred *active_cred, struct thread *td) +{ + switch (cmd) { + case FIONBIO: + case FIOASYNC: + return (0); + } + + return (ENOTTY); +} + +static int +eventfd_stat(struct file *fp, struct stat *st, struct ucred *active_cred, + struct thread *td) +{ + bzero((void *)st, sizeof *st); + st->st_mode = S_IFIFO; + return (0); +} + +static int +eventfd_fill_kinfo(struct file *fp, struct kinfo_file *kif, struct filedesc *fdp) +{ + struct eventfd *efd = fp->f_data; + + kif->kf_type = KF_TYPE_EVENTFD; + mtx_lock(&efd->efd_lock); + kif->kf_un.kf_eventfd.kf_eventfd_value = efd->efd_count; + kif->kf_un.kf_eventfd.kf_eventfd_flags = efd->efd_flags; + mtx_unlock(&efd->efd_lock); + return (0); +} diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c index fa9436d1f9f9..a055f4a9b597 100644 --- a/sys/kern/sys_generic.c +++ b/sys/kern/sys_generic.c @@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -63,6 +64,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -859,6 +861,67 @@ kern_posix_fallocate(struct thread *td, int fd, off_t offset, off_t len) return (error); } +int +kern_specialfd(struct thread *td, int type, void *arg) +{ + struct file *fp; + struct specialfd_eventfd *ae; + int error, fd, fflags; + + fflags = 0; + error = falloc_noinstall(td, &fp); + if (error != 0) + return (error); + + switch (type) { + case SPECIALFD_EVENTFD: + ae = arg; + if ((ae->flags & EFD_CLOEXEC) != 0) + fflags |= O_CLOEXEC; + error = eventfd_create_file(td, fp, ae->initval, ae->flags); + break; + default: + error = EINVAL; + break; + } + + if (error == 0) + error = finstall(td, fp, &fd, fflags, NULL); + fdrop(fp, td); + if (error == 0) + td->td_retval[0] = fd; + return (error); +} + +int +sys___specialfd(struct thread *td, struct __specialfd_args *args) +{ + struct specialfd_eventfd ae; + int error; + + switch (args->type) { + case SPECIALFD_EVENTFD: + if (args->len != sizeof(struct specialfd_eventfd)) { + error = EINVAL; + break; + } + error = copyin(args->req, &ae, sizeof(ae)); + if (error != 0) + break; + if ((ae.flags & ~(EFD_CLOEXEC | EFD_NONBLOCK | + EFD_SEMAPHORE)) != 0) { + error = EINVAL; + break; + } + error = kern_specialfd(td, args->type, &ae); + break; *** 184 LINES SKIPPED *** From owner-dev-commits-src-main@freebsd.org Sun Dec 27 10:57:39 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 749A54B70A7; Sun, 27 Dec 2020 10:57:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D3d1b2vVVz4SZT; Sun, 27 Dec 2020 10:57:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5656225F15; Sun, 27 Dec 2020 10:57:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BRAvdDc013862; Sun, 27 Dec 2020 10:57:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BRAvd9r013861; Sun, 27 Dec 2020 10:57:39 GMT (envelope-from git) Date: Sun, 27 Dec 2020 10:57:39 GMT Message-Id: <202012271057.0BRAvd9r013861@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 6d075fd9a5d3 - main - Document eventfd(). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6d075fd9a5d339c6d178968d7be86ba128b6dc7b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Dec 2020 10:57:39 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=6d075fd9a5d339c6d178968d7be86ba128b6dc7b commit 6d075fd9a5d339c6d178968d7be86ba128b6dc7b Author: Konstantin Belousov AuthorDate: 2020-12-23 14:17:09 +0000 Commit: Konstantin Belousov CommitDate: 2020-12-27 10:57:26 +0000 Document eventfd(). Submitted by: greg@unrelenting.technology Reviewed by: bcr, markj (previous version) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D26668 --- lib/libc/sys/eventfd.2 | 208 +++++++++++++++++++++++++++++++++++++++++++++++++ lib/libc/sys/kqueue.2 | 12 ++- 2 files changed, 219 insertions(+), 1 deletion(-) diff --git a/lib/libc/sys/eventfd.2 b/lib/libc/sys/eventfd.2 new file mode 100644 index 000000000000..597c58122033 --- /dev/null +++ b/lib/libc/sys/eventfd.2 @@ -0,0 +1,208 @@ +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.\" Copyright (c) 2020 Greg V +.\" +.\" 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$ +.\" +.Dd October 8, 2020 +.Dt EVENTFD 2 +.Os +.Sh NAME +.Nm eventfd +.Nd create a file descriptor for event notification +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/eventfd.h +.Ft int +.Fn eventfd "unsigned int initval" "int flags" +.Ft int +.Fn eventfd_read "int fd" "eventfd_t *value" +.Ft int +.Fn eventfd_write "int fd" "eventfd_t value" +.Sh DESCRIPTION +.Fn eventfd +creates a special file descriptor with event counter or semaphore semantics, +designed for interprocess communication. +The returned file descriptor refers to a kernel object containing an +unsigned 64-bit integer counter, which is initialized with the value of the +.Fa initval +argument. +.Pp +The +.Fa flags +argument may contain the result of +.Em or Ns 'ing +the following values: +.Pp +.Bl -tag -width "EFD_SEMAPHORE" -compact +.It Dv EFD_CLOEXEC +set FD_CLOEXEC on the file descriptor +.It Dv EFD_NONBLOCK +do not block on read/write operations +.It Dv EFD_SEMAPHORE +use semaphore semantics +.El +.Pp +File operations have the following semantics: +.Bl -tag -width EFD_SEMAPHORE +.It Xr read 2 +If the counter is zero, the call blocks until the counter becomes non-zero, unless +.Dv EFD_NONBLOCK +was set, in which case it would fail with +.Dv EAGAIN +instead. +.Pp +If the counter is non-zero: +.Bl -bullet +.It +If +.Dv EFD_SEMAPHORE +is not set, the current value of the counter is returned, +and the value is reset to zero. +.It +If +.Dv EFD_SEMAPHORE +is set, the constant 1 is returned, and the value is decremented by 1. +.El +.Pp +The numeric value is encoded as 64-bit (8 bytes) in host byte order. +The +.Xr read 2 +call fails with +.Dv EINVAL +if there is less than 8 bytes available in the supplied buffer. +.It Xr write 2 +Adds the given value to the counter. +The maximum value that can be stored in the counter is the +maximum unsigned 64-bit integer value minus one (0xfffffffffffffffe). +.Pp +If the resulting value exceeds the maximum, the call would block +until the value is reduced by +.Xr read 2 , +unless +.Dv EFD_NONBLOCK +was set, in which case it would fail with +.Dv EAGAIN +instead. +.Pp +The numeric value is encoded as 64-bit (8 bytes) in host byte order. +The +.Xr write 2 +call fails with +.Dv EINVAL +if there is less than 8 bytes available in the supplied buffer, +or if the value 0xffffffffffffffff is given. +.It Xr poll 2 +When receiving notifications via +.Xr poll 2 / +.Xr ppoll 2 / +.Xr select 2 / +.Xr pselect 2 / +.Xr kqueue 2 , +the following semantics apply: +.Bl -bullet +.It +The file descriptor is readable when the counter is greater than zero. +.It +The file descriptor is writable when the counter is less than the maximum value. +.El +.El +.Pp +File descriptors created by +.Fn eventfd +are passable to other processes via +.Xr sendmsg 2 +and are preserved across +.Xr fork 2 ; +in both cases the descriptors refer to the same counter from both processes. +Unless +.Dv O_CLOEXEC +flag was specified, +the created file descriptor will remain open across +.Xr execve 2 +system calls; see +.Xr close 2 , +.Xr fcntl 2 +and +.Dv O_CLOEXEC +description. +.Pp +.Fn eventfd_read +and +.Fn eventfd_write +are thin wrappers around +.Xr read 2 +and +.Xr write 2 +system calls, +provided for compatibility with glibc. +.Sh RETURN VALUES +If successful, +.Fn eventfd +returns a non-negative integer, termed a file descriptor. +It returns \-1 on failure, and sets +.Va errno +to indicate the error. +.Pp +The +.Fn eventfd_read +and +.Fn eventfd_write +functions return 0 if the operation succeeded, -1 otherwise. +.Sh ERRORS +.Fn eventfd +may fail with: +.Bl -tag -width Er +.It Bq Er EINVAL +The +.Fa flags +argument given to +.Fn eventfd +has unknown bits set. +.It Bq Er EMFILE +The process has already reached its limit for open +file descriptors. +.It Bq Er ENFILE +The system file table is full. +.It Bq Er ENOMEM +No memory was available to create the kernel object. +.El +.Sh SEE ALSO +.Xr close 2 , +.Xr kqueue 2 , +.Xr poll 2 , +.Xr read 2 , +.Xr select 2 , +.Xr write 2 +.Sh STANDARDS +The +.Fn eventfd +system call is non-standard. +It is present in Linux. +.Sh HISTORY +The +.Fn eventfd +system call first appeared in +.Fx 13.0 . diff --git a/lib/libc/sys/kqueue.2 b/lib/libc/sys/kqueue.2 index ef4278cf3c35..b83d85d90d42 100644 --- a/lib/libc/sys/kqueue.2 +++ b/lib/libc/sys/kqueue.2 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 1, 2020 +.Dd October 8, 2020 .Dt KQUEUE 2 .Os .Sh NAME @@ -341,6 +341,11 @@ when the BPF has enabled and there is any data to read; .Va data contains the number of bytes available. +.It Eventfds +Returns when the counter is greater than 0; +.Va data +contains the counter value, which must be cast to +.Vt uint64_t . .El .It Dv EVFILT_WRITE Takes a descriptor as the identifier, and returns whenever @@ -359,6 +364,11 @@ For sockets, the low water mark and socket error handling is identical to the .Dv EVFILT_READ case. +.Pp +For eventfds, +.Va data +will contain the maximum value that can be added to the counter +without blocking. .It Dv EVFILT_EMPTY Takes a descriptor as the identifier, and returns whenever there is no remaining data in the write buffer. From owner-dev-commits-src-main@freebsd.org Sun Dec 27 10:57:39 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 74ECD4B6978; Sun, 27 Dec 2020 10:57:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D3d1b2mmfz4Sk3; Sun, 27 Dec 2020 10:57:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 433ED25D1C; Sun, 27 Dec 2020 10:57:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BRAvdfP013845; Sun, 27 Dec 2020 10:57:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BRAvd9O013844; Sun, 27 Dec 2020 10:57:39 GMT (envelope-from git) Date: Sun, 27 Dec 2020 10:57:39 GMT Message-Id: <202012271057.0BRAvd9O013844@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 67af9aba6b14 - main - Decode and report native eventfd descriptors from libprocstat and procstat. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 67af9aba6b144789734289443a5f90a3ca716dbe Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Dec 2020 10:57:39 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=67af9aba6b144789734289443a5f90a3ca716dbe commit 67af9aba6b144789734289443a5f90a3ca716dbe Author: Konstantin Belousov AuthorDate: 2020-12-23 14:17:44 +0000 Commit: Konstantin Belousov CommitDate: 2020-12-27 10:57:27 +0000 Decode and report native eventfd descriptors from libprocstat and procstat. Submitted by: greg@unrelenting.technology Reviewed by: markj (previous version) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D26668 --- lib/libprocstat/libprocstat.c | 5 +++++ lib/libprocstat/libprocstat.h | 1 + usr.bin/procstat/procstat.1 | 2 ++ usr.bin/procstat/procstat_files.c | 5 +++++ 4 files changed, 13 insertions(+) diff --git a/lib/libprocstat/libprocstat.c b/lib/libprocstat/libprocstat.c index 8d10c2900459..a2de61855815 100644 --- a/lib/libprocstat/libprocstat.c +++ b/lib/libprocstat/libprocstat.c @@ -628,6 +628,10 @@ procstat_getfiles_kvm(struct procstat *procstat, struct kinfo_proc *kp, int mmap type = PS_FST_TYPE_DEV; data = file.f_data; break; + case DTYPE_EVENTFD: + type = PS_FST_TYPE_EVENTFD; + data = file.f_data; + break; default: continue; } @@ -719,6 +723,7 @@ kinfo_type2fst(int kftype) { KF_TYPE_SHM, PS_FST_TYPE_SHM }, { KF_TYPE_SOCKET, PS_FST_TYPE_SOCKET }, { KF_TYPE_VNODE, PS_FST_TYPE_VNODE }, + { KF_TYPE_EVENTFD, PS_FST_TYPE_EVENTFD }, { KF_TYPE_UNKNOWN, PS_FST_TYPE_UNKNOWN } }; #define NKFTYPES (sizeof(kftypes2fst) / sizeof(*kftypes2fst)) diff --git a/lib/libprocstat/libprocstat.h b/lib/libprocstat/libprocstat.h index 4ef34da75ec2..0624ec5289d4 100644 --- a/lib/libprocstat/libprocstat.h +++ b/lib/libprocstat/libprocstat.h @@ -72,6 +72,7 @@ #define PS_FST_TYPE_NONE 12 #define PS_FST_TYPE_PROCDESC 13 #define PS_FST_TYPE_DEV 14 +#define PS_FST_TYPE_EVENTFD 15 /* * Special descriptor numbers. diff --git a/usr.bin/procstat/procstat.1 b/usr.bin/procstat/procstat.1 index 174f932a9dde..1ce0b796beb4 100644 --- a/usr.bin/procstat/procstat.1 +++ b/usr.bin/procstat/procstat.1 @@ -313,6 +313,8 @@ The following file descriptor types may be displayed: .Bl -tag -width X -compact .It e POSIX semaphore +.It E +eventfd .It f fifo .It h diff --git a/usr.bin/procstat/procstat_files.c b/usr.bin/procstat/procstat_files.c index 74c6e48eab01..1d7b419b3f4a 100644 --- a/usr.bin/procstat/procstat_files.c +++ b/usr.bin/procstat/procstat_files.c @@ -414,6 +414,11 @@ procstat_files(struct procstat *procstat, struct kinfo_proc *kipp) xo_emit("{eq:fd_type/dev}"); break; + case PS_FST_TYPE_EVENTFD: + str = "E"; + xo_emit("{eq:fd_type/eventfd}"); + break; + case PS_FST_TYPE_NONE: str = "?"; xo_emit("{eq:fd_type/none}"); From owner-dev-commits-src-main@freebsd.org Sun Dec 27 10:57:39 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9A6684B7185; Sun, 27 Dec 2020 10:57:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D3d1b3yJ3z4SNt; Sun, 27 Dec 2020 10:57:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 79BDA25B32; Sun, 27 Dec 2020 10:57:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BRAvd4v013896; Sun, 27 Dec 2020 10:57:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BRAvdLB013895; Sun, 27 Dec 2020 10:57:39 GMT (envelope-from git) Date: Sun, 27 Dec 2020 10:57:39 GMT Message-Id: <202012271057.0BRAvdLB013895@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 44c5db52e258 - main - Add eventfd(3) wrappers to libc. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 44c5db52e258aebed0c5d01047c79bc3d8487966 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Dec 2020 10:57:39 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=44c5db52e258aebed0c5d01047c79bc3d8487966 commit 44c5db52e258aebed0c5d01047c79bc3d8487966 Author: Konstantin Belousov AuthorDate: 2020-12-23 14:16:35 +0000 Commit: Konstantin Belousov CommitDate: 2020-12-27 10:57:26 +0000 Add eventfd(3) wrappers to libc. eventfd_read/write one-liners are from musl libc. Submitted by: greg@unrelenting.technology Reviewed by: markj (previous version) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D26668 --- lib/libc/gen/Makefile.inc | 1 + lib/libc/gen/Symbol.map | 3 +++ lib/libc/gen/eventfd.c | 54 +++++++++++++++++++++++++++++++++++++++++ lib/libc/include/libc_private.h | 1 + lib/libc/sys/Makefile.inc | 3 +++ 5 files changed, 62 insertions(+) diff --git a/lib/libc/gen/Makefile.inc b/lib/libc/gen/Makefile.inc index c0d719371fc8..76a21975f1ac 100644 --- a/lib/libc/gen/Makefile.inc +++ b/lib/libc/gen/Makefile.inc @@ -47,6 +47,7 @@ SRCS+= __getosreldate.c \ err.c \ errlst.c \ errno.c \ + eventfd.c \ exec.c \ exect.c \ fdevname.c \ diff --git a/lib/libc/gen/Symbol.map b/lib/libc/gen/Symbol.map index 2fb8e080de6a..c89eb63caada 100644 --- a/lib/libc/gen/Symbol.map +++ b/lib/libc/gen/Symbol.map @@ -422,6 +422,9 @@ FBSD_1.5 { }; FBSD_1.6 { + eventfd; + eventfd_read; + eventfd_write; getlogin_r; memalign; scandir_b; diff --git a/lib/libc/gen/eventfd.c b/lib/libc/gen/eventfd.c new file mode 100644 index 000000000000..b757f82029a9 --- /dev/null +++ b/lib/libc/gen/eventfd.c @@ -0,0 +1,54 @@ +/*- + * SPDX-License-Identifier: MIT + * + * Copyright (c) 2005-2020 Rich Felker, et al. + * Copyright (c) 2020 Greg V + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "namespace.h" +#include +#include +#include +#include "un-namespace.h" +#include "libc_private.h" + +int eventfd(unsigned int initval, int flags) +{ + struct specialfd_eventfd args; + + args.initval = initval; + args.flags = flags; + return (__sys___specialfd(SPECIALFD_EVENTFD, &args, sizeof(args))); +} + +int eventfd_read(int fd, eventfd_t *value) +{ + return (sizeof(*value) == _read(fd, value, sizeof(*value)) ? 0 : -1); +} + +int eventfd_write(int fd, eventfd_t value) +{ + return (sizeof(value) == _write(fd, &value, sizeof(value)) ? 0 : -1); +} diff --git a/lib/libc/include/libc_private.h b/lib/libc/include/libc_private.h index 21f5b1762eb4..d26c78c21c07 100644 --- a/lib/libc/include/libc_private.h +++ b/lib/libc/include/libc_private.h @@ -382,6 +382,7 @@ int __sys_sigtimedwait(const __sigset_t *, struct __siginfo *, const struct timespec *); int __sys_sigwait(const __sigset_t *, int *); int __sys_sigwaitinfo(const __sigset_t *, struct __siginfo *); +int __sys___specialfd(int, const void *, __size_t); int __sys_statfs(const char *, struct statfs *); int __sys_swapcontext(struct __ucontext *, const struct __ucontext *); diff --git a/lib/libc/sys/Makefile.inc b/lib/libc/sys/Makefile.inc index 38156ccf507d..d43a59719563 100644 --- a/lib/libc/sys/Makefile.inc +++ b/lib/libc/sys/Makefile.inc @@ -178,6 +178,7 @@ MAN+= abort2.2 \ cpuset_getaffinity.2 \ cpuset_getdomain.2 \ dup.2 \ + eventfd.2 \ execve.2 \ _exit.2 \ extattr_get_file.2 \ @@ -379,6 +380,8 @@ MLINKS+=cpuset.2 cpuset_getid.2 \ MLINKS+=cpuset_getaffinity.2 cpuset_setaffinity.2 MLINKS+=cpuset_getdomain.2 cpuset_setdomain.2 MLINKS+=dup.2 dup2.2 +MLINKS+=eventfd.2 eventfd_read.3 \ + eventfd.2 eventfd_write.3 MLINKS+=execve.2 fexecve.2 MLINKS+=extattr_get_file.2 extattr.2 \ extattr_get_file.2 extattr_delete_fd.2 \ From owner-dev-commits-src-main@freebsd.org Sun Dec 27 10:57:40 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EA5424B6DBC; Sun, 27 Dec 2020 10:57:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D3d1b5sjnz4SNv; Sun, 27 Dec 2020 10:57:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B6F3E25CC0; Sun, 27 Dec 2020 10:57:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BRAvdvk013947; Sun, 27 Dec 2020 10:57:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BRAvdqY013946; Sun, 27 Dec 2020 10:57:39 GMT (envelope-from git) Date: Sun, 27 Dec 2020 10:57:39 GMT Message-Id: <202012271057.0BRAvdqY013946@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 11c9f2ff1acc - main - Add SPDX tag. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 11c9f2ff1acc3a1d6415d03af5ab74945afede13 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Dec 2020 10:57:40 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=11c9f2ff1acc3a1d6415d03af5ab74945afede13 commit 11c9f2ff1acc3a1d6415d03af5ab74945afede13 Author: Konstantin Belousov AuthorDate: 2020-12-23 13:18:57 +0000 Commit: Konstantin Belousov CommitDate: 2020-12-27 10:57:26 +0000 Add SPDX tag. Submitted by: greg@unrelenting.technology --- sys/compat/linux/linux_event.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/compat/linux/linux_event.c b/sys/compat/linux/linux_event.c index 1371b76c4b60..6afdcbec6b80 100644 --- a/sys/compat/linux/linux_event.c +++ b/sys/compat/linux/linux_event.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2007 Roman Divacky * Copyright (c) 2014 Dmitry Chagin * All rights reserved. From owner-dev-commits-src-main@freebsd.org Sun Dec 27 10:57:39 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E6EC04B6DBB; Sun, 27 Dec 2020 10:57:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D3d1b5bfRz4SmQ; Sun, 27 Dec 2020 10:57:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A3D0425B33; Sun, 27 Dec 2020 10:57:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BRAvdk3013930; Sun, 27 Dec 2020 10:57:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BRAvd03013929; Sun, 27 Dec 2020 10:57:39 GMT (envelope-from git) Date: Sun, 27 Dec 2020 10:57:39 GMT Message-Id: <202012271057.0BRAvd03013929@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 7cb901bf227f - main - Remove useless ARGUSED annotations. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7cb901bf227f1591f208a9df5ddc948c6124e0a8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Dec 2020 10:57:40 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=7cb901bf227f1591f208a9df5ddc948c6124e0a8 commit 7cb901bf227f1591f208a9df5ddc948c6124e0a8 Author: Konstantin Belousov AuthorDate: 2020-12-23 13:25:02 +0000 Commit: Konstantin Belousov CommitDate: 2020-12-27 10:57:26 +0000 Remove useless ARGUSED annotations. Submitted by: greg@unrelenting.technology --- sys/compat/linux/linux_event.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/sys/compat/linux/linux_event.c b/sys/compat/linux/linux_event.c index 6afdcbec6b80..c67d62d8aff0 100644 --- a/sys/compat/linux/linux_event.c +++ b/sys/compat/linux/linux_event.c @@ -879,7 +879,6 @@ eventfd_poll(struct file *fp, int events, struct ucred *active_cred, return (revents); } -/*ARGSUSED*/ static int eventfd_kqfilter(struct file *fp, struct knote *kn) { @@ -919,7 +918,6 @@ filt_eventfddetach(struct knote *kn) mtx_unlock(&efd->efd_lock); } -/*ARGSUSED*/ static int filt_eventfdread(struct knote *kn, long hint) { @@ -932,7 +930,6 @@ filt_eventfdread(struct knote *kn, long hint) return (ret); } -/*ARGSUSED*/ static int filt_eventfdwrite(struct knote *kn, long hint) { @@ -945,7 +942,6 @@ filt_eventfdwrite(struct knote *kn, long hint) return (ret); } -/*ARGSUSED*/ static int eventfd_ioctl(struct file *fp, u_long cmd, void *data, struct ucred *active_cred, struct thread *td) @@ -969,7 +965,6 @@ eventfd_ioctl(struct file *fp, u_long cmd, void *data, } } -/*ARGSUSED*/ static int eventfd_stat(struct file *fp, struct stat *st, struct ucred *active_cred, struct thread *td) @@ -978,7 +973,6 @@ eventfd_stat(struct file *fp, struct stat *st, struct ucred *active_cred, return (ENXIO); } -/*ARGSUSED*/ static int eventfd_fill_kinfo(struct file *fp, struct kinfo_file *kif, struct filedesc *fdp) { @@ -1122,7 +1116,6 @@ timerfd_poll(struct file *fp, int events, struct ucred *active_cred, return (revents); } -/*ARGSUSED*/ static int timerfd_kqfilter(struct file *fp, struct knote *kn) { @@ -1153,7 +1146,6 @@ filt_timerfddetach(struct knote *kn) mtx_unlock(&tfd->tfd_lock); } -/*ARGSUSED*/ static int filt_timerfdread(struct knote *kn, long hint) { @@ -1162,7 +1154,6 @@ filt_timerfdread(struct knote *kn, long hint) return (tfd->tfd_count > 0); } -/*ARGSUSED*/ static int timerfd_stat(struct file *fp, struct stat *st, struct ucred *active_cred, struct thread *td) @@ -1171,7 +1162,6 @@ timerfd_stat(struct file *fp, struct stat *st, struct ucred *active_cred, return (ENXIO); } -/*ARGSUSED*/ static int timerfd_fill_kinfo(struct file *fp, struct kinfo_file *kif, struct filedesc *fdp) { From owner-dev-commits-src-main@freebsd.org Sun Dec 27 11:14:58 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 567114B76AB; Sun, 27 Dec 2020 11:14:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D3dPZ158mz4Tsp; Sun, 27 Dec 2020 11:14:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 17FF426197; Sun, 27 Dec 2020 11:14:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BRBEwtr035875; Sun, 27 Dec 2020 11:14:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BRBEwmh035874; Sun, 27 Dec 2020 11:14:58 GMT (envelope-from git) Date: Sun, 27 Dec 2020 11:14:58 GMT Message-Id: <202012271114.0BRBEwmh035874@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 098dbd7ff7f3 - main - amd64 nmi handler: fix comment about %ebx MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 098dbd7ff7f3da9dda03802cdb2d8755f816eada Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Dec 2020 11:14:58 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=098dbd7ff7f3da9dda03802cdb2d8755f816eada commit 098dbd7ff7f3da9dda03802cdb2d8755f816eada Author: Konstantin Belousov AuthorDate: 2020-12-27 10:47:36 +0000 Commit: Konstantin Belousov CommitDate: 2020-12-27 10:59:33 +0000 amd64 nmi handler: fix comment about %ebx Reported by: markj MFC after: 3 days --- sys/amd64/amd64/exception.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/amd64/amd64/exception.S b/sys/amd64/amd64/exception.S index 6b56a2c8a50e..3fb518179406 100644 --- a/sys/amd64/amd64/exception.S +++ b/sys/amd64/amd64/exception.S @@ -940,7 +940,7 @@ outofnmi: cli nocallchain: #endif - testl %ebx,%ebx /* %ebx == 0 => return to userland */ + testl %ebx,%ebx /* %ebx != 0 => return to userland */ jnz doreti_exit /* * Restore speculation control MSR, if preserved. @@ -1059,7 +1059,7 @@ mchk_calltrap: movq %rsp,%rdi call mca_intr MEXITCOUNT - testl %ebx,%ebx /* %ebx == 0 => return to userland */ + testl %ebx,%ebx /* %ebx != 0 => return to userland */ jnz doreti_exit /* * Restore speculation control MSR, if preserved. From owner-dev-commits-src-main@freebsd.org Sun Dec 27 11:14:58 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 56D1F4B77DB; Sun, 27 Dec 2020 11:14:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D3dPZ1hppz4TwP; Sun, 27 Dec 2020 11:14:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 28DD925F62; Sun, 27 Dec 2020 11:14:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BRBEwKB035892; Sun, 27 Dec 2020 11:14:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BRBEwOO035891; Sun, 27 Dec 2020 11:14:58 GMT (envelope-from git) Date: Sun, 27 Dec 2020 11:14:58 GMT Message-Id: <202012271114.0BRBEwOO035891@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: d39f7430a6e1 - main - amd64: preserve %cr2 in NMI/MCE/DBG handlers. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d39f7430a6e1da419d6e4fb871bca5ba7863f738 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Dec 2020 11:14:58 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=d39f7430a6e1da419d6e4fb871bca5ba7863f738 commit d39f7430a6e1da419d6e4fb871bca5ba7863f738 Author: Konstantin Belousov AuthorDate: 2020-12-25 21:58:43 +0000 Commit: Konstantin Belousov CommitDate: 2020-12-27 10:59:33 +0000 amd64: preserve %cr2 in NMI/MCE/DBG handlers. These handlers could interrupt code which has interrupts disabled, and if a spurious page fault occurs during exception handler run, we get clobbered %cr2 in higher level stack. This is mostly a speculation, but it is based on hints from good sources. MFC after: 1 week Reviewed by: markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D27772 --- sys/amd64/amd64/exception.S | 21 +++++++++++++++------ sys/amd64/amd64/support.S | 3 ++- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/sys/amd64/amd64/exception.S b/sys/amd64/amd64/exception.S index 948f6c40e776..6b56a2c8a50e 100644 --- a/sys/amd64/amd64/exception.S +++ b/sys/amd64/amd64/exception.S @@ -667,9 +667,10 @@ IDTVEC(dbg) jnz dbg_fromuserspace lfence /* - * We've interrupted the kernel. Preserve GS.base in %r12, - * %cr3 in %r13, and possibly lower half of MSR_IA32_SPEC_CTL in %r14d. + * We've interrupted the kernel. See comment in NMI handler about + * registers use. */ + movq %cr2,%r15 movl $MSR_GSBASE,%ecx rdmsr movq %rax,%r12 @@ -710,6 +711,7 @@ IDTVEC(dbg) shrq $32,%rdx wrmsr movq %r13,%cr3 + movq %r15,%cr2 RESTORE_REGS addq $TF_RIP,%rsp jmp doreti_iret @@ -804,10 +806,14 @@ IDTVEC(nmi) testb $SEL_RPL_MASK,TF_CS(%rsp) jnz nmi_fromuserspace /* - * We've interrupted the kernel. Preserve GS.base in %r12, - * %cr3 in %r13, and possibly lower half of MSR_IA32_SPEC_CTL in %r14d. + * We've interrupted the kernel. Preserve in callee-saved regs: + * GS.base in %r12, + * %cr3 in %r13, + * possibly lower half of MSR_IA32_SPEC_CTL in %r14d, + * %cr2 in %r15. */ lfence + movq %cr2,%r15 movl $MSR_GSBASE,%ecx rdmsr movq %rax,%r12 @@ -957,6 +963,7 @@ nocallchain: je 2f call flush_l1d_sw /* bhyve L1TF assist */ 2: movq %r13,%cr3 + movq %r15,%cr2 RESTORE_REGS addq $TF_RIP,%rsp jmp doreti_iret @@ -1011,9 +1018,10 @@ IDTVEC(mchk) testb $SEL_RPL_MASK,TF_CS(%rsp) jnz mchk_fromuserspace /* - * We've interrupted the kernel. Preserve GS.base in %r12, - * %cr3 in %r13, and possibly lower half of MSR_IA32_SPEC_CTL in %r14d. + * We've interrupted the kernel. See comment in NMI handler about + * registers use. */ + movq %cr2,%r15 movl $MSR_GSBASE,%ecx rdmsr movq %rax,%r12 @@ -1071,6 +1079,7 @@ mchk_calltrap: shrq $32,%rdx wrmsr movq %r13,%cr3 + movq %r15,%cr2 RESTORE_REGS addq $TF_RIP,%rsp jmp doreti_iret diff --git a/sys/amd64/amd64/support.S b/sys/amd64/amd64/support.S index 5a25dc1d9695..b0ef54a27ca1 100644 --- a/sys/amd64/amd64/support.S +++ b/sys/amd64/amd64/support.S @@ -1651,7 +1651,8 @@ END(handle_ibrs_exit_rs) * * N.B. The function does not follow ABI calling conventions, it corrupts %rbx. * The vmm.ko caller expects that only %rax, %rdx, %rbx, %rcx, %r9, and %rflags - * registers are clobbered. The NMI handler caller only needs %r13 preserved. + * registers are clobbered. The NMI handler caller only needs %r13 and %r15 + * preserved. */ ENTRY(flush_l1d_sw) #define L1D_FLUSH_SIZE (64 * 1024) From owner-dev-commits-src-main@freebsd.org Sun Dec 27 16:47:44 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 53F2D4C028A; Sun, 27 Dec 2020 16:47:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D3mnX1tFNz4pXn; Sun, 27 Dec 2020 16:47:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 335AC2687; Sun, 27 Dec 2020 16:47:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BRGlicF092667; Sun, 27 Dec 2020 16:47:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BRGliZm092666; Sun, 27 Dec 2020 16:47:44 GMT (envelope-from git) Date: Sun, 27 Dec 2020 16:47:44 GMT Message-Id: <202012271647.0BRGliZm092666@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michal Meloun Subject: git: c8300031980e - main - EXTRES: Ignore index modifier flags for table based clock dividers. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mmel X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c8300031980e5647853a379aa518dd9e88a88619 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Dec 2020 16:47:44 -0000 The branch main has been updated by mmel: URL: https://cgit.FreeBSD.org/src/commit/?id=c8300031980e5647853a379aa518dd9e88a88619 commit c8300031980e5647853a379aa518dd9e88a88619 Author: Michal Meloun AuthorDate: 2018-01-04 12:12:39 +0000 Commit: Michal Meloun CommitDate: 2020-12-27 16:47:19 +0000 EXTRES: Ignore index modifier flags for table based clock dividers. The divider table already contains the correct HW divider value, it should not be modified by other flags such as 'CLK_DIV_ZERO_BASED'. MFC after: 4 weeks --- sys/dev/extres/clk/clk_div.c | 45 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/sys/dev/extres/clk/clk_div.c b/sys/dev/extres/clk/clk_div.c index bf2de85e7ad0..68b23c6cc45b 100644 --- a/sys/dev/extres/clk/clk_div.c +++ b/sys/dev/extres/clk/clk_div.c @@ -131,7 +131,8 @@ clknode_div_init(struct clknode *clk, device_t dev) return (rv); i_div = (reg >> sc->i_shift) & sc->i_mask; - if (!(sc->div_flags & CLK_DIV_ZERO_BASED)) + if (!(sc->div_flags & CLK_DIV_WITH_TABLE) && + !(sc->div_flags & CLK_DIV_ZERO_BASED)) i_div++; f_div = (reg >> sc->f_shift) & sc->f_mask; sc->divider = i_div << sc->f_width | f_div; @@ -166,7 +167,7 @@ clknode_div_set_freq(struct clknode *clk, uint64_t fin, uint64_t *fout, { struct clknode_div_sc *sc; uint64_t divider, _fin, _fout; - uint32_t div_value, reg, i_div, f_div, hw_i_div; + uint32_t reg, i_div, f_div, hw_i_div; int rv; sc = clknode_get_softc(clk); @@ -192,23 +193,27 @@ clknode_div_set_freq(struct clknode *clk, uint64_t fin, uint64_t *fout, return(EINVAL); } - hw_i_div = i_div; - if (!(sc->div_flags & CLK_DIV_ZERO_BASED)) - hw_i_div--; - *stop = 1; - if (hw_i_div > sc->i_mask && - ((sc->div_flags & CLK_DIV_WITH_TABLE) == 0)) { - /* XXX Or only return error? */ - printf("%s: %s integer divider is too big: %u\n", - clknode_get_name(clk), __func__, hw_i_div); - hw_i_div = sc->i_mask; - *stop = 0; + hw_i_div = i_div; + if (sc->div_flags & CLK_DIV_WITH_TABLE) { + if (clknode_div_table_get_value(sc, &hw_i_div) != 0) + return (ERANGE); + } else { + if (!(sc->div_flags & CLK_DIV_ZERO_BASED)) + hw_i_div--; + + if (i_div > sc->i_mask) { + /* XXX Pass to parent or return error? */ + printf("%s: %s integer divider is too big: %u\n", + clknode_get_name(clk), __func__, i_div); + hw_i_div = sc->i_mask; + *stop = 0; + } + i_div = hw_i_div; + if (!(sc->div_flags & CLK_DIV_ZERO_BASED)) + i_div++; } - i_div = hw_i_div; - if (!(sc->div_flags & CLK_DIV_ZERO_BASED)) - i_div++; divider = i_div << sc->f_width | f_div; if ((flags & CLK_SET_DRYRUN) == 0) { @@ -217,16 +222,10 @@ clknode_div_set_freq(struct clknode *clk, uint64_t fin, uint64_t *fout, (*fout != (_fin / divider))) return (ERANGE); - div_value = divider; - if (clknode_div_table_get_value(sc, &div_value) != 0) - return (ERANGE); - if (div_value != divider) - i_div = div_value; - DEVICE_LOCK(clk); rv = MD4(clk, sc->offset, (sc->i_mask << sc->i_shift) | (sc->f_mask << sc->f_shift), - (i_div << sc->i_shift) | (f_div << sc->f_shift)); + (hw_i_div << sc->i_shift) | (f_div << sc->f_shift)); if (rv != 0) { DEVICE_UNLOCK(clk); return (rv); From owner-dev-commits-src-main@freebsd.org Sun Dec 27 17:23:01 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 38CCD4C074D; Sun, 27 Dec 2020 17:23:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D3nZF19xlz4rL0; Sun, 27 Dec 2020 17:23:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1B55B2F8B; Sun, 27 Dec 2020 17:23:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BRHN1KR036143; Sun, 27 Dec 2020 17:23:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BRHN1QR036142; Sun, 27 Dec 2020 17:23:01 GMT (envelope-from git) Date: Sun, 27 Dec 2020 17:23:01 GMT Message-Id: <202012271723.0BRHN1QR036142@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 6dbb07ed6872 - main - cache: modification and last entry filling support in lockless lookup MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6dbb07ed6872ae7988b9b705e322c94658eba6d1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Dec 2020 17:23:01 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=6dbb07ed6872ae7988b9b705e322c94658eba6d1 commit 6dbb07ed6872ae7988b9b705e322c94658eba6d1 Author: Mateusz Guzik AuthorDate: 2020-12-27 15:28:14 +0000 Commit: Mateusz Guzik CommitDate: 2020-12-27 17:22:25 +0000 cache: modification and last entry filling support in lockless lookup Tested by: pho (previous version) --- sys/kern/vfs_cache.c | 297 ++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 281 insertions(+), 16 deletions(-) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index 38121893126e..7b7149a15e92 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -3724,6 +3724,13 @@ cache_fpl_handled_impl(struct cache_fpl *fpl, int error, int line) #define cache_fpl_handled(x, e) cache_fpl_handled_impl((x), (e), __LINE__) +static bool +cache_fpl_terminated(struct cache_fpl *fpl) +{ + + return (fpl->status != CACHE_FPL_STATUS_UNSET); +} + #define CACHE_FPL_SUPPORTED_CN_FLAGS \ (NC_NOMAKEENTRY | NC_KEEPPOSENTRY | LOCKLEAF | LOCKPARENT | WANTPARENT | \ FOLLOW | LOCKSHARED | SAVENAME | SAVESTART | WILLBEDIR | ISOPEN | \ @@ -3735,6 +3742,8 @@ cache_fpl_handled_impl(struct cache_fpl *fpl, int error, int line) _Static_assert((CACHE_FPL_SUPPORTED_CN_FLAGS & CACHE_FPL_INTERNAL_CN_FLAGS) == 0, "supported and internal flags overlap"); +static bool cache_fplookup_need_climb_mount(struct cache_fpl *fpl); + static bool cache_fpl_islastcn(struct nameidata *ndp) { @@ -3857,6 +3866,16 @@ cache_fplookup_partial_setup(struct cache_fpl *fpl) return (cache_fpl_aborted(fpl)); } + /* + * Note that seqc is checked before the vnode is locked, so by + * the time regular lookup gets to it it may have moved. + * + * Ultimately this does not affect correctness, any lookup errors + * are userspace racing with itself. It is guaranteed that any + * path which ultimatley gets found could also have been found + * by regular lookup going all the way in absence of concurrent + * modifications. + */ dvs = vget_prep_smr(dvp); cache_fpl_smr_exit(fpl); if (__predict_false(dvs == VGET_NONE)) { @@ -3874,6 +3893,7 @@ cache_fplookup_partial_setup(struct cache_fpl *fpl) cache_fpl_restore_partial(fpl, &fpl->snd); ndp->ni_startdir = dvp; + MPASS((cnp->cn_flags & MAKEENTRY) == 0); cnp->cn_flags |= MAKEENTRY; if (cache_fpl_islastcn(ndp)) cnp->cn_flags |= ISLASTCN; @@ -3920,18 +3940,159 @@ cache_fplookup_final_child(struct cache_fpl *fpl, enum vgetstate tvs) /* * They want to possibly modify the state of the namecache. - * - * Don't try to match the API contract, just leave. - * TODO: this leaves scalability on the table */ -static int +static int __noinline cache_fplookup_final_modifying(struct cache_fpl *fpl) { + struct nameidata *ndp; struct componentname *cnp; + enum vgetstate dvs; + struct vnode *dvp, *tvp; + struct mount *mp; + seqc_t dvp_seqc; + int error; + bool docache; + ndp = fpl->ndp; cnp = fpl->cnp; - MPASS(cnp->cn_nameiop != LOOKUP); - return (cache_fpl_partial(fpl)); + dvp = fpl->dvp; + dvp_seqc = fpl->dvp_seqc; + + MPASS(cache_fpl_islastcn(ndp)); + if ((cnp->cn_flags & LOCKPARENT) == 0) + MPASS((cnp->cn_flags & WANTPARENT) != 0); + MPASS((cnp->cn_flags & TRAILINGSLASH) == 0); + MPASS(cnp->cn_nameiop == CREATE || cnp->cn_nameiop == DELETE || + cnp->cn_nameiop == RENAME); + + docache = (cnp->cn_flags & NOCACHE) ^ NOCACHE; + if (cnp->cn_nameiop == DELETE || cnp->cn_nameiop == RENAME) + docache = false; + + mp = atomic_load_ptr(&dvp->v_mount); + if (__predict_false(mp == NULL)) { + return (cache_fpl_aborted(fpl)); + } + + if (__predict_false(mp->mnt_flag & MNT_RDONLY)) { + cache_fpl_smr_exit(fpl); + /* + * Original code keeps not checking for CREATE which + * might be a bug. For now let the old lookup decide. + */ + if (cnp->cn_nameiop == CREATE) { + return (cache_fpl_aborted(fpl)); + } + return (cache_fpl_handled(fpl, EROFS)); + } + + /* + * Secure access to dvp; check cache_fplookup_partial_setup for + * reasoning. + * + * XXX At least UFS requires its lookup routine to be called for + * the last path component, which leads to some level of complicaton + * and inefficiency: + * - the target routine always locks the target vnode, but our caller + * may not need it locked + * - some of the VOP machinery asserts that the parent is locked, which + * once more may be not required + * + * TODO: add a flag for filesystems which don't need this. + */ + dvs = vget_prep_smr(dvp); + cache_fpl_smr_exit(fpl); + if (__predict_false(dvs == VGET_NONE)) { + return (cache_fpl_aborted(fpl)); + } + + vget_finish_ref(dvp, dvs); + if (!vn_seqc_consistent(dvp, dvp_seqc)) { + vrele(dvp); + return (cache_fpl_aborted(fpl)); + } + + error = vn_lock(dvp, LK_EXCLUSIVE); + if (__predict_false(error != 0)) { + vrele(dvp); + return (cache_fpl_aborted(fpl)); + } + + tvp = NULL; + MPASS((cnp->cn_flags & MAKEENTRY) == 0); + if (docache) + cnp->cn_flags |= MAKEENTRY; + cnp->cn_flags |= ISLASTCN; + cnp->cn_lkflags = LK_EXCLUSIVE; + error = VOP_LOOKUP(dvp, &tvp, cnp); + switch (error) { + case EJUSTRETURN: + case 0: + break; + case ENOTDIR: + case ENOENT: + vput(dvp); + return (cache_fpl_handled(fpl, error)); + default: + vput(dvp); + return (cache_fpl_aborted(fpl)); + } + + fpl->tvp = tvp; + + if (tvp == NULL) { + if ((cnp->cn_flags & SAVESTART) != 0) { + ndp->ni_startdir = dvp; + vrefact(ndp->ni_startdir); + cnp->cn_flags |= SAVENAME; + } + MPASS(error == EJUSTRETURN); + if ((cnp->cn_flags & LOCKPARENT) == 0) { + VOP_UNLOCK(dvp); + } + return (cache_fpl_handled(fpl, 0)); + } + + /* + * Check if the target is either a symlink or a mount point. + * Since we expect this to be the terminal vnode it should + * almost never be true. + */ + if (__predict_false(!cache_fplookup_vnode_supported(tvp) || + cache_fplookup_need_climb_mount(fpl))) { + vput(dvp); + vput(tvp); + return (cache_fpl_aborted(fpl)); + } + + if ((cnp->cn_flags & LOCKLEAF) == 0) { + VOP_UNLOCK(tvp); + } + + if ((cnp->cn_flags & LOCKPARENT) == 0) { + VOP_UNLOCK(dvp); + } + + if ((cnp->cn_flags & SAVESTART) != 0) { + ndp->ni_startdir = dvp; + vrefact(ndp->ni_startdir); + cnp->cn_flags |= SAVENAME; + } + + return (cache_fpl_handled(fpl, 0)); +} + +static int __noinline +cache_fplookup_modifying(struct cache_fpl *fpl) +{ + struct nameidata *ndp; + + ndp = fpl->ndp; + + if (!cache_fpl_islastcn(ndp)) { + return (cache_fpl_partial(fpl)); + } + return (cache_fplookup_final_modifying(fpl)); } static int __noinline @@ -4012,8 +4173,6 @@ cache_fplookup_final(struct cache_fpl *fpl) dvp_seqc = fpl->dvp_seqc; tvp = fpl->tvp; - VNPASS(cache_fplookup_vnode_supported(dvp), dvp); - if (cnp->cn_nameiop != LOOKUP) { return (cache_fplookup_final_modifying(fpl)); } @@ -4036,6 +4195,117 @@ cache_fplookup_final(struct cache_fpl *fpl) return (cache_fplookup_final_child(fpl, tvs)); } +static int __noinline +cache_fplookup_noentry(struct cache_fpl *fpl) +{ + struct nameidata *ndp; + struct componentname *cnp; + enum vgetstate dvs; + struct vnode *dvp, *tvp; + seqc_t dvp_seqc; + int error; + bool docache; + + ndp = fpl->ndp; + cnp = fpl->cnp; + dvp = fpl->dvp; + dvp_seqc = fpl->dvp_seqc; + + if (cnp->cn_nameiop != LOOKUP) { + return (cache_fplookup_modifying(fpl)); + } + + MPASS((cnp->cn_flags & SAVESTART) == 0); + + /* + * Only try to fill in the component if it is the last one, + * otherwise not only there may be several to handle but the + * walk may be complicated. + */ + if (!cache_fpl_islastcn(ndp)) { + return (cache_fpl_partial(fpl)); + } + + /* + * Secure access to dvp; check cache_fplookup_partial_setup for + * reasoning. + */ + dvs = vget_prep_smr(dvp); + cache_fpl_smr_exit(fpl); + if (__predict_false(dvs == VGET_NONE)) { + return (cache_fpl_aborted(fpl)); + } + + vget_finish_ref(dvp, dvs); + if (!vn_seqc_consistent(dvp, dvp_seqc)) { + vrele(dvp); + return (cache_fpl_aborted(fpl)); + } + + error = vn_lock(dvp, LK_SHARED); + if (__predict_false(error != 0)) { + vrele(dvp); + return (cache_fpl_aborted(fpl)); + } + + tvp = NULL; + /* + * TODO: provide variants which don't require locking either vnode. + */ + docache = (cnp->cn_flags & NOCACHE) ^ NOCACHE; + MPASS((cnp->cn_flags & MAKEENTRY) == 0); + if (docache) + cnp->cn_flags |= MAKEENTRY; + cnp->cn_flags |= ISLASTCN; + cnp->cn_lkflags = LK_SHARED; + if ((cnp->cn_flags & LOCKSHARED) == 0) { + cnp->cn_lkflags = LK_EXCLUSIVE; + } + error = VOP_LOOKUP(dvp, &tvp, cnp); + switch (error) { + case EJUSTRETURN: + case 0: + break; + case ENOTDIR: + case ENOENT: + vput(dvp); + return (cache_fpl_handled(fpl, error)); + default: + vput(dvp); + return (cache_fpl_aborted(fpl)); + } + + fpl->tvp = tvp; + + if (tvp == NULL) { + MPASS(error == EJUSTRETURN); + if ((cnp->cn_flags & (WANTPARENT | LOCKPARENT)) == 0) { + vput(dvp); + } else if ((cnp->cn_flags & LOCKPARENT) == 0) { + VOP_UNLOCK(dvp); + } + return (cache_fpl_handled(fpl, 0)); + } + + if (__predict_false(!cache_fplookup_vnode_supported(tvp) || + cache_fplookup_need_climb_mount(fpl))) { + vput(dvp); + vput(tvp); + return (cache_fpl_aborted(fpl)); + } + + if ((cnp->cn_flags & LOCKLEAF) == 0) { + VOP_UNLOCK(tvp); + } + + if ((cnp->cn_flags & (WANTPARENT | LOCKPARENT)) == 0) { + vput(dvp); + } else if ((cnp->cn_flags & LOCKPARENT) == 0) { + VOP_UNLOCK(dvp); + } + return (cache_fpl_handled(fpl, 0)); +} + static int __noinline cache_fplookup_dot(struct cache_fpl *fpl) { @@ -4184,13 +4454,8 @@ cache_fplookup_next(struct cache_fpl *fpl) break; } - /* - * If there is no entry we have to punt to the slow path to perform - * actual lookup. Should there be nothing with this name a negative - * entry will be created. - */ if (__predict_false(ncp == NULL)) { - return (cache_fpl_partial(fpl)); + return (cache_fplookup_noentry(fpl)); } tvp = atomic_load_ptr(&ncp->nc_vp); @@ -4539,12 +4804,12 @@ cache_fplookup_impl(struct vnode *dvp, struct cache_fpl *fpl) if (__predict_false(cache_fpl_isdotdot(cnp))) { error = cache_fplookup_dotdot(fpl); - if (__predict_false(error != 0)) { + if (__predict_false(cache_fpl_terminated(fpl))) { break; } } else { error = cache_fplookup_next(fpl); - if (__predict_false(error != 0)) { + if (__predict_false(cache_fpl_terminated(fpl))) { break; } From owner-dev-commits-src-main@freebsd.org Sun Dec 27 17:49:35 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 70CEA4C1B1C; Sun, 27 Dec 2020 17:49:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D3p8v2pgJz4trC; Sun, 27 Dec 2020 17:49:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 533FA2D61; Sun, 27 Dec 2020 17:49:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BRHnZaB057715; Sun, 27 Dec 2020 17:49:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BRHnZ6F057714; Sun, 27 Dec 2020 17:49:35 GMT (envelope-from git) Date: Sun, 27 Dec 2020 17:49:35 GMT Message-Id: <202012271749.0BRHnZ6F057714@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 581ade97d561 - main - Perform kernel linker ifunc test only for builds MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 581ade97d561e136dbb7cf7a413128c343a23199 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Dec 2020 17:49:35 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=581ade97d561e136dbb7cf7a413128c343a23199 commit 581ade97d561e136dbb7cf7a413128c343a23199 Author: Ed Maste AuthorDate: 2020-12-27 00:34:24 +0000 Commit: Ed Maste CommitDate: 2020-12-27 17:46:51 +0000 Perform kernel linker ifunc test only for builds dvl reported that "make installkernel" failed with "amd64/arm64/i386 kernel requires linker ifunc support." This test should apply to builds only; the linker is not used at install time. I think the same (ifunc-supporting) linker used to build the kernel should be detected at install time in usual cases (and so not trigger this error). However, there is no reason to disallow the install, if for some reason the expected linker isn't the one tested at install time. PR: 251580 Reported by: dvl MFC after: 2 weeks Sponsored by: The FreeBSD Foundation --- sys/conf/kern.pre.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/conf/kern.pre.mk b/sys/conf/kern.pre.mk index 4754092694c1..75f59a90484d 100644 --- a/sys/conf/kern.pre.mk +++ b/sys/conf/kern.pre.mk @@ -148,7 +148,8 @@ LDFLAGS+= --build-id=sha1 .if (${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \ ${MACHINE_CPUARCH} == "i386" || ${MACHINE} == "powerpc") && \ - defined(LINKER_FEATURES) && ${LINKER_FEATURES:Mifunc} == "" + defined(LINKER_FEATURES) && ${LINKER_FEATURES:Mifunc} == "" && \ + !make(install) .error amd64/arm64/i386/ppc* kernel requires linker ifunc support .endif .if ${MACHINE_CPUARCH} == "amd64" From owner-dev-commits-src-main@freebsd.org Sun Dec 27 19:04:13 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7A3A74C3C6A; Sun, 27 Dec 2020 19:04:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D3qq12wSBz3GTG; Sun, 27 Dec 2020 19:04:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 56E01446D; Sun, 27 Dec 2020 19:04:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BRJ4DIE044874; Sun, 27 Dec 2020 19:04:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BRJ4DWF044873; Sun, 27 Dec 2020 19:04:13 GMT (envelope-from git) Date: Sun, 27 Dec 2020 19:04:13 GMT Message-Id: <202012271904.0BRJ4DWF044873@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: a1fc1f10c65f - main - Revert "cache: modification and last entry filling support in lockless lookup" MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a1fc1f10c65fe8684d09d2252c19ebb213182b4f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Dec 2020 19:04:13 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=a1fc1f10c65fe8684d09d2252c19ebb213182b4f commit a1fc1f10c65fe8684d09d2252c19ebb213182b4f Author: Mateusz Guzik AuthorDate: 2020-12-27 19:02:29 +0000 Commit: Mateusz Guzik CommitDate: 2020-12-27 19:02:29 +0000 Revert "cache: modification and last entry filling support in lockless lookup" This reverts commit 6dbb07ed6872ae7988b9b705e322c94658eba6d1. Some ports unreliably fail to build with rmdir getting ENOTEMPTY. --- sys/kern/vfs_cache.c | 297 +++------------------------------------------------ 1 file changed, 16 insertions(+), 281 deletions(-) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index 7b7149a15e92..38121893126e 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -3724,13 +3724,6 @@ cache_fpl_handled_impl(struct cache_fpl *fpl, int error, int line) #define cache_fpl_handled(x, e) cache_fpl_handled_impl((x), (e), __LINE__) -static bool -cache_fpl_terminated(struct cache_fpl *fpl) -{ - - return (fpl->status != CACHE_FPL_STATUS_UNSET); -} - #define CACHE_FPL_SUPPORTED_CN_FLAGS \ (NC_NOMAKEENTRY | NC_KEEPPOSENTRY | LOCKLEAF | LOCKPARENT | WANTPARENT | \ FOLLOW | LOCKSHARED | SAVENAME | SAVESTART | WILLBEDIR | ISOPEN | \ @@ -3742,8 +3735,6 @@ cache_fpl_terminated(struct cache_fpl *fpl) _Static_assert((CACHE_FPL_SUPPORTED_CN_FLAGS & CACHE_FPL_INTERNAL_CN_FLAGS) == 0, "supported and internal flags overlap"); -static bool cache_fplookup_need_climb_mount(struct cache_fpl *fpl); - static bool cache_fpl_islastcn(struct nameidata *ndp) { @@ -3866,16 +3857,6 @@ cache_fplookup_partial_setup(struct cache_fpl *fpl) return (cache_fpl_aborted(fpl)); } - /* - * Note that seqc is checked before the vnode is locked, so by - * the time regular lookup gets to it it may have moved. - * - * Ultimately this does not affect correctness, any lookup errors - * are userspace racing with itself. It is guaranteed that any - * path which ultimatley gets found could also have been found - * by regular lookup going all the way in absence of concurrent - * modifications. - */ dvs = vget_prep_smr(dvp); cache_fpl_smr_exit(fpl); if (__predict_false(dvs == VGET_NONE)) { @@ -3893,7 +3874,6 @@ cache_fplookup_partial_setup(struct cache_fpl *fpl) cache_fpl_restore_partial(fpl, &fpl->snd); ndp->ni_startdir = dvp; - MPASS((cnp->cn_flags & MAKEENTRY) == 0); cnp->cn_flags |= MAKEENTRY; if (cache_fpl_islastcn(ndp)) cnp->cn_flags |= ISLASTCN; @@ -3940,159 +3920,18 @@ cache_fplookup_final_child(struct cache_fpl *fpl, enum vgetstate tvs) /* * They want to possibly modify the state of the namecache. + * + * Don't try to match the API contract, just leave. + * TODO: this leaves scalability on the table */ -static int __noinline +static int cache_fplookup_final_modifying(struct cache_fpl *fpl) { - struct nameidata *ndp; struct componentname *cnp; - enum vgetstate dvs; - struct vnode *dvp, *tvp; - struct mount *mp; - seqc_t dvp_seqc; - int error; - bool docache; - ndp = fpl->ndp; cnp = fpl->cnp; - dvp = fpl->dvp; - dvp_seqc = fpl->dvp_seqc; - - MPASS(cache_fpl_islastcn(ndp)); - if ((cnp->cn_flags & LOCKPARENT) == 0) - MPASS((cnp->cn_flags & WANTPARENT) != 0); - MPASS((cnp->cn_flags & TRAILINGSLASH) == 0); - MPASS(cnp->cn_nameiop == CREATE || cnp->cn_nameiop == DELETE || - cnp->cn_nameiop == RENAME); - - docache = (cnp->cn_flags & NOCACHE) ^ NOCACHE; - if (cnp->cn_nameiop == DELETE || cnp->cn_nameiop == RENAME) - docache = false; - - mp = atomic_load_ptr(&dvp->v_mount); - if (__predict_false(mp == NULL)) { - return (cache_fpl_aborted(fpl)); - } - - if (__predict_false(mp->mnt_flag & MNT_RDONLY)) { - cache_fpl_smr_exit(fpl); - /* - * Original code keeps not checking for CREATE which - * might be a bug. For now let the old lookup decide. - */ - if (cnp->cn_nameiop == CREATE) { - return (cache_fpl_aborted(fpl)); - } - return (cache_fpl_handled(fpl, EROFS)); - } - - /* - * Secure access to dvp; check cache_fplookup_partial_setup for - * reasoning. - * - * XXX At least UFS requires its lookup routine to be called for - * the last path component, which leads to some level of complicaton - * and inefficiency: - * - the target routine always locks the target vnode, but our caller - * may not need it locked - * - some of the VOP machinery asserts that the parent is locked, which - * once more may be not required - * - * TODO: add a flag for filesystems which don't need this. - */ - dvs = vget_prep_smr(dvp); - cache_fpl_smr_exit(fpl); - if (__predict_false(dvs == VGET_NONE)) { - return (cache_fpl_aborted(fpl)); - } - - vget_finish_ref(dvp, dvs); - if (!vn_seqc_consistent(dvp, dvp_seqc)) { - vrele(dvp); - return (cache_fpl_aborted(fpl)); - } - - error = vn_lock(dvp, LK_EXCLUSIVE); - if (__predict_false(error != 0)) { - vrele(dvp); - return (cache_fpl_aborted(fpl)); - } - - tvp = NULL; - MPASS((cnp->cn_flags & MAKEENTRY) == 0); - if (docache) - cnp->cn_flags |= MAKEENTRY; - cnp->cn_flags |= ISLASTCN; - cnp->cn_lkflags = LK_EXCLUSIVE; - error = VOP_LOOKUP(dvp, &tvp, cnp); - switch (error) { - case EJUSTRETURN: - case 0: - break; - case ENOTDIR: - case ENOENT: - vput(dvp); - return (cache_fpl_handled(fpl, error)); - default: - vput(dvp); - return (cache_fpl_aborted(fpl)); - } - - fpl->tvp = tvp; - - if (tvp == NULL) { - if ((cnp->cn_flags & SAVESTART) != 0) { - ndp->ni_startdir = dvp; - vrefact(ndp->ni_startdir); - cnp->cn_flags |= SAVENAME; - } - MPASS(error == EJUSTRETURN); - if ((cnp->cn_flags & LOCKPARENT) == 0) { - VOP_UNLOCK(dvp); - } - return (cache_fpl_handled(fpl, 0)); - } - - /* - * Check if the target is either a symlink or a mount point. - * Since we expect this to be the terminal vnode it should - * almost never be true. - */ - if (__predict_false(!cache_fplookup_vnode_supported(tvp) || - cache_fplookup_need_climb_mount(fpl))) { - vput(dvp); - vput(tvp); - return (cache_fpl_aborted(fpl)); - } - - if ((cnp->cn_flags & LOCKLEAF) == 0) { - VOP_UNLOCK(tvp); - } - - if ((cnp->cn_flags & LOCKPARENT) == 0) { - VOP_UNLOCK(dvp); - } - - if ((cnp->cn_flags & SAVESTART) != 0) { - ndp->ni_startdir = dvp; - vrefact(ndp->ni_startdir); - cnp->cn_flags |= SAVENAME; - } - - return (cache_fpl_handled(fpl, 0)); -} - -static int __noinline -cache_fplookup_modifying(struct cache_fpl *fpl) -{ - struct nameidata *ndp; - - ndp = fpl->ndp; - - if (!cache_fpl_islastcn(ndp)) { - return (cache_fpl_partial(fpl)); - } - return (cache_fplookup_final_modifying(fpl)); + MPASS(cnp->cn_nameiop != LOOKUP); + return (cache_fpl_partial(fpl)); } static int __noinline @@ -4173,6 +4012,8 @@ cache_fplookup_final(struct cache_fpl *fpl) dvp_seqc = fpl->dvp_seqc; tvp = fpl->tvp; + VNPASS(cache_fplookup_vnode_supported(dvp), dvp); + if (cnp->cn_nameiop != LOOKUP) { return (cache_fplookup_final_modifying(fpl)); } @@ -4195,117 +4036,6 @@ cache_fplookup_final(struct cache_fpl *fpl) return (cache_fplookup_final_child(fpl, tvs)); } -static int __noinline -cache_fplookup_noentry(struct cache_fpl *fpl) -{ - struct nameidata *ndp; - struct componentname *cnp; - enum vgetstate dvs; - struct vnode *dvp, *tvp; - seqc_t dvp_seqc; - int error; - bool docache; - - ndp = fpl->ndp; - cnp = fpl->cnp; - dvp = fpl->dvp; - dvp_seqc = fpl->dvp_seqc; - - if (cnp->cn_nameiop != LOOKUP) { - return (cache_fplookup_modifying(fpl)); - } - - MPASS((cnp->cn_flags & SAVESTART) == 0); - - /* - * Only try to fill in the component if it is the last one, - * otherwise not only there may be several to handle but the - * walk may be complicated. - */ - if (!cache_fpl_islastcn(ndp)) { - return (cache_fpl_partial(fpl)); - } - - /* - * Secure access to dvp; check cache_fplookup_partial_setup for - * reasoning. - */ - dvs = vget_prep_smr(dvp); - cache_fpl_smr_exit(fpl); - if (__predict_false(dvs == VGET_NONE)) { - return (cache_fpl_aborted(fpl)); - } - - vget_finish_ref(dvp, dvs); - if (!vn_seqc_consistent(dvp, dvp_seqc)) { - vrele(dvp); - return (cache_fpl_aborted(fpl)); - } - - error = vn_lock(dvp, LK_SHARED); - if (__predict_false(error != 0)) { - vrele(dvp); - return (cache_fpl_aborted(fpl)); - } - - tvp = NULL; - /* - * TODO: provide variants which don't require locking either vnode. - */ - docache = (cnp->cn_flags & NOCACHE) ^ NOCACHE; - MPASS((cnp->cn_flags & MAKEENTRY) == 0); - if (docache) - cnp->cn_flags |= MAKEENTRY; - cnp->cn_flags |= ISLASTCN; - cnp->cn_lkflags = LK_SHARED; - if ((cnp->cn_flags & LOCKSHARED) == 0) { - cnp->cn_lkflags = LK_EXCLUSIVE; - } - error = VOP_LOOKUP(dvp, &tvp, cnp); - switch (error) { - case EJUSTRETURN: - case 0: - break; - case ENOTDIR: - case ENOENT: - vput(dvp); - return (cache_fpl_handled(fpl, error)); - default: - vput(dvp); - return (cache_fpl_aborted(fpl)); - } - - fpl->tvp = tvp; - - if (tvp == NULL) { - MPASS(error == EJUSTRETURN); - if ((cnp->cn_flags & (WANTPARENT | LOCKPARENT)) == 0) { - vput(dvp); - } else if ((cnp->cn_flags & LOCKPARENT) == 0) { - VOP_UNLOCK(dvp); - } - return (cache_fpl_handled(fpl, 0)); - } - - if (__predict_false(!cache_fplookup_vnode_supported(tvp) || - cache_fplookup_need_climb_mount(fpl))) { - vput(dvp); - vput(tvp); - return (cache_fpl_aborted(fpl)); - } - - if ((cnp->cn_flags & LOCKLEAF) == 0) { - VOP_UNLOCK(tvp); - } - - if ((cnp->cn_flags & (WANTPARENT | LOCKPARENT)) == 0) { - vput(dvp); - } else if ((cnp->cn_flags & LOCKPARENT) == 0) { - VOP_UNLOCK(dvp); - } - return (cache_fpl_handled(fpl, 0)); -} - static int __noinline cache_fplookup_dot(struct cache_fpl *fpl) { @@ -4454,8 +4184,13 @@ cache_fplookup_next(struct cache_fpl *fpl) break; } + /* + * If there is no entry we have to punt to the slow path to perform + * actual lookup. Should there be nothing with this name a negative + * entry will be created. + */ if (__predict_false(ncp == NULL)) { - return (cache_fplookup_noentry(fpl)); + return (cache_fpl_partial(fpl)); } tvp = atomic_load_ptr(&ncp->nc_vp); @@ -4804,12 +4539,12 @@ cache_fplookup_impl(struct vnode *dvp, struct cache_fpl *fpl) if (__predict_false(cache_fpl_isdotdot(cnp))) { error = cache_fplookup_dotdot(fpl); - if (__predict_false(cache_fpl_terminated(fpl))) { + if (__predict_false(error != 0)) { break; } } else { error = cache_fplookup_next(fpl); - if (__predict_false(cache_fpl_terminated(fpl))) { + if (__predict_false(error != 0)) { break; } From owner-dev-commits-src-main@freebsd.org Sun Dec 27 19:09:33 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2F9364C3AAE; Sun, 27 Dec 2020 19:09:33 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qv1-xf34.google.com (mail-qv1-xf34.google.com [IPv6:2607:f8b0:4864:20::f34]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D3qx90Yhbz3GM5; Sun, 27 Dec 2020 19:09:32 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qv1-xf34.google.com with SMTP id 4so4190233qvh.1; Sun, 27 Dec 2020 11:09:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=tcOztCaddb9dlC4Bn9QEV0dqUXPu4j+J8xJ/6Zz2xRA=; b=lgyYZcDGsLHs+nRWEugIgMmS9RoUGxWQtm4bP1Aad+Y3nrlg7KOYkO0rBp1orM+8Lr gFf/RAfm4wrv2urVUkb3mNWGR/GFwwKvdL2USPnxUl2IBsw2GqNjWixMfqDKjnnoUuoe /G7hN4m3SHiBYctbdFe+6BGy25QwSug+FFd6IAcrkzI0xHJU4Djd2nbZCHRLunWaNRpE 8QMB/lH0gejySg60RQe9Q8W+IxelC5sE4oMVB7Nmaui8Fw9hekCkTDftYChkfULK2LzW yWConeCAwJnVUvH1nT5SMemTr0OMN+W3QUDhb6qmmKTJQ11BlR4oTG8BapsavJJLSthF Tj8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=tcOztCaddb9dlC4Bn9QEV0dqUXPu4j+J8xJ/6Zz2xRA=; b=d/n5h7KMny3ASL0orPaZzX1iVI6KRg3JrnQpBFDMYO3GNeqWF0K97JTMJaMTfvOeJG nY+uH5RSvjnAzlXWEvcRvZKr9hGaF/pRiqH6XGWoxvQRcsmDlQI3MOBM+/8A/VZlx8bA LxAWf6RPIirWKacrlCJVm5Vp6cu3P9f+vck5GBByihTZ95IQxnEINiLy5zgVryNBYnM5 QSv/0vKVeAuz0JIEGPJqyjakzgS4Yjj7ultkEdMdHF4LL84mvoCeFpxGA16OsYDrEhkS 9Tqy90snw07pxMC2Yn5OHnOyijWDtoMP/R6oYZWYHwtI+C0tupFvgK8EHRAPgnvIt7xt 4HjQ== X-Gm-Message-State: AOAM5304v5DF8tl35niLXXTg/DB2RdR7cpfsUvxoWbS1SJsoWLZGFuZV Ykg7bHa1gjxhkCDUw+g3RF678dJ+rENO1g== X-Google-Smtp-Source: ABdhPJyHmFhpUr0l0H6UXh85F6rGEQYxVXHXfRYAQe21VB594r1vKbqoGE+4ZmQs5XFeEA/xwCxvGQ== X-Received: by 2002:ad4:4952:: with SMTP id o18mr43802041qvy.27.1609096171854; Sun, 27 Dec 2020 11:09:31 -0800 (PST) Received: from raichu ([142.126.164.150]) by smtp.gmail.com with ESMTPSA id q37sm21855879qte.10.2020.12.27.11.09.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Dec 2020 11:09:31 -0800 (PST) Sender: Mark Johnston Date: Sun, 27 Dec 2020 14:09:29 -0500 From: Mark Johnston To: Mateusz Guzik Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: a1fc1f10c65f - main - Revert "cache: modification and last entry filling support in lockless lookup" Message-ID: References: <202012271904.0BRJ4DWF044873@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202012271904.0BRJ4DWF044873@gitrepo.freebsd.org> X-Rspamd-Queue-Id: 4D3qx90Yhbz3GM5 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Dec 2020 19:09:33 -0000 On Sun, Dec 27, 2020 at 07:04:13PM +0000, Mateusz Guzik wrote: > The branch main has been updated by mjg: > > URL: https://cgit.FreeBSD.org/src/commit/?id=a1fc1f10c65fe8684d09d2252c19ebb213182b4f > > commit a1fc1f10c65fe8684d09d2252c19ebb213182b4f > Author: Mateusz Guzik > AuthorDate: 2020-12-27 19:02:29 +0000 > Commit: Mateusz Guzik > CommitDate: 2020-12-27 19:02:29 +0000 > > Revert "cache: modification and last entry filling support in lockless lookup" > > This reverts commit 6dbb07ed6872ae7988b9b705e322c94658eba6d1. > > Some ports unreliably fail to build with rmdir getting ENOTEMPTY. I also got this when running the fs/tmpfs/rename_test:dots test panic: Assertion (cnp->cn_flags & ISDOTDOT) != 0 failed at /usr/home/markj/src/freebsd-dev/sys/kern/vfs_cache.c:1663 cpuid = 22 time = 1609095767 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe01aeb764b0 vpanic() at vpanic+0x181/frame 0xfffffe01aeb76500 panic() at panic+0x43/frame 0xfffffe01aeb76560 cache_lookup_dotdot() at cache_lookup_dotdot+0x509/frame 0xfffffe01aeb765d0 vfs_cache_lookup() at vfs_cache_lookup+0x7b/frame 0xfffffe01aeb76620 cache_fplookup_final_modifying() at cache_fplookup_final_modifying+0x1b5/frame 0xfffffe01aeb766a0 cache_fplookup() at cache_fplookup+0x8f2/frame 0xfffffe01aeb767b0 namei() at namei+0x17f/frame 0xfffffe01aeb76870 kern_renameat() at kern_renameat+0x10c/frame 0xfffffe01aeb76ac0 amd64_syscall() at amd64_syscall+0x12e/frame 0xfffffe01aeb76bf0 fast_syscall_common() at fast_syscall_common+0xf8/frame 0xfffffe01aeb76bf0 From owner-dev-commits-src-main@freebsd.org Sun Dec 27 19:22:28 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B7A444C46AB; Sun, 27 Dec 2020 19:22:28 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D3rD44dNhz3HYt; Sun, 27 Dec 2020 19:22:28 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wm1-x329.google.com with SMTP id c124so7764200wma.5; Sun, 27 Dec 2020 11:22:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=iSV9qwRH9lNpNNo6KTbg9tuC22ySn0FwA1SWu7iovNQ=; b=AYju1pIvFEy+01Ouyl5CRaTFGFVaYZnonBgA8sYBv9lVN1iNfFHXghlWEDN0IFHqwR Q4GrOmnYxBmHsGlE+d/YjlgyZaJhLFfWwPj4OBr748kwGo195xEQyQDutmKqESU+PXm3 8xsNBzdqpMlUQFJJ6xmWkmLbBxGAQ8lKN22myh+vmWJqN83TeflewHA61lPMbVrdUL5A 4cqsHKp1MhXk+bP1SeAWdFZVKiZKOVcEoqK5Jb1zelxbe5CluaHrZT/cSttpTcVY9uOf qDJ6danVAh8KtxOKDZ/mWE6JR9x6fM/d91s3+CpQ8gRBe7i9I8/2WLumoEeAI+BjWiAy A/9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=iSV9qwRH9lNpNNo6KTbg9tuC22ySn0FwA1SWu7iovNQ=; b=LFqylyKQWVI+XjXofMRHMyxqwK5IS2wxOd0LDHE7dSagIZ5j5Ng9w6Dr+Cpin+sV7/ 7tVRSbRa3UBtvoBGcjyf5t8YgAQxJAqNHXNPqfVWR9sKwmc1lyCle1ifsrNK/U2NF3a+ pUMCadojQAmNa0v9quGYXS4qw3aFKFGTZCfT7zJLswJWuqHn1lMZ14SBgPc+HprrD9T/ Njh7oCjXSI8313X4mQQyK0Xoornb5Cigie67+7LDLgK0PAzc2K5kbfuckO7zHc3/Zb1Z zuIHwj68EthNGMv9HxpNSNmVOrmoLNqRih8zzzHv8XiyqDBEvKiouxaSbVpjjzllEwIs pA5w== X-Gm-Message-State: AOAM530To93ITDrQ64IVy/2PPKBCsmydiPyYlj5QqNsIVHg9JIOX7Ku+ /BrH55C2XyAj9jOVZw7fvbg706Tk6Xld08y97F4LArrIAOo= X-Google-Smtp-Source: ABdhPJzzITJDle4m1Xyk/MeqACd1564f+SnYzjrDBjtOlMoEC5YgTgcXY85HrrKBh6xjC9FZfbH0QgauYRCQUf371Hg= X-Received: by 2002:a7b:c773:: with SMTP id x19mr16928173wmk.127.1609096946423; Sun, 27 Dec 2020 11:22:26 -0800 (PST) MIME-Version: 1.0 Received: by 2002:adf:f811:0:0:0:0:0 with HTTP; Sun, 27 Dec 2020 11:22:25 -0800 (PST) In-Reply-To: References: <202012271904.0BRJ4DWF044873@gitrepo.freebsd.org> From: Mateusz Guzik Date: Sun, 27 Dec 2020 20:22:25 +0100 Message-ID: Subject: Re: git: a1fc1f10c65f - main - Revert "cache: modification and last entry filling support in lockless lookup" To: Mark Johnston Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4D3rD44dNhz3HYt X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Dec 2020 19:22:28 -0000 I ran into it myself building one of the affected ports (devel/gettext-runtime). On 12/27/20, Mark Johnston wrote: > On Sun, Dec 27, 2020 at 07:04:13PM +0000, Mateusz Guzik wrote: >> The branch main has been updated by mjg: >> >> URL: >> https://cgit.FreeBSD.org/src/commit/?id=a1fc1f10c65fe8684d09d2252c19ebb213182b4f >> >> commit a1fc1f10c65fe8684d09d2252c19ebb213182b4f >> Author: Mateusz Guzik >> AuthorDate: 2020-12-27 19:02:29 +0000 >> Commit: Mateusz Guzik >> CommitDate: 2020-12-27 19:02:29 +0000 >> >> Revert "cache: modification and last entry filling support in lockless >> lookup" >> >> This reverts commit 6dbb07ed6872ae7988b9b705e322c94658eba6d1. >> >> Some ports unreliably fail to build with rmdir getting ENOTEMPTY. > > I also got this when running the fs/tmpfs/rename_test:dots test > > panic: Assertion (cnp->cn_flags & ISDOTDOT) != 0 failed at > /usr/home/markj/src/freebsd-dev/sys/kern/vfs_cache.c:1663 > cpuid = 22 > time = 1609095767 > KDB: stack backtrace: > > db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame > 0xfffffe01aeb764b0 > vpanic() at vpanic+0x181/frame 0xfffffe01aeb76500 > panic() at panic+0x43/frame 0xfffffe01aeb76560 > cache_lookup_dotdot() at cache_lookup_dotdot+0x509/frame 0xfffffe01aeb765d0 > vfs_cache_lookup() at vfs_cache_lookup+0x7b/frame 0xfffffe01aeb76620 > cache_fplookup_final_modifying() at > cache_fplookup_final_modifying+0x1b5/frame 0xfffffe01aeb766a0 > cache_fplookup() at cache_fplookup+0x8f2/frame 0xfffffe01aeb767b0 > namei() at namei+0x17f/frame 0xfffffe01aeb76870 > kern_renameat() at kern_renameat+0x10c/frame 0xfffffe01aeb76ac0 > amd64_syscall() at amd64_syscall+0x12e/frame 0xfffffe01aeb76bf0 > fast_syscall_common() at fast_syscall_common+0xf8/frame 0xfffffe01aeb76bf0 > -- Mateusz Guzik From owner-dev-commits-src-main@freebsd.org Sun Dec 27 20:13:12 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DED984C52F5; Sun, 27 Dec 2020 20:13:12 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4D3sLc5mv5z3Lwp; Sun, 27 Dec 2020 20:13:12 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from [192.168.0.75] (d-137-103-47-117.fl.cpe.atlanticbb.net [137.103.47.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: gallatin) by duke.cs.duke.edu (Postfix) with ESMTPSA id 65B002700178; Sun, 27 Dec 2020 15:13:11 -0500 (EST) DMARC-Filter: OpenDMARC Filter v1.3.1 duke.cs.duke.edu 65B002700178 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=cs.duke.edu; s=mail0816; t=1609099991; bh=CMIt8ymdRUmtDIAuARdXgnIHVW9ItTlJ7wwtET+GSr0=; h=Subject:To:From:Date:From; b=K4/6jlSvWQ5h2DZEXGDxtR1gMzB3dq6h30P6xgp3IeeuC37G8ABg7Sno74TKXtvpF ySZTpALcwNAyaaOTiAMQ9usCLzz9SDoRjRbFcma9VVXniYEKnJqb7qBddBOee4B1kn MLiYmzEocQMYgnwP7GmxlIN49699kr+DHbcnoPyAxvdTyDkYC+9G4lBsEcQ8PlZepY qLRy44YiQHQamPPP7hlYo+t0nN5JJ36D0mSpbqBeXPGyE0s364BJcgiSK6A23q7Sn6 tHj3u33iJg9SaJO1TYkvG8hrhNf0PJNEgvnN7PNDWZOeGPU/sfUzc14pDI26LeNk1f TYVzeKqb5qigw== Subject: Re: git: d39f7430a6e1 - main - amd64: preserve %cr2 in NMI/MCE/DBG handlers. To: Konstantin Belousov , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202012271114.0BRBEwOO035891@gitrepo.freebsd.org> From: Andrew Gallatin Message-ID: Date: Sun, 27 Dec 2020 15:13:09 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: <202012271114.0BRBEwOO035891@gitrepo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4D3sLc5mv5z3Lwp X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Dec 2020 20:13:12 -0000 On 12/27/20 6:14 AM, Konstantin Belousov wrote: > The branch main has been updated by kib: > > URL: https://urldefense.com/v3/__https://cgit.FreeBSD.org/src/commit/?id=d39f7430a6e1da419d6e4fb871bca5ba7863f738__;!!OToaGQ!7EPo6uRRpq8kWDLzM05a4h158xFeRyJ9PhhE1j04Y5uZaHKskCoGhso0T717aEhpYQ$ > > commit d39f7430a6e1da419d6e4fb871bca5ba7863f738 > Author: Konstantin Belousov > AuthorDate: 2020-12-25 21:58:43 +0000 > Commit: Konstantin Belousov > CommitDate: 2020-12-27 10:59:33 +0000 > > amd64: preserve %cr2 in NMI/MCE/DBG handlers. > > These handlers could interrupt code which has interrupts disabled, > and if a spurious page fault occurs during exception handler run, > we get clobbered %cr2 in higher level stack. > > This is mostly a speculation, but it is based on hints from good sources. I assume this is based around the mystery panic I was talking about on irc last week. Can you please explain what a spurious page fault is? A fault where there is a valid mapping, but we somehow take a fault for no reason? How often does this happen? Drew From owner-dev-commits-src-main@freebsd.org Sun Dec 27 21:05:01 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D9C524C71F0; Sun, 27 Dec 2020 21:05:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D3tVP5spgz3R0N; Sun, 27 Dec 2020 21:05:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BC71D5E1B; Sun, 27 Dec 2020 21:05:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BRL51JL077792; Sun, 27 Dec 2020 21:05:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BRL51WQ077791; Sun, 27 Dec 2020 21:05:01 GMT (envelope-from git) Date: Sun, 27 Dec 2020 21:05:01 GMT Message-Id: <202012272105.0BRL51WQ077791@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 623daa69f9f4 - main - cache: assert internal flags are not passed by namei MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 623daa69f9f43613f49ea6164175195ea3a8b3e9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Dec 2020 21:05:01 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=623daa69f9f43613f49ea6164175195ea3a8b3e9 commit 623daa69f9f43613f49ea6164175195ea3a8b3e9 Author: Mateusz Guzik AuthorDate: 2020-12-27 19:42:16 +0000 Commit: Mateusz Guzik CommitDate: 2020-12-27 19:49:24 +0000 cache: assert internal flags are not passed by namei --- sys/kern/vfs_cache.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index 38121893126e..6e5154df63a1 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -67,6 +67,9 @@ __FBSDID("$FreeBSD$"); #ifdef KTRACE #include #endif +#ifdef INVARIANTS +#include +#endif #include @@ -4704,6 +4707,9 @@ cache_fplookup(struct nameidata *ndp, enum cache_fpl_status *status, fpl.ndp = ndp; fpl.cnp = &ndp->ni_cnd; MPASS(curthread == fpl.cnp->cn_thread); + KASSERT ((fpl.cnp->cn_flags & CACHE_FPL_INTERNAL_CN_FLAGS) == 0, + ("%s: internal flags found in cn_flags %" PRIx64, __func__, + fpl.cnp->cn_flags)); if ((fpl.cnp->cn_flags & SAVESTART) != 0) MPASS(fpl.cnp->cn_nameiop != LOOKUP); From owner-dev-commits-src-main@freebsd.org Sun Dec 27 21:05:01 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CD37C4C6E73; Sun, 27 Dec 2020 21:05:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D3tVP5PbKz3R2K; Sun, 27 Dec 2020 21:05:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ABDC2600C; Sun, 27 Dec 2020 21:05:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BRL51u8077775; Sun, 27 Dec 2020 21:05:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BRL51FN077774; Sun, 27 Dec 2020 21:05:01 GMT (envelope-from git) Date: Sun, 27 Dec 2020 21:05:01 GMT Message-Id: <202012272105.0BRL51FN077774@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: abd7ded451c0 - main - cache: modification and last entry filling support in lockless lookup v2 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: abd7ded451c0ddda2188b31826dc911cd22da9db Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Dec 2020 21:05:01 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=abd7ded451c0ddda2188b31826dc911cd22da9db commit abd7ded451c0ddda2188b31826dc911cd22da9db Author: Mateusz Guzik AuthorDate: 2020-12-27 19:19:43 +0000 Commit: Mateusz Guzik CommitDate: 2020-12-27 21:03:18 +0000 cache: modification and last entry filling support in lockless lookup v2 The previous patch failed to set the ISDOTDOT flag when appropriate, which in turn fail to properly handle degenerate lookups. While here sprinkle some extra assertions. Tested by: pho (previous version) --- sys/kern/vfs_cache.c | 302 ++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 286 insertions(+), 16 deletions(-) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index 6e5154df63a1..75c362534c91 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -3727,6 +3727,13 @@ cache_fpl_handled_impl(struct cache_fpl *fpl, int error, int line) #define cache_fpl_handled(x, e) cache_fpl_handled_impl((x), (e), __LINE__) +static bool +cache_fpl_terminated(struct cache_fpl *fpl) +{ + + return (fpl->status != CACHE_FPL_STATUS_UNSET); +} + #define CACHE_FPL_SUPPORTED_CN_FLAGS \ (NC_NOMAKEENTRY | NC_KEEPPOSENTRY | LOCKLEAF | LOCKPARENT | WANTPARENT | \ FOLLOW | LOCKSHARED | SAVENAME | SAVESTART | WILLBEDIR | ISOPEN | \ @@ -3738,6 +3745,8 @@ cache_fpl_handled_impl(struct cache_fpl *fpl, int error, int line) _Static_assert((CACHE_FPL_SUPPORTED_CN_FLAGS & CACHE_FPL_INTERNAL_CN_FLAGS) == 0, "supported and internal flags overlap"); +static bool cache_fplookup_need_climb_mount(struct cache_fpl *fpl); + static bool cache_fpl_islastcn(struct nameidata *ndp) { @@ -3860,6 +3869,16 @@ cache_fplookup_partial_setup(struct cache_fpl *fpl) return (cache_fpl_aborted(fpl)); } + /* + * Note that seqc is checked before the vnode is locked, so by + * the time regular lookup gets to it it may have moved. + * + * Ultimately this does not affect correctness, any lookup errors + * are userspace racing with itself. It is guaranteed that any + * path which ultimatley gets found could also have been found + * by regular lookup going all the way in absence of concurrent + * modifications. + */ dvs = vget_prep_smr(dvp); cache_fpl_smr_exit(fpl); if (__predict_false(dvs == VGET_NONE)) { @@ -3923,18 +3942,162 @@ cache_fplookup_final_child(struct cache_fpl *fpl, enum vgetstate tvs) /* * They want to possibly modify the state of the namecache. - * - * Don't try to match the API contract, just leave. - * TODO: this leaves scalability on the table */ -static int +static int __noinline cache_fplookup_final_modifying(struct cache_fpl *fpl) { + struct nameidata *ndp; struct componentname *cnp; + enum vgetstate dvs; + struct vnode *dvp, *tvp; + struct mount *mp; + seqc_t dvp_seqc; + int error; + bool docache; + ndp = fpl->ndp; cnp = fpl->cnp; - MPASS(cnp->cn_nameiop != LOOKUP); - return (cache_fpl_partial(fpl)); + dvp = fpl->dvp; + dvp_seqc = fpl->dvp_seqc; + + MPASS(cache_fpl_islastcn(ndp)); + if ((cnp->cn_flags & LOCKPARENT) == 0) + MPASS((cnp->cn_flags & WANTPARENT) != 0); + MPASS((cnp->cn_flags & TRAILINGSLASH) == 0); + MPASS(cnp->cn_nameiop == CREATE || cnp->cn_nameiop == DELETE || + cnp->cn_nameiop == RENAME); + MPASS((cnp->cn_flags & MAKEENTRY) == 0); + MPASS((cnp->cn_flags & ISDOTDOT) == 0); + + docache = (cnp->cn_flags & NOCACHE) ^ NOCACHE; + if (cnp->cn_nameiop == DELETE || cnp->cn_nameiop == RENAME) + docache = false; + + mp = atomic_load_ptr(&dvp->v_mount); + if (__predict_false(mp == NULL)) { + return (cache_fpl_aborted(fpl)); + } + + if (__predict_false(mp->mnt_flag & MNT_RDONLY)) { + cache_fpl_smr_exit(fpl); + /* + * Original code keeps not checking for CREATE which + * might be a bug. For now let the old lookup decide. + */ + if (cnp->cn_nameiop == CREATE) { + return (cache_fpl_aborted(fpl)); + } + return (cache_fpl_handled(fpl, EROFS)); + } + + /* + * Secure access to dvp; check cache_fplookup_partial_setup for + * reasoning. + * + * XXX At least UFS requires its lookup routine to be called for + * the last path component, which leads to some level of complicaton + * and inefficiency: + * - the target routine always locks the target vnode, but our caller + * may not need it locked + * - some of the VOP machinery asserts that the parent is locked, which + * once more may be not required + * + * TODO: add a flag for filesystems which don't need this. + */ + dvs = vget_prep_smr(dvp); + cache_fpl_smr_exit(fpl); + if (__predict_false(dvs == VGET_NONE)) { + return (cache_fpl_aborted(fpl)); + } + + vget_finish_ref(dvp, dvs); + if (!vn_seqc_consistent(dvp, dvp_seqc)) { + vrele(dvp); + return (cache_fpl_aborted(fpl)); + } + + error = vn_lock(dvp, LK_EXCLUSIVE); + if (__predict_false(error != 0)) { + vrele(dvp); + return (cache_fpl_aborted(fpl)); + } + + tvp = NULL; + cnp->cn_flags |= ISLASTCN; + if (docache) + cnp->cn_flags |= MAKEENTRY; + if (cache_fpl_isdotdot(cnp)) + cnp->cn_flags |= ISDOTDOT; + cnp->cn_lkflags = LK_EXCLUSIVE; + error = VOP_LOOKUP(dvp, &tvp, cnp); + switch (error) { + case EJUSTRETURN: + case 0: + break; + case ENOTDIR: + case ENOENT: + vput(dvp); + return (cache_fpl_handled(fpl, error)); + default: + vput(dvp); + return (cache_fpl_aborted(fpl)); + } + + fpl->tvp = tvp; + + if (tvp == NULL) { + if ((cnp->cn_flags & SAVESTART) != 0) { + ndp->ni_startdir = dvp; + vrefact(ndp->ni_startdir); + cnp->cn_flags |= SAVENAME; + } + MPASS(error == EJUSTRETURN); + if ((cnp->cn_flags & LOCKPARENT) == 0) { + VOP_UNLOCK(dvp); + } + return (cache_fpl_handled(fpl, 0)); + } + + /* + * Check if the target is either a symlink or a mount point. + * Since we expect this to be the terminal vnode it should + * almost never be true. + */ + if (__predict_false(!cache_fplookup_vnode_supported(tvp) || + cache_fplookup_need_climb_mount(fpl))) { + vput(dvp); + vput(tvp); + return (cache_fpl_aborted(fpl)); + } + + if ((cnp->cn_flags & LOCKLEAF) == 0) { + VOP_UNLOCK(tvp); + } + + if ((cnp->cn_flags & LOCKPARENT) == 0) { + VOP_UNLOCK(dvp); + } + + if ((cnp->cn_flags & SAVESTART) != 0) { + ndp->ni_startdir = dvp; + vrefact(ndp->ni_startdir); + cnp->cn_flags |= SAVENAME; + } + + return (cache_fpl_handled(fpl, 0)); +} + +static int __noinline +cache_fplookup_modifying(struct cache_fpl *fpl) +{ + struct nameidata *ndp; + + ndp = fpl->ndp; + + if (!cache_fpl_islastcn(ndp)) { + return (cache_fpl_partial(fpl)); + } + return (cache_fplookup_final_modifying(fpl)); } static int __noinline @@ -4015,8 +4178,6 @@ cache_fplookup_final(struct cache_fpl *fpl) dvp_seqc = fpl->dvp_seqc; tvp = fpl->tvp; - VNPASS(cache_fplookup_vnode_supported(dvp), dvp); - if (cnp->cn_nameiop != LOOKUP) { return (cache_fplookup_final_modifying(fpl)); } @@ -4039,6 +4200,120 @@ cache_fplookup_final(struct cache_fpl *fpl) return (cache_fplookup_final_child(fpl, tvs)); } +static int __noinline +cache_fplookup_noentry(struct cache_fpl *fpl) +{ + struct nameidata *ndp; + struct componentname *cnp; + enum vgetstate dvs; + struct vnode *dvp, *tvp; + seqc_t dvp_seqc; + int error; + bool docache; + + ndp = fpl->ndp; + cnp = fpl->cnp; + dvp = fpl->dvp; + dvp_seqc = fpl->dvp_seqc; + + MPASS((cnp->cn_flags & MAKEENTRY) == 0); + MPASS((cnp->cn_flags & ISDOTDOT) == 0); + MPASS(!cache_fpl_isdotdot(cnp)); + + if (cnp->cn_nameiop != LOOKUP) { + return (cache_fplookup_modifying(fpl)); + } + + MPASS((cnp->cn_flags & SAVESTART) == 0); + + /* + * Only try to fill in the component if it is the last one, + * otherwise not only there may be several to handle but the + * walk may be complicated. + */ + if (!cache_fpl_islastcn(ndp)) { + return (cache_fpl_partial(fpl)); + } + + /* + * Secure access to dvp; check cache_fplookup_partial_setup for + * reasoning. + */ + dvs = vget_prep_smr(dvp); + cache_fpl_smr_exit(fpl); + if (__predict_false(dvs == VGET_NONE)) { + return (cache_fpl_aborted(fpl)); + } + + vget_finish_ref(dvp, dvs); + if (!vn_seqc_consistent(dvp, dvp_seqc)) { + vrele(dvp); + return (cache_fpl_aborted(fpl)); + } + + error = vn_lock(dvp, LK_SHARED); + if (__predict_false(error != 0)) { + vrele(dvp); + return (cache_fpl_aborted(fpl)); + } + + tvp = NULL; + /* + * TODO: provide variants which don't require locking either vnode. + */ + cnp->cn_flags |= ISLASTCN; + docache = (cnp->cn_flags & NOCACHE) ^ NOCACHE; + if (docache) + cnp->cn_flags |= MAKEENTRY; + cnp->cn_lkflags = LK_SHARED; + if ((cnp->cn_flags & LOCKSHARED) == 0) { + cnp->cn_lkflags = LK_EXCLUSIVE; + } + error = VOP_LOOKUP(dvp, &tvp, cnp); + switch (error) { + case EJUSTRETURN: + case 0: + break; + case ENOTDIR: + case ENOENT: + vput(dvp); + return (cache_fpl_handled(fpl, error)); + default: + vput(dvp); + return (cache_fpl_aborted(fpl)); + } + + fpl->tvp = tvp; + + if (tvp == NULL) { + MPASS(error == EJUSTRETURN); + if ((cnp->cn_flags & (WANTPARENT | LOCKPARENT)) == 0) { + vput(dvp); + } else if ((cnp->cn_flags & LOCKPARENT) == 0) { + VOP_UNLOCK(dvp); + } + return (cache_fpl_handled(fpl, 0)); + } + + if (__predict_false(!cache_fplookup_vnode_supported(tvp) || + cache_fplookup_need_climb_mount(fpl))) { + vput(dvp); + vput(tvp); + return (cache_fpl_aborted(fpl)); + } + + if ((cnp->cn_flags & LOCKLEAF) == 0) { + VOP_UNLOCK(tvp); + } + + if ((cnp->cn_flags & (WANTPARENT | LOCKPARENT)) == 0) { + vput(dvp); + } else if ((cnp->cn_flags & LOCKPARENT) == 0) { + VOP_UNLOCK(dvp); + } + return (cache_fpl_handled(fpl, 0)); +} + static int __noinline cache_fplookup_dot(struct cache_fpl *fpl) { @@ -4187,13 +4462,8 @@ cache_fplookup_next(struct cache_fpl *fpl) break; } - /* - * If there is no entry we have to punt to the slow path to perform - * actual lookup. Should there be nothing with this name a negative - * entry will be created. - */ if (__predict_false(ncp == NULL)) { - return (cache_fpl_partial(fpl)); + return (cache_fplookup_noentry(fpl)); } tvp = atomic_load_ptr(&ncp->nc_vp); @@ -4542,12 +4812,12 @@ cache_fplookup_impl(struct vnode *dvp, struct cache_fpl *fpl) if (__predict_false(cache_fpl_isdotdot(cnp))) { error = cache_fplookup_dotdot(fpl); - if (__predict_false(error != 0)) { + if (__predict_false(cache_fpl_terminated(fpl))) { break; } } else { error = cache_fplookup_next(fpl); - if (__predict_false(error != 0)) { + if (__predict_false(cache_fpl_terminated(fpl))) { break; } From owner-dev-commits-src-main@freebsd.org Sun Dec 27 21:28:41 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 28F9A4C7CAF; Sun, 27 Dec 2020 21:28:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D3v1j0ZV2z3hp5; Sun, 27 Dec 2020 21:28:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 06CEF60BB; Sun, 27 Dec 2020 21:28:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BRLSecr099764; Sun, 27 Dec 2020 21:28:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BRLSeeX099763; Sun, 27 Dec 2020 21:28:40 GMT (envelope-from git) Date: Sun, 27 Dec 2020 21:28:40 GMT Message-Id: <202012272128.0BRLSeeX099763@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Toomas Soome Subject: git: 2ae58414722b - main - libsa: xdrproc_t should return bool MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tsoome X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2ae58414722b613f5e73be8e01602c2c9991f42a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Dec 2020 21:28:41 -0000 The branch main has been updated by tsoome: URL: https://cgit.FreeBSD.org/src/commit/?id=2ae58414722b613f5e73be8e01602c2c9991f42a commit 2ae58414722b613f5e73be8e01602c2c9991f42a Author: Toomas Soome AuthorDate: 2020-12-27 21:19:41 +0000 Commit: Toomas Soome CommitDate: 2020-12-27 21:25:18 +0000 libsa: xdrproc_t should return bool Since our xdr translation function are returning bool, so should xdrproc_t. Issue reported by gcc 10 build. --- stand/libsa/zfs/nvlist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stand/libsa/zfs/nvlist.c b/stand/libsa/zfs/nvlist.c index e5c9eb5c4e82..ba994f97d40a 100644 --- a/stand/libsa/zfs/nvlist.c +++ b/stand/libsa/zfs/nvlist.c @@ -56,7 +56,7 @@ static bool nvlist_size_native(xdr_t *, size_t *); static bool xdr_int(xdr_t *, int *); static bool xdr_u_int(xdr_t *, unsigned *); -typedef int (*xdrproc_t)(xdr_t *, void *); +typedef bool (*xdrproc_t)(xdr_t *, void *); /* Basic primitives for XDR translation operations, getint and putint. */ static int From owner-dev-commits-src-main@freebsd.org Sun Dec 27 21:32:36 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BC7364C7A5D; Sun, 27 Dec 2020 21:32:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D3v6D4wTRz3j26; Sun, 27 Dec 2020 21:32:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9C2C2631A; Sun, 27 Dec 2020 21:32:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BRLWaoV010545; Sun, 27 Dec 2020 21:32:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BRLWalR010544; Sun, 27 Dec 2020 21:32:36 GMT (envelope-from git) Date: Sun, 27 Dec 2020 21:32:36 GMT Message-Id: <202012272132.0BRLWalR010544@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Stefan Eßer Subject: git: 50fcb4ee771c - main - Replace sscanf() by strtoul() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: se X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 50fcb4ee771cabbae99bb3150b26484f3e573fab Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Dec 2020 21:32:36 -0000 The branch main has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=50fcb4ee771cabbae99bb3150b26484f3e573fab commit 50fcb4ee771cabbae99bb3150b26484f3e573fab Author: Stefan Eßer AuthorDate: 2020-12-26 21:21:49 +0000 Commit: Stefan Eßer CommitDate: 2020-12-27 21:32:22 +0000 Replace sscanf() by strtoul() This change has been motivated by a mail from bde sent in 2015 in which he mentioned inappropriate use of sscanf() in 3 programs in /bin. This change removes the potential mismatch of the types of the return values and the variable width specified in the scan pattern. While there was no issue with the patterns and types used, the new code is simpler and more efficient. --- bin/stty/gfmt.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/bin/stty/gfmt.c b/bin/stty/gfmt.c index 055edf880bd6..12ed2a2d3500 100644 --- a/bin/stty/gfmt.c +++ b/bin/stty/gfmt.c @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include "stty.h" @@ -85,7 +86,7 @@ gread(struct termios *tp, char *s) if (!(ep = strchr(p, '='))) gerr(p); *ep++ = '\0'; - (void)sscanf(ep, "%lx", (u_long *)&tmp); + tmp = strtoul(ep, NULL, 0x10); #define CHK(s) (*p == s[0] && !strcmp(p, s)) if (CHK("cflag")) { @@ -97,7 +98,7 @@ gread(struct termios *tp, char *s) continue; } if (CHK("ispeed")) { - (void)sscanf(ep, "%ld", &tmp); + tmp = strtoul(ep, NULL, 10); tp->c_ispeed = tmp; continue; } @@ -110,14 +111,14 @@ gread(struct termios *tp, char *s) continue; } if (CHK("ospeed")) { - (void)sscanf(ep, "%ld", &tmp); + tmp = strtoul(ep, NULL, 10); tp->c_ospeed = tmp; continue; } for (cp = cchars1; cp->name != NULL; ++cp) if (CHK(cp->name)) { if (cp->sub == VMIN || cp->sub == VTIME) - (void)sscanf(ep, "%ld", &tmp); + tmp = strtoul(ep, NULL, 10); tp->c_cc[cp->sub] = tmp; break; } From owner-dev-commits-src-main@freebsd.org Sun Dec 27 21:32:37 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0165A4C7A5F; Sun, 27 Dec 2020 21:32:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D3v6D6T2Dz3hsq; Sun, 27 Dec 2020 21:32:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D072E62D2; Sun, 27 Dec 2020 21:32:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BRLWaEY010596; Sun, 27 Dec 2020 21:32:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BRLWaFT010595; Sun, 27 Dec 2020 21:32:36 GMT (envelope-from git) Date: Sun, 27 Dec 2020 21:32:36 GMT Message-Id: <202012272132.0BRLWaFT010595@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Stefan Eßer Subject: git: 6fe8fbdc1cdd - main - Statistics are for threads, not processes MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: se X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6fe8fbdc1cdd8308fc0212d5324a73a3d7497fe5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Dec 2020 21:32:37 -0000 The branch main has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=6fe8fbdc1cdd8308fc0212d5324a73a3d7497fe5 commit 6fe8fbdc1cdd8308fc0212d5324a73a3d7497fe5 Author: Stefan Eßer AuthorDate: 2020-12-25 11:38:17 +0000 Commit: Stefan Eßer CommitDate: 2020-12-27 21:32:22 +0000 Statistics are for threads, not processes --- usr.bin/systat/systat.1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/systat/systat.1 b/usr.bin/systat/systat.1 index 802c7cd7614a..d2eeb2854816 100644 --- a/usr.bin/systat/systat.1 +++ b/usr.bin/systat/systat.1 @@ -333,7 +333,7 @@ Finally the last column shows the number of kilobytes in physical pages on the free list. .Pp Below the memory display is a list of the -average number of processes (over the last refresh interval) +average number of threads (over the last refresh interval) that are runnable (`r'), in page wait (`p'), in disk wait other than paging (`d'), sleeping (`s'), and swapped out but desiring to run (`w'). From owner-dev-commits-src-main@freebsd.org Sun Dec 27 21:32:36 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CEBE94C7A5E; Sun, 27 Dec 2020 21:32:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D3v6D5Rv4z3hsp; Sun, 27 Dec 2020 21:32:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ACEC4631B; Sun, 27 Dec 2020 21:32:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BRLWalq010562; Sun, 27 Dec 2020 21:32:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BRLWadl010561; Sun, 27 Dec 2020 21:32:36 GMT (envelope-from git) Date: Sun, 27 Dec 2020 21:32:36 GMT Message-Id: <202012272132.0BRLWadl010561@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Stefan Eßer Subject: git: 3fee777ec5a2 - main - Simplify LS_COLWIDTHS processing MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: se X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3fee777ec5a2e91ffbd9b396e99edae386eb150e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Dec 2020 21:32:36 -0000 The branch main has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=3fee777ec5a2e91ffbd9b396e99edae386eb150e commit 3fee777ec5a2e91ffbd9b396e99edae386eb150e Author: Stefan Eßer AuthorDate: 2020-12-26 21:10:54 +0000 Commit: Stefan Eßer CommitDate: 2020-12-27 21:32:22 +0000 Simplify LS_COLWIDTHS processing The previous version normalized the width list (replaced empty fields with "0") just to be able to use sscanf() on the string. It is much simpler to just parse the string as-is. The clearing of f_notabs is preserved for the case that less than 9 width values have been defined, but I do not understand the rationale for this particular condition. E.g., LS_COLWIDTHS="::::::::" will be counted as 9 defined fields (may clear f_notabs) but is no different fron LS_COLWIDTHS="" with regard to the field width (and that does not clear f_notabs, since there are less than 9 fields). --- bin/ls/ls.c | 115 +++++++++++++++++++++++------------------------------------- 1 file changed, 43 insertions(+), 72 deletions(-) diff --git a/bin/ls/ls.c b/bin/ls/ls.c index b0fe8d79e3ea..338b3d1d2a26 100644 --- a/bin/ls/ls.c +++ b/bin/ls/ls.c @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -88,12 +89,12 @@ __FBSDID("$FreeBSD$"); */ #define MAKENINES(n) \ do { \ - intmax_t i; \ + intmax_t __i; \ \ /* Use a loop as all values of n are small. */ \ - for (i = 1; n > 0; i *= 10) \ + for (__i = 1; n > 0; __i *= 10) \ n--; \ - n = i - 1; \ + n = __i - 1; \ } while(0) static void display(const FTSENT *, FTSENT *, int); @@ -715,88 +716,58 @@ display(const FTSENT *p, FTSENT *list, int options) char *flags, *labelstr = NULL; char ngroup[STRBUF_SIZEOF(uid_t) + 1]; char nuser[STRBUF_SIZEOF(gid_t) + 1]; + u_long width[9]; + int i; needstats = f_inode || f_longform || f_size; flen = 0; btotal = 0; + +#define LS_COLWIDTHS_FIELDS 9 initmax = getenv("LS_COLWIDTHS"); - /* Fields match -lios order. New ones should be added at the end. */ - maxlabelstr = maxblock = maxlen = maxnlink = 0; - maxuser = maxgroup = maxflags = maxsize = 0; - maxinode = 0; - if (initmax != NULL && *initmax != '\0') { - char *initmax2, *jinitmax; - int ninitmax; - - /* Fill-in "::" as "0:0:0" for the sake of scanf. */ - jinitmax = malloc(strlen(initmax) * 2 + 2); - if (jinitmax == NULL) - err(1, "malloc"); - initmax2 = jinitmax; - if (*initmax == ':') - strcpy(initmax2, "0:"), initmax2 += 2; - else - *initmax2++ = *initmax, *initmax2 = '\0'; - for (initmax++; *initmax != '\0'; initmax++) { - if (initmax[-1] == ':' && initmax[0] == ':') { - *initmax2++ = '0'; - *initmax2++ = initmax[0]; - initmax2[1] = '\0'; + + for (i = 0 ; i < LS_COLWIDTHS_FIELDS; i++) + width[i] = 0; + + if (initmax != NULL) { + char *endp; + + for (i = 0; i < LS_COLWIDTHS_FIELDS && *initmax != '\0'; i++) { + if (*initmax == ':') { + width[i] = 0; } else { - *initmax2++ = initmax[0]; - initmax2[1] = '\0'; + width[i] = strtoul(initmax, &endp, 10); + initmax = endp; + while (isspace(*initmax)) + initmax++; + if (*initmax != ':') + break; + initmax++; } } - if (initmax2[-1] == ':') - strcpy(initmax2, "0"); - - ninitmax = sscanf(jinitmax, - " %ju : %ld : %lu : %u : %u : %i : %jd : %lu : %lu ", - &maxinode, &maxblock, &maxnlink, &maxuser, - &maxgroup, &maxflags, &maxsize, &maxlen, &maxlabelstr); - f_notabs = 1; - switch (ninitmax) { - case 0: - maxinode = 0; - /* FALLTHROUGH */ - case 1: - maxblock = 0; - /* FALLTHROUGH */ - case 2: - maxnlink = 0; - /* FALLTHROUGH */ - case 3: - maxuser = 0; - /* FALLTHROUGH */ - case 4: - maxgroup = 0; - /* FALLTHROUGH */ - case 5: - maxflags = 0; - /* FALLTHROUGH */ - case 6: - maxsize = 0; - /* FALLTHROUGH */ - case 7: - maxlen = 0; - /* FALLTHROUGH */ - case 8: - maxlabelstr = 0; - /* FALLTHROUGH */ + if (i < LS_COLWIDTHS_FIELDS) #ifdef COLORLS if (!f_color) #endif f_notabs = 0; - /* FALLTHROUGH */ - default: - break; - } - MAKENINES(maxinode); - MAKENINES(maxblock); - MAKENINES(maxnlink); - MAKENINES(maxsize); - free(jinitmax); } + + /* Fields match -lios order. New ones should be added at the end. */ + maxinode = width[0]; + maxblock = width[1]; + maxnlink = width[2]; + maxuser = width[3]; + maxgroup = width[4]; + maxflags = width[5]; + maxsize = width[6]; + maxlen = width[7]; + maxlabelstr = width[8]; + + MAKENINES(maxinode); + MAKENINES(maxblock); + MAKENINES(maxnlink); + MAKENINES(maxsize); + d.s_size = 0; sizelen = 0; flags = NULL; From owner-dev-commits-src-main@freebsd.org Sun Dec 27 21:32:36 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EA5854C797E; Sun, 27 Dec 2020 21:32:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D3v6D6H8Wz3hwV; Sun, 27 Dec 2020 21:32:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CA37F639A; Sun, 27 Dec 2020 21:32:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BRLWa4H010579; Sun, 27 Dec 2020 21:32:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BRLWaEK010578; Sun, 27 Dec 2020 21:32:36 GMT (envelope-from git) Date: Sun, 27 Dec 2020 21:32:36 GMT Message-Id: <202012272132.0BRLWaEK010578@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Stefan Eßer Subject: git: dbb25cbe55cf - main - Adjust to display more than 999 sleeping threads MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: se X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dbb25cbe55cf45e23b586a5574d45fb012b37dd9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Dec 2020 21:32:37 -0000 The branch main has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=dbb25cbe55cf45e23b586a5574d45fb012b37dd9 commit dbb25cbe55cf45e23b586a5574d45fb012b37dd9 Author: Stefan Eßer AuthorDate: 2020-12-25 11:38:53 +0000 Commit: Stefan Eßer CommitDate: 2020-12-27 21:32:22 +0000 Adjust to display more than 999 sleeping threads --- usr.bin/systat/vmstat.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/usr.bin/systat/vmstat.c b/usr.bin/systat/vmstat.c index 07bce60531ca..e84b79bdd184 100644 --- a/usr.bin/systat/vmstat.c +++ b/usr.bin/systat/vmstat.c @@ -176,10 +176,10 @@ closekre(WINDOW *w) #define PAGECOL 47 #define INTSROW 5 /* uses all rows to bottom and 16 cols */ #define INTSCOL 64 -#define PROCSROW 6 /* uses 3 rows and 19 cols */ +#define PROCSROW 6 /* uses 3 rows and 20 cols */ #define PROCSCOL 0 #define GENSTATROW 7 /* uses 2 rows and 29 cols */ -#define GENSTATCOL 21 +#define GENSTATCOL 22 #define VMSTATROW 5 /* uses 17 rows and 12-14 cols */ #define VMSTATCOL 49 /* actually 50-51 for some fields */ #define GRAPHROW 10 /* uses 3 rows and 49-51 cols */ @@ -343,7 +343,7 @@ labelkre(void) mvprintw(GRAPHROW, GRAPHCOL, " . %%Sys . %%Intr . %%User . %%Nice . %%Idle"); mvprintw(PROCSROW, PROCSCOL, "Proc:"); - mvprintw(PROCSROW + 1, PROCSCOL, " r p d s w"); + mvprintw(PROCSROW + 1, PROCSCOL, " r p d s w"); mvprintw(GRAPHROW + 1, GRAPHCOL, "| | | | | | | | | | |"); @@ -470,8 +470,8 @@ showkre(void) putint(total.t_rq - 1, PROCSROW + 2, PROCSCOL, 3); putint(total.t_pw, PROCSROW + 2, PROCSCOL + 4, 3); putint(total.t_dw, PROCSROW + 2, PROCSCOL + 8, 3); - putint(total.t_sl, PROCSROW + 2, PROCSCOL + 12, 3); - putint(total.t_sw, PROCSROW + 2, PROCSCOL + 16, 3); + putint(total.t_sl, PROCSROW + 2, PROCSCOL + 12, 4); + putint(total.t_sw, PROCSROW + 2, PROCSCOL + 17, 3); PUTRATE(v_io_faults, VMSTATROW, VMSTATCOL + 2, 8 - 2); PUTRATE(v_cow_faults, VMSTATROW + 1, VMSTATCOL + 2, 8 - 2); PUTRATE(v_zfod, VMSTATROW + 2, VMSTATCOL + 2, 8 - 2); From owner-dev-commits-src-main@freebsd.org Sun Dec 27 21:32:36 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BBFF44C7BCB; Sun, 27 Dec 2020 21:32:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D3v6D4khtz3j68; Sun, 27 Dec 2020 21:32:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9554261EC; Sun, 27 Dec 2020 21:32:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BRLWaEb010528; Sun, 27 Dec 2020 21:32:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BRLWap5010527; Sun, 27 Dec 2020 21:32:36 GMT (envelope-from git) Date: Sun, 27 Dec 2020 21:32:36 GMT Message-Id: <202012272132.0BRLWap5010527@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Stefan Eßer Subject: git: e458944cf9de - main - Import bc 3.2.4 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: se X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e458944cf9deec51d03ec751050a58ddf43e796f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Dec 2020 21:32:36 -0000 The branch main has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=e458944cf9deec51d03ec751050a58ddf43e796f commit e458944cf9deec51d03ec751050a58ddf43e796f Author: Stefan Eßer AuthorDate: 2020-12-27 20:53:09 +0000 Commit: Stefan Eßer CommitDate: 2020-12-27 21:32:22 +0000 Import bc 3.2.4 --- contrib/bc/.travis.yml | 42 ------------------------------------------ contrib/bc/Makefile.in | 2 +- contrib/bc/NEWS.md | 7 +++++++ contrib/bc/README.md | 8 -------- contrib/bc/codecov.yml | 3 --- contrib/bc/include/status.h | 4 ++++ contrib/bc/release.sh | 4 ++-- 7 files changed, 14 insertions(+), 56 deletions(-) diff --git a/contrib/bc/.travis.yml b/contrib/bc/.travis.yml deleted file mode 100644 index 91694a821284..000000000000 --- a/contrib/bc/.travis.yml +++ /dev/null @@ -1,42 +0,0 @@ -dist: bionic - -language: c - -arch: - - amd64 - - arm64 - - ppc64le - -compiler: - - gcc - -env: - global: - - CODECOV_TOKEN="040ce7eb-5bc7-4040-8324-364f3ef4baa3" - - CFLAGS="-coverage -DBC_RAND_BUILTIN=0" - matrix: - - CONFIGURE_ARGS=-fHNPOg GEN_HOST=1 LONG_BIT=64 - - CONFIGURE_ARGS=-bfHNPOg GEN_HOST=1 LONG_BIT=64 - - CONFIGURE_ARGS=-dfHNPOg GEN_HOST=1 LONG_BIT=64 - - CONFIGURE_ARGS=-fEHNPOg GEN_HOST=1 LONG_BIT=64 - - CONFIGURE_ARGS=-bfEHNPOg GEN_HOST=1 LONG_BIT=64 - - CONFIGURE_ARGS=-dfEHNPOg GEN_HOST=1 LONG_BIT=64 - - CONFIGURE_ARGS=-fHNPOg GEN_HOST=1 LONG_BIT=32 - - CONFIGURE_ARGS=-bfHNPOg GEN_HOST=1 LONG_BIT=32 - - CONFIGURE_ARGS=-dfHNPOg GEN_HOST=1 LONG_BIT=32 - - CONFIGURE_ARGS=-fEHNPOg GEN_HOST=1 LONG_BIT=32 - - CONFIGURE_ARGS=-bfEHNPOg GEN_HOST=1 LONG_BIT=32 - - CONFIGURE_ARGS=-dfEHNPOg GEN_HOST=1 LONG_BIT=32 - -before_install: - - sudo apt-get install -y dc - - pip install --user codecov - -before_script: - - curl -o tests/bc/scripts/timeconst.bc https://raw.githubusercontent.com/torvalds/linux/master/kernel/time/timeconst.bc - -after_success: - - bash <(curl -s https://codecov.io/bash) - -script: - - if [ "${COVERITY_SCAN_BRANCH}" != 1 ]; then ./configure.sh "$CONFIGURE_ARGS" && make -j4 && make -j4 test ; fi diff --git a/contrib/bc/Makefile.in b/contrib/bc/Makefile.in index 968494e4a8a0..d17e74163397 100644 --- a/contrib/bc/Makefile.in +++ b/contrib/bc/Makefile.in @@ -29,7 +29,7 @@ # .POSIX: -VERSION = 3.2.3 +VERSION = 3.2.4 SRC = %%SRC%% OBJ = %%OBJ%% diff --git a/contrib/bc/NEWS.md b/contrib/bc/NEWS.md index db8448d48a86..f4fc2f5779ce 100644 --- a/contrib/bc/NEWS.md +++ b/contrib/bc/NEWS.md @@ -1,5 +1,12 @@ # News +## 3.2.4 + +This is a production release that fixes a warning on `gcc` 6 or older, which +does not have an attribute that is used. + +Users do ***NOT*** need to upgrade if they don't use `gcc` 6 or older. + ## 3.2.3 This is a production release that fixes a bug in `gen/strgen.sh`. I recently diff --git a/contrib/bc/README.md b/contrib/bc/README.md index cea5d877b95c..6f3c3f252cbc 100644 --- a/contrib/bc/README.md +++ b/contrib/bc/README.md @@ -1,7 +1,5 @@ # `bc` -[![Build Status][13]][14] -[![codecov][15]][16] [![Coverity Scan Build Status][17]][18] ***WARNING: This project has moved to [https://git.yzena.com/][20] for [these @@ -302,8 +300,6 @@ tarballs. Files: .gitignore The git ignore file (maintainer use only). - .travis.yml The Travis CI file (maintainer use only). - codecov.yml The Codecov file (maintainer use only). configure A symlink to configure.sh to make packaging easier. configure.sh The configure script. functions.sh A script with functions used by other scripts. @@ -339,10 +335,6 @@ Folders: [10]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html [11]: http://semver.org/ [12]: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html -[13]: https://travis-ci.com/gavinhoward/bc.svg?branch=master -[14]: https://travis-ci.com/gavinhoward/bc -[15]: https://codecov.io/gh/gavinhoward/bc/branch/master/graph/badge.svg -[16]: https://codecov.io/gh/gavinhoward/bc [17]: https://img.shields.io/coverity/scan/16609.svg [18]: https://scan.coverity.com/projects/gavinhoward-bc [19]: ./manuals/benchmarks.md diff --git a/contrib/bc/codecov.yml b/contrib/bc/codecov.yml deleted file mode 100644 index 396c77d9c20a..000000000000 --- a/contrib/bc/codecov.yml +++ /dev/null @@ -1,3 +0,0 @@ -ignore: - - "src/history/history.c" - - "gen/strgen.c" diff --git a/contrib/bc/include/status.h b/contrib/bc/include/status.h index 762ff3e25c36..2807a28af4ef 100644 --- a/contrib/bc/include/status.h +++ b/contrib/bc/include/status.h @@ -166,7 +166,11 @@ typedef enum BcErr { #endif // __STDC_VERSION__ #if defined(__clang__) || defined(__GNUC__) +#if defined(__has_attribute) && __has_attribute(fallthrough) #define BC_FALLTHROUGH __attribute__((fallthrough)); +#else // defined(__has_attribute) && __has_attribute(fallthrough) +#define BC_FALLTHROUGH +#endif // defined(__has_attribute) && __has_attribute(fallthrough) #else // defined(__clang__) || defined(__GNUC__) #define BC_FALLTHROUGH #endif //defined(__clang__) || defined(__GNUC__) diff --git a/contrib/bc/release.sh b/contrib/bc/release.sh index bd9c33e55da6..2cb39f6b38c5 100755 --- a/contrib/bc/release.sh +++ b/contrib/bc/release.sh @@ -573,8 +573,8 @@ if [ "$run_tests" -ne 0 ]; then printf '\n' printf 'Then run the GitHub release script as follows:\n' printf '\n' - printf ' %s .travis.yml codecov.yml release.sh \\\n' "$version" - printf ' RELEASE.md tests/afl.py tests/radamsa.sh tests/radamsa.txt tests/randmath.py \\\n' + printf ' %s release.sh RELEASE.md\\\n' "$version" + printf ' tests/afl.py tests/radamsa.sh tests/radamsa.txt tests/randmath.py \\\n' printf ' tests/bc/scripts/timeconst.bc\n' fi From owner-dev-commits-src-main@freebsd.org Sun Dec 27 21:33:27 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 40DF34C7D47 for ; Sun, 27 Dec 2020 21:33:27 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic313-20.consmr.mail.gq1.yahoo.com (sonic313-20.consmr.mail.gq1.yahoo.com [98.137.65.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4D3v753FGPz3k9K for ; Sun, 27 Dec 2020 21:33:20 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1609104795; bh=/K/+LpPhY0a28ohpZ56DsBvoLBPVwKnPBKuc4Y/UQQY=; h=From:Subject:Date:To:From:Subject; b=T41jGVQ1pmR2rQ28KVBNRmhSk0Thy8FzUN2JFZUbYxn01OfLOv1JCJPTINKWuoABLSYecFMN4qFMRV6VONkwybenGNRg94+a91ixQG1yEKMAawyJkG9kLHBzfiZD0rQfDXdeY7gk6gDspcTgqtpLgxqliHzmx1279UCIydp9iIrigzBY7zlpWCpJoTKQh0q3aUX4EiGKBf35tHRkWXWOjnJ3AdWY8W/vePkPdR6MS2A4HUu4pAA8WFpT6X8N/psa2mzpqO7Hg3NmlPFjRxIToHujqR+a8BvssP6YCQaAYac14MdKwCIECgc3J9gPOrN3BlrgELl4WNQhH0k8179Zww== X-YMail-OSG: 7Y.65NUVM1nyLlZ3pf3fKZTqgqBhH.lVu6_qkMqERZKQgsGONNmqtGfze4od6QF G4LrTtT4QsuIXEb3lHy_WCCb2MLTnusb5zWCkQNlI.23ZBEHbf0GGQ_xS4TPqVSFne0Ntkoscs.l jllAahUl0QHoxeMcJFFJVsiWN7JLmv_113d54p3ff0Yfhg7zDCLtSIRGKBrujU0fWwWJZmnSmdfn TU3uJYFCesGHiZasLJTN.0a8f8zwkQu5NguijUi6_x9CJAZsFusgB7QteZcoEv_a3PL577u8P1Zs DrwQ_RAIMP2dIGrBil3rqsXWNU.P1r.B3G.5CUTu7A9Isv7E.RX3DtxgFcYadOG6heDmgvWSy_hy 2O_FH63cHUePzYpFip1y2U..OGur8ZyllijlY3rK0Vf2d7Yxo4f8yr3YHCsXEwaSjTedWL0TY3LX 1468StC8ZA6e4_8XH_mmn6sDNL3bX2gLvxfkNBTAHYySNtuyAQbaJpyp6rdOm9yb_8Ezt1PYFSbt HJt7B.8LHBjE3KarT4N3gjqIvB2x9t7Ngrz0Mee4aPOHyB5l4awBr2sY7z56rNfV9Z7_eqdSDAoQ .pMMUNxAFR9Fm0tUpqhBbAAWQ.HOJ5BlEaPUok9kAkzcNYDujuEo2iXSCKRaEzKaxpLYpQeCoscB w_0nTxOUjviIxu6pC5QOUaU.SZiwo.2KQN8JmVVZOCR_hh2iR7mqaMfSm39H.XIxKD1VfbZN4e0G E5_PquPWbwhIwPMMlbIGzTiFmf6QBuaiqs21rbs1rFXPC2f_66NHFi5Wyo.FXmJpvrEP5qrGMij1 B87d2G7AQDhB5cLHB97SHvF.WvnNodvC1Yvag6WRAgbZRUlemu1wQdhFmDen.YaJFWNQyn3zz_4w b47Y9LC336BcYyzYYFQ65EErrPVKkiIZegsCa55edSarGwxox72barkVOWsTevJxV6sXpLeo59H7 dQn1BvOUKY1N63J4tVPjcHFqoDEa.LHsAIX1LFi4SYjgXaoDY2qBD1W1kkhHrOPRPaD.dGr1Uu0W _ycLeHGTIrmh4DVWyB5AGN9WMPYG1eim9eC6lVPFQxB8YeWv.pE8jkCOO._e6mDHS0mxYc2IDL4f Q05gjUDqJ9ZMXDvZT8ZibO8iYOWKgfwGJJ9ggMxN8JfvkeU6X7xbX246ucKzSRu1bwNH.PwdTXgW 125BT7fNChN23U9KM4m5FEMZv33V_oqjrG7.GqkeU8ZzuAE8OQFPxWxdgUlR76eSgX8K_pzdp3cY v4c6ykIyG7bVCytFrsmyAuOroo3yM8SNTba34fAz.dAxxOep3ynOzz6d0NyBAnYU9S4eZQoBBQZD QTo3g9wDR0zi4Xdz7dbuGo3od4GE8Hc2Fvz537xekkRnOkBhWHmlVhOxBAyMFzt1ZOqeCxQPlyn3 VBqypFdkA9vLtsZ1Ax12daIICRNU8itjnit5Qgr74EIsphsOJzMNcC41zM5fYwbRQp1kuVjzT0IC AsV2ibOYUHZ2J.0r9GR.UiIEQOi6jFbqEaIOsGJR_xJS8t7TpGumRHcyNFXCh4YcqecRbJcwIK04 .E3oP2Sz5VumS_VuFRJRLvLdghmP9SYuByRx7ujWHY8B_cSrGUDGk9VGT3mK0rnyBTqxAYNABE7D IVGc44vttEFg_3Qca5gtAaksg1b_mTCuQMyFtikYwATgBKhFIth44Vemvr69kV_G1ldQonOlmxeO J.GtbeShMahrUUE5rY3fQxb_uK3RBpXsdWrODePAhDkoD0uwXObRg6r5RW8EXv6nJ0sV51OByw24 2t2cQ17i8VcVqpw.BD7lo0oIgksM7nJkWoL9n0satLyxnLwHqVH1RyRz6RS3r9ZDKKdbO3bPKx9d On0btEFvqt.JjeHjh1xGXo9kRLHiyYV0vlOLwWQgFYdBVn.wi6rkWu.lOzXXnCgUr15Dp7pcF6Zx gKpiod.Wi1JxsR37K.fw3ghEyD9usHXpmjLPLCqhDDnrLLlv4GQ6QK7FNSfZMC.K9EByrhC1R5Oh xoqHfyxfNvtzwVrDnXTmnObj2izavrU1cUkF._nkIka9IbMTMX64_vh_fVvB9nU2dgRBryEJg7qo V3e2l8Ke53K.FTCViyZAd6h5hcKxjMWFwW_Yf_flS9ek5L1hLUr_JVtr3Bzq2oSs7RAIVy_zC5qk CQUUnbdVMcQJQLZ9bFK0S20qRG9oy39bd_F_CR8_F_KGseCoquo7AuKrqN7L4TKHqFJ.YS_6EtDz 01AC_.h8Wmpvki8SavQ_bONOSwN7nyE1nbVbFyuF5iUvyoBC0VC9sb3V_CD9B1U0aGXPdVxovugO XuPUviHxSxIrkRdbNkXXy11On.B98kuZjdna75PEskNNlDUxN3wO6hngGnfQ.LSsOr_m_5lxk1BA jeGtj8vkeNCTcZkykwCPs1x6z7EKVKCkWCnYn_HpweLaTxlTdbVKG2ZUt8lM8rj6QKg_2AIVczFK LApnNF2aX8iJb0l8Kzdb3ZvC8bwSY8iuHyksdoUA2p1weEytyYdq.PSRJLjGe5NrvTvg- Received: from sonic.gate.mail.ne1.yahoo.com by sonic313.consmr.mail.gq1.yahoo.com with HTTP; Sun, 27 Dec 2020 21:33:15 +0000 Received: by smtp415.mail.bf1.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 6240c9329422ae374e88aa4909677fcc; Sun, 27 Dec 2020 21:33:14 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.20.0.2.21\)) Subject: Re: git: abd7ded451c0 - main - cache: modification and last entry filling support in lockless lookup v2 Message-Id: Date: Sun, 27 Dec 2020 13:33:10 -0800 To: "mjg@freebsd.org " , dev-commits-src-main@freebsd.org X-Mailer: Apple Mail (2.3654.20.0.2.21) References: X-Rspamd-Queue-Id: 4D3v753FGPz3k9K X-Spamd-Bar: - X-Spamd-Result: default: False [-1.54 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; FREEMAIL_FROM(0.00)[yahoo.com]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; DKIM_TRACE(0.00)[yahoo.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[98.137.65.83:from]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/20, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[yahoo.com:dkim]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_HAS_DN(0.00)[]; NEURAL_SPAM_SHORT(0.96)[0.956]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; SPAMHAUS_ZRD(0.00)[98.137.65.83:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[98.137.65.83:from]; RWL_MAILSPIKE_POSSIBLE(0.00)[98.137.65.83:from]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[dev-commits-src-main] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Dec 2020 21:33:27 -0000 Mateusz Guzik mjg at FreeBSD.org wrote on Sun Dec 27 21:05:01 UTC 2020 : > The branch main has been updated by mjg: >=20 > URL:=20 > = https://cgit.FreeBSD.org/src/commit/?id=3Dabd7ded451c0ddda2188b31826dc911c= d22da9db >=20 >=20 > commit abd7ded451c0ddda2188b31826dc911cd22da9db > Author: Mateusz Guzik < > mjg at FreeBSD.org > > > AuthorDate: 2020-12-27 19:19:43 +0000 > Commit: Mateusz Guzik < > mjg at FreeBSD.org > > > CommitDate: 2020-12-27 21:03:18 +0000 >=20 > cache: modification and last entry filling support in lockless = lookup v2 >=20 > . . . I probably would have an easier time interpreting the following adjusted text ("vfs_" added) on https://cgit.freebsd.org/src/ : Branch Commit message Author Age main vfs_cache: modification and last entry filling support in = lockless lookup v2 Mateusz Guzik 9 min. instead of what actually displays: Branch Commit message Author Age main cache: modification and last entry filling support in lockless = lookup v2 Mateusz Guzik 9 min. All the following are not automatically very specific when I read such, = even in combination: cache modification last entry fulling support lockless lookup so the "vfs" would have helped me. Unfortunately, it just looks difficult to consistently have one line = summaries that well narrow down things. It is too easy to presume context not = shared with those that are just reading the text or having to make character-count = tradeoffs. If I were a committer I'd have the exact same difficulty. =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar) From owner-dev-commits-src-main@freebsd.org Sun Dec 27 22:01:55 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A10044C88FC; Sun, 27 Dec 2020 22:01:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D3vm342cpz3mpC; Sun, 27 Dec 2020 22:01:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 73FDA65CA; Sun, 27 Dec 2020 22:01:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BRM1tO5043361; Sun, 27 Dec 2020 22:01:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BRM1tqm043360; Sun, 27 Dec 2020 22:01:55 GMT (envelope-from git) Date: Sun, 27 Dec 2020 22:01:55 GMT Message-Id: <202012272201.0BRM1tqm043360@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 81846def3495 - main - vm: Fix some bugs in the page busying code MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 81846def349538d6dcd8d5efcc1c8d67ff0b4b41 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Dec 2020 22:01:55 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=81846def349538d6dcd8d5efcc1c8d67ff0b4b41 commit 81846def349538d6dcd8d5efcc1c8d67ff0b4b41 Author: Mark Johnston AuthorDate: 2020-12-27 21:50:54 +0000 Commit: Mark Johnston CommitDate: 2020-12-27 22:01:44 +0000 vm: Fix some bugs in the page busying code In vm_page_busy_acquire(), load the object pointer using atomic_load_ptr() as we do elsewhere. Per the comment, the object identity must be consistent across sleeps. In vm_page_grab_sleep(), pass the correct pindex to _vm_page_busy_sleep(). The pindex is used to re-check the page's identity before going to sleep. In particular, vm_page_grab_sleep() is used in unlocked grab, so the object lock is not necessarily held when verifying the page's identity, and the pindex may change if the page is moved, or freed and re-allocated. I believe this can result in spurious VM_PAGER_FAILs from vm_page_grab_valid_unlocked() or early termination of vm_page_grab_pages_unlocked(). In vm_page_grab_pages(), pass the correct pindex to vm_page_grab_sleep(). Otherwise I believe vm_page_grab_pages() will effectively spin when attempting to busy a busy page after the first index in the range. Reviewed by: alc, kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D27607 --- sys/vm/vm_page.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index cb5b5091ebb1..e668bbdc6178 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -882,7 +882,7 @@ vm_page_busy_acquire(vm_page_t m, int allocflags) * It is assumed that a reference to the object is already * held by the callers. */ - obj = m->object; + obj = atomic_load_ptr(&m->object); for (;;) { if (vm_page_tryacquire(m, allocflags)) return (true); @@ -4386,8 +4386,8 @@ vm_page_grab_sleep(vm_object_t object, vm_page_t m, vm_pindex_t pindex, if (locked && (allocflags & VM_ALLOC_NOCREAT) == 0) vm_page_reference(m); - if (_vm_page_busy_sleep(object, m, m->pindex, wmesg, allocflags, - locked) && locked) + if (_vm_page_busy_sleep(object, m, pindex, wmesg, allocflags, locked) && + locked) VM_OBJECT_WLOCK(object); if ((allocflags & VM_ALLOC_WAITFAIL) != 0) return (false); @@ -4780,7 +4780,7 @@ retrylookup: for (; i < count; i++) { if (m != NULL) { if (!vm_page_tryacquire(m, allocflags)) { - if (vm_page_grab_sleep(object, m, pindex, + if (vm_page_grab_sleep(object, m, pindex + i, "grbmaw", allocflags, true)) goto retrylookup; break; From owner-dev-commits-src-main@freebsd.org Sun Dec 27 22:01:55 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7BBA84C88FA; Sun, 27 Dec 2020 22:01:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D3vm32xl6z3mmH; Sun, 27 Dec 2020 22:01:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5856666D3; Sun, 27 Dec 2020 22:01:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BRM1tek043344; Sun, 27 Dec 2020 22:01:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BRM1t8U043343; Sun, 27 Dec 2020 22:01:55 GMT (envelope-from git) Date: Sun, 27 Dec 2020 22:01:55 GMT Message-Id: <202012272201.0BRM1t8U043343@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 599f90446376 - main - msdosfs: Fix a leak of dirent padding bytes MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 599f90446376370eb365a0fde857ea2b5766873a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Dec 2020 22:01:55 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=599f90446376370eb365a0fde857ea2b5766873a commit 599f90446376370eb365a0fde857ea2b5766873a Author: Mark Johnston AuthorDate: 2020-12-27 21:52:30 +0000 Commit: Mark Johnston CommitDate: 2020-12-27 22:01:44 +0000 msdosfs: Fix a leak of dirent padding bytes This was missed in r340856 / commit 6d2e2df764199f0a15fd743e79599391959cc17d. Three bytes from the kernel stack may be leaked when reading directory entries. Reported by: Syed Faraz Abrar MFC after: 3 days Sponsored by: The FreeBSD Foundation --- sys/fs/msdosfs/msdosfs_vnops.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/fs/msdosfs/msdosfs_vnops.c b/sys/fs/msdosfs/msdosfs_vnops.c index 857eefb384d9..b940633e0cfd 100644 --- a/sys/fs/msdosfs/msdosfs_vnops.c +++ b/sys/fs/msdosfs/msdosfs_vnops.c @@ -1684,6 +1684,7 @@ msdosfs_readdir(struct vop_readdir_args *ap) dirbuf.d_reclen = GENERIC_DIRSIZ(&dirbuf); /* NOTE: d_off is the offset of the *next* entry. */ dirbuf.d_off = offset + sizeof(struct direntry); + dirent_terminate(&dirbuf); if (uio->uio_resid < dirbuf.d_reclen) { brelse(bp); goto out; From owner-dev-commits-src-main@freebsd.org Sun Dec 27 22:01:55 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AAE144C8B51; Sun, 27 Dec 2020 22:01:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D3vm34VQDz3mmK; Sun, 27 Dec 2020 22:01:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8DD0666D4; Sun, 27 Dec 2020 22:01:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BRM1t8q043395; Sun, 27 Dec 2020 22:01:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BRM1tSH043394; Sun, 27 Dec 2020 22:01:55 GMT (envelope-from git) Date: Sun, 27 Dec 2020 22:01:55 GMT Message-Id: <202012272201.0BRM1tSH043394@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 795a009b325c - main - md: Set bio_completed properly in the face of errors MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 795a009b325c93a0f48a83a68b5278160ac6d38e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Dec 2020 22:01:55 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=795a009b325c93a0f48a83a68b5278160ac6d38e commit 795a009b325c93a0f48a83a68b5278160ac6d38e Author: Mark Johnston AuthorDate: 2020-12-27 21:49:35 +0000 Commit: Mark Johnston CommitDate: 2020-12-27 21:49:35 +0000 md: Set bio_completed properly in the face of errors Account for any residual bytes. This is only relevant for vnode-backed md(4) devices. Reviewed by: kib MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D27738 --- sys/dev/md/md.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/md/md.c b/sys/dev/md/md.c index 1778eda48f35..1b4b583b3c09 100644 --- a/sys/dev/md/md.c +++ b/sys/dev/md/md.c @@ -1244,7 +1244,7 @@ md_kthread(void *arg) bp->bio_bcount = bp->bio_length; devstat_end_transaction_bio(sc->devstat, bp); } - bp->bio_completed = bp->bio_length; + bp->bio_completed = bp->bio_length - bp->bio_resid; g_io_deliver(bp, error); } } From owner-dev-commits-src-main@freebsd.org Sun Dec 27 22:01:55 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A998A4C8BE3; Sun, 27 Dec 2020 22:01:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D3vm33zjTz3mmJ; Sun, 27 Dec 2020 22:01:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7BAB36A92; Sun, 27 Dec 2020 22:01:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BRM1tTN043378; Sun, 27 Dec 2020 22:01:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BRM1tTK043377; Sun, 27 Dec 2020 22:01:55 GMT (envelope-from git) Date: Sun, 27 Dec 2020 22:01:55 GMT Message-Id: <202012272201.0BRM1tTK043377@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: d2f1c44bc9f9 - main - uma: Remove the MINBUCKET flag from the flag name list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d2f1c44bc9f9798090d5ae91a4ab2b89c819ca4b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Dec 2020 22:01:55 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=d2f1c44bc9f9798090d5ae91a4ab2b89c819ca4b commit d2f1c44bc9f9798090d5ae91a4ab2b89c819ca4b Author: Mark Johnston AuthorDate: 2020-12-27 21:50:24 +0000 Commit: Mark Johnston CommitDate: 2020-12-27 22:01:33 +0000 uma: Remove the MINBUCKET flag from the flag name list This should have been done in r368399 / commit f8b6c51538fab88a7a62a399fb0948806b06133c. Reported by: rlibby Sponsored by: The FreeBSD Foundation --- sys/vm/uma_int.h | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/vm/uma_int.h b/sys/vm/uma_int.h index 20d4ebcdce91..9965e486ca53 100644 --- a/sys/vm/uma_int.h +++ b/sys/vm/uma_int.h @@ -188,7 +188,6 @@ "\20PCPU" \ "\17NODUMP" \ "\16CACHESPREAD" \ - "\15MINBUCKET" \ "\14MAXBUCKET" \ "\13NOBUCKET" \ "\12SECONDARY" \ From owner-dev-commits-src-main@freebsd.org Sun Dec 27 22:45:15 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3C4A64C9EF4; Sun, 27 Dec 2020 22:45:15 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4D3wk23sDSz3qtB; Sun, 27 Dec 2020 22:45:14 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.16.1/8.16.1) with ESMTPS id 0BRMj2Br047557 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 28 Dec 2020 00:45:05 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 0BRMj2Br047557 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 0BRMj2fn047554; Mon, 28 Dec 2020 00:45:02 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 28 Dec 2020 00:45:02 +0200 From: Konstantin Belousov To: Andrew Gallatin Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: d39f7430a6e1 - main - amd64: preserve %cr2 in NMI/MCE/DBG handlers. Message-ID: References: <202012271114.0BRBEwOO035891@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on tom.home X-Rspamd-Queue-Id: 4D3wk23sDSz3qtB X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Dec 2020 22:45:15 -0000 On Sun, Dec 27, 2020 at 03:13:09PM -0500, Andrew Gallatin wrote: > On 12/27/20 6:14 AM, Konstantin Belousov wrote: > > The branch main has been updated by kib: > > > > URL: https://urldefense.com/v3/__https://cgit.FreeBSD.org/src/commit/?id=d39f7430a6e1da419d6e4fb871bca5ba7863f738__;!!OToaGQ!7EPo6uRRpq8kWDLzM05a4h158xFeRyJ9PhhE1j04Y5uZaHKskCoGhso0T717aEhpYQ$ > > > > commit d39f7430a6e1da419d6e4fb871bca5ba7863f738 > > Author: Konstantin Belousov > > AuthorDate: 2020-12-25 21:58:43 +0000 > > Commit: Konstantin Belousov > > CommitDate: 2020-12-27 10:59:33 +0000 > > > > amd64: preserve %cr2 in NMI/MCE/DBG handlers. > > These handlers could interrupt code which has interrupts disabled, > > and if a spurious page fault occurs during exception handler run, > > we get clobbered %cr2 in higher level stack. > > This is mostly a speculation, but it is based on hints from good sources. > > I assume this is based around the mystery panic I was talking about on irc > last week. Yes, but it is not supposed to fix it, the hope is that it might reduce amount of the smoke around it. > > Can you please explain what a spurious page fault is? A fault where > there is a valid mapping, but we somehow take a fault for no reason? > How often does this happen? Hopefully spurious faults occur rarely, they happens due to the bugs in CPUs. It was relatively common for older models of Intel' CPUs some time ago so that amd64 trap.c has special handling for page faults that should not occur according to the kernel bookkeeping. Look for TDP_RESETSPUR flag and its use in trap_pfault() if interested. In short, we retry the faulted instruction and fall to normal fault handling if it faulted again on retry. In fact I do not think that this code can trigger during NMI. The patch intent was to cover a case that was immediately asked about when I described the paradoxical %cr2 != %rip fault to some people. If the panic can be repeated, at least we will know for sure that it is not NMI handler corrupting %cr2 and can show evidence to relevant channel. From owner-dev-commits-src-main@freebsd.org Sun Dec 27 23:03:40 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 60A814CA9A1; Sun, 27 Dec 2020 23:03:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D3x7J2F5jz3ryn; Sun, 27 Dec 2020 23:03:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3E1CC6FD6; Sun, 27 Dec 2020 23:03:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BRN3eKu008664; Sun, 27 Dec 2020 23:03:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BRN3e5A008663; Sun, 27 Dec 2020 23:03:40 GMT (envelope-from git) Date: Sun, 27 Dec 2020 23:03:40 GMT Message-Id: <202012272303.0BRN3e5A008663@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ryan Libby Subject: git: 48184e76619d - main - Merge commit c7500ded3 from openzfs git (by Ryan Libby): MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rlibby X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 48184e76619d4ac16300d45cfd9407e4aa388a58 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Dec 2020 23:03:40 -0000 The branch main has been updated by rlibby: URL: https://cgit.FreeBSD.org/src/commit/?id=48184e76619d4ac16300d45cfd9407e4aa388a58 commit 48184e76619d4ac16300d45cfd9407e4aa388a58 Author: Ryan Libby AuthorDate: 2020-12-27 22:33:13 +0000 Commit: Ryan Libby CommitDate: 2020-12-27 22:33:13 +0000 Merge commit c7500ded3 from openzfs git (by Ryan Libby): FreeBSD libzfs: gcc requires __thread after static Building libzfs with gcc on FreeBSD failed because gcc is picky about the order of keywords in declarations with __thread, whereas clang is more relaxed. https://gcc.gnu.org/onlinedocs/gcc/Thread-Local.html Reviewed-by: Brian Behlendorf Reviewed-by: Ryan Moeller Signed-off-by: Ryan Libby Closes #11331 --- sys/contrib/openzfs/lib/libzfs/os/freebsd/libzfs_compat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/contrib/openzfs/lib/libzfs/os/freebsd/libzfs_compat.c b/sys/contrib/openzfs/lib/libzfs/os/freebsd/libzfs_compat.c index 2de90c7ceea5..0e8a3b12176b 100644 --- a/sys/contrib/openzfs/lib/libzfs/os/freebsd/libzfs_compat.c +++ b/sys/contrib/openzfs/lib/libzfs/os/freebsd/libzfs_compat.c @@ -178,7 +178,7 @@ execvpe(const char *name, char * const argv[], char * const envp[]) #define ERRBUFLEN 256 -__thread static char errbuf[ERRBUFLEN]; +static __thread char errbuf[ERRBUFLEN]; const char * libzfs_error_init(int error) From owner-dev-commits-src-main@freebsd.org Sun Dec 27 23:03:40 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 825BF4CA8AB; Sun, 27 Dec 2020 23:03:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D3x7J3Bc5z3s6x; Sun, 27 Dec 2020 23:03:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 596077560; Sun, 27 Dec 2020 23:03:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BRN3eIY008698; Sun, 27 Dec 2020 23:03:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BRN3efZ008697; Sun, 27 Dec 2020 23:03:40 GMT (envelope-from git) Date: Sun, 27 Dec 2020 23:03:40 GMT Message-Id: <202012272303.0BRN3efZ008697@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ryan Libby Subject: git: 913f2d2e0cd3 - main - Merge commit 79a357c2a from openzfs git (by Adrian Chadd): MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rlibby X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 913f2d2e0cd37b491deb691a84ad5c4e95ef0a24 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Dec 2020 23:03:40 -0000 The branch main has been updated by rlibby: URL: https://cgit.FreeBSD.org/src/commit/?id=913f2d2e0cd37b491deb691a84ad5c4e95ef0a24 commit 913f2d2e0cd37b491deb691a84ad5c4e95ef0a24 Author: Ryan Libby AuthorDate: 2020-12-27 22:33:13 +0000 Commit: Ryan Libby CommitDate: 2020-12-27 22:33:13 +0000 Merge commit 79a357c2a from openzfs git (by Adrian Chadd): Fix pointer-is-uint64_t-sized assumption in the ioctl path This shows up when compiling freebsd-head on amd64 using gcc-6.4. The lib32 compat build ends up tripping over this assumption. Reviewed-by: Brian Behlendorf Reviewed-by: Ryan Moeller Signed-off-by: adrian chadd Closes #11068 Closes #11069 --- sys/contrib/openzfs/lib/libzutil/os/freebsd/zutil_compat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/contrib/openzfs/lib/libzutil/os/freebsd/zutil_compat.c b/sys/contrib/openzfs/lib/libzutil/os/freebsd/zutil_compat.c index 3e70fef1ec3d..baaf4b598ab1 100644 --- a/sys/contrib/openzfs/lib/libzutil/os/freebsd/zutil_compat.c +++ b/sys/contrib/openzfs/lib/libzutil/os/freebsd/zutil_compat.c @@ -55,7 +55,7 @@ zcmd_ioctl_compat(int fd, int request, zfs_cmd_t *zc, const int cflag) switch (cflag) { case ZFS_CMD_COMPAT_NONE: ncmd = _IOWR('Z', request, zfs_iocparm_t); - zp.zfs_cmd = (uint64_t)zc; + zp.zfs_cmd = (uint64_t)(uintptr_t)zc; zp.zfs_cmd_size = sizeof (zfs_cmd_t); zp.zfs_ioctl_version = ZFS_IOCVER_OZFS; break; @@ -64,7 +64,7 @@ zcmd_ioctl_compat(int fd, int request, zfs_cmd_t *zc, const int cflag) ncmd = _IOWR('Z', newrequest, zfs_iocparm_t); zc_c = malloc(sizeof (zfs_cmd_legacy_t)); zfs_cmd_ozfs_to_legacy(zc, zc_c); - zp.zfs_cmd = (uint64_t)zc_c; + zp.zfs_cmd = (uint64_t)(uintptr_t)zc_c; zp.zfs_cmd_size = sizeof (zfs_cmd_legacy_t); zp.zfs_ioctl_version = ZFS_IOCVER_LEGACY; break; From owner-dev-commits-src-main@freebsd.org Sun Dec 27 23:03:40 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 425904CA7F2; Sun, 27 Dec 2020 23:03:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D3x7J19VLz3s3K; Sun, 27 Dec 2020 23:03:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 104427433; Sun, 27 Dec 2020 23:03:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BRN3evf008630; Sun, 27 Dec 2020 23:03:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BRN3dR7008629; Sun, 27 Dec 2020 23:03:39 GMT (envelope-from git) Date: Sun, 27 Dec 2020 23:03:39 GMT Message-Id: <202012272303.0BRN3dR7008629@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ryan Libby Subject: git: f2d48b5e2c3b - main - Merge commit d8a09b3a0 from openzfs git (by Ryan Libby): MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rlibby X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f2d48b5e2c3b45850585e4d7aee324fe148afbf2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Dec 2020 23:03:40 -0000 The branch main has been updated by rlibby: URL: https://cgit.FreeBSD.org/src/commit/?id=f2d48b5e2c3b45850585e4d7aee324fe148afbf2 commit f2d48b5e2c3b45850585e4d7aee324fe148afbf2 Author: Ryan Libby AuthorDate: 2020-12-27 22:33:13 +0000 Commit: Ryan Libby CommitDate: 2020-12-27 22:33:13 +0000 Merge commit d8a09b3a0 from openzfs git (by Ryan Libby): lua: avoid gcc -Wreturn-local-addr bug Avoid a bug with gcc's -Wreturn-local-addr warning with some obfuscation. In buggy versions of gcc, if a return value is an expression that involves the address of a local variable, and even if that address is legally converted to a non-pointer type, a warning may be emitted and the value of the address may be replaced with zero. Howerver, buggy versions don't emit the warning or replace the value when simply returning a local variable of non-pointer type. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90737 Reviewed-by: Brian Behlendorf Signed-off-by: Ryan Libby Closes #11337 --- sys/contrib/openzfs/module/lua/ldo.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sys/contrib/openzfs/module/lua/ldo.c b/sys/contrib/openzfs/module/lua/ldo.c index 0344a29fd8e8..474fe659bcef 100644 --- a/sys/contrib/openzfs/module/lua/ldo.c +++ b/sys/contrib/openzfs/module/lua/ldo.c @@ -33,14 +33,16 @@ #if defined (_KERNEL) && defined(__linux__) #include static intptr_t stack_remaining(void) { - char local; - return (intptr_t)(&local - (char *)current->stack); + intptr_t local; + local = (intptr_t)&local - (intptr_t)current->stack; + return local; } #elif defined (_KERNEL) && defined(__FreeBSD__) #include static intptr_t stack_remaining(void) { - char local; - return (intptr_t)(&local - (char *)curthread->td_kstack); + intptr_t local; + local = (intptr_t)&local - (intptr_t)curthread->td_kstack; + return local; } #else static intptr_t stack_remaining(void) { From owner-dev-commits-src-main@freebsd.org Sun Dec 27 23:03:40 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6CF8E4CA5E6; Sun, 27 Dec 2020 23:03:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D3x7J2jrvz3rtN; Sun, 27 Dec 2020 23:03:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 503137270; Sun, 27 Dec 2020 23:03:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BRN3erX008681; Sun, 27 Dec 2020 23:03:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BRN3ekD008680; Sun, 27 Dec 2020 23:03:40 GMT (envelope-from git) Date: Sun, 27 Dec 2020 23:03:40 GMT Message-Id: <202012272303.0BRN3ekD008680@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ryan Libby Subject: git: e67d933d9c06 - main - Merge commit 3fcd73747 from openzfs git (by Adrian Chadd): MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rlibby X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e67d933d9c068328781cce46df400fc8782e6365 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Dec 2020 23:03:40 -0000 The branch main has been updated by rlibby: URL: https://cgit.FreeBSD.org/src/commit/?id=e67d933d9c068328781cce46df400fc8782e6365 commit e67d933d9c068328781cce46df400fc8782e6365 Author: Ryan Libby AuthorDate: 2020-12-27 22:33:13 +0000 Commit: Ryan Libby CommitDate: 2020-12-27 22:33:13 +0000 Merge commit 3fcd73747 from openzfs git (by Adrian Chadd): Fix compiling on FreeBSD + gcc - don't assume illmnos bits This looks like it was once from the illumnos compat code. FreeBSD doesn't have cmn_err as a compiler format attribute, so it definitely errors out. It doesn't show up on LLVM because it doesn't trigger at all. Add in the format flags but keep them behind #if 0 for now; there are too many format issues that trigger when one does format checking in the shared code. Reviewed-by: Brian Behlendorf Reviewed-by: Ryan Moeller Signed-off-by: adrian chadd Closes #11068 Closes #11069 --- .../openzfs/include/os/freebsd/spl/sys/ccompile.h | 32 ++++++++++++++-------- 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h b/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h index cf1e0a8a6376..a02e8f098540 100644 --- a/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h +++ b/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h @@ -48,6 +48,7 @@ extern "C" { #if defined(__ATTRIBUTE_IMPLEMENTED) || defined(__GNUC__) +#if 0 /* * analogous to lint's PRINTFLIKEn */ @@ -56,20 +57,28 @@ extern "C" { #define __sun_attr___VPRINTFLIKE__(__n) \ __attribute__((__format__(printf, __n, 0))) -/* - * Handle the kernel printf routines that can take '%b' too - */ -#if __GNUC_VERSION < 30402 -/* - * XX64 at least this doesn't work correctly yet with 3.4.1 anyway! - */ #define __sun_attr___KPRINTFLIKE__ __sun_attr___PRINTFLIKE__ #define __sun_attr___KVPRINTFLIKE__ __sun_attr___VPRINTFLIKE__ #else -#define __sun_attr___KPRINTFLIKE__(__n) \ - __attribute__((__format__(cmn_err, __n, (__n)+1))) -#define __sun_attr___KVPRINTFLIKE__(__n) \ - __attribute__((__format__(cmn_err, __n, 0))) +/* + * Currently the openzfs codebase has a lot of formatting errors + * which are not picked up in the linux build because they're not + * doing formatting checks. LLVM's kprintf implementation doesn't + * actually do format checks! + * + * For FreeBSD these break under gcc! LLVM shim'ed cmn_err as a + * format attribute but also didn't check anything. If one + * replaces it with the above, all of the format issues + * in the codebase show up. + * + * Once those format string issues are addressed, the above + * should be flipped on once again. + */ +#define __sun_attr___PRINTFLIKE__(__n) +#define __sun_attr___VPRINTFLIKE__(__n) +#define __sun_attr___KPRINTFLIKE__(__n) +#define __sun_attr___KVPRINTFLIKE__(__n) + #endif /* @@ -77,7 +86,6 @@ extern "C" { */ #define __sun_attr___noreturn__ __attribute__((__noreturn__)) - /* * This is an appropriate label for functions that do not * modify their arguments, e.g. strlen() From owner-dev-commits-src-main@freebsd.org Sun Dec 27 23:03:40 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 429264CA7F3; Sun, 27 Dec 2020 23:03:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D3x7J1Ms9z3rtM; Sun, 27 Dec 2020 23:03:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 21E7C755F; Sun, 27 Dec 2020 23:03:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BRN3eMQ008647; Sun, 27 Dec 2020 23:03:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BRN3eqg008646; Sun, 27 Dec 2020 23:03:40 GMT (envelope-from git) Date: Sun, 27 Dec 2020 23:03:40 GMT Message-Id: <202012272303.0BRN3eqg008646@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ryan Libby Subject: git: 21ce674e3c7e - main - Merge commit 956f94010 from openzfs git (by Ryan Libby): MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rlibby X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 21ce674e3c7e9dad485b0d84634616f0b535a17f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Dec 2020 23:03:40 -0000 The branch main has been updated by rlibby: URL: https://cgit.FreeBSD.org/src/commit/?id=21ce674e3c7e9dad485b0d84634616f0b535a17f commit 21ce674e3c7e9dad485b0d84634616f0b535a17f Author: Ryan Libby AuthorDate: 2020-12-27 22:33:13 +0000 Commit: Ryan Libby CommitDate: 2020-12-27 22:33:13 +0000 Merge commit 956f94010 from openzfs git (by Ryan Libby): spa: avoid type narrowing warning Building the spa module for i386 caused gcc to emit -Wint-to-pointer-cast "cast to pointer from integer of different size" because spa.spa_did was uint64_t but pthread_join (via thread_join in spa_deactivate) takes a pointer (32-bit on i386). Define spa_did to be pointer-size instead. For now spa_did is in fact never non-zero and the thread_join could instead be ifdef'd out, but changing the size of spa_did may be more useful for the future. Reviewed-by: Brian Behlendorf Signed-off-by: Ryan Libby Closes #11336 --- sys/contrib/openzfs/include/sys/spa_impl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/contrib/openzfs/include/sys/spa_impl.h b/sys/contrib/openzfs/include/sys/spa_impl.h index 69de75fb6d3f..3eb87d2bb220 100644 --- a/sys/contrib/openzfs/include/sys/spa_impl.h +++ b/sys/contrib/openzfs/include/sys/spa_impl.h @@ -377,7 +377,7 @@ struct spa { kcondvar_t spa_proc_cv; /* spa_proc_state transitions */ spa_proc_state_t spa_proc_state; /* see definition */ proc_t *spa_proc; /* "zpool-poolname" process */ - uint64_t spa_did; /* if procp != p0, did of t1 */ + uintptr_t spa_did; /* if procp != p0, did of t1 */ boolean_t spa_autoreplace; /* autoreplace set in open */ int spa_vdev_locks; /* locks grabbed */ uint64_t spa_creation_version; /* version at pool creation */ From owner-dev-commits-src-main@freebsd.org Sun Dec 27 23:03:40 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8ED2B4CA8AC; Sun, 27 Dec 2020 23:03:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D3x7J3YlDz3s6y; Sun, 27 Dec 2020 23:03:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6B9F57271; Sun, 27 Dec 2020 23:03:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BRN3eQ9008715; Sun, 27 Dec 2020 23:03:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BRN3egB008714; Sun, 27 Dec 2020 23:03:40 GMT (envelope-from git) Date: Sun, 27 Dec 2020 23:03:40 GMT Message-Id: <202012272303.0BRN3egB008714@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ryan Libby Subject: git: d021434a7960 - main - openzfs: fix gcc kernel module builds MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rlibby X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d021434a796008efbb93616f5297ed2f55a1a230 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Dec 2020 23:03:40 -0000 The branch main has been updated by rlibby: URL: https://cgit.FreeBSD.org/src/commit/?id=d021434a796008efbb93616f5297ed2f55a1a230 commit d021434a796008efbb93616f5297ed2f55a1a230 Author: Ryan Libby AuthorDate: 2020-12-27 22:33:13 +0000 Commit: Ryan Libby CommitDate: 2020-12-27 22:33:13 +0000 openzfs: fix gcc kernel module builds - Suppress -Wredundant-decls. Ultimately this warning is harmless in any case, and it does not look like there is a simple way to avoid redundant declarations in this case without a lot of header pollution (e.g. having openzfs's shim param.h pulling in sys/kernel.h for hz). - Suppress -Wnested-externs, which is useless anyway. Unfortunately it was not sufficient just to modify OPENZFS_CFLAGS, because the warning suppressions need to appear on the command line after they are explicitly enabled by CWARNFLAGS from sys/conf/kern.mk, but OPENZFS_CFLAGS get added before due to use of -I for the shims. Reviewed by: markj Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D27685 --- sys/conf/kmod.mk | 4 +++- sys/modules/dtrace/dtaudit/Makefile | 1 + sys/modules/dtrace/dtmalloc/Makefile | 1 + sys/modules/dtrace/dtnfscl/Makefile | 1 + sys/modules/dtrace/dtrace/Makefile | 1 + sys/modules/dtrace/fasttrap/Makefile | 1 + sys/modules/dtrace/fbt/Makefile | 1 + sys/modules/dtrace/profile/Makefile | 1 + sys/modules/dtrace/prototype/Makefile | 1 + sys/modules/dtrace/sdt/Makefile | 1 + sys/modules/dtrace/systrace/Makefile | 1 + sys/modules/dtrace/systrace_freebsd32/Makefile | 1 + sys/modules/dtrace/systrace_linux/Makefile | 1 + sys/modules/dtrace/systrace_linux32/Makefile | 1 + sys/modules/opensolaris/Makefile | 1 + sys/modules/zfs/Makefile | 1 + 16 files changed, 18 insertions(+), 1 deletion(-) diff --git a/sys/conf/kmod.mk b/sys/conf/kmod.mk index 54ecbdf69c88..dcc00829b831 100644 --- a/sys/conf/kmod.mk +++ b/sys/conf/kmod.mk @@ -540,7 +540,9 @@ OPENZFS_CFLAGS= \ -I${SYSDIR}/cddl/compat/opensolaris \ -I${SYSDIR}/cddl/contrib/opensolaris/uts/common \ -include ${ZINCDIR}/os/freebsd/spl/sys/ccompile.h - +OPENZFS_CWARNFLAGS= \ + -Wno-nested-externs \ + -Wno-redundant-decls .include .include diff --git a/sys/modules/dtrace/dtaudit/Makefile b/sys/modules/dtrace/dtaudit/Makefile index 72cdf03f4bc3..3571bcbb7ea2 100644 --- a/sys/modules/dtrace/dtaudit/Makefile +++ b/sys/modules/dtrace/dtaudit/Makefile @@ -13,3 +13,4 @@ CFLAGS+= ${OPENZFS_CFLAGS} .include CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h +CWARNFLAGS+= ${OPENZFS_CWARNFLAGS} diff --git a/sys/modules/dtrace/dtmalloc/Makefile b/sys/modules/dtrace/dtmalloc/Makefile index 910f8f360e80..ffde4f811ee8 100644 --- a/sys/modules/dtrace/dtmalloc/Makefile +++ b/sys/modules/dtrace/dtmalloc/Makefile @@ -13,3 +13,4 @@ CFLAGS+= ${OPENZFS_CFLAGS} .include CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h +CWARNFLAGS+= ${OPENZFS_CWARNFLAGS} diff --git a/sys/modules/dtrace/dtnfscl/Makefile b/sys/modules/dtrace/dtnfscl/Makefile index 6184ad183fc6..d28641e51ec8 100644 --- a/sys/modules/dtrace/dtnfscl/Makefile +++ b/sys/modules/dtrace/dtnfscl/Makefile @@ -13,3 +13,4 @@ CFLAGS+= ${OPENZFS_CFLAGS} .include CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h +CWARNFLAGS+= ${OPENZFS_CWARNFLAGS} diff --git a/sys/modules/dtrace/dtrace/Makefile b/sys/modules/dtrace/dtrace/Makefile index 0bedcaa12fe7..80278fc83a32 100644 --- a/sys/modules/dtrace/dtrace/Makefile +++ b/sys/modules/dtrace/dtrace/Makefile @@ -59,6 +59,7 @@ dtrace_asm.o: assym.inc CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h CFLAGS.dtrace_asm.S+= -D_SYS_ERRNO_H_ -D_SYS_PARAM_H_ -DLOCORE +CWARNFLAGS+= ${OPENZFS_CWARNFLAGS} CWARNFLAGS+= -Wno-parentheses CWARNFLAGS+= -Wno-uninitialized CWARNFLAGS+= -Wno-cast-qual diff --git a/sys/modules/dtrace/fasttrap/Makefile b/sys/modules/dtrace/fasttrap/Makefile index 1be1b97736ea..0eecfcb11aab 100644 --- a/sys/modules/dtrace/fasttrap/Makefile +++ b/sys/modules/dtrace/fasttrap/Makefile @@ -26,5 +26,6 @@ SRCS+= u8_textprep.c CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h +CWARNFLAGS+= ${OPENZFS_CWARNFLAGS} CWARNFLAGS+= -Wno-cast-qual CWARNFLAGS+= -Wno-unused diff --git a/sys/modules/dtrace/fbt/Makefile b/sys/modules/dtrace/fbt/Makefile index 288c8cafa817..360d92000776 100644 --- a/sys/modules/dtrace/fbt/Makefile +++ b/sys/modules/dtrace/fbt/Makefile @@ -23,3 +23,4 @@ CFLAGS+= -I${SYSDIR}/cddl/dev/fbt .include CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h +CWARNFLAGS+= ${OPENZFS_CWARNFLAGS} diff --git a/sys/modules/dtrace/profile/Makefile b/sys/modules/dtrace/profile/Makefile index aa36f9a2dfba..b3eec9a19f23 100644 --- a/sys/modules/dtrace/profile/Makefile +++ b/sys/modules/dtrace/profile/Makefile @@ -13,3 +13,4 @@ CFLAGS+= ${OPENZFS_CFLAGS} .include CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h +CWARNFLAGS+= ${OPENZFS_CWARNFLAGS} diff --git a/sys/modules/dtrace/prototype/Makefile b/sys/modules/dtrace/prototype/Makefile index 476c567a4dc0..189d6c2df2a2 100644 --- a/sys/modules/dtrace/prototype/Makefile +++ b/sys/modules/dtrace/prototype/Makefile @@ -13,3 +13,4 @@ CFLAGS+= ${OPENZFS_CFLAGS} .include CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h +CWARNFLAGS+= ${OPENZFS_CWARNFLAGS} diff --git a/sys/modules/dtrace/sdt/Makefile b/sys/modules/dtrace/sdt/Makefile index 2f6432e4a71f..a025848e3a60 100644 --- a/sys/modules/dtrace/sdt/Makefile +++ b/sys/modules/dtrace/sdt/Makefile @@ -12,3 +12,4 @@ CFLAGS+= ${OPENZFS_CFLAGS} .include CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h +CWARNFLAGS+= ${OPENZFS_CWARNFLAGS} diff --git a/sys/modules/dtrace/systrace/Makefile b/sys/modules/dtrace/systrace/Makefile index 3e122f70da25..2250a7418193 100644 --- a/sys/modules/dtrace/systrace/Makefile +++ b/sys/modules/dtrace/systrace/Makefile @@ -13,3 +13,4 @@ CFLAGS+= ${OPENZFS_CFLAGS} .include CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h +CWARNFLAGS+= ${OPENZFS_CWARNFLAGS} diff --git a/sys/modules/dtrace/systrace_freebsd32/Makefile b/sys/modules/dtrace/systrace_freebsd32/Makefile index 4661633f9a62..3b77bc4c6d0e 100644 --- a/sys/modules/dtrace/systrace_freebsd32/Makefile +++ b/sys/modules/dtrace/systrace_freebsd32/Makefile @@ -14,3 +14,4 @@ CFLAGS+= -DFREEBSD32_SYSTRACE .include CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h +CWARNFLAGS+= ${OPENZFS_CWARNFLAGS} diff --git a/sys/modules/dtrace/systrace_linux/Makefile b/sys/modules/dtrace/systrace_linux/Makefile index 7dbd88ffb5f0..56f422dfb9e5 100644 --- a/sys/modules/dtrace/systrace_linux/Makefile +++ b/sys/modules/dtrace/systrace_linux/Makefile @@ -15,3 +15,4 @@ CFLAGS+= -DLINUX_SYSTRACE .include CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h +CWARNFLAGS+= ${OPENZFS_CWARNFLAGS} diff --git a/sys/modules/dtrace/systrace_linux32/Makefile b/sys/modules/dtrace/systrace_linux32/Makefile index 81aa1b7de9df..febd4a0c1bab 100644 --- a/sys/modules/dtrace/systrace_linux32/Makefile +++ b/sys/modules/dtrace/systrace_linux32/Makefile @@ -15,3 +15,4 @@ CFLAGS+= -DLINUX32_SYSTRACE .include CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h +CWARNFLAGS+= ${OPENZFS_CWARNFLAGS} diff --git a/sys/modules/opensolaris/Makefile b/sys/modules/opensolaris/Makefile index 1b5dd6dffcfb..536b9637cd3c 100644 --- a/sys/modules/opensolaris/Makefile +++ b/sys/modules/opensolaris/Makefile @@ -34,3 +34,4 @@ IGNORE_PRAGMA= 1 .include CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h +CWARNFLAGS+= ${OPENZFS_CWARNFLAGS} diff --git a/sys/modules/zfs/Makefile b/sys/modules/zfs/Makefile index 2318b9b155d3..d2617dc6bdc6 100644 --- a/sys/modules/zfs/Makefile +++ b/sys/modules/zfs/Makefile @@ -279,6 +279,7 @@ SRCS+= zfs_zstd.c \ .include +CWARNFLAGS+= ${OPENZFS_CWARNFLAGS} CFLAGS.gcc+= -Wno-pointer-to-int-cast From owner-dev-commits-src-main@freebsd.org Sun Dec 27 23:38:11 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C3BA84CABFE; Sun, 27 Dec 2020 23:38:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D3xv758cgz3tbP; Sun, 27 Dec 2020 23:38:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A45AD79A8; Sun, 27 Dec 2020 23:38:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BRNcBfP042416; Sun, 27 Dec 2020 23:38:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BRNcBDO042415; Sun, 27 Dec 2020 23:38:11 GMT (envelope-from git) Date: Sun, 27 Dec 2020 23:38:11 GMT Message-Id: <202012272338.0BRNcBDO042415@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Martin Matuska Subject: git: 70a567c2c350 - main - bsdcat, cpio, tar: Bump version number to 3.5.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 70a567c2c350b29e667e26d5e1b9b1d35d567172 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Dec 2020 23:38:11 -0000 The branch main has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=70a567c2c350b29e667e26d5e1b9b1d35d567172 commit 70a567c2c350b29e667e26d5e1b9b1d35d567172 Author: Martin Matuska AuthorDate: 2020-12-27 23:35:49 +0000 Commit: Martin Matuska CommitDate: 2020-12-27 23:37:06 +0000 bsdcat,cpio,tar: Bump version number to 3.5.1 Matches import of libarchive 3.5.1 --- usr.bin/bsdcat/Makefile | 2 +- usr.bin/cpio/Makefile | 2 +- usr.bin/tar/Makefile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.bin/bsdcat/Makefile b/usr.bin/bsdcat/Makefile index b9ce457a57f6..483875a01a57 100644 --- a/usr.bin/bsdcat/Makefile +++ b/usr.bin/bsdcat/Makefile @@ -6,7 +6,7 @@ _LIBARCHIVEDIR= ${SRCTOP}/contrib/libarchive _LIBARCHIVECONFDIR= ${SRCTOP}/lib/libarchive PROG= bsdcat -BSDCAT_VERSION_STRING= 3.5.0 +BSDCAT_VERSION_STRING= 3.5.1 .PATH: ${_LIBARCHIVEDIR}/cat SRCS= bsdcat.c cmdline.c diff --git a/usr.bin/cpio/Makefile b/usr.bin/cpio/Makefile index 19446941ff05..6855e3e2d77e 100644 --- a/usr.bin/cpio/Makefile +++ b/usr.bin/cpio/Makefile @@ -6,7 +6,7 @@ _LIBARCHIVEDIR= ${SRCTOP}/contrib/libarchive _LIBARCHIVECONFDIR= ${SRCTOP}/lib/libarchive PROG= bsdcpio -BSDCPIO_VERSION_STRING= 3.5.0 +BSDCPIO_VERSION_STRING= 3.5.1 .PATH: ${_LIBARCHIVEDIR}/cpio SRCS= cpio.c cmdline.c diff --git a/usr.bin/tar/Makefile b/usr.bin/tar/Makefile index 938bcf32599b..d6154dc3b30d 100644 --- a/usr.bin/tar/Makefile +++ b/usr.bin/tar/Makefile @@ -5,7 +5,7 @@ _LIBARCHIVEDIR= ${SRCTOP}/contrib/libarchive PACKAGE= runtime PROG= bsdtar -BSDTAR_VERSION_STRING= 3.5.0 +BSDTAR_VERSION_STRING= 3.5.1 .PATH: ${_LIBARCHIVEDIR}/tar SRCS= bsdtar.c \ From owner-dev-commits-src-main@freebsd.org Sun Dec 27 23:38:12 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3C2F24CB187; Sun, 27 Dec 2020 23:38:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D3xv81Fmzz3tSt; Sun, 27 Dec 2020 23:38:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1D3587D91; Sun, 27 Dec 2020 23:38:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BRNcCuB042433; Sun, 27 Dec 2020 23:38:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BRNcBs8042432; Sun, 27 Dec 2020 23:38:11 GMT (envelope-from git) Date: Sun, 27 Dec 2020 23:38:11 GMT Message-Id: <202012272338.0BRNcBs8042432@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Martin Matuska Subject: git: 69a18c5826c9 - main - contrib/libarchive: Import libarchive 3.5.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 69a18c5826c9633a6d77e18f9f34e02c83d22717 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Dec 2020 23:38:12 -0000 The branch main has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=69a18c5826c9633a6d77e18f9f34e02c83d22717 commit 69a18c5826c9633a6d77e18f9f34e02c83d22717 Merge: f2d48b5e2c3b 8be2bb3d35e2 Author: Martin Matuska AuthorDate: 2020-12-27 23:34:06 +0000 Commit: Martin Matuska CommitDate: 2020-12-27 23:34:06 +0000 contrib/libarchive: Import libarchive 3.5.1 Merge commit '8be2bb3d35e232080b4e39244020e650bbe31562' into main contrib/libarchive/NEWS | 2 ++ contrib/libarchive/libarchive/archive.h | 4 ++-- contrib/libarchive/libarchive/archive_entry.h | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --cc contrib/libarchive/libarchive/archive.h index 7e55a926c740,000000000000..55f0fad15730 mode 100644,000000..100644 --- a/contrib/libarchive/libarchive/archive.h +++ b/contrib/libarchive/libarchive/archive.h @@@ -1,1204 -1,0 +1,1204 @@@ +/*- + * Copyright (c) 2003-2010 Tim Kientzle + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``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(S) 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 ARCHIVE_H_INCLUDED +#define ARCHIVE_H_INCLUDED + +/* + * The version number is expressed as a single integer that makes it + * easy to compare versions at build time: for version a.b.c, the + * version number is printf("%d%03d%03d",a,b,c). For example, if you + * know your application requires version 2.12.108 or later, you can + * assert that ARCHIVE_VERSION_NUMBER >= 2012108. + */ +/* Note: Compiler will complain if this does not match archive_entry.h! */ - #define ARCHIVE_VERSION_NUMBER 3005000 ++#define ARCHIVE_VERSION_NUMBER 3005001 + +#include +#include /* for wchar_t */ +#include /* For FILE * */ +#include /* For time_t */ + +/* + * Note: archive.h is for use outside of libarchive; the configuration + * headers (config.h, archive_platform.h, etc.) are purely internal. + * Do NOT use HAVE_XXX configuration macros to control the behavior of + * this header! If you must conditionalize, use predefined compiler and/or + * platform macros. + */ +#if defined(__BORLANDC__) && __BORLANDC__ >= 0x560 +# include +#elif !defined(__WATCOMC__) && !defined(_MSC_VER) && !defined(__INTERIX) && !defined(__BORLANDC__) && !defined(_SCO_DS) && !defined(__osf__) && !defined(__CLANG_INTTYPES_H) +# include +#endif + +/* Get appropriate definitions of 64-bit integer */ +#if !defined(__LA_INT64_T_DEFINED) +/* Older code relied on the __LA_INT64_T macro; after 4.0 we'll switch to the typedef exclusively. */ +# if ARCHIVE_VERSION_NUMBER < 4000000 +#define __LA_INT64_T la_int64_t +# endif +#define __LA_INT64_T_DEFINED +# if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__WATCOMC__) +typedef __int64 la_int64_t; +# else +# include /* ssize_t */ +# if defined(_SCO_DS) || defined(__osf__) +typedef long long la_int64_t; +# else +typedef int64_t la_int64_t; +# endif +# endif +#endif + +/* The la_ssize_t should match the type used in 'struct stat' */ +#if !defined(__LA_SSIZE_T_DEFINED) +/* Older code relied on the __LA_SSIZE_T macro; after 4.0 we'll switch to the typedef exclusively. */ +# if ARCHIVE_VERSION_NUMBER < 4000000 +#define __LA_SSIZE_T la_ssize_t +# endif +#define __LA_SSIZE_T_DEFINED +# if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__WATCOMC__) +# if defined(_SSIZE_T_DEFINED) || defined(_SSIZE_T_) +typedef ssize_t la_ssize_t; +# elif defined(_WIN64) +typedef __int64 la_ssize_t; +# else +typedef long la_ssize_t; +# endif +# else +# include /* ssize_t */ +typedef ssize_t la_ssize_t; +# endif +#endif + +/* Large file support for Android */ +#ifdef __ANDROID__ +#include "android_lf.h" +#endif + +/* + * On Windows, define LIBARCHIVE_STATIC if you're building or using a + * .lib. The default here assumes you're building a DLL. Only + * libarchive source should ever define __LIBARCHIVE_BUILD. + */ +#if ((defined __WIN32__) || (defined _WIN32) || defined(__CYGWIN__)) && (!defined LIBARCHIVE_STATIC) +# ifdef __LIBARCHIVE_BUILD +# ifdef __GNUC__ +# define __LA_DECL __attribute__((dllexport)) extern +# else +# define __LA_DECL __declspec(dllexport) +# endif +# else +# ifdef __GNUC__ +# define __LA_DECL +# else +# define __LA_DECL __declspec(dllimport) +# endif +# endif +#else +/* Static libraries or non-Windows needs no special declaration. */ +# define __LA_DECL +#endif + +#if defined(__GNUC__) && __GNUC__ >= 3 && !defined(__MINGW32__) +#define __LA_PRINTF(fmtarg, firstvararg) \ + __attribute__((__format__ (__printf__, fmtarg, firstvararg))) +#else +#define __LA_PRINTF(fmtarg, firstvararg) /* nothing */ +#endif + +#if defined(__GNUC__) && __GNUC__ >= 3 && __GNUC_MINOR__ >= 1 +# define __LA_DEPRECATED __attribute__((deprecated)) +#else +# define __LA_DEPRECATED +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * The version number is provided as both a macro and a function. + * The macro identifies the installed header; the function identifies + * the library version (which may not be the same if you're using a + * dynamically-linked version of the library). Of course, if the + * header and library are very different, you should expect some + * strangeness. Don't do that. + */ +__LA_DECL int archive_version_number(void); + +/* + * Textual name/version of the library, useful for version displays. + */ - #define ARCHIVE_VERSION_ONLY_STRING "3.5.0" ++#define ARCHIVE_VERSION_ONLY_STRING "3.5.1" +#define ARCHIVE_VERSION_STRING "libarchive " ARCHIVE_VERSION_ONLY_STRING +__LA_DECL const char * archive_version_string(void); + +/* + * Detailed textual name/version of the library and its dependencies. + * This has the form: + * "libarchive x.y.z zlib/a.b.c liblzma/d.e.f ... etc ..." + * the list of libraries described here will vary depending on how + * libarchive was compiled. + */ +__LA_DECL const char * archive_version_details(void); + +/* + * Returns NULL if libarchive was compiled without the associated library. + * Otherwise, returns the version number that libarchive was compiled + * against. + */ +__LA_DECL const char * archive_zlib_version(void); +__LA_DECL const char * archive_liblzma_version(void); +__LA_DECL const char * archive_bzlib_version(void); +__LA_DECL const char * archive_liblz4_version(void); +__LA_DECL const char * archive_libzstd_version(void); + +/* Declare our basic types. */ +struct archive; +struct archive_entry; + +/* + * Error codes: Use archive_errno() and archive_error_string() + * to retrieve details. Unless specified otherwise, all functions + * that return 'int' use these codes. + */ +#define ARCHIVE_EOF 1 /* Found end of archive. */ +#define ARCHIVE_OK 0 /* Operation was successful. */ +#define ARCHIVE_RETRY (-10) /* Retry might succeed. */ +#define ARCHIVE_WARN (-20) /* Partial success. */ +/* For example, if write_header "fails", then you can't push data. */ +#define ARCHIVE_FAILED (-25) /* Current operation cannot complete. */ +/* But if write_header is "fatal," then this archive is dead and useless. */ +#define ARCHIVE_FATAL (-30) /* No more operations are possible. */ + +/* + * As far as possible, archive_errno returns standard platform errno codes. + * Of course, the details vary by platform, so the actual definitions + * here are stored in "archive_platform.h". The symbols are listed here + * for reference; as a rule, clients should not need to know the exact + * platform-dependent error code. + */ +/* Unrecognized or invalid file format. */ +/* #define ARCHIVE_ERRNO_FILE_FORMAT */ +/* Illegal usage of the library. */ +/* #define ARCHIVE_ERRNO_PROGRAMMER_ERROR */ +/* Unknown or unclassified error. */ +/* #define ARCHIVE_ERRNO_MISC */ + +/* + * Callbacks are invoked to automatically read/skip/write/open/close the + * archive. You can provide your own for complex tasks (like breaking + * archives across multiple tapes) or use standard ones built into the + * library. + */ + +/* Returns pointer and size of next block of data from archive. */ +typedef la_ssize_t archive_read_callback(struct archive *, + void *_client_data, const void **_buffer); + +/* Skips at most request bytes from archive and returns the skipped amount. + * This may skip fewer bytes than requested; it may even skip zero bytes. + * If you do skip fewer bytes than requested, libarchive will invoke your + * read callback and discard data as necessary to make up the full skip. + */ +typedef la_int64_t archive_skip_callback(struct archive *, + void *_client_data, la_int64_t request); + +/* Seeks to specified location in the file and returns the position. + * Whence values are SEEK_SET, SEEK_CUR, SEEK_END from stdio.h. + * Return ARCHIVE_FATAL if the seek fails for any reason. + */ +typedef la_int64_t archive_seek_callback(struct archive *, + void *_client_data, la_int64_t offset, int whence); + +/* Returns size actually written, zero on EOF, -1 on error. */ +typedef la_ssize_t archive_write_callback(struct archive *, + void *_client_data, + const void *_buffer, size_t _length); + +typedef int archive_open_callback(struct archive *, void *_client_data); + +typedef int archive_close_callback(struct archive *, void *_client_data); + +typedef int archive_free_callback(struct archive *, void *_client_data); + +/* Switches from one client data object to the next/prev client data object. + * This is useful for reading from different data blocks such as a set of files + * that make up one large file. + */ +typedef int archive_switch_callback(struct archive *, void *_client_data1, + void *_client_data2); + +/* + * Returns a passphrase used for encryption or decryption, NULL on nothing + * to do and give it up. + */ +typedef const char *archive_passphrase_callback(struct archive *, + void *_client_data); + +/* + * Codes to identify various stream filters. + */ +#define ARCHIVE_FILTER_NONE 0 +#define ARCHIVE_FILTER_GZIP 1 +#define ARCHIVE_FILTER_BZIP2 2 +#define ARCHIVE_FILTER_COMPRESS 3 +#define ARCHIVE_FILTER_PROGRAM 4 +#define ARCHIVE_FILTER_LZMA 5 +#define ARCHIVE_FILTER_XZ 6 +#define ARCHIVE_FILTER_UU 7 +#define ARCHIVE_FILTER_RPM 8 +#define ARCHIVE_FILTER_LZIP 9 +#define ARCHIVE_FILTER_LRZIP 10 +#define ARCHIVE_FILTER_LZOP 11 +#define ARCHIVE_FILTER_GRZIP 12 +#define ARCHIVE_FILTER_LZ4 13 +#define ARCHIVE_FILTER_ZSTD 14 + +#if ARCHIVE_VERSION_NUMBER < 4000000 +#define ARCHIVE_COMPRESSION_NONE ARCHIVE_FILTER_NONE +#define ARCHIVE_COMPRESSION_GZIP ARCHIVE_FILTER_GZIP +#define ARCHIVE_COMPRESSION_BZIP2 ARCHIVE_FILTER_BZIP2 +#define ARCHIVE_COMPRESSION_COMPRESS ARCHIVE_FILTER_COMPRESS +#define ARCHIVE_COMPRESSION_PROGRAM ARCHIVE_FILTER_PROGRAM +#define ARCHIVE_COMPRESSION_LZMA ARCHIVE_FILTER_LZMA +#define ARCHIVE_COMPRESSION_XZ ARCHIVE_FILTER_XZ +#define ARCHIVE_COMPRESSION_UU ARCHIVE_FILTER_UU +#define ARCHIVE_COMPRESSION_RPM ARCHIVE_FILTER_RPM +#define ARCHIVE_COMPRESSION_LZIP ARCHIVE_FILTER_LZIP +#define ARCHIVE_COMPRESSION_LRZIP ARCHIVE_FILTER_LRZIP +#endif + +/* + * Codes returned by archive_format. + * + * Top 16 bits identifies the format family (e.g., "tar"); lower + * 16 bits indicate the variant. This is updated by read_next_header. + * Note that the lower 16 bits will often vary from entry to entry. + * In some cases, this variation occurs as libarchive learns more about + * the archive (for example, later entries might utilize extensions that + * weren't necessary earlier in the archive; in this case, libarchive + * will change the format code to indicate the extended format that + * was used). In other cases, it's because different tools have + * modified the archive and so different parts of the archive + * actually have slightly different formats. (Both tar and cpio store + * format codes in each entry, so it is quite possible for each + * entry to be in a different format.) + */ +#define ARCHIVE_FORMAT_BASE_MASK 0xff0000 +#define ARCHIVE_FORMAT_CPIO 0x10000 +#define ARCHIVE_FORMAT_CPIO_POSIX (ARCHIVE_FORMAT_CPIO | 1) +#define ARCHIVE_FORMAT_CPIO_BIN_LE (ARCHIVE_FORMAT_CPIO | 2) +#define ARCHIVE_FORMAT_CPIO_BIN_BE (ARCHIVE_FORMAT_CPIO | 3) +#define ARCHIVE_FORMAT_CPIO_SVR4_NOCRC (ARCHIVE_FORMAT_CPIO | 4) +#define ARCHIVE_FORMAT_CPIO_SVR4_CRC (ARCHIVE_FORMAT_CPIO | 5) +#define ARCHIVE_FORMAT_CPIO_AFIO_LARGE (ARCHIVE_FORMAT_CPIO | 6) +#define ARCHIVE_FORMAT_SHAR 0x20000 +#define ARCHIVE_FORMAT_SHAR_BASE (ARCHIVE_FORMAT_SHAR | 1) +#define ARCHIVE_FORMAT_SHAR_DUMP (ARCHIVE_FORMAT_SHAR | 2) +#define ARCHIVE_FORMAT_TAR 0x30000 +#define ARCHIVE_FORMAT_TAR_USTAR (ARCHIVE_FORMAT_TAR | 1) +#define ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE (ARCHIVE_FORMAT_TAR | 2) +#define ARCHIVE_FORMAT_TAR_PAX_RESTRICTED (ARCHIVE_FORMAT_TAR | 3) +#define ARCHIVE_FORMAT_TAR_GNUTAR (ARCHIVE_FORMAT_TAR | 4) +#define ARCHIVE_FORMAT_ISO9660 0x40000 +#define ARCHIVE_FORMAT_ISO9660_ROCKRIDGE (ARCHIVE_FORMAT_ISO9660 | 1) +#define ARCHIVE_FORMAT_ZIP 0x50000 +#define ARCHIVE_FORMAT_EMPTY 0x60000 +#define ARCHIVE_FORMAT_AR 0x70000 +#define ARCHIVE_FORMAT_AR_GNU (ARCHIVE_FORMAT_AR | 1) +#define ARCHIVE_FORMAT_AR_BSD (ARCHIVE_FORMAT_AR | 2) +#define ARCHIVE_FORMAT_MTREE 0x80000 +#define ARCHIVE_FORMAT_RAW 0x90000 +#define ARCHIVE_FORMAT_XAR 0xA0000 +#define ARCHIVE_FORMAT_LHA 0xB0000 +#define ARCHIVE_FORMAT_CAB 0xC0000 +#define ARCHIVE_FORMAT_RAR 0xD0000 +#define ARCHIVE_FORMAT_7ZIP 0xE0000 +#define ARCHIVE_FORMAT_WARC 0xF0000 +#define ARCHIVE_FORMAT_RAR_V5 0x100000 + +/* + * Codes returned by archive_read_format_capabilities(). + * + * This list can be extended with values between 0 and 0xffff. + * The original purpose of this list was to let different archive + * format readers expose their general capabilities in terms of + * encryption. + */ +#define ARCHIVE_READ_FORMAT_CAPS_NONE (0) /* no special capabilities */ +#define ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA (1<<0) /* reader can detect encrypted data */ +#define ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_METADATA (1<<1) /* reader can detect encryptable metadata (pathname, mtime, etc.) */ + +/* + * Codes returned by archive_read_has_encrypted_entries(). + * + * In case the archive does not support encryption detection at all + * ARCHIVE_READ_FORMAT_ENCRYPTION_UNSUPPORTED is returned. If the reader + * for some other reason (e.g. not enough bytes read) cannot say if + * there are encrypted entries, ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW + * is returned. + */ +#define ARCHIVE_READ_FORMAT_ENCRYPTION_UNSUPPORTED -2 +#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1 + +/*- + * Basic outline for reading an archive: + * 1) Ask archive_read_new for an archive reader object. + * 2) Update any global properties as appropriate. + * In particular, you'll certainly want to call appropriate + * archive_read_support_XXX functions. + * 3) Call archive_read_open_XXX to open the archive + * 4) Repeatedly call archive_read_next_header to get information about + * successive archive entries. Call archive_read_data to extract + * data for entries of interest. + * 5) Call archive_read_free to end processing. + */ +__LA_DECL struct archive *archive_read_new(void); + +/* + * The archive_read_support_XXX calls enable auto-detect for this + * archive handle. They also link in the necessary support code. + * For example, if you don't want bzlib linked in, don't invoke + * support_compression_bzip2(). The "all" functions provide the + * obvious shorthand. + */ + +#if ARCHIVE_VERSION_NUMBER < 4000000 +__LA_DECL int archive_read_support_compression_all(struct archive *) + __LA_DEPRECATED; +__LA_DECL int archive_read_support_compression_bzip2(struct archive *) + __LA_DEPRECATED; +__LA_DECL int archive_read_support_compression_compress(struct archive *) + __LA_DEPRECATED; +__LA_DECL int archive_read_support_compression_gzip(struct archive *) + __LA_DEPRECATED; +__LA_DECL int archive_read_support_compression_lzip(struct archive *) + __LA_DEPRECATED; +__LA_DECL int archive_read_support_compression_lzma(struct archive *) + __LA_DEPRECATED; +__LA_DECL int archive_read_support_compression_none(struct archive *) + __LA_DEPRECATED; +__LA_DECL int archive_read_support_compression_program(struct archive *, + const char *command) __LA_DEPRECATED; +__LA_DECL int archive_read_support_compression_program_signature + (struct archive *, const char *, + const void * /* match */, size_t) __LA_DEPRECATED; + +__LA_DECL int archive_read_support_compression_rpm(struct archive *) + __LA_DEPRECATED; +__LA_DECL int archive_read_support_compression_uu(struct archive *) + __LA_DEPRECATED; +__LA_DECL int archive_read_support_compression_xz(struct archive *) + __LA_DEPRECATED; +#endif + +__LA_DECL int archive_read_support_filter_all(struct archive *); +__LA_DECL int archive_read_support_filter_by_code(struct archive *, int); +__LA_DECL int archive_read_support_filter_bzip2(struct archive *); +__LA_DECL int archive_read_support_filter_compress(struct archive *); +__LA_DECL int archive_read_support_filter_gzip(struct archive *); +__LA_DECL int archive_read_support_filter_grzip(struct archive *); +__LA_DECL int archive_read_support_filter_lrzip(struct archive *); +__LA_DECL int archive_read_support_filter_lz4(struct archive *); +__LA_DECL int archive_read_support_filter_lzip(struct archive *); +__LA_DECL int archive_read_support_filter_lzma(struct archive *); +__LA_DECL int archive_read_support_filter_lzop(struct archive *); +__LA_DECL int archive_read_support_filter_none(struct archive *); +__LA_DECL int archive_read_support_filter_program(struct archive *, + const char *command); +__LA_DECL int archive_read_support_filter_program_signature + (struct archive *, const char * /* cmd */, + const void * /* match */, size_t); +__LA_DECL int archive_read_support_filter_rpm(struct archive *); +__LA_DECL int archive_read_support_filter_uu(struct archive *); +__LA_DECL int archive_read_support_filter_xz(struct archive *); +__LA_DECL int archive_read_support_filter_zstd(struct archive *); + +__LA_DECL int archive_read_support_format_7zip(struct archive *); +__LA_DECL int archive_read_support_format_all(struct archive *); +__LA_DECL int archive_read_support_format_ar(struct archive *); +__LA_DECL int archive_read_support_format_by_code(struct archive *, int); +__LA_DECL int archive_read_support_format_cab(struct archive *); +__LA_DECL int archive_read_support_format_cpio(struct archive *); +__LA_DECL int archive_read_support_format_empty(struct archive *); +__LA_DECL int archive_read_support_format_gnutar(struct archive *); +__LA_DECL int archive_read_support_format_iso9660(struct archive *); +__LA_DECL int archive_read_support_format_lha(struct archive *); +__LA_DECL int archive_read_support_format_mtree(struct archive *); +__LA_DECL int archive_read_support_format_rar(struct archive *); +__LA_DECL int archive_read_support_format_rar5(struct archive *); +__LA_DECL int archive_read_support_format_raw(struct archive *); +__LA_DECL int archive_read_support_format_tar(struct archive *); +__LA_DECL int archive_read_support_format_warc(struct archive *); +__LA_DECL int archive_read_support_format_xar(struct archive *); +/* archive_read_support_format_zip() enables both streamable and seekable + * zip readers. */ +__LA_DECL int archive_read_support_format_zip(struct archive *); +/* Reads Zip archives as stream from beginning to end. Doesn't + * correctly handle SFX ZIP files or ZIP archives that have been modified + * in-place. */ +__LA_DECL int archive_read_support_format_zip_streamable(struct archive *); +/* Reads starting from central directory; requires seekable input. */ +__LA_DECL int archive_read_support_format_zip_seekable(struct archive *); + +/* Functions to manually set the format and filters to be used. This is + * useful to bypass the bidding process when the format and filters to use + * is known in advance. + */ +__LA_DECL int archive_read_set_format(struct archive *, int); +__LA_DECL int archive_read_append_filter(struct archive *, int); +__LA_DECL int archive_read_append_filter_program(struct archive *, + const char *); +__LA_DECL int archive_read_append_filter_program_signature + (struct archive *, const char *, const void * /* match */, size_t); + +/* Set various callbacks. */ +__LA_DECL int archive_read_set_open_callback(struct archive *, + archive_open_callback *); +__LA_DECL int archive_read_set_read_callback(struct archive *, + archive_read_callback *); +__LA_DECL int archive_read_set_seek_callback(struct archive *, + archive_seek_callback *); +__LA_DECL int archive_read_set_skip_callback(struct archive *, + archive_skip_callback *); +__LA_DECL int archive_read_set_close_callback(struct archive *, + archive_close_callback *); +/* Callback used to switch between one data object to the next */ +__LA_DECL int archive_read_set_switch_callback(struct archive *, + archive_switch_callback *); + +/* This sets the first data object. */ +__LA_DECL int archive_read_set_callback_data(struct archive *, void *); +/* This sets data object at specified index */ +__LA_DECL int archive_read_set_callback_data2(struct archive *, void *, + unsigned int); +/* This adds a data object at the specified index. */ +__LA_DECL int archive_read_add_callback_data(struct archive *, void *, + unsigned int); +/* This appends a data object to the end of list */ +__LA_DECL int archive_read_append_callback_data(struct archive *, void *); +/* This prepends a data object to the beginning of list */ +__LA_DECL int archive_read_prepend_callback_data(struct archive *, void *); + +/* Opening freezes the callbacks. */ +__LA_DECL int archive_read_open1(struct archive *); + +/* Convenience wrappers around the above. */ +__LA_DECL int archive_read_open(struct archive *, void *_client_data, + archive_open_callback *, archive_read_callback *, + archive_close_callback *); +__LA_DECL int archive_read_open2(struct archive *, void *_client_data, + archive_open_callback *, archive_read_callback *, + archive_skip_callback *, archive_close_callback *); + +/* + * A variety of shortcuts that invoke archive_read_open() with + * canned callbacks suitable for common situations. The ones that + * accept a block size handle tape blocking correctly. + */ +/* Use this if you know the filename. Note: NULL indicates stdin. */ +__LA_DECL int archive_read_open_filename(struct archive *, + const char *_filename, size_t _block_size); +/* Use this for reading multivolume files by filenames. + * NOTE: Must be NULL terminated. Sorting is NOT done. */ +__LA_DECL int archive_read_open_filenames(struct archive *, + const char **_filenames, size_t _block_size); +__LA_DECL int archive_read_open_filename_w(struct archive *, + const wchar_t *_filename, size_t _block_size); +/* archive_read_open_file() is a deprecated synonym for ..._open_filename(). */ +__LA_DECL int archive_read_open_file(struct archive *, + const char *_filename, size_t _block_size) __LA_DEPRECATED; +/* Read an archive that's stored in memory. */ +__LA_DECL int archive_read_open_memory(struct archive *, + const void * buff, size_t size); +/* A more involved version that is only used for internal testing. */ +__LA_DECL int archive_read_open_memory2(struct archive *a, const void *buff, + size_t size, size_t read_size); +/* Read an archive that's already open, using the file descriptor. */ +__LA_DECL int archive_read_open_fd(struct archive *, int _fd, + size_t _block_size); +/* Read an archive that's already open, using a FILE *. */ +/* Note: DO NOT use this with tape drives. */ +__LA_DECL int archive_read_open_FILE(struct archive *, FILE *_file); + +/* Parses and returns next entry header. */ +__LA_DECL int archive_read_next_header(struct archive *, + struct archive_entry **); + +/* Parses and returns next entry header using the archive_entry passed in */ +__LA_DECL int archive_read_next_header2(struct archive *, + struct archive_entry *); + +/* + * Retrieve the byte offset in UNCOMPRESSED data where last-read + * header started. + */ +__LA_DECL la_int64_t archive_read_header_position(struct archive *); + +/* + * Returns 1 if the archive contains at least one encrypted entry. + * If the archive format not support encryption at all + * ARCHIVE_READ_FORMAT_ENCRYPTION_UNSUPPORTED is returned. + * If for any other reason (e.g. not enough data read so far) + * we cannot say whether there are encrypted entries, then + * ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW is returned. + * In general, this function will return values below zero when the + * reader is uncertain or totally incapable of encryption support. + * When this function returns 0 you can be sure that the reader + * supports encryption detection but no encrypted entries have + * been found yet. + * + * NOTE: If the metadata/header of an archive is also encrypted, you + * cannot rely on the number of encrypted entries. That is why this + * function does not return the number of encrypted entries but# + * just shows that there are some. + */ +__LA_DECL int archive_read_has_encrypted_entries(struct archive *); + +/* + * Returns a bitmask of capabilities that are supported by the archive format reader. + * If the reader has no special capabilities, ARCHIVE_READ_FORMAT_CAPS_NONE is returned. + */ +__LA_DECL int archive_read_format_capabilities(struct archive *); + +/* Read data from the body of an entry. Similar to read(2). */ +__LA_DECL la_ssize_t archive_read_data(struct archive *, + void *, size_t); + +/* Seek within the body of an entry. Similar to lseek(2). */ +__LA_DECL la_int64_t archive_seek_data(struct archive *, la_int64_t, int); + +/* + * A zero-copy version of archive_read_data that also exposes the file offset + * of each returned block. Note that the client has no way to specify + * the desired size of the block. The API does guarantee that offsets will + * be strictly increasing and that returned blocks will not overlap. + */ +__LA_DECL int archive_read_data_block(struct archive *a, + const void **buff, size_t *size, la_int64_t *offset); + +/*- + * Some convenience functions that are built on archive_read_data: + * 'skip': skips entire entry + * 'into_buffer': writes data into memory buffer that you provide + * 'into_fd': writes data to specified filedes + */ +__LA_DECL int archive_read_data_skip(struct archive *); +__LA_DECL int archive_read_data_into_fd(struct archive *, int fd); + +/* + * Set read options. + */ +/* Apply option to the format only. */ +__LA_DECL int archive_read_set_format_option(struct archive *_a, + const char *m, const char *o, + const char *v); +/* Apply option to the filter only. */ +__LA_DECL int archive_read_set_filter_option(struct archive *_a, + const char *m, const char *o, + const char *v); +/* Apply option to both the format and the filter. */ +__LA_DECL int archive_read_set_option(struct archive *_a, + const char *m, const char *o, + const char *v); +/* Apply option string to both the format and the filter. */ +__LA_DECL int archive_read_set_options(struct archive *_a, + const char *opts); + +/* + * Add a decryption passphrase. + */ +__LA_DECL int archive_read_add_passphrase(struct archive *, const char *); +__LA_DECL int archive_read_set_passphrase_callback(struct archive *, + void *client_data, archive_passphrase_callback *); + + +/*- + * Convenience function to recreate the current entry (whose header + * has just been read) on disk. + * + * This does quite a bit more than just copy data to disk. It also: + * - Creates intermediate directories as required. + * - Manages directory permissions: non-writable directories will + * be initially created with write permission enabled; when the + * archive is closed, dir permissions are edited to the values specified + * in the archive. + * - Checks hardlinks: hardlinks will not be extracted unless the + * linked-to file was also extracted within the same session. (TODO) + */ + +/* The "flags" argument selects optional behavior, 'OR' the flags you want. */ + +/* Default: Do not try to set owner/group. */ +#define ARCHIVE_EXTRACT_OWNER (0x0001) +/* Default: Do obey umask, do not restore SUID/SGID/SVTX bits. */ +#define ARCHIVE_EXTRACT_PERM (0x0002) +/* Default: Do not restore mtime/atime. */ +#define ARCHIVE_EXTRACT_TIME (0x0004) +/* Default: Replace existing files. */ +#define ARCHIVE_EXTRACT_NO_OVERWRITE (0x0008) +/* Default: Try create first, unlink only if create fails with EEXIST. */ +#define ARCHIVE_EXTRACT_UNLINK (0x0010) +/* Default: Do not restore ACLs. */ +#define ARCHIVE_EXTRACT_ACL (0x0020) +/* Default: Do not restore fflags. */ +#define ARCHIVE_EXTRACT_FFLAGS (0x0040) +/* Default: Do not restore xattrs. */ +#define ARCHIVE_EXTRACT_XATTR (0x0080) +/* Default: Do not try to guard against extracts redirected by symlinks. */ +/* Note: With ARCHIVE_EXTRACT_UNLINK, will remove any intermediate symlink. */ +#define ARCHIVE_EXTRACT_SECURE_SYMLINKS (0x0100) +/* Default: Do not reject entries with '..' as path elements. */ +#define ARCHIVE_EXTRACT_SECURE_NODOTDOT (0x0200) +/* Default: Create parent directories as needed. */ +#define ARCHIVE_EXTRACT_NO_AUTODIR (0x0400) +/* Default: Overwrite files, even if one on disk is newer. */ +#define ARCHIVE_EXTRACT_NO_OVERWRITE_NEWER (0x0800) +/* Detect blocks of 0 and write holes instead. */ +#define ARCHIVE_EXTRACT_SPARSE (0x1000) +/* Default: Do not restore Mac extended metadata. */ +/* This has no effect except on Mac OS. */ +#define ARCHIVE_EXTRACT_MAC_METADATA (0x2000) +/* Default: Use HFS+ compression if it was compressed. */ +/* This has no effect except on Mac OS v10.6 or later. */ +#define ARCHIVE_EXTRACT_NO_HFS_COMPRESSION (0x4000) +/* Default: Do not use HFS+ compression if it was not compressed. */ +/* This has no effect except on Mac OS v10.6 or later. */ +#define ARCHIVE_EXTRACT_HFS_COMPRESSION_FORCED (0x8000) +/* Default: Do not reject entries with absolute paths */ +#define ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS (0x10000) +/* Default: Do not clear no-change flags when unlinking object */ +#define ARCHIVE_EXTRACT_CLEAR_NOCHANGE_FFLAGS (0x20000) +/* Default: Do not extract atomically (using rename) */ +#define ARCHIVE_EXTRACT_SAFE_WRITES (0x40000) + +__LA_DECL int archive_read_extract(struct archive *, struct archive_entry *, + int flags); +__LA_DECL int archive_read_extract2(struct archive *, struct archive_entry *, + struct archive * /* dest */); +__LA_DECL void archive_read_extract_set_progress_callback(struct archive *, + void (*_progress_func)(void *), void *_user_data); + +/* Record the dev/ino of a file that will not be written. This is + * generally set to the dev/ino of the archive being read. */ +__LA_DECL void archive_read_extract_set_skip_file(struct archive *, + la_int64_t, la_int64_t); + +/* Close the file and release most resources. */ +__LA_DECL int archive_read_close(struct archive *); +/* Release all resources and destroy the object. */ +/* Note that archive_read_free will call archive_read_close for you. */ +__LA_DECL int archive_read_free(struct archive *); +#if ARCHIVE_VERSION_NUMBER < 4000000 +/* Synonym for archive_read_free() for backwards compatibility. */ +__LA_DECL int archive_read_finish(struct archive *) __LA_DEPRECATED; +#endif + +/*- + * To create an archive: + * 1) Ask archive_write_new for an archive writer object. + * 2) Set any global properties. In particular, you should set + * the compression and format to use. + * 3) Call archive_write_open to open the file (most people + * will use archive_write_open_file or archive_write_open_fd, + * which provide convenient canned I/O callbacks for you). + * 4) For each entry: + * - construct an appropriate struct archive_entry structure + * - archive_write_header to write the header + * - archive_write_data to write the entry data + * 5) archive_write_close to close the output + * 6) archive_write_free to cleanup the writer and release resources + */ +__LA_DECL struct archive *archive_write_new(void); +__LA_DECL int archive_write_set_bytes_per_block(struct archive *, + int bytes_per_block); +__LA_DECL int archive_write_get_bytes_per_block(struct archive *); +/* XXX This is badly misnamed; suggestions appreciated. XXX */ +__LA_DECL int archive_write_set_bytes_in_last_block(struct archive *, + int bytes_in_last_block); +__LA_DECL int archive_write_get_bytes_in_last_block(struct archive *); + +/* The dev/ino of a file that won't be archived. This is used + * to avoid recursively adding an archive to itself. */ +__LA_DECL int archive_write_set_skip_file(struct archive *, + la_int64_t, la_int64_t); + +#if ARCHIVE_VERSION_NUMBER < 4000000 +__LA_DECL int archive_write_set_compression_bzip2(struct archive *) + __LA_DEPRECATED; +__LA_DECL int archive_write_set_compression_compress(struct archive *) + __LA_DEPRECATED; +__LA_DECL int archive_write_set_compression_gzip(struct archive *) + __LA_DEPRECATED; +__LA_DECL int archive_write_set_compression_lzip(struct archive *) + __LA_DEPRECATED; +__LA_DECL int archive_write_set_compression_lzma(struct archive *) + __LA_DEPRECATED; +__LA_DECL int archive_write_set_compression_none(struct archive *) + __LA_DEPRECATED; +__LA_DECL int archive_write_set_compression_program(struct archive *, + const char *cmd) __LA_DEPRECATED; +__LA_DECL int archive_write_set_compression_xz(struct archive *) + __LA_DEPRECATED; +#endif + +/* A convenience function to set the filter based on the code. */ +__LA_DECL int archive_write_add_filter(struct archive *, int filter_code); +__LA_DECL int archive_write_add_filter_by_name(struct archive *, + const char *name); +__LA_DECL int archive_write_add_filter_b64encode(struct archive *); +__LA_DECL int archive_write_add_filter_bzip2(struct archive *); +__LA_DECL int archive_write_add_filter_compress(struct archive *); +__LA_DECL int archive_write_add_filter_grzip(struct archive *); +__LA_DECL int archive_write_add_filter_gzip(struct archive *); +__LA_DECL int archive_write_add_filter_lrzip(struct archive *); +__LA_DECL int archive_write_add_filter_lz4(struct archive *); +__LA_DECL int archive_write_add_filter_lzip(struct archive *); +__LA_DECL int archive_write_add_filter_lzma(struct archive *); +__LA_DECL int archive_write_add_filter_lzop(struct archive *); +__LA_DECL int archive_write_add_filter_none(struct archive *); +__LA_DECL int archive_write_add_filter_program(struct archive *, + const char *cmd); +__LA_DECL int archive_write_add_filter_uuencode(struct archive *); +__LA_DECL int archive_write_add_filter_xz(struct archive *); +__LA_DECL int archive_write_add_filter_zstd(struct archive *); + + +/* A convenience function to set the format based on the code or name. */ +__LA_DECL int archive_write_set_format(struct archive *, int format_code); +__LA_DECL int archive_write_set_format_by_name(struct archive *, + const char *name); +/* To minimize link pollution, use one or more of the following. */ +__LA_DECL int archive_write_set_format_7zip(struct archive *); +__LA_DECL int archive_write_set_format_ar_bsd(struct archive *); +__LA_DECL int archive_write_set_format_ar_svr4(struct archive *); +__LA_DECL int archive_write_set_format_cpio(struct archive *); +__LA_DECL int archive_write_set_format_cpio_newc(struct archive *); +__LA_DECL int archive_write_set_format_gnutar(struct archive *); +__LA_DECL int archive_write_set_format_iso9660(struct archive *); +__LA_DECL int archive_write_set_format_mtree(struct archive *); +__LA_DECL int archive_write_set_format_mtree_classic(struct archive *); +/* TODO: int archive_write_set_format_old_tar(struct archive *); */ +__LA_DECL int archive_write_set_format_pax(struct archive *); +__LA_DECL int archive_write_set_format_pax_restricted(struct archive *); +__LA_DECL int archive_write_set_format_raw(struct archive *); +__LA_DECL int archive_write_set_format_shar(struct archive *); +__LA_DECL int archive_write_set_format_shar_dump(struct archive *); +__LA_DECL int archive_write_set_format_ustar(struct archive *); +__LA_DECL int archive_write_set_format_v7tar(struct archive *); +__LA_DECL int archive_write_set_format_warc(struct archive *); +__LA_DECL int archive_write_set_format_xar(struct archive *); +__LA_DECL int archive_write_set_format_zip(struct archive *); +__LA_DECL int archive_write_set_format_filter_by_ext(struct archive *a, const char *filename); +__LA_DECL int archive_write_set_format_filter_by_ext_def(struct archive *a, const char *filename, const char * def_ext); +__LA_DECL int archive_write_zip_set_compression_deflate(struct archive *); +__LA_DECL int archive_write_zip_set_compression_store(struct archive *); +/* Deprecated; use archive_write_open2 instead */ +__LA_DECL int archive_write_open(struct archive *, void *, + archive_open_callback *, archive_write_callback *, + archive_close_callback *); +__LA_DECL int archive_write_open2(struct archive *, void *, + archive_open_callback *, archive_write_callback *, + archive_close_callback *, archive_free_callback *); +__LA_DECL int archive_write_open_fd(struct archive *, int _fd); +__LA_DECL int archive_write_open_filename(struct archive *, const char *_file); +__LA_DECL int archive_write_open_filename_w(struct archive *, + const wchar_t *_file); +/* A deprecated synonym for archive_write_open_filename() */ +__LA_DECL int archive_write_open_file(struct archive *, const char *_file) + __LA_DEPRECATED; +__LA_DECL int archive_write_open_FILE(struct archive *, FILE *); +/* _buffSize is the size of the buffer, _used refers to a variable that + * will be updated after each write into the buffer. */ +__LA_DECL int archive_write_open_memory(struct archive *, + void *_buffer, size_t _buffSize, size_t *_used); + +/* + * Note that the library will truncate writes beyond the size provided + * to archive_write_header or pad if the provided data is short. + */ +__LA_DECL int archive_write_header(struct archive *, + struct archive_entry *); +__LA_DECL la_ssize_t archive_write_data(struct archive *, + const void *, size_t); + +/* This interface is currently only available for archive_write_disk handles. */ +__LA_DECL la_ssize_t archive_write_data_block(struct archive *, + const void *, size_t, la_int64_t); + +__LA_DECL int archive_write_finish_entry(struct archive *); +__LA_DECL int archive_write_close(struct archive *); +/* Marks the archive as FATAL so that a subsequent free() operation + * won't try to close() cleanly. Provides a fast abort capability + * when the client discovers that things have gone wrong. */ +__LA_DECL int archive_write_fail(struct archive *); +/* This can fail if the archive wasn't already closed, in which case + * archive_write_free() will implicitly call archive_write_close(). */ +__LA_DECL int archive_write_free(struct archive *); +#if ARCHIVE_VERSION_NUMBER < 4000000 +/* Synonym for archive_write_free() for backwards compatibility. */ +__LA_DECL int archive_write_finish(struct archive *) __LA_DEPRECATED; +#endif + +/* + * Set write options. + */ +/* Apply option to the format only. */ +__LA_DECL int archive_write_set_format_option(struct archive *_a, + const char *m, const char *o, + const char *v); +/* Apply option to the filter only. */ +__LA_DECL int archive_write_set_filter_option(struct archive *_a, + const char *m, const char *o, + const char *v); +/* Apply option to both the format and the filter. */ +__LA_DECL int archive_write_set_option(struct archive *_a, + const char *m, const char *o, + const char *v); +/* Apply option string to both the format and the filter. */ +__LA_DECL int archive_write_set_options(struct archive *_a, + const char *opts); + +/* + * Set a encryption passphrase. + */ +__LA_DECL int archive_write_set_passphrase(struct archive *_a, const char *p); +__LA_DECL int archive_write_set_passphrase_callback(struct archive *, + void *client_data, archive_passphrase_callback *); + +/*- + * ARCHIVE_WRITE_DISK API + * + * To create objects on disk: + * 1) Ask archive_write_disk_new for a new archive_write_disk object. + * 2) Set any global properties. In particular, you probably + * want to set the options. + * 3) For each entry: + * - construct an appropriate struct archive_entry structure + * - archive_write_header to create the file/dir/etc on disk + * - archive_write_data to write the entry data + * 4) archive_write_free to cleanup the writer and release resources + * + * In particular, you can use this in conjunction with archive_read() + * to pull entries out of an archive and create them on disk. + */ +__LA_DECL struct archive *archive_write_disk_new(void); +/* This file will not be overwritten. */ +__LA_DECL int archive_write_disk_set_skip_file(struct archive *, + la_int64_t, la_int64_t); +/* Set flags to control how the next item gets created. + * This accepts a bitmask of ARCHIVE_EXTRACT_XXX flags defined above. */ +__LA_DECL int archive_write_disk_set_options(struct archive *, + int flags); +/* + * The lookup functions are given uname/uid (or gname/gid) pairs and + * return a uid (gid) suitable for this system. These are used for + * restoring ownership and for setting ACLs. The default functions + * are naive, they just return the uid/gid. These are small, so reasonable + * for applications that don't need to preserve ownership; they + * are probably also appropriate for applications that are doing + * same-system backup and restore. + */ +/* + * The "standard" lookup functions use common system calls to lookup + * the uname/gname, falling back to the uid/gid if the names can't be + * found. They cache lookups and are reasonably fast, but can be very + * large, so they are not used unless you ask for them. In + * particular, these match the specifications of POSIX "pax" and old + * POSIX "tar". + */ +__LA_DECL int archive_write_disk_set_standard_lookup(struct archive *); +/* + * If neither the default (naive) nor the standard (big) functions suit + * your needs, you can write your own and register them. Be sure to + * include a cleanup function if you have allocated private data. + */ +__LA_DECL int archive_write_disk_set_group_lookup(struct archive *, + void * /* private_data */, + la_int64_t (*)(void *, const char *, la_int64_t), + void (* /* cleanup */)(void *)); +__LA_DECL int archive_write_disk_set_user_lookup(struct archive *, + void * /* private_data */, + la_int64_t (*)(void *, const char *, la_int64_t), + void (* /* cleanup */)(void *)); +__LA_DECL la_int64_t archive_write_disk_gid(struct archive *, const char *, la_int64_t); +__LA_DECL la_int64_t archive_write_disk_uid(struct archive *, const char *, la_int64_t); + +/* + * ARCHIVE_READ_DISK API + * + * This is still evolving and somewhat experimental. + */ +__LA_DECL struct archive *archive_read_disk_new(void); *** 973 LINES SKIPPED ***