From owner-svn-src-all@freebsd.org Sun Jul 14 02:46:27 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AFF4115D4AEE; Sun, 14 Jul 2019 02:46:27 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5385982E10; Sun, 14 Jul 2019 02:46:27 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2DB592EFC4; Sun, 14 Jul 2019 02:46:27 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6E2kQrv041072; Sun, 14 Jul 2019 02:46:26 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6E2kQd9041071; Sun, 14 Jul 2019 02:46:26 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201907140246.x6E2kQd9041071@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 14 Jul 2019 02:46:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349978 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 349978 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5385982E10 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.94)[-0.943,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jul 2019 02:46:27 -0000 Author: cy Date: Sun Jul 14 02:46:26 2019 New Revision: 349978 URL: https://svnweb.freebsd.org/changeset/base/349978 Log: style(9) MFC after: 3 days Modified: head/sys/contrib/ipfilter/netinet/fil.c Modified: head/sys/contrib/ipfilter/netinet/fil.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/fil.c Sat Jul 13 21:41:12 2019 (r349977) +++ head/sys/contrib/ipfilter/netinet/fil.c Sun Jul 14 02:46:26 2019 (r349978) @@ -4431,23 +4431,23 @@ static int ipf_rule_compare(frentry_t *fr1, frentry_t *fr2) { if (fr1->fr_cksum != fr2->fr_cksum) - return 1; + return (1); if (fr1->fr_size != fr2->fr_size) - return 2; + return (2); if (fr1->fr_dsize != fr2->fr_dsize) - return 3; + return (3); if (bcmp((char *)&fr1->fr_func, (char *)&fr2->fr_func, fr1->fr_size - offsetof(struct frentry, fr_func)) != 0) - return 4; + return (4); if (fr1->fr_data && !fr2->fr_data) - return 5; + return (5); if (!fr1->fr_data && fr2->fr_data) - return 6; + return (6); if (fr1->fr_data) { if (bcmp(fr1->fr_caddr, fr2->fr_caddr, fr1->fr_dsize)) - return 7; + return (7); } - return 0; + return (0); } From owner-svn-src-all@freebsd.org Sun Jul 14 02:46:32 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04B5715D4B12; Sun, 14 Jul 2019 02:46:32 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 92E9D82E29; Sun, 14 Jul 2019 02:46:31 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3BD3E2EFC5; Sun, 14 Jul 2019 02:46:31 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6E2kVxK041119; Sun, 14 Jul 2019 02:46:31 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6E2kUM8041117; Sun, 14 Jul 2019 02:46:30 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201907140246.x6E2kUM8041117@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 14 Jul 2019 02:46:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349979 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 349979 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 92E9D82E29 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.94)[-0.943,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jul 2019 02:46:32 -0000 Author: cy Date: Sun Jul 14 02:46:30 2019 New Revision: 349979 URL: https://svnweb.freebsd.org/changeset/base/349979 Log: Recycle the unused FR_CMPSIZ macro which became orphaned in ipfilter 5 prior to its import into FreeBSD. This macro calculates the size to be compared within the frentry structure. The ipfilter 4 version of the macro calculated the compare size based upon the static size of the frentry struct. Today it uses the ipfilter 5 method of calculating the size based upon the new to ipfilter 5 fr_size value found in the frentry struct itself. No effective change in code is intended. MFC after: 1 week Modified: head/sys/contrib/ipfilter/netinet/fil.c head/sys/contrib/ipfilter/netinet/ip_fil.h Modified: head/sys/contrib/ipfilter/netinet/fil.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/fil.c Sun Jul 14 02:46:26 2019 (r349978) +++ head/sys/contrib/ipfilter/netinet/fil.c Sun Jul 14 02:46:30 2019 (r349979) @@ -4436,8 +4436,8 @@ ipf_rule_compare(frentry_t *fr1, frentry_t *fr2) return (2); if (fr1->fr_dsize != fr2->fr_dsize) return (3); - if (bcmp((char *)&fr1->fr_func, (char *)&fr2->fr_func, - fr1->fr_size - offsetof(struct frentry, fr_func)) != 0) + if (bcmp((char *)&fr1->fr_func, (char *)&fr2->fr_func, FR_CMPSIZ(fr1)) + != 0) return (4); if (fr1->fr_data && !fr2->fr_data) return (5); Modified: head/sys/contrib/ipfilter/netinet/ip_fil.h ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_fil.h Sun Jul 14 02:46:26 2019 (r349978) +++ head/sys/contrib/ipfilter/netinet/ip_fil.h Sun Jul 14 02:46:30 2019 (r349979) @@ -827,7 +827,7 @@ typedef struct frentry { #define FR_NOLOGTAG 0 -#define FR_CMPSIZ (sizeof(struct frentry) - \ +#define FR_CMPSIZ(_f) ((_f)->fr_size - \ offsetof(struct frentry, fr_func)) #define FR_NAME(_f, _n) (_f)->fr_names + (_f)->_n From owner-svn-src-all@freebsd.org Sun Jul 14 02:46:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CB63C15D4B34; Sun, 14 Jul 2019 02:46:38 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6B63F82EF9; Sun, 14 Jul 2019 02:46:38 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AE89A2EFC6; Sun, 14 Jul 2019 02:46:34 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6E2kYvf041166; Sun, 14 Jul 2019 02:46:34 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6E2kYMU041165; Sun, 14 Jul 2019 02:46:34 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201907140246.x6E2kYMU041165@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 14 Jul 2019 02:46:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349980 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 349980 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6B63F82EF9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.94)[-0.943,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jul 2019 02:46:39 -0000 Author: cy Date: Sun Jul 14 02:46:34 2019 New Revision: 349980 URL: https://svnweb.freebsd.org/changeset/base/349980 Log: Calculate the offset of the interface name using FR_NAME rather than calclulating it "by hand". This improves consistency with the rest of the code and is in line with planned fixes and other work. MFC after: 1 week Modified: head/sys/contrib/ipfilter/netinet/ip_state.c Modified: head/sys/contrib/ipfilter/netinet/ip_state.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_state.c Sun Jul 14 02:46:30 2019 (r349979) +++ head/sys/contrib/ipfilter/netinet/ip_state.c Sun Jul 14 02:46:34 2019 (r349980) @@ -980,7 +980,7 @@ ipf_state_putent(softc, softs, data) fr->fr_ifas[i] = NULL; continue; } - name = fr->fr_names + fr->fr_ifnames[i]; + name = FR_NAME(fr, fr_ifnames[i]); fr->fr_ifas[i] = ipf_resolvenic(softc, name, fr->fr_family); } @@ -1794,7 +1794,7 @@ ipf_state_add(softc, fin, stsave, flags) fr->fr_names[fr->fr_ifnames[out << 1] + 1] == '\0')) { is->is_ifp[out << 1] = fr->fr_ifas[0]; strncpy(is->is_ifname[out << 1], - fr->fr_names + fr->fr_ifnames[0], + FR_NAME(fr, fr_ifnames[0]), sizeof(fr->fr_ifnames[0])); } else { is->is_ifp[out << 1] = fin->fin_ifp; @@ -1805,21 +1805,21 @@ ipf_state_add(softc, fin, stsave, flags) is->is_ifp[(out << 1) + 1] = fr->fr_ifas[1]; if (fr->fr_ifnames[1] != -1) { strncpy(is->is_ifname[(out << 1) + 1], - fr->fr_names + fr->fr_ifnames[1], + FR_NAME(fr, fr_ifnames[1]), sizeof(fr->fr_ifnames[1])); } is->is_ifp[(1 - out) << 1] = fr->fr_ifas[2]; if (fr->fr_ifnames[2] != -1) { strncpy(is->is_ifname[((1 - out) << 1)], - fr->fr_names + fr->fr_ifnames[2], + FR_NAME(fr, fr_ifnames[2]), sizeof(fr->fr_ifnames[2])); } is->is_ifp[((1 - out) << 1) + 1] = fr->fr_ifas[3]; if (fr->fr_ifnames[3] != -1) { strncpy(is->is_ifname[((1 - out) << 1) + 1], - fr->fr_names + fr->fr_ifnames[3], + FR_NAME(fr, fr_ifnames[3]), sizeof(fr->fr_ifnames[3])); } } else { From owner-svn-src-all@freebsd.org Sun Jul 14 03:49:49 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E6AC15D60B0; Sun, 14 Jul 2019 03:49:49 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E0CD18569F; Sun, 14 Jul 2019 03:49:48 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BA2F92FADE; Sun, 14 Jul 2019 03:49:48 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6E3nm2u078196; Sun, 14 Jul 2019 03:49:48 GMT (envelope-from chuck@FreeBSD.org) Received: (from chuck@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6E3nmIH078195; Sun, 14 Jul 2019 03:49:48 GMT (envelope-from chuck@FreeBSD.org) Message-Id: <201907140349.x6E3nmIH078195@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: chuck set sender to chuck@FreeBSD.org using -f From: Chuck Tuffli Date: Sun, 14 Jul 2019 03:49:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349981 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: chuck X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 349981 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E0CD18569F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.94)[-0.937,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jul 2019 03:49:49 -0000 Author: chuck Date: Sun Jul 14 03:49:48 2019 New Revision: 349981 URL: https://svnweb.freebsd.org/changeset/base/349981 Log: Fix a typo in r349969 OUI_FRREBSD_NVME_HIGH should have been OUI_FREEBSD_NVME_HIGH Caught by: Gary Jennejohn Modified: head/sys/net/ieee_oui.h Modified: head/sys/net/ieee_oui.h ============================================================================== --- head/sys/net/ieee_oui.h Sun Jul 14 02:46:34 2019 (r349980) +++ head/sys/net/ieee_oui.h Sun Jul 14 03:49:48 2019 (r349981) @@ -82,4 +82,4 @@ /* Allocate 16 bits for emulated NVMe devices */ #define OUI_FREEBSD_NVME_MASK 0x20ffff #define OUI_FREEBSD_NVME_LOW OUI_FREEBSD(0x200000) -#define OUI_FRREBSD_NVME_HIGH OUI_FREEBSD(OUI_FREEBSD_NVME_MASK) +#define OUI_FREEBSD_NVME_HIGH OUI_FREEBSD(OUI_FREEBSD_NVME_MASK) From owner-svn-src-all@freebsd.org Sun Jul 14 05:39:03 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A8F8615D8EFF; Sun, 14 Jul 2019 05:39:03 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F62F8959C; Sun, 14 Jul 2019 05:39:03 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 23784E52; Sun, 14 Jul 2019 05:39:03 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6E5d2MK043318; Sun, 14 Jul 2019 05:39:02 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6E5d2Vt043317; Sun, 14 Jul 2019 05:39:02 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201907140539.x6E5d2Vt043317@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 14 Jul 2019 05:39:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r349982 - stable/12/lib/libthr/thread X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/lib/libthr/thread X-SVN-Commit-Revision: 349982 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4F62F8959C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.93)[-0.926,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jul 2019 05:39:03 -0000 Author: kib Date: Sun Jul 14 05:39:02 2019 New Revision: 349982 URL: https://svnweb.freebsd.org/changeset/base/349982 Log: MFC r349912: Restore ability to pass NULL name argument to pthread_set_name_np(3) to clear the thread name. PR: 239142 Modified: stable/12/lib/libthr/thread/thr_info.c Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libthr/thread/thr_info.c ============================================================================== --- stable/12/lib/libthr/thread/thr_info.c Sun Jul 14 03:49:48 2019 (r349981) +++ stable/12/lib/libthr/thread/thr_info.c Sun Jul 14 05:39:02 2019 (r349982) @@ -52,7 +52,7 @@ thr_set_name_np(struct pthread *thread, const char *na { free(thread->name); - thread->name = strdup(name); + thread->name = name != NULL ? strdup(name) : NULL; } /* Set the thread name for debug. */ From owner-svn-src-all@freebsd.org Sun Jul 14 05:40:04 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C4F2115D8F9B; Sun, 14 Jul 2019 05:40:04 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 67082896F6; Sun, 14 Jul 2019 05:40:04 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 41F9DE5B; Sun, 14 Jul 2019 05:40:04 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6E5e43Y043462; Sun, 14 Jul 2019 05:40:04 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6E5e4E8043461; Sun, 14 Jul 2019 05:40:04 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201907140540.x6E5e4E8043461@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 14 Jul 2019 05:40:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r349983 - stable/12/sys/x86/x86 X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/x86/x86 X-SVN-Commit-Revision: 349983 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 67082896F6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.93)[-0.926,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jul 2019 05:40:05 -0000 Author: kib Date: Sun Jul 14 05:40:03 2019 New Revision: 349983 URL: https://svnweb.freebsd.org/changeset/base/349983 Log: MFC r349913: Ensure that mds_handler always points to a valid method. Modified: stable/12/sys/x86/x86/cpu_machdep.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/x86/x86/cpu_machdep.c ============================================================================== --- stable/12/sys/x86/x86/cpu_machdep.c Sun Jul 14 05:39:02 2019 (r349982) +++ stable/12/sys/x86/x86/cpu_machdep.c Sun Jul 14 05:40:03 2019 (r349983) @@ -924,7 +924,6 @@ int hw_mds_disable; * architectural state except possibly %rflags. Also, it is always * called with interrupts disabled. */ -void (*mds_handler)(void); void mds_handler_void(void); void mds_handler_verw(void); void mds_handler_ivb(void); @@ -933,6 +932,7 @@ void mds_handler_skl_sse(void); void mds_handler_skl_avx(void); void mds_handler_skl_avx512(void); void mds_handler_silvermont(void); +void (*mds_handler)(void) = mds_handler_void; static int sysctl_hw_mds_disable_state_handler(SYSCTL_HANDLER_ARGS) From owner-svn-src-all@freebsd.org Sun Jul 14 05:41:15 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67F3515D919F; Sun, 14 Jul 2019 05:41:15 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0941B898EE; Sun, 14 Jul 2019 05:41:15 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D8176E90; Sun, 14 Jul 2019 05:41:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6E5fEeC044282; Sun, 14 Jul 2019 05:41:14 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6E5fELD044281; Sun, 14 Jul 2019 05:41:14 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201907140541.x6E5fELD044281@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 14 Jul 2019 05:41:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r349984 - stable/11/lib/libthr/thread X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/lib/libthr/thread X-SVN-Commit-Revision: 349984 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0941B898EE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.93)[-0.926,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jul 2019 05:41:15 -0000 Author: kib Date: Sun Jul 14 05:41:14 2019 New Revision: 349984 URL: https://svnweb.freebsd.org/changeset/base/349984 Log: MFC r349912: Restore ability to pass NULL name argument to pthread_set_name_np(3) to clear the thread name. PR: 239142 Modified: stable/11/lib/libthr/thread/thr_info.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libthr/thread/thr_info.c ============================================================================== --- stable/11/lib/libthr/thread/thr_info.c Sun Jul 14 05:40:03 2019 (r349983) +++ stable/11/lib/libthr/thread/thr_info.c Sun Jul 14 05:41:14 2019 (r349984) @@ -50,7 +50,7 @@ thr_set_name_np(struct pthread *thread, const char *na { free(thread->name); - thread->name = strdup(name); + thread->name = name != NULL ? strdup(name) : NULL; } /* Set the thread name for debug. */ From owner-svn-src-all@freebsd.org Sun Jul 14 05:41:44 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C53115D921D; Sun, 14 Jul 2019 05:41:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E7DD589BA8; Sun, 14 Jul 2019 05:41:43 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C2E75EC5; Sun, 14 Jul 2019 05:41:43 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6E5fh3v047414; Sun, 14 Jul 2019 05:41:43 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6E5fhqY047413; Sun, 14 Jul 2019 05:41:43 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201907140541.x6E5fhqY047413@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 14 Jul 2019 05:41:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r349985 - stable/11/sys/x86/x86 X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/x86/x86 X-SVN-Commit-Revision: 349985 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E7DD589BA8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.93)[-0.926,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jul 2019 05:41:44 -0000 Author: kib Date: Sun Jul 14 05:41:43 2019 New Revision: 349985 URL: https://svnweb.freebsd.org/changeset/base/349985 Log: MFC r349913: Ensure that mds_handler always points to a valid method. Modified: stable/11/sys/x86/x86/cpu_machdep.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/x86/x86/cpu_machdep.c ============================================================================== --- stable/11/sys/x86/x86/cpu_machdep.c Sun Jul 14 05:41:14 2019 (r349984) +++ stable/11/sys/x86/x86/cpu_machdep.c Sun Jul 14 05:41:43 2019 (r349985) @@ -953,7 +953,6 @@ int hw_mds_disable; * architectural state except possibly %rflags. Also, it is always * called with interrupts disabled. */ -void (*mds_handler)(void); void mds_handler_void(void); void mds_handler_verw(void); void mds_handler_ivb(void); @@ -962,6 +961,7 @@ void mds_handler_skl_sse(void); void mds_handler_skl_avx(void); void mds_handler_skl_avx512(void); void mds_handler_silvermont(void); +void (*mds_handler)(void) = mds_handler_void; static int sysctl_hw_mds_disable_state_handler(SYSCTL_HANDLER_ARGS) From owner-svn-src-all@freebsd.org Sun Jul 14 12:04:42 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D241615E0EA6; Sun, 14 Jul 2019 12:04:41 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 713A26E88E; Sun, 14 Jul 2019 12:04:41 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4A51C553F; Sun, 14 Jul 2019 12:04:41 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6EC4flp072103; Sun, 14 Jul 2019 12:04:41 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6EC4ddc072095; Sun, 14 Jul 2019 12:04:39 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201907141204.x6EC4ddc072095@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 14 Jul 2019 12:04:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349986 - in head/sys: netinet netinet6 X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: in head/sys: netinet netinet6 X-SVN-Commit-Revision: 349986 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 713A26E88E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.93)[-0.933,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jul 2019 12:04:42 -0000 Author: tuexen Date: Sun Jul 14 12:04:39 2019 New Revision: 349986 URL: https://svnweb.freebsd.org/changeset/base/349986 Log: When calling sctp_initialize_auth_params(), the inp must have at least a read lock. To avoid more complex locking dances, just call it in sctp_aloc_assoc() when the write lock is still held. Reported by: syzbot+08a486f7e6966f1c3cfb@syzkaller.appspotmail.com MFC after: 1 week Modified: head/sys/netinet/sctp_input.c head/sys/netinet/sctp_output.c head/sys/netinet/sctp_pcb.c head/sys/netinet/sctp_pcb.h head/sys/netinet/sctp_usrreq.c head/sys/netinet6/sctp6_usrreq.c Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Sun Jul 14 05:41:43 2019 (r349985) +++ head/sys/netinet/sctp_input.c Sun Jul 14 12:04:39 2019 (r349986) @@ -2155,8 +2155,8 @@ sctp_process_cookie_new(struct mbuf *m, int iphlen, in ntohl(initack_cp->init.initiate_tag), vrf_id, ntohs(initack_cp->init.num_outbound_streams), port, - (struct thread *)NULL - ); + (struct thread *)NULL, + SCTP_DONT_INITIALIZE_AUTH_PARAMS); if (stcb == NULL) { struct mbuf *op_err; Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Sun Jul 14 05:41:43 2019 (r349985) +++ head/sys/netinet/sctp_output.c Sun Jul 14 12:04:39 2019 (r349986) @@ -12769,7 +12769,8 @@ sctp_lower_sosend(struct socket *so, stcb = sctp_aloc_assoc(inp, addr, &error, 0, vrf_id, inp->sctp_ep.pre_open_stream_count, inp->sctp_ep.port, - p); + p, + SCTP_INITIALIZE_AUTH_PARAMS); if (stcb == NULL) { /* Error is setup for us in the call */ goto out_unlocked; @@ -12797,9 +12798,6 @@ sctp_lower_sosend(struct socket *so, asoc = &stcb->asoc; SCTP_SET_STATE(stcb, SCTP_STATE_COOKIE_WAIT); (void)SCTP_GETTIME_TIMEVAL(&asoc->time_entered); - - /* initialize authentication params for the assoc */ - sctp_initialize_auth_params(inp, stcb); if (control) { if (sctp_process_cmsgs_for_init(stcb, control, &error)) { Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Sun Jul 14 05:41:43 2019 (r349985) +++ head/sys/netinet/sctp_pcb.c Sun Jul 14 12:04:39 2019 (r349986) @@ -4190,8 +4190,8 @@ struct sctp_tcb * sctp_aloc_assoc(struct sctp_inpcb *inp, struct sockaddr *firstaddr, int *error, uint32_t override_tag, uint32_t vrf_id, uint16_t o_streams, uint16_t port, - struct thread *p -) + struct thread *p, + int initialize_auth_params) { /* note the p argument is only valid in unbound sockets */ @@ -4420,6 +4420,9 @@ sctp_aloc_assoc(struct sctp_inpcb *inp, struct sockadd head = &inp->sctp_tcbhash[SCTP_PCBHASH_ALLADDR(stcb->rport, inp->sctp_hashmark)]; LIST_INSERT_HEAD(head, stcb, sctp_tcbhash); + } + if (initialize_auth_params == SCTP_INITIALIZE_AUTH_PARAMS) { + sctp_initialize_auth_params(inp, stcb); } SCTP_INP_WUNLOCK(inp); SCTPDBG(SCTP_DEBUG_PCB1, "Association %p now allocated\n", (void *)stcb); Modified: head/sys/netinet/sctp_pcb.h ============================================================================== --- head/sys/netinet/sctp_pcb.h Sun Jul 14 05:41:43 2019 (r349985) +++ head/sys/netinet/sctp_pcb.h Sun Jul 14 12:04:39 2019 (r349986) @@ -578,9 +578,13 @@ int sctp_is_address_on_local_host(struct sockaddr *add void sctp_inpcb_free(struct sctp_inpcb *, int, int); +#define SCTP_DONT_INITIALIZE_AUTH_PARAMS 0 +#define SCTP_INITIALIZE_AUTH_PARAMS 1 + struct sctp_tcb * sctp_aloc_assoc(struct sctp_inpcb *, struct sockaddr *, - int *, uint32_t, uint32_t, uint16_t, uint16_t, struct thread *); + int *, uint32_t, uint32_t, uint16_t, uint16_t, struct thread *, + int); int sctp_free_assoc(struct sctp_inpcb *, struct sctp_tcb *, int, int); Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Sun Jul 14 05:41:43 2019 (r349985) +++ head/sys/netinet/sctp_usrreq.c Sun Jul 14 12:04:39 2019 (r349986) @@ -1443,8 +1443,8 @@ sctp_do_connect_x(struct socket *so, struct sctp_inpcb stcb = sctp_aloc_assoc(inp, sa, &error, 0, vrf_id, inp->sctp_ep.pre_open_stream_count, inp->sctp_ep.port, - (struct thread *)p - ); + (struct thread *)p, + SCTP_INITIALIZE_AUTH_PARAMS); if (stcb == NULL) { /* Gak! no memory */ goto out_now; @@ -1480,9 +1480,6 @@ sctp_do_connect_x(struct socket *so, struct sctp_inpcb a_id = (sctp_assoc_t *)optval; *a_id = sctp_get_associd(stcb); - /* initialize authentication parameters for the assoc */ - sctp_initialize_auth_params(inp, stcb); - if (delay) { /* doing delayed connection */ stcb->asoc.delayed_connection = 1; @@ -7025,7 +7022,8 @@ sctp_connect(struct socket *so, struct sockaddr *addr, /* We are GOOD to go */ stcb = sctp_aloc_assoc(inp, addr, &error, 0, vrf_id, inp->sctp_ep.pre_open_stream_count, - inp->sctp_ep.port, p); + inp->sctp_ep.port, p, + SCTP_INITIALIZE_AUTH_PARAMS); if (stcb == NULL) { /* Gak! no memory */ goto out_now; @@ -7037,9 +7035,6 @@ sctp_connect(struct socket *so, struct sockaddr *addr, } SCTP_SET_STATE(stcb, SCTP_STATE_COOKIE_WAIT); (void)SCTP_GETTIME_TIMEVAL(&stcb->asoc.time_entered); - - /* initialize authentication parameters for the assoc */ - sctp_initialize_auth_params(inp, stcb); sctp_send_initiate(inp, stcb, SCTP_SO_LOCKED); SCTP_TCB_UNLOCK(stcb); Modified: head/sys/netinet6/sctp6_usrreq.c ============================================================================== --- head/sys/netinet6/sctp6_usrreq.c Sun Jul 14 05:41:43 2019 (r349985) +++ head/sys/netinet6/sctp6_usrreq.c Sun Jul 14 12:04:39 2019 (r349986) @@ -908,7 +908,8 @@ sctp6_connect(struct socket *so, struct sockaddr *addr /* We are GOOD to go */ stcb = sctp_aloc_assoc(inp, addr, &error, 0, vrf_id, inp->sctp_ep.pre_open_stream_count, - inp->sctp_ep.port, p); + inp->sctp_ep.port, p, + SCTP_INITIALIZE_AUTH_PARAMS); SCTP_ASOC_CREATE_UNLOCK(inp); if (stcb == NULL) { /* Gak! no memory */ @@ -921,10 +922,6 @@ sctp6_connect(struct socket *so, struct sockaddr *addr } SCTP_SET_STATE(stcb, SCTP_STATE_COOKIE_WAIT); (void)SCTP_GETTIME_TIMEVAL(&stcb->asoc.time_entered); - - /* initialize authentication parameters for the assoc */ - sctp_initialize_auth_params(inp, stcb); - sctp_send_initiate(inp, stcb, SCTP_SO_LOCKED); SCTP_TCB_UNLOCK(stcb); return (error); From owner-svn-src-all@freebsd.org Sun Jul 14 16:05:49 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47D0915E5546; Sun, 14 Jul 2019 16:05:49 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0FDDA75F8E; Sun, 14 Jul 2019 16:05:49 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C46F27EFB; Sun, 14 Jul 2019 16:05:48 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6EG5mPu013744; Sun, 14 Jul 2019 16:05:48 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6EG5mGN013740; Sun, 14 Jul 2019 16:05:48 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <201907141605.x6EG5mGN013740@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Sun, 14 Jul 2019 16:05:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349987 - in head/sys/netinet: . tcp_stacks X-SVN-Group: head X-SVN-Commit-Author: rrs X-SVN-Commit-Paths: in head/sys/netinet: . tcp_stacks X-SVN-Commit-Revision: 349987 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0FDDA75F8E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jul 2019 16:05:49 -0000 Author: rrs Date: Sun Jul 14 16:05:47 2019 New Revision: 349987 URL: https://svnweb.freebsd.org/changeset/base/349987 Log: This is the second in a number of patches needed to get BBRv1 into the tree. This fixes the DSACK bug but is also needed by BBR. We have yet to go two more one will be for the pacing code (tcp_ratelimit.c) and the second will be for the new updated LRO code that allows a transport to know the arrival times of packets and (tcp_lro.c). After that we should finally be able to get BBRv1 into head. Sponsored by: Netflix Inc Differential Revision: https://reviews.freebsd.org/D20908 Modified: head/sys/netinet/tcp_output.c head/sys/netinet/tcp_sack.c head/sys/netinet/tcp_stacks/rack.c head/sys/netinet/tcp_var.h Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Sun Jul 14 12:04:39 2019 (r349986) +++ head/sys/netinet/tcp_output.c Sun Jul 14 16:05:47 2019 (r349987) @@ -1508,7 +1508,13 @@ timer: if (SEQ_GT(tp->snd_nxt + xlen, tp->snd_max)) tp->snd_max = tp->snd_nxt + xlen; } - + if ((error == 0) && + (TCPS_HAVEESTABLISHED(tp->t_state) && + (tp->t_flags & TF_SACK_PERMIT) && + tp->rcv_numsacks > 0)) { + /* Clean up any DSACK's sent */ + tcp_clean_dsack_blocks(tp); + } if (error) { /* Record the error. */ TCP_LOG_EVENT(tp, NULL, &so->so_rcv, &so->so_snd, TCP_LOG_OUT, Modified: head/sys/netinet/tcp_sack.c ============================================================================== --- head/sys/netinet/tcp_sack.c Sun Jul 14 12:04:39 2019 (r349986) +++ head/sys/netinet/tcp_sack.c Sun Jul 14 16:05:47 2019 (r349987) @@ -279,6 +279,45 @@ tcp_update_sack_list(struct tcpcb *tp, tcp_seq rcv_sta tp->rcv_numsacks = num_head + num_saved; } +void +tcp_clean_dsack_blocks(struct tcpcb *tp) +{ + struct sackblk saved_blks[MAX_SACK_BLKS]; + int num_saved, i; + + INP_WLOCK_ASSERT(tp->t_inpcb); + /* + * Clean up any DSACK blocks that + * are in our queue of sack blocks. + * + */ + num_saved = 0; + for (i = 0; i < tp->rcv_numsacks; i++) { + tcp_seq start = tp->sackblks[i].start; + tcp_seq end = tp->sackblks[i].end; + if (SEQ_GEQ(start, end) || SEQ_LEQ(start, tp->rcv_nxt)) { + /* + * Discard this D-SACK block. + */ + continue; + } + /* + * Save this SACK block. + */ + saved_blks[num_saved].start = start; + saved_blks[num_saved].end = end; + num_saved++; + } + if (num_saved > 0) { + /* + * Copy the saved SACK blocks back. + */ + bcopy(saved_blks, &tp->sackblks[0], + sizeof(struct sackblk) * num_saved); + } + tp->rcv_numsacks = num_saved; +} + /* * Delete all receiver-side SACK information. */ Modified: head/sys/netinet/tcp_stacks/rack.c ============================================================================== --- head/sys/netinet/tcp_stacks/rack.c Sun Jul 14 12:04:39 2019 (r349986) +++ head/sys/netinet/tcp_stacks/rack.c Sun Jul 14 16:05:47 2019 (r349987) @@ -5087,9 +5087,8 @@ rack_do_fastnewdata(struct mbuf *m, struct tcphdr *th, /* Clean receiver SACK report if present */ -/* if (tp->rcv_numsacks) + if (tp->rcv_numsacks) tcp_clean_sackreport(tp); -*/ TCPSTAT_INC(tcps_preddat); tp->rcv_nxt += tlen; /* @@ -8537,10 +8536,10 @@ out: * retransmit. In persist state, just set snd_max. */ if (error == 0) { -/* if (TCPS_HAVEESTABLISHED(tp->t_state) && + if (TCPS_HAVEESTABLISHED(tp->t_state) && (tp->t_flags & TF_SACK_PERMIT) && tp->rcv_numsacks > 0) - tcp_clean_dsack_blocks(tp);*/ + tcp_clean_dsack_blocks(tp); if (len == 0) counter_u64_add(rack_out_size[TCP_MSS_ACCT_SNDACK], 1); else if (len == 1) { Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Sun Jul 14 12:04:39 2019 (r349986) +++ head/sys/netinet/tcp_var.h Sun Jul 14 16:05:47 2019 (r349987) @@ -939,6 +939,7 @@ tcp_seq tcp_new_isn(struct in_conninfo *); int tcp_sack_doack(struct tcpcb *, struct tcpopt *, tcp_seq); void tcp_update_sack_list(struct tcpcb *tp, tcp_seq rcv_laststart, tcp_seq rcv_lastend); +void tcp_clean_dsack_blocks(struct tcpcb *tp); void tcp_clean_sackreport(struct tcpcb *tp); void tcp_sack_adjust(struct tcpcb *tp); struct sackhole *tcp_sack_output(struct tcpcb *tp, int *sack_bytes_rexmt); From owner-svn-src-all@freebsd.org Sun Jul 14 19:35:11 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E76DDA452F; Sun, 14 Jul 2019 19:35:11 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io1-f53.google.com (mail-io1-f53.google.com [209.85.166.53]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) 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 CB5D08928B; Sun, 14 Jul 2019 19:35:10 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io1-f53.google.com with SMTP id f4so30836517ioh.6; Sun, 14 Jul 2019 12:35:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=EjFy9Gek3zORXJzn5EEBIzdXhQgKks5qhpsFBJcGIRw=; b=QyHjvokgMN11NziVAB/EJSKWsROk0rhrwZqvwbkgcVC89nUob8CjmJtISnTY9RgJNP diIOizHSORwuOnpeB90Ct6LtOVqAUQcIu1bbk9yAfrRO/dwdCfF64JCJ92OwYywv35oT kFFXXo58NCNoF3B6gF+aZedySkyv8xGUm+XJf3CPXqPQTrn9P7cj7dYrgAXGAnMqBcKt 7E8/MExLzOFhxezavED2qVoxgTxRDqJEbLSGDW/eBqzbF5dGIDyOGCd3+w5fLub79DFC i0UzrqV4rsBr6n4IK1uhaUqgpF2KvNUe18YGmcIyTO5aPZ4japNwkwzAekxHjATC5/WO oz4g== X-Gm-Message-State: APjAAAXvH0Q0OUb5GxPXcHLfu/kE6jpFsONvWG7LqmevQM53dhi66XjS UENo6m2nEsQ2uLnSnf2KhTHqBmNA X-Google-Smtp-Source: APXvYqxPgq9ZdNbFO3JUvDQ6H/E0DgU0SfWI6aFyVBBxeMUTsQrjOJl3qMsrKKPUw0OeR07vAVMGZw== X-Received: by 2002:a6b:b497:: with SMTP id d145mr21649301iof.17.1563131330372; Sun, 14 Jul 2019 12:08:50 -0700 (PDT) Received: from mail-io1-f42.google.com (mail-io1-f42.google.com. [209.85.166.42]) by smtp.gmail.com with ESMTPSA id w23sm14094242ioa.51.2019.07.14.12.08.49 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Sun, 14 Jul 2019 12:08:49 -0700 (PDT) Received: by mail-io1-f42.google.com with SMTP id z3so30834568iog.0; Sun, 14 Jul 2019 12:08:49 -0700 (PDT) X-Received: by 2002:a5d:88c6:: with SMTP id i6mr22005932iol.107.1563131329372; Sun, 14 Jul 2019 12:08:49 -0700 (PDT) MIME-Version: 1.0 References: <201906251944.x5PJiNaA093352@repo.freebsd.org> In-Reply-To: <201906251944.x5PJiNaA093352@repo.freebsd.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Sun, 14 Jul 2019 12:08:38 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r349391 - head/sys/kern To: Alan Somers Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: CB5D08928B X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of csecem@gmail.com designates 209.85.166.53 as permitted sender) smtp.mailfrom=csecem@gmail.com X-Spamd-Result: default: False [-4.73 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[cem@freebsd.org]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; REPLYTO_ADDR_EQ_FROM(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; TO_DN_ALL(0.00)[]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.84)[-0.839,0]; FORGED_SENDER(0.30)[cem@freebsd.org,csecem@gmail.com]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[cem@freebsd.org,csecem@gmail.com]; TAGGED_FROM(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; MIME_TRACE(0.00)[0:+]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[freebsd.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; IP_SCORE(-1.89)[ip: (-3.47), ipnet: 209.85.128.0/17(-3.46), asn: 15169(-2.44), country: US(-0.06)]; RCVD_IN_DNSWL_NONE(0.00)[53.166.85.209.list.dnswl.org : 127.0.5.0]; RWL_MAILSPIKE_POSSIBLE(0.00)[53.166.85.209.rep.mailspike.net : 127.0.0.17] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jul 2019 19:35:12 -0000 Hi Alan, This change restores the possible overflow beyond IO_SEQMAX that the removed conditional prevented. On Tue, Jun 25, 2019 at 12:44 PM Alan Somers wrote: > > Author: asomers > Date: Tue Jun 25 19:44:22 2019 > New Revision: 349391 > URL: https://svnweb.freebsd.org/changeset/base/349391 > > --- head/sys/kern/vfs_vnops.c Tue Jun 25 19:36:01 2019 (r349390) > +++ head/sys/kern/vfs_vnops.c Tue Jun 25 19:44:22 2019 (r349391) > @@ -499,10 +499,8 @@ sequential_heuristic(struct uio *uio, struct file *fp) > * closely related to the best I/O size for real disks than > * to any block size used by software. > */ > - fp->f_seqcount += MIN(IO_SEQMAX, > + fp->f_seqcount += lmin(IO_SEQMAX, > howmany(uio->uio_resid, 16384)); > - if (fp->f_seqcount > IO_SEQMAX) > - fp->f_seqcount = IO_SEQMAX; > return (fp->f_seqcount << IO_SEQSHIFT); > } Perhaps instead this should be: fp->f_seqcount = lmin(IO_SEQMAX, fp->f_seqcount + howmany(...)); Best, Conrad From owner-svn-src-all@freebsd.org Sun Jul 14 21:08:54 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CE13FA726C; Sun, 14 Jul 2019 21:08:54 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AD41A8D353; Sun, 14 Jul 2019 21:08:54 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8A71EB4A5; Sun, 14 Jul 2019 21:08:54 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6EL8sc0089788; Sun, 14 Jul 2019 21:08:54 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6EL8sA1089787; Sun, 14 Jul 2019 21:08:54 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201907142108.x6EL8sA1089787@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 14 Jul 2019 21:08:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349988 - head/sys/x86/iommu X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/x86/iommu X-SVN-Commit-Revision: 349988 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AD41A8D353 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jul 2019 21:08:54 -0000 Author: kib Date: Sun Jul 14 21:08:54 2019 New Revision: 349988 URL: https://svnweb.freebsd.org/changeset/base/349988 Log: PR: 239143 Reported and tested by: Wes Maag Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/x86/iommu/intel_drv.c Modified: head/sys/x86/iommu/intel_drv.c ============================================================================== --- head/sys/x86/iommu/intel_drv.c Sun Jul 14 16:05:47 2019 (r349987) +++ head/sys/x86/iommu/intel_drv.c Sun Jul 14 21:08:54 2019 (r349988) @@ -770,6 +770,13 @@ dmar_find(device_t dev, bool verbose) const char *banner; int i, dev_domain, dev_busno, dev_path_len; + /* + * This function can only handle PCI(e) devices. + */ + if (device_get_devclass(device_get_parent(dev)) != + devclass_find("pci")) + return (NULL); + dmar_dev = NULL; dev_domain = pci_get_domain(dev); dev_path_len = dmar_dev_depth(dev); From owner-svn-src-all@freebsd.org Sun Jul 14 21:13:35 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 37091A74AF; Sun, 14 Jul 2019 21:13:35 +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) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 80D3F8D7B3; Sun, 14 Jul 2019 21:13:34 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id x6ELDRgh091244 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 15 Jul 2019 00:13:30 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x6ELDRgh091244 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x6ELDQDC091243; Mon, 15 Jul 2019 00:13:26 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 15 Jul 2019 00:13:26 +0300 From: Konstantin Belousov To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r349988 - head/sys/x86/iommu Message-ID: <20190714211326.GU47193@kib.kiev.ua> References: <201907142108.x6EL8sA1089787@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201907142108.x6EL8sA1089787@repo.freebsd.org> User-Agent: Mutt/1.12.1 (2019-06-15) 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.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jul 2019 21:13:35 -0000 On Sun, Jul 14, 2019 at 09:08:54PM +0000, Konstantin Belousov wrote: > Author: kib > Date: Sun Jul 14 21:08:54 2019 > New Revision: 349988 > URL: https://svnweb.freebsd.org/changeset/base/349988 In dmar_find(), refuse to search for DMAR unit for non-PCI device. Eventually this should be reworked, because ACPI DMAR table can specify ANND entries for scoping ACPI namespace enumerated devices. But code to match DMAR unit against such device is missed currently anyway. Sorry. > > Log: > PR: 239143 > Reported and tested by: Wes Maag > Sponsored by: The FreeBSD Foundation > MFC after: 1 week > > Modified: > head/sys/x86/iommu/intel_drv.c > > Modified: head/sys/x86/iommu/intel_drv.c > ============================================================================== > --- head/sys/x86/iommu/intel_drv.c Sun Jul 14 16:05:47 2019 (r349987) > +++ head/sys/x86/iommu/intel_drv.c Sun Jul 14 21:08:54 2019 (r349988) > @@ -770,6 +770,13 @@ dmar_find(device_t dev, bool verbose) > const char *banner; > int i, dev_domain, dev_busno, dev_path_len; > > + /* > + * This function can only handle PCI(e) devices. > + */ > + if (device_get_devclass(device_get_parent(dev)) != > + devclass_find("pci")) > + return (NULL); > + > dmar_dev = NULL; > dev_domain = pci_get_domain(dev); > dev_path_len = dmar_dev_depth(dev); From owner-svn-src-all@freebsd.org Sun Jul 14 21:44:19 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A8442A7DEB; Sun, 14 Jul 2019 21:44:19 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8A65C8E75B; Sun, 14 Jul 2019 21:44:19 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2B7E3BD51; Sun, 14 Jul 2019 21:44:19 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6ELiJkT013094; Sun, 14 Jul 2019 21:44:19 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6ELiJr7013093; Sun, 14 Jul 2019 21:44:19 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201907142144.x6ELiJr7013093@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 14 Jul 2019 21:44:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349989 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 349989 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8A65C8E75B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.94)[-0.943,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jul 2019 21:44:19 -0000 Author: tuexen Date: Sun Jul 14 21:44:18 2019 New Revision: 349989 URL: https://svnweb.freebsd.org/changeset/base/349989 Log: Improve the input validation for l_linger. When using the SOL_SOCKET level socket option SO_LINGER, the structure struct linger is used as the option value. The component l_linger is of type int, but internally copied to the field so_linger of the structure struct socket. The type of so_linger is short, but it is assumed to be non-negative and the value is used to compute ticks to be stored in a variable of type int. Therefore, perform input validation on l_linger similar to the one performed by NetBSD and OpenBSD. Thanks to syzkaller for making me aware of this issue. Thanks to markj@ for pointing out that a similar check should be added to so_linger_set(). Reviewed by: markj@ MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D20948 Modified: head/sys/kern/uipc_socket.c Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Sun Jul 14 21:08:54 2019 (r349988) +++ head/sys/kern/uipc_socket.c Sun Jul 14 21:44:18 2019 (r349989) @@ -2776,7 +2776,12 @@ sosetopt(struct socket *so, struct sockopt *sopt) error = sooptcopyin(sopt, &l, sizeof l, sizeof l); if (error) goto bad; - + if (l.l_linger < 0 || + l.l_linger > USHRT_MAX || + l.l_linger > (INT_MAX / hz)) { + error = EDOM; + goto bad; + } SOCK_LOCK(so); so->so_linger = l.l_linger; if (l.l_onoff) @@ -4105,6 +4110,9 @@ so_linger_get(const struct socket *so) void so_linger_set(struct socket *so, int val) { + + KASSERT(val >= 0 && val <= USHRT_MAX && val <= (INT_MAX / hz), + ("%s: val %d out of range", __func__, val)); so->so_linger = val; } From owner-svn-src-all@freebsd.org Mon Jul 15 03:23:55 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B544BAEDAA; Mon, 15 Jul 2019 03:23:55 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) 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 A8E1A72DC3; Mon, 15 Jul 2019 03:23:54 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf1-x444.google.com with SMTP id m30so6735004pff.8; Sun, 14 Jul 2019 20:23:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=5y7CE4MGAMkdepa7OU75u2sttt74bEqk1sVntoTqZ/8=; b=vC7d3qJoSwdPtshORQJ/k2wA9q/7usTuJryDVhXkrpSuLYaohXX3pkyynjPn6BOwrE N3lPDvjlgIxa5rHEVls7sCBoOOB4nar33a4YSNOlJCbrMA0Rg1qcsz21ps1R7mXh8Roi 6h0V9MO7gKpxqbBscL3tOGeTZxe5fn/21VVdgitZ+DBcjIazbxfALJHUro7BsPVmF8WO RlOqrm8pM8mG2Ugb0KslB+r6ihykDufwMJc+Fcb0PaN7f4jK/I0x5uCPWeB0mSf2hG4L 7SC9UTregVowKM46xSmvxxlMH7zFHjZUd+tyyICISZSB5h8+iiJqVOMc07l3vmha8wov 6hOQ== 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=5y7CE4MGAMkdepa7OU75u2sttt74bEqk1sVntoTqZ/8=; b=ALFpVWu3fPUYBoOWvc6/kri4XtNYXB8PoqlYYrtZjR9mellE3zbbitDVY6K/gPJFlK oYYTlpAvkb6nV4j/33UjLiUTVua6sC3esIKhfv7yIE315PreqFC9/Hlf803S96BV3EaS MOFq27LyX/dUf1tSZuu+GbJ93vld3kqOGiKcfucAXPzqSv9L/pVPpWcIwiq2HQcDvtzm Xcx21P4WtXgct1qrgbz76T++KXhydOLhsT2Q5C9IbYIahXYTnD7y38DcYU2iL36IBVgg +oVkkwxaKMe/ewf3gpur2r1BBE7vc9bZvKvzNY/ifdA+civ13vdhmhrUp0/wy4G+fNak XqrA== X-Gm-Message-State: APjAAAU3ofAwvoHgY++DcanK4zFUBf9C/gV1A1oKrKg6qmUVrctxcXUh pMiKwe7fsLHUmIGYgK5VeEiAtL6heSw= X-Google-Smtp-Source: APXvYqwKPaXgRpTURJ3a0TOFpElzuxGSu/jz87TNkunpizXaKB5EEIgtTxDfQtGKWxrtyAG4EYpQDw== X-Received: by 2002:a63:d755:: with SMTP id w21mr24788556pgi.311.1563161033170; Sun, 14 Jul 2019 20:23:53 -0700 (PDT) Received: from [192.168.20.12] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id m13sm12381254pgv.89.2019.07.14.20.23.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 14 Jul 2019 20:23:52 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: svn commit: r349974 - head/libexec/rc/rc.d From: "Enji Cooper (yaneurabeya)" In-Reply-To: <201907131607.x6DG7cTR067202@repo.freebsd.org> Date: Sun, 14 Jul 2019 20:23:51 -0700 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <4D2DD5FF-3BEE-42F7-B4D1-41C399740551@gmail.com> References: <201907131607.x6DG7cTR067202@repo.freebsd.org> To: Ian Lepore X-Mailer: Apple Mail (2.3445.104.11) X-Rspamd-Queue-Id: A8E1A72DC3 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=vC7d3qJo; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of yaneurabeya@gmail.com designates 2607:f8b0:4864:20::444 as permitted sender) smtp.mailfrom=yaneurabeya@gmail.com X-Spamd-Result: default: False [-4.40 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; MV_CASE(0.50)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.72)[-0.723,0]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(-1.17)[ip: (-0.19), ipnet: 2607:f8b0::/32(-3.17), asn: 15169(-2.44), country: US(-0.06)]; RCVD_IN_DNSWL_NONE(0.00)[4.4.4.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jul 2019 03:23:55 -0000 > On Jul 13, 2019, at 09:07, Ian Lepore wrote: >=20 > Author: ian > Date: Sat Jul 13 16:07:38 2019 > New Revision: 349974 > URL: https://svnweb.freebsd.org/changeset/base/349974 >=20 > Log: > Limit access to system accounting files. >=20 > In 2013 the security chapter of the Handbook was updated in r42501 to > suggest limiting access to the system accounting file [*1] by = creating the > initial file with a mode of 0600. This was in part based on a = discussion in > the forums [*2]. Unfortunately, this advice is overridden by the fact = that a > new file is created as part of periodic daily processing, and the = file mode > is set by the rc.d/accounting script. >=20 > These changes update the accounting script to create the directory = with mode > 0750 if it doesn't already exist, and to create the daily file with = mode > 0640. This limits write access to root only, read access to root and = members > of wheel, and eliminates world access completely. For admins who want = to > prevent even members of wheel from accessing the files, the mode of = the > /var/account directory can be manually changed to 0700, because the = script > never creates or changes that directory if it already exists. >=20 > The accounting_rotate_log() function now also handles the error cases = of no > existing log file to rotate, and attempting to rotate the file = multiple > times (.0 file already exists). >=20 > Another small change here eliminates the complexity of the = mktemp/chmod/mv > sequence for creating a new acct file by using install(1) with the = flags > needed to directly create the file with the desired ownership and > modes. That allows coalescing two separate if checkyesno = accounting_enable > blocks into one. >=20 > These changes were inspired by my investigation of PR 202203. >=20 > [1] https://www.freebsd.org/doc/handbook/security-accounting.html > [2] http://forums.freebsd.org/showthread.php?t=3D41059 >=20 > PR: 202203 > Differential Revision: https://reviews.freebsd.org/D20876 Does this deserve a =E2=80=9CRelnotes: yes=E2=80=9D=E2=80=A6? Thanks! -Enji= From owner-svn-src-all@freebsd.org Mon Jul 15 07:35:47 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A7510B2E01; Mon, 15 Jul 2019 07:35:47 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 87BE4830EE; Mon, 15 Jul 2019 07:35:47 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 62CB11A509; Mon, 15 Jul 2019 07:35:47 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6F7ZlBV059828; Mon, 15 Jul 2019 07:35:47 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6F7ZlXU059827; Mon, 15 Jul 2019 07:35:47 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201907150735.x6F7ZlXU059827@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 15 Jul 2019 07:35:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349990 - head/bin/ls X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/bin/ls X-SVN-Commit-Revision: 349990 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 87BE4830EE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.93)[-0.929,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jul 2019 07:35:47 -0000 Author: imp Date: Mon Jul 15 07:35:46 2019 New Revision: 349990 URL: https://svnweb.freebsd.org/changeset/base/349990 Log: Now that we have MK_LS_COLORS, we don't need RELEASE_CRUNCH check here. The RELEASE_CRUNCH check is redundant here. We don't need it for releases anymore, and picobsd can control this more directly without making it a special case. Modified: head/bin/ls/Makefile Modified: head/bin/ls/Makefile ============================================================================== --- head/bin/ls/Makefile Sun Jul 14 21:44:18 2019 (r349989) +++ head/bin/ls/Makefile Mon Jul 15 07:35:46 2019 (r349990) @@ -8,8 +8,7 @@ PROG= ls SRCS= cmp.c ls.c print.c util.c LIBADD= util -.if !defined(RELEASE_CRUNCH) && \ - ${MK_LS_COLORS} != no +.if ${MK_LS_COLORS} != no CFLAGS+= -DCOLORLS LIBADD+= termcapw .endif From owner-svn-src-all@freebsd.org Mon Jul 15 07:39:29 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 305B7B2EB3; Mon, 15 Jul 2019 07:39:29 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 132AC832FE; Mon, 15 Jul 2019 07:39:29 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E0CAD1A50C; Mon, 15 Jul 2019 07:39:28 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6F7dSrq060041; Mon, 15 Jul 2019 07:39:28 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6F7dSme060040; Mon, 15 Jul 2019 07:39:28 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201907150739.x6F7dSme060040@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 15 Jul 2019 07:39:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349991 - in head/usr.sbin: ntp wpa X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/usr.sbin: ntp wpa X-SVN-Commit-Revision: 349991 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 132AC832FE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.93)[-0.929,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jul 2019 07:39:29 -0000 Author: imp Date: Mon Jul 15 07:39:28 2019 New Revision: 349991 URL: https://svnweb.freebsd.org/changeset/base/349991 Log: MK_OPENSSL makes RELEASE_CRUNCH redundant here Since these things are more completely controlled by the MK_OPENSSL knob, remove RELEASE_CRUNCH here. It's no longer needed for the release and other users can use the more proper knob if they so desire. Modified: head/usr.sbin/ntp/Makefile.inc head/usr.sbin/wpa/Makefile.crypto Modified: head/usr.sbin/ntp/Makefile.inc ============================================================================== --- head/usr.sbin/ntp/Makefile.inc Mon Jul 15 07:35:46 2019 (r349990) +++ head/usr.sbin/ntp/Makefile.inc Mon Jul 15 07:39:28 2019 (r349991) @@ -10,7 +10,7 @@ NTPDEFS= -DSYS_FREEBSD # -DMX4200 -DNMEA -DBOEDER CFLAGS+= ${NTPDEFS} ${DEFS_LOCAL} ${CLOCKDEFS} -.if ${MK_OPENSSL} != "no" && !defined(RELEASE_CRUNCH) +.if ${MK_OPENSSL} != "no" CFLAGS+= -DOPENSSL -DUSE_OPENSSL_CRYPTO_RAND -DAUTOKEY .endif Modified: head/usr.sbin/wpa/Makefile.crypto ============================================================================== --- head/usr.sbin/wpa/Makefile.crypto Mon Jul 15 07:35:46 2019 (r349990) +++ head/usr.sbin/wpa/Makefile.crypto Mon Jul 15 07:39:28 2019 (r349991) @@ -1,6 +1,6 @@ # $FreeBSD$ -.if ${MK_OPENSSL} != "no" && !defined(RELEASE_CRUNCH) +.if ${MK_OPENSSL} != "no" SRCS+= crypto_openssl.c random.c sha1-prf.c sha256-prf.c sha256-tlsprf.c \ sha512.c LIBADD+= ssl crypto From owner-svn-src-all@freebsd.org Mon Jul 15 08:21:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C9192B3982; Mon, 15 Jul 2019 08:21:21 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AB0F28487E; Mon, 15 Jul 2019 08:21:21 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 85B891AD39; Mon, 15 Jul 2019 08:21:21 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6F8LLsk083714; Mon, 15 Jul 2019 08:21:21 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6F8LLA9083713; Mon, 15 Jul 2019 08:21:21 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201907150821.x6F8LLA9083713@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 15 Jul 2019 08:21:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r349992 - stable/12/share/man/man9 X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/share/man/man9 X-SVN-Commit-Revision: 349992 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AB0F28487E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.945,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jul 2019 08:21:21 -0000 Author: kib Date: Mon Jul 15 08:21:21 2019 New Revision: 349992 URL: https://svnweb.freebsd.org/changeset/base/349992 Log: MFC r349950: Style: avoid long lines by using .Fo instead of .Fn. Modified: stable/12/share/man/man9/casuword.9 Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man9/casuword.9 ============================================================================== --- stable/12/share/man/man9/casuword.9 Mon Jul 15 07:39:28 2019 (r349991) +++ stable/12/share/man/man9/casuword.9 Mon Jul 15 08:21:21 2019 (r349992) @@ -41,13 +41,31 @@ .In sys/types.h .In sys/systm.h .Ft int -.Fn casueword "volatile u_long *base" "u_long oldval" "u_long *oldvalp" "u_long newval" +.Fo casueword +.Fa "volatile u_long *base" +.Fa "u_long oldval" +.Fa "u_long *oldvalp" +.Fa "u_long newval" +.Fc .Ft int -.Fn casueword32 "volatile uint32_t *base" "uint32_t oldval" "uint32_t *oldvalp" "uint32_t newval" +.Fo casueword32 +.Fa "volatile uint32_t *base" +.Fa "uint32_t oldval" +.Fa "uint32_t *oldvalp" +.Fa "uint32_t newval" +.Fc .Ft u_long -.Fn casuword "volatile u_long *base" "u_long oldval" "u_long newval" +.Fo casuword +.Fa "volatile u_long *base" +.Fa "u_long oldval" +.Fa "u_long newval" +.Fc .Ft uint32_t -.Fn casuword32 "volatile uint32_t *base" "uint32_t oldval" "uint32_t newval" +.Fo casuword32 +.Fa "volatile uint32_t *base" +.Fa "uint32_t oldval" +.Fa "uint32_t newval" +.Fc .Sh DESCRIPTION The .Nm From owner-svn-src-all@freebsd.org Mon Jul 15 08:21:50 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 38196B3B08; Mon, 15 Jul 2019 08:21:50 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1A03684A0B; Mon, 15 Jul 2019 08:21:50 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E4BC11AD60; Mon, 15 Jul 2019 08:21:49 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6F8LnNT086033; Mon, 15 Jul 2019 08:21:49 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6F8LnvJ086032; Mon, 15 Jul 2019 08:21:49 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201907150821.x6F8LnvJ086032@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 15 Jul 2019 08:21:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r349993 - stable/11/share/man/man9 X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/share/man/man9 X-SVN-Commit-Revision: 349993 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1A03684A0B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.945,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jul 2019 08:21:50 -0000 Author: kib Date: Mon Jul 15 08:21:49 2019 New Revision: 349993 URL: https://svnweb.freebsd.org/changeset/base/349993 Log: MFC r349950: Style: avoid long lines by using .Fo instead of .Fn. Modified: stable/11/share/man/man9/casuword.9 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man9/casuword.9 ============================================================================== --- stable/11/share/man/man9/casuword.9 Mon Jul 15 08:21:21 2019 (r349992) +++ stable/11/share/man/man9/casuword.9 Mon Jul 15 08:21:49 2019 (r349993) @@ -41,13 +41,31 @@ .In sys/types.h .In sys/systm.h .Ft int -.Fn casueword "volatile u_long *base" "u_long oldval" "u_long *oldvalp" "u_long newval" +.Fo casueword +.Fa "volatile u_long *base" +.Fa "u_long oldval" +.Fa "u_long *oldvalp" +.Fa "u_long newval" +.Fc .Ft int -.Fn casueword32 "volatile uint32_t *base" "uint32_t oldval" "uint32_t *oldvalp" "uint32_t newval" +.Fo casueword32 +.Fa "volatile uint32_t *base" +.Fa "uint32_t oldval" +.Fa "uint32_t *oldvalp" +.Fa "uint32_t newval" +.Fc .Ft u_long -.Fn casuword "volatile u_long *base" "u_long oldval" "u_long newval" +.Fo casuword +.Fa "volatile u_long *base" +.Fa "u_long oldval" +.Fa "u_long newval" +.Fc .Ft uint32_t -.Fn casuword32 "volatile uint32_t *base" "uint32_t oldval" "uint32_t newval" +.Fo casuword32 +.Fa "volatile uint32_t *base" +.Fa "uint32_t oldval" +.Fa "uint32_t newval" +.Fc .Sh DESCRIPTION The .Nm From owner-svn-src-all@freebsd.org Mon Jul 15 08:38:01 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C4D54B3EEA; Mon, 15 Jul 2019 08:38:01 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A6AA08528B; Mon, 15 Jul 2019 08:38:01 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7DEE41AF87; Mon, 15 Jul 2019 08:38:01 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6F8c1kP095491; Mon, 15 Jul 2019 08:38:01 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6F8c1mu095490; Mon, 15 Jul 2019 08:38:01 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201907150838.x6F8c1mu095490@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 15 Jul 2019 08:38:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349994 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 349994 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A6AA08528B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jul 2019 08:38:01 -0000 Author: kib Date: Mon Jul 15 08:38:01 2019 New Revision: 349994 URL: https://svnweb.freebsd.org/changeset/base/349994 Log: Correctly check for casueword(9) success in do_set_ceiling(). After r349951, the return code must be checked instead of old == new comparision. Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 12 days Differential revision: https://reviews.freebsd.org/D20949 Modified: head/sys/kern/kern_umtx.c Modified: head/sys/kern/kern_umtx.c ============================================================================== --- head/sys/kern/kern_umtx.c Mon Jul 15 08:21:49 2019 (r349993) +++ head/sys/kern/kern_umtx.c Mon Jul 15 08:38:01 2019 (r349994) @@ -2456,7 +2456,8 @@ do_set_ceiling(struct thread *td, struct umutex *m, ui break; } - if (owner == UMUTEX_CONTESTED) { + if (rv == 0) { + MPASS(owner == UMUTEX_CONTESTED); rv = suword32(&m->m_ceilings[0], ceiling); rv1 = suword32(&m->m_owner, UMUTEX_CONTESTED); error = (rv == 0 && rv1 == 0) ? 0: EFAULT; From owner-svn-src-all@freebsd.org Mon Jul 15 08:39:53 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 69594B3F7E; Mon, 15 Jul 2019 08:39:53 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BEBB85436; Mon, 15 Jul 2019 08:39:53 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2654C1AF8D; Mon, 15 Jul 2019 08:39:53 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6F8drm9095613; Mon, 15 Jul 2019 08:39:53 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6F8drnv095612; Mon, 15 Jul 2019 08:39:53 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201907150839.x6F8drnv095612@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 15 Jul 2019 08:39:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349995 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 349995 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4BEBB85436 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jul 2019 08:39:53 -0000 Author: kib Date: Mon Jul 15 08:39:52 2019 New Revision: 349995 URL: https://svnweb.freebsd.org/changeset/base/349995 Log: In do_lock_pi(), do not return prematurely. If umtxq_check_susp() indicates an exit, we should clean the resources before returning. Do it by breaking out of the loop and relying on post-loop cleanup. Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 12 days Differential revision: https://reviews.freebsd.org/D20949 Modified: head/sys/kern/kern_umtx.c Modified: head/sys/kern/kern_umtx.c ============================================================================== --- head/sys/kern/kern_umtx.c Mon Jul 15 08:38:01 2019 (r349994) +++ head/sys/kern/kern_umtx.c Mon Jul 15 08:39:52 2019 (r349995) @@ -1926,7 +1926,7 @@ do_lock_pi(struct thread *td, struct umutex *m, uint32 if (error == 0) { error = umtxq_check_susp(td, true); if (error != 0) - return (error); + break; } /* From owner-svn-src-all@freebsd.org Mon Jul 15 12:27:54 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 83010B8DE2; Mon, 15 Jul 2019 12:27:54 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id 5C7658DEB2; Mon, 15 Jul 2019 12:27:53 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id 9B5E73DC4A5; Mon, 15 Jul 2019 22:27:43 +1000 (AEST) Date: Mon, 15 Jul 2019 22:27:42 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Michael Tuexen cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r349989 - head/sys/kern In-Reply-To: <201907142144.x6ELiJr7013093@repo.freebsd.org> Message-ID: <20190715214323.Y1092@besplex.bde.org> References: <201907142144.x6ELiJr7013093@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=D+Q3ErZj c=1 sm=1 tr=0 cx=a_idp_d a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=LS_uVbEeALFgrawW9_YA:9 a=CjuIK1q_8ugA:10 X-Rspamd-Queue-Id: 5C7658DEB2 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of brde@optusnet.com.au designates 211.29.132.42 as permitted sender) smtp.mailfrom=brde@optusnet.com.au X-Spamd-Result: default: False [-5.43 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; RCVD_IN_DNSWL_LOW(-0.10)[42.132.29.211.list.dnswl.org : 127.0.5.1]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:211.29.132.0/23]; FREEMAIL_FROM(0.00)[optusnet.com.au]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DMARC_NA(0.00)[optusnet.com.au]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; IP_SCORE(-2.58)[ip: (-7.38), ipnet: 211.28.0.0/14(-3.19), asn: 4804(-2.35), country: AU(0.01)]; MX_GOOD(-0.01)[cached: extmail.optusnet.com.au]; NEURAL_HAM_SHORT(-0.54)[-0.543,0]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[optusnet.com.au]; ASN(0.00)[asn:4804, ipnet:211.28.0.0/14, country:AU]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jul 2019 12:27:54 -0000 On Sun, 14 Jul 2019, Michael Tuexen wrote: > Log: > Improve the input validation for l_linger. > When using the SOL_SOCKET level socket option SO_LINGER, the structure > struct linger is used as the option value. The component l_linger is of > type int, but internally copied to the field so_linger of the structure > struct socket. The type of so_linger is short, but it is assumed to be > non-negative and the value is used to compute ticks to be stored in a > variable of type int. > > Therefore, perform input validation on l_linger similar to the one > performed by NetBSD and OpenBSD. This still overflows, at least in FreeBSD. FreeBSD really does have type short (or int16_t in the user struct) for l_linger, so overflow now occurs when SHRT_MAX < l.linger <= USHRT_MAX. The overflow is to a negative value on all supported arches. > Thanks to syzkaller for making me aware of this issue. > > Thanks to markj@ for pointing out that a similar check should be added > to so_linger_set(). This check seems to be wrong, but it is hard to be sure since so_linger_set() is never referenced. Using KASSERT() is wrong unless the caller is supposed to have checked the args and usually unnecessary if the caller has checked the args. > Modified: head/sys/kern/uipc_socket.c > ============================================================================== > --- head/sys/kern/uipc_socket.c Sun Jul 14 21:08:54 2019 (r349988) > +++ head/sys/kern/uipc_socket.c Sun Jul 14 21:44:18 2019 (r349989) > @@ -2776,7 +2776,12 @@ sosetopt(struct socket *so, struct sockopt *sopt) > error = sooptcopyin(sopt, &l, sizeof l, sizeof l); > if (error) > goto bad; > - This fixes a style bug (extra blank line separating related code). > + if (l.l_linger < 0 || > + l.l_linger > USHRT_MAX || This adds a style bug (excessive line splitting) together with the wrong limit. The correct limit is INT16_MAX since the user struct uses int16_t and we don't want to allow that to overflow. SHRT_MAX is only the same as INT16_MAX on all supported arches. > + l.l_linger > (INT_MAX / hz)) { This adds a syle bug (excessive parentheses). It is unfortunately technically necessary for a paranoid check. We blindly multiply by hz later and want to ensure no overflow then. Overflow is barely possible with the correct limit of 32767. Then overflow on multiplication by hz would occur with maximal l_linger and 32-bit ints when hz = 65536. hz = 65536 is barely reasonable. > + error = EDOM; > + goto bad; > + } > SOCK_LOCK(so); > so->so_linger = l.l_linger; > if (l.l_onoff) > @@ -4105,6 +4110,9 @@ so_linger_get(const struct socket *so) > void > so_linger_set(struct socket *so, int val) > { > + > + KASSERT(val >= 0 && val <= USHRT_MAX && val <= (INT_MAX / hz), > + ("%s: val %d out of range", __func__, val)); > > so->so_linger = val; > } Unreached code with the same error in the limit and the excessive parentheses, but otherwise fewer style bugs. r180641 in 2008 added mounds of accessor functions like this. Using these is painful compared with direct acccess, and there is currently 1 whole use of so_{state,options,error,linger,protosw}_{set,get} in the sys tree. This is a so_options_get() in cxgbe. cxgbe elsewhere uses 3 direct accesses to so->so_options alone, including 1 '|=' operation which would be especially painful using 2 accessor functions. Bruce From owner-svn-src-all@freebsd.org Mon Jul 15 14:19:40 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F35A9BB1B7; Mon, 15 Jul 2019 14:19:40 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CFBA292DF5; Mon, 15 Jul 2019 14:19:40 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AA9441EC53; Mon, 15 Jul 2019 14:19:40 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6FEJe2X097265; Mon, 15 Jul 2019 14:19:40 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6FEJeLf097263; Mon, 15 Jul 2019 14:19:40 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201907151419.x6FEJeLf097263@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 15 Jul 2019 14:19:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349996 - in head: sbin/ping usr.bin/telnet usr.sbin/inetd X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head: sbin/ping usr.bin/telnet usr.sbin/inetd X-SVN-Commit-Revision: 349996 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CFBA292DF5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jul 2019 14:19:41 -0000 Author: imp Date: Mon Jul 15 14:19:39 2019 New Revision: 349996 URL: https://svnweb.freebsd.org/changeset/base/349996 Log: Remove all the RELEASE_CRUNCH instances that partially disable IPSEC We remove IPSEC only in parts of the tree, and not others. RELEASE_CRUNCH to disable it has not kept up with all its uses. Remove it. Should there be a real need to disable IPSEC, one that hasn't shown up in the base system to date, it can be re-added behind a WITHOUT_IPSEC build option. Modified: head/sbin/ping/Makefile head/usr.bin/telnet/Makefile head/usr.sbin/inetd/Makefile Modified: head/sbin/ping/Makefile ============================================================================== --- head/sbin/ping/Makefile Mon Jul 15 08:39:52 2019 (r349995) +++ head/sbin/ping/Makefile Mon Jul 15 14:19:39 2019 (r349996) @@ -19,9 +19,7 @@ LIBADD+= cap_dns CFLAGS+=-DWITH_CASPER .endif -.if !defined(RELEASE_CRUNCH) CFLAGS+=-DIPSEC LIBADD+= ipsec -.endif .include Modified: head/usr.bin/telnet/Makefile ============================================================================== --- head/usr.bin/telnet/Makefile Mon Jul 15 08:39:52 2019 (r349995) +++ head/usr.bin/telnet/Makefile Mon Jul 15 14:19:39 2019 (r349996) @@ -21,14 +21,8 @@ WARNS?= 2 LIBADD= telnet ncursesw -.if !defined(RELEASE_CRUNCH) CFLAGS+= -DIPSEC LIBADD+= ipsec -.else -.PATH: ${TELNETDIR}/libtelnet -SRCS+= genget.c getent.c misc.c -CFLAGS+= -DHAS_CGETENT -.endif .if ${MK_OPENSSL} != "no" SRCS+= authenc.c Modified: head/usr.sbin/inetd/Makefile ============================================================================== --- head/usr.sbin/inetd/Makefile Mon Jul 15 08:39:52 2019 (r349995) +++ head/usr.sbin/inetd/Makefile Mon Jul 15 14:19:39 2019 (r349996) @@ -24,10 +24,7 @@ CFLAGS+= -DLIBWRAP LIBADD+= wrap .endif -# XXX for src/release/picobsd -.if !defined(RELEASE_CRUNCH) CFLAGS+= -DIPSEC LIBADD+= ipsec -.endif .include From owner-svn-src-all@freebsd.org Mon Jul 15 14:23:52 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 04840BB472; Mon, 15 Jul 2019 14:23:52 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DB4F69341D; Mon, 15 Jul 2019 14:23:51 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B09091EE10; Mon, 15 Jul 2019 14:23:51 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6FENpx8002865; Mon, 15 Jul 2019 14:23:51 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6FENpK1002864; Mon, 15 Jul 2019 14:23:51 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201907151423.x6FENpK1002864@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 15 Jul 2019 14:23:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349997 - head/usr.sbin/ngctl X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/usr.sbin/ngctl X-SVN-Commit-Revision: 349997 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DB4F69341D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jul 2019 14:23:52 -0000 Author: imp Date: Mon Jul 15 14:23:51 2019 New Revision: 349997 URL: https://svnweb.freebsd.org/changeset/base/349997 Log: Replace complicated expression to disable libedit when no libthr is being built with a simpler one. Modified: head/usr.sbin/ngctl/Makefile Modified: head/usr.sbin/ngctl/Makefile ============================================================================== --- head/usr.sbin/ngctl/Makefile Mon Jul 15 14:19:39 2019 (r349996) +++ head/usr.sbin/ngctl/Makefile Mon Jul 15 14:23:51 2019 (r349997) @@ -9,17 +9,9 @@ SRCS= main.c mkpeer.c config.c connect.c dot.c name.c msg.c debug.c shutdown.c rmhook.c status.c types.c write.c WARNS?= 3 -.if defined(RELEASE_CRUNCH) -NGCTL_NO_LIBEDIT= -.endif - -.if ${MK_LIBTHR} == "no" -NGCTL_NO_LIBEDIT= -.endif - LIBADD= netgraph -.if !defined(NGCTL_NO_LIBEDIT) +.if ${MK_LIBTHR} != "no" CFLAGS+= -DEDITLINE LIBADD+= edit pthread .endif From owner-svn-src-all@freebsd.org Mon Jul 15 14:52:53 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8F96CBBF32; Mon, 15 Jul 2019 14:52:53 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 70C2A94B00; Mon, 15 Jul 2019 14:52:53 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4B6501F34E; Mon, 15 Jul 2019 14:52:53 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6FEqrS8020522; Mon, 15 Jul 2019 14:52:53 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6FEqrDI020521; Mon, 15 Jul 2019 14:52:53 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201907151452.x6FEqrDI020521@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 15 Jul 2019 14:52:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349998 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 349998 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 70C2A94B00 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jul 2019 14:52:53 -0000 Author: tuexen Date: Mon Jul 15 14:52:52 2019 New Revision: 349998 URL: https://svnweb.freebsd.org/changeset/base/349998 Log: Fix socket state handling when freeing an SCTP endpoint. This issue was found by runing syzkaller. MFC after: 1 week Modified: head/sys/netinet/sctp_pcb.c Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Mon Jul 15 14:23:51 2019 (r349997) +++ head/sys/netinet/sctp_pcb.c Mon Jul 15 14:52:52 2019 (r349998) @@ -4912,12 +4912,11 @@ sctp_free_assoc(struct sctp_inpcb *inp, struct sctp_tc inp->sctp_flags |= SCTP_PCB_FLAGS_WAS_CONNECTED; if (so) { SOCKBUF_LOCK(&so->so_rcv); - if (so->so_rcv.sb_cc == 0) { - so->so_state &= ~(SS_ISCONNECTING | - SS_ISDISCONNECTING | - SS_ISCONFIRMING | - SS_ISCONNECTED); - } + so->so_state &= ~(SS_ISCONNECTING | + SS_ISDISCONNECTING | + SS_ISCONFIRMING | + SS_ISCONNECTED); + so->so_state |= SS_ISDISCONNECTED; socantrcvmore_locked(so); socantsendmore(so); sctp_sowwakeup(inp, so); From owner-svn-src-all@freebsd.org Mon Jul 15 14:54:05 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 07E8DBBFC7; Mon, 15 Jul 2019 14:54:05 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DDCAB94CAC; Mon, 15 Jul 2019 14:54:04 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B1C101F351; Mon, 15 Jul 2019 14:54:04 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6FEs4gD020631; Mon, 15 Jul 2019 14:54:04 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6FEs4g7020630; Mon, 15 Jul 2019 14:54:04 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201907151454.x6FEs4g7020630@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 15 Jul 2019 14:54:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349999 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 349999 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DDCAB94CAC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jul 2019 14:54:05 -0000 Author: tuexen Date: Mon Jul 15 14:54:04 2019 New Revision: 349999 URL: https://svnweb.freebsd.org/changeset/base/349999 Log: Add support for MSG_EOR and MSG_EOF in sendmsg() for SCTP. This is an FreeBSD extension, not covered by Posix. This issue was found by running syzkaller. MFC after: 1 week Modified: head/sys/netinet/sctp_output.c Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Mon Jul 15 14:52:52 2019 (r349998) +++ head/sys/netinet/sctp_output.c Mon Jul 15 14:54:04 2019 (r349999) @@ -12652,6 +12652,12 @@ sctp_lower_sosend(struct socket *so, sinfo_flags = inp->def_send.sinfo_flags; sinfo_assoc_id = inp->def_send.sinfo_assoc_id; } + if (flags & MSG_EOR) { + sinfo_flags |= SCTP_EOR; + } + if (flags & MSG_EOF) { + sinfo_flags |= SCTP_EOF; + } if (sinfo_flags & SCTP_SENDALL) { /* its a sendall */ error = sctp_sendall(inp, uio, top, srcv); @@ -12819,9 +12825,17 @@ sctp_lower_sosend(struct socket *so, } } else asoc = &stcb->asoc; - if (srcv == NULL) + if (srcv == NULL) { srcv = (struct sctp_sndrcvinfo *)&asoc->def_send; - if (srcv->sinfo_flags & SCTP_ADDR_OVER) { + sinfo_flags = srcv->sinfo_flags; + if (flags & MSG_EOR) { + sinfo_flags |= SCTP_EOR; + } + if (flags & MSG_EOF) { + sinfo_flags |= SCTP_EOF; + } + } + if (sinfo_flags & SCTP_ADDR_OVER) { if (addr) net = sctp_findnet(stcb, addr); else @@ -12928,7 +12942,7 @@ sctp_lower_sosend(struct socket *so, (SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_RECEIVED) || (SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_ACK_SENT) || (asoc->state & SCTP_STATE_SHUTDOWN_PENDING)) { - if (srcv->sinfo_flags & SCTP_ABORT) { + if (sinfo_flags & SCTP_ABORT) { ; } else { SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, ECONNRESET); @@ -12941,7 +12955,7 @@ sctp_lower_sosend(struct socket *so, p->td_ru.ru_msgsnd++; } /* Are we aborting? */ - if (srcv->sinfo_flags & SCTP_ABORT) { + if (sinfo_flags & SCTP_ABORT) { struct mbuf *mm; ssize_t tot_demand, tot_out = 0, max_out; @@ -13145,7 +13159,7 @@ skip_preblock: * case NOTE: uio will be null when top/mbuf is passed */ if (sndlen == 0) { - if (srcv->sinfo_flags & SCTP_EOF) { + if (sinfo_flags & SCTP_EOF) { got_all_of_the_send = 1; goto dataless_eof; } else { @@ -13194,7 +13208,7 @@ skip_preblock: } sctp_snd_sb_alloc(stcb, sp->length); atomic_add_int(&asoc->stream_queue_cnt, 1); - if (srcv->sinfo_flags & SCTP_UNORDERED) { + if (sinfo_flags & SCTP_UNORDERED) { SCTP_STAT_INCR(sctps_sends_with_unord); } TAILQ_INSERT_TAIL(&strm->outqueue, sp, next); @@ -13269,15 +13283,15 @@ skip_preblock: sctp_snd_sb_alloc(stcb, sndout); atomic_add_int(&sp->length, sndout); len += sndout; - if (srcv->sinfo_flags & SCTP_SACK_IMMEDIATELY) { + if (sinfo_flags & SCTP_SACK_IMMEDIATELY) { sp->sinfo_flags |= SCTP_SACK_IMMEDIATELY; } /* Did we reach EOR? */ if ((uio->uio_resid == 0) && ((user_marks_eor == 0) || - (srcv->sinfo_flags & SCTP_EOF) || - (user_marks_eor && (srcv->sinfo_flags & SCTP_EOR)))) { + (sinfo_flags & SCTP_EOF) || + (user_marks_eor && (sinfo_flags & SCTP_EOR)))) { sp->msg_is_complete = 1; } else { sp->msg_is_complete = 0; @@ -13479,7 +13493,7 @@ skip_preblock: /* We send in a 0, since we do NOT have any locks */ error = sctp_msg_append(stcb, net, top, srcv, 0); top = NULL; - if (srcv->sinfo_flags & SCTP_EOF) { + if (sinfo_flags & SCTP_EOF) { /* * This should only happen for Panda for the mbuf * send case, which does NOT yet support EEOR mode. @@ -13494,7 +13508,7 @@ skip_preblock: } dataless_eof: /* EOF thing ? */ - if ((srcv->sinfo_flags & SCTP_EOF) && + if ((sinfo_flags & SCTP_EOF) && (got_all_of_the_send == 1)) { SCTP_STAT_INCR(sctps_sends_with_eof); error = 0; From owner-svn-src-all@freebsd.org Mon Jul 15 15:02:41 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7970EBC234; Mon, 15 Jul 2019 15:02:41 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5BE859533F; Mon, 15 Jul 2019 15:02:41 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 34A911F50C; Mon, 15 Jul 2019 15:02:41 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6FF2fOV026328; Mon, 15 Jul 2019 15:02:41 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6FF2eMR026326; Mon, 15 Jul 2019 15:02:40 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201907151502.x6FF2eMR026326@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 15 Jul 2019 15:02:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350000 - in head/release/picobsd: bridge qemu X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/release/picobsd: bridge qemu X-SVN-Commit-Revision: 350000 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5BE859533F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jul 2019 15:02:41 -0000 Author: imp Date: Mon Jul 15 15:02:40 2019 New Revision: 350000 URL: https://svnweb.freebsd.org/changeset/base/350000 Log: Remove RELEASE_CRUNCH here. It's obsolete. Remove RELEASE_CRUNCH here. It's obsolete and hasn't worked in a while. The build options need to be revisited, since many older ones are listed, while newer useful ones are not. But that rototilling I'll leave to others. Modified: head/release/picobsd/bridge/crunch.conf head/release/picobsd/qemu/crunch.conf Modified: head/release/picobsd/bridge/crunch.conf ============================================================================== --- head/release/picobsd/bridge/crunch.conf Mon Jul 15 14:54:04 2019 (r349999) +++ head/release/picobsd/bridge/crunch.conf Mon Jul 15 15:02:40 2019 (r350000) @@ -29,7 +29,7 @@ # Default build options. Basically tell the Makefiles # that to use the most compact possible version of the code. -buildopts -DWITHOUT_PAM -DRELEASE_CRUNCH -DPPP_NO_NETGRAPH +buildopts -DWITHOUT_PAM -DPPP_NO_NETGRAPH buildopts -DTRACEROUTE_NO_IPSEC -DNO_INET6 buildopts -DWITHOUT_KERBEROS -DWITHOUT_OPENSSL Modified: head/release/picobsd/qemu/crunch.conf ============================================================================== --- head/release/picobsd/qemu/crunch.conf Mon Jul 15 14:54:04 2019 (r349999) +++ head/release/picobsd/qemu/crunch.conf Mon Jul 15 15:02:40 2019 (r350000) @@ -29,7 +29,7 @@ # Default build options. Basically tell the Makefiles # that to use the most compact possible version of the code. -buildopts -DWITHOUT_PAM -DRELEASE_CRUNCH -DPPP_NO_NETGRAPH +buildopts -DWITHOUT_PAM -DPPP_NO_NETGRAPH buildopts -DTRACEROUTE_NO_IPSEC -DNO_INET6 buildopts -DWITHOUT_KERBEROS -DWITHOUT_OPENSSL From owner-svn-src-all@freebsd.org Mon Jul 15 15:07:56 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 691AABC3B3; Mon, 15 Jul 2019 15:07:56 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48736956A4; Mon, 15 Jul 2019 15:07:56 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1CEE71F515; Mon, 15 Jul 2019 15:07:56 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6FF7tnO026604; Mon, 15 Jul 2019 15:07:55 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6FF7t6r026603; Mon, 15 Jul 2019 15:07:55 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201907151507.x6FF7t6r026603@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Mon, 15 Jul 2019 15:07:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350001 - head/sys/arm/conf X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/conf X-SVN-Commit-Revision: 350001 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 48736956A4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jul 2019 15:07:56 -0000 Author: manu Date: Mon Jul 15 15:07:55 2019 New Revision: 350001 URL: https://svnweb.freebsd.org/changeset/base/350001 Log: Remove duplicated device firmware entry in generic arm kernel config added in r333191 Submitted by: Daniel Engberg (daniel.engberg.lists@pyret.net) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D20680 Modified: head/sys/arm/conf/GENERIC Modified: head/sys/arm/conf/GENERIC ============================================================================== --- head/sys/arm/conf/GENERIC Mon Jul 15 15:02:40 2019 (r350000) +++ head/sys/arm/conf/GENERIC Mon Jul 15 15:07:55 2019 (r350001) @@ -205,8 +205,6 @@ device umass # Disks/Mass storage - Requires scbus device uhid # "Human Interface Devices" device ukbd # Allow keyboard like HIDs to control console -device firmware - # Device mode support device usb_template # Control of the gadget From owner-svn-src-all@freebsd.org Mon Jul 15 15:13:11 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DD371BC616; Mon, 15 Jul 2019 15:13:11 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg1-x52b.google.com (mail-pg1-x52b.google.com [IPv6:2607:f8b0:4864:20::52b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) 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 C081A95C88; Mon, 15 Jul 2019 15:13:10 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg1-x52b.google.com with SMTP id m4so7869093pgk.0; Mon, 15 Jul 2019 08:13:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=0FZh01lAsPWgOWyw3IyqSRm1L0No6E9EMZ1gU0TyAEA=; b=AVA88EETGVAu4y/vtn7eNTRnOLF5NURW6yUKPyR1DgHIKPC49ckjfw04p9rCY/1Fzu 2TRUiy04dh3TEQqrDQIyjYGGwwC20jg0xtowmD2JwgVWMK6Db8bew4Jg95rwVbFsyCoJ jyz3Ey3FeUwPliG+YQ8b08VvDM946PEICEA6y5ZVnep8aRmCJz8VoVshCMftsbLFbCPC 2VuBBdYHStGb6GYczBtiWnYTL7WR7oontDqcj6Q3iAt38H8WXYY6wnxkqnlOrk+1MOiV GpL2s00Oisq02WGR6bKJHR8RO/fxtph+YcfDI+SkiGgC5BGhOd6Gl2Txq9BVVX3g8QXi DikQ== 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=0FZh01lAsPWgOWyw3IyqSRm1L0No6E9EMZ1gU0TyAEA=; b=MPx0cgEwZXnpJtP0MPpekwGl7MmJP8fahfj5tQLWXM5NOgar55mCoy1TfuuZ+AJ3K4 BaewECo9kU+gvZrTz+ykIODX4aG/MJQy9Yfjw5LsuM1RtE1drgGe9H1jlFLcVNVVdfAq ZvA36dy9lyBCS2W0ObR9k4Gw5XI9RD/Us5NsZ0TCi0TAfxKQbRAtmFYuKDBtnYDa1QIs GyiSucTKUCz/1ZmxHklSi8XC2HBO/DaHDHyXamzTqAfPGCLMQto/a0Wa19aMYodCuCvr ULe8EYGD+hiwuNnbjlTxt3UwTqQyJrev1bXqhT5OYgiAaVDcLK27pCQNPiHBqf3bi+72 M6hQ== X-Gm-Message-State: APjAAAW6KRpkUszInjxRJmF0wBZaw9yCI6PJYNIo/JD9dgtpltKu5tmn k9ntArOMWGb5REiJdSUPbc57Ql3HUBc= X-Google-Smtp-Source: APXvYqwSNOqSSWEl/zh7Xzvjo5ztxxl4dgnHffC7B+VKAQ5aTVGLBOh/6UpfL+1PxSqOFoAdozDIsw== X-Received: by 2002:a65:50cb:: with SMTP id s11mr27395436pgp.371.1563203589172; Mon, 15 Jul 2019 08:13:09 -0700 (PDT) Received: from [192.168.20.12] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id e124sm26068828pfh.181.2019.07.15.08.13.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Jul 2019 08:13:08 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: svn commit: r349996 - in head: sbin/ping usr.bin/telnet usr.sbin/inetd From: "Enji Cooper (yaneurabeya)" In-Reply-To: <201907151419.x6FEJeLf097263@repo.freebsd.org> Date: Mon, 15 Jul 2019 08:13:07 -0700 Cc: src-committers , svn-src-all , svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <91FDA4F0-2793-45F9-A5D0-35F03865A157@gmail.com> References: <201907151419.x6FEJeLf097263@repo.freebsd.org> To: Warner Losh X-Mailer: Apple Mail (2.3445.104.11) X-Rspamd-Queue-Id: C081A95C88 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=AVA88EET; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of yaneurabeya@gmail.com designates 2607:f8b0:4864:20::52b as permitted sender) smtp.mailfrom=yaneurabeya@gmail.com X-Spamd-Result: default: False [-6.25 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; MV_CASE(0.50)[]; RCVD_COUNT_THREE(0.00)[3]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(-2.78)[ip: (-8.21), ipnet: 2607:f8b0::/32(-3.17), asn: 15169(-2.44), country: US(-0.06)]; RCVD_IN_DNSWL_NONE(0.00)[b.2.5.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jul 2019 15:13:11 -0000 > On Jul 15, 2019, at 07:19, Warner Losh wrote: >=20 > Author: imp > Date: Mon Jul 15 14:19:39 2019 > New Revision: 349996 > URL: https://svnweb.freebsd.org/changeset/base/349996 >=20 > Log: > Remove all the RELEASE_CRUNCH instances that partially disable IPSEC >=20 > We remove IPSEC only in parts of the tree, and not others. = RELEASE_CRUNCH to > disable it has not kept up with all its uses. Remove it. Should there = be a real > need to disable IPSEC, one that hasn't shown up in the base system to = date, > it can be re-added behind a WITHOUT_IPSEC build option. =E2=80=A6 > Modified: head/usr.bin/telnet/Makefile > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/usr.bin/telnet/Makefile Mon Jul 15 08:39:52 2019 = (r349995) > +++ head/usr.bin/telnet/Makefile Mon Jul 15 14:19:39 2019 = (r349996) > @@ -21,14 +21,8 @@ WARNS?=3D 2 >=20 > LIBADD=3D telnet ncursesw >=20 > -.if !defined(RELEASE_CRUNCH) > CFLAGS+=3D -DIPSEC > LIBADD+=3D ipsec > -.else > -.PATH: ${TELNETDIR}/libtelnet > -SRCS+=3D genget.c getent.c misc.c > -CFLAGS+=3D -DHAS_CGETENT > -.endif Hmmm=E2=80=A6 this is interesting. Why was cgetent/ipsec support = mutually exclusive=E2=80=A6 Thanks for cleaning this up :)! -Enji= From owner-svn-src-all@freebsd.org Mon Jul 15 15:43:16 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 834E0BD5CC; Mon, 15 Jul 2019 15:43:16 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6401D97AB4; Mon, 15 Jul 2019 15:43:16 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 215211FCE8; Mon, 15 Jul 2019 15:43:16 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6FFhGdm050081; Mon, 15 Jul 2019 15:43:16 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6FFhGDs050080; Mon, 15 Jul 2019 15:43:16 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201907151543.x6FFhGDs050080@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 15 Jul 2019 15:43:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350002 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 350002 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6401D97AB4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.983,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jul 2019 15:43:16 -0000 Author: markj Date: Mon Jul 15 15:43:15 2019 New Revision: 350002 URL: https://svnweb.freebsd.org/changeset/base/350002 Log: Fix reference counting in pmap_ts_referenced() on RISC-V. pmap_ts_referenced() does not necessarily clear the access bit from all accessed mappings of a given page. Thus, if a scan of the mappings needs to be restarted, we should be careful to avoid double-counting accessed mappings whose access bits were not cleared in a previous attempt. Reported by: alc Reviewed by: alc MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20926 Modified: head/sys/riscv/riscv/pmap.c Modified: head/sys/riscv/riscv/pmap.c ============================================================================== --- head/sys/riscv/riscv/pmap.c Mon Jul 15 15:07:55 2019 (r350001) +++ head/sys/riscv/riscv/pmap.c Mon Jul 15 15:43:15 2019 (r350002) @@ -3950,12 +3950,12 @@ pmap_ts_referenced(vm_page_t m) pt_entry_t *l3, l3e; vm_paddr_t pa; vm_offset_t va; - int md_gen, pvh_gen, ret; + int cleared, md_gen, not_cleared, pvh_gen; KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_ts_referenced: page %p is not managed", m)); SLIST_INIT(&free); - ret = 0; + cleared = 0; pa = VM_PAGE_TO_PHYS(m); pvh = (m->flags & PG_FICTITIOUS) != 0 ? &pv_dummy : pa_to_pvh(pa); @@ -3963,6 +3963,7 @@ pmap_ts_referenced(vm_page_t m) rw_rlock(&pvh_global_lock); rw_wlock(lock); retry: + not_cleared = 0; if ((pvf = TAILQ_FIRST(&pvh->pv_list)) == NULL) goto small_mappings; pv = pvf; @@ -4013,8 +4014,9 @@ retry: (l2e & PTE_SW_WIRED) == 0) { pmap_clear_bits(l2, PTE_A); pmap_invalidate_page(pmap, va); - } - ret++; + cleared++; + } else + not_cleared++; } PMAP_UNLOCK(pmap); /* Rotate the PV list if it has more than one entry. */ @@ -4023,7 +4025,7 @@ retry: TAILQ_INSERT_TAIL(&pvh->pv_list, pv, pv_next); pvh->pv_gen++; } - if (ret >= PMAP_TS_REFERENCED_MAX) + if (cleared + not_cleared >= PMAP_TS_REFERENCED_MAX) goto out; } while ((pv = TAILQ_FIRST(&pvh->pv_list)) != pvf); small_mappings: @@ -4062,8 +4064,9 @@ small_mappings: */ pmap_clear_bits(l3, PTE_A); pmap_invalidate_page(pmap, pv->pv_va); - } - ret++; + cleared++; + } else + not_cleared++; } PMAP_UNLOCK(pmap); /* Rotate the PV list if it has more than one entry. */ @@ -4072,13 +4075,13 @@ small_mappings: TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_next); m->md.pv_gen++; } - } while ((pv = TAILQ_FIRST(&m->md.pv_list)) != pvf && ret < - PMAP_TS_REFERENCED_MAX); + } while ((pv = TAILQ_FIRST(&m->md.pv_list)) != pvf && cleared + + not_cleared < PMAP_TS_REFERENCED_MAX); out: rw_wunlock(lock); rw_runlock(&pvh_global_lock); vm_page_free_pages_toq(&free, false); - return (ret); + return (cleared + not_cleared); } /* From owner-svn-src-all@freebsd.org Mon Jul 15 15:45:34 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7671DBD659; Mon, 15 Jul 2019 15:45:34 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 58AFB97C78; Mon, 15 Jul 2019 15:45:34 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 311A11FCED; Mon, 15 Jul 2019 15:45:34 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6FFjYNi050255; Mon, 15 Jul 2019 15:45:34 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6FFjYvT050254; Mon, 15 Jul 2019 15:45:34 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201907151545.x6FFjYvT050254@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 15 Jul 2019 15:45:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350003 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 350003 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 58AFB97C78 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.982,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jul 2019 15:45:34 -0000 Author: markj Date: Mon Jul 15 15:45:33 2019 New Revision: 350003 URL: https://svnweb.freebsd.org/changeset/base/350003 Log: pmap_clear_modify() needs to clear PTE_W. MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/sys/riscv/riscv/pmap.c Modified: head/sys/riscv/riscv/pmap.c ============================================================================== --- head/sys/riscv/riscv/pmap.c Mon Jul 15 15:43:15 2019 (r350002) +++ head/sys/riscv/riscv/pmap.c Mon Jul 15 15:45:33 2019 (r350003) @@ -4187,7 +4187,7 @@ restart: m)); l3 = pmap_l2_to_l3(l2, pv->pv_va); if ((pmap_load(l3) & (PTE_D | PTE_W)) == (PTE_D | PTE_W)) { - pmap_clear_bits(l3, PTE_D); + pmap_clear_bits(l3, PTE_D | PTE_W); pmap_invalidate_page(pmap, pv->pv_va); } PMAP_UNLOCK(pmap); From owner-svn-src-all@freebsd.org Mon Jul 15 17:13:33 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9531CBF2A6; Mon, 15 Jul 2019 17:13:33 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 819946C6D8; Mon, 15 Jul 2019 17:13:33 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6304D20D08; Mon, 15 Jul 2019 17:13:33 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6FHDX4w003354; Mon, 15 Jul 2019 17:13:33 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6FHDWtO003352; Mon, 15 Jul 2019 17:13:32 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201907151713.x6FHDWtO003352@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 15 Jul 2019 17:13:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350004 - in head/sys/arm64: arm64 include X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys/arm64: arm64 include X-SVN-Commit-Revision: 350004 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 819946C6D8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jul 2019 17:13:33 -0000 Author: markj Date: Mon Jul 15 17:13:32 2019 New Revision: 350004 URL: https://svnweb.freebsd.org/changeset/base/350004 Log: Implement software access and dirty bit management for arm64. Previously the arm64 pmap did no reference or modification tracking; all mappings were treated as referenced and all read-write mappings were treated as dirty. This change implements software management of these attributes. Dirty bit management is implemented to emulate ARMv8.1's optional hardware dirty bit modifier management, following a suggestion from alc. In particular, a mapping with ATTR_SW_DBM set is logically writeable and is dirty if the ATTR_AP_RW_BIT bit is clear. Mappings with ATTR_AP_RW_BIT set are write-protected, and a write access will trigger a permission fault. pmap_fault() handles permission faults for such mappings and marks the page dirty by clearing ATTR_AP_RW_BIT, thus mapping the page read-write. Reviewed by: alc MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20907 Modified: head/sys/arm64/arm64/pmap.c head/sys/arm64/arm64/trap.c head/sys/arm64/include/pte.h Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Mon Jul 15 15:45:33 2019 (r350003) +++ head/sys/arm64/arm64/pmap.c Mon Jul 15 17:13:32 2019 (r350004) @@ -217,6 +217,13 @@ __FBSDID("$FreeBSD$"); #define VM_PAGE_TO_PV_LIST_LOCK(m) \ PHYS_TO_PV_LIST_LOCK(VM_PAGE_TO_PHYS(m)) +/* + * The presence of this flag indicates that the mapping is writeable. + * If the ATTR_AP_RO bit is also set, then the mapping is clean, otherwise it is + * dirty. This flag may only be set on managed mappings. + */ +static pt_entry_t ATTR_SW_DBM; + struct pmap kernel_pmap_store; /* Used for mapping ACPI memory before VM is initialized */ @@ -315,11 +322,12 @@ static __inline vm_page_t pmap_remove_pt_page(pmap_t p * They need to be atomic as the System MMU may write to the table at * the same time as the CPU. */ -#define pmap_clear(table) atomic_store_64(table, 0) -#define pmap_load_store(table, entry) atomic_swap_64(table, entry) -#define pmap_set(table, mask) atomic_set_64(table, mask) -#define pmap_load_clear(table) atomic_swap_64(table, 0) -#define pmap_load(table) (*table) +#define pmap_clear(table) atomic_store_64(table, 0) +#define pmap_clear_bits(table, bits) atomic_clear_64(table, bits) +#define pmap_load(table) (*table) +#define pmap_load_clear(table) atomic_swap_64(table, 0) +#define pmap_load_store(table, entry) atomic_swap_64(table, entry) +#define pmap_set_bits(table, bits) atomic_set_64(table, bits) /********************/ /* Inline functions */ @@ -532,15 +540,18 @@ pmap_l3_valid(pt_entry_t l3) CTASSERT(L1_BLOCK == L2_BLOCK); /* - * Checks if the page is dirty. We currently lack proper tracking of this on - * arm64 so for now assume is a page mapped as rw was accessed it is. + * Checks if the PTE is dirty. */ static inline int pmap_pte_dirty(pt_entry_t pte) { - return ((pte & (ATTR_AF | ATTR_AP_RW_BIT)) == - (ATTR_AF | ATTR_AP(ATTR_AP_RW))); + KASSERT((pte & ATTR_SW_MANAGED) != 0, ("pte %#lx is unmanaged", pte)); + KASSERT((pte & (ATTR_AP_RW_BIT | ATTR_SW_DBM)) != 0, + ("pte %#lx is writeable and missing ATTR_SW_DBM", pte)); + + return ((pte & (ATTR_AP_RW_BIT | ATTR_SW_DBM)) == + (ATTR_AP(ATTR_AP_RW) | ATTR_SW_DBM)); } static __inline void @@ -765,13 +776,18 @@ pmap_bootstrap(vm_offset_t l0pt, vm_offset_t l1pt, vm_ vm_size_t kernlen) { u_int l1_slot, l2_slot; - uint64_t kern_delta; pt_entry_t *l2; vm_offset_t va, freemempos; vm_offset_t dpcpu, msgbufpv; vm_paddr_t start_pa, pa, min_pa; + uint64_t kern_delta, reg; int i; + /* Determine whether the hardware implements DBM management. */ + reg = READ_SPECIALREG(ID_AA64MMFR1_EL1); + ATTR_SW_DBM = ID_AA64MMFR1_HAFDBS(reg) == ID_AA64MMFR1_HAFDBS_AF_DBS ? + ATTR_DBM : _ATTR_SW_DBM; + kern_delta = KERNBASE - kernstart; printf("pmap_bootstrap %lx %lx %lx\n", l1pt, kernstart, kernlen); @@ -2478,7 +2494,7 @@ pmap_remove_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_ /* * pmap_remove_l3: do the things to unmap a page in a process */ -static int +static int __unused pmap_remove_l3(pmap_t pmap, pt_entry_t *l3, vm_offset_t va, pd_entry_t l2e, struct spglist *free, struct rwlock **lockp) { @@ -2788,7 +2804,8 @@ retry: * pmap_protect_l2: do the things to protect a 2MB page in a pmap */ static void -pmap_protect_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_t sva, pt_entry_t nbits) +pmap_protect_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_t sva, pt_entry_t mask, + pt_entry_t nbits) { pd_entry_t old_l2; vm_page_t m, mt; @@ -2804,7 +2821,8 @@ pmap_protect_l2(pmap_t pmap, pt_entry_t *l2, vm_offset * Return if the L2 entry already has the desired access restrictions * in place. */ - if ((old_l2 | nbits) == old_l2) +retry: + if ((old_l2 & mask) == nbits) return; /* @@ -2819,7 +2837,8 @@ pmap_protect_l2(pmap_t pmap, pt_entry_t *l2, vm_offset vm_page_dirty(mt); } - pmap_set(l2, nbits); + if (!atomic_fcmpset_64(l2, &old_l2, (old_l2 & ~mask) | nbits)) + goto retry; /* * Since a promotion must break the 4KB page mappings before making @@ -2837,7 +2856,7 @@ pmap_protect(pmap_t pmap, vm_offset_t sva, vm_offset_t { vm_offset_t va, va_next; pd_entry_t *l0, *l1, *l2; - pt_entry_t *l3p, l3, nbits; + pt_entry_t *l3p, l3, mask, nbits; KASSERT((prot & ~VM_PROT_ALL) == 0, ("invalid prot %x", prot)); if (prot == VM_PROT_NONE) { @@ -2845,12 +2864,16 @@ pmap_protect(pmap_t pmap, vm_offset_t sva, vm_offset_t return; } - nbits = 0; - if ((prot & VM_PROT_WRITE) == 0) + mask = nbits = 0; + if ((prot & VM_PROT_WRITE) == 0) { + mask |= ATTR_AP_RW_BIT | ATTR_SW_DBM; nbits |= ATTR_AP(ATTR_AP_RO); - if ((prot & VM_PROT_EXECUTE) == 0) + } + if ((prot & VM_PROT_EXECUTE) == 0) { + mask |= ATTR_XN; nbits |= ATTR_XN; - if (nbits == 0) + } + if (mask == 0) return; PMAP_LOCK(pmap); @@ -2882,7 +2905,7 @@ pmap_protect(pmap_t pmap, vm_offset_t sva, vm_offset_t if ((pmap_load(l2) & ATTR_DESCR_MASK) == L2_BLOCK) { if (sva + L2_SIZE == va_next && eva >= va_next) { - pmap_protect_l2(pmap, l2, sva, nbits); + pmap_protect_l2(pmap, l2, sva, mask, nbits); continue; } else if (pmap_demote_l2(pmap, l2, sva) == NULL) continue; @@ -2896,6 +2919,8 @@ pmap_protect(pmap_t pmap, vm_offset_t sva, vm_offset_t va = va_next; for (l3p = pmap_l2_to_l3(l2, sva); sva != va_next; l3p++, sva += L3_SIZE) { + l3 = pmap_load(l3p); +retry: /* * Go to the next L3 entry if the current one is * invalid or already has the desired access @@ -2904,16 +2929,13 @@ pmap_protect(pmap_t pmap, vm_offset_t sva, vm_offset_t * workload, almost 1 out of 4 L3 entries already * have the desired restrictions.) */ - l3 = pmap_load(l3p); - if (!pmap_l3_valid(l3) || (l3 | nbits) == l3) { + if (!pmap_l3_valid(l3) || (l3 & mask) == nbits) { if (va != va_next) { pmap_invalidate_range(pmap, va, sva); va = va_next; } continue; } - if (va == va_next) - va = sva; /* * When a dirty read/write mapping is write protected, @@ -2924,7 +2946,10 @@ pmap_protect(pmap_t pmap, vm_offset_t sva, vm_offset_t pmap_pte_dirty(l3)) vm_page_dirty(PHYS_TO_VM_PAGE(l3 & ~ATTR_MASK)); - pmap_set(l3p, nbits); + if (!atomic_fcmpset_64(l3p, &l3, (l3 & ~mask) | nbits)) + goto retry; + if (va == va_next) + va = sva; } if (va != va_next) pmap_invalidate_range(pmap, va, sva); @@ -3059,17 +3084,32 @@ pmap_promote_l2(pmap_t pmap, pd_entry_t *l2, vm_offset firstl3 = pmap_l2_to_l3(l2, sva); newl2 = pmap_load(firstl3); - /* Check the alingment is valid */ - if (((newl2 & ~ATTR_MASK) & L2_OFFSET) != 0) { +setl2: + if (((newl2 & (~ATTR_MASK | ATTR_AF)) & L2_OFFSET) != ATTR_AF) { atomic_add_long(&pmap_l2_p_failures, 1); CTR2(KTR_PMAP, "pmap_promote_l2: failure for va %#lx" " in pmap %p", va, pmap); return; } + if ((newl2 & (ATTR_AP_RW_BIT | ATTR_SW_DBM)) == + (ATTR_AP(ATTR_AP_RO) | ATTR_SW_DBM)) { + if (!atomic_fcmpset_64(l2, &newl2, newl2 & ~ATTR_SW_DBM)) + goto setl2; + newl2 &= ~ATTR_SW_DBM; + } + pa = newl2 + L2_SIZE - PAGE_SIZE; for (l3 = firstl3 + NL3PG - 1; l3 > firstl3; l3--) { oldl3 = pmap_load(l3); +setl3: + if ((oldl3 & (ATTR_AP_RW_BIT | ATTR_SW_DBM)) == + (ATTR_AP(ATTR_AP_RO) | ATTR_SW_DBM)) { + if (!atomic_fcmpset_64(l3, &oldl3, oldl3 & + ~ATTR_SW_DBM)) + goto setl3; + oldl3 &= ~ATTR_SW_DBM; + } if (oldl3 != pa) { atomic_add_long(&pmap_l2_p_failures, 1); CTR2(KTR_PMAP, "pmap_promote_l2: failure for va %#lx" @@ -3152,8 +3192,14 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, v new_l3 |= ATTR_SW_WIRED; if (va < VM_MAXUSER_ADDRESS) new_l3 |= ATTR_AP(ATTR_AP_USER) | ATTR_PXN; - if ((m->oflags & VPO_UNMANAGED) == 0) + if ((m->oflags & VPO_UNMANAGED) == 0) { new_l3 |= ATTR_SW_MANAGED; + if ((prot & VM_PROT_WRITE) != 0) { + new_l3 |= ATTR_SW_DBM; + if ((flags & VM_PROT_WRITE) == 0) + new_l3 |= ATTR_AP(ATTR_AP_RO); + } + } CTR2(KTR_PMAP, "pmap_enter: %.16lx -> %.16lx", va, pa); @@ -3341,6 +3387,7 @@ validate: KASSERT(opa == pa, ("pmap_enter: invalid update")); if ((orig_l3 & ~ATTR_AF) != (new_l3 & ~ATTR_AF)) { /* same PA, different attributes */ + /* XXXMJ need to reload orig_l3 for hardware DBM. */ pmap_load_store(l3, new_l3); pmap_invalidate_page(pmap, va); if ((orig_l3 & ATTR_SW_MANAGED) != 0 && @@ -3403,8 +3450,10 @@ pmap_enter_2mpage(pmap_t pmap, vm_offset_t va, vm_page new_l2 = (pd_entry_t)(VM_PAGE_TO_PHYS(m) | ATTR_DEFAULT | ATTR_IDX(m->md.pv_memattr) | ATTR_AP(ATTR_AP_RO) | L2_BLOCK); - if ((m->oflags & VPO_UNMANAGED) == 0) + if ((m->oflags & VPO_UNMANAGED) == 0) { new_l2 |= ATTR_SW_MANAGED; + new_l2 &= ~ATTR_AF; + } if ((prot & VM_PROT_EXECUTE) == 0 || m->md.pv_memattr == DEVICE_MEMORY) new_l2 |= ATTR_XN; if (va < VM_MAXUSER_ADDRESS) @@ -3704,8 +3753,10 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, v /* * Now validate mapping with RO protection */ - if ((m->oflags & VPO_UNMANAGED) == 0) + if ((m->oflags & VPO_UNMANAGED) == 0) { l3_val |= ATTR_SW_MANAGED; + l3_val &= ~ATTR_AF; + } /* Sync icache before the mapping is stored to PTE */ if ((prot & VM_PROT_EXECUTE) && pmap != kernel_pmap && @@ -3834,7 +3885,7 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pmap, vm_offset_ struct rwlock *lock; struct spglist free; pd_entry_t *l0, *l1, *l2, srcptepaddr; - pt_entry_t *dst_pte, ptetemp, *src_pte; + pt_entry_t *dst_pte, mask, nbits, ptetemp, *src_pte; vm_offset_t addr, end_addr, va_next; vm_page_t dst_l2pg, dstmpte, srcmpte; @@ -3885,8 +3936,12 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pmap, vm_offset_ ((srcptepaddr & ATTR_SW_MANAGED) == 0 || pmap_pv_insert_l2(dst_pmap, addr, srcptepaddr, PMAP_ENTER_NORECLAIM, &lock))) { - (void)pmap_load_store(l2, srcptepaddr & - ~ATTR_SW_WIRED); + mask = ATTR_AF | ATTR_SW_WIRED; + nbits = 0; + if ((srcptepaddr & ATTR_SW_DBM) != 0) + nbits |= ATTR_AP_RW_BIT; + (void)pmap_load_store(l2, + (srcptepaddr & ~mask) | nbits); pmap_resident_count_inc(dst_pmap, L2_SIZE / PAGE_SIZE); atomic_add_long(&pmap_l2_mappings, 1); @@ -3930,11 +3985,13 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pmap, vm_offset_ /* * Clear the wired, modified, and accessed * (referenced) bits during the copy. - * - * XXX not yet */ - (void)pmap_load_store(dst_pte, ptetemp & - ~ATTR_SW_WIRED); + mask = ATTR_AF | ATTR_SW_WIRED; + nbits = 0; + if ((ptetemp & ATTR_SW_DBM) != 0) + nbits |= ATTR_AP_RW_BIT; + (void)pmap_load_store(dst_pte, + (ptetemp & ~mask) | nbits); pmap_resident_count_inc(dst_pmap, 1); } else { SLIST_INIT(&free); @@ -4560,7 +4617,7 @@ retry_pv_loop: } va = pv->pv_va; pte = pmap_pte(pmap, pv->pv_va, &lvl); - if ((pmap_load(pte) & ATTR_AP_RW_BIT) == ATTR_AP(ATTR_AP_RW)) + if ((pmap_load(pte) & ATTR_SW_DBM) != 0) (void)pmap_demote_l2_locked(pmap, pte, va, &lock); KASSERT(lock == VM_PAGE_TO_PV_LIST_LOCK(m), ("inconsistent pv lock %p %p for page %p", @@ -4583,13 +4640,14 @@ retry_pv_loop: } } pte = pmap_pte(pmap, pv->pv_va, &lvl); -retry: oldpte = pmap_load(pte); - if ((oldpte & ATTR_AP_RW_BIT) == ATTR_AP(ATTR_AP_RW)) { - if (!atomic_cmpset_long(pte, oldpte, - oldpte | ATTR_AP(ATTR_AP_RO))) +retry: + if ((oldpte & ATTR_SW_DBM) != 0) { + if (!atomic_fcmpset_long(pte, &oldpte, + (oldpte | ATTR_AP_RW_BIT) & ~ATTR_SW_DBM)) goto retry; - if ((oldpte & ATTR_AF) != 0) + if ((oldpte & ATTR_AP_RW_BIT) == + ATTR_AP(ATTR_AP_RW)) vm_page_dirty(m); pmap_invalidate_page(pmap, pv->pv_va); } @@ -4599,13 +4657,6 @@ retry: vm_page_aflag_clear(m, PGA_WRITEABLE); } -static __inline boolean_t -safe_to_clear_referenced(pmap_t pmap, pt_entry_t pte) -{ - - return (FALSE); -} - /* * pmap_ts_referenced: * @@ -4631,12 +4682,10 @@ pmap_ts_referenced(vm_page_t m) struct rwlock *lock; pd_entry_t *pde, tpde; pt_entry_t *pte, tpte; - pt_entry_t *l3; vm_offset_t va; vm_paddr_t pa; - int cleared, md_gen, not_cleared, lvl, pvh_gen; + int cleared, lvl, md_gen, not_cleared, pvh_gen; struct spglist free; - bool demoted; KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_ts_referenced: page %p is not managed", m)); @@ -4683,17 +4732,18 @@ retry: */ vm_page_dirty(m); } + if ((tpte & ATTR_AF) != 0) { /* - * Since this reference bit is shared by 512 4KB - * pages, it should not be cleared every time it is - * tested. Apply a simple "hash" function on the - * physical page number, the virtual superpage number, - * and the pmap address to select one 4KB page out of - * the 512 on which testing the reference bit will - * result in clearing that reference bit. This - * function is designed to avoid the selection of the - * same 4KB page for every 2MB page mapping. + * Since this reference bit is shared by 512 4KB pages, + * it should not be cleared every time it is tested. + * Apply a simple "hash" function on the physical page + * number, the virtual superpage number, and the pmap + * address to select one 4KB page out of the 512 on + * which testing the reference bit will result in + * clearing that reference bit. This function is + * designed to avoid the selection of the same 4KB page + * for every 2MB page mapping. * * On demotion, a mapping that hasn't been referenced * is simply destroyed. To avoid the possibility of a @@ -4705,39 +4755,9 @@ retry: if ((((pa >> PAGE_SHIFT) ^ (pv->pv_va >> L2_SHIFT) ^ (uintptr_t)pmap) & (Ln_ENTRIES - 1)) == 0 && (tpte & ATTR_SW_WIRED) == 0) { - if (safe_to_clear_referenced(pmap, tpte)) { - /* - * TODO: We don't handle the access - * flag at all. We need to be able - * to set it in the exception handler. - */ - panic("ARM64TODO: " - "safe_to_clear_referenced\n"); - } else if (pmap_demote_l2_locked(pmap, pte, - pv->pv_va, &lock) != NULL) { - demoted = true; - va += VM_PAGE_TO_PHYS(m) - - (tpte & ~ATTR_MASK); - l3 = pmap_l2_to_l3(pte, va); - pmap_remove_l3(pmap, l3, va, - pmap_load(pte), NULL, &lock); - } else - demoted = true; - - if (demoted) { - /* - * The superpage mapping was removed - * entirely and therefore 'pv' is no - * longer valid. - */ - if (pvf == pv) - pvf = NULL; - pv = NULL; - } + pmap_clear_bits(pte, ATTR_AF); + pmap_invalidate_page(pmap, pv->pv_va); cleared++; - KASSERT(lock == VM_PAGE_TO_PV_LIST_LOCK(m), - ("inconsistent pv lock %p %p for page %p", - lock, VM_PAGE_TO_PV_LIST_LOCK(m), m)); } else not_cleared++; } @@ -4782,29 +4802,10 @@ small_mappings: if (pmap_pte_dirty(tpte)) vm_page_dirty(m); if ((tpte & ATTR_AF) != 0) { - if (safe_to_clear_referenced(pmap, tpte)) { - /* - * TODO: We don't handle the access flag - * at all. We need to be able to set it in - * the exception handler. - */ - panic("ARM64TODO: safe_to_clear_referenced\n"); - } else if ((tpte & ATTR_SW_WIRED) == 0) { - /* - * Wired pages cannot be paged out so - * doing accessed bit emulation for - * them is wasted effort. We do the - * hard work for unwired pages only. - */ - pmap_remove_l3(pmap, pte, pv->pv_va, tpde, - &free, &lock); + if ((tpte & ATTR_SW_WIRED) == 0) { + pmap_clear_bits(pte, ATTR_AF); + pmap_invalidate_page(pmap, pv->pv_va); cleared++; - if (pvf == pv) - pvf = NULL; - pv = NULL; - KASSERT(lock == VM_PAGE_TO_PV_LIST_LOCK(m), - ("inconsistent pv lock %p %p for page %p", - lock, VM_PAGE_TO_PV_LIST_LOCK(m), m)); } else not_cleared++; } @@ -4839,6 +4840,14 @@ pmap_advise(pmap_t pmap, vm_offset_t sva, vm_offset_t void pmap_clear_modify(vm_page_t m) { + struct md_page *pvh; + struct rwlock *lock; + pmap_t pmap; + pv_entry_t next_pv, pv; + pd_entry_t *l2, oldl2; + pt_entry_t *l3, oldl3; + vm_offset_t va; + int md_gen, pvh_gen; KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_clear_modify: page %p is not managed", m)); @@ -4847,14 +4856,81 @@ pmap_clear_modify(vm_page_t m) ("pmap_clear_modify: page %p is exclusive busied", m)); /* - * If the page is not PGA_WRITEABLE, then no PTEs can have PG_M set. - * If the object containing the page is locked and the page is not + * If the page is not PGA_WRITEABLE, then no PTEs can have ATTR_SW_DBM + * set. If the object containing the page is locked and the page is not * exclusive busied, then PGA_WRITEABLE cannot be concurrently set. */ if ((m->aflags & PGA_WRITEABLE) == 0) return; - - /* ARM64TODO: We lack support for tracking if a page is modified */ + pvh = (m->flags & PG_FICTITIOUS) != 0 ? &pv_dummy : + pa_to_pvh(VM_PAGE_TO_PHYS(m)); + lock = VM_PAGE_TO_PV_LIST_LOCK(m); + rw_wlock(lock); +restart: + TAILQ_FOREACH_SAFE(pv, &pvh->pv_list, pv_next, next_pv) { + pmap = PV_PMAP(pv); + if (!PMAP_TRYLOCK(pmap)) { + pvh_gen = pvh->pv_gen; + rw_wunlock(lock); + PMAP_LOCK(pmap); + rw_wlock(lock); + if (pvh_gen != pvh->pv_gen) { + PMAP_UNLOCK(pmap); + goto restart; + } + } + va = pv->pv_va; + l2 = pmap_l2(pmap, va); + oldl2 = pmap_load(l2); + if ((oldl2 & ATTR_SW_DBM) != 0) { + if (pmap_demote_l2_locked(pmap, l2, va, &lock)) { + if ((oldl2 & ATTR_SW_WIRED) == 0) { + /* + * Write protect the mapping to a + * single page so that a subsequent + * write access may repromote. + */ + va += VM_PAGE_TO_PHYS(m) - + (oldl2 & ~ATTR_MASK); + l3 = pmap_l2_to_l3(l2, va); + oldl3 = pmap_load(l3); + if (pmap_l3_valid(oldl3)) { + while (!atomic_fcmpset_long(l3, + &oldl3, (oldl3 & ~ATTR_SW_DBM) | + ATTR_AP(ATTR_AP_RO))) + cpu_spinwait(); + vm_page_dirty(m); + pmap_invalidate_page(pmap, va); + } + } + } + } + PMAP_UNLOCK(pmap); + } + TAILQ_FOREACH(pv, &m->md.pv_list, pv_next) { + pmap = PV_PMAP(pv); + if (!PMAP_TRYLOCK(pmap)) { + md_gen = m->md.pv_gen; + pvh_gen = pvh->pv_gen; + rw_wunlock(lock); + PMAP_LOCK(pmap); + rw_wlock(lock); + if (pvh_gen != pvh->pv_gen || md_gen != m->md.pv_gen) { + PMAP_UNLOCK(pmap); + goto restart; + } + } + l2 = pmap_l2(pmap, pv->pv_va); + l3 = pmap_l2_to_l3(l2, pv->pv_va); + oldl3 = pmap_load(l3); + if (pmap_l3_valid(oldl3) && + (oldl3 & (ATTR_AP_RW_BIT | ATTR_SW_DBM)) == ATTR_SW_DBM) { + pmap_set_bits(l3, ATTR_AP(ATTR_AP_RO)); + pmap_invalidate_page(pmap, pv->pv_va); + } + PMAP_UNLOCK(pmap); + } + rw_wunlock(lock); } void * @@ -5328,14 +5404,15 @@ pmap_demote_l2_locked(pmap_t pmap, pt_entry_t *l2, vm_ pmap_resident_count_inc(pmap, 1); } } - l3phys = VM_PAGE_TO_PHYS(ml3); l3 = (pt_entry_t *)PHYS_TO_DMAP(l3phys); - /* Address the range points at */ phys = oldl2 & ~ATTR_MASK; /* The attributed from the old l2 table to be copied */ newl3 = (oldl2 & (ATTR_MASK & ~ATTR_DESCR_MASK)) | L3_PAGE; + KASSERT((oldl2 & (ATTR_AP_RW_BIT | ATTR_SW_DBM)) != + (ATTR_AP(ATTR_AP_RO) | ATTR_SW_DBM), + ("pmap_demote_l2: L2 entry is writeable but not dirty")); /* * If the page table page is not leftover from an earlier promotion, @@ -5442,15 +5519,16 @@ retry: panic("pmap_mincore: invalid level %d", lvl); } + managed = (tpte & ATTR_SW_MANAGED) != 0; val = MINCORE_INCORE; if (lvl != 3) val |= MINCORE_SUPER; - if (pmap_pte_dirty(tpte)) + if ((managed && pmap_pte_dirty(tpte)) || (!managed && + (tpte & ATTR_AP_RW_BIT) == ATTR_AP(ATTR_AP_RW))) val |= MINCORE_MODIFIED | MINCORE_MODIFIED_OTHER; if ((tpte & ATTR_AF) == ATTR_AF) val |= MINCORE_REFERENCED | MINCORE_REFERENCED_OTHER; - managed = (tpte & ATTR_SW_MANAGED) == ATTR_SW_MANAGED; pa = (tpte & ~ATTR_MASK) | (addr & mask); } else managed = false; @@ -5560,22 +5638,58 @@ pmap_sync_icache(pmap_t pmap, vm_offset_t va, vm_size_ int pmap_fault(pmap_t pmap, uint64_t esr, uint64_t far) { -#ifdef SMP + pt_entry_t *pte; register_t intr; - uint64_t par; + uint64_t ec, par; + int lvl, rv; - switch (ESR_ELx_EXCEPTION(esr)) { + rv = KERN_FAILURE; + + ec = ESR_ELx_EXCEPTION(esr); + switch (ec) { case EXCP_INSN_ABORT_L: case EXCP_INSN_ABORT: case EXCP_DATA_ABORT_L: case EXCP_DATA_ABORT: break; default: - return (KERN_FAILURE); + return (rv); } - /* Data and insn aborts use same encoding for FCS field. */ + /* Data and insn aborts use same encoding for FSC field. */ switch (esr & ISS_DATA_DFSC_MASK) { + case ISS_DATA_DFSC_AFF_L1: + case ISS_DATA_DFSC_AFF_L2: + case ISS_DATA_DFSC_AFF_L3: + PMAP_LOCK(pmap); + pte = pmap_pte(pmap, far, &lvl); + if (pte != NULL) { + pmap_set_bits(pte, ATTR_AF); + rv = KERN_SUCCESS; + /* + * XXXMJ as an optimization we could mark the entry + * dirty if this is a write fault. + */ + } + PMAP_UNLOCK(pmap); + break; + case ISS_DATA_DFSC_PF_L1: + case ISS_DATA_DFSC_PF_L2: + case ISS_DATA_DFSC_PF_L3: + if ((ec != EXCP_DATA_ABORT_L && ec != EXCP_DATA_ABORT) || + (esr & ISS_DATA_WnR) == 0) + return (rv); + PMAP_LOCK(pmap); + pte = pmap_pte(pmap, far, &lvl); + if (pte != NULL && + (pmap_load(pte) & (ATTR_AP_RW_BIT | ATTR_SW_DBM)) == + (ATTR_AP(ATTR_AP_RO) | ATTR_SW_DBM)) { + pmap_clear_bits(pte, ATTR_AP_RW_BIT); + pmap_invalidate_page(pmap, trunc_page(far)); + rv = KERN_SUCCESS; + } + PMAP_UNLOCK(pmap); + break; case ISS_DATA_DFSC_TF_L0: case ISS_DATA_DFSC_TF_L1: case ISS_DATA_DFSC_TF_L2: @@ -5596,14 +5710,11 @@ pmap_fault(pmap_t pmap, uint64_t esr, uint64_t far) * return success to the trap handler. */ if (PAR_SUCCESS(par)) - return (KERN_SUCCESS); + rv = KERN_SUCCESS; break; - default: - break; } -#endif - return (KERN_FAILURE); + return (rv); } /* Modified: head/sys/arm64/arm64/trap.c ============================================================================== --- head/sys/arm64/arm64/trap.c Mon Jul 15 15:45:33 2019 (r350003) +++ head/sys/arm64/arm64/trap.c Mon Jul 15 17:13:32 2019 (r350004) @@ -192,32 +192,16 @@ data_abort(struct thread *td, struct trapframe *frame, } /* - * The call to pmap_fault can be dangerous when coming from the - * kernel as it may be not be able to lock the pmap to check if - * the address is now valid. Because of this we filter the cases - * when we are not going to see superpage activity. + * Try to handle translation, access flag, and permission faults. + * Translation faults may occur as a result of the required + * break-before-make sequence used when promoting or demoting + * superpages. Such faults must not occur while holding the pmap lock, + * or pmap_fault() will recurse on that lock. */ - if (!lower) { - /* - * We may fault in a DMAP region due to a superpage being - * unmapped when the access took place. - */ - if (map == kernel_map && !VIRT_IN_DMAP(far)) - goto no_pmap_fault; - /* - * We can also fault in the userspace handling functions, - * e.g. copyin. In these cases we will have set a fault - * handler so we can check if this is set before calling - * pmap_fault. - */ - if (map != kernel_map && pcb->pcb_onfault == 0) - goto no_pmap_fault; - } - - if (pmap_fault(map->pmap, esr, far) == KERN_SUCCESS) + if ((lower || map == kernel_map || pcb->pcb_onfault != 0) && + pmap_fault(map->pmap, esr, far) == KERN_SUCCESS) return; -no_pmap_fault: KASSERT(td->td_md.md_spinlock_count == 0, ("data abort with spinlock held")); if (td->td_critnest != 0 || WITNESS_CHECK(WARN_SLEEPOK | @@ -229,9 +213,11 @@ no_pmap_fault: } va = trunc_page(far); - ftype = ((esr >> 6) & 1) ? VM_PROT_READ | VM_PROT_WRITE : VM_PROT_READ; if (exec) - ftype |= VM_PROT_EXECUTE; + ftype = VM_PROT_EXECUTE; + else + ftype = (esr & ISS_DATA_WnR) == 0 ? VM_PROT_READ : + VM_PROT_READ | VM_PROT_WRITE; /* Fault in the page. */ error = vm_fault(map, va, ftype, VM_FAULT_NORMAL); Modified: head/sys/arm64/include/pte.h ============================================================================== --- head/sys/arm64/include/pte.h Mon Jul 15 15:45:33 2019 (r350003) +++ head/sys/arm64/include/pte.h Mon Jul 15 17:13:32 2019 (r350004) @@ -39,11 +39,12 @@ typedef uint64_t pt_entry_t; /* page table entry */ #endif /* Block and Page attributes */ -/* TODO: Add the upper attributes */ #define ATTR_MASK_H UINT64_C(0xfff0000000000000) #define ATTR_MASK_L UINT64_C(0x0000000000000fff) #define ATTR_MASK (ATTR_MASK_H | ATTR_MASK_L) /* Bits 58:55 are reserved for software */ +#define ATTR_SW_UNUSED (1UL << 58) +#define _ATTR_SW_DBM (1UL << 57) #define ATTR_SW_MANAGED (1UL << 56) #define ATTR_SW_WIRED (1UL << 55) #define ATTR_UXN (1UL << 54) From owner-svn-src-all@freebsd.org Mon Jul 15 19:18:26 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2BA55C1722; Mon, 15 Jul 2019 19:18:26 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0A928721FB; Mon, 15 Jul 2019 19:18:26 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D4707222CB; Mon, 15 Jul 2019 19:18:25 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6FJIPpb077976; Mon, 15 Jul 2019 19:18:25 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6FJIPFo077975; Mon, 15 Jul 2019 19:18:25 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201907151918.x6FJIPFo077975@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 15 Jul 2019 19:18:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350005 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 350005 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0A928721FB X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jul 2019 19:18:26 -0000 Author: kib Date: Mon Jul 15 19:18:25 2019 New Revision: 350005 URL: https://svnweb.freebsd.org/changeset/base/350005 Log: In do_sem2_wait(), balance umtx_key_get() with umtx_key_release() on retry. Reported by: ler Bisected and reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 12 days Modified: head/sys/kern/kern_umtx.c Modified: head/sys/kern/kern_umtx.c ============================================================================== --- head/sys/kern/kern_umtx.c Mon Jul 15 17:13:32 2019 (r350004) +++ head/sys/kern/kern_umtx.c Mon Jul 15 19:18:25 2019 (r350005) @@ -3316,14 +3316,13 @@ do_sem2_wait(struct thread *td, struct _usem2 *sem, st uq = td->td_umtxq; flags = fuword32(&sem->_flags); - error = umtx_key_get(sem, TYPE_SEM, GET_SHARE(flags), &uq->uq_key); - if (error != 0) - return (error); - if (timeout != NULL) abs_timeout_init2(&timo, timeout); again: + error = umtx_key_get(sem, TYPE_SEM, GET_SHARE(flags), &uq->uq_key); + if (error != 0) + return (error); umtxq_lock(&uq->uq_key); umtxq_busy(&uq->uq_key); umtxq_insert(uq); From owner-svn-src-all@freebsd.org Mon Jul 15 20:12:55 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 51CF9C2A22; Mon, 15 Jul 2019 20:12:55 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 32E5474DE9; Mon, 15 Jul 2019 20:12:55 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 07E8B22DC7; Mon, 15 Jul 2019 20:12:55 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6FKCs1M014186; Mon, 15 Jul 2019 20:12:54 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6FKCssH014185; Mon, 15 Jul 2019 20:12:54 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201907152012.x6FKCssH014185@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Mon, 15 Jul 2019 20:12:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350006 - stable/12/sys/dev/netmap X-SVN-Group: stable-12 X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: stable/12/sys/dev/netmap X-SVN-Commit-Revision: 350006 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 32E5474DE9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.94)[-0.940,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jul 2019 20:12:55 -0000 Author: vmaffione Date: Mon Jul 15 20:12:54 2019 New Revision: 350006 URL: https://svnweb.freebsd.org/changeset/base/350006 Log: MFC r349966 netmap: fix bug introduced by r349752 r349752 introduced a NULL pointer reference bug in the emulated netmap code. Reported by: lwhsu Modified: stable/12/sys/dev/netmap/netmap_generic.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/netmap/netmap_generic.c ============================================================================== --- stable/12/sys/dev/netmap/netmap_generic.c Mon Jul 15 19:18:25 2019 (r350005) +++ stable/12/sys/dev/netmap/netmap_generic.c Mon Jul 15 20:12:54 2019 (r350006) @@ -1126,7 +1126,8 @@ generic_netmap_attach(struct ifnet *ifp) nm_os_generic_set_features(gna); - nm_prinf("Emulated adapter for %s created (prev was %s)", na->name, gna->prev->name); + nm_prinf("Emulated adapter for %s created (prev was %s)", na->name, + gna->prev ? gna->prev->name : "NULL"); return retval; } From owner-svn-src-all@freebsd.org Mon Jul 15 20:14:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4CD19C2B2D; Mon, 15 Jul 2019 20:14:31 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 006DF74FBA; Mon, 15 Jul 2019 20:14:31 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C6C9022DC8; Mon, 15 Jul 2019 20:14:30 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6FKEUL2014320; Mon, 15 Jul 2019 20:14:30 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6FKEU1b014319; Mon, 15 Jul 2019 20:14:30 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201907152014.x6FKEU1b014319@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Mon, 15 Jul 2019 20:14:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r350007 - stable/11/sys/dev/netmap X-SVN-Group: stable-11 X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: stable/11/sys/dev/netmap X-SVN-Commit-Revision: 350007 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 006DF74FBA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.94)[-0.940,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jul 2019 20:14:31 -0000 Author: vmaffione Date: Mon Jul 15 20:14:30 2019 New Revision: 350007 URL: https://svnweb.freebsd.org/changeset/base/350007 Log: MFC r349966 netmap: fix bug introduced by r349752 r349752 introduced a NULL pointer reference bug in the emulated netmap code. Reported by: lwhsu Modified: stable/11/sys/dev/netmap/netmap_generic.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/netmap/netmap_generic.c ============================================================================== --- stable/11/sys/dev/netmap/netmap_generic.c Mon Jul 15 20:12:54 2019 (r350006) +++ stable/11/sys/dev/netmap/netmap_generic.c Mon Jul 15 20:14:30 2019 (r350007) @@ -1124,7 +1124,8 @@ generic_netmap_attach(struct ifnet *ifp) nm_os_generic_set_features(gna); - nm_prinf("Emulated adapter for %s created (prev was %s)", na->name, gna->prev->name); + nm_prinf("Emulated adapter for %s created (prev was %s)", na->name, + gna->prev ? gna->prev->name : "NULL"); return retval; } From owner-svn-src-all@freebsd.org Mon Jul 15 20:25:42 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DAE28C2E76; Mon, 15 Jul 2019 20:25:42 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B40F875724; Mon, 15 Jul 2019 20:25:42 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8AF1B22F80; Mon, 15 Jul 2019 20:25:42 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6FKPgrc020382; Mon, 15 Jul 2019 20:25:42 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6FKPfRA020377; Mon, 15 Jul 2019 20:25:41 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201907152025.x6FKPfRA020377@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 15 Jul 2019 20:25:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350008 - head/sbin/camcontrol X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sbin/camcontrol X-SVN-Commit-Revision: 350008 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B40F875724 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.95)[-0.946,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jul 2019 20:25:42 -0000 Author: imp Date: Mon Jul 15 20:25:41 2019 New Revision: 350008 URL: https://svnweb.freebsd.org/changeset/base/350008 Log: Use the more proper term of SATL instead of ATA_BEHIND_SCSI. Most people know SAS attached SATA devices by the name SAT or SATL (with the latter being a little more common). Change the device type ATA_BEHIND_SCSI to SATL since it's more specific and meaningful. Suggested by: scottl@ Modified: head/sbin/camcontrol/camcontrol.c head/sbin/camcontrol/camcontrol.h head/sbin/camcontrol/epc.c head/sbin/camcontrol/fwdownload.c head/sbin/camcontrol/zone.c Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Mon Jul 15 20:14:30 2019 (r350007) +++ head/sbin/camcontrol/camcontrol.c Mon Jul 15 20:25:41 2019 (r350008) @@ -5391,7 +5391,7 @@ get_device_type(struct cam_device *dev, int retry_coun retval = dev_has_vpd_page(dev, SVPD_ATA_INFORMATION, retry_count, timeout, verbosemode); if (retval == 1) - *devtype = CC_DT_ATA_BEHIND_SCSI; + *devtype = CC_DT_SATL; else *devtype = CC_DT_SCSI; Modified: head/sbin/camcontrol/camcontrol.h ============================================================================== --- head/sbin/camcontrol/camcontrol.h Mon Jul 15 20:14:30 2019 (r350007) +++ head/sbin/camcontrol/camcontrol.h Mon Jul 15 20:25:41 2019 (r350008) @@ -42,7 +42,7 @@ typedef enum { typedef enum { CC_DT_NONE, CC_DT_SCSI, - CC_DT_ATA_BEHIND_SCSI, + CC_DT_SATL, CC_DT_ATA, CC_DT_NVME, CC_DT_MMCSD, Modified: head/sbin/camcontrol/epc.c ============================================================================== --- head/sbin/camcontrol/epc.c Mon Jul 15 20:14:30 2019 (r350007) +++ head/sbin/camcontrol/epc.c Mon Jul 15 20:25:41 2019 (r350008) @@ -767,7 +767,7 @@ epc(struct cam_device *device, int argc, char **argv, switch (devtype) { case CC_DT_ATA: - case CC_DT_ATA_BEHIND_SCSI: + case CC_DT_SATL: break; default: warnx("The epc subcommand only works with ATA protocol " Modified: head/sbin/camcontrol/fwdownload.c ============================================================================== --- head/sbin/camcontrol/fwdownload.c Mon Jul 15 20:14:30 2019 (r350007) +++ head/sbin/camcontrol/fwdownload.c Mon Jul 15 20:25:41 2019 (r350008) @@ -694,7 +694,7 @@ fw_check_device_ready(struct cam_device *dev, camcontr /*sense_len*/ SSD_FULL_SIZE, /*timeout*/ 5000); break; - case CC_DT_ATA_BEHIND_SCSI: + case CC_DT_SATL: case CC_DT_ATA: { retval = build_ata_cmd(ccb, /*retries*/ 1, @@ -853,7 +853,7 @@ fw_download_img(struct cam_device *cam_dev, struct fw_ timeout ? timeout : WB_TIMEOUT); /* timeout*/ break; case CC_DT_ATA: - case CC_DT_ATA_BEHIND_SCSI: { + case CC_DT_SATL: { uint32_t off; off = (uint32_t)(pkt_ptr - buf); @@ -969,7 +969,7 @@ fwdownload(struct cam_device *device, int argc, char * errx(1, "Unable to determine device type"); if ((devtype == CC_DT_ATA) - || (devtype == CC_DT_ATA_BEHIND_SCSI)) { + || (devtype == CC_DT_SATL)) { ccb = cam_getccb(device); if (ccb == NULL) { warnx("couldn't allocate CCB"); Modified: head/sbin/camcontrol/zone.c ============================================================================== --- head/sbin/camcontrol/zone.c Mon Jul 15 20:14:30 2019 (r350007) +++ head/sbin/camcontrol/zone.c Mon Jul 15 20:25:41 2019 (r350008) @@ -466,7 +466,7 @@ restart_report: /*timeout*/ timeout ? timeout : 60000); break; case CC_DT_ATA: - case CC_DT_ATA_BEHIND_SCSI: { + case CC_DT_SATL: { uint8_t command = 0; uint8_t protocol = 0; uint16_t features = 0, sector_count = 0; @@ -558,7 +558,7 @@ restart_report: /*timeout*/ timeout ? timeout : 60000); break; case CC_DT_ATA: - case CC_DT_ATA_BEHIND_SCSI: { + case CC_DT_SATL: { uint8_t command = 0; uint8_t protocol = 0; uint16_t features = 0, sector_count = 0; From owner-svn-src-all@freebsd.org Mon Jul 15 20:25:51 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4B85EC2E95; Mon, 15 Jul 2019 20:25:51 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2954F757F8; Mon, 15 Jul 2019 20:25:51 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8B52322F81; Mon, 15 Jul 2019 20:25:49 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6FKPnG8020442; Mon, 15 Jul 2019 20:25:49 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6FKPnY2020441; Mon, 15 Jul 2019 20:25:49 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201907152025.x6FKPnY2020441@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Mon, 15 Jul 2019 20:25:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350009 - stable/12/sys/dev/netmap X-SVN-Group: stable-12 X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: stable/12/sys/dev/netmap X-SVN-Commit-Revision: 350009 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2954F757F8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.94)[-0.940,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jul 2019 20:25:51 -0000 Author: vmaffione Date: Mon Jul 15 20:25:49 2019 New Revision: 350009 URL: https://svnweb.freebsd.org/changeset/base/350009 Log: MFC r349581 netmap: fix two panics with emulated adapter This patch fixes 2 panics. The first one is due to the current VNET not being set in the emulated adapter transmission path. The second one is caused by the M_PKTHDR flag not being set when preallocated mbufs are recycled in the transmit path. Submitted by: aleksandr.fedorov@itglobal.com Reviewed by: vmaffione Differential Revision: https://reviews.freebsd.org/D20824 Modified: stable/12/sys/dev/netmap/netmap_freebsd.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/netmap/netmap_freebsd.c ============================================================================== --- stable/12/sys/dev/netmap/netmap_freebsd.c Mon Jul 15 20:25:41 2019 (r350008) +++ stable/12/sys/dev/netmap/netmap_freebsd.c Mon Jul 15 20:25:49 2019 (r350009) @@ -443,6 +443,7 @@ nm_os_generic_xmit_frame(struct nm_os_gen_arg *a) m->m_ext.ext_size = len; #endif /* __FreeBSD_version >= 1100000 */ + m->m_flags |= M_PKTHDR; m->m_len = m->m_pkthdr.len = len; /* mbuf refcnt is not contended, no need to use atomic @@ -451,7 +452,9 @@ nm_os_generic_xmit_frame(struct nm_os_gen_arg *a) M_HASHTYPE_SET(m, M_HASHTYPE_OPAQUE); m->m_pkthdr.flowid = a->ring_nr; m->m_pkthdr.rcvif = ifp; /* used for tx notification */ + CURVNET_SET(ifp->if_vnet); ret = NA(ifp)->if_transmit(ifp, m); + CURVNET_RESTORE(); return ret ? -1 : 0; } From owner-svn-src-all@freebsd.org Mon Jul 15 20:38:56 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EC376C36AD; Mon, 15 Jul 2019 20:38:56 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CDBFD76264; Mon, 15 Jul 2019 20:38:56 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A85D92313F; Mon, 15 Jul 2019 20:38:56 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6FKcu2p026561; Mon, 15 Jul 2019 20:38:56 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6FKcukE026560; Mon, 15 Jul 2019 20:38:56 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201907152038.x6FKcukE026560@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Mon, 15 Jul 2019 20:38:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r350010 - stable/11/sys/dev/netmap X-SVN-Group: stable-11 X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: stable/11/sys/dev/netmap X-SVN-Commit-Revision: 350010 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CDBFD76264 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.94)[-0.940,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jul 2019 20:38:57 -0000 Author: vmaffione Date: Mon Jul 15 20:38:56 2019 New Revision: 350010 URL: https://svnweb.freebsd.org/changeset/base/350010 Log: MFC r349581 netmap: fix two panics with emulated adapter This patch fixes 2 panics. The first one is due to the current VNET not being set in the emulated adapter transmission path. The second one is caused by the M_PKTHDR flag not being set when preallocated mbufs are recycled in the transmit path. Submitted by: aleksandr.fedorov@itglobal.com Reviewed by: vmaffione Differential Revision: https://reviews.freebsd.org/D20824 Modified: stable/11/sys/dev/netmap/netmap_freebsd.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/netmap/netmap_freebsd.c ============================================================================== --- stable/11/sys/dev/netmap/netmap_freebsd.c Mon Jul 15 20:25:49 2019 (r350009) +++ stable/11/sys/dev/netmap/netmap_freebsd.c Mon Jul 15 20:38:56 2019 (r350010) @@ -441,6 +441,7 @@ nm_os_generic_xmit_frame(struct nm_os_gen_arg *a) m->m_ext.ext_size = len; #endif /* __FreeBSD_version >= 1100000 */ + m->m_flags |= M_PKTHDR; m->m_len = m->m_pkthdr.len = len; /* mbuf refcnt is not contended, no need to use atomic @@ -449,7 +450,9 @@ nm_os_generic_xmit_frame(struct nm_os_gen_arg *a) M_HASHTYPE_SET(m, M_HASHTYPE_OPAQUE); m->m_pkthdr.flowid = a->ring_nr; m->m_pkthdr.rcvif = ifp; /* used for tx notification */ + CURVNET_SET(ifp->if_vnet); ret = NA(ifp)->if_transmit(ifp, m); + CURVNET_RESTORE(); return ret ? -1 : 0; } From owner-svn-src-all@freebsd.org Mon Jul 15 20:45:01 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CE44CC38F0; Mon, 15 Jul 2019 20:45:01 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AFFB376761; Mon, 15 Jul 2019 20:45:01 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8DCB323313; Mon, 15 Jul 2019 20:45:01 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6FKj1Sl032851; Mon, 15 Jul 2019 20:45:01 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6FKj1fh032850; Mon, 15 Jul 2019 20:45:01 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201907152045.x6FKj1fh032850@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 15 Jul 2019 20:45:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350011 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 350011 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AFFB376761 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.95)[-0.945,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jul 2019 20:45:01 -0000 Author: tuexen Date: Mon Jul 15 20:45:01 2019 New Revision: 350011 URL: https://svnweb.freebsd.org/changeset/base/350011 Log: Don't free read control entries, which are still on the stream queue when adding them the the read queue fails MFC after: 1 week Modified: head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Mon Jul 15 20:38:56 2019 (r350010) +++ head/sys/netinet/sctputil.c Mon Jul 15 20:45:01 2019 (r350011) @@ -4567,12 +4567,14 @@ sctp_add_to_readq(struct sctp_inpcb *inp, if (inp_read_lock_held == 0) SCTP_INP_READ_LOCK(inp); if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_CANT_READ) { - sctp_free_remote_addr(control->whoFrom); - if (control->data) { - sctp_m_freem(control->data); - control->data = NULL; + if (!control->on_strm_q) { + sctp_free_remote_addr(control->whoFrom); + if (control->data) { + sctp_m_freem(control->data); + control->data = NULL; + } + sctp_free_a_readq(stcb, control); } - sctp_free_a_readq(stcb, control); if (inp_read_lock_held == 0) SCTP_INP_READ_UNLOCK(inp); return; @@ -4617,8 +4619,10 @@ sctp_add_to_readq(struct sctp_inpcb *inp, control->tail_mbuf = prev; } else { /* Everything got collapsed out?? */ - sctp_free_remote_addr(control->whoFrom); - sctp_free_a_readq(stcb, control); + if (!control->on_strm_q) { + sctp_free_remote_addr(control->whoFrom); + sctp_free_a_readq(stcb, control); + } if (inp_read_lock_held == 0) SCTP_INP_READ_UNLOCK(inp); return; From owner-svn-src-all@freebsd.org Mon Jul 15 21:16:02 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7F99BC4074; Mon, 15 Jul 2019 21:16:02 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 60B99778D5; Mon, 15 Jul 2019 21:16:02 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3962B23859; Mon, 15 Jul 2019 21:16:02 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6FLG261050269; Mon, 15 Jul 2019 21:16:02 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6FLG1Ir050266; Mon, 15 Jul 2019 21:16:01 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201907152116.x6FLG1Ir050266@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 15 Jul 2019 21:16:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350012 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 350012 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 60B99778D5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.946,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jul 2019 21:16:02 -0000 Author: jhb Date: Mon Jul 15 21:16:01 2019 New Revision: 350012 URL: https://svnweb.freebsd.org/changeset/base/350012 Log: Always set td_errno to the error value of a system call. Early errors prior to a system call did not set td_errno. This commit sets td_errno for all errors during syscallenter(). As a result, syscallret() can now always use td_errno without checking TDP_NERRNO. Reviewed by: kib MFC after: 1 month Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D20898 Modified: head/sys/kern/kern_thread.c head/sys/kern/subr_syscall.c head/sys/sys/proc.h Modified: head/sys/kern/kern_thread.c ============================================================================== --- head/sys/kern/kern_thread.c Mon Jul 15 20:45:01 2019 (r350011) +++ head/sys/kern/kern_thread.c Mon Jul 15 21:16:01 2019 (r350012) @@ -84,7 +84,7 @@ _Static_assert(offsetof(struct thread, td_pflags) == 0 "struct thread KBI td_pflags"); _Static_assert(offsetof(struct thread, td_frame) == 0x478, "struct thread KBI td_frame"); -_Static_assert(offsetof(struct thread, td_emuldata) == 0x548, +_Static_assert(offsetof(struct thread, td_emuldata) == 0x540, "struct thread KBI td_emuldata"); _Static_assert(offsetof(struct proc, p_flag) == 0xb0, "struct proc KBI p_flag"); @@ -102,7 +102,7 @@ _Static_assert(offsetof(struct thread, td_flags) == 0x "struct thread KBI td_flags"); _Static_assert(offsetof(struct thread, td_pflags) == 0xa0, "struct thread KBI td_pflags"); -_Static_assert(offsetof(struct thread, td_frame) == 0x2ec, +_Static_assert(offsetof(struct thread, td_frame) == 0x2f0, "struct thread KBI td_frame"); _Static_assert(offsetof(struct thread, td_emuldata) == 0x338, "struct thread KBI td_emuldata"); Modified: head/sys/kern/subr_syscall.c ============================================================================== --- head/sys/kern/subr_syscall.c Mon Jul 15 20:45:01 2019 (r350011) +++ head/sys/kern/subr_syscall.c Mon Jul 15 21:16:01 2019 (r350012) @@ -85,8 +85,10 @@ syscallenter(struct thread *td) (uintptr_t)td, "pid:%d", td->td_proc->p_pid, "arg0:%p", sa->args[0], "arg1:%p", sa->args[1], "arg2:%p", sa->args[2]); - if (error != 0) + if (error != 0) { + td->td_errno = error; goto retval; + } STOPEVENT(p, S_SCE, sa->narg); if ((p->p_flag & P_TRACED) != 0) { @@ -105,8 +107,10 @@ syscallenter(struct thread *td) if (KTRPOINT(td, KTR_SYSCALL)) ktrsyscall(sa->code, sa->narg, sa->args); #endif - if (error != 0) + if (error != 0) { + td->td_errno = error; goto retval; + } } #ifdef CAPABILITY_MODE @@ -116,14 +120,16 @@ syscallenter(struct thread *td) */ if (IN_CAPABILITY_MODE(td) && !(sa->callp->sy_flags & SYF_CAPENABLED)) { - error = ECAPMODE; + td->td_errno = error = ECAPMODE; goto retval; } #endif error = syscall_thread_enter(td, sa->callp); - if (error != 0) + if (error != 0) { + td->td_errno = error; goto retval; + } #ifdef KDTRACE_HOOKS /* Give the syscall:::entry DTrace probe a chance to fire. */ @@ -131,6 +137,9 @@ syscallenter(struct thread *td) (*systrace_probe_func)(sa, SYSTRACE_ENTRY, 0); #endif + /* Let system calls set td_errno directly. */ + td->td_pflags &= ~TDP_NERRNO; + AUDIT_SYSCALL_ENTER(sa->code, td); error = (sa->callp->sy_call)(td, sa->args); AUDIT_SYSCALL_EXIT(error, td); @@ -162,12 +171,12 @@ syscallenter(struct thread *td) } static inline void -syscallret(struct thread *td, int error) +syscallret(struct thread *td, int error __unused) { struct proc *p; struct syscall_args *sa; ksiginfo_t ksi; - int traced, error1; + int traced; KASSERT((td->td_pflags & TDP_FORKING) == 0, ("fork() did not clear TDP_FORKING upon completion")); @@ -176,12 +185,10 @@ syscallret(struct thread *td, int error) sa = &td->td_sa; if ((trap_enotcap || (p->p_flag2 & P2_TRAPCAP) != 0) && IN_CAPABILITY_MODE(td)) { - error1 = (td->td_pflags & TDP_NERRNO) == 0 ? error : - td->td_errno; - if (error1 == ENOTCAPABLE || error1 == ECAPMODE) { + if (td->td_errno == ENOTCAPABLE || td->td_errno == ECAPMODE) { ksiginfo_init_trap(&ksi); ksi.ksi_signo = SIGTRAP; - ksi.ksi_errno = error1; + ksi.ksi_errno = td->td_errno; ksi.ksi_code = TRAP_CAP; trapsignal(td, &ksi); } @@ -194,11 +201,9 @@ syscallret(struct thread *td, int error) #ifdef KTRACE if (KTRPOINT(td, KTR_SYSRET)) { - ktrsysret(sa->code, (td->td_pflags & TDP_NERRNO) == 0 ? - error : td->td_errno, td->td_retval[0]); + ktrsysret(sa->code, td->td_errno, td->td_retval[0]); } #endif - td->td_pflags &= ~TDP_NERRNO; if (p->p_flag & P_TRACED) { traced = 1; Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Mon Jul 15 20:45:01 2019 (r350011) +++ head/sys/sys/proc.h Mon Jul 15 21:16:01 2019 (r350012) @@ -303,6 +303,7 @@ struct thread { void *td_su; /* (k) FFS SU private */ sbintime_t td_sleeptimo; /* (t) Sleep timeout. */ int td_rtcgen; /* (s) rtc_generation of abs. sleep */ + int td_errno; /* (k) Error from last syscall. */ size_t td_vslock_sz; /* (k) amount of vslock-ed space */ struct kcov_info *td_kcov_info; /* (*) Kernel code coverage data */ #define td_endzero td_sigmask @@ -353,8 +354,6 @@ struct thread { struct kaudit_record *td_ar; /* (k) Active audit record, if any. */ struct lpohead td_lprof[2]; /* (a) lock profiling objects. */ struct kdtrace_thread *td_dtrace; /* (*) DTrace-specific data. */ - int td_errno; /* Error returned by last syscall. */ - /* LP64 hole */ struct vnet *td_vnet; /* (k) Effective vnet. */ const char *td_vnet_lpush; /* (k) Debugging vnet push / pop. */ struct trapframe *td_intr_frame;/* (k) Frame of the current irq */ From owner-svn-src-all@freebsd.org Mon Jul 15 21:25:20 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0DF6EC42B7; Mon, 15 Jul 2019 21:25:20 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5AC3677E94; Mon, 15 Jul 2019 21:25:19 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4982223A35; Mon, 15 Jul 2019 21:25:19 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6FLPJCX056501; Mon, 15 Jul 2019 21:25:19 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6FLPHs6056491; Mon, 15 Jul 2019 21:25:17 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201907152125.x6FLPHs6056491@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 15 Jul 2019 21:25:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350013 - in head/sys: amd64/amd64 amd64/ia32 arm/arm arm64/arm64 i386/i386 kern mips/mips powerpc/powerpc riscv/riscv sparc64/sparc64 X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/sys: amd64/amd64 amd64/ia32 arm/arm arm64/arm64 i386/i386 kern mips/mips powerpc/powerpc riscv/riscv sparc64/sparc64 X-SVN-Commit-Revision: 350013 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5AC3677E94 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.96)[-0.963,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jul 2019 21:25:20 -0000 Author: jhb Date: Mon Jul 15 21:25:16 2019 New Revision: 350013 URL: https://svnweb.freebsd.org/changeset/base/350013 Log: Don't pass error from syscallenter() to syscallret(). syscallret() doesn't use error anymore. Fix a few other places to permit removing the return value from syscallenter() entirely. - Remove a duplicated assertion from arm's syscall(). - Use td_errno for amd64_syscall_ret_flush_l1d. Reviewed by: kib MFC after: 1 month Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D2090 Modified: head/sys/amd64/amd64/trap.c head/sys/amd64/ia32/ia32_syscall.c head/sys/arm/arm/syscall.c head/sys/arm64/arm64/trap.c head/sys/i386/i386/trap.c head/sys/kern/subr_syscall.c head/sys/mips/mips/trap.c head/sys/powerpc/powerpc/trap.c head/sys/riscv/riscv/trap.c head/sys/sparc64/sparc64/trap.c Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Mon Jul 15 21:16:01 2019 (r350012) +++ head/sys/amd64/amd64/trap.c Mon Jul 15 21:25:16 2019 (r350013) @@ -1169,7 +1169,6 @@ SYSCTL_PROC(_machdep, OID_AUTO, syscall_ret_flush_l1d, void amd64_syscall(struct thread *td, int traced) { - int error; ksiginfo_t ksi; #ifdef DIAGNOSTIC @@ -1178,7 +1177,7 @@ amd64_syscall(struct thread *td, int traced) /* NOT REACHED */ } #endif - error = syscallenter(td); + syscallenter(td); /* * Traced syscall. @@ -1203,7 +1202,7 @@ amd64_syscall(struct thread *td, int traced) syscallname(td->td_proc, td->td_sa.code), td->td_md.md_invl_gen.gen)); - syscallret(td, error); + syscallret(td); /* * If the user-supplied value of %rip is not a canonical @@ -1216,5 +1215,5 @@ amd64_syscall(struct thread *td, int traced) if (__predict_false(td->td_frame->tf_rip >= VM_MAXUSER_ADDRESS)) set_pcb_flags(td->td_pcb, PCB_FULL_IRET); - amd64_syscall_ret_flush_l1d_inline(error); + amd64_syscall_ret_flush_l1d_inline(td->td_errno); } Modified: head/sys/amd64/ia32/ia32_syscall.c ============================================================================== --- head/sys/amd64/ia32/ia32_syscall.c Mon Jul 15 21:16:01 2019 (r350012) +++ head/sys/amd64/ia32/ia32_syscall.c Mon Jul 15 21:25:16 2019 (r350013) @@ -207,14 +207,13 @@ ia32_syscall(struct trapframe *frame) { struct thread *td; register_t orig_tf_rflags; - int error; ksiginfo_t ksi; orig_tf_rflags = frame->tf_rflags; td = curthread; td->td_frame = frame; - error = syscallenter(td); + syscallenter(td); /* * Traced syscall. @@ -228,8 +227,8 @@ ia32_syscall(struct trapframe *frame) trapsignal(td, &ksi); } - syscallret(td, error); - amd64_syscall_ret_flush_l1d(error); + syscallret(td); + amd64_syscall_ret_flush_l1d(td->td_errno); } static void Modified: head/sys/arm/arm/syscall.c ============================================================================== --- head/sys/arm/arm/syscall.c Mon Jul 15 21:16:01 2019 (r350012) +++ head/sys/arm/arm/syscall.c Mon Jul 15 21:25:16 2019 (r350013) @@ -141,14 +141,10 @@ cpu_fetch_syscall_args(struct thread *td) static void syscall(struct thread *td, struct trapframe *frame) { - int error; td->td_sa.nap = 4; - - error = syscallenter(td); - KASSERT(error != 0 || td->td_ar == NULL, - ("returning from syscall with td_ar set!")); - syscallret(td, error); + syscallenter(td); + syscallret(td); } void Modified: head/sys/arm64/arm64/trap.c ============================================================================== --- head/sys/arm64/arm64/trap.c Mon Jul 15 21:16:01 2019 (r350012) +++ head/sys/arm64/arm64/trap.c Mon Jul 15 21:25:16 2019 (r350013) @@ -137,11 +137,10 @@ cpu_fetch_syscall_args(struct thread *td) static void svc_handler(struct thread *td, struct trapframe *frame) { - int error; if ((frame->tf_esr & ESR_ELx_ISS_MASK) == 0) { - error = syscallenter(td); - syscallret(td, error); + syscallenter(td); + syscallret(td); } else { call_trapsignal(td, SIGILL, ILL_ILLOPN, (void *)frame->tf_elr); userret(td, frame); Modified: head/sys/i386/i386/trap.c ============================================================================== --- head/sys/i386/i386/trap.c Mon Jul 15 21:16:01 2019 (r350012) +++ head/sys/i386/i386/trap.c Mon Jul 15 21:25:16 2019 (r350013) @@ -1142,7 +1142,6 @@ syscall(struct trapframe *frame) { struct thread *td; register_t orig_tf_eflags; - int error; ksiginfo_t ksi; #ifdef DIAGNOSTIC @@ -1157,7 +1156,7 @@ syscall(struct trapframe *frame) td = curthread; td->td_frame = frame; - error = syscallenter(td); + syscallenter(td); /* * Traced syscall. @@ -1178,5 +1177,5 @@ syscall(struct trapframe *frame) ("System call %s returning with mangled pcb_save", syscallname(td->td_proc, td->td_sa.code))); - syscallret(td, error); + syscallret(td); } Modified: head/sys/kern/subr_syscall.c ============================================================================== --- head/sys/kern/subr_syscall.c Mon Jul 15 21:16:01 2019 (r350012) +++ head/sys/kern/subr_syscall.c Mon Jul 15 21:25:16 2019 (r350013) @@ -54,7 +54,7 @@ __FBSDID("$FreeBSD$"); #endif #include -static inline int +static inline void syscallenter(struct thread *td) { struct proc *p; @@ -167,11 +167,10 @@ syscallenter(struct thread *td) PROC_UNLOCK(p); } (p->p_sysent->sv_set_syscall_retval)(td, error); - return (error); } static inline void -syscallret(struct thread *td, int error __unused) +syscallret(struct thread *td) { struct proc *p; struct syscall_args *sa; Modified: head/sys/mips/mips/trap.c ============================================================================== --- head/sys/mips/mips/trap.c Mon Jul 15 21:16:01 2019 (r350012) +++ head/sys/mips/mips/trap.c Mon Jul 15 21:25:16 2019 (r350013) @@ -787,10 +787,8 @@ dofault: case T_SYSCALL + T_USER: { - int error; - td->td_sa.trapframe = trapframe; - error = syscallenter(td); + syscallenter(td); #if !defined(SMP) && (defined(DDB) || defined(DEBUG)) if (trp == trapdebug) @@ -806,7 +804,7 @@ dofault: * instead of being done here under a special check * for SYS_ptrace(). */ - syscallret(td, error); + syscallret(td); return (trapframe->pc); } Modified: head/sys/powerpc/powerpc/trap.c ============================================================================== --- head/sys/powerpc/powerpc/trap.c Mon Jul 15 21:16:01 2019 (r350012) +++ head/sys/powerpc/powerpc/trap.c Mon Jul 15 21:25:16 2019 (r350013) @@ -700,7 +700,6 @@ void syscall(struct trapframe *frame) { struct thread *td; - int error; td = curthread; td->td_frame = frame; @@ -715,8 +714,8 @@ syscall(struct trapframe *frame) "r"(td->td_pcb->pcb_cpu.aim.usr_vsid), "r"(USER_SLB_SLBE)); #endif - error = syscallenter(td); - syscallret(td, error); + syscallenter(td); + syscallret(td); } static int Modified: head/sys/riscv/riscv/trap.c ============================================================================== --- head/sys/riscv/riscv/trap.c Mon Jul 15 21:16:01 2019 (r350012) +++ head/sys/riscv/riscv/trap.c Mon Jul 15 21:25:16 2019 (r350013) @@ -156,13 +156,12 @@ static void svc_handler(struct trapframe *frame) { struct thread *td; - int error; td = curthread; td->td_frame = frame; - error = syscallenter(td); - syscallret(td, error); + syscallenter(td); + syscallret(td); } static void Modified: head/sys/sparc64/sparc64/trap.c ============================================================================== --- head/sys/sparc64/sparc64/trap.c Mon Jul 15 21:16:01 2019 (r350012) +++ head/sys/sparc64/sparc64/trap.c Mon Jul 15 21:25:16 2019 (r350013) @@ -593,7 +593,6 @@ void syscall(struct trapframe *tf) { struct thread *td; - int error; td = curthread; td->td_frame = tf; @@ -608,6 +607,6 @@ syscall(struct trapframe *tf) td->td_pcb->pcb_tpc = tf->tf_tpc; TF_DONE(tf); - error = syscallenter(td); - syscallret(td, error); + syscallenter(td); + syscallret(td); } From owner-svn-src-all@freebsd.org Mon Jul 15 21:26:55 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BBBCAC43E8; Mon, 15 Jul 2019 21:26:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9E6878016A; Mon, 15 Jul 2019 21:26:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8DA2D23A46; Mon, 15 Jul 2019 21:26:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6FLQthV056628; Mon, 15 Jul 2019 21:26:55 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6FLQtC1056627; Mon, 15 Jul 2019 21:26:55 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201907152126.x6FLQtC1056627@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 15 Jul 2019 21:26:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350014 - head/tests/sys/kern X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/tests/sys/kern X-SVN-Commit-Revision: 350014 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9E6878016A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.96)[-0.963,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jul 2019 21:26:55 -0000 Author: jhb Date: Mon Jul 15 21:26:55 2019 New Revision: 350014 URL: https://svnweb.freebsd.org/changeset/base/350014 Log: Add a test for PT_GET_SC_ARGS. Reviewed by: kib MFC after: 1 month Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D20899 Modified: head/tests/sys/kern/ptrace_test.c Modified: head/tests/sys/kern/ptrace_test.c ============================================================================== --- head/tests/sys/kern/ptrace_test.c Mon Jul 15 21:25:16 2019 (r350013) +++ head/tests/sys/kern/ptrace_test.c Mon Jul 15 21:26:55 2019 (r350014) @@ -3904,6 +3904,86 @@ ATF_TC_BODY(ptrace__PT_LWPINFO_stale_siginfo, tc) ATF_REQUIRE(errno == ECHILD); } +/* + * A simple test of PT_GET_SC_ARGS. + */ +ATF_TC_WITHOUT_HEAD(ptrace__syscall_args); +ATF_TC_BODY(ptrace__syscall_args, tc) +{ + struct ptrace_lwpinfo pl; + pid_t fpid, wpid; + register_t args[2]; + int events, status; + + ATF_REQUIRE((fpid = fork()) != -1); + if (fpid == 0) { + trace_me(); + kill(getpid(), 0); + exit(1); + } + + /* The first wait() should report the stop from SIGSTOP. */ + wpid = waitpid(fpid, &status, 0); + ATF_REQUIRE(wpid == fpid); + ATF_REQUIRE(WIFSTOPPED(status)); + ATF_REQUIRE(WSTOPSIG(status) == SIGSTOP); + + /* + * Continue the process ignoring the signal, but enabling + * syscall entry traps. + */ + ATF_REQUIRE(ptrace(PT_TO_SCE, fpid, (caddr_t)1, 0) == 0); + + /* + * The next stop should be the syscall entry from getpid(). + */ + wpid = waitpid(fpid, &status, 0); + ATF_REQUIRE(wpid == fpid); + ATF_REQUIRE(WIFSTOPPED(status)); + ATF_REQUIRE(WSTOPSIG(status) == SIGTRAP); + + ATF_REQUIRE(ptrace(PT_LWPINFO, wpid, (caddr_t)&pl, sizeof(pl)) != -1); + ATF_REQUIRE(pl.pl_flags & PL_FLAG_SCE); + ATF_REQUIRE(pl.pl_syscall_code == SYS_getpid); + + ATF_REQUIRE(ptrace(PT_CONTINUE, fpid, (caddr_t)1, 0) == 0); + + /* + * The next stop should be the syscall entry from kill(). + */ + wpid = waitpid(fpid, &status, 0); + ATF_REQUIRE(wpid == fpid); + ATF_REQUIRE(WIFSTOPPED(status)); + ATF_REQUIRE(WSTOPSIG(status) == SIGTRAP); + + ATF_REQUIRE(ptrace(PT_LWPINFO, wpid, (caddr_t)&pl, sizeof(pl)) != -1); + ATF_REQUIRE(pl.pl_flags & PL_FLAG_SCE); + ATF_REQUIRE(pl.pl_syscall_code == SYS_kill); + ATF_REQUIRE(pl.pl_syscall_narg == 2); + + ATF_REQUIRE(ptrace(PT_GET_SC_ARGS, wpid, (caddr_t)args, + sizeof(args)) != -1); + ATF_REQUIRE(args[0] == wpid); + ATF_REQUIRE(args[1] == 0); + + /* Disable syscall tracing and continue the child to let it exit. */ + ATF_REQUIRE(ptrace(PT_GET_EVENT_MASK, fpid, (caddr_t)&events, + sizeof(events)) == 0); + events &= ~PTRACE_SYSCALL; + ATF_REQUIRE(ptrace(PT_SET_EVENT_MASK, fpid, (caddr_t)&events, + sizeof(events)) == 0); + ATF_REQUIRE(ptrace(PT_CONTINUE, fpid, (caddr_t)1, 0) == 0); + + /* The last event should be for the child process's exit. */ + wpid = waitpid(fpid, &status, 0); + ATF_REQUIRE(WIFEXITED(status)); + ATF_REQUIRE(WEXITSTATUS(status) == 1); + + wpid = wait(&status); + ATF_REQUIRE(wpid == -1); + ATF_REQUIRE(errno == ECHILD); +} + ATF_TP_ADD_TCS(tp) { @@ -3965,6 +4045,7 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, ptrace__PT_CONTINUE_different_thread); #endif ATF_TP_ADD_TC(tp, ptrace__PT_LWPINFO_stale_siginfo); + ATF_TP_ADD_TC(tp, ptrace__syscall_args); return (atf_no_error()); } From owner-svn-src-all@freebsd.org Mon Jul 15 21:28:15 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 89EBEC44B6; Mon, 15 Jul 2019 21:28:15 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) 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 399158031E; Mon, 15 Jul 2019 21:28:15 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-4.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id BFE7C627B; Mon, 15 Jul 2019 21:28:14 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r350013 - in head/sys: amd64/amd64 amd64/ia32 arm/arm arm64/arm64 i386/i386 kern mips/mips powerpc/powerpc riscv/riscv sparc64/sparc64 From: John Baldwin To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201907152125.x6FLPHs6056491@repo.freebsd.org> Openpgp: preference=signencrypt Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: <38630be0-4b20-ebc4-dd16-e454e05264ca@FreeBSD.org> Date: Mon, 15 Jul 2019 14:28:12 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <201907152125.x6FLPHs6056491@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 399158031E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.86 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.86)[-0.864,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jul 2019 21:28:15 -0000 On 7/15/19 2:25 PM, John Baldwin wrote: > Author: jhb > Date: Mon Jul 15 21:25:16 2019 > New Revision: 350013 > URL: https://svnweb.freebsd.org/changeset/base/350013 > > Log: > Don't pass error from syscallenter() to syscallret(). > > syscallret() doesn't use error anymore. Fix a few other places to permit > removing the return value from syscallenter() entirely. > - Remove a duplicated assertion from arm's syscall(). > - Use td_errno for amd64_syscall_ret_flush_l1d. > > Reviewed by: kib > MFC after: 1 month > Sponsored by: DARPA > Differential Revision: https://reviews.freebsd.org/D2090 Bah, copy and paste fail. This should be D20905. -- John Baldwin From owner-svn-src-all@freebsd.org Mon Jul 15 21:40:58 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D2C4FC496C; Mon, 15 Jul 2019 21:40:58 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B609D80D20; Mon, 15 Jul 2019 21:40:58 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 929C923C36; Mon, 15 Jul 2019 21:40:58 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6FLewor063650; Mon, 15 Jul 2019 21:40:58 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6FLewnE063649; Mon, 15 Jul 2019 21:40:58 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201907152140.x6FLewnE063649@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 15 Jul 2019 21:40:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350015 - head/sys/dev/iicbus X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/iicbus X-SVN-Commit-Revision: 350015 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B609D80D20 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.96)[-0.963,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jul 2019 21:40:58 -0000 Author: ian Date: Mon Jul 15 21:40:58 2019 New Revision: 350015 URL: https://svnweb.freebsd.org/changeset/base/350015 Log: Fix nxprtc(4) on systems that support i2c repeat-start correctly. An obscure footnote in the datasheets for the PCx2127, PCx2129, and PCF8523 rtc chips states that the chips do not support i2c repeat-start operations. When the driver was originally written and tested, the i2c bus on that system also didn't support repeat-start and just quietly turned repeat-start operations into a stop-then-start, making it appear that the nxprtc driver was working properly. The repeat-start situation only comes up on reads, so instead of using the standard iicdev_readfrom(), use a local nxprtc_readfrom(), which is just a cut-and-pasted copy of iicdev_readfrom(), modified to send two separate start-data-stop sequences instead of using repeat-start. Modified: head/sys/dev/iicbus/nxprtc.c Modified: head/sys/dev/iicbus/nxprtc.c ============================================================================== --- head/sys/dev/iicbus/nxprtc.c Mon Jul 15 21:26:55 2019 (r350014) +++ head/sys/dev/iicbus/nxprtc.c Mon Jul 15 21:40:58 2019 (r350015) @@ -236,10 +236,43 @@ static nxprtc_compat_data compat_data[] = { }; static int +nxprtc_readfrom(device_t slavedev, uint8_t regaddr, void *buffer, + uint16_t buflen, int waithow) +{ + struct iic_msg msg; + int err; + uint8_t slaveaddr; + + /* + * Two transfers back to back with a stop and start between them; first we + * write the address-within-device, then we read from the device. This + * is used instead of the standard iicdev_readfrom() because some of the + * chips we service don't support i2c repeat-start operations (grrrrr) + * so we do two completely separate transfers with a full stop between. + */ + slaveaddr = iicbus_get_addr(slavedev); + + msg.slave = slaveaddr; + msg.flags = IIC_M_WR; + msg.len = 1; + msg.buf = ®addr; + + if ((err = iicbus_transfer_excl(slavedev, &msg, 1, waithow)) != 0) + return (err); + + msg.slave = slaveaddr; + msg.flags = IIC_M_RD; + msg.len = buflen; + msg.buf = buffer; + + return (iicbus_transfer_excl(slavedev, &msg, 1, waithow)); +} + +static int read_reg(struct nxprtc_softc *sc, uint8_t reg, uint8_t *val) { - return (iicdev_readfrom(sc->dev, reg, val, sizeof(*val), WAITFLAGS)); + return (nxprtc_readfrom(sc->dev, reg, val, sizeof(*val), WAITFLAGS)); } static int @@ -272,7 +305,7 @@ read_timeregs(struct nxprtc_softc *sc, struct time_reg if (tmr1 != tmr2) continue; } - if ((err = iicdev_readfrom(sc->dev, sc->secaddr, tregs, + if ((err = nxprtc_readfrom(sc->dev, sc->secaddr, tregs, sizeof(*tregs), WAITFLAGS)) != 0) break; } while (sc->use_timer && tregs->sec != sec); From owner-svn-src-all@freebsd.org Mon Jul 15 21:47:41 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7FE9AC4C51; Mon, 15 Jul 2019 21:47:41 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 617EE811FF; Mon, 15 Jul 2019 21:47:41 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3A5EC23DCF; Mon, 15 Jul 2019 21:47:41 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6FLlfaF068415; Mon, 15 Jul 2019 21:47:41 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6FLlfID068413; Mon, 15 Jul 2019 21:47:41 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201907152147.x6FLlfID068413@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 15 Jul 2019 21:47:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350016 - head/sys/dev/iicbus X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/iicbus X-SVN-Commit-Revision: 350016 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 617EE811FF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.96)[-0.963,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jul 2019 21:47:41 -0000 Author: ian Date: Mon Jul 15 21:47:40 2019 New Revision: 350016 URL: https://svnweb.freebsd.org/changeset/base/350016 Log: In nxprtc(4), use the countdown timer for better timekeeping resolution on PCx2129 chips too. The datasheet for the PCx2129 chips says that there is only a watchdog timer, no countdown timer. It turns out the countdown timer hardware is there and works just the same as it does on a PCx2127 chip, except that you can't use it to trigger an interrupt or toggle an output pin. We don't need interrupts or output pins, we only need to read the timer register to get sub-second resolution. So start treating the 2129 chips the same as 2127. Modified: head/sys/dev/iicbus/nxprtc.c Modified: head/sys/dev/iicbus/nxprtc.c ============================================================================== --- head/sys/dev/iicbus/nxprtc.c Mon Jul 15 21:40:58 2019 (r350015) +++ head/sys/dev/iicbus/nxprtc.c Mon Jul 15 21:47:40 2019 (r350016) @@ -33,8 +33,8 @@ __FBSDID("$FreeBSD$"); * - PCA8565 = like PCF8563, automotive temperature range * - PCF8523 = low power, countdown timer, oscillator freq tuning, 2 timers * - PCF2127 = like PCF8523, industrial, tcxo, tamper/ts, i2c & spi, 512B ram - * - PCA2129 = like PCF8523, automotive, tcxo, tamper/ts, i2c & spi, no timer - * - PCF2129 = like PCF8523, industrial, tcxo, tamper/ts, i2c & spi, no timer + * - PCA2129 = like PCF8523, automotive, tcxo, tamper/ts, i2c & spi, (note 1) + * - PCF2129 = like PCF8523, industrial, tcxo, tamper/ts, i2c & spi, (note 1) * * Most chips have a countdown timer, ostensibly intended to generate periodic * interrupt signals on an output pin. The timer is driven from the same @@ -42,6 +42,13 @@ __FBSDID("$FreeBSD$"); * in sync when the STOP bit is cleared after the time and timer registers are * set. The timer register can also be read on the fly, so we use it to count * fractional seconds and get a resolution of ~15ms. + * + * [1] Note that the datasheets for the PCx2129 chips state that they have only + * a watchdog timer, not a countdown timer. Empirical testing shows that the + * countdown timer is actually there and it works fine, except that it can't + * trigger an interrupt or toggle an output pin like it can on other chips. We + * don't care about interrupts and output pins, we just read the timer register + * to get better resolution. */ #include "opt_platform.h" @@ -471,7 +478,13 @@ pcf2127_start_timer(struct nxprtc_softc *sc) int err; uint8_t stdctl, tmrctl; - /* See comment in pcf8523_start_timer(). */ + /* + * Set up timer if it's not already in the mode we normally run it. See + * the comment in pcf8523_start_timer() for more details. + * + * Note that the PCF2129 datasheet says it has no countdown timer, but + * empirical testing shows that it works just fine for our purposes. + */ if ((err = read_reg(sc, PCF2127_R_TMR_CTL, &tmrctl)) != 0) return (err); @@ -521,10 +534,6 @@ nxprtc_start(void *dev) switch (sc->chiptype) { case TYPE_PCA2129: case TYPE_PCF2129: - if (pcf8523_start(sc) != 0) - return; - /* No timer to start */ - break; case TYPE_PCF2127: if (pcf8523_start(sc) != 0) return; @@ -796,10 +805,6 @@ nxprtc_attach(device_t dev) switch (sc->chiptype) { case TYPE_PCA2129: case TYPE_PCF2129: - sc->secaddr = PCF8523_R_SECOND; - sc->tmcaddr = 0; - sc->use_timer = false; - break; case TYPE_PCF2127: case TYPE_PCF8523: sc->secaddr = PCF8523_R_SECOND; From owner-svn-src-all@freebsd.org Mon Jul 15 21:48:04 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1F773C4CA4; Mon, 15 Jul 2019 21:48:04 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0167581352; Mon, 15 Jul 2019 21:48:04 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D346E23DD0; Mon, 15 Jul 2019 21:48:03 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6FLm3U0068483; Mon, 15 Jul 2019 21:48:03 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6FLm3EL068478; Mon, 15 Jul 2019 21:48:03 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201907152148.x6FLm3EL068478@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 15 Jul 2019 21:48:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350017 - in head: lib/libc/sys sys/kern sys/sys tests/sys/kern X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head: lib/libc/sys sys/kern sys/sys tests/sys/kern X-SVN-Commit-Revision: 350017 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0167581352 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.963,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jul 2019 21:48:04 -0000 Author: jhb Date: Mon Jul 15 21:48:02 2019 New Revision: 350017 URL: https://svnweb.freebsd.org/changeset/base/350017 Log: Add ptrace op PT_GET_SC_RET. This ptrace operation returns a structure containing the error and return values from the current system call. It is only valid when a thread is stopped during a system call exit (PL_FLAG_SCX is set). The sr_error member holds the error value from the system call. Note that this error value is the native FreeBSD error value that has _not_ been translated to an ABI-specific error value similar to the values logged to ktrace. If sr_error is zero, then the return values of the system call will be set in sr_retval[0] and sr_retval[1]. Reviewed by: kib MFC after: 1 month Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D20901 Modified: head/lib/libc/sys/ptrace.2 head/sys/kern/sys_process.c head/sys/sys/ptrace.h head/tests/sys/kern/ptrace_test.c Modified: head/lib/libc/sys/ptrace.2 ============================================================================== --- head/lib/libc/sys/ptrace.2 Mon Jul 15 21:47:40 2019 (r350016) +++ head/lib/libc/sys/ptrace.2 Mon Jul 15 21:48:02 2019 (r350017) @@ -2,7 +2,7 @@ .\" $NetBSD: ptrace.2,v 1.2 1995/02/27 12:35:37 cgd Exp $ .\" .\" This file is in the public domain. -.Dd June 2, 2018 +.Dd July 15, 2019 .Dt PTRACE 2 .Os .Sh NAME @@ -664,6 +664,52 @@ member of the but not more than the .Fa data bytes in total are copied. +.It Dv PT_GET_SC_RET +Fetch the system call return values on exit from a syscall. +This request is only valid for threads stopped in a syscall +exit (the +.Dv PL_FLAG_SCX +state). +The +.Fa addr +argument specifies a pointer to a +.Vt "struct ptrace_sc_ret" , +which is defined as follows: +.Bd -literal +struct ptrace_sc_ret { + register_t sr_retval[2]; + int sr_error; +}; +.Ed +.Pp +The +.Fa data +argument is set to the size of the structure. +.Pp +If the system call completed successfully, +.Va sr_error +is set to zero and the return values of the system call are saved in +.Va sr_retval . +If the system call failed to execute, +.Va sr_error +field is set to a positive +.Xr errno 2 +value. +If the system call completed in an unusual fashion, +.Va sr_error +is set to a negative value: +.Pp +.Bl -tag -width Dv EJUSTRETURN -compact +.It Dv ERESTART +System call will be restarted. +.It Dv EJUSTRETURN +System call completed sucessfully but did not set a return value +.Po for example, +.Xr setcontext 2 +and +.Xr sigreturn 2 +.Pc . +.El .It Dv PT_FOLLOW_FORK This request controls tracing for new child processes of a traced process. If Modified: head/sys/kern/sys_process.c ============================================================================== --- head/sys/kern/sys_process.c Mon Jul 15 21:47:40 2019 (r350016) +++ head/sys/kern/sys_process.c Mon Jul 15 21:48:02 2019 (r350017) @@ -76,6 +76,11 @@ struct ptrace_io_desc32 { uint32_t piod_len; }; +struct ptrace_sc_ret32 { + uint32_t sr_retval[2]; + int sr_error; +}; + struct ptrace_vm_entry32 { int pve_entry; int pve_timestamp; @@ -518,6 +523,17 @@ ptrace_lwpinfo_to32(const struct ptrace_lwpinfo *pl, pl32->pl_syscall_code = pl->pl_syscall_code; pl32->pl_syscall_narg = pl->pl_syscall_narg; } + +static void +ptrace_sc_ret_to32(const struct ptrace_sc_ret *psr, + struct ptrace_sc_ret32 *psr32) +{ + + bzero(psr32, sizeof(*psr32)); + psr32->sr_retval[0] = psr->sr_retval[0]; + psr32->sr_retval[1] = psr->sr_retval[1]; + psr32->sr_error = psr->sr_error; +} #endif /* COMPAT_FREEBSD32 */ /* @@ -580,6 +596,7 @@ sys_ptrace(struct thread *td, struct ptrace_args *uap) struct ptrace_vm_entry32 pve32; #endif char args[sizeof(td->td_sa.args)]; + struct ptrace_sc_ret psr; int ptevents; } r; void *addr; @@ -598,6 +615,7 @@ sys_ptrace(struct thread *td, struct ptrace_args *uap) case PT_GET_EVENT_MASK: case PT_LWPINFO: case PT_GET_SC_ARGS: + case PT_GET_SC_RET: break; case PT_GETREGS: BZERO(&r.reg, sizeof r.reg); @@ -668,6 +686,10 @@ sys_ptrace(struct thread *td, struct ptrace_args *uap) error = copyout(r.args, uap->addr, MIN(uap->data, sizeof(r.args))); break; + case PT_GET_SC_RET: + error = copyout(&r.psr, uap->addr, MIN(uap->data, + sizeof(r.psr))); + break; } return (error); @@ -719,6 +741,7 @@ kern_ptrace(struct thread *td, int req, pid_t pid, voi struct thread *td2 = NULL, *td3; struct ptrace_io_desc *piod = NULL; struct ptrace_lwpinfo *pl; + struct ptrace_sc_ret *psr; int error, num, tmp; int proctree_locked = 0; lwpid_t tid = 0, *buf; @@ -726,7 +749,11 @@ kern_ptrace(struct thread *td, int req, pid_t pid, voi int wrap32 = 0, safe = 0; struct ptrace_io_desc32 *piod32 = NULL; struct ptrace_lwpinfo32 *pl32 = NULL; - struct ptrace_lwpinfo plr; + struct ptrace_sc_ret32 *psr32 = NULL; + union { + struct ptrace_lwpinfo pl; + struct ptrace_sc_ret psr; + } r; #endif curp = td->td_proc; @@ -1049,6 +1076,38 @@ kern_ptrace(struct thread *td, int req, pid_t pid, voi bcopy(td2->td_sa.args, addr, td2->td_sa.narg * sizeof(register_t)); break; + + case PT_GET_SC_RET: + if ((td2->td_dbgflags & (TDB_SCX)) == 0 +#ifdef COMPAT_FREEBSD32 + || (wrap32 && !safe) +#endif + ) { + error = EINVAL; + break; + } +#ifdef COMPAT_FREEBSD32 + if (wrap32) { + psr = &r.psr; + psr32 = addr; + } else +#endif + psr = addr; + bzero(psr, sizeof(*psr)); + psr->sr_error = td2->td_errno; + if (psr->sr_error == 0) { + psr->sr_retval[0] = td2->td_retval[0]; + psr->sr_retval[1] = td2->td_retval[1]; + } +#ifdef COMPAT_FREEBSD32 + if (wrap32) + ptrace_sc_ret_to32(psr, psr32); +#endif + CTR4(KTR_PTRACE, + "PT_GET_SC_RET: pid %d error %d retval %#lx,%#lx", + p->p_pid, psr->sr_error, psr->sr_retval[0], + psr->sr_retval[1]); + break; case PT_STEP: case PT_CONTINUE: @@ -1335,7 +1394,7 @@ kern_ptrace(struct thread *td, int req, pid_t pid, voi } #ifdef COMPAT_FREEBSD32 if (wrap32) { - pl = &plr; + pl = &r.pl; pl32 = addr; } else #endif Modified: head/sys/sys/ptrace.h ============================================================================== --- head/sys/sys/ptrace.h Mon Jul 15 21:47:40 2019 (r350016) +++ head/sys/sys/ptrace.h Mon Jul 15 21:48:02 2019 (r350017) @@ -72,6 +72,7 @@ #define PT_SET_EVENT_MASK 26 /* set mask of optional events */ #define PT_GET_SC_ARGS 27 /* fetch syscall args */ +#define PT_GET_SC_RET 28 /* fetch syscall results */ #define PT_GETREGS 33 /* get general-purpose registers */ #define PT_SETREGS 34 /* set general-purpose registers */ @@ -154,6 +155,12 @@ struct ptrace_lwpinfo32 { u_int pl_syscall_narg; }; #endif + +/* Argument structure for PT_GET_SC_RET. */ +struct ptrace_sc_ret { + register_t sr_retval[2]; /* Only valid if sr_error == 0. */ + int sr_error; +}; /* Argument structure for PT_VM_ENTRY. */ struct ptrace_vm_entry { Modified: head/tests/sys/kern/ptrace_test.c ============================================================================== --- head/tests/sys/kern/ptrace_test.c Mon Jul 15 21:47:40 2019 (r350016) +++ head/tests/sys/kern/ptrace_test.c Mon Jul 15 21:48:02 2019 (r350017) @@ -3905,12 +3905,13 @@ ATF_TC_BODY(ptrace__PT_LWPINFO_stale_siginfo, tc) } /* - * A simple test of PT_GET_SC_ARGS. + * A simple test of PT_GET_SC_ARGS and PT_GET_SC_RET. */ ATF_TC_WITHOUT_HEAD(ptrace__syscall_args); ATF_TC_BODY(ptrace__syscall_args, tc) { struct ptrace_lwpinfo pl; + struct ptrace_sc_ret psr; pid_t fpid, wpid; register_t args[2]; int events, status; @@ -3919,6 +3920,7 @@ ATF_TC_BODY(ptrace__syscall_args, tc) if (fpid == 0) { trace_me(); kill(getpid(), 0); + close(3); exit(1); } @@ -3930,9 +3932,9 @@ ATF_TC_BODY(ptrace__syscall_args, tc) /* * Continue the process ignoring the signal, but enabling - * syscall entry traps. + * syscall traps. */ - ATF_REQUIRE(ptrace(PT_TO_SCE, fpid, (caddr_t)1, 0) == 0); + ATF_REQUIRE(ptrace(PT_SYSCALL, fpid, (caddr_t)1, 0) == 0); /* * The next stop should be the syscall entry from getpid(). @@ -3949,6 +3951,25 @@ ATF_TC_BODY(ptrace__syscall_args, tc) ATF_REQUIRE(ptrace(PT_CONTINUE, fpid, (caddr_t)1, 0) == 0); /* + * The next stop should be the syscall exit from getpid(). + */ + wpid = waitpid(fpid, &status, 0); + ATF_REQUIRE(wpid == fpid); + ATF_REQUIRE(WIFSTOPPED(status)); + ATF_REQUIRE(WSTOPSIG(status) == SIGTRAP); + + ATF_REQUIRE(ptrace(PT_LWPINFO, wpid, (caddr_t)&pl, sizeof(pl)) != -1); + ATF_REQUIRE(pl.pl_flags & PL_FLAG_SCX); + ATF_REQUIRE(pl.pl_syscall_code == SYS_getpid); + + ATF_REQUIRE(ptrace(PT_GET_SC_RET, wpid, (caddr_t)&psr, + sizeof(psr)) != -1); + ATF_REQUIRE(psr.sr_error == 0); + ATF_REQUIRE(psr.sr_retval[0] == wpid); + + ATF_REQUIRE(ptrace(PT_CONTINUE, fpid, (caddr_t)1, 0) == 0); + + /* * The next stop should be the syscall entry from kill(). */ wpid = waitpid(fpid, &status, 0); @@ -3965,6 +3986,61 @@ ATF_TC_BODY(ptrace__syscall_args, tc) sizeof(args)) != -1); ATF_REQUIRE(args[0] == wpid); ATF_REQUIRE(args[1] == 0); + + ATF_REQUIRE(ptrace(PT_CONTINUE, fpid, (caddr_t)1, 0) == 0); + + /* + * The next stop should be the syscall exit from kill(). + */ + wpid = waitpid(fpid, &status, 0); + ATF_REQUIRE(wpid == fpid); + ATF_REQUIRE(WIFSTOPPED(status)); + ATF_REQUIRE(WSTOPSIG(status) == SIGTRAP); + + ATF_REQUIRE(ptrace(PT_LWPINFO, wpid, (caddr_t)&pl, sizeof(pl)) != -1); + ATF_REQUIRE(pl.pl_flags & PL_FLAG_SCX); + ATF_REQUIRE(pl.pl_syscall_code == SYS_kill); + + ATF_REQUIRE(ptrace(PT_GET_SC_RET, wpid, (caddr_t)&psr, + sizeof(psr)) != -1); + ATF_REQUIRE(psr.sr_error == 0); + + ATF_REQUIRE(ptrace(PT_CONTINUE, fpid, (caddr_t)1, 0) == 0); + + /* + * The next stop should be the syscall entry from close(). + */ + wpid = waitpid(fpid, &status, 0); + ATF_REQUIRE(wpid == fpid); + ATF_REQUIRE(WIFSTOPPED(status)); + ATF_REQUIRE(WSTOPSIG(status) == SIGTRAP); + + ATF_REQUIRE(ptrace(PT_LWPINFO, wpid, (caddr_t)&pl, sizeof(pl)) != -1); + ATF_REQUIRE(pl.pl_flags & PL_FLAG_SCE); + ATF_REQUIRE(pl.pl_syscall_code == SYS_close); + ATF_REQUIRE(pl.pl_syscall_narg == 1); + + ATF_REQUIRE(ptrace(PT_GET_SC_ARGS, wpid, (caddr_t)args, + sizeof(args)) != -1); + ATF_REQUIRE(args[0] == 3); + + ATF_REQUIRE(ptrace(PT_CONTINUE, fpid, (caddr_t)1, 0) == 0); + + /* + * The next stop should be the syscall exit from close(). + */ + wpid = waitpid(fpid, &status, 0); + ATF_REQUIRE(wpid == fpid); + ATF_REQUIRE(WIFSTOPPED(status)); + ATF_REQUIRE(WSTOPSIG(status) == SIGTRAP); + + ATF_REQUIRE(ptrace(PT_LWPINFO, wpid, (caddr_t)&pl, sizeof(pl)) != -1); + ATF_REQUIRE(pl.pl_flags & PL_FLAG_SCX); + ATF_REQUIRE(pl.pl_syscall_code == SYS_close); + + ATF_REQUIRE(ptrace(PT_GET_SC_RET, wpid, (caddr_t)&psr, + sizeof(psr)) != -1); + ATF_REQUIRE(psr.sr_error == EBADF); /* Disable syscall tracing and continue the child to let it exit. */ ATF_REQUIRE(ptrace(PT_GET_EVENT_MASK, fpid, (caddr_t)&events, From owner-svn-src-all@freebsd.org Mon Jul 15 22:28:45 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 591D6C55C9; Mon, 15 Jul 2019 22:28:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) 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 D7AC382ADF; Mon, 15 Jul 2019 22:28:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-4.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 11F336991; Mon, 15 Jul 2019 22:28:42 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r349391 - head/sys/kern To: cem@freebsd.org, Alan Somers Cc: src-committers , svn-src-all , svn-src-head References: <201906251944.x5PJiNaA093352@repo.freebsd.org> From: John Baldwin Openpgp: preference=signencrypt Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: <3b2ade4e-d19d-31e4-7ee2-c0085a00e53e@FreeBSD.org> Date: Mon, 15 Jul 2019 15:28:40 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D7AC382ADF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.84 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.85)[-0.848,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jul 2019 22:28:45 -0000 On 7/14/19 12:08 PM, Conrad Meyer wrote: > Hi Alan, > > This change restores the possible overflow beyond IO_SEQMAX that the > removed conditional prevented. > > On Tue, Jun 25, 2019 at 12:44 PM Alan Somers wrote: >> >> Author: asomers >> Date: Tue Jun 25 19:44:22 2019 >> New Revision: 349391 >> URL: https://svnweb.freebsd.org/changeset/base/349391 >> >> --- head/sys/kern/vfs_vnops.c Tue Jun 25 19:36:01 2019 (r349390) >> +++ head/sys/kern/vfs_vnops.c Tue Jun 25 19:44:22 2019 (r349391) >> @@ -499,10 +499,8 @@ sequential_heuristic(struct uio *uio, struct file *fp) >> * closely related to the best I/O size for real disks than >> * to any block size used by software. >> */ >> - fp->f_seqcount += MIN(IO_SEQMAX, >> + fp->f_seqcount += lmin(IO_SEQMAX, >> howmany(uio->uio_resid, 16384)); >> - if (fp->f_seqcount > IO_SEQMAX) >> - fp->f_seqcount = IO_SEQMAX; >> return (fp->f_seqcount << IO_SEQSHIFT); >> } > > Perhaps instead this should be: > > fp->f_seqcount = lmin(IO_SEQMAX, > fp->f_seqcount + howmany(...)); While I agree with your assessment of the removed conditional, I think the suggestion above can have a funky overflow where f_seqcount + howmany(...) ends up less than IO_SEQMAX and this expression would then be used instead of IO_SEQMAX? The first lmin seems designed to minimize what we add in the hope that since the existing value is bounded to '0...IO_SEQMAX' the result of the += can only be in the range '0...2*IO_SEQMAX'. I'm not sure which variants are most readable: A) fp->f_seqcount += lmin(IO_SEQMAX, howmany(resid, 16384)); if (fp->f_seqcount > IO_SEQMAX) fp->f_seqcount = IO_SEQMAX; B) fp->f_seqcount += lmin(IO_SEQMAX, howmany(resid, 16384)); fp->f_seqcount = lmin(fp->f_seqcount, IO_SEQMAX); C) if (fp->f_seqcount + howmany(resid, 16384) < fp->f_seqcount) fp->f_seqcount = IO_SEQMAX; else fp->f_seqcount = lmin(IO_SEQMAX, fp->f_seqcount + howmany(resid, 16384)); I'm probably not a fan of C). -- John Baldwin From owner-svn-src-all@freebsd.org Mon Jul 15 22:33:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5E5B2C588E; Mon, 15 Jul 2019 22:33:38 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4296183339; Mon, 15 Jul 2019 22:33:38 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 04A1C246B1; Mon, 15 Jul 2019 22:33:38 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6FMXbkc097892; Mon, 15 Jul 2019 22:33:37 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6FMXb3S097890; Mon, 15 Jul 2019 22:33:37 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201907152233.x6FMXb3S097890@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 15 Jul 2019 22:33:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350018 - head/sbin/camcontrol X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sbin/camcontrol X-SVN-Commit-Revision: 350018 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4296183339 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.95)[-0.955,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jul 2019 22:33:38 -0000 Author: imp Date: Mon Jul 15 22:33:37 2019 New Revision: 350018 URL: https://svnweb.freebsd.org/changeset/base/350018 Log: Implement a devtype command. List the device's protocol. The returned value is one of the following: ata direct attach ATA or SATA device satl a SATA device attached via SAS scsi A parallel SCSI or SAS nvme A direct attached NVMe device mmcsd A MMC or SD attached device Reviewed by: scottl@, rpokala@ Differential Revision: https://reviews.freebsd.org/D20950 Modified: head/sbin/camcontrol/camcontrol.8 head/sbin/camcontrol/camcontrol.c Modified: head/sbin/camcontrol/camcontrol.8 ============================================================================== --- head/sbin/camcontrol/camcontrol.8 Mon Jul 15 21:48:02 2019 (r350017) +++ head/sbin/camcontrol/camcontrol.8 Mon Jul 15 22:33:37 2019 (r350018) @@ -353,6 +353,9 @@ .Op generic args .Ao Fl r Oo Ns Fl f Ar format | Fl m | Fl U Oc | Fl s Ao Fl f Ar format Fl T Ar time | Fl U Ac Ac .Nm +.Ic devtype +.Op device id +.Nm .Ic help .Sh DESCRIPTION The @@ -2515,6 +2518,26 @@ option. .It Fl U Set the timestamp to the host system's time in UTC. .El +.El +.It Ic devtype +Print out the device type for specified device. +.Bl -tag -width 10n +.It ata +An ATA device attached directly to an ATA controller +.It satl +An SATA device attached behind a SAS controller via SCSI-ATA Translation Layer (SATL) +.It scsi +A SCSI device +.It nvme +An directly attached NVMe device +.It mmcsd +An MMC or SD device attached via a mmcsd bus +.It none +No device type reported +.It unknown +Device type is unknown +.It illegal +A programming error occurred .El .It Ic help Print out verbose usage information. Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Mon Jul 15 21:48:02 2019 (r350017) +++ head/sbin/camcontrol/camcontrol.c Mon Jul 15 22:33:37 2019 (r350018) @@ -109,6 +109,7 @@ typedef enum { CAM_CMD_TIMESTAMP = 0x00000028, CAM_CMD_MMCSD_CMD = 0x00000029, CAM_CMD_POWER_MODE = 0x0000002a, + CAM_CMD_DEVTYPE = 0x0000002b, } cam_cmdmask; typedef enum { @@ -217,6 +218,7 @@ static struct camcontrol_opts option_table[] = { {"defects", CAM_CMD_READ_DEFECTS, CAM_ARG_NONE, readdefect_opts}, {"defectlist", CAM_CMD_READ_DEFECTS, CAM_ARG_NONE, readdefect_opts}, {"devlist", CAM_CMD_DEVTREE, CAM_ARG_NONE, "-b"}, + {"devtype", CAM_CMD_DEVTYPE, CAM_ARG_NONE, ""}, {"periphlist", CAM_CMD_DEVLIST, CAM_ARG_NONE, NULL}, {"modepage", CAM_CMD_MODE_PAGE, CAM_ARG_NONE, "bdelm:P:"}, {"tags", CAM_CMD_TAG, CAM_ARG_NONE, "N:q"}, @@ -263,11 +265,22 @@ struct cam_devlist { static cam_cmdmask cmdlist; static cam_argmask arglist; +static const char *devtype_names[] = { + "none", + "scsi", + "satl", + "ata", + "nvme", + "mmcsd", + "unknown", +}; + camcontrol_optret getoption(struct camcontrol_opts *table, char *arg, uint32_t *cmdnum, cam_argmask *argnum, const char **subopt); static int getdevlist(struct cam_device *device); static int getdevtree(int argc, char **argv, char *combinedopt); +static int getdevtype(struct cam_device *device); static int print_dev_scsi(struct device_match_result *dev_result, char *tmpstr); static int print_dev_ata(struct device_match_result *dev_result, char *tmpstr); static int print_dev_semb(struct device_match_result *dev_result, char *tmpstr); @@ -654,6 +667,24 @@ getdevtree(int argc, char **argv, char *combinedopt) } static int +getdevtype(struct cam_device *cam_dev) +{ + camcontrol_devtype dt; + int error; + + /* + * Get the device type and report it, request no I/O be done to do this. + */ + error = get_device_type(cam_dev, -1, 0, 0, &dt); + if (error != 0 || dt < CC_DT_NONE || dt > CC_DT_UNKNOWN) { + fprintf(stdout, "illegal\n"); + return (1); + } + fprintf(stdout, "%s\n", devtype_names[dt]); + return (0); +} + +static int print_dev_scsi(struct device_match_result *dev_result, char *tmpstr) { char vendor[16], product[48], revision[16]; @@ -5351,7 +5382,7 @@ get_device_type(struct cam_device *dev, int retry_coun int verbosemode, camcontrol_devtype *devtype) { struct ccb_getdev cgd; - int retval = 0; + int retval; retval = get_cgd(dev, &cgd); if (retval != 0) @@ -5380,21 +5411,34 @@ get_device_type(struct cam_device *dev, int retry_coun break; /*NOTREACHED*/ } - /* - * Check for the ATA Information VPD page (0x89). If this is an - * ATA device behind a SCSI to ATA translation layer, this VPD page - * should be present. - * - * If that VPD page isn't present, or we get an error back from the - * INQUIRY command, we'll just treat it as a normal SCSI device. - */ - retval = dev_has_vpd_page(dev, SVPD_ATA_INFORMATION, retry_count, - timeout, verbosemode); - if (retval == 1) - *devtype = CC_DT_SATL; - else - *devtype = CC_DT_SCSI; - + if (retry_count == -1) { + /* + * For a retry count of -1, used only the cached data to avoid + * I/O to the drive. Sending the identify command to the drive + * can cause issues for SATL attachaed drives since identify is + * not an NCQ command. + */ + if (cgd.ident_data.config != 0) + *devtype = CC_DT_SATL; + else + *devtype = CC_DT_SCSI; + } else { + /* + * Check for the ATA Information VPD page (0x89). If this is an + * ATA device behind a SCSI to ATA translation layer (SATL), + * this VPD page should be present. + * + * If that VPD page isn't present, or we get an error back from + * the INQUIRY command, we'll just treat it as a normal SCSI + * device. + */ + retval = dev_has_vpd_page(dev, SVPD_ATA_INFORMATION, retry_count, + timeout, verbosemode); + if (retval == 1) + *devtype = CC_DT_SATL; + else + *devtype = CC_DT_SCSI; + } retval = 0; bailout: @@ -9620,6 +9664,7 @@ usage(int printlong) " [-S power_src] [-T timer]\n" " camcontrol timestamp [dev_id][generic_args] <-r [-f format|-m|-U]>|\n" " <-s <-f format -T time | -U >>\n" +" camcontrol devtype [dev_id]\n" " \n" " camcontrol help\n"); if (!printlong) @@ -9665,6 +9710,7 @@ usage(int printlong) "zone manage Zoned Block (Shingled) devices\n" "epc send ATA Extended Power Conditions commands\n" "timestamp report or set the device's timestamp\n" +"devtype report the type of device\n" "help this message\n" "Device Identifiers:\n" "bus:target specify the bus and target, lun defaults to 0\n" @@ -10127,6 +10173,9 @@ main(int argc, char **argv) break; case CAM_CMD_DEVTREE: error = getdevtree(argc, argv, combinedopt); + break; + case CAM_CMD_DEVTYPE: + error = getdevtype(cam_dev); break; case CAM_CMD_TUR: error = testunitready(cam_dev, task_attr, retry_count, From owner-svn-src-all@freebsd.org Mon Jul 15 22:55:43 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 454EAC603D for ; Mon, 15 Jul 2019 22:55:43 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-yw1-xc2a.google.com (mail-yw1-xc2a.google.com [IPv6:2607:f8b0:4864:20::c2a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) 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 60C568435D for ; Mon, 15 Jul 2019 22:55:42 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-yw1-xc2a.google.com with SMTP id n205so7926196ywb.10 for ; Mon, 15 Jul 2019 15:55:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=OPkJ5w6XSfl7Uhs+PsGKvgY0dSujsgGmEucTQaNIaRs=; b=E3jXZte6aJe2qygnWhf4zJldeoCewb2dwzrtqw8ex84B8lq5ZjPJeY7f1p2qBgOR2Y uBAU46k1zPZNS95JKL6huvwxDPOcY2pHi1gyvA5dI3IThoWih+nLT2AWuNubwWl/2JG5 S4aFx7qRr2DZECApmwwKhevpqFpznUWD+h2ASbK2rRY32I5Jh/VZ3NdkXf7mcKvU6uOm JjW7zg6f0nY82dfdXNcMjOj25xIpc5kJodnjWpfkWX+Wd3u9KJt5fKe5cboBVurT7V8P ZyvYrrOn5pOY1x7FsC9iVuBOpv+SKlHOirDepkP6Up5PdTpViuJuvJJcN8xHyXhnEtU3 oBhA== 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=OPkJ5w6XSfl7Uhs+PsGKvgY0dSujsgGmEucTQaNIaRs=; b=Xmr6wwTPnp/+FHabRE7DR6fMZ6YIBYrSoBCCC3Qye6N9J9hILpogq5HyA8SS7yx555 d85fuk/jxyESKoSgNX8M/WMbjoniAdEG+KHfERJHOl7iK+LsULkjlWFx7rlejJyB8lLY fCwNsLAQO2EZ3ikhHaJbYjweFlC5m+xAlbd6+nOBPJiZteADjEaaxuNAdm5ha3WeUwON rIk2jNq9yavsyLFd3zAxGGsALu4j0PbBxH0vYeO18FSdZwHRhlO7EirTBZVvbXB3ePzW QxTO+/ERYG7dLTRSCmXTuK4IOKgumXjxPm2Pxvf8+wthEHusE1UOeTiDKTZ6QOhKu5rz CG8g== X-Gm-Message-State: APjAAAWxh3QhpOJ/DKKHBxKWCa94UWv/lAtFySO9a7zhUOGyhfqrTiSV AKyIDKhNBvWatRIfsTYBPBa0Sr+tq535USjFuoUzZw== X-Google-Smtp-Source: APXvYqwKp/ZFx4ElYQfTEgAjFduLEhjpYwai9fMn/yxCFVnTRNPPk/ovJ5K2speZiYo3ASDIi8JFhRUx+ext/v2WoLM= X-Received: by 2002:a81:ad12:: with SMTP id l18mr15102886ywh.377.1563231341563; Mon, 15 Jul 2019 15:55:41 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a5b:586:0:0:0:0:0 with HTTP; Mon, 15 Jul 2019 15:55:40 -0700 (PDT) In-Reply-To: <201907151454.x6FEs4g7020630@repo.freebsd.org> References: <201907151454.x6FEs4g7020630@repo.freebsd.org> From: Oliver Pinter Date: Tue, 16 Jul 2019 00:55:40 +0200 Message-ID: Subject: Re: svn commit: r349999 - head/sys/netinet To: Michael Tuexen Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" X-Rspamd-Queue-Id: 60C568435D X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; dkim=pass header.d=hardenedbsd.org header.s=google header.b=E3jXZte6; spf=pass (mx1.freebsd.org: domain of oliver.pinter@hardenedbsd.org designates 2607:f8b0:4864:20::c2a as permitted sender) smtp.mailfrom=oliver.pinter@hardenedbsd.org X-Spamd-Result: default: False [-6.00 / 15.00]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; R_DKIM_ALLOW(-0.20)[hardenedbsd.org:s=google]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[hardenedbsd.org]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[hardenedbsd.org:+]; MIME_BASE64_TEXT(0.10)[]; RCVD_IN_DNSWL_NONE(0.00)[a.2.c.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; MX_GOOD(-0.01)[cached: alt1.aspmx.l.google.com]; NEURAL_HAM_SHORT(-0.79)[-0.793,0]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; IP_SCORE(-2.80)[ip: (-8.33), ipnet: 2607:f8b0::/32(-3.17), asn: 15169(-2.45), country: US(-0.06)] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jul 2019 22:55:43 -0000 On Monday, July 15, 2019, Michael Tuexen wrote: > Author: tuexen > Date: Mon Jul 15 14:54:04 2019 > New Revision: 349999 > URL: https://svnweb.freebsd.org/changeset/base/349999 > > Log: > Add support for MSG_EOR and MSG_EOF in sendmsg() for SCTP. > > This is an FreeBSD extension, not covered by Posix. > > This issue was found by running syzkaller. Aren't there syzkaller ids for these findings? > > MFC after: 1 week > > Modified: > head/sys/netinet/sctp_output.c > > Modified: head/sys/netinet/sctp_output.c > ============================================================ > ================== > --- head/sys/netinet/sctp_output.c Mon Jul 15 14:52:52 2019 > (r349998) > +++ head/sys/netinet/sctp_output.c Mon Jul 15 14:54:04 2019 > (r349999) > @@ -12652,6 +12652,12 @@ sctp_lower_sosend(struct socket *so, > sinfo_flags = inp->def_send.sinfo_flags; > sinfo_assoc_id = inp->def_send.sinfo_assoc_id; > } > + if (flags & MSG_EOR) { > + sinfo_flags |= SCTP_EOR; > + } > + if (flags & MSG_EOF) { > + sinfo_flags |= SCTP_EOF; > + } > if (sinfo_flags & SCTP_SENDALL) { > /* its a sendall */ > error = sctp_sendall(inp, uio, top, srcv); > @@ -12819,9 +12825,17 @@ sctp_lower_sosend(struct socket *so, > } > } else > asoc = &stcb->asoc; > - if (srcv == NULL) > + if (srcv == NULL) { > srcv = (struct sctp_sndrcvinfo *)&asoc->def_send; > - if (srcv->sinfo_flags & SCTP_ADDR_OVER) { > + sinfo_flags = srcv->sinfo_flags; > + if (flags & MSG_EOR) { > + sinfo_flags |= SCTP_EOR; > + } > + if (flags & MSG_EOF) { > + sinfo_flags |= SCTP_EOF; > + } > + } > + if (sinfo_flags & SCTP_ADDR_OVER) { > if (addr) > net = sctp_findnet(stcb, addr); > else > @@ -12928,7 +12942,7 @@ sctp_lower_sosend(struct socket *so, > (SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_RECEIVED) || > (SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_ACK_SENT) || > (asoc->state & SCTP_STATE_SHUTDOWN_PENDING)) { > - if (srcv->sinfo_flags & SCTP_ABORT) { > + if (sinfo_flags & SCTP_ABORT) { > ; > } else { > SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, > SCTP_FROM_SCTP_OUTPUT, ECONNRESET); > @@ -12941,7 +12955,7 @@ sctp_lower_sosend(struct socket *so, > p->td_ru.ru_msgsnd++; > } > /* Are we aborting? */ > - if (srcv->sinfo_flags & SCTP_ABORT) { > + if (sinfo_flags & SCTP_ABORT) { > struct mbuf *mm; > ssize_t tot_demand, tot_out = 0, max_out; > > @@ -13145,7 +13159,7 @@ skip_preblock: > * case NOTE: uio will be null when top/mbuf is passed > */ > if (sndlen == 0) { > - if (srcv->sinfo_flags & SCTP_EOF) { > + if (sinfo_flags & SCTP_EOF) { > got_all_of_the_send = 1; > goto dataless_eof; > } else { > @@ -13194,7 +13208,7 @@ skip_preblock: > } > sctp_snd_sb_alloc(stcb, sp->length); > atomic_add_int(&asoc->stream_queue_cnt, 1); > - if (srcv->sinfo_flags & SCTP_UNORDERED) { > + if (sinfo_flags & SCTP_UNORDERED) { > SCTP_STAT_INCR(sctps_sends_with_unord); > } > TAILQ_INSERT_TAIL(&strm->outqueue, sp, next); > @@ -13269,15 +13283,15 @@ skip_preblock: > sctp_snd_sb_alloc(stcb, sndout); > atomic_add_int(&sp->length, sndout); > len += sndout; > - if (srcv->sinfo_flags & > SCTP_SACK_IMMEDIATELY) { > + if (sinfo_flags & SCTP_SACK_IMMEDIATELY) { > sp->sinfo_flags |= > SCTP_SACK_IMMEDIATELY; > } > > /* Did we reach EOR? */ > if ((uio->uio_resid == 0) && > ((user_marks_eor == 0) || > - (srcv->sinfo_flags & SCTP_EOF) || > - (user_marks_eor && (srcv->sinfo_flags > & SCTP_EOR)))) { > + (sinfo_flags & SCTP_EOF) || > + (user_marks_eor && (sinfo_flags & > SCTP_EOR)))) { > sp->msg_is_complete = 1; > } else { > sp->msg_is_complete = 0; > @@ -13479,7 +13493,7 @@ skip_preblock: > /* We send in a 0, since we do NOT have any locks */ > error = sctp_msg_append(stcb, net, top, srcv, 0); > top = NULL; > - if (srcv->sinfo_flags & SCTP_EOF) { > + if (sinfo_flags & SCTP_EOF) { > /* > * This should only happen for Panda for the mbuf > * send case, which does NOT yet support EEOR mode. > @@ -13494,7 +13508,7 @@ skip_preblock: > } > dataless_eof: > /* EOF thing ? */ > - if ((srcv->sinfo_flags & SCTP_EOF) && > + if ((sinfo_flags & SCTP_EOF) && > (got_all_of_the_send == 1)) { > SCTP_STAT_INCR(sctps_sends_with_eof); > error = 0; > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > From owner-svn-src-all@freebsd.org Mon Jul 15 23:08:56 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9200AC62E9; Mon, 15 Jul 2019 23:08:56 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from drew.franken.de (drew.ipv6.franken.de [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.franken.de", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D62A84B33; Mon, 15 Jul 2019 23:08:56 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from [IPv6:2a02:8109:1140:c3d:45d6:a5c2:b3fa:a44] (unknown [IPv6:2a02:8109:1140:c3d:45d6:a5c2:b3fa:a44]) (Authenticated sender: macmic) by drew.franken.de (Postfix) with ESMTPSA id C6B1E71E3F46D; Tue, 16 Jul 2019 01:08:52 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: svn commit: r349999 - head/sys/netinet From: Michael Tuexen In-Reply-To: Date: Tue, 16 Jul 2019 01:08:51 +0200 Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <1FA95CCB-CCD4-44AD-9346-95D1AA16B6E9@freebsd.org> References: <201907151454.x6FEs4g7020630@repo.freebsd.org> To: Oliver Pinter X-Mailer: Apple Mail (2.3445.104.11) X-Spam-Status: No, score=-1.6 required=5.0 tests=ALL_TRUSTED,BAYES_00, IP_LINK_PLUS,NORMAL_HTTP_TO_IP,NUMERIC_HTTP_ADDR,WEIRD_PORT autolearn=disabled version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail-n.franken.de X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jul 2019 23:08:56 -0000 > On 16. Jul 2019, at 00:55, Oliver Pinter = wrote: >=20 >=20 >=20 > On Monday, July 15, 2019, Michael Tuexen wrote: > Author: tuexen > Date: Mon Jul 15 14:54:04 2019 > New Revision: 349999 > URL: https://svnweb.freebsd.org/changeset/base/349999 >=20 > Log: > Add support for MSG_EOR and MSG_EOF in sendmsg() for SCTP. >=20 > This is an FreeBSD extension, not covered by Posix. >=20 > This issue was found by running syzkaller. >=20 > Aren't there syzkaller ids for these findings?=20 I don't think so. It was observed while resolving this issue: = http://212.201.121.91:10000/crash?id=3D6776fd17dd57519d11638604f246aacf5db= af5a2 Just to be clear: this patch is about adding a feature, not fixing a = bug. Best regards Michael > =20 >=20 > MFC after: 1 week >=20 > Modified: > head/sys/netinet/sctp_output.c >=20 > Modified: head/sys/netinet/sctp_output.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/netinet/sctp_output.c Mon Jul 15 14:52:52 2019 = (r349998) > +++ head/sys/netinet/sctp_output.c Mon Jul 15 14:54:04 2019 = (r349999) > @@ -12652,6 +12652,12 @@ sctp_lower_sosend(struct socket *so, > sinfo_flags =3D inp->def_send.sinfo_flags; > sinfo_assoc_id =3D inp->def_send.sinfo_assoc_id; > } > + if (flags & MSG_EOR) { > + sinfo_flags |=3D SCTP_EOR; > + } > + if (flags & MSG_EOF) { > + sinfo_flags |=3D SCTP_EOF; > + } > if (sinfo_flags & SCTP_SENDALL) { > /* its a sendall */ > error =3D sctp_sendall(inp, uio, top, srcv); > @@ -12819,9 +12825,17 @@ sctp_lower_sosend(struct socket *so, > } > } else > asoc =3D &stcb->asoc; > - if (srcv =3D=3D NULL) > + if (srcv =3D=3D NULL) { > srcv =3D (struct sctp_sndrcvinfo *)&asoc->def_send; > - if (srcv->sinfo_flags & SCTP_ADDR_OVER) { > + sinfo_flags =3D srcv->sinfo_flags; > + if (flags & MSG_EOR) { > + sinfo_flags |=3D SCTP_EOR; > + } > + if (flags & MSG_EOF) { > + sinfo_flags |=3D SCTP_EOF; > + } > + } > + if (sinfo_flags & SCTP_ADDR_OVER) { > if (addr) > net =3D sctp_findnet(stcb, addr); > else > @@ -12928,7 +12942,7 @@ sctp_lower_sosend(struct socket *so, > (SCTP_GET_STATE(stcb) =3D=3D SCTP_STATE_SHUTDOWN_RECEIVED) = || > (SCTP_GET_STATE(stcb) =3D=3D SCTP_STATE_SHUTDOWN_ACK_SENT) = || > (asoc->state & SCTP_STATE_SHUTDOWN_PENDING)) { > - if (srcv->sinfo_flags & SCTP_ABORT) { > + if (sinfo_flags & SCTP_ABORT) { > ; > } else { > SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, = SCTP_FROM_SCTP_OUTPUT, ECONNRESET); > @@ -12941,7 +12955,7 @@ sctp_lower_sosend(struct socket *so, > p->td_ru.ru_msgsnd++; > } > /* Are we aborting? */ > - if (srcv->sinfo_flags & SCTP_ABORT) { > + if (sinfo_flags & SCTP_ABORT) { > struct mbuf *mm; > ssize_t tot_demand, tot_out =3D 0, max_out; >=20 > @@ -13145,7 +13159,7 @@ skip_preblock: > * case NOTE: uio will be null when top/mbuf is passed > */ > if (sndlen =3D=3D 0) { > - if (srcv->sinfo_flags & SCTP_EOF) { > + if (sinfo_flags & SCTP_EOF) { > got_all_of_the_send =3D 1; > goto dataless_eof; > } else { > @@ -13194,7 +13208,7 @@ skip_preblock: > } > sctp_snd_sb_alloc(stcb, sp->length); > atomic_add_int(&asoc->stream_queue_cnt, 1); > - if (srcv->sinfo_flags & SCTP_UNORDERED) { > + if (sinfo_flags & SCTP_UNORDERED) { > = SCTP_STAT_INCR(sctps_sends_with_unord); > } > TAILQ_INSERT_TAIL(&strm->outqueue, sp, next); > @@ -13269,15 +13283,15 @@ skip_preblock: > sctp_snd_sb_alloc(stcb, sndout); > atomic_add_int(&sp->length, sndout); > len +=3D sndout; > - if (srcv->sinfo_flags & = SCTP_SACK_IMMEDIATELY) { > + if (sinfo_flags & = SCTP_SACK_IMMEDIATELY) { > sp->sinfo_flags |=3D = SCTP_SACK_IMMEDIATELY; > } >=20 > /* Did we reach EOR? */ > if ((uio->uio_resid =3D=3D 0) && > ((user_marks_eor =3D=3D 0) || > - (srcv->sinfo_flags & SCTP_EOF) || > - (user_marks_eor && = (srcv->sinfo_flags & SCTP_EOR)))) { > + (sinfo_flags & SCTP_EOF) || > + (user_marks_eor && (sinfo_flags & = SCTP_EOR)))) { > sp->msg_is_complete =3D 1; > } else { > sp->msg_is_complete =3D 0; > @@ -13479,7 +13493,7 @@ skip_preblock: > /* We send in a 0, since we do NOT have any locks */ > error =3D sctp_msg_append(stcb, net, top, srcv, 0); > top =3D NULL; > - if (srcv->sinfo_flags & SCTP_EOF) { > + if (sinfo_flags & SCTP_EOF) { > /* > * This should only happen for Panda for the = mbuf > * send case, which does NOT yet support EEOR = mode. > @@ -13494,7 +13508,7 @@ skip_preblock: > } > dataless_eof: > /* EOF thing ? */ > - if ((srcv->sinfo_flags & SCTP_EOF) && > + if ((sinfo_flags & SCTP_EOF) && > (got_all_of_the_send =3D=3D 1)) { > SCTP_STAT_INCR(sctps_sends_with_eof); > error =3D 0; > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to = "svn-src-head-unsubscribe@freebsd.org" From owner-svn-src-all@freebsd.org Mon Jul 15 23:41:01 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 72A3CC6ACB; Mon, 15 Jul 2019 23:41:01 +0000 (UTC) (envelope-from olivier@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 553F885D0B; Mon, 15 Jul 2019 23:41:01 +0000 (UTC) (envelope-from olivier@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 317AB25263; Mon, 15 Jul 2019 23:41:01 +0000 (UTC) (envelope-from olivier@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6FNf1Yk034372; Mon, 15 Jul 2019 23:41:01 GMT (envelope-from olivier@FreeBSD.org) Received: (from olivier@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6FNf1mH034371; Mon, 15 Jul 2019 23:41:01 GMT (envelope-from olivier@FreeBSD.org) Message-Id: <201907152341.x6FNf1mH034371@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: olivier set sender to olivier@FreeBSD.org using -f From: Olivier Cochard Date: Mon, 15 Jul 2019 23:41:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350019 - head/lib/libc/tests/net X-SVN-Group: head X-SVN-Commit-Author: olivier X-SVN-Commit-Paths: head/lib/libc/tests/net X-SVN-Commit-Revision: 350019 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 553F885D0B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.92 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.92)[-0.922,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jul 2019 23:41:01 -0000 Author: olivier (ports committer) Date: Mon Jul 15 23:41:00 2019 New Revision: 350019 URL: https://svnweb.freebsd.org/changeset/base/350019 Log: Fix filename to avoid skipping lib/libc/net/servent test. PR: 239177 Approved by: ngie MFC after: 1 month Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D20943 Modified: head/lib/libc/tests/net/Makefile Modified: head/lib/libc/tests/net/Makefile ============================================================================== --- head/lib/libc/tests/net/Makefile Mon Jul 15 22:33:37 2019 (r350018) +++ head/lib/libc/tests/net/Makefile Mon Jul 15 23:41:00 2019 (r350019) @@ -38,4 +38,6 @@ aton_ether_subr.c: gen_ether_subr ${SRCTOP}/sys/net/if ${PACKAGE}FILES+= hosts ${PACKAGE}FILES+= resolv.conf +ATF_TESTS_SH_SED_servent_test= -e 's,services.cdb,services.db,g' + .include From owner-svn-src-all@freebsd.org Mon Jul 15 23:43:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C6EF9C6C8F; Mon, 15 Jul 2019 23:43:38 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AA79386093; Mon, 15 Jul 2019 23:43:38 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 858BB252E2; Mon, 15 Jul 2019 23:43:38 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6FNhc7X039361; Mon, 15 Jul 2019 23:43:38 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6FNhcsm039360; Mon, 15 Jul 2019 23:43:38 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201907152343.x6FNhcsm039360@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 15 Jul 2019 23:43:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350020 - head/sbin/camcontrol X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sbin/camcontrol X-SVN-Commit-Revision: 350020 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AA79386093 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.92 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.92)[-0.922,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jul 2019 23:43:38 -0000 Author: imp Date: Mon Jul 15 23:43:38 2019 New Revision: 350020 URL: https://svnweb.freebsd.org/changeset/base/350020 Log: Use a different approach to range check. gcc hates dt < CC_DT_NONE since it can never be true when dt is an unsigned type. Since that's a compiler choice and may be affected by weird stuff, instead use (unsigned)dt > CC_DT_UNKNOWN to test for bounds error since that will work regardless of the signedness of dt. Modified: head/sbin/camcontrol/camcontrol.c Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Mon Jul 15 23:41:00 2019 (r350019) +++ head/sbin/camcontrol/camcontrol.c Mon Jul 15 23:43:38 2019 (r350020) @@ -676,7 +676,7 @@ getdevtype(struct cam_device *cam_dev) * Get the device type and report it, request no I/O be done to do this. */ error = get_device_type(cam_dev, -1, 0, 0, &dt); - if (error != 0 || dt < CC_DT_NONE || dt > CC_DT_UNKNOWN) { + if (error != 0 || (unsigned)dt > CC_DT_UNKNOWN) { fprintf(stdout, "illegal\n"); return (1); } From owner-svn-src-all@freebsd.org Tue Jul 16 03:09:04 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 87034A432F; Tue, 16 Jul 2019 03:09:04 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 68A238D8AF; Tue, 16 Jul 2019 03:09:04 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5C51027716; Tue, 16 Jul 2019 03:09:04 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6G394ZR059295; Tue, 16 Jul 2019 03:09:04 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6G39467059294; Tue, 16 Jul 2019 03:09:04 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201907160309.x6G39467059294@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Tue, 16 Jul 2019 03:09:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350021 - head/sys/i386/i386 X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/i386/i386 X-SVN-Commit-Revision: 350021 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 68A238D8AF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.95)[-0.950,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jul 2019 03:09:04 -0000 Author: alc Date: Tue Jul 16 03:09:03 2019 New Revision: 350021 URL: https://svnweb.freebsd.org/changeset/base/350021 Log: Revert r349973. Upon further reflection, I realized that the comment deleted by r349973 is still valid on i386. Restore it. Discussed with: markj Modified: head/sys/i386/i386/pmap.c Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Mon Jul 15 23:43:38 2019 (r350020) +++ head/sys/i386/i386/pmap.c Tue Jul 16 03:09:03 2019 (r350021) @@ -5096,6 +5096,13 @@ __CONCAT(PMTYPE, ts_referenced)(vm_page_t m) * reference bit will result in clearing that bit. * This function is designed to avoid the selection of * the same 4KB page for every 2- or 4MB page mapping. + * + * On demotion, a mapping that hasn't been referenced + * is simply destroyed. To avoid the possibility of a + * subsequent page fault on a demoted wired mapping, + * always leave its reference bit set. Moreover, + * since the superpage is wired, the current state of + * its reference bit won't affect page replacement. */ if ((((pa >> PAGE_SHIFT) ^ (pv->pv_va >> PDRSHIFT) ^ (uintptr_t)pmap) & (NPTEPG - 1)) == 0 && From owner-svn-src-all@freebsd.org Tue Jul 16 03:32:22 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9298CA47FD; Tue, 16 Jul 2019 03:32:22 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 75DD88E561; Tue, 16 Jul 2019 03:32:22 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 512B727C85; Tue, 16 Jul 2019 03:32:22 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6G3WMwg076070; Tue, 16 Jul 2019 03:32:22 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6G3WM5Y076069; Tue, 16 Jul 2019 03:32:22 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201907160332.x6G3WM5Y076069@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Tue, 16 Jul 2019 03:32:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350022 - head/contrib/elftoolchain/strings X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/contrib/elftoolchain/strings X-SVN-Commit-Revision: 350022 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 75DD88E561 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jul 2019 03:32:22 -0000 Author: oshogbo Date: Tue Jul 16 03:32:21 2019 New Revision: 350022 URL: https://svnweb.freebsd.org/changeset/base/350022 Log: strings: fix entering to the capability mode Reported by: markj Modified: head/contrib/elftoolchain/strings/strings.c Modified: head/contrib/elftoolchain/strings/strings.c ============================================================================== --- head/contrib/elftoolchain/strings/strings.c Tue Jul 16 03:09:03 2019 (r350021) +++ head/contrib/elftoolchain/strings/strings.c Tue Jul 16 03:32:21 2019 (r350022) @@ -200,7 +200,7 @@ main(int argc, char **argv) err(1, "Unable to initialize casper fileargs"); caph_cache_catpages(); - if (caph_limit_stdio() < 0 && caph_enter_casper() < 0) { + if (caph_limit_stdio() < 0 || caph_enter_casper() < 0) { fileargs_free(fa); err(1, "Unable to enter capability mode"); } From owner-svn-src-all@freebsd.org Tue Jul 16 03:55:28 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 76912A4CDA; Tue, 16 Jul 2019 03:55:28 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 589238F0E8; Tue, 16 Jul 2019 03:55:28 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 18FC970; Tue, 16 Jul 2019 03:55:28 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6G3tRZ3088747; Tue, 16 Jul 2019 03:55:27 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6G3tRbK088746; Tue, 16 Jul 2019 03:55:27 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201907160355.x6G3tRbK088746@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Tue, 16 Jul 2019 03:55:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350023 - head/sys/powerpc/powerpc X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/powerpc X-SVN-Commit-Revision: 350023 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 589238F0E8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jul 2019 03:55:28 -0000 Author: jhibbits Date: Tue Jul 16 03:55:27 2019 New Revision: 350023 URL: https://svnweb.freebsd.org/changeset/base/350023 Log: powerpc: Fix casueword(9) post-r349951 '=' asm constraint marks a variable as write-only. Because of this, gcc throws away the initialization of 'res', causing garbage to be returned if the CAS was successful. Use '+' to mark res as read/write, so that the initialization stays in the generated asm. Also, fix the reservation clearing stwcx store index register in casueword32, and only do the dummy store when needed, skip it if the real store has already succeeded. Modified: head/sys/powerpc/powerpc/copyinout.c Modified: head/sys/powerpc/powerpc/copyinout.c ============================================================================== --- head/sys/powerpc/powerpc/copyinout.c Tue Jul 16 03:32:21 2019 (r350022) +++ head/sys/powerpc/powerpc/copyinout.c Tue Jul 16 03:55:27 2019 (r350023) @@ -456,13 +456,13 @@ casueword32(volatile uint32_t *addr, uint32_t old, uin "cmplw %4, %0\n\t" /* compare */ "bne 1f\n\t" /* exit if not equal */ "stwcx. %5, 0, %3\n\t" /* attempt to store */ - "bne- 1f\n\t" /* if failed */ - "b 2f\n\t" /* we've succeeded */ + "bne- 2f\n\t" /* if failed */ + "b 3f\n\t" /* we've succeeded */ "1:\n\t" - "stwcx. %0, 0, %4\n\t" /* clear reservation (74xx) */ - "li %2, 1\n\t" - "2:\n\t" - : "=&r" (val), "=m" (*p), "=&r" (res) + "stwcx. %0, 0, %3\n\t" /* clear reservation (74xx) */ + "2:li %2, 1\n\t" + "3:\n\t" + : "=&r" (val), "=m" (*p), "+&r" (res) : "r" (p), "r" (old), "r" (new), "m" (*p) : "cr0", "memory"); @@ -511,13 +511,13 @@ casueword(volatile u_long *addr, u_long old, u_long *o "cmpld %4, %0\n\t" /* compare */ "bne 1f\n\t" /* exit if not equal */ "stdcx. %5, 0, %3\n\t" /* attempt to store */ - "bne- 1f\n\t" /* if failed */ - "b 2f\n\t" /* we've succeeded */ + "bne- 2f\n\t" /* if failed */ + "b 3f\n\t" /* we've succeeded */ "1:\n\t" "stdcx. %0, 0, %3\n\t" /* clear reservation (74xx) */ - "li %2, 1\n\t" - "2:\n\t" - : "=&r" (val), "=m" (*p), "=&r" (res) + "2:li %2, 1\n\t" + "3:\n\t" + : "=&r" (val), "=m" (*p), "+&r" (res) : "r" (p), "r" (old), "r" (new), "m" (*p) : "cr0", "memory"); From owner-svn-src-all@freebsd.org Tue Jul 16 04:17:26 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 62C32A518E; Tue, 16 Jul 2019 04:17:26 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 42BA88FB2B; Tue, 16 Jul 2019 04:17:26 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0E589428; Tue, 16 Jul 2019 04:17:26 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6G4HP5A000846; Tue, 16 Jul 2019 04:17:25 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6G4HPC4000845; Tue, 16 Jul 2019 04:17:25 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201907160417.x6G4HPC4000845@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Tue, 16 Jul 2019 04:17:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350024 - head/contrib/elftoolchain/strings X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/contrib/elftoolchain/strings X-SVN-Commit-Revision: 350024 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 42BA88FB2B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jul 2019 04:17:26 -0000 Author: oshogbo Date: Tue Jul 16 04:17:25 2019 New Revision: 350024 URL: https://svnweb.freebsd.org/changeset/base/350024 Log: strings: extends rights The libelf is using mmap if it can, if not it was fall backing to read. Reported by: markj Modified: head/contrib/elftoolchain/strings/strings.c Modified: head/contrib/elftoolchain/strings/strings.c ============================================================================== --- head/contrib/elftoolchain/strings/strings.c Tue Jul 16 03:55:27 2019 (r350023) +++ head/contrib/elftoolchain/strings/strings.c Tue Jul 16 04:17:25 2019 (r350024) @@ -194,7 +194,7 @@ main(int argc, char **argv) argc -= optind; argv += optind; - cap_rights_init(&rights, CAP_READ, CAP_SEEK, CAP_FSTAT, CAP_FCNTL); + cap_rights_init(&rights, CAP_READ, CAP_SEEK, CAP_FSTAT, CAP_FCNTL, CAP_MMAP_R); fa = fileargs_init(argc, argv, O_RDONLY, 0, &rights, FA_OPEN); if (fa == NULL) err(1, "Unable to initialize casper fileargs"); From owner-svn-src-all@freebsd.org Tue Jul 16 08:36:50 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8CDEFA9736; Tue, 16 Jul 2019 08:36:50 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6F86B719B2; Tue, 16 Jul 2019 08:36:50 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4C4E83209; Tue, 16 Jul 2019 08:36:50 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6G8aoVF053750; Tue, 16 Jul 2019 08:36:50 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6G8aor8053749; Tue, 16 Jul 2019 08:36:50 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201907160836.x6G8aor8053749@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 16 Jul 2019 08:36:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350025 - head/sys/dev/bge X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/dev/bge X-SVN-Commit-Revision: 350025 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6F86B719B2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.94)[-0.942,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jul 2019 08:36:50 -0000 Author: avg Date: Tue Jul 16 08:36:49 2019 New Revision: 350025 URL: https://svnweb.freebsd.org/changeset/base/350025 Log: bge: check that the bus is a pci bus before using it as such This fixes the following panic on powerpc: pci_get_vendor failed for pcib1 on bus ofwbus0, error = 2 PR: 238730 Reported by: Dennis Clarke Tested by: Dennis Clarke MFC after: 2 weeks Modified: head/sys/dev/bge/if_bge.c Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Tue Jul 16 04:17:25 2019 (r350024) +++ head/sys/dev/bge/if_bge.c Tue Jul 16 08:36:49 2019 (r350025) @@ -3276,6 +3276,8 @@ bge_mbox_reorder(struct bge_softc *sc) bus = device_get_parent(dev); if (device_get_devclass(dev) != pcib) break; + if (device_get_devclass(bus) != pci) + break; for (i = 0; i < nitems(mbox_reorder_lists); i++) { if (pci_get_vendor(dev) == mbox_reorder_lists[i].vendor && @@ -3287,8 +3289,6 @@ bge_mbox_reorder(struct bge_softc *sc) return (1); } } - if (device_get_devclass(bus) != pci) - break; } return (0); } From owner-svn-src-all@freebsd.org Tue Jul 16 09:48:11 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4C016AAE96; Tue, 16 Jul 2019 09:48:11 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id 2230D749D9; Tue, 16 Jul 2019 09:48:08 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 3449743C2CD; Tue, 16 Jul 2019 19:48:04 +1000 (AEST) Date: Tue, 16 Jul 2019 19:48:02 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: John Baldwin cc: cem@freebsd.org, Alan Somers , src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r349391 - head/sys/kern In-Reply-To: <3b2ade4e-d19d-31e4-7ee2-c0085a00e53e@FreeBSD.org> Message-ID: <20190716180618.C962@besplex.bde.org> References: <201906251944.x5PJiNaA093352@repo.freebsd.org> <3b2ade4e-d19d-31e4-7ee2-c0085a00e53e@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=P6RKvmIu c=1 sm=1 tr=0 cx=a_idp_d a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=h1vcgeBvbb_nU-wzG2IA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-Rspamd-Queue-Id: 2230D749D9 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of brde@optusnet.com.au designates 211.29.132.246 as permitted sender) smtp.mailfrom=brde@optusnet.com.au X-Spamd-Result: default: False [-5.75 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; RCVD_IN_DNSWL_LOW(-0.10)[246.132.29.211.list.dnswl.org : 127.0.5.1]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:211.29.132.0/23]; FREEMAIL_FROM(0.00)[optusnet.com.au]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DMARC_NA(0.00)[optusnet.com.au]; RCPT_COUNT_FIVE(0.00)[6]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; IP_SCORE(-2.54)[ip: (-7.21), ipnet: 211.28.0.0/14(-3.20), asn: 4804(-2.32), country: AU(0.01)]; MX_GOOD(-0.01)[cached: extmail.optusnet.com.au]; NEURAL_HAM_SHORT(-0.89)[-0.894,0]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[optusnet.com.au]; ASN(0.00)[asn:4804, ipnet:211.28.0.0/14, country:AU]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jul 2019 09:48:11 -0000 On Mon, 15 Jul 2019, John Baldwin wrote: > On 7/14/19 12:08 PM, Conrad Meyer wrote: >> >> This change restores the possible overflow beyond IO_SEQMAX that the >> removed conditional prevented. >> >> On Tue, Jun 25, 2019 at 12:44 PM Alan Somers wrote: I thought the same for a while on Tue, Jan 25, then didn't reply since I saw a non-problem while writing the reply. Actually, all versions are broken. >>> Author: asomers >>> Date: Tue Jun 25 19:44:22 2019 >>> New Revision: 349391 >>> URL: https://svnweb.freebsd.org/changeset/base/349391 >>> >>> --- head/sys/kern/vfs_vnops.c Tue Jun 25 19:36:01 2019 (r349390) >>> +++ head/sys/kern/vfs_vnops.c Tue Jun 25 19:44:22 2019 (r349391) >>> @@ -499,10 +499,8 @@ sequential_heuristic(struct uio *uio, struct file *fp) >>> * closely related to the best I/O size for real disks than >>> * to any block size used by software. >>> */ >>> - fp->f_seqcount += MIN(IO_SEQMAX, >>> + fp->f_seqcount += lmin(IO_SEQMAX, >>> howmany(uio->uio_resid, 16384)); >>> - if (fp->f_seqcount > IO_SEQMAX) >>> - fp->f_seqcount = IO_SEQMAX; >>> return (fp->f_seqcount << IO_SEQSHIFT); >>> } Overflow occurs in all versions in howmany() when uio_resid is near its limit of SSIZE_MAX. Then adding (65536 - 1) to uio_resid overflows. The behaviour is undefined, but usually the addition gives a large negative value and howmany gives a not so large negative value after dividing by 65536. In the previous version, MIN() preserves signedness and the type of howmany(), which is always long (since ssize_t happens to be long on all supported arches). The large negative value is less than IO_SEQMAX sinc that has a correct type (signed int) and is non-negative. So MIN() preserves the large negative value. This is blindly added to f_seqcount, giving another overflow on 64-bit arches and a garbage negative value on 32-bit arches if f_seqcount was not garbage. The removed conditional only fixes up large positive values, so has no effect in this case. Finally, left shifting the garbage gives further undefined behaviour. The second overflow on 64-bit arches is because the not so large negative value is still much larger than can be represented in f_seqcount. Values near -SSIZE_MAX have 63 value bits, so dividing by 16384 leaves 47 value bits, but f_seqcount has only 31 value bits. In this version, lmin() happens to give the same result as MIN() on all supported machines, because ssize_t happens to have the same representation on all supported machines. So overflows occur as before for large uio_resid. So this change makes no differences for the 2 overflows for uio_resid near SSIZE_MAX. But removing the conditional restores an overflow that actually was fixed in a previous recent commit. >> Perhaps instead this should be: >> >> fp->f_seqcount = lmin(IO_SEQMAX, >> fp->f_seqcount + howmany(...)); This works to restore the check in the removed conditional, but is a bit subtle and leaves the 2 old overflow bugs unfixed. > While I agree with your assessment of the removed conditional, I think the > suggestion above can have a funky overflow where f_seqcount + howmany(...) ends > up less than IO_SEQMAX and this expression would then be used instead of IO_SEQMAX? This only happens when howmany() itself overflows. Otherwise, dividing by 16384 reduces the value enough to add f_seqcount to howmany(...) without overflow. > The first lmin seems designed to minimize what we add in the hope that since the > existing value is bounded to '0...IO_SEQMAX' the result of the += can only be in > the range '0...2*IO_SEQMAX'. One addition doesn't overflow, and the shift could be clamped later, but overflow still occurs after approx. INT_MAX / IO_SEQMAX additions, so it is better to clamp earlier. > I'm not sure which variants are most readable: > > A) > fp->f_seqcount += lmin(IO_SEQMAX, > howmany(resid, 16384)); > if (fp->f_seqcount > IO_SEQMAX) > fp->f_seqcount = IO_SEQMAX; This change is because I said that using the unsafe macro MIN() is a style bug. I also said that using the lmin() family is too hard, since it is not type generic. I didn't notice the overflow problem in howmany(). This has another style bug -- using lmin() and then open-coding the clamp f->f_seqcount = imax(f->f_seqcount, IO_SEQMAX). This is sort of backwards -- we use open code for the simple case because it is simple with either spelling, but we use lmin() for the complicated case to avoid spelling out the howmany() expression twice. This obscures the 2 overflow bugs in the howmany() expression and many delicate type promotions and type equivalences that are needed for lmin() to work. > B) > fp->f_seqcount += lmin(IO_SEQMAX, > howmany(resid, 16384)); > fp->f_seqcount = lmin(fp->f_seqcount, IO_SEQMAX); Consistent style, but another has another type error. f_seqcount has type int. Of course, lmin() handles ints too, but to see that it works you still have to check that f_seqcount is representable as long and once you do that it is easier to see that imin() is courrect. > C) > if (fp->f_seqcount + howmany(resid, 16384) < fp->f_seqcount) > fp->f_seqcount = IO_SEQMAX; > else > fp->f_seqcount = lmin(IO_SEQMAX, > fp->f_seqcount + howmany(resid, 16384)); > > I'm probably not a fan of C). On supported arches, it recovers from overflow in howmany(), but only if the compiler doesn't optimize away the recovery. The first part can be done better: if (uio->uio_resid >= IO_SEQMAX * 16384) fp->f_seqcount = IO_SEQMAX; Then for the second part, any version works since all values are small and non-negative, but I prefer to restore the the version that I rewrote 15-20 years ago and committed 11 years ago (r175106): fp->f_seqcount += howmany(uio->uio_resid, 16384); if (fp->f_seqcount > IO_SEQMAX) fp->f_seqcount = IO_SEQMAX; My changes to this were to use 16384 instead of BKVASIZE and howmany() instead of its expansion. Changing to howmany() was a mistake since it hides the first overflow. When I rewrote it, uio_resid had type int so it was small enough after division by 16384, but not small enough to add (16384 - 1) to. I didn't change the open-coded clamp on f_seqcount in this because it was good enough. Bruce From owner-svn-src-all@freebsd.org Tue Jul 16 10:06:42 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 41E79AB560; Tue, 16 Jul 2019 10:06:42 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 068F6757DA; Tue, 16 Jul 2019 10:06:42 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D4B4544ED; Tue, 16 Jul 2019 10:06:41 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6GA6fiq006750; Tue, 16 Jul 2019 10:06:41 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6GA6fnW006749; Tue, 16 Jul 2019 10:06:41 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201907161006.x6GA6fnW006749@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 16 Jul 2019 10:06:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350026 - head/usr.sbin/traceroute6 X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/usr.sbin/traceroute6 X-SVN-Commit-Revision: 350026 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 068F6757DA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jul 2019 10:06:42 -0000 Author: tuexen Date: Tue Jul 16 10:06:41 2019 New Revision: 350026 URL: https://svnweb.freebsd.org/changeset/base/350026 Log: Whitespace change. No functional change. MFC after: 2 weeks Modified: head/usr.sbin/traceroute6/traceroute6.c Modified: head/usr.sbin/traceroute6/traceroute6.c ============================================================================== --- head/usr.sbin/traceroute6/traceroute6.c Tue Jul 16 08:36:49 2019 (r350025) +++ head/usr.sbin/traceroute6/traceroute6.c Tue Jul 16 10:06:41 2019 (r350026) @@ -1006,7 +1006,7 @@ wait_for_reply(int sock, struct msghdr *mhdr) if (poll(pfd, 1, waittime * 1000) > 0) cc = recvmsg(rcvsock, mhdr, 0); - return(cc); + return (cc); #else fd_set *fdsp; struct timeval wait; @@ -1023,7 +1023,7 @@ wait_for_reply(int sock, struct msghdr *mhdr) cc = recvmsg(rcvsock, mhdr, 0); free(fdsp); - return(cc); + return (cc); #endif } @@ -1189,10 +1189,10 @@ get_hoplim(struct msghdr *mhdr) if (cm->cmsg_level == IPPROTO_IPV6 && cm->cmsg_type == IPV6_HOPLIMIT && cm->cmsg_len == CMSG_LEN(sizeof(int))) - return(*(int *)CMSG_DATA(cm)); + return (*(int *)CMSG_DATA(cm)); } - return(-1); + return (-1); } double @@ -1303,7 +1303,7 @@ packet_ok(struct msghdr *mhdr, int cc, int seq) strlcpy(hbuf, "invalid", sizeof(hbuf)); printf("data too short (%d bytes) from %s\n", cc, hbuf); } - return(0); + return (0); } icp = (struct icmp6_hdr *)buf; #endif @@ -1326,7 +1326,7 @@ packet_ok(struct msghdr *mhdr, int cc, int seq) if (rcvpktinfo == NULL || hlimp == NULL) { warnx("failed to get received hop limit or packet info"); #if 0 - return(0); + return (0); #else rcvhlim = 0; /*XXX*/ #endif @@ -1350,7 +1350,7 @@ packet_ok(struct msghdr *mhdr, int cc, int seq) if ((up = get_uphdr(hip, (u_char *)(buf + cc))) == NULL) { if (verbose) warnx("failed to get upper layer header"); - return(0); + return (0); } switch (useproto) { case IPPROTO_ICMPV6: @@ -1445,7 +1445,7 @@ packet_ok(struct msghdr *mhdr, int cc, int seq) if (cc % WIDTH != 0) printf("\n"); } - return(0); + return (0); } /* @@ -1459,7 +1459,7 @@ get_uphdr(struct ip6_hdr *ip6, u_char *lim) static u_char none_hdr[1]; /* Fake pointer for IPPROTO_NONE. */ if (cp + sizeof(*ip6) > lim) - return(NULL); + return (NULL); nh = ip6->ip6_nxt; cp += sizeof(struct ip6_hdr); @@ -1467,15 +1467,15 @@ get_uphdr(struct ip6_hdr *ip6, u_char *lim) while (lim - cp >= (nh == IPPROTO_NONE ? 0 : 8)) { switch (nh) { case IPPROTO_ESP: - return(NULL); + return (NULL); case IPPROTO_ICMPV6: - return(useproto == nh ? cp : NULL); + return (useproto == nh ? cp : NULL); case IPPROTO_SCTP: case IPPROTO_TCP: case IPPROTO_UDP: - return(useproto == nh ? cp : NULL); + return (useproto == nh ? cp : NULL); case IPPROTO_NONE: - return(useproto == nh ? none_hdr : NULL); + return (useproto == nh ? none_hdr : NULL); case IPPROTO_FRAGMENT: hlen = sizeof(struct ip6_frag); nh = ((struct ip6_frag *)cp)->ip6f_nxt; @@ -1493,7 +1493,7 @@ get_uphdr(struct ip6_hdr *ip6, u_char *lim) cp += hlen; } - return(NULL); + return (NULL); } void From owner-svn-src-all@freebsd.org Tue Jul 16 12:38:18 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4D712AED79; Tue, 16 Jul 2019 12:38:18 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2C57A8312D; Tue, 16 Jul 2019 12:38:18 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1181F5F72; Tue, 16 Jul 2019 12:38:18 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6GCcH6X094667; Tue, 16 Jul 2019 12:38:17 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6GCcHOS094666; Tue, 16 Jul 2019 12:38:17 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201907161238.x6GCcHOS094666@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 16 Jul 2019 12:38:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350027 - head/usr.sbin/traceroute6 X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/usr.sbin/traceroute6 X-SVN-Commit-Revision: 350027 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2C57A8312D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jul 2019 12:38:18 -0000 Author: tuexen Date: Tue Jul 16 12:38:17 2019 New Revision: 350027 URL: https://svnweb.freebsd.org/changeset/base/350027 Log: Let packet_op() explicitly return the type and code instead of doing this implicitly by encoding it in a number space. No functional change intended. This is done as a preparation to add support for ICMPv6 mesages indicating a parameter problem related to the next header. MFC after: 2 weeks Modified: head/usr.sbin/traceroute6/traceroute6.c Modified: head/usr.sbin/traceroute6/traceroute6.c ============================================================================== --- head/usr.sbin/traceroute6/traceroute6.c Tue Jul 16 10:06:41 2019 (r350026) +++ head/usr.sbin/traceroute6/traceroute6.c Tue Jul 16 12:38:17 2019 (r350027) @@ -309,7 +309,7 @@ void *get_uphdr(struct ip6_hdr *, u_char *); int get_hoplim(struct msghdr *); double deltaT(struct timeval *, struct timeval *); const char *pr_type(int); -int packet_ok(struct msghdr *, int, int); +int packet_ok(struct msghdr *, int, int, u_char *, u_char *); void print(struct msghdr *, int); const char *inetname(struct sockaddr *); u_int32_t sctp_crc32c(void *, u_int32_t); @@ -367,6 +367,7 @@ main(int argc, char *argv[]) struct hostent *hp; size_t size, minlen; uid_t uid; + u_char type, code; /* * Receive ICMP @@ -937,7 +938,7 @@ main(int argc, char *argv[]) send_probe(++seq, hops); while ((cc = wait_for_reply(rcvsock, &rcvmhdr))) { (void) gettimeofday(&t2, NULL); - if ((i = packet_ok(&rcvmhdr, cc, seq))) { + if (packet_ok(&rcvmhdr, cc, seq, &type, &code)) { if (!IN6_ARE_ADDR_EQUAL(&Rcv.sin6_addr, &lastaddr)) { if (probe > 0) @@ -946,29 +947,36 @@ main(int argc, char *argv[]) lastaddr = Rcv.sin6_addr; } printf(" %.3f ms", deltaT(&t1, &t2)); - switch (i - 1) { - case ICMP6_DST_UNREACH_NOROUTE: - ++unreachable; - printf(" !N"); - break; - case ICMP6_DST_UNREACH_ADMIN: - ++unreachable; - printf(" !P"); - break; - case ICMP6_DST_UNREACH_NOTNEIGHBOR: - ++unreachable; - printf(" !S"); - break; - case ICMP6_DST_UNREACH_ADDR: - ++unreachable; - printf(" !A"); - break; - case ICMP6_DST_UNREACH_NOPORT: + if (type == ICMP6_DST_UNREACH) { + switch (code) { + case ICMP6_DST_UNREACH_NOROUTE: + ++unreachable; + printf(" !N"); + break; + case ICMP6_DST_UNREACH_ADMIN: + ++unreachable; + printf(" !P"); + break; + case ICMP6_DST_UNREACH_NOTNEIGHBOR: + ++unreachable; + printf(" !S"); + break; + case ICMP6_DST_UNREACH_ADDR: + ++unreachable; + printf(" !A"); + break; + case ICMP6_DST_UNREACH_NOPORT: + if (rcvhlim >= 0 && + rcvhlim <= 1) + printf(" !"); + ++got_there; + break; + } + } else if (type == ICMP6_ECHO_REPLY) { if (rcvhlim >= 0 && rcvhlim <= 1) printf(" !"); ++got_there; - break; } break; } else if (deltaT(&t1, &t2) > waittime * 1000) { @@ -1265,11 +1273,10 @@ pr_type(int t0) } int -packet_ok(struct msghdr *mhdr, int cc, int seq) +packet_ok(struct msghdr *mhdr, int cc, int seq, u_char *type, u_char *code) { struct icmp6_hdr *icp; struct sockaddr_in6 *from = (struct sockaddr_in6 *)mhdr->msg_name; - u_char type, code; char *buf = (char *)mhdr->msg_iov[0].iov_base; struct cmsghdr *cm; int *hlimp; @@ -1334,10 +1341,11 @@ packet_ok(struct msghdr *mhdr, int cc, int seq) else rcvhlim = *hlimp; - type = icp->icmp6_type; - code = icp->icmp6_code; - if ((type == ICMP6_TIME_EXCEEDED && code == ICMP6_TIME_EXCEED_TRANSIT) - || type == ICMP6_DST_UNREACH) { + *type = icp->icmp6_type; + *code = icp->icmp6_code; + if ((*type == ICMP6_TIME_EXCEEDED && + *code == ICMP6_TIME_EXCEED_TRANSIT) || + (*type == ICMP6_DST_UNREACH)) { struct ip6_hdr *hip; struct icmp6_hdr *icmp; struct sctp_init_chunk *init; @@ -1357,15 +1365,13 @@ packet_ok(struct msghdr *mhdr, int cc, int seq) icmp = (struct icmp6_hdr *)up; if (icmp->icmp6_id == ident && icmp->icmp6_seq == htons(seq)) - return (type == ICMP6_TIME_EXCEEDED ? - -1 : code + 1); + return (1); break; case IPPROTO_UDP: udp = (struct udphdr *)up; if (udp->uh_sport == htons(srcport) && udp->uh_dport == htons(port + seq)) - return (type == ICMP6_TIME_EXCEEDED ? - -1 : code + 1); + return (1); break; case IPPROTO_SCTP: sctp = (struct sctphdr *)up; @@ -1381,20 +1387,17 @@ packet_ok(struct msghdr *mhdr, int cc, int seq) init = (struct sctp_init_chunk *)(sctp + 1); /* Check the initiate tag, if available. */ if ((char *)&init->init.a_rwnd > buf + cc) { - return (type == ICMP6_TIME_EXCEEDED ? - -1 : code + 1); + return (1); } if (init->init.initiate_tag == (u_int32_t) ((sctp->src_port << 16) | sctp->dest_port)) { - return (type == ICMP6_TIME_EXCEEDED ? - -1 : code + 1); + return (1); } } else { if (sctp->v_tag == (u_int32_t)((sctp->src_port << 16) | sctp->dest_port)) { - return (type == ICMP6_TIME_EXCEEDED ? - -1 : code + 1); + return (1); } } break; @@ -1404,19 +1407,18 @@ packet_ok(struct msghdr *mhdr, int cc, int seq) tcp->th_dport == htons(port + seq) && tcp->th_seq == (tcp_seq)((tcp->th_sport << 16) | tcp->th_dport)) - return (type == ICMP6_TIME_EXCEEDED ? - -1 : code + 1); + return (1); break; case IPPROTO_NONE: - return (type == ICMP6_TIME_EXCEEDED ? -1 : code + 1); + return (1); default: fprintf(stderr, "Unknown probe proto %d.\n", useproto); break; } - } else if (useproto == IPPROTO_ICMPV6 && type == ICMP6_ECHO_REPLY) { + } else if (useproto == IPPROTO_ICMPV6 && *type == ICMP6_ECHO_REPLY) { if (icp->icmp6_id == ident && icp->icmp6_seq == htons(seq)) - return (ICMP6_DST_UNREACH_NOPORT + 1); + return (1); } if (verbose) { char sbuf[NI_MAXHOST+1], dbuf[INET6_ADDRSTRLEN]; @@ -1429,8 +1431,8 @@ packet_ok(struct msghdr *mhdr, int cc, int seq) printf("\n%d bytes from %s to %s", cc, sbuf, rcvpktinfo ? inet_ntop(AF_INET6, &rcvpktinfo->ipi6_addr, dbuf, sizeof(dbuf)) : "?"); - printf(": icmp type %d (%s) code %d\n", type, pr_type(type), - icp->icmp6_code); + printf(": icmp type %d (%s) code %d\n", *type, pr_type(*type), + *code); p = (u_int8_t *)(icp + 1); #define WIDTH 16 for (i = 0; i < cc; i++) { From owner-svn-src-all@freebsd.org Tue Jul 16 12:58:00 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E0C74AF3C1; Tue, 16 Jul 2019 12:58:00 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C224983C82; Tue, 16 Jul 2019 12:58:00 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9EE9062F8; Tue, 16 Jul 2019 12:58:00 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6GCw00J006856; Tue, 16 Jul 2019 12:58:00 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6GCw0Fc006854; Tue, 16 Jul 2019 12:58:00 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201907161258.x6GCw0Fc006854@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 16 Jul 2019 12:58:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350028 - head/usr.sbin/traceroute6 X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/usr.sbin/traceroute6 X-SVN-Commit-Revision: 350028 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C224983C82 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jul 2019 12:58:00 -0000 Author: tuexen Date: Tue Jul 16 12:57:59 2019 New Revision: 350028 URL: https://svnweb.freebsd.org/changeset/base/350028 Log: Add support for ICMPv6 messages indicating a parameter problem related to an unrecognized next header. MFC after: 2 weeks Modified: head/usr.sbin/traceroute6/traceroute6.8 head/usr.sbin/traceroute6/traceroute6.c Modified: head/usr.sbin/traceroute6/traceroute6.8 ============================================================================== --- head/usr.sbin/traceroute6/traceroute6.8 Tue Jul 16 12:38:17 2019 (r350027) +++ head/usr.sbin/traceroute6/traceroute6.8 Tue Jul 16 12:57:59 2019 (r350028) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 2, 2018 +.Dd July 16, 2019 .Dt TRACEROUTE6 8 .Os .\" @@ -172,6 +172,8 @@ Destination Unreachable - Administratively Prohibited. Destination Unreachable - Not a Neighbour. .It !A Destination Unreachable - Address Unreachable. +.It !H +Parameter Problem - Unrecognized Next Header Type. .It !\& This is printed if the hop limit is <= 1 on a port unreachable message. This means that the packet got to the destination, Modified: head/usr.sbin/traceroute6/traceroute6.c ============================================================================== --- head/usr.sbin/traceroute6/traceroute6.c Tue Jul 16 12:38:17 2019 (r350027) +++ head/usr.sbin/traceroute6/traceroute6.c Tue Jul 16 12:57:59 2019 (r350028) @@ -972,6 +972,10 @@ main(int argc, char *argv[]) ++got_there; break; } + } else if (type == ICMP6_PARAM_PROB && + code == ICMP6_PARAMPROB_NEXTHEADER) { + printf(" !H"); + ++got_there; } else if (type == ICMP6_ECHO_REPLY) { if (rcvhlim >= 0 && rcvhlim <= 1) @@ -1345,7 +1349,9 @@ packet_ok(struct msghdr *mhdr, int cc, int seq, u_char *code = icp->icmp6_code; if ((*type == ICMP6_TIME_EXCEEDED && *code == ICMP6_TIME_EXCEED_TRANSIT) || - (*type == ICMP6_DST_UNREACH)) { + (*type == ICMP6_DST_UNREACH) || + (*type == ICMP6_PARAM_PROB && + *code == ICMP6_PARAMPROB_NEXTHEADER)) { struct ip6_hdr *hip; struct icmp6_hdr *icmp; struct sctp_init_chunk *init; From owner-svn-src-all@freebsd.org Tue Jul 16 14:40:50 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 350B6B10F3; Tue, 16 Jul 2019 14:40:50 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 183B98776E; Tue, 16 Jul 2019 14:40:50 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D05467505; Tue, 16 Jul 2019 14:40:49 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6GEenNK065323; Tue, 16 Jul 2019 14:40:49 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6GEenHI065322; Tue, 16 Jul 2019 14:40:49 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201907161440.x6GEenHI065322@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 16 Jul 2019 14:40:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350029 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 350029 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 183B98776E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.93)[-0.934,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jul 2019 14:40:50 -0000 Author: markj Date: Tue Jul 16 14:40:49 2019 New Revision: 350029 URL: https://svnweb.freebsd.org/changeset/base/350029 Log: Propagate attribute changes during demotion. After r349117 and r349122, some mapping attribute changes do not trigger superpage demotion. However, pmap_demote_l2() was not updated to ensure that the replacement L3 entries carry any attribute changes that occurred since promotion. Reported and tested by: manu Reviewed by: alc MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20965 Modified: head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Tue Jul 16 12:57:59 2019 (r350028) +++ head/sys/arm64/arm64/pmap.c Tue Jul 16 14:40:49 2019 (r350029) @@ -5310,6 +5310,17 @@ pmap_demote_l1(pmap_t pmap, pt_entry_t *l1, vm_offset_ } static void +pmap_fill_l3(pt_entry_t *firstl3, pt_entry_t newl3) +{ + pt_entry_t *l3; + + for (l3 = firstl3; l3 - firstl3 < Ln_ENTRIES; l3++) { + *l3 = newl3; + newl3 += L3_SIZE; + } +} + +static void pmap_demote_l2_abort(pmap_t pmap, vm_offset_t va, pt_entry_t *l2, struct rwlock **lockp) { @@ -5330,9 +5341,8 @@ pmap_demote_l2_locked(pmap_t pmap, pt_entry_t *l2, vm_ { pt_entry_t *l3, newl3, oldl2; vm_offset_t tmpl2; - vm_paddr_t l3phys, phys; + vm_paddr_t l3phys; vm_page_t ml3; - int i; PMAP_LOCK_ASSERT(pmap, MA_OWNED); l3 = NULL; @@ -5406,27 +5416,17 @@ pmap_demote_l2_locked(pmap_t pmap, pt_entry_t *l2, vm_ } l3phys = VM_PAGE_TO_PHYS(ml3); l3 = (pt_entry_t *)PHYS_TO_DMAP(l3phys); - /* Address the range points at */ - phys = oldl2 & ~ATTR_MASK; - /* The attributed from the old l2 table to be copied */ - newl3 = (oldl2 & (ATTR_MASK & ~ATTR_DESCR_MASK)) | L3_PAGE; + newl3 = (oldl2 & ~ATTR_DESCR_MASK) | L3_PAGE; KASSERT((oldl2 & (ATTR_AP_RW_BIT | ATTR_SW_DBM)) != (ATTR_AP(ATTR_AP_RO) | ATTR_SW_DBM), ("pmap_demote_l2: L2 entry is writeable but not dirty")); /* * If the page table page is not leftover from an earlier promotion, - * initialize it. + * or the mapping attributes have changed, (re)initialize the L3 table. */ - if (ml3->valid == 0) { - for (i = 0; i < Ln_ENTRIES; i++) { - l3[i] = newl3 | phys; - phys += L3_SIZE; - } - } - KASSERT(l3[0] == ((oldl2 & ~ATTR_DESCR_MASK) | L3_PAGE), - ("Invalid l3 page (%lx != %lx)", l3[0], - (oldl2 & ~ATTR_DESCR_MASK) | L3_PAGE)); + if (ml3->valid == 0 || (l3[0] & ATTR_MASK) != (newl3 & ATTR_MASK)) + pmap_fill_l3(l3, newl3); /* * Map the temporary page so we don't lose access to the l2 table. From owner-svn-src-all@freebsd.org Tue Jul 16 14:59:40 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D966CB1A52; Tue, 16 Jul 2019 14:59:40 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B948988634; Tue, 16 Jul 2019 14:59:40 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 96B7E7870; Tue, 16 Jul 2019 14:59:40 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6GExeWl077123; Tue, 16 Jul 2019 14:59:40 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6GExeES077120; Tue, 16 Jul 2019 14:59:40 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201907161459.x6GExeES077120@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 16 Jul 2019 14:59:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350030 - stable/12/sys/dev/iicbus X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/sys/dev/iicbus X-SVN-Commit-Revision: 350030 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B948988634 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.95)[-0.949,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jul 2019 14:59:40 -0000 Author: avg Date: Tue Jul 16 14:59:39 2019 New Revision: 350030 URL: https://svnweb.freebsd.org/changeset/base/350030 Log: MFC r348355: revert r273728 and parts of r306589, iicbus no-stop by default feature After r349224 the only consumer of that broken code is gone. Modified: stable/12/sys/dev/iicbus/iicbus.c stable/12/sys/dev/iicbus/iicbus.h stable/12/sys/dev/iicbus/iiconf.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/iicbus/iicbus.c ============================================================================== --- stable/12/sys/dev/iicbus/iicbus.c Tue Jul 16 14:40:49 2019 (r350029) +++ stable/12/sys/dev/iicbus/iicbus.c Tue Jul 16 14:59:39 2019 (r350030) @@ -194,9 +194,6 @@ iicbus_read_ivar(device_t bus, device_t child, int whi case IICBUS_IVAR_ADDR: *result = devi->addr; break; - case IICBUS_IVAR_NOSTOP: - *result = devi->nostop; - break; } return (0); } @@ -213,9 +210,6 @@ iicbus_write_ivar(device_t bus, device_t child, int wh if (devi->addr != 0) return (EINVAL); devi->addr = value; - case IICBUS_IVAR_NOSTOP: - devi->nostop = value; - break; } return (0); } Modified: stable/12/sys/dev/iicbus/iicbus.h ============================================================================== --- stable/12/sys/dev/iicbus/iicbus.h Tue Jul 16 14:40:49 2019 (r350029) +++ stable/12/sys/dev/iicbus/iicbus.h Tue Jul 16 14:59:39 2019 (r350030) @@ -54,19 +54,16 @@ struct iicbus_ivar { uint32_t addr; struct resource_list rl; - bool nostop; }; enum { - IICBUS_IVAR_ADDR, /* Address or base address */ - IICBUS_IVAR_NOSTOP, /* nostop defaults */ + IICBUS_IVAR_ADDR /* Address or base address */ }; #define IICBUS_ACCESSOR(A, B, T) \ __BUS_ACCESSOR(iicbus, A, IICBUS, B, T) IICBUS_ACCESSOR(addr, ADDR, uint32_t) -IICBUS_ACCESSOR(nostop, NOSTOP, bool) #define IICBUS_LOCK(sc) mtx_lock(&(sc)->lock) #define IICBUS_UNLOCK(sc) mtx_unlock(&(sc)->lock) Modified: stable/12/sys/dev/iicbus/iiconf.c ============================================================================== --- stable/12/sys/dev/iicbus/iiconf.c Tue Jul 16 14:40:49 2019 (r350029) +++ stable/12/sys/dev/iicbus/iiconf.c Tue Jul 16 14:59:39 2019 (r350030) @@ -427,7 +427,7 @@ iicbus_transfer_gen(device_t dev, struct iic_msg *msgs { int i, error, lenread, lenwrote, nkid, rpstart, addr; device_t *children, bus; - bool nostop, started; + bool started; if ((error = device_get_children(dev, &children, &nkid)) != 0) return (IIC_ERESOURCE); @@ -438,7 +438,6 @@ iicbus_transfer_gen(device_t dev, struct iic_msg *msgs bus = children[0]; rpstart = 0; free(children, M_TEMP); - nostop = iicbus_get_nostop(dev); started = false; for (i = 0, error = 0; i < nmsgs && error == 0; i++) { addr = msgs[i].slave; @@ -466,12 +465,11 @@ iicbus_transfer_gen(device_t dev, struct iic_msg *msgs if (error != 0) break; - if ((msgs[i].flags & IIC_M_NOSTOP) != 0 || - (nostop && i + 1 < nmsgs)) { - rpstart = 1; /* Next message gets repeated start */ - } else { + if (!(msgs[i].flags & IIC_M_NOSTOP)) { rpstart = 0; iicbus_stop(bus); + } else { + rpstart = 1; /* Next message gets repeated start */ } } if (error != 0 && started) From owner-svn-src-all@freebsd.org Tue Jul 16 15:02:30 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 14740B1C38; Tue, 16 Jul 2019 15:02:30 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E9B7E88C02; Tue, 16 Jul 2019 15:02:29 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C68A67A23; Tue, 16 Jul 2019 15:02:29 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6GF2TTM082499; Tue, 16 Jul 2019 15:02:29 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6GF2TSq082497; Tue, 16 Jul 2019 15:02:29 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201907161502.x6GF2TSq082497@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 16 Jul 2019 15:02:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r350031 - stable/11/sys/dev/iicbus X-SVN-Group: stable-11 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/11/sys/dev/iicbus X-SVN-Commit-Revision: 350031 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E9B7E88C02 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.95)[-0.949,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jul 2019 15:02:30 -0000 Author: avg Date: Tue Jul 16 15:02:28 2019 New Revision: 350031 URL: https://svnweb.freebsd.org/changeset/base/350031 Log: MFC r348355: revert r273728 and parts of r306589, iicbus no-stop by default feature After r349227 the only consumer of that broken code is gone from this branch. Modified: stable/11/sys/dev/iicbus/iicbus.c stable/11/sys/dev/iicbus/iicbus.h stable/11/sys/dev/iicbus/iiconf.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iicbus/iicbus.c ============================================================================== --- stable/11/sys/dev/iicbus/iicbus.c Tue Jul 16 14:59:39 2019 (r350030) +++ stable/11/sys/dev/iicbus/iicbus.c Tue Jul 16 15:02:28 2019 (r350031) @@ -192,9 +192,6 @@ iicbus_read_ivar(device_t bus, device_t child, int whi case IICBUS_IVAR_ADDR: *result = devi->addr; break; - case IICBUS_IVAR_NOSTOP: - *result = devi->nostop; - break; } return (0); } @@ -211,9 +208,6 @@ iicbus_write_ivar(device_t bus, device_t child, int wh if (devi->addr != 0) return (EINVAL); devi->addr = value; - case IICBUS_IVAR_NOSTOP: - devi->nostop = value; - break; } return (0); } Modified: stable/11/sys/dev/iicbus/iicbus.h ============================================================================== --- stable/11/sys/dev/iicbus/iicbus.h Tue Jul 16 14:59:39 2019 (r350030) +++ stable/11/sys/dev/iicbus/iicbus.h Tue Jul 16 15:02:28 2019 (r350031) @@ -52,19 +52,16 @@ struct iicbus_ivar { uint32_t addr; struct resource_list rl; - bool nostop; }; enum { - IICBUS_IVAR_ADDR, /* Address or base address */ - IICBUS_IVAR_NOSTOP, /* nostop defaults */ + IICBUS_IVAR_ADDR /* Address or base address */ }; #define IICBUS_ACCESSOR(A, B, T) \ __BUS_ACCESSOR(iicbus, A, IICBUS, B, T) IICBUS_ACCESSOR(addr, ADDR, uint32_t) -IICBUS_ACCESSOR(nostop, NOSTOP, bool) #define IICBUS_LOCK(sc) mtx_lock(&(sc)->lock) #define IICBUS_UNLOCK(sc) mtx_unlock(&(sc)->lock) Modified: stable/11/sys/dev/iicbus/iiconf.c ============================================================================== --- stable/11/sys/dev/iicbus/iiconf.c Tue Jul 16 14:59:39 2019 (r350030) +++ stable/11/sys/dev/iicbus/iiconf.c Tue Jul 16 15:02:28 2019 (r350031) @@ -418,7 +418,7 @@ iicbus_transfer_gen(device_t dev, struct iic_msg *msgs { int i, error, lenread, lenwrote, nkid, rpstart, addr; device_t *children, bus; - bool nostop, started; + bool started; if ((error = device_get_children(dev, &children, &nkid)) != 0) return (IIC_ERESOURCE); @@ -429,7 +429,6 @@ iicbus_transfer_gen(device_t dev, struct iic_msg *msgs bus = children[0]; rpstart = 0; free(children, M_TEMP); - nostop = iicbus_get_nostop(dev); started = false; for (i = 0, error = 0; i < nmsgs && error == 0; i++) { addr = msgs[i].slave; @@ -457,12 +456,11 @@ iicbus_transfer_gen(device_t dev, struct iic_msg *msgs if (error != 0) break; - if ((msgs[i].flags & IIC_M_NOSTOP) != 0 || - (nostop && i + 1 < nmsgs)) { - rpstart = 1; /* Next message gets repeated start */ - } else { + if (!(msgs[i].flags & IIC_M_NOSTOP)) { rpstart = 0; iicbus_stop(bus); + } else { + rpstart = 1; /* Next message gets repeated start */ } } if (error != 0 && started) From owner-svn-src-all@freebsd.org Tue Jul 16 15:07:34 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CE898B1CF0; Tue, 16 Jul 2019 15:07:34 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B1F8B88E8C; Tue, 16 Jul 2019 15:07:34 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8B2D17A37; Tue, 16 Jul 2019 15:07:34 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6GF7Y8m082803; Tue, 16 Jul 2019 15:07:34 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6GF7YAm082801; Tue, 16 Jul 2019 15:07:34 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201907161507.x6GF7YAm082801@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 16 Jul 2019 15:07:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350032 - in stable/12/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/12/sys/compat/linuxkpi/common: include/linux src X-SVN-Commit-Revision: 350032 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B1F8B88E8C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.949,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jul 2019 15:07:34 -0000 Author: hselasky Date: Tue Jul 16 15:07:33 2019 New Revision: 350032 URL: https://svnweb.freebsd.org/changeset/base/350032 Log: MFC r349645: Remove dead code added after r348743 in the LinuxKPI. The LINUXKPI_VERSION macro is not defined for any compiled LinuxKPI code which basically means __GFP_NOTWIRED is never checked when allocating pages. This should work fine with the existing external DRM code as long as the page wiring and unwiring is balanced. Sponsored by: Mellanox Technologies Modified: stable/12/sys/compat/linuxkpi/common/include/linux/gfp.h stable/12/sys/compat/linuxkpi/common/src/linux_page.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/gfp.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/linux/gfp.h Tue Jul 16 15:02:28 2019 (r350031) +++ stable/12/sys/compat/linuxkpi/common/include/linux/gfp.h Tue Jul 16 15:07:33 2019 (r350032) @@ -58,9 +58,6 @@ #define __GFP_NO_KSWAPD 0 #define __GFP_WAIT M_WAITOK #define __GFP_DMA32 (1U << 24) /* LinuxKPI only */ -#if defined(LINUXKPI_VERSION) && LINUXKPI_VERSION == 50000 -#define __GFP_NOTWIRED (1U << 25) -#endif #define __GFP_BITS_SHIFT 25 #define __GFP_BITS_MASK ((1 << __GFP_BITS_SHIFT) - 1) #define __GFP_NOFAIL M_WAITOK @@ -101,9 +98,6 @@ static inline struct page * alloc_page(gfp_t flags) { -#ifdef __GFP_NOTWIRED - flags |= __GFP_NOTWIRED; -#endif return (linux_alloc_pages(flags, 0)); } @@ -111,9 +105,6 @@ static inline struct page * alloc_pages(gfp_t flags, unsigned int order) { -#ifdef __GFP_NOTWIRED - flags |= __GFP_NOTWIRED; -#endif return (linux_alloc_pages(flags, order)); } @@ -121,9 +112,6 @@ static inline struct page * alloc_pages_node(int node_id, gfp_t flags, unsigned int order) { -#ifdef __GFP_NOTWIRED - flags |= __GFP_NOTWIRED; -#endif return (linux_alloc_pages(flags, order)); } Modified: stable/12/sys/compat/linuxkpi/common/src/linux_page.c ============================================================================== --- stable/12/sys/compat/linuxkpi/common/src/linux_page.c Tue Jul 16 15:02:28 2019 (r350031) +++ stable/12/sys/compat/linuxkpi/common/src/linux_page.c Tue Jul 16 15:07:33 2019 (r350032) @@ -93,10 +93,6 @@ linux_alloc_pages(gfp_t flags, unsigned int order) unsigned long npages = 1UL << order; int req = VM_ALLOC_NOOBJ | VM_ALLOC_WIRED | VM_ALLOC_NORMAL; -#ifdef __GFP_NOTWIRED - if ((flags & __GFP_NOTWIRED) != 0) - req &= ~VM_ALLOC_WIRED; -#endif if ((flags & M_ZERO) != 0) req |= VM_ALLOC_ZERO; if (order == 0 && (flags & GFP_DMA32) == 0) { From owner-svn-src-all@freebsd.org Tue Jul 16 15:28:29 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3E0CBB24AA; Tue, 16 Jul 2019 15:28:29 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EDE4589EB8; Tue, 16 Jul 2019 15:28:28 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C24FA7E1F; Tue, 16 Jul 2019 15:28:28 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6GFSSum095342; Tue, 16 Jul 2019 15:28:28 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6GFSS70095341; Tue, 16 Jul 2019 15:28:28 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201907161528.x6GFSS70095341@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 16 Jul 2019 15:28:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350033 - stable/12/sys/sys X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/sys/sys X-SVN-Commit-Revision: 350033 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EDE4589EB8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jul 2019 15:28:29 -0000 Author: avg Date: Tue Jul 16 15:28:28 2019 New Revision: 350033 URL: https://svnweb.freebsd.org/changeset/base/350033 Log: MFC r348688: first step towards enforcing must-succeed semantics for bus accessors Modified: stable/12/sys/sys/bus.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/sys/bus.h ============================================================================== --- stable/12/sys/sys/bus.h Tue Jul 16 15:07:33 2019 (r350032) +++ stable/12/sys/sys/bus.h Tue Jul 16 15:28:28 2019 (r350033) @@ -807,16 +807,30 @@ DECLARE_MODULE(name##_##busname, name##_##busname##_mo static __inline type varp ## _get_ ## var(device_t dev) \ { \ uintptr_t v; \ - BUS_READ_IVAR(device_get_parent(dev), dev, \ + int e; \ + e = BUS_READ_IVAR(device_get_parent(dev), dev, \ ivarp ## _IVAR_ ## ivar, &v); \ + if (e != 0) { \ + device_printf(dev, "failed to read ivar " \ + __XSTRING(ivarp ## _IVAR_ ## ivar) " on bus %s, " \ + "error = %d\n", \ + device_get_nameunit(device_get_parent(dev)), e); \ + } \ return ((type) v); \ } \ \ static __inline void varp ## _set_ ## var(device_t dev, type t) \ { \ uintptr_t v = (uintptr_t) t; \ - BUS_WRITE_IVAR(device_get_parent(dev), dev, \ + int e; \ + e = BUS_WRITE_IVAR(device_get_parent(dev), dev, \ ivarp ## _IVAR_ ## ivar, v); \ + if (e != 0) { \ + device_printf(dev, "failed to write ivar " \ + __XSTRING(ivarp ## _IVAR_ ## ivar) " on bus %s, " \ + "error = %d\n", \ + device_get_nameunit(device_get_parent(dev)), e); \ + } \ } /** From owner-svn-src-all@freebsd.org Tue Jul 16 15:28:42 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E3886B24EC; Tue, 16 Jul 2019 15:28:42 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9CC3089FD6; Tue, 16 Jul 2019 15:28:42 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7951F7E20; Tue, 16 Jul 2019 15:28:42 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6GFSgus095403; Tue, 16 Jul 2019 15:28:42 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6GFSgoW095402; Tue, 16 Jul 2019 15:28:42 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201907161528.x6GFSgoW095402@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 16 Jul 2019 15:28:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r350034 - stable/11/sys/sys X-SVN-Group: stable-11 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/11/sys/sys X-SVN-Commit-Revision: 350034 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9CC3089FD6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jul 2019 15:28:43 -0000 Author: avg Date: Tue Jul 16 15:28:41 2019 New Revision: 350034 URL: https://svnweb.freebsd.org/changeset/base/350034 Log: MFC r348688: first step towards enforcing must-succeed semantics for bus accessors Modified: stable/11/sys/sys/bus.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/sys/bus.h ============================================================================== --- stable/11/sys/sys/bus.h Tue Jul 16 15:28:28 2019 (r350033) +++ stable/11/sys/sys/bus.h Tue Jul 16 15:28:41 2019 (r350034) @@ -787,16 +787,30 @@ DECLARE_MODULE(name##_##busname, name##_##busname##_mo static __inline type varp ## _get_ ## var(device_t dev) \ { \ uintptr_t v; \ - BUS_READ_IVAR(device_get_parent(dev), dev, \ + int e; \ + e = BUS_READ_IVAR(device_get_parent(dev), dev, \ ivarp ## _IVAR_ ## ivar, &v); \ + if (e != 0) { \ + device_printf(dev, "failed to read ivar " \ + __XSTRING(ivarp ## _IVAR_ ## ivar) " on bus %s, " \ + "error = %d\n", \ + device_get_nameunit(device_get_parent(dev)), e); \ + } \ return ((type) v); \ } \ \ static __inline void varp ## _set_ ## var(device_t dev, type t) \ { \ uintptr_t v = (uintptr_t) t; \ - BUS_WRITE_IVAR(device_get_parent(dev), dev, \ + int e; \ + e = BUS_WRITE_IVAR(device_get_parent(dev), dev, \ ivarp ## _IVAR_ ## ivar, v); \ + if (e != 0) { \ + device_printf(dev, "failed to write ivar " \ + __XSTRING(ivarp ## _IVAR_ ## ivar) " on bus %s, " \ + "error = %d\n", \ + device_get_nameunit(device_get_parent(dev)), e); \ + } \ } /** From owner-svn-src-all@freebsd.org Tue Jul 16 15:36:06 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D650FB273B; Tue, 16 Jul 2019 15:36:06 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 945A28A4F7; Tue, 16 Jul 2019 15:36:06 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6BFE77FD3; Tue, 16 Jul 2019 15:36:06 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6GFa63M001074; Tue, 16 Jul 2019 15:36:06 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6GFa6iN001073; Tue, 16 Jul 2019 15:36:06 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201907161536.x6GFa6iN001073@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 16 Jul 2019 15:36:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350035 - stable/12/share/man/man4 X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/share/man/man4 X-SVN-Commit-Revision: 350035 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 945A28A4F7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jul 2019 15:36:06 -0000 Author: avg Date: Tue Jul 16 15:36:05 2019 New Revision: 350035 URL: https://svnweb.freebsd.org/changeset/base/350035 Log: MFC r349406: owc.4: document how to set up the 1-wire bus on a device.hints system Modified: stable/12/share/man/man4/owc.4 Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/owc.4 ============================================================================== --- stable/12/share/man/man4/owc.4 Tue Jul 16 15:28:41 2019 (r350034) +++ stable/12/share/man/man4/owc.4 Tue Jul 16 15:36:05 2019 (r350035) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 20, 2015 +.Dd June 26, 2019 .Dt OWC 4 .Os .Sh NAME @@ -69,6 +69,24 @@ For more details about the .Va gpios property, please consult .Pa /usr/src/sys/dts/bindings-gpio.txt . +.Pp +On a +.Xr device.hints 5 +based system these values are required for the +.Nm : +.Bl -tag -width ".Va hint.owc.%d.atXXX" +.It Va hint.owc.%d.at +The +.Nm gpiobus +you are attaching to. +.It Va hint.owc.%d.pins +This is a bitmask that defines a pin on the +.Nm gpiobus +that is to be used for the 1-Wire bus. +For instance, to configure pin 10, use the bitmask of 0x400. +Please note that this mask should have only one bit set +(any other bits - i.e., pins - will be ignored). +.El .Sh SEE ALSO .Xr gpiobus 4 , .Xr ow 4 , From owner-svn-src-all@freebsd.org Tue Jul 16 15:37:39 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3553DB27C1; Tue, 16 Jul 2019 15:37:39 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 165098A69A; Tue, 16 Jul 2019 15:37:39 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DC2DC7FD4; Tue, 16 Jul 2019 15:37:38 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6GFbc2Z001221; Tue, 16 Jul 2019 15:37:38 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6GFbcuF001220; Tue, 16 Jul 2019 15:37:38 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201907161537.x6GFbcuF001220@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 16 Jul 2019 15:37:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r350036 - stable/11/share/man/man4 X-SVN-Group: stable-11 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/11/share/man/man4 X-SVN-Commit-Revision: 350036 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 165098A69A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jul 2019 15:37:39 -0000 Author: avg Date: Tue Jul 16 15:37:38 2019 New Revision: 350036 URL: https://svnweb.freebsd.org/changeset/base/350036 Log: MFC r349406: owc.4: document how to set up the 1-wire bus on a device.hints system Modified: stable/11/share/man/man4/owc.4 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/owc.4 ============================================================================== --- stable/11/share/man/man4/owc.4 Tue Jul 16 15:36:05 2019 (r350035) +++ stable/11/share/man/man4/owc.4 Tue Jul 16 15:37:38 2019 (r350036) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 20, 2015 +.Dd June 26, 2019 .Dt OWC 4 .Os .Sh NAME @@ -69,6 +69,24 @@ For more details about the .Va gpios property, please consult .Pa /usr/src/sys/boot/fdt/dts/bindings-gpio.txt . +.Pp +On a +.Xr device.hints 5 +based system these values are required for the +.Nm : +.Bl -tag -width ".Va hint.owc.%d.atXXX" +.It Va hint.owc.%d.at +The +.Nm gpiobus +you are attaching to. +.It Va hint.owc.%d.pins +This is a bitmask that defines a pin on the +.Nm gpiobus +that is to be used for the 1-Wire bus. +For instance, to configure pin 10, use the bitmask of 0x400. +Please note that this mask should have only one bit set +(any other bits - i.e., pins - will be ignored). +.El .Sh SEE ALSO .Xr gpiobus 4 , .Xr ow 4 , From owner-svn-src-all@freebsd.org Tue Jul 16 15:38:02 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 38C23B2818; Tue, 16 Jul 2019 15:38:02 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1B70E8A7CB; Tue, 16 Jul 2019 15:38:02 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DF9E07FD5; Tue, 16 Jul 2019 15:38:01 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6GFc1Ld001290; Tue, 16 Jul 2019 15:38:01 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6GFc1Up001289; Tue, 16 Jul 2019 15:38:01 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201907161538.x6GFc1Up001289@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 16 Jul 2019 15:38:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350037 - head/sys/arm64/include X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/arm64/include X-SVN-Commit-Revision: 350037 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1B70E8A7CB X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jul 2019 15:38:02 -0000 Author: markj Date: Tue Jul 16 15:38:01 2019 New Revision: 350037 URL: https://svnweb.freebsd.org/changeset/base/350037 Log: Fix the arm64 page table entry attribute mask. It did not include the DBM or contiguous bits. Reported by: andrew Reviewed by: andrew MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/include/pte.h Modified: head/sys/arm64/include/pte.h ============================================================================== --- head/sys/arm64/include/pte.h Tue Jul 16 15:37:38 2019 (r350036) +++ head/sys/arm64/include/pte.h Tue Jul 16 15:38:01 2019 (r350037) @@ -39,7 +39,7 @@ typedef uint64_t pt_entry_t; /* page table entry */ #endif /* Block and Page attributes */ -#define ATTR_MASK_H UINT64_C(0xfff0000000000000) +#define ATTR_MASK_H UINT64_C(0xfffc000000000000) #define ATTR_MASK_L UINT64_C(0x0000000000000fff) #define ATTR_MASK (ATTR_MASK_H | ATTR_MASK_L) /* Bits 58:55 are reserved for software */ From owner-svn-src-all@freebsd.org Tue Jul 16 15:41:09 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D53A8B2AB2; Tue, 16 Jul 2019 15:41:09 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B81F78AC61; Tue, 16 Jul 2019 15:41:09 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8F830811E; Tue, 16 Jul 2019 15:41:09 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6GFf9VG003895; Tue, 16 Jul 2019 15:41:09 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6GFf9Vq003894; Tue, 16 Jul 2019 15:41:09 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201907161541.x6GFf9Vq003894@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 16 Jul 2019 15:41:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350038 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 350038 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B81F78AC61 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jul 2019 15:41:09 -0000 Author: markj Date: Tue Jul 16 15:41:09 2019 New Revision: 350038 URL: https://svnweb.freebsd.org/changeset/base/350038 Log: Always use the software DBM bit for now. r350004 added most of the machinery needed to support hardware DBM management, but it did not intend to actually enable use of the hardware DBM bit. Reviewed by: andrew MFC with: r350004 Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Tue Jul 16 15:38:01 2019 (r350037) +++ head/sys/arm64/arm64/pmap.c Tue Jul 16 15:41:09 2019 (r350038) @@ -780,13 +780,17 @@ pmap_bootstrap(vm_offset_t l0pt, vm_offset_t l1pt, vm_ vm_offset_t va, freemempos; vm_offset_t dpcpu, msgbufpv; vm_paddr_t start_pa, pa, min_pa; - uint64_t kern_delta, reg; + uint64_t kern_delta; int i; +#ifdef notyet /* Determine whether the hardware implements DBM management. */ - reg = READ_SPECIALREG(ID_AA64MMFR1_EL1); + uint64_t reg = READ_SPECIALREG(ID_AA64MMFR1_EL1); ATTR_SW_DBM = ID_AA64MMFR1_HAFDBS(reg) == ID_AA64MMFR1_HAFDBS_AF_DBS ? ATTR_DBM : _ATTR_SW_DBM; +#else + ATTR_SW_DBM = _ATTR_SW_DBM; +#endif kern_delta = KERNBASE - kernstart; From owner-svn-src-all@freebsd.org Tue Jul 16 15:44:07 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D4849B2BA9; Tue, 16 Jul 2019 15:44:07 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B553F8B027; Tue, 16 Jul 2019 15:44:07 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8C7A98193; Tue, 16 Jul 2019 15:44:07 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6GFi7r2007721; Tue, 16 Jul 2019 15:44:07 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6GFi7Ch007720; Tue, 16 Jul 2019 15:44:07 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201907161544.x6GFi7Ch007720@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 16 Jul 2019 15:44:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350039 - stable/12/share/man/man4 X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/share/man/man4 X-SVN-Commit-Revision: 350039 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B553F8B027 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jul 2019 15:44:07 -0000 Author: avg Date: Tue Jul 16 15:44:07 2019 New Revision: 350039 URL: https://svnweb.freebsd.org/changeset/base/350039 Log: MFC r349408: gpio.4: document device hints common to all devices on gpiobus Modified: stable/12/share/man/man4/gpio.4 Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/gpio.4 ============================================================================== --- stable/12/share/man/man4/gpio.4 Tue Jul 16 15:41:09 2019 (r350038) +++ stable/12/share/man/man4/gpio.4 Tue Jul 16 15:44:07 2019 (r350039) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 5, 2013 +.Dd June 26, 2019 .Dt GPIO 4 .Os .Sh NAME @@ -103,12 +103,36 @@ passed to the kernel, being either statically compiled of ways where the boot loader (or Open Firmware enabled system) passes the DTS blob to the kernel at boot. .Pp +On a +.Xr device.hints 5 +based system these hints can be used to configure drivers for devices +attached to +.Nm +pins: +.Bl -tag -width ".Va hint.driver.unit.pins" +.It Va hint.driver.unit.at +The +.Nm gpiobus +where the device is attached. +For example, +.Qq gpiobus0 . +.Ar driver +and +.Ar unit +are the driver name and the unit number for the device driver. +.It Va hint.driver.unit.pins +This is a bitmask of the pins on the +.Nm gpiobus +that are connected to the device. +The pins will be allocated to the specified driver instance. +.El +.Pp The following .Xr device.hints 5 are only provided by the .Cd ar71xx_gpio driver: -.Bl -tag -width ".Va hint.gpioiic.%d.atXXX" +.Bl -tag -width ".Va hint.gpio.function_clear" .It Va hint.gpio.%d.pinmask This is a bitmask of pins on the GPIO board that we would like to expose for use to the host operating system. @@ -133,6 +157,7 @@ of some device in a system. .Xr gpioiic 4 , .Xr gpioled 4 , .Xr iicbus 4 , +.Xr device.hints 5 , .Xr gpioctl 8 .Sh HISTORY The From owner-svn-src-all@freebsd.org Tue Jul 16 15:44:54 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2123EB2CB2; Tue, 16 Jul 2019 15:44:54 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 033A38B2EC; Tue, 16 Jul 2019 15:44:54 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CD3DA8199; Tue, 16 Jul 2019 15:44:53 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6GFirL3007942; Tue, 16 Jul 2019 15:44:53 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6GFirFS007941; Tue, 16 Jul 2019 15:44:53 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201907161544.x6GFirFS007941@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 16 Jul 2019 15:44:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r350040 - stable/11/share/man/man4 X-SVN-Group: stable-11 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/11/share/man/man4 X-SVN-Commit-Revision: 350040 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 033A38B2EC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jul 2019 15:44:54 -0000 Author: avg Date: Tue Jul 16 15:44:53 2019 New Revision: 350040 URL: https://svnweb.freebsd.org/changeset/base/350040 Log: MFC r349408: gpio.4: document device hints common to all devices on gpiobus Modified: stable/11/share/man/man4/gpio.4 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/gpio.4 ============================================================================== --- stable/11/share/man/man4/gpio.4 Tue Jul 16 15:44:07 2019 (r350039) +++ stable/11/share/man/man4/gpio.4 Tue Jul 16 15:44:53 2019 (r350040) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 5, 2013 +.Dd June 26, 2019 .Dt GPIO 4 .Os .Sh NAME @@ -103,12 +103,36 @@ passed to the kernel, being either statically compiled of ways where the boot loader (or Open Firmware enabled system) passes the DTS blob to the kernel at boot. .Pp +On a +.Xr device.hints 5 +based system these hints can be used to configure drivers for devices +attached to +.Nm +pins: +.Bl -tag -width ".Va hint.driver.unit.pins" +.It Va hint.driver.unit.at +The +.Nm gpiobus +where the device is attached. +For example, +.Qq gpiobus0 . +.Ar driver +and +.Ar unit +are the driver name and the unit number for the device driver. +.It Va hint.driver.unit.pins +This is a bitmask of the pins on the +.Nm gpiobus +that are connected to the device. +The pins will be allocated to the specified driver instance. +.El +.Pp The following .Xr device.hints 5 are only provided by the .Cd ar71xx_gpio driver: -.Bl -tag -width ".Va hint.gpioiic.%d.atXXX" +.Bl -tag -width ".Va hint.gpio.function_clear" .It Va hint.gpio.%d.pinmask This is a bitmask of pins on the GPIO board that we would like to expose for use to the host operating system. @@ -133,6 +157,7 @@ of some device in a system. .Xr gpioiic 4 , .Xr gpioled 4 , .Xr iicbus 4 , +.Xr device.hints 5 , .Xr gpioctl 8 .Sh HISTORY The From owner-svn-src-all@freebsd.org Tue Jul 16 15:48:02 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D1C4AB2D73; Tue, 16 Jul 2019 15:48:02 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B4B4D8B496; Tue, 16 Jul 2019 15:48:02 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8D145819B; Tue, 16 Jul 2019 15:48:02 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6GFm2Ya008174; Tue, 16 Jul 2019 15:48:02 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6GFm2cw008173; Tue, 16 Jul 2019 15:48:02 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201907161548.x6GFm2cw008173@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 16 Jul 2019 15:48:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350041 - stable/12/sys/dev/ow X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/sys/dev/ow X-SVN-Commit-Revision: 350041 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B4B4D8B496 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jul 2019 15:48:02 -0000 Author: avg Date: Tue Jul 16 15:48:02 2019 New Revision: 350041 URL: https://svnweb.freebsd.org/changeset/base/350041 Log: MFC r349428,r349433: owc_gpiobus: clean / fix up the driver module things "fdt" is removed from the driver module name as the driver does not require FDT and can work very well on hints based systems. A module dependency is added for gpiobus. Without that owc cannot resolve symbols in gpiobus if both are loaded as kernel modules. Finally, a driver module module version is added. Modified: stable/12/sys/dev/ow/owc_gpiobus.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/ow/owc_gpiobus.c ============================================================================== --- stable/12/sys/dev/ow/owc_gpiobus.c Tue Jul 16 15:44:53 2019 (r350040) +++ stable/12/sys/dev/ow/owc_gpiobus.c Tue Jul 16 15:48:02 2019 (r350041) @@ -416,5 +416,7 @@ static driver_t owc_gpiobus_driver = { sizeof(struct owc_gpiobus_softc), }; -DRIVER_MODULE(owc_gpiobus_fdt, gpiobus, owc_gpiobus_driver, owc_gpiobus_devclass, 0, 0); -MODULE_DEPEND(owc_gpiobus_fdt, ow, 1, 1, 1); +DRIVER_MODULE(owc_gpiobus, gpiobus, owc_gpiobus_driver, owc_gpiobus_devclass, 0, 0); +MODULE_DEPEND(owc_gpiobus, ow, 1, 1, 1); +MODULE_DEPEND(owc_gpiobus, gpiobus, 1, 1, 1); +MODULE_VERSION(owc_gpiobus, 1); From owner-svn-src-all@freebsd.org Tue Jul 16 15:49:45 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 952C6B2E0F; Tue, 16 Jul 2019 15:49:45 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 75CD28B6C7; Tue, 16 Jul 2019 15:49:45 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AA61C819F; Tue, 16 Jul 2019 15:49:43 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6GFnhYE008434; Tue, 16 Jul 2019 15:49:43 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6GFnhec008433; Tue, 16 Jul 2019 15:49:43 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201907161549.x6GFnhec008433@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 16 Jul 2019 15:49:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r350042 - stable/11/sys/dev/ow X-SVN-Group: stable-11 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/11/sys/dev/ow X-SVN-Commit-Revision: 350042 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 75CD28B6C7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jul 2019 15:49:45 -0000 Author: avg Date: Tue Jul 16 15:49:43 2019 New Revision: 350042 URL: https://svnweb.freebsd.org/changeset/base/350042 Log: MFC r349428,r349433: owc_gpiobus: clean / fix up the driver module things "fdt" is removed from the driver module name as the driver does not require FDT and can work very well on hints based systems. A module dependency is added for gpiobus. Without that owc cannot resolve symbols in gpiobus if both are loaded as kernel modules. Finally, a driver module module version is added. Modified: stable/11/sys/dev/ow/owc_gpiobus.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/ow/owc_gpiobus.c ============================================================================== --- stable/11/sys/dev/ow/owc_gpiobus.c Tue Jul 16 15:48:02 2019 (r350041) +++ stable/11/sys/dev/ow/owc_gpiobus.c Tue Jul 16 15:49:43 2019 (r350042) @@ -416,5 +416,7 @@ static driver_t owc_gpiobus_driver = { sizeof(struct owc_gpiobus_softc), }; -DRIVER_MODULE(owc_gpiobus_fdt, gpiobus, owc_gpiobus_driver, owc_gpiobus_devclass, 0, 0); -MODULE_DEPEND(owc_gpiobus_fdt, ow, 1, 1, 1); +DRIVER_MODULE(owc_gpiobus, gpiobus, owc_gpiobus_driver, owc_gpiobus_devclass, 0, 0); +MODULE_DEPEND(owc_gpiobus, ow, 1, 1, 1); +MODULE_DEPEND(owc_gpiobus, gpiobus, 1, 1, 1); +MODULE_VERSION(owc_gpiobus, 1); From owner-svn-src-all@freebsd.org Tue Jul 16 15:51:10 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2BBD3B30EC; Tue, 16 Jul 2019 15:51:10 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0DE7C8BA00; Tue, 16 Jul 2019 15:51:10 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D83B682F4; Tue, 16 Jul 2019 15:51:09 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6GFp9hQ011647; Tue, 16 Jul 2019 15:51:09 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6GFp9T2011645; Tue, 16 Jul 2019 15:51:09 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201907161551.x6GFp9T2011645@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Tue, 16 Jul 2019 15:51:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350043 - in head: share/man/man5 sys/kern X-SVN-Group: head X-SVN-Commit-Author: vangyzen X-SVN-Commit-Paths: in head: share/man/man5 sys/kern X-SVN-Commit-Revision: 350043 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0DE7C8BA00 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.97)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jul 2019 15:51:10 -0000 Author: vangyzen Date: Tue Jul 16 15:51:09 2019 New Revision: 350043 URL: https://svnweb.freebsd.org/changeset/base/350043 Log: Adds signal number format to kern.corefile Add format capability to core file names to include signal that generated the core. This can help various validation workflows where all cores should not be considered equally (SIGQUIT is often intentional and not an error unlike SIGSEGV or SIGBUS) Submitted by: David Leimbach (leimy2k@gmail.com) Reviewed by: markj MFC after: 1 week Relnotes: sysctl kern.corefile can now include the signal number Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D20970 Modified: head/share/man/man5/core.5 head/sys/kern/kern_sig.c Modified: head/share/man/man5/core.5 ============================================================================== --- head/share/man/man5/core.5 Tue Jul 16 15:49:43 2019 (r350042) +++ head/share/man/man5/core.5 Tue Jul 16 15:51:09 2019 (r350043) @@ -82,6 +82,8 @@ generated by a particular process. process name. .It Em \&%P processes PID. +.It Em \&%S +signal during core. .It Em \&%U process UID. .El Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Tue Jul 16 15:49:43 2019 (r350042) +++ head/sys/kern/kern_sig.c Tue Jul 16 15:51:09 2019 (r350043) @@ -3433,7 +3433,7 @@ corefile_open_last(struct thread *td, char *name, int */ static int corefile_open(const char *comm, uid_t uid, pid_t pid, struct thread *td, - int compress, struct vnode **vpp, char **namep) + int compress, int signum, struct vnode **vpp, char **namep) { struct sbuf sb; struct nameidata nd; @@ -3482,6 +3482,9 @@ corefile_open(const char *comm, uid_t uid, pid_t pid, case 'P': /* process id */ sbuf_printf(&sb, "%u", pid); break; + case 'S': /* signal number */ + sbuf_printf(&sb, "%i", signum); + break; case 'U': /* user id */ sbuf_printf(&sb, "%u", uid); break; @@ -3599,7 +3602,7 @@ coredump(struct thread *td) PROC_UNLOCK(p); error = corefile_open(p->p_comm, cred->cr_uid, p->p_pid, td, - compress_user_cores, &vp, &name); + compress_user_cores, p->p_sig, &vp, &name); if (error != 0) return (error); From owner-svn-src-all@freebsd.org Tue Jul 16 15:52:48 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6683DB3349; Tue, 16 Jul 2019 15:52:48 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 493298BE68; Tue, 16 Jul 2019 15:52:48 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 182D1837B; Tue, 16 Jul 2019 15:52:48 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6GFqler013939; Tue, 16 Jul 2019 15:52:47 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6GFqlU5013936; Tue, 16 Jul 2019 15:52:47 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201907161552.x6GFqlU5013936@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 16 Jul 2019 15:52:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350044 - in stable/12: share/man/man4 sys/dev/gpio X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in stable/12: share/man/man4 sys/dev/gpio X-SVN-Commit-Revision: 350044 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 493298BE68 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jul 2019 15:52:48 -0000 Author: avg Date: Tue Jul 16 15:52:47 2019 New Revision: 350044 URL: https://svnweb.freebsd.org/changeset/base/350044 Log: MFC r349460: gpiobus: provide a new hint, pin_list "pin_list" allows to specify child pins as a list of pin numbers. Existing hint "pins" serves the same purpose but with a 32-bit wide bit mask. One problem with that is that a controller can have more than 32 pins. One example is amdgpio. Also, a list of numbers is a little bit more human friendly than a matching bit mask. As a side note, it seems that in FDT pins are typically specified by their numbers as well. This commit also adds accessors for instance variables (IVARs) that define the child pins. My primary goal is to allow a child to be configured programmatically rather than via hints (assuming that FDT is not supported on a platform). Also, while a child should not care about specific pin numbers that are allocated to it, it could be interested in how many were actually assigned to it. While there, I removed "flags" instance variable. It was unused. Modified: stable/12/share/man/man4/gpio.4 stable/12/sys/dev/gpio/gpiobus.c stable/12/sys/dev/gpio/gpiobusvar.h Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/gpio.4 ============================================================================== --- stable/12/share/man/man4/gpio.4 Tue Jul 16 15:51:09 2019 (r350043) +++ stable/12/share/man/man4/gpio.4 Tue Jul 16 15:52:47 2019 (r350044) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 26, 2019 +.Dd June 27, 2019 .Dt GPIO 4 .Os .Sh NAME @@ -109,7 +109,7 @@ based system these hints can be used to configure driv attached to .Nm pins: -.Bl -tag -width ".Va hint.driver.unit.pins" +.Bl -tag -width ".Va hint.driver.unit.pin_list" .It Va hint.driver.unit.at The .Nm gpiobus @@ -125,6 +125,20 @@ This is a bitmask of the pins on the .Nm gpiobus that are connected to the device. The pins will be allocated to the specified driver instance. +Only pins with numbers from 0 to 31 can be specified using this hint. +.It Va hint.driver.unit.pin_list +This is a list of pin numbers of pins on the +.Nm gpiobus +that are connected to the device. +The pins will be allocated to the specified driver instance. +This is a more user friendly alternative to the +.Ar pins +hint. +Additionally, this hint allows specifying pin numbers greater than 31. +The numbers can be decimal or hexadecimal with 0x prefix. +Any non-digit character can be used as a separator. +For example, it can be a comma, a slash or a space. +The separator can be followed by any number of space characters. .El .Pp The following Modified: stable/12/sys/dev/gpio/gpiobus.c ============================================================================== --- stable/12/sys/dev/gpio/gpiobus.c Tue Jul 16 15:51:09 2019 (r350043) +++ stable/12/sys/dev/gpio/gpiobus.c Tue Jul 16 15:52:47 2019 (r350044) @@ -255,13 +255,6 @@ gpiobus_alloc_ivars(struct gpiobus_ivar *devi) M_NOWAIT | M_ZERO); if (devi->pins == NULL) return (ENOMEM); - devi->flags = malloc(sizeof(uint32_t) * devi->npins, M_DEVBUF, - M_NOWAIT | M_ZERO); - if (devi->flags == NULL) { - free(devi->pins, M_DEVBUF); - return (ENOMEM); - } - return (0); } @@ -269,14 +262,11 @@ void gpiobus_free_ivars(struct gpiobus_ivar *devi) { - if (devi->flags) { - free(devi->flags, M_DEVBUF); - devi->flags = NULL; - } if (devi->pins) { free(devi->pins, M_DEVBUF); devi->pins = NULL; } + devi->npins = 0; } int @@ -326,6 +316,34 @@ gpiobus_release_pin(device_t bus, uint32_t pin) } static int +gpiobus_acquire_child_pins(device_t dev, device_t child) +{ + struct gpiobus_ivar *devi = GPIOBUS_IVAR(child); + int i; + + for (i = 0; i < devi->npins; i++) { + /* Reserve the GPIO pin. */ + if (gpiobus_acquire_pin(dev, devi->pins[i]) != 0) { + device_printf(child, "cannot acquire pin %d\n", + devi->pins[i]); + while (--i >= 0) { + (void)gpiobus_release_pin(dev, + devi->pins[i]); + } + gpiobus_free_ivars(devi); + return (EBUSY); + } + } + for (i = 0; i < devi->npins; i++) { + /* Use the child name as pin name. */ + GPIOBUS_PIN_SETNAME(dev, devi->pins[i], + device_get_nameunit(child)); + + } + return (0); +} + +static int gpiobus_parse_pins(struct gpiobus_softc *sc, device_t child, int mask) { struct gpiobus_ivar *devi = GPIOBUS_IVAR(child); @@ -349,21 +367,70 @@ gpiobus_parse_pins(struct gpiobus_softc *sc, device_t for (i = 0; i < 32; i++) { if ((mask & (1 << i)) == 0) continue; - /* Reserve the GPIO pin. */ - if (gpiobus_acquire_pin(sc->sc_busdev, i) != 0) { - gpiobus_free_ivars(devi); - return (EINVAL); - } devi->pins[npins++] = i; - /* Use the child name as pin name. */ - GPIOBUS_PIN_SETNAME(sc->sc_busdev, i, - device_get_nameunit(child)); } + if (gpiobus_acquire_child_pins(sc->sc_busdev, child) != 0) + return (EINVAL); return (0); } static int +gpiobus_parse_pin_list(struct gpiobus_softc *sc, device_t child, + const char *pins) +{ + struct gpiobus_ivar *devi = GPIOBUS_IVAR(child); + const char *p; + char *endp; + unsigned long pin; + int i, npins; + + npins = 0; + p = pins; + for (;;) { + pin = strtoul(p, &endp, 0); + if (endp == p) + break; + npins++; + if (*endp == '\0') + break; + p = endp + 1; + } + + if (*endp != '\0') { + device_printf(child, "garbage in the pin list: %s\n", endp); + return (EINVAL); + } + if (npins == 0) { + device_printf(child, "empty pin list\n"); + return (EINVAL); + } + + devi->npins = npins; + if (gpiobus_alloc_ivars(devi) != 0) { + device_printf(child, "cannot allocate device ivars\n"); + return (EINVAL); + } + + i = 0; + p = pins; + for (;;) { + pin = strtoul(p, &endp, 0); + + devi->pins[i] = pin; + + if (*endp == '\0') + break; + i++; + p = endp + 1; + } + + if (gpiobus_acquire_child_pins(sc->sc_busdev, child) != 0) + return (EINVAL); + return (0); +} + +static int gpiobus_probe(device_t dev) { device_set_desc(dev, "GPIO bus"); @@ -539,16 +606,27 @@ gpiobus_hinted_child(device_t bus, const char *dname, struct gpiobus_softc *sc = GPIOBUS_SOFTC(bus); struct gpiobus_ivar *devi; device_t child; - int irq, pins; + const char *pins; + int irq, pinmask; child = BUS_ADD_CHILD(bus, 0, dname, dunit); devi = GPIOBUS_IVAR(child); - resource_int_value(dname, dunit, "pins", &pins); - if (gpiobus_parse_pins(sc, child, pins)) { - resource_list_free(&devi->rl); - free(devi, M_DEVBUF); - device_delete_child(bus, child); + if (resource_int_value(dname, dunit, "pins", &pinmask) == 0) { + if (gpiobus_parse_pins(sc, child, pinmask)) { + resource_list_free(&devi->rl); + free(devi, M_DEVBUF); + device_delete_child(bus, child); + return; + } } + else if (resource_string_value(dname, dunit, "pin_list", &pins) == 0) { + if (gpiobus_parse_pin_list(sc, child, pins)) { + resource_list_free(&devi->rl); + free(devi, M_DEVBUF); + device_delete_child(bus, child); + return; + } + } if (resource_int_value(dname, dunit, "irq", &irq) == 0) { if (bus_set_resource(child, SYS_RES_IRQ, 0, irq, 1) != 0) device_printf(bus, @@ -574,6 +652,61 @@ gpiobus_set_resource(device_t dev, device_t child, int return (0); } +static int +gpiobus_read_ivar(device_t dev, device_t child, int which, uintptr_t *result) +{ + struct gpiobus_ivar *devi; + + devi = GPIOBUS_IVAR(child); + switch (which) { + case GPIOBUS_IVAR_NPINS: + *result = devi->npins; + break; + case GPIOBUS_IVAR_PINS: + /* Children do not ever need to directly examine this. */ + return (ENOTSUP); + default: + return (ENOENT); + } + + return (0); +} + +static int +gpiobus_write_ivar(device_t dev, device_t child, int which, uintptr_t value) +{ + struct gpiobus_ivar *devi; + const uint32_t *ptr; + int i; + + devi = GPIOBUS_IVAR(child); + switch (which) { + case GPIOBUS_IVAR_NPINS: + /* GPIO ivars are set once. */ + if (devi->npins != 0) { + return (EBUSY); + } + devi->npins = value; + if (gpiobus_alloc_ivars(devi) != 0) { + device_printf(child, "cannot allocate device ivars\n"); + devi->npins = 0; + return (ENOMEM); + } + break; + case GPIOBUS_IVAR_PINS: + ptr = (const uint32_t *)value; + for (i = 0; i < devi->npins; i++) + devi->pins[i] = ptr[i]; + if (gpiobus_acquire_child_pins(dev, child) != 0) + return (EBUSY); + break; + default: + return (ENOENT); + } + + return (0); +} + static struct resource * gpiobus_alloc_resource(device_t bus, device_t child, int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) @@ -833,6 +966,8 @@ static device_method_t gpiobus_methods[] = { DEVMETHOD(bus_child_pnpinfo_str, gpiobus_child_pnpinfo_str), DEVMETHOD(bus_child_location_str, gpiobus_child_location_str), DEVMETHOD(bus_hinted_child, gpiobus_hinted_child), + DEVMETHOD(bus_read_ivar, gpiobus_read_ivar), + DEVMETHOD(bus_write_ivar, gpiobus_write_ivar), /* GPIO protocol */ DEVMETHOD(gpiobus_acquire_bus, gpiobus_acquire_bus), Modified: stable/12/sys/dev/gpio/gpiobusvar.h ============================================================================== --- stable/12/sys/dev/gpio/gpiobusvar.h Tue Jul 16 15:51:09 2019 (r350043) +++ stable/12/sys/dev/gpio/gpiobusvar.h Tue Jul 16 15:52:47 2019 (r350044) @@ -107,9 +107,21 @@ struct gpiobus_ivar { struct resource_list rl; /* isr resource list */ uint32_t npins; /* pins total */ - uint32_t *flags; /* pins flags */ uint32_t *pins; /* pins map */ }; + +enum gpiobus_ivars { + GPIOBUS_IVAR_NPINS = 10500, + GPIOBUS_IVAR_PINS, +}; + +#define GPIOBUS_ACCESSOR(var, ivar, type) \ + __BUS_ACCESSOR(gpiobus, var, GPIOBUS, ivar, type) + +GPIOBUS_ACCESSOR(npins, NPINS, uint32_t) +GPIOBUS_ACCESSOR(pins, PINS, const uint32_t *) + +#undef GPIOBUS_ACCESSOR #ifdef FDT struct ofw_gpiobus_devinfo { From owner-svn-src-all@freebsd.org Tue Jul 16 15:58:20 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 816C0B3468; Tue, 16 Jul 2019 15:58:20 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 61BB58C1C0; Tue, 16 Jul 2019 15:58:20 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 505ED838C; Tue, 16 Jul 2019 15:58:20 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6GFwKFb014419; Tue, 16 Jul 2019 15:58:20 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6GFwJLN014417; Tue, 16 Jul 2019 15:58:19 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201907161558.x6GFwJLN014417@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 16 Jul 2019 15:58:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r350045 - in stable/11: share/man/man4 sys/dev/gpio X-SVN-Group: stable-11 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in stable/11: share/man/man4 sys/dev/gpio X-SVN-Commit-Revision: 350045 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 61BB58C1C0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jul 2019 15:58:20 -0000 Author: avg Date: Tue Jul 16 15:58:19 2019 New Revision: 350045 URL: https://svnweb.freebsd.org/changeset/base/350045 Log: MFC r349460: gpiobus: provide a new hint, pin_list "pin_list" allows to specify child pins as a list of pin numbers. Existing hint "pins" serves the same purpose but with a 32-bit wide bit mask. One problem with that is that a controller can have more than 32 pins. One example is amdgpio. Also, a list of numbers is a little bit more human friendly than a matching bit mask. As a side note, it seems that in FDT pins are typically specified by their numbers as well. This commit also adds accessors for instance variables (IVARs) that define the child pins. My primary goal is to allow a child to be configured programmatically rather than via hints (assuming that FDT is not supported on a platform). Also, while a child should not care about specific pin numbers that are allocated to it, it could be interested in how many were actually assigned to it. While there, I removed "flags" instance variable. It was unused. Modified: stable/11/share/man/man4/gpio.4 stable/11/sys/dev/gpio/gpiobus.c stable/11/sys/dev/gpio/gpiobusvar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/gpio.4 ============================================================================== --- stable/11/share/man/man4/gpio.4 Tue Jul 16 15:52:47 2019 (r350044) +++ stable/11/share/man/man4/gpio.4 Tue Jul 16 15:58:19 2019 (r350045) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 26, 2019 +.Dd June 27, 2019 .Dt GPIO 4 .Os .Sh NAME @@ -109,7 +109,7 @@ based system these hints can be used to configure driv attached to .Nm pins: -.Bl -tag -width ".Va hint.driver.unit.pins" +.Bl -tag -width ".Va hint.driver.unit.pin_list" .It Va hint.driver.unit.at The .Nm gpiobus @@ -125,6 +125,20 @@ This is a bitmask of the pins on the .Nm gpiobus that are connected to the device. The pins will be allocated to the specified driver instance. +Only pins with numbers from 0 to 31 can be specified using this hint. +.It Va hint.driver.unit.pin_list +This is a list of pin numbers of pins on the +.Nm gpiobus +that are connected to the device. +The pins will be allocated to the specified driver instance. +This is a more user friendly alternative to the +.Ar pins +hint. +Additionally, this hint allows specifying pin numbers greater than 31. +The numbers can be decimal or hexadecimal with 0x prefix. +Any non-digit character can be used as a separator. +For example, it can be a comma, a slash or a space. +The separator can be followed by any number of space characters. .El .Pp The following Modified: stable/11/sys/dev/gpio/gpiobus.c ============================================================================== --- stable/11/sys/dev/gpio/gpiobus.c Tue Jul 16 15:52:47 2019 (r350044) +++ stable/11/sys/dev/gpio/gpiobus.c Tue Jul 16 15:58:19 2019 (r350045) @@ -253,13 +253,6 @@ gpiobus_alloc_ivars(struct gpiobus_ivar *devi) M_NOWAIT | M_ZERO); if (devi->pins == NULL) return (ENOMEM); - devi->flags = malloc(sizeof(uint32_t) * devi->npins, M_DEVBUF, - M_NOWAIT | M_ZERO); - if (devi->flags == NULL) { - free(devi->pins, M_DEVBUF); - return (ENOMEM); - } - return (0); } @@ -267,14 +260,11 @@ void gpiobus_free_ivars(struct gpiobus_ivar *devi) { - if (devi->flags) { - free(devi->flags, M_DEVBUF); - devi->flags = NULL; - } if (devi->pins) { free(devi->pins, M_DEVBUF); devi->pins = NULL; } + devi->npins = 0; } int @@ -324,6 +314,34 @@ gpiobus_release_pin(device_t bus, uint32_t pin) } static int +gpiobus_acquire_child_pins(device_t dev, device_t child) +{ + struct gpiobus_ivar *devi = GPIOBUS_IVAR(child); + int i; + + for (i = 0; i < devi->npins; i++) { + /* Reserve the GPIO pin. */ + if (gpiobus_acquire_pin(dev, devi->pins[i]) != 0) { + device_printf(child, "cannot acquire pin %d\n", + devi->pins[i]); + while (--i >= 0) { + (void)gpiobus_release_pin(dev, + devi->pins[i]); + } + gpiobus_free_ivars(devi); + return (EBUSY); + } + } + for (i = 0; i < devi->npins; i++) { + /* Use the child name as pin name. */ + GPIOBUS_PIN_SETNAME(dev, devi->pins[i], + device_get_nameunit(child)); + + } + return (0); +} + +static int gpiobus_parse_pins(struct gpiobus_softc *sc, device_t child, int mask) { struct gpiobus_ivar *devi = GPIOBUS_IVAR(child); @@ -347,21 +365,70 @@ gpiobus_parse_pins(struct gpiobus_softc *sc, device_t for (i = 0; i < 32; i++) { if ((mask & (1 << i)) == 0) continue; - /* Reserve the GPIO pin. */ - if (gpiobus_acquire_pin(sc->sc_busdev, i) != 0) { - gpiobus_free_ivars(devi); - return (EINVAL); - } devi->pins[npins++] = i; - /* Use the child name as pin name. */ - GPIOBUS_PIN_SETNAME(sc->sc_busdev, i, - device_get_nameunit(child)); } + if (gpiobus_acquire_child_pins(sc->sc_busdev, child) != 0) + return (EINVAL); return (0); } static int +gpiobus_parse_pin_list(struct gpiobus_softc *sc, device_t child, + const char *pins) +{ + struct gpiobus_ivar *devi = GPIOBUS_IVAR(child); + const char *p; + char *endp; + unsigned long pin; + int i, npins; + + npins = 0; + p = pins; + for (;;) { + pin = strtoul(p, &endp, 0); + if (endp == p) + break; + npins++; + if (*endp == '\0') + break; + p = endp + 1; + } + + if (*endp != '\0') { + device_printf(child, "garbage in the pin list: %s\n", endp); + return (EINVAL); + } + if (npins == 0) { + device_printf(child, "empty pin list\n"); + return (EINVAL); + } + + devi->npins = npins; + if (gpiobus_alloc_ivars(devi) != 0) { + device_printf(child, "cannot allocate device ivars\n"); + return (EINVAL); + } + + i = 0; + p = pins; + for (;;) { + pin = strtoul(p, &endp, 0); + + devi->pins[i] = pin; + + if (*endp == '\0') + break; + i++; + p = endp + 1; + } + + if (gpiobus_acquire_child_pins(sc->sc_busdev, child) != 0) + return (EINVAL); + return (0); +} + +static int gpiobus_probe(device_t dev) { device_set_desc(dev, "GPIO bus"); @@ -537,16 +604,27 @@ gpiobus_hinted_child(device_t bus, const char *dname, struct gpiobus_softc *sc = GPIOBUS_SOFTC(bus); struct gpiobus_ivar *devi; device_t child; - int irq, pins; + const char *pins; + int irq, pinmask; child = BUS_ADD_CHILD(bus, 0, dname, dunit); devi = GPIOBUS_IVAR(child); - resource_int_value(dname, dunit, "pins", &pins); - if (gpiobus_parse_pins(sc, child, pins)) { - resource_list_free(&devi->rl); - free(devi, M_DEVBUF); - device_delete_child(bus, child); + if (resource_int_value(dname, dunit, "pins", &pinmask) == 0) { + if (gpiobus_parse_pins(sc, child, pinmask)) { + resource_list_free(&devi->rl); + free(devi, M_DEVBUF); + device_delete_child(bus, child); + return; + } } + else if (resource_string_value(dname, dunit, "pin_list", &pins) == 0) { + if (gpiobus_parse_pin_list(sc, child, pins)) { + resource_list_free(&devi->rl); + free(devi, M_DEVBUF); + device_delete_child(bus, child); + return; + } + } if (resource_int_value(dname, dunit, "irq", &irq) == 0) { if (bus_set_resource(child, SYS_RES_IRQ, 0, irq, 1) != 0) device_printf(bus, @@ -572,6 +650,61 @@ gpiobus_set_resource(device_t dev, device_t child, int return (0); } +static int +gpiobus_read_ivar(device_t dev, device_t child, int which, uintptr_t *result) +{ + struct gpiobus_ivar *devi; + + devi = GPIOBUS_IVAR(child); + switch (which) { + case GPIOBUS_IVAR_NPINS: + *result = devi->npins; + break; + case GPIOBUS_IVAR_PINS: + /* Children do not ever need to directly examine this. */ + return (ENOTSUP); + default: + return (ENOENT); + } + + return (0); +} + +static int +gpiobus_write_ivar(device_t dev, device_t child, int which, uintptr_t value) +{ + struct gpiobus_ivar *devi; + const uint32_t *ptr; + int i; + + devi = GPIOBUS_IVAR(child); + switch (which) { + case GPIOBUS_IVAR_NPINS: + /* GPIO ivars are set once. */ + if (devi->npins != 0) { + return (EBUSY); + } + devi->npins = value; + if (gpiobus_alloc_ivars(devi) != 0) { + device_printf(child, "cannot allocate device ivars\n"); + devi->npins = 0; + return (ENOMEM); + } + break; + case GPIOBUS_IVAR_PINS: + ptr = (const uint32_t *)value; + for (i = 0; i < devi->npins; i++) + devi->pins[i] = ptr[i]; + if (gpiobus_acquire_child_pins(dev, child) != 0) + return (EBUSY); + break; + default: + return (ENOENT); + } + + return (0); +} + static struct resource * gpiobus_alloc_resource(device_t bus, device_t child, int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) @@ -831,6 +964,8 @@ static device_method_t gpiobus_methods[] = { DEVMETHOD(bus_child_pnpinfo_str, gpiobus_child_pnpinfo_str), DEVMETHOD(bus_child_location_str, gpiobus_child_location_str), DEVMETHOD(bus_hinted_child, gpiobus_hinted_child), + DEVMETHOD(bus_read_ivar, gpiobus_read_ivar), + DEVMETHOD(bus_write_ivar, gpiobus_write_ivar), /* GPIO protocol */ DEVMETHOD(gpiobus_acquire_bus, gpiobus_acquire_bus), Modified: stable/11/sys/dev/gpio/gpiobusvar.h ============================================================================== --- stable/11/sys/dev/gpio/gpiobusvar.h Tue Jul 16 15:52:47 2019 (r350044) +++ stable/11/sys/dev/gpio/gpiobusvar.h Tue Jul 16 15:58:19 2019 (r350045) @@ -102,9 +102,21 @@ struct gpiobus_ivar { struct resource_list rl; /* isr resource list */ uint32_t npins; /* pins total */ - uint32_t *flags; /* pins flags */ uint32_t *pins; /* pins map */ }; + +enum gpiobus_ivars { + GPIOBUS_IVAR_NPINS = 10500, + GPIOBUS_IVAR_PINS, +}; + +#define GPIOBUS_ACCESSOR(var, ivar, type) \ + __BUS_ACCESSOR(gpiobus, var, GPIOBUS, ivar, type) + +GPIOBUS_ACCESSOR(npins, NPINS, uint32_t) +GPIOBUS_ACCESSOR(pins, PINS, const uint32_t *) + +#undef GPIOBUS_ACCESSOR #ifdef FDT struct ofw_gpiobus_devinfo { From owner-svn-src-all@freebsd.org Tue Jul 16 16:01:52 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3D27EB3634; Tue, 16 Jul 2019 16:01:52 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1EAD08C65B; Tue, 16 Jul 2019 16:01:52 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EEF4C8511; Tue, 16 Jul 2019 16:01:51 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6GG1pgT016871; Tue, 16 Jul 2019 16:01:51 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6GG1peA016870; Tue, 16 Jul 2019 16:01:51 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201907161601.x6GG1peA016870@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 16 Jul 2019 16:01:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350046 - stable/12/sys/dev/nctgpio X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/sys/dev/nctgpio X-SVN-Commit-Revision: 350046 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1EAD08C65B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jul 2019 16:01:52 -0000 Author: avg Date: Tue Jul 16 16:01:51 2019 New Revision: 350046 URL: https://svnweb.freebsd.org/changeset/base/350046 Log: MFC r349579: nctgpio: change default pin names to those used by the datasheet(s) That is, instead of the current GPIO00 - GPIO15 the names will be GPIO00 - GPIO07, GPIO10 - GPIO17. The first digit is a GPIO "bank" / group number and the second one is a pin number within the bank. Alternative view is that the pin names are changed from decimal numbering scheme to octal one (as there are 8 pins per bank). Modified: stable/12/sys/dev/nctgpio/nctgpio.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/nctgpio/nctgpio.c ============================================================================== --- stable/12/sys/dev/nctgpio/nctgpio.c Tue Jul 16 15:58:19 2019 (r350045) +++ stable/12/sys/dev/nctgpio/nctgpio.c Tue Jul 16 16:01:51 2019 (r350046) @@ -529,7 +529,7 @@ nct_attach(device_t dev) pin->gp_caps = NCT_GPIO_CAPS; pin->gp_flags = 0; - snprintf(pin->gp_name, GPIOMAXNAME, "GPIO%02u", i); + snprintf(pin->gp_name, GPIOMAXNAME, "GPIO%02o", i); pin->gp_name[GPIOMAXNAME - 1] = '\0'; if (nct_pin_is_input(sc, i)) From owner-svn-src-all@freebsd.org Tue Jul 16 16:02:05 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ACD13B366C; Tue, 16 Jul 2019 16:02:05 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8DE068C79A; Tue, 16 Jul 2019 16:02:05 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A8E118522; Tue, 16 Jul 2019 16:02:03 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6GG23ln017549; Tue, 16 Jul 2019 16:02:03 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6GG23QI017534; Tue, 16 Jul 2019 16:02:03 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201907161602.x6GG23QI017534@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 16 Jul 2019 16:02:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r350047 - stable/11/sys/dev/nctgpio X-SVN-Group: stable-11 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/11/sys/dev/nctgpio X-SVN-Commit-Revision: 350047 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8DE068C79A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jul 2019 16:02:05 -0000 Author: avg Date: Tue Jul 16 16:02:03 2019 New Revision: 350047 URL: https://svnweb.freebsd.org/changeset/base/350047 Log: MFC r349579: nctgpio: change default pin names to those used by the datasheet(s) That is, instead of the current GPIO00 - GPIO15 the names will be GPIO00 - GPIO07, GPIO10 - GPIO17. The first digit is a GPIO "bank" / group number and the second one is a pin number within the bank. Alternative view is that the pin names are changed from decimal numbering scheme to octal one (as there are 8 pins per bank). Modified: stable/11/sys/dev/nctgpio/nctgpio.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/nctgpio/nctgpio.c ============================================================================== --- stable/11/sys/dev/nctgpio/nctgpio.c Tue Jul 16 16:01:51 2019 (r350046) +++ stable/11/sys/dev/nctgpio/nctgpio.c Tue Jul 16 16:02:03 2019 (r350047) @@ -529,7 +529,7 @@ nct_attach(device_t dev) pin->gp_caps = NCT_GPIO_CAPS; pin->gp_flags = 0; - snprintf(pin->gp_name, GPIOMAXNAME, "GPIO%02u", i); + snprintf(pin->gp_name, GPIOMAXNAME, "GPIO%02o", i); pin->gp_name[GPIOMAXNAME - 1] = '\0'; if (nct_pin_is_input(sc, i)) From owner-svn-src-all@freebsd.org Tue Jul 16 16:02:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DBB24B3807; Tue, 16 Jul 2019 16:02:21 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BDD2E8C929; Tue, 16 Jul 2019 16:02:21 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2B4B88541; Tue, 16 Jul 2019 16:02:21 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6GG2LBp020149; Tue, 16 Jul 2019 16:02:21 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6GG2LMP020148; Tue, 16 Jul 2019 16:02:21 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201907161602.x6GG2LMP020148@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 16 Jul 2019 16:02:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350048 - head/lib/libkvm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/lib/libkvm X-SVN-Commit-Revision: 350048 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BDD2E8C929 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.97)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jul 2019 16:02:21 -0000 Author: markj Date: Tue Jul 16 16:02:20 2019 New Revision: 350048 URL: https://svnweb.freebsd.org/changeset/base/350048 Log: Chase r350037. Reported by: jenkins MFC with: r350037 Sponsored by: The FreeBSD Foundation Modified: head/lib/libkvm/kvm_aarch64.h Modified: head/lib/libkvm/kvm_aarch64.h ============================================================================== --- head/lib/libkvm/kvm_aarch64.h Tue Jul 16 16:02:03 2019 (r350047) +++ head/lib/libkvm/kvm_aarch64.h Tue Jul 16 16:02:20 2019 (r350048) @@ -40,7 +40,7 @@ typedef uint64_t aarch64_pte_t; #define AARCH64_PAGE_MASK (AARCH64_PAGE_SIZE - 1) /* Source: arm64/include/pte.h */ -#define AARCH64_ATTR_MASK 0xfff0000000000fff +#define AARCH64_ATTR_MASK 0xfffc000000000fff #define AARCH64_ATTR_UXN (1ULL << 54) #define AARCH64_ATTR_PXN (1ULL << 53) #define AARCH64_ATTR_XN (AARCH64_ATTR_PXN | AARCH64_ATTR_UXN) From owner-svn-src-all@freebsd.org Tue Jul 16 16:03:09 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 65AE8B38AD; Tue, 16 Jul 2019 16:03:09 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 488278CACB; Tue, 16 Jul 2019 16:03:09 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 30E038552; Tue, 16 Jul 2019 16:03:09 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6GG39gU020230; Tue, 16 Jul 2019 16:03:09 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6GG38oZ020228; Tue, 16 Jul 2019 16:03:08 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201907161603.x6GG38oZ020228@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Tue, 16 Jul 2019 16:03:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350049 - head/contrib/amd/amd X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/contrib/amd/amd X-SVN-Commit-Revision: 350049 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 488278CACB X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.97)[-0.965,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jul 2019 16:03:09 -0000 Author: brooks Date: Tue Jul 16 16:03:08 2019 New Revision: 350049 URL: https://svnweb.freebsd.org/changeset/base/350049 Log: Fix two mismatches between function declaration and definition. In both cases, function pointer arguments were inconsistently declared and the result worked because of C's odd rules around function pointer (de)references. With a stricter compiler these fail to compile. Reviewed by: cem Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D20964 Modified: head/contrib/amd/amd/amd.h head/contrib/amd/amd/rpc_fwd.c Modified: head/contrib/amd/amd/amd.h ============================================================================== --- head/contrib/amd/amd/amd.h Tue Jul 16 16:02:20 2019 (r350048) +++ head/contrib/amd/amd/amd.h Tue Jul 16 16:03:08 2019 (r350049) @@ -625,7 +625,7 @@ extern void map_flush_srvr(fserver *); extern void mapc_add_kv(mnt_map *, char *, char *); extern mnt_map *mapc_find(char *, char *, const char *, const char *); extern void mapc_free(opaque_t); -extern int mapc_keyiter(mnt_map *, key_fun, opaque_t); +extern int mapc_keyiter(mnt_map *, key_fun *, opaque_t); extern void mapc_reload(void); extern int mapc_search(mnt_map *, char *, char **); extern void mapc_showtypes(char *buf, size_t l); Modified: head/contrib/amd/amd/rpc_fwd.c ============================================================================== --- head/contrib/amd/amd/rpc_fwd.c Tue Jul 16 16:02:20 2019 (r350048) +++ head/contrib/amd/amd/rpc_fwd.c Tue Jul 16 16:03:08 2019 (r350049) @@ -221,7 +221,7 @@ fwd_locate(u_int id) * different address. */ int -fwd_packet(int type_id, char *pkt, int len, struct sockaddr_in *fwdto, struct sockaddr_in *replyto, opaque_t cb_arg, fwd_fun cb) +fwd_packet(int type_id, char *pkt, int len, struct sockaddr_in *fwdto, struct sockaddr_in *replyto, opaque_t cb_arg, fwd_fun *cb) { rpc_forward *p; u_int *pkt_int; From owner-svn-src-all@freebsd.org Tue Jul 16 16:05:42 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B445CB3963; Tue, 16 Jul 2019 16:05:42 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 969CD8CCBA; Tue, 16 Jul 2019 16:05:42 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6FCFC855A; Tue, 16 Jul 2019 16:05:42 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6GG5geH020406; Tue, 16 Jul 2019 16:05:42 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6GG5gbD020405; Tue, 16 Jul 2019 16:05:42 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201907161605.x6GG5gbD020405@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Tue, 16 Jul 2019 16:05:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350050 - stable/12/sys/dev/vt X-SVN-Group: stable-12 X-SVN-Commit-Author: vangyzen X-SVN-Commit-Paths: stable/12/sys/dev/vt X-SVN-Commit-Revision: 350050 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 969CD8CCBA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jul 2019 16:05:42 -0000 Author: vangyzen Date: Tue Jul 16 16:05:42 2019 New Revision: 350050 URL: https://svnweb.freebsd.org/changeset/base/350050 Log: MFC r349834 Ignore kern.vt.splash_cpu without graphics When the system has no graphical console, such as bhyve in common configurations, ignore kern.vt.splash_cpu, instead of panicking on INVARIANTS kernels. Reviewed by: cem dumbbell Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D20877 Modified: stable/12/sys/dev/vt/vt_cpulogos.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/vt/vt_cpulogos.c ============================================================================== --- stable/12/sys/dev/vt/vt_cpulogos.c Tue Jul 16 16:03:08 2019 (r350049) +++ stable/12/sys/dev/vt/vt_cpulogos.c Tue Jul 16 16:05:42 2019 (r350050) @@ -227,9 +227,8 @@ vt_init_logos(void *dummy) return; VT_LOCK(vd); - KASSERT((vd->vd_flags & VDF_INITIALIZED) != 0, - ("vd %p not initialized", vd)); - + if ((vd->vd_flags & VDF_INITIALIZED) == 0) + goto out; if ((vd->vd_flags & (VDF_DEAD | VDF_TEXTMODE)) != 0) goto out; if (vd->vd_height <= vt_logo_sprite_height) From owner-svn-src-all@freebsd.org Tue Jul 16 16:23:57 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 57D51B405C; Tue, 16 Jul 2019 16:23:57 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3141A8DF03; Tue, 16 Jul 2019 16:23:57 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1A5E08907; Tue, 16 Jul 2019 16:23:57 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6GGNupY033419; Tue, 16 Jul 2019 16:23:56 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6GGNuI9033418; Tue, 16 Jul 2019 16:23:56 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201907161623.x6GGNuI9033418@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Tue, 16 Jul 2019 16:23:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350051 - stable/12/sys/dev/gpio X-SVN-Group: stable-12 X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: stable/12/sys/dev/gpio X-SVN-Commit-Revision: 350051 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3141A8DF03 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jul 2019 16:23:57 -0000 Author: lwhsu Date: Tue Jul 16 16:23:56 2019 New Revision: 350051 URL: https://svnweb.freebsd.org/changeset/base/350051 Log: MFC r349472: Follow r349460 to complete removing "flags" in struct gpiobus_ivar Sponsored by: The FreeBSD Foundation Modified: stable/12/sys/dev/gpio/ofw_gpiobus.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/gpio/ofw_gpiobus.c ============================================================================== --- stable/12/sys/dev/gpio/ofw_gpiobus.c Tue Jul 16 16:05:42 2019 (r350050) +++ stable/12/sys/dev/gpio/ofw_gpiobus.c Tue Jul 16 16:23:56 2019 (r350051) @@ -321,10 +321,8 @@ ofw_gpiobus_setup_devinfo(device_t bus, device_t child ofw_gpiobus_destroy_devinfo(bus, dinfo); return (NULL); } - for (i = 0; i < devi->npins; i++) { - devi->flags[i] = pins[i].flags; + for (i = 0; i < devi->npins; i++) devi->pins[i] = pins[i].pin; - } free(pins, M_DEVBUF); /* Parse the interrupt resources. */ if (ofw_bus_intr_to_rl(bus, node, &dinfo->opd_dinfo.rl, NULL) != 0) { From owner-svn-src-all@freebsd.org Tue Jul 16 16:25:28 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1CC88B41D8; Tue, 16 Jul 2019 16:25:28 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0C5788E2A7; Tue, 16 Jul 2019 16:25:28 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CDAF7890D; Tue, 16 Jul 2019 16:25:27 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6GGPRdx033690; Tue, 16 Jul 2019 16:25:27 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6GGPR4x033689; Tue, 16 Jul 2019 16:25:27 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201907161625.x6GGPR4x033689@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 16 Jul 2019 16:25:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350052 - head/lib/libnv/tests X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/lib/libnv/tests X-SVN-Commit-Revision: 350052 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0C5788E2A7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.982,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jul 2019 16:25:28 -0000 Author: markj Date: Tue Jul 16 16:25:27 2019 New Revision: 350052 URL: https://svnweb.freebsd.org/changeset/base/350052 Log: Convert the nvlist send/recv tests to ATF. MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/lib/libnv/tests/Makefile head/lib/libnv/tests/nvlist_send_recv_test.c Modified: head/lib/libnv/tests/Makefile ============================================================================== --- head/lib/libnv/tests/Makefile Tue Jul 16 16:23:56 2019 (r350051) +++ head/lib/libnv/tests/Makefile Tue Jul 16 16:25:27 2019 (r350052) @@ -1,10 +1,13 @@ # $FreeBSD$ +ATF_TESTS_C= \ + nvlist_send_recv_test + ATF_TESTS_CXX= \ cnv_tests \ dnv_tests \ nv_array_tests \ - nv_tests \ + nv_tests TAP_TESTS_C+= nvlist_add_test TAP_TESTS_C+= nvlist_append_test @@ -12,7 +15,6 @@ TAP_TESTS_C+= nvlist_exists_test TAP_TESTS_C+= nvlist_free_test TAP_TESTS_C+= nvlist_get_test TAP_TESTS_C+= nvlist_move_test -TAP_TESTS_C+= nvlist_send_recv_test LIBADD+= nv Modified: head/lib/libnv/tests/nvlist_send_recv_test.c ============================================================================== --- head/lib/libnv/tests/nvlist_send_recv_test.c Tue Jul 16 16:23:56 2019 (r350051) +++ head/lib/libnv/tests/nvlist_send_recv_test.c Tue Jul 16 16:25:27 2019 (r350052) @@ -25,10 +25,11 @@ * 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 @@ -42,20 +43,13 @@ #include #include -static int ntest = 1; +#include -#define CHECK(expr) do { \ - if ((expr)) \ - printf("ok # %d %s:%u\n", ntest, __FILE__, __LINE__); \ - else \ - printf("not ok # %d %s:%u\n", ntest, __FILE__, __LINE__);\ - ntest++; \ -} while (0) - +#define ALPHABET "abcdefghijklmnopqrstuvwxyz" #define fd_is_valid(fd) (fcntl((fd), F_GETFL) != -1 || errno != EBADF) static void -child(int sock) +send_nvlist_child(int sock) { nvlist_t *nvl; nvlist_t *empty; @@ -74,9 +68,10 @@ child(int sock) nvlist_add_number(nvl, "nvlist/number/INT64_MAX", INT64_MAX); nvlist_add_string(nvl, "nvlist/string/", ""); nvlist_add_string(nvl, "nvlist/string/x", "x"); - nvlist_add_string(nvl, "nvlist/string/abcdefghijklmnopqrstuvwxyz", "abcdefghijklmnopqrstuvwxyz"); + nvlist_add_string(nvl, "nvlist/string/" ALPHABET, ALPHABET); - nvlist_add_descriptor(nvl, "nvlist/descriptor/STDERR_FILENO", STDERR_FILENO); + nvlist_add_descriptor(nvl, "nvlist/descriptor/STDERR_FILENO", + STDERR_FILENO); if (pipe(pfd) == -1) err(EXIT_FAILURE, "pipe"); if (write(pfd[1], "test", 4) != 4) @@ -86,7 +81,8 @@ child(int sock) close(pfd[0]); nvlist_add_binary(nvl, "nvlist/binary/x", "x", 1); - nvlist_add_binary(nvl, "nvlist/binary/abcdefghijklmnopqrstuvwxyz", "abcdefghijklmnopqrstuvwxyz", sizeof("abcdefghijklmnopqrstuvwxyz")); + nvlist_add_binary(nvl, "nvlist/binary/" ALPHABET, ALPHABET, + sizeof(ALPHABET)); nvlist_move_nvlist(nvl, "nvlist/nvlist/empty", empty); nvlist_add_nvlist(nvl, "nvlist/nvlist", nvl); @@ -96,7 +92,7 @@ child(int sock) } static void -parent(int sock) +send_nvlist_parent(int sock) { nvlist_t *nvl; const nvlist_t *cnvl, *empty; @@ -107,290 +103,283 @@ parent(int sock) char buf[4]; nvl = nvlist_recv(sock, 0); - CHECK(nvlist_error(nvl) == 0); + ATF_REQUIRE(nvlist_error(nvl) == 0); if (nvlist_error(nvl) != 0) err(1, "nvlist_recv() failed"); cookie = NULL; name = nvlist_next(nvl, &type, &cookie); - CHECK(name != NULL); - CHECK(type == NV_TYPE_BOOL); - CHECK(strcmp(name, "nvlist/bool/true") == 0); - CHECK(nvlist_get_bool(nvl, name) == true); + ATF_REQUIRE(name != NULL); + ATF_REQUIRE(type == NV_TYPE_BOOL); + ATF_REQUIRE(strcmp(name, "nvlist/bool/true") == 0); + ATF_REQUIRE(nvlist_get_bool(nvl, name) == true); name = nvlist_next(nvl, &type, &cookie); - CHECK(name != NULL); - CHECK(type == NV_TYPE_BOOL); - CHECK(strcmp(name, "nvlist/bool/false") == 0); - CHECK(nvlist_get_bool(nvl, name) == false); + ATF_REQUIRE(name != NULL); + ATF_REQUIRE(type == NV_TYPE_BOOL); + ATF_REQUIRE(strcmp(name, "nvlist/bool/false") == 0); + ATF_REQUIRE(nvlist_get_bool(nvl, name) == false); name = nvlist_next(nvl, &type, &cookie); - CHECK(name != NULL); - CHECK(type == NV_TYPE_NUMBER); - CHECK(strcmp(name, "nvlist/number/0") == 0); - CHECK(nvlist_get_number(nvl, name) == 0); + ATF_REQUIRE(name != NULL); + ATF_REQUIRE(type == NV_TYPE_NUMBER); + ATF_REQUIRE(strcmp(name, "nvlist/number/0") == 0); + ATF_REQUIRE(nvlist_get_number(nvl, name) == 0); name = nvlist_next(nvl, &type, &cookie); - CHECK(name != NULL); - CHECK(type == NV_TYPE_NUMBER); - CHECK(strcmp(name, "nvlist/number/1") == 0); - CHECK(nvlist_get_number(nvl, name) == 1); + ATF_REQUIRE(name != NULL); + ATF_REQUIRE(type == NV_TYPE_NUMBER); + ATF_REQUIRE(strcmp(name, "nvlist/number/1") == 0); + ATF_REQUIRE(nvlist_get_number(nvl, name) == 1); name = nvlist_next(nvl, &type, &cookie); - CHECK(name != NULL); - CHECK(type == NV_TYPE_NUMBER); - CHECK(strcmp(name, "nvlist/number/-1") == 0); - CHECK((int)nvlist_get_number(nvl, name) == -1); + ATF_REQUIRE(name != NULL); + ATF_REQUIRE(type == NV_TYPE_NUMBER); + ATF_REQUIRE(strcmp(name, "nvlist/number/-1") == 0); + ATF_REQUIRE((int)nvlist_get_number(nvl, name) == -1); name = nvlist_next(nvl, &type, &cookie); - CHECK(name != NULL); - CHECK(type == NV_TYPE_NUMBER); - CHECK(strcmp(name, "nvlist/number/UINT64_MAX") == 0); - CHECK(nvlist_get_number(nvl, name) == UINT64_MAX); + ATF_REQUIRE(name != NULL); + ATF_REQUIRE(type == NV_TYPE_NUMBER); + ATF_REQUIRE(strcmp(name, "nvlist/number/UINT64_MAX") == 0); + ATF_REQUIRE(nvlist_get_number(nvl, name) == UINT64_MAX); name = nvlist_next(nvl, &type, &cookie); - CHECK(name != NULL); - CHECK(type == NV_TYPE_NUMBER); - CHECK(strcmp(name, "nvlist/number/INT64_MIN") == 0); - CHECK((int64_t)nvlist_get_number(nvl, name) == INT64_MIN); + ATF_REQUIRE(name != NULL); + ATF_REQUIRE(type == NV_TYPE_NUMBER); + ATF_REQUIRE(strcmp(name, "nvlist/number/INT64_MIN") == 0); + ATF_REQUIRE((int64_t)nvlist_get_number(nvl, name) == INT64_MIN); name = nvlist_next(nvl, &type, &cookie); - CHECK(name != NULL); - CHECK(type == NV_TYPE_NUMBER); - CHECK(strcmp(name, "nvlist/number/INT64_MAX") == 0); - CHECK((int64_t)nvlist_get_number(nvl, name) == INT64_MAX); + ATF_REQUIRE(name != NULL); + ATF_REQUIRE(type == NV_TYPE_NUMBER); + ATF_REQUIRE(strcmp(name, "nvlist/number/INT64_MAX") == 0); + ATF_REQUIRE((int64_t)nvlist_get_number(nvl, name) == INT64_MAX); name = nvlist_next(nvl, &type, &cookie); - CHECK(name != NULL); - CHECK(type == NV_TYPE_STRING); - CHECK(strcmp(name, "nvlist/string/") == 0); - CHECK(strcmp(nvlist_get_string(nvl, name), "") == 0); + ATF_REQUIRE(name != NULL); + ATF_REQUIRE(type == NV_TYPE_STRING); + ATF_REQUIRE(strcmp(name, "nvlist/string/") == 0); + ATF_REQUIRE(strcmp(nvlist_get_string(nvl, name), "") == 0); name = nvlist_next(nvl, &type, &cookie); - CHECK(name != NULL); - CHECK(type == NV_TYPE_STRING); - CHECK(strcmp(name, "nvlist/string/x") == 0); - CHECK(strcmp(nvlist_get_string(nvl, name), "x") == 0); + ATF_REQUIRE(name != NULL); + ATF_REQUIRE(type == NV_TYPE_STRING); + ATF_REQUIRE(strcmp(name, "nvlist/string/x") == 0); + ATF_REQUIRE(strcmp(nvlist_get_string(nvl, name), "x") == 0); name = nvlist_next(nvl, &type, &cookie); - CHECK(name != NULL); - CHECK(type == NV_TYPE_STRING); - CHECK(strcmp(name, "nvlist/string/abcdefghijklmnopqrstuvwxyz") == 0); - CHECK(strcmp(nvlist_get_string(nvl, name), "abcdefghijklmnopqrstuvwxyz") == 0); + ATF_REQUIRE(name != NULL); + ATF_REQUIRE(type == NV_TYPE_STRING); + ATF_REQUIRE(strcmp(name, "nvlist/string/" ALPHABET) == 0); + ATF_REQUIRE(strcmp(nvlist_get_string(nvl, name), ALPHABET) == 0); name = nvlist_next(nvl, &type, &cookie); - CHECK(name != NULL); - CHECK(type == NV_TYPE_DESCRIPTOR); - CHECK(strcmp(name, "nvlist/descriptor/STDERR_FILENO") == 0); - CHECK(fd_is_valid(nvlist_get_descriptor(nvl, name))); + ATF_REQUIRE(name != NULL); + ATF_REQUIRE(type == NV_TYPE_DESCRIPTOR); + ATF_REQUIRE(strcmp(name, "nvlist/descriptor/STDERR_FILENO") == 0); + ATF_REQUIRE(fd_is_valid(nvlist_get_descriptor(nvl, name))); name = nvlist_next(nvl, &type, &cookie); - CHECK(name != NULL); - CHECK(type == NV_TYPE_DESCRIPTOR); - CHECK(strcmp(name, "nvlist/descriptor/pipe_rd") == 0); + ATF_REQUIRE(name != NULL); + ATF_REQUIRE(type == NV_TYPE_DESCRIPTOR); + ATF_REQUIRE(strcmp(name, "nvlist/descriptor/pipe_rd") == 0); fd = nvlist_get_descriptor(nvl, name); - CHECK(fd_is_valid(fd)); - CHECK(read(fd, buf, sizeof(buf)) == 4); - CHECK(strncmp(buf, "test", sizeof(buf)) == 0); + ATF_REQUIRE(fd_is_valid(fd)); + ATF_REQUIRE(read(fd, buf, sizeof(buf)) == 4); + ATF_REQUIRE(strncmp(buf, "test", sizeof(buf)) == 0); name = nvlist_next(nvl, &type, &cookie); - CHECK(name != NULL); - CHECK(type == NV_TYPE_BINARY); - CHECK(strcmp(name, "nvlist/binary/x") == 0); - CHECK(memcmp(nvlist_get_binary(nvl, name, NULL), "x", 1) == 0); - CHECK(memcmp(nvlist_get_binary(nvl, name, &size), "x", 1) == 0); - CHECK(size == 1); + ATF_REQUIRE(name != NULL); + ATF_REQUIRE(type == NV_TYPE_BINARY); + ATF_REQUIRE(strcmp(name, "nvlist/binary/x") == 0); + ATF_REQUIRE(memcmp(nvlist_get_binary(nvl, name, NULL), "x", 1) == 0); + ATF_REQUIRE(memcmp(nvlist_get_binary(nvl, name, &size), "x", 1) == 0); + ATF_REQUIRE(size == 1); name = nvlist_next(nvl, &type, &cookie); - CHECK(name != NULL); - CHECK(type == NV_TYPE_BINARY); - CHECK(strcmp(name, "nvlist/binary/abcdefghijklmnopqrstuvwxyz") == 0); - CHECK(memcmp(nvlist_get_binary(nvl, name, NULL), "abcdefghijklmnopqrstuvwxyz", sizeof("abcdefghijklmnopqrstuvwxyz")) == 0); - CHECK(memcmp(nvlist_get_binary(nvl, name, &size), "abcdefghijklmnopqrstuvwxyz", sizeof("abcdefghijklmnopqrstuvwxyz")) == 0); - CHECK(size == sizeof("abcdefghijklmnopqrstuvwxyz")); + ATF_REQUIRE(name != NULL); + ATF_REQUIRE(type == NV_TYPE_BINARY); + ATF_REQUIRE(strcmp(name, "nvlist/binary/" ALPHABET) == 0); + ATF_REQUIRE(memcmp(nvlist_get_binary(nvl, name, NULL), ALPHABET, + sizeof(ALPHABET)) == 0); + ATF_REQUIRE(memcmp(nvlist_get_binary(nvl, name, &size), ALPHABET, + sizeof(ALPHABET)) == 0); + ATF_REQUIRE(size == sizeof(ALPHABET)); name = nvlist_next(nvl, &type, &cookie); - CHECK(name != NULL); - CHECK(type == NV_TYPE_NVLIST); - CHECK(strcmp(name, "nvlist/nvlist/empty") == 0); + ATF_REQUIRE(name != NULL); + ATF_REQUIRE(type == NV_TYPE_NVLIST); + ATF_REQUIRE(strcmp(name, "nvlist/nvlist/empty") == 0); cnvl = nvlist_get_nvlist(nvl, name); - CHECK(nvlist_empty(cnvl)); + ATF_REQUIRE(nvlist_empty(cnvl)); name = nvlist_next(nvl, &type, &cookie); - CHECK(name != NULL); - CHECK(type == NV_TYPE_NVLIST); - CHECK(strcmp(name, "nvlist/nvlist") == 0); + ATF_REQUIRE(name != NULL); + ATF_REQUIRE(type == NV_TYPE_NVLIST); + ATF_REQUIRE(strcmp(name, "nvlist/nvlist") == 0); cnvl = nvlist_get_nvlist(nvl, name); ccookie = NULL; cname = nvlist_next(cnvl, &ctype, &ccookie); - CHECK(cname != NULL); - CHECK(ctype == NV_TYPE_BOOL); - CHECK(strcmp(cname, "nvlist/bool/true") == 0); - CHECK(nvlist_get_bool(cnvl, cname) == true); + ATF_REQUIRE(cname != NULL); + ATF_REQUIRE(ctype == NV_TYPE_BOOL); + ATF_REQUIRE(strcmp(cname, "nvlist/bool/true") == 0); + ATF_REQUIRE(nvlist_get_bool(cnvl, cname) == true); cname = nvlist_next(cnvl, &ctype, &ccookie); - CHECK(cname != NULL); - CHECK(ctype == NV_TYPE_BOOL); - CHECK(strcmp(cname, "nvlist/bool/false") == 0); - CHECK(nvlist_get_bool(cnvl, cname) == false); + ATF_REQUIRE(cname != NULL); + ATF_REQUIRE(ctype == NV_TYPE_BOOL); + ATF_REQUIRE(strcmp(cname, "nvlist/bool/false") == 0); + ATF_REQUIRE(nvlist_get_bool(cnvl, cname) == false); cname = nvlist_next(cnvl, &ctype, &ccookie); - CHECK(cname != NULL); - CHECK(ctype == NV_TYPE_NUMBER); - CHECK(strcmp(cname, "nvlist/number/0") == 0); - CHECK(nvlist_get_number(cnvl, cname) == 0); + ATF_REQUIRE(cname != NULL); + ATF_REQUIRE(ctype == NV_TYPE_NUMBER); + ATF_REQUIRE(strcmp(cname, "nvlist/number/0") == 0); + ATF_REQUIRE(nvlist_get_number(cnvl, cname) == 0); cname = nvlist_next(cnvl, &ctype, &ccookie); - CHECK(cname != NULL); - CHECK(ctype == NV_TYPE_NUMBER); - CHECK(strcmp(cname, "nvlist/number/1") == 0); - CHECK(nvlist_get_number(cnvl, cname) == 1); + ATF_REQUIRE(cname != NULL); + ATF_REQUIRE(ctype == NV_TYPE_NUMBER); + ATF_REQUIRE(strcmp(cname, "nvlist/number/1") == 0); + ATF_REQUIRE(nvlist_get_number(cnvl, cname) == 1); cname = nvlist_next(cnvl, &ctype, &ccookie); - CHECK(cname != NULL); - CHECK(ctype == NV_TYPE_NUMBER); - CHECK(strcmp(cname, "nvlist/number/-1") == 0); - CHECK((int)nvlist_get_number(cnvl, cname) == -1); + ATF_REQUIRE(cname != NULL); + ATF_REQUIRE(ctype == NV_TYPE_NUMBER); + ATF_REQUIRE(strcmp(cname, "nvlist/number/-1") == 0); + ATF_REQUIRE((int)nvlist_get_number(cnvl, cname) == -1); cname = nvlist_next(cnvl, &ctype, &ccookie); - CHECK(cname != NULL); - CHECK(ctype == NV_TYPE_NUMBER); - CHECK(strcmp(cname, "nvlist/number/UINT64_MAX") == 0); - CHECK(nvlist_get_number(cnvl, cname) == UINT64_MAX); + ATF_REQUIRE(cname != NULL); + ATF_REQUIRE(ctype == NV_TYPE_NUMBER); + ATF_REQUIRE(strcmp(cname, "nvlist/number/UINT64_MAX") == 0); + ATF_REQUIRE(nvlist_get_number(cnvl, cname) == UINT64_MAX); cname = nvlist_next(cnvl, &ctype, &ccookie); - CHECK(cname != NULL); - CHECK(ctype == NV_TYPE_NUMBER); - CHECK(strcmp(cname, "nvlist/number/INT64_MIN") == 0); - CHECK((int64_t)nvlist_get_number(cnvl, cname) == INT64_MIN); + ATF_REQUIRE(cname != NULL); + ATF_REQUIRE(ctype == NV_TYPE_NUMBER); + ATF_REQUIRE(strcmp(cname, "nvlist/number/INT64_MIN") == 0); + ATF_REQUIRE((int64_t)nvlist_get_number(cnvl, cname) == INT64_MIN); cname = nvlist_next(cnvl, &ctype, &ccookie); - CHECK(cname != NULL); - CHECK(ctype == NV_TYPE_NUMBER); - CHECK(strcmp(cname, "nvlist/number/INT64_MAX") == 0); - CHECK((int64_t)nvlist_get_number(cnvl, cname) == INT64_MAX); + ATF_REQUIRE(cname != NULL); + ATF_REQUIRE(ctype == NV_TYPE_NUMBER); + ATF_REQUIRE(strcmp(cname, "nvlist/number/INT64_MAX") == 0); + ATF_REQUIRE((int64_t)nvlist_get_number(cnvl, cname) == INT64_MAX); cname = nvlist_next(cnvl, &ctype, &ccookie); - CHECK(cname != NULL); - CHECK(ctype == NV_TYPE_STRING); - CHECK(strcmp(cname, "nvlist/string/") == 0); - CHECK(strcmp(nvlist_get_string(cnvl, cname), "") == 0); + ATF_REQUIRE(cname != NULL); + ATF_REQUIRE(ctype == NV_TYPE_STRING); + ATF_REQUIRE(strcmp(cname, "nvlist/string/") == 0); + ATF_REQUIRE(strcmp(nvlist_get_string(cnvl, cname), "") == 0); cname = nvlist_next(cnvl, &ctype, &ccookie); - CHECK(cname != NULL); - CHECK(ctype == NV_TYPE_STRING); - CHECK(strcmp(cname, "nvlist/string/x") == 0); - CHECK(strcmp(nvlist_get_string(cnvl, cname), "x") == 0); + ATF_REQUIRE(cname != NULL); + ATF_REQUIRE(ctype == NV_TYPE_STRING); + ATF_REQUIRE(strcmp(cname, "nvlist/string/x") == 0); + ATF_REQUIRE(strcmp(nvlist_get_string(cnvl, cname), "x") == 0); cname = nvlist_next(cnvl, &ctype, &ccookie); - CHECK(cname != NULL); - CHECK(ctype == NV_TYPE_STRING); - CHECK(strcmp(cname, "nvlist/string/abcdefghijklmnopqrstuvwxyz") == 0); - CHECK(strcmp(nvlist_get_string(cnvl, cname), "abcdefghijklmnopqrstuvwxyz") == 0); + ATF_REQUIRE(cname != NULL); + ATF_REQUIRE(ctype == NV_TYPE_STRING); + ATF_REQUIRE(strcmp(cname, "nvlist/string/" ALPHABET) == 0); + ATF_REQUIRE(strcmp(nvlist_get_string(cnvl, cname), ALPHABET) == 0); cname = nvlist_next(cnvl, &ctype, &ccookie); - CHECK(cname != NULL); - CHECK(ctype == NV_TYPE_DESCRIPTOR); - CHECK(strcmp(cname, "nvlist/descriptor/STDERR_FILENO") == 0); - CHECK(fd_is_valid(nvlist_get_descriptor(cnvl, cname))); + ATF_REQUIRE(cname != NULL); + ATF_REQUIRE(ctype == NV_TYPE_DESCRIPTOR); + ATF_REQUIRE(strcmp(cname, "nvlist/descriptor/STDERR_FILENO") == 0); + ATF_REQUIRE(fd_is_valid(nvlist_get_descriptor(cnvl, cname))); cname = nvlist_next(cnvl, &ctype, &ccookie); - CHECK(cname != NULL); - CHECK(ctype == NV_TYPE_DESCRIPTOR); - CHECK(strcmp(cname, "nvlist/descriptor/pipe_rd") == 0); - CHECK(fd_is_valid(nvlist_get_descriptor(cnvl, cname))); + ATF_REQUIRE(cname != NULL); + ATF_REQUIRE(ctype == NV_TYPE_DESCRIPTOR); + ATF_REQUIRE(strcmp(cname, "nvlist/descriptor/pipe_rd") == 0); + ATF_REQUIRE(fd_is_valid(nvlist_get_descriptor(cnvl, cname))); cname = nvlist_next(cnvl, &ctype, &ccookie); - CHECK(cname != NULL); - CHECK(ctype == NV_TYPE_BINARY); - CHECK(strcmp(cname, "nvlist/binary/x") == 0); - CHECK(memcmp(nvlist_get_binary(cnvl, cname, NULL), "x", 1) == 0); - CHECK(memcmp(nvlist_get_binary(cnvl, cname, &size), "x", 1) == 0); - CHECK(size == 1); + ATF_REQUIRE(cname != NULL); + ATF_REQUIRE(ctype == NV_TYPE_BINARY); + ATF_REQUIRE(strcmp(cname, "nvlist/binary/x") == 0); + ATF_REQUIRE(memcmp(nvlist_get_binary(cnvl, cname, NULL), "x", 1) == 0); + ATF_REQUIRE(memcmp(nvlist_get_binary(cnvl, cname, &size), "x", 1) == 0); + ATF_REQUIRE(size == 1); cname = nvlist_next(cnvl, &ctype, &ccookie); - CHECK(cname != NULL); - CHECK(ctype == NV_TYPE_BINARY); - CHECK(strcmp(cname, "nvlist/binary/abcdefghijklmnopqrstuvwxyz") == 0); - CHECK(memcmp(nvlist_get_binary(cnvl, cname, NULL), "abcdefghijklmnopqrstuvwxyz", sizeof("abcdefghijklmnopqrstuvwxyz")) == 0); - CHECK(memcmp(nvlist_get_binary(cnvl, cname, &size), "abcdefghijklmnopqrstuvwxyz", sizeof("abcdefghijklmnopqrstuvwxyz")) == 0); - CHECK(size == sizeof("abcdefghijklmnopqrstuvwxyz")); + ATF_REQUIRE(cname != NULL); + ATF_REQUIRE(ctype == NV_TYPE_BINARY); + ATF_REQUIRE(strcmp(cname, "nvlist/binary/" ALPHABET) == 0); + ATF_REQUIRE(memcmp(nvlist_get_binary(cnvl, cname, NULL), ALPHABET, + sizeof(ALPHABET)) == 0); + ATF_REQUIRE(memcmp(nvlist_get_binary(cnvl, cname, &size), ALPHABET, + sizeof(ALPHABET)) == 0); + ATF_REQUIRE(size == sizeof(ALPHABET)); cname = nvlist_next(cnvl, &ctype, &ccookie); - CHECK(cname != NULL); - CHECK(ctype == NV_TYPE_NVLIST); - CHECK(strcmp(cname, "nvlist/nvlist/empty") == 0); + ATF_REQUIRE(cname != NULL); + ATF_REQUIRE(ctype == NV_TYPE_NVLIST); + ATF_REQUIRE(strcmp(cname, "nvlist/nvlist/empty") == 0); empty = nvlist_get_nvlist(cnvl, cname); - CHECK(nvlist_empty(empty)); + ATF_REQUIRE(nvlist_empty(empty)); cname = nvlist_next(cnvl, &ctype, &ccookie); - CHECK(cname == NULL); + ATF_REQUIRE(cname == NULL); name = nvlist_next(nvl, &type, &cookie); - CHECK(name == NULL); + ATF_REQUIRE(name == NULL); nvlist_destroy(nvl); } -static void -send_nvlist(void) +ATF_TC_WITHOUT_HEAD(nvlist_send_recv__send_nvlist); +ATF_TC_BODY(nvlist_send_recv__send_nvlist, tc) { - int status, socks[2]; + int socks[2], status; pid_t pid; - if (socketpair(PF_UNIX, SOCK_STREAM, 0, socks) < 0) - err(1, "socketpair() failed"); + ATF_REQUIRE(socketpair(PF_UNIX, SOCK_STREAM, 0, socks) == 0); + pid = fork(); - switch (pid) { - case -1: - /* Failure. */ - err(1, "unable to fork"); - case 0: + ATF_REQUIRE(pid >= 0); + if (pid == 0) { /* Child. */ - close(socks[0]); - child(socks[1]); + (void)close(socks[0]); + send_nvlist_child(socks[1]); _exit(0); - default: - /* Parent. */ - close(socks[1]); - parent(socks[0]); - break; } - if (waitpid(pid, &status, 0) < 0) - err(1, "waitpid() failed"); + (void)close(socks[1]); + send_nvlist_parent(socks[0]); + + ATF_REQUIRE(waitpid(pid, &status, 0) == pid); + ATF_REQUIRE(status == 0); } -static void -send_closed_fd(void) +ATF_TC_WITHOUT_HEAD(nvlist_send_recv__send_closed_fd); +ATF_TC_BODY(nvlist_send_recv__send_closed_fd, tc) { nvlist_t *nvl; - int error, socks[2]; + int socks[2]; - if (socketpair(PF_UNIX, SOCK_STREAM, 0, socks) < 0) - err(1, "socketpair() failed"); + ATF_REQUIRE(socketpair(PF_UNIX, SOCK_STREAM, 0, socks) == 0); nvl = nvlist_create(0); + ATF_REQUIRE(nvl != NULL); nvlist_add_descriptor(nvl, "fd", 12345); - error = nvlist_error(nvl); - CHECK(error == EBADF); + ATF_REQUIRE(nvlist_error(nvl) == EBADF); - error = nvlist_send(socks[1], nvl); - CHECK(error != 0 && errno == EBADF); + ATF_REQUIRE_ERRNO(EBADF, nvlist_send(socks[1], nvl) != 0); } -int -main(void) +ATF_TP_ADD_TCS(tp) { - printf("1..146\n"); - fflush(stdout); + ATF_TP_ADD_TC(tp, nvlist_send_recv__send_nvlist); + ATF_TP_ADD_TC(tp, nvlist_send_recv__send_closed_fd); - send_nvlist(); - send_closed_fd(); - - return (0); + return (atf_no_error()); } From owner-svn-src-all@freebsd.org Tue Jul 16 16:26:52 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 26D59B42BC; Tue, 16 Jul 2019 16:26:52 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0A08F8E521; Tue, 16 Jul 2019 16:26:52 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F247B8915; Tue, 16 Jul 2019 16:26:51 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6GGQp4X033930; Tue, 16 Jul 2019 16:26:51 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6GGQplf033929; Tue, 16 Jul 2019 16:26:51 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201907161626.x6GGQplf033929@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Tue, 16 Jul 2019 16:26:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r350053 - stable/11/sys/dev/gpio X-SVN-Group: stable-11 X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: stable/11/sys/dev/gpio X-SVN-Commit-Revision: 350053 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0A08F8E521 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jul 2019 16:26:52 -0000 Author: lwhsu Date: Tue Jul 16 16:26:51 2019 New Revision: 350053 URL: https://svnweb.freebsd.org/changeset/base/350053 Log: MFC r349472: Follow r349460 to complete removing "flags" in struct gpiobus_ivar Sponsored by: The FreeBSD Foundation Modified: stable/11/sys/dev/gpio/ofw_gpiobus.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/gpio/ofw_gpiobus.c ============================================================================== --- stable/11/sys/dev/gpio/ofw_gpiobus.c Tue Jul 16 16:25:27 2019 (r350052) +++ stable/11/sys/dev/gpio/ofw_gpiobus.c Tue Jul 16 16:26:51 2019 (r350053) @@ -317,10 +317,8 @@ ofw_gpiobus_setup_devinfo(device_t bus, device_t child ofw_gpiobus_destroy_devinfo(bus, dinfo); return (NULL); } - for (i = 0; i < devi->npins; i++) { - devi->flags[i] = pins[i].flags; + for (i = 0; i < devi->npins; i++) devi->pins[i] = pins[i].pin; - } free(pins, M_DEVBUF); /* Parse the interrupt resources. */ if (ofw_bus_intr_to_rl(bus, node, &dinfo->opd_dinfo.rl, NULL) != 0) { From owner-svn-src-all@freebsd.org Tue Jul 16 16:28:50 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F05BFB4387; Tue, 16 Jul 2019 16:28:50 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D2AF98E720; Tue, 16 Jul 2019 16:28:50 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AD601892E; Tue, 16 Jul 2019 16:28:50 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6GGSoHk034070; Tue, 16 Jul 2019 16:28:50 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6GGSoAG034069; Tue, 16 Jul 2019 16:28:50 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201907161628.x6GGSoAG034069@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 16 Jul 2019 16:28:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350054 - head/lib/libnv X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/lib/libnv X-SVN-Commit-Revision: 350054 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D2AF98E720 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jul 2019 16:28:51 -0000 Author: markj Date: Tue Jul 16 16:28:50 2019 New Revision: 350054 URL: https://svnweb.freebsd.org/changeset/base/350054 Log: Use a platform-independent constant for PKG_MAX_SIZE. This constant determines the number of rights libnv will attempt to transmit in a given control message. In practice, the upper limit defined by the kernel is machine-dependent and is smaller on 64-bit kernels than on 32-bit kernels. To ensure that a 32-bit libnv works as expected when run on a 64-bit kernel, use a limit that will work on both 32-bit and 64-bit kernels. PR: 238511 Discussed with: oshogbo MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20942 Modified: head/lib/libnv/msgio.c Modified: head/lib/libnv/msgio.c ============================================================================== --- head/lib/libnv/msgio.c Tue Jul 16 16:26:51 2019 (r350053) +++ head/lib/libnv/msgio.c Tue Jul 16 16:28:50 2019 (r350054) @@ -63,7 +63,13 @@ __FBSDID("$FreeBSD$"); /* Linux: arbitrary size, but must be lower than SCM_MAX_FD. */ #define PKG_MAX_SIZE ((64U - 1) * CMSG_SPACE(sizeof(int))) #else -#define PKG_MAX_SIZE (MCLBYTES / CMSG_SPACE(sizeof(int)) - 1) +/* + * To work around limitations in 32-bit emulation on 64-bit kernels, use a + * machine-independent limit on the number of FDs per message. Each control + * message contains 1 FD and requires 12 bytes for the header, 4 pad bytes, + * 4 bytes for the descriptor, and another 4 pad bytes. + */ +#define PKG_MAX_SIZE (MCLBYTES / 24) #endif static int From owner-svn-src-all@freebsd.org Tue Jul 16 16:33:45 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1370FB45F0; Tue, 16 Jul 2019 16:33:45 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E8DA88EDDC; Tue, 16 Jul 2019 16:33:44 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B2B778B03; Tue, 16 Jul 2019 16:33:44 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6GGXiJX039799; Tue, 16 Jul 2019 16:33:44 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6GGXiXI039798; Tue, 16 Jul 2019 16:33:44 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201907161633.x6GGXiXI039798@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 16 Jul 2019 16:33:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350055 - head/lib/libnv/tests X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/lib/libnv/tests X-SVN-Commit-Revision: 350055 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E8DA88EDDC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jul 2019 16:33:45 -0000 Author: markj Date: Tue Jul 16 16:33:44 2019 New Revision: 350055 URL: https://svnweb.freebsd.org/changeset/base/350055 Log: Add a regression test which transfers varying number of rights. This exercises the PKG_MAX_SIZE limit mentioned in r350054. MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/lib/libnv/tests/nvlist_send_recv_test.c Modified: head/lib/libnv/tests/nvlist_send_recv_test.c ============================================================================== --- head/lib/libnv/tests/nvlist_send_recv_test.c Tue Jul 16 16:28:50 2019 (r350054) +++ head/lib/libnv/tests/nvlist_send_recv_test.c Tue Jul 16 16:33:44 2019 (r350055) @@ -30,8 +30,9 @@ #include __FBSDID("$FreeBSD$"); -#include +#include #include +#include #include #include @@ -39,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -375,11 +377,106 @@ ATF_TC_BODY(nvlist_send_recv__send_closed_fd, tc) ATF_REQUIRE_ERRNO(EBADF, nvlist_send(socks[1], nvl) != 0); } +static int +nopenfds(void) +{ + size_t len; + int error, mib[4], n; + + mib[0] = CTL_KERN; + mib[1] = KERN_PROC; + mib[2] = KERN_PROC_NFDS; + mib[3] = 0; + + len = sizeof(n); + error = sysctl(mib, nitems(mib), &n, &len, NULL, 0); + if (error != 0) + return (-1); + return (n); +} + +#define NFDS 512 + +static void +send_many_fds_child(int sock) +{ + char name[16]; + nvlist_t *nvl; + int anfds, bnfds, fd, i, j; + + fd = open(_PATH_DEVNULL, O_RDONLY); + ATF_REQUIRE(fd >= 0); + + for (i = 1; i < NFDS; i++) { + nvl = nvlist_create(0); + bnfds = nopenfds(); + if (bnfds == -1) + err(EXIT_FAILURE, "sysctl"); + + for (j = 0; j < i; j++) { + snprintf(name, sizeof(name), "fd%d", j); + nvlist_add_descriptor(nvl, name, fd); + } + nvlist_send(sock, nvl); + nvlist_destroy(nvl); + + anfds = nopenfds(); + if (anfds == -1) + err(EXIT_FAILURE, "sysctl"); + if (anfds != bnfds) + errx(EXIT_FAILURE, "fd count mismatch"); + } +} + +ATF_TC_WITHOUT_HEAD(nvlist_send_recv__send_many_fds); +ATF_TC_BODY(nvlist_send_recv__send_many_fds, tc) +{ + char name[16]; + nvlist_t *nvl; + int anfds, bnfds, fd, i, j, socks[2], status; + pid_t pid; + + ATF_REQUIRE(socketpair(PF_UNIX, SOCK_STREAM, 0, socks) == 0); + + pid = fork(); + ATF_REQUIRE(pid >= 0); + if (pid == 0) { + /* Child. */ + (void)close(socks[0]); + send_many_fds_child(socks[1]); + _exit(0); + } + + (void)close(socks[1]); + + for (i = 1; i < NFDS; i++) { + bnfds = nopenfds(); + ATF_REQUIRE(bnfds != -1); + + nvl = nvlist_recv(socks[0], 0); + ATF_REQUIRE(nvl != NULL); + for (j = 0; j < i; j++) { + snprintf(name, sizeof(name), "fd%d", j); + fd = nvlist_take_descriptor(nvl, name); + ATF_REQUIRE(close(fd) == 0); + } + nvlist_destroy(nvl); + + anfds = nopenfds(); + ATF_REQUIRE(anfds != -1); + ATF_REQUIRE(anfds == bnfds); + } + + ATF_REQUIRE(waitpid(pid, &status, 0) == pid); + ATF_REQUIRE(status == 0); +} + ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, nvlist_send_recv__send_nvlist); ATF_TP_ADD_TC(tp, nvlist_send_recv__send_closed_fd); + ATF_TP_ADD_TC(tp, nvlist_send_recv__send_many_fds); return (atf_no_error()); } From owner-svn-src-all@freebsd.org Tue Jul 16 16:49:12 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 14205B4B83; Tue, 16 Jul 2019 16:49:12 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E98908FAF3; Tue, 16 Jul 2019 16:49:11 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C62A58CF6; Tue, 16 Jul 2019 16:49:11 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6GGnB97046330; Tue, 16 Jul 2019 16:49:11 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6GGnBtO046329; Tue, 16 Jul 2019 16:49:11 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201907161649.x6GGnBtO046329@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Tue, 16 Jul 2019 16:49:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r350056 - stable/11/sys/dev/vt X-SVN-Group: stable-11 X-SVN-Commit-Author: vangyzen X-SVN-Commit-Paths: stable/11/sys/dev/vt X-SVN-Commit-Revision: 350056 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E98908FAF3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.95)[-0.946,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jul 2019 16:49:12 -0000 Author: vangyzen Date: Tue Jul 16 16:49:11 2019 New Revision: 350056 URL: https://svnweb.freebsd.org/changeset/base/350056 Log: MFC r349834 Ignore kern.vt.splash_cpu without graphics When the system has no graphical console, such as bhyve in common configurations, ignore kern.vt.splash_cpu, instead of panicking on INVARIANTS kernels. Reviewed by: cem dumbbell Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D20877 Modified: stable/11/sys/dev/vt/vt_cpulogos.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/vt/vt_cpulogos.c ============================================================================== --- stable/11/sys/dev/vt/vt_cpulogos.c Tue Jul 16 16:33:44 2019 (r350055) +++ stable/11/sys/dev/vt/vt_cpulogos.c Tue Jul 16 16:49:11 2019 (r350056) @@ -227,9 +227,8 @@ vt_init_logos(void *dummy) return; VT_LOCK(vd); - KASSERT((vd->vd_flags & VDF_INITIALIZED) != 0, - ("vd %p not initialized", vd)); - + if ((vd->vd_flags & VDF_INITIALIZED) == 0) + goto out; if ((vd->vd_flags & (VDF_DEAD | VDF_TEXTMODE)) != 0) goto out; if (vd->vd_height <= vt_logo_sprite_height) From owner-svn-src-all@freebsd.org Tue Jul 16 17:24:05 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 82CAAB582F; Tue, 16 Jul 2019 17:24:05 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 713426A9AE; Tue, 16 Jul 2019 17:24:05 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 30CC39441; Tue, 16 Jul 2019 17:24:05 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6GHO5D0070284; Tue, 16 Jul 2019 17:24:05 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6GHO3MZ070277; Tue, 16 Jul 2019 17:24:03 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201907161724.x6GHO3MZ070277@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 16 Jul 2019 17:24:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350057 - in head/sbin/nvmecontrol: . modules/wdc X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sbin/nvmecontrol: . modules/wdc X-SVN-Commit-Revision: 350057 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 713426A9AE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jul 2019 17:24:05 -0000 Author: imp Date: Tue Jul 16 17:24:03 2019 New Revision: 350057 URL: https://svnweb.freebsd.org/changeset/base/350057 Log: Create generic command / arg parsing routines Create a set of routines and structures to hold the data for the args for a command. Use them to generate help and to parse args. Convert all the current commands over to the new format. "comnd" is a hat-tip to the TOPS-20 %COMND JSYS that (very) loosely inspired much of the subsequent command line notions in the industry, but this is far simpler (the %COMND man page is longer than this code) and not in the kernel... Also, it implements today's de-facto command [verb]+ [opts]* [args]* format rather than the old, archaic TOPS-20 command format :) This is a snapshot of a work in progress to get the nvme passthru stuff committed. In time it will become a private library and used by some other programs in the tree that conform to the above pattern. Differential Revision: https://reviews.freebsd.org/D19296 Added: head/sbin/nvmecontrol/comnd.c (contents, props changed) head/sbin/nvmecontrol/comnd.h (contents, props changed) Modified: head/sbin/nvmecontrol/Makefile head/sbin/nvmecontrol/devlist.c head/sbin/nvmecontrol/firmware.c head/sbin/nvmecontrol/format.c head/sbin/nvmecontrol/identify.c head/sbin/nvmecontrol/logpage.c head/sbin/nvmecontrol/modules/wdc/wdc.c head/sbin/nvmecontrol/ns.c head/sbin/nvmecontrol/nvmecontrol.c head/sbin/nvmecontrol/nvmecontrol.h head/sbin/nvmecontrol/perftest.c head/sbin/nvmecontrol/power.c head/sbin/nvmecontrol/reset.c Modified: head/sbin/nvmecontrol/Makefile ============================================================================== --- head/sbin/nvmecontrol/Makefile Tue Jul 16 16:49:11 2019 (r350056) +++ head/sbin/nvmecontrol/Makefile Tue Jul 16 17:24:03 2019 (r350057) @@ -2,10 +2,13 @@ PACKAGE=runtime PROG= nvmecontrol -SRCS= nvmecontrol.c devlist.c firmware.c format.c identify.c identify_ext.c logpage.c \ - perftest.c reset.c ns.c nvme_util.c power.c nc_util.c +SRCS= comnd.c nvmecontrol.c +SRCS+= devlist.c firmware.c format.c identify.c logpage.c ns.c perftest.c power.c reset.c +#SRCS+= passthru.c +SRCS+= identify_ext.c nvme_util.c nc_util.c MAN= nvmecontrol.8 LDFLAGS+= -rdynamic +LIBADD+= util SUBDIR= modules .PATH: ${SRCTOP}/sys/dev/nvme Added: head/sbin/nvmecontrol/comnd.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/nvmecontrol/comnd.c Tue Jul 16 17:24:03 2019 (r350057) @@ -0,0 +1,326 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (C) 2019 Netflix, Inc + * + * 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 "comnd.h" + +static struct cmd top; + +static void +print_usage(const struct cmd *f) +{ + + fprintf(stderr, " %s %-15s - %s\n", getprogname(), f->name, f->descr); +} + +static void +gen_usage(const struct cmd *t) +{ + struct cmd *walker; + + fprintf(stderr, "usage:\n"); + SLIST_FOREACH(walker, &t->subcmd, link) { + print_usage(walker); + } + exit(1); +} + +int +cmd_dispatch(int argc, char *argv[], const struct cmd *t) +{ + struct cmd *walker; + + if (t == NULL) + t = ⊤ + + if (argv[1] == NULL) { + gen_usage(t); + return (1); + } + SLIST_FOREACH(walker, &t->subcmd, link) { + if (strcmp(argv[1], walker->name) == 0) { + walker->fn(walker, argc-1, &argv[1]); + return (0); + } + } + fprintf(stderr, "Unknown command: %s\n", argv[1]); + gen_usage(t); + return (1); +} + +static void +arg_suffix(char *buf, size_t len, arg_type at) +{ + switch (at) { + case arg_none: + break; + case arg_string: + strlcat(buf, "=", len); + break; + case arg_path: + strlcat(buf, "=", len); + break; + default: + strlcat(buf, "=", len); + break; + } +} + +void +arg_help(int argc __unused, char * const *argv, const struct cmd *f) +{ + int i; + char buf[31]; + const struct opts *opts = f->opts; + const struct args *args = f->args; + + // XXX walk up the cmd list... + if (argv[optind]) + fprintf(stderr, "Unknown argument: %s\n", argv[optind]); + fprintf(stderr, "Usage:\n %s %s", getprogname(), argv[0]); + if (opts) + fprintf(stderr, " "); + if (args) { + while (args->descr != NULL) { + fprintf(stderr, " %s", args->descr); + args++; + } + } + fprintf(stderr, "\n\n%s\n", f->descr); + if (opts != NULL) { + fprintf(stderr, "Options:\n"); + for (i = 0; opts[i].long_arg != NULL; i++) { + *buf = '\0'; + if (isprint(opts[i].short_arg)) { + snprintf(buf, sizeof(buf), " -%c, ", opts[i].short_arg); + } else { + strlcpy(buf, " ", sizeof(buf)); + } + strlcat(buf, "--", sizeof(buf)); + strlcat(buf, opts[i].long_arg, sizeof(buf)); + arg_suffix(buf, sizeof(buf), opts[i].at); + fprintf(stderr, "%-30.30s - %s\n", buf, opts[i].descr); + } + } + exit(1); +} + +static int +find_long(struct option *lopts, int ch) +{ + int i; + + for (i = 0; lopts[i].val != ch && lopts[i].name != NULL; i++) + continue; + return i; +} + +int +arg_parse(int argc, char * const * argv, const struct cmd *f) +{ + int i, n, idx, ch; + uint64_t v; + struct option *lopts; + char *shortopts, *p; + const struct opts *opts = f->opts; + const struct args *args = f->args; + + if (opts == NULL) + n = 0; + else + for (n = 0; opts[n].long_arg != NULL;) + n++; + lopts = malloc((n + 2) * sizeof(struct option)); + if (lopts == NULL) + err(1, "option memory"); + p = shortopts = malloc((n + 3) * sizeof(char)); + if (shortopts == NULL) + err(1, "shortopts memory"); + idx = 0; + for (i = 0; i < n; i++) { + lopts[i].name = opts[i].long_arg; + lopts[i].has_arg = opts[i].at == arg_none ? no_argument : required_argument; + lopts[i].flag = NULL; + lopts[i].val = opts[i].short_arg; + if (isprint(opts[i].short_arg)) { + *p++ = opts[i].short_arg; + if (lopts[i].has_arg) + *p++ = ':'; + } + } + lopts[n].name = "help"; + lopts[n].has_arg = no_argument; + lopts[n].flag = NULL; + lopts[n].val = '?'; + *p++ = '?'; + *p++ = '\0'; + memset(lopts + n + 1, 0, sizeof(struct option)); + while ((ch = getopt_long(argc, argv, shortopts, lopts, &idx)) != -1) { + /* + * If ch != 0, we've found a short option, and we have to + * look it up lopts table. Otherwise idx is valid. + */ + if (ch != 0) + idx = find_long(lopts, ch); + if (idx == n) + arg_help(argc, argv, f); + switch (opts[idx].at) { + case arg_none: + *(bool *)opts[idx].ptr = true; + break; + case arg_string: + case arg_path: + *(const char **)opts[idx].ptr = optarg; + break; + case arg_uint8: + v = strtoul(optarg, NULL, 0); + if (v > 0xff) + goto bad_arg; + *(uint8_t *)opts[idx].ptr = v; + break; + case arg_uint16: + v = strtoul(optarg, NULL, 0); + if (v > 0xffff) + goto bad_arg; + *(uint16_t *)opts[idx].ptr = v; + break; + case arg_uint32: + v = strtoul(optarg, NULL, 0); + if (v > 0xffffffffu) + goto bad_arg; + *(uint32_t *)opts[idx].ptr = v; + break; + case arg_uint64: + v = strtoul(optarg, NULL, 0); + if (v > 0xffffffffffffffffull) + goto bad_arg; + *(uint64_t *)opts[idx].ptr = v; + break; + case arg_size: + if (expand_number(optarg, &v) < 0) + goto bad_arg; + *(uint64_t *)opts[idx].ptr = v; + break; + } + } + if (args) { + while (args->descr) { + if (optind >= argc) { + fprintf(stderr, "Missing arg %s\n", args->descr); + arg_help(argc, argv, f); + return (1); + } + *(char **)args->ptr = argv[optind++]; + args++; + } + } + free(lopts); + return (0); +bad_arg: + fprintf(stderr, "Bad value to --%s: %s\n", opts[idx].long_arg, optarg); + free(lopts); + exit(1); +} + +/* + * Loads all the .so's from the specified directory. + */ +void +cmd_load_dir(const char *dir __unused, cmd_load_cb_t cb __unused, void *argp __unused) +{ + DIR *d; + struct dirent *dent; + char *path = NULL; + void *h; + + d = opendir(dir); + if (d == NULL) + return; + for (dent = readdir(d); dent != NULL; dent = readdir(d)) { + if (strcmp(".so", dent->d_name + dent->d_namlen - 3) != 0) + continue; + asprintf(&path, "%s/%s", dir, dent->d_name); + if (path == NULL) + err(1, "Can't malloc for path, giving up."); + if ((h = dlopen(path, RTLD_NOW | RTLD_GLOBAL)) == NULL) + warnx("Can't load %s: %s", path, dlerror()); + else { + if (cb != NULL) + cb(argp, h); + } + free(path); + path = NULL; + } + closedir(d); +} + +void +cmd_register(struct cmd *up, struct cmd *cmd) +{ + struct cmd *walker, *last; + + if (up == NULL) + up = ⊤ + SLIST_INIT(&cmd->subcmd); + cmd->parent = up; + last = NULL; + SLIST_FOREACH(walker, &up->subcmd, link) { + if (strcmp(walker->name, cmd->name) > 0) + break; + last = walker; + } + if (last == NULL) { + SLIST_INSERT_HEAD(&up->subcmd, cmd, link); + } else { + SLIST_INSERT_AFTER(last, cmd, link); + } +} + +void +cmd_init(void) +{ + +} Added: head/sbin/nvmecontrol/comnd.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/nvmecontrol/comnd.h Tue Jul 16 17:24:03 2019 (r350057) @@ -0,0 +1,102 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 Netflix, Inc + * + * 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 COMND_H +#define COMND_H + +#include +#include + +/* + * Regularized parsing of simple arguments built on top of getopt_long. + */ + +typedef enum arg_type { + arg_none = 0, + arg_uint8, + arg_uint16, + arg_uint32, + arg_uint64, + arg_size, + arg_string, + arg_path, +} arg_type; + +// XXX need to change to offsetof for opts and args. +// we then need to allocate ctx and pass that into the cmd +// stuff. this will be a little tricky and we may need to expand +// arg_type stuff. + +struct opts { + const char *long_arg; + int short_arg; + arg_type at; + void *ptr; // XXXX change to offset of + const char *descr; +}; + +// XXX TDB: subcommand vs actual argument. maybe with subcmd? +// XXX TBD: do we need parsing callback functions? +struct args { + arg_type at; + void *ptr; // XXXX change to offset of + const char *descr; +}; + +typedef void (cmd_load_cb_t)(void *, void *); +struct cmd; +typedef void (cmd_fn_t)(const struct cmd *nf, int argc, char *argv[]); + +struct cmd { + SLIST_ENTRY(cmd) link; + const char *name; + cmd_fn_t *fn; + size_t ctx_size; + const struct opts *opts; + const struct args *args; + const char *descr; + SLIST_HEAD(,cmd) subcmd; + struct cmd *parent; +}; + +void cmd_register(struct cmd *, struct cmd *); +#define CMD_COMMAND(c) \ + static void cmd_register_##c(void) __attribute__((constructor)); \ + static void cmd_register_##c(void) { cmd_register(NULL, &c); } +#define CMD_SUBCOMMAND(c,sc) \ + static void cmd_register_##c_##sc(void) __attribute__((constructor)); \ + static void cmd_register_##c_##sc(void) { cmd_register(&c, &sc); } + +int arg_parse(int argc, char * const *argv, const struct cmd *f); +void arg_help(int argc, char * const *argv, const struct cmd *f); +void cmd_init(void); +void cmd_load_dir(const char *dir, cmd_load_cb_t *cb, void *argp); +int cmd_dispatch(int argc, char *argv[], const struct cmd *); + +#endif /* COMND_H */ Modified: head/sbin/nvmecontrol/devlist.c ============================================================================== --- head/sbin/nvmecontrol/devlist.c Tue Jul 16 16:49:11 2019 (r350056) +++ head/sbin/nvmecontrol/devlist.c Tue Jul 16 17:24:03 2019 (r350057) @@ -42,12 +42,24 @@ __FBSDID("$FreeBSD$"); #include #include "nvmecontrol.h" +#include "comnd.h" -#define DEVLIST_USAGE \ - "devlist\n" +/* Tables for command line parsing */ #define NVME_MAX_UNIT 256 +static cmd_fn_t devlist; + +static struct cmd devlist_cmd = { + .name = "devlist", + .fn = devlist, + .descr = "Display a list of NVMe controllers and namespaces." +}; + +CMD_COMMAND(devlist_cmd); + +/* End of tables for command line parsing */ + static inline uint32_t ns_get_sector_size(struct nvme_namespace_data *nsdata) { @@ -62,21 +74,17 @@ ns_get_sector_size(struct nvme_namespace_data *nsdata) } static void -devlist(const struct nvme_function *nf, int argc, char *argv[]) +devlist(const struct cmd *f, int argc, char *argv[]) { struct nvme_controller_data cdata; struct nvme_namespace_data nsdata; char name[64]; uint8_t mn[64]; uint32_t i; - int ch, ctrlr, fd, found, ret; + int ctrlr, fd, found, ret; - while ((ch = getopt(argc, argv, "")) != -1) { - switch ((char)ch) { - default: - usage(nf); - } - } + if (arg_parse(argc, argv, f)) + return; ctrlr = -1; found = 0; @@ -119,5 +127,3 @@ devlist(const struct nvme_function *nf, int argc, char exit(1); } - -NVME_COMMAND(top, devlist, devlist, DEVLIST_USAGE); Modified: head/sbin/nvmecontrol/firmware.c ============================================================================== --- head/sbin/nvmecontrol/firmware.c Tue Jul 16 16:49:11 2019 (r350056) +++ head/sbin/nvmecontrol/firmware.c Tue Jul 16 17:24:03 2019 (r350057) @@ -50,9 +50,53 @@ __FBSDID("$FreeBSD$"); #include "nvmecontrol.h" -#define FIRMWARE_USAGE \ - "firmware [-s slot] [-f path_to_firmware] [-a] \n" +/* Tables for command line parsing */ +static cmd_fn_t firmware; + +#define NONE 0xffffffffu +static struct options { + bool activate; + uint32_t slot; + const char *fw_img; + const char *dev; +} opt = { + .activate = false, + .slot = NONE, + .fw_img = NULL, + .dev = NULL, +}; + +static const struct opts firmware_opts[] = { +#define OPT(l, s, t, opt, addr, desc) { l, s, t, &opt.addr, desc } + OPT("activate", 'a', arg_none, opt, activate, + "Attempt to activate firmware"), + OPT("slot", 's', arg_uint32, opt, slot, + "Slot to activate and/or download firmware to"), + OPT("firmware", 'f', arg_path, opt, fw_img, + "Firmware image to download"), + { NULL, 0, arg_none, NULL, NULL } +}; +#undef OPT + +static const struct args firmware_args[] = { + { arg_string, &opt.dev, "controller-id" }, + { arg_none, NULL, NULL }, +}; + +static struct cmd firmware_cmd = { + .name = "firmware", + .fn = firmware, + .descr = "Download firmware image to controller.", + .ctx_size = sizeof(opt), + .opts = firmware_opts, + .args = firmware_args, +}; + +CMD_COMMAND(firmware_cmd); + +/* End of tables for command line parsing */ + static int slot_has_valid_firmware(int fd, int slot) { @@ -69,7 +113,7 @@ slot_has_valid_firmware(int fd, int slot) } static void -read_image_file(char *path, void **buf, int32_t *size) +read_image_file(const char *path, void **buf, int32_t *size) { struct stat sb; int32_t filesize; @@ -174,74 +218,52 @@ activate_firmware(int fd, int slot, int activate_actio } static void -firmware(const struct nvme_function *nf, int argc, char *argv[]) +firmware(const struct cmd *f, int argc, char *argv[]) { - int fd = -1, slot = 0; - int a_flag, f_flag; + int fd = -1; int activate_action, reboot_required; - int opt; - char *p, *image = NULL; - char *controller = NULL, prompt[64]; + char prompt[64]; void *buf = NULL; int32_t size = 0; uint16_t oacs_fw; uint8_t fw_slot1_ro, fw_num_slots; struct nvme_controller_data cdata; - a_flag = f_flag = false; + if (arg_parse(argc, argv, f)) + return; - while ((opt = getopt(argc, argv, "af:s:")) != -1) { - switch (opt) { - case 'a': - a_flag = true; - break; - case 's': - slot = strtol(optarg, &p, 0); - if (p != NULL && *p != '\0') { - fprintf(stderr, - "\"%s\" not valid slot.\n", - optarg); - usage(nf); - } else if (slot == 0) { - fprintf(stderr, - "0 is not a valid slot number. " - "Slot numbers start at 1.\n"); - usage(nf); - } else if (slot > 7) { - fprintf(stderr, - "Slot number %s specified which is " - "greater than max allowed slot number of " - "7.\n", optarg); - usage(nf); - } - break; - case 'f': - image = optarg; - f_flag = true; - break; - } + if (opt.slot == 0) { + fprintf(stderr, + "0 is not a valid slot number. " + "Slot numbers start at 1.\n"); + arg_help(argc, argv, f); + } else if (opt.slot > 7 && opt.slot != NONE) { + fprintf(stderr, + "Slot number %s specified which is " + "greater than max allowed slot number of " + "7.\n", optarg); + arg_help(argc, argv, f); } - /* Check that a controller (and not a namespace) was specified. */ - if (optind >= argc || strstr(argv[optind], NVME_NS_PREFIX) != NULL) - usage(nf); - - if (!f_flag && !a_flag) { + if (!opt.activate && opt.fw_img == NULL) { fprintf(stderr, "Neither a replace ([-f path_to_firmware]) nor " "activate ([-a]) firmware image action\n" "was specified.\n"); - usage(nf); + arg_help(argc, argv, f); } - if (!f_flag && a_flag && slot == 0) { + /* Check that a controller (and not a namespace) was specified. */ + if (strstr(opt.dev, NVME_NS_PREFIX) != NULL) + arg_help(argc, argv, f); + + if (opt.activate && opt.fw_img == NULL && opt.slot == 0) { fprintf(stderr, "Slot number to activate not specified.\n"); - usage(nf); + arg_help(argc, argv, f); } - controller = argv[optind]; - open_dev(controller, &fd, 1, 1); + open_dev(opt.dev, &fd, 1, 1); read_controller_data(fd, &cdata); oacs_fw = (cdata.oacs >> NVME_CTRLR_DATA_OACS_FIRMWARE_SHIFT) & @@ -254,44 +276,45 @@ firmware(const struct nvme_function *nf, int argc, cha fw_slot1_ro = (cdata.frmw >> NVME_CTRLR_DATA_FRMW_SLOT1_RO_SHIFT) & NVME_CTRLR_DATA_FRMW_SLOT1_RO_MASK; - if (f_flag && slot == 1 && fw_slot1_ro) - errx(1, "slot %d is marked as read only", slot); + if (opt.fw_img && opt.slot == 1 && fw_slot1_ro) + errx(1, "slot %d is marked as read only", opt.slot); fw_num_slots = (cdata.frmw >> NVME_CTRLR_DATA_FRMW_NUM_SLOTS_SHIFT) & NVME_CTRLR_DATA_FRMW_NUM_SLOTS_MASK; - if (slot > fw_num_slots) + if (opt.slot > fw_num_slots) errx(1, "slot %d specified but controller only supports %d slots", - slot, fw_num_slots); + opt.slot, fw_num_slots); - if (a_flag && !f_flag && !slot_has_valid_firmware(fd, slot)) + if (opt.activate && opt.fw_img == NULL && + !slot_has_valid_firmware(fd, opt.slot)) errx(1, "slot %d does not contain valid firmware,\n" "try 'nvmecontrol logpage -p 3 %s' to get a list " "of available images\n", - slot, controller); + opt.slot, opt.dev); - if (f_flag) - read_image_file(image, &buf, &size); + if (opt.fw_img) + read_image_file(opt.fw_img, &buf, &size); - if (f_flag && a_flag) + if (opt.fw_img != NULL&& opt.activate) printf("You are about to download and activate " "firmware image (%s) to controller %s.\n" "This may damage your controller and/or " "overwrite an existing firmware image.\n", - image, controller); - else if (a_flag) + opt.fw_img, opt.dev); + else if (opt.activate) printf("You are about to activate a new firmware " "image on controller %s.\n" "This may damage your controller.\n", - controller); - else if (f_flag) + opt.dev); + else if (opt.fw_img != NULL) printf("You are about to download firmware image " "(%s) to controller %s.\n" "This may damage your controller and/or " "overwrite an existing firmware image.\n", - image, controller); + opt.fw_img, opt.dev); printf("Are you sure you want to continue? (yes/no) "); while (1) { @@ -303,9 +326,9 @@ firmware(const struct nvme_function *nf, int argc, cha printf("Please answer \"yes\" or \"no\". "); } - if (f_flag) { + if (opt.fw_img != NULL) { update_firmware(fd, buf, size); - if (a_flag) + if (opt.activate) activate_action = NVME_AA_REPLACE_ACTIVATE; else activate_action = NVME_AA_REPLACE_NO_ACTIVATE; @@ -313,9 +336,9 @@ firmware(const struct nvme_function *nf, int argc, cha activate_action = NVME_AA_ACTIVATE; } - reboot_required = activate_firmware(fd, slot, activate_action); + reboot_required = activate_firmware(fd, opt.slot, activate_action); - if (a_flag) { + if (opt.activate) { if (reboot_required) { printf("New firmware image activated but requires " "conventional reset (i.e. reboot) to " @@ -325,12 +348,10 @@ firmware(const struct nvme_function *nf, int argc, cha "effect after next controller reset.\n" "Controller reset can be initiated via " "'nvmecontrol reset %s'\n", - controller); + opt.dev); } } close(fd); exit(0); } - -NVME_COMMAND(top, firmware, firmware, FIRMWARE_USAGE); Modified: head/sbin/nvmecontrol/format.c ============================================================================== --- head/sbin/nvmecontrol/format.c Tue Jul 16 16:49:11 2019 (r350056) +++ head/sbin/nvmecontrol/format.c Tue Jul 16 17:24:03 2019 (r350057) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -43,57 +44,104 @@ __FBSDID("$FreeBSD$"); #include "nvmecontrol.h" -#define FORMAT_USAGE \ - "format [-f fmt] [-m mset] [-p pi] [-l pil] [-E] [-C] \n" +#define NONE 0xffffffffu +#define SES_NONE 0 +#define SES_USER 1 +#define SES_CRYPTO 2 +/* Tables for command line parsing */ + +static cmd_fn_t format; + +static struct options { + uint32_t lbaf; + uint32_t ms; + uint32_t pi; + uint32_t pil; + uint32_t ses; + bool Eflag; + bool Cflag; + const char *dev; +} opt = { + .lbaf = NONE, + .ms = NONE, + .pi = NONE, + .pil = NONE, + .ses = SES_NONE, + .Eflag = false, + .Cflag = false, + .dev = NULL, +}; + +static const struct opts format_opts[] = { +#define OPT(l, s, t, opt, addr, desc) { l, s, t, &opt.addr, desc } + OPT("crypto", 'C', arg_none, opt, Cflag, + "Crptographically erase user data by forgetting key"), + OPT("erase", 'E', arg_none, opt, Eflag, + "Erase user data"), + OPT("lbaf", 'f', arg_uint32, opt, lbaf, + "Set the LBA Format to apply to the media"), + OPT("ms", 'm', arg_uint32, opt, ms, + "Slot to activate and/or download format to"), + OPT("pi", 'p', arg_uint32, opt, pi, + "Slot to activate and/or download format to"), + OPT("pil", 'l', arg_uint32, opt, pil, + "Slot to activate and/or download format to"), + OPT("ses", 's', arg_uint32, opt, ses, + "Slot to activate and/or download format to"), + { NULL, 0, arg_none, NULL, NULL } +}; +#undef OPT + +static const struct args format_args[] = { + { arg_string, &opt.dev, "controller-id|namespace-id" }, + { arg_none, NULL, NULL }, +}; + +static struct cmd format_cmd = { + .name = "format", + .fn = format, + .descr = "Format/erase one or all the namespaces.", + .ctx_size = sizeof(opt), + .opts = format_opts, + .args = format_args, +}; + +CMD_COMMAND(format_cmd); + +/* End of tables for command line parsing */ + static void -format(const struct nvme_function *nf, int argc, char *argv[]) +format(const struct cmd *f, int argc, char *argv[]) { struct nvme_controller_data cd; struct nvme_namespace_data nsd; struct nvme_pt_command pt; char path[64]; - char *target; + const char *target; uint32_t nsid; - int ch, fd; - int lbaf = -1, mset = -1, pi = -1, pil = -1, ses = 0; + int lbaf, ms, pi, pil, ses, fd; - if (argc < 2) - usage(nf); + if (arg_parse(argc, argv, f)) + return; - while ((ch = getopt(argc, argv, "f:m:p:l:EC")) != -1) { - switch ((char)ch) { - case 'f': - lbaf = strtol(optarg, NULL, 0); - break; - case 'm': - mset = strtol(optarg, NULL, 0); - break; - case 'p': - pi = strtol(optarg, NULL, 0); - break; - case 'l': - pil = strtol(optarg, NULL, 0); - break; - case 'E': - if (ses == 2) - errx(1, "-E and -C are mutually exclusive"); - ses = 1; - break; - case 'C': - if (ses == 1) - errx(1, "-E and -C are mutually exclusive"); - ses = 2; - break; - default: - usage(nf); - } + if (opt.Eflag || opt.Cflag || opt.ses != SES_NONE) { + fprintf(stderr, + "Only one of -E, -C or -s may be specified\n"); + arg_help(argc, argv, f); } - /* Check that a controller or namespace was specified. */ - if (optind >= argc) - usage(nf); - target = argv[optind]; + target = opt.dev; + lbaf = opt.lbaf; + ms = opt.ms; + pi = opt.pi; + pil = opt.pil; + if (opt.Eflag) + ses = SES_USER; + else if (opt.Cflag) + ses = SES_CRYPTO; + else + ses = opt.ses; /* * Check if the specified device node exists before continuing. @@ -126,15 +174,15 @@ format(const struct nvme_function *nf, int argc, char NVME_CTRLR_DATA_OACS_FORMAT_MASK) == 0) errx(1, "controller does not support format"); if (((cd.fna >> NVME_CTRLR_DATA_FNA_CRYPTO_ERASE_SHIFT) & - NVME_CTRLR_DATA_FNA_CRYPTO_ERASE_MASK) == 0 && ses == 2) + NVME_CTRLR_DATA_FNA_CRYPTO_ERASE_MASK) == 0 && ses == SES_CRYPTO) errx(1, "controller does not support cryptographic erase"); if (nsid != NVME_GLOBAL_NAMESPACE_TAG) { if (((cd.fna >> NVME_CTRLR_DATA_FNA_FORMAT_ALL_SHIFT) & - NVME_CTRLR_DATA_FNA_FORMAT_ALL_MASK) && ses == 0) + NVME_CTRLR_DATA_FNA_FORMAT_ALL_MASK) && ses == SES_NONE) errx(1, "controller does not support per-NS format"); if (((cd.fna >> NVME_CTRLR_DATA_FNA_ERASE_ALL_SHIFT) & - NVME_CTRLR_DATA_FNA_ERASE_ALL_MASK) && ses != 0) + NVME_CTRLR_DATA_FNA_ERASE_ALL_MASK) && ses != SES_NONE) errx(1, "controller does not support per-NS erase"); /* Try to keep previous namespace parameters. */ @@ -144,8 +192,8 @@ format(const struct nvme_function *nf, int argc, char & NVME_NS_DATA_FLBAS_FORMAT_MASK; if (lbaf > nsd.nlbaf) errx(1, "LBA format is out of range"); - if (mset < 0) - mset = (nsd.flbas >> NVME_NS_DATA_FLBAS_EXTENDED_SHIFT) + if (ms < 0) + ms = (nsd.flbas >> NVME_NS_DATA_FLBAS_EXTENDED_SHIFT) & NVME_NS_DATA_FLBAS_EXTENDED_MASK; if (pi < 0) pi = (nsd.dps >> NVME_NS_DATA_DPS_MD_START_SHIFT) @@ -158,8 +206,8 @@ format(const struct nvme_function *nf, int argc, char /* We have no previous parameters, so default to zeroes. */ if (lbaf < 0) lbaf = 0; - if (mset < 0) - mset = 0; + if (ms < 0) + ms = 0; if (pi < 0) pi = 0; if (pil < 0) @@ -170,7 +218,7 @@ format(const struct nvme_function *nf, int argc, char pt.cmd.opc = NVME_OPC_FORMAT_NVM; pt.cmd.nsid = htole32(nsid); pt.cmd.cdw10 = htole32((ses << 9) + (pil << 8) + (pi << 5) + - (mset << 4) + lbaf); + (ms << 4) + lbaf); if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0) err(1, "format request failed"); @@ -180,5 +228,3 @@ format(const struct nvme_function *nf, int argc, char close(fd); exit(0); } - -NVME_COMMAND(top, format, format, FORMAT_USAGE); Modified: head/sbin/nvmecontrol/identify.c ============================================================================== --- head/sbin/nvmecontrol/identify.c Tue Jul 16 16:49:11 2019 (r350056) +++ head/sbin/nvmecontrol/identify.c Tue Jul 16 17:24:03 2019 (r350057) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -43,8 +44,15 @@ __FBSDID("$FreeBSD$"); #include "nvmecontrol.h" *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Jul 16 17:24:26 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C53C8B5882; Tue, 16 Jul 2019 17:24:26 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A6DD16AAF8; Tue, 16 Jul 2019 17:24:26 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7FFBB9445; Tue, 16 Jul 2019 17:24:26 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6GHOQsG070347; Tue, 16 Jul 2019 17:24:26 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6GHOQ5f070346; Tue, 16 Jul 2019 17:24:26 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201907161724.x6GHOQ5f070346@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 16 Jul 2019 17:24:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350058 - head/sbin/nvmecontrol X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sbin/nvmecontrol X-SVN-Commit-Revision: 350058 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A6DD16AAF8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jul 2019 17:24:26 -0000 Author: imp Date: Tue Jul 16 17:24:25 2019 New Revision: 350058 URL: https://svnweb.freebsd.org/changeset/base/350058 Log: Implement {io,admin}-passthru commands. These are mostly compatible with Linux, with three exceptions. 1. We don't do metadata segment stuff. Our passthrough interface doesn't cope. The code is there, but generates an error. 2. Linux lets you specify a namespace ID for the command. We current do not: we get ours from the namespace device, or pass in a generic one. Generally, this will lead to the same command, but FreeBSD's is safer since you can't specify the wrong id. 3. --show-command outputs to stderr instead of stdout so you can both see your command, and capture its output with a simple redirect. Differential Revision: https://reviews.freebsd.org/D19296 Added: head/sbin/nvmecontrol/passthru.c (contents, props changed) Added: head/sbin/nvmecontrol/passthru.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/nvmecontrol/passthru.c Tue Jul 16 17:24:25 2019 (r350058) @@ -0,0 +1,273 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (C) 2012-2013 Intel Corporation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 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 "nvmecontrol.h" +#include "comnd.h" + +static struct options { + uint8_t opcode; + uint8_t flags; + uint16_t rsvd; + uint32_t nsid; + uint32_t data_len; + uint32_t metadata_len; + uint32_t timeout; + uint32_t cdw2; + uint32_t cdw3; + uint32_t cdw10; + uint32_t cdw11; + uint32_t cdw12; + uint32_t cdw13; + uint32_t cdw14; + uint32_t cdw15; + const char *ifn; + bool binary; + bool show_command; + bool dry_run; + bool read; + bool write; + uint8_t prefill; + const char *dev; +} opt = { + .binary = false, + .cdw10 = 0, + .cdw11 = 0, + .cdw12 = 0, + .cdw13 = 0, + .cdw14 = 0, + .cdw15 = 0, + .cdw2 = 0, + .cdw3 = 0, + .data_len = 0, + .dry_run = false, + .flags = 0, + .ifn = "", + .metadata_len = 0, + .nsid = 0, + .opcode = 0, + .prefill = 0, + .read = false, + .rsvd = 0, + .show_command = false, + .timeout = 0, + .write = false, + .dev = NULL, +}; + +/* + * Argument names and short names selected to match the nvme-cli program + * so vendor-siupplied formulas work out of the box on FreeBSD with a simple + * s/nvme/nvmecontrol/. + */ +#define ARG(l, s, t, opt, addr, desc) { l, s, t, &opt.addr, desc } + +static const struct opts opts[] = { + ARG("opcode", 'o', arg_uint8, opt, opcode, + "NVMe command opcode (required)"), + ARG("cdw2", '2', arg_uint32, opt, cdw2, + "Command dword 2 value"), + ARG("cdw3", '3', arg_uint32, opt, cdw3, + "Command dword 3 value"), + ARG("cdw10", '4', arg_uint32, opt, cdw10, + "Command dword 10 value"), + ARG("cdw11", '5', arg_uint32, opt, cdw11, + "Command dword 11 value"), + ARG("cdw12", '6', arg_uint32, opt, cdw12, + "Command dword 12 value"), + ARG("cdw13", '7', arg_uint32, opt, cdw13, + "Command dword 13 value"), + ARG("cdw14", '8', arg_uint32, opt, cdw14, + "Command dword 14 value"), + ARG("cdw15", '9', arg_uint32, opt, cdw15, + "Command dword 15 value"), + ARG("data-len", 'l', arg_uint32, opt, data_len, + "Length of data for I/O (bytes)"), + ARG("metadata-len", 'm', arg_uint32, opt, metadata_len, + "Length of metadata segment (bytes) (igored)"), + ARG("flags", 'f', arg_uint8, opt, flags, + "NVMe command flags"), + ARG("input-file", 'i', arg_path, opt, ifn, + "Input file to send (default stdin)"), + ARG("namespace-id", 'n', arg_uint32, opt, nsid, + "Namespace id (ignored on FreeBSD)"), + ARG("prefill", 'p', arg_uint8, opt, prefill, + "Value to prefill payload with"), + ARG("rsvd", 'R', arg_uint16, opt, rsvd, + "Reserved field value"), + ARG("timeout", 't', arg_uint32, opt, timeout, + "Command timeout (ms)"), + ARG("raw-binary", 'b', arg_none, opt, binary, + "Output in binary format"), + ARG("dry-run", 'd', arg_none, opt, dry_run, + "Don't actually execute the command"), + ARG("read", 'r', arg_none, opt, read, + "Command reads data from device"), + ARG("show-command", 's', arg_none, opt, show_command, + "Show all the command values on stdout"), + ARG("write", 'w', arg_none, opt, write, + "Command writes data to device"), + { NULL, 0, arg_none, NULL, NULL } +}; + +static const struct args args[] = { + { arg_string, &opt.dev, "controller-id|namespace-id" }, + { arg_none, NULL, NULL }, +}; + +static void +passthru(const struct cmd *f, int argc, char *argv[]) +{ + int fd = -1, ifd = -1; + void *data = NULL, *metadata = NULL; + struct nvme_pt_command pt; + + arg_parse(argc, argv, f); + open_dev(argv[optind], &fd, 1, 1); + + if (opt.read && opt.write) + errx(1, "need exactly one of --read or --write"); + if (opt.data_len != 0 && !opt.read && !opt.write) + errx(1, "need exactly one of --read or --write"); + if (*opt.ifn && (ifd = open(opt.ifn, O_RDONLY)) == -1) { + warn("open %s", opt.ifn); + goto cleanup; + } +#if notyet /* No support in kernel for this */ + if (opt.metadata_len != 0) { + if (posix_memalign(&metadata, getpagesize(), opt.metadata_len)) { + warn("can't allocate %d bytes for metadata", metadata_len); + goto cleanup; + } + } +#else + if (opt.metadata_len != 0) + errx(1, "metadata not supported on FreeBSD"); +#endif + if (opt.data_len) { + if (posix_memalign(&data, getpagesize(), opt.data_len)) { + warn("can't allocate %d bytes for data", opt.data_len); + goto cleanup; + } + memset(data, opt.prefill, opt.data_len); + if (opt.write && read(ifd, data, opt.data_len) < 0) { + warn("read %s", *opt.ifn ? opt.ifn : "stdin"); + goto cleanup; + } + } + if (opt.show_command) { + fprintf(stderr, "opcode : %#02x\n", opt.opcode); + fprintf(stderr, "flags : %#02x\n", opt.flags); + fprintf(stderr, "rsvd1 : %#04x\n", opt.rsvd); + fprintf(stderr, "nsid : %#04x\n", opt.nsid); + fprintf(stderr, "cdw2 : %#08x\n", opt.cdw2); + fprintf(stderr, "cdw3 : %#08x\n", opt.cdw3); + fprintf(stderr, "data_len : %#08x\n", opt.data_len); + fprintf(stderr, "metadata_len : %#08x\n", opt.metadata_len); + fprintf(stderr, "data : %p\n", data); + fprintf(stderr, "metadata : %p\n", metadata); + fprintf(stderr, "cdw10 : %#08x\n", opt.cdw10); + fprintf(stderr, "cdw11 : %#08x\n", opt.cdw11); + fprintf(stderr, "cdw12 : %#08x\n", opt.cdw12); + fprintf(stderr, "cdw13 : %#08x\n", opt.cdw13); + fprintf(stderr, "cdw14 : %#08x\n", opt.cdw14); + fprintf(stderr, "cdw15 : %#08x\n", opt.cdw15); + fprintf(stderr, "timeout_ms : %d\n", opt.timeout); + } + if (opt.dry_run) { + errno = 0; + warn("Doing a dry-run, no actual I/O"); + goto cleanup; + } + + memset(&pt, 0, sizeof(pt)); + pt.cmd.opc = opt.opcode; + pt.cmd.fuse = opt.flags; + pt.cmd.cid = htole16(opt.rsvd); + pt.cmd.nsid = opt.nsid; /* XXX note: kernel overrides this */ + pt.cmd.rsvd2 = htole32(opt.cdw2); + pt.cmd.rsvd3 = htole32(opt.cdw3); + pt.cmd.cdw10 = htole32(opt.cdw10); + pt.cmd.cdw11 = htole32(opt.cdw11); + pt.cmd.cdw12 = htole32(opt.cdw12); + pt.cmd.cdw13 = htole32(opt.cdw13); + pt.cmd.cdw14 = htole32(opt.cdw14); + pt.cmd.cdw15 = htole32(opt.cdw15); + pt.buf = data; + pt.len = opt.data_len; + pt.is_read = opt.read; + + errno = 0; + if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0) + err(1, "passthrough request failed"); + /* XXX report status */ + if (opt.read) { + if (opt.binary) + write(STDOUT_FILENO, data, opt.data_len); + else { + /* print status here */ + print_hex(data, opt.data_len); + } + } +cleanup: + if (errno) + exit(1); +} + +static void +admin_passthru(const struct cmd *nf, int argc, char *argv[]) +{ + + passthru(nf, argc, argv); +} + +static void +io_passthru(const struct cmd *nf, int argc, char *argv[]) +{ + + passthru(nf, argc, argv); +} + +CMD_COMMAND(top, admin-passthru, admin_passthru, sizeof(struct options), opts, args, + "Send a pass through Admin command to the specified device"); +CMD_COMMAND(top, io-passthru, io_passthru, sizeof(struct options), opts, args, + "Send a pass through I/O command to the specified device"); From owner-svn-src-all@freebsd.org Tue Jul 16 17:27:52 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7D222B59D3; Tue, 16 Jul 2019 17:27:52 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6149A6ADAF; Tue, 16 Jul 2019 17:27:52 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3AB799451; Tue, 16 Jul 2019 17:27:52 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6GHRqYG070709; Tue, 16 Jul 2019 17:27:52 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6GHRqnu070708; Tue, 16 Jul 2019 17:27:52 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201907161727.x6GHRqnu070708@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Tue, 16 Jul 2019 17:27:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350059 - stable/12/usr.bin/calendar/calendars X-SVN-Group: stable-12 X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: stable/12/usr.bin/calendar/calendars X-SVN-Commit-Revision: 350059 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6149A6ADAF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jul 2019 17:27:52 -0000 Author: vmaffione Date: Tue Jul 16 17:27:51 2019 New Revision: 350059 URL: https://svnweb.freebsd.org/changeset/base/350059 Log: MFC r349869 update calendar.freebsd Modified: stable/12/usr.bin/calendar/calendars/calendar.freebsd Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- stable/12/usr.bin/calendar/calendars/calendar.freebsd Tue Jul 16 17:24:25 2019 (r350058) +++ stable/12/usr.bin/calendar/calendars/calendar.freebsd Tue Jul 16 17:27:51 2019 (r350059) @@ -378,7 +378,6 @@ 10/05 Hiroki Sato born in Yamagata, Japan, 1977 10/05 Chris Costello born in Houston, Texas, United States, 1985 10/09 Stefan Walter born in Werne, Nordrhein-Westfalen, Germany, 1978 -10/09 Vincenzo Maffione born in Foggia, Italy, 1988 10/11 Rick Macklem born in Ontario, Canada, 1955 10/12 Pawel Jakub Dawidek born in Radzyn Podlaski, Poland, 1980 10/15 Maxim Konovalov born in Khabarovsk, USSR, 1973 From owner-svn-src-all@freebsd.org Tue Jul 16 17:29:43 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 50169B5A55; Tue, 16 Jul 2019 17:29:43 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) 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 F17296AF43; Tue, 16 Jul 2019 17:29:41 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-pl1-f172.google.com with SMTP id ay6so10457413plb.9; Tue, 16 Jul 2019 10:29:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:openpgp:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=ILUKmuyGxUPugrs/o1tpBIgPvmnGMoJ+ulG97kAsQXM=; b=TszS6pHGyOVedQXFxmJ9CPxvRxqz38GgmxM4bOuMesFA7FKdBuFIW5MeAxSjjfGXiK JF/YW+hu1gcIwuV+hdA0Ecwpr3XTwZO1X9R3/zrFiFfZw6egkrA3FFaCvS56d7ggvNK3 qEAuNWrhI6LVqoSXu6sizlWYulTh7jGKJ+rOSFU+2DeiiMEijbL6aIWuAfZAn+JFdw5G sMnsLTj60PnFr83vNO48TnIojCQHgMDUN+pCtCKBLlKj4H3d1y7FDrRBESNfYxjVLh1U xQhRy/cyCM38pMpqU0ZBWKa1ztsh8yUIuId9dLWbZWWB1Vh+8AxA1ZP6dMefEoFiPqZm J0AA== X-Gm-Message-State: APjAAAWiMY2QF/u4kQhlViJUG5MSY3tzvYY2jBHc09/ETSWUJTTdlYMf pwWRlFG7eRugeVxU+EgZM/O6XWmC X-Google-Smtp-Source: APXvYqysIop7rmAhcY5ZScsgvJVVtjPehjlZfttfoTYFAcedPBwi6LfhkOmrngZ2OwvVygtSwHsGIQ== X-Received: by 2002:a17:902:2a6b:: with SMTP id i98mr34894775plb.75.1563294488323; Tue, 16 Jul 2019 09:28:08 -0700 (PDT) Received: from [192.168.1.36] (broadband-82-140-249-80.atc.tvcom.ru. [82.140.249.80]) by smtp.googlemail.com with ESMTPSA id b17sm23939827pgj.73.2019.07.16.09.28.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Jul 2019 09:28:07 -0700 (PDT) Subject: Re: svn commit: r350044 - in stable/12: share/man/man4 sys/dev/gpio To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org References: <201907161552.x6GFqlU5013936@repo.freebsd.org> From: Andriy Gapon Openpgp: preference=signencrypt Message-ID: <94d937ee-e121-8882-9859-7d477e18beb4@FreeBSD.org> Date: Tue, 16 Jul 2019 19:28:00 +0300 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <201907161552.x6GFqlU5013936@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: F17296AF43 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of agapon@gmail.com designates 209.85.214.172 as permitted sender) smtp.mailfrom=agapon@gmail.com X-Spamd-Result: default: False [-5.80 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; TO_DN_NONE(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.66)[-0.659,0]; FORGED_SENDER(0.30)[avg@FreeBSD.org,agapon@gmail.com]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[avg@FreeBSD.org,agapon@gmail.com]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_TLS_LAST(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[172.214.85.209.list.dnswl.org : 127.0.5.0]; IP_SCORE(-3.13)[ip: (-9.71), ipnet: 209.85.128.0/17(-3.46), asn: 15169(-2.45), country: US(-0.06)] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jul 2019 17:29:43 -0000 On 16/07/2019 18:52, Andriy Gapon wrote: > Author: avg > Date: Tue Jul 16 15:52:47 2019 > New Revision: 350044 > URL: https://svnweb.freebsd.org/changeset/base/350044 > > Log: > MFC r349460: gpiobus: provide a new hint, pin_list > > "pin_list" allows to specify child pins as a list of pin numbers. > Existing hint "pins" serves the same purpose but with a 32-bit wide bit > mask. One problem with that is that a controller can have more than 32 > pins. One example is amdgpio. Also, a list of numbers is a little bit > more human friendly than a matching bit mask. As a side note, it seems > that in FDT pins are typically specified by their numbers as well. > > This commit also adds accessors for instance variables (IVARs) that > define the child pins. My primary goal is to allow a child to be > configured programmatically rather than via hints (assuming that FDT is > not supported on a platform). Also, while a child should not care about > specific pin numbers that are allocated to it, it could be interested in > how many were actually assigned to it. > > While there, I removed "flags" instance variable. It was unused. This change (the "flags" removal, specifically) broke build on OFW platforms (powerpc). I am working on a fix, it should be trivial. > Modified: > stable/12/share/man/man4/gpio.4 > stable/12/sys/dev/gpio/gpiobus.c > stable/12/sys/dev/gpio/gpiobusvar.h > Directory Properties: > stable/12/ (props changed) -- Andriy Gapon From owner-svn-src-all@freebsd.org Tue Jul 16 17:36:44 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F2833B5DB1; Tue, 16 Jul 2019 17:36:44 +0000 (UTC) (envelope-from lwhsu.freebsd@gmail.com) Received: from mail-yb1-f193.google.com (mail-yb1-f193.google.com [209.85.219.193]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) 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 740076B7FB; Tue, 16 Jul 2019 17:36:44 +0000 (UTC) (envelope-from lwhsu.freebsd@gmail.com) Received: by mail-yb1-f193.google.com with SMTP id x188so3507087yba.8; Tue, 16 Jul 2019 10:36:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=B1aNIa7W6eoGSUR6iwo26GFNuUAnSGwcaGg5It/55Zc=; b=LlmS7PgF5vL6GyYTF7uUUevxDwAmB8Q4lfnDXtDCwzOtY4OOYaBQhPvW7uFDyUXXrO YHct75avQ91JjNSWraGldPd9zYdkCbckO9FZzfdt1vN+p+z6OZhSy58N/lx2CbFNdw7S xm9eg7WX8v3c9q6SLAe6yCkFlbiUDQxZW8JS6P2yGIsqGT/mbMIsvbtVZOkv/pEh0lnA Ym32FrjNYOQSyqWMlNSk62WyRn8xASNeno9r66+OeSLlRiwQ9ko8I0+o9+oTgBNryNQF 2PCvHEzbTjD0tuAP8DPxJxzkK5zI7hImQOcf5Mw5vmluExTSsSuZuy7hIpz/c4EXzfTZ MK/g== X-Gm-Message-State: APjAAAWjqWwokJeAmVbPNl/+Xg6u4r8iqzsIaYpXuSL1sG8NBxvwBS59 PVZZwHGPS8XijWAoEdKpbLGX4BML2JiDThgkK18tdCJb X-Google-Smtp-Source: APXvYqySJATmri3/iQZmKbWmsNiQoHWLvgzfpbI5Qg3ucp1AAn4CU/2y/rrEEXLy7ii4+lUWbwsFDvU7bg2G26toyxA= X-Received: by 2002:a25:1d42:: with SMTP id d63mr9364258ybd.405.1563298597899; Tue, 16 Jul 2019 10:36:37 -0700 (PDT) MIME-Version: 1.0 References: <201907161552.x6GFqlU5013936@repo.freebsd.org> <94d937ee-e121-8882-9859-7d477e18beb4@FreeBSD.org> In-Reply-To: <94d937ee-e121-8882-9859-7d477e18beb4@FreeBSD.org> From: Li-Wen Hsu Date: Wed, 17 Jul 2019 01:36:26 +0800 Message-ID: Subject: Re: svn commit: r350044 - in stable/12: share/man/man4 sys/dev/gpio To: Andriy Gapon Cc: src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 740076B7FB X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of lwhsufreebsd@gmail.com designates 209.85.219.193 as permitted sender) smtp.mailfrom=lwhsufreebsd@gmail.com X-Spamd-Result: default: False [-3.11 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.88)[-0.878,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[freebsd.org]; RCPT_COUNT_FIVE(0.00)[5]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCVD_TLS_LAST(0.00)[]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.03)[-0.029,0]; RCVD_IN_DNSWL_NONE(0.00)[193.219.85.209.list.dnswl.org : 127.0.5.0]; IP_SCORE(-1.19)[ipnet: 209.85.128.0/17(-3.45), asn: 15169(-2.45), country: US(-0.06)]; FORGED_SENDER(0.30)[lwhsu@freebsd.org,lwhsufreebsd@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[193.219.85.209.rep.mailspike.net : 127.0.0.17]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; TAGGED_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[lwhsu@freebsd.org,lwhsufreebsd@gmail.com]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jul 2019 17:36:45 -0000 On Wed, Jul 17, 2019 at 1:29 AM Andriy Gapon wrote: > > On 16/07/2019 18:52, Andriy Gapon wrote: > > Author: avg > > Date: Tue Jul 16 15:52:47 2019 > > New Revision: 350044 > > URL: https://svnweb.freebsd.org/changeset/base/350044 > > > > Log: > > MFC r349460: gpiobus: provide a new hint, pin_list > > > > "pin_list" allows to specify child pins as a list of pin numbers. > > Existing hint "pins" serves the same purpose but with a 32-bit wide bit > > mask. One problem with that is that a controller can have more than 32 > > pins. One example is amdgpio. Also, a list of numbers is a little bit > > more human friendly than a matching bit mask. As a side note, it seems > > that in FDT pins are typically specified by their numbers as well. > > > > This commit also adds accessors for instance variables (IVARs) that > > define the child pins. My primary goal is to allow a child to be > > configured programmatically rather than via hints (assuming that FDT is > > not supported on a platform). Also, while a child should not care about > > specific pin numbers that are allocated to it, it could be interested in > > how many were actually assigned to it. > > > > While there, I removed "flags" instance variable. It was unused. > > This change (the "flags" removal, specifically) broke build on OFW > platforms (powerpc). > I am working on a fix, it should be trivial. I've merged r349472 and it should be fine now. Best, Li-Wen From owner-svn-src-all@freebsd.org Tue Jul 16 17:39:59 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C0E73B5EB8; Tue, 16 Jul 2019 17:39:59 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A2ECB6BA40; Tue, 16 Jul 2019 17:39:59 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7E1399634; Tue, 16 Jul 2019 17:39:59 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6GHdxAM077185; Tue, 16 Jul 2019 17:39:59 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6GHdx0q077184; Tue, 16 Jul 2019 17:39:59 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201907161739.x6GHdx0q077184@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 16 Jul 2019 17:39:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350060 - in stable: 11/contrib/llvm/tools/lld/ELF 12/contrib/llvm/tools/lld/ELF X-SVN-Group: stable-12 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 11/contrib/llvm/tools/lld/ELF 12/contrib/llvm/tools/lld/ELF X-SVN-Commit-Revision: 350060 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A2ECB6BA40 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jul 2019 17:39:59 -0000 Author: dim Date: Tue Jul 16 17:39:58 2019 New Revision: 350060 URL: https://svnweb.freebsd.org/changeset/base/350060 Log: MFC r349971: Pull in r365760 from upstream lld trunk (by Fangrui Song): [ELF] Handle non-glob patterns before glob patterns in version scripts & fix a corner case of --dynamic-list This fixes PR38549, which is silently accepted by ld.bfd. This seems correct because it makes sense to let non-glob patterns take precedence over glob patterns. lld issues an error because `assignWildcardVersion(ver, VER_NDX_LOCAL);` is processed before `assignExactVersion(ver, v.id, v.name);`. Move all assignWildcardVersion() calls after assignExactVersion() calls to fix this. Also, move handleDynamicList() to the bottom. computeBinding() called by includeInDynsym() has this cryptic rule: if (versionId == VER_NDX_LOCAL && isDefined() && !isPreemptible) return STB_LOCAL; Before the change: * foo's version is set to VER_NDX_LOCAL due to `local: *` * handleDynamicList() is called - foo.computeBinding() is STB_LOCAL - foo.includeInDynsym() is false - foo.isPreemptible is not set (wrong) * foo's version is set to V1 After the change: * foo's version is set to VER_NDX_LOCAL due to `local: *` * foo's version is set to V1 * handleDynamicList() is called - foo.computeBinding() is STB_GLOBAL - foo.includeInDynsym() is true - foo.isPreemptible is set (correct) Reviewed By: ruiu Differential Revision: https://reviews.llvm.org/D64550 This makes it longer necessary to patch the version scripts for the samba ports, to avoid "duplicate symbol 'pdb_search_init' in version script" errors. PR: 230602 Modified: stable/12/contrib/llvm/tools/lld/ELF/SymbolTable.cpp stable/12/contrib/llvm/tools/lld/ELF/SymbolTable.h Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/contrib/llvm/tools/lld/ELF/SymbolTable.cpp stable/11/contrib/llvm/tools/lld/ELF/SymbolTable.h Directory Properties: stable/11/ (props changed) Modified: stable/12/contrib/llvm/tools/lld/ELF/SymbolTable.cpp ============================================================================== --- stable/12/contrib/llvm/tools/lld/ELF/SymbolTable.cpp Tue Jul 16 17:27:51 2019 (r350059) +++ stable/12/contrib/llvm/tools/lld/ELF/SymbolTable.cpp Tue Jul 16 17:39:58 2019 (r350060) @@ -654,20 +654,6 @@ std::vector SymbolTable::findAllByVersion(Sy return Res; } -// If there's only one anonymous version definition in a version -// script file, the script does not actually define any symbol version, -// but just specifies symbols visibilities. -void SymbolTable::handleAnonymousVersion() { - for (SymbolVersion &Ver : Config->VersionScriptGlobals) - assignExactVersion(Ver, VER_NDX_GLOBAL, "global"); - for (SymbolVersion &Ver : Config->VersionScriptGlobals) - assignWildcardVersion(Ver, VER_NDX_GLOBAL); - for (SymbolVersion &Ver : Config->VersionScriptLocals) - assignExactVersion(Ver, VER_NDX_LOCAL, "local"); - for (SymbolVersion &Ver : Config->VersionScriptLocals) - assignWildcardVersion(Ver, VER_NDX_LOCAL); -} - // Handles -dynamic-list. void SymbolTable::handleDynamicList() { for (SymbolVersion &Ver : Config->DynamicList) { @@ -731,23 +717,27 @@ void SymbolTable::assignWildcardVersion(SymbolVersion // This function processes version scripts by updating VersionId // member of symbols. +// If there's only one anonymous version definition in a version +// script file, the script does not actually define any symbol version, +// but just specifies symbols visibilities. void SymbolTable::scanVersionScript() { - // Handle edge cases first. - handleAnonymousVersion(); - handleDynamicList(); - - // Now we have version definitions, so we need to set version ids to symbols. - // Each version definition has a glob pattern, and all symbols that match - // with the pattern get that version. - // First, we assign versions to exact matching symbols, // i.e. version definitions not containing any glob meta-characters. + for (SymbolVersion &Ver : Config->VersionScriptGlobals) + assignExactVersion(Ver, VER_NDX_GLOBAL, "global"); + for (SymbolVersion &Ver : Config->VersionScriptLocals) + assignExactVersion(Ver, VER_NDX_LOCAL, "local"); for (VersionDefinition &V : Config->VersionDefinitions) for (SymbolVersion &Ver : V.Globals) assignExactVersion(Ver, V.Id, V.Name); // Next, we assign versions to fuzzy matching symbols, // i.e. version definitions containing glob meta-characters. + for (SymbolVersion &Ver : Config->VersionScriptGlobals) + assignWildcardVersion(Ver, VER_NDX_GLOBAL); + for (SymbolVersion &Ver : Config->VersionScriptLocals) + assignWildcardVersion(Ver, VER_NDX_LOCAL); + // Note that because the last match takes precedence over previous matches, // we iterate over the definitions in the reverse order. for (VersionDefinition &V : llvm::reverse(Config->VersionDefinitions)) @@ -759,6 +749,12 @@ void SymbolTable::scanVersionScript() { // Let them parse and update their names to exclude version suffix. for (Symbol *Sym : SymVector) Sym->parseSymbolVersion(); + + // isPreemptible is false at this point. To correctly compute the binding of a + // Defined (which is used by includeInDynsym()), we need to know if it is + // VER_NDX_LOCAL or not. If defaultSymbolVersion is VER_NDX_LOCAL, we should + // compute symbol versions before handling --dynamic-list. + handleDynamicList(); } template void SymbolTable::addFile(InputFile *); Modified: stable/12/contrib/llvm/tools/lld/ELF/SymbolTable.h ============================================================================== --- stable/12/contrib/llvm/tools/lld/ELF/SymbolTable.h Tue Jul 16 17:27:51 2019 (r350059) +++ stable/12/contrib/llvm/tools/lld/ELF/SymbolTable.h Tue Jul 16 17:39:58 2019 (r350060) @@ -90,7 +90,6 @@ class SymbolTable { (private) std::vector findAllByVersion(SymbolVersion Ver); llvm::StringMap> &getDemangledSyms(); - void handleAnonymousVersion(); void assignExactVersion(SymbolVersion Ver, uint16_t VersionId, StringRef VersionName); void assignWildcardVersion(SymbolVersion Ver, uint16_t VersionId); From owner-svn-src-all@freebsd.org Tue Jul 16 17:40:00 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 52526B5EC5; Tue, 16 Jul 2019 17:40:00 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 322B66BA43; Tue, 16 Jul 2019 17:40:00 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0D8359638; Tue, 16 Jul 2019 17:40:00 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6GHdxbZ077193; Tue, 16 Jul 2019 17:39:59 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6GHdxwV077192; Tue, 16 Jul 2019 17:39:59 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201907161739.x6GHdxwV077192@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 16 Jul 2019 17:39:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r350060 - in stable: 11/contrib/llvm/tools/lld/ELF 12/contrib/llvm/tools/lld/ELF X-SVN-Group: stable-11 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 11/contrib/llvm/tools/lld/ELF 12/contrib/llvm/tools/lld/ELF X-SVN-Commit-Revision: 350060 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 322B66BA43 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jul 2019 17:40:00 -0000 Author: dim Date: Tue Jul 16 17:39:58 2019 New Revision: 350060 URL: https://svnweb.freebsd.org/changeset/base/350060 Log: MFC r349971: Pull in r365760 from upstream lld trunk (by Fangrui Song): [ELF] Handle non-glob patterns before glob patterns in version scripts & fix a corner case of --dynamic-list This fixes PR38549, which is silently accepted by ld.bfd. This seems correct because it makes sense to let non-glob patterns take precedence over glob patterns. lld issues an error because `assignWildcardVersion(ver, VER_NDX_LOCAL);` is processed before `assignExactVersion(ver, v.id, v.name);`. Move all assignWildcardVersion() calls after assignExactVersion() calls to fix this. Also, move handleDynamicList() to the bottom. computeBinding() called by includeInDynsym() has this cryptic rule: if (versionId == VER_NDX_LOCAL && isDefined() && !isPreemptible) return STB_LOCAL; Before the change: * foo's version is set to VER_NDX_LOCAL due to `local: *` * handleDynamicList() is called - foo.computeBinding() is STB_LOCAL - foo.includeInDynsym() is false - foo.isPreemptible is not set (wrong) * foo's version is set to V1 After the change: * foo's version is set to VER_NDX_LOCAL due to `local: *` * foo's version is set to V1 * handleDynamicList() is called - foo.computeBinding() is STB_GLOBAL - foo.includeInDynsym() is true - foo.isPreemptible is set (correct) Reviewed By: ruiu Differential Revision: https://reviews.llvm.org/D64550 This makes it longer necessary to patch the version scripts for the samba ports, to avoid "duplicate symbol 'pdb_search_init' in version script" errors. PR: 230602 Modified: stable/11/contrib/llvm/tools/lld/ELF/SymbolTable.cpp stable/11/contrib/llvm/tools/lld/ELF/SymbolTable.h Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/contrib/llvm/tools/lld/ELF/SymbolTable.cpp stable/12/contrib/llvm/tools/lld/ELF/SymbolTable.h Directory Properties: stable/12/ (props changed) Modified: stable/11/contrib/llvm/tools/lld/ELF/SymbolTable.cpp ============================================================================== --- stable/11/contrib/llvm/tools/lld/ELF/SymbolTable.cpp Tue Jul 16 17:27:51 2019 (r350059) +++ stable/11/contrib/llvm/tools/lld/ELF/SymbolTable.cpp Tue Jul 16 17:39:58 2019 (r350060) @@ -654,20 +654,6 @@ std::vector SymbolTable::findAllByVersion(Sy return Res; } -// If there's only one anonymous version definition in a version -// script file, the script does not actually define any symbol version, -// but just specifies symbols visibilities. -void SymbolTable::handleAnonymousVersion() { - for (SymbolVersion &Ver : Config->VersionScriptGlobals) - assignExactVersion(Ver, VER_NDX_GLOBAL, "global"); - for (SymbolVersion &Ver : Config->VersionScriptGlobals) - assignWildcardVersion(Ver, VER_NDX_GLOBAL); - for (SymbolVersion &Ver : Config->VersionScriptLocals) - assignExactVersion(Ver, VER_NDX_LOCAL, "local"); - for (SymbolVersion &Ver : Config->VersionScriptLocals) - assignWildcardVersion(Ver, VER_NDX_LOCAL); -} - // Handles -dynamic-list. void SymbolTable::handleDynamicList() { for (SymbolVersion &Ver : Config->DynamicList) { @@ -731,23 +717,27 @@ void SymbolTable::assignWildcardVersion(SymbolVersion // This function processes version scripts by updating VersionId // member of symbols. +// If there's only one anonymous version definition in a version +// script file, the script does not actually define any symbol version, +// but just specifies symbols visibilities. void SymbolTable::scanVersionScript() { - // Handle edge cases first. - handleAnonymousVersion(); - handleDynamicList(); - - // Now we have version definitions, so we need to set version ids to symbols. - // Each version definition has a glob pattern, and all symbols that match - // with the pattern get that version. - // First, we assign versions to exact matching symbols, // i.e. version definitions not containing any glob meta-characters. + for (SymbolVersion &Ver : Config->VersionScriptGlobals) + assignExactVersion(Ver, VER_NDX_GLOBAL, "global"); + for (SymbolVersion &Ver : Config->VersionScriptLocals) + assignExactVersion(Ver, VER_NDX_LOCAL, "local"); for (VersionDefinition &V : Config->VersionDefinitions) for (SymbolVersion &Ver : V.Globals) assignExactVersion(Ver, V.Id, V.Name); // Next, we assign versions to fuzzy matching symbols, // i.e. version definitions containing glob meta-characters. + for (SymbolVersion &Ver : Config->VersionScriptGlobals) + assignWildcardVersion(Ver, VER_NDX_GLOBAL); + for (SymbolVersion &Ver : Config->VersionScriptLocals) + assignWildcardVersion(Ver, VER_NDX_LOCAL); + // Note that because the last match takes precedence over previous matches, // we iterate over the definitions in the reverse order. for (VersionDefinition &V : llvm::reverse(Config->VersionDefinitions)) @@ -759,6 +749,12 @@ void SymbolTable::scanVersionScript() { // Let them parse and update their names to exclude version suffix. for (Symbol *Sym : SymVector) Sym->parseSymbolVersion(); + + // isPreemptible is false at this point. To correctly compute the binding of a + // Defined (which is used by includeInDynsym()), we need to know if it is + // VER_NDX_LOCAL or not. If defaultSymbolVersion is VER_NDX_LOCAL, we should + // compute symbol versions before handling --dynamic-list. + handleDynamicList(); } template void SymbolTable::addFile(InputFile *); Modified: stable/11/contrib/llvm/tools/lld/ELF/SymbolTable.h ============================================================================== --- stable/11/contrib/llvm/tools/lld/ELF/SymbolTable.h Tue Jul 16 17:27:51 2019 (r350059) +++ stable/11/contrib/llvm/tools/lld/ELF/SymbolTable.h Tue Jul 16 17:39:58 2019 (r350060) @@ -90,7 +90,6 @@ class SymbolTable { (private) std::vector findAllByVersion(SymbolVersion Ver); llvm::StringMap> &getDemangledSyms(); - void handleAnonymousVersion(); void assignExactVersion(SymbolVersion Ver, uint16_t VersionId, StringRef VersionName); void assignWildcardVersion(SymbolVersion Ver, uint16_t VersionId); From owner-svn-src-all@freebsd.org Tue Jul 16 17:54:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 04F56B63B2; Tue, 16 Jul 2019 17:54:21 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D9E966C89D; Tue, 16 Jul 2019 17:54:20 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B36D799F2; Tue, 16 Jul 2019 17:54:20 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6GHsKgj089153; Tue, 16 Jul 2019 17:54:20 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6GHsKAs089152; Tue, 16 Jul 2019 17:54:20 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201907161754.x6GHsKAs089152@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 16 Jul 2019 17:54:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350061 - head/sys/netinet/tcp_stacks X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet/tcp_stacks X-SVN-Commit-Revision: 350061 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D9E966C89D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jul 2019 17:54:21 -0000 Author: tuexen Date: Tue Jul 16 17:54:20 2019 New Revision: 350061 URL: https://svnweb.freebsd.org/changeset/base/350061 Log: Fix compilation on platforms using gcc. When compiling RACK on platforms using gcc, a warning that tcp_outflags is defined but not used is issued and terminates compilation on PPC64, for example. So don't indicate that tcp_outflags is used. Reviewed by: rrs@ Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D20971 Modified: head/sys/netinet/tcp_stacks/rack_bbr_common.c Modified: head/sys/netinet/tcp_stacks/rack_bbr_common.c ============================================================================== --- head/sys/netinet/tcp_stacks/rack_bbr_common.c Tue Jul 16 17:39:58 2019 (r350060) +++ head/sys/netinet/tcp_stacks/rack_bbr_common.c Tue Jul 16 17:54:20 2019 (r350061) @@ -85,7 +85,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#define TCPOUTFLAGS #include #include #include From owner-svn-src-all@freebsd.org Tue Jul 16 18:40:01 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0363EB73E8; Tue, 16 Jul 2019 18:40:01 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DA7176E5E3; Tue, 16 Jul 2019 18:40:00 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B68F7A123; Tue, 16 Jul 2019 18:40:00 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6GIe04s012961; Tue, 16 Jul 2019 18:40:00 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6GIdx97012918; Tue, 16 Jul 2019 18:39:59 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201907161839.x6GIdx97012918@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Tue, 16 Jul 2019 18:39:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350062 - in stable/12/sys/modules: efirt iflib nvdimm tpm X-SVN-Group: stable-12 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: in stable/12/sys/modules: efirt iflib nvdimm tpm X-SVN-Commit-Revision: 350062 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DA7176E5E3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jul 2019 18:40:01 -0000 Author: eugen Date: Tue Jul 16 18:39:59 2019 New Revision: 350062 URL: https://svnweb.freebsd.org/changeset/base/350062 Log: MFC r345632 by lwhsu: Fix `make` in sys/modules PR: 239120 Modified: stable/12/sys/modules/efirt/Makefile stable/12/sys/modules/iflib/Makefile stable/12/sys/modules/nvdimm/Makefile stable/12/sys/modules/tpm/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/modules/efirt/Makefile ============================================================================== --- stable/12/sys/modules/efirt/Makefile Tue Jul 16 17:54:20 2019 (r350061) +++ stable/12/sys/modules/efirt/Makefile Tue Jul 16 18:39:59 2019 (r350062) @@ -9,6 +9,7 @@ SRCS+= efirtc.c SRCS+= device_if.h bus_if.h clock_if.h .if ${MACHINE_CPUARCH} == "amd64" +SRCS+= opt_hwpmc_hooks.h opt_kstack_pages.h SRCS+= efirt_support.S efirt_support.o: efirt_support.S assym.inc ${CC} -c -x assembler-with-cpp -DLOCORE ${CFLAGS} \ Modified: stable/12/sys/modules/iflib/Makefile ============================================================================== --- stable/12/sys/modules/iflib/Makefile Tue Jul 16 17:54:20 2019 (r350061) +++ stable/12/sys/modules/iflib/Makefile Tue Jul 16 18:39:59 2019 (r350062) @@ -9,5 +9,6 @@ SRCS= \ mp_ring.c SRCS+= ifdi_if.c SRCS+= device_if.h bus_if.h pci_if.h pci_iov_if.h ifdi_if.h +SRCS+= opt_acpi.h opt_inet.h opt_inet6.h opt_sched.h .include Modified: stable/12/sys/modules/nvdimm/Makefile ============================================================================== --- stable/12/sys/modules/nvdimm/Makefile Tue Jul 16 17:54:20 2019 (r350061) +++ stable/12/sys/modules/nvdimm/Makefile Tue Jul 16 18:39:59 2019 (r350062) @@ -9,5 +9,6 @@ SRCS= nvdimm.c \ nvdimm_spa.c SRCS+= acpi_if.h bus_if.h device_if.h +SRCS+= opt_acpi.h opt_ddb.h .include Modified: stable/12/sys/modules/tpm/Makefile ============================================================================== --- stable/12/sys/modules/tpm/Makefile Tue Jul 16 17:54:20 2019 (r350061) +++ stable/12/sys/modules/tpm/Makefile Tue Jul 16 18:39:59 2019 (r350062) @@ -8,6 +8,6 @@ SRCS= tpm.c bus_if.h device_if.h #Bus specific stuff. SRCS+= tpm_isa.c tpm_acpi.c isa_if.h opt_acpi.h acpi_if.h #TPM 2.0 -SRCS+= tpm20.c tpm_crb.c tpm_tis.c +SRCS+= tpm20.c tpm_crb.c tpm_tis.c opt_tpm.h .include From owner-svn-src-all@freebsd.org Tue Jul 16 19:00:39 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C3F5DB7A97; Tue, 16 Jul 2019 19:00:39 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A431D6F57B; Tue, 16 Jul 2019 19:00:39 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7EE76A4D9; Tue, 16 Jul 2019 19:00:39 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6GJ0dNh027642; Tue, 16 Jul 2019 19:00:39 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6GJ0d12027641; Tue, 16 Jul 2019 19:00:39 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201907161900.x6GJ0d12027641@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Tue, 16 Jul 2019 19:00:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350063 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 350063 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A431D6F57B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jul 2019 19:00:39 -0000 Author: cy Date: Tue Jul 16 19:00:38 2019 New Revision: 350063 URL: https://svnweb.freebsd.org/changeset/base/350063 Log: Refactor, removing one compare. This changes the return code however the caller only tests for 0 and != 0. One might ask then, why multiple return codes when the caller only tests for 0 and != 0? From what I can tell, Darren probably passed various return codes for sake of debugging. The debugging code is long gone however we can still use the different return codes using DTrace FBT traces. We can still determine why the compare failed by examining the differences between the fr1 and fr2 frentry structs, which is a simple test in DTrace. This allows reducing the number of tests, improving the code while not affecting our ability to capture information for diagnostic purposes. MFC after: 1 week Modified: head/sys/contrib/ipfilter/netinet/fil.c Modified: head/sys/contrib/ipfilter/netinet/fil.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/fil.c Tue Jul 16 18:39:59 2019 (r350062) +++ head/sys/contrib/ipfilter/netinet/fil.c Tue Jul 16 19:00:38 2019 (r350063) @@ -4439,15 +4439,13 @@ ipf_rule_compare(frentry_t *fr1, frentry_t *fr2) if (bcmp((char *)&fr1->fr_func, (char *)&fr2->fr_func, FR_CMPSIZ(fr1)) != 0) return (4); - if (fr1->fr_data && !fr2->fr_data) - return (5); - if (!fr1->fr_data && fr2->fr_data) - return (6); - if (fr1->fr_data) { - if (bcmp(fr1->fr_caddr, fr2->fr_caddr, fr1->fr_dsize)) - return (7); + if (!fr1->fr_data && !fr2->fr_data) + return (0); /* move along, nothing to see here */ + if (fr1->fr_data && fr2->fr_data) { + if (bcmp(fr1->fr_caddr, fr2->fr_caddr, fr1->fr_dsize) == 0) + return (0); /* same */ } - return (0); + return (5); } From owner-svn-src-all@freebsd.org Tue Jul 16 19:00:43 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 67DDCB7ABF; Tue, 16 Jul 2019 19:00:43 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 45A636F5A5; Tue, 16 Jul 2019 19:00:43 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F1E8BA4E0; Tue, 16 Jul 2019 19:00:42 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6GJ0gk1027690; Tue, 16 Jul 2019 19:00:42 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6GJ0gsS027689; Tue, 16 Jul 2019 19:00:42 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201907161900.x6GJ0gsS027689@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Tue, 16 Jul 2019 19:00:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350064 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 350064 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 45A636F5A5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jul 2019 19:00:43 -0000 Author: cy Date: Tue Jul 16 19:00:42 2019 New Revision: 350064 URL: https://svnweb.freebsd.org/changeset/base/350064 Log: As of upstream fil.c CVS r1.53 (March 1, 2009), prior to the import of ipfilter 5.1.2 into FreeBSD-10, the fix for, 2580062 from/to targets should be able to use any interface name, moved frentry.fr_cksum to prior to frentry.fr_func thereby making this code redundant. After investigating whether this fix to move fr_cksum was correct and if it broke anything, it has been determined that the fix is correct and this code is redundant. We remove it here. MFC after: 2 weeks Modified: head/sys/contrib/ipfilter/netinet/fil.c Modified: head/sys/contrib/ipfilter/netinet/fil.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/fil.c Tue Jul 16 19:00:38 2019 (r350063) +++ head/sys/contrib/ipfilter/netinet/fil.c Tue Jul 16 19:00:42 2019 (r350064) @@ -4922,9 +4922,6 @@ frrequest(softc, unit, req, data, set, makecopy) * the constant part of the filter rule to make comparisons quicker * (this meaning no pointers are included). */ - for (fp->fr_cksum = 0, p = (u_int *)&fp->fr_func, pp = &fp->fr_cksum; - p < pp; p++) - fp->fr_cksum += *p; pp = (u_int *)(fp->fr_caddr + fp->fr_dsize); for (p = (u_int *)fp->fr_data; p < pp; p++) fp->fr_cksum += *p; From owner-svn-src-all@freebsd.org Tue Jul 16 19:23:48 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 68A25B82D3; Tue, 16 Jul 2019 19:23:48 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D11A7073B; Tue, 16 Jul 2019 19:23:48 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 267F8AA2C; Tue, 16 Jul 2019 19:23:48 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6GJNm7r045297; Tue, 16 Jul 2019 19:23:48 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6GJNmeZ045296; Tue, 16 Jul 2019 19:23:48 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201907161923.x6GJNmeZ045296@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Tue, 16 Jul 2019 19:23:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r350065 - stable/11/sys/modules/tpm X-SVN-Group: stable-11 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: stable/11/sys/modules/tpm X-SVN-Commit-Revision: 350065 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4D11A7073B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jul 2019 19:23:48 -0000 Author: eugen Date: Tue Jul 16 19:23:47 2019 New Revision: 350065 URL: https://svnweb.freebsd.org/changeset/base/350065 Log: Make tpm(4) kernel module buildable outside of kernel build environment. This direct commit is partial merge of r345632 (by lwhsu) from head that cannot be merged completely due to significant differences in code base. PR: 239120 Modified: stable/11/sys/modules/tpm/Makefile Modified: stable/11/sys/modules/tpm/Makefile ============================================================================== --- stable/11/sys/modules/tpm/Makefile Tue Jul 16 19:00:42 2019 (r350064) +++ stable/11/sys/modules/tpm/Makefile Tue Jul 16 19:23:47 2019 (r350065) @@ -8,6 +8,6 @@ SRCS= tpm.c bus_if.h device_if.h #Bus specific stuff. SRCS+= tpm_isa.c tpm_acpi.c isa_if.h opt_acpi.h acpi_if.h #TPM 2.0 -SRCS+= tpm20.c tpm_crb.c tpm_tis.c +SRCS+= tpm20.c tpm_crb.c tpm_tis.c opt_tpm.h .include From owner-svn-src-all@freebsd.org Tue Jul 16 19:40:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 093F6B8B11; Tue, 16 Jul 2019 19:40:24 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DF807714F0; Tue, 16 Jul 2019 19:40:23 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B6C5BAC55; Tue, 16 Jul 2019 19:40:23 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6GJeNr0051334; Tue, 16 Jul 2019 19:40:23 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6GJeNb9051333; Tue, 16 Jul 2019 19:40:23 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201907161940.x6GJeNb9051333@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Tue, 16 Jul 2019 19:40:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r350066 - stable/11/sys/modules/spigen X-SVN-Group: stable-11 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: stable/11/sys/modules/spigen X-SVN-Commit-Revision: 350066 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DF807714F0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jul 2019 19:40:24 -0000 Author: eugen Date: Tue Jul 16 19:40:23 2019 New Revision: 350066 URL: https://svnweb.freebsd.org/changeset/base/350066 Log: MFC r336561 by lwhsu: Fix `make` in sys/modules/spigen PR: 239119 Modified: stable/11/sys/modules/spigen/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/modules/spigen/Makefile ============================================================================== --- stable/11/sys/modules/spigen/Makefile Tue Jul 16 19:23:47 2019 (r350065) +++ stable/11/sys/modules/spigen/Makefile Tue Jul 16 19:40:23 2019 (r350066) @@ -9,6 +9,7 @@ SRCS+= \ bus_if.h \ device_if.h \ opt_platform.h \ + opt_spi.h \ spibus_if.h \ .if !empty(OPT_FDT) From owner-svn-src-all@freebsd.org Tue Jul 16 19:44:58 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 04DC8B8E65 for ; Tue, 16 Jul 2019 19:44:58 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-vs1-xe43.google.com (mail-vs1-xe43.google.com [IPv6:2607:f8b0:4864:20::e43]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) 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 B0F8571A56 for ; Tue, 16 Jul 2019 19:44:56 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-vs1-xe43.google.com with SMTP id v129so14735443vsb.11 for ; Tue, 16 Jul 2019 12:44:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=xhq4HqtWpYVviAoGYvVSrVPQr2hi1ZYDm133K18hx3A=; b=dUPTzKYM63mIHT2C8+dqLCGHOrJ0nahuycKciDqnIQx5O9h/no9nB+VNgXDcYg5ilk ipUg5WxakPrO2cxap16IriowzbhYptRaNCXI7AoxVAT7lHyGSp241kXOAU2g5rL4ju7c 0sKnvuDr8G1lGFoVT1+MjW/657V8Zb1us089QWiTHqOuCoou4SbnsPFD3d0Jzmwow9b6 9ASKLO29gM5yJpPmS/VOxibJ8X8VuXsV3BZaDxOxmLFYUjq+yxA/OczxlFT29dMhoubt aXdeEWfy2FnUETEsfgaTDYC8o1gbWFZLeEqj/ikUVPm5WfdfcmIy5MCzWpCAOCizhP4t I/jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=xhq4HqtWpYVviAoGYvVSrVPQr2hi1ZYDm133K18hx3A=; b=smtNqd5uneZkdc2Z5habPbfMo7OQvA/94H4euuwRZZm7hCi2ARPQ6ovEdDt9F4zkpJ LmiisYlRzk1y/RV/od4SgiyB1yks2QrSsi4qfcsEigptBu5+1mdiGtflXZpUfGuhdQpJ ul5sJcuwfixbqfsYtF4QjPgef7Y61UqM4ytKvnJYt3n9M2rsEdGWfZaByWIvUg352o3J WTzbuXGFnA9NzInBAaDoLRh0jg2Fy2lh3GC9eue07UXqrQyhjr/NhF778esq34MdCYO8 aKbYDxaK7FVEJXWdT2rSPvaPMcBp86PJjprsdknxJ+B25pheyIo2IKcTmQCZBYErUT6Q L81A== X-Gm-Message-State: APjAAAUCUPDAHlVZa9uj656PZXIPGfQn23GDqgRumMnlPn63RVy9c85H UZEBZzqPkP0/11yPRyJM4VXa4ndw23eEvQ== X-Google-Smtp-Source: APXvYqwwvvm13oyddgEpD3LhmmIMeXcO+ytXKL+eR72+pixkMwBwwGLb5VkqRBcyd7GqOHBi0OBoZQ== X-Received: by 2002:a67:ab0d:: with SMTP id u13mr21851198vse.145.1563306296112; Tue, 16 Jul 2019 12:44:56 -0700 (PDT) Received: from mutt-hbsd ([151.196.118.239]) by smtp.gmail.com with ESMTPSA id n129sm4392315vsc.18.2019.07.16.12.44.55 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 16 Jul 2019 12:44:55 -0700 (PDT) Date: Tue, 16 Jul 2019 15:44:54 -0400 From: Shawn Webb To: Brooks Davis Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r350049 - head/contrib/amd/amd Message-ID: <20190716194454.odytcdjtlduliz6l@mutt-hbsd> References: <201907161603.x6GG38oZ020228@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="4sd5ly7yvjmy2vpg" Content-Disposition: inline In-Reply-To: <201907161603.x6GG38oZ020228@repo.freebsd.org> X-Operating-System: FreeBSD mutt-hbsd 13.0-CURRENT-HBSD FreeBSD 13.0-CURRENT-HBSD X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0xFF2E67A277F8E1FA User-Agent: NeoMutt/20180716 X-Rspamd-Queue-Id: B0F8571A56 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=hardenedbsd.org header.s=google header.b=dUPTzKYM; spf=pass (mx1.freebsd.org: domain of shawn.webb@hardenedbsd.org designates 2607:f8b0:4864:20::e43 as permitted sender) smtp.mailfrom=shawn.webb@hardenedbsd.org X-Spamd-Result: default: False [-5.76 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; RCVD_COUNT_THREE(0.00)[3]; MX_GOOD(-0.01)[cached: alt1.aspmx.l.google.com]; DKIM_TRACE(0.00)[hardenedbsd.org:+]; NEURAL_HAM_SHORT(-0.99)[-0.986,0]; SIGNED_PGP(-2.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; IP_SCORE(-0.67)[ip: (2.35), ipnet: 2607:f8b0::/32(-3.17), asn: 15169(-2.45), country: US(-0.06)]; RECEIVED_SPAMHAUS_PBL(0.00)[239.118.196.151.zen.spamhaus.org : 127.0.0.10]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; R_DKIM_ALLOW(-0.20)[hardenedbsd.org:s=google]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[hardenedbsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[3.4.e.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; MID_RHS_NOT_FQDN(0.50)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jul 2019 19:44:58 -0000 --4sd5ly7yvjmy2vpg Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jul 16, 2019 at 04:03:08PM +0000, Brooks Davis wrote: > Author: brooks > Date: Tue Jul 16 16:03:08 2019 > New Revision: 350049 > URL: https://svnweb.freebsd.org/changeset/base/350049 >=20 > Log: > Fix two mismatches between function declaration and definition. > =20 > In both cases, function pointer arguments were inconsistently declared > and the result worked because of C's odd rules around function pointer > (de)references. With a stricter compiler these fail to compile. And, with CFI applied to the kernel, would cause a panic. :) Good catch and thanks for the great work! --=20 Shawn Webb Cofounder / Security Engineer HardenedBSD Tor-ified Signal: +1 443-546-8752 Tor+XMPP+OTR: lattera@is.a.hacker.sx GPG Key ID: 0xFF2E67A277F8E1FA GPG Key Fingerprint: D206 BB45 15E0 9C49 0CF9 3633 C85B 0AF8 AB23 0FB2 --4sd5ly7yvjmy2vpg Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEA6TL67gupaZ9nzhT/y5nonf44foFAl0uKTEACgkQ/y5nonf4 4fpY3xAAqKnAegT4e8E2L6pUei14CJwB6Od2xAgXmGf/IiAxsqVRRTuV2XMJMBHc 7cpVlr7pbaOijABDKXvDShOweS4ZobME1nhklLuz88dpr+CvqqZg3Rg5W9sSJFy7 uCk2Gcs66pGipMZr1yXk8ZhgmucmZRWywJHqL0cvsWamW/KF68D+Kk7+XhJZ8sJW /TneAyXBZ4JaFCkbktPXanoNliIcd/YqHDj7s1Y9SdEjc8n3+wscq4s9FkdONlBD /ysPwp31X5RZdTD6xr7g0qvwSRsGygZMXYQzSRfJNGVqaQmhllzdRDTQhfzcL6FU zzPLuFFddiv7Jzlq77t12Vctl2qLaDcUOPsN7j/XMEgud41086sXtN8OWMX6F3Ay fpV4OtmBnpZejcCLjy2/Vgkoy1tT3jou5xSj2yZW94ttYHyh+DpdgZyUkL6cMlrd QFg1uuJsHmTICaCEYickH7qXzVOqsQTjrVZUeQZquNLW7+Fn4z6TjXDVb2tMfob7 L8MKK5g4aLm7CKJ79VJqVJ3ITnD+rKio74sxXxuHxqrW0cXI1ntd430jRu0adZIN 85I2yMxzWEFFMCFmc31xIEgKj8luBMsrY3kq9vbZSWI4cAd9aK97Z49p8aDOPZ33 GEPBv4D24Jr0mfYWcZco80uViV+q/bv64H8I3i1ikjezzZZ0LL0= =aQZI -----END PGP SIGNATURE----- --4sd5ly7yvjmy2vpg-- From owner-svn-src-all@freebsd.org Tue Jul 16 20:41:13 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B7D62B9D50; Tue, 16 Jul 2019 20:41:13 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) 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 99A7F73B6D; Tue, 16 Jul 2019 20:41:13 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-4.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 9EE87106A7; Tue, 16 Jul 2019 20:41:12 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r350049 - head/contrib/amd/amd To: Shawn Webb , Brooks Davis Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201907161603.x6GG38oZ020228@repo.freebsd.org> <20190716194454.odytcdjtlduliz6l@mutt-hbsd> From: John Baldwin Openpgp: preference=signencrypt Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: <6ddf37a1-3b1a-2401-a338-36b6c8b9947d@FreeBSD.org> Date: Tue, 16 Jul 2019 13:41:06 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <20190716194454.odytcdjtlduliz6l@mutt-hbsd> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 99A7F73B6D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.87 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.992,0]; NEURAL_HAM_SHORT(-0.88)[-0.882,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jul 2019 20:41:13 -0000 On 7/16/19 12:44 PM, Shawn Webb wrote: > On Tue, Jul 16, 2019 at 04:03:08PM +0000, Brooks Davis wrote: >> Author: brooks >> Date: Tue Jul 16 16:03:08 2019 >> New Revision: 350049 >> URL: https://svnweb.freebsd.org/changeset/base/350049 >> >> Log: >> Fix two mismatches between function declaration and definition. >> >> In both cases, function pointer arguments were inconsistently declared >> and the result worked because of C's odd rules around function pointer >> (de)references. With a stricter compiler these fail to compile. > > And, with CFI applied to the kernel, would cause a panic. :) > > Good catch and thanks for the great work! How would an incorrect function prototype in userland cause a kernel panic? -- John Baldwin From owner-svn-src-all@freebsd.org Tue Jul 16 20:44:47 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D038FB9FFC for ; Tue, 16 Jul 2019 20:44:47 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qt1-x843.google.com (mail-qt1-x843.google.com [IPv6:2607:f8b0:4864:20::843]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) 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 749F7744E9 for ; Tue, 16 Jul 2019 20:44:47 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qt1-x843.google.com with SMTP id x22so16151045qtp.12 for ; Tue, 16 Jul 2019 13:44:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=s7U8u+9Jgaz8trmScOqB+mZR9YvYOO3Gqd/yCU8IkJk=; b=BLxyyS9njxhFWy2zuttRhEQQcN9/kt0GME+0ZHou/Pgf4MSRJY0DJiraX08X0p08oG GPnwEF+TxB3U+zdCDWCbsKd+TgD0D0K/QYJq4O0OT9uYfQka6wl0BShebyJrSQZiQsO7 RmLDRH5+/KFcNwwj5a0fnpqYaRsKjOYN2zvDMNCyGvPp4CozsYua8954ehG+bSiDqXk9 w9lNHTLQ+nb9bzx2KrM8oJ6y0usPbARv7YszBQVaZL/zCq0CsMeUA2eHMTYquEFscrE8 Z01d/HiHRNB4Xqbed5i7IfHmas4cNTBv944gc7yAkzUP4ixbPIRR2VxK+QRs21wM1tyc xeYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=s7U8u+9Jgaz8trmScOqB+mZR9YvYOO3Gqd/yCU8IkJk=; b=inbSi6rr89jQ6mmqU1SCZGDL0fSHOTIJOTfVpQdB93TJ4Aa9uKI1EUSai8JXGPFSBe FmU0QVucfA9FOetKF5WcPcslh14jeeKdZtnVoJlBNCKJ9lZQl5bnRabLfd0V19cgz+tf AENn30V3MZ5UQ1abSXhOkmDCiTvA+YyUOpbEmc5HEvsbCO1R7VF75Ip4TejcKUcEvkBn nHuwW26jiyaMUWUjRqvr1Mha+vEbN3+PXWGPhdlr321UJ6U7DbNr2SpJA++aLUh4joIO dh+RDhnUoRj31Tmtof7uN2ggujxaACBKJsMenqt5yBUIQ+/j7ZxM9Nw3XYZvH6+U2Ijm tw6g== X-Gm-Message-State: APjAAAXFIIurLCKWEaacJuGJ5ifncJKfzTNmDaSis42ZltEAZ0IW3Kou /j7L9bpyCXKyv0eRM0UIqH+fjw== X-Google-Smtp-Source: APXvYqxgPkT5VMBJ5g95+mYizRVThZi838BasDIGYSPv5d0qi2A5j/Fpugb8/FKfQWwEWZ5F73jO8A== X-Received: by 2002:ac8:7404:: with SMTP id p4mr24970729qtq.181.1563309886806; Tue, 16 Jul 2019 13:44:46 -0700 (PDT) Received: from mutt-hbsd ([151.196.118.239]) by smtp.gmail.com with ESMTPSA id m12sm9139964qkk.123.2019.07.16.13.44.45 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 16 Jul 2019 13:44:46 -0700 (PDT) Date: Tue, 16 Jul 2019 16:44:45 -0400 From: Shawn Webb To: John Baldwin Cc: Brooks Davis , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r350049 - head/contrib/amd/amd Message-ID: <20190716204445.qyhccsp6cijkxslk@mutt-hbsd> References: <201907161603.x6GG38oZ020228@repo.freebsd.org> <20190716194454.odytcdjtlduliz6l@mutt-hbsd> <6ddf37a1-3b1a-2401-a338-36b6c8b9947d@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="4xnewste4utnug75" Content-Disposition: inline In-Reply-To: <6ddf37a1-3b1a-2401-a338-36b6c8b9947d@FreeBSD.org> X-Operating-System: FreeBSD mutt-hbsd 13.0-CURRENT-HBSD FreeBSD 13.0-CURRENT-HBSD X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0xFF2E67A277F8E1FA User-Agent: NeoMutt/20180716 X-Rspamd-Queue-Id: 749F7744E9 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=hardenedbsd.org header.s=google header.b=BLxyyS9n; spf=pass (mx1.freebsd.org: domain of shawn.webb@hardenedbsd.org designates 2607:f8b0:4864:20::843 as permitted sender) smtp.mailfrom=shawn.webb@hardenedbsd.org X-Spamd-Result: default: False [-5.87 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[hardenedbsd.org:+]; MX_GOOD(-0.01)[cached: alt1.aspmx.l.google.com]; NEURAL_HAM_SHORT(-0.97)[-0.965,0]; SIGNED_PGP(-2.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; IP_SCORE(-0.80)[ip: (1.67), ipnet: 2607:f8b0::/32(-3.17), asn: 15169(-2.45), country: US(-0.06)]; RECEIVED_SPAMHAUS_PBL(0.00)[239.118.196.151.zen.spamhaus.org : 127.0.0.10]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; R_DKIM_ALLOW(-0.20)[hardenedbsd.org:s=google]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[hardenedbsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[3.4.8.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; MID_RHS_NOT_FQDN(0.50)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jul 2019 20:44:47 -0000 --4xnewste4utnug75 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jul 16, 2019 at 01:41:06PM -0700, John Baldwin wrote: > On 7/16/19 12:44 PM, Shawn Webb wrote: > > On Tue, Jul 16, 2019 at 04:03:08PM +0000, Brooks Davis wrote: > >> Author: brooks > >> Date: Tue Jul 16 16:03:08 2019 > >> New Revision: 350049 > >> URL: https://svnweb.freebsd.org/changeset/base/350049 > >> > >> Log: > >> Fix two mismatches between function declaration and definition. > >> =20 > >> In both cases, function pointer arguments were inconsistently declar= ed > >> and the result worked because of C's odd rules around function point= er > >> (de)references. With a stricter compiler these fail to compile. > >=20 > > And, with CFI applied to the kernel, would cause a panic. :) > >=20 > > Good catch and thanks for the great work! >=20 > How would an incorrect function prototype in userland cause a kernel pani= c? Another good catch! I misread the intent of the patch. Sorry for the line noise. --=20 Shawn Webb Cofounder / Security Engineer HardenedBSD Tor-ified Signal: +1 443-546-8752 Tor+XMPP+OTR: lattera@is.a.hacker.sx GPG Key ID: 0xFF2E67A277F8E1FA GPG Key Fingerprint: D206 BB45 15E0 9C49 0CF9 3633 C85B 0AF8 AB23 0FB2 --4xnewste4utnug75 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEA6TL67gupaZ9nzhT/y5nonf44foFAl0uNzcACgkQ/y5nonf4 4fpwPxAAo3YWTwjFpQ7wOTZNnZXbT/FbG/0BLpfZMGgoXFDtaHPv8M23g5ha6g3T BJcV7gCB9nL0fUN86qP0Q64eurm2BoCEJx9p6y6YOMHSPddRb3HZ76t0KrIkOgP0 KQf4eHLM7sX/1jRhdzaRk96rOI8Kq9BgkSc0AKiBg7IGIDf5eW+TLWjm/Hdkozvn ms1dx6YLtBD9IzQPadsbcQ8THEhkP34JnsY+A8gZLoXRUbfPbNTzJ0MAt/aj6n2h 2cS4UQpGaQf2s2GL4oXKmz8cjrl5MsVC+/MnB0APruvoW8KNqgNOFW6uxncaKBtO a1Lfd71Im5S4t9pGk6jdoOux8cj+OtaeYww/onKhCnZdkZAFfg4cfyKbHRLF+HX3 iAWbJmjj/h5+FMlnID6l8Net6ExWbcZag3yiJsh9fwD8lDrboHAIdXqhYqh1xz98 n7+wdW2sogwgyMI/9hFlEPlDGFUwUts3p04t9p5rARHkKCCBDbKz8FpFZWy7JC/w 15uJl6QhXQfbuegm5sgMjjpDvmbTk/sUQb6bohwBJ95UWp97RcVKwz34MZ5dnErj G2URwEJTXtA/nif6fGdgttAoQXTLHHh7egH46LGSP1q6VFPSU8BML/2F9QM99CrN 9z9Gqd26XAqZv6ZLnx/cI/UcWKgJhjdqVyWJxEQ3U559DHf6qRw= =xZj2 -----END PGP SIGNATURE----- --4xnewste4utnug75-- From owner-svn-src-all@freebsd.org Tue Jul 16 21:00:06 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3E731BA609; Tue, 16 Jul 2019 21:00:06 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-lf1-f68.google.com (mail-lf1-f68.google.com [209.85.167.68]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) 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 78A5174E1C; Tue, 16 Jul 2019 21:00:04 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-lf1-f68.google.com with SMTP id b29so7511302lfq.1; Tue, 16 Jul 2019 14:00:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=q1h+bP7JnosNtW0UWQC/5MMsyPa3GKhEoc60xHo0bO0=; b=qHmHU3iRyEAI746m8jWMEmD2QX+dzZjG+vNxQzeCvFgjpfsGOOfx92QT385u/8Jbyr N/fK44r5qt6iWKy1JCUzeoR/xq16c8fmObMg9musmLZJKI7X/IbxqLKvdkOU8pYcqVew QZ037oM+Mo7/K72yRIOwHRAB2mxycrZ3f8FLbueQeHTcmhlTGh0o4O3W27TZCM5ElGOj Bg8ghNeRM9n66ST2fL8MUWmCPUrXQ5wKZFi8v8VfYvn0Vn9TpoEPxNR0twCWPWILyift 0j6FplnZLRs/vz79vlmYPeRCAxIbZOZSOYS+DB6XNEPwBnZekYBFuChL54FgBlGxdvQR DB9Q== X-Gm-Message-State: APjAAAWMCvviJia+jJuQw/laRKRiKk+l2k8WbpyYuMmrsfaC7GJi+6ia WMVByv4KvNygyOxPT869CR6qND8H9yZe5SEipNA= X-Google-Smtp-Source: APXvYqzJwSSQ2KQauw13pRligqgstrAHKNhmeSwwsGQsqAxNkeN1Dx18lT/hWgwYqAP6dllXYtuk6HmKssyOXMaZnNs= X-Received: by 2002:a19:6904:: with SMTP id e4mr16082230lfc.156.1563310370481; Tue, 16 Jul 2019 13:52:50 -0700 (PDT) MIME-Version: 1.0 References: <201906251944.x5PJiNaA093352@repo.freebsd.org> <3b2ade4e-d19d-31e4-7ee2-c0085a00e53e@FreeBSD.org> <20190716180618.C962@besplex.bde.org> In-Reply-To: <20190716180618.C962@besplex.bde.org> From: Alan Somers Date: Tue, 16 Jul 2019 14:52:38 -0600 Message-ID: Subject: Re: svn commit: r349391 - head/sys/kern To: Bruce Evans Cc: John Baldwin , "Conrad E. Meyer" , src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 78A5174E1C X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of asomers@gmail.com designates 209.85.167.68 as permitted sender) smtp.mailfrom=asomers@gmail.com X-Spamd-Result: default: False [-3.55 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.89)[-0.886,0]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[freebsd.org]; RCPT_COUNT_FIVE(0.00)[6]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.49)[-0.491,0]; RCVD_IN_DNSWL_NONE(0.00)[68.167.85.209.list.dnswl.org : 127.0.5.0]; RCVD_TLS_LAST(0.00)[]; FORGED_SENDER(0.30)[asomers@freebsd.org,asomers@gmail.com]; FREEMAIL_TO(0.00)[optusnet.com.au]; RWL_MAILSPIKE_POSSIBLE(0.00)[68.167.85.209.rep.mailspike.net : 127.0.0.17]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[asomers@freebsd.org,asomers@gmail.com]; IP_SCORE(-1.16)[ip: (0.15), ipnet: 209.85.128.0/17(-3.45), asn: 15169(-2.45), country: US(-0.06)]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jul 2019 21:00:06 -0000 On Tue, Jul 16, 2019 at 3:48 AM Bruce Evans wrote: > > On Mon, 15 Jul 2019, John Baldwin wrote: > > > On 7/14/19 12:08 PM, Conrad Meyer wrote: > >> > >> This change restores the possible overflow beyond IO_SEQMAX that the > >> removed conditional prevented. > >> > >> On Tue, Jun 25, 2019 at 12:44 PM Alan Somers wrote: > > I thought the same for a while on Tue, Jan 25, then didn't reply since I > saw a non-problem while writing the reply. Actually, all versions are > broken. > > >>> Author: asomers > >>> Date: Tue Jun 25 19:44:22 2019 > >>> New Revision: 349391 > >>> URL: https://svnweb.freebsd.org/changeset/base/349391 > >>> > >>> --- head/sys/kern/vfs_vnops.c Tue Jun 25 19:36:01 2019 (r349390) > >>> +++ head/sys/kern/vfs_vnops.c Tue Jun 25 19:44:22 2019 (r349391) > >>> @@ -499,10 +499,8 @@ sequential_heuristic(struct uio *uio, struct file *fp) > >>> * closely related to the best I/O size for real disks than > >>> * to any block size used by software. > >>> */ > >>> - fp->f_seqcount += MIN(IO_SEQMAX, > >>> + fp->f_seqcount += lmin(IO_SEQMAX, > >>> howmany(uio->uio_resid, 16384)); > >>> - if (fp->f_seqcount > IO_SEQMAX) > >>> - fp->f_seqcount = IO_SEQMAX; > >>> return (fp->f_seqcount << IO_SEQSHIFT); > >>> } > > Overflow occurs in all versions in howmany() when uio_resid is near > its limit of SSIZE_MAX. Then adding (65536 - 1) to uio_resid overflows. > The behaviour is undefined, but usually the addition gives a large > negative value and howmany gives a not so large negative value after > dividing by 65536. > > In the previous version, MIN() preserves signedness and the type of > howmany(), which is always long (since ssize_t happens to be long on all > supported arches). The large negative value is less than IO_SEQMAX sinc > that has a correct type (signed int) and is non-negative. So MIN() preserves > the large negative value. This is blindly added to f_seqcount, giving > another overflow on 64-bit arches and a garbage negative value on 32-bit > arches if f_seqcount was not garbage. The removed conditional only fixes > up large positive values, so has no effect in this case. Finally, left > shifting the garbage gives further undefined behaviour. > > The second overflow on 64-bit arches is because the not so large negative > value is still much larger than can be represented in f_seqcount. > Values near -SSIZE_MAX have 63 value bits, so dividing by 16384 leaves > 47 value bits, but f_seqcount has only 31 value bits. > > In this version, lmin() happens to give the same result as MIN() on all > supported machines, because ssize_t happens to have the same representation > on all supported machines. So overflows occur as before for large uio_resid. > > So this change makes no differences for the 2 overflows for uio_resid near > SSIZE_MAX. But removing the conditional restores an overflow that actually > was fixed in a previous recent commit. > > >> Perhaps instead this should be: > >> > >> fp->f_seqcount = lmin(IO_SEQMAX, > >> fp->f_seqcount + howmany(...)); > > This works to restore the check in the removed conditional, but is a bit > subtle and leaves the 2 old overflow bugs unfixed. > > > While I agree with your assessment of the removed conditional, I think the > > suggestion above can have a funky overflow where f_seqcount + howmany(...) ends > > up less than IO_SEQMAX and this expression would then be used instead of IO_SEQMAX? > > This only happens when howmany() itself overflows. Otherwise, dividing by > 16384 reduces the value enough to add f_seqcount to howmany(...) without > overflow. > > > The first lmin seems designed to minimize what we add in the hope that since the > > existing value is bounded to '0...IO_SEQMAX' the result of the += can only be in > > the range '0...2*IO_SEQMAX'. > > One addition doesn't overflow, and the shift could be clamped later, but > overflow still occurs after approx. INT_MAX / IO_SEQMAX additions, so it > is better to clamp earlier. > > > I'm not sure which variants are most readable: > > > > A) > > fp->f_seqcount += lmin(IO_SEQMAX, > > howmany(resid, 16384)); > > if (fp->f_seqcount > IO_SEQMAX) > > fp->f_seqcount = IO_SEQMAX; > > This change is because I said that using the unsafe macro MIN() is a style > bug. I also said that using the lmin() family is too hard, since it is > not type generic. I didn't notice the overflow problem in howmany(). > > This has another style bug -- using lmin() and then open-coding the clamp > f->f_seqcount = imax(f->f_seqcount, IO_SEQMAX). This is sort of backwards -- > we use open code for the simple case because it is simple with either > spelling, but we use lmin() for the complicated case to avoid spelling out > the howmany() expression twice. This obscures the 2 overflow bugs in the > howmany() expression and many delicate type promotions and type equivalences > that are needed for lmin() to work. > > > B) > > fp->f_seqcount += lmin(IO_SEQMAX, > > howmany(resid, 16384)); > > fp->f_seqcount = lmin(fp->f_seqcount, IO_SEQMAX); > > Consistent style, but another has another type error. f_seqcount has type > int. Of course, lmin() handles ints too, but to see that it works you > still have to check that f_seqcount is representable as long and once you > do that it is easier to see that imin() is courrect. > > > C) > > if (fp->f_seqcount + howmany(resid, 16384) < fp->f_seqcount) > > fp->f_seqcount = IO_SEQMAX; > > else > > fp->f_seqcount = lmin(IO_SEQMAX, > > fp->f_seqcount + howmany(resid, 16384)); > > > > I'm probably not a fan of C). > > On supported arches, it recovers from overflow in howmany(), but only if > the compiler doesn't optimize away the recovery. > > The first part can be done better: > > if (uio->uio_resid >= IO_SEQMAX * 16384) > fp->f_seqcount = IO_SEQMAX; > > Then for the second part, any version works since all values are small and > non-negative, but I prefer to restore the the version that I rewrote 15-20 > years ago and committed 11 years ago (r175106): > > fp->f_seqcount += howmany(uio->uio_resid, 16384); > if (fp->f_seqcount > IO_SEQMAX) > fp->f_seqcount = IO_SEQMAX; > > My changes to this were to use 16384 instead of BKVASIZE and howmany() > instead of its expansion. Changing to howmany() was a mistake since > it hides the first overflow. When I rewrote it, uio_resid had type > int so it was small enough after division by 16384, but not small enough > to add (16384 - 1) to. I didn't change the open-coded clamp on f_seqcount > in this because it was good enough. > > Bruce Bruce, Is this how you want it? Index: sys/kern/vfs_vnops.c =================================================================== --- sys/kern/vfs_vnops.c (revision 349977) +++ sys/kern/vfs_vnops.c (working copy) @@ -499,8 +499,13 @@ * closely related to the best I/O size for real disks than * to any block size used by software. */ - fp->f_seqcount += lmin(IO_SEQMAX, - howmany(uio->uio_resid, 16384)); + if (uio->uio_resid >= IO_SEQMAX * 16384) + fp->f_seqcount = IO_SEQMAX; + else { + fp->f_seqcount += howmany(uio->uio_resid, 16384); + if (fp->f_seqcount > IO_SEQMAX) + fp->f_seqcount = IO_SEQMAX; + } return (fp->f_seqcount << IO_SEQSHIFT); } -Alan From owner-svn-src-all@freebsd.org Tue Jul 16 22:27:50 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F2402BC016; Tue, 16 Jul 2019 22:27:50 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D46F080114; Tue, 16 Jul 2019 22:27:50 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A8855CFB1; Tue, 16 Jul 2019 22:27:50 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6GMRoF0051875; Tue, 16 Jul 2019 22:27:50 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6GMRnwG051868; Tue, 16 Jul 2019 22:27:49 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201907162227.x6GMRnwG051868@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Tue, 16 Jul 2019 22:27:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350067 - in head/contrib/netbsd-tests/lib/libc: gen stdio sys X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head/contrib/netbsd-tests/lib/libc: gen stdio sys X-SVN-Commit-Revision: 350067 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D46F080114 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.92 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.92)[-0.920,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jul 2019 22:27:51 -0000 Author: brooks Date: Tue Jul 16 22:27:49 2019 New Revision: 350067 URL: https://svnweb.freebsd.org/changeset/base/350067 Log: Add missing mode in open(2) calls with O_CREAT. When O_CREAT is specified, the third, variadic argument is required as the permission. If on is not passed, then depending on the ABI, either the contents of the third argument register or some arbitrary stuff on the stack will be used as the permission. This has been merged to NetBSD. Reviewed by: asomers, ngie Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D20972 Modified: head/contrib/netbsd-tests/lib/libc/gen/t_ftok.c head/contrib/netbsd-tests/lib/libc/stdio/t_fopen.c head/contrib/netbsd-tests/lib/libc/sys/t_access.c head/contrib/netbsd-tests/lib/libc/sys/t_mprotect.c head/contrib/netbsd-tests/lib/libc/sys/t_stat.c head/contrib/netbsd-tests/lib/libc/sys/t_write.c Modified: head/contrib/netbsd-tests/lib/libc/gen/t_ftok.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/gen/t_ftok.c Tue Jul 16 19:40:23 2019 (r350066) +++ head/contrib/netbsd-tests/lib/libc/gen/t_ftok.c Tue Jul 16 22:27:49 2019 (r350067) @@ -65,7 +65,7 @@ ATF_TC_BODY(ftok_link, tc) key_t k1, k2, k3; int fd; - fd = open(path, O_RDONLY | O_CREAT); + fd = open(path, O_RDONLY | O_CREAT, 0600); ATF_REQUIRE(fd >= 0); (void)close(fd); Modified: head/contrib/netbsd-tests/lib/libc/stdio/t_fopen.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/stdio/t_fopen.c Tue Jul 16 19:40:23 2019 (r350066) +++ head/contrib/netbsd-tests/lib/libc/stdio/t_fopen.c Tue Jul 16 22:27:49 2019 (r350067) @@ -58,7 +58,7 @@ ATF_TC_BODY(fdopen_close, tc) * used to fdopen(3) a stream is * closed once the stream is closed. */ - fd = open(path, O_RDWR | O_CREAT); + fd = open(path, O_RDWR | O_CREAT, 0600); ATF_REQUIRE(fd >= 0); @@ -85,7 +85,7 @@ ATF_TC_BODY(fdopen_err, tc) { int fd; - fd = open(path, O_RDONLY | O_CREAT); + fd = open(path, O_RDONLY | O_CREAT, 0600); ATF_REQUIRE(fd >= 0); errno = 0; @@ -126,7 +126,7 @@ ATF_TC_BODY(fdopen_seek, tc) * with the stream corresponds with the offset * set earlier for the file descriptor. */ - fd = open(path, O_RDWR | O_CREAT); + fd = open(path, O_RDWR | O_CREAT, 0600); ATF_REQUIRE(fd >= 0); ATF_REQUIRE(write(fd, "garbage", 7) == 7); Modified: head/contrib/netbsd-tests/lib/libc/sys/t_access.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/sys/t_access.c Tue Jul 16 19:40:23 2019 (r350066) +++ head/contrib/netbsd-tests/lib/libc/sys/t_access.c Tue Jul 16 22:27:49 2019 (r350067) @@ -62,7 +62,7 @@ ATF_TC_BODY(access_access, tc) size_t i; int fd; - fd = open(path, O_RDONLY | O_CREAT); + fd = open(path, O_RDONLY | O_CREAT, 0600); if (fd < 0) return; Modified: head/contrib/netbsd-tests/lib/libc/sys/t_mprotect.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/sys/t_mprotect.c Tue Jul 16 19:40:23 2019 (r350066) +++ head/contrib/netbsd-tests/lib/libc/sys/t_mprotect.c Tue Jul 16 22:27:49 2019 (r350067) @@ -116,7 +116,7 @@ ATF_TC_BODY(mprotect_access, tc) size_t i; int fd; - fd = open(path, O_RDONLY | O_CREAT); + fd = open(path, O_RDONLY | O_CREAT, 0600); ATF_REQUIRE(fd >= 0); /* Modified: head/contrib/netbsd-tests/lib/libc/sys/t_stat.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/sys/t_stat.c Tue Jul 16 19:40:23 2019 (r350066) +++ head/contrib/netbsd-tests/lib/libc/sys/t_stat.c Tue Jul 16 22:27:49 2019 (r350067) @@ -64,7 +64,7 @@ ATF_TC_BODY(stat_chflags, tc) (void)memset(&sa, 0, sizeof(struct stat)); (void)memset(&sb, 0, sizeof(struct stat)); - fd = open(path, O_RDONLY | O_CREAT); + fd = open(path, O_RDONLY | O_CREAT, 0600); ATF_REQUIRE(fd != -1); ATF_REQUIRE(stat(path, &sa) == 0); @@ -210,7 +210,7 @@ ATF_TC_BODY(stat_mtime, tc) (void)memset(&sa, 0, sizeof(struct stat)); (void)memset(&sb, 0, sizeof(struct stat)); - fd[i] = open(path, O_WRONLY | O_CREAT); + fd[i] = open(path, O_WRONLY | O_CREAT, 0600); ATF_REQUIRE(fd[i] != -1); ATF_REQUIRE(write(fd[i], "X", 1) == 1); @@ -254,7 +254,7 @@ ATF_TC_BODY(stat_perm, tc) uid = getuid(); gid = getgid(); - fd = open(path, O_RDONLY | O_CREAT); + fd = open(path, O_RDONLY | O_CREAT, 0600); ATF_REQUIRE(fd != -1); ATF_REQUIRE(fstat(fd, &sa) == 0); @@ -288,7 +288,7 @@ ATF_TC_BODY(stat_size, tc) size_t i; int fd; - fd = open(path, O_WRONLY | O_CREAT); + fd = open(path, O_WRONLY | O_CREAT, 0600); ATF_REQUIRE(fd >= 0); for (i = 0; i < n; i++) { @@ -377,7 +377,7 @@ ATF_TC_BODY(stat_symlink, tc) (void)memset(&sa, 0, sizeof(struct stat)); (void)memset(&sb, 0, sizeof(struct stat)); - fd = open(path, O_WRONLY | O_CREAT); + fd = open(path, O_WRONLY | O_CREAT, 0600); ATF_REQUIRE(fd >= 0); ATF_REQUIRE(symlink(path, pathlink) == 0); Modified: head/contrib/netbsd-tests/lib/libc/sys/t_write.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/sys/t_write.c Tue Jul 16 19:40:23 2019 (r350066) +++ head/contrib/netbsd-tests/lib/libc/sys/t_write.c Tue Jul 16 22:27:49 2019 (r350067) @@ -69,7 +69,7 @@ ATF_TC_BODY(write_err, tc) errno = 0; ATF_REQUIRE_ERRNO(EBADF, write(-1, wbuf, sizeof(wbuf)) == -1); - fd = open(path, O_RDWR | O_CREAT); + fd = open(path, O_RDWR | O_CREAT, 0600); if (fd >= 0) { @@ -141,7 +141,7 @@ ATF_TC_BODY(write_pos, tc) size_t i; int fd; - fd = open(path, O_RDWR | O_CREAT); + fd = open(path, O_RDWR | O_CREAT, 0600); ATF_REQUIRE(fd >= 0); for (i = 0; i < n; i++) { @@ -171,7 +171,7 @@ ATF_TC_BODY(write_ret, tc) size_t i, j; int fd; - fd = open(path, O_WRONLY | O_CREAT); + fd = open(path, O_WRONLY | O_CREAT, 0600); ATF_REQUIRE(fd >= 0); (void)memset(buf, 'x', sizeof(buf)); From owner-svn-src-all@freebsd.org Tue Jul 16 22:55:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 57541BC848; Tue, 16 Jul 2019 22:55:31 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3959281038; Tue, 16 Jul 2019 22:55:31 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0F217D4F6; Tue, 16 Jul 2019 22:55:31 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6GMtU0f069455; Tue, 16 Jul 2019 22:55:30 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6GMtUCR069454; Tue, 16 Jul 2019 22:55:30 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201907162255.x6GMtUCR069454@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 16 Jul 2019 22:55:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350068 - head/sys/dev/nvme X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/nvme X-SVN-Commit-Revision: 350068 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3959281038 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.92 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.92)[-0.918,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jul 2019 22:55:31 -0000 Author: imp Date: Tue Jul 16 22:55:30 2019 New Revision: 350068 URL: https://svnweb.freebsd.org/changeset/base/350068 Log: Assume that the timeout value from the capacity is 1-based Neither the 1.3 or 1.4 standards say this number is 1's based, but adding 1 costs little and copes with those NVMe drives that report '0' in this field cheaply. This is consistent with what the Linux driver does as well. Modified: head/sys/dev/nvme/nvme_ctrlr.c Modified: head/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- head/sys/dev/nvme/nvme_ctrlr.c Tue Jul 16 22:27:49 2019 (r350067) +++ head/sys/dev/nvme/nvme_ctrlr.c Tue Jul 16 22:55:30 2019 (r350068) @@ -1255,7 +1255,7 @@ nvme_ctrlr_construct(struct nvme_controller *ctrlr, de /* Get ready timeout value from controller, in units of 500ms. */ cap_lo = nvme_mmio_read_4(ctrlr, cap_lo); - to = (cap_lo >> NVME_CAP_LO_REG_TO_SHIFT) & NVME_CAP_LO_REG_TO_MASK; + to = ((cap_lo >> NVME_CAP_LO_REG_TO_SHIFT) & NVME_CAP_LO_REG_TO_MASK) + 1; ctrlr->ready_timeout_in_ms = to * 500; timeout_period = NVME_DEFAULT_TIMEOUT_PERIOD; From owner-svn-src-all@freebsd.org Tue Jul 16 22:59:16 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AAFF1BC91E; Tue, 16 Jul 2019 22:59:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8CE6281246; Tue, 16 Jul 2019 22:59:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 68853D4F8; Tue, 16 Jul 2019 22:59:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6GMxGQQ069700; Tue, 16 Jul 2019 22:59:16 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6GMxFrJ069696; Tue, 16 Jul 2019 22:59:15 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201907162259.x6GMxFrJ069696@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 16 Jul 2019 22:59:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350069 - head/usr.bin/truss X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/usr.bin/truss X-SVN-Commit-Revision: 350069 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8CE6281246 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.92 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.92)[-0.923,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jul 2019 22:59:16 -0000 Author: jhb Date: Tue Jul 16 22:59:15 2019 New Revision: 350069 URL: https://svnweb.freebsd.org/changeset/base/350069 Log: Use PT_GET_SC_ARGS and PT_GET_SC_RET in truss. This removes all of the architecture-specific functions from truss. A per-ABI structure is still needed to map syscall numbers to names and FreeBSD errno values to ABI error values as well as hold syscall counters. However, the linker set of ABI structures is now replaced with a simple table mapping ABI names to structures. This approach permits sharing the same ABI structure among separate names such as i386 a.out and ELF binaries as well as ELF v1 vs ELF v2 for powerpc64. A few differences are visible due to using PT_GET_SC_RET to fetch the error value of a system call. Note that ktrace/kdump have had the "new" behaviors for a long time already: - System calls that return with EJUSTRETURN or ERESTART will now be noticed and logged as such. Previously sigreturn (which uses EJUSTRETURN) would report whatever random value was in the register holding errno from the previous system call for example. Now it reports EJUSTRETURN. - System calls that return errno as their error value such as posix_fallocate() and posix_fadvise() now report non-zero return values as errors instead of success with a non-zero return value. Reviewed by: kib MFC after: 1 month Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D20963 Deleted: head/usr.bin/truss/aarch64-cloudabi32.c head/usr.bin/truss/aarch64-cloudabi64.c head/usr.bin/truss/aarch64-freebsd.c head/usr.bin/truss/amd64-cloudabi32.c head/usr.bin/truss/amd64-cloudabi64.c head/usr.bin/truss/amd64-freebsd.c head/usr.bin/truss/amd64-freebsd32.c head/usr.bin/truss/amd64-linux.c head/usr.bin/truss/amd64-linux32.c head/usr.bin/truss/arm-freebsd.c head/usr.bin/truss/i386-cloudabi32.c head/usr.bin/truss/i386-freebsd.c head/usr.bin/truss/i386-linux.c head/usr.bin/truss/mips-freebsd.c head/usr.bin/truss/powerpc-freebsd.c head/usr.bin/truss/powerpc64-freebsd.c head/usr.bin/truss/powerpc64-freebsd32.c head/usr.bin/truss/riscv-freebsd.c head/usr.bin/truss/sparc64-freebsd.c Modified: head/usr.bin/truss/Makefile head/usr.bin/truss/setup.c head/usr.bin/truss/syscall.h head/usr.bin/truss/syscalls.c head/usr.bin/truss/truss.h Modified: head/usr.bin/truss/Makefile ============================================================================== --- head/usr.bin/truss/Makefile Tue Jul 16 22:55:30 2019 (r350068) +++ head/usr.bin/truss/Makefile Tue Jul 16 22:59:15 2019 (r350069) @@ -9,38 +9,4 @@ LIBADD= sysdecode #CFLAGS+= -I${.CURDIR} -I. -I${SRCTOP}/sys CFLAGS+= -I${SRCTOP}/sys -ABIS+= freebsd -# Each ABI is expected to have an ABI.c, MACHINE_ARCH-ABI.c or -# MACHINE_CPUARCH-ABI.c file that will be used to map the syscall arguments. -.if ${MACHINE_ARCH} == "aarch64" -ABIS+= cloudabi32 -ABIS+= cloudabi64 -.endif -.if ${MACHINE_CPUARCH} == "i386" -ABIS+= i386-linux -ABIS+= cloudabi32 -.endif -.if ${MACHINE_CPUARCH} == "amd64" -ABIS+= amd64-linux -ABIS+= amd64-linux32 -ABIS+= freebsd32 -ABIS+= cloudabi32 -ABIS+= cloudabi64 -.endif -.if ${MACHINE_ARCH} == "powerpc64" -ABIS+= freebsd32 -.endif - -.for abi in ${ABIS} -# Find the right file to handle this ABI. -abi_src= -ABI_SRCS= ${abi}.c ${MACHINE_ARCH}-${abi}.c ${MACHINE_CPUARCH}-${abi}.c -.for f in ${ABI_SRCS} -.if exists(${.CURDIR}/${f}) && empty(abi_src) -abi_src= ${f} -.endif -.endfor -SRCS:= ${SRCS} ${abi_src} -.endfor - .include Modified: head/usr.bin/truss/setup.c ============================================================================== --- head/usr.bin/truss/setup.c Tue Jul 16 22:55:30 2019 (r350068) +++ head/usr.bin/truss/setup.c Tue Jul 16 22:59:15 2019 (r350069) @@ -61,7 +61,10 @@ __FBSDID("$FreeBSD$"); #include "syscall.h" #include "extern.h" -SET_DECLARE(procabi, struct procabi); +struct procabi_table { + const char *name; + struct procabi *abi; +}; static sig_atomic_t detaching; @@ -69,6 +72,79 @@ static void enter_syscall(struct trussinfo *, struct t struct ptrace_lwpinfo *); static void new_proc(struct trussinfo *, pid_t, lwpid_t); + +static struct procabi cloudabi32 = { + "CloudABI32", + SYSDECODE_ABI_CLOUDABI32, + STAILQ_HEAD_INITIALIZER(cloudabi32.extra_syscalls), + { NULL } +}; + +static struct procabi cloudabi64 = { + "CloudABI64", + SYSDECODE_ABI_CLOUDABI64, + STAILQ_HEAD_INITIALIZER(cloudabi64.extra_syscalls), + { NULL } +}; + +static struct procabi freebsd = { + "FreeBSD", + SYSDECODE_ABI_FREEBSD, + STAILQ_HEAD_INITIALIZER(freebsd.extra_syscalls), + { NULL } +}; + +#ifdef __LP64__ +static struct procabi freebsd32 = { + "FreeBSD32", + SYSDECODE_ABI_FREEBSD32, + STAILQ_HEAD_INITIALIZER(freebsd32.extra_syscalls), + { NULL } +}; +#endif + +static struct procabi linux = { + "Linux", + SYSDECODE_ABI_LINUX, + STAILQ_HEAD_INITIALIZER(linux.extra_syscalls), + { NULL } +}; + +#ifdef __LP64__ +static struct procabi linux32 = { + "Linux32", + SYSDECODE_ABI_LINUX32, + STAILQ_HEAD_INITIALIZER(linux32.extra_syscalls), + { NULL } +}; +#endif + +static struct procabi_table abis[] = { + { "CloudABI ELF32", &cloudabi32 }, + { "CloudABI ELF64", &cloudabi64 }, +#ifdef __LP64__ + { "FreeBSD ELF64", &freebsd }, + { "FreeBSD ELF32", &freebsd32 }, +#else + { "FreeBSD ELF32", &freebsd }, +#endif +#if defined(__powerpc64__) + { "FreeBSD ELF64 V2", &freebsd }, +#endif +#if defined(__amd64__) + { "FreeBSD a.out", &freebsd32 }, +#endif +#if defined(__i386__) + { "FreeBSD a.out", &freebsd }, +#endif +#ifdef __LP64__ + { "Linux ELF64", &linux }, + { "Linux ELF32", &linux32 }, +#else + { "Linux ELF", &linux }, +#endif +}; + /* * setup_and_wait() is called to start a process. All it really does * is fork(), enable tracing in the child, and then exec the given @@ -153,8 +229,8 @@ detach_proc(pid_t pid) static struct procabi * find_abi(pid_t pid) { - struct procabi **pabi; size_t len; + unsigned int i; int error; int mib[4]; char progt[32]; @@ -168,9 +244,9 @@ find_abi(pid_t pid) if (error != 0) err(2, "can not get sysvec name"); - SET_FOREACH(pabi, procabi) { - if (strcmp((*pabi)->type, progt) == 0) - return (*pabi); + for (i = 0; i < nitems(abis); i++) { + if (strcmp(abis[i].name, progt) == 0) + return (abis[i].abi); } warnx("ABI %s for pid %ld is not supported", progt, (long)pid); return (NULL); @@ -376,7 +452,8 @@ enter_syscall(struct trussinfo *info, struct threadinf alloc_syscall(t, pl); narg = MIN(pl->pl_syscall_narg, nitems(t->cs.args)); - if (narg != 0 && t->proc->abi->fetch_args(info, narg) != 0) { + if (narg != 0 && ptrace(PT_GET_SC_ARGS, t->tid, (caddr_t)t->cs.args, + sizeof(t->cs.args)) != 0) { free_syscall(t); return; } @@ -408,7 +485,7 @@ enter_syscall(struct trussinfo *info, struct threadinf #endif if (!(sc->args[i].type & OUT)) { t->cs.s_args[i] = print_arg(&sc->args[i], - t->cs.args, 0, info); + t->cs.args, NULL, info); } } #if DEBUG @@ -446,9 +523,8 @@ exit_syscall(struct trussinfo *info, struct ptrace_lwp struct threadinfo *t; struct procinfo *p; struct syscall *sc; - long retval[2]; + struct ptrace_sc_ret psr; u_int i; - int errorp; t = info->curthread; if (!t->in_syscall) @@ -456,7 +532,7 @@ exit_syscall(struct trussinfo *info, struct ptrace_lwp clock_gettime(CLOCK_REALTIME, &t->after); p = t->proc; - if (p->abi->fetch_retval(info, retval, &errorp) < 0) { + if (ptrace(PT_GET_SC_RET, t->tid, (caddr_t)&psr, sizeof(psr)) != 0) { free_syscall(t); return; } @@ -474,18 +550,18 @@ exit_syscall(struct trussinfo *info, struct ptrace_lwp * If an error occurred, then don't bother * getting the data; it may not be valid. */ - if (errorp) { + if (psr.sr_error != 0) { asprintf(&temp, "0x%lx", t->cs.args[sc->args[i].offset]); } else { temp = print_arg(&sc->args[i], - t->cs.args, retval, info); + t->cs.args, psr.sr_retval, info); } t->cs.s_args[i] = temp; } } - print_syscall_ret(info, errorp, retval); + print_syscall_ret(info, psr.sr_error, psr.sr_retval); free_syscall(t); /* Modified: head/usr.bin/truss/syscall.h ============================================================================== --- head/usr.bin/truss/syscall.h Tue Jul 16 22:55:30 2019 (r350068) +++ head/usr.bin/truss/syscall.h Tue Jul 16 22:59:15 2019 (r350069) @@ -227,7 +227,8 @@ struct syscall { }; struct syscall *get_syscall(struct threadinfo *, u_int, u_int); -char *print_arg(struct syscall_args *, unsigned long*, long *, struct trussinfo *); +char *print_arg(struct syscall_args *, unsigned long*, register_t *, + struct trussinfo *); /* * Linux Socket defines @@ -271,5 +272,5 @@ struct linux_socketcall_args { void init_syscalls(void); void print_syscall(struct trussinfo *); -void print_syscall_ret(struct trussinfo *, int, long *); +void print_syscall_ret(struct trussinfo *, int, register_t *); void print_summary(struct trussinfo *trussinfo); Modified: head/usr.bin/truss/syscalls.c ============================================================================== --- head/usr.bin/truss/syscalls.c Tue Jul 16 22:55:30 2019 (r350068) +++ head/usr.bin/truss/syscalls.c Tue Jul 16 22:59:15 2019 (r350069) @@ -61,6 +61,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#define _WANT_KERNEL_ERRNO +#include #include #include #include @@ -1556,7 +1558,7 @@ print_cmsgs(FILE *fp, pid_t pid, bool receive, struct * an array of all of the system call arguments. */ char * -print_arg(struct syscall_args *sc, unsigned long *args, long *retval, +print_arg(struct syscall_args *sc, unsigned long *args, register_t *retval, struct trussinfo *trussinfo) { FILE *fp; @@ -2277,7 +2279,7 @@ print_arg(struct syscall_args *sc, unsigned long *args * Overwrite the first retval to signal a successful * return as well. */ - fprintf(fp, "{ %ld, %ld }", retval[0], retval[1]); + fprintf(fp, "{ %d, %d }", (int)retval[0], (int)retval[1]); retval[0] = 0; break; case Utrace: { @@ -2646,12 +2648,11 @@ print_syscall(struct trussinfo *trussinfo) } void -print_syscall_ret(struct trussinfo *trussinfo, int errorp, long *retval) +print_syscall_ret(struct trussinfo *trussinfo, int error, register_t *retval) { struct timespec timediff; struct threadinfo *t; struct syscall *sc; - int error; t = trussinfo->curthread; sc = t->cs.sc; @@ -2659,7 +2660,7 @@ print_syscall_ret(struct trussinfo *trussinfo, int err timespecsub(&t->after, &t->before, &timediff); timespecadd(&sc->time, &timediff, &sc->time); sc->ncalls++; - if (errorp) + if (error != 0) sc->nerror++; return; } @@ -2676,11 +2677,14 @@ print_syscall_ret(struct trussinfo *trussinfo, int err return; } - if (errorp) { - error = sysdecode_abi_to_freebsd_errno(t->proc->abi->abi, - retval[0]); - fprintf(trussinfo->outfile, " ERR#%ld '%s'\n", retval[0], - error == INT_MAX ? "Unknown error" : strerror(error)); + if (error == ERESTART) + fprintf(trussinfo->outfile, " ERESTART\n"); + else if (error == EJUSTRETURN) + fprintf(trussinfo->outfile, " EJUSTRETURN\n"); + else if (error != 0) { + fprintf(trussinfo->outfile, " ERR#%d '%s'\n", + sysdecode_freebsd_to_abi_errno(t->proc->abi->abi, error), + strerror(error)); } #ifndef __LP64__ else if (sc->ret_type == 2) { @@ -2696,8 +2700,8 @@ print_syscall_ret(struct trussinfo *trussinfo, int err } #endif else - fprintf(trussinfo->outfile, " = %ld (0x%lx)\n", retval[0], - retval[0]); + fprintf(trussinfo->outfile, " = %jd (0x%jx)\n", + (intmax_t)retval[0], (intmax_t)retval[0]); } void Modified: head/usr.bin/truss/truss.h ============================================================================== --- head/usr.bin/truss/truss.h Tue Jul 16 22:55:30 2019 (r350068) +++ head/usr.bin/truss/truss.h Tue Jul 16 22:59:15 2019 (r350069) @@ -27,7 +27,6 @@ * $FreeBSD$ */ -#include #include #define FOLLOWFORKS 0x00000001 @@ -59,13 +58,9 @@ struct extra_syscall { struct procabi { const char *type; enum sysdecode_abi abi; - int (*fetch_args)(struct trussinfo *, u_int); - int (*fetch_retval)(struct trussinfo *, long *, int *); STAILQ_HEAD(, extra_syscall) extra_syscalls; struct syscall *syscalls[SYSCALL_NORMAL_COUNT]; }; - -#define PROCABI(abi) DATA_SET(procabi, abi) /* * This is confusingly named. It holds per-thread state about the From owner-svn-src-all@freebsd.org Tue Jul 16 23:02:57 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 996E2BCB47; Tue, 16 Jul 2019 23:02:57 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) 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 4BAC5819D1; Tue, 16 Jul 2019 23:02:57 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-4.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id C8ECA1184D; Tue, 16 Jul 2019 23:02:53 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r350069 - head/usr.bin/truss From: John Baldwin To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201907162259.x6GMxFrJ069696@repo.freebsd.org> Openpgp: preference=signencrypt Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: <7bbc1a04-33b8-e6a4-7bda-2253de294806@FreeBSD.org> Date: Tue, 16 Jul 2019 16:02:51 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <201907162259.x6GMxFrJ069696@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4BAC5819D1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.88 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.88)[-0.880,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jul 2019 23:02:57 -0000 On 7/16/19 3:59 PM, John Baldwin wrote: > Author: jhb > Date: Tue Jul 16 22:59:15 2019 > New Revision: 350069 > URL: https://svnweb.freebsd.org/changeset/base/350069 > > Log: > Use PT_GET_SC_ARGS and PT_GET_SC_RET in truss. > > This removes all of the architecture-specific functions from truss. > > A per-ABI structure is still needed to map syscall numbers to names > and FreeBSD errno values to ABI error values as well as hold syscall > counters. However, the linker set of ABI structures is now replaced > with a simple table mapping ABI names to structures. This approach > permits sharing the same ABI structure among separate names such as > i386 a.out and ELF binaries as well as ELF v1 vs ELF v2 for powerpc64. > > A few differences are visible due to using PT_GET_SC_RET to fetch the > error value of a system call. Note that ktrace/kdump have had the > "new" behaviors for a long time already: > - System calls that return with EJUSTRETURN or ERESTART will now be > noticed and logged as such. Previously sigreturn (which uses > EJUSTRETURN) would report whatever random value was in the register > holding errno from the previous system call for example. Now it > reports EJUSTRETURN. > - System calls that return errno as their error value such as > posix_fallocate() and posix_fadvise() now report non-zero return > values as errors instead of success with a non-zero return value. > > Reviewed by: kib > MFC after: 1 month > Sponsored by: DARPA > Differential Revision: https://reviews.freebsd.org/D20963 One side effect of this change that I haven't tested is that I think this enables truss for 64-bit Linux and 32-bit FreeBSD binaries on aarch64. -- John Baldwin From owner-svn-src-all@freebsd.org Tue Jul 16 23:12:28 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 55154BCDEA; Tue, 16 Jul 2019 23:12:28 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 343FB8218B; Tue, 16 Jul 2019 23:12:28 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 17A6FD8A2; Tue, 16 Jul 2019 23:12:28 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6GNCRvI081349; Tue, 16 Jul 2019 23:12:27 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6GNCR3E081347; Tue, 16 Jul 2019 23:12:27 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201907162312.x6GNCR3E081347@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Tue, 16 Jul 2019 23:12:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350070 - in head/sys/ufs: ffs ufs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: in head/sys/ufs: ffs ufs X-SVN-Commit-Revision: 350070 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 343FB8218B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.948,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jul 2019 23:12:28 -0000 Author: mckusick Date: Tue Jul 16 23:12:27 2019 New Revision: 350070 URL: https://svnweb.freebsd.org/changeset/base/350070 Log: When a process attempts to allocate space on a full filesystem, a filesystem full message is sent to the offending process or the kernel log if the offending process cannot be identified. To prevent an explotion of messages, the kernel ppsratecheck() function is used to limit the messages to one per second. This revision changes the variable that tracks the rate of these messages from a systemwide limit to a per-filesystem limit by moving it from a global variable to a variable in the ufsmount structure. Suggested by: kib Reviewed by: kib Sponsored by: Netflix Modified: head/sys/ufs/ffs/ffs_alloc.c head/sys/ufs/ffs/ffs_balloc.c head/sys/ufs/ufs/ufsmount.h Modified: head/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_alloc.c Tue Jul 16 22:59:15 2019 (r350069) +++ head/sys/ufs/ffs/ffs_alloc.c Tue Jul 16 23:12:27 2019 (r350070) @@ -158,8 +158,6 @@ ffs_alloc(ip, lbn, bpref, size, flags, cred, bnp) struct ufsmount *ump; ufs2_daddr_t bno; u_int cg, reclaimed; - static struct timeval lastfail; - static int curfail; int64_t delta; #ifdef QUOTA int error; @@ -224,11 +222,14 @@ nospace: softdep_request_cleanup(fs, ITOV(ip), cred, FLUSH_BLOCKS_WAIT); goto retry; } - UFS_UNLOCK(ump); - if (reclaimed > 0 && ppsratecheck(&lastfail, &curfail, 1)) { + if (reclaimed > 0 && + ppsratecheck(&ump->um_last_fullmsg, &ump->um_secs_fullmsg, 1)) { + UFS_UNLOCK(ump); ffs_fserr(fs, ip->i_number, "filesystem full"); uprintf("\n%s: write failed, filesystem is full\n", fs->fs_fsmnt); + } else { + UFS_UNLOCK(ump); } return (ENOSPC); } @@ -258,8 +259,6 @@ ffs_realloccg(ip, lbprev, bprev, bpref, osize, nsize, u_int cg, request, reclaimed; int error, gbflags; ufs2_daddr_t bno; - static struct timeval lastfail; - static int curfail; int64_t delta; vp = ITOV(ip); @@ -449,14 +448,17 @@ nospace: softdep_request_cleanup(fs, vp, cred, FLUSH_BLOCKS_WAIT); goto retry; } - UFS_UNLOCK(ump); - if (bp) - brelse(bp); - if (reclaimed > 0 && ppsratecheck(&lastfail, &curfail, 1)) { + if (reclaimed > 0 && + ppsratecheck(&ump->um_last_fullmsg, &ump->um_secs_fullmsg, 1)) { + UFS_UNLOCK(ump); ffs_fserr(fs, ip->i_number, "filesystem full"); uprintf("\n%s: write failed, filesystem is full\n", fs->fs_fsmnt); + } else { + UFS_UNLOCK(ump); } + if (bp) + brelse(bp); return (ENOSPC); } @@ -1101,8 +1103,6 @@ ffs_valloc(pvp, mode, cred, vpp) ino_t ino, ipref; u_int cg; int error, error1, reclaimed; - static struct timeval lastfail; - static int curfail; *vpp = NULL; pip = VTOI(pvp); @@ -1193,11 +1193,13 @@ noinodes: softdep_request_cleanup(fs, pvp, cred, FLUSH_INODES_WAIT); goto retry; } - UFS_UNLOCK(ump); - if (ppsratecheck(&lastfail, &curfail, 1)) { + if (ppsratecheck(&ump->um_last_fullmsg, &ump->um_secs_fullmsg, 1)) { + UFS_UNLOCK(ump); ffs_fserr(fs, pip->i_number, "out of inodes"); uprintf("\n%s: create/symlink failed, no inodes free\n", fs->fs_fsmnt); + } else { + UFS_UNLOCK(ump); } return (ENOSPC); } Modified: head/sys/ufs/ffs/ffs_balloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_balloc.c Tue Jul 16 22:59:15 2019 (r350069) +++ head/sys/ufs/ffs/ffs_balloc.c Tue Jul 16 23:12:27 2019 (r350070) @@ -108,8 +108,6 @@ ffs_balloc_ufs1(struct vnode *vp, off_t startoffset, i ufs2_daddr_t *lbns_remfree, lbns[UFS_NIADDR + 1]; int unwindidx = -1; int saved_inbdflush; - static struct timeval lastfail; - static int curfail; int gbflags, reclaimed; ip = VTOI(vp); @@ -315,17 +313,21 @@ retry: if ((error = ffs_alloc(ip, lbn, pref, (int)fs->fs_bsize, flags | IO_BUFLOCKED, cred, &newb)) != 0) { brelse(bp); + UFS_LOCK(ump); if (DOINGSOFTDEP(vp) && ++reclaimed == 1) { - UFS_LOCK(ump); softdep_request_cleanup(fs, vp, cred, FLUSH_BLOCKS_WAIT); UFS_UNLOCK(ump); goto retry; } - if (ppsratecheck(&lastfail, &curfail, 1)) { + if (ppsratecheck(&ump->um_last_fullmsg, + &ump->um_secs_fullmsg, 1)) { + UFS_UNLOCK(ump); ffs_fserr(fs, ip->i_number, "filesystem full"); uprintf("\n%s: write failed, filesystem " "is full\n", fs->fs_fsmnt); + } else { + UFS_UNLOCK(ump); } goto fail; } @@ -394,17 +396,21 @@ retry: flags | IO_BUFLOCKED, cred, &newb); if (error) { brelse(bp); + UFS_LOCK(ump); if (DOINGSOFTDEP(vp) && ++reclaimed == 1) { - UFS_LOCK(ump); softdep_request_cleanup(fs, vp, cred, FLUSH_BLOCKS_WAIT); UFS_UNLOCK(ump); goto retry; } - if (ppsratecheck(&lastfail, &curfail, 1)) { + if (ppsratecheck(&ump->um_last_fullmsg, + &ump->um_secs_fullmsg, 1)) { + UFS_UNLOCK(ump); ffs_fserr(fs, ip->i_number, "filesystem full"); uprintf("\n%s: write failed, filesystem " "is full\n", fs->fs_fsmnt); + } else { + UFS_UNLOCK(ump); } goto fail; } @@ -582,8 +588,6 @@ ffs_balloc_ufs2(struct vnode *vp, off_t startoffset, i int deallocated, osize, nsize, num, i, error; int unwindidx = -1; int saved_inbdflush; - static struct timeval lastfail; - static int curfail; int gbflags, reclaimed; ip = VTOI(vp); @@ -902,17 +906,21 @@ retry: if ((error = ffs_alloc(ip, lbn, pref, (int)fs->fs_bsize, flags | IO_BUFLOCKED, cred, &newb)) != 0) { brelse(bp); + UFS_LOCK(ump); if (DOINGSOFTDEP(vp) && ++reclaimed == 1) { - UFS_LOCK(ump); softdep_request_cleanup(fs, vp, cred, FLUSH_BLOCKS_WAIT); UFS_UNLOCK(ump); goto retry; } - if (ppsratecheck(&lastfail, &curfail, 1)) { + if (ppsratecheck(&ump->um_last_fullmsg, + &ump->um_secs_fullmsg, 1)) { + UFS_UNLOCK(ump); ffs_fserr(fs, ip->i_number, "filesystem full"); uprintf("\n%s: write failed, filesystem " "is full\n", fs->fs_fsmnt); + } else { + UFS_UNLOCK(ump); } goto fail; } @@ -982,17 +990,21 @@ retry: flags | IO_BUFLOCKED, cred, &newb); if (error) { brelse(bp); + UFS_LOCK(ump); if (DOINGSOFTDEP(vp) && ++reclaimed == 1) { - UFS_LOCK(ump); softdep_request_cleanup(fs, vp, cred, FLUSH_BLOCKS_WAIT); UFS_UNLOCK(ump); goto retry; } - if (ppsratecheck(&lastfail, &curfail, 1)) { + if (ppsratecheck(&ump->um_last_fullmsg, + &ump->um_secs_fullmsg, 1)) { + UFS_UNLOCK(ump); ffs_fserr(fs, ip->i_number, "filesystem full"); uprintf("\n%s: write failed, filesystem " "is full\n", fs->fs_fsmnt); + } else { + UFS_UNLOCK(ump); } goto fail; } Modified: head/sys/ufs/ufs/ufsmount.h ============================================================================== --- head/sys/ufs/ufs/ufsmount.h Tue Jul 16 22:59:15 2019 (r350069) +++ head/sys/ufs/ufs/ufsmount.h Tue Jul 16 23:12:27 2019 (r350070) @@ -100,6 +100,8 @@ struct ufsmount { char um_qflags[MAXQUOTAS]; /* (i) quota specific flags */ int64_t um_savedmaxfilesize; /* (c) track maxfilesize */ u_int um_flags; /* (i) filesystem flags */ + struct timeval um_last_fullmsg; /* (i) last full msg time */ + int um_secs_fullmsg; /* (i) seconds since full msg */ u_int um_trim_inflight; /* (i) outstanding trim count */ u_int um_trim_inflight_blks; /* (i) outstanding trim blks */ u_long um_trim_total; /* (i) total trim count */ From owner-svn-src-all@freebsd.org Tue Jul 16 23:39:40 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 68DF4BD22F; Tue, 16 Jul 2019 23:39:40 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48FB082C11; Tue, 16 Jul 2019 23:39:40 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1E1B1DC19; Tue, 16 Jul 2019 23:39:40 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6GNddrl093373; Tue, 16 Jul 2019 23:39:39 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6GNddjJ093372; Tue, 16 Jul 2019 23:39:39 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201907162339.x6GNddjJ093372@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Tue, 16 Jul 2019 23:39:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350071 - head/sys/ufs/ufs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/sys/ufs/ufs X-SVN-Commit-Revision: 350071 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 48FB082C11 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.94)[-0.941,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jul 2019 23:39:40 -0000 Author: mckusick Date: Tue Jul 16 23:39:39 2019 New Revision: 350071 URL: https://svnweb.freebsd.org/changeset/base/350071 Log: Style. No change intended. Modified: head/sys/ufs/ufs/ufsmount.h Modified: head/sys/ufs/ufs/ufsmount.h ============================================================================== --- head/sys/ufs/ufs/ufsmount.h Tue Jul 16 23:12:27 2019 (r350070) +++ head/sys/ufs/ufs/ufsmount.h Tue Jul 16 23:39:39 2019 (r350071) @@ -132,11 +132,15 @@ struct ufsmount { /* * function prototypes */ -#define UFS_BALLOC(aa, bb, cc, dd, ee, ff) VFSTOUFS((aa)->v_mount)->um_balloc(aa, bb, cc, dd, ee, ff) -#define UFS_BLKATOFF(aa, bb, cc, dd) VFSTOUFS((aa)->v_mount)->um_blkatoff(aa, bb, cc, dd) -#define UFS_TRUNCATE(aa, bb, cc, dd) VFSTOUFS((aa)->v_mount)->um_truncate(aa, bb, cc, dd) +#define UFS_BALLOC(aa, bb, cc, dd, ee, ff) \ + VFSTOUFS((aa)->v_mount)->um_balloc(aa, bb, cc, dd, ee, ff) +#define UFS_BLKATOFF(aa, bb, cc, dd) \ + VFSTOUFS((aa)->v_mount)->um_blkatoff(aa, bb, cc, dd) +#define UFS_TRUNCATE(aa, bb, cc, dd) \ + VFSTOUFS((aa)->v_mount)->um_truncate(aa, bb, cc, dd) #define UFS_UPDATE(aa, bb) VFSTOUFS((aa)->v_mount)->um_update(aa, bb) -#define UFS_VALLOC(aa, bb, cc, dd) VFSTOUFS((aa)->v_mount)->um_valloc(aa, bb, cc, dd) +#define UFS_VALLOC(aa, bb, cc, dd) \ + VFSTOUFS((aa)->v_mount)->um_valloc(aa, bb, cc, dd) #define UFS_VFREE(aa, bb, cc) VFSTOUFS((aa)->v_mount)->um_vfree(aa, bb, cc) #define UFS_IFREE(aa, bb) ((aa)->um_ifree(aa, bb)) #define UFS_RDONLY(aa) (ITOUMP(aa)->um_rdonly(aa)) From owner-svn-src-all@freebsd.org Wed Jul 17 00:27:12 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2363ABDDDF; Wed, 17 Jul 2019 00:27:12 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 050EB844CF; Wed, 17 Jul 2019 00:27:12 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CFA14E4F1; Wed, 17 Jul 2019 00:27:11 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6H0RBsk022948; Wed, 17 Jul 2019 00:27:11 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6H0RBmd022947; Wed, 17 Jul 2019 00:27:11 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201907170027.x6H0RBmd022947@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 17 Jul 2019 00:27:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350072 - stable/12/sys/dev/iwm X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/dev/iwm X-SVN-Commit-Revision: 350072 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 050EB844CF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.93)[-0.935,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jul 2019 00:27:12 -0000 Author: markj Date: Wed Jul 17 00:27:11 2019 New Revision: 350072 URL: https://svnweb.freebsd.org/changeset/base/350072 Log: MFC r349711: iwm: Drain callouts after stopping the device during detach. Modified: stable/12/sys/dev/iwm/if_iwm.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/12/sys/dev/iwm/if_iwm.c Tue Jul 16 23:39:39 2019 (r350071) +++ stable/12/sys/dev/iwm/if_iwm.c Wed Jul 17 00:27:11 2019 (r350072) @@ -6330,12 +6330,9 @@ iwm_detach_local(struct iwm_softc *sc, int do_net80211 if (!sc->sc_attached) return 0; sc->sc_attached = 0; - - if (do_net80211) + if (do_net80211) { ieee80211_draintask(&sc->sc_ic, &sc->sc_es_task); - - callout_drain(&sc->sc_led_blink_to); - callout_drain(&sc->sc_watchdog_to); + } iwm_stop_device(sc); if (do_net80211) { IWM_LOCK(sc); @@ -6343,6 +6340,8 @@ iwm_detach_local(struct iwm_softc *sc, int do_net80211 IWM_UNLOCK(sc); ieee80211_ifdetach(&sc->sc_ic); } + callout_drain(&sc->sc_led_blink_to); + callout_drain(&sc->sc_watchdog_to); iwm_phy_db_free(sc->sc_phy_db); sc->sc_phy_db = NULL; From owner-svn-src-all@freebsd.org Wed Jul 17 01:05:34 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 37958BE83F; Wed, 17 Jul 2019 01:05:34 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 17D6085975; Wed, 17 Jul 2019 01:05:34 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F116BEC4F; Wed, 17 Jul 2019 01:05:33 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6H15Xtu046363; Wed, 17 Jul 2019 01:05:33 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6H15XPH046362; Wed, 17 Jul 2019 01:05:33 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201907170105.x6H15XPH046362@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 17 Jul 2019 01:05:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r350073 - in stable: 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 350073 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 17D6085975 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.93)[-0.935,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jul 2019 01:05:34 -0000 Author: cy Date: Wed Jul 17 01:05:33 2019 New Revision: 350073 URL: https://svnweb.freebsd.org/changeset/base/350073 Log: MFC r349978: style(9) Modified: stable/11/sys/contrib/ipfilter/netinet/fil.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/sys/contrib/ipfilter/netinet/fil.c Directory Properties: stable/12/ (props changed) Modified: stable/11/sys/contrib/ipfilter/netinet/fil.c ============================================================================== --- stable/11/sys/contrib/ipfilter/netinet/fil.c Wed Jul 17 00:27:11 2019 (r350072) +++ stable/11/sys/contrib/ipfilter/netinet/fil.c Wed Jul 17 01:05:33 2019 (r350073) @@ -4431,23 +4431,23 @@ static int ipf_rule_compare(frentry_t *fr1, frentry_t *fr2) { if (fr1->fr_cksum != fr2->fr_cksum) - return 1; + return (1); if (fr1->fr_size != fr2->fr_size) - return 2; + return (2); if (fr1->fr_dsize != fr2->fr_dsize) - return 3; + return (3); if (bcmp((char *)&fr1->fr_func, (char *)&fr2->fr_func, fr1->fr_size - offsetof(struct frentry, fr_func)) != 0) - return 4; + return (4); if (fr1->fr_data && !fr2->fr_data) - return 5; + return (5); if (!fr1->fr_data && fr2->fr_data) - return 6; + return (6); if (fr1->fr_data) { if (bcmp(fr1->fr_caddr, fr2->fr_caddr, fr1->fr_dsize)) - return 7; + return (7); } - return 0; + return (0); } From owner-svn-src-all@freebsd.org Wed Jul 17 01:05:34 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 91146BE845; Wed, 17 Jul 2019 01:05:34 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7343485976; Wed, 17 Jul 2019 01:05:34 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4D923EC50; Wed, 17 Jul 2019 01:05:34 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6H15Ynu046369; Wed, 17 Jul 2019 01:05:34 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6H15YEH046368; Wed, 17 Jul 2019 01:05:34 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201907170105.x6H15YEH046368@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 17 Jul 2019 01:05:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350073 - in stable: 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 350073 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7343485976 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.93)[-0.935,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jul 2019 01:05:34 -0000 Author: cy Date: Wed Jul 17 01:05:33 2019 New Revision: 350073 URL: https://svnweb.freebsd.org/changeset/base/350073 Log: MFC r349978: style(9) Modified: stable/12/sys/contrib/ipfilter/netinet/fil.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/contrib/ipfilter/netinet/fil.c Directory Properties: stable/11/ (props changed) Modified: stable/12/sys/contrib/ipfilter/netinet/fil.c ============================================================================== --- stable/12/sys/contrib/ipfilter/netinet/fil.c Wed Jul 17 00:27:11 2019 (r350072) +++ stable/12/sys/contrib/ipfilter/netinet/fil.c Wed Jul 17 01:05:33 2019 (r350073) @@ -4431,23 +4431,23 @@ static int ipf_rule_compare(frentry_t *fr1, frentry_t *fr2) { if (fr1->fr_cksum != fr2->fr_cksum) - return 1; + return (1); if (fr1->fr_size != fr2->fr_size) - return 2; + return (2); if (fr1->fr_dsize != fr2->fr_dsize) - return 3; + return (3); if (bcmp((char *)&fr1->fr_func, (char *)&fr2->fr_func, fr1->fr_size - offsetof(struct frentry, fr_func)) != 0) - return 4; + return (4); if (fr1->fr_data && !fr2->fr_data) - return 5; + return (5); if (!fr1->fr_data && fr2->fr_data) - return 6; + return (6); if (fr1->fr_data) { if (bcmp(fr1->fr_caddr, fr2->fr_caddr, fr1->fr_dsize)) - return 7; + return (7); } - return 0; + return (0); } From owner-svn-src-all@freebsd.org Wed Jul 17 01:56:41 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3DDC9BF314; Wed, 17 Jul 2019 01:56:41 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2009F872B5; Wed, 17 Jul 2019 01:56:41 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E91F1F577; Wed, 17 Jul 2019 01:56:40 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6H1uei5076084; Wed, 17 Jul 2019 01:56:40 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6H1ueWR076081; Wed, 17 Jul 2019 01:56:40 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201907170156.x6H1ueWR076081@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Wed, 17 Jul 2019 01:56:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350074 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: kevlo X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 350074 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2009F872B5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jul 2019 01:56:41 -0000 Author: kevlo Date: Wed Jul 17 01:56:40 2019 New Revision: 350074 URL: https://svnweb.freebsd.org/changeset/base/350074 Log: Mention iflib(4). Modified: head/share/man/man4/ixgbe.4 head/share/man/man4/ixl.4 head/share/man/man4/vmx.4 Modified: head/share/man/man4/ixgbe.4 ============================================================================== --- head/share/man/man4/ixgbe.4 Wed Jul 17 01:05:33 2019 (r350073) +++ head/share/man/man4/ixgbe.4 Wed Jul 17 01:56:40 2019 (r350074) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 30, 2019 +.Dd July 17, 2019 .Dt IXGBE 4 .Os .Sh NAME @@ -110,6 +110,7 @@ issue to .Sh SEE ALSO .Xr altq 4 , .Xr arp 4 , +.Xr iflib 4 , .Xr netintro 4 , .Xr ng_ether 4 , .Xr polling 4 , Modified: head/share/man/man4/ixl.4 ============================================================================== --- head/share/man/man4/ixl.4 Wed Jul 17 01:05:33 2019 (r350073) +++ head/share/man/man4/ixl.4 Wed Jul 17 01:56:40 2019 (r350074) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 30, 2019 +.Dd July 17, 2019 .Dt IXL 4 .Os .Sh NAME @@ -271,11 +271,11 @@ email all the specific information related to the issu .Sh SEE ALSO .Xr arp 4 , .Xr iavf 4 , +.Xr iflib 4, .Xr netintro 4 , .Xr vlan 4 , .Xr ifconfig 8 , -.Xr iovctl 8 , -.Xr iflib 9 +.Xr iovctl 8 .Sh HISTORY The .Nm Modified: head/share/man/man4/vmx.4 ============================================================================== --- head/share/man/man4/vmx.4 Wed Jul 17 01:05:33 2019 (r350073) +++ head/share/man/man4/vmx.4 Wed Jul 17 01:56:40 2019 (r350074) @@ -17,7 +17,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 30, 2019 +.Dd July 17, 2019 .Dt VMX 4 .Os .Sh NAME @@ -137,6 +137,7 @@ ethernet0.virtualDev = "vmxnet3" .Xr altq 4 , .Xr arp 4 , .Xr em 4 , +.Xr iflib 4 , .Xr netintro 4 , .Xr ng_ether 4 , .Xr pcn 4 , From owner-svn-src-all@freebsd.org Wed Jul 17 02:08:58 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 55FB7BF61A; Wed, 17 Jul 2019 02:08:58 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 98DC487A70; Wed, 17 Jul 2019 02:08:57 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 85757F751; Wed, 17 Jul 2019 02:08:57 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6H28vbH082293; Wed, 17 Jul 2019 02:08:57 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6H28vW7082292; Wed, 17 Jul 2019 02:08:57 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201907170208.x6H28vW7082292@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Wed, 17 Jul 2019 02:08:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350075 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: kevlo X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 350075 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 98DC487A70 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.92 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.93)[-0.925,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jul 2019 02:08:58 -0000 Author: kevlo Date: Wed Jul 17 02:08:57 2019 New Revision: 350075 URL: https://svnweb.freebsd.org/changeset/base/350075 Log: Add an MLINK for igb. Discussed with: lwhsu Modified: head/share/man/man4/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Wed Jul 17 01:56:40 2019 (r350074) +++ head/share/man/man4/Makefile Wed Jul 17 02:08:57 2019 (r350075) @@ -618,7 +618,9 @@ MLINKS+=cxgbev.4 if_cxgbev.4 \ MLINKS+=dc.4 if_dc.4 MLINKS+=disc.4 if_disc.4 MLINKS+=edsc.4 if_edsc.4 -MLINKS+=em.4 if_em.4 +MLINKS+=em.4 if_em.4 \ + em.4 igb.4 \ + em.4 if_igb.4 MLINKS+=enc.4 if_enc.4 MLINKS+=epair.4 if_epair.4 MLINKS+=et.4 if_et.4 From owner-svn-src-all@freebsd.org Wed Jul 17 02:24:17 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8EC2EBFB49; Wed, 17 Jul 2019 02:24:17 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 70F9688488; Wed, 17 Jul 2019 02:24:17 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4AF83FABA; Wed, 17 Jul 2019 02:24:17 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6H2OHSR093891; Wed, 17 Jul 2019 02:24:17 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6H2OHA9093890; Wed, 17 Jul 2019 02:24:17 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201907170224.x6H2OHA9093890@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Wed, 17 Jul 2019 02:24:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350076 - head X-SVN-Group: head X-SVN-Commit-Author: kevlo X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 350076 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 70F9688488 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jul 2019 02:24:17 -0000 Author: kevlo Date: Wed Jul 17 02:24:16 2019 New Revision: 350076 URL: https://svnweb.freebsd.org/changeset/base/350076 Log: More follow-up to r350075, I forgot to update ObsoleteFiles. Spotted by: lwhsu Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Wed Jul 17 02:08:57 2019 (r350075) +++ head/ObsoleteFiles.inc Wed Jul 17 02:24:16 2019 (r350076) @@ -2374,9 +2374,6 @@ OLD_FILES+=usr/tests/usr.sbin/pw/pw_useradd OLD_FILES+=usr/tests/usr.sbin/pw/pw_userdel OLD_FILES+=usr/tests/usr.sbin/pw/pw_usermod OLD_FILES+=usr/tests/usr.sbin/pw/pw_usernext -# 20170322: garbage collect old references to igb(4) -OLD_FILES+=usr/share/man/man4/if_igb.4.gz -OLD_FILES+=usr/share/man/man4/igb.4.gz # 20170319: io_test requires zh_TW.Big5 locale. OLD_FILES+=usr/tests/lib/libc/locale/io_test # 20170319: remove nls for non supported Big5* locales From owner-svn-src-all@freebsd.org Wed Jul 17 03:19:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2A0A3A1B11; Wed, 17 Jul 2019 03:19:31 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D1FF88A1CA; Wed, 17 Jul 2019 03:19:30 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AC1CC18409; Wed, 17 Jul 2019 03:19:30 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6H3JUhh024685; Wed, 17 Jul 2019 03:19:30 GMT (envelope-from chuck@FreeBSD.org) Received: (from chuck@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6H3JUQC024684; Wed, 17 Jul 2019 03:19:30 GMT (envelope-from chuck@FreeBSD.org) Message-Id: <201907170319.x6H3JUQC024684@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: chuck set sender to chuck@FreeBSD.org using -f From: Chuck Tuffli Date: Wed, 17 Jul 2019 03:19:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350077 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: chuck X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 350077 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D1FF88A1CA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jul 2019 03:19:31 -0000 Author: chuck Date: Wed Jul 17 03:19:30 2019 New Revision: 350077 URL: https://svnweb.freebsd.org/changeset/base/350077 Log: bhyve: update the NVMe CQ based on the status Instead of skipping the NVMe Completion Queue update based on the opcode, define a synthetic status value which indicates the completion queue entry is invalid. This will also allow deferred completion queue updates for other commands. Also returns the correct status for unrecognized opcodes ("invalid opcode"). Reviewed by: imp, jhb, araujo Approved by: imp (mentor), jhb (maintainer) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D20945 Modified: head/usr.sbin/bhyve/pci_nvme.c Modified: head/usr.sbin/bhyve/pci_nvme.c ============================================================================== --- head/usr.sbin/bhyve/pci_nvme.c Wed Jul 17 02:24:16 2019 (r350076) +++ head/usr.sbin/bhyve/pci_nvme.c Wed Jul 17 03:19:30 2019 (r350077) @@ -99,6 +99,10 @@ static int nvme_debug = 0; #define NVME_PRP2_ITEMS (PAGE_SIZE/sizeof(uint64_t)) #define NVME_MAX_BLOCKIOVS 512 +/* This is a synthetic status code to indicate there is no status */ +#define NVME_NO_STATUS 0xffff +#define NVME_COMPLETION_VALID(c) ((c).status != NVME_NO_STATUS) + /* helpers */ /* Convert a zero-based value into a one-based value */ @@ -1093,14 +1097,16 @@ pci_nvme_handle_admin_cmd(struct pci_nvme_softc* sc, u /* XXX dont care, unhandled for now do_intr |= nvme_opc_async_event_req(sc, cmd, &compl); */ + compl.status = NVME_NO_STATUS; break; default: WPRINTF(("0x%x command is not implemented\r\n", cmd->opc)); + pci_nvme_status_genc(&compl.status, NVME_SC_INVALID_OPCODE); + do_intr |= 1; } - /* for now skip async event generation */ - if (cmd->opc != NVME_OPC_ASYNC_EVENT_REQUEST) { + if (NVME_COMPLETION_VALID(compl)) { struct nvme_completion *cp; int phase; From owner-svn-src-all@freebsd.org Wed Jul 17 04:13:48 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0B9F2A2EC9; Wed, 17 Jul 2019 04:13:48 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E14E48C893; Wed, 17 Jul 2019 04:13:47 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BAFA818F22; Wed, 17 Jul 2019 04:13:47 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6H4Dlan059439; Wed, 17 Jul 2019 04:13:47 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6H4Dlvd059436; Wed, 17 Jul 2019 04:13:47 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201907170413.x6H4Dlvd059436@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Wed, 17 Jul 2019 04:13:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350078 - in head: share/man/man4 sys/dev/sound/pci/hda X-SVN-Group: head X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: in head: share/man/man4 sys/dev/sound/pci/hda X-SVN-Commit-Revision: 350078 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E14E48C893 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jul 2019 04:13:48 -0000 Author: sbruno Date: Wed Jul 17 04:13:46 2019 New Revision: 350078 URL: https://svnweb.freebsd.org/changeset/base/350078 Log: I add the ability to accept the default pin widget configuration to help with various laptops using hdaa(4) sound devices. We don't seem to know the "correct" configurations for these devices and the defaults are far superiour, e.g. they work if you don't nuke the default configs. PR: 200526 Differential Revision: https://reviews.freebsd.org/D17772 Modified: head/share/man/man4/snd_hda.4 head/sys/dev/sound/pci/hda/hdaa.c head/sys/dev/sound/pci/hda/hdaa.h Modified: head/share/man/man4/snd_hda.4 ============================================================================== --- head/share/man/man4/snd_hda.4 Wed Jul 17 03:19:30 2019 (r350077) +++ head/share/man/man4/snd_hda.4 Wed Jul 17 04:13:46 2019 (r350078) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 1, 2018 +.Dd July 16, 2019 .Dt SND_HDA 4 .Os .Sh NAME @@ -153,6 +153,12 @@ The and .Dq Li ovref Ns Ar X options control the voltage used to power external microphones. +.It Va dev.hdaa.%d.init_clear +Zero out the pin widget config setup by the system. +Some systems seem to have unuseable audio devices if the pin widgit +configuration is cleared. +Set this value to 0 to accept the default configuration values setup by the +BIOS. .It Va hint.hdaa.%d.gpio_config Overrides audio function GPIO pins configuration set by BIOS. May be specified as a set of space-separated Modified: head/sys/dev/sound/pci/hda/hdaa.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdaa.c Wed Jul 17 03:19:30 2019 (r350077) +++ head/sys/dev/sound/pci/hda/hdaa.c Wed Jul 17 04:13:46 2019 (r350078) @@ -5034,11 +5034,13 @@ hdaa_audio_prepare_pin_ctrl(struct hdaa_devinfo *devin pincap = w->wclass.pin.cap; /* Disable everything. */ - w->wclass.pin.ctrl &= ~( - HDA_CMD_SET_PIN_WIDGET_CTRL_HPHN_ENABLE | - HDA_CMD_SET_PIN_WIDGET_CTRL_OUT_ENABLE | - HDA_CMD_SET_PIN_WIDGET_CTRL_IN_ENABLE | - HDA_CMD_SET_PIN_WIDGET_CTRL_VREF_ENABLE_MASK); + if (devinfo->init_clear) { + w->wclass.pin.ctrl &= ~( + HDA_CMD_SET_PIN_WIDGET_CTRL_HPHN_ENABLE | + HDA_CMD_SET_PIN_WIDGET_CTRL_OUT_ENABLE | + HDA_CMD_SET_PIN_WIDGET_CTRL_IN_ENABLE | + HDA_CMD_SET_PIN_WIDGET_CTRL_VREF_ENABLE_MASK); + } if (w->enable == 0) { /* Pin is unused so left it disabled. */ @@ -6671,6 +6673,10 @@ hdaa_attach(device_t dev) SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "reconfig", CTLTYPE_INT | CTLFLAG_RW, dev, 0, hdaa_sysctl_reconfig, "I", "Reprocess configuration"); + SYSCTL_ADD_INT(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, + "init_clear", CTLFLAG_RW, + &devinfo->init_clear, 1,"Clear initial pin widget configuration"); bus_generic_attach(dev); return (0); } Modified: head/sys/dev/sound/pci/hda/hdaa.h ============================================================================== --- head/sys/dev/sound/pci/hda/hdaa.h Wed Jul 17 03:19:30 2019 (r350077) +++ head/sys/dev/sound/pci/hda/hdaa.h Wed Jul 17 04:13:46 2019 (r350078) @@ -214,6 +214,7 @@ struct hdaa_devinfo { struct hdaa_chan *chans; struct callout poll_jack; int poll_ival; + uint32_t init_clear; }; #define HDAA_CHN_RUNNING 0x00000001 From owner-svn-src-all@freebsd.org Wed Jul 17 06:17:28 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DB857A463B; Wed, 17 Jul 2019 06:17:28 +0000 (UTC) (envelope-from tmunro@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BB5CF681B2; Wed, 17 Jul 2019 06:17:28 +0000 (UTC) (envelope-from tmunro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 95C2E1A494; Wed, 17 Jul 2019 06:17:28 +0000 (UTC) (envelope-from tmunro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6H6HS1Q030273; Wed, 17 Jul 2019 06:17:28 GMT (envelope-from tmunro@FreeBSD.org) Received: (from tmunro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6H6HSQt030271; Wed, 17 Jul 2019 06:17:28 GMT (envelope-from tmunro@FreeBSD.org) Message-Id: <201907170617.x6H6HSQt030271@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tmunro set sender to tmunro@FreeBSD.org using -f From: Thomas Munro Date: Wed, 17 Jul 2019 06:17:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350079 - in head: share/zoneinfo usr.sbin/tzsetup X-SVN-Group: head X-SVN-Commit-Author: tmunro X-SVN-Commit-Paths: in head: share/zoneinfo usr.sbin/tzsetup X-SVN-Commit-Revision: 350079 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BB5CF681B2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.93)[-0.932,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jul 2019 06:17:28 -0000 Author: tmunro Date: Wed Jul 17 06:17:27 2019 New Revision: 350079 URL: https://svnweb.freebsd.org/changeset/base/350079 Log: tzsetup: upgrade to zone1970.tab zone.tab is deprecated. Install zone1970.tab alongside it, and use it for tzsetup(8). This is also useful for other applications that need the modern better maintained file. Reviewed by: philip Approved by: allanjude (mentor) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D20646 Modified: head/share/zoneinfo/Makefile head/usr.sbin/tzsetup/tzsetup.c Modified: head/share/zoneinfo/Makefile ============================================================================== --- head/share/zoneinfo/Makefile Wed Jul 17 04:13:46 2019 (r350078) +++ head/share/zoneinfo/Makefile Wed Jul 17 06:17:27 2019 (r350079) @@ -115,6 +115,8 @@ install-zoneinfo: .endfor ${INSTALL} ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \ ${CONTRIBDIR}/zone.tab ${DESTDIR}/usr/share/zoneinfo/ + ${INSTALL} ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \ + ${CONTRIBDIR}/zone1970.tab ${DESTDIR}/usr/share/zoneinfo/ afterinstall: # Modified: head/usr.sbin/tzsetup/tzsetup.c ============================================================================== --- head/usr.sbin/tzsetup/tzsetup.c Wed Jul 17 04:13:46 2019 (r350078) +++ head/usr.sbin/tzsetup/tzsetup.c Wed Jul 17 06:17:27 2019 (r350079) @@ -53,7 +53,7 @@ __FBSDID("$FreeBSD$"); #include #endif -#define _PATH_ZONETAB "/usr/share/zoneinfo/zone.tab" +#define _PATH_ZONETAB "/usr/share/zoneinfo/zone1970.tab" #define _PATH_ISO3166 "/usr/share/misc/iso3166" #define _PATH_ZONEINFO "/usr/share/zoneinfo" #define _PATH_LOCALTIME "/etc/localtime" @@ -217,7 +217,7 @@ struct continent { int nitems; }; -static struct continent africa, america, antarctica, arctic, asia, atlantic; +static struct continent africa, america, antarctica, asia, atlantic; static struct continent australia, europe, indian, pacific, utc; static struct continent_names { @@ -227,7 +227,6 @@ static struct continent_names { { "Africa", &africa }, { "America", &america }, { "Antarctica", &antarctica }, - { "Arctic", &arctic }, { "Asia", &asia }, { "Atlantic", &atlantic }, { "Australia", &australia }, @@ -244,21 +243,20 @@ static struct continent_items { { "1", "Africa" }, { "2", "America -- North and South" }, { "3", "Antarctica" }, - { "4", "Arctic Ocean" }, - { "5", "Asia" }, - { "6", "Atlantic Ocean" }, - { "7", "Australia" }, - { "8", "Europe" }, - { "9", "Indian Ocean" }, - { "0", "Pacific Ocean" }, - { "a", "UTC" } + { "4", "Asia" }, + { "5", "Atlantic Ocean" }, + { "6", "Australia" }, + { "7", "Europe" }, + { "8", "Indian Ocean" }, + { "9", "Pacific Ocean" }, + { "0", "UTC" } }; #define NCONTINENTS \ (int)((sizeof(continent_items)) / (sizeof(continent_items[0]))) static dialogMenuItem continents[NCONTINENTS]; -#define OCEANP(x) ((x) == 3 || (x) == 5 || (x) == 8 || (x) == 9) +#define OCEANP(x) ((x) == 4 || (x) == 7 || (x) == 8) static int continent_country_menu(dialogMenuItem *continent) @@ -482,7 +480,7 @@ read_zones(void) FILE *fp; struct continent *cont; size_t len, contlen; - char *line, *tlc, *file, *descr, *p; + char *line, *country_list, *tlc, *file, *descr, *p; int lineno; fp = fopen(path_zonetab, "r"); @@ -498,10 +496,7 @@ read_zones(void) if (line[0] == '#') continue; - tlc = strsep(&line, "\t"); - if (strlen(tlc) != 2) - errx(1, "%s:%d: invalid country code `%s'", - path_zonetab, lineno, tlc); + country_list = strsep(&line, "\t"); /* coord = */ strsep(&line, "\t"); /* Unused */ file = strsep(&line, "\t"); /* get continent portion from continent/country */ @@ -521,7 +516,13 @@ read_zones(void) descr = (line != NULL && *line != '\0') ? line : NULL; - add_zone_to_country(lineno, tlc, descr, file, cont); + while (country_list != NULL) { + tlc = strsep(&country_list, ","); + if (strlen(tlc) != 2) + errx(1, "%s:%d: invalid country code `%s'", + path_zonetab, lineno, tlc); + add_zone_to_country(lineno, tlc, descr, file, cont); + } } fclose(fp); } From owner-svn-src-all@freebsd.org Wed Jul 17 14:07:23 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F3F40AD804; Wed, 17 Jul 2019 14:07:22 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id AC39C82E50; Wed, 17 Jul 2019 14:07:12 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id 7DBC93DCC08; Thu, 18 Jul 2019 00:07:02 +1000 (AEST) Date: Thu, 18 Jul 2019 00:07:00 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Alan Somers cc: Bruce Evans , John Baldwin , "Conrad E. Meyer" , src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r349391 - head/sys/kern In-Reply-To: Message-ID: <20190717235525.L1726@besplex.bde.org> References: <201906251944.x5PJiNaA093352@repo.freebsd.org> <3b2ade4e-d19d-31e4-7ee2-c0085a00e53e@FreeBSD.org> <20190716180618.C962@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=D+Q3ErZj c=1 sm=1 tr=0 cx=a_idp_d a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=sS6U7fMKXT-JdnrxqNEA:9 a=CjuIK1q_8ugA:10 X-Rspamd-Queue-Id: AC39C82E50 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of brde@optusnet.com.au designates 211.29.132.42 as permitted sender) smtp.mailfrom=brde@optusnet.com.au X-Spamd-Result: default: False [-5.44 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; RCVD_COUNT_TWO(0.00)[2]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:211.29.132.0/23]; FREEMAIL_FROM(0.00)[optusnet.com.au]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[optusnet.com.au]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; MX_GOOD(-0.01)[extmail.optusnet.com.au]; NEURAL_HAM_SHORT(-0.54)[-0.536,0]; RCPT_COUNT_SEVEN(0.00)[7]; IP_SCORE(-2.60)[ip: (-7.44), ipnet: 211.28.0.0/14(-3.22), asn: 4804(-2.34), country: AU(0.01)]; RCVD_NO_TLS_LAST(0.10)[]; RCVD_IN_DNSWL_LOW(-0.10)[42.132.29.211.list.dnswl.org : 127.0.5.1]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[optusnet.com.au]; ASN(0.00)[asn:4804, ipnet:211.28.0.0/14, country:AU]; FREEMAIL_CC(0.00)[optusnet.com.au]; FROM_EQ_ENVFROM(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jul 2019 14:07:23 -0000 On Tue, 16 Jul 2019, Alan Somers wrote: > On Tue, Jul 16, 2019 at 3:48 AM Bruce Evans wrote: >> >> On Mon, 15 Jul 2019, John Baldwin wrote: >>> ... >>> I'm not sure which variants are most readable: >> ... >>> C) >>> if (fp->f_seqcount + howmany(resid, 16384) < fp->f_seqcount) >>> fp->f_seqcount = IO_SEQMAX; >>> else >>> fp->f_seqcount = lmin(IO_SEQMAX, >>> fp->f_seqcount + howmany(resid, 16384)); >>> >>> I'm probably not a fan of C). >> >> On supported arches, it recovers from overflow in howmany(), but only if >> the compiler doesn't optimize away the recovery. >> >> The first part can be done better: >> >> if (uio->uio_resid >= IO_SEQMAX * 16384) >> fp->f_seqcount = IO_SEQMAX; >> >> Then for the second part, any version works since all values are small and >> non-negative, but I prefer to restore the the version that I rewrote 15-20 >> years ago and committed 11 years ago (r175106): >> >> fp->f_seqcount += howmany(uio->uio_resid, 16384); >> if (fp->f_seqcount > IO_SEQMAX) >> fp->f_seqcount = IO_SEQMAX; >> ... > Bruce, > Is this how you want it? > Index: sys/kern/vfs_vnops.c > =================================================================== > --- sys/kern/vfs_vnops.c (revision 349977) > +++ sys/kern/vfs_vnops.c (working copy) > @@ -499,8 +499,13 @@ > * closely related to the best I/O size for real disks than > * to any block size used by software. > */ > - fp->f_seqcount += lmin(IO_SEQMAX, > - howmany(uio->uio_resid, 16384)); > + if (uio->uio_resid >= IO_SEQMAX * 16384) > + fp->f_seqcount = IO_SEQMAX; > + else { > + fp->f_seqcount += howmany(uio->uio_resid, 16384); > + if (fp->f_seqcount > IO_SEQMAX) > + fp->f_seqcount = IO_SEQMAX; > + } > return (fp->f_seqcount << IO_SEQSHIFT); > } That looks OK, except it is misformatted with tabs corrupted to other than 8 spaces. I checked that uio_resid is checked by some callers to be >= 0, so we don't have to check that here. (Callers between userland and here start with size_t nbytes or an array of sizes for readv(), and have to check that nbytes or the sum of the sizes fits in ssize_t, else overflow would alread have occurred on assigment to uio_resid. Callers that construct a uio that is not so directly controlled by userland presumably don't construct ones with unusable sizes.) Bruce From owner-svn-src-all@freebsd.org Wed Jul 17 14:14:52 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 99607ADA4F; Wed, 17 Jul 2019 14:14:52 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 88270833D8; Wed, 17 Jul 2019 14:14:52 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 60AF51F9A4; Wed, 17 Jul 2019 14:14:52 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6HEEqMS010416; Wed, 17 Jul 2019 14:14:52 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6HEEp4X010412; Wed, 17 Jul 2019 14:14:51 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201907171414.x6HEEp4X010412@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 17 Jul 2019 14:14:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r350080 - in vendor/sqlite3/dist: . tea X-SVN-Group: vendor X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in vendor/sqlite3/dist: . tea X-SVN-Commit-Revision: 350080 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 88270833D8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.941,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jul 2019 14:14:52 -0000 Author: cy Date: Wed Jul 17 14:14:51 2019 New Revision: 350080 URL: https://svnweb.freebsd.org/changeset/base/350080 Log: Import sqlite3-3.29.0 (3290000) Modified: vendor/sqlite3/dist/configure vendor/sqlite3/dist/configure.ac vendor/sqlite3/dist/shell.c vendor/sqlite3/dist/sqlite3.c vendor/sqlite3/dist/sqlite3.h vendor/sqlite3/dist/tea/configure vendor/sqlite3/dist/tea/configure.ac Modified: vendor/sqlite3/dist/configure ============================================================================== --- vendor/sqlite3/dist/configure Wed Jul 17 06:17:27 2019 (r350079) +++ vendor/sqlite3/dist/configure Wed Jul 17 14:14:51 2019 (r350080) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for sqlite 3.28.0. +# Generated by GNU Autoconf 2.69 for sqlite 3.29.0. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='sqlite' PACKAGE_TARNAME='sqlite' -PACKAGE_VERSION='3.28.0' -PACKAGE_STRING='sqlite 3.28.0' +PACKAGE_VERSION='3.29.0' +PACKAGE_STRING='sqlite 3.29.0' PACKAGE_BUGREPORT='http://www.sqlite.org' PACKAGE_URL='' @@ -1341,7 +1341,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures sqlite 3.28.0 to adapt to many kinds of systems. +\`configure' configures sqlite 3.29.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1412,7 +1412,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of sqlite 3.28.0:";; + short | recursive ) echo "Configuration of sqlite 3.29.0:";; esac cat <<\_ACEOF @@ -1537,7 +1537,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -sqlite configure 3.28.0 +sqlite configure 3.29.0 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1952,7 +1952,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by sqlite $as_me 3.28.0, which was +It was created by sqlite $as_me 3.29.0, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2818,7 +2818,7 @@ fi # Define the identity of the package. PACKAGE='sqlite' - VERSION='3.28.0' + VERSION='3.29.0' cat >>confdefs.h <<_ACEOF @@ -14438,7 +14438,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by sqlite $as_me 3.28.0, which was +This file was extended by sqlite $as_me 3.29.0, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -14495,7 +14495,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -sqlite config.status 3.28.0 +sqlite config.status 3.29.0 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Modified: vendor/sqlite3/dist/configure.ac ============================================================================== --- vendor/sqlite3/dist/configure.ac Wed Jul 17 06:17:27 2019 (r350079) +++ vendor/sqlite3/dist/configure.ac Wed Jul 17 14:14:51 2019 (r350080) @@ -10,7 +10,7 @@ # AC_PREREQ(2.61) -AC_INIT(sqlite, 3.28.0, http://www.sqlite.org) +AC_INIT(sqlite, 3.29.0, http://www.sqlite.org) AC_CONFIG_SRCDIR([sqlite3.c]) AC_CONFIG_AUX_DIR([.]) Modified: vendor/sqlite3/dist/shell.c ============================================================================== --- vendor/sqlite3/dist/shell.c Wed Jul 17 06:17:27 2019 (r350079) +++ vendor/sqlite3/dist/shell.c Wed Jul 17 14:14:51 2019 (r350080) @@ -983,6 +983,7 @@ static void shellAddSchemaName( ** We need several support functions from the SQLite core. */ +/* #include "sqlite3.h" */ /* ** We need several things from the ANSI and MSVCRT headers. @@ -1336,6 +1337,7 @@ INT closedir( ** is used. If SIZE is included it must be one of the integers 224, 256, ** 384, or 512, to determine SHA3 hash variant that is computed. */ +/* #include "sqlite3ext.h" */ SQLITE_EXTENSION_INIT1 #include #include @@ -2099,6 +2101,7 @@ int sqlite3_shathree_init( ** And the paths returned in the "name" column of the table are also ** relative to directory $dir. */ +/* #include "sqlite3ext.h" */ SQLITE_EXTENSION_INIT1 #include #include @@ -3056,6 +3059,7 @@ int sqlite3_fileio_init( ** faster than any human can type. ** */ +/* #include "sqlite3ext.h" */ SQLITE_EXTENSION_INIT1 #include #include @@ -3572,6 +3576,7 @@ int sqlite3_completion_init( ** If the file being opened is not an appended database, then this shim is ** a pass-through into the default underlying VFS. **/ +/* #include "sqlite3ext.h" */ SQLITE_EXTENSION_INIT1 #include #include @@ -4228,6 +4233,7 @@ int sqlite3MemTraceDeactivate(void){ ** * No support for zip64 extensions ** * Only the "inflate/deflate" (zlib) compression method is supported */ +/* #include "sqlite3ext.h" */ SQLITE_EXTENSION_INIT1 #include #include @@ -6398,6 +6404,7 @@ int sqlite3_zipfile_init( ** for working with sqlar archives and used by the shell tool's built-in ** sqlar support. */ +/* #include "sqlite3ext.h" */ SQLITE_EXTENSION_INIT1 #include @@ -6520,6 +6527,7 @@ int sqlite3_sqlar_init( */ +/* #include "sqlite3.h" */ typedef struct sqlite3expert sqlite3expert; @@ -6688,6 +6696,7 @@ void sqlite3_expert_destroy(sqlite3expert*); ** ************************************************************************* */ +/* #include "sqlite3expert.h" */ #include #include #include @@ -8631,6 +8640,863 @@ void sqlite3_expert_destroy(sqlite3expert *p){ /************************* End ../ext/expert/sqlite3expert.c ********************/ +#if !defined(SQLITE_OMIT_VIRTUALTABLE) && defined(SQLITE_ENABLE_DBPAGE_VTAB) +/************************* Begin ../ext/misc/dbdata.c ******************/ +/* +** 2019-04-17 +** +** The author disclaims copyright to this source code. In place of +** a legal notice, here is a blessing: +** +** May you do good and not evil. +** May you find forgiveness for yourself and forgive others. +** May you share freely, never taking more than you give. +** +****************************************************************************** +** +** This file contains an implementation of two eponymous virtual tables, +** "sqlite_dbdata" and "sqlite_dbptr". Both modules require that the +** "sqlite_dbpage" eponymous virtual table be available. +** +** SQLITE_DBDATA: +** sqlite_dbdata is used to extract data directly from a database b-tree +** page and its associated overflow pages, bypassing the b-tree layer. +** The table schema is equivalent to: +** +** CREATE TABLE sqlite_dbdata( +** pgno INTEGER, +** cell INTEGER, +** field INTEGER, +** value ANY, +** schema TEXT HIDDEN +** ); +** +** IMPORTANT: THE VIRTUAL TABLE SCHEMA ABOVE IS SUBJECT TO CHANGE. IN THE +** FUTURE NEW NON-HIDDEN COLUMNS MAY BE ADDED BETWEEN "value" AND +** "schema". +** +** Each page of the database is inspected. If it cannot be interpreted as +** a b-tree page, or if it is a b-tree page containing 0 entries, the +** sqlite_dbdata table contains no rows for that page. Otherwise, the +** table contains one row for each field in the record associated with +** each cell on the page. For intkey b-trees, the key value is stored in +** field -1. +** +** For example, for the database: +** +** CREATE TABLE t1(a, b); -- root page is page 2 +** INSERT INTO t1(rowid, a, b) VALUES(5, 'v', 'five'); +** INSERT INTO t1(rowid, a, b) VALUES(10, 'x', 'ten'); +** +** the sqlite_dbdata table contains, as well as from entries related to +** page 1, content equivalent to: +** +** INSERT INTO sqlite_dbdata(pgno, cell, field, value) VALUES +** (2, 0, -1, 5 ), +** (2, 0, 0, 'v' ), +** (2, 0, 1, 'five'), +** (2, 1, -1, 10 ), +** (2, 1, 0, 'x' ), +** (2, 1, 1, 'ten' ); +** +** If database corruption is encountered, this module does not report an +** error. Instead, it attempts to extract as much data as possible and +** ignores the corruption. +** +** SQLITE_DBPTR: +** The sqlite_dbptr table has the following schema: +** +** CREATE TABLE sqlite_dbptr( +** pgno INTEGER, +** child INTEGER, +** schema TEXT HIDDEN +** ); +** +** It contains one entry for each b-tree pointer between a parent and +** child page in the database. +*/ +#if !defined(SQLITEINT_H) +/* #include "sqlite3ext.h" */ + +/* typedef unsigned char u8; */ + +#endif +SQLITE_EXTENSION_INIT1 +#include +#include + +#define DBDATA_PADDING_BYTES 100 + +typedef struct DbdataTable DbdataTable; +typedef struct DbdataCursor DbdataCursor; + +/* Cursor object */ +struct DbdataCursor { + sqlite3_vtab_cursor base; /* Base class. Must be first */ + sqlite3_stmt *pStmt; /* For fetching database pages */ + + int iPgno; /* Current page number */ + u8 *aPage; /* Buffer containing page */ + int nPage; /* Size of aPage[] in bytes */ + int nCell; /* Number of cells on aPage[] */ + int iCell; /* Current cell number */ + int bOnePage; /* True to stop after one page */ + int szDb; + sqlite3_int64 iRowid; + + /* Only for the sqlite_dbdata table */ + u8 *pRec; /* Buffer containing current record */ + int nRec; /* Size of pRec[] in bytes */ + int nHdr; /* Size of header in bytes */ + int iField; /* Current field number */ + u8 *pHdrPtr; + u8 *pPtr; + + sqlite3_int64 iIntkey; /* Integer key value */ +}; + +/* Table object */ +struct DbdataTable { + sqlite3_vtab base; /* Base class. Must be first */ + sqlite3 *db; /* The database connection */ + sqlite3_stmt *pStmt; /* For fetching database pages */ + int bPtr; /* True for sqlite3_dbptr table */ +}; + +/* Column and schema definitions for sqlite_dbdata */ +#define DBDATA_COLUMN_PGNO 0 +#define DBDATA_COLUMN_CELL 1 +#define DBDATA_COLUMN_FIELD 2 +#define DBDATA_COLUMN_VALUE 3 +#define DBDATA_COLUMN_SCHEMA 4 +#define DBDATA_SCHEMA \ + "CREATE TABLE x(" \ + " pgno INTEGER," \ + " cell INTEGER," \ + " field INTEGER," \ + " value ANY," \ + " schema TEXT HIDDEN" \ + ")" + +/* Column and schema definitions for sqlite_dbptr */ +#define DBPTR_COLUMN_PGNO 0 +#define DBPTR_COLUMN_CHILD 1 +#define DBPTR_COLUMN_SCHEMA 2 +#define DBPTR_SCHEMA \ + "CREATE TABLE x(" \ + " pgno INTEGER," \ + " child INTEGER," \ + " schema TEXT HIDDEN" \ + ")" + +/* +** Connect to an sqlite_dbdata (pAux==0) or sqlite_dbptr (pAux!=0) virtual +** table. +*/ +static int dbdataConnect( + sqlite3 *db, + void *pAux, + int argc, const char *const*argv, + sqlite3_vtab **ppVtab, + char **pzErr +){ + DbdataTable *pTab = 0; + int rc = sqlite3_declare_vtab(db, pAux ? DBPTR_SCHEMA : DBDATA_SCHEMA); + + if( rc==SQLITE_OK ){ + pTab = (DbdataTable*)sqlite3_malloc64(sizeof(DbdataTable)); + if( pTab==0 ){ + rc = SQLITE_NOMEM; + }else{ + memset(pTab, 0, sizeof(DbdataTable)); + pTab->db = db; + pTab->bPtr = (pAux!=0); + } + } + + *ppVtab = (sqlite3_vtab*)pTab; + return rc; +} + +/* +** Disconnect from or destroy a sqlite_dbdata or sqlite_dbptr virtual table. +*/ +static int dbdataDisconnect(sqlite3_vtab *pVtab){ + DbdataTable *pTab = (DbdataTable*)pVtab; + if( pTab ){ + sqlite3_finalize(pTab->pStmt); + sqlite3_free(pVtab); + } + return SQLITE_OK; +} + +/* +** This function interprets two types of constraints: +** +** schema=? +** pgno=? +** +** If neither are present, idxNum is set to 0. If schema=? is present, +** the 0x01 bit in idxNum is set. If pgno=? is present, the 0x02 bit +** in idxNum is set. +** +** If both parameters are present, schema is in position 0 and pgno in +** position 1. +*/ +static int dbdataBestIndex(sqlite3_vtab *tab, sqlite3_index_info *pIdx){ + DbdataTable *pTab = (DbdataTable*)tab; + int i; + int iSchema = -1; + int iPgno = -1; + int colSchema = (pTab->bPtr ? DBPTR_COLUMN_SCHEMA : DBDATA_COLUMN_SCHEMA); + + for(i=0; inConstraint; i++){ + struct sqlite3_index_constraint *p = &pIdx->aConstraint[i]; + if( p->op==SQLITE_INDEX_CONSTRAINT_EQ ){ + if( p->iColumn==colSchema ){ + if( p->usable==0 ) return SQLITE_CONSTRAINT; + iSchema = i; + } + if( p->iColumn==DBDATA_COLUMN_PGNO && p->usable ){ + iPgno = i; + } + } + } + + if( iSchema>=0 ){ + pIdx->aConstraintUsage[iSchema].argvIndex = 1; + pIdx->aConstraintUsage[iSchema].omit = 1; + } + if( iPgno>=0 ){ + pIdx->aConstraintUsage[iPgno].argvIndex = 1 + (iSchema>=0); + pIdx->aConstraintUsage[iPgno].omit = 1; + pIdx->estimatedCost = 100; + pIdx->estimatedRows = 50; + + if( pTab->bPtr==0 && pIdx->nOrderBy && pIdx->aOrderBy[0].desc==0 ){ + int iCol = pIdx->aOrderBy[0].iColumn; + if( pIdx->nOrderBy==1 ){ + pIdx->orderByConsumed = (iCol==0 || iCol==1); + }else if( pIdx->nOrderBy==2 && pIdx->aOrderBy[1].desc==0 && iCol==0 ){ + pIdx->orderByConsumed = (pIdx->aOrderBy[1].iColumn==1); + } + } + + }else{ + pIdx->estimatedCost = 100000000; + pIdx->estimatedRows = 1000000000; + } + pIdx->idxNum = (iSchema>=0 ? 0x01 : 0x00) | (iPgno>=0 ? 0x02 : 0x00); + return SQLITE_OK; +} + +/* +** Open a new sqlite_dbdata or sqlite_dbptr cursor. +*/ +static int dbdataOpen(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCursor){ + DbdataCursor *pCsr; + + pCsr = (DbdataCursor*)sqlite3_malloc64(sizeof(DbdataCursor)); + if( pCsr==0 ){ + return SQLITE_NOMEM; + }else{ + memset(pCsr, 0, sizeof(DbdataCursor)); + pCsr->base.pVtab = pVTab; + } + + *ppCursor = (sqlite3_vtab_cursor *)pCsr; + return SQLITE_OK; +} + +/* +** Restore a cursor object to the state it was in when first allocated +** by dbdataOpen(). +*/ +static void dbdataResetCursor(DbdataCursor *pCsr){ + DbdataTable *pTab = (DbdataTable*)(pCsr->base.pVtab); + if( pTab->pStmt==0 ){ + pTab->pStmt = pCsr->pStmt; + }else{ + sqlite3_finalize(pCsr->pStmt); + } + pCsr->pStmt = 0; + pCsr->iPgno = 1; + pCsr->iCell = 0; + pCsr->iField = 0; + pCsr->bOnePage = 0; + sqlite3_free(pCsr->aPage); + sqlite3_free(pCsr->pRec); + pCsr->pRec = 0; + pCsr->aPage = 0; +} + +/* +** Close an sqlite_dbdata or sqlite_dbptr cursor. +*/ +static int dbdataClose(sqlite3_vtab_cursor *pCursor){ + DbdataCursor *pCsr = (DbdataCursor*)pCursor; + dbdataResetCursor(pCsr); + sqlite3_free(pCsr); + return SQLITE_OK; +} + +/* +** Utility methods to decode 16 and 32-bit big-endian unsigned integers. +*/ +static unsigned int get_uint16(unsigned char *a){ + return (a[0]<<8)|a[1]; +} +static unsigned int get_uint32(unsigned char *a){ + return ((unsigned int)a[0]<<24) + | ((unsigned int)a[1]<<16) + | ((unsigned int)a[2]<<8) + | ((unsigned int)a[3]); +} + +/* +** Load page pgno from the database via the sqlite_dbpage virtual table. +** If successful, set (*ppPage) to point to a buffer containing the page +** data, (*pnPage) to the size of that buffer in bytes and return +** SQLITE_OK. In this case it is the responsibility of the caller to +** eventually free the buffer using sqlite3_free(). +** +** Or, if an error occurs, set both (*ppPage) and (*pnPage) to 0 and +** return an SQLite error code. +*/ +static int dbdataLoadPage( + DbdataCursor *pCsr, /* Cursor object */ + unsigned int pgno, /* Page number of page to load */ + u8 **ppPage, /* OUT: pointer to page buffer */ + int *pnPage /* OUT: Size of (*ppPage) in bytes */ +){ + int rc2; + int rc = SQLITE_OK; + sqlite3_stmt *pStmt = pCsr->pStmt; + + *ppPage = 0; + *pnPage = 0; + sqlite3_bind_int64(pStmt, 2, pgno); + if( SQLITE_ROW==sqlite3_step(pStmt) ){ + int nCopy = sqlite3_column_bytes(pStmt, 0); + if( nCopy>0 ){ + u8 *pPage; + pPage = (u8*)sqlite3_malloc64(nCopy + DBDATA_PADDING_BYTES); + if( pPage==0 ){ + rc = SQLITE_NOMEM; + }else{ + const u8 *pCopy = sqlite3_column_blob(pStmt, 0); + memcpy(pPage, pCopy, nCopy); + memset(&pPage[nCopy], 0, DBDATA_PADDING_BYTES); + } + *ppPage = pPage; + *pnPage = nCopy; + } + } + rc2 = sqlite3_reset(pStmt); + if( rc==SQLITE_OK ) rc = rc2; + + return rc; +} + +/* +** Read a varint. Put the value in *pVal and return the number of bytes. +*/ +static int dbdataGetVarint(const u8 *z, sqlite3_int64 *pVal){ + sqlite3_int64 v = 0; + int i; + for(i=0; i<8; i++){ + v = (v<<7) + (z[i]&0x7f); + if( (z[i]&0x80)==0 ){ *pVal = v; return i+1; } + } + v = (v<<8) + (z[i]&0xff); + *pVal = v; + return 9; +} + +/* +** Return the number of bytes of space used by an SQLite value of type +** eType. +*/ +static int dbdataValueBytes(int eType){ + switch( eType ){ + case 0: case 8: case 9: + case 10: case 11: + return 0; + case 1: + return 1; + case 2: + return 2; + case 3: + return 3; + case 4: + return 4; + case 5: + return 6; + case 6: + case 7: + return 8; + default: + if( eType>0 ){ + return ((eType-12) / 2); + } + return 0; + } +} + +/* +** Load a value of type eType from buffer pData and use it to set the +** result of context object pCtx. +*/ +static void dbdataValue( + sqlite3_context *pCtx, + int eType, + u8 *pData, + int nData +){ + if( eType>=0 && dbdataValueBytes(eType)<=nData ){ + switch( eType ){ + case 0: + case 10: + case 11: + sqlite3_result_null(pCtx); + break; + + case 8: + sqlite3_result_int(pCtx, 0); + break; + case 9: + sqlite3_result_int(pCtx, 1); + break; + + case 1: case 2: case 3: case 4: case 5: case 6: case 7: { + sqlite3_uint64 v = (signed char)pData[0]; + pData++; + switch( eType ){ + case 7: + case 6: v = (v<<16) + (pData[0]<<8) + pData[1]; pData += 2; + case 5: v = (v<<16) + (pData[0]<<8) + pData[1]; pData += 2; + case 4: v = (v<<8) + pData[0]; pData++; + case 3: v = (v<<8) + pData[0]; pData++; + case 2: v = (v<<8) + pData[0]; pData++; + } + + if( eType==7 ){ + double r; + memcpy(&r, &v, sizeof(r)); + sqlite3_result_double(pCtx, r); + }else{ + sqlite3_result_int64(pCtx, (sqlite3_int64)v); + } + break; + } + + default: { + int n = ((eType-12) / 2); + if( eType % 2 ){ + sqlite3_result_text(pCtx, (const char*)pData, n, SQLITE_TRANSIENT); + }else{ + sqlite3_result_blob(pCtx, pData, n, SQLITE_TRANSIENT); + } + } + } + } +} + +/* +** Move an sqlite_dbdata or sqlite_dbptr cursor to the next entry. +*/ +static int dbdataNext(sqlite3_vtab_cursor *pCursor){ + DbdataCursor *pCsr = (DbdataCursor*)pCursor; + DbdataTable *pTab = (DbdataTable*)pCursor->pVtab; + + pCsr->iRowid++; + while( 1 ){ + int rc; + int iOff = (pCsr->iPgno==1 ? 100 : 0); + int bNextPage = 0; + + if( pCsr->aPage==0 ){ + while( 1 ){ + if( pCsr->bOnePage==0 && pCsr->iPgno>pCsr->szDb ) return SQLITE_OK; + rc = dbdataLoadPage(pCsr, pCsr->iPgno, &pCsr->aPage, &pCsr->nPage); + if( rc!=SQLITE_OK ) return rc; + if( pCsr->aPage ) break; + pCsr->iPgno++; + } + pCsr->iCell = pTab->bPtr ? -2 : 0; + pCsr->nCell = get_uint16(&pCsr->aPage[iOff+3]); + } + + if( pTab->bPtr ){ + if( pCsr->aPage[iOff]!=0x02 && pCsr->aPage[iOff]!=0x05 ){ + pCsr->iCell = pCsr->nCell; + } + pCsr->iCell++; + if( pCsr->iCell>=pCsr->nCell ){ + sqlite3_free(pCsr->aPage); + pCsr->aPage = 0; + if( pCsr->bOnePage ) return SQLITE_OK; + pCsr->iPgno++; + }else{ + return SQLITE_OK; + } + }else{ + /* If there is no record loaded, load it now. */ + if( pCsr->pRec==0 ){ + int bHasRowid = 0; + int nPointer = 0; + sqlite3_int64 nPayload = 0; + sqlite3_int64 nHdr = 0; + int iHdr; + int U, X; + int nLocal; + + switch( pCsr->aPage[iOff] ){ + case 0x02: + nPointer = 4; + break; + case 0x0a: + break; + case 0x0d: + bHasRowid = 1; + break; + default: + /* This is not a b-tree page with records on it. Continue. */ + pCsr->iCell = pCsr->nCell; + break; + } + + if( pCsr->iCell>=pCsr->nCell ){ + bNextPage = 1; + }else{ + + iOff += 8 + nPointer + pCsr->iCell*2; + if( iOff>pCsr->nPage ){ + bNextPage = 1; + }else{ + iOff = get_uint16(&pCsr->aPage[iOff]); + } + + /* For an interior node cell, skip past the child-page number */ + iOff += nPointer; + + /* Load the "byte of payload including overflow" field */ + if( bNextPage || iOff>pCsr->nPage ){ + bNextPage = 1; + }else{ + iOff += dbdataGetVarint(&pCsr->aPage[iOff], &nPayload); + } + + /* If this is a leaf intkey cell, load the rowid */ + if( bHasRowid && !bNextPage && iOffnPage ){ + iOff += dbdataGetVarint(&pCsr->aPage[iOff], &pCsr->iIntkey); + } + + /* Figure out how much data to read from the local page */ + U = pCsr->nPage; + if( bHasRowid ){ + X = U-35; + }else{ + X = ((U-12)*64/255)-23; + } + if( nPayload<=X ){ + nLocal = nPayload; + }else{ + int M, K; + M = ((U-12)*32/255)-23; + K = M+((nPayload-M)%(U-4)); + if( K<=X ){ + nLocal = K; + }else{ + nLocal = M; + } + } + + if( bNextPage || nLocal+iOff>pCsr->nPage ){ + bNextPage = 1; + }else{ + + /* Allocate space for payload. And a bit more to catch small buffer + ** overruns caused by attempting to read a varint or similar from + ** near the end of a corrupt record. */ + pCsr->pRec = (u8*)sqlite3_malloc64(nPayload+DBDATA_PADDING_BYTES); + if( pCsr->pRec==0 ) return SQLITE_NOMEM; + memset(pCsr->pRec, 0, nPayload+DBDATA_PADDING_BYTES); + pCsr->nRec = nPayload; + + /* Load the nLocal bytes of payload */ + memcpy(pCsr->pRec, &pCsr->aPage[iOff], nLocal); + iOff += nLocal; + + /* Load content from overflow pages */ + if( nPayload>nLocal ){ + sqlite3_int64 nRem = nPayload - nLocal; + unsigned int pgnoOvfl = get_uint32(&pCsr->aPage[iOff]); + while( nRem>0 ){ + u8 *aOvfl = 0; + int nOvfl = 0; + int nCopy; + rc = dbdataLoadPage(pCsr, pgnoOvfl, &aOvfl, &nOvfl); + assert( rc!=SQLITE_OK || aOvfl==0 || nOvfl==pCsr->nPage ); + if( rc!=SQLITE_OK ) return rc; + if( aOvfl==0 ) break; + + nCopy = U-4; + if( nCopy>nRem ) nCopy = nRem; + memcpy(&pCsr->pRec[nPayload-nRem], &aOvfl[4], nCopy); + nRem -= nCopy; + + pgnoOvfl = get_uint32(aOvfl); + sqlite3_free(aOvfl); + } + } + + iHdr = dbdataGetVarint(pCsr->pRec, &nHdr); + pCsr->nHdr = nHdr; + pCsr->pHdrPtr = &pCsr->pRec[iHdr]; + pCsr->pPtr = &pCsr->pRec[pCsr->nHdr]; + pCsr->iField = (bHasRowid ? -1 : 0); + } + } + }else{ + pCsr->iField++; + if( pCsr->iField>0 ){ + sqlite3_int64 iType; + if( pCsr->pHdrPtr>&pCsr->pRec[pCsr->nRec] ){ + bNextPage = 1; + }else{ + pCsr->pHdrPtr += dbdataGetVarint(pCsr->pHdrPtr, &iType); + pCsr->pPtr += dbdataValueBytes(iType); + } + } + } + + if( bNextPage ){ + sqlite3_free(pCsr->aPage); + sqlite3_free(pCsr->pRec); + pCsr->aPage = 0; + pCsr->pRec = 0; + if( pCsr->bOnePage ) return SQLITE_OK; + pCsr->iPgno++; + }else{ + if( pCsr->iField<0 || pCsr->pHdrPtr<&pCsr->pRec[pCsr->nHdr] ){ + return SQLITE_OK; + } + + /* Advance to the next cell. The next iteration of the loop will load + ** the record and so on. */ + sqlite3_free(pCsr->pRec); + pCsr->pRec = 0; + pCsr->iCell++; + } + } + } + + assert( !"can't get here" ); + return SQLITE_OK; +} + +/* +** Return true if the cursor is at EOF. +*/ +static int dbdataEof(sqlite3_vtab_cursor *pCursor){ + DbdataCursor *pCsr = (DbdataCursor*)pCursor; + return pCsr->aPage==0; +} + +/* +** Determine the size in pages of database zSchema (where zSchema is +** "main", "temp" or the name of an attached database) and set +** pCsr->szDb accordingly. If successful, return SQLITE_OK. Otherwise, +** an SQLite error code. +*/ +static int dbdataDbsize(DbdataCursor *pCsr, const char *zSchema){ + DbdataTable *pTab = (DbdataTable*)pCsr->base.pVtab; + char *zSql = 0; + int rc, rc2; + sqlite3_stmt *pStmt = 0; + + zSql = sqlite3_mprintf("PRAGMA %Q.page_count", zSchema); + if( zSql==0 ) return SQLITE_NOMEM; + rc = sqlite3_prepare_v2(pTab->db, zSql, -1, &pStmt, 0); + sqlite3_free(zSql); + if( rc==SQLITE_OK && sqlite3_step(pStmt)==SQLITE_ROW ){ + pCsr->szDb = sqlite3_column_int(pStmt, 0); + } + rc2 = sqlite3_finalize(pStmt); + if( rc==SQLITE_OK ) rc = rc2; + return rc; +} + +/* +** xFilter method for sqlite_dbdata and sqlite_dbptr. +*/ +static int dbdataFilter( + sqlite3_vtab_cursor *pCursor, + int idxNum, const char *idxStr, + int argc, sqlite3_value **argv +){ + DbdataCursor *pCsr = (DbdataCursor*)pCursor; + DbdataTable *pTab = (DbdataTable*)pCursor->pVtab; + int rc = SQLITE_OK; + const char *zSchema = "main"; + + dbdataResetCursor(pCsr); + assert( pCsr->iPgno==1 ); + if( idxNum & 0x01 ){ + zSchema = (const char*)sqlite3_value_text(argv[0]); + } + if( idxNum & 0x02 ){ + pCsr->iPgno = sqlite3_value_int(argv[(idxNum & 0x01)]); + pCsr->bOnePage = 1; + }else{ + pCsr->nPage = dbdataDbsize(pCsr, zSchema); + rc = dbdataDbsize(pCsr, zSchema); + } + + if( rc==SQLITE_OK ){ + if( pTab->pStmt ){ + pCsr->pStmt = pTab->pStmt; + pTab->pStmt = 0; + }else{ + rc = sqlite3_prepare_v2(pTab->db, + "SELECT data FROM sqlite_dbpage(?) WHERE pgno=?", -1, + &pCsr->pStmt, 0 + ); + } + } + if( rc==SQLITE_OK ){ + rc = sqlite3_bind_text(pCsr->pStmt, 1, zSchema, -1, SQLITE_TRANSIENT); + }else{ + pTab->base.zErrMsg = sqlite3_mprintf("%s", sqlite3_errmsg(pTab->db)); + } + if( rc==SQLITE_OK ){ + rc = dbdataNext(pCursor); + } + return rc; +} + +/* +** Return a column for the sqlite_dbdata or sqlite_dbptr table. +*/ +static int dbdataColumn( + sqlite3_vtab_cursor *pCursor, + sqlite3_context *ctx, + int i +){ + DbdataCursor *pCsr = (DbdataCursor*)pCursor; + DbdataTable *pTab = (DbdataTable*)pCursor->pVtab; + if( pTab->bPtr ){ + switch( i ){ + case DBPTR_COLUMN_PGNO: + sqlite3_result_int64(ctx, pCsr->iPgno); + break; + case DBPTR_COLUMN_CHILD: { + int iOff = pCsr->iPgno==1 ? 100 : 0; + if( pCsr->iCell<0 ){ + iOff += 8; + }else{ + iOff += 12 + pCsr->iCell*2; + if( iOff>pCsr->nPage ) return SQLITE_OK; + iOff = get_uint16(&pCsr->aPage[iOff]); + } + if( iOff<=pCsr->nPage ){ + sqlite3_result_int64(ctx, get_uint32(&pCsr->aPage[iOff])); + } + break; + } + } + }else{ + switch( i ){ + case DBDATA_COLUMN_PGNO: + sqlite3_result_int64(ctx, pCsr->iPgno); + break; + case DBDATA_COLUMN_CELL: + sqlite3_result_int(ctx, pCsr->iCell); + break; + case DBDATA_COLUMN_FIELD: + sqlite3_result_int(ctx, pCsr->iField); + break; + case DBDATA_COLUMN_VALUE: { + if( pCsr->iField<0 ){ + sqlite3_result_int64(ctx, pCsr->iIntkey); + }else{ + sqlite3_int64 iType; + dbdataGetVarint(pCsr->pHdrPtr, &iType); + dbdataValue( + ctx, iType, pCsr->pPtr, &pCsr->pRec[pCsr->nRec] - pCsr->pPtr + ); + } + break; + } + } + } + return SQLITE_OK; +} + +/* +** Return the rowid for an sqlite_dbdata or sqlite_dptr table. +*/ +static int dbdataRowid(sqlite3_vtab_cursor *pCursor, sqlite_int64 *pRowid){ + DbdataCursor *pCsr = (DbdataCursor*)pCursor; + *pRowid = pCsr->iRowid; + return SQLITE_OK; +} + + +/* +** Invoke this routine to register the "sqlite_dbdata" virtual table module +*/ +static int sqlite3DbdataRegister(sqlite3 *db){ + static sqlite3_module dbdata_module = { + 0, /* iVersion */ + 0, /* xCreate */ + dbdataConnect, /* xConnect */ + dbdataBestIndex, /* xBestIndex */ + dbdataDisconnect, /* xDisconnect */ + 0, /* xDestroy */ + dbdataOpen, /* xOpen - open a cursor */ + dbdataClose, /* xClose - close a cursor */ + dbdataFilter, /* xFilter - configure scan constraints */ + dbdataNext, /* xNext - advance a cursor */ + dbdataEof, /* xEof - check for end of scan */ + dbdataColumn, /* xColumn - read data */ + dbdataRowid, /* xRowid - read data */ + 0, /* xUpdate */ + 0, /* xBegin */ + 0, /* xSync */ + 0, /* xCommit */ + 0, /* xRollback */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Jul 17 14:17:51 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 02B45ADB4B; Wed, 17 Jul 2019 14:17:51 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D67D683634; Wed, 17 Jul 2019 14:17:50 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A56021F9A6; Wed, 17 Jul 2019 14:17:50 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6HEHo9I010585; Wed, 17 Jul 2019 14:17:50 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6HEHoHl010584; Wed, 17 Jul 2019 14:17:50 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201907171417.x6HEHoHl010584@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 17 Jul 2019 14:17:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r350081 - vendor/sqlite3/sqlite-autoconf-3290000 X-SVN-Group: vendor X-SVN-Commit-Author: cy X-SVN-Commit-Paths: vendor/sqlite3/sqlite-autoconf-3290000 X-SVN-Commit-Revision: 350081 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D67D683634 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.93)[-0.929,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jul 2019 14:17:51 -0000 Author: cy Date: Wed Jul 17 14:17:50 2019 New Revision: 350081 URL: https://svnweb.freebsd.org/changeset/base/350081 Log: Tag import of sqlite3-3.29.0 (3290000) Added: vendor/sqlite3/sqlite-autoconf-3290000/ - copied from r350080, vendor/sqlite3/dist/ From owner-svn-src-all@freebsd.org Wed Jul 17 15:43:16 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AD34DAF5BE; Wed, 17 Jul 2019 15:43:16 +0000 (UTC) (envelope-from philip@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) server-signature RSA-PSS (4096 bits) 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 545CF86F1E; Wed, 17 Jul 2019 15:43:16 +0000 (UTC) (envelope-from philip@freebsd.org) Received: from weatherwax.trouble.is (weatherwax.trouble.is [176.58.93.127]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "weatherwax.trouble.is", Issuer "Let's Encrypt Authority X3" (verified OK)) (Authenticated sender: philip/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 0BE3118E73; Wed, 17 Jul 2019 15:43:16 +0000 (UTC) (envelope-from philip@freebsd.org) Received: from rincewind.trouble.is (rincewind.trouble.is [95.216.22.234]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "rincewind.trouble.is", Issuer "Let's Encrypt Authority X3" (verified OK)) by weatherwax.trouble.is (Postfix) with ESMTPS id 45phPG348nz4fYZ; Wed, 17 Jul 2019 15:43:14 +0000 (UTC) Received: by rincewind.trouble.is (Postfix, from userid 1001) id 45phPF2rHxz1t2p; Wed, 17 Jul 2019 15:43:13 +0000 (UTC) Date: Wed, 17 Jul 2019 08:43:13 -0700 From: Philip Paeps To: Thomas Munro Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r350079 - in head: share/zoneinfo usr.sbin/tzsetup Message-ID: <20190717154313.GF5636@rincewind.trouble.is> Mail-Followup-To: Thomas Munro , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201907170617.x6H6HSQt030271@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <201907170617.x6H6HSQt030271@repo.freebsd.org> X-PGP-Fingerprint: 2CD1 92C2 6EE7 B7D1 F552 6619 31AE B9B5 FDBB CB0E X-Date: Today is Pungenday, the 52nd day of Confusion in the YOLD 3185 X-Phase-of-Moon: The Moon is Waning Gibbous (100% of Full) X-Clacks-Overhead: GNU Terry Pratchett Organization: Happily Disorganized User-Agent: Mutt/1.12.1 (2019-06-15) X-Rspamd-Queue-Id: 545CF86F1E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jul 2019 15:43:16 -0000 On 2019-07-17 06:17:28 (+0000), Thomas Munro wrote: >Author: tmunro >Date: Wed Jul 17 06:17:27 2019 >New Revision: 350079 >URL: https://svnweb.freebsd.org/changeset/base/350079 > >Log: > tzsetup: upgrade to zone1970.tab > > zone.tab is deprecated. Install zone1970.tab alongside it, and use it > for tzsetup(8). This is also useful for other applications that need > the modern better maintained file. > > Reviewed by: philip > Approved by: allanjude (mentor) > MFC after: 2 weeks > Differential Revision: https://reviews.freebsd.org/D20646 Thank you! Philip -- Philip Paeps Senior Reality Engineer Alternative Enterprises From owner-svn-src-all@freebsd.org Wed Jul 17 16:02:10 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F35C9AFE14; Wed, 17 Jul 2019 16:02:10 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-lj1-f196.google.com (mail-lj1-f196.google.com [209.85.208.196]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) 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 03F3487E41; Wed, 17 Jul 2019 16:02:09 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-lj1-f196.google.com with SMTP id z28so24226652ljn.4; Wed, 17 Jul 2019 09:02:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=qWSoCM83uz2K0MeYTftuNQazKMdqtB89zbdt8psr4lA=; b=V9awrTs/3YsvsbWJ8+RM4IJQZgjsxDEW/EQ2ypXicOce1OvmztkIhyKB9upW8st1tr Bw+5rBg1zEfDP4P1uaE1Rw0oEi8MJt7hNWT8mCgkBMR8SuimraZH5+g+58LMNtmcNxHp 0jZj8Ah/idiDmOhq5owcIlJG36XA9OwMPUDThbO3nvEwfK8N1S7XRNas5ZngzbPon5OA 8vOU9d8uIoO0B7ZYIJs4rRzp3yDIyRKU97mgRaK4lGRTuxahq/y/fTpoyvid+Y7fWSPk 8UsN3rB+u4k2AecCxYXGiDFLJNLPUI7fn0i80XGchx77h9qU5gxVm5cwhpNbPxHQsHeT DJnA== X-Gm-Message-State: APjAAAXmL6Hd+fiLclsY+CHGATtHfN8MeuhvGasbSoHcdr5Lb7XoeFvR JK7bBZ4LZQ1TWr/u5t+bZW6VWyTtf4OXz6TfRkCLWA== X-Google-Smtp-Source: APXvYqybVfYOLsGePOcMiSuq/oZsVsEp3vb+OF95n2xwmO7JTqY3NAHMSY687EbRe6BUN8VujYXyqbqXilzcFfcGaVE= X-Received: by 2002:a2e:9cd1:: with SMTP id g17mr21864167ljj.234.1563379321957; Wed, 17 Jul 2019 09:02:01 -0700 (PDT) MIME-Version: 1.0 References: <201906251944.x5PJiNaA093352@repo.freebsd.org> <3b2ade4e-d19d-31e4-7ee2-c0085a00e53e@FreeBSD.org> <20190716180618.C962@besplex.bde.org> <20190717235525.L1726@besplex.bde.org> In-Reply-To: <20190717235525.L1726@besplex.bde.org> From: Alan Somers Date: Wed, 17 Jul 2019 10:01:50 -0600 Message-ID: Subject: Re: svn commit: r349391 - head/sys/kern To: Bruce Evans Cc: John Baldwin , "Conrad E. Meyer" , src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 03F3487E41 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of asomers@gmail.com designates 209.85.208.196 as permitted sender) smtp.mailfrom=asomers@gmail.com X-Spamd-Result: default: False [-2.90 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.94)[-0.937,0]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[freebsd.org]; RCPT_COUNT_FIVE(0.00)[6]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; RCVD_IN_DNSWL_NONE(0.00)[196.208.85.209.list.dnswl.org : 127.0.5.0]; NEURAL_SPAM_SHORT(0.24)[0.239,0]; RCVD_TLS_LAST(0.00)[]; FORGED_SENDER(0.30)[asomers@freebsd.org,asomers@gmail.com]; FREEMAIL_TO(0.00)[optusnet.com.au]; RWL_MAILSPIKE_POSSIBLE(0.00)[196.208.85.209.rep.mailspike.net : 127.0.0.17]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[asomers@freebsd.org,asomers@gmail.com]; IP_SCORE(-1.19)[ipnet: 209.85.128.0/17(-3.45), asn: 15169(-2.44), country: US(-0.05)]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jul 2019 16:02:11 -0000 On Wed, Jul 17, 2019 at 8:07 AM Bruce Evans wrote: > > On Tue, 16 Jul 2019, Alan Somers wrote: > > > On Tue, Jul 16, 2019 at 3:48 AM Bruce Evans wrote: > >> > >> On Mon, 15 Jul 2019, John Baldwin wrote: > >>> ... > >>> I'm not sure which variants are most readable: > >> ... > >>> C) > >>> if (fp->f_seqcount + howmany(resid, 16384) < fp->f_seqcount) > >>> fp->f_seqcount = IO_SEQMAX; > >>> else > >>> fp->f_seqcount = lmin(IO_SEQMAX, > >>> fp->f_seqcount + howmany(resid, 16384)); > >>> > >>> I'm probably not a fan of C). > >> > >> On supported arches, it recovers from overflow in howmany(), but only if > >> the compiler doesn't optimize away the recovery. > >> > >> The first part can be done better: > >> > >> if (uio->uio_resid >= IO_SEQMAX * 16384) > >> fp->f_seqcount = IO_SEQMAX; > >> > >> Then for the second part, any version works since all values are small and > >> non-negative, but I prefer to restore the the version that I rewrote 15-20 > >> years ago and committed 11 years ago (r175106): > >> > >> fp->f_seqcount += howmany(uio->uio_resid, 16384); > >> if (fp->f_seqcount > IO_SEQMAX) > >> fp->f_seqcount = IO_SEQMAX; > >> ... > > Bruce, > > Is this how you want it? > > Index: sys/kern/vfs_vnops.c > > =================================================================== > > --- sys/kern/vfs_vnops.c (revision 349977) > > +++ sys/kern/vfs_vnops.c (working copy) > > @@ -499,8 +499,13 @@ > > * closely related to the best I/O size for real disks than > > * to any block size used by software. > > */ > > - fp->f_seqcount += lmin(IO_SEQMAX, > > - howmany(uio->uio_resid, 16384)); > > + if (uio->uio_resid >= IO_SEQMAX * 16384) > > + fp->f_seqcount = IO_SEQMAX; > > + else { > > + fp->f_seqcount += howmany(uio->uio_resid, 16384); > > + if (fp->f_seqcount > IO_SEQMAX) > > + fp->f_seqcount = IO_SEQMAX; > > + } > > return (fp->f_seqcount << IO_SEQSHIFT); > > } > > That looks OK, except it is misformatted with tabs corrupted to other than > 8 spaces. The screwed up whitespace is just an artifact of gmail. > > I checked that uio_resid is checked by some callers to be >= 0, so we > don't have to check that here. (Callers between userland and here > start with size_t nbytes or an array of sizes for readv(), and have > to check that nbytes or the sum of the sizes fits in ssize_t, else > overflow would alread have occurred on assigment to uio_resid. Callers > that construct a uio that is not so directly controlled by userland > presumably don't construct ones with unusable sizes.) > > Bruce Ok, I'll commit it then. From owner-svn-src-all@freebsd.org Wed Jul 17 16:31:51 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3ACA3B0B37; Wed, 17 Jul 2019 16:31:51 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1ABC389501; Wed, 17 Jul 2019 16:31:51 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EAE85211A8; Wed, 17 Jul 2019 16:31:50 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6HGVoRh092250; Wed, 17 Jul 2019 16:31:50 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6HGVofW092249; Wed, 17 Jul 2019 16:31:50 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201907171631.x6HGVofW092249@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 17 Jul 2019 16:31:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350082 - head/cddl/contrib/opensolaris/lib/libctf/common X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/lib/libctf/common X-SVN-Commit-Revision: 350082 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1ABC389501 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.951,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jul 2019 16:31:51 -0000 Author: markj Date: Wed Jul 17 16:31:50 2019 New Revision: 350082 URL: https://svnweb.freebsd.org/changeset/base/350082 Log: Reference stdint.h types in ctf.5. MFC after: 1 week Modified: head/cddl/contrib/opensolaris/lib/libctf/common/ctf.5 Modified: head/cddl/contrib/opensolaris/lib/libctf/common/ctf.5 ============================================================================== --- head/cddl/contrib/opensolaris/lib/libctf/common/ctf.5 Wed Jul 17 14:17:50 2019 (r350081) +++ head/cddl/contrib/opensolaris/lib/libctf/common/ctf.5 Wed Jul 17 16:31:50 2019 (r350082) @@ -231,9 +231,9 @@ The is defined as follows: .Bd -literal typedef struct ctf_preamble { - ushort_t ctp_magic; /* magic number (CTF_MAGIC) */ - uchar_t ctp_version; /* data format version number (CTF_VERSION) */ - uchar_t ctp_flags; /* flags (see below) */ + uint16_t ctp_magic; /* magic number (CTF_MAGIC) */ + uint8_t ctp_version; /* data format version number (CTF_VERSION) */ + uint8_t ctp_flags; /* flags (see below) */ } ctf_preamble_t; .Ed .Pp @@ -313,14 +313,14 @@ and the two have a combined size of 36 bytes. .Bd -literal typedef struct ctf_header { ctf_preamble_t cth_preamble; - uint_t cth_parlabel; /* ref to name of parent lbl uniq'd against */ - uint_t cth_parname; /* ref to basename of parent */ - uint_t cth_lbloff; /* offset of label section */ - uint_t cth_objtoff; /* offset of object section */ - uint_t cth_funcoff; /* offset of function section */ - uint_t cth_typeoff; /* offset of type section */ - uint_t cth_stroff; /* offset of string section */ - uint_t cth_strlen; /* length of string section in bytes */ + uint32_t cth_parlabel; /* ref to name of parent lbl uniq'd against */ + uint32_t cth_parname; /* ref to basename of parent */ + uint32_t cth_lbloff; /* offset of label section */ + uint32_t cth_objtoff; /* offset of object section */ + uint32_t cth_funcoff; /* offset of function section */ + uint32_t cth_typeoff; /* offset of type section */ + uint32_t cth_stroff; /* offset of string section */ + uint32_t cth_strlen; /* length of string section in bytes */ } ctf_header_t; .Ed .Pp @@ -541,8 +541,8 @@ Each label is encoded in the file format using the fol structure: .Bd -literal typedef struct ctf_lblent { - uint_t ctl_label; /* ref to name of label */ - uint_t ctl_typeidx; /* last type associated with this label */ + uint32_t ctl_label; /* ref to name of label */ + uint32_t ctl_typeidx; /* last type associated with this label */ } ctf_lblent_t; .Ed .Lp @@ -728,23 +728,23 @@ The following definitions describe the short and long #define CTF_MAX_LSIZE UINT64_MAX typedef struct ctf_stype { - uint_t ctt_name; /* reference to name in string table */ - ushort_t ctt_info; /* encoded kind, variant length */ + uint32_t ctt_name; /* reference to name in string table */ + uint16_t ctt_info; /* encoded kind, variant length */ union { - ushort_t _size; /* size of entire type in bytes */ - ushort_t _type; /* reference to another type */ + uint16_t _size; /* size of entire type in bytes */ + uint16_t _type; /* reference to another type */ } _u; } ctf_stype_t; typedef struct ctf_type { - uint_t ctt_name; /* reference to name in string table */ - ushort_t ctt_info; /* encoded kind, variant length */ + uint32_t ctt_name; /* reference to name in string table */ + uint16_t ctt_info; /* encoded kind, variant length */ union { - ushort_t _size; /* always CTF_LSIZE_SENT */ - ushort_t _type; /* do not use */ + uint16_t _size; /* always CTF_LSIZE_SENT */ + uint16_t _type; /* do not use */ } _u; - uint_t ctt_lsizehi; /* high 32 bits of type size in bytes */ - uint_t ctt_lsizelo; /* low 32 bits of type size in bytes */ + uint32_t ctt_lsizehi; /* high 32 bits of type size in bytes */ + uint32_t ctt_lsizelo; /* low 32 bits of type size in bytes */ } ctf_type_t; #define ctt_size _u._size /* for fundamental types that have a size */ @@ -754,7 +754,7 @@ typedef struct ctf_type { Type sizes are stored in .Sy bytes . The basic small form uses a -.Sy ushort_t +.Sy uint16_t to store the number of bytes. If the number of bytes in a structure would exceed 0xfffe, then the alternate form, the @@ -806,8 +806,8 @@ various kinds. Integers, which are of type .Sy CTF_K_INTEGER , have no variable length arguments. -Instead, they are followed by a four byte -.Sy uint_t +Instead, they are followed by a +.Sy uint32_t which describes their encoding. All integers must be encoded with a variable length of zero. The @@ -937,9 +937,9 @@ member is set to zero. The structure that follows an array is defined as: .Bd -literal typedef struct ctf_array { - ushort_t cta_contents; /* reference to type of array contents */ - ushort_t cta_index; /* reference to type of array index */ - uint_t cta_nelems; /* number of elements */ + uint16_t cta_contents; /* reference to type of array contents */ + uint16_t cta_index; /* reference to type of array index */ + uint32_t cta_nelems; /* number of elements */ } ctf_array_t; .Ed .Lp @@ -1005,17 +1005,17 @@ all members are encoded using the same structure. The structure for members is as follows: .Bd -literal typedef struct ctf_member { - uint_t ctm_name; /* reference to name in string table */ - ushort_t ctm_type; /* reference to type of member */ - ushort_t ctm_offset; /* offset of this member in bits */ + uint32_t ctm_name; /* reference to name in string table */ + uint16_t ctm_type; /* reference to type of member */ + uint16_t ctm_offset; /* offset of this member in bits */ } ctf_member_t; typedef struct ctf_lmember { - uint_t ctlm_name; /* reference to name in string table */ - ushort_t ctlm_type; /* reference to type of member */ - ushort_t ctlm_pad; /* padding */ - uint_t ctlm_offsethi; /* high 32 bits of member offset in bits */ - uint_t ctlm_offsetlo; /* low 32 bits of member offset in bits */ + uint32_t ctlm_name; /* reference to name in string table */ + uint16_t ctlm_type; /* reference to type of member */ + uint16_t ctlm_pad; /* padding */ + uint32_t ctlm_offsethi; /* high 32 bits of member offset in bits */ + uint32_t ctlm_offsetlo; /* low 32 bits of member offset in bits */ } ctf_lmember_t; .Ed .Lp @@ -1088,8 +1088,8 @@ The enumerators encoded in an enumeration have the fol variable list: .Bd -literal typedef struct ctf_enum { - uint_t cte_name; /* reference to name in string table */ - int cte_value; /* value associated with this name */ + uint32_t cte_name; /* reference to name in string table */ + int32_t cte_value; /* value associated with this name */ } ctf_enum_t; .Ed .Pp From owner-svn-src-all@freebsd.org Wed Jul 17 16:34:33 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 46C45B0BF2; Wed, 17 Jul 2019 16:34:33 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 28D0F89717; Wed, 17 Jul 2019 16:34:33 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 052F9212F4; Wed, 17 Jul 2019 16:34:33 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6HGYWKB093138; Wed, 17 Jul 2019 16:34:32 GMT (envelope-from johalun@FreeBSD.org) Received: (from johalun@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6HGYW1i093135; Wed, 17 Jul 2019 16:34:32 GMT (envelope-from johalun@FreeBSD.org) Message-Id: <201907171634.x6HGYW1i093135@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: johalun set sender to johalun@FreeBSD.org using -f From: Johannes Lundberg Date: Wed, 17 Jul 2019 16:34:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350083 - in stable/12/sys: compat/linuxkpi/common/include/linux sys X-SVN-Group: stable-12 X-SVN-Commit-Author: johalun X-SVN-Commit-Paths: in stable/12/sys: compat/linuxkpi/common/include/linux sys X-SVN-Commit-Revision: 350083 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 28D0F89717 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.94)[-0.945,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jul 2019 16:34:33 -0000 Author: johalun Date: Wed Jul 17 16:34:32 2019 New Revision: 350083 URL: https://svnweb.freebsd.org/changeset/base/350083 Log: MFC r349277: LinuxKPI: Additions to rcu list. - Add rcu list functions. - Make rcu hlist's foreach macro use rcu calls instead of the non-rcu macro. - Bump FreeBSD version so we have a checkpoint for the vboxvideo drm driver. Reviewed by: hps Approved by: imp (mentor), hps MFC after: 1 week Differential Revision: D20719 Modified: stable/12/sys/compat/linuxkpi/common/include/linux/rculist.h stable/12/sys/sys/param.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/rculist.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/linux/rculist.h Wed Jul 17 16:31:50 2019 (r350082) +++ stable/12/sys/compat/linuxkpi/common/include/linux/rculist.h Wed Jul 17 16:34:32 2019 (r350083) @@ -33,6 +33,25 @@ #include #include +#define list_entry_rcu(ptr, type, member) \ + container_of(READ_ONCE(ptr), type, member) + +#define list_next_rcu(head) (*((struct list_head **)(&(head)->next))) + +#define list_for_each_entry_rcu(pos, head, member) \ + for (pos = list_entry_rcu((head)->next, typeof(*(pos)), member); \ + &(pos)->member != (head); \ + pos = list_entry_rcu((pos)->member.next, typeof(*(pos)), member)) + +static inline void +list_add_rcu(struct list_head *new, struct list_head *prev) +{ + new->next = prev->next; + new->prev = prev; + rcu_assign_pointer(list_next_rcu(prev), new); + prev->prev = new; +} + #define hlist_first_rcu(head) (*((struct hlist_node **)(&(head)->first))) #define hlist_next_rcu(node) (*((struct hlist_node **)(&(node)->next))) #define hlist_pprev_rcu(node) (*((struct hlist_node **)((node)->pprev))) @@ -47,8 +66,12 @@ hlist_add_behind_rcu(struct hlist_node *n, struct hlis n->next->pprev = &n->next; } -#define hlist_for_each_entry_rcu(pos, head, member) \ - hlist_for_each_entry(pos, head, member) +#define hlist_for_each_entry_rcu(pos, head, member) \ + for (pos = hlist_entry_safe (rcu_dereference_raw(hlist_first_rcu(head)),\ + typeof(*(pos)), member); \ + (pos); \ + pos = hlist_entry_safe(rcu_dereference_raw(hlist_next_rcu( \ + &(pos)->member)), typeof(*(pos)), member)) static inline void hlist_del_rcu(struct hlist_node *n) Modified: stable/12/sys/sys/param.h ============================================================================== --- stable/12/sys/sys/param.h Wed Jul 17 16:31:50 2019 (r350082) +++ stable/12/sys/sys/param.h Wed Jul 17 16:34:32 2019 (r350083) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1200513 /* Master, propagated to newvers */ +#define __FreeBSD_version 1200514 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Wed Jul 17 16:38:30 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 48E53B0DDA; Wed, 17 Jul 2019 16:38:30 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2BDE489963; Wed, 17 Jul 2019 16:38:30 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0662B212FB; Wed, 17 Jul 2019 16:38:30 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6HGcTh2093367; Wed, 17 Jul 2019 16:38:29 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6HGcTBP093365; Wed, 17 Jul 2019 16:38:29 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201907171638.x6HGcTBP093365@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 17 Jul 2019 16:38:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350084 - in head/sys/cddl/contrib/opensolaris/uts/common: dtrace sys X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys/cddl/contrib/opensolaris/uts/common: dtrace sys X-SVN-Commit-Revision: 350084 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2BDE489963 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.949,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jul 2019 16:38:30 -0000 Author: markj Date: Wed Jul 17 16:38:29 2019 New Revision: 350084 URL: https://svnweb.freebsd.org/changeset/base/350084 Log: Fix FASTTRAPIOC_GETINSTR. This ioctl is used when a breakpoint is encountered while disassembling a symbol in the target process. Since only one DTrace consumer can toggle or enumerate fasttrap probes from a given process at time, this ioctl does not appear to be used in practice. Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c head/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap.h Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Wed Jul 17 16:34:32 2019 (r350083) +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Wed Jul 17 16:38:29 2019 (r350084) @@ -2326,10 +2326,8 @@ err: int ret; #endif -#ifdef illumos if (copyin((void *)arg, &instr, sizeof (instr)) != 0) return (EFAULT); -#endif #ifdef notyet if (!PRIV_POLICY_CHOICE(cr, PRIV_ALL, B_FALSE)) { Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap.h Wed Jul 17 16:34:32 2019 (r350083) +++ head/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap.h Wed Jul 17 16:38:29 2019 (r350084) @@ -42,7 +42,7 @@ extern "C" { #define FASTTRAPIOC_MAKEPROBE (FASTTRAPIOC | 1) #define FASTTRAPIOC_GETINSTR (FASTTRAPIOC | 2) #else -#define FASTTRAPIOC_GETINSTR _IOWR('f', 2, uint8_t) +#define FASTTRAPIOC_GETINSTR _IO('f', 2) #define FASTTRAPIOC_MAKEPROBE _IO('f', 3) #endif From owner-svn-src-all@freebsd.org Wed Jul 17 16:38:42 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EBEF0B0E1A; Wed, 17 Jul 2019 16:38:42 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C07F089A98; Wed, 17 Jul 2019 16:38:42 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BD41A212FC; Wed, 17 Jul 2019 16:38:40 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6HGceoB093420; Wed, 17 Jul 2019 16:38:40 GMT (envelope-from johalun@FreeBSD.org) Received: (from johalun@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6HGcemr093419; Wed, 17 Jul 2019 16:38:40 GMT (envelope-from johalun@FreeBSD.org) Message-Id: <201907171638.x6HGcemr093419@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: johalun set sender to johalun@FreeBSD.org using -f From: Johannes Lundberg Date: Wed, 17 Jul 2019 16:38:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350085 - stable/12/sys/compat/linuxkpi/common/include/asm X-SVN-Group: stable-12 X-SVN-Commit-Author: johalun X-SVN-Commit-Paths: stable/12/sys/compat/linuxkpi/common/include/asm X-SVN-Commit-Revision: 350085 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C07F089A98 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.943,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jul 2019 16:38:43 -0000 Author: johalun Date: Wed Jul 17 16:38:40 2019 New Revision: 350085 URL: https://svnweb.freebsd.org/changeset/base/350085 Log: MFC r349276: LinuxKPI: Add atomic_long_sub macro. Reviewed by: imp (mentor), hps Approved by: imp (mentor), hps MFC after: 1 week Differential Revision: D20718 Modified: stable/12/sys/compat/linuxkpi/common/include/asm/atomic-long.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/asm/atomic-long.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/asm/atomic-long.h Wed Jul 17 16:38:29 2019 (r350084) +++ stable/12/sys/compat/linuxkpi/common/include/asm/atomic-long.h Wed Jul 17 16:38:40 2019 (r350085) @@ -42,6 +42,7 @@ typedef struct { } atomic_long_t; #define atomic_long_add(i, v) atomic_long_add_return((i), (v)) +#define atomic_long_sub(i, v) atomic_long_add_return(-(i), (v)) #define atomic_long_inc_return(v) atomic_long_add_return(1, (v)) #define atomic_long_inc_not_zero(v) atomic_long_add_unless((v), 1, 0) From owner-svn-src-all@freebsd.org Wed Jul 17 16:50:54 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A82F9B1187; Wed, 17 Jul 2019 16:50:54 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8B51F8A14C; Wed, 17 Jul 2019 16:50:54 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 651EC214F2; Wed, 17 Jul 2019 16:50:54 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6HGosgL099735; Wed, 17 Jul 2019 16:50:54 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6HGoseO099734; Wed, 17 Jul 2019 16:50:54 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201907171650.x6HGoseO099734@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 17 Jul 2019 16:50:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350086 - head/usr.sbin/rtadvd X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/usr.sbin/rtadvd X-SVN-Commit-Revision: 350086 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8B51F8A14C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.949,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jul 2019 16:50:54 -0000 Author: markj Date: Wed Jul 17 16:50:53 2019 New Revision: 350086 URL: https://svnweb.freebsd.org/changeset/base/350086 Log: Remove obsolete compatibility code from rtadvd. MFC after: 1 week Modified: head/usr.sbin/rtadvd/rtadvd.c Modified: head/usr.sbin/rtadvd/rtadvd.c ============================================================================== --- head/usr.sbin/rtadvd/rtadvd.c Wed Jul 17 16:38:40 2019 (r350085) +++ head/usr.sbin/rtadvd/rtadvd.c Wed Jul 17 16:50:53 2019 (r350086) @@ -1052,15 +1052,8 @@ check_accept_rtadv(int idx) __func__, idx); return (0); } -#if (__FreeBSD_version < 900000) + /* - * RA_RECV: !ip6.forwarding && ip6.accept_rtadv - * RA_SEND: ip6.forwarding - */ - return ((getinet6sysctl(IPV6CTL_FORWARDING) == 0) && - (getinet6sysctl(IPV6CTL_ACCEPT_RTADV) == 1)); -#else - /* * RA_RECV: ND6_IFF_ACCEPT_RTADV * RA_SEND: ip6.forwarding */ @@ -1070,7 +1063,6 @@ check_accept_rtadv(int idx) } return (ifi->ifi_nd_flags & ND6_IFF_ACCEPT_RTADV); -#endif } static void From owner-svn-src-all@freebsd.org Wed Jul 17 16:52:26 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 22F64B1351; Wed, 17 Jul 2019 16:52:26 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 06EAC8A508; Wed, 17 Jul 2019 16:52:26 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EE2B921689; Wed, 17 Jul 2019 16:52:25 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6HGqPD1005066; Wed, 17 Jul 2019 16:52:25 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6HGqPrC005065; Wed, 17 Jul 2019 16:52:25 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201907171652.x6HGqPrC005065@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 17 Jul 2019 16:52:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350087 - stable/12/usr.sbin/rtsold X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/usr.sbin/rtsold X-SVN-Commit-Revision: 350087 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 06EAC8A508 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.943,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jul 2019 16:52:26 -0000 Author: markj Date: Wed Jul 17 16:52:25 2019 New Revision: 350087 URL: https://svnweb.freebsd.org/changeset/base/350087 Log: MFC r344629: rtsol: Use vwarnx(3) to log messages to standard error. Modified: stable/12/usr.sbin/rtsold/rtsold.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/rtsold/rtsold.c ============================================================================== --- stable/12/usr.sbin/rtsold/rtsold.c Wed Jul 17 16:50:53 2019 (r350086) +++ stable/12/usr.sbin/rtsold/rtsold.c Wed Jul 17 16:52:25 2019 (r350087) @@ -743,10 +743,8 @@ warnmsg(int priority, const char *func, const char *ms va_start(ap, msg); if (fflag) { - if (priority <= log_upto) { - (void)vfprintf(stderr, msg, ap); - (void)fprintf(stderr, "\n"); - } + if (priority <= log_upto) + vwarnx(msg, ap); } else { snprintf(buf, sizeof(buf), "<%s> %s", func, msg); msg = buf; From owner-svn-src-all@freebsd.org Wed Jul 17 17:01:08 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1F321B162A; Wed, 17 Jul 2019 17:01:08 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 015F78AA49; Wed, 17 Jul 2019 17:01:08 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8A173217DB; Wed, 17 Jul 2019 17:01:07 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6HH17qd006384; Wed, 17 Jul 2019 17:01:07 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6HH17p9006383; Wed, 17 Jul 2019 17:01:07 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201907171701.x6HH17p9006383@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Wed, 17 Jul 2019 17:01:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350088 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 350088 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 015F78AA49 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.949,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jul 2019 17:01:08 -0000 Author: asomers Date: Wed Jul 17 17:01:07 2019 New Revision: 350088 URL: https://svnweb.freebsd.org/changeset/base/350088 Log: F_READAHEAD: Fix r349248's overflow protection, broken by r349391 I accidentally broke the main point of r349248 when making stylistic changes in r349391. Restore the original behavior, and also fix an additional overflow that was possible when uio->uio_resid was nearly SSIZE_MAX. Reported by: cem Reviewed by: bde MFC after: 2 weeks MFC-With: 349248 Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/vfs_vnops.c Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Wed Jul 17 16:52:25 2019 (r350087) +++ head/sys/kern/vfs_vnops.c Wed Jul 17 17:01:07 2019 (r350088) @@ -499,8 +499,13 @@ sequential_heuristic(struct uio *uio, struct file *fp) * closely related to the best I/O size for real disks than * to any block size used by software. */ - fp->f_seqcount += lmin(IO_SEQMAX, - howmany(uio->uio_resid, 16384)); + if (uio->uio_resid >= IO_SEQMAX * 16384) + fp->f_seqcount = IO_SEQMAX; + else { + fp->f_seqcount += howmany(uio->uio_resid, 16384); + if (fp->f_seqcount > IO_SEQMAX) + fp->f_seqcount = IO_SEQMAX; + } return (fp->f_seqcount << IO_SEQSHIFT); } From owner-svn-src-all@freebsd.org Wed Jul 17 19:09:06 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 75675B3671; Wed, 17 Jul 2019 19:09:06 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 577198F6AD; Wed, 17 Jul 2019 19:09:06 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 32E7722EC1; Wed, 17 Jul 2019 19:09:06 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6HJ96W8082987; Wed, 17 Jul 2019 19:09:06 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6HJ96Tu082986; Wed, 17 Jul 2019 19:09:06 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201907171909.x6HJ96Tu082986@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 17 Jul 2019 19:09:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350089 - head X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 350089 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 577198F6AD X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.947,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jul 2019 19:09:06 -0000 Author: markj Date: Wed Jul 17 19:09:05 2019 New Revision: 350089 URL: https://svnweb.freebsd.org/changeset/base/350089 Log: Add an initial RELNOTES file. The intent is to provide a convenient location to document changes that are relevant to users of binary FreeBSD distributions, in contrast with UPDATING, which exists to document caveats for users who build FreeBSD from source. This complements the "Relnotes:" tag in commit messages by providing a place to document the change in more detail, or in case a "Relnotes:" tag was accidentally omitted. In particular, "Relnotes:" should be used if you do not intend to document the change in RELNOTES for some reason. Changes to the file should not be MFCed. For now the file will exist only in head, but may be updated via direct commits to stable branches depending on how things go. I took the liberty of pre-populating the file with some recent release notes-worthy changes. Reviewed by: ian (earlier version) Discussed with: cy, gjb, imp, rgrimes Differential Revision: https://reviews.freebsd.org/D20762 Added: head/RELNOTES (contents, props changed) Added: head/RELNOTES ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/RELNOTES Wed Jul 17 19:09:05 2019 (r350089) @@ -0,0 +1,34 @@ +Release notes for FreeBSD 13.0. + +This file describes new user-visible features, changes and updates relevant to +users of binary FreeBSD releases. Each entry should describe the change in no +more than several sentences and should reference manual pages where an +interested user can find more information. Entries should wrap after 80 +columns. Each entry should begin with one or more commit IDs on one line, +specified as a comma separated list and/or range, followed by a colon and a +newline. Entries should be separated by a newline. + +Changes to this file should not be MFCed. + +r349352: + nand(4) and related components have been removed. + +r349349: + The UEFI loader now supports HTTP boot. + +r349335: + bhyve(8) now implements a High Definition Audio (HDA) driver, allowing + guests to play to and record audio data from the host. + +r349286: + swapon(8) can now erase a swap device immediately before enabling it, + similar to newfs(8)'s -E option. This behaviour can be specified by + adding -E to swapon(8)'s command-line parameters, or by adding the + "trimonce" option to a swap device's /etc/fstab entry. + +r347908-r347923: + The following network drivers have been removed: bm(4), cs(4), de(4), + ed(4), ep(4), ex(4), fe(4), pcn(4), sf(4), sn(4), tl(4), tx(4), txp(4), + vx(4), wb(4), xe(4). + +$FreeBSD$ From owner-svn-src-all@freebsd.org Wed Jul 17 19:11:25 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4F80AB3834; Wed, 17 Jul 2019 19:11:25 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2D8B38F9C7; Wed, 17 Jul 2019 19:11:25 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 028B12302C; Wed, 17 Jul 2019 19:11:25 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6HJBOvO085464; Wed, 17 Jul 2019 19:11:24 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6HJBO94085463; Wed, 17 Jul 2019 19:11:24 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201907171911.x6HJBO94085463@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 17 Jul 2019 19:11:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350090 - head X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 350090 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2D8B38F9C7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.945,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jul 2019 19:11:25 -0000 Author: markj Date: Wed Jul 17 19:11:24 2019 New Revision: 350090 URL: https://svnweb.freebsd.org/changeset/base/350090 Log: Remove an old warning from UPDATING. The clang switchover happened long enough ago that we can garbage-collect this note. Reviewed by: emaste, imp Differential Revision: https://reviews.freebsd.org/D20978 Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Wed Jul 17 19:09:05 2019 (r350089) +++ head/UPDATING Wed Jul 17 19:11:24 2019 (r350090) @@ -11,11 +11,6 @@ handbook: Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before running portupgrade. -NOTE: FreeBSD has switched from gcc to clang. If you have trouble bootstrapping -from older versions of FreeBSD, try WITHOUT_CLANG and WITH_GCC to bootstrap to -the tip of head, and then rebuild without this option. The bootstrap process -from older version of current across the gcc/clang cutover is a bit fragile. - NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW: FreeBSD 13.x has many debugging features turned on, in both the kernel and userland. These features attempt to detect incorrect use of From owner-svn-src-all@freebsd.org Wed Jul 17 19:29:55 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BCB00B3D48; Wed, 17 Jul 2019 19:29:55 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9EC1B90581; Wed, 17 Jul 2019 19:29:55 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 766E023273; Wed, 17 Jul 2019 19:29:55 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6HJTtH4095197; Wed, 17 Jul 2019 19:29:55 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6HJTtJ2095196; Wed, 17 Jul 2019 19:29:55 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201907171929.x6HJTtJ2095196@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 17 Jul 2019 19:29:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350091 - head/lib/libc/stdlib X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/lib/libc/stdlib X-SVN-Commit-Revision: 350091 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9EC1B90581 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jul 2019 19:29:55 -0000 Author: kib Date: Wed Jul 17 19:29:55 2019 New Revision: 350091 URL: https://svnweb.freebsd.org/changeset/base/350091 Log: bsearch.3: Improve the example. Submitted by: fernape MFC after: 1 week Differential revision: https://reviews.freebsd.org/D19902 Modified: head/lib/libc/stdlib/bsearch.3 Modified: head/lib/libc/stdlib/bsearch.3 ============================================================================== --- head/lib/libc/stdlib/bsearch.3 Wed Jul 17 19:11:24 2019 (r350090) +++ head/lib/libc/stdlib/bsearch.3 Wed Jul 17 19:29:55 2019 (r350091) @@ -32,7 +32,7 @@ .\" @(#)bsearch.3 8.3 (Berkeley) 4/19/94 .\" $FreeBSD$ .\" -.Dd May 15, 2019 +.Dd July 17, 2019 .Dt BSEARCH 3 .Os .Sh NAME @@ -93,26 +93,29 @@ A sample program that searches people by age in a sort #include struct person { - char name[5]; - int age; + const char *name; + int age; }; -int -compare(const void *key, const void *array_member) +static int +compare(const void *a, const void *b) { - int age = (intptr_t) key; - struct person person = *(struct person *) array_member; + const int *age; + const struct person *person; - return (age - person.age); + age = a; + person = b; + + return (*age - person->age); } int -main() +main(void) { struct person *friend; - + int age; /* Sorted array */ - struct person friends[6] = { + const struct person friends[] = { { "paul", 22 }, { "anne", 25 }, { "fred", 25 }, @@ -120,22 +123,28 @@ main() { "mark", 35 }, { "bill", 50 } }; + const size_t len = sizeof(friends) / sizeof(friends[0]); - size_t array_size = sizeof(friends) / sizeof(struct person); - - friend = bsearch((void *)22, &friends, array_size, sizeof(struct person), compare); + age = 22; + friend = bsearch(&age, friends, len, sizeof(friends[0]), compare); assert(strcmp(friend->name, "paul") == 0); printf("name: %s\enage: %d\en", friend->name, friend->age); - friend = bsearch((void *)25, &friends, array_size, sizeof(struct person), compare); - assert(strcmp(friend->name, "fred") == 0 || strcmp(friend->name, "anne") == 0); + age = 25; + friend = bsearch(&age, friends, len, sizeof(friends[0]), compare); + + /* + * For multiple elements with the same key, it is implementation + * defined which will be returned + */ + assert(strcmp(friend->name, "fred") == 0 || + strcmp(friend->name, "anne") == 0); printf("name: %s\enage: %d\en", friend->name, friend->age); - friend = bsearch((void *)30, &friends, array_size, sizeof(struct person), compare); + age = 30; + friend = bsearch(&age, friends, len, sizeof(friends[0]), compare); assert(friend == NULL); printf("friend aged 30 not found\en"); - - return (EXIT_SUCCESS); } .Ed .Sh SEE ALSO From owner-svn-src-all@freebsd.org Wed Jul 17 20:43:15 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9F081B55E4; Wed, 17 Jul 2019 20:43:15 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7CF1793717; Wed, 17 Jul 2019 20:43:15 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 57EDC2419F; Wed, 17 Jul 2019 20:43:15 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6HKhFqt042935; Wed, 17 Jul 2019 20:43:15 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6HKhFKq042934; Wed, 17 Jul 2019 20:43:15 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201907172043.x6HKhFKq042934@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 17 Jul 2019 20:43:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350094 - head/sys/dev/nvme X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/nvme X-SVN-Commit-Revision: 350094 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7CF1793717 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jul 2019 20:43:15 -0000 Author: imp Date: Wed Jul 17 20:43:14 2019 New Revision: 350094 URL: https://svnweb.freebsd.org/changeset/base/350094 Log: Remove now-obsolete comment. Modified: head/sys/dev/nvme/nvme.c Modified: head/sys/dev/nvme/nvme.c ============================================================================== --- head/sys/dev/nvme/nvme.c Wed Jul 17 19:41:44 2019 (r350093) +++ head/sys/dev/nvme/nvme.c Wed Jul 17 20:43:14 2019 (r350094) @@ -452,8 +452,7 @@ nvme_register_consumer(nvme_cons_ns_fn_t ns_fn, nvme_c int i; /* - * TODO: add locking around consumer registration. Not an issue - * right now since we only have one nvme consumer - nvd(4). + * TODO: add locking around consumer registration. */ for (i = 0; i < NVME_MAX_CONSUMERS; i++) if (nvme_consumer[i].id == INVALID_CONSUMER_ID) { From owner-svn-src-all@freebsd.org Wed Jul 17 21:25:27 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8B220B5E55; Wed, 17 Jul 2019 21:25:27 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6345C948E5; Wed, 17 Jul 2019 21:25:27 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3A05B248E9; Wed, 17 Jul 2019 21:25:27 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6HLPR7P066927; Wed, 17 Jul 2019 21:25:27 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6HLPRLZ066925; Wed, 17 Jul 2019 21:25:27 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201907172125.x6HLPRLZ066925@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Wed, 17 Jul 2019 21:25:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350095 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 350095 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6345C948E5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jul 2019 21:25:27 -0000 Author: kp Date: Wed Jul 17 21:25:26 2019 New Revision: 350095 URL: https://svnweb.freebsd.org/changeset/base/350095 Log: riscv: Return vm_paddr_t in pmap_early_vtophys() We can't use a u_int to compute the physical address in pmap_early_vtophys(). Our int is 32-bit, but the physical address is 64-bit. This works fine if everything lives in below 0x100000000, but as soon as it doesn't this breaks. MFC after: 1 week Sponsored by: Axiado Modified: head/sys/riscv/riscv/pmap.c Modified: head/sys/riscv/riscv/pmap.c ============================================================================== --- head/sys/riscv/riscv/pmap.c Wed Jul 17 20:43:14 2019 (r350094) +++ head/sys/riscv/riscv/pmap.c Wed Jul 17 21:25:26 2019 (r350095) @@ -464,7 +464,7 @@ pmap_early_vtophys(vm_offset_t l1pt, vm_offset_t va) { u_int l1_slot, l2_slot; pt_entry_t *l2; - u_int ret; + vm_paddr_t ret; l2 = pmap_early_page_idx(l1pt, va, &l1_slot, &l2_slot); From owner-svn-src-all@freebsd.org Wed Jul 17 22:07:45 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9458BB697D; Wed, 17 Jul 2019 22:07:45 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 760AE95C45; Wed, 17 Jul 2019 22:07:45 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4C70225097; Wed, 17 Jul 2019 22:07:45 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6HM7jMn090407; Wed, 17 Jul 2019 22:07:45 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6HM7hbS090400; Wed, 17 Jul 2019 22:07:43 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201907172207.x6HM7hbS090400@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Wed, 17 Jul 2019 22:07:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350096 - in head/sys/ufs: ffs ufs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: in head/sys/ufs: ffs ufs X-SVN-Commit-Revision: 350096 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 760AE95C45 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jul 2019 22:07:45 -0000 Author: mckusick Date: Wed Jul 17 22:07:43 2019 New Revision: 350096 URL: https://svnweb.freebsd.org/changeset/base/350096 Log: The error reported in FS-14-UFS-3 can only happen on UFS/FFS filesystems that have block pointers that are out-of-range for their filesystem. These out-of-range block pointers are corrected by fsck(8) so are only encountered when an unchecked filesystem is mounted. A new "untrusted" flag has been added to the generic mount interface that can be set when mounting media of unknown provenance or integrity. For example, a daemon that automounts a filesystem on a flash drive when it is plugged into a system. This commit adds a test to UFS/FFS that validates all block numbers before using them. Because checking for out-of-range blocks adds unnecessary overhead to normal operation, the tests are only done when the filesystem is mounted as an "untrusted" filesystem. Reported by: Christopher Krah, Thomas Barabosch, and Jan-Niclas Hilgert of Fraunhofer FKIE Reported as: FS-14-UFS-3: Out of bounds read in write-2 (ffs_alloccg) Reviewed by: kib Sponsored by: Netflix Modified: head/sys/ufs/ffs/ffs_alloc.c head/sys/ufs/ffs/ffs_balloc.c head/sys/ufs/ffs/ffs_extern.h head/sys/ufs/ffs/ffs_softdep.c head/sys/ufs/ffs/ffs_subr.c head/sys/ufs/ffs/ffs_vfsops.c head/sys/ufs/ufs/ufs_bmap.c head/sys/ufs/ufs/ufsmount.h Modified: head/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_alloc.c Wed Jul 17 21:25:26 2019 (r350095) +++ head/sys/ufs/ffs/ffs_alloc.c Wed Jul 17 22:07:43 2019 (r350096) @@ -1374,7 +1374,7 @@ ffs_blkpref_ufs1(ip, lbn, indx, bap) struct fs *fs; u_int cg, inocg; u_int avgbfree, startcg; - ufs2_daddr_t pref; + ufs2_daddr_t pref, prevbn; KASSERT(indx <= 0 || bap != NULL, ("need non-NULL bap")); mtx_assert(UFS_MTX(ITOUMP(ip)), MA_OWNED); @@ -1424,7 +1424,15 @@ ffs_blkpref_ufs1(ip, lbn, indx, bap) * have a block allocated immediately preceding us, then we need * to decide where to start allocating new blocks. */ - if (indx % fs->fs_maxbpg == 0 || bap[indx - 1] == 0) { + if (indx == 0) { + prevbn = 0; + } else { + prevbn = bap[indx - 1]; + if (UFS_CHECK_BLKNO(ITOVFS(ip), ip->i_number, prevbn, + fs->fs_bsize) != 0) + prevbn = 0; + } + if (indx % fs->fs_maxbpg == 0 || prevbn == 0) { /* * If we are allocating a directory data block, we want * to place it in the metadata area. @@ -1442,10 +1450,10 @@ ffs_blkpref_ufs1(ip, lbn, indx, bap) * Find a cylinder with greater than average number of * unused data blocks. */ - if (indx == 0 || bap[indx - 1] == 0) + if (indx == 0 || prevbn == 0) startcg = inocg + lbn / fs->fs_maxbpg; else - startcg = dtog(fs, bap[indx - 1]) + 1; + startcg = dtog(fs, prevbn) + 1; startcg %= fs->fs_ncg; avgbfree = fs->fs_cstotal.cs_nbfree / fs->fs_ncg; for (cg = startcg; cg < fs->fs_ncg; cg++) @@ -1463,7 +1471,7 @@ ffs_blkpref_ufs1(ip, lbn, indx, bap) /* * Otherwise, we just always try to lay things out contiguously. */ - return (bap[indx - 1] + fs->fs_frag); + return (prevbn + fs->fs_frag); } /* @@ -1479,7 +1487,7 @@ ffs_blkpref_ufs2(ip, lbn, indx, bap) struct fs *fs; u_int cg, inocg; u_int avgbfree, startcg; - ufs2_daddr_t pref; + ufs2_daddr_t pref, prevbn; KASSERT(indx <= 0 || bap != NULL, ("need non-NULL bap")); mtx_assert(UFS_MTX(ITOUMP(ip)), MA_OWNED); @@ -1529,7 +1537,15 @@ ffs_blkpref_ufs2(ip, lbn, indx, bap) * have a block allocated immediately preceding us, then we need * to decide where to start allocating new blocks. */ - if (indx % fs->fs_maxbpg == 0 || bap[indx - 1] == 0) { + if (indx == 0) { + prevbn = 0; + } else { + prevbn = bap[indx - 1]; + if (UFS_CHECK_BLKNO(ITOVFS(ip), ip->i_number, prevbn, + fs->fs_bsize) != 0) + prevbn = 0; + } + if (indx % fs->fs_maxbpg == 0 || prevbn == 0) { /* * If we are allocating a directory data block, we want * to place it in the metadata area. @@ -1547,10 +1563,10 @@ ffs_blkpref_ufs2(ip, lbn, indx, bap) * Find a cylinder with greater than average number of * unused data blocks. */ - if (indx == 0 || bap[indx - 1] == 0) + if (indx == 0 || prevbn == 0) startcg = inocg + lbn / fs->fs_maxbpg; else - startcg = dtog(fs, bap[indx - 1]) + 1; + startcg = dtog(fs, prevbn) + 1; startcg %= fs->fs_ncg; avgbfree = fs->fs_cstotal.cs_nbfree / fs->fs_ncg; for (cg = startcg; cg < fs->fs_ncg; cg++) @@ -1568,7 +1584,7 @@ ffs_blkpref_ufs2(ip, lbn, indx, bap) /* * Otherwise, we just always try to lay things out contiguously. */ - return (bap[indx - 1] + fs->fs_frag); + return (prevbn + fs->fs_frag); } /* Modified: head/sys/ufs/ffs/ffs_balloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_balloc.c Wed Jul 17 21:25:26 2019 (r350095) +++ head/sys/ufs/ffs/ffs_balloc.c Wed Jul 17 22:07:43 2019 (r350096) @@ -99,6 +99,7 @@ ffs_balloc_ufs1(struct vnode *vp, off_t startoffset, i struct fs *fs; ufs1_daddr_t nb; struct buf *bp, *nbp; + struct mount *mp; struct ufsmount *ump; struct indir indirs[UFS_NIADDR + 2]; int deallocated, osize, nsize, num, i, error; @@ -113,6 +114,7 @@ ffs_balloc_ufs1(struct vnode *vp, off_t startoffset, i ip = VTOI(vp); dp = ip->i_din1; fs = ITOFS(ip); + mp = ITOVFS(ip); ump = ITOUMP(ip); lbn = lblkno(fs, startoffset); size = blkoff(fs, startoffset) + size; @@ -295,6 +297,11 @@ retry: } bap = (ufs1_daddr_t *)bp->b_data; nb = bap[indirs[i].in_off]; + if ((error = UFS_CHECK_BLKNO(mp, ip->i_number, nb, + fs->fs_bsize)) != 0) { + brelse(bp); + goto fail; + } if (i == num) break; i += 1; @@ -580,6 +587,7 @@ ffs_balloc_ufs2(struct vnode *vp, off_t startoffset, i ufs_lbn_t lbn, lastlbn; struct fs *fs; struct buf *bp, *nbp; + struct mount *mp; struct ufsmount *ump; struct indir indirs[UFS_NIADDR + 2]; ufs2_daddr_t nb, newb, *bap, pref; @@ -593,6 +601,7 @@ ffs_balloc_ufs2(struct vnode *vp, off_t startoffset, i ip = VTOI(vp); dp = ip->i_din2; fs = ITOFS(ip); + mp = ITOVFS(ip); ump = ITOUMP(ip); lbn = lblkno(fs, startoffset); size = blkoff(fs, startoffset) + size; @@ -888,6 +897,11 @@ retry: } bap = (ufs2_daddr_t *)bp->b_data; nb = bap[indirs[i].in_off]; + if ((error = UFS_CHECK_BLKNO(mp, ip->i_number, nb, + fs->fs_bsize)) != 0) { + brelse(bp); + goto fail; + } if (i == num) break; i += 1; Modified: head/sys/ufs/ffs/ffs_extern.h ============================================================================== --- head/sys/ufs/ffs/ffs_extern.h Wed Jul 17 21:25:26 2019 (r350095) +++ head/sys/ufs/ffs/ffs_extern.h Wed Jul 17 22:07:43 2019 (r350096) @@ -69,6 +69,7 @@ ufs2_daddr_t ffs_blkpref_ufs2(struct inode *, ufs_lbn_ void ffs_blkrelease_finish(struct ufsmount *, u_long); u_long ffs_blkrelease_start(struct ufsmount *, struct vnode *, ino_t); uint32_t ffs_calc_sbhash(struct fs *); +int ffs_check_blkno(struct mount *, ino_t, ufs2_daddr_t, int); int ffs_checkfreefile(struct fs *, struct vnode *, ino_t); void ffs_clrblock(struct fs *, u_char *, ufs1_daddr_t); void ffs_clusteracct(struct fs *, struct cg *, ufs1_daddr_t, int); Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Wed Jul 17 21:25:26 2019 (r350095) +++ head/sys/ufs/ffs/ffs_softdep.c Wed Jul 17 22:07:43 2019 (r350096) @@ -8124,6 +8124,7 @@ indir_trunc(freework, dbn, lbn) struct buf *bp; struct fs *fs; struct indirdep *indirdep; + struct mount *mp; struct ufsmount *ump; ufs1_daddr_t *bap1; ufs2_daddr_t nb, nnb, *bap2; @@ -8133,7 +8134,8 @@ indir_trunc(freework, dbn, lbn) int goingaway, freedeps, needj, level, cnt, i; freeblks = freework->fw_freeblks; - ump = VFSTOUFS(freeblks->fb_list.wk_mp); + mp = freeblks->fb_list.wk_mp; + ump = VFSTOUFS(mp); fs = ump->um_fs; /* * Get buffer of block pointers to be freed. There are three cases: @@ -8226,6 +8228,9 @@ indir_trunc(freework, dbn, lbn) */ key = ffs_blkrelease_start(ump, freeblks->fb_devvp, freeblks->fb_inum); for (i = freework->fw_off; i < NINDIR(fs); i++, nb = nnb) { + if (UFS_CHECK_BLKNO(mp, freeblks->fb_inum, nb, + fs->fs_bsize) != 0) + nb = 0; if (i != NINDIR(fs) - 1) { if (ufs1fmt) nnb = bap1[i+1]; Modified: head/sys/ufs/ffs/ffs_subr.c ============================================================================== --- head/sys/ufs/ffs/ffs_subr.c Wed Jul 17 21:25:26 2019 (r350095) +++ head/sys/ufs/ffs/ffs_subr.c Wed Jul 17 22:07:43 2019 (r350096) @@ -154,6 +154,55 @@ ffs_load_inode(struct buf *bp, struct inode *ip, struc ip->i_gid = dip2->di_gid; return (0); } + +/* + * Verify that a filesystem block number is a valid data block. + * This routine is only called on untrusted filesystems. + */ +int +ffs_check_blkno(struct mount *mp, ino_t inum, ufs2_daddr_t daddr, int blksize) +{ + struct fs *fs; + struct ufsmount *ump; + ufs2_daddr_t end_daddr; + int cg, havemtx; + + KASSERT((mp->mnt_flag & MNT_UNTRUSTED) != 0, + ("ffs_check_blkno called on a trusted file system")); + ump = VFSTOUFS(mp); + fs = ump->um_fs; + cg = dtog(fs, daddr); + end_daddr = daddr + numfrags(fs, blksize); + /* + * Verify that the block number is a valid data block. Also check + * that it does not point to an inode block or a superblock. Accept + * blocks that are unalloacted (0) or part of snapshot metadata + * (BLK_NOCOPY or BLK_SNAP). + * + * Thus, the block must be in a valid range for the filesystem and + * either in the space before a backup superblock (except the first + * cylinder group where that space is used by the bootstrap code) or + * after the inode blocks and before the end of the cylinder group. + */ + if ((uint64_t)daddr <= BLK_SNAP || + ((uint64_t)end_daddr <= fs->fs_size && + ((cg > 0 && end_daddr <= cgsblock(fs, cg)) || + (daddr >= cgdmin(fs, cg) && + end_daddr <= cgbase(fs, cg) + fs->fs_fpg)))) + return (0); + if ((havemtx = mtx_owned(UFS_MTX(ump))) == 0) + UFS_LOCK(ump); + if (ppsratecheck(&ump->um_last_integritymsg, + &ump->um_secs_integritymsg, 1)) { + UFS_UNLOCK(ump); + uprintf("\n%s: inode %jd, out-of-range indirect block " + "number %jd\n", mp->mnt_stat.f_mntonname, inum, daddr); + if (havemtx) + UFS_LOCK(ump); + } else if (!havemtx) + UFS_UNLOCK(ump); + return (EINTEGRITY); +} #endif /* _KERNEL */ /* Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Wed Jul 17 21:25:26 2019 (r350095) +++ head/sys/ufs/ffs/ffs_vfsops.c Wed Jul 17 22:07:43 2019 (r350096) @@ -919,6 +919,10 @@ ffs_mountfs(devvp, mp, td) ump->um_ifree = ffs_ifree; ump->um_rdonly = ffs_rdonly; ump->um_snapgone = ffs_snapgone; + if ((mp->mnt_flag & MNT_UNTRUSTED) != 0) + ump->um_check_blkno = ffs_check_blkno; + else + ump->um_check_blkno = NULL; mtx_init(UFS_MTX(ump), "FFS", "FFS Lock", MTX_DEF); ffs_oldfscompat_read(fs, ump, fs->fs_sblockloc); fs->fs_ronly = ronly; Modified: head/sys/ufs/ufs/ufs_bmap.c ============================================================================== --- head/sys/ufs/ufs/ufs_bmap.c Wed Jul 17 21:25:26 2019 (r350095) +++ head/sys/ufs/ufs/ufs_bmap.c Wed Jul 17 22:07:43 2019 (r350096) @@ -267,8 +267,16 @@ ufs_bmaparray(vp, bn, bnp, nbp, runp, runb) if (error != 0) return (error); - if (I_IS_UFS1(ip)) { + if (I_IS_UFS1(ip)) daddr = ((ufs1_daddr_t *)bp->b_data)[ap->in_off]; + else + daddr = ((ufs2_daddr_t *)bp->b_data)[ap->in_off]; + if ((error = UFS_CHECK_BLKNO(mp, ip->i_number, daddr, + mp->mnt_stat.f_iosize)) != 0) { + bqrelse(bp); + return (error); + } + if (I_IS_UFS1(ip)) { if (num == 1 && daddr && runp) { for (bn = ap->in_off + 1; bn < MNINDIR(ump) && *runp < maxrun && @@ -287,7 +295,6 @@ ufs_bmaparray(vp, bn, bnp, nbp, runp, runb) } continue; } - daddr = ((ufs2_daddr_t *)bp->b_data)[ap->in_off]; if (num == 1 && daddr && runp) { for (bn = ap->in_off + 1; bn < MNINDIR(ump) && *runp < maxrun && Modified: head/sys/ufs/ufs/ufsmount.h ============================================================================== --- head/sys/ufs/ufs/ufsmount.h Wed Jul 17 21:25:26 2019 (r350095) +++ head/sys/ufs/ufs/ufsmount.h Wed Jul 17 22:07:43 2019 (r350096) @@ -102,6 +102,8 @@ struct ufsmount { u_int um_flags; /* (i) filesystem flags */ struct timeval um_last_fullmsg; /* (i) last full msg time */ int um_secs_fullmsg; /* (i) seconds since full msg */ + struct timeval um_last_integritymsg; /* (i) last integrity msg */ + int um_secs_integritymsg; /* (i) secs since integ msg */ u_int um_trim_inflight; /* (i) outstanding trim count */ u_int um_trim_inflight_blks; /* (i) outstanding trim blks */ u_long um_trim_total; /* (i) total trim count */ @@ -121,6 +123,7 @@ struct ufsmount { void (*um_ifree)(struct ufsmount *, struct inode *); int (*um_rdonly)(struct inode *); void (*um_snapgone)(struct inode *); + int (*um_check_blkno)(struct mount *, ino_t, daddr_t, int); }; /* @@ -145,6 +148,9 @@ struct ufsmount { #define UFS_IFREE(aa, bb) ((aa)->um_ifree(aa, bb)) #define UFS_RDONLY(aa) (ITOUMP(aa)->um_rdonly(aa)) #define UFS_SNAPGONE(aa) (ITOUMP(aa)->um_snapgone(aa)) +#define UFS_CHECK_BLKNO(aa, bb, cc, dd) \ + (VFSTOUFS(aa)->um_check_blkno == NULL ? 0 : \ + VFSTOUFS(aa)->um_check_blkno(aa, bb, cc, dd)) #define UFS_LOCK(aa) mtx_lock(&(aa)->um_lock) #define UFS_UNLOCK(aa) mtx_unlock(&(aa)->um_lock) From owner-svn-src-all@freebsd.org Wed Jul 17 23:09:43 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A68C2B7934; Wed, 17 Jul 2019 23:09:43 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 50B9A97579; Wed, 17 Jul 2019 23:09:43 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2832025C23; Wed, 17 Jul 2019 23:09:43 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6HN9g9F025911; Wed, 17 Jul 2019 23:09:42 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6HN9ex5025900; Wed, 17 Jul 2019 23:09:40 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201907172309.x6HN9ex5025900@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Wed, 17 Jul 2019 23:09:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350098 - head/contrib/tcp_wrappers X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/contrib/tcp_wrappers X-SVN-Commit-Revision: 350098 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 50B9A97579 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jul 2019 23:09:43 -0000 Author: brooks Date: Wed Jul 17 23:09:40 2019 New Revision: 350098 URL: https://svnweb.freebsd.org/changeset/base/350098 Log: Use ANSI C function definitions and declerations. Obtained from: CheriBSD MFC after: 1 week Sponsored by: DARPA, AFRL Modified: head/contrib/tcp_wrappers/hosts_access.c head/contrib/tcp_wrappers/inetcf.c head/contrib/tcp_wrappers/inetcf.h head/contrib/tcp_wrappers/mystdarg.h head/contrib/tcp_wrappers/options.c head/contrib/tcp_wrappers/rfc931.c head/contrib/tcp_wrappers/scaffold.h head/contrib/tcp_wrappers/shell_cmd.c head/contrib/tcp_wrappers/socket.c head/contrib/tcp_wrappers/tcpdchk.c head/contrib/tcp_wrappers/tcpdmatch.c Modified: head/contrib/tcp_wrappers/hosts_access.c ============================================================================== --- head/contrib/tcp_wrappers/hosts_access.c Wed Jul 17 22:45:43 2019 (r350097) +++ head/contrib/tcp_wrappers/hosts_access.c Wed Jul 17 23:09:40 2019 (r350098) @@ -87,16 +87,17 @@ int resident = (-1); /* -1, 0: unknown; +1: yes * /* Forward declarations. */ -static int table_match(); -static int list_match(); -static int server_match(); -static int client_match(); -static int host_match(); -static int string_match(); -static int masked_match(); +static int table_match(char *table, struct request_info *request); +static int list_match(char *list, struct request_info *request, + int (*match_fn)(char *, struct request_info *)); +static int server_match(char *tok, struct request_info *request); +static int client_match(char *tok, struct request_info *request); +static int host_match(char *tok, struct host_info *host); +static int string_match(char *tok, char *string); +static int masked_match(char *net_tok, char *mask_tok, char *string); #ifdef INET6 -static int masked_match4(); -static int masked_match6(); +static int masked_match4(char *net_tok, char *mask_tok, char *string); +static int masked_match6(char *net_tok, char *mask_tok, char *string); #endif /* Size of logical line buffer. */ @@ -213,10 +214,8 @@ struct request_info *request; /* list_match - match a request against a list of patterns with exceptions */ -static int list_match(list, request, match_fn) -char *list; -struct request_info *request; -int (*match_fn) (); +static int list_match(char *list, struct request_info *request, + int (*match_fn)(char *, struct request_info *)) { char *tok; Modified: head/contrib/tcp_wrappers/inetcf.c ============================================================================== --- head/contrib/tcp_wrappers/inetcf.c Wed Jul 17 22:45:43 2019 (r350097) +++ head/contrib/tcp_wrappers/inetcf.c Wed Jul 17 23:09:40 2019 (r350098) @@ -39,8 +39,9 @@ char *inet_files[] = { 0, }; -static void inet_chk(); -static char *base_name(); +static void inet_chk(char *protocol, char *path, char *arg0, char *arg1); +static char *base_name(char *path); +extern char *percent_m(char *obuf, char *ibuf); /* * Structure with everything we know about a service. @@ -69,7 +70,6 @@ char *conf; char *arg0; char *arg1; struct tcpd_context saved_context; - char *percent_m(); int i; struct stat st; Modified: head/contrib/tcp_wrappers/inetcf.h ============================================================================== --- head/contrib/tcp_wrappers/inetcf.h Wed Jul 17 22:45:43 2019 (r350097) +++ head/contrib/tcp_wrappers/inetcf.h Wed Jul 17 23:09:40 2019 (r350098) @@ -4,9 +4,9 @@ * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands. */ -extern char *inet_cfg(); /* read inetd.conf file */ -extern void inet_set(); /* remember internet service */ -extern int inet_get(); /* look up internet service */ +extern char *inet_cfg(char *conf); /* read inetd.conf file */ +extern void inet_set(char *name, int type); /* remember internet service */ +extern int inet_get(char *name); /* look up internet service */ #define WR_UNKNOWN (-1) /* service unknown */ #define WR_NOT 1 /* may not be wrapped */ Modified: head/contrib/tcp_wrappers/mystdarg.h ============================================================================== --- head/contrib/tcp_wrappers/mystdarg.h Wed Jul 17 22:45:43 2019 (r350097) +++ head/contrib/tcp_wrappers/mystdarg.h Wed Jul 17 23:09:40 2019 (r350098) @@ -16,4 +16,4 @@ #define VAEND(ap) va_end(ap);} #endif -extern char *percent_m(); +extern char *percent_m(char *obuf, char *ibuf); Modified: head/contrib/tcp_wrappers/options.c ============================================================================== --- head/contrib/tcp_wrappers/options.c Wed Jul 17 22:45:43 2019 (r350097) +++ head/contrib/tcp_wrappers/options.c Wed Jul 17 23:09:40 2019 (r350098) @@ -71,8 +71,8 @@ extern jmp_buf tcpd_buf; /* tcpd_jump() support */ static char whitespace_eq[] = "= \t\r\n"; #define whitespace (whitespace_eq + 1) -static char *get_field(); /* chew :-delimited field off string */ -static char *chop_string(); /* strip leading and trailing blanks */ +static char *get_field(char *string); /* chew :-delimited field off string */ +static char *chop_string(char *string); /* strip leading and trailing blanks */ /* List of functions that implement the options. Add yours here. */ Modified: head/contrib/tcp_wrappers/rfc931.c ============================================================================== --- head/contrib/tcp_wrappers/rfc931.c Wed Jul 17 22:45:43 2019 (r350097) +++ head/contrib/tcp_wrappers/rfc931.c Wed Jul 17 23:09:40 2019 (r350098) @@ -66,8 +66,7 @@ int protocol; /* timeout - handle timeouts */ -static void timeout(sig) -int sig; +static void timeout(int sig) { longjmp(timebuf, sig); } Modified: head/contrib/tcp_wrappers/scaffold.h ============================================================================== --- head/contrib/tcp_wrappers/scaffold.h Wed Jul 17 22:45:43 2019 (r350097) +++ head/contrib/tcp_wrappers/scaffold.h Wed Jul 17 23:09:40 2019 (r350098) @@ -7,9 +7,9 @@ */ #ifdef INET6 -extern struct addrinfo *find_inet_addr(); +extern struct addrinfo *find_inet_addr(char *host); #else -extern struct hostent *find_inet_addr(); +extern struct hostent *find_inet_addr(char *host); #endif -extern int check_dns(); -extern int check_path(); +extern int check_dns(char *host); +extern int check_path(char *path, struct stat *st); Modified: head/contrib/tcp_wrappers/shell_cmd.c ============================================================================== --- head/contrib/tcp_wrappers/shell_cmd.c Wed Jul 17 22:45:43 2019 (r350097) +++ head/contrib/tcp_wrappers/shell_cmd.c Wed Jul 17 23:09:40 2019 (r350098) @@ -32,7 +32,7 @@ extern void exit(); /* Forward declarations. */ -static void do_child(); +static void do_child(char *command); /* shell_cmd - execute shell command */ @@ -62,8 +62,7 @@ char *command; /* do_child - exec command with { stdin, stdout, stderr } to /dev/null */ -static void do_child(command) -char *command; +static void do_child(char *command) { char *error; int tmp_fd; Modified: head/contrib/tcp_wrappers/socket.c ============================================================================== --- head/contrib/tcp_wrappers/socket.c Wed Jul 17 22:45:43 2019 (r350097) +++ head/contrib/tcp_wrappers/socket.c Wed Jul 17 23:09:40 2019 (r350098) @@ -42,7 +42,7 @@ extern char *inet_ntoa(); /* Forward declarations. */ -static void sock_sink(); +static void sock_sink(int); #ifdef APPEND_DOT @@ -406,8 +406,7 @@ struct host_info *host; /* sock_sink - absorb unreceived IP datagram */ -static void sock_sink(fd) -int fd; +static void sock_sink(int fd) { char buf[BUFSIZ]; #ifdef INET6 Modified: head/contrib/tcp_wrappers/tcpdchk.c ============================================================================== --- head/contrib/tcp_wrappers/tcpdchk.c Wed Jul 17 22:45:43 2019 (r350097) +++ head/contrib/tcp_wrappers/tcpdchk.c Wed Jul 17 23:09:40 2019 (r350098) @@ -73,15 +73,15 @@ extern jmp_buf tcpd_buf; /* * Local stuff. */ -static void usage(); -static void parse_table(); -static void print_list(); -static void check_daemon_list(); -static void check_client_list(); -static void check_daemon(); -static void check_user(); -static int check_host(); -static int reserved_name(); +static void usage(void); +static void parse_table(char *table, struct request_info *request); +static void print_list(char *title, char *list); +static void check_daemon_list(char *list); +static void check_client_list(char *list); +static void check_daemon(char *pat); +static void check_user(char *pat); +static int check_host(char *pat); +static int reserved_name(char *pat); #define PERMIT 1 #define DENY 0 @@ -185,7 +185,7 @@ char **argv; /* usage - explain */ -static void usage() +static void usage(void) { fprintf(stderr, "usage: %s [-a] [-d] [-i inet_conf] [-v]\n", myname); fprintf(stderr, " -a: report rules with implicit \"ALLOW\" at end\n"); Modified: head/contrib/tcp_wrappers/tcpdmatch.c ============================================================================== --- head/contrib/tcp_wrappers/tcpdmatch.c Wed Jul 17 22:45:43 2019 (r350097) +++ head/contrib/tcp_wrappers/tcpdmatch.c Wed Jul 17 23:09:40 2019 (r350098) @@ -51,8 +51,8 @@ extern char *optarg; #include "inetcf.h" #include "scaffold.h" -static void usage(); -static void tcpdmatch(); +static void usage(char *myname); +static void tcpdmatch(struct request_info *request); /* The main program */ From owner-svn-src-all@freebsd.org Wed Jul 17 23:33:15 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 582C0B8051; Wed, 17 Jul 2019 23:33:15 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 13ECE68050; Wed, 17 Jul 2019 23:33:15 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DE8EC261C7; Wed, 17 Jul 2019 23:33:14 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6HNXEqc043291; Wed, 17 Jul 2019 23:33:14 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6HNXEKM043290; Wed, 17 Jul 2019 23:33:14 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201907172333.x6HNXEKM043290@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Wed, 17 Jul 2019 23:33:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350099 - head/stand/common X-SVN-Group: head X-SVN-Commit-Author: sjg X-SVN-Commit-Paths: head/stand/common X-SVN-Commit-Revision: 350099 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 13ECE68050 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jul 2019 23:33:15 -0000 Author: sjg Date: Wed Jul 17 23:33:14 2019 New Revision: 350099 URL: https://svnweb.freebsd.org/changeset/base/350099 Log: loader: ignore some variable settings if input unverified libsecureboot can tell us if the most recent file opened was verfied or not. If it's state is VE_UNVERIFIED_OK, skip if variable matches one of the restricted prefixes. Reviewed by: stevek MFC after: 1 week Sponsored by: Juniper Networks Differential Revision: https://reviews.freebsd.org//D20909 Modified: head/stand/common/commands.c Modified: head/stand/common/commands.c ============================================================================== --- head/stand/common/commands.c Wed Jul 17 23:09:40 2019 (r350098) +++ head/stand/common/commands.c Wed Jul 17 23:33:14 2019 (r350099) @@ -304,6 +304,36 @@ command_set(int argc, char *argv[]) command_errmsg = "wrong number of arguments"; return (CMD_ERROR); } else { +#ifdef LOADER_VERIEXEC + /* + * Impose restrictions if input is not verified + */ + const char *restricted[] = { + "boot", + "init", + "loader.ve.", + "rootfs", + "secur", + "vfs.", + NULL, + }; + const char **cp; + int ves; + + ves = ve_status_get(-1); + if (ves == VE_UNVERIFIED_OK) { +#ifdef LOADER_VERIEXEC_TESTING + printf("Checking: %s\n", argv[1]); +#endif + for (cp = restricted; *cp; cp++) { + if (strncmp(argv[1], *cp, strlen(*cp)) == 0) { + printf("Ignoring restricted variable: %s\n", + argv[1]); + return (CMD_OK); + } + } + } +#endif if ((err = putenv(argv[1])) != 0) { command_errmsg = strerror(err); return (CMD_ERROR); From owner-svn-src-all@freebsd.org Wed Jul 17 23:36:37 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E3051B8117; Wed, 17 Jul 2019 23:36:37 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C3D09681ED; Wed, 17 Jul 2019 23:36:37 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 86E4E261CA; Wed, 17 Jul 2019 23:36:37 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6HNabbd043496; Wed, 17 Jul 2019 23:36:37 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6HNaasw043491; Wed, 17 Jul 2019 23:36:36 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201907172336.x6HNaasw043491@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Wed, 17 Jul 2019 23:36:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350100 - head/contrib/tcp_wrappers X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/contrib/tcp_wrappers X-SVN-Commit-Revision: 350100 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C3D09681ED X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jul 2019 23:36:38 -0000 Author: brooks Date: Wed Jul 17 23:36:36 2019 New Revision: 350100 URL: https://svnweb.freebsd.org/changeset/base/350100 Log: Use headers instead of manual declerations of standard functions and variables. Modified: head/contrib/tcp_wrappers/inetcf.c head/contrib/tcp_wrappers/scaffold.c head/contrib/tcp_wrappers/tcpd.c head/contrib/tcp_wrappers/tcpdchk.c head/contrib/tcp_wrappers/tcpdmatch.c Modified: head/contrib/tcp_wrappers/inetcf.c ============================================================================== --- head/contrib/tcp_wrappers/inetcf.c Wed Jul 17 23:33:14 2019 (r350099) +++ head/contrib/tcp_wrappers/inetcf.c Wed Jul 17 23:36:36 2019 (r350100) @@ -14,11 +14,8 @@ static char sccsid[] = "@(#) inetcf.c 1.7 97/02/12 02: #include #include #include -#include #include - -extern int errno; -extern void exit(); +#include #include "tcpd.h" #include "inetcf.h" Modified: head/contrib/tcp_wrappers/scaffold.c ============================================================================== --- head/contrib/tcp_wrappers/scaffold.c Wed Jul 17 23:33:14 2019 (r350099) +++ head/contrib/tcp_wrappers/scaffold.c Wed Jul 17 23:36:36 2019 (r350100) @@ -21,6 +21,7 @@ static char sccs_id[] = "@(#) scaffold.c 1.6 97/03/21 #include #include #include +#include #include #include Modified: head/contrib/tcp_wrappers/tcpd.c ============================================================================== --- head/contrib/tcp_wrappers/tcpd.c Wed Jul 17 23:33:14 2019 (r350099) +++ head/contrib/tcp_wrappers/tcpd.c Wed Jul 17 23:36:36 2019 (r350100) @@ -26,6 +26,7 @@ static char sccsid[] = "@(#) tcpd.c 1.10 96/02/11 17:0 #include #include #include +#include #ifndef MAXPATHNAMELEN #define MAXPATHNAMELEN BUFSIZ Modified: head/contrib/tcp_wrappers/tcpdchk.c ============================================================================== --- head/contrib/tcp_wrappers/tcpdchk.c Wed Jul 17 23:33:14 2019 (r350099) +++ head/contrib/tcp_wrappers/tcpdchk.c Wed Jul 17 23:36:36 2019 (r350100) @@ -34,14 +34,9 @@ static char sccsid[] = "@(#) tcpdchk.c 1.8 97/02/12 02 #include #include #include +#include #include #include -#include - -extern int errno; -extern void exit(); -extern int optind; -extern char *optarg; #ifndef INADDR_NONE #define INADDR_NONE (-1) /* XXX should be 0xffffffff */ Modified: head/contrib/tcp_wrappers/tcpdmatch.c ============================================================================== --- head/contrib/tcp_wrappers/tcpdmatch.c Wed Jul 17 23:33:14 2019 (r350099) +++ head/contrib/tcp_wrappers/tcpdmatch.c Wed Jul 17 23:36:36 2019 (r350100) @@ -30,12 +30,9 @@ static char sccsid[] = "@(#) tcpdmatch.c 1.5 96/02/11 #include #include #include +#include #include #include - -extern void exit(); -extern int optind; -extern char *optarg; #ifndef INADDR_NONE #define INADDR_NONE (-1) /* XXX should be 0xffffffff */ From owner-svn-src-all@freebsd.org Wed Jul 17 23:43:14 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C4FD5B832B; Wed, 17 Jul 2019 23:43:14 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A720B699D9; Wed, 17 Jul 2019 23:43:14 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 80FD6263D4; Wed, 17 Jul 2019 23:43:14 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6HNhEkm049040; Wed, 17 Jul 2019 23:43:14 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6HNhE7D049039; Wed, 17 Jul 2019 23:43:14 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201907172343.x6HNhE7D049039@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Wed, 17 Jul 2019 23:43:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350101 - head/contrib/tcp_wrappers X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/contrib/tcp_wrappers X-SVN-Commit-Revision: 350101 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A720B699D9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jul 2019 23:43:14 -0000 Author: brooks Date: Wed Jul 17 23:43:14 2019 New Revision: 350101 URL: https://svnweb.freebsd.org/changeset/base/350101 Log: Remove a duplicate global (rfc931_timeout). It is declared here and in rfc931.c and unused here so keep that copy and discard this one. Obtained from: CheriBSD MFC after: 1 week Sponsored by: DARPA, AFRL Modified: head/contrib/tcp_wrappers/scaffold.c Modified: head/contrib/tcp_wrappers/scaffold.c ============================================================================== --- head/contrib/tcp_wrappers/scaffold.c Wed Jul 17 23:36:36 2019 (r350100) +++ head/contrib/tcp_wrappers/scaffold.c Wed Jul 17 23:43:14 2019 (r350101) @@ -39,7 +39,6 @@ static char sccs_id[] = "@(#) scaffold.c 1.6 97/03/21 */ int allow_severity = SEVERITY; int deny_severity = LOG_WARNING; -int rfc931_timeout = RFC931_TIMEOUT; #ifndef INET6 /* dup_hostent - create hostent in one memory block */ From owner-svn-src-all@freebsd.org Wed Jul 17 23:46:51 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 23D83B848A; Wed, 17 Jul 2019 23:46:51 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D491369F00; Wed, 17 Jul 2019 23:46:50 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 15B5E263E2; Wed, 17 Jul 2019 23:46:48 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6HNklen050127; Wed, 17 Jul 2019 23:46:47 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6HNklOW050126; Wed, 17 Jul 2019 23:46:47 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201907172346.x6HNklOW050126@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Wed, 17 Jul 2019 23:46:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350102 - head/lib/libc/gen X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/lib/libc/gen X-SVN-Commit-Revision: 350102 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D491369F00 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jul 2019 23:46:51 -0000 Author: brooks Date: Wed Jul 17 23:46:47 2019 New Revision: 350102 URL: https://svnweb.freebsd.org/changeset/base/350102 Log: Remove redundent decleration of __elf_phdr_match_addr(). Obtained from: CheriBSD MFC after: 1 week Sponsored by: DARPA, AFRL Modified: head/lib/libc/gen/elf_utils.c Modified: head/lib/libc/gen/elf_utils.c ============================================================================== --- head/lib/libc/gen/elf_utils.c Wed Jul 17 23:43:14 2019 (r350101) +++ head/lib/libc/gen/elf_utils.c Wed Jul 17 23:46:47 2019 (r350102) @@ -38,7 +38,6 @@ #include "libc_private.h" #include "static_tls.h" -int __elf_phdr_match_addr(struct dl_phdr_info *, void *); void __pthread_map_stacks_exec(void); void __pthread_distribute_static_tls(size_t, void *, size_t, size_t); From owner-svn-src-all@freebsd.org Thu Jul 18 00:27:30 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 95FCEB8F7E; Thu, 18 Jul 2019 00:27:30 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 829E66B8C1; Thu, 18 Jul 2019 00:27:30 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1452726B7F; Thu, 18 Jul 2019 00:27:30 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6I0RUHA074076; Thu, 18 Jul 2019 00:27:30 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6I0RTYu074070; Thu, 18 Jul 2019 00:27:29 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201907180027.x6I0RTYu074070@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Thu, 18 Jul 2019 00:27:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350103 - in head/contrib/sqlite3: . tea X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in head/contrib/sqlite3: . tea X-SVN-Commit-Revision: 350103 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 829E66B8C1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jul 2019 00:27:30 -0000 Author: cy Date: Thu Jul 18 00:27:28 2019 New Revision: 350103 URL: https://svnweb.freebsd.org/changeset/base/350103 Log: MFV r350080: Update sqlite3-3.28.0 (3280000) --> sqlite3-3.29.0 (3290000) MFC after: 1 week Modified: head/contrib/sqlite3/configure head/contrib/sqlite3/configure.ac head/contrib/sqlite3/shell.c head/contrib/sqlite3/sqlite3.c head/contrib/sqlite3/sqlite3.h head/contrib/sqlite3/tea/configure head/contrib/sqlite3/tea/configure.ac Directory Properties: head/contrib/sqlite3/ (props changed) Modified: head/contrib/sqlite3/configure ============================================================================== --- head/contrib/sqlite3/configure Wed Jul 17 23:46:47 2019 (r350102) +++ head/contrib/sqlite3/configure Thu Jul 18 00:27:28 2019 (r350103) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for sqlite 3.28.0. +# Generated by GNU Autoconf 2.69 for sqlite 3.29.0. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='sqlite' PACKAGE_TARNAME='sqlite' -PACKAGE_VERSION='3.28.0' -PACKAGE_STRING='sqlite 3.28.0' +PACKAGE_VERSION='3.29.0' +PACKAGE_STRING='sqlite 3.29.0' PACKAGE_BUGREPORT='http://www.sqlite.org' PACKAGE_URL='' @@ -1341,7 +1341,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures sqlite 3.28.0 to adapt to many kinds of systems. +\`configure' configures sqlite 3.29.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1412,7 +1412,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of sqlite 3.28.0:";; + short | recursive ) echo "Configuration of sqlite 3.29.0:";; esac cat <<\_ACEOF @@ -1537,7 +1537,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -sqlite configure 3.28.0 +sqlite configure 3.29.0 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1952,7 +1952,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by sqlite $as_me 3.28.0, which was +It was created by sqlite $as_me 3.29.0, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2818,7 +2818,7 @@ fi # Define the identity of the package. PACKAGE='sqlite' - VERSION='3.28.0' + VERSION='3.29.0' cat >>confdefs.h <<_ACEOF @@ -14438,7 +14438,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by sqlite $as_me 3.28.0, which was +This file was extended by sqlite $as_me 3.29.0, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -14495,7 +14495,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -sqlite config.status 3.28.0 +sqlite config.status 3.29.0 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Modified: head/contrib/sqlite3/configure.ac ============================================================================== --- head/contrib/sqlite3/configure.ac Wed Jul 17 23:46:47 2019 (r350102) +++ head/contrib/sqlite3/configure.ac Thu Jul 18 00:27:28 2019 (r350103) @@ -10,7 +10,7 @@ # AC_PREREQ(2.61) -AC_INIT(sqlite, 3.28.0, http://www.sqlite.org) +AC_INIT(sqlite, 3.29.0, http://www.sqlite.org) AC_CONFIG_SRCDIR([sqlite3.c]) AC_CONFIG_AUX_DIR([.]) Modified: head/contrib/sqlite3/shell.c ============================================================================== --- head/contrib/sqlite3/shell.c Wed Jul 17 23:46:47 2019 (r350102) +++ head/contrib/sqlite3/shell.c Thu Jul 18 00:27:28 2019 (r350103) @@ -983,6 +983,7 @@ static void shellAddSchemaName( ** We need several support functions from the SQLite core. */ +/* #include "sqlite3.h" */ /* ** We need several things from the ANSI and MSVCRT headers. @@ -1336,6 +1337,7 @@ INT closedir( ** is used. If SIZE is included it must be one of the integers 224, 256, ** 384, or 512, to determine SHA3 hash variant that is computed. */ +/* #include "sqlite3ext.h" */ SQLITE_EXTENSION_INIT1 #include #include @@ -2099,6 +2101,7 @@ int sqlite3_shathree_init( ** And the paths returned in the "name" column of the table are also ** relative to directory $dir. */ +/* #include "sqlite3ext.h" */ SQLITE_EXTENSION_INIT1 #include #include @@ -3056,6 +3059,7 @@ int sqlite3_fileio_init( ** faster than any human can type. ** */ +/* #include "sqlite3ext.h" */ SQLITE_EXTENSION_INIT1 #include #include @@ -3572,6 +3576,7 @@ int sqlite3_completion_init( ** If the file being opened is not an appended database, then this shim is ** a pass-through into the default underlying VFS. **/ +/* #include "sqlite3ext.h" */ SQLITE_EXTENSION_INIT1 #include #include @@ -4228,6 +4233,7 @@ int sqlite3MemTraceDeactivate(void){ ** * No support for zip64 extensions ** * Only the "inflate/deflate" (zlib) compression method is supported */ +/* #include "sqlite3ext.h" */ SQLITE_EXTENSION_INIT1 #include #include @@ -6398,6 +6404,7 @@ int sqlite3_zipfile_init( ** for working with sqlar archives and used by the shell tool's built-in ** sqlar support. */ +/* #include "sqlite3ext.h" */ SQLITE_EXTENSION_INIT1 #include @@ -6520,6 +6527,7 @@ int sqlite3_sqlar_init( */ +/* #include "sqlite3.h" */ typedef struct sqlite3expert sqlite3expert; @@ -6688,6 +6696,7 @@ void sqlite3_expert_destroy(sqlite3expert*); ** ************************************************************************* */ +/* #include "sqlite3expert.h" */ #include #include #include @@ -8631,6 +8640,863 @@ void sqlite3_expert_destroy(sqlite3expert *p){ /************************* End ../ext/expert/sqlite3expert.c ********************/ +#if !defined(SQLITE_OMIT_VIRTUALTABLE) && defined(SQLITE_ENABLE_DBPAGE_VTAB) +/************************* Begin ../ext/misc/dbdata.c ******************/ +/* +** 2019-04-17 +** +** The author disclaims copyright to this source code. In place of +** a legal notice, here is a blessing: +** +** May you do good and not evil. +** May you find forgiveness for yourself and forgive others. +** May you share freely, never taking more than you give. +** +****************************************************************************** +** +** This file contains an implementation of two eponymous virtual tables, +** "sqlite_dbdata" and "sqlite_dbptr". Both modules require that the +** "sqlite_dbpage" eponymous virtual table be available. +** +** SQLITE_DBDATA: +** sqlite_dbdata is used to extract data directly from a database b-tree +** page and its associated overflow pages, bypassing the b-tree layer. +** The table schema is equivalent to: +** +** CREATE TABLE sqlite_dbdata( +** pgno INTEGER, +** cell INTEGER, +** field INTEGER, +** value ANY, +** schema TEXT HIDDEN +** ); +** +** IMPORTANT: THE VIRTUAL TABLE SCHEMA ABOVE IS SUBJECT TO CHANGE. IN THE +** FUTURE NEW NON-HIDDEN COLUMNS MAY BE ADDED BETWEEN "value" AND +** "schema". +** +** Each page of the database is inspected. If it cannot be interpreted as +** a b-tree page, or if it is a b-tree page containing 0 entries, the +** sqlite_dbdata table contains no rows for that page. Otherwise, the +** table contains one row for each field in the record associated with +** each cell on the page. For intkey b-trees, the key value is stored in +** field -1. +** +** For example, for the database: +** +** CREATE TABLE t1(a, b); -- root page is page 2 +** INSERT INTO t1(rowid, a, b) VALUES(5, 'v', 'five'); +** INSERT INTO t1(rowid, a, b) VALUES(10, 'x', 'ten'); +** +** the sqlite_dbdata table contains, as well as from entries related to +** page 1, content equivalent to: +** +** INSERT INTO sqlite_dbdata(pgno, cell, field, value) VALUES +** (2, 0, -1, 5 ), +** (2, 0, 0, 'v' ), +** (2, 0, 1, 'five'), +** (2, 1, -1, 10 ), +** (2, 1, 0, 'x' ), +** (2, 1, 1, 'ten' ); +** +** If database corruption is encountered, this module does not report an +** error. Instead, it attempts to extract as much data as possible and +** ignores the corruption. +** +** SQLITE_DBPTR: +** The sqlite_dbptr table has the following schema: +** +** CREATE TABLE sqlite_dbptr( +** pgno INTEGER, +** child INTEGER, +** schema TEXT HIDDEN +** ); +** +** It contains one entry for each b-tree pointer between a parent and +** child page in the database. +*/ +#if !defined(SQLITEINT_H) +/* #include "sqlite3ext.h" */ + +/* typedef unsigned char u8; */ + +#endif +SQLITE_EXTENSION_INIT1 +#include +#include + +#define DBDATA_PADDING_BYTES 100 + +typedef struct DbdataTable DbdataTable; +typedef struct DbdataCursor DbdataCursor; + +/* Cursor object */ +struct DbdataCursor { + sqlite3_vtab_cursor base; /* Base class. Must be first */ + sqlite3_stmt *pStmt; /* For fetching database pages */ + + int iPgno; /* Current page number */ + u8 *aPage; /* Buffer containing page */ + int nPage; /* Size of aPage[] in bytes */ + int nCell; /* Number of cells on aPage[] */ + int iCell; /* Current cell number */ + int bOnePage; /* True to stop after one page */ + int szDb; + sqlite3_int64 iRowid; + + /* Only for the sqlite_dbdata table */ + u8 *pRec; /* Buffer containing current record */ + int nRec; /* Size of pRec[] in bytes */ + int nHdr; /* Size of header in bytes */ + int iField; /* Current field number */ + u8 *pHdrPtr; + u8 *pPtr; + + sqlite3_int64 iIntkey; /* Integer key value */ +}; + +/* Table object */ +struct DbdataTable { + sqlite3_vtab base; /* Base class. Must be first */ + sqlite3 *db; /* The database connection */ + sqlite3_stmt *pStmt; /* For fetching database pages */ + int bPtr; /* True for sqlite3_dbptr table */ +}; + +/* Column and schema definitions for sqlite_dbdata */ +#define DBDATA_COLUMN_PGNO 0 +#define DBDATA_COLUMN_CELL 1 +#define DBDATA_COLUMN_FIELD 2 +#define DBDATA_COLUMN_VALUE 3 +#define DBDATA_COLUMN_SCHEMA 4 +#define DBDATA_SCHEMA \ + "CREATE TABLE x(" \ + " pgno INTEGER," \ + " cell INTEGER," \ + " field INTEGER," \ + " value ANY," \ + " schema TEXT HIDDEN" \ + ")" + +/* Column and schema definitions for sqlite_dbptr */ +#define DBPTR_COLUMN_PGNO 0 +#define DBPTR_COLUMN_CHILD 1 +#define DBPTR_COLUMN_SCHEMA 2 +#define DBPTR_SCHEMA \ + "CREATE TABLE x(" \ + " pgno INTEGER," \ + " child INTEGER," \ + " schema TEXT HIDDEN" \ + ")" + +/* +** Connect to an sqlite_dbdata (pAux==0) or sqlite_dbptr (pAux!=0) virtual +** table. +*/ +static int dbdataConnect( + sqlite3 *db, + void *pAux, + int argc, const char *const*argv, + sqlite3_vtab **ppVtab, + char **pzErr +){ + DbdataTable *pTab = 0; + int rc = sqlite3_declare_vtab(db, pAux ? DBPTR_SCHEMA : DBDATA_SCHEMA); + + if( rc==SQLITE_OK ){ + pTab = (DbdataTable*)sqlite3_malloc64(sizeof(DbdataTable)); + if( pTab==0 ){ + rc = SQLITE_NOMEM; + }else{ + memset(pTab, 0, sizeof(DbdataTable)); + pTab->db = db; + pTab->bPtr = (pAux!=0); + } + } + + *ppVtab = (sqlite3_vtab*)pTab; + return rc; +} + +/* +** Disconnect from or destroy a sqlite_dbdata or sqlite_dbptr virtual table. +*/ +static int dbdataDisconnect(sqlite3_vtab *pVtab){ + DbdataTable *pTab = (DbdataTable*)pVtab; + if( pTab ){ + sqlite3_finalize(pTab->pStmt); + sqlite3_free(pVtab); + } + return SQLITE_OK; +} + +/* +** This function interprets two types of constraints: +** +** schema=? +** pgno=? +** +** If neither are present, idxNum is set to 0. If schema=? is present, +** the 0x01 bit in idxNum is set. If pgno=? is present, the 0x02 bit +** in idxNum is set. +** +** If both parameters are present, schema is in position 0 and pgno in +** position 1. +*/ +static int dbdataBestIndex(sqlite3_vtab *tab, sqlite3_index_info *pIdx){ + DbdataTable *pTab = (DbdataTable*)tab; + int i; + int iSchema = -1; + int iPgno = -1; + int colSchema = (pTab->bPtr ? DBPTR_COLUMN_SCHEMA : DBDATA_COLUMN_SCHEMA); + + for(i=0; inConstraint; i++){ + struct sqlite3_index_constraint *p = &pIdx->aConstraint[i]; + if( p->op==SQLITE_INDEX_CONSTRAINT_EQ ){ + if( p->iColumn==colSchema ){ + if( p->usable==0 ) return SQLITE_CONSTRAINT; + iSchema = i; + } + if( p->iColumn==DBDATA_COLUMN_PGNO && p->usable ){ + iPgno = i; + } + } + } + + if( iSchema>=0 ){ + pIdx->aConstraintUsage[iSchema].argvIndex = 1; + pIdx->aConstraintUsage[iSchema].omit = 1; + } + if( iPgno>=0 ){ + pIdx->aConstraintUsage[iPgno].argvIndex = 1 + (iSchema>=0); + pIdx->aConstraintUsage[iPgno].omit = 1; + pIdx->estimatedCost = 100; + pIdx->estimatedRows = 50; + + if( pTab->bPtr==0 && pIdx->nOrderBy && pIdx->aOrderBy[0].desc==0 ){ + int iCol = pIdx->aOrderBy[0].iColumn; + if( pIdx->nOrderBy==1 ){ + pIdx->orderByConsumed = (iCol==0 || iCol==1); + }else if( pIdx->nOrderBy==2 && pIdx->aOrderBy[1].desc==0 && iCol==0 ){ + pIdx->orderByConsumed = (pIdx->aOrderBy[1].iColumn==1); + } + } + + }else{ + pIdx->estimatedCost = 100000000; + pIdx->estimatedRows = 1000000000; + } + pIdx->idxNum = (iSchema>=0 ? 0x01 : 0x00) | (iPgno>=0 ? 0x02 : 0x00); + return SQLITE_OK; +} + +/* +** Open a new sqlite_dbdata or sqlite_dbptr cursor. +*/ +static int dbdataOpen(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCursor){ + DbdataCursor *pCsr; + + pCsr = (DbdataCursor*)sqlite3_malloc64(sizeof(DbdataCursor)); + if( pCsr==0 ){ + return SQLITE_NOMEM; + }else{ + memset(pCsr, 0, sizeof(DbdataCursor)); + pCsr->base.pVtab = pVTab; + } + + *ppCursor = (sqlite3_vtab_cursor *)pCsr; + return SQLITE_OK; +} + +/* +** Restore a cursor object to the state it was in when first allocated +** by dbdataOpen(). +*/ +static void dbdataResetCursor(DbdataCursor *pCsr){ + DbdataTable *pTab = (DbdataTable*)(pCsr->base.pVtab); + if( pTab->pStmt==0 ){ + pTab->pStmt = pCsr->pStmt; + }else{ + sqlite3_finalize(pCsr->pStmt); + } + pCsr->pStmt = 0; + pCsr->iPgno = 1; + pCsr->iCell = 0; + pCsr->iField = 0; + pCsr->bOnePage = 0; + sqlite3_free(pCsr->aPage); + sqlite3_free(pCsr->pRec); + pCsr->pRec = 0; + pCsr->aPage = 0; +} + +/* +** Close an sqlite_dbdata or sqlite_dbptr cursor. +*/ +static int dbdataClose(sqlite3_vtab_cursor *pCursor){ + DbdataCursor *pCsr = (DbdataCursor*)pCursor; + dbdataResetCursor(pCsr); + sqlite3_free(pCsr); + return SQLITE_OK; +} + +/* +** Utility methods to decode 16 and 32-bit big-endian unsigned integers. +*/ +static unsigned int get_uint16(unsigned char *a){ + return (a[0]<<8)|a[1]; +} +static unsigned int get_uint32(unsigned char *a){ + return ((unsigned int)a[0]<<24) + | ((unsigned int)a[1]<<16) + | ((unsigned int)a[2]<<8) + | ((unsigned int)a[3]); +} + +/* +** Load page pgno from the database via the sqlite_dbpage virtual table. +** If successful, set (*ppPage) to point to a buffer containing the page +** data, (*pnPage) to the size of that buffer in bytes and return +** SQLITE_OK. In this case it is the responsibility of the caller to +** eventually free the buffer using sqlite3_free(). +** +** Or, if an error occurs, set both (*ppPage) and (*pnPage) to 0 and +** return an SQLite error code. +*/ +static int dbdataLoadPage( + DbdataCursor *pCsr, /* Cursor object */ + unsigned int pgno, /* Page number of page to load */ + u8 **ppPage, /* OUT: pointer to page buffer */ + int *pnPage /* OUT: Size of (*ppPage) in bytes */ +){ + int rc2; + int rc = SQLITE_OK; + sqlite3_stmt *pStmt = pCsr->pStmt; + + *ppPage = 0; + *pnPage = 0; + sqlite3_bind_int64(pStmt, 2, pgno); + if( SQLITE_ROW==sqlite3_step(pStmt) ){ + int nCopy = sqlite3_column_bytes(pStmt, 0); + if( nCopy>0 ){ + u8 *pPage; + pPage = (u8*)sqlite3_malloc64(nCopy + DBDATA_PADDING_BYTES); + if( pPage==0 ){ + rc = SQLITE_NOMEM; + }else{ + const u8 *pCopy = sqlite3_column_blob(pStmt, 0); + memcpy(pPage, pCopy, nCopy); + memset(&pPage[nCopy], 0, DBDATA_PADDING_BYTES); + } + *ppPage = pPage; + *pnPage = nCopy; + } + } + rc2 = sqlite3_reset(pStmt); + if( rc==SQLITE_OK ) rc = rc2; + + return rc; +} + +/* +** Read a varint. Put the value in *pVal and return the number of bytes. +*/ +static int dbdataGetVarint(const u8 *z, sqlite3_int64 *pVal){ + sqlite3_int64 v = 0; + int i; + for(i=0; i<8; i++){ + v = (v<<7) + (z[i]&0x7f); + if( (z[i]&0x80)==0 ){ *pVal = v; return i+1; } + } + v = (v<<8) + (z[i]&0xff); + *pVal = v; + return 9; +} + +/* +** Return the number of bytes of space used by an SQLite value of type +** eType. +*/ +static int dbdataValueBytes(int eType){ + switch( eType ){ + case 0: case 8: case 9: + case 10: case 11: + return 0; + case 1: + return 1; + case 2: + return 2; + case 3: + return 3; + case 4: + return 4; + case 5: + return 6; + case 6: + case 7: + return 8; + default: + if( eType>0 ){ + return ((eType-12) / 2); + } + return 0; + } +} + +/* +** Load a value of type eType from buffer pData and use it to set the +** result of context object pCtx. +*/ +static void dbdataValue( + sqlite3_context *pCtx, + int eType, + u8 *pData, + int nData +){ + if( eType>=0 && dbdataValueBytes(eType)<=nData ){ + switch( eType ){ + case 0: + case 10: + case 11: + sqlite3_result_null(pCtx); + break; + + case 8: + sqlite3_result_int(pCtx, 0); + break; + case 9: + sqlite3_result_int(pCtx, 1); + break; + + case 1: case 2: case 3: case 4: case 5: case 6: case 7: { + sqlite3_uint64 v = (signed char)pData[0]; + pData++; + switch( eType ){ + case 7: + case 6: v = (v<<16) + (pData[0]<<8) + pData[1]; pData += 2; + case 5: v = (v<<16) + (pData[0]<<8) + pData[1]; pData += 2; + case 4: v = (v<<8) + pData[0]; pData++; + case 3: v = (v<<8) + pData[0]; pData++; + case 2: v = (v<<8) + pData[0]; pData++; + } + + if( eType==7 ){ + double r; + memcpy(&r, &v, sizeof(r)); + sqlite3_result_double(pCtx, r); + }else{ + sqlite3_result_int64(pCtx, (sqlite3_int64)v); + } + break; + } + + default: { + int n = ((eType-12) / 2); + if( eType % 2 ){ + sqlite3_result_text(pCtx, (const char*)pData, n, SQLITE_TRANSIENT); + }else{ + sqlite3_result_blob(pCtx, pData, n, SQLITE_TRANSIENT); + } + } + } + } +} + +/* +** Move an sqlite_dbdata or sqlite_dbptr cursor to the next entry. +*/ +static int dbdataNext(sqlite3_vtab_cursor *pCursor){ + DbdataCursor *pCsr = (DbdataCursor*)pCursor; + DbdataTable *pTab = (DbdataTable*)pCursor->pVtab; + + pCsr->iRowid++; + while( 1 ){ + int rc; + int iOff = (pCsr->iPgno==1 ? 100 : 0); + int bNextPage = 0; + + if( pCsr->aPage==0 ){ + while( 1 ){ + if( pCsr->bOnePage==0 && pCsr->iPgno>pCsr->szDb ) return SQLITE_OK; + rc = dbdataLoadPage(pCsr, pCsr->iPgno, &pCsr->aPage, &pCsr->nPage); + if( rc!=SQLITE_OK ) return rc; + if( pCsr->aPage ) break; + pCsr->iPgno++; + } + pCsr->iCell = pTab->bPtr ? -2 : 0; + pCsr->nCell = get_uint16(&pCsr->aPage[iOff+3]); + } + + if( pTab->bPtr ){ + if( pCsr->aPage[iOff]!=0x02 && pCsr->aPage[iOff]!=0x05 ){ + pCsr->iCell = pCsr->nCell; + } + pCsr->iCell++; + if( pCsr->iCell>=pCsr->nCell ){ + sqlite3_free(pCsr->aPage); + pCsr->aPage = 0; + if( pCsr->bOnePage ) return SQLITE_OK; + pCsr->iPgno++; + }else{ + return SQLITE_OK; + } + }else{ + /* If there is no record loaded, load it now. */ + if( pCsr->pRec==0 ){ + int bHasRowid = 0; + int nPointer = 0; + sqlite3_int64 nPayload = 0; + sqlite3_int64 nHdr = 0; + int iHdr; + int U, X; + int nLocal; + + switch( pCsr->aPage[iOff] ){ + case 0x02: + nPointer = 4; + break; + case 0x0a: + break; + case 0x0d: + bHasRowid = 1; + break; + default: + /* This is not a b-tree page with records on it. Continue. */ + pCsr->iCell = pCsr->nCell; + break; + } + + if( pCsr->iCell>=pCsr->nCell ){ + bNextPage = 1; + }else{ + + iOff += 8 + nPointer + pCsr->iCell*2; + if( iOff>pCsr->nPage ){ + bNextPage = 1; + }else{ + iOff = get_uint16(&pCsr->aPage[iOff]); + } + + /* For an interior node cell, skip past the child-page number */ + iOff += nPointer; + + /* Load the "byte of payload including overflow" field */ + if( bNextPage || iOff>pCsr->nPage ){ + bNextPage = 1; + }else{ + iOff += dbdataGetVarint(&pCsr->aPage[iOff], &nPayload); + } + + /* If this is a leaf intkey cell, load the rowid */ + if( bHasRowid && !bNextPage && iOffnPage ){ + iOff += dbdataGetVarint(&pCsr->aPage[iOff], &pCsr->iIntkey); + } + + /* Figure out how much data to read from the local page */ + U = pCsr->nPage; + if( bHasRowid ){ + X = U-35; + }else{ + X = ((U-12)*64/255)-23; + } + if( nPayload<=X ){ + nLocal = nPayload; + }else{ + int M, K; + M = ((U-12)*32/255)-23; + K = M+((nPayload-M)%(U-4)); + if( K<=X ){ + nLocal = K; + }else{ + nLocal = M; + } + } + + if( bNextPage || nLocal+iOff>pCsr->nPage ){ + bNextPage = 1; + }else{ + + /* Allocate space for payload. And a bit more to catch small buffer + ** overruns caused by attempting to read a varint or similar from + ** near the end of a corrupt record. */ + pCsr->pRec = (u8*)sqlite3_malloc64(nPayload+DBDATA_PADDING_BYTES); + if( pCsr->pRec==0 ) return SQLITE_NOMEM; + memset(pCsr->pRec, 0, nPayload+DBDATA_PADDING_BYTES); + pCsr->nRec = nPayload; + + /* Load the nLocal bytes of payload */ + memcpy(pCsr->pRec, &pCsr->aPage[iOff], nLocal); + iOff += nLocal; + + /* Load content from overflow pages */ + if( nPayload>nLocal ){ + sqlite3_int64 nRem = nPayload - nLocal; + unsigned int pgnoOvfl = get_uint32(&pCsr->aPage[iOff]); + while( nRem>0 ){ + u8 *aOvfl = 0; + int nOvfl = 0; + int nCopy; + rc = dbdataLoadPage(pCsr, pgnoOvfl, &aOvfl, &nOvfl); + assert( rc!=SQLITE_OK || aOvfl==0 || nOvfl==pCsr->nPage ); + if( rc!=SQLITE_OK ) return rc; + if( aOvfl==0 ) break; + + nCopy = U-4; + if( nCopy>nRem ) nCopy = nRem; + memcpy(&pCsr->pRec[nPayload-nRem], &aOvfl[4], nCopy); + nRem -= nCopy; + + pgnoOvfl = get_uint32(aOvfl); + sqlite3_free(aOvfl); + } + } + + iHdr = dbdataGetVarint(pCsr->pRec, &nHdr); + pCsr->nHdr = nHdr; + pCsr->pHdrPtr = &pCsr->pRec[iHdr]; + pCsr->pPtr = &pCsr->pRec[pCsr->nHdr]; + pCsr->iField = (bHasRowid ? -1 : 0); + } + } + }else{ + pCsr->iField++; + if( pCsr->iField>0 ){ + sqlite3_int64 iType; + if( pCsr->pHdrPtr>&pCsr->pRec[pCsr->nRec] ){ + bNextPage = 1; + }else{ + pCsr->pHdrPtr += dbdataGetVarint(pCsr->pHdrPtr, &iType); + pCsr->pPtr += dbdataValueBytes(iType); + } + } + } + + if( bNextPage ){ + sqlite3_free(pCsr->aPage); + sqlite3_free(pCsr->pRec); + pCsr->aPage = 0; + pCsr->pRec = 0; + if( pCsr->bOnePage ) return SQLITE_OK; + pCsr->iPgno++; + }else{ + if( pCsr->iField<0 || pCsr->pHdrPtr<&pCsr->pRec[pCsr->nHdr] ){ + return SQLITE_OK; + } + + /* Advance to the next cell. The next iteration of the loop will load + ** the record and so on. */ + sqlite3_free(pCsr->pRec); + pCsr->pRec = 0; + pCsr->iCell++; + } + } + } + + assert( !"can't get here" ); + return SQLITE_OK; +} + +/* +** Return true if the cursor is at EOF. +*/ +static int dbdataEof(sqlite3_vtab_cursor *pCursor){ + DbdataCursor *pCsr = (DbdataCursor*)pCursor; + return pCsr->aPage==0; +} + +/* +** Determine the size in pages of database zSchema (where zSchema is +** "main", "temp" or the name of an attached database) and set +** pCsr->szDb accordingly. If successful, return SQLITE_OK. Otherwise, +** an SQLite error code. +*/ +static int dbdataDbsize(DbdataCursor *pCsr, const char *zSchema){ + DbdataTable *pTab = (DbdataTable*)pCsr->base.pVtab; + char *zSql = 0; + int rc, rc2; + sqlite3_stmt *pStmt = 0; + + zSql = sqlite3_mprintf("PRAGMA %Q.page_count", zSchema); + if( zSql==0 ) return SQLITE_NOMEM; + rc = sqlite3_prepare_v2(pTab->db, zSql, -1, &pStmt, 0); + sqlite3_free(zSql); + if( rc==SQLITE_OK && sqlite3_step(pStmt)==SQLITE_ROW ){ + pCsr->szDb = sqlite3_column_int(pStmt, 0); + } + rc2 = sqlite3_finalize(pStmt); + if( rc==SQLITE_OK ) rc = rc2; + return rc; +} + +/* +** xFilter method for sqlite_dbdata and sqlite_dbptr. +*/ +static int dbdataFilter( + sqlite3_vtab_cursor *pCursor, + int idxNum, const char *idxStr, + int argc, sqlite3_value **argv +){ + DbdataCursor *pCsr = (DbdataCursor*)pCursor; + DbdataTable *pTab = (DbdataTable*)pCursor->pVtab; + int rc = SQLITE_OK; + const char *zSchema = "main"; + + dbdataResetCursor(pCsr); + assert( pCsr->iPgno==1 ); + if( idxNum & 0x01 ){ + zSchema = (const char*)sqlite3_value_text(argv[0]); + } + if( idxNum & 0x02 ){ + pCsr->iPgno = sqlite3_value_int(argv[(idxNum & 0x01)]); + pCsr->bOnePage = 1; + }else{ + pCsr->nPage = dbdataDbsize(pCsr, zSchema); + rc = dbdataDbsize(pCsr, zSchema); + } + + if( rc==SQLITE_OK ){ + if( pTab->pStmt ){ + pCsr->pStmt = pTab->pStmt; + pTab->pStmt = 0; + }else{ + rc = sqlite3_prepare_v2(pTab->db, + "SELECT data FROM sqlite_dbpage(?) WHERE pgno=?", -1, + &pCsr->pStmt, 0 + ); + } + } + if( rc==SQLITE_OK ){ + rc = sqlite3_bind_text(pCsr->pStmt, 1, zSchema, -1, SQLITE_TRANSIENT); + }else{ + pTab->base.zErrMsg = sqlite3_mprintf("%s", sqlite3_errmsg(pTab->db)); + } + if( rc==SQLITE_OK ){ + rc = dbdataNext(pCursor); + } + return rc; +} + +/* +** Return a column for the sqlite_dbdata or sqlite_dbptr table. +*/ +static int dbdataColumn( + sqlite3_vtab_cursor *pCursor, + sqlite3_context *ctx, + int i +){ + DbdataCursor *pCsr = (DbdataCursor*)pCursor; + DbdataTable *pTab = (DbdataTable*)pCursor->pVtab; + if( pTab->bPtr ){ + switch( i ){ + case DBPTR_COLUMN_PGNO: + sqlite3_result_int64(ctx, pCsr->iPgno); + break; + case DBPTR_COLUMN_CHILD: { + int iOff = pCsr->iPgno==1 ? 100 : 0; + if( pCsr->iCell<0 ){ + iOff += 8; + }else{ + iOff += 12 + pCsr->iCell*2; + if( iOff>pCsr->nPage ) return SQLITE_OK; + iOff = get_uint16(&pCsr->aPage[iOff]); + } + if( iOff<=pCsr->nPage ){ + sqlite3_result_int64(ctx, get_uint32(&pCsr->aPage[iOff])); + } + break; + } + } + }else{ + switch( i ){ + case DBDATA_COLUMN_PGNO: + sqlite3_result_int64(ctx, pCsr->iPgno); + break; + case DBDATA_COLUMN_CELL: + sqlite3_result_int(ctx, pCsr->iCell); + break; + case DBDATA_COLUMN_FIELD: + sqlite3_result_int(ctx, pCsr->iField); + break; + case DBDATA_COLUMN_VALUE: { + if( pCsr->iField<0 ){ + sqlite3_result_int64(ctx, pCsr->iIntkey); + }else{ + sqlite3_int64 iType; + dbdataGetVarint(pCsr->pHdrPtr, &iType); + dbdataValue( + ctx, iType, pCsr->pPtr, &pCsr->pRec[pCsr->nRec] - pCsr->pPtr + ); + } + break; + } + } + } + return SQLITE_OK; +} + +/* +** Return the rowid for an sqlite_dbdata or sqlite_dptr table. +*/ +static int dbdataRowid(sqlite3_vtab_cursor *pCursor, sqlite_int64 *pRowid){ + DbdataCursor *pCsr = (DbdataCursor*)pCursor; + *pRowid = pCsr->iRowid; + return SQLITE_OK; +} + + +/* +** Invoke this routine to register the "sqlite_dbdata" virtual table module +*/ +static int sqlite3DbdataRegister(sqlite3 *db){ + static sqlite3_module dbdata_module = { + 0, /* iVersion */ + 0, /* xCreate */ + dbdataConnect, /* xConnect */ + dbdataBestIndex, /* xBestIndex */ + dbdataDisconnect, /* xDisconnect */ + 0, /* xDestroy */ + dbdataOpen, /* xOpen - open a cursor */ + dbdataClose, /* xClose - close a cursor */ + dbdataFilter, /* xFilter - configure scan constraints */ + dbdataNext, /* xNext - advance a cursor */ + dbdataEof, /* xEof - check for end of scan */ + dbdataColumn, /* xColumn - read data */ + dbdataRowid, /* xRowid - read data */ + 0, /* xUpdate */ + 0, /* xBegin */ + 0, /* xSync */ + 0, /* xCommit */ + 0, /* xRollback */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Jul 18 01:30:57 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 394C3BA610; Thu, 18 Jul 2019 01:30:57 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1BC1D6D211; Thu, 18 Jul 2019 01:30:57 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E6CFB2771B; Thu, 18 Jul 2019 01:30:56 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6I1Uuc4009532; Thu, 18 Jul 2019 01:30:56 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6I1Uui6009531; Thu, 18 Jul 2019 01:30:56 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201907180130.x6I1Uui6009531@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 18 Jul 2019 01:30:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350104 - head/sys/dev/iicbus X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/iicbus X-SVN-Commit-Revision: 350104 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1BC1D6D211 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jul 2019 01:30:57 -0000 Author: ian Date: Thu Jul 18 01:30:56 2019 New Revision: 350104 URL: https://svnweb.freebsd.org/changeset/base/350104 Log: Handle the PCF2127 RTC chip the same as PCF2129 when init'ing the chip. This affects the detection of 24-hour vs AM/PM mode... the ampm bit is in a different location on 2127 and 2129 chips compared to other nxp rtc chips. I noticed the 2127 case wasn't being handled correctly when I accidentally misconfiged my system by claiming my PCF2129 was a 2127. Modified: head/sys/dev/iicbus/nxprtc.c Modified: head/sys/dev/iicbus/nxprtc.c ============================================================================== --- head/sys/dev/iicbus/nxprtc.c Thu Jul 18 00:27:28 2019 (r350103) +++ head/sys/dev/iicbus/nxprtc.c Thu Jul 18 01:30:56 2019 (r350104) @@ -351,9 +351,18 @@ pcf8523_start(struct nxprtc_softc *sc) { int err; uint8_t cs1, cs3, clkout; - bool is2129; + bool is212x; - is2129 = (sc->chiptype == TYPE_PCA2129 || sc->chiptype == TYPE_PCF2129); + switch (sc->chiptype) { + case TYPE_PCF2127: + case TYPE_PCA2129: + case TYPE_PCF2129: + is212x = true; + break; + default: + is212x = true; + break; + } /* Read and sanity-check the control registers. */ if ((err = read_reg(sc, PCF85xx_R_CS1, &cs1)) != 0) { @@ -389,7 +398,7 @@ pcf8523_start(struct nxprtc_softc *sc) * to zero then back to 1, then wait 100ms for the refresh, and * finally set the bit back to zero with the COF_HIGHZ write. */ - if (is2129) { + if (is212x) { clkout = PCF2129_B_CLKOUT_HIGHZ; if ((err = write_reg(sc, PCF8523_R_TMR_CLKOUT, clkout)) != 0) { @@ -429,7 +438,7 @@ pcf8523_start(struct nxprtc_softc *sc) device_printf(sc->dev, "WARNING: RTC battery is low\n"); /* Remember whether we're running in AM/PM mode. */ - if (is2129) { + if (is212x) { if (cs1 & PCF2129_B_CS1_12HR) sc->use_ampm = true; } else { From owner-svn-src-all@freebsd.org Thu Jul 18 01:33:00 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DE35EBA83B; Thu, 18 Jul 2019 01:33:00 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BE7716D5AE; Thu, 18 Jul 2019 01:33:00 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 96A5F278C4; Thu, 18 Jul 2019 01:33:00 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6I1X0lm015145; Thu, 18 Jul 2019 01:33:00 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6I1X0cN015144; Thu, 18 Jul 2019 01:33:00 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201907180133.x6I1X0cN015144@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 18 Jul 2019 01:33:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350105 - stable/12/sys/arm64/include X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/arm64/include X-SVN-Commit-Revision: 350105 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BE7716D5AE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jul 2019 01:33:00 -0000 Author: markj Date: Thu Jul 18 01:33:00 2019 New Revision: 350105 URL: https://svnweb.freebsd.org/changeset/base/350105 Log: MFC r349910: Fix some ISS bit definitions for data aborts. Modified: stable/12/sys/arm64/include/armreg.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm64/include/armreg.h ============================================================================== --- stable/12/sys/arm64/include/armreg.h Thu Jul 18 01:30:56 2019 (r350104) +++ stable/12/sys/arm64/include/armreg.h Thu Jul 18 01:33:00 2019 (r350105) @@ -85,10 +85,10 @@ #define ISS_DATA_SF (0x01 << 15) #define ISS_DATA_AR (0x01 << 14) #define ISS_DATA_FnV (0x01 << 10) -#define ISS_DATa_EA (0x01 << 9) -#define ISS_DATa_CM (0x01 << 8) -#define ISS_INSN_S1PTW (0x01 << 7) -#define ISS_DATa_WnR (0x01 << 6) +#define ISS_DATA_EA (0x01 << 9) +#define ISS_DATA_CM (0x01 << 8) +#define ISS_DATA_S1PTW (0x01 << 7) +#define ISS_DATA_WnR (0x01 << 6) #define ISS_DATA_DFSC_MASK (0x3f << 0) #define ISS_DATA_DFSC_ASF_L0 (0x00 << 0) #define ISS_DATA_DFSC_ASF_L1 (0x01 << 0) From owner-svn-src-all@freebsd.org Thu Jul 18 01:37:01 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 38DCEBA9CF; Thu, 18 Jul 2019 01:37:01 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1B7106D765; Thu, 18 Jul 2019 01:37:01 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EAC60278CE; Thu, 18 Jul 2019 01:37:00 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6I1b0NE015383; Thu, 18 Jul 2019 01:37:00 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6I1b0UA015382; Thu, 18 Jul 2019 01:37:00 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201907180137.x6I1b0UA015382@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 18 Jul 2019 01:37:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350106 - head/sys/dev/iicbus X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/iicbus X-SVN-Commit-Revision: 350106 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1B7106D765 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jul 2019 01:37:01 -0000 Author: ian Date: Thu Jul 18 01:37:00 2019 New Revision: 350106 URL: https://svnweb.freebsd.org/changeset/base/350106 Log: Fix a paste-o, set is212x = false for other chip types. Doh! Modified: head/sys/dev/iicbus/nxprtc.c Modified: head/sys/dev/iicbus/nxprtc.c ============================================================================== --- head/sys/dev/iicbus/nxprtc.c Thu Jul 18 01:33:00 2019 (r350105) +++ head/sys/dev/iicbus/nxprtc.c Thu Jul 18 01:37:00 2019 (r350106) @@ -360,7 +360,7 @@ pcf8523_start(struct nxprtc_softc *sc) is212x = true; break; default: - is212x = true; + is212x = false; break; } From owner-svn-src-all@freebsd.org Thu Jul 18 07:26:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0C03EA1960; Thu, 18 Jul 2019 07:26:31 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E228D765D3; Thu, 18 Jul 2019 07:26:30 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BCB323FA3; Thu, 18 Jul 2019 07:26:30 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6I7QUS0022968; Thu, 18 Jul 2019 07:26:30 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6I7QUJJ022967; Thu, 18 Jul 2019 07:26:30 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201907180726.x6I7QUJJ022967@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 18 Jul 2019 07:26:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350108 - head/usr.bin/bsdiff/bspatch X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/usr.bin/bsdiff/bspatch X-SVN-Commit-Revision: 350108 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E228D765D3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.944,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jul 2019 07:26:31 -0000 Author: delphij Date: Thu Jul 18 07:26:30 2019 New Revision: 350108 URL: https://svnweb.freebsd.org/changeset/base/350108 Log: Remove support for FreeBSD 10.x. MFC after: 1 month Modified: head/usr.bin/bsdiff/bspatch/bspatch.c Modified: head/usr.bin/bsdiff/bspatch/bspatch.c ============================================================================== --- head/usr.bin/bsdiff/bspatch/bspatch.c Thu Jul 18 04:46:30 2019 (r350107) +++ head/usr.bin/bsdiff/bspatch/bspatch.c Thu Jul 18 07:26:30 2019 (r350108) @@ -29,13 +29,9 @@ #include __FBSDID("$FreeBSD$"); -#if defined(__FreeBSD__) -#include -#if __FreeBSD_version >= 1001511 +#ifndef WITHOUT_CAPSICUM #include -#define HAVE_CAPSICUM #endif -#endif #include #include @@ -107,7 +103,7 @@ int main(int argc, char *argv[]) off_t oldpos, newpos; off_t ctrl[3]; off_t i, lenread, offset; -#ifdef HAVE_CAPSICUM +#ifndef WITHOUT_CAPSICUM cap_rights_t rights_dir, rights_ro, rights_wr; #endif @@ -143,7 +139,7 @@ int main(int argc, char *argv[]) err(1, "open(%s)", argv[2]); atexit(exit_cleanup); -#ifdef HAVE_CAPSICUM +#ifndef WITHOUT_CAPSICUM if (cap_enter() < 0) err(1, "failed to enter security sandbox"); From owner-svn-src-all@freebsd.org Thu Jul 18 07:37:28 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 13408A1E0E; Thu, 18 Jul 2019 07:37:28 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B60E676C84; Thu, 18 Jul 2019 07:37:27 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 85CB341BB; Thu, 18 Jul 2019 07:37:27 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6I7bRQv028992; Thu, 18 Jul 2019 07:37:27 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6I7bRY8028991; Thu, 18 Jul 2019 07:37:27 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201907180737.x6I7bRY8028991@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 18 Jul 2019 07:37:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350109 - head/usr.bin/bsdiff/bspatch X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/usr.bin/bsdiff/bspatch X-SVN-Commit-Revision: 350109 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B60E676C84 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jul 2019 07:37:28 -0000 Author: delphij Date: Thu Jul 18 07:37:26 2019 New Revision: 350109 URL: https://svnweb.freebsd.org/changeset/base/350109 Log: errno.h is no longer needed as of r340239 so remove it. No MFC planned as that revision was not merged. Modified: head/usr.bin/bsdiff/bspatch/bspatch.c Modified: head/usr.bin/bsdiff/bspatch/bspatch.c ============================================================================== --- head/usr.bin/bsdiff/bspatch/bspatch.c Thu Jul 18 07:26:30 2019 (r350108) +++ head/usr.bin/bsdiff/bspatch/bspatch.c Thu Jul 18 07:37:26 2019 (r350109) @@ -35,7 +35,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include From owner-svn-src-all@freebsd.org Thu Jul 18 11:43:11 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0E961A67B1; Thu, 18 Jul 2019 11:43:11 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E3B6A85BA8; Thu, 18 Jul 2019 11:43:10 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BA84671AC; Thu, 18 Jul 2019 11:43:10 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6IBhArF076808; Thu, 18 Jul 2019 11:43:10 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6IBhABd076807; Thu, 18 Jul 2019 11:43:10 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201907181143.x6IBhABd076807@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Thu, 18 Jul 2019 11:43:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350110 - in stable: 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 350110 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E3B6A85BA8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jul 2019 11:43:11 -0000 Author: cy Date: Thu Jul 18 11:43:09 2019 New Revision: 350110 URL: https://svnweb.freebsd.org/changeset/base/350110 Log: MFC r349898, r349916: ipfilter commands, in this case ipf(8), passes its operations and rules via an ioctl interface. Rules can be added or removed and stats and counters can be zeroed out. As the ipfilter interprets these instructions or operations they are stored in an integer called addrem (add/remove). 0 is add, 1 is remove, and 2 is clear stats and counters. Much of this is not documented. This commit documents these operations by replacing simple integers with a self documenting enum along with a few basic comments. Modified: stable/12/sys/contrib/ipfilter/netinet/fil.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/contrib/ipfilter/netinet/fil.c Directory Properties: stable/11/ (props changed) Modified: stable/12/sys/contrib/ipfilter/netinet/fil.c ============================================================================== --- stable/12/sys/contrib/ipfilter/netinet/fil.c Thu Jul 18 07:37:26 2019 (r350109) +++ stable/12/sys/contrib/ipfilter/netinet/fil.c Thu Jul 18 11:43:09 2019 (r350110) @@ -4476,7 +4476,11 @@ frrequest(softc, unit, req, data, set, makecopy) int set, makecopy; caddr_t data; { - int error = 0, in, family, addrem, need_free = 0; + int error = 0, in, family, need_free = 0; + enum { OP_ADD, /* add rule */ + OP_REM, /* remove rule */ + OP_ZERO /* zero statistics and counters */ } + addrem = OP_ADD; frentry_t frd, *fp, *f, **fprev, **ftail; void *ptr, *uptr, *cptr; u_int *p, *pp; @@ -4544,11 +4548,11 @@ frrequest(softc, unit, req, data, set, makecopy) if (req == (ioctlcmd_t)SIOCINAFR || req == (ioctlcmd_t)SIOCINIFR || req == (ioctlcmd_t)SIOCADAFR || req == (ioctlcmd_t)SIOCADIFR) - addrem = 0; + addrem = OP_ADD; /* Add rule */ else if (req == (ioctlcmd_t)SIOCRMAFR || req == (ioctlcmd_t)SIOCRMIFR) - addrem = 1; + addrem = OP_REM; /* Remove rule */ else if (req == (ioctlcmd_t)SIOCZRLST) - addrem = 2; + addrem = OP_ZERO; /* Zero statistics and counters */ else { IPFERROR(9); error = EINVAL; @@ -4582,7 +4586,7 @@ frrequest(softc, unit, req, data, set, makecopy) goto donenolock; } - if (addrem == 0) { + if (addrem == OP_ADD) { error = ipf_funcinit(softc, fp); if (error != 0) goto donenolock; @@ -4646,7 +4650,7 @@ frrequest(softc, unit, req, data, set, makecopy) * them to be created if they don't already exit. */ group = FR_NAME(fp, fr_group); - if (addrem == 0) { + if (addrem == OP_ADD) { fg = ipf_group_add(softc, group, NULL, fp->fr_flags, unit, set); fp->fr_grp = fg; @@ -4951,7 +4955,7 @@ frrequest(softc, unit, req, data, set, makecopy) /* * If zero'ing statistics, copy current to caller and zero. */ - if (addrem == 2) { + if (addrem == OP_ZERO) { if (f == NULL) { IPFERROR(27); error = ESRCH; @@ -5044,7 +5048,7 @@ frrequest(softc, unit, req, data, set, makecopy) /* * Request to remove a rule. */ - if (addrem == 1) { + if (addrem == OP_REM) { if (f == NULL) { IPFERROR(29); error = ESRCH; @@ -5110,7 +5114,7 @@ frrequest(softc, unit, req, data, set, makecopy) if (fp->fr_next != NULL) fp->fr_next->fr_pnext = &fp->fr_next; *ftail = fp; - if (addrem == 0) + if (addrem == OP_ADD) ipf_fixskip(ftail, fp, 1); fp->fr_icmpgrp = NULL; From owner-svn-src-all@freebsd.org Thu Jul 18 11:43:10 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B548FA67AD; Thu, 18 Jul 2019 11:43:10 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 979C685BA7; Thu, 18 Jul 2019 11:43:10 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 69D0F71AB; Thu, 18 Jul 2019 11:43:10 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6IBhAn5076801; Thu, 18 Jul 2019 11:43:10 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6IBhAho076800; Thu, 18 Jul 2019 11:43:10 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201907181143.x6IBhAho076800@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Thu, 18 Jul 2019 11:43:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r350110 - in stable: 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 350110 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 979C685BA7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jul 2019 11:43:10 -0000 Author: cy Date: Thu Jul 18 11:43:09 2019 New Revision: 350110 URL: https://svnweb.freebsd.org/changeset/base/350110 Log: MFC r349898, r349916: ipfilter commands, in this case ipf(8), passes its operations and rules via an ioctl interface. Rules can be added or removed and stats and counters can be zeroed out. As the ipfilter interprets these instructions or operations they are stored in an integer called addrem (add/remove). 0 is add, 1 is remove, and 2 is clear stats and counters. Much of this is not documented. This commit documents these operations by replacing simple integers with a self documenting enum along with a few basic comments. Modified: stable/11/sys/contrib/ipfilter/netinet/fil.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/sys/contrib/ipfilter/netinet/fil.c Directory Properties: stable/12/ (props changed) Modified: stable/11/sys/contrib/ipfilter/netinet/fil.c ============================================================================== --- stable/11/sys/contrib/ipfilter/netinet/fil.c Thu Jul 18 07:37:26 2019 (r350109) +++ stable/11/sys/contrib/ipfilter/netinet/fil.c Thu Jul 18 11:43:09 2019 (r350110) @@ -4476,7 +4476,11 @@ frrequest(softc, unit, req, data, set, makecopy) int set, makecopy; caddr_t data; { - int error = 0, in, family, addrem, need_free = 0; + int error = 0, in, family, need_free = 0; + enum { OP_ADD, /* add rule */ + OP_REM, /* remove rule */ + OP_ZERO /* zero statistics and counters */ } + addrem = OP_ADD; frentry_t frd, *fp, *f, **fprev, **ftail; void *ptr, *uptr, *cptr; u_int *p, *pp; @@ -4544,11 +4548,11 @@ frrequest(softc, unit, req, data, set, makecopy) if (req == (ioctlcmd_t)SIOCINAFR || req == (ioctlcmd_t)SIOCINIFR || req == (ioctlcmd_t)SIOCADAFR || req == (ioctlcmd_t)SIOCADIFR) - addrem = 0; + addrem = OP_ADD; /* Add rule */ else if (req == (ioctlcmd_t)SIOCRMAFR || req == (ioctlcmd_t)SIOCRMIFR) - addrem = 1; + addrem = OP_REM; /* Remove rule */ else if (req == (ioctlcmd_t)SIOCZRLST) - addrem = 2; + addrem = OP_ZERO; /* Zero statistics and counters */ else { IPFERROR(9); error = EINVAL; @@ -4582,7 +4586,7 @@ frrequest(softc, unit, req, data, set, makecopy) goto donenolock; } - if (addrem == 0) { + if (addrem == OP_ADD) { error = ipf_funcinit(softc, fp); if (error != 0) goto donenolock; @@ -4646,7 +4650,7 @@ frrequest(softc, unit, req, data, set, makecopy) * them to be created if they don't already exit. */ group = FR_NAME(fp, fr_group); - if (addrem == 0) { + if (addrem == OP_ADD) { fg = ipf_group_add(softc, group, NULL, fp->fr_flags, unit, set); fp->fr_grp = fg; @@ -4951,7 +4955,7 @@ frrequest(softc, unit, req, data, set, makecopy) /* * If zero'ing statistics, copy current to caller and zero. */ - if (addrem == 2) { + if (addrem == OP_ZERO) { if (f == NULL) { IPFERROR(27); error = ESRCH; @@ -5044,7 +5048,7 @@ frrequest(softc, unit, req, data, set, makecopy) /* * Request to remove a rule. */ - if (addrem == 1) { + if (addrem == OP_REM) { if (f == NULL) { IPFERROR(29); error = ESRCH; @@ -5110,7 +5114,7 @@ frrequest(softc, unit, req, data, set, makecopy) if (fp->fr_next != NULL) fp->fr_next->fr_pnext = &fp->fr_next; *ftail = fp; - if (addrem == 0) + if (addrem == OP_ADD) ipf_fixskip(ftail, fp, 1); fp->fr_icmpgrp = NULL; From owner-svn-src-all@freebsd.org Thu Jul 18 11:46:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 852E2A68BB; Thu, 18 Jul 2019 11:46:38 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 67E3885E5C; Thu, 18 Jul 2019 11:46:38 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3EF7771AF; Thu, 18 Jul 2019 11:46:38 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6IBkcrF077041; Thu, 18 Jul 2019 11:46:38 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6IBkccF077040; Thu, 18 Jul 2019 11:46:38 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201907181146.x6IBkccF077040@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Thu, 18 Jul 2019 11:46:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r350111 - in stable: 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 350111 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 67E3885E5C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jul 2019 11:46:38 -0000 Author: cy Date: Thu Jul 18 11:46:37 2019 New Revision: 350111 URL: https://svnweb.freebsd.org/changeset/base/350111 Log: MFC r349917: Remove a tautological test for adding a rule in the block that adds rules. Modified: stable/11/sys/contrib/ipfilter/netinet/fil.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/sys/contrib/ipfilter/netinet/fil.c Directory Properties: stable/12/ (props changed) Modified: stable/11/sys/contrib/ipfilter/netinet/fil.c ============================================================================== --- stable/11/sys/contrib/ipfilter/netinet/fil.c Thu Jul 18 11:43:09 2019 (r350110) +++ stable/11/sys/contrib/ipfilter/netinet/fil.c Thu Jul 18 11:46:37 2019 (r350111) @@ -5114,8 +5114,7 @@ frrequest(softc, unit, req, data, set, makecopy) if (fp->fr_next != NULL) fp->fr_next->fr_pnext = &fp->fr_next; *ftail = fp; - if (addrem == OP_ADD) - ipf_fixskip(ftail, fp, 1); + ipf_fixskip(ftail, fp, 1); fp->fr_icmpgrp = NULL; if (fp->fr_icmphead != -1) { From owner-svn-src-all@freebsd.org Thu Jul 18 11:46:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D294EA68BF; Thu, 18 Jul 2019 11:46:38 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B393885E5D; Thu, 18 Jul 2019 11:46:38 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8E31171B0; Thu, 18 Jul 2019 11:46:38 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6IBkc6A077047; Thu, 18 Jul 2019 11:46:38 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6IBkcGV077046; Thu, 18 Jul 2019 11:46:38 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201907181146.x6IBkcGV077046@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Thu, 18 Jul 2019 11:46:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350111 - in stable: 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 350111 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B393885E5D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jul 2019 11:46:38 -0000 Author: cy Date: Thu Jul 18 11:46:37 2019 New Revision: 350111 URL: https://svnweb.freebsd.org/changeset/base/350111 Log: MFC r349917: Remove a tautological test for adding a rule in the block that adds rules. Modified: stable/12/sys/contrib/ipfilter/netinet/fil.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/contrib/ipfilter/netinet/fil.c Directory Properties: stable/11/ (props changed) Modified: stable/12/sys/contrib/ipfilter/netinet/fil.c ============================================================================== --- stable/12/sys/contrib/ipfilter/netinet/fil.c Thu Jul 18 11:43:09 2019 (r350110) +++ stable/12/sys/contrib/ipfilter/netinet/fil.c Thu Jul 18 11:46:37 2019 (r350111) @@ -5114,8 +5114,7 @@ frrequest(softc, unit, req, data, set, makecopy) if (fp->fr_next != NULL) fp->fr_next->fr_pnext = &fp->fr_next; *ftail = fp; - if (addrem == OP_ADD) - ipf_fixskip(ftail, fp, 1); + ipf_fixskip(ftail, fp, 1); fp->fr_icmpgrp = NULL; if (fp->fr_icmphead != -1) { From owner-svn-src-all@freebsd.org Thu Jul 18 13:58:05 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8B3C0A9643; Thu, 18 Jul 2019 13:58:05 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 79B748A637; Thu, 18 Jul 2019 13:58:05 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4C26A8A51; Thu, 18 Jul 2019 13:58:05 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6IDw5CJ053302; Thu, 18 Jul 2019 13:58:05 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6IDw5Dk053301; Thu, 18 Jul 2019 13:58:05 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201907181358.x6IDw5Dk053301@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 18 Jul 2019 13:58:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350112 - in head/sys/arm64: arm64 include X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in head/sys/arm64: arm64 include X-SVN-Commit-Revision: 350112 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 79B748A637 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jul 2019 13:58:05 -0000 Author: andrew Date: Thu Jul 18 13:58:04 2019 New Revision: 350112 URL: https://svnweb.freebsd.org/changeset/base/350112 Log: Rename arm64 macros in preperation for a script to generate them. I have a script to generate most of the ID_AA64* macros from the Arm XML source [1]. In preperation for using this we need to clean up the macros to be in line with what the script will generate. This is the first step, rename the macros to follow the names in said XML. [1] https://developer.arm.com/architectures/cpu-architecture/a-profile/exploration-tools MFC after: 1 week Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D20976 Modified: head/sys/arm64/arm64/identcpu.c head/sys/arm64/include/armreg.h Modified: head/sys/arm64/arm64/identcpu.c ============================================================================== --- head/sys/arm64/arm64/identcpu.c Thu Jul 18 11:46:37 2019 (r350111) +++ head/sys/arm64/arm64/identcpu.c Thu Jul 18 13:58:04 2019 (r350112) @@ -216,7 +216,7 @@ static struct mrs_field id_aa64isar0_fields[] = { MRS_FIELD(false, MRS_LOWER, ID_AA64ISAR0_SM3_SHIFT), MRS_FIELD(false, MRS_LOWER, ID_AA64ISAR0_SHA3_SHIFT), MRS_FIELD(false, MRS_LOWER, ID_AA64ISAR0_RDM_SHIFT), - MRS_FIELD(false, MRS_LOWER, ID_AA64ISAR0_ATOMIC_SHIFT), + MRS_FIELD(false, MRS_LOWER, ID_AA64ISAR0_Atomic_SHIFT), MRS_FIELD(false, MRS_LOWER, ID_AA64ISAR0_CRC32_SHIFT), MRS_FIELD(false, MRS_LOWER, ID_AA64ISAR0_SHA2_SHIFT), MRS_FIELD(false, MRS_LOWER, ID_AA64ISAR0_SHA1_SHIFT), @@ -240,7 +240,7 @@ static struct mrs_field id_aa64pfr0_fields[] = { MRS_FIELD(false, MRS_EXACT, ID_AA64PFR0_SVE_SHIFT), MRS_FIELD(false, MRS_EXACT, ID_AA64PFR0_RAS_SHIFT), MRS_FIELD(false, MRS_EXACT, ID_AA64PFR0_GIC_SHIFT), - MRS_FIELD(true, MRS_LOWER, ID_AA64PFR0_ADV_SIMD_SHIFT), + MRS_FIELD(true, MRS_LOWER, ID_AA64PFR0_AdvSIMD_SHIFT), MRS_FIELD(true, MRS_LOWER, ID_AA64PFR0_FP_SHIFT), MRS_FIELD(false, MRS_EXACT, ID_AA64PFR0_EL3_SHIFT), MRS_FIELD(false, MRS_EXACT, ID_AA64PFR0_EL2_SHIFT), @@ -250,13 +250,13 @@ static struct mrs_field id_aa64pfr0_fields[] = { }; static struct mrs_field id_aa64dfr0_fields[] = { - MRS_FIELD(false, MRS_EXACT, ID_AA64DFR0_PMS_VER_SHIFT), - MRS_FIELD(false, MRS_EXACT, ID_AA64DFR0_CTX_CMPS_SHIFT), - MRS_FIELD(false, MRS_EXACT, ID_AA64DFR0_WRPS_SHIFT), - MRS_FIELD(false, MRS_EXACT, ID_AA64DFR0_BRPS_SHIFT), - MRS_FIELD(false, MRS_EXACT, ID_AA64DFR0_PMU_VER_SHIFT), - MRS_FIELD(false, MRS_EXACT, ID_AA64DFR0_TRACE_VER_SHIFT), - MRS_FIELD(false, MRS_EXACT_VAL(0x6), ID_AA64DFR0_DEBUG_VER_SHIFT), + MRS_FIELD(false, MRS_EXACT, ID_AA64DFR0_PMSVer_SHIFT), + MRS_FIELD(false, MRS_EXACT, ID_AA64DFR0_CTX_CMPs_SHIFT), + MRS_FIELD(false, MRS_EXACT, ID_AA64DFR0_WRPs_SHIFT), + MRS_FIELD(false, MRS_EXACT, ID_AA64DFR0_BRPs_SHIFT), + MRS_FIELD(false, MRS_EXACT, ID_AA64DFR0_PMUVer_SHIFT), + MRS_FIELD(false, MRS_EXACT, ID_AA64DFR0_TraceVer_SHIFT), + MRS_FIELD(false, MRS_EXACT_VAL(0x6), ID_AA64DFR0_DebugVer_SHIFT), MRS_FIELD_END, }; @@ -420,9 +420,9 @@ identify_cpu_sysinit(void *dummy __unused) /* Create a user visible cpu description with safe values */ memset(&user_cpu_desc, 0, sizeof(user_cpu_desc)); /* Safe values for these registers */ - user_cpu_desc.id_aa64pfr0 = ID_AA64PFR0_ADV_SIMD_NONE | + user_cpu_desc.id_aa64pfr0 = ID_AA64PFR0_AdvSIMD_NONE | ID_AA64PFR0_FP_NONE | ID_AA64PFR0_EL1_64 | ID_AA64PFR0_EL0_64; - user_cpu_desc.id_aa64dfr0 = ID_AA64DFR0_DEBUG_VER_8; + user_cpu_desc.id_aa64dfr0 = ID_AA64DFR0_DebugVer_8; CPU_FOREACH(cpu) { @@ -552,10 +552,10 @@ print_cpu_features(u_int cpu) sbuf_printf(sb, "%sUnknown RDM", SEP_STR); } - switch (ID_AA64ISAR0_ATOMIC(cpu_desc[cpu].id_aa64isar0)) { - case ID_AA64ISAR0_ATOMIC_NONE: + switch (ID_AA64ISAR0_Atomic(cpu_desc[cpu].id_aa64isar0)) { + case ID_AA64ISAR0_Atomic_NONE: break; - case ID_AA64ISAR0_ATOMIC_IMPL: + case ID_AA64ISAR0_Atomic_IMPL: sbuf_printf(sb, "%sAtomic", SEP_STR); break; default: @@ -760,13 +760,13 @@ print_cpu_features(u_int cpu) break; } - switch (ID_AA64PFR0_ADV_SIMD(cpu_desc[cpu].id_aa64pfr0)) { - case ID_AA64PFR0_ADV_SIMD_NONE: + switch (ID_AA64PFR0_AdvSIMD(cpu_desc[cpu].id_aa64pfr0)) { + case ID_AA64PFR0_AdvSIMD_NONE: break; - case ID_AA64PFR0_ADV_SIMD_IMPL: + case ID_AA64PFR0_AdvSIMD_IMPL: sbuf_printf(sb, "%sAdvSIMD", SEP_STR); break; - case ID_AA64PFR0_ADV_SIMD_HP: + case ID_AA64PFR0_AdvSIMD_HP: sbuf_printf(sb, "%sAdvSIMD+HP", SEP_STR); break; default: @@ -861,10 +861,10 @@ print_cpu_features(u_int cpu) if (cpu == 0 || (cpu_print_regs & PRINT_ID_AA64_MMFR0) != 0) { printed = 0; sbuf_printf(sb, " Memory Model Features 0 = <"); - switch (ID_AA64MMFR0_TGRAN4(cpu_desc[cpu].id_aa64mmfr0)) { - case ID_AA64MMFR0_TGRAN4_NONE: + switch (ID_AA64MMFR0_TGran4(cpu_desc[cpu].id_aa64mmfr0)) { + case ID_AA64MMFR0_TGran4_NONE: break; - case ID_AA64MMFR0_TGRAN4_IMPL: + case ID_AA64MMFR0_TGran4_IMPL: sbuf_printf(sb, "%s4k Granule", SEP_STR); break; default: @@ -872,10 +872,10 @@ print_cpu_features(u_int cpu) break; } - switch (ID_AA64MMFR0_TGRAN64(cpu_desc[cpu].id_aa64mmfr0)) { - case ID_AA64MMFR0_TGRAN64_NONE: + switch (ID_AA64MMFR0_TGran64(cpu_desc[cpu].id_aa64mmfr0)) { + case ID_AA64MMFR0_TGran64_NONE: break; - case ID_AA64MMFR0_TGRAN64_IMPL: + case ID_AA64MMFR0_TGran64_IMPL: sbuf_printf(sb, "%s64k Granule", SEP_STR); break; default: @@ -883,10 +883,10 @@ print_cpu_features(u_int cpu) break; } - switch (ID_AA64MMFR0_TGRAN16(cpu_desc[cpu].id_aa64mmfr0)) { - case ID_AA64MMFR0_TGRAN16_NONE: + switch (ID_AA64MMFR0_TGran16(cpu_desc[cpu].id_aa64mmfr0)) { + case ID_AA64MMFR0_TGran16_NONE: break; - case ID_AA64MMFR0_TGRAN16_IMPL: + case ID_AA64MMFR0_TGran16_IMPL: sbuf_printf(sb, "%s16k Granule", SEP_STR); break; default: @@ -894,10 +894,10 @@ print_cpu_features(u_int cpu) break; } - switch (ID_AA64MMFR0_BIGEND_EL0(cpu_desc[cpu].id_aa64mmfr0)) { - case ID_AA64MMFR0_BIGEND_EL0_FIXED: + switch (ID_AA64MMFR0_BigEndEL0(cpu_desc[cpu].id_aa64mmfr0)) { + case ID_AA64MMFR0_BigEndEL0_FIXED: break; - case ID_AA64MMFR0_BIGEND_EL0_MIXED: + case ID_AA64MMFR0_BigEndEL0_MIXED: sbuf_printf(sb, "%sEL0 MixEndian", SEP_STR); break; default: @@ -905,10 +905,10 @@ print_cpu_features(u_int cpu) break; } - switch (ID_AA64MMFR0_S_NS_MEM(cpu_desc[cpu].id_aa64mmfr0)) { - case ID_AA64MMFR0_S_NS_MEM_NONE: + switch (ID_AA64MMFR0_SNSMem(cpu_desc[cpu].id_aa64mmfr0)) { + case ID_AA64MMFR0_SNSMem_NONE: break; - case ID_AA64MMFR0_S_NS_MEM_DISTINCT: + case ID_AA64MMFR0_SNSMem_DISTINCT: sbuf_printf(sb, "%sS/NS Mem", SEP_STR); break; default: @@ -916,10 +916,10 @@ print_cpu_features(u_int cpu) break; } - switch (ID_AA64MMFR0_BIGEND(cpu_desc[cpu].id_aa64mmfr0)) { - case ID_AA64MMFR0_BIGEND_FIXED: + switch (ID_AA64MMFR0_BigEnd(cpu_desc[cpu].id_aa64mmfr0)) { + case ID_AA64MMFR0_BigEnd_FIXED: break; - case ID_AA64MMFR0_BIGEND_MIXED: + case ID_AA64MMFR0_BigEnd_MIXED: sbuf_printf(sb, "%sMixedEndian", SEP_STR); break; default: @@ -927,11 +927,11 @@ print_cpu_features(u_int cpu) break; } - switch (ID_AA64MMFR0_ASID_BITS(cpu_desc[cpu].id_aa64mmfr0)) { - case ID_AA64MMFR0_ASID_BITS_8: + switch (ID_AA64MMFR0_ASIDBits(cpu_desc[cpu].id_aa64mmfr0)) { + case ID_AA64MMFR0_ASIDBits_8: sbuf_printf(sb, "%s8bit ASID", SEP_STR); break; - case ID_AA64MMFR0_ASID_BITS_16: + case ID_AA64MMFR0_ASIDBits_16: sbuf_printf(sb, "%s16bit ASID", SEP_STR); break; default: @@ -939,26 +939,26 @@ print_cpu_features(u_int cpu) break; } - switch (ID_AA64MMFR0_PA_RANGE(cpu_desc[cpu].id_aa64mmfr0)) { - case ID_AA64MMFR0_PA_RANGE_4G: + switch (ID_AA64MMFR0_PARange(cpu_desc[cpu].id_aa64mmfr0)) { + case ID_AA64MMFR0_PARange_4G: sbuf_printf(sb, "%s4GB PA", SEP_STR); break; - case ID_AA64MMFR0_PA_RANGE_64G: + case ID_AA64MMFR0_PARange_64G: sbuf_printf(sb, "%s64GB PA", SEP_STR); break; - case ID_AA64MMFR0_PA_RANGE_1T: + case ID_AA64MMFR0_PARange_1T: sbuf_printf(sb, "%s1TB PA", SEP_STR); break; - case ID_AA64MMFR0_PA_RANGE_4T: + case ID_AA64MMFR0_PARange_4T: sbuf_printf(sb, "%s4TB PA", SEP_STR); break; - case ID_AA64MMFR0_PA_RANGE_16T: + case ID_AA64MMFR0_PARange_16T: sbuf_printf(sb, "%s16TB PA", SEP_STR); break; - case ID_AA64MMFR0_PA_RANGE_256T: + case ID_AA64MMFR0_PARange_256T: sbuf_printf(sb, "%s256TB PA", SEP_STR); break; - case ID_AA64MMFR0_PA_RANGE_4P: + case ID_AA64MMFR0_PARange_4P: sbuf_printf(sb, "%s4PB PA", SEP_STR); break; default: @@ -990,10 +990,10 @@ print_cpu_features(u_int cpu) break; } - switch (ID_AA64MMFR1_SPEC_SEI(cpu_desc[cpu].id_aa64mmfr1)) { - case ID_AA64MMFR1_SPEC_SEI_NONE: + switch (ID_AA64MMFR1_SpecSEI(cpu_desc[cpu].id_aa64mmfr1)) { + case ID_AA64MMFR1_SpecSEI_NONE: break; - case ID_AA64MMFR1_SPEC_SEI_IMPL: + case ID_AA64MMFR1_SpecSEI_IMPL: sbuf_printf(sb, "%sSpecSEI", SEP_STR); break; default: @@ -1051,10 +1051,10 @@ print_cpu_features(u_int cpu) break; } - switch (ID_AA64MMFR1_VMIDBITS(cpu_desc[cpu].id_aa64mmfr1)) { - case ID_AA64MMFR1_VMIDBITS_8: + switch (ID_AA64MMFR1_VMIDBits(cpu_desc[cpu].id_aa64mmfr1)) { + case ID_AA64MMFR1_VMIDBits_8: break; - case ID_AA64MMFR1_VMIDBITS_16: + case ID_AA64MMFR1_VMIDBits_16: sbuf_printf(sb, "%s16 VMID bits", SEP_STR); break; default: @@ -1112,11 +1112,11 @@ print_cpu_features(u_int cpu) break; } - switch (ID_AA64MMFR2_VA_RANGE(cpu_desc[cpu].id_aa64mmfr2)) { - case ID_AA64MMFR2_VA_RANGE_48: + switch (ID_AA64MMFR2_VARange(cpu_desc[cpu].id_aa64mmfr2)) { + case ID_AA64MMFR2_VARange_48: sbuf_printf(sb, "%s48b VA", SEP_STR); break; - case ID_AA64MMFR2_VA_RANGE_52: + case ID_AA64MMFR2_VARange_52: sbuf_printf(sb, "%s52b VA", SEP_STR); break; default: @@ -1157,10 +1157,10 @@ print_cpu_features(u_int cpu) break; } - switch (ID_AA64MMFR2_CNP(cpu_desc[cpu].id_aa64mmfr2)) { - case ID_AA64MMFR2_CNP_NONE: + switch (ID_AA64MMFR2_CnP(cpu_desc[cpu].id_aa64mmfr2)) { + case ID_AA64MMFR2_CnP_NONE: break; - case ID_AA64MMFR2_CNP_IMPL: + case ID_AA64MMFR2_CnP_IMPL: sbuf_printf(sb, "%sCnP", SEP_STR); break; default: @@ -1180,10 +1180,10 @@ print_cpu_features(u_int cpu) if (cpu == 0 || (cpu_print_regs & PRINT_ID_AA64_DFR0) != 0) { printed = 0; sbuf_printf(sb, " Debug Features 0 = <"); - switch(ID_AA64DFR0_PMS_VER(cpu_desc[cpu].id_aa64dfr0)) { - case ID_AA64DFR0_PMS_VER_NONE: + switch(ID_AA64DFR0_PMSVer(cpu_desc[cpu].id_aa64dfr0)) { + case ID_AA64DFR0_PMSVer_NONE: break; - case ID_AA64DFR0_PMS_VER_V1: + case ID_AA64DFR0_PMSVer_V1: sbuf_printf(sb, "%sSPE v1", SEP_STR); break; default: @@ -1192,24 +1192,24 @@ print_cpu_features(u_int cpu) } sbuf_printf(sb, "%s%lu CTX Breakpoints", SEP_STR, - ID_AA64DFR0_CTX_CMPS(cpu_desc[cpu].id_aa64dfr0)); + ID_AA64DFR0_CTX_CMPs(cpu_desc[cpu].id_aa64dfr0)); sbuf_printf(sb, "%s%lu Watchpoints", SEP_STR, - ID_AA64DFR0_WRPS(cpu_desc[cpu].id_aa64dfr0)); + ID_AA64DFR0_WRPs(cpu_desc[cpu].id_aa64dfr0)); sbuf_printf(sb, "%s%lu Breakpoints", SEP_STR, - ID_AA64DFR0_BRPS(cpu_desc[cpu].id_aa64dfr0)); + ID_AA64DFR0_BRPs(cpu_desc[cpu].id_aa64dfr0)); - switch (ID_AA64DFR0_PMU_VER(cpu_desc[cpu].id_aa64dfr0)) { - case ID_AA64DFR0_PMU_VER_NONE: + switch (ID_AA64DFR0_PMUVer(cpu_desc[cpu].id_aa64dfr0)) { + case ID_AA64DFR0_PMUVer_NONE: break; - case ID_AA64DFR0_PMU_VER_3: + case ID_AA64DFR0_PMUVer_3: sbuf_printf(sb, "%sPMUv3", SEP_STR); break; - case ID_AA64DFR0_PMU_VER_3_1: + case ID_AA64DFR0_PMUVer_3_1: sbuf_printf(sb, "%sPMUv3+16 bit evtCount", SEP_STR); break; - case ID_AA64DFR0_PMU_VER_IMPL: + case ID_AA64DFR0_PMUVer_IMPL: sbuf_printf(sb, "%sImplementation defined PMU", SEP_STR); break; default: @@ -1217,10 +1217,10 @@ print_cpu_features(u_int cpu) break; } - switch (ID_AA64DFR0_TRACE_VER(cpu_desc[cpu].id_aa64dfr0)) { - case ID_AA64DFR0_TRACE_VER_NONE: + switch (ID_AA64DFR0_TraceVer(cpu_desc[cpu].id_aa64dfr0)) { + case ID_AA64DFR0_TraceVer_NONE: break; - case ID_AA64DFR0_TRACE_VER_IMPL: + case ID_AA64DFR0_TraceVer_IMPL: sbuf_printf(sb, "%sTrace", SEP_STR); break; default: @@ -1228,14 +1228,14 @@ print_cpu_features(u_int cpu) break; } - switch (ID_AA64DFR0_DEBUG_VER(cpu_desc[cpu].id_aa64dfr0)) { - case ID_AA64DFR0_DEBUG_VER_8: + switch (ID_AA64DFR0_DebugVer(cpu_desc[cpu].id_aa64dfr0)) { + case ID_AA64DFR0_DebugVer_8: sbuf_printf(sb, "%sDebug v8", SEP_STR); break; - case ID_AA64DFR0_DEBUG_VER_8_VHE: + case ID_AA64DFR0_DebugVer_8_VHE: sbuf_printf(sb, "%sDebug v8+VHE", SEP_STR); break; - case ID_AA64DFR0_DEBUG_VER_8_2: + case ID_AA64DFR0_DebugVer_8_2: sbuf_printf(sb, "%sDebug v8.2", SEP_STR); break; default: Modified: head/sys/arm64/include/armreg.h ============================================================================== --- head/sys/arm64/include/armreg.h Thu Jul 18 11:46:37 2019 (r350111) +++ head/sys/arm64/include/armreg.h Thu Jul 18 13:58:04 2019 (r350112) @@ -175,41 +175,41 @@ /* ID_AA64DFR0_EL1 */ #define ID_AA64DFR0_MASK 0x0000000ff0f0fffful -#define ID_AA64DFR0_DEBUG_VER_SHIFT 0 -#define ID_AA64DFR0_DEBUG_VER_MASK (0xf << ID_AA64DFR0_DEBUG_VER_SHIFT) -#define ID_AA64DFR0_DEBUG_VER(x) ((x) & ID_AA64DFR0_DEBUG_VER_MASK) -#define ID_AA64DFR0_DEBUG_VER_8 (0x6 << ID_AA64DFR0_DEBUG_VER_SHIFT) -#define ID_AA64DFR0_DEBUG_VER_8_VHE (0x7 << ID_AA64DFR0_DEBUG_VER_SHIFT) -#define ID_AA64DFR0_DEBUG_VER_8_2 (0x8 << ID_AA64DFR0_DEBUG_VER_SHIFT) -#define ID_AA64DFR0_TRACE_VER_SHIFT 4 -#define ID_AA64DFR0_TRACE_VER_MASK (0xf << ID_AA64DFR0_TRACE_VER_SHIFT) -#define ID_AA64DFR0_TRACE_VER(x) ((x) & ID_AA64DFR0_TRACE_VER_MASK) -#define ID_AA64DFR0_TRACE_VER_NONE (0x0 << ID_AA64DFR0_TRACE_VER_SHIFT) -#define ID_AA64DFR0_TRACE_VER_IMPL (0x1 << ID_AA64DFR0_TRACE_VER_SHIFT) -#define ID_AA64DFR0_PMU_VER_SHIFT 8 -#define ID_AA64DFR0_PMU_VER_MASK (0xf << ID_AA64DFR0_PMU_VER_SHIFT) -#define ID_AA64DFR0_PMU_VER(x) ((x) & ID_AA64DFR0_PMU_VER_MASK) -#define ID_AA64DFR0_PMU_VER_NONE (0x0 << ID_AA64DFR0_PMU_VER_SHIFT) -#define ID_AA64DFR0_PMU_VER_3 (0x1 << ID_AA64DFR0_PMU_VER_SHIFT) -#define ID_AA64DFR0_PMU_VER_3_1 (0x4 << ID_AA64DFR0_PMU_VER_SHIFT) -#define ID_AA64DFR0_PMU_VER_IMPL (0xf << ID_AA64DFR0_PMU_VER_SHIFT) -#define ID_AA64DFR0_BRPS_SHIFT 12 -#define ID_AA64DFR0_BRPS_MASK (0xf << ID_AA64DFR0_BRPS_SHIFT) -#define ID_AA64DFR0_BRPS(x) \ - ((((x) >> ID_AA64DFR0_BRPS_SHIFT) & 0xf) + 1) -#define ID_AA64DFR0_WRPS_SHIFT 20 -#define ID_AA64DFR0_WRPS_MASK (0xf << ID_AA64DFR0_WRPS_SHIFT) -#define ID_AA64DFR0_WRPS(x) \ - ((((x) >> ID_AA64DFR0_WRPS_SHIFT) & 0xf) + 1) -#define ID_AA64DFR0_CTX_CMPS_SHIFT 28 -#define ID_AA64DFR0_CTX_CMPS_MASK (0xf << ID_AA64DFR0_CTX_CMPS_SHIFT) -#define ID_AA64DFR0_CTX_CMPS(x) \ - ((((x) >> ID_AA64DFR0_CTX_CMPS_SHIFT) & 0xf) + 1) -#define ID_AA64DFR0_PMS_VER_SHIFT 32 -#define ID_AA64DFR0_PMS_VER_MASK (0xful << ID_AA64DFR0_PMS_VER_SHIFT) -#define ID_AA64DFR0_PMS_VER(x) ((x) & ID_AA64DFR0_PMS_VER_MASK) -#define ID_AA64DFR0_PMS_VER_NONE (0x0ul << ID_AA64DFR0_PMS_VER_SHIFT) -#define ID_AA64DFR0_PMS_VER_V1 (0x1ul << ID_AA64DFR0_PMS_VER_SHIFT) +#define ID_AA64DFR0_DebugVer_SHIFT 0 +#define ID_AA64DFR0_DebugVer_MASK (0xf << ID_AA64DFR0_DebugVer_SHIFT) +#define ID_AA64DFR0_DebugVer(x) ((x) & ID_AA64DFR0_DebugVer_MASK) +#define ID_AA64DFR0_DebugVer_8 (0x6 << ID_AA64DFR0_DebugVer_SHIFT) +#define ID_AA64DFR0_DebugVer_8_VHE (0x7 << ID_AA64DFR0_DebugVer_SHIFT) +#define ID_AA64DFR0_DebugVer_8_2 (0x8 << ID_AA64DFR0_DebugVer_SHIFT) +#define ID_AA64DFR0_TraceVer_SHIFT 4 +#define ID_AA64DFR0_TraceVer_MASK (0xf << ID_AA64DFR0_TraceVer_SHIFT) +#define ID_AA64DFR0_TraceVer(x) ((x) & ID_AA64DFR0_TraceVer_MASK) +#define ID_AA64DFR0_TraceVer_NONE (0x0 << ID_AA64DFR0_TraceVer_SHIFT) +#define ID_AA64DFR0_TraceVer_IMPL (0x1 << ID_AA64DFR0_TraceVer_SHIFT) +#define ID_AA64DFR0_PMUVer_SHIFT 8 +#define ID_AA64DFR0_PMUVer_MASK (0xf << ID_AA64DFR0_PMUVer_SHIFT) +#define ID_AA64DFR0_PMUVer(x) ((x) & ID_AA64DFR0_PMUVer_MASK) +#define ID_AA64DFR0_PMUVer_NONE (0x0 << ID_AA64DFR0_PMUVer_SHIFT) +#define ID_AA64DFR0_PMUVer_3 (0x1 << ID_AA64DFR0_PMUVer_SHIFT) +#define ID_AA64DFR0_PMUVer_3_1 (0x4 << ID_AA64DFR0_PMUVer_SHIFT) +#define ID_AA64DFR0_PMUVer_IMPL (0xf << ID_AA64DFR0_PMUVer_SHIFT) +#define ID_AA64DFR0_BRPs_SHIFT 12 +#define ID_AA64DFR0_BRPs_MASK (0xf << ID_AA64DFR0_BRPs_SHIFT) +#define ID_AA64DFR0_BRPs(x) \ + ((((x) >> ID_AA64DFR0_BRPs_SHIFT) & 0xf) + 1) +#define ID_AA64DFR0_WRPs_SHIFT 20 +#define ID_AA64DFR0_WRPs_MASK (0xf << ID_AA64DFR0_WRPs_SHIFT) +#define ID_AA64DFR0_WRPs(x) \ + ((((x) >> ID_AA64DFR0_WRPs_SHIFT) & 0xf) + 1) +#define ID_AA64DFR0_CTX_CMPs_SHIFT 28 +#define ID_AA64DFR0_CTX_CMPs_MASK (0xf << ID_AA64DFR0_CTX_CMPs_SHIFT) +#define ID_AA64DFR0_CTX_CMPs(x) \ + ((((x) >> ID_AA64DFR0_CTX_CMPs_SHIFT) & 0xf) + 1) +#define ID_AA64DFR0_PMSVer_SHIFT 32 +#define ID_AA64DFR0_PMSVer_MASK (0xful << ID_AA64DFR0_PMSVer_SHIFT) +#define ID_AA64DFR0_PMSVer(x) ((x) & ID_AA64DFR0_PMSVer_MASK) +#define ID_AA64DFR0_PMSVer_NONE (0x0ul << ID_AA64DFR0_PMSVer_SHIFT) +#define ID_AA64DFR0_PMSVer_V1 (0x1ul << ID_AA64DFR0_PMSVer_SHIFT) /* ID_AA64ISAR0_EL1 */ #define ID_AA64ISAR0_MASK 0x0000fffff0fffff0ul @@ -235,11 +235,11 @@ #define ID_AA64ISAR0_CRC32(x) ((x) & ID_AA64ISAR0_CRC32_MASK) #define ID_AA64ISAR0_CRC32_NONE (0x0 << ID_AA64ISAR0_CRC32_SHIFT) #define ID_AA64ISAR0_CRC32_BASE (0x1 << ID_AA64ISAR0_CRC32_SHIFT) -#define ID_AA64ISAR0_ATOMIC_SHIFT 20 -#define ID_AA64ISAR0_ATOMIC_MASK (0xf << ID_AA64ISAR0_ATOMIC_SHIFT) -#define ID_AA64ISAR0_ATOMIC(x) ((x) & ID_AA64ISAR0_ATOMIC_MASK) -#define ID_AA64ISAR0_ATOMIC_NONE (0x0 << ID_AA64ISAR0_ATOMIC_SHIFT) -#define ID_AA64ISAR0_ATOMIC_IMPL (0x2 << ID_AA64ISAR0_ATOMIC_SHIFT) +#define ID_AA64ISAR0_Atomic_SHIFT 20 +#define ID_AA64ISAR0_Atomic_MASK (0xf << ID_AA64ISAR0_Atomic_SHIFT) +#define ID_AA64ISAR0_Atomic(x) ((x) & ID_AA64ISAR0_Atomic_MASK) +#define ID_AA64ISAR0_Atomic_NONE (0x0 << ID_AA64ISAR0_Atomic_SHIFT) +#define ID_AA64ISAR0_Atomic_IMPL (0x2 << ID_AA64ISAR0_Atomic_SHIFT) #define ID_AA64ISAR0_RDM_SHIFT 28 #define ID_AA64ISAR0_RDM_MASK (0xf << ID_AA64ISAR0_RDM_SHIFT) #define ID_AA64ISAR0_RDM(x) ((x) & ID_AA64ISAR0_RDM_MASK) @@ -311,51 +311,51 @@ /* ID_AA64MMFR0_EL1 */ #define ID_AA64MMFR0_MASK 0xffffffff -#define ID_AA64MMFR0_PA_RANGE_SHIFT 0 -#define ID_AA64MMFR0_PA_RANGE_MASK (0xf << ID_AA64MMFR0_PA_RANGE_SHIFT) -#define ID_AA64MMFR0_PA_RANGE(x) ((x) & ID_AA64MMFR0_PA_RANGE_MASK) -#define ID_AA64MMFR0_PA_RANGE_4G (0x0 << ID_AA64MMFR0_PA_RANGE_SHIFT) -#define ID_AA64MMFR0_PA_RANGE_64G (0x1 << ID_AA64MMFR0_PA_RANGE_SHIFT) -#define ID_AA64MMFR0_PA_RANGE_1T (0x2 << ID_AA64MMFR0_PA_RANGE_SHIFT) -#define ID_AA64MMFR0_PA_RANGE_4T (0x3 << ID_AA64MMFR0_PA_RANGE_SHIFT) -#define ID_AA64MMFR0_PA_RANGE_16T (0x4 << ID_AA64MMFR0_PA_RANGE_SHIFT) -#define ID_AA64MMFR0_PA_RANGE_256T (0x5 << ID_AA64MMFR0_PA_RANGE_SHIFT) -#define ID_AA64MMFR0_PA_RANGE_4P (0x6 << ID_AA64MMFR0_PA_RANGE_SHIFT) -#define ID_AA64MMFR0_ASID_BITS_SHIFT 4 -#define ID_AA64MMFR0_ASID_BITS_MASK (0xf << ID_AA64MMFR0_ASID_BITS_SHIFT) -#define ID_AA64MMFR0_ASID_BITS(x) ((x) & ID_AA64MMFR0_ASID_BITS_MASK) -#define ID_AA64MMFR0_ASID_BITS_8 (0x0 << ID_AA64MMFR0_ASID_BITS_SHIFT) -#define ID_AA64MMFR0_ASID_BITS_16 (0x2 << ID_AA64MMFR0_ASID_BITS_SHIFT) -#define ID_AA64MMFR0_BIGEND_SHIFT 8 -#define ID_AA64MMFR0_BIGEND_MASK (0xf << ID_AA64MMFR0_BIGEND_SHIFT) -#define ID_AA64MMFR0_BIGEND(x) ((x) & ID_AA64MMFR0_BIGEND_MASK) -#define ID_AA64MMFR0_BIGEND_FIXED (0x0 << ID_AA64MMFR0_BIGEND_SHIFT) -#define ID_AA64MMFR0_BIGEND_MIXED (0x1 << ID_AA64MMFR0_BIGEND_SHIFT) -#define ID_AA64MMFR0_S_NS_MEM_SHIFT 12 -#define ID_AA64MMFR0_S_NS_MEM_MASK (0xf << ID_AA64MMFR0_S_NS_MEM_SHIFT) -#define ID_AA64MMFR0_S_NS_MEM(x) ((x) & ID_AA64MMFR0_S_NS_MEM_MASK) -#define ID_AA64MMFR0_S_NS_MEM_NONE (0x0 << ID_AA64MMFR0_S_NS_MEM_SHIFT) -#define ID_AA64MMFR0_S_NS_MEM_DISTINCT (0x1 << ID_AA64MMFR0_S_NS_MEM_SHIFT) -#define ID_AA64MMFR0_BIGEND_EL0_SHIFT 16 -#define ID_AA64MMFR0_BIGEND_EL0_MASK (0xf << ID_AA64MMFR0_BIGEND_EL0_SHIFT) -#define ID_AA64MMFR0_BIGEND_EL0(x) ((x) & ID_AA64MMFR0_BIGEND_EL0_MASK) -#define ID_AA64MMFR0_BIGEND_EL0_FIXED (0x0 << ID_AA64MMFR0_BIGEND_EL0_SHIFT) -#define ID_AA64MMFR0_BIGEND_EL0_MIXED (0x1 << ID_AA64MMFR0_BIGEND_EL0_SHIFT) -#define ID_AA64MMFR0_TGRAN16_SHIFT 20 -#define ID_AA64MMFR0_TGRAN16_MASK (0xf << ID_AA64MMFR0_TGRAN16_SHIFT) -#define ID_AA64MMFR0_TGRAN16(x) ((x) & ID_AA64MMFR0_TGRAN16_MASK) -#define ID_AA64MMFR0_TGRAN16_NONE (0x0 << ID_AA64MMFR0_TGRAN16_SHIFT) -#define ID_AA64MMFR0_TGRAN16_IMPL (0x1 << ID_AA64MMFR0_TGRAN16_SHIFT) -#define ID_AA64MMFR0_TGRAN64_SHIFT 24 -#define ID_AA64MMFR0_TGRAN64_MASK (0xf << ID_AA64MMFR0_TGRAN64_SHIFT) -#define ID_AA64MMFR0_TGRAN64(x) ((x) & ID_AA64MMFR0_TGRAN64_MASK) -#define ID_AA64MMFR0_TGRAN64_IMPL (0x0 << ID_AA64MMFR0_TGRAN64_SHIFT) -#define ID_AA64MMFR0_TGRAN64_NONE (0xf << ID_AA64MMFR0_TGRAN64_SHIFT) -#define ID_AA64MMFR0_TGRAN4_SHIFT 28 -#define ID_AA64MMFR0_TGRAN4_MASK (0xf << ID_AA64MMFR0_TGRAN4_SHIFT) -#define ID_AA64MMFR0_TGRAN4(x) ((x) & ID_AA64MMFR0_TGRAN4_MASK) -#define ID_AA64MMFR0_TGRAN4_IMPL (0x0 << ID_AA64MMFR0_TGRAN4_SHIFT) -#define ID_AA64MMFR0_TGRAN4_NONE (0xf << ID_AA64MMFR0_TGRAN4_SHIFT) +#define ID_AA64MMFR0_PARange_SHIFT 0 +#define ID_AA64MMFR0_PARange_MASK (0xf << ID_AA64MMFR0_PARange_SHIFT) +#define ID_AA64MMFR0_PARange(x) ((x) & ID_AA64MMFR0_PARange_MASK) +#define ID_AA64MMFR0_PARange_4G (0x0 << ID_AA64MMFR0_PARange_SHIFT) +#define ID_AA64MMFR0_PARange_64G (0x1 << ID_AA64MMFR0_PARange_SHIFT) +#define ID_AA64MMFR0_PARange_1T (0x2 << ID_AA64MMFR0_PARange_SHIFT) +#define ID_AA64MMFR0_PARange_4T (0x3 << ID_AA64MMFR0_PARange_SHIFT) +#define ID_AA64MMFR0_PARange_16T (0x4 << ID_AA64MMFR0_PARange_SHIFT) +#define ID_AA64MMFR0_PARange_256T (0x5 << ID_AA64MMFR0_PARange_SHIFT) +#define ID_AA64MMFR0_PARange_4P (0x6 << ID_AA64MMFR0_PARange_SHIFT) +#define ID_AA64MMFR0_ASIDBits_SHIFT 4 +#define ID_AA64MMFR0_ASIDBits_MASK (0xf << ID_AA64MMFR0_ASIDBits_SHIFT) +#define ID_AA64MMFR0_ASIDBits(x) ((x) & ID_AA64MMFR0_ASIDBits_MASK) +#define ID_AA64MMFR0_ASIDBits_8 (0x0 << ID_AA64MMFR0_ASIDBits_SHIFT) +#define ID_AA64MMFR0_ASIDBits_16 (0x2 << ID_AA64MMFR0_ASIDBits_SHIFT) +#define ID_AA64MMFR0_BigEnd_SHIFT 8 +#define ID_AA64MMFR0_BigEnd_MASK (0xf << ID_AA64MMFR0_BigEnd_SHIFT) +#define ID_AA64MMFR0_BigEnd(x) ((x) & ID_AA64MMFR0_BigEnd_MASK) +#define ID_AA64MMFR0_BigEnd_FIXED (0x0 << ID_AA64MMFR0_BigEnd_SHIFT) +#define ID_AA64MMFR0_BigEnd_MIXED (0x1 << ID_AA64MMFR0_BigEnd_SHIFT) +#define ID_AA64MMFR0_SNSMem_SHIFT 12 +#define ID_AA64MMFR0_SNSMem_MASK (0xf << ID_AA64MMFR0_SNSMem_SHIFT) +#define ID_AA64MMFR0_SNSMem(x) ((x) & ID_AA64MMFR0_SNSMem_MASK) +#define ID_AA64MMFR0_SNSMem_NONE (0x0 << ID_AA64MMFR0_SNSMem_SHIFT) +#define ID_AA64MMFR0_SNSMem_DISTINCT (0x1 << ID_AA64MMFR0_SNSMem_SHIFT) +#define ID_AA64MMFR0_BigEndEL0_SHIFT 16 +#define ID_AA64MMFR0_BigEndEL0_MASK (0xf << ID_AA64MMFR0_BigEndEL0_SHIFT) +#define ID_AA64MMFR0_BigEndEL0(x) ((x) & ID_AA64MMFR0_BigEndEL0_MASK) +#define ID_AA64MMFR0_BigEndEL0_FIXED (0x0 << ID_AA64MMFR0_BigEndEL0_SHIFT) +#define ID_AA64MMFR0_BigEndEL0_MIXED (0x1 << ID_AA64MMFR0_BigEndEL0_SHIFT) +#define ID_AA64MMFR0_TGran16_SHIFT 20 +#define ID_AA64MMFR0_TGran16_MASK (0xf << ID_AA64MMFR0_TGran16_SHIFT) +#define ID_AA64MMFR0_TGran16(x) ((x) & ID_AA64MMFR0_TGran16_MASK) +#define ID_AA64MMFR0_TGran16_NONE (0x0 << ID_AA64MMFR0_TGran16_SHIFT) +#define ID_AA64MMFR0_TGran16_IMPL (0x1 << ID_AA64MMFR0_TGran16_SHIFT) +#define ID_AA64MMFR0_TGran64_SHIFT 24 +#define ID_AA64MMFR0_TGran64_MASK (0xf << ID_AA64MMFR0_TGran64_SHIFT) +#define ID_AA64MMFR0_TGran64(x) ((x) & ID_AA64MMFR0_TGran64_MASK) +#define ID_AA64MMFR0_TGran64_IMPL (0x0 << ID_AA64MMFR0_TGran64_SHIFT) +#define ID_AA64MMFR0_TGran64_NONE (0xf << ID_AA64MMFR0_TGran64_SHIFT) +#define ID_AA64MMFR0_TGran4_SHIFT 28 +#define ID_AA64MMFR0_TGran4_MASK (0xf << ID_AA64MMFR0_TGran4_SHIFT) +#define ID_AA64MMFR0_TGran4(x) ((x) & ID_AA64MMFR0_TGran4_MASK) +#define ID_AA64MMFR0_TGran4_IMPL (0x0 << ID_AA64MMFR0_TGran4_SHIFT) +#define ID_AA64MMFR0_TGran4_NONE (0xf << ID_AA64MMFR0_TGran4_SHIFT) /* ID_AA64MMFR1_EL1 */ #define ID_AA64MMFR1_MASK 0xffffffff @@ -365,11 +365,11 @@ #define ID_AA64MMFR1_HAFDBS_NONE (0x0 << ID_AA64MMFR1_HAFDBS_SHIFT) #define ID_AA64MMFR1_HAFDBS_AF (0x1 << ID_AA64MMFR1_HAFDBS_SHIFT) #define ID_AA64MMFR1_HAFDBS_AF_DBS (0x2 << ID_AA64MMFR1_HAFDBS_SHIFT) -#define ID_AA64MMFR1_VMIDBITS_SHIFT 4 -#define ID_AA64MMFR1_VMIDBITS_MASK (0xf << ID_AA64MMFR1_VMIDBITS_SHIFT) -#define ID_AA64MMFR1_VMIDBITS(x) ((x) & ID_AA64MMFR1_VMIDBITS_MASK) -#define ID_AA64MMFR1_VMIDBITS_8 (0x0 << ID_AA64MMFR1_VMIDBITS_SHIFT) -#define ID_AA64MMFR1_VMIDBITS_16 (0x2 << ID_AA64MMFR1_VMIDBITS_SHIFT) +#define ID_AA64MMFR1_VMIDBits_SHIFT 4 +#define ID_AA64MMFR1_VMIDBits_MASK (0xf << ID_AA64MMFR1_VMIDBits_SHIFT) +#define ID_AA64MMFR1_VMIDBits(x) ((x) & ID_AA64MMFR1_VMIDBits_MASK) +#define ID_AA64MMFR1_VMIDBits_8 (0x0 << ID_AA64MMFR1_VMIDBits_SHIFT) +#define ID_AA64MMFR1_VMIDBits_16 (0x2 << ID_AA64MMFR1_VMIDBits_SHIFT) #define ID_AA64MMFR1_VH_SHIFT 8 #define ID_AA64MMFR1_VH_MASK (0xf << ID_AA64MMFR1_VH_SHIFT) #define ID_AA64MMFR1_VH(x) ((x) & ID_AA64MMFR1_VH_MASK) @@ -392,11 +392,11 @@ #define ID_AA64MMFR1_PAN_NONE (0x0 << ID_AA64MMFR1_PAN_SHIFT) #define ID_AA64MMFR1_PAN_IMPL (0x1 << ID_AA64MMFR1_PAN_SHIFT) #define ID_AA64MMFR1_PAN_ATS1E1 (0x2 << ID_AA64MMFR1_PAN_SHIFT) -#define ID_AA64MMFR1_SPEC_SEI_SHIFT 24 -#define ID_AA64MMFR1_SPEC_SEI_MASK (0xf << ID_AA64MMFR1_SPEC_SEI_SHIFT) -#define ID_AA64MMFR1_SPEC_SEI(x) ((x) & ID_AA64MMFR1_SPEC_SEI_MASK) -#define ID_AA64MMFR1_SPEC_SEI_NONE (0x0 << ID_AA64MMFR1_SPEC_SEI_SHIFT) -#define ID_AA64MMFR1_SPEC_SEI_IMPL (0x1 << ID_AA64MMFR1_SPEC_SEI_SHIFT) +#define ID_AA64MMFR1_SpecSEI_SHIFT 24 +#define ID_AA64MMFR1_SpecSEI_MASK (0xf << ID_AA64MMFR1_SpecSEI_SHIFT) +#define ID_AA64MMFR1_SpecSEI(x) ((x) & ID_AA64MMFR1_SpecSEI_MASK) +#define ID_AA64MMFR1_SpecSEI_NONE (0x0 << ID_AA64MMFR1_SpecSEI_SHIFT) +#define ID_AA64MMFR1_SpecSEI_IMPL (0x1 << ID_AA64MMFR1_SpecSEI_SHIFT) #define ID_AA64MMFR1_XNX_SHIFT 28 #define ID_AA64MMFR1_XNX_MASK (0xf << ID_AA64MMFR1_XNX_SHIFT) #define ID_AA64MMFR1_XNX(x) ((x) & ID_AA64MMFR1_XNX_MASK) @@ -406,11 +406,11 @@ /* ID_AA64MMFR2_EL1 */ #define ID_AA64MMFR2_EL1 S3_0_C0_C7_2 #define ID_AA64MMFR2_MASK 0x0fffffff -#define ID_AA64MMFR2_CNP_SHIFT 0 -#define ID_AA64MMFR2_CNP_MASK (0xf << ID_AA64MMFR2_CNP_SHIFT) -#define ID_AA64MMFR2_CNP(x) ((x) & ID_AA64MMFR2_CNP_MASK) -#define ID_AA64MMFR2_CNP_NONE (0x0 << ID_AA64MMFR2_CNP_SHIFT) -#define ID_AA64MMFR2_CNP_IMPL (0x1 << ID_AA64MMFR2_CNP_SHIFT) +#define ID_AA64MMFR2_CnP_SHIFT 0 +#define ID_AA64MMFR2_CnP_MASK (0xf << ID_AA64MMFR2_CnP_SHIFT) +#define ID_AA64MMFR2_CnP(x) ((x) & ID_AA64MMFR2_CnP_MASK) +#define ID_AA64MMFR2_CnP_NONE (0x0 << ID_AA64MMFR2_CnP_SHIFT) +#define ID_AA64MMFR2_CnP_IMPL (0x1 << ID_AA64MMFR2_CnP_SHIFT) #define ID_AA64MMFR2_UAO_SHIFT 4 #define ID_AA64MMFR2_UAO_MASK (0xf << ID_AA64MMFR2_UAO_SHIFT) #define ID_AA64MMFR2_UAO(x) ((x) & ID_AA64MMFR2_UAO_MASK) @@ -426,11 +426,11 @@ #define ID_AA64MMFR2_IESB(x) ((x) & ID_AA64MMFR2_IESB_MASK) #define ID_AA64MMFR2_IESB_NONE (0x0 << ID_AA64MMFR2_IESB_SHIFT) #define ID_AA64MMFR2_IESB_IMPL (0x1 << ID_AA64MMFR2_IESB_SHIFT) -#define ID_AA64MMFR2_VA_RANGE_SHIFT 16 -#define ID_AA64MMFR2_VA_RANGE_MASK (0xf << ID_AA64MMFR2_VA_RANGE_SHIFT) -#define ID_AA64MMFR2_VA_RANGE(x) ((x) & ID_AA64MMFR2_VA_RANGE_MASK) -#define ID_AA64MMFR2_VA_RANGE_48 (0x0 << ID_AA64MMFR2_VA_RANGE_SHIFT) -#define ID_AA64MMFR2_VA_RANGE_52 (0x1 << ID_AA64MMFR2_VA_RANGE_SHIFT) +#define ID_AA64MMFR2_VARange_SHIFT 16 +#define ID_AA64MMFR2_VARange_MASK (0xf << ID_AA64MMFR2_VARange_SHIFT) +#define ID_AA64MMFR2_VARange(x) ((x) & ID_AA64MMFR2_VARange_MASK) +#define ID_AA64MMFR2_VARange_48 (0x0 << ID_AA64MMFR2_VARange_SHIFT) +#define ID_AA64MMFR2_VARange_52 (0x1 << ID_AA64MMFR2_VARange_SHIFT) #define ID_AA64MMFR2_CCIDX_SHIFT 20 #define ID_AA64MMFR2_CCIDX_MASK (0xf << ID_AA64MMFR2_CCIDX_SHIFT) #define ID_AA64MMFR2_CCIDX(x) ((x) & ID_AA64MMFR2_CCIDX_MASK) @@ -472,12 +472,12 @@ #define ID_AA64PFR0_FP_IMPL (0x0 << ID_AA64PFR0_FP_SHIFT) #define ID_AA64PFR0_FP_HP (0x1 << ID_AA64PFR0_FP_SHIFT) #define ID_AA64PFR0_FP_NONE (0xf << ID_AA64PFR0_FP_SHIFT) -#define ID_AA64PFR0_ADV_SIMD_SHIFT 20 -#define ID_AA64PFR0_ADV_SIMD_MASK (0xf << ID_AA64PFR0_ADV_SIMD_SHIFT) -#define ID_AA64PFR0_ADV_SIMD(x) ((x) & ID_AA64PFR0_ADV_SIMD_MASK) -#define ID_AA64PFR0_ADV_SIMD_IMPL (0x0 << ID_AA64PFR0_ADV_SIMD_SHIFT) -#define ID_AA64PFR0_ADV_SIMD_HP (0x1 << ID_AA64PFR0_ADV_SIMD_SHIFT) -#define ID_AA64PFR0_ADV_SIMD_NONE (0xf << ID_AA64PFR0_ADV_SIMD_SHIFT) +#define ID_AA64PFR0_AdvSIMD_SHIFT 20 +#define ID_AA64PFR0_AdvSIMD_MASK (0xf << ID_AA64PFR0_AdvSIMD_SHIFT) +#define ID_AA64PFR0_AdvSIMD(x) ((x) & ID_AA64PFR0_AdvSIMD_MASK) +#define ID_AA64PFR0_AdvSIMD_IMPL (0x0 << ID_AA64PFR0_AdvSIMD_SHIFT) +#define ID_AA64PFR0_AdvSIMD_HP (0x1 << ID_AA64PFR0_AdvSIMD_SHIFT) +#define ID_AA64PFR0_AdvSIMD_NONE (0xf << ID_AA64PFR0_AdvSIMD_SHIFT) #define ID_AA64PFR0_GIC_BITS 0x4 /* Number of bits in GIC field */ #define ID_AA64PFR0_GIC_SHIFT 24 #define ID_AA64PFR0_GIC_MASK (0xf << ID_AA64PFR0_GIC_SHIFT) From owner-svn-src-all@freebsd.org Thu Jul 18 15:41:11 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DC49BAB1C7; Thu, 18 Jul 2019 15:41:11 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BB3588D549; Thu, 18 Jul 2019 15:41:11 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8CEBD9EAE; Thu, 18 Jul 2019 15:41:11 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6IFfBjt016390; Thu, 18 Jul 2019 15:41:11 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6IFfBUA016388; Thu, 18 Jul 2019 15:41:11 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201907181541.x6IFfBUA016388@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 18 Jul 2019 15:41:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350114 - head/sys/dev/nvme X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/nvme X-SVN-Commit-Revision: 350114 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BB3588D549 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jul 2019 15:41:11 -0000 Author: imp Date: Thu Jul 18 15:41:10 2019 New Revision: 350114 URL: https://svnweb.freebsd.org/changeset/base/350114 Log: Provide macros to extract the sub-fields of the CAP_LO and CAP_HI registers. These macros make places where we extract these easier to read. The shift and mask stuff is also a bit tedious and error prone. Start with the CAP_LO and CAP_HI registers since their scope is somewhat constrained. This is style chagne only, no functional changes. Reviewed by: chuck Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D20979 Modified: head/sys/dev/nvme/nvme.h head/sys/dev/nvme/nvme_ctrlr.c Modified: head/sys/dev/nvme/nvme.h ============================================================================== --- head/sys/dev/nvme/nvme.h Thu Jul 18 15:30:00 2019 (r350113) +++ head/sys/dev/nvme/nvme.h Thu Jul 18 15:41:10 2019 (r350114) @@ -69,6 +69,14 @@ #define NVME_CAP_LO_REG_AMS_MASK (0x3) #define NVME_CAP_LO_REG_TO_SHIFT (24) #define NVME_CAP_LO_REG_TO_MASK (0xFF) +#define NVME_CAP_LO_MQES(x) \ + (((x) >> NVME_CAP_LO_REG_MQES_SHIFT) & NVME_CAP_LO_REG_MQES_MASK) +#define NVME_CAP_LO_CQR(x) \ + (((x) >> NVME_CAP_LO_REG_CQR_SHIFT) & NVME_CAP_LO_REG_CQR_MASK) +#define NVME_CAP_LO_AMS(x) \ + (((x) >> NVME_CAP_LO_REG_AMS_SHIFT) & NVME_CAP_LO_REG_AMS_MASK) +#define NVME_CAP_LO_TO(x) \ + (((x) >> NVME_CAP_LO_REG_TO_SHIFT) & NVME_CAP_LO_REG_TO_MASK) #define NVME_CAP_HI_REG_DSTRD_SHIFT (0) #define NVME_CAP_HI_REG_DSTRD_MASK (0xF) @@ -78,6 +86,14 @@ #define NVME_CAP_HI_REG_MPSMIN_MASK (0xF) #define NVME_CAP_HI_REG_MPSMAX_SHIFT (20) #define NVME_CAP_HI_REG_MPSMAX_MASK (0xF) +#define NVME_CAP_HI_DSTRD(x) \ + (((x) >> NVME_CAP_HI_REG_DSTRD_SHIFT) & NVME_CAP_HI_REG_DSTRD_MASK) +#define NVME_CAP_HI_CSS_NVM(x) \ + (((x) >> NVME_CAP_HI_REG_CSS_NVM_SHIFT) & NVME_CAP_HI_REG_CSS_NVM_MASK) +#define NVME_CAP_HI_MPSMIN(x) \ + (((x) >> NVME_CAP_HI_REG_MPSMIN_SHIFT) & NVME_CAP_HI_REG_MPSMIN_MASK) +#define NVME_CAP_HI_MPSMAX(x) \ + (((x) >> NVME_CAP_HI_REG_MPSMAX_SHIFT) & NVME_CAP_HI_REG_MPSMAX_MASK) #define NVME_CC_REG_EN_SHIFT (0) #define NVME_CC_REG_EN_MASK (0x1) Modified: head/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- head/sys/dev/nvme/nvme_ctrlr.c Thu Jul 18 15:30:00 2019 (r350113) +++ head/sys/dev/nvme/nvme_ctrlr.c Thu Jul 18 15:41:10 2019 (r350114) @@ -137,7 +137,7 @@ nvme_ctrlr_construct_io_qpairs(struct nvme_controller * the MQES field in the capabilities register. */ cap_lo = nvme_mmio_read_4(ctrlr, cap_lo); - mqes = (cap_lo >> NVME_CAP_LO_REG_MQES_SHIFT) & NVME_CAP_LO_REG_MQES_MASK; + mqes = NVME_CAP_LO_MQES(cap_lo); num_entries = min(num_entries, mqes + 1); num_trackers = NVME_IO_TRACKERS; @@ -1246,16 +1246,16 @@ nvme_ctrlr_construct(struct nvme_controller *ctrlr, de * other than zero, but this driver is not set up to handle that. */ cap_hi = nvme_mmio_read_4(ctrlr, cap_hi); - dstrd = (cap_hi >> NVME_CAP_HI_REG_DSTRD_SHIFT) & NVME_CAP_HI_REG_DSTRD_MASK; + dstrd = NVME_CAP_HI_DSTRD(cap_hi); if (dstrd != 0) return (ENXIO); - mpsmin = (cap_hi >> NVME_CAP_HI_REG_MPSMIN_SHIFT) & NVME_CAP_HI_REG_MPSMIN_MASK; + mpsmin = NVME_CAP_HI_MPSMIN(cap_hi); ctrlr->min_page_size = 1 << (12 + mpsmin); /* Get ready timeout value from controller, in units of 500ms. */ cap_lo = nvme_mmio_read_4(ctrlr, cap_lo); - to = ((cap_lo >> NVME_CAP_LO_REG_TO_SHIFT) & NVME_CAP_LO_REG_TO_MASK) + 1; + to = NVME_CAP_LO_TO(cap_lo) + 1; ctrlr->ready_timeout_in_ms = to * 500; timeout_period = NVME_DEFAULT_TIMEOUT_PERIOD; From owner-svn-src-all@freebsd.org Thu Jul 18 21:33:56 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B6A52B1F8D; Thu, 18 Jul 2019 21:33:56 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9550472817; Thu, 18 Jul 2019 21:33:56 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 61AA6E46D; Thu, 18 Jul 2019 21:33:56 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6ILXub2026794; Thu, 18 Jul 2019 21:33:56 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6ILXu4k026793; Thu, 18 Jul 2019 21:33:56 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201907182133.x6ILXu4k026793@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 18 Jul 2019 21:33:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350116 - head/lib/libc/gen X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/lib/libc/gen X-SVN-Commit-Revision: 350116 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9550472817 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.94)[-0.942,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jul 2019 21:33:56 -0000 Author: brooks Date: Thu Jul 18 21:33:55 2019 New Revision: 350116 URL: https://svnweb.freebsd.org/changeset/base/350116 Log: Document that setmode(3) is not thread safe. In some circumstances, setmode(3) may call umask(2) twice to retrieve the current mode and then restore it. Between calls, the process will have a umask of 0. Reviewed by: markj Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D20982 Modified: head/lib/libc/gen/setmode.3 Modified: head/lib/libc/gen/setmode.3 ============================================================================== --- head/lib/libc/gen/setmode.3 Thu Jul 18 17:55:13 2019 (r350115) +++ head/lib/libc/gen/setmode.3 Thu Jul 18 21:33:55 2019 (r350116) @@ -28,7 +28,7 @@ .\" @(#)setmode.3 8.2 (Berkeley) 4/28/95 .\" $FreeBSD$ .\" -.Dd February 22, 2015 +.Dd July 18, 2019 .Dt SETMODE 3 .Os .Sh NAME @@ -125,3 +125,10 @@ and .Fn setmode functions first appeared in .Bx 4.4 . +.Sh BUGS +The +.Fn setmode +function is not thread safe. +Files created in other threads while +.Fn setmode +is being called may be created with a umask of 0. From owner-svn-src-all@freebsd.org Thu Jul 18 21:37:51 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2111CB2172; Thu, 18 Jul 2019 21:37:51 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0282872B87; Thu, 18 Jul 2019 21:37:51 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E3375E4D4; Thu, 18 Jul 2019 21:37:50 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6ILbo3J027025; Thu, 18 Jul 2019 21:37:50 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6ILbo2H027024; Thu, 18 Jul 2019 21:37:50 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201907182137.x6ILbo2H027024@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 18 Jul 2019 21:37:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350117 - head/lib/libc/tests/gen X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/lib/libc/tests/gen X-SVN-Commit-Revision: 350117 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0282872B87 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.94)[-0.942,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jul 2019 21:37:51 -0000 Author: brooks Date: Thu Jul 18 21:37:50 2019 New Revision: 350117 URL: https://svnweb.freebsd.org/changeset/base/350117 Log: Include a mode when creating files with openat(). Reviewed by: asomers Obtained from: CheriBSD MFC after: 1 week Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D20989 Modified: head/lib/libc/tests/gen/dir2_test.c Modified: head/lib/libc/tests/gen/dir2_test.c ============================================================================== --- head/lib/libc/tests/gen/dir2_test.c Thu Jul 18 21:33:55 2019 (r350116) +++ head/lib/libc/tests/gen/dir2_test.c Thu Jul 18 21:37:50 2019 (r350117) @@ -73,7 +73,7 @@ ATF_TC_BODY(telldir_after_seekdir, tc) char filename[16]; snprintf(filename, sizeof(filename), "%d", i); - fd = openat(dirfd, filename, O_WRONLY | O_CREAT); + fd = openat(dirfd, filename, O_WRONLY | O_CREAT, 0600); ATF_REQUIRE(fd > 0); close(fd); } @@ -150,7 +150,7 @@ ATF_TC_BODY(telldir_at_end_of_block, tc) char filename[16]; snprintf(filename, sizeof(filename), "%d", i); - fd = openat(dirfd, filename, O_WRONLY | O_CREAT); + fd = openat(dirfd, filename, O_WRONLY | O_CREAT, 0600); ATF_REQUIRE(fd > 0); close(fd); } From owner-svn-src-all@freebsd.org Thu Jul 18 21:41:18 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 34DB7B23C6; Thu, 18 Jul 2019 21:41:18 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.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 5EEDE72DCB; Thu, 18 Jul 2019 21:41:17 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 4B68F3C0199; Thu, 18 Jul 2019 21:41:15 +0000 (UTC) Date: Thu, 18 Jul 2019 21:41:15 +0000 From: Brooks Davis To: Brooks Davis Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r350116 - head/lib/libc/gen Message-ID: <20190718214115.GA42117@spindle.one-eyed-alien.net> References: <201907182133.x6ILXu4k026793@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="W/nzBZO5zC0uMSeA" Content-Disposition: inline In-Reply-To: <201907182133.x6ILXu4k026793@repo.freebsd.org> User-Agent: Mutt/1.9.4 (2018-02-28) X-Rspamd-Queue-Id: 5EEDE72DCB X-Spamd-Bar: ------- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-7.19 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[freebsd.org]; AUTH_NA(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; IP_SCORE(-3.56)[ip: (-9.25), ipnet: 199.48.128.0/22(-4.60), asn: 36236(-3.87), country: US(-0.05)]; MX_GOOD(-0.01)[cached: spindle.one-eyed-alien.net]; NEURAL_HAM_SHORT(-0.72)[-0.724,0]; R_SPF_NA(0.00)[]; SIGNED_PGP(-2.00)[]; FORGED_SENDER(0.30)[brooks@freebsd.org,brooks@spindle.one-eyed-alien.net]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+]; ASN(0.00)[asn:36236, ipnet:199.48.128.0/22, country:US]; FROM_NEQ_ENVFROM(0.00)[brooks@freebsd.org,brooks@spindle.one-eyed-alien.net]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jul 2019 21:41:18 -0000 --W/nzBZO5zC0uMSeA Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jul 18, 2019 at 09:33:56PM +0000, Brooks Davis wrote: > Author: brooks > Date: Thu Jul 18 21:33:55 2019 > New Revision: 350116 > URL: https://svnweb.freebsd.org/changeset/base/350116 >=20 > Log: > Document that setmode(3) is not thread safe. > =20 > In some circumstances, setmode(3) may call umask(2) twice to retrieve > the current mode and then restore it. Between calls, the process will > have a umask of 0. This race isn't especially serious, since it only occurs when security.bsd.unprivileged_proc_debug=3D0, but it's probably something to fix. The easiest solution would probably be to implement a getumask() syscall. -- Brooks --W/nzBZO5zC0uMSeA Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJdMOd6AAoJEKzQXbSebgfARCkIAJ1llteqB1g0WemVZ9X9Sv72 6Nf7wxnTrqtXNrGqyWigDpM1ftyfsLUjvbKtN+oOIuVa3a3FQjkqTEHBpCKPrh8h XIV8v/aXr5nS+xnmd6VT7r0FLnkiKap4R3pZZ2ifcQ7lGcFUB0vU9oHcVtNt+GeL EtD8sF9m8D1MgxR6FtcoEgt2oBMECTdnZDTvjFOX3Xs44Z2qmqZR4n1EVNyTEryf QQmLXoDli6nO4QHPB/qTWfvH1scCV360vv+FQcs+huSWRW7w4hHT8j5G8MHy2pYj 9ATAHX8Q7ynQi6y38e3pREahL1r3A2QZK2F1KeVaTrlG2iq7+porGE8JqH9XVOk= =Vk+s -----END PGP SIGNATURE----- --W/nzBZO5zC0uMSeA-- From owner-svn-src-all@freebsd.org Thu Jul 18 21:46:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DD771B26D5; Thu, 18 Jul 2019 21:46:36 +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) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 489E1732E2; Thu, 18 Jul 2019 21:46:36 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id x6ILkSd2052938 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Fri, 19 Jul 2019 00:46:31 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x6ILkSd2052938 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x6ILkSJT052937; Fri, 19 Jul 2019 00:46:28 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 19 Jul 2019 00:46:28 +0300 From: Konstantin Belousov To: Brooks Davis Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r350116 - head/lib/libc/gen Message-ID: <20190718214628.GD47193@kib.kiev.ua> References: <201907182133.x6ILXu4k026793@repo.freebsd.org> <20190718214115.GA42117@spindle.one-eyed-alien.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190718214115.GA42117@spindle.one-eyed-alien.net> User-Agent: Mutt/1.12.1 (2019-06-15) 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.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jul 2019 21:46:36 -0000 On Thu, Jul 18, 2019 at 09:41:15PM +0000, Brooks Davis wrote: > On Thu, Jul 18, 2019 at 09:33:56PM +0000, Brooks Davis wrote: > > Author: brooks > > Date: Thu Jul 18 21:33:55 2019 > > New Revision: 350116 > > URL: https://svnweb.freebsd.org/changeset/base/350116 > > > > Log: > > Document that setmode(3) is not thread safe. > > > > In some circumstances, setmode(3) may call umask(2) twice to retrieve > > the current mode and then restore it. Between calls, the process will > > have a umask of 0. > > This race isn't especially serious, since it only occurs when > security.bsd.unprivileged_proc_debug=0, but it's probably something to > fix. The easiest solution would probably be to implement a getumask() > syscall. You can use pthread_suspend_all_np(3). From owner-svn-src-all@freebsd.org Thu Jul 18 21:48:44 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C371FB2770 for ; Thu, 18 Jul 2019 21:48:44 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound3d.ore.mailhop.org (outbound3d.ore.mailhop.org [54.186.57.195]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 430ED73460 for ; Thu, 18 Jul 2019 21:48:44 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1563486522; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=vrM/z5EFRF/MVzYpI8wplzwDUU5mjfkiUCxi+ASi7HpC33nBp0lM1SS329jagU2TUq2h9vxdsb7dX DLrJPu1lYxZpZr8OIDN7jjDoiu39UMe5aa+CFTN5OgAYUbiDkQvxYnPCi2BWlNHqQiLTdwXtPG4Jwi yNbB4G6NKx3SOXI2ZiI9tk58ZjAM3fQyqb7Y0PgAgXpf/dK0cV9Aw4apkPcn4nvrrNrwK6UDL+4tjz BrtDebD0wy3QeH8OlLqBbIuIK1OVWkWO84M8wvyn9p1lyEw3OiWTVyGxYIL7DmqNTHZjslkKLwDHI4 bzcBmdS4qbFMSQWtczvHo6U+cKz0m4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:dkim-signature:from; bh=4tmf0xafcVRwE7E9cbx6RFAQfS6zIetmANlgHxDhxdM=; b=K16V4FUACD69mKEW3Jwfxa7DVitVS6sfaJhyHJPor8QPLyXTkeNryxdR9WGFGNuxg3zRJb5qYJM1N qpVxUxZQ3WCHWnYFmsNYK7HTZ5LhktgNhSlZjMrXL5dbpF7eAOLjDYLPOz1MuhNykc532OW/Apcroq sJJaTNZHpBMLZIpuV7d3ftrR+zCogXwDXI+Fd1W0S5YnRqiY4OARVr29B8DJeP2+XAvLEUunse+VF9 AMJOcnsmGhIhuVxP6niYZdy5YMS0D34kO/0b4Qz8CQHeOYYK87i1sOYluntxz7vE4rw3QsmGTgMmVK wj50csLDPipZsGpaQ6r19RmxZixq4/g== ARC-Authentication-Results: i=1; outbound3.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:from; bh=4tmf0xafcVRwE7E9cbx6RFAQfS6zIetmANlgHxDhxdM=; b=piVdw1/DA4USNpnnT5xCRycO/xd6MbPidQ/WPZuGPg31xkG4jXIPYtGwMXa9WWxqGTH30COI69A9b mkiQBlaKl/s3zsoln9xSoQWm+RpNFxdUn2J7WH9a4jrQFRfXExIl3mVlVI3v/+6FtbhLaAmzdq0F7U /OGcgrQGTEXBaegDNdsm+uaAKLFyUMVhQVSdlL4V8CRyLpmYNDxGXWwq/hJ8lBLhh2vwTErocD6e8o epmNNT9vfiuR7eNWAIDtGAc9iWR8+F8680hSrpncNzGVmWEejbyyxYSpQfpXS6024opO4HMhHLHg4P apIqtrdsxvM8O+eNsFzMqd1jsBwd1kA== X-MHO-RoutePath: aGlwcGll X-MHO-User: cdf7a3a8-a9a5-11e9-90e8-c17e0c9f2e02 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound3.ore.mailhop.org (Halon) with ESMTPSA id cdf7a3a8-a9a5-11e9-90e8-c17e0c9f2e02; Thu, 18 Jul 2019 21:48:41 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x6ILmdJY046119; Thu, 18 Jul 2019 15:48:39 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: Subject: Re: svn commit: r350116 - head/lib/libc/gen From: Ian Lepore To: Brooks Davis Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Thu, 18 Jul 2019 15:48:39 -0600 In-Reply-To: <20190718214115.GA42117@spindle.one-eyed-alien.net> References: <201907182133.x6ILXu4k026793@repo.freebsd.org> <20190718214115.GA42117@spindle.one-eyed-alien.net> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 430ED73460 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; ASN(0.00)[asn:16509, ipnet:54.186.0.0/15, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jul 2019 21:48:44 -0000 On Thu, 2019-07-18 at 21:41 +0000, Brooks Davis wrote: > On Thu, Jul 18, 2019 at 09:33:56PM +0000, Brooks Davis wrote: > > Author: brooks > > Date: Thu Jul 18 21:33:55 2019 > > New Revision: 350116 > > URL: https://svnweb.freebsd.org/changeset/base/350116 > > > > Log: > > Document that setmode(3) is not thread safe. > > > > In some circumstances, setmode(3) may call umask(2) twice to retrieve > > the current mode and then restore it. Between calls, the process will > > have a umask of 0. > > This race isn't especially serious, since it only occurs when > security.bsd.unprivileged_proc_debug=0, but it's probably something to > fix. The easiest solution would probably be to implement a getumask() > syscall. > Or define a magic value to pass to umask(2) that means "return the old mask without changing anything". If umask() only cares about the low 9 bits and mode_t is uint16, that shouldn't be hard. -- Ian From owner-svn-src-all@freebsd.org Thu Jul 18 21:58:53 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A4668B2A1F; Thu, 18 Jul 2019 21:58:53 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 80ABB738D8; Thu, 18 Jul 2019 21:58:53 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 089B7E8C6; Thu, 18 Jul 2019 21:58:53 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6ILwqwe038776; Thu, 18 Jul 2019 21:58:52 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6ILwqm8038772; Thu, 18 Jul 2019 21:58:52 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201907182158.x6ILwqm8038772@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 18 Jul 2019 21:58:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350118 - in head: share/man/man4 sys/dev/nvme X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head: share/man/man4 sys/dev/nvme X-SVN-Commit-Revision: 350118 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 80ABB738D8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.944,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jul 2019 21:58:53 -0000 Author: imp Date: Thu Jul 18 21:58:51 2019 New Revision: 350118 URL: https://svnweb.freebsd.org/changeset/base/350118 Log: Provide new tunable hw.nvme.verbose_cmd_dump The nvme drive dumps only the most relevant details about a command when it fails. However, there are times this is not sufficient (such as debugging weird issues for a new drive with a vendor). Setting hw.nvme.verbose_cmd_dump=1 in loader.conf will enable more complete debugging information about each command that fails. Reviewed by: rpokala Sponsored by: Netflix Differential Version: https://reviews.freebsd.org/D20988 Modified: head/share/man/man4/nvme.4 head/sys/dev/nvme/nvme.c head/sys/dev/nvme/nvme_private.h head/sys/dev/nvme/nvme_qpair.c Modified: head/share/man/man4/nvme.4 ============================================================================== --- head/share/man/man4/nvme.4 Thu Jul 18 21:37:50 2019 (r350117) +++ head/share/man/man4/nvme.4 Thu Jul 18 21:58:51 2019 (r350118) @@ -151,6 +151,17 @@ This value may also be set in the kernel config file w .Bd -literal -offset indent .Cd options NVME_USE_NVD=0 .Ed +.Pp +When there is an error, +.Nm +prints only the most relevant information about the command by default. +To enable dumping of all information about the command, set the following tunable +value in +.Xr loader.conf 5 : +.Bd -literal -offset indent +hw.nvme.verbose_cmd_dump=1 +.Ed +.Pp .Sh SYSCTL VARIABLES The following controller-level sysctls are currently implemented: .Bl -tag -width indent Modified: head/sys/dev/nvme/nvme.c ============================================================================== --- head/sys/dev/nvme/nvme.c Thu Jul 18 21:37:50 2019 (r350117) +++ head/sys/dev/nvme/nvme.c Thu Jul 18 21:58:51 2019 (r350118) @@ -54,6 +54,9 @@ struct nvme_consumer nvme_consumer[NVME_MAX_CONSUMERS] uma_zone_t nvme_request_zone; int32_t nvme_retry_count; +int nvme_verbose_cmd_dump; + +TUNABLE_INT("hw.nvme.verbose_cmd_dump", &nvme_verbose_cmd_dump); MALLOC_DEFINE(M_NVME, "nvme", "nvme(4) memory allocations"); Modified: head/sys/dev/nvme/nvme_private.h ============================================================================== --- head/sys/dev/nvme/nvme_private.h Thu Jul 18 21:37:50 2019 (r350117) +++ head/sys/dev/nvme/nvme_private.h Thu Jul 18 21:58:51 2019 (r350118) @@ -114,6 +114,7 @@ MALLOC_DECLARE(M_NVME); extern uma_zone_t nvme_request_zone; extern int32_t nvme_retry_count; +extern int32_t nvme_verbose_cmd_dump; struct nvme_completion_poll_status { Modified: head/sys/dev/nvme/nvme_qpair.c ============================================================================== --- head/sys/dev/nvme/nvme_qpair.c Thu Jul 18 21:37:50 2019 (r350117) +++ head/sys/dev/nvme/nvme_qpair.c Thu Jul 18 21:58:51 2019 (r350118) @@ -178,6 +178,16 @@ nvme_qpair_print_command(struct nvme_qpair *qpair, str nvme_admin_qpair_print_command(qpair, cmd); else nvme_io_qpair_print_command(qpair, cmd); + if (nvme_verbose_cmd_dump) { + nvme_printf(qpair->ctrlr, + "nsid:%#x rsvd2:%#x rsvd3:%#x mptr:%#jx prp1:%#jx prp2:%#jx\n", + cmd->nsid, cmd->rsvd2, cmd->rsvd3, (uintmax_t)cmd->mptr, + (uintmax_t)cmd->prp1, (uintmax_t)cmd->prp2); + nvme_printf(qpair->ctrlr, + "cdw10: %#x cdw11:%#x cdw12:%#x cdw13:%#x cdw14:%#x cdw15:%#x\n", + cmd->cdw10, cmd->cdw11, cmd->cdw12, cmd->cdw13, cmd->cdw14, + cmd->cdw15); + } } struct nvme_status_string { From owner-svn-src-all@freebsd.org Fri Jul 19 00:15:26 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9D5A0B530C; Fri, 19 Jul 2019 00:15:26 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7F92C80307; Fri, 19 Jul 2019 00:15:26 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5B32D18424; Fri, 19 Jul 2019 00:15:26 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6J0FQrJ023962; Fri, 19 Jul 2019 00:15:26 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6J0FPCM023960; Fri, 19 Jul 2019 00:15:25 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201907190015.x6J0FPCM023960@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 19 Jul 2019 00:15:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350119 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 350119 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7F92C80307 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jul 2019 00:15:26 -0000 Author: bdrewery Date: Fri Jul 19 00:15:25 2019 New Revision: 350119 URL: https://svnweb.freebsd.org/changeset/base/350119 Log: Rework some multi-output target dependency handling. This reworks my last commit in r301285 to more closely match what was in r241298 (but reverted in r294878). This is addressing "missing .meta file" rebuilds but also ensuring that files are always generated when needed in each case. Note that this is not a complete rework of the problem areas identified in r301285 as most are "good enough" right now as the new pattern is too verbose. It's only worth making this current change where headers may be generated in the INCS list; where missing .meta file rebuilds are spotted. --- Technical details follow --- Several attempts to deal with this problem of multi-output targets, with and without META MODE, were explained in r241298, r294878, and r301285. The general problem is with multi-output targets such as: foo.c foo.h: touch foo.c foo.h foo.c foo.h: touch foo.c touch foo.h foo.c foo.h: foo.in ./generator ${.ALLSRC} This pattern is problematic in jobs mode as both files end up being built concurrently and leads to races. With META MODE it is worse as both targets end up rebuilding if they lack a .meta file. So the generator is force built twice even though it is only needed once. There are also problems in that 'make foo.h' may be ran before 'make foo.c'; The order of make generating the targets is not guaranteed. An older attempted workaround to this (discussed in r294878) was: foo.h: foo.c foo.c: foo.in ./generator ${.ALLSRC} This appears fine except that if foo.h is missing and foo.c exists then foo.h will never be regenerated. This pattern is close to the solution in this commit though: foo.h: foo.c .NOMETA .if !exists(foo.h) foo.c: .PHONY .META .endif foo.c: foo.in ./generator ${.ALLSRC} There's 2 differences here: 1. foo.h will never expect to have a .meta file since the foo.c target will generate both and own the .meta file. 2. If foo.h does not exist then it needs to force foo.c to be rebuilt with .PHONY. That normally disables META MODE though so .META is given to tell bmake we do really expect a .meta file. This pattern cannot work with implicit suffix rules since the .c and .h files may be generated at different times (buildincludes vs depend/all). Sponsored by: Dell EMC MFC after: 2 weeks Modified: head/share/mk/bsd.dep.mk head/share/mk/bsd.snmpmod.mk Modified: head/share/mk/bsd.dep.mk ============================================================================== --- head/share/mk/bsd.dep.mk Thu Jul 18 21:58:51 2019 (r350118) +++ head/share/mk/bsd.dep.mk Fri Jul 19 00:15:25 2019 (r350119) @@ -121,17 +121,27 @@ CLEANFILES+= ${_LC} SRCS:= ${SRCS:S/${_YSRC}/${_YC}/} CLEANFILES+= ${_YC} .if !empty(YFLAGS:M-d) && !empty(SRCS:My.tab.h) -.ORDER: ${_YC} y.tab.h -y.tab.h: .NOMETA -${_YC} y.tab.h: ${_YSRC} +# Multi-output targets both expect a .meta file and will fight over it. Only +# allow it on the .c file instead. +y.tab.h: ${_YC} .NOMETA +# Force rebuild the .c file if any of its other outputs are missing. +.if !exists(y.tab.h) +${_YC}: .PHONY .META +.endif +${_YC}: ${_YSRC} ${YACC} ${YFLAGS} ${.ALLSRC} cp y.tab.c ${_YC} CLEANFILES+= y.tab.c y.tab.h .elif !empty(YFLAGS:M-d) .for _YH in ${_YC:R}.h -.ORDER: ${_YC} ${_YH} -${_YH}: .NOMETA -${_YC} ${_YH}: ${_YSRC} +# Multi-output targets both expect a .meta file and will fight over it. Only +# allow it on the .c file instead. +${_YH}: ${_YC} .NOMETA +# Force rebuild the .c file if any of its other outputs are missing. +.if !exists(${_YH}) +${_YC}: .PHONY .META +.endif +${_YC}: ${_YSRC} ${YACC} ${YFLAGS} -o ${_YC} ${.ALLSRC} SRCS+= ${_YH} CLEANFILES+= ${_YH} Modified: head/share/mk/bsd.snmpmod.mk ============================================================================== --- head/share/mk/bsd.snmpmod.mk Thu Jul 18 21:58:51 2019 (r350118) +++ head/share/mk/bsd.snmpmod.mk Fri Jul 19 00:15:25 2019 (r350119) @@ -12,9 +12,14 @@ GENSNMPTREEFLAGS+= -I${SHAREDIR}/snmpdefs ${MOD}_oid.h: ${MOD}_tree.def ${EXTRAMIBDEFS} ${EXTRAMIBSYMS} cat ${.ALLSRC} | gensnmptree ${GENSNMPTREEFLAGS} -e ${XSYM} > ${.TARGET} -.ORDER: ${MOD}_tree.c ${MOD}_tree.h -${MOD}_tree.h: .NOMETA -${MOD}_tree.c ${MOD}_tree.h: ${MOD}_tree.def ${EXTRAMIBDEFS} +# Multi-output targets both expect a .meta file and will fight over it. Only +# allow it on the .c file instead. +${MOD}_tree.h: ${MOD}_tree.c .NOMETA +# Force rebuild the .c file if any of its other outputs are missing. +.if !exists(${MOD}_tree.h) +${MOD}_tree.c: .PHONY .META +.endif +${MOD}_tree.c: ${MOD}_tree.def ${EXTRAMIBDEFS} cat ${.ALLSRC} | gensnmptree -f ${GENSNMPTREEFLAGS} -p ${MOD}_ .if defined(DEFS) From owner-svn-src-all@freebsd.org Fri Jul 19 00:32:57 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9ECA6B5716; Fri, 19 Jul 2019 00:32:57 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7A98780B72; Fri, 19 Jul 2019 00:32:57 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 556F7187F9; Fri, 19 Jul 2019 00:32:57 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6J0Wv3h035580; Fri, 19 Jul 2019 00:32:57 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6J0Wu1P035577; Fri, 19 Jul 2019 00:32:56 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201907190032.x6J0Wu1P035577@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 19 Jul 2019 00:32:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350120 - head/sys/dev/nvme X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/nvme X-SVN-Commit-Revision: 350120 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7A98780B72 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jul 2019 00:32:57 -0000 Author: imp Date: Fri Jul 19 00:32:56 2019 New Revision: 350120 URL: https://svnweb.freebsd.org/changeset/base/350120 Log: Use sysctl + CTLRWTUN for hw.nvme.verbose_cmd_dump. Also convert it to a bool. While the rest of the driver isn't yet bool clean, this will help. Reviewed by: cem@ Differential Revision: https://reviews.freebsd.org/D20988 Modified: head/sys/dev/nvme/nvme.c head/sys/dev/nvme/nvme_private.h head/sys/dev/nvme/nvme_sysctl.c Modified: head/sys/dev/nvme/nvme.c ============================================================================== --- head/sys/dev/nvme/nvme.c Fri Jul 19 00:15:25 2019 (r350119) +++ head/sys/dev/nvme/nvme.c Fri Jul 19 00:32:56 2019 (r350120) @@ -54,9 +54,7 @@ struct nvme_consumer nvme_consumer[NVME_MAX_CONSUMERS] uma_zone_t nvme_request_zone; int32_t nvme_retry_count; -int nvme_verbose_cmd_dump; -TUNABLE_INT("hw.nvme.verbose_cmd_dump", &nvme_verbose_cmd_dump); MALLOC_DEFINE(M_NVME, "nvme", "nvme(4) memory allocations"); Modified: head/sys/dev/nvme/nvme_private.h ============================================================================== --- head/sys/dev/nvme/nvme_private.h Fri Jul 19 00:15:25 2019 (r350119) +++ head/sys/dev/nvme/nvme_private.h Fri Jul 19 00:32:56 2019 (r350120) @@ -114,7 +114,7 @@ MALLOC_DECLARE(M_NVME); extern uma_zone_t nvme_request_zone; extern int32_t nvme_retry_count; -extern int32_t nvme_verbose_cmd_dump; +extern bool nvme_verbose_cmd_dump; struct nvme_completion_poll_status { Modified: head/sys/dev/nvme/nvme_sysctl.c ============================================================================== --- head/sys/dev/nvme/nvme_sysctl.c Fri Jul 19 00:15:25 2019 (r350119) +++ head/sys/dev/nvme/nvme_sysctl.c Fri Jul 19 00:32:56 2019 (r350120) @@ -42,10 +42,14 @@ __FBSDID("$FreeBSD$"); #endif int nvme_use_nvd = NVME_USE_NVD; +bool nvme_verbose_cmd_dump = false; SYSCTL_NODE(_hw, OID_AUTO, nvme, CTLFLAG_RD, 0, "NVMe sysctl tunables"); SYSCTL_INT(_hw_nvme, OID_AUTO, use_nvd, CTLFLAG_RDTUN, &nvme_use_nvd, 1, "1 = Create NVD devices, 0 = Create NDA devices"); +SYSCTL_BOOL(_hw_nvme, OID_AUTO, verbose_cmd_dump, CTLFLAG_RWTUN, + &nvme_verbose_cmd_dump, 0, + "enable verbose command printting when a command fails"); /* * CTLTYPE_S64 and sysctl_handle_64 were added in r217616. Define these From owner-svn-src-all@freebsd.org Fri Jul 19 14:12:12 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 62A5BA3983; Fri, 19 Jul 2019 14:12:12 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 457986EDCA; Fri, 19 Jul 2019 14:12:12 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 216C52207C; Fri, 19 Jul 2019 14:12:12 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6JECCST017044; Fri, 19 Jul 2019 14:12:12 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6JECBf1017043; Fri, 19 Jul 2019 14:12:11 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201907191412.x6JECBf1017043@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 19 Jul 2019 14:12:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350121 - stable/12/tests/sys/net X-SVN-Group: stable-12 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: stable/12/tests/sys/net X-SVN-Commit-Revision: 350121 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 457986EDCA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.944,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jul 2019 14:12:12 -0000 Author: asomers Date: Fri Jul 19 14:12:11 2019 New Revision: 350121 URL: https://svnweb.freebsd.org/changeset/base/350121 Log: MFC r349009: Add test cases for epair Implements the missing test cases for epair in a similar fashion to the existing tests. Fixes shared abstractions to work with epair tests. Submitted by: Ryan Moeller Reviewed by: asomers Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D20498 Modified: stable/12/tests/sys/net/if_clone_test.sh Directory Properties: stable/12/ (props changed) Modified: stable/12/tests/sys/net/if_clone_test.sh ============================================================================== --- stable/12/tests/sys/net/if_clone_test.sh Fri Jul 19 00:32:56 2019 (r350120) +++ stable/12/tests/sys/net/if_clone_test.sh Fri Jul 19 14:12:11 2019 (r350121) @@ -39,6 +39,52 @@ TESTLEN=10 # seconds +atf_test_case epair_stress cleanup +epair_stress_head() +{ + atf_set "descr" "Simultaneously create and destroy an epair(4)" + atf_set "require.user" "root" +} +epair_stress_body() +{ + do_stress "epair" +} +epair_stress_cleanup() +{ + cleanup_ifaces +} + +atf_test_case epair_up_stress cleanup +epair_up_stress_head() +{ + atf_set "descr" "Simultaneously up and detroy an epair(4)" + atf_set "require.user" "root" +} +epair_up_stress_body() +{ + do_up_stress "epair" "" "" +} +epair_up_stress_cleanup() +{ + cleanup_ifaces +} + +atf_test_case epair_ipv6_up_stress cleanup +epair_ipv6_up_stress_head() +{ + atf_set "descr" "Simultaneously up and destroy an epair(4) with IPv6" + atf_set "require.user" "root" +} +epair_ipv6_up_stress_body() +{ + atf_skip "Quickly panics: page fault in in6_unlink_ifa (PR 225438)" + do_up_stress "epair" "6" "" +} +epair_ipv6_up_stress_cleanup() +{ + cleanup_ifaces +} + atf_test_case faith_stress cleanup faith_stress_head() { @@ -369,7 +415,9 @@ vmnet_ipv6_up_stress_cleanup() atf_init_test_cases() { - # TODO: add epair(4) tests, which need a different syntax + atf_add_test_case epair_ipv6_up_stress + atf_add_test_case epair_stress + atf_add_test_case epair_up_stress atf_add_test_case faith_ipv6_up_stress atf_add_test_case faith_stress atf_add_test_case faith_up_stress @@ -396,13 +444,13 @@ atf_init_test_cases() do_stress() { - local IFACE + local IFACE CREATOR_PID DESTROYER_PID IFACE=`get_iface $1` # First thread: create the interface while true; do - ifconfig $IFACE create 2>/dev/null && \ + ifconfig ${IFACE%a} create 2>/dev/null && \ echo -n . >> creator_count.txt done & CREATOR_PID=$! @@ -417,7 +465,7 @@ do_stress() sleep ${TESTLEN} kill $CREATOR_PID kill $DESTROYER_PID - echo "Created $IFACE `stat -f %z creator_count.txt` times." + echo "Created ${IFACE%a} `stat -f %z creator_count.txt` times." echo "Destroyed it `stat -f %z destroyer_count.txt` times." } @@ -428,7 +476,8 @@ do_stress() # $3 p2p for point to point interfaces, anything else for normal interfaces do_up_stress() { - local IFACE IPv6 MAC P2P SRCDIR + local ADDR DSTADDR MASK MEAN_SLEEP_SECONDS MAX_SLEEP_USECS \ + IFACE IPV6 P2P SRCDIR LOOP_PID ipv6_cmd up_cmd # Configure the interface to use an RFC5737 nonrouteable addresses ADDR="192.0.2.2" @@ -464,7 +513,7 @@ do_up_stress() ifconfig $IFACE destroy && echo -n . >> destroy_count.txt ; } & wait - ifconfig $IFACE create + ifconfig ${IFACE%a} create done & LOOP_PID=$! @@ -489,7 +538,11 @@ get_iface() N=$(($N + 1)) fi done - local DEV=${CLASS}${N} + if [ ${CLASS} = "epair" ]; then + DEV=${CLASS}${N}a + else + DEV=${CLASS}${N} + fi # Record the device so we can clean it up later echo ${DEV} >> "devices_to_cleanup" echo ${DEV} @@ -501,11 +554,7 @@ cleanup_ifaces() local DEV for DEV in `cat "devices_to_cleanup"`; do - if [ ${DEV%%[0-9]*a} = "epair" ]; then - ifconfig ${DEV}a destroy - else - ifconfig ${DEV} destroy - fi + ifconfig ${DEV} destroy done true } From owner-svn-src-all@freebsd.org Fri Jul 19 14:13:51 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6DBFFA3A55; Fri, 19 Jul 2019 14:13:51 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FD436F040; Fri, 19 Jul 2019 14:13:51 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2C308221B1; Fri, 19 Jul 2019 14:13:51 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6JEDpjB020386; Fri, 19 Jul 2019 14:13:51 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6JEDpB8020385; Fri, 19 Jul 2019 14:13:51 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201907191413.x6JEDpB8020385@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 19 Jul 2019 14:13:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350122 - stable/12/lib/libc/sys X-SVN-Group: stable-12 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: stable/12/lib/libc/sys X-SVN-Commit-Revision: 350122 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4FD436F040 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.94)[-0.943,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jul 2019 14:13:51 -0000 Author: asomers Date: Fri Jul 19 14:13:50 2019 New Revision: 350122 URL: https://svnweb.freebsd.org/changeset/base/350122 Log: MFC r349041: open(2): fix the description of O_FSYNC The man page claims that with O_FSYNC (aka O_SYNC) the kernel will not cache written data. However, that's not true. Nor does POSIX require it. Perhaps it was true when that section of the man page was written in r69336 (I haven't checked). But it's not true now. Now the effect is simply that writes are sent to disk immediately and synchronously, but they're still cached. See also: https://pubs.opengroup.org/onlinepubs/9699919799/ See also: ffs_write in sys/ufs/ffs/ffs_vnops.c Reviewed by: cem Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20641 Modified: stable/12/lib/libc/sys/open.2 Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libc/sys/open.2 ============================================================================== --- stable/12/lib/libc/sys/open.2 Fri Jul 19 14:12:11 2019 (r350121) +++ stable/12/lib/libc/sys/open.2 Fri Jul 19 14:13:50 2019 (r350122) @@ -28,7 +28,7 @@ .\" @(#)open.2 8.2 (Berkeley) 11/16/93 .\" $FreeBSD$ .\" -.Dd December 1, 2017 +.Dd June 14, 2019 .Dt OPEN 2 .Os .Sh NAME @@ -183,10 +183,7 @@ The descriptor remains in non-blocking mode for subseq If .Dv O_FSYNC is used in the mask, all writes will -immediately be written to disk, -the kernel will not cache written data -and all writes on the descriptor will not return until -the data to be written completes. +immediately and synchronously be written to disk. .Pp .Dv O_SYNC is a synonym for From owner-svn-src-all@freebsd.org Fri Jul 19 14:16:12 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C1490A3B35; Fri, 19 Jul 2019 14:16:12 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A2AE36F2C7; Fri, 19 Jul 2019 14:16:12 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7B295221BD; Fri, 19 Jul 2019 14:16:12 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6JEGCSi020672; Fri, 19 Jul 2019 14:16:12 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6JEGBHk020669; Fri, 19 Jul 2019 14:16:11 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201907191416.x6JEGBHk020669@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 19 Jul 2019 14:16:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350123 - in stable/12: share/man/man9 sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in stable/12: share/man/man9 sys/kern X-SVN-Commit-Revision: 350123 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A2AE36F2C7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.94)[-0.944,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jul 2019 14:16:12 -0000 Author: asomers Date: Fri Jul 19 14:16:11 2019 New Revision: 350123 URL: https://svnweb.freebsd.org/changeset/base/350123 Log: MFC r349230, r349234, r349477 r349230: Add a VOP_BMAP(9) man page Reviewed by: mckusick Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20704 r349234: VOP_BMAP(9): fix typo in the copyright header Reported by: rgrimes MFC-With: 349230 Sponsored by: The FreeBSD Foundation r349477: [skip ci] VOP_BMAP.9: fix diction in copyright header MFC-With: r349230 Sponsored by: The FreeBSD Foundation Added: stable/12/share/man/man9/VOP_BMAP.9 - copied, changed from r349230, head/share/man/man9/VOP_BMAP.9 Modified: stable/12/share/man/man9/Makefile stable/12/sys/kern/vfs_default.c Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man9/Makefile ============================================================================== --- stable/12/share/man/man9/Makefile Fri Jul 19 14:13:50 2019 (r350122) +++ stable/12/share/man/man9/Makefile Fri Jul 19 14:16:11 2019 (r350123) @@ -397,6 +397,7 @@ MAN= accept_filter.9 \ VOP_ADVLOCK.9 \ VOP_ALLOCATE.9 \ VOP_ATTRIB.9 \ + VOP_BMAP.9 \ VOP_BWRITE.9 \ VOP_CREATE.9 \ VOP_FSYNC.9 \ Copied and modified: stable/12/share/man/man9/VOP_BMAP.9 (from r349230, head/share/man/man9/VOP_BMAP.9) ============================================================================== --- head/share/man/man9/VOP_BMAP.9 Thu Jun 20 13:59:46 2019 (r349230, copy source) +++ stable/12/share/man/man9/VOP_BMAP.9 Fri Jul 19 14:16:11 2019 (r350123) @@ -3,15 +3,15 @@ .\" .\" Copyright (c) 2019 The FreeBSD Foundation .\" -.\" This software was developed by BFF Storage Systems, LLC under sponsorship -.\" from the FreeBSD Foundation. +.\" This documentation was written by BFF Storage Systems, LLC under +.\" sponsorship from the FreeBSD Foundation. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. -.\".\"2. Redistributions in binary form must reproduce the above copyright +.\" 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. .\" Modified: stable/12/sys/kern/vfs_default.c ============================================================================== --- stable/12/sys/kern/vfs_default.c Fri Jul 19 14:13:50 2019 (r350122) +++ stable/12/sys/kern/vfs_default.c Fri Jul 19 14:16:11 2019 (r350123) @@ -603,7 +603,13 @@ vop_stdgetwritemount(ap) return (0); } -/* XXX Needs good comment and VOP_BMAP(9) manpage */ +/* + * If the file system doesn't implement VOP_BMAP, then return sensible defaults: + * - Return the vnode's bufobj instead of any underlying device's bufobj + * - Calculate the physical block number as if there were equal size + * consecutive blocks, but + * - Report no contiguous runs of blocks. + */ int vop_stdbmap(ap) struct vop_bmap_args /* { From owner-svn-src-all@freebsd.org Fri Jul 19 14:18:05 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2FC32A3C39; Fri, 19 Jul 2019 14:18:05 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from ecc05.stack.nl (ws0.zlo.nu [190.2.135.243]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "*.stack.nl", Issuer "Sectigo RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 22C216F49E; Fri, 19 Jul 2019 14:18:03 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mail04.stack.nl (blade.stack.nl [51.15.111.152]) by ecc05.stack.nl (Postfix) with ESMTPS id E0E6410051B; Fri, 19 Jul 2019 14:17:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=stack.nl; s=mail; t=1563545873; bh=Iy4YEx4SloU/sWjKwRvt0QVJk/xX0zTSyPOpcNXKGu0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=jF5qGbghQtRwX9XLdoFWBcwwU9E6gC4FaPN+0XOnqcC1kpB1sX0clJe9gyoPyXt4O lhIbGcHraesu8SFR4XenHNDbFd0gHle+aAqUqOctxN45e+0RreT+s77/fh4E24oeSK xEyd3IB1MrhqKkUUT/Zt821JyFfA9xPFk+1DuTJFAO4ShYF4zcQoGPobNbbAcw8toT rOffv9/I5HvWEkz45XyqpQz765M3IpT2MuvzlnZuukneyRS6F4GpnC39xuIvzn4gS+ EyAAu/m5Vw3ZyeQcpFnOuMk+Gez4v6T5pyyAEjWH7Z5Phn1H3195UUInSHhdqSRytx 6hZVvf9LJmxMA== Received: from localhost (localhost.localdomain [127.0.0.1]) by mail04.stack.nl (Postfix) with ESMTP id B70C5DD4; Fri, 19 Jul 2019 14:17:53 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at mail04.stack.nl Received: from mail04.stack.nl ([127.0.0.1]) by localhost (mail04.stack.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id k4Zj3PNavfOu; Fri, 19 Jul 2019 14:17:51 +0000 (UTC) Received: from blade.stack.nl (blade.stack.nl [192.168.122.130]) by mail04.stack.nl (Postfix) with ESMTP id 3698E31D; Fri, 19 Jul 2019 14:17:51 +0000 (UTC) Received: by blade.stack.nl (Postfix, from userid 1677) id 1003520F76; Fri, 19 Jul 2019 16:17:51 +0200 (CEST) Date: Fri, 19 Jul 2019 16:17:50 +0200 From: Jilles Tjoelker To: Brooks Davis Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r350116 - head/lib/libc/gen Message-ID: <20190719141750.GA17297@stack.nl> References: <201907182133.x6ILXu4k026793@repo.freebsd.org> <20190718214115.GA42117@spindle.one-eyed-alien.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190718214115.GA42117@spindle.one-eyed-alien.net> User-Agent: Mutt/1.9.4 (2018-02-28) X-Rspamd-Queue-Id: 22C216F49E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=stack.nl header.s=mail header.b=jF5qGbgh; spf=pass (mx1.freebsd.org: domain of jilles@stack.nl designates 190.2.135.243 as permitted sender) smtp.mailfrom=jilles@stack.nl X-Spamd-Result: default: False [-2.49 / 15.00]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:190.2.135.243]; DKIM_TRACE(0.00)[stack.nl:+]; MX_GOOD(-0.01)[mail01.stack.nl]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:49981, ipnet:190.2.128.0/20, country:NL]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.91)[-0.914,0]; R_DKIM_ALLOW(-0.20)[stack.nl:s=mail]; RCVD_COUNT_FIVE(0.00)[6]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[stack.nl]; NEURAL_SPAM_SHORT(0.09)[0.088,0]; IP_SCORE(-0.16)[asn: 49981(-0.79), country: NL(0.01)] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jul 2019 14:18:05 -0000 On Thu, Jul 18, 2019 at 09:41:15PM +0000, Brooks Davis wrote: > On Thu, Jul 18, 2019 at 09:33:56PM +0000, Brooks Davis wrote: > > Author: brooks > > Date: Thu Jul 18 21:33:55 2019 > > New Revision: 350116 > > URL: https://svnweb.freebsd.org/changeset/base/350116 > > Log: > > Document that setmode(3) is not thread safe. > > In some circumstances, setmode(3) may call umask(2) twice to retrieve > > the current mode and then restore it. Between calls, the process will > > have a umask of 0. > This race isn't especially serious, since it only occurs when > security.bsd.unprivileged_proc_debug=0, but it's probably something to > fix. The easiest solution would probably be to implement a getumask() > syscall. Or make the KERN_PROC_UMASK sysctl work on the process itself even if security.bsd.unprivileged_proc_debug=0. This security sysctl is currently also lowering security. -- Jilles Tjoelker From owner-svn-src-all@freebsd.org Fri Jul 19 14:22:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EC9B0A3D2A; Fri, 19 Jul 2019 14:22:24 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CD4636F876; Fri, 19 Jul 2019 14:22:24 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A716D22392; Fri, 19 Jul 2019 14:22:24 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6JEMObJ026257; Fri, 19 Jul 2019 14:22:24 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6JEMOpB026256; Fri, 19 Jul 2019 14:22:24 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201907191422.x6JEMOpB026256@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 19 Jul 2019 14:22:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r350124 - stable/11/tests/sys/net X-SVN-Group: stable-11 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: stable/11/tests/sys/net X-SVN-Commit-Revision: 350124 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CD4636F876 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.944,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jul 2019 14:22:25 -0000 Author: asomers Date: Fri Jul 19 14:22:24 2019 New Revision: 350124 URL: https://svnweb.freebsd.org/changeset/base/350124 Log: MFC r349009: Add test cases for epair Implements the missing test cases for epair in a similar fashion to the existing tests. Fixes shared abstractions to work with epair tests. Submitted by: Ryan Moeller Reviewed by: asomers Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D20498 Modified: stable/11/tests/sys/net/if_clone_test.sh Directory Properties: stable/11/ (props changed) Modified: stable/11/tests/sys/net/if_clone_test.sh ============================================================================== --- stable/11/tests/sys/net/if_clone_test.sh Fri Jul 19 14:16:11 2019 (r350123) +++ stable/11/tests/sys/net/if_clone_test.sh Fri Jul 19 14:22:24 2019 (r350124) @@ -39,6 +39,52 @@ TESTLEN=10 # seconds +atf_test_case epair_stress cleanup +epair_stress_head() +{ + atf_set "descr" "Simultaneously create and destroy an epair(4)" + atf_set "require.user" "root" +} +epair_stress_body() +{ + do_stress "epair" +} +epair_stress_cleanup() +{ + cleanup_ifaces +} + +atf_test_case epair_up_stress cleanup +epair_up_stress_head() +{ + atf_set "descr" "Simultaneously up and detroy an epair(4)" + atf_set "require.user" "root" +} +epair_up_stress_body() +{ + do_up_stress "epair" "" "" +} +epair_up_stress_cleanup() +{ + cleanup_ifaces +} + +atf_test_case epair_ipv6_up_stress cleanup +epair_ipv6_up_stress_head() +{ + atf_set "descr" "Simultaneously up and destroy an epair(4) with IPv6" + atf_set "require.user" "root" +} +epair_ipv6_up_stress_body() +{ + atf_skip "Quickly panics: page fault in in6_unlink_ifa (PR 225438)" + do_up_stress "epair" "6" "" +} +epair_ipv6_up_stress_cleanup() +{ + cleanup_ifaces +} + atf_test_case faith_stress cleanup faith_stress_head() { @@ -369,7 +415,9 @@ vmnet_ipv6_up_stress_cleanup() atf_init_test_cases() { - # TODO: add epair(4) tests, which need a different syntax + atf_add_test_case epair_ipv6_up_stress + atf_add_test_case epair_stress + atf_add_test_case epair_up_stress atf_add_test_case faith_ipv6_up_stress atf_add_test_case faith_stress atf_add_test_case faith_up_stress @@ -396,13 +444,13 @@ atf_init_test_cases() do_stress() { - local IFACE + local IFACE CREATOR_PID DESTROYER_PID IFACE=`get_iface $1` # First thread: create the interface while true; do - ifconfig $IFACE create 2>/dev/null && \ + ifconfig ${IFACE%a} create 2>/dev/null && \ echo -n . >> creator_count.txt done & CREATOR_PID=$! @@ -417,7 +465,7 @@ do_stress() sleep ${TESTLEN} kill $CREATOR_PID kill $DESTROYER_PID - echo "Created $IFACE `stat -f %z creator_count.txt` times." + echo "Created ${IFACE%a} `stat -f %z creator_count.txt` times." echo "Destroyed it `stat -f %z destroyer_count.txt` times." } @@ -428,7 +476,8 @@ do_stress() # $3 p2p for point to point interfaces, anything else for normal interfaces do_up_stress() { - local IFACE IPv6 MAC P2P SRCDIR + local ADDR DSTADDR MASK MEAN_SLEEP_SECONDS MAX_SLEEP_USECS \ + IFACE IPV6 P2P SRCDIR LOOP_PID ipv6_cmd up_cmd # Configure the interface to use an RFC5737 nonrouteable addresses ADDR="192.0.2.2" @@ -464,7 +513,7 @@ do_up_stress() ifconfig $IFACE destroy && echo -n . >> destroy_count.txt ; } & wait - ifconfig $IFACE create + ifconfig ${IFACE%a} create done & LOOP_PID=$! @@ -489,7 +538,11 @@ get_iface() N=$(($N + 1)) fi done - local DEV=${CLASS}${N} + if [ ${CLASS} = "epair" ]; then + DEV=${CLASS}${N}a + else + DEV=${CLASS}${N} + fi # Record the device so we can clean it up later echo ${DEV} >> "devices_to_cleanup" echo ${DEV} @@ -501,11 +554,7 @@ cleanup_ifaces() local DEV for DEV in `cat "devices_to_cleanup"`; do - if [ ${DEV%%[0-9]*a} = "epair" ]; then - ifconfig ${DEV}a destroy - else - ifconfig ${DEV} destroy - fi + ifconfig ${DEV} destroy done true } From owner-svn-src-all@freebsd.org Fri Jul 19 14:23:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 27F98A3EC7; Fri, 19 Jul 2019 14:23:24 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0A55B6F9D2; Fri, 19 Jul 2019 14:23:24 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D3EC3223A4; Fri, 19 Jul 2019 14:23:23 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6JENNPV026357; Fri, 19 Jul 2019 14:23:23 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6JENN3D026356; Fri, 19 Jul 2019 14:23:23 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201907191423.x6JENN3D026356@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 19 Jul 2019 14:23:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r350125 - stable/11/lib/libc/sys X-SVN-Group: stable-11 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: stable/11/lib/libc/sys X-SVN-Commit-Revision: 350125 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0A55B6F9D2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.94)[-0.943,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jul 2019 14:23:24 -0000 Author: asomers Date: Fri Jul 19 14:23:23 2019 New Revision: 350125 URL: https://svnweb.freebsd.org/changeset/base/350125 Log: MFC r349041: open(2): fix the description of O_FSYNC The man page claims that with O_FSYNC (aka O_SYNC) the kernel will not cache written data. However, that's not true. Nor does POSIX require it. Perhaps it was true when that section of the man page was written in r69336 (I haven't checked). But it's not true now. Now the effect is simply that writes are sent to disk immediately and synchronously, but they're still cached. See also: https://pubs.opengroup.org/onlinepubs/9699919799/ See also: ffs_write in sys/ufs/ffs/ffs_vnops.c Reviewed by: cem Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20641 Modified: stable/11/lib/libc/sys/open.2 Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/sys/open.2 ============================================================================== --- stable/11/lib/libc/sys/open.2 Fri Jul 19 14:22:24 2019 (r350124) +++ stable/11/lib/libc/sys/open.2 Fri Jul 19 14:23:23 2019 (r350125) @@ -28,7 +28,7 @@ .\" @(#)open.2 8.2 (Berkeley) 11/16/93 .\" $FreeBSD$ .\" -.Dd March 28, 2018 +.Dd June 14, 2019 .Dt OPEN 2 .Os .Sh NAME @@ -183,10 +183,7 @@ The descriptor remains in non-blocking mode for subseq If .Dv O_FSYNC is used in the mask, all writes will -immediately be written to disk, -the kernel will not cache written data -and all writes on the descriptor will not return until -the data to be written completes. +immediately and synchronously be written to disk. .Pp .Dv O_SYNC is a synonym for From owner-svn-src-all@freebsd.org Fri Jul 19 14:24:34 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A3E1CA3F66; Fri, 19 Jul 2019 14:24:34 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 84DFF6FB14; Fri, 19 Jul 2019 14:24:34 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6107B223A5; Fri, 19 Jul 2019 14:24:34 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6JEOYS6026463; Fri, 19 Jul 2019 14:24:34 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6JEOXbw026460; Fri, 19 Jul 2019 14:24:33 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201907191424.x6JEOXbw026460@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 19 Jul 2019 14:24:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r350126 - in stable/11: share/man/man9 sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in stable/11: share/man/man9 sys/kern X-SVN-Commit-Revision: 350126 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 84DFF6FB14 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.94)[-0.944,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jul 2019 14:24:34 -0000 Author: asomers Date: Fri Jul 19 14:24:33 2019 New Revision: 350126 URL: https://svnweb.freebsd.org/changeset/base/350126 Log: MFC r349230, r349234, r349477 r349230: Add a VOP_BMAP(9) man page Reviewed by: mckusick Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20704 r349234: VOP_BMAP(9): fix typo in the copyright header Reported by: rgrimes MFC-With: 349230 Sponsored by: The FreeBSD Foundation r349477: [skip ci] VOP_BMAP.9: fix diction in copyright header MFC-With: r349230 Sponsored by: The FreeBSD Foundation Added: stable/11/share/man/man9/VOP_BMAP.9 - copied, changed from r349230, head/share/man/man9/VOP_BMAP.9 Modified: stable/11/share/man/man9/Makefile stable/11/sys/kern/vfs_default.c Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man9/Makefile ============================================================================== --- stable/11/share/man/man9/Makefile Fri Jul 19 14:23:23 2019 (r350125) +++ stable/11/share/man/man9/Makefile Fri Jul 19 14:24:33 2019 (r350126) @@ -376,6 +376,7 @@ MAN= accept_filter.9 \ VOP_ADVLOCK.9 \ VOP_ALLOCATE.9 \ VOP_ATTRIB.9 \ + VOP_BMAP.9 \ VOP_BWRITE.9 \ VOP_CREATE.9 \ VOP_FSYNC.9 \ Copied and modified: stable/11/share/man/man9/VOP_BMAP.9 (from r349230, head/share/man/man9/VOP_BMAP.9) ============================================================================== --- head/share/man/man9/VOP_BMAP.9 Thu Jun 20 13:59:46 2019 (r349230, copy source) +++ stable/11/share/man/man9/VOP_BMAP.9 Fri Jul 19 14:24:33 2019 (r350126) @@ -3,15 +3,15 @@ .\" .\" Copyright (c) 2019 The FreeBSD Foundation .\" -.\" This software was developed by BFF Storage Systems, LLC under sponsorship -.\" from the FreeBSD Foundation. +.\" This documentation was written by BFF Storage Systems, LLC under +.\" sponsorship from the FreeBSD Foundation. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. -.\".\"2. Redistributions in binary form must reproduce the above copyright +.\" 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. .\" Modified: stable/11/sys/kern/vfs_default.c ============================================================================== --- stable/11/sys/kern/vfs_default.c Fri Jul 19 14:23:23 2019 (r350125) +++ stable/11/sys/kern/vfs_default.c Fri Jul 19 14:24:33 2019 (r350126) @@ -604,7 +604,13 @@ vop_stdgetwritemount(ap) return (0); } -/* XXX Needs good comment and VOP_BMAP(9) manpage */ +/* + * If the file system doesn't implement VOP_BMAP, then return sensible defaults: + * - Return the vnode's bufobj instead of any underlying device's bufobj + * - Calculate the physical block number as if there were equal size + * consecutive blocks, but + * - Report no contiguous runs of blocks. + */ int vop_stdbmap(ap) struct vop_bmap_args /* { From owner-svn-src-all@freebsd.org Fri Jul 19 14:25:50 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 645C0A3FFE; Fri, 19 Jul 2019 14:25:50 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 44FC76FC5B; Fri, 19 Jul 2019 14:25:50 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3893C223A6; Fri, 19 Jul 2019 14:25:50 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6JEPo0x026582; Fri, 19 Jul 2019 14:25:50 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6JEPowd026581; Fri, 19 Jul 2019 14:25:50 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201907191425.x6JEPowd026581@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 19 Jul 2019 14:25:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r350127 - stable/11/share/man/man9 X-SVN-Group: stable-11 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: stable/11/share/man/man9 X-SVN-Commit-Revision: 350127 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 44FC76FC5B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.94)[-0.943,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jul 2019 14:25:50 -0000 Author: asomers Date: Fri Jul 19 14:25:49 2019 New Revision: 350127 URL: https://svnweb.freebsd.org/changeset/base/350127 Log: MFC r349237: VOP_REVOKE(9): update locking requirements per r143495 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20524 Modified: stable/11/share/man/man9/VOP_REVOKE.9 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man9/VOP_REVOKE.9 ============================================================================== --- stable/11/share/man/man9/VOP_REVOKE.9 Fri Jul 19 14:24:33 2019 (r350126) +++ stable/11/share/man/man9/VOP_REVOKE.9 Fri Jul 19 14:25:49 2019 (r350127) @@ -34,7 +34,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 5, 2002 +.Dd June 20, 2019 .Dt VOP_REVOKE 9 .Os .Sh NAME @@ -61,7 +61,7 @@ to signify that all access will be revoked; any other .Sh LOCKS The .Fa vp -must be unlocked on entry, and will remain unlocked upon return. +must be exclusively locked on entry, and will remain locked upon return. .Sh SEE ALSO .Xr make_dev_alias 9 , .Xr vnode 9 From owner-svn-src-all@freebsd.org Fri Jul 19 14:27:19 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 00A3CA407D; Fri, 19 Jul 2019 14:27:19 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D62056FDB2; Fri, 19 Jul 2019 14:27:18 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AE9E6223A7; Fri, 19 Jul 2019 14:27:18 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6JERIxu026708; Fri, 19 Jul 2019 14:27:18 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6JERIrF026707; Fri, 19 Jul 2019 14:27:18 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201907191427.x6JERIrF026707@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 19 Jul 2019 14:27:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350128 - stable/12/share/man/man9 X-SVN-Group: stable-12 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: stable/12/share/man/man9 X-SVN-Commit-Revision: 350128 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D62056FDB2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.94)[-0.943,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jul 2019 14:27:19 -0000 Author: asomers Date: Fri Jul 19 14:27:18 2019 New Revision: 350128 URL: https://svnweb.freebsd.org/changeset/base/350128 Log: MFC r349237: VOP_REVOKE(9): update locking requirements per r143495 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20524 Modified: stable/12/share/man/man9/VOP_REVOKE.9 Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man9/VOP_REVOKE.9 ============================================================================== --- stable/12/share/man/man9/VOP_REVOKE.9 Fri Jul 19 14:25:49 2019 (r350127) +++ stable/12/share/man/man9/VOP_REVOKE.9 Fri Jul 19 14:27:18 2019 (r350128) @@ -34,7 +34,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 5, 2002 +.Dd June 20, 2019 .Dt VOP_REVOKE 9 .Os .Sh NAME @@ -61,7 +61,7 @@ to signify that all access will be revoked; any other .Sh LOCKS The .Fa vp -must be unlocked on entry, and will remain unlocked upon return. +must be exclusively locked on entry, and will remain locked upon return. .Sh SEE ALSO .Xr make_dev_alias 9 , .Xr vnode 9 From owner-svn-src-all@freebsd.org Fri Jul 19 15:07:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C3B33A4DCF; Fri, 19 Jul 2019 15:07:31 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A475F715A0; Fri, 19 Jul 2019 15:07:31 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7417322B48; Fri, 19 Jul 2019 15:07:31 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6JF7VO8051441; Fri, 19 Jul 2019 15:07:31 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6JF7VfT051440; Fri, 19 Jul 2019 15:07:31 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201907191507.x6JF7VfT051440@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 19 Jul 2019 15:07:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350130 - stable/12/lib/libnv X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/lib/libnv X-SVN-Commit-Revision: 350130 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A475F715A0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jul 2019 15:07:31 -0000 Author: markj Date: Fri Jul 19 15:07:31 2019 New Revision: 350130 URL: https://svnweb.freebsd.org/changeset/base/350130 Log: MFC r350054: Use a platform-independent constant for PKG_MAX_SIZE. PR: 238511 Modified: stable/12/lib/libnv/msgio.c Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libnv/msgio.c ============================================================================== --- stable/12/lib/libnv/msgio.c Fri Jul 19 15:07:30 2019 (r350129) +++ stable/12/lib/libnv/msgio.c Fri Jul 19 15:07:31 2019 (r350130) @@ -58,7 +58,13 @@ __FBSDID("$FreeBSD$"); #define PJDLOG_ABORT(...) abort() #endif -#define PKG_MAX_SIZE (MCLBYTES / CMSG_SPACE(sizeof(int)) - 1) +/* + * To work around limitations in 32-bit emulation on 64-bit kernels, use a + * machine-independent limit on the number of FDs per message. Each control + * message contains 1 FD and requires 12 bytes for the header, 4 pad bytes, + * 4 bytes for the descriptor, and another 4 pad bytes. + */ +#define PKG_MAX_SIZE (MCLBYTES / 24) static int msghdr_add_fd(struct cmsghdr *cmsg, int fd) From owner-svn-src-all@freebsd.org Fri Jul 19 15:07:32 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8A9EDA4DDF; Fri, 19 Jul 2019 15:07:32 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6BDC9715A3; Fri, 19 Jul 2019 15:07:32 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 43DA522B4A; Fri, 19 Jul 2019 15:07:32 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6JF7WEs051466; Fri, 19 Jul 2019 15:07:32 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6JF7VwT051434; Fri, 19 Jul 2019 15:07:31 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201907191507.x6JF7VwT051434@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 19 Jul 2019 15:07:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350129 - in head: release/packages usr.sbin/wpa/wpa_cli usr.sbin/wpa/wpa_passphrase usr.sbin/wpa/wpa_priv usr.sbin/wpa/wpa_supplicant X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head: release/packages usr.sbin/wpa/wpa_cli usr.sbin/wpa/wpa_passphrase usr.sbin/wpa/wpa_priv usr.sbin/wpa/wpa_supplicant X-SVN-Commit-Revision: 350129 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6BDC9715A3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jul 2019 15:07:32 -0000 Author: manu Date: Fri Jul 19 15:07:30 2019 New Revision: 350129 URL: https://svnweb.freebsd.org/changeset/base/350129 Log: pkgbase: Add a FreeBSD-wpa package Move the wpa related files from FreeBSD-runtime to a new package named FreeBSD-wpa The FreeBSD runtime is only intended to have everything for a working FreeBSD installation and wpa isn't needed for that. Reviewed by: bapt, gjb Differential Revision: https://reviews.freebsd.org/D20957 Added: head/release/packages/wpa.ucl (contents, props changed) Modified: head/release/packages/Makefile.package head/usr.sbin/wpa/wpa_cli/Makefile head/usr.sbin/wpa/wpa_passphrase/Makefile head/usr.sbin/wpa/wpa_priv/Makefile head/usr.sbin/wpa/wpa_supplicant/Makefile Modified: head/release/packages/Makefile.package ============================================================================== --- head/release/packages/Makefile.package Fri Jul 19 14:27:18 2019 (r350128) +++ head/release/packages/Makefile.package Fri Jul 19 15:07:30 2019 (r350129) @@ -78,3 +78,5 @@ unbound_COMMENT= Unbound DNS Resolver unbound_DESC= Unbound DNS Resolver vi_COMMENT= Vi Editor vi_DESC= Vi Editor +wpa_COMMENT= 802.11 Supplicant +wpa_DESC= 802.11 Supplicant Added: head/release/packages/wpa.ucl ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/release/packages/wpa.ucl Fri Jul 19 15:07:30 2019 (r350129) @@ -0,0 +1,24 @@ +# +# $FreeBSD$ +# + +name = "FreeBSD-%PKGNAME%" +origin = "base" +version = "%VERSION%" +comment = "%COMMENT%" +categories = [ base ] +maintainer = "re@FreeBSD.org" +www = "https://www.FreeBSD.org" +prefix = "/" +licenselogic = "single" +licenses = [ BSD2CLAUSE ] +desc = < Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 58DC7A4EFD; Fri, 19 Jul 2019 15:09:02 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3C078718A2; Fri, 19 Jul 2019 15:09:02 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F17A222B5A; Fri, 19 Jul 2019 15:09:01 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6JF9187051597; Fri, 19 Jul 2019 15:09:01 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6JF91XG051593; Fri, 19 Jul 2019 15:09:01 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201907191509.x6JF91XG051593@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 19 Jul 2019 15:09:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350131 - in head: release/packages usr.sbin/wpa/hostapd usr.sbin/wpa/hostapd_cli X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head: release/packages usr.sbin/wpa/hostapd usr.sbin/wpa/hostapd_cli X-SVN-Commit-Revision: 350131 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3C078718A2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jul 2019 15:09:02 -0000 Author: manu Date: Fri Jul 19 15:09:00 2019 New Revision: 350131 URL: https://svnweb.freebsd.org/changeset/base/350131 Log: pkgbase: Add a FreeBSD-hostapd package Move the hostapd related files from FreeBSD-runtime to a new package n FreeBSD-hostapd The FreeBSD runtime is only intended to have everything for a working FreeBSD installation and hostapd isn't needed for that. Reviewed by: bapt, gjb Differential Revision: https://reviews.freebsd.org/D20958 Added: head/release/packages/hostapd.ucl (contents, props changed) Modified: head/release/packages/Makefile.package head/usr.sbin/wpa/hostapd/Makefile head/usr.sbin/wpa/hostapd_cli/Makefile Modified: head/release/packages/Makefile.package ============================================================================== --- head/release/packages/Makefile.package Fri Jul 19 15:07:31 2019 (r350130) +++ head/release/packages/Makefile.package Fri Jul 19 15:09:00 2019 (r350131) @@ -38,6 +38,8 @@ groff_COMMENT= Groff Utilities groff_DESC= Groff Utilities hast_COMMENT= Highly Available Storage daemon hast_DESC= Highly Available Storage daemon +hostapd_COMMENT= 802.11 Access Point Daemon an Utilities +hostapd_DESC= 802.11 Access Point Daemon an Utilities jail_COMMENT= Jail Utilities jail_DESC= Jail Utilities jail-debug_DESCR= Debugging Symbols Added: head/release/packages/hostapd.ucl ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/release/packages/hostapd.ucl Fri Jul 19 15:09:00 2019 (r350131) @@ -0,0 +1,23 @@ +# +# $FreeBSD$ +# + +name = "FreeBSD-%PKGNAME%" +origin = "base" +version = "%VERSION%" +comment = "%COMMENT%" +categories = [ base ] +maintainer = "re@FreeBSD.org" +www = "https://www.FreeBSD.org" +prefix = "/" +licenselogic = "single" +licenses = [ BSD2CLAUSE ] +desc = < Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 43270A4F8E; Fri, 19 Jul 2019 15:10:08 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 264A871A13; Fri, 19 Jul 2019 15:10:08 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EFDB422B66; Fri, 19 Jul 2019 15:10:07 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6JFA74P051744; Fri, 19 Jul 2019 15:10:07 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6JFA3Td051721; Fri, 19 Jul 2019 15:10:03 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201907191510.x6JFA3Td051721@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 19 Jul 2019 15:10:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350132 - in head: libexec/rc/rc.d release/packages usr.bin/bluetooth/bthost usr.bin/bluetooth/btsockstat usr.bin/bluetooth/rfcomm_sppd usr.sbin/bluetooth/ath3kfw usr.sbin/bluetooth/bcm... X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head: libexec/rc/rc.d release/packages usr.bin/bluetooth/bthost usr.bin/bluetooth/btsockstat usr.bin/bluetooth/rfcomm_sppd usr.sbin/bluetooth/ath3kfw usr.sbin/bluetooth/bcmfw usr.sbin/bluetooth/blu... X-SVN-Commit-Revision: 350132 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 264A871A13 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jul 2019 15:10:08 -0000 Author: manu Date: Fri Jul 19 15:10:03 2019 New Revision: 350132 URL: https://svnweb.freebsd.org/changeset/base/350132 Log: pkgbase: Add a FreeBSD-bluetooth package Move the bluetooth related files from FreeBSD-runtime to a new package named FreeBSD-bluetooth The FreeBSD runtime is only intended to have everything for a working FreeBSD installation and bluetooth isn't needed for that. Reviewed by: bapt, gjb Differential Revision: https://reviews.freebsd.org/D20959 Added: head/release/packages/bluetooth.ucl (contents, props changed) Modified: head/libexec/rc/rc.d/Makefile head/release/packages/Makefile.package head/usr.bin/bluetooth/bthost/Makefile head/usr.bin/bluetooth/btsockstat/Makefile head/usr.bin/bluetooth/rfcomm_sppd/Makefile head/usr.sbin/bluetooth/ath3kfw/Makefile head/usr.sbin/bluetooth/bcmfw/Makefile head/usr.sbin/bluetooth/bluetooth-config/Makefile head/usr.sbin/bluetooth/bt3cfw/Makefile head/usr.sbin/bluetooth/bthidcontrol/Makefile head/usr.sbin/bluetooth/bthidd/Makefile head/usr.sbin/bluetooth/btpand/Makefile head/usr.sbin/bluetooth/hccontrol/Makefile head/usr.sbin/bluetooth/hcsecd/Makefile head/usr.sbin/bluetooth/hcseriald/Makefile head/usr.sbin/bluetooth/l2control/Makefile head/usr.sbin/bluetooth/l2ping/Makefile head/usr.sbin/bluetooth/rfcomm_pppd/Makefile head/usr.sbin/bluetooth/sdpcontrol/Makefile head/usr.sbin/bluetooth/sdpd/Makefile Modified: head/libexec/rc/rc.d/Makefile ============================================================================== --- head/libexec/rc/rc.d/Makefile Fri Jul 19 15:09:00 2019 (r350131) +++ head/libexec/rc/rc.d/Makefile Fri Jul 19 15:10:03 2019 (r350132) @@ -17,9 +17,7 @@ CONFS= DAEMON \ archdep \ bgfsck \ ${_blacklistd} \ - ${_bluetooth} \ bridge \ - ${_bthidd} \ cfumass \ cleanvar \ cleartmp \ @@ -40,7 +38,6 @@ CONFS= DAEMON \ gptboot \ growfs \ gssd \ - ${_hcsecd} \ hostid \ hostid_save \ hostname \ @@ -111,7 +108,6 @@ CONFS= DAEMON \ sysctl \ syslogd \ tmp \ - ${_ubthidhci} \ ugidfw \ ${_utx} \ var \ @@ -175,12 +171,14 @@ _blacklistd+= blacklistd .endif .if ${MK_BLUETOOTH} != "no" -_bluetooth= bluetooth -_bthidd= bthidd -_hcsecd= hcsecd -CONFS+= rfcomm_pppd_server -CONFS+= sdpd -_ubthidhci= ubthidhci +CONFGROUPS+= BLUETOOTH +BLUETOOTH+= bluetooth \ + bthidd \ + hcsecd \ + rfcomm_pppd_server \ + sdpd \ + ubthidhci +BLUETOOTHPACKAGE= bluetooth .endif .if ${MK_BOOTPARAMD} != "no" Modified: head/release/packages/Makefile.package ============================================================================== --- head/release/packages/Makefile.package Fri Jul 19 15:09:00 2019 (r350131) +++ head/release/packages/Makefile.package Fri Jul 19 15:10:03 2019 (r350132) @@ -18,6 +18,8 @@ bhyve_COMMENT= Bhyve Utilities bhyve_DESC= Bhyve Utilities binutils_COMMENT= Binutils binutils_DESC= Binutils +bluetooth_COMMENT= Bluetooth Utilities +bluetooth_DESC= Bluetooth Utilities bsdinstall_COMMENT= BSDInstall Utilities bsdinstall_DESC= BSDInstall Utilities bsnmp_COMMENT= BSNMP Utilities Added: head/release/packages/bluetooth.ucl ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/release/packages/bluetooth.ucl Fri Jul 19 15:10:03 2019 (r350132) @@ -0,0 +1,24 @@ +# +# $FreeBSD$ +# + +name = "FreeBSD-%PKGNAME%" +origin = "base" +version = "%VERSION%" +comment = "%COMMENT%" +categories = [ base ] +maintainer = "re@FreeBSD.org" +www = "https://www.FreeBSD.org" +prefix = "/" +licenselogic = "single" +licenses = [ BSD2CLAUSE ] +desc = < Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 438EFA5000; Fri, 19 Jul 2019 15:10:54 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2739E71BAD; Fri, 19 Jul 2019 15:10:54 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0093522B8D; Fri, 19 Jul 2019 15:10:54 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6JFAroI052523; Fri, 19 Jul 2019 15:10:53 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6JFArPo052520; Fri, 19 Jul 2019 15:10:53 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201907191510.x6JFArPo052520@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 19 Jul 2019 15:10:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350133 - in head: lib/libdpv lib/libfigpar usr.bin/dpv X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head: lib/libdpv lib/libfigpar usr.bin/dpv X-SVN-Commit-Revision: 350133 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2739E71BAD X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jul 2019 15:10:54 -0000 Author: manu Date: Fri Jul 19 15:10:53 2019 New Revision: 350133 URL: https://svnweb.freebsd.org/changeset/base/350133 Log: pkgbase: Add a FreeBSD-dpv package Move the dpv related files from FreeBSD-runtime to a new package named FreeBSD-dpv The only consumer is bsdinstall which is already in it's own package. Reviewed by: bapt, gjb Differential Revision: https://reviews.freebsd.org/D20960 Modified: head/lib/libdpv/Makefile head/lib/libfigpar/Makefile head/usr.bin/dpv/Makefile Modified: head/lib/libdpv/Makefile ============================================================================== --- head/lib/libdpv/Makefile Fri Jul 19 15:10:03 2019 (r350132) +++ head/lib/libdpv/Makefile Fri Jul 19 15:10:53 2019 (r350133) @@ -1,6 +1,6 @@ # $FreeBSD$ -PACKAGE=lib${LIB} +PACKAGE= dpv LIB= dpv SHLIB_MAJOR= 1 INCS= dpv.h Modified: head/lib/libfigpar/Makefile ============================================================================== --- head/lib/libfigpar/Makefile Fri Jul 19 15:10:03 2019 (r350132) +++ head/lib/libfigpar/Makefile Fri Jul 19 15:10:53 2019 (r350133) @@ -1,6 +1,6 @@ # $FreeBSD$ -PACKAGE=lib${LIB} +PACKAGE= dpv LIB= figpar SHLIB_MAJOR= 0 INCS= figpar.h string_m.h Modified: head/usr.bin/dpv/Makefile ============================================================================== --- head/usr.bin/dpv/Makefile Fri Jul 19 15:10:03 2019 (r350132) +++ head/usr.bin/dpv/Makefile Fri Jul 19 15:10:53 2019 (r350133) @@ -1,5 +1,7 @@ # $FreeBSD$ +PACKAGE= dpv + PROG= dpv CFLAGS+= -I${.CURDIR} From owner-svn-src-all@freebsd.org Fri Jul 19 15:11:15 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 917AFA5080; Fri, 19 Jul 2019 15:11:15 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 70DAC71D55; Fri, 19 Jul 2019 15:11:15 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B9FE122BB8; Fri, 19 Jul 2019 15:11:14 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6JFBEsu053480; Fri, 19 Jul 2019 15:11:14 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6JFBELI053479; Fri, 19 Jul 2019 15:11:14 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201907191511.x6JFBELI053479@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 19 Jul 2019 15:11:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350134 - stable/12/sys/arm64/include X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/arm64/include X-SVN-Commit-Revision: 350134 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 70DAC71D55 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jul 2019 15:11:15 -0000 Author: markj Date: Fri Jul 19 15:11:14 2019 New Revision: 350134 URL: https://svnweb.freebsd.org/changeset/base/350134 Log: MFC r350037: Fix the arm64 page table entry attribute mask. Modified: stable/12/sys/arm64/include/pte.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm64/include/pte.h ============================================================================== --- stable/12/sys/arm64/include/pte.h Fri Jul 19 15:10:53 2019 (r350133) +++ stable/12/sys/arm64/include/pte.h Fri Jul 19 15:11:14 2019 (r350134) @@ -40,7 +40,7 @@ typedef uint64_t pt_entry_t; /* page table entry */ /* Block and Page attributes */ /* TODO: Add the upper attributes */ -#define ATTR_MASK_H UINT64_C(0xfff0000000000000) +#define ATTR_MASK_H UINT64_C(0xfffc000000000000) #define ATTR_MASK_L UINT64_C(0x0000000000000fff) #define ATTR_MASK (ATTR_MASK_H | ATTR_MASK_L) /* Bits 58:55 are reserved for software */ From owner-svn-src-all@freebsd.org Fri Jul 19 15:11:54 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 14275A51FB; Fri, 19 Jul 2019 15:11:54 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 34CA371E41; Fri, 19 Jul 2019 15:11:35 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EC6EC22BDE; Fri, 19 Jul 2019 15:11:32 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6JFBWsU053538; Fri, 19 Jul 2019 15:11:32 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6JFBWVi053537; Fri, 19 Jul 2019 15:11:32 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201907191511.x6JFBWVi053537@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 19 Jul 2019 15:11:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350135 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 350135 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 34CA371E41 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jul 2019 15:11:54 -0000 Author: manu Date: Fri Jul 19 15:11:32 2019 New Revision: 350135 URL: https://svnweb.freebsd.org/changeset/base/350135 Log: bsd.confs.mk: Test the correct value for the destination package Reviewed by: bapt, gjb Differential Revision: https://reviews.freebsd.org/D20961 Modified: head/share/mk/bsd.confs.mk Modified: head/share/mk/bsd.confs.mk ============================================================================== --- head/share/mk/bsd.confs.mk Fri Jul 19 15:11:14 2019 (r350134) +++ head/share/mk/bsd.confs.mk Fri Jul 19 15:11:32 2019 (r350135) @@ -43,7 +43,7 @@ STAGE_SETS+= ${group:C,[/*],_,g} . if defined(NO_ROOT) . if !defined(${group}TAGS) || ! ${${group}TAGS:Mpackage=*} -. if defined(${${group}PACKAGE}) +. if defined(${group}PACKAGE) ${group}TAGS+= package=${${group}PACKAGE:Uruntime} . else ${group}TAGS+= package=${PACKAGE:Uruntime} From owner-svn-src-all@freebsd.org Fri Jul 19 15:12:30 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7B082A5276; Fri, 19 Jul 2019 15:12:30 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 175D2721C1; Fri, 19 Jul 2019 15:12:24 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 48C9022D42; Fri, 19 Jul 2019 15:12:23 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6JFCNN3057625; Fri, 19 Jul 2019 15:12:23 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6JFCKuG056140; Fri, 19 Jul 2019 15:12:20 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201907191512.x6JFCKuG056140@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 19 Jul 2019 15:12:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350136 - in head/share/man: man1 man3 man4 man4/man4.aarch64 man4/man4.arm man4/man4.i386 man4/man4.powerpc man4/man4.sparc64 man5 man6 man7 man8 man9 X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/share/man: man1 man3 man4 man4/man4.aarch64 man4/man4.arm man4/man4.i386 man4/man4.powerpc man4/man4.sparc64 man5 man6 man7 man8 man9 X-SVN-Commit-Revision: 350136 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 175D2721C1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jul 2019 15:12:30 -0000 Author: manu Date: Fri Jul 19 15:12:20 2019 New Revision: 350136 URL: https://svnweb.freebsd.org/changeset/base/350136 Log: pkgbase: move man pages from runtime-manual to runtime We don't split the other man pages in their own package so do the same for runtime. Reviewed by: bapt, gjb Differential Revision: https://reviews.freebsd.org/D20962 Modified: head/share/man/man1/Makefile head/share/man/man3/Makefile head/share/man/man4/Makefile head/share/man/man4/man4.aarch64/Makefile head/share/man/man4/man4.arm/Makefile head/share/man/man4/man4.i386/Makefile head/share/man/man4/man4.powerpc/Makefile head/share/man/man4/man4.sparc64/Makefile head/share/man/man5/Makefile head/share/man/man6/Makefile head/share/man/man7/Makefile head/share/man/man8/Makefile head/share/man/man9/Makefile Modified: head/share/man/man1/Makefile ============================================================================== --- head/share/man/man1/Makefile Fri Jul 19 15:11:32 2019 (r350135) +++ head/share/man/man1/Makefile Fri Jul 19 15:12:20 2019 (r350136) @@ -5,8 +5,6 @@ MAN= builtin.1 intro.1 -PACKAGE=runtime-manuals - .if ${MK_TESTS} != "no" ATF= ${SRCTOP}/contrib/atf .PATH: ${ATF}/doc Modified: head/share/man/man3/Makefile ============================================================================== --- head/share/man/man3/Makefile Fri Jul 19 15:11:32 2019 (r350135) +++ head/share/man/man3/Makefile Fri Jul 19 15:12:20 2019 (r350136) @@ -3,8 +3,6 @@ .include -PACKAGE=runtime-manuals - MAN= assert.3 \ ATOMIC_VAR_INIT.3 \ bitstring.3 \ Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Fri Jul 19 15:11:32 2019 (r350135) +++ head/share/man/man4/Makefile Fri Jul 19 15:12:20 2019 (r350136) @@ -3,8 +3,6 @@ .include -PACKAGE=runtime-manuals - MAN= aac.4 \ aacraid.4 \ acpi.4 \ Modified: head/share/man/man4/man4.aarch64/Makefile ============================================================================== --- head/share/man/man4/man4.aarch64/Makefile Fri Jul 19 15:11:32 2019 (r350135) +++ head/share/man/man4/man4.aarch64/Makefile Fri Jul 19 15:12:20 2019 (r350136) @@ -1,7 +1,5 @@ # $FreeBSD$ -PACKAGE=runtime-manuals - .PATH: ${.CURDIR}/../man4.arm # Some manpages are common to arm and aarch64 MAN= \ Modified: head/share/man/man4/man4.arm/Makefile ============================================================================== --- head/share/man/man4/man4.arm/Makefile Fri Jul 19 15:11:32 2019 (r350135) +++ head/share/man/man4/man4.arm/Makefile Fri Jul 19 15:12:20 2019 (r350136) @@ -1,7 +1,5 @@ # $FreeBSD$ -PACKAGE=runtime-manuals - MAN= \ aw_gpio.4 \ aw_mmc.4 \ Modified: head/share/man/man4/man4.i386/Makefile ============================================================================== --- head/share/man/man4/man4.i386/Makefile Fri Jul 19 15:11:32 2019 (r350135) +++ head/share/man/man4/man4.i386/Makefile Fri Jul 19 15:12:20 2019 (r350136) @@ -1,7 +1,5 @@ # $FreeBSD$ -PACKAGE=runtime-manuals - MAN= apm.4 \ ce.4 \ cp.4 \ Modified: head/share/man/man4/man4.powerpc/Makefile ============================================================================== --- head/share/man/man4/man4.powerpc/Makefile Fri Jul 19 15:11:32 2019 (r350135) +++ head/share/man/man4/man4.powerpc/Makefile Fri Jul 19 15:12:20 2019 (r350136) @@ -1,7 +1,5 @@ # $FreeBSD$ -PACKAGE=runtime-manuals - MAN= adb.4 \ akbd.4 \ abtn.4 \ Modified: head/share/man/man4/man4.sparc64/Makefile ============================================================================== --- head/share/man/man4/man4.sparc64/Makefile Fri Jul 19 15:11:32 2019 (r350135) +++ head/share/man/man4/man4.sparc64/Makefile Fri Jul 19 15:12:20 2019 (r350136) @@ -1,7 +1,5 @@ # $FreeBSD$ -PACKAGE=runtime-manuals - MAN= auxio.4 \ central.4 \ clkbrd.4 \ Modified: head/share/man/man5/Makefile ============================================================================== --- head/share/man/man5/Makefile Fri Jul 19 15:11:32 2019 (r350135) +++ head/share/man/man5/Makefile Fri Jul 19 15:12:20 2019 (r350136) @@ -3,8 +3,6 @@ .include -PACKAGE=runtime-manuals - #MISSING: dump.5 plot.5 MAN= acct.5 \ ar.5 \ Modified: head/share/man/man6/Makefile ============================================================================== --- head/share/man/man6/Makefile Fri Jul 19 15:11:32 2019 (r350135) +++ head/share/man/man6/Makefile Fri Jul 19 15:12:20 2019 (r350136) @@ -2,6 +2,4 @@ MAN= intro.6 -PACKAGE=runtime-manuals - .include Modified: head/share/man/man7/Makefile ============================================================================== --- head/share/man/man7/Makefile Fri Jul 19 15:11:32 2019 (r350135) +++ head/share/man/man7/Makefile Fri Jul 19 15:12:20 2019 (r350136) @@ -3,8 +3,6 @@ .include -PACKAGE=runtime-manuals - #MISSING: eqnchar.7 ms.7 term.7 MAN= arch.7 \ ascii.7 \ Modified: head/share/man/man8/Makefile ============================================================================== --- head/share/man/man8/Makefile Fri Jul 19 15:11:32 2019 (r350135) +++ head/share/man/man8/Makefile Fri Jul 19 15:12:20 2019 (r350136) @@ -3,8 +3,6 @@ .include -PACKAGE=runtime-manuals - MAN= \ beinstall.8 \ crash.8 \ Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Fri Jul 19 15:11:32 2019 (r350135) +++ head/share/man/man9/Makefile Fri Jul 19 15:12:20 2019 (r350136) @@ -2,8 +2,6 @@ .include -PACKAGE=runtime-manuals - MAN= accept_filter.9 \ accf_data.9 \ accf_dns.9 \ From owner-svn-src-all@freebsd.org Fri Jul 19 15:17:55 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 162EEA53E5; Fri, 19 Jul 2019 15:17:55 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EBF5A724F2; Fri, 19 Jul 2019 15:17:54 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DE76F22D71; Fri, 19 Jul 2019 15:17:54 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6JFHsfM057930; Fri, 19 Jul 2019 15:17:54 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6JFHsR3057929; Fri, 19 Jul 2019 15:17:54 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201907191517.x6JFHsR3057929@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Fri, 19 Jul 2019 15:17:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350137 - stable/12/sys/netpfil/ipfw X-SVN-Group: stable-12 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: stable/12/sys/netpfil/ipfw X-SVN-Commit-Revision: 350137 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EBF5A724F2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jul 2019 15:17:55 -0000 Author: ae Date: Fri Jul 19 15:17:54 2019 New Revision: 350137 URL: https://svnweb.freebsd.org/changeset/base/350137 Log: MFC r349940: Correctly truncate the rule in case when it has several action opcodes. It is possible, that opcode at the ACTION_PTR() location is not real action, but action modificator like "log", "tag" etc. In this case we need to check for each opcode in the loop to find O_EXTERNAL_ACTION. Obtained from: Yandex LLC Sponsored by: Yandex LLC MFC r349941: Do not modify cmd pointer if it is already last opcode in the rule. Modified: stable/12/sys/netpfil/ipfw/ip_fw_eaction.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netpfil/ipfw/ip_fw_eaction.c ============================================================================== --- stable/12/sys/netpfil/ipfw/ip_fw_eaction.c Fri Jul 19 15:12:20 2019 (r350136) +++ stable/12/sys/netpfil/ipfw/ip_fw_eaction.c Fri Jul 19 15:17:54 2019 (r350137) @@ -377,35 +377,51 @@ ipfw_reset_eaction(struct ip_fw_chain *ch, struct ip_f uint16_t eaction_id, uint16_t default_id, uint16_t instance_id) { ipfw_insn *cmd, *icmd; + int l, cmdlen; IPFW_UH_WLOCK_ASSERT(ch); IPFW_WLOCK_ASSERT(ch); cmd = ACTION_PTR(rule); + l = rule->cmd_len - rule->act_ofs; + while (l > 0) { + cmdlen = F_LEN(cmd); + l -= cmdlen; + if (cmd->opcode == O_EXTERNAL_ACTION || l <= 0) + break; + cmd += cmdlen; + } + /* + * Return if there is not O_EXTERNAL_ACTION or its id is + * different. + */ if (cmd->opcode != O_EXTERNAL_ACTION || cmd->arg1 != eaction_id) return (0); - - if (instance_id != 0 && rule->act_ofs < rule->cmd_len - 1) { + /* + * If instance_id is specified, we need to truncate the + * rule length. Check if there is O_EXTERNAL_INSTANCE opcode. + */ + if (instance_id != 0 && l > 0) { + MPASS(cmdlen == 1); icmd = cmd + 1; if (icmd->opcode != O_EXTERNAL_INSTANCE || icmd->arg1 != instance_id) return (0); - /* FALLTHROUGH */ + /* + * Since named_object related to this instance will be + * destroyed, truncate the chain of opcodes to remove + * the rest of cmd chain just after O_EXTERNAL_ACTION + * opcode. + */ + EACTION_DEBUG("truncate rule %d: len %u -> %u", + rule->rulenum, rule->cmd_len, rule->cmd_len - l); + rule->cmd_len -= l; + MPASS(((uint32_t *)icmd - + (uint32_t *)rule->cmd) == rule->cmd_len); } cmd->arg1 = default_id; /* Set to default id */ - /* - * Since named_object related to this instance will be - * also destroyed, truncate the chain of opcodes to - * remove the rest of cmd chain just after O_EXTERNAL_ACTION - * opcode. - */ - if (rule->act_ofs < rule->cmd_len - 1) { - EACTION_DEBUG("truncate rule %d: len %u -> %u", - rule->rulenum, rule->cmd_len, rule->act_ofs + 1); - rule->cmd_len = rule->act_ofs + 1; - } /* * Return 1 when reset successfully happened. */ From owner-svn-src-all@freebsd.org Fri Jul 19 15:24:09 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 44F80A56A7; Fri, 19 Jul 2019 15:24:09 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2782B7298B; Fri, 19 Jul 2019 15:24:09 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DA21B22F48; Fri, 19 Jul 2019 15:24:08 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6JFO8qI063414; Fri, 19 Jul 2019 15:24:08 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6JFO84W063413; Fri, 19 Jul 2019 15:24:08 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201907191524.x6JFO84W063413@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Fri, 19 Jul 2019 15:24:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r350138 - stable/11/sys/netpfil/ipfw X-SVN-Group: stable-11 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: stable/11/sys/netpfil/ipfw X-SVN-Commit-Revision: 350138 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2782B7298B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jul 2019 15:24:09 -0000 Author: ae Date: Fri Jul 19 15:24:08 2019 New Revision: 350138 URL: https://svnweb.freebsd.org/changeset/base/350138 Log: MFC r349940: Correctly truncate the rule in case when it has several action opcodes. It is possible, that opcode at the ACTION_PTR() location is not real action, but action modificator like "log", "tag" etc. In this case we need to check for each opcode in the loop to find O_EXTERNAL_ACTION. Obtained from: Yandex LLC Sponsored by: Yandex LLC MFC r349941: Do not modify cmd pointer if it is already last opcode in the rule. Modified: stable/11/sys/netpfil/ipfw/ip_fw_eaction.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netpfil/ipfw/ip_fw_eaction.c ============================================================================== --- stable/11/sys/netpfil/ipfw/ip_fw_eaction.c Fri Jul 19 15:17:54 2019 (r350137) +++ stable/11/sys/netpfil/ipfw/ip_fw_eaction.c Fri Jul 19 15:24:08 2019 (r350138) @@ -377,35 +377,51 @@ ipfw_reset_eaction(struct ip_fw_chain *ch, struct ip_f uint16_t eaction_id, uint16_t default_id, uint16_t instance_id) { ipfw_insn *cmd, *icmd; + int l, cmdlen; IPFW_UH_WLOCK_ASSERT(ch); IPFW_WLOCK_ASSERT(ch); cmd = ACTION_PTR(rule); + l = rule->cmd_len - rule->act_ofs; + while (l > 0) { + cmdlen = F_LEN(cmd); + l -= cmdlen; + if (cmd->opcode == O_EXTERNAL_ACTION || l <= 0) + break; + cmd += cmdlen; + } + /* + * Return if there is not O_EXTERNAL_ACTION or its id is + * different. + */ if (cmd->opcode != O_EXTERNAL_ACTION || cmd->arg1 != eaction_id) return (0); - - if (instance_id != 0 && rule->act_ofs < rule->cmd_len - 1) { + /* + * If instance_id is specified, we need to truncate the + * rule length. Check if there is O_EXTERNAL_INSTANCE opcode. + */ + if (instance_id != 0 && l > 0) { + MPASS(cmdlen == 1); icmd = cmd + 1; if (icmd->opcode != O_EXTERNAL_INSTANCE || icmd->arg1 != instance_id) return (0); - /* FALLTHROUGH */ + /* + * Since named_object related to this instance will be + * destroyed, truncate the chain of opcodes to remove + * the rest of cmd chain just after O_EXTERNAL_ACTION + * opcode. + */ + EACTION_DEBUG("truncate rule %d: len %u -> %u", + rule->rulenum, rule->cmd_len, rule->cmd_len - l); + rule->cmd_len -= l; + MPASS(((uint32_t *)icmd - + (uint32_t *)rule->cmd) == rule->cmd_len); } cmd->arg1 = default_id; /* Set to default id */ - /* - * Since named_object related to this instance will be - * also destroyed, truncate the chain of opcodes to - * remove the rest of cmd chain just after O_EXTERNAL_ACTION - * opcode. - */ - if (rule->act_ofs < rule->cmd_len - 1) { - EACTION_DEBUG("truncate rule %d: len %u -> %u", - rule->rulenum, rule->cmd_len, rule->act_ofs + 1); - rule->cmd_len = rule->act_ofs + 1; - } /* * Return 1 when reset successfully happened. */ From owner-svn-src-all@freebsd.org Fri Jul 19 15:37:30 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AFCF4A5A61; Fri, 19 Jul 2019 15:37:30 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9323B72F4F; Fri, 19 Jul 2019 15:37:30 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6D80923140; Fri, 19 Jul 2019 15:37:30 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6JFbUR7069733; Fri, 19 Jul 2019 15:37:30 GMT (envelope-from philip@FreeBSD.org) Received: (from philip@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6JFbTwK069730; Fri, 19 Jul 2019 15:37:29 GMT (envelope-from philip@FreeBSD.org) Message-Id: <201907191537.x6JFbTwK069730@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: philip set sender to philip@FreeBSD.org using -f From: Philip Paeps Date: Fri, 19 Jul 2019 15:37:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350139 - stable/12/contrib/telnet/telnet X-SVN-Group: stable-12 X-SVN-Commit-Author: philip X-SVN-Commit-Paths: stable/12/contrib/telnet/telnet X-SVN-Commit-Revision: 350139 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9323B72F4F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jul 2019 15:37:30 -0000 Author: philip Date: Fri Jul 19 15:37:29 2019 New Revision: 350139 URL: https://svnweb.freebsd.org/changeset/base/350139 Log: MFC r349890: telnet: fix a couple of snprintf() buffer overflows Obtained from: Juniper Networks MFC r349896: telnet: fix minor style violationo While here also fix a very unlikely NULL pointer dereference. Submitted by: Shawn Webb Modified: stable/12/contrib/telnet/telnet/commands.c stable/12/contrib/telnet/telnet/telnet.c stable/12/contrib/telnet/telnet/utilities.c Directory Properties: stable/12/ (props changed) Modified: stable/12/contrib/telnet/telnet/commands.c ============================================================================== --- stable/12/contrib/telnet/telnet/commands.c Fri Jul 19 15:24:08 2019 (r350138) +++ stable/12/contrib/telnet/telnet/commands.c Fri Jul 19 15:37:29 2019 (r350139) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -1654,11 +1655,14 @@ env_init(void) || (strncmp((char *)ep->value, "unix:", 5) == 0))) { char hbuf[256+1]; char *cp2 = strchr((char *)ep->value, ':'); + size_t buflen; - gethostname(hbuf, 256); - hbuf[256] = '\0'; - cp = (char *)malloc(strlen(hbuf) + strlen(cp2) + 1); - sprintf((char *)cp, "%s%s", hbuf, cp2); + gethostname(hbuf, sizeof(hbuf)); + hbuf[sizeof(hbuf)-1] = '\0'; + buflen = strlen(hbuf) + strlen(cp2) + 1; + cp = (char *)malloc(sizeof(char)*buflen); + assert(cp != NULL); + snprintf((char *)cp, buflen, "%s%s", hbuf, cp2); free(ep->value); ep->value = (unsigned char *)cp; } Modified: stable/12/contrib/telnet/telnet/telnet.c ============================================================================== --- stable/12/contrib/telnet/telnet/telnet.c Fri Jul 19 15:24:08 2019 (r350138) +++ stable/12/contrib/telnet/telnet/telnet.c Fri Jul 19 15:37:29 2019 (r350139) @@ -785,7 +785,7 @@ suboption(void) name = gettermname(); len = strlen(name) + 4 + 2; if (len < NETROOM()) { - sprintf(temp, "%c%c%c%c%s%c%c", IAC, SB, TELOPT_TTYPE, + snprintf(temp, sizeof(temp), "%c%c%c%c%s%c%c", IAC, SB, TELOPT_TTYPE, TELQUAL_IS, name, IAC, SE); ring_supply_data(&netoring, temp, len); printsub('>', &temp[2], len-2); @@ -807,7 +807,7 @@ suboption(void) TerminalSpeeds(&ispeed, &ospeed); - sprintf((char *)temp, "%c%c%c%c%ld,%ld%c%c", IAC, SB, TELOPT_TSPEED, + snprintf((char *)temp, sizeof(temp), "%c%c%c%c%ld,%ld%c%c", IAC, SB, TELOPT_TSPEED, TELQUAL_IS, ospeed, ispeed, IAC, SE); len = strlen((char *)temp+4) + 4; /* temp[3] is 0 ... */ Modified: stable/12/contrib/telnet/telnet/utilities.c ============================================================================== --- stable/12/contrib/telnet/telnet/utilities.c Fri Jul 19 15:24:08 2019 (r350138) +++ stable/12/contrib/telnet/telnet/utilities.c Fri Jul 19 15:37:29 2019 (r350139) @@ -629,7 +629,7 @@ printsub(char direction, unsigned char *pointer, int l } { char tbuf[64]; - sprintf(tbuf, "%s%s%s%s%s", + snprintf(tbuf, sizeof(tbuf), "%s%s%s%s%s", pointer[2]&MODE_EDIT ? "|EDIT" : "", pointer[2]&MODE_TRAPSIG ? "|TRAPSIG" : "", pointer[2]&MODE_SOFT_TAB ? "|SOFT_TAB" : "", From owner-svn-src-all@freebsd.org Fri Jul 19 15:37:54 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7033AA5ABB; Fri, 19 Jul 2019 15:37:54 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4730873085; Fri, 19 Jul 2019 15:37:54 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 18FDD23141; Fri, 19 Jul 2019 15:37:54 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6JFbr7a069799; Fri, 19 Jul 2019 15:37:53 GMT (envelope-from philip@FreeBSD.org) Received: (from philip@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6JFbrF3069795; Fri, 19 Jul 2019 15:37:53 GMT (envelope-from philip@FreeBSD.org) Message-Id: <201907191537.x6JFbrF3069795@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: philip set sender to philip@FreeBSD.org using -f From: Philip Paeps Date: Fri, 19 Jul 2019 15:37:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r350140 - stable/11/contrib/telnet/telnet X-SVN-Group: stable-11 X-SVN-Commit-Author: philip X-SVN-Commit-Paths: stable/11/contrib/telnet/telnet X-SVN-Commit-Revision: 350140 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4730873085 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jul 2019 15:37:54 -0000 Author: philip Date: Fri Jul 19 15:37:53 2019 New Revision: 350140 URL: https://svnweb.freebsd.org/changeset/base/350140 Log: MFC r349890: telnet: fix a couple of snprintf() buffer overflows Obtained from: Juniper Networks MFC r349896: telnet: fix minor style violationo While here also fix a very unlikely NULL pointer dereference. Submitted by: Shawn Webb Modified: stable/11/contrib/telnet/telnet/commands.c stable/11/contrib/telnet/telnet/telnet.c stable/11/contrib/telnet/telnet/utilities.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/telnet/telnet/commands.c ============================================================================== --- stable/11/contrib/telnet/telnet/commands.c Fri Jul 19 15:37:29 2019 (r350139) +++ stable/11/contrib/telnet/telnet/commands.c Fri Jul 19 15:37:53 2019 (r350140) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -1654,11 +1655,14 @@ env_init(void) || (strncmp((char *)ep->value, "unix:", 5) == 0))) { char hbuf[256+1]; char *cp2 = strchr((char *)ep->value, ':'); + size_t buflen; - gethostname(hbuf, 256); - hbuf[256] = '\0'; - cp = (char *)malloc(strlen(hbuf) + strlen(cp2) + 1); - sprintf((char *)cp, "%s%s", hbuf, cp2); + gethostname(hbuf, sizeof(hbuf)); + hbuf[sizeof(hbuf)-1] = '\0'; + buflen = strlen(hbuf) + strlen(cp2) + 1; + cp = (char *)malloc(sizeof(char)*buflen); + assert(cp != NULL); + snprintf((char *)cp, buflen, "%s%s", hbuf, cp2); free(ep->value); ep->value = (unsigned char *)cp; } Modified: stable/11/contrib/telnet/telnet/telnet.c ============================================================================== --- stable/11/contrib/telnet/telnet/telnet.c Fri Jul 19 15:37:29 2019 (r350139) +++ stable/11/contrib/telnet/telnet/telnet.c Fri Jul 19 15:37:53 2019 (r350140) @@ -785,7 +785,7 @@ suboption(void) name = gettermname(); len = strlen(name) + 4 + 2; if (len < NETROOM()) { - sprintf(temp, "%c%c%c%c%s%c%c", IAC, SB, TELOPT_TTYPE, + snprintf(temp, sizeof(temp), "%c%c%c%c%s%c%c", IAC, SB, TELOPT_TTYPE, TELQUAL_IS, name, IAC, SE); ring_supply_data(&netoring, temp, len); printsub('>', &temp[2], len-2); @@ -807,7 +807,7 @@ suboption(void) TerminalSpeeds(&ispeed, &ospeed); - sprintf((char *)temp, "%c%c%c%c%ld,%ld%c%c", IAC, SB, TELOPT_TSPEED, + snprintf((char *)temp, sizeof(temp), "%c%c%c%c%ld,%ld%c%c", IAC, SB, TELOPT_TSPEED, TELQUAL_IS, ospeed, ispeed, IAC, SE); len = strlen((char *)temp+4) + 4; /* temp[3] is 0 ... */ Modified: stable/11/contrib/telnet/telnet/utilities.c ============================================================================== --- stable/11/contrib/telnet/telnet/utilities.c Fri Jul 19 15:37:29 2019 (r350139) +++ stable/11/contrib/telnet/telnet/utilities.c Fri Jul 19 15:37:53 2019 (r350140) @@ -629,7 +629,7 @@ printsub(char direction, unsigned char *pointer, int l } { char tbuf[64]; - sprintf(tbuf, "%s%s%s%s%s", + snprintf(tbuf, sizeof(tbuf), "%s%s%s%s%s", pointer[2]&MODE_EDIT ? "|EDIT" : "", pointer[2]&MODE_TRAPSIG ? "|TRAPSIG" : "", pointer[2]&MODE_SOFT_TAB ? "|SOFT_TAB" : "", From owner-svn-src-all@freebsd.org Fri Jul 19 16:21:20 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7DD54A6445; Fri, 19 Jul 2019 16:21:20 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6056F745B1; Fri, 19 Jul 2019 16:21:20 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3CB4123A20; Fri, 19 Jul 2019 16:21:20 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6JGLKdB095129; Fri, 19 Jul 2019 16:21:20 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6JGLKjB095128; Fri, 19 Jul 2019 16:21:20 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201907191621.x6JGLKjB095128@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 19 Jul 2019 16:21:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350141 - stable/12/lib/libkvm X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/lib/libkvm X-SVN-Commit-Revision: 350141 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6056F745B1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jul 2019 16:21:20 -0000 Author: markj Date: Fri Jul 19 16:21:19 2019 New Revision: 350141 URL: https://svnweb.freebsd.org/changeset/base/350141 Log: MFC r350048: Chase r350037. Modified: stable/12/lib/libkvm/kvm_aarch64.h Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libkvm/kvm_aarch64.h ============================================================================== --- stable/12/lib/libkvm/kvm_aarch64.h Fri Jul 19 15:37:53 2019 (r350140) +++ stable/12/lib/libkvm/kvm_aarch64.h Fri Jul 19 16:21:19 2019 (r350141) @@ -41,7 +41,7 @@ typedef uint64_t aarch64_pte_t; #define AARCH64_PAGE_MASK (AARCH64_PAGE_SIZE - 1) /* Source: arm64/include/pte.h */ -#define AARCH64_ATTR_MASK 0xfff0000000000fff +#define AARCH64_ATTR_MASK 0xfffc000000000fff #define AARCH64_ATTR_UXN (1ULL << 54) #define AARCH64_ATTR_PXN (1ULL << 53) #define AARCH64_ATTR_XN (AARCH64_ATTR_PXN | AARCH64_ATTR_UXN) From owner-svn-src-all@freebsd.org Fri Jul 19 17:48:29 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CB131A7CCB; Fri, 19 Jul 2019 17:48:29 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ACE9877349; Fri, 19 Jul 2019 17:48:29 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 889AD249E8; Fri, 19 Jul 2019 17:48:29 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6JHmTPN047010; Fri, 19 Jul 2019 17:48:29 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6JHmTEJ047009; Fri, 19 Jul 2019 17:48:29 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201907191748.x6JHmTEJ047009@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 19 Jul 2019 17:48:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350142 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 350142 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: ACE9877349 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jul 2019 17:48:29 -0000 Author: imp Date: Fri Jul 19 17:48:29 2019 New Revision: 350142 URL: https://svnweb.freebsd.org/changeset/base/350142 Log: Add comments about KERN_OPT here. Modified: head/sys/conf/config.mk Modified: head/sys/conf/config.mk ============================================================================== --- head/sys/conf/config.mk Fri Jul 19 16:21:19 2019 (r350141) +++ head/sys/conf/config.mk Fri Jul 19 17:48:29 2019 (r350142) @@ -45,6 +45,8 @@ KERN_OPTS+= INET TCP_OFFLOAD KERN_OPTS+= INET6 .endif .elif !defined(KERN_OPTS) +# Add all the options that are mentioned in any opt_*.h file when we +# have a kernel build directory to pull them from. KERN_OPTS!=cat ${KERNBUILDDIR}/opt*.h | awk '{print $$2;}' | sort -u .export KERN_OPTS .endif From owner-svn-src-all@freebsd.org Fri Jul 19 17:52:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 16EF1A7EE4; Fri, 19 Jul 2019 17:52:24 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ECE27777DD; Fri, 19 Jul 2019 17:52:23 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C93CB24BC4; Fri, 19 Jul 2019 17:52:23 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6JHqNPr052529; Fri, 19 Jul 2019 17:52:23 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6JHqNEi052528; Fri, 19 Jul 2019 17:52:23 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201907191752.x6JHqNEi052528@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 19 Jul 2019 17:52:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350143 - in head/libexec/bootpd: . tools X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head/libexec/bootpd: . tools X-SVN-Commit-Revision: 350143 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: ECE27777DD X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.94)[-0.942,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jul 2019 17:52:24 -0000 Author: brooks Date: Fri Jul 19 17:52:23 2019 New Revision: 350143 URL: https://svnweb.freebsd.org/changeset/base/350143 Log: Chain Makefile.inc's so default are inherited as expected. Remove unneeded or duplicate variables. No functional change. Obtained from: CheriBSD MFC after: 1 week Sponsored by: DARPA, AFRL Modified: head/libexec/bootpd/Makefile.inc head/libexec/bootpd/tools/Makefile.inc Modified: head/libexec/bootpd/Makefile.inc ============================================================================== --- head/libexec/bootpd/Makefile.inc Fri Jul 19 17:48:29 2019 (r350142) +++ head/libexec/bootpd/Makefile.inc Fri Jul 19 17:52:23 2019 (r350143) @@ -1,5 +1,3 @@ # $FreeBSD$ -BINDIR?= /usr/libexec - -WARNS?= 1 +.include "../Makefile.inc" Modified: head/libexec/bootpd/tools/Makefile.inc ============================================================================== --- head/libexec/bootpd/tools/Makefile.inc Fri Jul 19 17:48:29 2019 (r350142) +++ head/libexec/bootpd/tools/Makefile.inc Fri Jul 19 17:52:23 2019 (r350143) @@ -4,3 +4,5 @@ BINDIR= /usr/sbin WARNS?= 1 + +.include "../Makefile.inc" From owner-svn-src-all@freebsd.org Fri Jul 19 18:38:48 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7BEB1A9150; Fri, 19 Jul 2019 18:38:48 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5DE198122D; Fri, 19 Jul 2019 18:38:48 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 369F6253E7; Fri, 19 Jul 2019 18:38:48 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6JIcmUK076452; Fri, 19 Jul 2019 18:38:48 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6JIcmTZ076451; Fri, 19 Jul 2019 18:38:48 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201907191838.x6JIcmTZ076451@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 19 Jul 2019 18:38:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350145 - head/sys/libkern X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/libkern X-SVN-Commit-Revision: 350145 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5DE198122D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jul 2019 18:38:48 -0000 Author: imp Date: Fri Jul 19 18:38:47 2019 New Revision: 350145 URL: https://svnweb.freebsd.org/changeset/base/350145 Log: Remove pre-FreeBSD 7.0 compatibility. Modified: head/sys/libkern/inet_pton.c Modified: head/sys/libkern/inet_pton.c ============================================================================== --- head/sys/libkern/inet_pton.c Fri Jul 19 18:03:30 2019 (r350144) +++ head/sys/libkern/inet_pton.c Fri Jul 19 18:38:47 2019 (r350145) @@ -27,10 +27,6 @@ __FBSDID("$FreeBSD$"); #include -#if __FreeBSD_version < 700000 -#define strchr index -#endif - /*% * WARNING: Don't even consider trying to compile this on a system where * sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX. From owner-svn-src-all@freebsd.org Fri Jul 19 18:39:20 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2F7EBA9197; Fri, 19 Jul 2019 18:39:20 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 115B68136E; Fri, 19 Jul 2019 18:39:20 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DD103253E8; Fri, 19 Jul 2019 18:39:19 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6JIdJ5r076542; Fri, 19 Jul 2019 18:39:19 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6JIdJdQ076540; Fri, 19 Jul 2019 18:39:19 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201907191839.x6JIdJdQ076540@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 19 Jul 2019 18:39:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350146 - head/sys/dev/nvme X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/nvme X-SVN-Commit-Revision: 350146 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 115B68136E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jul 2019 18:39:20 -0000 Author: imp Date: Fri Jul 19 18:39:18 2019 New Revision: 350146 URL: https://svnweb.freebsd.org/changeset/base/350146 Log: Keep track of the number of retried commands. Retried commands can indicate a performance degredation of an nvme drive. Keep track of the number of retries and report it out via sysctl, just like number of commands an interrupts. Modified: head/sys/dev/nvme/nvme_private.h head/sys/dev/nvme/nvme_qpair.c head/sys/dev/nvme/nvme_sysctl.c Modified: head/sys/dev/nvme/nvme_private.h ============================================================================== --- head/sys/dev/nvme/nvme_private.h Fri Jul 19 18:38:47 2019 (r350145) +++ head/sys/dev/nvme/nvme_private.h Fri Jul 19 18:39:18 2019 (r350146) @@ -190,6 +190,7 @@ struct nvme_qpair { int64_t num_cmds; int64_t num_intr_handler_calls; + int64_t num_retries; struct nvme_command *cmd; struct nvme_completion *cpl; Modified: head/sys/dev/nvme/nvme_qpair.c ============================================================================== --- head/sys/dev/nvme/nvme_qpair.c Fri Jul 19 18:38:47 2019 (r350145) +++ head/sys/dev/nvme/nvme_qpair.c Fri Jul 19 18:39:18 2019 (r350146) @@ -393,6 +393,8 @@ nvme_qpair_complete_tracker(struct nvme_qpair *qpair, error = nvme_completion_is_error(cpl); retry = error && nvme_completion_is_retry(cpl) && req->retries < nvme_retry_count; + if (retry) + qpair->num_retries++; if (error && (print_on_error == ERROR_PRINT_ALL || (!retry && print_on_error == ERROR_PRINT_NO_RETRY))) { @@ -684,6 +686,7 @@ nvme_qpair_construct(struct nvme_qpair *qpair, uint32_ qpair->num_cmds = 0; qpair->num_intr_handler_calls = 0; + qpair->num_retries = 0; qpair->cmd = (struct nvme_command *)queuemem; qpair->cpl = (struct nvme_completion *)(queuemem + cmdsz); prpmem = (uint8_t *)(queuemem + cmdsz + cplsz); Modified: head/sys/dev/nvme/nvme_sysctl.c ============================================================================== --- head/sys/dev/nvme/nvme_sysctl.c Fri Jul 19 18:38:47 2019 (r350145) +++ head/sys/dev/nvme/nvme_sysctl.c Fri Jul 19 18:39:18 2019 (r350146) @@ -166,6 +166,7 @@ nvme_qpair_reset_stats(struct nvme_qpair *qpair) qpair->num_cmds = 0; qpair->num_intr_handler_calls = 0; + qpair->num_retries = 0; } static int @@ -199,6 +200,21 @@ nvme_sysctl_num_intr_handler_calls(SYSCTL_HANDLER_ARGS } static int +nvme_sysctl_num_retries(SYSCTL_HANDLER_ARGS) +{ + struct nvme_controller *ctrlr = arg1; + int64_t num_retries = 0; + int i; + + num_retries = ctrlr->adminq.num_retries; + + for (i = 0; i < ctrlr->num_io_queues; i++) + num_retries += ctrlr->ioq[i].num_retries; + + return (sysctl_handle_64(oidp, &num_retries, 0, req)); +} + +static int nvme_sysctl_reset_stats(SYSCTL_HANDLER_ARGS) { struct nvme_controller *ctrlr = arg1; @@ -249,6 +265,8 @@ nvme_sysctl_initialize_queue(struct nvme_qpair *qpair, "Number of times interrupt handler was invoked (will typically be " "less than number of actual interrupts generated due to " "coalescing)"); + SYSCTL_ADD_QUAD(ctrlr_ctx, que_list, OID_AUTO, "num_retries", + CTLFLAG_RD, &qpair->num_retries, "Number of commands retried"); SYSCTL_ADD_PROC(ctrlr_ctx, que_list, OID_AUTO, "dump_debug", CTLTYPE_UINT | CTLFLAG_RW, qpair, 0, @@ -299,6 +317,11 @@ nvme_sysctl_initialize_ctrlr(struct nvme_controller *c "Number of times interrupt handler was invoked (will " "typically be less than number of actual interrupts " "generated due to coalescing)"); + + SYSCTL_ADD_PROC(ctrlr_ctx, ctrlr_list, OID_AUTO, + "num_retries", CTLTYPE_S64 | CTLFLAG_RD, + ctrlr, 0, nvme_sysctl_num_retries, "IU", + "Number of commands retried"); SYSCTL_ADD_PROC(ctrlr_ctx, ctrlr_list, OID_AUTO, "reset_stats", CTLTYPE_UINT | CTLFLAG_RW, ctrlr, 0, From owner-svn-src-all@freebsd.org Fri Jul 19 18:39:26 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DAA30A91CA; Fri, 19 Jul 2019 18:39:26 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A6066813DB; Fri, 19 Jul 2019 18:39:26 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B12C0253E9; Fri, 19 Jul 2019 18:39:25 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6JIdPSO076600; Fri, 19 Jul 2019 18:39:25 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6JIdPQF076598; Fri, 19 Jul 2019 18:39:25 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201907191839.x6JIdPQF076598@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 19 Jul 2019 18:39:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350147 - head/sys/dev/nvme X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/nvme X-SVN-Commit-Revision: 350147 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A6066813DB X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jul 2019 18:39:26 -0000 Author: imp Date: Fri Jul 19 18:39:24 2019 New Revision: 350147 URL: https://svnweb.freebsd.org/changeset/base/350147 Log: Keep track of the number of commands that exhaust their retry limit. While we print failure messages on the console, sometimes logs are lost or overwhelmed. Keeping a count of how many times we've failed retriable commands helps get a magnitude of the problem. Modified: head/sys/dev/nvme/nvme_private.h head/sys/dev/nvme/nvme_qpair.c head/sys/dev/nvme/nvme_sysctl.c Modified: head/sys/dev/nvme/nvme_private.h ============================================================================== --- head/sys/dev/nvme/nvme_private.h Fri Jul 19 18:39:18 2019 (r350146) +++ head/sys/dev/nvme/nvme_private.h Fri Jul 19 18:39:24 2019 (r350147) @@ -191,6 +191,7 @@ struct nvme_qpair { int64_t num_cmds; int64_t num_intr_handler_calls; int64_t num_retries; + int64_t num_failures; struct nvme_command *cmd; struct nvme_completion *cpl; Modified: head/sys/dev/nvme/nvme_qpair.c ============================================================================== --- head/sys/dev/nvme/nvme_qpair.c Fri Jul 19 18:39:18 2019 (r350146) +++ head/sys/dev/nvme/nvme_qpair.c Fri Jul 19 18:39:24 2019 (r350147) @@ -387,14 +387,16 @@ nvme_qpair_complete_tracker(struct nvme_qpair *qpair, struct nvme_completion *cpl, error_print_t print_on_error) { struct nvme_request *req; - boolean_t retry, error; + boolean_t retry, error, retriable; req = tr->req; error = nvme_completion_is_error(cpl); - retry = error && nvme_completion_is_retry(cpl) && - req->retries < nvme_retry_count; + retriable = nvme_completion_is_retry(cpl); + retry = error && retriable && req->retries < nvme_retry_count; if (retry) qpair->num_retries++; + if (error && req->retries >= nvme_retry_count && retriable) + qpair->num_failures++; if (error && (print_on_error == ERROR_PRINT_ALL || (!retry && print_on_error == ERROR_PRINT_NO_RETRY))) { @@ -687,6 +689,7 @@ nvme_qpair_construct(struct nvme_qpair *qpair, uint32_ qpair->num_cmds = 0; qpair->num_intr_handler_calls = 0; qpair->num_retries = 0; + qpair->num_failures = 0; qpair->cmd = (struct nvme_command *)queuemem; qpair->cpl = (struct nvme_completion *)(queuemem + cmdsz); prpmem = (uint8_t *)(queuemem + cmdsz + cplsz); Modified: head/sys/dev/nvme/nvme_sysctl.c ============================================================================== --- head/sys/dev/nvme/nvme_sysctl.c Fri Jul 19 18:39:18 2019 (r350146) +++ head/sys/dev/nvme/nvme_sysctl.c Fri Jul 19 18:39:24 2019 (r350147) @@ -167,6 +167,7 @@ nvme_qpair_reset_stats(struct nvme_qpair *qpair) qpair->num_cmds = 0; qpair->num_intr_handler_calls = 0; qpair->num_retries = 0; + qpair->num_failures = 0; } static int @@ -215,6 +216,21 @@ nvme_sysctl_num_retries(SYSCTL_HANDLER_ARGS) } static int +nvme_sysctl_num_failures(SYSCTL_HANDLER_ARGS) +{ + struct nvme_controller *ctrlr = arg1; + int64_t num_failures = 0; + int i; + + num_failures = ctrlr->adminq.num_failures; + + for (i = 0; i < ctrlr->num_io_queues; i++) + num_failures += ctrlr->ioq[i].num_failures; + + return (sysctl_handle_64(oidp, &num_failures, 0, req)); +} + +static int nvme_sysctl_reset_stats(SYSCTL_HANDLER_ARGS) { struct nvme_controller *ctrlr = arg1; @@ -267,6 +283,9 @@ nvme_sysctl_initialize_queue(struct nvme_qpair *qpair, "coalescing)"); SYSCTL_ADD_QUAD(ctrlr_ctx, que_list, OID_AUTO, "num_retries", CTLFLAG_RD, &qpair->num_retries, "Number of commands retried"); + SYSCTL_ADD_QUAD(ctrlr_ctx, que_list, OID_AUTO, "num_failures", + CTLFLAG_RD, &qpair->num_failures, + "Number of commands ending in failure after all retries"); SYSCTL_ADD_PROC(ctrlr_ctx, que_list, OID_AUTO, "dump_debug", CTLTYPE_UINT | CTLFLAG_RW, qpair, 0, @@ -322,6 +341,11 @@ nvme_sysctl_initialize_ctrlr(struct nvme_controller *c "num_retries", CTLTYPE_S64 | CTLFLAG_RD, ctrlr, 0, nvme_sysctl_num_retries, "IU", "Number of commands retried"); + + SYSCTL_ADD_PROC(ctrlr_ctx, ctrlr_list, OID_AUTO, + "num_failures", CTLTYPE_S64 | CTLFLAG_RD, + ctrlr, 0, nvme_sysctl_num_failures, "IU", + "Number of commands ending in failure after all retries"); SYSCTL_ADD_PROC(ctrlr_ctx, ctrlr_list, OID_AUTO, "reset_stats", CTLTYPE_UINT | CTLFLAG_RW, ctrlr, 0, From owner-svn-src-all@freebsd.org Fri Jul 19 18:47:14 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3AE7EA945F; Fri, 19 Jul 2019 18:47:14 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1CCB481920; Fri, 19 Jul 2019 18:47:14 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DF876255C4; Fri, 19 Jul 2019 18:47:13 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6JIlD1e082957; Fri, 19 Jul 2019 18:47:13 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6JIlDL2082956; Fri, 19 Jul 2019 18:47:13 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201907191847.x6JIlDL2082956@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 19 Jul 2019 18:47:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350148 - head/libexec/bootpd X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/libexec/bootpd X-SVN-Commit-Revision: 350148 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1CCB481920 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jul 2019 18:47:14 -0000 Author: brooks Date: Fri Jul 19 18:47:13 2019 New Revision: 350148 URL: https://svnweb.freebsd.org/changeset/base/350148 Log: Restore WARNS?=1 here. I missed that libexec/bootpd/bootpgw existed. Modified: head/libexec/bootpd/Makefile.inc Modified: head/libexec/bootpd/Makefile.inc ============================================================================== --- head/libexec/bootpd/Makefile.inc Fri Jul 19 18:39:24 2019 (r350147) +++ head/libexec/bootpd/Makefile.inc Fri Jul 19 18:47:13 2019 (r350148) @@ -1,3 +1,5 @@ # $FreeBSD$ +WARNS?= 1 + .include "../Makefile.inc" From owner-svn-src-all@freebsd.org Fri Jul 19 19:15:10 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 11372A9A25; Fri, 19 Jul 2019 19:15:10 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ECE8B82B24; Fri, 19 Jul 2019 19:15:09 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C1D9B25B90; Fri, 19 Jul 2019 19:15:09 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6JJF9NS000395; Fri, 19 Jul 2019 19:15:09 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6JJF8TW000391; Fri, 19 Jul 2019 19:15:08 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201907191915.x6JJF8TW000391@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 19 Jul 2019 19:15:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350149 - in head: sbin/camcontrol sys/cam/ata sys/sys X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in head: sbin/camcontrol sys/cam/ata sys/sys X-SVN-Commit-Revision: 350149 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: ECE8B82B24 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jul 2019 19:15:10 -0000 Author: mav Date: Fri Jul 19 19:15:08 2019 New Revision: 350149 URL: https://svnweb.freebsd.org/changeset/base/350149 Log: Add Accessible Max Address Configuration support to camcontrol. AMA replaced HPA in ACS-3 specification. It allows to limit size of the disk alike to HPA, but declares inaccessible data as indeterminate. One of its practical use cases is to under-provision SATA SSDs for better reliability and performance. While there, fix HPA Security detection/reporting. MFC after: 2 weeks Relnotes: yes Sponsored by: iXsystems, Inc. Modified: head/sbin/camcontrol/camcontrol.8 head/sbin/camcontrol/camcontrol.c head/sys/cam/ata/ata_all.c head/sys/sys/ata.h Modified: head/sbin/camcontrol/camcontrol.8 ============================================================================== --- head/sbin/camcontrol/camcontrol.8 Fri Jul 19 18:47:13 2019 (r350148) +++ head/sbin/camcontrol/camcontrol.8 Fri Jul 19 19:15:08 2019 (r350149) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 22, 2019 +.Dd July 19, 2019 .Dt CAMCONTROL 8 .Os .Sh NAME @@ -292,6 +292,13 @@ .Op Fl U Ar pwd .Op Fl y .Nm +.Ic ama +.Op device id +.Op generic args +.Op Fl f +.Op Fl q +.Op Fl s Ar max_sectors +.Nm .Ic persist .Op device id .Op generic args @@ -1599,6 +1606,40 @@ without prompting for confirmation .Pp The password for all HPA commands is limited to 32 characters, longer passwords will fail. +.It Ic ama +Update or report Accessible Max Address Configuration. +By default +.Nm +will print out the Accessible Max Address Configuration support and associated +settings of the device. +The +.Ic ama +command takes several optional arguments: +.Bl -tag -width 0n +.It Fl f +.Pp +Freeze the Accessible Max Address Configuration of the specified device. +.Pp +After command completion any other commands that update the configuration +shall be command aborted. +Frozen mode is disabled by power-off. +.It Fl q +.Pp +Be quiet, do not print any status messages. +.It Fl s Ar max_sectors +.Pp +Configures the maximum user accessible sectors of the device. +This will change the number of sectors the device reports. +.Pp +.Em WARNING! WARNING! WARNING! +.Pp +Changing the max sectors of a device using this option will make the data on +the device beyond the specified value indeterminate. +.Pp +Only one successful +.Fl s Ar max_sectors +call can be made without a power-on reset of the device. +.El .It Ic fwdownload Program firmware of the named .Tn SCSI Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Fri Jul 19 18:47:13 2019 (r350148) +++ head/sbin/camcontrol/camcontrol.c Fri Jul 19 19:15:08 2019 (r350149) @@ -110,6 +110,7 @@ typedef enum { CAM_CMD_MMCSD_CMD = 0x00000029, CAM_CMD_POWER_MODE = 0x0000002a, CAM_CMD_DEVTYPE = 0x0000002b, + CAM_CMD_AMA = 0x0000002c, } cam_cmdmask; typedef enum { @@ -236,6 +237,7 @@ static struct camcontrol_opts option_table[] = { {"fwdownload", CAM_CMD_DOWNLOAD_FW, CAM_ARG_NONE, "f:qsy"}, {"security", CAM_CMD_SECURITY, CAM_ARG_NONE, "d:e:fh:k:l:qs:T:U:y"}, {"hpa", CAM_CMD_HPA, CAM_ARG_NONE, "Pflp:qs:U:y"}, + {"ama", CAM_CMD_AMA, CAM_ARG_NONE, "fqs:"}, {"persist", CAM_CMD_PERSIST, CAM_ARG_NONE, "ai:I:k:K:o:ps:ST:U"}, {"attrib", CAM_CMD_ATTRIB, CAM_ARG_NONE, "a:ce:F:p:r:s:T:w:V:"}, {"opcodes", CAM_CMD_OPCODES, CAM_ARG_NONE, "No:s:T"}, @@ -359,6 +361,8 @@ static int atasecurity(struct cam_device *device, int int argc, char **argv, char *combinedopt); static int atahpa(struct cam_device *device, int retry_count, int timeout, int argc, char **argv, char *combinedopt); +static int ataama(struct cam_device *device, int retry_count, int timeout, + int argc, char **argv, char *combinedopt); static int scsiprintoneopcode(struct cam_device *device, int req_opcode, int sa_set, int req_sa, uint8_t *buf, uint32_t valid_len); @@ -1423,8 +1427,9 @@ atahpa_print(struct ata_params *parm, u_int64_t hpasiz lba, hpasize); printf("HPA - Security "); - if (parm->support.command1 & ATA_SUPPORT_MAXSECURITY) - printf("yes\n"); + if (parm->support.command2 & ATA_SUPPORT_MAXSECURITY) + printf("yes %s\n", (parm->enabled.command2 & + ATA_SUPPORT_MAXSECURITY) ? "yes" : "no "); else printf("no\n"); } else { @@ -1432,6 +1437,32 @@ atahpa_print(struct ata_params *parm, u_int64_t hpasiz } } +static void +ataama_print(struct ata_params *parm, u_int64_t nativesize, int header) +{ + u_int32_t lbasize = (u_int32_t)parm->lba_size_1 | + ((u_int32_t)parm->lba_size_2 << 16); + + u_int64_t lbasize48 = ((u_int64_t)parm->lba_size48_1) | + ((u_int64_t)parm->lba_size48_2 << 16) | + ((u_int64_t)parm->lba_size48_3 << 32) | + ((u_int64_t)parm->lba_size48_4 << 48); + + if (header) { + printf("\nFeature " + "Support Enabled Value\n"); + } + + printf("Accessible Max Address Config "); + if (parm->support2 & ATA_SUPPORT_AMAX_ADDR) { + u_int64_t lba = lbasize48 ? lbasize48 : lbasize; + printf("yes %s %ju/%ju\n", + (nativesize > lba) ? "yes" : "no ", lba, nativesize); + } else { + printf("no\n"); + } +} + static int atasata(struct ata_params *parm) { @@ -2258,7 +2289,95 @@ atahpa_freeze_lock(struct cam_device *device, int retr return atahpa_proc_resp(device, ccb, is48bit, NULL); } +static int +ata_get_native_max(struct cam_device *device, int retry_count, + u_int32_t timeout, union ccb *ccb, + u_int64_t *nativesize) +{ + int error; + error = ata_do_cmd(device, + ccb, + retry_count, + /*flags*/CAM_DIR_NONE, + /*protocol*/AP_PROTO_NON_DATA | AP_EXTEND, + /*ata_flags*/AP_FLAG_CHK_COND, + /*tag_action*/MSG_SIMPLE_Q_TAG, + /*command*/ATA_AMAX_ADDR, + /*features*/ATA_AMAX_ADDR_GET, + /*lba*/0, + /*sector_count*/0, + /*data_ptr*/NULL, + /*dxfer_len*/0, + timeout ? timeout : 30 * 1000, + /*force48bit*/1); + + if (error) + return (error); + + return atahpa_proc_resp(device, ccb, /*is48bit*/1, nativesize); +} + +static int +ataama_set(struct cam_device *device, int retry_count, + u_int32_t timeout, union ccb *ccb, u_int64_t maxsize) +{ + int error; + + /* lba's are zero indexed so the max lba is requested max - 1 */ + if (maxsize) + maxsize--; + + error = ata_do_cmd(device, + ccb, + retry_count, + /*flags*/CAM_DIR_NONE, + /*protocol*/AP_PROTO_NON_DATA | AP_EXTEND, + /*ata_flags*/AP_FLAG_CHK_COND, + /*tag_action*/MSG_SIMPLE_Q_TAG, + /*command*/ATA_AMAX_ADDR, + /*features*/ATA_AMAX_ADDR_SET, + /*lba*/maxsize, + /*sector_count*/0, + /*data_ptr*/NULL, + /*dxfer_len*/0, + timeout ? timeout : 30 * 1000, + /*force48bit*/1); + + if (error) + return (error); + + return atahpa_proc_resp(device, ccb, /*is48bit*/1, NULL); +} + +static int +ataama_freeze(struct cam_device *device, int retry_count, + u_int32_t timeout, union ccb *ccb) +{ + int error; + + error = ata_do_cmd(device, + ccb, + retry_count, + /*flags*/CAM_DIR_NONE, + /*protocol*/AP_PROTO_NON_DATA | AP_EXTEND, + /*ata_flags*/AP_FLAG_CHK_COND, + /*tag_action*/MSG_SIMPLE_Q_TAG, + /*command*/ATA_AMAX_ADDR, + /*features*/ATA_AMAX_ADDR_FREEZE, + /*lba*/0, + /*sector_count*/0, + /*data_ptr*/NULL, + /*dxfer_len*/0, + timeout ? timeout : 30 * 1000, + /*force48bit*/1); + + if (error) + return (error); + + return atahpa_proc_resp(device, ccb, /*is48bit*/1, NULL); +} + int ata_do_identify(struct cam_device *device, int retry_count, int timeout, union ccb *ccb, struct ata_params** ident_bufp) @@ -2371,7 +2490,7 @@ ataidentify(struct cam_device *device, int retry_count { union ccb *ccb; struct ata_params *ident_buf; - u_int64_t hpasize; + u_int64_t hpasize, nativesize; if ((ccb = cam_getccb(device)) == NULL) { warnx("couldn't allocate CCB"); @@ -2392,12 +2511,22 @@ ataidentify(struct cam_device *device, int retry_count } else { hpasize = 0; } + if (ident_buf->support2 & ATA_SUPPORT_AMAX_ADDR) { + if (ata_get_native_max(device, retry_count, timeout, ccb, + &nativesize) != 0) { + cam_freeccb(ccb); + return (1); + } + } else { + nativesize = 0; + } printf("%s%d: ", device->device_name, device->dev_unit_num); ata_print_ident(ident_buf); camxferrate(device); atacapprint(ident_buf); atahpa_print(ident_buf, hpasize, 0); + ataama_print(ident_buf, nativesize, 0); free(ident_buf); cam_freeccb(ccb); @@ -2917,7 +3046,7 @@ atahpa(struct cam_device *device, int retry_count, int return (1); } - if (security && !(ident_buf->support.command1 & ATA_SUPPORT_MAXSECURITY)) { + if (security && !(ident_buf->support.command2 & ATA_SUPPORT_MAXSECURITY)) { warnx("HPA Security is not supported by this device"); cam_freeccb(ccb); free(ident_buf); @@ -2946,7 +3075,7 @@ atahpa(struct cam_device *device, int retry_count, int if (error == 0) { error = atahpa_set_max(device, retry_count, timeout, ccb, is48bit, maxsize, persist); - if (error == 0) { + if (error == 0 && quiet == 0) { /* redo identify to get new lba values */ error = ata_do_identify(device, retry_count, timeout, ccb, @@ -2959,28 +3088,28 @@ atahpa(struct cam_device *device, int retry_count, int case ATA_HPA_ACTION_SET_PWD: error = atahpa_password(device, retry_count, timeout, ccb, is48bit, &pwd); - if (error == 0) + if (error == 0 && quiet == 0) printf("HPA password has been set\n"); break; case ATA_HPA_ACTION_LOCK: error = atahpa_lock(device, retry_count, timeout, ccb, is48bit); - if (error == 0) + if (error == 0 && quiet == 0) printf("HPA has been locked\n"); break; case ATA_HPA_ACTION_UNLOCK: error = atahpa_unlock(device, retry_count, timeout, ccb, is48bit, &pwd); - if (error == 0) + if (error == 0 && quiet == 0) printf("HPA has been unlocked\n"); break; case ATA_HPA_ACTION_FREEZE_LOCK: error = atahpa_freeze_lock(device, retry_count, timeout, ccb, is48bit); - if (error == 0) + if (error == 0 && quiet == 0) printf("HPA has been frozen\n"); break; @@ -2994,7 +3123,128 @@ atahpa(struct cam_device *device, int retry_count, int return (error); } +enum { + ATA_AMA_ACTION_PRINT, + ATA_AMA_ACTION_SET_MAX, + ATA_AMA_ACTION_FREEZE_LOCK +}; + static int +ataama(struct cam_device *device, int retry_count, int timeout, + int argc, char **argv, char *combinedopt) +{ + union ccb *ccb; + struct ata_params *ident_buf; + struct ccb_getdev cgd; + int error, quiet, c, action, actions; + u_int64_t nativesize, maxsize; + + actions = 0; + quiet = 0; + maxsize = 0; + + /* default action is to print AMA information */ + action = ATA_AMA_ACTION_PRINT; + + while ((c = getopt(argc, argv, combinedopt)) != -1) { + switch(c){ + case 's': + action = ATA_AMA_ACTION_SET_MAX; + maxsize = strtoumax(optarg, NULL, 0); + actions++; + break; + + case 'f': + action = ATA_AMA_ACTION_FREEZE_LOCK; + actions++; + break; + + case 'q': + quiet++; + break; + } + } + + if (actions > 1) { + warnx("too many AMA actions specified"); + return (1); + } + + if (get_cgd(device, &cgd) != 0) { + warnx("couldn't get CGD"); + return (1); + } + + ccb = cam_getccb(device); + if (ccb == NULL) { + warnx("couldn't allocate CCB"); + return (1); + } + + error = ata_do_identify(device, retry_count, timeout, ccb, &ident_buf); + if (error != 0) { + cam_freeccb(ccb); + return (1); + } + + if (quiet == 0) { + printf("%s%d: ", device->device_name, device->dev_unit_num); + ata_print_ident(ident_buf); + camxferrate(device); + } + + if (action == ATA_AMA_ACTION_PRINT) { + error = ata_get_native_max(device, retry_count, timeout, ccb, + &nativesize); + if (error == 0) + ataama_print(ident_buf, nativesize, 1); + + cam_freeccb(ccb); + free(ident_buf); + return (error); + } + + if (!(ident_buf->support2 & ATA_SUPPORT_AMAX_ADDR)) { + warnx("Accessible Max Address is not supported by this device"); + cam_freeccb(ccb); + free(ident_buf); + return (1); + } + + switch(action) { + case ATA_AMA_ACTION_SET_MAX: + error = ata_get_native_max(device, retry_count, timeout, ccb, + &nativesize); + if (error == 0) { + error = ataama_set(device, retry_count, timeout, + ccb, maxsize); + if (error == 0 && quiet == 0) { + /* redo identify to get new lba values */ + error = ata_do_identify(device, retry_count, + timeout, ccb, &ident_buf); + ataama_print(ident_buf, nativesize, 1); + } + } + break; + + case ATA_AMA_ACTION_FREEZE_LOCK: + error = ataama_freeze(device, retry_count, timeout, + ccb); + if (error == 0 && quiet == 0) + printf("Accessible Max Address has been frozen\n"); + break; + + default: + errx(1, "Option currently not supported"); + } + + cam_freeccb(ccb); + free(ident_buf); + + return (error); +} + +static int atasecurity(struct cam_device *device, int retry_count, int timeout, int argc, char **argv, char *combinedopt) { @@ -9649,6 +9899,7 @@ usage(int printlong) " [-U ] [-y]\n" " camcontrol hpa [dev_id][generic args] [-f] [-l] [-P] [-p pwd]\n" " [-q] [-s max_sectors] [-U pwd] [-y]\n" +" camcontrol ama [dev_id][generic args] [-f] [-q] [-s max_sectors]\n" " camcontrol persist [dev_id][generic args] <-i action|-o action>\n" " [-a][-I tid][-k key][-K sa_key][-p][-R rtp]\n" " [-s scope][-S][-T type][-U]\n" @@ -9847,6 +10098,11 @@ usage(int printlong) " device\n" "-U pwd unlock the HPA configuration of the device\n" "-y don't ask any questions\n" +"ama arguments:\n" +"-f freeze the AMA configuration of the device\n" +"-q be quiet, do not print any status messages\n" +"-s sectors configures the maximum user accessible sectors of the\n" +" device\n" "persist arguments:\n" "-i action specify read_keys, read_reservation, report_cap, or\n" " read_full_status\n" @@ -10169,6 +10425,10 @@ main(int argc, char **argv) break; case CAM_CMD_HPA: error = atahpa(cam_dev, retry_count, timeout, + argc, argv, combinedopt); + break; + case CAM_CMD_AMA: + error = ataama(cam_dev, retry_count, timeout, argc, argv, combinedopt); break; case CAM_CMD_DEVTREE: Modified: head/sys/cam/ata/ata_all.c ============================================================================== --- head/sys/cam/ata/ata_all.c Fri Jul 19 18:47:13 2019 (r350148) +++ head/sys/cam/ata/ata_all.c Fri Jul 19 19:15:08 2019 (r350149) @@ -184,7 +184,13 @@ ata_op_string(struct ata_cmd *cmd) return ("SEP_ATTN"); case 0x70: return ("SEEK"); case 0x77: return ("SET_DATE_TIME_EXT"); - case 0x78: return ("ACCESSIBLE_MAX_ADDRESS_CONFIGURATION"); + case 0x78: + switch (cmd->features) { + case 0x00: return ("GET_NATIVE_MAX_ADDRESS_EXT"); + case 0x01: return ("SET_ACCESSIBLE_MAX_ADDRESS_EXT"); + case 0x02: return ("FREEZE_ACCESSIBLE_MAX_ADDRESS_EXT"); + } + return ("ACCESSIBLE_MAX_ADDRESS_CONFIGURATION"); case 0x7C: return ("REMOVE_ELEMENT_AND_TRUNCATE"); case 0x87: return ("CFA_TRANSLATE_SECTOR"); case 0x90: return ("EXECUTE_DEVICE_DIAGNOSTIC"); Modified: head/sys/sys/ata.h ============================================================================== --- head/sys/sys/ata.h Fri Jul 19 18:47:13 2019 (r350148) +++ head/sys/sys/ata.h Fri Jul 19 19:15:08 2019 (r350149) @@ -242,12 +242,15 @@ struct ata_params { #define ATA_SUPPORT_FREEFALL 0x0020 #define ATA_SUPPORT_SENSE_REPORT 0x0040 #define ATA_SUPPORT_EPC 0x0080 +#define ATA_SUPPORT_AMAX_ADDR 0x0100 +#define ATA_SUPPORT_DSN 0x0200 /*120*/ u_int16_t enabled2; #define ATA_ENABLED_WRITEREADVERIFY 0x0002 #define ATA_ENABLED_WRITEUNCORREXT 0x0004 #define ATA_ENABLED_FREEFALL 0x0020 #define ATA_ENABLED_SENSE_REPORT 0x0040 #define ATA_ENABLED_EPC 0x0080 +#define ATA_ENABLED_DSN 0x0200 u_int16_t reserved121[6]; /*127*/ u_int16_t removable_status; /*128*/ u_int16_t security_status; @@ -436,6 +439,10 @@ struct ata_params { #define ATA_RFPDMA_ZAC_MGMT_IN 0x02 /* NCQ ZAC mgmt in w/data */ #define ATA_SEP_ATTN 0x67 /* SEP request */ #define ATA_SEEK 0x70 /* seek */ +#define ATA_AMAX_ADDR 0x78 /* Accessible Max Address */ +#define ATA_AMAX_ADDR_GET 0x00 /* GET NATIVE MAX ADDRESS EXT */ +#define ATA_AMAX_ADDR_SET 0x01 /* SET ACCESSIBLE MAX ADDRESS EXT */ +#define ATA_AMAX_ADDR_FREEZE 0x02 /* FREEZE ACCESSIBLE MAX ADDRESS EXT */ #define ATA_ZAC_MANAGEMENT_OUT 0x9f /* ZAC management out */ #define ATA_ZM_CLOSE_ZONE 0x01 /* close zone */ #define ATA_ZM_FINISH_ZONE 0x02 /* finish zone */ From owner-svn-src-all@freebsd.org Fri Jul 19 20:02:01 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C1D2FAAABD; Fri, 19 Jul 2019 20:02:01 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A2F328442B; Fri, 19 Jul 2019 20:02:01 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7D9E1264B1; Fri, 19 Jul 2019 20:02:01 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6JK216q030047; Fri, 19 Jul 2019 20:02:01 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6JK21mn030046; Fri, 19 Jul 2019 20:02:01 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201907192002.x6JK21mn030046@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 19 Jul 2019 20:02:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350150 - head/sbin/camcontrol X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sbin/camcontrol X-SVN-Commit-Revision: 350150 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A2F328442B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jul 2019 20:02:01 -0000 Author: mav Date: Fri Jul 19 20:02:01 2019 New Revision: 350150 URL: https://svnweb.freebsd.org/changeset/base/350150 Log: Properly report ACS revisions alike to kernel. MFC after: 2 weeks Modified: head/sbin/camcontrol/camcontrol.c Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Fri Jul 19 19:15:08 2019 (r350149) +++ head/sbin/camcontrol/camcontrol.c Fri Jul 19 20:02:01 2019 (r350150) @@ -1478,6 +1478,7 @@ atasata(struct ata_params *parm) static void atacapprint(struct ata_params *parm) { + const char *proto; u_int32_t lbasize = (u_int32_t)parm->lba_size_1 | ((u_int32_t)parm->lba_size_2 << 16); @@ -1488,7 +1489,19 @@ atacapprint(struct ata_params *parm) printf("\n"); printf("protocol "); - printf("ATA/ATAPI-%d", ata_version(parm->version_major)); + proto = (parm->config == ATA_PROTO_CFA) ? "CFA" : + (parm->config & ATA_PROTO_ATAPI) ? "ATAPI" : "ATA"; + if (ata_version(parm->version_major) == 0) { + printf("%s", proto); + } else if (ata_version(parm->version_major) <= 7) { + printf("%s-%d", proto, + ata_version(parm->version_major)); + } else if (ata_version(parm->version_major) == 8) { + printf("%s8-ACS", proto); + } else { + printf("ACS-%d %s", + ata_version(parm->version_major) - 7, proto); + } if (parm->satacapabilities && parm->satacapabilities != 0xffff) { if (parm->satacapabilities & ATA_SATA_GEN3) printf(" SATA 3.x\n"); From owner-svn-src-all@freebsd.org Fri Jul 19 20:04:14 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 24722AAB52; Fri, 19 Jul 2019 20:04:14 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0649D8460D; Fri, 19 Jul 2019 20:04:14 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D3367264E5; Fri, 19 Jul 2019 20:04:13 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6JK4DYA030174; Fri, 19 Jul 2019 20:04:13 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6JK4D2Y030173; Fri, 19 Jul 2019 20:04:13 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201907192004.x6JK4D2Y030173@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 19 Jul 2019 20:04:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350151 - head/sbin/ifconfig X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sbin/ifconfig X-SVN-Commit-Revision: 350151 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0649D8460D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jul 2019 20:04:14 -0000 Author: imp Date: Fri Jul 19 20:04:13 2019 New Revision: 350151 URL: https://svnweb.freebsd.org/changeset/base/350151 Log: Remove RELEASE_CRUNCH RELEASE_CRUNCH isn't used for releases any more. If someone wants to subset, then they can set MK_JAIL=no instead. Modified: head/sbin/ifconfig/Makefile Modified: head/sbin/ifconfig/Makefile ============================================================================== --- head/sbin/ifconfig/Makefile Fri Jul 19 20:02:01 2019 (r350150) +++ head/sbin/ifconfig/Makefile Fri Jul 19 20:04:13 2019 (r350151) @@ -63,7 +63,7 @@ CFLAGS+= -DINET6 .if ${MK_INET_SUPPORT} != "no" CFLAGS+= -DINET .endif -.if ${MK_JAIL} != "no" && !defined(RELEASE_CRUNCH) && !defined(RESCUE) +.if ${MK_JAIL} != "no" && !defined(RESCUE) CFLAGS+= -DJAIL LIBADD+= jail .endif From owner-svn-src-all@freebsd.org Fri Jul 19 20:04:30 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 39133AAB72; Fri, 19 Jul 2019 20:04:30 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A916F84703; Fri, 19 Jul 2019 20:04:27 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 43E6C264E6; Fri, 19 Jul 2019 20:04:22 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6JK4Mgx030233; Fri, 19 Jul 2019 20:04:22 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6JK4MCV030232; Fri, 19 Jul 2019 20:04:22 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201907192004.x6JK4MCV030232@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 19 Jul 2019 20:04:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350152 - head/usr.sbin/crunch/crunchgen X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/usr.sbin/crunch/crunchgen X-SVN-Commit-Revision: 350152 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A916F84703 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jul 2019 20:04:30 -0000 Author: imp Date: Fri Jul 19 20:04:21 2019 New Revision: 350152 URL: https://svnweb.freebsd.org/changeset/base/350152 Log: Remove obsolete RELEASE_CRUNCH Remove documentation of RELEASE_CRUNCH here. It's obsolete and no longer a good example. Modified: head/usr.sbin/crunch/crunchgen/crunchgen.1 Modified: head/usr.sbin/crunch/crunchgen/crunchgen.1 ============================================================================== --- head/usr.sbin/crunch/crunchgen/crunchgen.1 Fri Jul 19 20:04:13 2019 (r350151) +++ head/usr.sbin/crunch/crunchgen/crunchgen.1 Fri Jul 19 20:04:21 2019 (r350152) @@ -137,9 +137,7 @@ Set the name of a file to be included at the beginning .Pa Makefile Ns s generated by .Nm . -This is useful to define some make variables such as -.Va RELEASE_CRUNCH -or similar, which might affect the behavior of +This is useful to define some make variables which might affect the behavior of .Xr make 1 and are annoying to pass through environment variables. .It Fl m Ar makefile-name From owner-svn-src-all@freebsd.org Fri Jul 19 20:04:30 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5BC90AAB77; Fri, 19 Jul 2019 20:04:30 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2405B8473A; Fri, 19 Jul 2019 20:04:30 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 29C8C264E7; Fri, 19 Jul 2019 20:04:27 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6JK4Qk3030287; Fri, 19 Jul 2019 20:04:26 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6JK4QDT030286; Fri, 19 Jul 2019 20:04:26 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201907192004.x6JK4QDT030286@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 19 Jul 2019 20:04:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350153 - head/share/man/man8 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/share/man/man8 X-SVN-Commit-Revision: 350153 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2405B8473A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jul 2019 20:04:30 -0000 Author: imp Date: Fri Jul 19 20:04:26 2019 New Revision: 350153 URL: https://svnweb.freebsd.org/changeset/base/350153 Log: Remove RELEASE_CRUNCH in example RELEASE_CRUNCH is no longer relevant. Modified: head/share/man/man8/picobsd.8 Modified: head/share/man/man8/picobsd.8 ============================================================================== --- head/share/man/man8/picobsd.8 Fri Jul 19 20:04:21 2019 (r350152) +++ head/share/man/man8/picobsd.8 Fri Jul 19 20:04:26 2019 (r350153) @@ -267,7 +267,7 @@ We can pass build options to those makefiles which und that, in order to reduce the size of the programs. This is achieved with a line of the form .Pp -.Dl "buildopts -DNO_PAM -DRELEASE_CRUNCH ..." +.Dl "buildopts -DNO_PAM ..." .It When providing the list of directories where source files are, it is convenient to list the following entry first: From owner-svn-src-all@freebsd.org Fri Jul 19 20:04:43 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 22ED9AABBD; Fri, 19 Jul 2019 20:04:43 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 10CAA84752; Fri, 19 Jul 2019 20:04:32 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BDF7C264E8; Fri, 19 Jul 2019 20:04:31 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6JK4VD2030339; Fri, 19 Jul 2019 20:04:31 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6JK4VbR030338; Fri, 19 Jul 2019 20:04:31 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201907192004.x6JK4VbR030338@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 19 Jul 2019 20:04:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350154 - head/usr.bin/vi X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/usr.bin/vi X-SVN-Commit-Revision: 350154 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 10CAA84752 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jul 2019 20:04:43 -0000 Author: imp Date: Fri Jul 19 20:04:31 2019 New Revision: 350154 URL: https://svnweb.freebsd.org/changeset/base/350154 Log: Remove RELEASE_CRUNCH here If someone wants to subset, they can set MK_ICONV=no. We no longer use it for the release. Modified: head/usr.bin/vi/Makefile Modified: head/usr.bin/vi/Makefile ============================================================================== --- head/usr.bin/vi/Makefile Fri Jul 19 20:04:26 2019 (r350153) +++ head/usr.bin/vi/Makefile Fri Jul 19 20:04:31 2019 (r350154) @@ -37,7 +37,7 @@ CFLAGS+=-I${.CURDIR} -I${SRCDIR} -I${SRCDIR}/regex LIBADD= util ncursesw CFLAGS+= -DUSE_WIDECHAR -.if ${MK_ICONV} == "yes" && !defined(RESCUE) && !defined(RELEASE_CRUNCH) +.if ${MK_ICONV} == "yes" && !defined(RESCUE) CFLAGS+= -DUSE_ICONV .endif From owner-svn-src-all@freebsd.org Fri Jul 19 20:47:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 13895AB743; Fri, 19 Jul 2019 20:47:36 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E629885A28; Fri, 19 Jul 2019 20:47:35 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BC14126C4C; Fri, 19 Jul 2019 20:47:35 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6JKlZHa053731; Fri, 19 Jul 2019 20:47:35 GMT (envelope-from dougm@FreeBSD.org) Received: (from dougm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6JKlZru053730; Fri, 19 Jul 2019 20:47:35 GMT (envelope-from dougm@FreeBSD.org) Message-Id: <201907192047.x6JKlZru053730@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dougm set sender to dougm@FreeBSD.org using -f From: Doug Moore Date: Fri, 19 Jul 2019 20:47:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350155 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: dougm X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 350155 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E629885A28 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jul 2019 20:47:36 -0000 Author: dougm Date: Fri Jul 19 20:47:35 2019 New Revision: 350155 URL: https://svnweb.freebsd.org/changeset/base/350155 Log: Define vm_map_entry_in_transition to handle an in-transition map entry, combining code currently in vm_map_unwire and vm_map_wire_locked into a single function, called by each of them for entries in transition. Discussed with: kib, markj Reviewed by: alc Approved by: kib, markj (mentors, implicit) Tested by: pho Differential Revision: https://reviews.freebsd.org/D20833 Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Fri Jul 19 20:04:31 2019 (r350154) +++ head/sys/vm/vm_map.c Fri Jul 19 20:47:35 2019 (r350155) @@ -2837,6 +2837,55 @@ vm_map_inherit(vm_map_t map, vm_offset_t start, vm_off } /* + * vm_map_entry_in_transition: + * + * Release the map lock, and sleep until the entry is no longer in + * transition. Awake and acquire the map lock. If the map changed while + * another held the lock, lookup a possibly-changed entry at or after the + * 'start' position of the old entry. + */ +static vm_map_entry_t +vm_map_entry_in_transition(vm_map_t map, vm_offset_t in_start, + vm_offset_t *io_end, bool holes_ok, vm_map_entry_t in_entry) +{ + vm_map_entry_t entry; + vm_offset_t start; + u_int last_timestamp; + + VM_MAP_ASSERT_LOCKED(map); + KASSERT((in_entry->eflags & MAP_ENTRY_IN_TRANSITION) != 0, + ("not in-tranition map entry %p", in_entry)); + /* + * We have not yet clipped the entry. + */ + start = MAX(in_start, in_entry->start); + in_entry->eflags |= MAP_ENTRY_NEEDS_WAKEUP; + last_timestamp = map->timestamp; + if (vm_map_unlock_and_wait(map, 0)) { + /* + * Allow interruption of user wiring/unwiring? + */ + } + vm_map_lock(map); + if (last_timestamp + 1 == map->timestamp) + return (in_entry); + + /* + * Look again for the entry because the map was modified while it was + * unlocked. Specifically, the entry may have been clipped, merged, or + * deleted. + */ + if (!vm_map_lookup_entry(map, start, &entry)) { + if (!holes_ok) { + *io_end = start; + return (NULL); + } + entry = entry->next; + } + return (entry); +} + +/* * vm_map_unwire: * * Implements both kernel and user unwiring. @@ -2845,11 +2894,9 @@ int vm_map_unwire(vm_map_t map, vm_offset_t start, vm_offset_t end, int flags) { - vm_map_entry_t entry, first_entry, tmp_entry; - vm_offset_t saved_start; - unsigned int last_timestamp; + vm_map_entry_t entry, first_entry; int rv; - bool holes_ok, need_wakeup, user_unwire; + bool first_iteration, holes_ok, need_wakeup, user_unwire; if (start == end) return (KERN_SUCCESS); @@ -2865,7 +2912,7 @@ vm_map_unwire(vm_map_t map, vm_offset_t start, vm_offs return (KERN_INVALID_ADDRESS); } } - last_timestamp = map->timestamp; + first_iteration = true; entry = first_entry; rv = KERN_SUCCESS; while (entry->start < end) { @@ -2873,48 +2920,20 @@ vm_map_unwire(vm_map_t map, vm_offset_t start, vm_offs /* * We have not yet clipped the entry. */ - saved_start = (start >= entry->start) ? start : - entry->start; - entry->eflags |= MAP_ENTRY_NEEDS_WAKEUP; - if (vm_map_unlock_and_wait(map, 0)) { - /* - * Allow interruption of user unwiring? - */ - } - vm_map_lock(map); - if (last_timestamp+1 != map->timestamp) { - /* - * Look again for the entry because the map was - * modified while it was unlocked. - * Specifically, the entry may have been - * clipped, merged, or deleted. - */ - if (!vm_map_lookup_entry(map, saved_start, - &tmp_entry)) { - if (holes_ok) - tmp_entry = tmp_entry->next; - else { - if (saved_start == start) { - /* - * First_entry has been deleted. - */ - vm_map_unlock(map); - return (KERN_INVALID_ADDRESS); - } - end = saved_start; - rv = KERN_INVALID_ADDRESS; - break; - } + entry = vm_map_entry_in_transition(map, start, &end, + holes_ok, entry); + if (entry == NULL) { + if (first_iteration) { + vm_map_unlock(map); + return (KERN_INVALID_ADDRESS); } - if (entry == first_entry) - first_entry = tmp_entry; - else - first_entry = NULL; - entry = tmp_entry; + rv = KERN_INVALID_ADDRESS; + break; } - last_timestamp = map->timestamp; + first_entry = first_iteration ? entry : NULL; continue; } + first_iteration = false; vm_map_clip_start(map, entry, start); vm_map_clip_end(map, entry, end); /* @@ -3081,7 +3100,7 @@ vm_map_wire_locked(vm_map_t map, vm_offset_t start, vm u_long npages; u_int last_timestamp; int rv; - bool holes_ok, need_wakeup, user_wire; + bool first_iteration, holes_ok, need_wakeup, user_wire; vm_prot_t prot; VM_MAP_ASSERT_LOCKED(map); @@ -3100,54 +3119,25 @@ vm_map_wire_locked(vm_map_t map, vm_offset_t start, vm else return (KERN_INVALID_ADDRESS); } - last_timestamp = map->timestamp; + first_iteration = true; entry = first_entry; while (entry->start < end) { if (entry->eflags & MAP_ENTRY_IN_TRANSITION) { /* * We have not yet clipped the entry. */ - saved_start = (start >= entry->start) ? start : - entry->start; - entry->eflags |= MAP_ENTRY_NEEDS_WAKEUP; - if (vm_map_unlock_and_wait(map, 0)) { - /* - * Allow interruption of user wiring? - */ + entry = vm_map_entry_in_transition(map, start, &end, + holes_ok, entry); + if (entry == NULL) { + if (first_iteration) + return (KERN_INVALID_ADDRESS); + rv = KERN_INVALID_ADDRESS; + goto done; } - vm_map_lock(map); - if (last_timestamp + 1 != map->timestamp) { - /* - * Look again for the entry because the map was - * modified while it was unlocked. - * Specifically, the entry may have been - * clipped, merged, or deleted. - */ - if (!vm_map_lookup_entry(map, saved_start, - &tmp_entry)) { - if (holes_ok) - tmp_entry = tmp_entry->next; - else { - if (saved_start == start) { - /* - * first_entry has been deleted. - */ - return (KERN_INVALID_ADDRESS); - } - end = saved_start; - rv = KERN_INVALID_ADDRESS; - goto done; - } - } - if (entry == first_entry) - first_entry = tmp_entry; - else - first_entry = NULL; - entry = tmp_entry; - } - last_timestamp = map->timestamp; + first_entry = first_iteration ? entry : NULL; continue; } + first_iteration = false; vm_map_clip_start(map, entry, start); vm_map_clip_end(map, entry, end); /* @@ -3185,6 +3175,7 @@ vm_map_wire_locked(vm_map_t map, vm_offset_t start, vm */ saved_start = entry->start; saved_end = entry->end; + last_timestamp = map->timestamp; vm_map_busy(map); vm_map_unlock(map); @@ -3230,7 +3221,6 @@ vm_map_wire_locked(vm_map_t map, vm_offset_t start, vm entry = entry->next; } } - last_timestamp = map->timestamp; if (rv != KERN_SUCCESS) { vm_map_wire_entry_failure(map, entry, faddr); if (user_wire) From owner-svn-src-all@freebsd.org Fri Jul 19 20:51:40 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 32F91AB93D; Fri, 19 Jul 2019 20:51:40 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 158C185CD4; Fri, 19 Jul 2019 20:51:40 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CDFC126CC6; Fri, 19 Jul 2019 20:51:39 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6JKpdeR057734; Fri, 19 Jul 2019 20:51:39 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6JKpdhI057733; Fri, 19 Jul 2019 20:51:39 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201907192051.x6JKpdhI057733@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 19 Jul 2019 20:51:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350156 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 350156 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 158C185CD4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jul 2019 20:51:40 -0000 Author: kib Date: Fri Jul 19 20:51:39 2019 New Revision: 350156 URL: https://svnweb.freebsd.org/changeset/base/350156 Log: Fix leak of memory and file refs with sendmsg(2) over unix domain sockets. When sendmsg(2) sucessfully internalized one SCM_RIGHTS control message, but failed to process some other control message later, both file references and filedescent memory needs to be freed. This was not done, only mbuf chain was freed. Noted, test case written, reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D21000 Modified: head/sys/kern/uipc_usrreq.c Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Fri Jul 19 20:47:35 2019 (r350155) +++ head/sys/kern/uipc_usrreq.c Fri Jul 19 20:51:39 2019 (r350156) @@ -2120,30 +2120,53 @@ unp_init(void) UNP_DEFERRED_LOCK_INIT(); } +static void +unp_internalize_cleanup_rights(struct mbuf *control) +{ + struct cmsghdr *cp; + struct mbuf *m; + void *data; + socklen_t datalen; + + for (m = control; m != NULL; m = m->m_next) { + cp = mtod(m, struct cmsghdr *); + if (cp->cmsg_level != SOL_SOCKET || + cp->cmsg_type != SCM_RIGHTS) + continue; + data = CMSG_DATA(cp); + datalen = (caddr_t)cp + cp->cmsg_len - (caddr_t)data; + unp_freerights(data, datalen / sizeof(struct filedesc *)); + } +} + static int unp_internalize(struct mbuf **controlp, struct thread *td) { - struct mbuf *control = *controlp; - struct proc *p = td->td_proc; - struct filedesc *fdesc = p->p_fd; + struct mbuf *control, **initial_controlp; + struct proc *p; + struct filedesc *fdesc; struct bintime *bt; - struct cmsghdr *cm = mtod(control, struct cmsghdr *); + struct cmsghdr *cm; struct cmsgcred *cmcred; struct filedescent *fde, **fdep, *fdev; struct file *fp; struct timeval *tv; struct timespec *ts; - int i, *fdp; void *data; - socklen_t clen = control->m_len, datalen; - int error, oldfds; + socklen_t clen, datalen; + int i, error, *fdp, oldfds; u_int newlen; UNP_LINK_UNLOCK_ASSERT(); + p = td->td_proc; + fdesc = p->p_fd; error = 0; + control = *controlp; + clen = control->m_len; *controlp = NULL; - while (cm != NULL) { + initial_controlp = controlp; + for (cm = mtod(control, struct cmsghdr *); cm != NULL;) { if (sizeof(*cm) > clen || cm->cmsg_level != SOL_SOCKET || cm->cmsg_len > clen || cm->cmsg_len < sizeof(*cm)) { error = EINVAL; @@ -2294,6 +2317,8 @@ unp_internalize(struct mbuf **controlp, struct thread } out: + if (error != 0 && initial_controlp != NULL) + unp_internalize_cleanup_rights(*initial_controlp); m_freem(control); return (error); } From owner-svn-src-all@freebsd.org Fri Jul 19 22:54:10 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D6A1DADCB2; Fri, 19 Jul 2019 22:54:10 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B8DEE89762; Fri, 19 Jul 2019 22:54:10 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9471856D; Fri, 19 Jul 2019 22:54:10 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6JMsAoI029702; Fri, 19 Jul 2019 22:54:10 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6JMsAsH029701; Fri, 19 Jul 2019 22:54:10 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201907192254.x6JMsAsH029701@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 19 Jul 2019 22:54:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350157 - head/lib/libgssapi X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/lib/libgssapi X-SVN-Commit-Revision: 350157 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B8DEE89762 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jul 2019 22:54:10 -0000 Author: brooks Date: Fri Jul 19 22:54:09 2019 New Revision: 350157 URL: https://svnweb.freebsd.org/changeset/base/350157 Log: Use the __DECONST macro rather than hand rolling it. Obtained from: CheriBSD MFC after: 1 week Sponsored by: DARPA, AFRL Modified: head/lib/libgssapi/gss_accept_sec_context.c head/lib/libgssapi/gss_names.c Modified: head/lib/libgssapi/gss_accept_sec_context.c ============================================================================== --- head/lib/libgssapi/gss_accept_sec_context.c Fri Jul 19 20:51:39 2019 (r350156) +++ head/lib/libgssapi/gss_accept_sec_context.c Fri Jul 19 22:54:09 2019 (r350157) @@ -100,11 +100,11 @@ parse_header(const gss_buffer_t input_token, gss_OID m } static gss_OID_desc krb5_mechanism = -{9, (void *)(uintptr_t) "\x2a\x86\x48\x86\xf7\x12\x01\x02\x02"}; +{9, __DECONST(void *, "\x2a\x86\x48\x86\xf7\x12\x01\x02\x02")}; static gss_OID_desc ntlm_mechanism = -{10, (void *)(uintptr_t) "\x2b\x06\x01\x04\x01\x82\x37\x02\x02\x0a"}; +{10, __DECONST(void *, "\x2b\x06\x01\x04\x01\x82\x37\x02\x02\x0a")}; static gss_OID_desc spnego_mechanism = -{6, (void *)(uintptr_t) "\x2b\x06\x01\x05\x05\x02"}; +{6, __DECONST(void *, "\x2b\x06\x01\x05\x05\x02")}; static OM_uint32 choose_mech(const gss_buffer_t input, gss_OID mech_oid) Modified: head/lib/libgssapi/gss_names.c ============================================================================== --- head/lib/libgssapi/gss_names.c Fri Jul 19 20:51:39 2019 (r350156) +++ head/lib/libgssapi/gss_names.c Fri Jul 19 22:54:09 2019 (r350157) @@ -49,7 +49,7 @@ * to that gss_OID_desc. */ static gss_OID_desc GSS_C_NT_USER_NAME_storage = - {10, (void *)(uintptr_t)"\x2a\x86\x48\x86\xf7\x12\x01\x02\x01\x01"}; + {10, __DECONST(void *, "\x2a\x86\x48\x86\xf7\x12\x01\x02\x01\x01")}; gss_OID GSS_C_NT_USER_NAME = &GSS_C_NT_USER_NAME_storage; /* @@ -64,7 +64,7 @@ gss_OID GSS_C_NT_USER_NAME = &GSS_C_NT_USER_NAME_stora * initialized to point to that gss_OID_desc. */ static gss_OID_desc GSS_C_NT_MACHINE_UID_NAME_storage = - {10, (void *)(uintptr_t)"\x2a\x86\x48\x86\xf7\x12\x01\x02\x01\x02"}; + {10, __DECONST(void *, "\x2a\x86\x48\x86\xf7\x12\x01\x02\x01\x02")}; gss_OID GSS_C_NT_MACHINE_UID_NAME = &GSS_C_NT_MACHINE_UID_NAME_storage; /* @@ -79,7 +79,7 @@ gss_OID GSS_C_NT_MACHINE_UID_NAME = &GSS_C_NT_MACHINE_ * initialized to point to that gss_OID_desc. */ static gss_OID_desc GSS_C_NT_STRING_UID_NAME_storage = - {10, (void *)(uintptr_t)"\x2a\x86\x48\x86\xf7\x12\x01\x02\x01\x03"}; + {10, __DECONST(void *, "\x2a\x86\x48\x86\xf7\x12\x01\x02\x01\x03")}; gss_OID GSS_C_NT_STRING_UID_NAME = &GSS_C_NT_STRING_UID_NAME_storage; /* @@ -100,7 +100,7 @@ gss_OID GSS_C_NT_STRING_UID_NAME = &GSS_C_NT_STRING_UI * implementations */ static gss_OID_desc GSS_C_NT_HOSTBASED_SERVICE_X_storage = - {6, (void *)(uintptr_t)"\x2b\x06\x01\x05\x06\x02"}; + {6, __DECONST(void *, "\x2b\x06\x01\x05\x06\x02")}; gss_OID GSS_C_NT_HOSTBASED_SERVICE_X = &GSS_C_NT_HOSTBASED_SERVICE_X_storage; /* @@ -115,7 +115,7 @@ gss_OID GSS_C_NT_HOSTBASED_SERVICE_X = &GSS_C_NT_HOSTB * to point to that gss_OID_desc. */ static gss_OID_desc GSS_C_NT_HOSTBASED_SERVICE_storage = - {10, (void *)(uintptr_t)"\x2a\x86\x48\x86\xf7\x12\x01\x02\x01\x04"}; + {10, __DECONST(void *, "\x2a\x86\x48\x86\xf7\x12\x01\x02\x01\x04")}; gss_OID GSS_C_NT_HOSTBASED_SERVICE = &GSS_C_NT_HOSTBASED_SERVICE_storage; /* @@ -129,7 +129,7 @@ gss_OID GSS_C_NT_HOSTBASED_SERVICE = &GSS_C_NT_HOSTBAS * to that gss_OID_desc. */ static gss_OID_desc GSS_C_NT_ANONYMOUS_storage = - {6, (void *)(uintptr_t)"\x2b\x06\01\x05\x06\x03"}; + {6, __DECONST(void *, "\x2b\x06\01\x05\x06\x03")}; gss_OID GSS_C_NT_ANONYMOUS = &GSS_C_NT_ANONYMOUS_storage; /* @@ -143,7 +143,7 @@ gss_OID GSS_C_NT_ANONYMOUS = &GSS_C_NT_ANONYMOUS_stora * to that gss_OID_desc. */ static gss_OID_desc GSS_C_NT_EXPORT_NAME_storage = - {6, (void *)(uintptr_t)"\x2b\x06\x01\x05\x06\x04"}; + {6, __DECONST(void *, "\x2b\x06\x01\x05\x06\x04")}; gss_OID GSS_C_NT_EXPORT_NAME = &GSS_C_NT_EXPORT_NAME_storage; /* @@ -153,7 +153,7 @@ gss_OID GSS_C_NT_EXPORT_NAME = &GSS_C_NT_EXPORT_NAME_s * is "GSS_KRB5_NT_PRINCIPAL_NAME". */ static gss_OID_desc GSS_KRB5_NT_PRINCIPAL_NAME_storage = - {10, (void *)(uintptr_t)"\x2a\x86\x48\x86\xf7\x12\x01\x02\x02\x01"}; + {10, __DECONST(void *, "\x2a\x86\x48\x86\xf7\x12\x01\x02\x02\x01")}; gss_OID GSS_KRB5_NT_PRINCIPAL_NAME = &GSS_KRB5_NT_PRINCIPAL_NAME_storage; /* From owner-svn-src-all@freebsd.org Fri Jul 19 23:10:43 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C0F5BAE43A; Fri, 19 Jul 2019 23:10:43 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A16428AE41; Fri, 19 Jul 2019 23:10:43 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7C95676A; Fri, 19 Jul 2019 23:10:43 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6JNAhIu036590; Fri, 19 Jul 2019 23:10:43 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6JNAhK5036589; Fri, 19 Jul 2019 23:10:43 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201907192310.x6JNAhK5036589@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 19 Jul 2019 23:10:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350158 - head/lib/libproc X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/lib/libproc X-SVN-Commit-Revision: 350158 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A16428AE41 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jul 2019 23:10:43 -0000 Author: brooks Date: Fri Jul 19 23:10:43 2019 New Revision: 350158 URL: https://svnweb.freebsd.org/changeset/base/350158 Log: Remove an unneeded temporary variable in two functions. There is no need to convert an intptr_t to a long just to cast it to a (void *). Obtained from: CheriBSD MFC after: 1 week Sponsored by: DARPA, AFRL Modified: head/lib/libproc/proc_bkpt.c Modified: head/lib/libproc/proc_bkpt.c ============================================================================== --- head/lib/libproc/proc_bkpt.c Fri Jul 19 22:54:09 2019 (r350157) +++ head/lib/libproc/proc_bkpt.c Fri Jul 19 23:10:43 2019 (r350158) @@ -102,7 +102,6 @@ proc_bkptset(struct proc_handle *phdl, uintptr_t addre unsigned long *saved) { struct ptrace_io_desc piod; - unsigned long caddr; int ret = 0, stopped; instr_t instr; @@ -125,10 +124,9 @@ proc_bkptset(struct proc_handle *phdl, uintptr_t addre /* * Read the original instruction. */ - caddr = address; instr = 0; piod.piod_op = PIOD_READ_I; - piod.piod_offs = (void *)caddr; + piod.piod_offs = (void *)address; piod.piod_addr = &instr; piod.piod_len = BREAKPOINT_INSTR_SZ; if (ptrace(PT_IO, proc_getpid(phdl), (caddr_t)&piod, 0) < 0) { @@ -141,10 +139,9 @@ proc_bkptset(struct proc_handle *phdl, uintptr_t addre /* * Write a breakpoint instruction to that address. */ - caddr = address; instr = BREAKPOINT_INSTR; piod.piod_op = PIOD_WRITE_I; - piod.piod_offs = (void *)caddr; + piod.piod_offs = (void *)address; piod.piod_addr = &instr; piod.piod_len = BREAKPOINT_INSTR_SZ; if (ptrace(PT_IO, proc_getpid(phdl), (caddr_t)&piod, 0) < 0) { @@ -167,7 +164,6 @@ proc_bkptdel(struct proc_handle *phdl, uintptr_t addre unsigned long saved) { struct ptrace_io_desc piod; - unsigned long caddr; int ret = 0, stopped; instr_t instr; @@ -189,10 +185,9 @@ proc_bkptdel(struct proc_handle *phdl, uintptr_t addre /* * Overwrite the breakpoint instruction that we setup previously. */ - caddr = address; instr = saved; piod.piod_op = PIOD_WRITE_I; - piod.piod_offs = (void *)caddr; + piod.piod_offs = (void *)address; piod.piod_addr = &instr; piod.piod_len = BREAKPOINT_INSTR_SZ; if (ptrace(PT_IO, proc_getpid(phdl), (caddr_t)&piod, 0) < 0) { From owner-svn-src-all@freebsd.org Fri Jul 19 23:39:22 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 67C7DAEBE1; Fri, 19 Jul 2019 23:39:22 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 408E28BCD8; Fri, 19 Jul 2019 23:39:22 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 15B90D15; Fri, 19 Jul 2019 23:39:22 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6JNdLco053494; Fri, 19 Jul 2019 23:39:21 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6JNdLCQ053493; Fri, 19 Jul 2019 23:39:21 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201907192339.x6JNdLCQ053493@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 19 Jul 2019 23:39:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350159 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 350159 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 408E28BCD8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jul 2019 23:39:22 -0000 Author: brooks Date: Fri Jul 19 23:39:21 2019 New Revision: 350159 URL: https://svnweb.freebsd.org/changeset/base/350159 Log: Make setting mips endian and ABI less verbose. Allow ABI to be over ridden to allow (with other changes) programs to be built targeting ABIs other than the default. This is used in CheriBSD. Reviewed by: imp Obtained from: CheriBSD MFC after: 1 week Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D21001 Modified: head/share/mk/bsd.cpu.mk Modified: head/share/mk/bsd.cpu.mk ============================================================================== --- head/share/mk/bsd.cpu.mk Fri Jul 19 23:10:43 2019 (r350158) +++ head/share/mk/bsd.cpu.mk Fri Jul 19 23:39:21 2019 (r350159) @@ -314,27 +314,20 @@ MACHINE_CPU = v9 ultrasparc ultrasparc3 .if ${MACHINE_CPUARCH} == "mips" CFLAGS += -G0 +AFLAGS+= -${MIPS_ENDIAN} -mabi=${MIPS_ABI} +CFLAGS+= -${MIPS_ENDIAN} -mabi=${MIPS_ABI} +LDFLAGS+= -${MIPS_ENDIAN} -mabi=${MIPS_ABI} . if ${MACHINE_ARCH:Mmips*el*} != "" -AFLAGS += -EL -CFLAGS += -EL -LDFLAGS += -EL +MIPS_ENDIAN= EL . else -AFLAGS += -EB -CFLAGS += -EB -LDFLAGS += -EB +MIPS_ENDIAN= EB . endif . if ${MACHINE_ARCH:Mmips64*} != "" -AFLAGS+= -mabi=64 -CFLAGS+= -mabi=64 -LDFLAGS+= -mabi=64 +MIPS_ABI?= 64 . elif ${MACHINE_ARCH:Mmipsn32*} != "" -AFLAGS+= -mabi=n32 -CFLAGS+= -mabi=n32 -LDFLAGS+= -mabi=n32 +MIPS_ABI?= n32 . else -AFLAGS+= -mabi=32 -CFLAGS+= -mabi=32 -LDFLAGS+= -mabi=32 +MIPS_ABI?= 32 . endif . if ${MACHINE_ARCH:Mmips*hf} CFLAGS += -mhard-float From owner-svn-src-all@freebsd.org Fri Jul 19 23:58:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 68C3EAF3B0; Fri, 19 Jul 2019 23:58:31 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4AC4E8C610; Fri, 19 Jul 2019 23:58:31 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 21A0310FC; Fri, 19 Jul 2019 23:58:31 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6JNwUvU065040; Fri, 19 Jul 2019 23:58:30 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6JNwUhY065039; Fri, 19 Jul 2019 23:58:30 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201907192358.x6JNwUhY065039@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 19 Jul 2019 23:58:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350160 - head/lib/libc/tests/string X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/lib/libc/tests/string X-SVN-Commit-Revision: 350160 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4AC4E8C610 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jul 2019 23:58:31 -0000 Author: brooks Date: Fri Jul 19 23:58:30 2019 New Revision: 350160 URL: https://svnweb.freebsd.org/changeset/base/350160 Log: Avoid copying too much from the input string. This avoids reading past the end of the static strings. On a system with bounds checking these tests fault. Reviewed by: asomers Obtained from: CheriBSD MFC after: 1 week Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D21004 Modified: head/lib/libc/tests/string/wcsnlen_test.c Modified: head/lib/libc/tests/string/wcsnlen_test.c ============================================================================== --- head/lib/libc/tests/string/wcsnlen_test.c Fri Jul 19 23:39:21 2019 (r350159) +++ head/lib/libc/tests/string/wcsnlen_test.c Fri Jul 19 23:58:30 2019 (r350160) @@ -65,7 +65,7 @@ test_wcsnlen(const wchar_t *s) for (i = 0; i <= 1; i++) { for (bufsize = 0; bufsize <= size + 10; bufsize++) { s1 = makebuf(bufsize * sizeof(wchar_t), i); - wmemcpy(s1, s, bufsize); + wmemcpy(s1, s, bufsize <= size ? bufsize : size); len = (size > bufsize) ? bufsize : size - 1; ATF_CHECK(wcsnlen(s1, bufsize) == len); } From owner-svn-src-all@freebsd.org Sat Jul 20 02:03:32 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CCAC6B17E0; Sat, 20 Jul 2019 02:03:32 +0000 (UTC) (envelope-from ganbold@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ADB9C8F880; Sat, 20 Jul 2019 02:03:32 +0000 (UTC) (envelope-from ganbold@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 853222947; Sat, 20 Jul 2019 02:03:32 +0000 (UTC) (envelope-from ganbold@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6K23WL6041329; Sat, 20 Jul 2019 02:03:32 GMT (envelope-from ganbold@FreeBSD.org) Received: (from ganbold@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6K23VH8041326; Sat, 20 Jul 2019 02:03:31 GMT (envelope-from ganbold@FreeBSD.org) Message-Id: <201907200203.x6K23VH8041326@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ganbold set sender to ganbold@FreeBSD.org using -f From: Ganbold Tsagaankhuu Date: Sat, 20 Jul 2019 02:03:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350161 - in head/sys: arm64/conf arm64/rockchip conf X-SVN-Group: head X-SVN-Commit-Author: ganbold X-SVN-Commit-Paths: in head/sys: arm64/conf arm64/rockchip conf X-SVN-Commit-Revision: 350161 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: ADB9C8F880 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jul 2019 02:03:32 -0000 Author: ganbold Date: Sat Jul 20 02:03:31 2019 New Revision: 350161 URL: https://svnweb.freebsd.org/changeset/base/350161 Log: Add driver for Rockchip RK3399 eMMC PHY. Tested on NanoPC-T4 board. Reviewed by: manu Differential Revision: https://reviews.freebsd.org/D20840 Added: head/sys/arm64/rockchip/rk3399_emmcphy.c (contents, props changed) Modified: head/sys/arm64/conf/GENERIC head/sys/conf/files.arm64 Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Fri Jul 19 23:58:30 2019 (r350160) +++ head/sys/arm64/conf/GENERIC Sat Jul 20 02:03:31 2019 (r350161) @@ -188,6 +188,7 @@ device aw_mmc # Allwinner SD/MMC controller device mmc # mmc/sd bus device mmcsd # mmc/sd flash cards device dwmmc +device rk_emmcphy # Serial (COM) ports device uart # Generic UART driver Added: head/sys/arm64/rockchip/rk3399_emmcphy.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/rockchip/rk3399_emmcphy.c Sat Jul 20 02:03:31 2019 (r350161) @@ -0,0 +1,341 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 Ganbold Tsagaankhuu + * 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. + */ + +/* + * Rockchip RK3399 eMMC PHY + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include + +#include "syscon_if.h" + +#define GRF_EMMCPHY_BASE 0xf780 +#define GRF_EMMCPHY_CON0 (GRF_EMMCPHY_BASE + 0x00) +#define PHYCTRL_FRQSEL (1 << 13) | (1 << 12) +#define PHYCTRL_FRQSEL_200M 0 +#define PHYCTRL_FRQSEL_50M 1 +#define PHYCTRL_FRQSEL_100M 2 +#define PHYCTRL_FRQSEL_150M 3 +#define PHYCTRL_OTAPDLYENA (1 << 11) +#define PHYCTRL_OTAPDLYSEL (1 << 10) | (1 << 9) | (1 << 8) | (1 << 7) +#define PHYCTRL_ITAPCHGWIN (1 << 6) +#define PHYCTRL_ITAPDLYSEL (1 << 5) | (1 << 4) | (1 << 3) | (1 << 2) | \ + (1 << 1) +#define PHYCTRL_ITAPDLYENA (1 << 0) +#define GRF_EMMCPHY_CON1 (GRF_EMMCPHY_BASE + 0x04) +#define PHYCTRL_CLKBUFSEL (1 << 8) | (1 << 7) | (1 << 6) +#define PHYCTRL_SELDLYTXCLK (1 << 5) +#define PHYCTRL_SELDLYRXCLK (1 << 4) +#define PHYCTRL_STRBSEL 0xf +#define GRF_EMMCPHY_CON2 (GRF_EMMCPHY_BASE + 0x08) +#define PHYCTRL_REN_STRB (1 << 9) +#define PHYCTRL_REN_CMD (1 << 8) +#define PHYCTRL_REN_DAT 0xff +#define GRF_EMMCPHY_CON3 (GRF_EMMCPHY_BASE + 0x0c) +#define PHYCTRL_PU_STRB (1 << 9) +#define PHYCTRL_PU_CMD (1 << 8) +#define PHYCTRL_PU_DAT 0xff +#define GRF_EMMCPHY_CON4 (GRF_EMMCPHY_BASE + 0x10) +#define PHYCTRL_OD_RELEASE_CMD (1 << 9) +#define PHYCTRL_OD_RELEASE_STRB (1 << 8) +#define PHYCTRL_OD_RELEASE_DAT 0xff +#define GRF_EMMCPHY_CON5 (GRF_EMMCPHY_BASE + 0x14) +#define PHYCTRL_ODEN_STRB (1 << 9) +#define PHYCTRL_ODEN_CMD (1 << 8) +#define PHYCTRL_ODEN_DAT 0xff +#define GRF_EMMCPHY_CON6 (GRF_EMMCPHY_BASE + 0x18) +#define PHYCTRL_DLL_TRM_ICP (1 << 12) | (1 << 11) | (1 << 10) | (1 << 9) +#define PHYCTRL_EN_RTRIM (1 << 8) +#define PHYCTRL_RETRIM (1 << 7) +#define PHYCTRL_DR_TY (1 << 6) | (1 << 5) | (1 << 4) +#define PHYCTRL_RETENB (1 << 3) +#define PHYCTRL_RETEN (1 << 2) +#define PHYCTRL_ENDLL (1 << 1) +#define PHYCTRL_PDB (1 << 0) +#define GRF_EMMCPHY_STATUS (GRF_EMMCPHY_BASE + 0x20) +#define PHYCTRL_CALDONE (1 << 6) +#define PHYCTRL_DLLRDY (1 << 5) +#define PHYCTRL_RTRIM (1 << 4) | (1 << 3) | (1 << 2) | (1 << 1) +#define PHYCTRL_EXR_NINST (1 << 0) + +static struct ofw_compat_data compat_data[] = { + { "rockchip,rk3399-emmc-phy", 1 }, + { NULL, 0 } +}; + +struct rk_emmcphy_softc { + struct syscon *syscon; + struct rk_emmcphy_conf *phy_conf; + clk_t clk; +}; + +#define LOWEST_SET_BIT(mask) ((((mask) - 1) & (mask)) ^ (mask)) +#define SHIFTIN(x, mask) ((x) * LOWEST_SET_BIT(mask)) + +/* Phy class and methods. */ +static int rk_emmcphy_enable(struct phynode *phynode, bool enable); +static phynode_method_t rk_emmcphy_phynode_methods[] = { + PHYNODEMETHOD(phynode_enable, rk_emmcphy_enable), + PHYNODEMETHOD_END +}; + +DEFINE_CLASS_1(rk_emmcphy_phynode, rk_emmcphy_phynode_class, + rk_emmcphy_phynode_methods, 0, phynode_class); + +static int +rk_emmcphy_enable(struct phynode *phynode, bool enable) +{ + struct rk_emmcphy_softc *sc; + device_t dev; + intptr_t phy; + uint64_t rate, frqsel; + uint32_t mask, val; + int error; + + dev = phynode_get_device(phynode); + phy = phynode_get_id(phynode); + sc = device_get_softc(dev); + + if (bootverbose) + device_printf(dev, "Phy id: %ld\n", phy); + + if (phy != 0) { + device_printf(dev, "Unknown phy: %ld\n", phy); + return (ERANGE); + } + if (enable) { + /* Drive strength */ + mask = PHYCTRL_DR_TY; + val = SHIFTIN(0, PHYCTRL_DR_TY); + SYSCON_WRITE_4(sc->syscon, GRF_EMMCPHY_CON6, + (mask << 16) | val); + + /* Enable output tap delay */ + mask = PHYCTRL_OTAPDLYENA | PHYCTRL_OTAPDLYSEL; + val = PHYCTRL_OTAPDLYENA | SHIFTIN(4, PHYCTRL_OTAPDLYSEL); + SYSCON_WRITE_4(sc->syscon, GRF_EMMCPHY_CON0, + (mask << 16) | val); + } + + /* Power down PHY and disable DLL before making changes */ + mask = PHYCTRL_ENDLL | PHYCTRL_PDB; + val = 0; + SYSCON_WRITE_4(sc->syscon, GRF_EMMCPHY_CON6, (mask << 16) | val); + + if (enable == false) + return (0); + + sc->phy_conf = (struct rk_emmcphy_conf *)ofw_bus_search_compatible(dev, + compat_data)->ocd_data; + + /* Get clock */ + error = clk_get_by_ofw_name(dev, 0, "emmcclk", &sc->clk); + if (error != 0) { + device_printf(dev, "cannot get emmcclk clock, continue\n"); + sc->clk = NULL; + } else + device_printf(dev, "got emmcclk clock\n"); + + if (sc->clk) { + error = clk_get_freq(sc->clk, &rate); + if (error != 0) { + device_printf(dev, "cannot get clock frequency\n"); + return (ENXIO); + } + } else + rate = 0; + + if (rate != 0) { + if (rate < 75000000) + frqsel = PHYCTRL_FRQSEL_50M; + else if (rate < 125000000) + frqsel = PHYCTRL_FRQSEL_100M; + else if (rate < 175000000) + frqsel = PHYCTRL_FRQSEL_150M; + else + frqsel = PHYCTRL_FRQSEL_200M; + } else + frqsel = PHYCTRL_FRQSEL_200M; + + DELAY(3); + + /* Power up PHY */ + mask = PHYCTRL_PDB; + val = PHYCTRL_PDB; + SYSCON_WRITE_4(sc->syscon, GRF_EMMCPHY_CON6, (mask << 16) | val); + + /* Wait for calibration */ + DELAY(10); + val = SYSCON_READ_4(sc->syscon, GRF_EMMCPHY_STATUS); + if ((val & PHYCTRL_CALDONE) == 0) { + device_printf(dev, "PHY calibration did not complete\n"); + return (ENXIO); + } + + /* Set DLL frequency */ + mask = PHYCTRL_FRQSEL; + val = SHIFTIN(frqsel, PHYCTRL_FRQSEL); + SYSCON_WRITE_4(sc->syscon, GRF_EMMCPHY_CON0, (mask << 16) | val); + + /* Enable DLL */ + mask = PHYCTRL_ENDLL; + val = PHYCTRL_ENDLL; + SYSCON_WRITE_4(sc->syscon, GRF_EMMCPHY_CON6, (mask << 16) | val); + + if (rate != 0) { + /* + * Rockchip RK3399 TRM V1.3 Part2.pdf says in page 698: + * After the DLL control loop reaches steady state a DLL + * ready signal is generated by the DLL circuits + * 'phyctrl_dllrdy'. + * The time from 'phyctrl_endll' to DLL ready signal + * 'phyctrl_dllrdy' varies with the clock frequency. + * At 200MHz clock frequency the DLL ready delay is 2.56us, + * at 100MHz clock frequency the DLL ready delay is 5.112us and + * at 50 MHz clock frequency the DLL ready delay is 10.231us. + * We could use safe values for wait, 12us, 8us, 6us and 4us + * respectively. + * However due to some unknown reason it is not working and + * DLL seems to take extra long time to lock. + * So we will use more safe value 50ms here. + */ + + /* Wait for DLL ready */ + DELAY(50000); + val = SYSCON_READ_4(sc->syscon, GRF_EMMCPHY_STATUS); + if ((val & PHYCTRL_DLLRDY) == 0) { + device_printf(dev, "DLL loop failed to lock\n"); + return (ENXIO); + } + } + + return (0); +} + +static int +rk_emmcphy_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) + return (ENXIO); + + device_set_desc(dev, "Rockchip RK3399 eMMC PHY"); + return (BUS_PROBE_DEFAULT); +} + +static int +rk_emmcphy_attach(device_t dev) +{ + struct phynode_init_def phy_init; + struct phynode *phynode; + struct rk_emmcphy_softc *sc; + phandle_t node; + phandle_t xnode; + pcell_t handle; + intptr_t phy; + + sc = device_get_softc(dev); + node = ofw_bus_get_node(dev); + + if (OF_getencprop(node, "clocks", (void *)&handle, + sizeof(handle)) <= 0) { + device_printf(dev, "cannot get clocks handle\n"); + return (ENXIO); + } + xnode = OF_node_from_xref(handle); + if (OF_hasprop(xnode, "arasan,soc-ctl-syscon") && + syscon_get_by_ofw_property(dev, xnode, + "arasan,soc-ctl-syscon", &sc->syscon) != 0) { + device_printf(dev, "cannot get grf driver handle\n"); + return (ENXIO); + } + + if (sc->syscon == NULL) { + device_printf(dev, "failed to get syscon\n"); + return (ENXIO); + } + + /* Create and register phy */ + bzero(&phy_init, sizeof(phy_init)); + phy_init.id = 0; + phy_init.ofw_node = ofw_bus_get_node(dev); + phynode = phynode_create(dev, &rk_emmcphy_phynode_class, &phy_init); + if (phynode == NULL) { + device_printf(dev, "failed to create eMMC PHY\n"); + return (ENXIO); + } + if (phynode_register(phynode) == NULL) { + device_printf(dev, "failed to register eMMC PHY\n"); + return (ENXIO); + } + if (bootverbose) { + phy = phynode_get_id(phynode); + device_printf(dev, "Attached phy id: %ld\n", phy); + } + return (0); +} + +static device_method_t rk_emmcphy_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, rk_emmcphy_probe), + DEVMETHOD(device_attach, rk_emmcphy_attach), + + DEVMETHOD_END +}; + +static driver_t rk_emmcphy_driver = { + "rk_emmcphy", + rk_emmcphy_methods, + sizeof(struct rk_emmcphy_softc) +}; + +static devclass_t rk_emmcphy_devclass; +EARLY_DRIVER_MODULE(rk_emmcphy, simplebus, rk_emmcphy_driver, + rk_emmcphy_devclass, 0, 0, BUS_PASS_SUPPORTDEV + BUS_PASS_ORDER_MIDDLE); +MODULE_VERSION(rk_emmcphy, 1); Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Fri Jul 19 23:58:30 2019 (r350160) +++ head/sys/conf/files.arm64 Sat Jul 20 02:03:31 2019 (r350161) @@ -269,6 +269,7 @@ cddl/dev/dtrace/aarch64/dtrace_subr.c optional dtrac cddl/dev/fbt/aarch64/fbt_isa.c optional dtrace_fbt | dtraceall compile-with "${FBT_C}" # RockChip Drivers +arm64/rockchip/rk3399_emmcphy.c optional fdt rk_emmcphy soc_rockchip_rk3399 arm64/rockchip/rk_i2c.c optional fdt rk_i2c soc_rockchip_rk3328 | fdt rk_i2c soc_rockchip_rk3399 arm64/rockchip/rk805.c optional fdt rk805 soc_rockchip_rk3328 | fdt rk805 soc_rockchip_rk3399 arm64/rockchip/rk_grf.c optional fdt soc_rockchip_rk3328 | fdt soc_rockchip_rk3399 From owner-svn-src-all@freebsd.org Sat Jul 20 02:53:07 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 50B88B2B04; Sat, 20 Jul 2019 02:53:07 +0000 (UTC) (envelope-from ganbold@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 311406A1C8; Sat, 20 Jul 2019 02:53:07 +0000 (UTC) (envelope-from ganbold@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B274E329D; Sat, 20 Jul 2019 02:53:06 +0000 (UTC) (envelope-from ganbold@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6K2r6XF070386; Sat, 20 Jul 2019 02:53:06 GMT (envelope-from ganbold@FreeBSD.org) Received: (from ganbold@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6K2r64J070385; Sat, 20 Jul 2019 02:53:06 GMT (envelope-from ganbold@FreeBSD.org) Message-Id: <201907200253.x6K2r64J070385@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ganbold set sender to ganbold@FreeBSD.org using -f From: Ganbold Tsagaankhuu Date: Sat, 20 Jul 2019 02:53:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350162 - head/sys/dev/sdhci X-SVN-Group: head X-SVN-Commit-Author: ganbold X-SVN-Commit-Paths: head/sys/dev/sdhci X-SVN-Commit-Revision: 350162 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 311406A1C8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jul 2019 02:53:07 -0000 Author: ganbold Date: Sat Jul 20 02:53:06 2019 New Revision: 350162 URL: https://svnweb.freebsd.org/changeset/base/350162 Log: Add emmc support for Rockchip RK3399 SoC. Tested on NanoPC-T4 board. Reviewed by: manu Differential Revision: https://reviews.freebsd.org/D20156 Modified: head/sys/dev/sdhci/sdhci_fdt.c Modified: head/sys/dev/sdhci/sdhci_fdt.c ============================================================================== --- head/sys/dev/sdhci/sdhci_fdt.c Sat Jul 20 02:03:31 2019 (r350161) +++ head/sys/dev/sdhci/sdhci_fdt.c Sat Jul 20 02:53:06 2019 (r350162) @@ -52,6 +52,14 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef EXT_RESOURCES +#include +#include +#include +#include +#include +#endif + #include #include @@ -61,16 +69,37 @@ __FBSDID("$FreeBSD$"); #include "opt_mmccam.h" +#ifdef EXT_RESOURCES +#include "clkdev_if.h" +#include "syscon_if.h" +#endif + #define MAX_SLOTS 6 #define SDHCI_FDT_ARMADA38X 1 #define SDHCI_FDT_GENERIC 2 #define SDHCI_FDT_XLNX_ZY7 3 #define SDHCI_FDT_QUALCOMM 4 +#define SDHCI_FDT_RK3399 5 +#ifdef EXT_RESOURCES +#define RK3399_GRF_EMMCCORE_CON0 0xf000 +#define RK3399_CORECFG_BASECLKFREQ 0xff00 +#define RK3399_CORECFG_TIMEOUTCLKUNIT (1 << 7) +#define RK3399_CORECFG_TUNINGCOUNT 0x3f +#define RK3399_GRF_EMMCCORE_CON11 0xf02c +#define RK3399_CORECFG_CLOCKMULTIPLIER 0xff + +#define LOWEST_SET_BIT(mask) ((((mask) - 1) & (mask)) ^ (mask)) +#define SHIFTIN(x, mask) ((x) * LOWEST_SET_BIT(mask)) + +#define EMMCCARDCLK_ID 1000 +#endif + static struct ofw_compat_data compat_data[] = { { "marvell,armada-380-sdhci", SDHCI_FDT_ARMADA38X }, { "sdhci_generic", SDHCI_FDT_GENERIC }, { "qcom,sdhci-msm-v4", SDHCI_FDT_QUALCOMM }, + { "rockchip,rk3399-sdhci-5.1", SDHCI_FDT_RK3399 }, { "xlnx,zy7_sdhci", SDHCI_FDT_XLNX_ZY7 }, { NULL, 0 } }; @@ -90,8 +119,209 @@ struct sdhci_fdt_softc { bool wp_inverted; /* WP pin is inverted */ bool no_18v; /* No 1.8V support */ + +#ifdef EXT_RESOURCES + clk_t clk_xin; /* xin24m fixed clock */ + clk_t clk_ahb; /* ahb clock */ + phy_t phy; /* phy to be used */ +#endif }; +#ifdef EXT_RESOURCES +struct rk3399_emmccardclk_sc { + device_t clkdev; + bus_addr_t reg; +}; + +static int +rk3399_emmccardclk_init(struct clknode *clk, device_t dev) +{ + + clknode_init_parent_idx(clk, 0); + return (0); +} + +static clknode_method_t rk3399_emmccardclk_clknode_methods[] = { + /* Device interface */ + CLKNODEMETHOD(clknode_init, rk3399_emmccardclk_init), + CLKNODEMETHOD_END +}; +DEFINE_CLASS_1(rk3399_emmccardclk_clknode, rk3399_emmccardclk_clknode_class, + rk3399_emmccardclk_clknode_methods, sizeof(struct rk3399_emmccardclk_sc), + clknode_class); + +static int +rk3399_ofw_map(struct clkdom *clkdom, uint32_t ncells, + phandle_t *cells, struct clknode **clk) +{ + + if (ncells == 0) + *clk = clknode_find_by_id(clkdom, EMMCCARDCLK_ID); + else + return (ERANGE); + + if (*clk == NULL) + return (ENXIO); + return (0); +} + +static void +sdhci_init_rk3399_emmccardclk(device_t dev) +{ + struct clknode_init_def def; + struct rk3399_emmccardclk_sc *sc; + struct clkdom *clkdom; + struct clknode *clk; + clk_t clk_parent; + bus_addr_t paddr; + bus_size_t psize; + const char **clknames; + phandle_t node; + int i, nclocks, ncells, error; + + node = ofw_bus_get_node(dev); + + if (ofw_reg_to_paddr(node, 0, &paddr, &psize, NULL) != 0) { + device_printf(dev, "cannot parse 'reg' property\n"); + return; + } + + error = ofw_bus_parse_xref_list_get_length(node, "clocks", + "#clock-cells", &ncells); + if (error != 0 || ncells != 2) { + device_printf(dev, "couldn't find parent clocks\n"); + return; + } + + nclocks = ofw_bus_string_list_to_array(node, "clock-output-names", + &clknames); + /* No clocks to export */ + if (nclocks <= 0) + return; + + if (nclocks != 1) { + device_printf(dev, "Having %d clock instead of 1, aborting\n", + nclocks); + return; + } + + clkdom = clkdom_create(dev); + clkdom_set_ofw_mapper(clkdom, rk3399_ofw_map); + + memset(&def, 0, sizeof(def)); + def.id = EMMCCARDCLK_ID; + def.name = clknames[0]; + def.parent_names = malloc(sizeof(char *) * ncells, M_OFWPROP, M_WAITOK); + for (i = 0; i < ncells; i++) { + error = clk_get_by_ofw_index(dev, 0, i, &clk_parent); + if (error != 0) { + device_printf(dev, "cannot get clock %d\n", error); + return; + } + def.parent_names[i] = clk_get_name(clk_parent); + if (bootverbose) + device_printf(dev, "clk parent: %s\n", + def.parent_names[i]); + clk_release(clk_parent); + } + def.parent_cnt = ncells; + + clk = clknode_create(clkdom, &rk3399_emmccardclk_clknode_class, &def); + if (clk == NULL) { + device_printf(dev, "cannot create clknode\n"); + return; + } + + sc = clknode_get_softc(clk); + sc->reg = paddr; + sc->clkdev = device_get_parent(dev); + + clknode_register(clkdom, clk); + + if (clkdom_finit(clkdom) != 0) { + device_printf(dev, "cannot finalize clkdom initialization\n"); + return; + } + + if (bootverbose) + clkdom_dump(clkdom); +} + +static int +sdhci_init_rk3399(device_t dev) +{ + struct sdhci_fdt_softc *sc = device_get_softc(dev); + struct syscon *grf = NULL; + phandle_t node; + uint64_t freq; + uint32_t mask, val; + int error; + + /* Get and activate clocks */ + error = clk_get_by_ofw_name(dev, 0, "clk_xin", &sc->clk_xin); + if (error != 0) { + device_printf(dev, "cannot get xin clock\n"); + return (ENXIO); + } + error = clk_enable(sc->clk_xin); + if (error != 0) { + device_printf(dev, "cannot enable xin clock\n"); + return (ENXIO); + } + error = clk_get_freq(sc->clk_xin, &freq); + if (error != 0) { + device_printf(dev, "cannot get xin clock frequency\n"); + return (ENXIO); + } + error = clk_get_by_ofw_name(dev, 0, "clk_ahb", &sc->clk_ahb); + if (error != 0) { + device_printf(dev, "cannot get ahb clock\n"); + return (ENXIO); + } + error = clk_enable(sc->clk_ahb); + if (error != 0) { + device_printf(dev, "cannot enable ahb clock\n"); + return (ENXIO); + } + + /* Register clock */ + sdhci_init_rk3399_emmccardclk(dev); + + /* Enable PHY */ + error = phy_get_by_ofw_name(dev, 0, "phy_arasan", &sc->phy); + if (error != 0) { + device_printf(dev, "Could not get phy\n"); + return (ENXIO); + } + error = phy_enable(sc->phy); + if (error != 0) { + device_printf(dev, "Could not enable phy\n"); + return (ENXIO); + } + /* Get syscon */ + node = ofw_bus_get_node(dev); + if (OF_hasprop(node, "arasan,soc-ctl-syscon") && + syscon_get_by_ofw_property(dev, node, + "arasan,soc-ctl-syscon", &grf) != 0) { + device_printf(dev, "cannot get grf driver handle\n"); + return (ENXIO); + } + + /* Disable clock multiplier */ + mask = RK3399_CORECFG_CLOCKMULTIPLIER; + val = 0; + SYSCON_WRITE_4(grf, RK3399_GRF_EMMCCORE_CON11, (mask << 16) | val); + + /* Set base clock frequency */ + mask = RK3399_CORECFG_BASECLKFREQ; + val = SHIFTIN((freq + (1000000 / 2)) / 1000000, + RK3399_CORECFG_BASECLKFREQ); + SYSCON_WRITE_4(grf, RK3399_GRF_EMMCCORE_CON0, (mask << 16) | val); + + return (0); +} +#endif + static uint8_t sdhci_fdt_read_1(device_t dev, struct sdhci_slot *slot, bus_size_t off) { @@ -212,6 +442,9 @@ sdhci_fdt_probe(device_t dev) sc->sdma_boundary = SDHCI_BLKSZ_SDMA_BNDRY_4K; device_set_desc(dev, "Qualcomm FDT SDHCI controller"); break; + case SDHCI_FDT_RK3399: + device_set_desc(dev, "Rockchip RK3399 fdt SDHCI controller"); + break; case SDHCI_FDT_XLNX_ZY7: sc->quirks = SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK; device_set_desc(dev, "Zynq-7000 generic fdt SDHCI controller"); @@ -254,6 +487,18 @@ sdhci_fdt_attach(device_t dev) device_printf(dev, "Can't allocate IRQ\n"); return (ENOMEM); } + +#ifdef EXT_RESOURCES + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == + SDHCI_FDT_RK3399) { + /* Initialize SDHCI */ + err = sdhci_init_rk3399(dev); + if (err != 0) { + device_printf(dev, "Cannot init RK3399 SDHCI\n"); + return (err); + } + } +#endif /* Scan all slots. */ slots = sc->num_slots; /* number of slots determined in probe(). */ From owner-svn-src-all@freebsd.org Sat Jul 20 07:04:26 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C05E9B6853; Sat, 20 Jul 2019 07:04:26 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 990427007D; Sat, 20 Jul 2019 07:04:26 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 70CE06542; Sat, 20 Jul 2019 07:04:26 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6K74QqP019605; Sat, 20 Jul 2019 07:04:26 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6K74QDt019604; Sat, 20 Jul 2019 07:04:26 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201907200704.x6K74QDt019604@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Sat, 20 Jul 2019 07:04:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350164 - stable/12/tests/sys/opencrypto X-SVN-Group: stable-12 X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: stable/12/tests/sys/opencrypto X-SVN-Commit-Revision: 350164 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 990427007D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jul 2019 07:04:26 -0000 Author: lwhsu Date: Sat Jul 20 07:04:25 2019 New Revision: 350164 URL: https://svnweb.freebsd.org/changeset/base/350164 Log: MFC r349872: Correct definitions in sys.opencrypto.runtests.main for 32bit platform Reviewed by: cem, jhb MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20894 Modified: stable/12/tests/sys/opencrypto/cryptodev.py Directory Properties: stable/12/ (props changed) Modified: stable/12/tests/sys/opencrypto/cryptodev.py ============================================================================== --- stable/12/tests/sys/opencrypto/cryptodev.py Sat Jul 20 05:21:13 2019 (r350163) +++ stable/12/tests/sys/opencrypto/cryptodev.py Sat Jul 20 07:04:25 2019 (r350164) @@ -35,6 +35,7 @@ import array import dpkt from fcntl import ioctl import os +import platform import signal from struct import pack as _pack @@ -106,14 +107,19 @@ class CryptAEAD(dpkt.Packet): # h2py.py can't handle multiarg macros CRIOGET = 3221513060 CIOCGSESSION = 3224396645 -CIOCGSESSION2 = 3225445226 CIOCFSESSION = 2147771238 -CIOCCRYPT = 3224396647 CIOCKEY = 3230688104 CIOCASYMFEAT = 1074029417 CIOCKEY2 = 3230688107 CIOCFINDDEV = 3223610220 -CIOCCRYPTAEAD = 3225445229 +if platform.architecture()[0] == '64bit': + CIOCGSESSION2 = 3225445226 + CIOCCRYPT = 3224396647 + CIOCCRYPTAEAD = 3225445229 +else: + CIOCGSESSION2 = 3224396650 + CIOCCRYPT = 3223085927 + CIOCCRYPTAEAD = 3223872365 def _getdev(): fd = os.open('/dev/crypto', os.O_RDWR) From owner-svn-src-all@freebsd.org Sat Jul 20 08:40:32 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 04956B8780; Sat, 20 Jul 2019 08:40:32 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D813F72476; Sat, 20 Jul 2019 08:40:31 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AD2367626; Sat, 20 Jul 2019 08:40:31 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6K8eVIM073283; Sat, 20 Jul 2019 08:40:31 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6K8eVKf073282; Sat, 20 Jul 2019 08:40:31 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201907200840.x6K8eVKf073282@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Sat, 20 Jul 2019 08:40:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350165 - stable/12/share/man/man9 X-SVN-Group: stable-12 X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: stable/12/share/man/man9 X-SVN-Commit-Revision: 350165 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D813F72476 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.90 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.90)[-0.905,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jul 2019 08:40:32 -0000 Author: lwhsu Date: Sat Jul 20 08:40:31 2019 New Revision: 350165 URL: https://svnweb.freebsd.org/changeset/base/350165 Log: MFC r349543 Fix VOP_PUTPAGES(9) in regards to the use of VM_PAGER_CLUSTER_OK Submitted by: Ka Ho Ng Reviewed by: mckusick MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20695 Modified: stable/12/share/man/man9/VOP_GETPAGES.9 Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man9/VOP_GETPAGES.9 ============================================================================== --- stable/12/share/man/man9/VOP_GETPAGES.9 Sat Jul 20 07:04:25 2019 (r350164) +++ stable/12/share/man/man9/VOP_GETPAGES.9 Sat Jul 20 08:40:31 2019 (r350165) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 7, 2017 +.Dd June 29, 2019 .Dt VOP_GETPAGES 9 .Os .Sh NAME @@ -105,7 +105,7 @@ This could occur via a call to which puts such pages onto the head of the inactive queue. If .Dv VM_PAGER_CLUSTER_OK -is set, writes may be performed asynchronously, so that related writes +is set, writes may be delayed, so that related writes can be coalesced for efficiency, e.g., using the clustering mechanism of the buffer cache. .It Fa rtvals From owner-svn-src-all@freebsd.org Sat Jul 20 14:29:13 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 47C08BF745; Sat, 20 Jul 2019 14:29:13 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2B2E583B1D; Sat, 20 Jul 2019 14:29:13 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 024B2B7D3; Sat, 20 Jul 2019 14:29:13 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6KETCCO079653; Sat, 20 Jul 2019 14:29:12 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6KETC4j079649; Sat, 20 Jul 2019 14:29:12 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201907201429.x6KETC4j079649@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sat, 20 Jul 2019 14:29:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350166 - in head/sys/arm64: arm64 include X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys/arm64: arm64 include X-SVN-Commit-Revision: 350166 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2B2E583B1D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.93)[-0.930,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jul 2019 14:29:13 -0000 Author: manu Date: Sat Jul 20 14:29:11 2019 New Revision: 350166 URL: https://svnweb.freebsd.org/changeset/base/350166 Log: arm64: Implement HWCAP Add HWCAP support for arm64. defines are the same as in Linux and a userland program can use elf_aux_info to get the data. We only save the common denominator for all cores in case the big and little cluster have different support (this is known to exists even if we don't support those SoCs in FreeBSD) Differential Revision: https://reviews.freebsd.org/D17137 Modified: head/sys/arm64/arm64/elf_machdep.c head/sys/arm64/arm64/identcpu.c head/sys/arm64/include/cpu.h head/sys/arm64/include/elf.h Modified: head/sys/arm64/arm64/elf_machdep.c ============================================================================== --- head/sys/arm64/arm64/elf_machdep.c Sat Jul 20 08:40:31 2019 (r350165) +++ head/sys/arm64/arm64/elf_machdep.c Sat Jul 20 14:29:11 2019 (r350166) @@ -55,6 +55,8 @@ __FBSDID("$FreeBSD$"); #include "linker_if.h" +u_long elf_hwcap; + static struct sysentvec elf64_freebsd_sysvec = { .sv_size = SYS_MAXSYSCALL, .sv_table = sysent, @@ -88,6 +90,7 @@ static struct sysentvec elf64_freebsd_sysvec = { .sv_schedtail = NULL, .sv_thread_detach = NULL, .sv_trap = NULL, + .sv_hwcap = &elf_hwcap, }; INIT_SYSENTVEC(elf64_sysvec, &elf64_freebsd_sysvec); Modified: head/sys/arm64/arm64/identcpu.c ============================================================================== --- head/sys/arm64/arm64/identcpu.c Sat Jul 20 08:40:31 2019 (r350165) +++ head/sys/arm64/arm64/identcpu.c Sat Jul 20 14:29:11 2019 (r350166) @@ -44,8 +44,11 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include static int ident_lock; +static void print_cpu_features(u_int cpu); +static u_long parse_cpu_features_hwcap(u_int cpu); char machine[] = "arm64"; @@ -412,10 +415,14 @@ update_user_regs(u_int cpu) } } +/* HWCAP */ +extern u_long elf_hwcap; + static void identify_cpu_sysinit(void *dummy __unused) { int cpu; + u_long hwcap; /* Create a user visible cpu description with safe values */ memset(&user_cpu_desc, 0, sizeof(user_cpu_desc)); @@ -427,6 +434,11 @@ identify_cpu_sysinit(void *dummy __unused) CPU_FOREACH(cpu) { print_cpu_features(cpu); + hwcap = parse_cpu_features_hwcap(cpu); + if (elf_hwcap == 0) + elf_hwcap = hwcap; + else + elf_hwcap &= hwcap; update_user_regs(cpu); } @@ -434,7 +446,95 @@ identify_cpu_sysinit(void *dummy __unused) } SYSINIT(idenrity_cpu, SI_SUB_SMP, SI_ORDER_ANY, identify_cpu_sysinit, NULL); -void +static u_long +parse_cpu_features_hwcap(u_int cpu) +{ + u_long hwcap = 0; + + if (ID_AA64ISAR0_DP(cpu_desc[cpu].id_aa64isar0) == ID_AA64ISAR0_DP_IMPL) + hwcap |= HWCAP_ASIMDDP; + + if (ID_AA64ISAR0_SM4(cpu_desc[cpu].id_aa64isar0) == ID_AA64ISAR0_SM4_IMPL) + hwcap |= HWCAP_SM4; + + if (ID_AA64ISAR0_SM3(cpu_desc[cpu].id_aa64isar0) == ID_AA64ISAR0_SM3_IMPL) + hwcap |= HWCAP_SM3; + + if (ID_AA64ISAR0_RDM(cpu_desc[cpu].id_aa64isar0) == ID_AA64ISAR0_RDM_IMPL) + hwcap |= HWCAP_ASIMDRDM; + + if (ID_AA64ISAR0_Atomic(cpu_desc[cpu].id_aa64isar0) == ID_AA64ISAR0_Atomic_IMPL) + hwcap |= HWCAP_ATOMICS; + + if (ID_AA64ISAR0_CRC32(cpu_desc[cpu].id_aa64isar0) == ID_AA64ISAR0_CRC32_BASE) + hwcap |= HWCAP_CRC32; + + switch (ID_AA64ISAR0_SHA2(cpu_desc[cpu].id_aa64isar0)) { + case ID_AA64ISAR0_SHA2_BASE: + hwcap |= HWCAP_SHA2; + break; + case ID_AA64ISAR0_SHA2_512: + hwcap |= HWCAP_SHA2 | HWCAP_SHA512; + break; + default: + break; + } + + if (ID_AA64ISAR0_SHA1(cpu_desc[cpu].id_aa64isar0)) + hwcap |= HWCAP_SHA1; + + switch (ID_AA64ISAR0_AES(cpu_desc[cpu].id_aa64isar0)) { + case ID_AA64ISAR0_AES_BASE: + hwcap |= HWCAP_AES; + break; + case ID_AA64ISAR0_AES_PMULL: + hwcap |= HWCAP_PMULL | HWCAP_AES; + break; + default: + break; + } + + if (ID_AA64ISAR1_LRCPC(cpu_desc[cpu].id_aa64isar1) == ID_AA64ISAR1_LRCPC_IMPL) + hwcap |= HWCAP_LRCPC; + + if (ID_AA64ISAR1_FCMA(cpu_desc[cpu].id_aa64isar1) == ID_AA64ISAR1_FCMA_IMPL) + hwcap |= HWCAP_FCMA; + + if (ID_AA64ISAR1_JSCVT(cpu_desc[cpu].id_aa64isar1) == ID_AA64ISAR1_JSCVT_IMPL) + hwcap |= HWCAP_JSCVT; + + if (ID_AA64ISAR1_DPB(cpu_desc[cpu].id_aa64isar1) == ID_AA64ISAR1_DPB_IMPL) + hwcap |= HWCAP_DCPOP; + + if (ID_AA64PFR0_SVE(cpu_desc[cpu].id_aa64pfr0) == ID_AA64PFR0_SVE_IMPL) + hwcap |= HWCAP_SVE; + + switch (ID_AA64PFR0_AdvSIMD(cpu_desc[cpu].id_aa64pfr0)) { + case ID_AA64PFR0_AdvSIMD_IMPL: + hwcap |= HWCAP_ASIMD; + break; + case ID_AA64PFR0_AdvSIMD_HP: + hwcap |= HWCAP_ASIMD | HWCAP_ASIMDDP; + break; + default: + break; + } + + switch (ID_AA64PFR0_FP(cpu_desc[cpu].id_aa64pfr0)) { + case ID_AA64PFR0_FP_IMPL: + hwcap |= HWCAP_FP; + break; + case ID_AA64PFR0_FP_HP: + hwcap |= HWCAP_FP | HWCAP_FPHP; + break; + default: + break; + } + + return (hwcap); +} + +static void print_cpu_features(u_int cpu) { struct sbuf *sb; @@ -487,9 +587,6 @@ print_cpu_features(u_int cpu) printf("WARNING: ThunderX Pass 1.1 detected.\nThis has known " "hardware bugs that may cause the incorrect operation of " "atomic operations.\n"); - - if (cpu != 0 && cpu_print_regs == 0) - return; #define SEP_STR ((printed++) == 0) ? "" : "," Modified: head/sys/arm64/include/cpu.h ============================================================================== --- head/sys/arm64/include/cpu.h Sat Jul 20 08:40:31 2019 (r350165) +++ head/sys/arm64/include/cpu.h Sat Jul 20 14:29:11 2019 (r350166) @@ -160,7 +160,6 @@ void cpu_reset(void) __dead2; void fork_trampoline(void); void identify_cpu(void); void install_cpu_errata(void); -void print_cpu_features(u_int); void swi_vm(void *v); #define CPU_AFFINITY(cpu) __cpu_affinity[(cpu)] Modified: head/sys/arm64/include/elf.h ============================================================================== --- head/sys/arm64/include/elf.h Sat Jul 20 08:40:31 2019 (r350165) +++ head/sys/arm64/include/elf.h Sat Jul 20 14:29:11 2019 (r350166) @@ -87,4 +87,34 @@ __ElfType(Auxinfo); #define ET_DYN_LOAD_ADDR 0x100000 #endif +/* HWCAP */ + +#define HWCAP_FP 0x00000001 +#define HWCAP_ASIMD 0x00000002 +#define HWCAP_EVTSTRM 0x00000004 +#define HWCAP_AES 0x00000008 +#define HWCAP_PMULL 0x00000010 +#define HWCAP_SHA1 0x00000020 +#define HWCAP_SHA2 0x00000040 +#define HWCAP_CRC32 0x00000080 +#define HWCAP_ATOMICS 0x00000100 +#define HWCAP_FPHP 0x00000200 +#define HWCAP_CPUID 0x00000400 +#define HWCAP_ASIMDRDM 0x00000800 +#define HWCAP_JSCVT 0x00001000 +#define HWCAP_FCMA 0x00002000 +#define HWCAP_LRCPC 0x00004000 +#define HWCAP_DCPOP 0x00008000 +#define HWCAP_SHA3 0x00010000 +#define HWCAP_SM3 0x00020000 +#define HWCAP_SM4 0x00040000 +#define HWCAP_ASIMDDP 0x00080000 +#define HWCAP_SHA512 0x00100000 +#define HWCAP_SVE 0x00200000 +#define HWCAP_ASIMDFHM 0x00400000 +#define HWCAP_DIT 0x00800000 +#define HWCAP_USCAT 0x01000000 +#define HWCAP_ILRCPC 0x02000000 +#define HWCAP_FLAGM 0x04000000 + #endif /* !_MACHINE_ELF_H_ */ From owner-svn-src-all@freebsd.org Sat Jul 20 14:44:07 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 54F5EBFC92; Sat, 20 Jul 2019 14:44:07 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3530F84321; Sat, 20 Jul 2019 14:44:07 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DAD9ABD4E; Sat, 20 Jul 2019 14:44:06 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6KEi6Sl091158; Sat, 20 Jul 2019 14:44:06 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6KEi6kH091157; Sat, 20 Jul 2019 14:44:06 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201907201444.x6KEi6kH091157@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 20 Jul 2019 14:44:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r350167 - vendor/llvm/llvm-release_801-r366581 X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/llvm/llvm-release_801-r366581 X-SVN-Commit-Revision: 350167 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3530F84321 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.92 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.92)[-0.925,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jul 2019 14:44:07 -0000 Author: dim Date: Sat Jul 20 14:44:06 2019 New Revision: 350167 URL: https://svnweb.freebsd.org/changeset/base/350167 Log: Tag llvm 8.0.1 release r366581. Added: vendor/llvm/llvm-release_801-r366581/ - copied from r350166, vendor/llvm/dist-release_80/ From owner-svn-src-all@freebsd.org Sat Jul 20 14:44:25 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3CE26BFCD5; Sat, 20 Jul 2019 14:44:25 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0D04284441; Sat, 20 Jul 2019 14:44:25 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BC1F7BD51; Sat, 20 Jul 2019 14:44:24 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6KEiOPt091306; Sat, 20 Jul 2019 14:44:24 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6KEiOmj091305; Sat, 20 Jul 2019 14:44:24 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201907201444.x6KEiOmj091305@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 20 Jul 2019 14:44:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r350170 - vendor/compiler-rt/compiler-rt-release_801-r366581 X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/compiler-rt/compiler-rt-release_801-r366581 X-SVN-Commit-Revision: 350170 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0D04284441 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.92 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.92)[-0.925,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jul 2019 14:44:25 -0000 Author: dim Date: Sat Jul 20 14:44:24 2019 New Revision: 350170 URL: https://svnweb.freebsd.org/changeset/base/350170 Log: Tag compiler-rt 8.0.1 release r366581. Added: vendor/compiler-rt/compiler-rt-release_801-r366581/ - copied from r350169, vendor/compiler-rt/dist-release_80/ From owner-svn-src-all@freebsd.org Sat Jul 20 14:44:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3F43ABFCBD; Sat, 20 Jul 2019 14:44:24 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8E2578441C; Sat, 20 Jul 2019 14:44:22 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7BC88BD4F; Sat, 20 Jul 2019 14:44:17 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6KEiHtI091211; Sat, 20 Jul 2019 14:44:17 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6KEiHFB091210; Sat, 20 Jul 2019 14:44:17 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201907201444.x6KEiHFB091210@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 20 Jul 2019 14:44:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r350168 - vendor/clang/dist-release_80/lib/Basic X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/clang/dist-release_80/lib/Basic X-SVN-Commit-Revision: 350168 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8E2578441C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.93)[-0.928,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jul 2019 14:44:24 -0000 Author: dim Date: Sat Jul 20 14:44:17 2019 New Revision: 350168 URL: https://svnweb.freebsd.org/changeset/base/350168 Log: Vendor import of clang 8.0.1 release r366581: https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_801/final@366581 Modified: vendor/clang/dist-release_80/lib/Basic/Version.cpp Modified: vendor/clang/dist-release_80/lib/Basic/Version.cpp ============================================================================== --- vendor/clang/dist-release_80/lib/Basic/Version.cpp Sat Jul 20 14:44:06 2019 (r350167) +++ vendor/clang/dist-release_80/lib/Basic/Version.cpp Sat Jul 20 14:44:17 2019 (r350168) @@ -36,7 +36,7 @@ std::string getClangRepositoryPath() { // If the SVN_REPOSITORY is empty, try to use the SVN keyword. This helps us // pick up a tag in an SVN export, for example. - StringRef SVNRepository("$URL: https://llvm.org/svn/llvm-project/cfe/branches/release_80/lib/Basic/Version.cpp $"); + StringRef SVNRepository("$URL: https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_801/final/lib/Basic/Version.cpp $"); if (URL.empty()) { URL = SVNRepository.slice(SVNRepository.find(':'), SVNRepository.find("/lib/Basic")); From owner-svn-src-all@freebsd.org Sat Jul 20 14:44:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3F393BFCBC; Sat, 20 Jul 2019 14:44:24 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C0A2284420; Sat, 20 Jul 2019 14:44:22 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6F600BD50; Sat, 20 Jul 2019 14:44:20 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6KEiKhB091260; Sat, 20 Jul 2019 14:44:20 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6KEiKJP091259; Sat, 20 Jul 2019 14:44:20 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201907201444.x6KEiKJP091259@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 20 Jul 2019 14:44:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r350169 - vendor/clang/clang-release_801-r366581 X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/clang/clang-release_801-r366581 X-SVN-Commit-Revision: 350169 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C0A2284420 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.92 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.92)[-0.925,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jul 2019 14:44:24 -0000 Author: dim Date: Sat Jul 20 14:44:19 2019 New Revision: 350169 URL: https://svnweb.freebsd.org/changeset/base/350169 Log: Tag clang 8.0.1 release r366581. Added: vendor/clang/clang-release_801-r366581/ - copied from r350168, vendor/clang/dist-release_80/ From owner-svn-src-all@freebsd.org Sat Jul 20 14:45:06 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 15BF7BFD35; Sat, 20 Jul 2019 14:45:06 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EAB008454D; Sat, 20 Jul 2019 14:44:38 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4B95FBD56; Sat, 20 Jul 2019 14:44:31 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6KEiVvd091358; Sat, 20 Jul 2019 14:44:31 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6KEiVOE091357; Sat, 20 Jul 2019 14:44:31 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201907201444.x6KEiVOE091357@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 20 Jul 2019 14:44:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r350171 - vendor/libc++/libc++-release_801-r366581 X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/libc++/libc++-release_801-r366581 X-SVN-Commit-Revision: 350171 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EAB008454D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.92 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.92)[-0.925,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jul 2019 14:45:06 -0000 Author: dim Date: Sat Jul 20 14:44:30 2019 New Revision: 350171 URL: https://svnweb.freebsd.org/changeset/base/350171 Log: Tag libc++ 8.0.1 release r366581. Added: vendor/libc++/libc++-release_801-r366581/ - copied from r350170, vendor/libc++/dist-release_80/ From owner-svn-src-all@freebsd.org Sat Jul 20 14:45:07 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D5F38BFD5E; Sat, 20 Jul 2019 14:45:07 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5FF7F8456F; Sat, 20 Jul 2019 14:44:40 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 951A6BD57; Sat, 20 Jul 2019 14:44:33 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6KEiXZI091405; Sat, 20 Jul 2019 14:44:33 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6KEiXvg091404; Sat, 20 Jul 2019 14:44:33 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201907201444.x6KEiXvg091404@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 20 Jul 2019 14:44:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r350172 - vendor/llvm-libunwind/dist-release_80/src X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/llvm-libunwind/dist-release_80/src X-SVN-Commit-Revision: 350172 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5FF7F8456F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.93)[-0.928,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jul 2019 14:45:07 -0000 Author: dim Date: Sat Jul 20 14:44:33 2019 New Revision: 350172 URL: https://svnweb.freebsd.org/changeset/base/350172 Log: Vendor import of LLVM libunwind 8.0.1 release r366581: https://llvm.org/svn/llvm-project/libunwind/tags/RELEASE_801/final@366581 Modified: vendor/llvm-libunwind/dist-release_80/src/assembly.h Modified: vendor/llvm-libunwind/dist-release_80/src/assembly.h ============================================================================== --- vendor/llvm-libunwind/dist-release_80/src/assembly.h Sat Jul 20 14:44:30 2019 (r350171) +++ vendor/llvm-libunwind/dist-release_80/src/assembly.h Sat Jul 20 14:44:33 2019 (r350172) @@ -117,7 +117,9 @@ .globl SYMBOL_NAME(name) SEPARATOR \ HIDDEN_SYMBOL(SYMBOL_NAME(name)) SEPARATOR \ SYMBOL_IS_FUNC(SYMBOL_NAME(name)) SEPARATOR \ - SYMBOL_NAME(name): + PPC64_OPD1 \ + SYMBOL_NAME(name): \ + PPC64_OPD2 #if defined(__arm__) #if !defined(__ARM_ARCH) From owner-svn-src-all@freebsd.org Sat Jul 20 14:45:10 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ECAA6BFD84; Sat, 20 Jul 2019 14:45:10 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0E75884599; Sat, 20 Jul 2019 14:44:43 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 59352BD58; Sat, 20 Jul 2019 14:44:36 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6KEiaLo091454; Sat, 20 Jul 2019 14:44:36 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6KEiawR091453; Sat, 20 Jul 2019 14:44:36 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201907201444.x6KEiawR091453@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 20 Jul 2019 14:44:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r350173 - vendor/llvm-libunwind/libunwind-release_801-r366581 X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/llvm-libunwind/libunwind-release_801-r366581 X-SVN-Commit-Revision: 350173 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0E75884599 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.92 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.92)[-0.925,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jul 2019 14:45:11 -0000 Author: dim Date: Sat Jul 20 14:44:35 2019 New Revision: 350173 URL: https://svnweb.freebsd.org/changeset/base/350173 Log: Tag LLVM libunwind 8.0.1 release r366581. Added: vendor/llvm-libunwind/libunwind-release_801-r366581/ - copied from r350172, vendor/llvm-libunwind/dist-release_80/ From owner-svn-src-all@freebsd.org Sat Jul 20 14:45:10 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DD9BABFD83; Sat, 20 Jul 2019 14:45:10 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 26F468459B; Sat, 20 Jul 2019 14:44:43 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 74D64BD59; Sat, 20 Jul 2019 14:44:40 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6KEie9v091501; Sat, 20 Jul 2019 14:44:40 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6KEiefm091500; Sat, 20 Jul 2019 14:44:40 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201907201444.x6KEiefm091500@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 20 Jul 2019 14:44:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r350174 - vendor/lld/lld-release_801-r366581 X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/lld/lld-release_801-r366581 X-SVN-Commit-Revision: 350174 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 26F468459B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.92 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.92)[-0.925,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jul 2019 14:45:10 -0000 Author: dim Date: Sat Jul 20 14:44:40 2019 New Revision: 350174 URL: https://svnweb.freebsd.org/changeset/base/350174 Log: Tag lld 8.0.1 release r366581. Added: vendor/lld/lld-release_801-r366581/ - copied from r350173, vendor/lld/dist-release_80/ From owner-svn-src-all@freebsd.org Sat Jul 20 14:45:27 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7F4DDBFDDD; Sat, 20 Jul 2019 14:45:27 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B33C484623; Sat, 20 Jul 2019 14:44:51 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B457BBD5A; Sat, 20 Jul 2019 14:44:46 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6KEik0A091551; Sat, 20 Jul 2019 14:44:46 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6KEikv9091550; Sat, 20 Jul 2019 14:44:46 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201907201444.x6KEikv9091550@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 20 Jul 2019 14:44:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r350175 - vendor/lldb/lldb-release_801-r366581 X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/lldb/lldb-release_801-r366581 X-SVN-Commit-Revision: 350175 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B33C484623 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.92 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.92)[-0.925,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jul 2019 14:45:27 -0000 Author: dim Date: Sat Jul 20 14:44:46 2019 New Revision: 350175 URL: https://svnweb.freebsd.org/changeset/base/350175 Log: Tag lldb 8.0.1 release r366581. Added: vendor/lldb/lldb-release_801-r366581/ - copied from r350174, vendor/lldb/dist-release_80/ From owner-svn-src-all@freebsd.org Sat Jul 20 14:45:29 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2930ABFDFF; Sat, 20 Jul 2019 14:45:29 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 687598463F; Sat, 20 Jul 2019 14:44:53 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9A88ABD5B; Sat, 20 Jul 2019 14:44:49 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6KEinL6091600; Sat, 20 Jul 2019 14:44:49 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6KEin88091599; Sat, 20 Jul 2019 14:44:49 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201907201444.x6KEin88091599@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 20 Jul 2019 14:44:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r350176 - vendor/llvm-openmp/openmp-release_801-r366581 X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/llvm-openmp/openmp-release_801-r366581 X-SVN-Commit-Revision: 350176 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 687598463F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.92 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.92)[-0.925,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jul 2019 14:45:29 -0000 Author: dim Date: Sat Jul 20 14:44:49 2019 New Revision: 350176 URL: https://svnweb.freebsd.org/changeset/base/350176 Log: Tag LLVM openmp 8.0.1 release r366581. Added: vendor/llvm-openmp/openmp-release_801-r366581/ - copied from r350175, vendor/llvm-openmp/dist-release_80/ From owner-svn-src-all@freebsd.org Sat Jul 20 15:26:22 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EC42AC0C45; Sat, 20 Jul 2019 15:26:22 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CE0CC85D79; Sat, 20 Jul 2019 15:26:22 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A9741C4E7; Sat, 20 Jul 2019 15:26:22 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6KFQMRo015306; Sat, 20 Jul 2019 15:26:22 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6KFQLLf015302; Sat, 20 Jul 2019 15:26:21 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201907201526.x6KFQLLf015302@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 20 Jul 2019 15:26:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350177 - in head: contrib/libunwind/src contrib/llvm/tools/clang/lib/Basic lib/clang/include/clang/Basic lib/clang/include/lld/Common lib/clang/include/llvm/Support X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in head: contrib/libunwind/src contrib/llvm/tools/clang/lib/Basic lib/clang/include/clang/Basic lib/clang/include/lld/Common lib/clang/include/llvm/Support X-SVN-Commit-Revision: 350177 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CE0CC85D79 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.93)[-0.930,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jul 2019 15:26:23 -0000 Author: dim Date: Sat Jul 20 15:26:21 2019 New Revision: 350177 URL: https://svnweb.freebsd.org/changeset/base/350177 Log: Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp 8.0.1 final release r366581. The only functional change is a fix for a mismerge of upstream r360816, which properly restores the r2 register when unwinding on PowerPC64 (See https://reviews.freebsd.org/D20337). Relnotes: yes PR: 236062 MFC after: 3 days X-MFC-With: r349004 Modified: head/contrib/libunwind/src/assembly.h head/contrib/llvm/tools/clang/lib/Basic/Version.cpp head/lib/clang/include/clang/Basic/Version.inc head/lib/clang/include/lld/Common/Version.inc head/lib/clang/include/llvm/Support/VCSRevision.h Directory Properties: head/contrib/compiler-rt/ (props changed) head/contrib/libc++/ (props changed) head/contrib/libunwind/ (props changed) head/contrib/llvm/ (props changed) head/contrib/llvm/tools/clang/ (props changed) head/contrib/llvm/tools/lld/ (props changed) head/contrib/llvm/tools/lldb/ (props changed) head/contrib/openmp/ (props changed) Modified: head/contrib/libunwind/src/assembly.h ============================================================================== --- head/contrib/libunwind/src/assembly.h Sat Jul 20 14:44:49 2019 (r350176) +++ head/contrib/libunwind/src/assembly.h Sat Jul 20 15:26:21 2019 (r350177) @@ -117,7 +117,9 @@ .globl SYMBOL_NAME(name) SEPARATOR \ HIDDEN_SYMBOL(SYMBOL_NAME(name)) SEPARATOR \ SYMBOL_IS_FUNC(SYMBOL_NAME(name)) SEPARATOR \ - SYMBOL_NAME(name): + PPC64_OPD1 \ + SYMBOL_NAME(name): \ + PPC64_OPD2 #if defined(__arm__) #if !defined(__ARM_ARCH) Modified: head/contrib/llvm/tools/clang/lib/Basic/Version.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Basic/Version.cpp Sat Jul 20 14:44:49 2019 (r350176) +++ head/contrib/llvm/tools/clang/lib/Basic/Version.cpp Sat Jul 20 15:26:21 2019 (r350177) @@ -36,7 +36,7 @@ std::string getClangRepositoryPath() { // If the SVN_REPOSITORY is empty, try to use the SVN keyword. This helps us // pick up a tag in an SVN export, for example. - StringRef SVNRepository("$URL: https://llvm.org/svn/llvm-project/cfe/branches/release_80/lib/Basic/Version.cpp $"); + StringRef SVNRepository("$URL: https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_801/final/lib/Basic/Version.cpp $"); if (URL.empty()) { URL = SVNRepository.slice(SVNRepository.find(':'), SVNRepository.find("/lib/Basic")); Modified: head/lib/clang/include/clang/Basic/Version.inc ============================================================================== --- head/lib/clang/include/clang/Basic/Version.inc Sat Jul 20 14:44:49 2019 (r350176) +++ head/lib/clang/include/clang/Basic/Version.inc Sat Jul 20 15:26:21 2019 (r350177) @@ -8,4 +8,4 @@ #define CLANG_VENDOR "FreeBSD " -#define SVN_REVISION "364487" +#define SVN_REVISION "366581" Modified: head/lib/clang/include/lld/Common/Version.inc ============================================================================== --- head/lib/clang/include/lld/Common/Version.inc Sat Jul 20 14:44:49 2019 (r350176) +++ head/lib/clang/include/lld/Common/Version.inc Sat Jul 20 15:26:21 2019 (r350177) @@ -7,4 +7,4 @@ #define LLD_REPOSITORY_STRING "FreeBSD" // - -#define LLD_REVISION_STRING "364487-1300004" +#define LLD_REVISION_STRING "366581-1300004" Modified: head/lib/clang/include/llvm/Support/VCSRevision.h ============================================================================== --- head/lib/clang/include/llvm/Support/VCSRevision.h Sat Jul 20 14:44:49 2019 (r350176) +++ head/lib/clang/include/llvm/Support/VCSRevision.h Sat Jul 20 15:26:21 2019 (r350177) @@ -1,2 +1,2 @@ /* $FreeBSD$ */ -#define LLVM_REVISION "svn-r364487" +#define LLVM_REVISION "svn-r366581" From owner-svn-src-all@freebsd.org Sat Jul 20 15:59:50 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 13816C139A; Sat, 20 Jul 2019 15:59:50 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E759786892; Sat, 20 Jul 2019 15:59:49 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A890CCA7F; Sat, 20 Jul 2019 15:59:49 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6KFxncv033031; Sat, 20 Jul 2019 15:59:49 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6KFxn1l033030; Sat, 20 Jul 2019 15:59:49 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201907201559.x6KFxn1l033030@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 20 Jul 2019 15:59:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350178 - head/sys/amd64/vmm/io X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/amd64/vmm/io X-SVN-Commit-Revision: 350178 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E759786892 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.949,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jul 2019 15:59:50 -0000 Author: jhb Date: Sat Jul 20 15:59:49 2019 New Revision: 350178 URL: https://svnweb.freebsd.org/changeset/base/350178 Log: Improve the precision of bhyve's vPIT. Use 'struct bintime' instead of 'sbintime_t' to manage times in vPIT to postpone rounding to final results rather than intermediate results. In tests performed by Joyent, this reduced the error measured by Linux guests by 59 ppm. Smart OS bug: https://smartos.org/bugview/OS-6923 Submitted by: Patrick Mooney Reviewed by: rgrimes Obtained from: SmartOS / Joyent MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D20335 Modified: head/sys/amd64/vmm/io/vatpit.c Modified: head/sys/amd64/vmm/io/vatpit.c ============================================================================== --- head/sys/amd64/vmm/io/vatpit.c Sat Jul 20 15:26:21 2019 (r350177) +++ head/sys/amd64/vmm/io/vatpit.c Sat Jul 20 15:59:49 2019 (r350178) @@ -2,6 +2,7 @@ * Copyright (c) 2014 Tycho Nightingale * Copyright (c) 2011 NetApp, Inc. * All rights reserved. + * Copyright (c) 2018 Joyent, Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -78,7 +79,7 @@ struct vatpit_callout_arg { struct channel { int mode; uint16_t initial; /* initial counter value */ - sbintime_t now_sbt; /* uptime when counter was loaded */ + struct bintime now_bt; /* uptime when counter was loaded */ uint8_t cr[2]; uint8_t ol[2]; bool slatched; /* status latched */ @@ -87,7 +88,7 @@ struct channel { int olbyte; int frbyte; struct callout callout; - sbintime_t callout_sbt; /* target time */ + struct bintime callout_bt; /* target time */ struct vatpit_callout_arg callout_arg; }; @@ -95,26 +96,41 @@ struct vatpit { struct vm *vm; struct mtx mtx; - sbintime_t freq_sbt; + struct bintime freq_bt; struct channel channel[3]; }; static void pit_timer_start_cntr0(struct vatpit *vatpit); +static uint64_t +vatpit_delta_ticks(struct vatpit *vatpit, struct channel *c) +{ + struct bintime delta; + uint64_t result; + + binuptime(&delta); + bintime_sub(&delta, &c->now_bt); + + result = delta.sec * PIT_8254_FREQ; + result += delta.frac / vatpit->freq_bt.frac; + + return (result); +} + static int vatpit_get_out(struct vatpit *vatpit, int channel) { struct channel *c; - sbintime_t delta_ticks; + uint64_t delta_ticks; int out; c = &vatpit->channel[channel]; switch (c->mode) { case TIMER_INTTC: - delta_ticks = (sbinuptime() - c->now_sbt) / vatpit->freq_sbt; - out = ((c->initial - delta_ticks) <= 0); + delta_ticks = vatpit_delta_ticks(vatpit, c); + out = (delta_ticks >= c->initial); break; default: out = 0; @@ -164,24 +180,28 @@ static void pit_timer_start_cntr0(struct vatpit *vatpit) { struct channel *c; - sbintime_t now, delta, precision; + struct bintime now, delta; + sbintime_t precision; c = &vatpit->channel[0]; if (c->initial != 0) { - delta = c->initial * vatpit->freq_sbt; - precision = delta >> tc_precexp; - c->callout_sbt = c->callout_sbt + delta; + delta.sec = 0; + delta.frac = vatpit->freq_bt.frac * c->initial; + bintime_add(&c->callout_bt, &delta); + precision = bttosbt(delta) >> tc_precexp; /* - * Reset 'callout_sbt' if the time that the callout + * Reset 'callout_bt' if the time that the callout * was supposed to fire is more than 'c->initial' * ticks in the past. */ - now = sbinuptime(); - if (c->callout_sbt < now) - c->callout_sbt = now + delta; + binuptime(&now); + if (bintime_cmp(&c->callout_bt, &now, <)) { + c->callout_bt = now; + bintime_add(&c->callout_bt, &delta); + } - callout_reset_sbt(&c->callout, c->callout_sbt, + callout_reset_sbt(&c->callout, bttosbt(c->callout_bt), precision, vatpit_callout_handler, &c->callout_arg, C_ABSOLUTE); } @@ -191,7 +211,7 @@ static uint16_t pit_update_counter(struct vatpit *vatpit, struct channel *c, bool latch) { uint16_t lval; - sbintime_t delta_ticks; + uint64_t delta_ticks; /* cannot latch a new value until the old one has been consumed */ if (latch && c->olbyte != 0) @@ -207,12 +227,11 @@ pit_update_counter(struct vatpit *vatpit, struct chann * here. */ c->initial = TIMER_DIV(PIT_8254_FREQ, 100); - c->now_sbt = sbinuptime(); + binuptime(&c->now_bt); c->status &= ~TIMER_STS_NULLCNT; } - delta_ticks = (sbinuptime() - c->now_sbt) / vatpit->freq_sbt; - + delta_ticks = vatpit_delta_ticks(vatpit, c); lval = c->initial - delta_ticks % c->initial; if (latch) { @@ -383,10 +402,10 @@ vatpit_handler(struct vm *vm, int vcpuid, bool in, int c->frbyte = 0; c->crbyte = 0; c->initial = c->cr[0] | (uint16_t)c->cr[1] << 8; - c->now_sbt = sbinuptime(); + binuptime(&c->now_bt); /* Start an interval timer for channel 0 */ if (port == TIMER_CNTR0) { - c->callout_sbt = c->now_sbt; + c->callout_bt = c->now_bt; pit_timer_start_cntr0(vatpit); } if (c->initial == 0) @@ -423,7 +442,6 @@ struct vatpit * vatpit_init(struct vm *vm) { struct vatpit *vatpit; - struct bintime bt; struct vatpit_callout_arg *arg; int i; @@ -432,8 +450,7 @@ vatpit_init(struct vm *vm) mtx_init(&vatpit->mtx, "vatpit lock", NULL, MTX_SPIN); - FREQ2BT(PIT_8254_FREQ, &bt); - vatpit->freq_sbt = bttosbt(bt); + FREQ2BT(PIT_8254_FREQ, &vatpit->freq_bt); for (i = 0; i < 3; i++) { callout_init(&vatpit->channel[i].callout, 1); From owner-svn-src-all@freebsd.org Sat Jul 20 16:03:54 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DADE2C159E; Sat, 20 Jul 2019 16:03:54 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BC52086D31; Sat, 20 Jul 2019 16:03:54 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9452ACC66; Sat, 20 Jul 2019 16:03:54 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6KG3sum038623; Sat, 20 Jul 2019 16:03:54 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6KG3san038622; Sat, 20 Jul 2019 16:03:54 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201907201603.x6KG3san038622@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 20 Jul 2019 16:03:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350179 - head/lib/libutil X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/lib/libutil X-SVN-Commit-Revision: 350179 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BC52086D31 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.946,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jul 2019 16:03:54 -0000 Author: jhb Date: Sat Jul 20 16:03:54 2019 New Revision: 350179 URL: https://svnweb.freebsd.org/changeset/base/350179 Log: expand_number(3) parses suffixes, not prefixes. While here, tidy the opening sentence a bit. MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D20791 Modified: head/lib/libutil/expand_number.3 Modified: head/lib/libutil/expand_number.3 ============================================================================== --- head/lib/libutil/expand_number.3 Sat Jul 20 15:59:49 2019 (r350178) +++ head/lib/libutil/expand_number.3 Sat Jul 20 16:03:54 2019 (r350179) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 15, 2010 +.Dd July 20, 2019 .Dt EXPAND_NUMBER 3 .Os .Sh NAME @@ -42,11 +42,10 @@ .Sh DESCRIPTION The .Fn expand_number -function unformats the +function parses the .Fa buf -string and stores a unsigned 64-bit quantity at address pointed out by the -.Fa num -argument. +string and stores a unsigned 64-bit quantity at +.Fa *num . .Pp The .Fn expand_number @@ -54,9 +53,9 @@ function is case-insensitive and follows the SI power of two convention. .Pp -The prefixes are: -.Bl -column "Prefix" "Description" "1000000000000000000" -offset indent -.It Sy "Prefix" Ta Sy "Description" Ta Sy "Multiplier" +The suffixes are: +.Bl -column "Suffix" "Description" "1000000000000000000" -offset indent +.It Sy "Suffix" Ta Sy "Description" Ta Sy "Multiplier" .It Li K Ta No kilo Ta 1024 .It Li M Ta No mega Ta 1048576 .It Li G Ta No giga Ta 1073741824 @@ -74,7 +73,7 @@ function will fail if: .It Bq Er EINVAL The given string contains no digits. .It Bq Er EINVAL -An unrecognized prefix was given. +An unrecognized suffix was given. .It Bq Er ERANGE Result doesn't fit into 64 bits. .El From owner-svn-src-all@freebsd.org Sat Jul 20 17:28:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 62ADEC3257 for ; Sat, 20 Jul 2019 17:28:21 +0000 (UTC) (envelope-from inv@ui.prato.it) Received: from zimbra.ui.prato.it (zimbra.ui.prato.it [93.188.112.40]) (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 8165989990 for ; Sat, 20 Jul 2019 17:28:17 +0000 (UTC) (envelope-from inv@ui.prato.it) Received: from localhost (localhost.localdomain [127.0.0.1]) by zimbra.ui.prato.it (Postfix) with ESMTP id 099F2F0275D for ; Sat, 20 Jul 2019 19:28:16 +0200 (CEST) Received: from zimbra.ui.prato.it ([127.0.0.1]) by localhost (zimbra.ui.prato.it [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id LUKbf6xAnrH3 for ; Sat, 20 Jul 2019 19:28:14 +0200 (CEST) Received: from localhost (localhost.localdomain [127.0.0.1]) by zimbra.ui.prato.it (Postfix) with ESMTP id 94133F0276C for ; Sat, 20 Jul 2019 19:19:45 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.10.3 zimbra.ui.prato.it 94133F0276C X-Virus-Scanned: amavisd-new at ui.prato.it Received: from zimbra.ui.prato.it ([127.0.0.1]) by localhost (zimbra.ui.prato.it [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id iDM2O0t1OpIK for ; Sat, 20 Jul 2019 19:19:45 +0200 (CEST) Received: from WIN-HUAKD8TBG21.local (unknown [185.242.180.120]) by zimbra.ui.prato.it (Postfix) with ESMTPSA id 0E727F0331D for ; Sat, 20 Jul 2019 19:13:04 +0200 (CEST) From: "=?utf-8?B?QnVkZ2V0IENsZWFuZXJzIMKu?=" To: svn-src-all@freebsd.org Subject: Budget Cleaners Tax Invoice Date: Sat, 20 Jul 2019 17:13:04 +0200 MIME-Version: 1.0 Message-ID: <1563538113a8597cb01e01166a657ed37c7efa5601_61455@ui.prato.it> X-Rspamd-Queue-Id: 8165989990 X-Spamd-Bar: + X-Spamd-Result: default: False [1.81 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[ui.prato.it:s=0606D86E-3EFD-11E7-BD6F-3E499311674D]; RCVD_COUNT_FIVE(0.00)[6]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[multipart/related,multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; TO_DN_NONE(0.00)[]; NEURAL_SPAM_MEDIUM(1.00)[0.998,0]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-0.69)[-0.691,0]; IP_SCORE(0.32)[ip: (0.84), ipnet: 93.188.112.0/21(0.42), asn: 47178(0.33), country: IT(0.03)]; NEURAL_SPAM_SHORT(0.85)[0.850,0]; DKIM_TRACE(0.00)[ui.prato.it:+]; DMARC_POLICY_ALLOW(-0.50)[ui.prato.it,quarantine]; RCVD_IN_DNSWL_NONE(0.00)[40.112.188.93.list.dnswl.org : 127.0.10.0]; MX_GOOD(-0.01)[cached: ns1.conmet.it]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:47178, ipnet:93.188.112.0/21, country:IT]; PHISHING(1.34)[sageone.co->inv231.s3.ca-central-1.amazonaws.com]; MID_RHS_MATCH_FROM(0.00)[] Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jul 2019 17:28:21 -0000 You have received an Invoice Budget Cleaners from Budget Cleaners =09 =09 View your invoice online: https://accounting.sageone.co.za/customerzone/invoice/viewinvoice?TypeId= =3D1&Key=3Dffd62228-a6b3-4a8a-bb26-2ca3c5165bba&T=3D1&TraceId=3D30491393 Dear Valued Client. Thank You, for using Budget Cleaners, please kindly make payment for your Tax= invoice as stated on the above link. Please Note, all accounts are STRICTLY payable by the 20th of each month,= unless prior arrangements have been made with the Accounts Dept. Thank You. Kind Regards. Budget Cleaners Management. =09 =09 Generated by Accounting =09 From owner-svn-src-all@freebsd.org Sat Jul 20 17:42:47 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 685CCC393B; Sat, 20 Jul 2019 17:42:47 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 45AB68A298; Sat, 20 Jul 2019 17:42:47 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CF994DF35; Sat, 20 Jul 2019 17:42:46 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6KHgk6s098404; Sat, 20 Jul 2019 17:42:46 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6KHgkQG098402; Sat, 20 Jul 2019 17:42:46 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201907201742.x6KHgkQG098402@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sat, 20 Jul 2019 17:42:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350180 - in head/sys: dts/arm/overlays modules/dtb/allwinner X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys: dts/arm/overlays modules/dtb/allwinner X-SVN-Commit-Revision: 350180 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 45AB68A298 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jul 2019 17:42:47 -0000 Author: manu Date: Sat Jul 20 17:42:46 2019 New Revision: 350180 URL: https://svnweb.freebsd.org/changeset/base/350180 Log: dtso: allwinner: Add an overlay for H3 i2c0 Most of the H3 boards don't enable i2c as it is unused. Add an overlay so it's easier for user to use i2c device. Added: head/sys/dts/arm/overlays/sun8i-h3-i2c0.dtso (contents, props changed) Modified: head/sys/modules/dtb/allwinner/Makefile Added: head/sys/dts/arm/overlays/sun8i-h3-i2c0.dtso ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dts/arm/overlays/sun8i-h3-i2c0.dtso Sat Jul 20 17:42:46 2019 (r350180) @@ -0,0 +1,12 @@ +/dts-v1/; +/plugin/; + +/ { + compatible = "allwinner,sun8i-h3"; +}; + +&{/soc/i2c@1c2ac00} { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&i2c0_pins>; +}; Modified: head/sys/modules/dtb/allwinner/Makefile ============================================================================== --- head/sys/modules/dtb/allwinner/Makefile Sat Jul 20 16:03:54 2019 (r350179) +++ head/sys/modules/dtb/allwinner/Makefile Sat Jul 20 17:42:46 2019 (r350180) @@ -24,6 +24,7 @@ DTS= \ sun8i-h3-orangepi-plus2e.dts DTSO= sun8i-a83t-sid.dtso \ + sun8i-h3-i2c0.dtso \ sun8i-h3-sid.dtso LINKS= \ From owner-svn-src-all@freebsd.org Sat Jul 20 18:22:02 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 830FFC41C6; Sat, 20 Jul 2019 18:22:02 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 663368AF1D; Sat, 20 Jul 2019 18:22:02 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3FDF7E557; Sat, 20 Jul 2019 18:22:02 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6KIM2wv021947; Sat, 20 Jul 2019 18:22:02 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6KIM2gI021946; Sat, 20 Jul 2019 18:22:02 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201907201822.x6KIM2gI021946@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 20 Jul 2019 18:22:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350181 - head/sys/powerpc/booke X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/booke X-SVN-Commit-Revision: 350181 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 663368AF1D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jul 2019 18:22:02 -0000 Author: jhibbits Date: Sat Jul 20 18:22:01 2019 New Revision: 350181 URL: https://svnweb.freebsd.org/changeset/base/350181 Log: powerpc/SPE: Enable SPV bit for EFSCFD instruction emulation EFSCFD (floating point single convert from double) emulation requires saving the high word of the register, which uses SPE instructions. Enable the SPE to avoid an SPV Unavailable exception. MFC after: 1 week Modified: head/sys/powerpc/booke/spe.c Modified: head/sys/powerpc/booke/spe.c ============================================================================== --- head/sys/powerpc/booke/spe.c Sat Jul 20 17:42:46 2019 (r350180) +++ head/sys/powerpc/booke/spe.c Sat Jul 20 18:22:01 2019 (r350181) @@ -572,6 +572,7 @@ spe_handle_fpdata(struct trapframe *frame) frame->fixreg[rd] = frame->fixreg[ra] ^ (1U << 31); break; case EFSCFD: + mtmsr(msr | PSL_VEC); spe_explode(&fpemu, &fpemu.fe_f3, DOUBLE, spe_save_reg_high(rb), frame->fixreg[rb]); result = &fpemu.fe_f3; From owner-svn-src-all@freebsd.org Sat Jul 20 18:25:42 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 34C32C425A; Sat, 20 Jul 2019 18:25:42 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F3B818B0EF; Sat, 20 Jul 2019 18:25:41 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CA0CDE697; Sat, 20 Jul 2019 18:25:41 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6KIPf2r022147; Sat, 20 Jul 2019 18:25:41 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6KIPfK0022146; Sat, 20 Jul 2019 18:25:41 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201907201825.x6KIPfK0022146@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 20 Jul 2019 18:25:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350182 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 350182 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F3B818B0EF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jul 2019 18:25:42 -0000 Author: markj Date: Sat Jul 20 18:25:41 2019 New Revision: 350182 URL: https://svnweb.freebsd.org/changeset/base/350182 Log: Rename vm_page_{import,release}() to vm_page_zone_{import,release}(). I would like to use the name vm_page_release() for a different purpose, and vm_page_{import,release}() are local to vm_page.c. Reviewed by: kib MFC after: 1 week Modified: head/sys/vm/vm_page.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Sat Jul 20 18:22:01 2019 (r350181) +++ head/sys/vm/vm_page.c Sat Jul 20 18:25:41 2019 (r350182) @@ -168,9 +168,9 @@ static int vm_page_reclaim_run(int req_class, int doma vm_page_t m_run, vm_paddr_t high); static int vm_domain_alloc_fail(struct vm_domain *vmd, vm_object_t object, int req); -static int vm_page_import(void *arg, void **store, int cnt, int domain, +static int vm_page_zone_import(void *arg, void **store, int cnt, int domain, int flags); -static void vm_page_release(void *arg, void **store, int cnt); +static void vm_page_zone_release(void *arg, void **store, int cnt); SYSINIT(vm_page, SI_SUB_VM, SI_ORDER_SECOND, vm_page_init, NULL); @@ -210,7 +210,7 @@ vm_page_init_cache_zones(void *dummy __unused) pgcache->pool = pool; pgcache->zone = uma_zcache_create("vm pgcache", sizeof(struct vm_page), NULL, NULL, NULL, NULL, - vm_page_import, vm_page_release, pgcache, + vm_page_zone_import, vm_page_zone_release, pgcache, UMA_ZONE_MAXBUCKET | UMA_ZONE_VM); (void)uma_zone_set_maxcache(pgcache->zone, 0); } @@ -2208,7 +2208,7 @@ again: } static int -vm_page_import(void *arg, void **store, int cnt, int domain, int flags) +vm_page_zone_import(void *arg, void **store, int cnt, int domain, int flags) { struct vm_domain *vmd; struct vm_pgcache *pgcache; @@ -2231,7 +2231,7 @@ vm_page_import(void *arg, void **store, int cnt, int d } static void -vm_page_release(void *arg, void **store, int cnt) +vm_page_zone_release(void *arg, void **store, int cnt) { struct vm_domain *vmd; struct vm_pgcache *pgcache; From owner-svn-src-all@freebsd.org Sat Jul 20 19:58:11 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F1344C5BDF; Sat, 20 Jul 2019 19:58:11 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 03D3D8DB7F; Sat, 20 Jul 2019 19:58:03 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 68EB92AD7B4; Sun, 21 Jul 2019 05:57:51 +1000 (AEST) Date: Sun, 21 Jul 2019 05:57:49 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: John Baldwin cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r350179 - head/lib/libutil In-Reply-To: <201907201603.x6KG3san038622@repo.freebsd.org> Message-ID: <20190721042856.E2399@besplex.bde.org> References: <201907201603.x6KG3san038622@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=D+Q3ErZj c=1 sm=1 tr=0 cx=a_idp_d a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=VCHz-q8NbMAeLeODyNQA:9 a=5XS03JLEKE182DUy:21 a=Blnbo46mB81ZVtKh:21 a=CjuIK1q_8ugA:10 X-Rspamd-Queue-Id: 03D3D8DB7F X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of brde@optusnet.com.au designates 211.29.132.249 as permitted sender) smtp.mailfrom=brde@optusnet.com.au X-Spamd-Result: default: False [-5.30 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; RCVD_COUNT_TWO(0.00)[2]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:211.29.132.0/23]; FREEMAIL_FROM(0.00)[optusnet.com.au]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DMARC_NA(0.00)[optusnet.com.au]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; IP_SCORE(-2.03)[ip: (-4.57), ipnet: 211.28.0.0/14(-3.23), asn: 4804(-2.35), country: AU(0.01)]; MX_GOOD(-0.01)[extmail.optusnet.com.au]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; RCVD_NO_TLS_LAST(0.10)[]; RCVD_IN_DNSWL_LOW(-0.10)[249.132.29.211.list.dnswl.org : 127.0.5.1]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[optusnet.com.au]; ASN(0.00)[asn:4804, ipnet:211.28.0.0/14, country:AU]; MIME_TRACE(0.00)[0:+]; FROM_EQ_ENVFROM(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jul 2019 19:58:12 -0000 On Sat, 20 Jul 2019, John Baldwin wrote: > Log: > expand_number(3) parses suffixes, not prefixes. This is not quite correct, although conflating prefixes and suffixes is one of the bugs that I pointed out in mails about [de]humanize_number and expand_number() long ago. Bugs in expand_number() start with its name. It doesn't expand numbers. It parses strings and produces integers with a wrong limited type/range (uint64_t instead of uintmax_t plus sign info). I don't know what it means to expand a number, but this is close to the opposite. expand_number() is not nearly as badly designed as humanize_number(). humanize_number() doesn't humanize numbers. It converts integers with a different wrong limited type/range (int64_t instead of uint64_t plus sign info) to a hideous/dehumanized string format. The humanized format would be decimal decimal. humanize_number() produces a scientific format. humanize_number() still documents SI prefixes, and has a suffix arg which gives the units. Its SI prefixes are prefixes to the suffix. E.g., a prefix of "K" and a suffix of "B" gives units of non-disk-marketers kilobytes. It is only when the suffix is null that the prefix becomes a suffix. Most quantities have units, but it is common to omit the units in the string representation to save space. expand_number() doesn't even support units, except it treats the suffix "B" or "b" as a null unit provided it doesn't have a prefix (e.g., "1B" gives 1, byut "1KB" is a syntax error). strtonum() uses the long long abomination instead of the correct type (uintmax_t with sign info). Its name is better, but uses the precious str* namespace for a badly designed API. I would prefer a strtonum() that is more like expand_number() (not too much error handling) but handles any number of suffixes and multipliers like the number-parsing function in dd. This should be almost as easy to use as atoi(), but have some error handling. E.g., uintmax_t strtonum(const char *nptr, const char *errspec, ...); where simple uses use errspec = NULL to get default error handling similar to expand_number(). errspec would need 3 specifiers to specify the last 3 args in the current strtonum(). > Modified: head/lib/libutil/expand_number.3 > ============================================================================== > --- head/lib/libutil/expand_number.3 Sat Jul 20 15:59:49 2019 (r350178) > +++ head/lib/libutil/expand_number.3 Sat Jul 20 16:03:54 2019 (r350179) > @@ -42,11 +42,10 @@ > .Sh DESCRIPTION > The > .Fn expand_number > -function unformats the > +function parses the Better. The supported formats are still undocumented. Not even that they are integers. They may have leading whitespace and signs, or hex and octal prefixes (anything parseable by strtoumax(), with special treatment of a single optional suffix character). > .Fa buf > -string and stores a unsigned 64-bit quantity at address pointed out by the > -.Fa num > -argument. > +string and stores a unsigned 64-bit quantity at > +.Fa *num . "unsigned 64-bit quantity" is a bad way of spelling of "uint64_t". uint64_t's aren't quantities. > .Pp > The > .Fn expand_number > @@ -54,9 +53,9 @@ function > is case-insensitive and > follows the SI power of two convention. There is no SI power of 2 convention according to Wikipedia. humanize_number() and its bugs must be understood to see what this means. Google gives approximately zero hits for "SI suffix". It automatically translates "SI suffix" to "SI prefix" and of course finds zillions of hits for that. humanize_number(3) says that it "follows the traditional computer science conventions by default, rather than the IEE/IEC (and now also SI) power of two convention...", but according to Wikipedia, IEC 60027-2 Amendment 2 confirms that SI only supports power of 10 prefixes. According to Wikipedia, the power of 2 convention is IEC for kibi through yobi, and JEDEC has the better traditional prefixes and names for K/kilo though G/Giga. k is documented to mean 1000 and K 1024 for humanize_number(), but expand_number() treats both as 1024. The other prefixes can't be disambiguated like this. > .Pp > -The prefixes are: > -.Bl -column "Prefix" "Description" "1000000000000000000" -offset indent > -.It Sy "Prefix" Ta Sy "Description" Ta Sy "Multiplier" > +The suffixes are: > +.Bl -column "Suffix" "Description" "1000000000000000000" -offset indent > +.It Sy "Suffix" Ta Sy "Description" Ta Sy "Multiplier" > .It Li K Ta No kilo Ta 1024 > .It Li M Ta No mega Ta 1048576 > .It Li G Ta No giga Ta 1073741824 > @@ -74,7 +73,7 @@ function will fail if: > .It Bq Er EINVAL > The given string contains no digits. > .It Bq Er EINVAL > -An unrecognized prefix was given. > +An unrecognized suffix was given. > .It Bq Er ERANGE > Result doesn't fit into 64 bits. > .El Bruce From owner-svn-src-all@freebsd.org Sat Jul 20 20:47:09 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 293E6C69FF; Sat, 20 Jul 2019 20:47:09 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 88F008EF69; Sat, 20 Jul 2019 20:47:08 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5F16D1813A; Sat, 20 Jul 2019 20:47:08 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6KKl8GO005422; Sat, 20 Jul 2019 20:47:08 GMT (envelope-from dougm@FreeBSD.org) Received: (from dougm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6KKl8pJ005421; Sat, 20 Jul 2019 20:47:08 GMT (envelope-from dougm@FreeBSD.org) Message-Id: <201907202047.x6KKl8pJ005421@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dougm set sender to dougm@FreeBSD.org using -f From: Doug Moore Date: Sat, 20 Jul 2019 20:47:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350183 - head/sbin/swapon X-SVN-Group: head X-SVN-Commit-Author: dougm X-SVN-Commit-Paths: head/sbin/swapon X-SVN-Commit-Revision: 350183 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 88F008EF69 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.982,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jul 2019 20:47:09 -0000 Author: dougm Date: Sat Jul 20 20:47:07 2019 New Revision: 350183 URL: https://svnweb.freebsd.org/changeset/base/350183 Log: In trimming on startup, invoke swapon before closing the fd used for trimming so that a geli device isn't detached before swapon is invoked. Submitted by: sigsys_gmail.com Discussed with: alc Approved by: markj (mentor) Differential Revision: https://reviews.freebsd.org/D21006 Modified: head/sbin/swapon/swapon.c Modified: head/sbin/swapon/swapon.c ============================================================================== --- head/sbin/swapon/swapon.c Sat Jul 20 18:25:41 2019 (r350182) +++ head/sbin/swapon/swapon.c Sat Jul 20 20:47:07 2019 (r350183) @@ -739,12 +739,12 @@ run_cmd(int *ofd, const char *cmdline, ...) return (WEXITSTATUS(status)); } -static void -swap_trim(const char *name) +static int +swapon_trim(const char *name) { struct stat sb; off_t ioarg[2], sz; - int fd; + int error, fd; fd = open(name, O_WRONLY); if (fd < 0) @@ -762,7 +762,16 @@ swap_trim(const char *name) ioarg[1] = sz; if (ioctl(fd, DIOCGDELETE, ioarg) != 0) warn("ioctl(DIOCGDELETE)"); + + /* + * swapon is invoked after trimming, so that the trimming doesn't happen + * after the device is in use for swapping, but before the fd is closed, + * for the benefit of geli, which could otherwise detach the device, + * before swapon, on close. + */ + error = swapon(name); close(fd); + return (error); } static const char * @@ -770,11 +779,9 @@ swap_on_off_sfile(const char *name, int doingall) { int error; - if (which_prog == SWAPON) { - if (Eflag) - swap_trim(name); - error = swapon(name); - } else /* SWAPOFF */ + if (which_prog == SWAPON) + error = Eflag ? swapon_trim(name) : swapon(name); + else /* SWAPOFF */ error = swapoff(name); if (error == -1) { From owner-svn-src-all@freebsd.org Sat Jul 20 20:56:34 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4EB4EC6D3E; Sat, 20 Jul 2019 20:56:34 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 238048F4BF; Sat, 20 Jul 2019 20:56:34 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C72E418315; Sat, 20 Jul 2019 20:56:33 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6KKuX7D011178; Sat, 20 Jul 2019 20:56:33 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6KKuWsF011171; Sat, 20 Jul 2019 20:56:32 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201907202056.x6KKuWsF011171@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 20 Jul 2019 20:56:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350184 - in head: libexec/rc/rc.d release/picobsd/tinyware/login share/man/man5 usr.bin/login X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head: libexec/rc/rc.d release/picobsd/tinyware/login share/man/man5 usr.bin/login X-SVN-Commit-Revision: 350184 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 238048F4BF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.983,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jul 2019 20:56:34 -0000 Author: cem Date: Sat Jul 20 20:56:31 2019 New Revision: 350184 URL: https://svnweb.freebsd.org/changeset/base/350184 Log: motd: Generate from template to /var/run Update login(1), its manual pages, similar utilities, and motd.5 to refer to the new location. Suggested by: delphij@ (re: r349256) Reviewed by: bcr (manpages), delphij Differential Revision: https://reviews.freebsd.org/D20721 Added: head/usr.bin/login/motd.template - copied, changed from r350183, head/usr.bin/login/motd Deleted: head/usr.bin/login/motd Modified: head/libexec/rc/rc.d/motd head/release/picobsd/tinyware/login/pathnames.h head/share/man/man5/motd.5 head/usr.bin/login/Makefile head/usr.bin/login/login.1 head/usr.bin/login/login.conf head/usr.bin/login/pathnames.h Modified: head/libexec/rc/rc.d/motd ============================================================================== --- head/libexec/rc/rc.d/motd Sat Jul 20 20:47:07 2019 (r350183) +++ head/libexec/rc/rc.d/motd Sat Jul 20 20:56:31 2019 (r350184) @@ -4,48 +4,52 @@ # # PROVIDE: motd -# REQUIRE: mountcritremote +# REQUIRE: mountcritremote FILESYSTEMS # BEFORE: LOGIN . /etc/rc.subr name="motd" -desc="Update /etc/motd" +desc="Update /var/run/motd" rcvar="update_motd" start_cmd="motd_start" stop_cmd=":" +COMPAT_MOTD="/etc/motd" +TARGET="/var/run/motd" +TEMPLATE="/etc/motd.template" PERMS="644" motd_start() { - # Update kernel info in /etc/motd + # Update kernel info in /var/run/motd # Must be done *before* interactive logins are possible # to prevent possible race conditions. # check_startmsgs && echo -n 'Updating motd:' - if [ ! -f /etc/motd ]; then - install -c -o root -g wheel -m ${PERMS} /dev/null /etc/motd + if [ ! -f "${TEMPLATE}" ]; then + # Create missing template from existing regular motd file, if + # one exists. + if [ -f "${COMPAT_MOTD}" ]; then + sed '1{/^FreeBSD.*/{d;};};' "${COMPAT_MOTD}" > "${TEMPLATE}" + chmod $PERMS "${TEMPLATE}" + rm -f "${COMPAT_MOTD}" + else + # Otherwise, create an empty template file. + install -c -o root -g wheel -m ${PERMS} /dev/null "${TEMPLATE}" + fi + # Provide compatibility symlink: + if [ ! -h "${COMPAT_MOTD}" ]; then + ln -sF "${TARGET}" "${COMPAT_MOTD}" + fi fi - if [ ! -w /etc/motd ]; then - echo ' /etc/motd is not writable, update failed.' - return - fi - T=`mktemp -t motd` uname -v | sed -e 's,^\([^#]*\) #\(.* [1-2][0-9][0-9][0-9]\).*/\([^\]*\) $,\1 (\3) #\2,' > ${T} - awk '{if (NR == 1) {if ($1 == "FreeBSD") {next} else {print "\n"$0}} else {print}}' < /etc/motd >> ${T} + cat "${TEMPLATE}" >> ${T} - if ! cmp -s $T /etc/motd; then - mv -f $T /etc/.motd.tmp - fsync /etc/.motd.tmp - mv -f /etc/.motd.tmp /etc/motd - chmod ${PERMS} /etc/motd - fsync /etc - else - rm -f $T - fi + install -C -o root -g wheel -m "${PERMS}" "$T" "${TARGET}" + rm -f "$T" check_startmsgs && echo '.' } Modified: head/release/picobsd/tinyware/login/pathnames.h ============================================================================== --- head/release/picobsd/tinyware/login/pathnames.h Sat Jul 20 20:47:07 2019 (r350183) +++ head/release/picobsd/tinyware/login/pathnames.h Sat Jul 20 20:56:31 2019 (r350184) @@ -39,7 +39,7 @@ #include #define _PATH_HUSHLOGIN ".hushlogin" -#define _PATH_MOTDFILE "/etc/motd" +#define _PATH_MOTDFILE "/var/run/motd" #define _PATH_LOGACCESS "/etc/login.access" #define _PATH_FBTAB "/etc/fbtab" #define _PATH_LOGINDEVPERM "/etc/logindevperm" Modified: head/share/man/man5/motd.5 ============================================================================== --- head/share/man/man5/motd.5 Sat Jul 20 20:47:07 2019 (r350183) +++ head/share/man/man5/motd.5 Sat Jul 20 20:56:31 2019 (r350184) @@ -3,7 +3,7 @@ .\" This file is in the public domain. .\" $FreeBSD$ .\" -.Dd February 13, 1997 +.Dd July 20, 2019 .Dt MOTD 5 .Os .Sh NAME @@ -11,13 +11,16 @@ .Nd file containing message(s) of the day .Sh DESCRIPTION The file -.Pa /etc/motd +.Pa /var/run/motd is normally displayed by .Xr login 1 after a user has logged in but before the shell is run. It is generally used for important system-wide announcements. During system startup, a line containing the kernel version string is -prepended to this file. +prepended to +.Pa /etc/motd.template +and the contents are written to +.Pa /var/run/motd . .Pp Individual users may suppress the display of this file by creating a file named @@ -26,11 +29,13 @@ in their home directories or through .Xr login.conf 5 . .Sh FILES .Bl -tag -width $HOME/.hushlogin -compact -.It Pa /etc/motd +.It Pa /etc/motd.template +The template file that system administrators can edit. +.It Pa /var/run/motd The message of the day. .It Pa $HOME/.hushlogin Suppresses output of -.Pa /etc/motd . +.Pa /var/run/motd . .El .Sh EXAMPLES .Bd -literal @@ -41,3 +46,9 @@ FreeBSD 2.1.6.1-RELEASE (GENERIC) #0: Sun Dec 29 03:08 .Sh SEE ALSO .Xr login 1 , .Xr login.conf 5 +.Sh HISTORY +Prior to +.Fx 13.0 , +.Nm +lived in +.Pa /etc . Modified: head/usr.bin/login/Makefile ============================================================================== --- head/usr.bin/login/Makefile Sat Jul 20 20:47:07 2019 (r350183) +++ head/usr.bin/login/Makefile Sat Jul 20 20:56:31 2019 (r350184) @@ -3,7 +3,7 @@ .include -CONFS= fbtab login.conf motd login.access +CONFS= fbtab login.conf motd.template login.access PROG= login SRCS= login.c login_fbtab.c CFLAGS+=-DLOGALL Modified: head/usr.bin/login/login.1 ============================================================================== --- head/usr.bin/login/login.1 Sat Jul 20 20:47:07 2019 (r350183) +++ head/usr.bin/login/login.1 Sat Jul 20 20:56:31 2019 (r350184) @@ -28,7 +28,7 @@ .\" @(#)login.1 8.2 (Berkeley) 5/5/94 .\" $FreeBSD$ .\" -.Dd September 13, 2006 +.Dd July 20, 2019 .Dt LOGIN 1 .Os .Sh NAME @@ -131,7 +131,7 @@ result in an error exit from changes device protections .It Pa /etc/login.conf login class capabilities database -.It Pa /etc/motd +.It Pa /var/run/motd message-of-the-day .It Pa /var/mail/user system mailboxes Modified: head/usr.bin/login/login.conf ============================================================================== --- head/usr.bin/login/login.conf Sat Jul 20 20:47:07 2019 (r350183) +++ head/usr.bin/login/login.conf Sat Jul 20 20:56:31 2019 (r350184) @@ -25,7 +25,7 @@ default:\ :passwd_format=sha512:\ :copyright=/etc/COPYRIGHT:\ - :welcome=/etc/motd:\ + :welcome=/var/run/motd:\ :setenv=MAIL=/var/mail/$,BLOCKSIZE=K:\ :path=/sbin /bin /usr/sbin /usr/bin /usr/local/sbin /usr/local/bin ~/bin:\ :nologin=/var/run/nologin:\ @@ -120,7 +120,7 @@ russian|Russian Users Accounts:\ ## #standard:\ # :copyright=/etc/COPYRIGHT:\ -# :welcome=/etc/motd:\ +# :welcome=/var/run/motd:\ # :setenv=MAIL=/var/mail/$,BLOCKSIZE=K:\ # :path=~/bin /bin /usr/bin /usr/local/bin:\ # :manpath=/usr/share/man /usr/local/man:\ Copied and modified: head/usr.bin/login/motd.template (from r350183, head/usr.bin/login/motd) ============================================================================== --- head/usr.bin/login/motd Sat Jul 20 20:47:07 2019 (r350183, copy source) +++ head/usr.bin/login/motd.template Sat Jul 20 20:56:31 2019 (r350184) @@ -1,4 +1,3 @@ -FreeBSD ?.?.? (UNKNOWN) Welcome to FreeBSD! @@ -18,4 +17,4 @@ Please include that output and any error messages when Introduction to manual pages: man man FreeBSD directory layout: man hier -Edit /etc/motd to change this login announcement. +Edit /etc/motd.template to change this login announcement. Modified: head/usr.bin/login/pathnames.h ============================================================================== --- head/usr.bin/login/pathnames.h Sat Jul 20 20:47:07 2019 (r350183) +++ head/usr.bin/login/pathnames.h Sat Jul 20 20:56:31 2019 (r350184) @@ -35,6 +35,6 @@ #include #define _PATH_HUSHLOGIN ".hushlogin" -#define _PATH_MOTDFILE "/etc/motd" +#define _PATH_MOTDFILE "/var/run/motd" #define _PATH_FBTAB "/etc/fbtab" #define _PATH_LOGINDEVPERM "/etc/logindevperm" From owner-svn-src-all@freebsd.org Sat Jul 20 21:10:28 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 27315C7395; Sat, 20 Jul 2019 21:10:28 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 089B08FAFF; Sat, 20 Jul 2019 21:10:28 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BEC7C18526; Sat, 20 Jul 2019 21:10:27 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6KLAR4a017351; Sat, 20 Jul 2019 21:10:27 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6KLARvB017350; Sat, 20 Jul 2019 21:10:27 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201907202110.x6KLARvB017350@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 20 Jul 2019 21:10:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350185 - head/sys/dev/iicbus X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/iicbus X-SVN-Commit-Revision: 350185 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 089B08FAFF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.983,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jul 2019 21:10:28 -0000 Author: ian Date: Sat Jul 20 21:10:27 2019 New Revision: 350185 URL: https://svnweb.freebsd.org/changeset/base/350185 Log: Rewrite the nxprtc chip init to extend battery life by using power-saving features offered by the chips. For 2127 and 2129 chips, fix the detection of when chip-init is needed. The chip config needs to be reset whenever power was lost, but the logic was wrong for 212x chips (it only worked for 8523). Now the "oscillator stopped" bit rather than the power manager mode is used to detect startup after powerfail. For all chips, disable the clock output pin. For chips that have a timestamp/tamper-monitor feature, turn off monitoring of the timestamp trigger pin. The 8523, 2127, and 2129 chips have a "power manager" feature that offers several options. We've been using the default mode which enables everything. Now the code sets the power manager options to - direct-switch (when Vdd < Vbat, without extra threshold check) - no battery monitor - no external powerfail monitor This reduces the current draw while running on battery from 1930nA to 880nA, which should roughly double the lifespan of the battery under load. Because battery checking is a nice thing to have, the code now does a check at startup, and then once a day after that, instead of checking continuously (but only actually reporting at startup). The battery check is now done by setting the power manager back to default mode, sleeping briefly while it makes a voltage measurement, then switching back to power-saving mode. Modified: head/sys/dev/iicbus/nxprtc.c Modified: head/sys/dev/iicbus/nxprtc.c ============================================================================== --- head/sys/dev/iicbus/nxprtc.c Sat Jul 20 20:56:31 2019 (r350184) +++ head/sys/dev/iicbus/nxprtc.c Sat Jul 20 21:10:27 2019 (r350185) @@ -106,6 +106,9 @@ __FBSDID("$FreeBSD$"); #define PCF2127_B_TMR_CD 0x40 /* Run in countdown mode */ #define PCF2127_B_TMR_64HZ 0x01 /* Timer frequency 64Hz */ +#define PCF2127_R_TS_CTL 0x12 /* Timestamp control */ +#define PCF2127_B_TSOFF 0x40 /* Turn off timestamp function */ + /* * PCA/PCF2129-specific registers, bits, and masks. */ @@ -134,12 +137,16 @@ __FBSDID("$FreeBSD$"); #define PCF8523_M_CS3_PM 0xE0 /* Power mode mask */ #define PCF8523_B_CS3_PM_NOBAT 0xE0 /* PM bits: no battery usage */ #define PCF8523_B_CS3_PM_STD 0x00 /* PM bits: standard */ +#define PCF8523_B_CS3_PM_DSNBM 0xa0 /* PM bits: direct switch, no bat mon */ #define PCF8523_B_CS3_BLF 0x04 /* Battery Low Flag bit */ /* * PCF8563-specific registers, bits, and masks. */ #define PCF8563_R_SECOND 0x02 /* Seconds */ + +#define PCF8563_R_CLKOUT 0x0d /* Clock output control */ + #define PCF8563_R_TMR_CTRL 0x0e /* Timer control */ #define PCF8563_R_TMR_COUNT 0x0f /* Timer count */ @@ -196,10 +203,12 @@ struct nxprtc_softc { config_hook; u_int flags; /* SC_F_* flags */ u_int chiptype; /* Type of PCF85xx chip */ + time_t bat_time; /* Next time to check battery */ uint8_t secaddr; /* Address of seconds register */ uint8_t tmcaddr; /* Address of timer count register */ bool use_timer; /* Use timer for fractional sec */ bool use_ampm; /* Chip is set to use am/pm mode */ + bool is212x; /* Chip type is 2127 or 2129 */ }; #define SC_F_CPOL (1 << 0) /* Century bit means 19xx */ @@ -347,108 +356,153 @@ write_timeregs(struct nxprtc_softc *sc, struct time_re } static int -pcf8523_start(struct nxprtc_softc *sc) +pcf8523_battery_check(struct nxprtc_softc *sc) { + struct timespec ts; int err; - uint8_t cs1, cs3, clkout; - bool is212x; + uint8_t cs3; - switch (sc->chiptype) { - case TYPE_PCF2127: - case TYPE_PCA2129: - case TYPE_PCF2129: - is212x = true; - break; - default: - is212x = false; - break; - } + /* We check the battery when starting up, and then only once a day. */ + getnanouptime(&ts); + if (ts.tv_sec < sc->bat_time) + return (0); + sc->bat_time = ts.tv_sec + (60 * 60 * 24); - /* Read and sanity-check the control registers. */ - if ((err = read_reg(sc, PCF85xx_R_CS1, &cs1)) != 0) { - device_printf(sc->dev, "cannot read RTC CS1 control\n"); + /* + * The 8523, 2127, and 2129 chips have a "power manager" which includes + * an optional battery voltage monitor and several choices for power + * switching modes. The battery monitor uses a lot of current and it + * remains active when running from battery, making it the "drain my + * battery twice as fast" mode. So, we run the chip in direct-switching + * mode with the battery monitor disabled, reducing the current draw + * when running on battery from 1930nA to 880nA. While it's not clear + * from the datasheets, empirical testing shows that both disabling the + * battery monitor and using direct-switch mode are required to get the + * full power savings. + * + * There isn't any need to continuously monitor the battery voltage, so + * this function is used to periodically enable the monitor, check the + * voltage, then return to the low-power monitor-disabled mode. + */ + err = write_reg(sc, PCF8523_R_CS3, PCF8523_B_CS3_PM_STD); + if (err != 0) { + device_printf(sc->dev, "cannot write CS3 reg\n"); return (err); } + pause_sbt("nxpbat", mstosbt(10), 0, 0); if ((err = read_reg(sc, PCF8523_R_CS3, &cs3)) != 0) { - device_printf(sc->dev, "cannot read RTC CS3 control\n"); + device_printf(sc->dev, "cannot read CS3 reg\n"); return (err); } + err = write_reg(sc, PCF8523_R_CS3, PCF8523_B_CS3_PM_DSNBM); + if (err != 0) { + device_printf(sc->dev, "cannot write CS3 reg\n"); + return (err); + } + if (cs3 & PCF8523_B_CS3_BLF) + device_printf(sc->dev, "WARNING: RTC battery is low\n"); + + return (0); +} + +static int +pcf8523_start(struct nxprtc_softc *sc) +{ + struct csr { + uint8_t cs1; + uint8_t cs2; + uint8_t cs3; + uint8_t sec; + } csr; + int err; + uint8_t clkout; + + /* Read the control and status registers. */ + if ((err = nxprtc_readfrom(sc->dev, PCF85xx_R_CS1, &csr, + sizeof(csr), WAITFLAGS)) != 0){ + device_printf(sc->dev, "cannot read RTC control regs\n"); + return (err); + } + /* - * Do a full init (soft-reset) if... - * - The chip is in battery-disable mode (fresh from the factory). + * Do a full init if... + * - The chip power manager is in battery-disable mode. + * - The OS (oscillator stopped) bit is set (all power was lost). * - The clock-increment STOP flag is set (this is just insane). - * After reset, battery disable mode has to be overridden to "standard" - * mode. Also, turn off clock output to save battery power. */ - if ((cs3 & PCF8523_M_CS3_PM) == PCF8523_B_CS3_PM_NOBAT || - (cs1 & PCF85xx_B_CS1_STOP)) { - cs1 = PCF8523_B_CS1_SOFTRESET; - if ((err = write_reg(sc, PCF85xx_R_CS1, cs1)) != 0) { - device_printf(sc->dev, "cannot write CS1 control\n"); - return (err); - } - cs3 = PCF8523_B_CS3_PM_STD; - if ((err = write_reg(sc, PCF8523_R_CS3, cs3)) != 0) { - device_printf(sc->dev, "cannot write CS3 control\n"); - return (err); - } + if ((csr.cs3 & PCF8523_M_CS3_PM) == PCF8523_B_CS3_PM_NOBAT || + (csr.cs1 & PCF85xx_B_CS1_STOP) || (csr.sec & PCF85xx_B_SECOND_OS)) { + device_printf(sc->dev, + "WARNING: RTC battery failed; time is invalid\n"); + /* - * For 2129 series, trigger OTP refresh by forcing the OTPR bit - * to zero then back to 1, then wait 100ms for the refresh, and - * finally set the bit back to zero with the COF_HIGHZ write. + * For 212x series... + * - Turn off the POR-Override bit (used for mfg test only), + * by writing zero to cs 1 (all other bits power on as zero). + * - Turn off the timestamp option to save the power used to + * monitor that input pin. + * - Trigger OTP refresh by forcing the OTPR bit to zero then + * back to 1, then wait 100ms for the refresh. */ - if (is212x) { - clkout = PCF2129_B_CLKOUT_HIGHZ; - if ((err = write_reg(sc, PCF8523_R_TMR_CLKOUT, - clkout)) != 0) { + if (sc->is212x) { + err = write_reg(sc, PCF85xx_R_CS1, 0); + if (err != 0) { device_printf(sc->dev, - "cannot write CLKOUT control\n"); + "cannot write CS1 reg\n"); return (err); } - if ((err = write_reg(sc, PCF8523_R_TMR_CLKOUT, - clkout | PCF2129_B_CLKOUT_OTPR)) != 0) { + + err = write_reg(sc, PCF2127_R_TS_CTL, PCF2127_B_TSOFF); + if (err != 0) { device_printf(sc->dev, + "cannot write timestamp control\n"); + return (err); + } + + clkout = PCF2129_B_CLKOUT_HIGHZ; + err = write_reg(sc, PCF8523_R_TMR_CLKOUT, clkout); + if (err == 0) + err = write_reg(sc, PCF8523_R_TMR_CLKOUT, + clkout | PCF2129_B_CLKOUT_OTPR); + if (err != 0) { + device_printf(sc->dev, "cannot write CLKOUT control\n"); return (err); } pause_sbt("nxpotp", mstosbt(100), mstosbt(10), 0); } else clkout = PCF8523_B_CLKOUT_HIGHZ; + + /* All chips: set clock output pin to high-z to save power */ if ((err = write_reg(sc, PCF8523_R_TMR_CLKOUT, clkout)) != 0) { device_printf(sc->dev, "cannot write CLKOUT control\n"); return (err); } - device_printf(sc->dev, - "first time startup, enabled RTC battery operation\n"); - - /* - * Sleep briefly so the battery monitor can make a measurement, - * then re-read CS3 so battery-low status can be reported below. - */ - pause_sbt("nxpbat", mstosbt(100), 0, 0); - if ((err = read_reg(sc, PCF8523_R_CS3, &cs3)) != 0) { - device_printf(sc->dev, "cannot read RTC CS3 control\n"); - return (err); - } } - /* Let someone know if the battery is weak. */ - if (cs3 & PCF8523_B_CS3_BLF) - device_printf(sc->dev, "WARNING: RTC battery is low\n"); + /* + * Check the battery voltage and report if it's low. This also has the + * side effect of (re-)initializing the power manager to low-power mode + * when we come up after a power fail. + */ + pcf8523_battery_check(sc); - /* Remember whether we're running in AM/PM mode. */ - if (is212x) { - if (cs1 & PCF2129_B_CS1_12HR) + /* + * Remember whether we're running in AM/PM mode. The chip default is + * 24-hour mode, but if we're co-existing with some other OS that + * prefers AM/PM we can run that way too. + */ + if (sc->is212x) { + if (csr.cs1 & PCF2129_B_CS1_12HR) sc->use_ampm = true; } else { - if (cs1 & PCF8523_B_CS1_12HR) + if (csr.cs1 & PCF8523_B_CS1_12HR) sc->use_ampm = true; } return (0); } - static int pcf8523_start_timer(struct nxprtc_softc *sc) { @@ -509,6 +563,52 @@ pcf2127_start_timer(struct nxprtc_softc *sc) } static int +pcf8563_start(struct nxprtc_softc *sc) +{ + struct csr { + uint8_t cs1; + uint8_t cs2; + uint8_t sec; + } csr; + int err; + + /* Read the control and status registers. */ + if ((err = nxprtc_readfrom(sc->dev, PCF85xx_R_CS1, &csr, + sizeof(csr), WAITFLAGS)) != 0){ + device_printf(sc->dev, "cannot read RTC control regs\n"); + return (err); + } + + /* + * Do a full init if... + * - The OS (oscillator stopped) bit is set (all power was lost). This + * bit is called VL (Voltage Low) in the 8563 datasheet. + * - The clock-increment STOP flag is set (this is just insane). + */ + if ((csr.cs1 & PCF85xx_B_CS1_STOP) || (csr.sec & PCF85xx_B_SECOND_OS)) { + device_printf(sc->dev, + "WARNING: RTC battery failed; time is invalid\n"); + /* + * - Turn off the POR-Override bit (used for mfg test only), by + * writing zero to cs 1 (all other bits power on as zero). + * - Turn off the clock output pin (to save battery power), by + * writing zero to the clkout control reg. + */ + if ((err = write_reg(sc, PCF85xx_R_CS1, 0)) != 0) { + device_printf(sc->dev, "cannot write CS1 reg\n"); + return (err); + } + + if ((err = write_reg(sc, PCF8563_R_CLKOUT, 0)) != 0) { + device_printf(sc->dev, "cannot write CS1 reg\n"); + return (err); + } + } + + return (0); +} + +static int pcf8563_start_timer(struct nxprtc_softc *sc) { int err; @@ -534,7 +634,6 @@ nxprtc_start(void *dev) { struct nxprtc_softc *sc; int clockflags, resolution; - uint8_t sec; sc = device_get_softc((device_t)dev); config_intrhook_disestablish(&sc->config_hook); @@ -544,6 +643,7 @@ nxprtc_start(void *dev) case TYPE_PCA2129: case TYPE_PCF2129: case TYPE_PCF2127: + sc->is212x = true; if (pcf8523_start(sc) != 0) return; if (pcf2127_start_timer(sc) != 0) { @@ -561,6 +661,8 @@ nxprtc_start(void *dev) break; case TYPE_PCA8565: case TYPE_PCF8563: + if (pcf8563_start(sc) != 0) + return; if (pcf8563_start_timer(sc) != 0) { device_printf(sc->dev, "cannot set up timer\n"); return; @@ -572,19 +674,6 @@ nxprtc_start(void *dev) } /* - * Common init. Read the seconds register so we can check the - * oscillator-stopped status bit in it. - */ - if (read_reg(sc, sc->secaddr, &sec) != 0) { - device_printf(sc->dev, "cannot read RTC seconds\n"); - return; - } - if ((sec & PCF85xx_B_SECOND_OS) != 0) { - device_printf(sc->dev, - "WARNING: RTC battery failed; time is invalid\n"); - } - - /* * Everything looks good if we make it to here; register as an RTC. If * we're using the timer to count fractional seconds, our resolution is * 1e6/64, about 15.6ms. Without the timer we still align the RTC clock @@ -731,6 +820,12 @@ nxprtc_settime(device_t dev, struct timespec *ts) cs1 &= ~PCF85xx_B_CS1_STOP; err = write_reg(sc, PCF85xx_R_CS1, cs1); + + /* + * Check for battery-low. The actual check is throttled to only occur + * once a day, mostly to avoid spamming the user with frequent warnings. + */ + pcf8523_battery_check(sc); errout: From owner-svn-src-all@freebsd.org Sat Jul 20 21:20:40 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E11B2C76AB; Sat, 20 Jul 2019 21:20:40 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C3DDC9000B; Sat, 20 Jul 2019 21:20:40 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9FB2F1871B; Sat, 20 Jul 2019 21:20:40 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6KLKe3p023500; Sat, 20 Jul 2019 21:20:40 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6KLKe02023499; Sat, 20 Jul 2019 21:20:40 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201907202120.x6KLKe02023499@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Sat, 20 Jul 2019 21:20:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350186 - head/sbin/fsck_ffs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/sbin/fsck_ffs X-SVN-Commit-Revision: 350186 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C3DDC9000B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jul 2019 21:20:40 -0000 Author: mckusick Date: Sat Jul 20 21:20:40 2019 New Revision: 350186 URL: https://svnweb.freebsd.org/changeset/base/350186 Log: When running with journaled soft updates, some updated inodes were not having their check hashes recomputed which resulted in spurious inode check-hash errors when the system came back up after a crash. Reported by: Alan Somers Sponsored by: Netflix Modified: head/sbin/fsck_ffs/suj.c Modified: head/sbin/fsck_ffs/suj.c ============================================================================== --- head/sbin/fsck_ffs/suj.c Sat Jul 20 21:10:27 2019 (r350185) +++ head/sbin/fsck_ffs/suj.c Sat Jul 20 21:20:40 2019 (r350186) @@ -431,17 +431,28 @@ ino_dirty(ino_t ino) struct iblkhd *hd; struct suj_cg *sc; ufs2_daddr_t blk; + int off; blk = ino_to_fsba(fs, ino); sc = cg_lookup(ino_to_cg(fs, ino)); iblk = sc->sc_lastiblk; if (iblk && iblk->ib_blk == blk) { + if (fs->fs_magic == FS_UFS2_MAGIC) { + off = ino_to_fsbo(fs, ino); + ffs_update_dinode_ckhash(fs, + &((struct ufs2_dinode *)iblk->ib_buf)[off]); + } iblk->ib_dirty = 1; return; } hd = &sc->sc_iblkhash[SUJ_HASH(fragstoblks(fs, blk))]; LIST_FOREACH(iblk, hd, ib_next) { if (iblk->ib_blk == blk) { + if (fs->fs_magic == FS_UFS2_MAGIC) { + off = ino_to_fsbo(fs, ino); + ffs_update_dinode_ckhash(fs, + &((struct ufs2_dinode *)iblk->ib_buf)[off]); + } iblk->ib_dirty = 1; return; } From owner-svn-src-all@freebsd.org Sat Jul 20 21:39:32 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EC17AC7D69; Sat, 20 Jul 2019 21:39:32 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C727E9096E; Sat, 20 Jul 2019 21:39:32 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 978D218AD9; Sat, 20 Jul 2019 21:39:32 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6KLdWue034966; Sat, 20 Jul 2019 21:39:32 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6KLdWTY034965; Sat, 20 Jul 2019 21:39:32 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201907202139.x6KLdWTY034965@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Sat, 20 Jul 2019 21:39:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350187 - head/sbin/fsck_ffs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/sbin/fsck_ffs X-SVN-Commit-Revision: 350187 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C727E9096E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jul 2019 21:39:33 -0000 Author: mckusick Date: Sat Jul 20 21:39:32 2019 New Revision: 350187 URL: https://svnweb.freebsd.org/changeset/base/350187 Log: Treat any inode with bad content as unknown (i.e., ask if it should be cleared). Sponsored by: Netflix Modified: head/sbin/fsck_ffs/pass1.c Modified: head/sbin/fsck_ffs/pass1.c ============================================================================== --- head/sbin/fsck_ffs/pass1.c Sat Jul 20 21:20:40 2019 (r350186) +++ head/sbin/fsck_ffs/pass1.c Sat Jul 20 21:39:32 2019 (r350187) @@ -251,7 +251,7 @@ checkinode(ino_t inumber, struct inodesc *idesc, int r int j, ret, offset; if ((dp = getnextinode(inumber, rebuildcg)) == NULL) - return (0); + goto unknown; mode = DIP(dp, di_mode) & IFMT; if (mode == 0) { if ((sblock.fs_magic == FS_UFS1_MAGIC &&